import{SDK_VERSION as e,_getProvider as t,_registerComponent as n,registerVersion as r,getApp as i}from"https://www.gstatic.com/firebasejs/9.23.0/firebase-app.js";var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>2,d=(3&i)<<4|s>>4;let l=(15&s)<<2|u>>6,h=63&u;a||(h=64,o||(l=64)),r.push(n[c],n[d],n[l],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(function(e){const t=[];let n=0;for(let r=0;r>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t}(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{const o=e[n++],s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t>4;if(r.push(u),64!==s){const e=o<<4&240|s>>2;if(r.push(e),64!==a){const e=s<<6&192|a;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class f extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}function p(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}class v extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,v.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,m.prototype.create)}}class m{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],o=i?function(e,t){return e.replace(g,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",s=`${this.serviceName}: ${o} (${r}).`;return new v(r,s,n)}}const g=/\{\$([^}]+)}/g;function _(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],o=t[i];if(I(n)&&I(o)){if(!_(n,o))return!1}else if(n!==o)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function I(e){return null!==e&&"object"==typeof e}function y(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach((e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function T(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}})),t}function b(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class E{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=A),void 0===r.error&&(r.error=A),void 0===r.complete&&(r.complete=A);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}})),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function A(){}function w(e){return e&&e._delegate?e._delegate:e}class k{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}var R;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(R||(R={}));const N={debug:R.DEBUG,verbose:R.VERBOSE,info:R.INFO,warn:R.WARN,error:R.ERROR,silent:R.SILENT},S=R.INFO,O={[R.DEBUG]:"log",[R.VERBOSE]:"log",[R.INFO]:"info",[R.WARN]:"warn",[R.ERROR]:"error"},C=(e,t,...n)=>{if(t3)throw r;return this.db&&(this.db.close(),this.db=void 0),[3,6];case 6:return[3,1];case 7:return[2]}}))}))},e.prototype.initializeServiceWorkerMessaging=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){return[2,V()?this.initializeReceiver():this.initializeSender()]}))}))},e.prototype.initializeReceiver=function(){return c(this,void 0,void 0,(function(){var e=this;return d(this,(function(t){return this.receiver=D._getInstance(V()?self:null),this.receiver._subscribe("keyChanged",(function(t,n){return c(e,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this._poll()];case 1:return[2,{keyProcessed:e.sent().includes(n.key)}]}}))}))})),this.receiver._subscribe("ping",(function(t,n){return c(e,void 0,void 0,(function(){return d(this,(function(e){return[2,["keyChanged"]]}))}))})),[2]}))}))},e.prototype.initializeSender=function(){var e,t;return c(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=this,[4,F()];case 1:return n.activeServiceWorker=i.sent(),this.activeServiceWorker?(this.sender=new U(this.activeServiceWorker),[4,this.sender._send("ping",{},800)]):[2];case 2:return(r=i.sent())?((null===(e=r[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=r[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0),[2]):[2]}}))}))},e.prototype.notifyServiceWorker=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:if(!this.sender||!this.activeServiceWorker||function(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}()!==this.activeServiceWorker)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)];case 2:case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},e.prototype._isAvailable=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),indexedDB?[4,B()]:[2,!1];case 1:return[4,W(e=t.sent(),"__sak","1")];case 2:return t.sent(),[4,G(e,"__sak")];case 3:return t.sent(),[2,!0];case 4:return t.sent(),[3,5];case 5:return[2,!1]}}))}))},e.prototype._withPendingWrite=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:this.pendingWrites++,t.label=1;case 1:return t.trys.push([1,,3,4]),[4,e()];case 2:return t.sent(),[3,4];case 3:return this.pendingWrites--,[7];case 4:return[2]}}))}))},e.prototype._set=function(e,t){return c(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){return[2,this._withPendingWrite((function(){return c(n,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,this._withRetries((function(n){return W(n,e,t)}))];case 1:return n.sent(),this.localCache[e]=t,[2,this.notifyServiceWorker(e)]}}))}))}))]}))}))},e.prototype._get=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,this._withRetries((function(t){return function(e,t){return c(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=j(e,!1).get(t),[4,new x(n).toPromise()];case 1:return[2,void 0===(r=i.sent())?null:r.value]}}))}))}(t,e)}))];case 1:return t=n.sent(),this.localCache[e]=t,[2,t]}}))}))},e.prototype._remove=function(e){return c(this,void 0,void 0,(function(){var t=this;return d(this,(function(n){return[2,this._withPendingWrite((function(){return c(t,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return[4,this._withRetries((function(t){return G(t,e)}))];case 1:return t.sent(),delete this.localCache[e],[2,this.notifyServiceWorker(e)]}}))}))}))]}))}))},e.prototype._poll=function(){return c(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return[4,this._withRetries((function(e){var t=j(e,!1).getAll();return new x(t).toPromise()}))];case 1:if(!(e=d.sent()))return[2,[]];if(0!==this.pendingWrites)return[2,[]];for(t=[],n=new Set,r=0,i=e;re,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())||"object"==typeof navigator&&"ReactNative"===navigator.product}return e.prototype.get=function(){return he()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)},e}();function pe(e,t){ue(e.emulator,"Emulator should always be set here");var n=e.emulator.url;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n}var ve,me=function(){function e(){}return e.initialize=function(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)},e.fetch=function(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void ae("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")},e.headers=function(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:void ae("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")},e.response=function(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:void ae("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")},e}(),ge=((ve={}).CREDENTIAL_MISMATCH="custom-token-mismatch",ve.MISSING_CUSTOM_TOKEN="internal-error",ve.INVALID_IDENTIFIER="invalid-email",ve.MISSING_CONTINUE_URI="internal-error",ve.INVALID_PASSWORD="wrong-password",ve.MISSING_PASSWORD="missing-password",ve.EMAIL_EXISTS="email-already-in-use",ve.PASSWORD_LOGIN_DISABLED="operation-not-allowed",ve.INVALID_IDP_RESPONSE="invalid-credential",ve.INVALID_PENDING_TOKEN="invalid-credential",ve.FEDERATED_USER_ID_ALREADY_LINKED="credential-already-in-use",ve.MISSING_REQ_TYPE="internal-error",ve.EMAIL_NOT_FOUND="user-not-found",ve.RESET_PASSWORD_EXCEED_LIMIT="too-many-requests",ve.EXPIRED_OOB_CODE="expired-action-code",ve.INVALID_OOB_CODE="invalid-action-code",ve.MISSING_OOB_CODE="internal-error",ve.CREDENTIAL_TOO_OLD_LOGIN_AGAIN="requires-recent-login",ve.INVALID_ID_TOKEN="invalid-user-token",ve.TOKEN_EXPIRED="user-token-expired",ve.USER_NOT_FOUND="user-token-expired",ve.TOO_MANY_ATTEMPTS_TRY_LATER="too-many-requests",ve.INVALID_CODE="invalid-verification-code",ve.INVALID_SESSION_INFO="invalid-verification-id",ve.INVALID_TEMPORARY_PROOF="invalid-credential",ve.MISSING_SESSION_INFO="missing-verification-id",ve.SESSION_EXPIRED="code-expired",ve.MISSING_ANDROID_PACKAGE_NAME="missing-android-pkg-name",ve.UNAUTHORIZED_DOMAIN="unauthorized-continue-uri",ve.INVALID_OAUTH_CLIENT_ID="invalid-oauth-client-id",ve.ADMIN_ONLY_OPERATION="admin-restricted-operation",ve.INVALID_MFA_PENDING_CREDENTIAL="invalid-multi-factor-session",ve.MFA_ENROLLMENT_NOT_FOUND="multi-factor-info-not-found",ve.MISSING_MFA_ENROLLMENT_ID="missing-multi-factor-info",ve.MISSING_MFA_PENDING_CREDENTIAL="missing-multi-factor-session",ve.SECOND_FACTOR_EXISTS="second-factor-already-in-use",ve.SECOND_FACTOR_LIMIT_EXCEEDED="maximum-second-factor-count-exceeded",ve.BLOCKING_FUNCTION_ERROR_RESPONSE="internal-error",ve.RECAPTCHA_NOT_ENABLED="recaptcha-not-enabled",ve.MISSING_RECAPTCHA_TOKEN="missing-recaptcha-token",ve.INVALID_RECAPTCHA_TOKEN="invalid-recaptcha-token",ve.INVALID_RECAPTCHA_ACTION="invalid-recaptcha-action",ve.MISSING_CLIENT_TYPE="missing-client-type",ve.MISSING_RECAPTCHA_VERSION="missing-recaptcha-version",ve.INVALID_RECAPTCHA_VERSION="invalid-recaptcha-version",ve.INVALID_REQ_TYPE="invalid-req-type",ve),_e=new fe(3e4,6e4);function Ie(e,t){return e.tenantId&&!t.tenantId?a(a({},t),{tenantId:e.tenantId}):t}function ye(e,t,n,r,i){return void 0===i&&(i={}),c(this,void 0,void 0,(function(){var o=this;return d(this,(function(s){return[2,Te(e,i,(function(){return c(o,void 0,void 0,(function(){var i,o,s,u;return d(this,(function(c){switch(c.label){case 0:return i={},o={},r&&("GET"===t?o=r:i={body:JSON.stringify(r)}),s=y(a({key:e.config.apiKey},o)).slice(1),[4,e._getAdditionalHeaders()];case 1:return(u=c.sent())["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),[2,me.fetch()(Ee(e,e.config.apiHost,n,s),a({method:t,headers:u,referrerPolicy:"no-referrer"},i))]}}))}))}))]}))}))}function Te(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o,s,u,c,l,h,f,p;return d(this,(function(d){switch(d.label){case 0:e._canInitEmulator=!1,r=a(a({},ge),t),d.label=1;case 1:return d.trys.push([1,4,,5]),i=new Ae(e),[4,Promise.race([n(),i.promise])];case 2:return o=d.sent(),i.clearNetworkTimeout(),[4,o.json()];case 3:if("needConfirmation"in(s=d.sent()))throw we(e,"account-exists-with-different-credential",s);if(o.ok&&!("errorMessage"in s))return[2,s];if(u=o.ok?s.errorMessage:s.error.message,c=u.split(" : "),l=c[0],h=c[1],"FEDERATED_USER_ID_ALREADY_LINKED"===l)throw we(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===l)throw we(e,"email-already-in-use",s);if("USER_DISABLED"===l)throw we(e,"user-disabled",s);if(f=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-"),h)throw re(e,f,h);return te(e,f),[3,5];case 4:if((p=d.sent())instanceof v)throw p;return te(e,"network-request-failed",{message:String(p)}),[3,5];case 5:return[2]}}))}))}function be(e,t,n,r,i){return void 0===i&&(i={}),c(this,void 0,void 0,(function(){var o;return d(this,(function(s){switch(s.label){case 0:return[4,ye(e,t,n,r,i)];case 1:return"mfaPendingCredential"in(o=s.sent())&&te(e,"multi-factor-auth-required",{_serverResponse:o}),[2,o]}}))}))}function Ee(e,t,n,r){var i="".concat(t).concat(n,"?").concat(r);return e.config.emulator?pe(e.config,i):"".concat(e.config.apiScheme,"://").concat(i)}var Ae=function(){function e(e){var t=this;this.auth=e,this.timer=null,this.promise=new Promise((function(e,n){t.timer=setTimeout((function(){return n(ne(t.auth,"network-request-failed"))}),_e.get())}))}return e.prototype.clearNetworkTimeout=function(){clearTimeout(this.timer)},e}();function we(e,t,n){var r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);var i=ne(e,t,r);return i.customData._tokenResponse=n,i}function ke(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:delete",t)]}))}))}function Re(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:update",t)]}))}))}function Ne(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:lookup",t)]}))}))}function Se(e){if(e)try{var t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function Oe(e,t){return void 0===t&&(t=!1),w(e).getIdToken(t)}function Ce(e,t){return void 0===t&&(t=!1),c(this,void 0,void 0,(function(){var n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return[4,(n=w(e)).getIdToken(t)];case 1:return r=a.sent(),se((i=De(r))&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error"),o="object"==typeof i.firebase?i.firebase:void 0,s=null==o?void 0:o.sign_in_provider,[2,{claims:i,token:r,authTime:Se(Pe(i.auth_time)),issuedAtTime:Se(Pe(i.iat)),expirationTime:Se(Pe(i.exp)),signInProvider:s||null,signInSecondFactor:(null==o?void 0:o.sign_in_second_factor)||null}]}}))}))}function Pe(e){return 1e3*Number(e)}function De(e){var t=e.split("."),n=t[0],r=t[1],i=t[2];if(void 0===n||void 0===r||void 0===i)return ee("JWT malformed, contained fewer than 3 sections"),null;try{var o=function(e){try{return h.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}(r);return o?JSON.parse(o):(ee("Failed to decode base64 JWT payload"),null)}catch(e){return ee("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}function Le(e,t,n){return void 0===n&&(n=!1),c(this,void 0,void 0,(function(){var r;return d(this,(function(i){switch(i.label){case 0:if(n)return[2,t];i.label=1;case 1:return i.trys.push([1,3,,6]),[4,t];case 2:return[2,i.sent()];case 3:return(r=i.sent())instanceof v&&function(e){var t=e.code;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}(r)?e.auth.currentUser!==e?[3,5]:[4,e.auth.signOut()]:[3,5];case 4:i.sent(),i.label=5;case 5:throw r;case 6:return[2]}}))}))}var Ue=function(){function e(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}return e.prototype._start=function(){this.isRunning||(this.isRunning=!0,this.schedule())},e.prototype._stop=function(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))},e.prototype.getInterval=function(e){var t;if(e){var n=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),n}this.errorBackoff=3e4;n=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,n)},e.prototype.schedule=function(e){var t=this;if(void 0===e&&(e=!1),this.isRunning){var n=this.getInterval(e);this.timerId=setTimeout((function(){return c(t,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this.iteration()];case 1:return e.sent(),[2]}}))}))}),n)}},e.prototype.iteration=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.user.getIdToken(!0)];case 1:return t.sent(),[3,3];case 2:return(null==(e=t.sent())?void 0:e.code)==="auth/".concat("network-request-failed")&&this.schedule(!0),[2];case 3:return this.schedule(),[2]}}))}))},e}(),Me=function(){function e(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}return e.prototype._initializeTime=function(){this.lastSignInTime=Se(this.lastLoginAt),this.creationTime=Se(this.createdAt)},e.prototype._copy=function(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()},e.prototype.toJSON=function(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}},e}();function Ve(e){var t;return c(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,h,f,p;return d(this,(function(d){switch(d.label){case 0:return n=e.auth,[4,e.getIdToken()];case 1:return r=d.sent(),[4,Le(e,Ne(n,{idToken:r}))];case 2:return se(null==(i=d.sent())?void 0:i.users.length,n,"internal-error"),o=i.users[0],e._notifyReloadListener(o),s=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?o.providerUserInfo.map((function(e){var t=e.providerId,n=u(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[],v=e.providerData,m=s,a=l(l([],v.filter((function(e){return!m.some((function(t){return t.providerId===e.providerId}))})),!0),m,!0),c=e.isAnonymous,h=!(e.email&&o.passwordHash||(null==a?void 0:a.length)),f=!!c&&h,p={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new Me(o.createdAt,o.lastLoginAt),isAnonymous:f},Object.assign(e,p),[2]}var v,m}))}))}function Fe(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,Ve(t=w(e))];case 1:return n.sent(),[4,t.auth._persistUserIfCurrent(t)];case 2:return n.sent(),t.auth._notifyListenersIfCurrent(t),[2]}}))}))}function He(e,t){return c(this,void 0,void 0,(function(){var n,r=this;return d(this,(function(i){switch(i.label){case 0:return[4,Te(e,{},(function(){return c(r,void 0,void 0,(function(){var n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return n=y({grant_type:"refresh_token",refresh_token:t}).slice(1),r=e.config,i=r.tokenApiHost,o=r.apiKey,s=Ee(e,i,"/v1/token","key=".concat(o)),[4,e._getAdditionalHeaders()];case 1:return(a=u.sent())["Content-Type"]="application/x-www-form-urlencoded",[2,me.fetch()(s,{method:"POST",headers:a,body:n})]}}))}))}))];case 1:return[2,{accessToken:(n=i.sent()).access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}]}}))}))}var xe=function(){function e(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}return Object.defineProperty(e.prototype,"isExpired",{get:function(){return!this.expirationTime||Date.now()>this.expirationTime-3e4},enumerable:!1,configurable:!0}),e.prototype.updateFromServerResponse=function(e){se(e.idToken,"internal-error"),se(void 0!==e.idToken,"internal-error"),se(void 0!==e.refreshToken,"internal-error");var t,n,r="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):(t=e.idToken,se(n=De(t),"internal-error"),se(void 0!==n.exp,"internal-error"),se(void 0!==n.iat,"internal-error"),Number(n.exp)-Number(n.iat));this.updateTokensAndExpiration(e.idToken,e.refreshToken,r)},e.prototype.getToken=function(e,t){return void 0===t&&(t=!1),c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return se(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired?this.refreshToken?[4,this.refresh(e,this.refreshToken)]:[3,2]:[2,this.accessToken];case 1:return n.sent(),[2,this.accessToken];case 2:return[2,null]}}))}))},e.prototype.clearRefreshToken=function(){this.refreshToken=null},e.prototype.refresh=function(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return[4,He(e,t)];case 1:return n=s.sent(),r=n.accessToken,i=n.refreshToken,o=n.expiresIn,this.updateTokensAndExpiration(r,i,Number(o)),[2]}}))}))},e.prototype.updateTokensAndExpiration=function(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n},e.fromJSON=function(t,n){var r=n.refreshToken,i=n.accessToken,o=n.expirationTime,s=new e;return r&&(se("string"==typeof r,"internal-error",{appName:t}),s.refreshToken=r),i&&(se("string"==typeof i,"internal-error",{appName:t}),s.accessToken=i),o&&(se("number"==typeof o,"internal-error",{appName:t}),s.expirationTime=o),s},e.prototype.toJSON=function(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}},e.prototype._assign=function(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime},e.prototype._clone=function(){return Object.assign(new e,this.toJSON())},e.prototype._performRefresh=function(){return ae("not implemented")},e}();function je(e,t){se("string"==typeof e||void 0===e,"internal-error",{appName:t})}var qe=function(){function e(e){var t=e.uid,n=e.auth,r=e.stsTokenManager,i=u(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Ue(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?l([],i.providerData,!0):[],this.metadata=new Me(i.createdAt||void 0,i.lastLoginAt||void 0)}return e.prototype.getIdToken=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,Le(this,this.stsTokenManager.getToken(this.auth,e))];case 1:return se(t=n.sent(),this.auth,"internal-error"),this.accessToken===t?[3,3]:(this.accessToken=t,[4,this.auth._persistUserIfCurrent(this)]);case 2:n.sent(),this.auth._notifyListenersIfCurrent(this),n.label=3;case 3:return[2,t]}}))}))},e.prototype.getIdTokenResult=function(e){return Ce(this,e)},e.prototype.reload=function(){return Fe(this)},e.prototype._assign=function(e){this!==e&&(se(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map((function(e){return a({},e)})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))},e.prototype._clone=function(t){var n=new e(a(a({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n},e.prototype._onReload=function(e){se(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)},e.prototype._notifyReloadListener=function(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e},e.prototype._startProactiveRefresh=function(){this.proactiveRefresh._start()},e.prototype._stopProactiveRefresh=function(){this.proactiveRefresh._stop()},e.prototype._updateTokensIfNecessary=function(e,t){return void 0===t&&(t=!1),c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return n=!1,e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t?[4,Ve(this)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[4,this.auth._persistUserIfCurrent(this)];case 3:return r.sent(),n&&this.auth._notifyListenersIfCurrent(this),[2]}}))}))},e.prototype.delete=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return[4,this.getIdToken()];case 1:return e=t.sent(),[4,Le(this,ke(this.auth,{idToken:e}))];case 2:return t.sent(),this.stsTokenManager.clearRefreshToken(),[2,this.auth.signOut()]}}))}))},e.prototype.toJSON=function(){return a(a({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((function(e){return a({},e)})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})},Object.defineProperty(e.prototype,"refreshToken",{get:function(){return this.stsTokenManager.refreshToken||""},enumerable:!1,configurable:!0}),e._fromJSON=function(t,n){var r,i,o,s,u,c,d,l,h=null!==(r=n.displayName)&&void 0!==r?r:void 0,f=null!==(i=n.email)&&void 0!==i?i:void 0,p=null!==(o=n.phoneNumber)&&void 0!==o?o:void 0,v=null!==(s=n.photoURL)&&void 0!==s?s:void 0,m=null!==(u=n.tenantId)&&void 0!==u?u:void 0,g=null!==(c=n._redirectEventId)&&void 0!==c?c:void 0,_=null!==(d=n.createdAt)&&void 0!==d?d:void 0,I=null!==(l=n.lastLoginAt)&&void 0!==l?l:void 0,y=n.uid,T=n.emailVerified,b=n.isAnonymous,E=n.providerData,A=n.stsTokenManager;se(y&&A,t,"internal-error");var w=xe.fromJSON(this.name,A);se("string"==typeof y,t,"internal-error"),je(h,t.name),je(f,t.name),se("boolean"==typeof T,t,"internal-error"),se("boolean"==typeof b,t,"internal-error"),je(p,t.name),je(v,t.name),je(m,t.name),je(g,t.name),je(_,t.name),je(I,t.name);var k=new e({uid:y,auth:t,email:f,emailVerified:T,displayName:h,isAnonymous:b,photoURL:v,phoneNumber:p,tenantId:m,stsTokenManager:w,createdAt:_,lastLoginAt:I});return E&&Array.isArray(E)&&(k.providerData=E.map((function(e){return a({},e)}))),g&&(k._redirectEventId=g),k},e._fromIdTokenResponse=function(t,n,r){return void 0===r&&(r=!1),c(this,void 0,void 0,(function(){var i,o;return d(this,(function(s){switch(s.label){case 0:return(i=new xe).updateFromServerResponse(n),[4,Ve(o=new e({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r}))];case 1:return s.sent(),[2,o]}}))}))},e}(),Be=new Map;function We(e){ue(e instanceof Function,"Expected a class definition");var t=Be.get(e);return t?(ue(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Be.set(e,t),t)}var Ge=function(){function e(){this.type="NONE",this.storage={}}return e.prototype._isAvailable=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){return[2,!0]}))}))},e.prototype._set=function(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return this.storage[e]=t,[2]}))}))},e.prototype._get=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){return[2,void 0===(t=this.storage[e])?null:t]}))}))},e.prototype._remove=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){return delete this.storage[e],[2]}))}))},e.prototype._addListener=function(e,t){},e.prototype._removeListener=function(e,t){},e.type="NONE",e}();function ze(e,t,n){return"".concat("firebase",":").concat(e,":").concat(t,":").concat(n)}var Ke=function(){function e(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;var r=this.auth,i=r.config,o=r.name;this.fullUserKey=ze(this.userKey,i.apiKey,o),this.fullPersistenceKey=ze("persistence",i.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}return e.prototype.setCurrentUser=function(e){return this.persistence._set(this.fullUserKey,e.toJSON())},e.prototype.getCurrentUser=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return[4,this.persistence._get(this.fullUserKey)];case 1:return[2,(e=t.sent())?qe._fromJSON(this.auth,e):null]}}))}))},e.prototype.removeCurrentUser=function(){return this.persistence._remove(this.fullUserKey)},e.prototype.savePersistenceForRedirect=function(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)},e.prototype.setPersistence=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return this.persistence===e?[2]:[4,this.getCurrentUser()];case 1:return t=n.sent(),[4,this.removeCurrentUser()];case 2:return n.sent(),this.persistence=e,t?[2,this.setCurrentUser(t)]:[2]}}))}))},e.prototype.delete=function(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)},e.create=function(t,n,r){return void 0===r&&(r="authUser"),c(this,void 0,void 0,(function(){var i,o,s,a,u,l,h,f,p,v,m=this;return d(this,(function(g){switch(g.label){case 0:return n.length?[4,Promise.all(n.map((function(e){return c(m,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return[4,e._isAvailable()];case 1:return t.sent()?[2,e]:[2,void 0]}}))}))})))]:[2,new e(We(Ge),t,r)];case 1:i=g.sent().filter((function(e){return e})),o=i[0]||We(Ge),s=ze(r,t.config.apiKey,t.name),a=null,u=0,l=n,g.label=2;case 2:if(!(u=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function nt(t,n){var r;switch(void 0===n&&(n=[]),t){case"Browser":r=Je(p());break;case"Worker":r="".concat(Je(p()),"-").concat(t);break;default:r=t}var i=n.length?n.join(","):"FirebaseCore-web";return"".concat(r,"/").concat("JsCore","/").concat(e,"/").concat(i)}function rt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"GET","/v2/recaptchaConfig",Ie(e,t))]}))}))}function it(e){return void 0!==e&&void 0!==e.enterprise}var ot=function(e){if(this.siteKey="",this.emailPasswordEnabled=!1,void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some((function(e){return"EMAIL_PASSWORD_PROVIDER"===e.provider&&"OFF"!==e.enforcementState}))};function st(e){return new Promise((function(t,n){var r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=function(e){var t=ne("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",function(){var e,t;return null!==(t=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0])&&void 0!==t?t:document}().appendChild(r)}))}var at=function(){function e(e){this.type="recaptcha-enterprise",this.auth=lt(e)}return e.prototype.verify=function(e,t){return void 0===e&&(e="verify"),void 0===t&&(t=!1),c(this,void 0,void 0,(function(){function n(t,n,r){var i=window.grecaptcha;it(i)?i.enterprise.ready((function(){i.enterprise.execute(t,{action:e}).then((function(e){n(e)})).catch((function(){n("NO_RECAPTCHA")}))})):r(Error("No reCAPTCHA enterprise script loaded."))}var r=this;return d(this,(function(e){return[2,new Promise((function(e,i){(function(e){return c(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return[2,e._agentRecaptchaConfig.siteKey];if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return[2,e._tenantRecaptchaConfigs[e.tenantId].siteKey]}return[2,new Promise((function(t,r){return c(n,void 0,void 0,(function(){return d(this,(function(n){return rt(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then((function(n){if(void 0!==n.recaptchaKey){var i=new ot(n);return null==e.tenantId?e._agentRecaptchaConfig=i:e._tenantRecaptchaConfigs[e.tenantId]=i,t(i.siteKey)}r(new Error("recaptcha Enterprise site key undefined"))})).catch((function(e){r(e)})),[2]}))}))}))]}))}))})(r.auth).then((function(r){if(!t&&it(window.grecaptcha))n(r,e,i);else{if("undefined"==typeof window)return void i(new Error("RecaptchaVerifier is only supported in browser"));st("https://www.google.com/recaptcha/enterprise.js?render="+r).then((function(){n(r,e,i)})).catch((function(e){i(e)}))}})).catch((function(e){i(e)}))}))]}))}))},e}();function ut(e,t,n,r){return void 0===r&&(r=!1),c(this,void 0,void 0,(function(){var i,o,s;return d(this,(function(u){switch(u.label){case 0:i=new at(e),u.label=1;case 1:return u.trys.push([1,3,,5]),[4,i.verify(n)];case 2:return o=u.sent(),[3,5];case 3:return u.sent(),[4,i.verify(n,!0)];case 4:return o=u.sent(),[3,5];case 5:return s=a({},t),r?Object.assign(s,{captchaResp:o}):Object.assign(s,{captchaResponse:o}),Object.assign(s,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(s,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),[2,s]}}))}))}var ct=function(){function e(e){this.auth=e,this.queue=[]}return e.prototype.pushCallback=function(e,t){var n=this,r=function(t){return new Promise((function(n,r){try{n(e(t))}catch(e){r(e)}}))};r.onAbort=t,this.queue.push(r);var i=this.queue.length-1;return function(){n.queue[i]=function(){return Promise.resolve()}}},e.prototype.runMiddleware=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:if(this.auth.currentUser===e)return[2];t=[],c.label=1;case 1:c.trys.push([1,6,,7]),n=0,r=this.queue,c.label=2;case 2:return n0,e,"invalid-continue-uri"),se(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(se(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(se(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}function vn(e,t,n){var r;return c(this,void 0,void 0,(function(){var i,o,s,a=this;return d(this,(function(u){switch(u.label){case 0:return i=lt(e),o={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"},(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled)?[4,ut(i,o,"getOobCode",!0)]:[3,3];case 1:return s=u.sent(),n&&pn(i,s,n),[4,At(i,s)];case 2:return u.sent(),[3,5];case 3:return n&&pn(i,o,n),[4,At(i,o).catch((function(e){return c(a,void 0,void 0,(function(){var t;return d(this,(function(r){switch(r.label){case 0:return e.code!=="auth/".concat("missing-recaptcha-token")?[3,3]:(console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow."),[4,ut(i,o,"getOobCode",!0)]);case 1:return t=r.sent(),n&&pn(i,t,n),[4,At(i,t)];case 2:return r.sent(),[3,4];case 3:return[2,Promise.reject(e)];case 4:return[2]}}))}))}))];case 4:u.sent(),u.label=5;case 5:return[2]}}))}))}function mn(e,t,n){return c(this,void 0,void 0,(function(){return d(this,(function(r){switch(r.label){case 0:return[4,_t(w(e),{oobCode:t,newPassword:n})];case 1:return r.sent(),[2]}}))}))}function gn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,yt(w(e),{oobCode:t})];case 1:return n.sent(),[2]}}))}))}function _n(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return[4,_t(n=w(e),{oobCode:t})];case 1:switch(r=s.sent(),se(i=r.requestType,n,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":se(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":se(r.mfaInfo,n,"internal-error");default:se(r.email,n,"internal-error")}return o=null,r.mfaInfo&&(o=ln._fromServerResponse(lt(n),r.mfaInfo)),[2,{data:{email:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.newEmail:r.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.email:r.newEmail)||null,multiFactorInfo:o},operation:i}]}}))}))}function In(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,_n(w(e),t)];case 1:return[2,n.sent().data.email]}}))}))}function yn(e,t,n){var r;return c(this,void 0,void 0,(function(){var i,o,s,a,u,l,h=this;return d(this,(function(f){switch(f.label){case 0:return i=lt(e),o={returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled)?[4,ut(i,o,"signUpPassword")]:[3,2];case 1:return a=f.sent(),s=Kt(i,a),[3,3];case 2:s=Kt(i,o).catch((function(e){return c(h,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return e.code!=="auth/".concat("missing-recaptcha-token")?[3,2]:(console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow."),[4,ut(i,o,"signUpPassword")]);case 1:return t=n.sent(),[2,Kt(i,t)];case 2:return[2,Promise.reject(e)]}}))}))})),f.label=3;case 3:return[4,s.catch((function(e){return Promise.reject(e)}))];case 4:return u=f.sent(),[4,Jt._fromIdTokenResponse(i,"signIn",u)];case 5:return l=f.sent(),[4,i._updateCurrentUser(l.user)];case 6:return f.sent(),[2,l]}}))}))}function Tn(e,t,n){return sn(w(e),Vt.credential(t,n))}function bn(e,t,n){var r;return c(this,void 0,void 0,(function(){function i(e,t){se(t.handleCodeInApp,o,"argument-error"),t&&pn(o,e,t)}var o,s,a,u=this;return d(this,(function(l){switch(l.label){case 0:return o=lt(e),s={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"},(null===(r=o._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled)?[4,ut(o,s,"getOobCode",!0)]:[3,3];case 1:return i(a=l.sent(),n),[4,wt(o,a)];case 2:return l.sent(),[3,5];case 3:return i(s,n),[4,wt(o,s).catch((function(e){return c(u,void 0,void 0,(function(){var t;return d(this,(function(r){switch(r.label){case 0:return e.code!=="auth/".concat("missing-recaptcha-token")?[3,3]:(console.log("Email link sign-in is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow."),[4,ut(o,s,"getOobCode",!0)]);case 1:return i(t=r.sent(),n),[4,wt(o,t)];case 2:return r.sent(),[3,4];case 3:return[2,Promise.reject(e)];case 4:return[2]}}))}))}))];case 4:l.sent(),l.label=5;case 5:return[2]}}))}))}function En(e,t){var n=Ut.parseLink(t);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}function An(e,t,n){return c(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){return r=w(e),se((i=Vt.credentialWithLink(t,n||ce()))._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),[2,sn(r,i)]}))}))}function wn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:createAuthUri",Ie(e,t))]}))}))}function kn(e,t){return c(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=de()?ce():"http://localhost",r={identifier:t,continueUri:n},[4,wn(w(e),r)];case 1:return[2,i.sent().signinMethods||[]]}}))}))}function Rn(e,t){return c(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return n=w(e),[4,e.getIdToken()];case 1:return r=o.sent(),i={requestType:"VERIFY_EMAIL",idToken:r},t&&pn(n.auth,i,t),[4,Et(n.auth,i)];case 2:return o.sent().email===e.email?[3,4]:[4,e.reload()];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))}function Nn(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return r=w(e),[4,e.getIdToken()];case 1:return i=s.sent(),o={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:i,newEmail:t},n&&pn(r.auth,o,n),[4,kt(r.auth,o)];case 2:return s.sent().email===e.email?[3,4]:[4,e.reload()];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))}function Sn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:update",t)]}))}))}function On(e,t){var n=t.displayName,r=t.photoURL;return c(this,void 0,void 0,(function(){var t,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return void 0===n&&void 0===r?[2]:[4,(t=w(e)).getIdToken()];case 1:return i=u.sent(),o={idToken:i,displayName:n,photoUrl:r,returnSecureToken:!0},[4,Le(t,Sn(t.auth,o))];case 2:return s=u.sent(),t.displayName=s.displayName||null,t.photoURL=s.photoUrl||null,a=t.providerData.find((function(e){return"password"===e.providerId})),a&&(a.displayName=t.displayName,a.photoURL=t.photoURL),[4,t._updateTokensIfNecessary(s)];case 3:return u.sent(),[2]}}))}))}function Cn(e,t){return Dn(w(e),t,null)}function Pn(e,t){return Dn(w(e),null,t)}function Dn(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return r=e.auth,[4,e.getIdToken()];case 1:return i=a.sent(),o={idToken:i,returnSecureToken:!0},t&&(o.email=t),n&&(o.password=n),[4,Le(e,It(r,o))];case 2:return s=a.sent(),[4,e._updateTokensIfNecessary(s,!0)];case 3:return a.sent(),[2]}}))}))}var Ln=function(e,t,n){void 0===n&&(n={}),this.isNewUser=e,this.providerId=t,this.profile=n},Un=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r)||this;return o.username=i,o}return s(t,e),t}(Ln),Mn=function(e){function t(t,n){return e.call(this,t,"facebook.com",n)||this}return s(t,e),t}(Ln),Vn=function(e){function t(t,n){return e.call(this,t,"github.com",n,"string"==typeof(null==n?void 0:n.login)?null==n?void 0:n.login:null)||this}return s(t,e),t}(Un),Fn=function(e){function t(t,n){return e.call(this,t,"google.com",n)||this}return s(t,e),t}(Ln),Hn=function(e){function t(t,n,r){return e.call(this,t,"twitter.com",n,r)||this}return s(t,e),t}(Un);function xn(e){var t=e,n=t.user,r=t._tokenResponse;return n.isAnonymous&&!r?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,n;if(!e)return null;var r=e.providerId,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},o=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!r&&(null==e?void 0:e.idToken)){var s=null===(n=null===(t=De(e.idToken))||void 0===t?void 0:t.firebase)||void 0===n?void 0:n.sign_in_provider;if(s)return new Ln(o,"anonymous"!==s&&"custom"!==s?s:null)}if(!r)return null;switch(r){case"facebook.com":return new Mn(o,i);case"github.com":return new Vn(o,i);case"google.com":return new Fn(o,i);case"twitter.com":return new Hn(o,i,e.screenName||null);case"custom":case"anonymous":return new Ln(o,null);default:return new Ln(o,r,i)}}(r)}function jn(e,t){return w(e).setPersistence(t)}function qn(e){return lt(e).initializeRecaptchaConfig()}function Bn(e,t,n,r){return w(e).onIdTokenChanged(t,n,r)}function Wn(e,t,n){return w(e).beforeAuthStateChanged(t,n)}function Gn(e,t,n,r){return w(e).onAuthStateChanged(t,n,r)}function zn(e){w(e).useDeviceLanguage()}function Kn(e,t){return w(e).updateCurrentUser(t)}function Jn(e){return w(e).signOut()}function Yn(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){return[2,w(e).delete()]}))}))}var Xn=function(){function e(e,t,n){this.type=e,this.credential=t,this.user=n}return e._fromIdtoken=function(t,n){return new e("enroll",t,n)},e._fromMfaPendingCredential=function(t){return new e("signin",t)},e.prototype.toJSON=function(){var e;return{multiFactorSession:(e={},e["enroll"===this.type?"idToken":"pendingCredential"]=this.credential,e)}},e.fromJSON=function(t){var n,r;if(null==t?void 0:t.multiFactorSession){if(null===(n=t.multiFactorSession)||void 0===n?void 0:n.pendingCredential)return e._fromMfaPendingCredential(t.multiFactorSession.pendingCredential);if(null===(r=t.multiFactorSession)||void 0===r?void 0:r.idToken)return e._fromIdtoken(t.multiFactorSession.idToken)}return null},e}(),Qn=function(){function e(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}return e._fromError=function(t,n){var r=this,i=lt(t),o=n.customData._serverResponse,s=(o.mfaInfo||[]).map((function(e){return ln._fromServerResponse(i,e)}));se(o.mfaPendingCredential,i,"internal-error");var u=Xn._fromMfaPendingCredential(o.mfaPendingCredential);return new e(u,s,(function(e){return c(r,void 0,void 0,(function(){var t,r,s;return d(this,(function(c){switch(c.label){case 0:return[4,e._process(i,u)];case 1:switch(t=c.sent(),delete o.mfaInfo,delete o.mfaPendingCredential,r=a(a({},o),{idToken:t.idToken,refreshToken:t.refreshToken}),n.operationType){case"signIn":return[3,2];case"reauthenticate":return[3,5]}return[3,6];case 2:return[4,Jt._fromIdTokenResponse(i,n.operationType,r)];case 3:return s=c.sent(),[4,i._updateCurrentUser(s.user)];case 4:return c.sent(),[2,s];case 5:return se(n.user,i,"internal-error"),[2,Jt._forOperation(n.user,n.operationType,r)];case 6:te(i,"internal-error"),c.label=7;case 7:return[2]}}))}))}))},e.prototype.resolveSignIn=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){return t=e,[2,this.signInResolver(t)]}))}))},e}();function $n(e,t){var n,r=w(e),i=t;return se(t.customData.operationType,r,"argument-error"),se(null===(n=i.customData._serverResponse)||void 0===n?void 0:n.mfaPendingCredential,r,"argument-error"),Qn._fromError(r,i)}var Zn=function(){function e(e){var t=this;this.user=e,this.enrolledFactors=[],e._onReload((function(n){n.mfaInfo&&(t.enrolledFactors=n.mfaInfo.map((function(t){return ln._fromServerResponse(e.auth,t)})))}))}return e._fromUser=function(t){return new e(t)},e.prototype.getSession=function(){return c(this,void 0,void 0,(function(){var e,t;return d(this,(function(n){switch(n.label){case 0:return t=(e=Xn)._fromIdtoken,[4,this.user.getIdToken()];case 1:return[2,t.apply(e,[n.sent(),this.user])]}}))}))},e.prototype.enroll=function(e,t){return c(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return n=e,[4,this.getSession()];case 1:return r=o.sent(),[4,Le(this.user,n._process(this.user.auth,r,t))];case 2:return i=o.sent(),[4,this.user._updateTokensIfNecessary(i)];case 3:return o.sent(),[2,this.user.reload()]}}))}))},e.prototype.unenroll=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:return t="string"==typeof e?e:e.uid,[4,this.user.getIdToken()];case 1:n=i.sent(),i.label=2;case 2:return i.trys.push([2,6,,7]),[4,Le(this.user,(o=this.user.auth,s={idToken:n,mfaEnrollmentId:t},ye(o,"POST","/v2/accounts/mfaEnrollment:withdraw",Ie(o,s))))];case 3:return r=i.sent(),this.enrolledFactors=this.enrolledFactors.filter((function(e){return e.uid!==t})),[4,this.user._updateTokensIfNecessary(r)];case 4:return i.sent(),[4,this.user.reload()];case 5:return i.sent(),[3,7];case 6:throw i.sent();case 7:return[2]}var o,s}))}))},e}(),er=new WeakMap;function tr(e){var t=w(e);return er.has(t)||er.set(t,Zn._fromUser(t)),er.get(t)}var nr="@firebase/auth",rr=function(){function e(e){this.auth=e,this.internalListeners=new Map}return e.prototype.getUid=function(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null},e.prototype.getToken=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this.assertAuthConfigured(),[4,this.auth._initializationPromise];case 1:return t.sent(),this.auth.currentUser?[4,this.auth.currentUser.getIdToken(e)]:[2,null];case 2:return[2,{accessToken:t.sent()}]}}))}))},e.prototype.addAuthTokenListener=function(e){if(this.assertAuthConfigured(),!this.internalListeners.has(e)){var t=this.auth.onIdTokenChanged((function(t){e((null==t?void 0:t.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}},e.prototype.removeAuthTokenListener=function(e){this.assertAuthConfigured();var t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())},e.prototype.assertAuthConfigured=function(){se(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")},e.prototype.updateProactiveRefresh=function(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()},e}();var ir={PHONE:"phone",TOTP:"totp"},or={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},sr={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},ar={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},ur={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"},cr=function(){function e(e,t){this.storageRetriever=e,this.type=t}return e.prototype._isAvailable=function(){try{return this.storage?(this.storage.setItem("__sak","1"),this.storage.removeItem("__sak"),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}},e.prototype._set=function(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()},e.prototype._get=function(e){var t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)},e.prototype._remove=function(e){return this.storage.removeItem(e),Promise.resolve()},Object.defineProperty(e.prototype,"storage",{get:function(){return this.storageRetriever()},enumerable:!1,configurable:!0}),e}();var dr=function(e){function t(){var t,n=e.call(this,(function(){return window.localStorage}),"LOCAL")||this;return n.boundEventHandler=function(e,t){return n.onStorageEvent(e,t)},n.listeners={},n.localCache={},n.pollTimer=null,n.safariLocalStorageNotSynced=(Ye(t=p())||et(t))&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),n.fallbackToPolling=function(e){return void 0===e&&(e=p()),et(e)||Qe(e)||Ze(e)||$e(e)||/windows phone/i.test(e)||Xe(e)}(),n._shouldAllowMigration=!0,n}return s(t,e),t.prototype.forAllChangedKeys=function(e){for(var t=0,n=Object.keys(this.listeners);t0&&(a.scopes=f.join(",")),t.tenantId&&(a.tid=t.tenantId),p=a,v=0,m=Object.keys(p);v=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Hr(e))},e.prototype.saveEventToCache=function(e){this.cachedEventUids.add(Hr(e)),this.lastProcessedEventTime=Date.now()},e}();function Hr(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((function(e){return e})).join("-")}function xr(e){var t=e.type,n=e.error;return"unknown"===t&&(null==n?void 0:n.code)==="auth/".concat("no-auth-event")}var jr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.passiveListeners=new Set,t.initPromise=new Promise((function(e){t.resolveInialized=e})),t}return s(t,e),t.prototype.addPassiveListener=function(e){this.passiveListeners.add(e)},t.prototype.removePassiveListener=function(e){this.passiveListeners.delete(e)},t.prototype.resetRedirect=function(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1},t.prototype.onEvent=function(t){return this.resolveInialized(),this.passiveListeners.forEach((function(e){return e(t)})),e.prototype.onEvent.call(this,t)},t.prototype.initialized=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this.initPromise];case 1:return e.sent(),[2]}}))}))},t}(Fr);function qr(e,t){return zr()._set(Kr(e),t)}function Br(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,zr()._get(Kr(e))];case 1:return(t=n.sent())?[4,zr()._remove(Kr(e))]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2,t]}}))}))}function Wr(e,t){var n,r,i=function(e){var t=Jr(e),n=t.link?decodeURIComponent(t.link):void 0,r=Jr(n).link,i=t.deep_link_id?decodeURIComponent(t.deep_link_id):void 0;return Jr(i).link||i||r||n||e}(t);if(i.includes("/__/auth/callback")){var o=Jr(i),s=o.firebaseError?function(e){try{return JSON.parse(e)}catch(e){return null}}(decodeURIComponent(o.firebaseError)):null,a=null===(r=null===(n=null==s?void 0:s.code)||void 0===n?void 0:n.split("auth/"))||void 0===r?void 0:r[1],u=a?ne(a):null;return u?{type:e.type,eventId:e.eventId,tenantId:e.tenantId,error:u,urlResponse:null,sessionId:null,postBody:null}:{type:e.type,eventId:e.eventId,tenantId:e.tenantId,sessionId:e.sessionId,urlResponse:i,postBody:null}}return null}function Gr(){for(var e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=0;n<20;n++){var r=Math.floor(Math.random()*t.length);e.push(t.charAt(r))}return e.join("")}function zr(){return We(lr)}function Kr(e){return ze("authEvent",e.config.apiKey,e.name)}function Jr(e){if(!(null==e?void 0:e.includes("?")))return{};var t=e.split("?");return t[0],T(t.slice(1).join("?"))}var Yr,Xr=function(){function e(){this._redirectPersistence=hr,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=Rr,this._overrideRedirectResult=Er}return e.prototype._initialize=function(e){return c(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){return t=e._key(),(n=this.eventManagers.get(t))||(n=new jr(e),this.eventManagers.set(t,n),this.attachCallbackListeners(e,n)),[2,n]}))}))},e.prototype._openPopup=function(e){te(e,"operation-not-supported-in-this-environment")},e.prototype._openRedirect=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,s;return d(this,(function(a){switch(a.label){case 0:return function(e){var t,n,r,i,o,s,a,u,c,d,l=Pr();se("function"==typeof(null===(t=null==l?void 0:l.universalLinks)||void 0===t?void 0:t.subscribe),e,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),se(void 0!==(null===(n=null==l?void 0:l.BuildInfo)||void 0===n?void 0:n.packageName),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),se("function"==typeof(null===(o=null===(i=null===(r=null==l?void 0:l.cordova)||void 0===r?void 0:r.plugins)||void 0===i?void 0:i.browsertab)||void 0===o?void 0:o.openUrl),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),se("function"==typeof(null===(u=null===(a=null===(s=null==l?void 0:l.cordova)||void 0===s?void 0:s.plugins)||void 0===a?void 0:a.browsertab)||void 0===u?void 0:u.isAvailable),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),se("function"==typeof(null===(d=null===(c=null==l?void 0:l.cordova)||void 0===c?void 0:c.InAppBrowser)||void 0===d?void 0:d.open),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}(e),[4,this._initialize(e)];case 1:return[4,(i=a.sent()).initialized()];case 2:return a.sent(),i.resetRedirect(),Ir.clear(),[4,this._originValidation(e)];case 3:return a.sent(),o=function(e,t,n){return void 0===n&&(n=null),{type:t,eventId:n,urlResponse:null,sessionId:Gr(),postBody:null,tenantId:e.tenantId,error:ne(e,"no-auth-event")}}(e,n,r),[4,qr(e,o)];case 4:return a.sent(),[4,Lr(e,o,t)];case 5:return[4,Ur(a.sent())];case 6:return s=a.sent(),[2,Mr(e,i,s)]}}))}))},e.prototype._isIframeWebStorageSupported=function(e,t){throw new Error("Method not implemented.")},e.prototype._originValidation=function(e){var t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function(e){return c(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return t=Pr().BuildInfo,n={},et()?n.iosBundleId=t.packageName:Qe()?n.androidPackageName=t.packageName:te(e,"operation-not-supported-in-this-environment"),[4,Dr(e,n)];case 1:return r.sent(),[2]}}))}))}(e)),this.originValidationPromises[t]},e.prototype.attachCallbackListeners=function(e,t){var n=this,r=Pr(),i=r.universalLinks,o=r.handleOpenURL,s=r.BuildInfo,a=setTimeout((function(){return c(n,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,Br(e)];case 1:return n.sent(),t.onEvent($r()),[2]}}))}))}),500),u=function(r){return c(n,void 0,void 0,(function(){var n,i;return d(this,(function(o){switch(o.label){case 0:return clearTimeout(a),[4,Br(e)];case 1:return n=o.sent(),i=null,n&&(null==r?void 0:r.url)&&(i=Wr(n,r.url)),t.onEvent(i||$r()),[2]}}))}))};void 0!==i&&"function"==typeof i.subscribe&&i.subscribe(null,u);var l=o,h="".concat(s.packageName.toLowerCase(),"://");Pr().handleOpenURL=function(e){return c(n,void 0,void 0,(function(){return d(this,(function(t){if(e.toLowerCase().startsWith(h)&&u({url:e}),"function"==typeof l)try{l(e)}catch(e){console.error(e)}return[2]}))}))}},e}(),Qr=Xr;function $r(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:ne("no-auth-event")}}function Zr(e,t,n){return function(e,t,n){return c(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:return r=lt(e),ie(e,t,Ft),[4,r._initializationPromise];case 1:return o.sent(),[4,br(i=fr(r,n),r)];case 2:return o.sent(),[2,i._openRedirect(r,t,"signInViaRedirect")]}}))}))}(e,t,n)}function ei(e,t,n){return function(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return ie((r=w(e)).auth,t,Ft),[4,r.auth._initializationPromise];case 1:return s.sent(),[4,br(i=fr(r.auth,n),r.auth)];case 2:return s.sent(),[4,Nr(r)];case 3:return o=s.sent(),[2,i._openRedirect(r.auth,t,"reauthViaRedirect",o)]}}))}))}(e,t,n)}function ti(e,t,n){return function(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return ie((r=w(e)).auth,t,Ft),[4,r.auth._initializationPromise];case 1:return s.sent(),i=fr(r.auth,n),[4,nn(!1,r,t.providerId)];case 2:return s.sent(),[4,br(i,r.auth)];case 3:return s.sent(),[4,Nr(r)];case 4:return o=s.sent(),[2,i._openRedirect(r.auth,t,"linkViaRedirect",o)]}}))}))}(e,t,n)}function ni(e){void 0===e&&(e=i());var n=t(e,"auth");return n.isInitialized()?n.getImmediate():ft(e,{persistence:K,popupRedirectResolver:Qr})}Yr="Cordova",n(new k("auth",(function(e,t){var n=t.options,r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),s=r.options,a=s.apiKey,u=s.authDomain;se(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});var c={apiKey:a,authDomain:u,clientPlatform:Yr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:nt(Yr)},d=new dt(r,i,o,c);return function(e,t){var n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(We);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(d,n),d}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((function(e,t,n){e.getProvider("auth-internal").initialize()}))),n(new k("auth-internal",(function(e){return function(e){return new rr(e)}(lt(e.getProvider("auth").getImmediate()))}),"PRIVATE").setInstantiationMode("EXPLICIT")),r(nr,"0.23.2",function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Yr)),r(nr,"0.23.2","esm5");export{ur as ActionCodeOperation,Ut as ActionCodeURL,gt as AuthCredential,$ as AuthErrorCodes,St as EmailAuthCredential,Vt as EmailAuthProvider,jt as FacebookAuthProvider,ir as FactorId,Bt as GithubAuthProvider,qt as GoogleAuthProvider,Pt as OAuthCredential,xt as OAuthProvider,ar as OperationType,Lt as PhoneAuthCredential,or as ProviderId,Gt as SAMLAuthProvider,sr as SignInMethod,zt as TwitterAuthProvider,gn as applyActionCode,Wn as beforeAuthStateChanged,lr as browserLocalPersistence,hr as browserSessionPersistence,_n as checkActionCode,mn as confirmPasswordReset,pt as connectAuthEmulator,Qr as cordovaPopupRedirectResolver,yn as createUserWithEmailAndPassword,Y as debugErrorMap,Yn as deleteUser,kn as fetchSignInMethodsForEmail,xn as getAdditionalUserInfo,ni as getAuth,Oe as getIdToken,Ce as getIdTokenResult,$n as getMultiFactorResolver,kr as getRedirectResult,Ge as inMemoryPersistence,K as indexedDBLocalPersistence,ft as initializeAuth,qn as initializeRecaptchaConfig,En as isSignInWithEmailLink,an as linkWithCredential,ti as linkWithRedirect,tr as multiFactor,Gn as onAuthStateChanged,Bn as onIdTokenChanged,Mt as parseActionCodeURL,X as prodErrorMap,un as reauthenticateWithCredential,ei as reauthenticateWithRedirect,Fe as reload,Rn as sendEmailVerification,vn as sendPasswordResetEmail,bn as sendSignInLinkToEmail,jn as setPersistence,Xt as signInAnonymously,sn as signInWithCredential,dn as signInWithCustomToken,Tn as signInWithEmailAndPassword,An as signInWithEmailLink,Zr as signInWithRedirect,Jn as signOut,en as unlink,Kn as updateCurrentUser,Cn as updateEmail,Pn as updatePassword,On as updateProfile,zn as useDeviceLanguage,Nn as verifyBeforeUpdateEmail,In as verifyPasswordResetCode}; //# sourceMappingURL=firebase-auth-cordova.js.map