1import{_ as Zi}from"./tslib-BGVaTf34.js";import{o as Bn,d as Ii}from"./idb-Bn1DMRyg.js";var Cs={};/** 2 * @license 3 * Copyright 2017 Google LLC 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */const Bo=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);s<128?e[n++]=s:s<2048?(e[n++]=s>>6|192,e[n++]=s&63|128):(s&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=s>>18|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128,e[n++]=s&63|128):(e[n++]=s>>12|224,e[n++]=s>>6&63|128,e[n++]=s&63|128)}return e},Al=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n++];if(s<128)e[r++]=String.fromCharCode(s);else if(s>191&&s<224){const a=t[n++];e[r++]=String.fromCharCode((s&31)<<6|a&63)}else if(s>239&&s<365){const a=t[n++],l=t[n++],h=t[n++],f=((s&7)<<18|(a&63)<<12|(l&63)<<6|h&63)-65536;e[r++]=String.fromCharCode(55296+(f>>10)),e[r++]=String.fromCharCode(56320+(f&1023))}else{const a=t[n++],l=t[n++];e[r++]=String.fromCharCode((s&15)<<12|(a&63)<<6|l&63)}}return e.join("")},er={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<t.length;s+=3){const a=t[s],l=s+1<t.length,h=l?t[s+1]:0,f=s+2<t.length,I=f?t[s+2]:0,E=a>>2,A=(a&3)<<4|h>>4;let k=(h&15)<<2|I>>6,O=I&63;f||(O=64,l||(k=64)),r.push(n[E],n[A],n[k],n[O])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Bo(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):Al(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<t.length;){const a=n[t.charAt(s++)],h=s<t.length?n[t.charAt(s)]:0;++s;const I=s<t.length?n[t.charAt(s)]:64;++s;const A=s<t.length?n[t.charAt(s)]:64;if(++s,a==null||h==null||I==null||A==null)throw new kl;const k=a<<2|h>>4;if(r.push(k),I!==64){const O=h<<4&240|I>>2;if(r.push(O),A!==64){const R=I<<6&192|A;r.push(R)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class kl extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Sl=function(t){const e=Bo(t);return er.encodeByteArray(e,!0)},Cn=function(t){return Sl(t).replace(/\./g,"")},Ho=function(t){try{return er.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** 17 * @license 18 * Copyright 2022 Google LLC 19 * 20 * Licensed under the Apache License, Version 2.0 (the "License"); 21 * you may not use this file except in compliance with the License. 22 * You may obtain a copy of the License at 23 * 24 * http://www.apache.org/licenses/LICENSE-2.0 25 * 26 * Unless required by applicable law or agreed to in writing, softw
26are 27 * distributed under the License is distributed on an "AS IS" BASIS, 28 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 * See the License for the specific language governing permissions and 30 * limitations under the License. 31 */function Vo(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** 32 * @license 33 * Copyright 2022 Google LLC 34 * 35 * Licensed under the Apache License, Version 2.0 (the "License"); 36 * you may not use this file except in compliance with the License. 37 * You may obtain a copy of the License at 38 * 39 * http://www.apache.org/licenses/LICENSE-2.0 40 * 41 * Unless required by applicable law or agreed to in writing, software 42 * distributed under the License is distributed on an "AS IS" BASIS, 43 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44 * See the License for the specific language governing permissions and 45 * limitations under the License. 46 */const Rl=()=>Vo().__FIREBASE_DEFAULTS__,Cl=()=>{if(typeof process>"u"||typeof Cs>"u")return;const t=Cs.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},Pl=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&Ho(t[1]);return e&&JSON.parse(e)},tr=()=>{try{return Rl()||Cl()||Pl()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},Ko=t=>{var e,n;return(n=(e=tr())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},zo=t=>{const e=Ko(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},qo=()=>{var t;return(t=tr())===null||t===void 0?void 0:t.config},Wo=t=>{var e;return(e=tr())===null||e===void 0?void 0:e[`_${t}`]};/** 47 * @license 48 * Copyright 2017 Google LLC 49 * 50 * Licensed under the Apache License, Version 2.0 (the "License"); 51 * you may not use this file except in compliance with the License. 52 * You may obtain a copy of the License at 53 * 54 * http://www.apache.org/licenses/LICENSE-2.0 55 * 56 * Unless required by applicable law or agreed to in writing, software 57 * distributed under the License is distributed on an "AS IS" BASIS, 58 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 59 * See the License for the specific language governing permissions and 60 * limitations under the License. 61 */class Ht{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** 62 * @license 63 * Copyright 2021 Google LLC 64 * 65 * Licensed under the Apache License, Version 2.0 (the "License"); 66 * you may not use this file except in compliance with the License. 67 * You may obtain a copy of the License at 68 * 69 * http://www.apache.org/licenses/LICENSE-2.0 70 * 71 * Unless required by applicable law or agreed to in writing, software 72 * distributed under the License is distributed on an "AS IS" BASIS, 73 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 74 * See the License for the specific language governing permissions and 75 * limitations under the License. 76 */function Go(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",s=t.iat||0,a=t.sub||t.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const l=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}}},t);return[Cn(JSON.stringify(n)),Cn(JSON.stringify(l)),""].join(".")}/** 77 * @license 78 * Copyright 2017 Google LLC 79 * 80 * Licensed under the Apache License, Version 2.0 (the "License");
81 * you may not use this file except in compliance with the License. 82 * You may obtain a copy of the License at 83 * 84 * http://www.apache.org/licenses/LICENSE-2.0 85 * 86 * Unless required by applicable law or agreed to in writing, software 87 * distributed under the License is distributed on an "AS IS" BASIS, 88 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 89 * See the License for the specific language governing permissions and 90 * limitations under the License. 91 */function se(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Ol(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(se())}function Xo(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function Nl(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Dl(){const t=se();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function Tt(){try{return typeof indexedDB=="object"}catch{return!1}}function Hn(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var a;e(((a=s.error)===null||a===void 0?void 0:a.message)||"")}}catch(n){e(n)}})}function nr(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/** 92 * @license 93 * Copyright 2017 Google LLC 94 * 95 * Licensed under the Apache License, Version 2.0 (the "License"); 96 * you may not use this file except in compliance with the License. 97 * You may obtain a copy of the License at 98 * 99 * http://www.apache.org/licenses/LICENSE-2.0 100 * 101 * Unless required by applicable law or agreed to in writing, software 102 * distributed under the License is distributed on an "AS IS" BASIS, 103 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 104 * See the License for the specific language governing permissions and 105 * limitations under the License. 106 */const Ml="FirebaseError";class ge extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=Ml,Object.setPrototypeOf(this,ge.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,be.prototype.create)}}class be{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},s=`${this.service}/${e}`,a=this.errors[e],l=a?Ll(a,r):"Error",h=`${this.serviceName}: ${l} (${s}).`;return new ge(s,h,r)}}function Ll(t,e){return t.replace(Ul,(n,r)=>{const s=e[r];return s!=null?String(s):`<${r}?>`})}const Ul=/\{\$([^}]+)}/g;function xl(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Vt(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const s of n){if(!r.includes(s))return!1;const a=t[s],l=e[s];if(Ps(a)&&Ps(l)){if(!Vt(a,l))return!1}else if(a!==l)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function Ps(t){return t!==null&&typeof t=="object"}/** 107 * @license 108 * Copyright 2017 Google LLC 109 * 110 * Licensed under the Apache License, Version 2.0 (the "License"); 111 * you may not use this file except in compliance with the License. 112 * You may obtain a copy of the License at 113 * 114 * http://www.apache.org/licenses/LICENSE-2.0 115 * 116 * Unless required by applicable law or agreed to in writing, software 117 * distributed under the License is distributed on an "AS IS" BASIS, 118 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 119 * See the License for the specific language governing permissions and 120 * limitations under the License. 121 */function Yt(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(s=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Fl(t,e){const n=new $l(t,e);return n.subscribe.bind(n)}class $l{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
121ise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let s;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");jl(e,["next","error","complete"])?s=e:s={next:e,error:n,complete:r},s.next===void 0&&(s.next=wi),s.error===void 0&&(s.error=wi),s.complete===void 0&&(s.complete=wi);const a=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),a}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function jl(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function wi(){}/** 122 * @license 123 * Copyright 2022 Google LLC 124 * 125 * Licensed under the Apache License, Version 2.0 (the "License"); 126 * you may not use this file except in compliance with the License. 127 * You may obtain a copy of the License at 128 * 129 * http://www.apache.org/licenses/LICENSE-2.0 130 * 131 * Unless required by applicable law or agreed to in writing, software 132 * distributed under the License is distributed on an "AS IS" BASIS, 133 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 134 * See the License for the specific language governing permissions and 135 * limitations under the License. 136 */const Bl=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})};/** 137 * @license 138 * Copyright 2019 Google LLC 139 * 140 * Licensed under the Apache License, Version 2.0 (the "License"); 141 * you may not use this file except in compliance with the License. 142 * You may obtain a copy of the License at 143 * 144 * http://www.apache.org/licenses/LICENSE-2.0 145 * 146 * Unless required by applicable law or agreed to in writing, software 147 * distributed under the License is distributed on an "AS IS" BASIS, 148 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 149 * See the License for the specific language governing permissions and 150 * limitations under the License. 151 */const Hl=1e3,Vl=2,Kl=4*60*60*1e3,zl=.5;function ji(t,e=Hl,n=Vl){const r=e*Math.pow(n,t),s=Math.round(zl*r*(Math.random()-.5)*2);return Math.min(Kl,r+s)}/** 152 * @license 153 * Copyright 2021 Google LLC 154 * 155 * Licensed under the Apache License, Version 2.0 (the "License"); 156 * you may not use this file except in compliance with the License. 157 * You may obtain a copy of the License at 158 * 159 * http://www.apache.org/licenses/LICENSE-2.0 160 * 161 * Unless required by applicable law or agreed to in writing, software 162 * distributed under the License is distributed on an "AS IS" BASIS, 163 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 164 * See the License for the specific language governing permissions and 165 * limitations under the License. 166 */function de(t){return t&&t._delegate?t._delegate:t}class z{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,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}}/** 167 * @license 168 * Copyright 2019 Google LLC 169 * 170 * Licensed under the Apache License, Version 2.0 (the "License");
171 * you may not use this file except in compliance with the License. 172 * You may obtain a copy of the License at 173 * 174 * http://www.apache.org/licenses/LICENSE-2.0 175 * 176 * Unless required by applicable law or agreed to in writing, software 177 * distributed under the License is distributed on an "AS IS" BASIS, 178 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 179 * See the License for the specific language governing permissions and 180 * limitations under the License. 181 */const Qe="[DEFAULT]";/** 182 * @license 183 * Copyright 2019 Google LLC 184 * 185 * Licensed under the Apache License, Version 2.0 (the "License"); 186 * you may not use this file except in compliance with the License. 187 * You may obtain a copy of the License at 188 * 189 * http://www.apache.org/licenses/LICENSE-2.0 190 * 191 * Unless required by applicable law or agreed to in writing, software 192 * distributed under the License is distributed on an "AS IS" BASIS, 193 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 194 * See the License for the specific language governing permissions and 195 * limitations under the License. 196 */class ql{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new Ht;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(a){if(s)return null;throw a}else{if(s)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Gl(e))try{this.getOrInitializeService({instanceIdentifier:Qe})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const a=this.getOrInitializeService({instanceIdentifier:s});r.resolve(a)}catch{}}}}clearInstance(e=Qe){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Qe){return this.instances.has(e)}getOptions(e=Qe){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[a,l]of this.instancesDeferred.entries()){const h=this.normalizeInstanceIdentifier(a);r===h&&l.resolve(s)}return s}onInit(e,n){var r;const s=this.normalizeInstanceIdentifier(n),a=(r=this.onInitCallbacks.get(s))!==null&&r!==void 0?r:new Set;a.add(e),this.onInitCallbacks.set(s,a);const l=this.instances.get(s);return l&&e(l,s),()=>{a.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Wl(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Qe){return this.component?this.component.multipleInstances?e:Qe:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Wl(t){return t===Qe?void 0:t}function Gl(t){return t.instantiationMode==="EAGER"}/** 197 * @license 198 * Copyright 2019 Google LLC 199 * 200 * Licensed under the Apache License, Version 2.0 (the "License");
201 * you may not use this file except in compliance with the License. 202 * You may obtain a copy of the License at 203 * 204 * http://www.apache.org/licenses/LICENSE-2.0 205 * 206 * Unless required by applicable law or agreed to in writing, software 207 * distributed under the License is distributed on an "AS IS" BASIS, 208 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 209 * See the License for the specific language governing permissions and 210 * limitations under the License. 211 */class Xl{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new ql(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** 212 * @license 213 * Copyright 2017 Google LLC 214 * 215 * Licensed under the Apache License, Version 2.0 (the "License"); 216 * you may not use this file except in compliance with the License. 217 * You may obtain a copy of the License at 218 * 219 * http://www.apache.org/licenses/LICENSE-2.0 220 * 221 * Unless required by applicable law or agreed to in writing, software 222 * distributed under the License is distributed on an "AS IS" BASIS, 223 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 224 * See the License for the specific language governing permissions and 225 * limitations under the License. 226 */var D;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(D||(D={}));const Jl={debug:D.DEBUG,verbose:D.VERBOSE,info:D.INFO,warn:D.WARN,error:D.ERROR,silent:D.SILENT},Yl=D.INFO,Ql={[D.DEBUG]:"log",[D.VERBOSE]:"log",[D.INFO]:"info",[D.WARN]:"warn",[D.ERROR]:"error"},Zl=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),s=Ql[e];if(s)console[s](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class It{constructor(e){this.name=e,this._logLevel=Yl,this._logHandler=Zl,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in D))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Jl[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,D.DEBUG,...e),this._logHandler(this,D.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,D.VERBOSE,...e),this._logHandler(this,D.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,D.INFO,...e),this._logHandler(this,D.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,D.WARN,...e),this._logHandler(this,D.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,D.ERROR,...e),this._logHandler(this,D.ERROR,...e)}}/** 227 * @license 228 * Copyright 2019 Google LLC 229 * 230 * Licensed under the Apache License, Version 2.0 (the "License"); 231 * you may not use this file except in compliance with the License. 232 * You may obtain a copy of the License at 233 * 234 * http://www.apache.org/licenses/LICENSE-2.0 235 * 236 * Unless required by applicable law or agreed to in writing, software 237 * distributed under the License is distributed on an "AS IS" BASIS, 238 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 239 * See the License for the specific language governing permissions and 240 * limitations under the License. 241 */class eu{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(tu(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function tu(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Bi="@firebase/app",Os="0.10.10";/** 242 * @license 243 * Copyright 2019 Google LLC 244 * 245 * Licensed under the Apache License, Version 2.0 (the "License");
246 * you may not use this file except in compliance with the License. 247 * You may obtain a copy of the License at 248 * 249 * http://www.apache.org/licenses/LICENSE-2.0 250 * 251 * Unless required by applicable law or agreed to in writing, software 252 * distributed under the License is distributed on an "AS IS" BASIS, 253 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 254 * See the License for the specific language governing permissions and 255 * limitations under the License. 256 */const De=new It("@firebase/app"),nu="@firebase/app-compat",iu="@firebase/analytics-compat",ru="@firebase/analytics",su="@firebase/app-check-compat",ou="@firebase/app-check",au="@firebase/auth",cu="@firebase/auth-compat",lu="@firebase/database",uu="@firebase/database-compat",hu="@firebase/functions",du="@firebase/functions-compat",fu="@firebase/installations",pu="@firebase/installations-compat",gu="@firebase/messaging",mu="@firebase/messaging-compat",_u="@firebase/performance",vu="@firebase/performance-compat",yu="@firebase/remote-config",Tu="@firebase/remote-config-compat",Iu="@firebase/storage",wu="@firebase/storage-compat",Eu="@firebase/firestore",bu="@firebase/vertexai-preview",Au="@firebase/firestore-compat",ku="firebase",Su="10.13.1";/** 257 * @license 258 * Copyright 2019 Google LLC 259 * 260 * Licensed under the Apache License, Version 2.0 (the "License"); 261 * you may not use this file except in compliance with the License. 262 * You may obtain a copy of the License at 263 * 264 * http://www.apache.org/licenses/LICENSE-2.0 265 * 266 * Unless required by applicable law or agreed to in writing, software 267 * distributed under the License is distributed on an "AS IS" BASIS, 268 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 269 * See the License for the specific language governing permissions and 270 * limitations under the License. 271 */const Hi="[DEFAULT]",Ru={[Bi]:"fire-core",[nu]:"fire-core-compat",[ru]:"fire-analytics",[iu]:"fire-analytics-compat",[ou]:"fire-app-check",[su]:"fire-app-check-compat",[au]:"fire-auth",[cu]:"fire-auth-compat",[lu]:"fire-rtdb",[uu]:"fire-rtdb-compat",[hu]:"fire-fn",[du]:"fire-fn-compat",[fu]:"fire-iid",[pu]:"fire-iid-compat",[gu]:"fire-fcm",[mu]:"fire-fcm-compat",[_u]:"fire-perf",[vu]:"fire-perf-compat",[yu]:"fire-rc",[Tu]:"fire-rc-compat",[Iu]:"fire-gcs",[wu]:"fire-gcs-compat",[Eu]:"fire-fst",[Au]:"fire-fst-compat",[bu]:"fire-vertex","fire-js":"fire-js",[ku]:"fire-js-all"};/** 272 * @license 273 * Copyright 2019 Google LLC 274 * 275 * Licensed under the Apache License, Version 2.0 (the "License"); 276 * you may not use this file except in compliance with the License. 277 * You may obtain a copy of the License at 278 * 279 * http://www.apache.org/licenses/LICENSE-2.0 280 * 281 * Unless required by applicable law or agreed to in writing, software 282 * distributed under the License is distributed on an "AS IS" BASIS, 283 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 284 * See the License for the specific language governing permissions and 285 * limitations under the License.
286 */const Kt=new Map,Cu=new Map,Vi=new Map;function Ns(t,e){try{t.container.addComponent(e)}catch(n){De.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function ee(t){const e=t.name;if(Vi.has(e))return De.debug(`There were multiple attempts to register component ${e}.`),!1;Vi.set(e,t);for(const n of Kt.values())Ns(n,t);for(const n of Cu.values())Ns(n,t);return!0}function me(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function ze(t){return t.settings!==void 0}/** 287 * @license 288 * Copyright 2019 Google LLC 289 * 290 * Licensed under the Apache License, Version 2.0 (the "License"); 291 * you may not use this file except in compliance with the License. 292 * You may obtain a copy of the License at 293 * 294 * http://www.apache.org/licenses/LICENSE-2.0 295 * 296 * Unless required by applicable law or agreed to in writing, software 297 * distributed under the License is distributed on an "AS IS" BASIS, 298 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 299 * See the License for the specific language governing permissions and 300 * limitations under the License. 301 */const Pu={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
301d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},qe=new be("app","Firebase",Pu);/** 302 * @license 303 * Copyright 2019 Google LLC 304 * 305 * Licensed under the Apache License, Version 2.0 (the "License"); 306 * you may not use this file except in compliance with the License. 307 * You may obtain a copy of the License at 308 * 309 * http://www.apache.org/licenses/LICENSE-2.0 310 * 311 * Unless required by applicable law or agreed to in writing, software 312 * distributed under the License is distributed on an "AS IS" BASIS, 313 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 314 * See the License for the specific language governing permissions and 315 * limitations under the License. 316 */class Ou{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new z("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw qe.create("app-deleted",{appName:this._name})}}/** 317 * @license 318 * Copyright 2019 Google LLC 319 * 320 * Licensed under the Apache License, Version 2.0 (the "License"); 321 * you may not use this file except in compliance with the License. 322 * You may obtain a copy of the License at 323 * 324 * http://www.apache.org/licenses/LICENSE-2.0 325 * 326 * Unless required by applicable law or agreed to in writing, software 327 * distributed under the License is distributed on an "AS IS" BASIS, 328 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 329 * See the License for the specific language governing permissions and 330 * limitations under the License. 331 */const rt=Su;function Nu(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Hi,automaticDataCollectionEnabled:!1},e),s=r.name;if(typeof s!="string"||!s)throw qe.create("bad-app-name",{appName:String(s)});if(n||(n=qo()),!n)throw qe.create("no-options");const a=Kt.get(s);if(a){if(Vt(n,a.options)&&Vt(r,a.config))return a;throw qe.create("duplicate-app",{appName:s})}const l=new Xl(s);for(const f of Vi.values())l.addComponent(f);const h=new Ou(n,r,l);return Kt.set(s,h),h}function st(t=Hi){const e=Kt.get(t);if(!e&&t===Hi&&qo())return Nu();if(!e)throw qe.create("no-app",{appName:t});return e}function I_(){return Array.from(Kt.values())}function H(t,e,n){var r;let s=(r=Ru[t])!==null&&r!==void 0?r:t;n&&(s+=`-${n}`);const a=s.match(/\s|\//),l=e.match(/\s|\//);if(a||l){const h=[`Unable to register library "${s}" with version "${e}":`];a&&h.push(`library name "${s}" contains illegal characters (whitespace or "/")`),a&&l&&h.push("and"),l&&h.push(`version name "${e}" contains illegal characters (whitespace or "/")`),De.warn(h.join(" "));return}ee(new z(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}/** 332 * @license 333 * Copyright 2021 Google LLC 334 * 335 * Licensed under the Apache License, Version 2.0 (the "License"); 336 * you may not use this file except in compliance with the License. 337 * You may obtain a copy of the License at 338 * 339 * http://www.apache.org/licenses/LICENSE-2.0 340 * 341 * Unless required by applicable law or agreed to in writing, softw
341are 342 * distributed under the License is distributed on an "AS IS" BASIS, 343 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 344 * See the License for the specific language governing permissions and 345 * limitations under the License. 346 */const Du="firebase-heartbeat-database",Mu=1,zt="firebase-heartbeat-store";let Ei=null;function Jo(){return Ei||(Ei=Bn(Du,Mu,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(zt)}catch(n){console.warn(n)}}}}).catch(t=>{throw qe.create("idb-open",{originalErrorMessage:t.message})})),Ei}async function Lu(t){try{const n=(await Jo()).transaction(zt),r=await n.objectStore(zt).get(Yo(t));return await n.done,r}catch(e){if(e instanceof ge)De.warn(e.message);else{const n=qe.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});De.warn(n.message)}}}async function Ds(t,e){try{const r=(await Jo()).transaction(zt,"readwrite");await r.objectStore(zt).put(e,Yo(t)),await r.done}catch(n){if(n instanceof ge)De.warn(n.message);else{const r=qe.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});De.warn(r.message)}}}function Yo(t){return`${t.name}!${t.options.appId}`}/** 347 * @license 348 * Copyright 2021 Google LLC 349 * 350 * Licensed under the Apache License, Version 2.0 (the "License"); 351 * you may not use this file except in compliance with the License. 352 * You may obtain a copy of the License at 353 * 354 * http://www.apache.org/licenses/LICENSE-2.0 355 * 356 * Unless required by applicable law or agreed to in writing, software 357 * distributed under the License is distributed on an "AS IS" BASIS, 358 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 359 * See the License for the specific language governing permissions and 360 * limitations under the License. 361 */const Uu=1024,xu=30*24*60*60*1e3;class Fu{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new ju(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),a=Ms();return((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===a||this._heartbeatsCache.heartbeats.some(l=>l.date===a)?void 0:(this._heartbeatsCache.heartbeats.push({date:a,agent:s}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(l=>{const h=new Date(l.date).valueOf();return Date.now()-h<=xu}),this._storage.overwrite(this._heartbeatsCache))}catch(r){De.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Ms(),{heartbeatsToSend:r,unsentEntries:s}=$u(this._heartbeatsCache.heartbeats),a=Cn(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}catch(n){return De.warn(n),""}}}function Ms(){return new Date().toISOString().substring(0,10)}function $u(t,e=Uu){const n=[];let r=t.slice();for(const s of t){const a=n.find(l=>l.agent===s.agent);if(a){if(a.dates.push(s.date),Ls(n)>e){a.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Ls(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class ju{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Tt()?Hn().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await Lu(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const s=await this.read();return Ds(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const s=await this.read();return Ds(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}}function Ls(t){return Cn(JSON.stringify({version:2,heartbeats:t})).length}/** 362 * @license 363 * Copyright 2019 Google LLC 364 * 365 * Licensed under the Apache License, Version 2.0 (the "License");
366 * you may not use this file except in compliance with the License. 367 * You may obtain a copy of the License at 368 * 369 * http://www.apache.org/licenses/LICENSE-2.0 370 * 371 * Unless required by applicable law or agreed to in writing, software 372 * distributed under the License is distributed on an "AS IS" BASIS, 373 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 374 * See the License for the specific language governing permissions and 375 * limitations under the License. 376 */function Bu(t){ee(new z("platform-logger",e=>new eu(e),"PRIVATE")),ee(new z("heartbeat",e=>new Fu(e),"PRIVATE")),H(Bi,Os,t),H(Bi,Os,"esm2017"),H("fire-js","")}Bu("");var Us=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license 377Copyright The Closure Library Authors. 378SPDX-License-Identifier: Apache-2.0 379*/var Qo;(function(){var t;/** @license 380 381 Copyright The Closure Library Authors. 382 SPDX-License-Identifier: Apache-2.0 383*/function e(v,d){function g(){}g.prototype=d.prototype,v.D=d.prototype,v.prototype=new g,v.prototype.constructor=v,v.C=function(m,_,T){for(var p=Array(arguments.length-2),ke=2;ke<arguments.length;ke++)p[ke-2]=arguments[ke];return d.prototype[_].apply(m,p)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,n),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function s(v,d,g){g||(g=0);var m=Array(16);if(typeof d=="string")for(var _=0;16>_;++_)m[_]=d.charCodeAt(g++)|d.charCodeAt(g++)<<8|d.charCodeAt(g++)<<16|d.charCodeAt(g++)<<24;else for(_=0;16>_;++_)m[_]=d[g++]|d[g++]<<8|d[g++]<<16|d[g++]<<24;d=v.g[0],g=v.g[1],_=v.g[2];var T=v.g[3],p=d+(T^g&(_^T))+m[0]+3614090360&4294967295;d=g+(p<<7&4294967295|p>>>25),p=T+(_^d&(g^_))+m[1]+3905402710&4294967295,T=d+(p<<12&4294967295|p>>>20),p=_+(g^T&(d^g))+m[2]+606105819&4294967295,_=T+(p<<17&4294967295|p>>>15),p=g+(d^_&(T^d))+m[3]+3250441966&4294967295,g=_+(p<<22&4294967295|p>>>10),p=d+(T^g&(_^T))+m[4]+4118548399&4294967295,d=g+(p<<7&4294967295|p>>>25),p=T+(_^d&(g^_))+m[5]+1200080426&4294967295,T=d+(p<<12&4294967295|p>>>20),p=_+(g^T&(d^g))+m[6]+2821735955&4294967295,_=T+(p<<17&4294967295|p>>>15),p=g+(d^_&(T^d))+m[7]+4249261313&4294967295,g=_+(p<<22&4294967295|p>>>10),p=d+(T^g&(_^T))+m[8]+1770035416&4294967295,d=g+(p<<7&4294967295|p>>>25),p=T+(_^d&(g^_))+m[9]+2336552879&4294967295,T=d+(p<<12&4294967295|p>>>20),p=_+(g^T&(d^g))+m[10]+4294925233&4294967295,_=T+(p<<17&4294967295|p>>>15),p=g+(d^_&(T^d))+m[11]+2304563134&4294967295,g=_+(p<<22&4294967295|p>>>10),p=d+(T^g&(_^T))+m[12]+1804603682&4294967295,d=g+(p<<7&4294967295|p>>>25),p=T+(_^d&(g^_))+m[13]+4254626195&4294967295,T=d+(p<<12&4294967295|p>>>20),p=_+(g^T&(d^g))+m[14]+2792965006&4294967295,_=T+(p<<17&4294967295|p>>>15),p=g+(d^_&(T^d))+m[15]+1236535329&4294967295,g=_+(p<<22&4294967295|p>>>10),p=d+(_^T&(g^_))+m[1]+4129170786&4294967295,d=g+(p<<5&4294967295|p>>>27),p=T+(g^_&(d^g))+m[6]+3225465664&4294967295,T=d+(p<<9&4294967295|p>>>23),p=_+(d^g&(T^d))+m[11]+643717713&4294967295,_=T+(p<<14&4294967295|p>>>18),p=g+(T^d&(_^T))+m[0]+3921069994&4294967295,g=_+(p<<20&4294967295|p>>>12),p=d+(_^T&(g^_))+m[5]+3593408605&4294967295,d=g+(p<<5&4294967295|p>>>27),p=T+(g^_&(d^g))+m[10]+38016083&4294967295,T=d+(p<<9&4294967295|p>>>23),p=_+(d^g&(T^d))+m[15]+3634488961&4294967295,_=T+(p<<14&4294967295|p>>>18),p=g+(T^d&(_^T))+m[4]+3889429448&4294967295,g=_+(p<<20&4294967295|p>>>12),p=d+(_^T&(g^_))+m[9]+568446438&4294967295,d=g+(p<<5&4294967295|p>>>27),p=T+(g^_&(d^g))+m[14]+3275163606&4294967295,T=d+(p<<9&4294967295|p>>>23),p=_+(d^g&(T^d))+m[3]+4107603335&4294967295,_=T+(p<<14&4294967295|p>>>18),p=g+(T^d&(_^T))+m[8]+1163531501&4294967295,g=_+(p<<20&4294967295|p>>>12),p=d+(_^T&(g^_))+m[13]+2850285829&4294967295,d=g+(p<<5&4294967295|p>>>27),p=T+(g^_&(d^g))+m[2]+4243563512&4294967295,T=d+(p<<9&4294967295|p>>>23),p=_+(d^g&(T^d))+m[7]+1735328473&4294967295,_=T+(p<<14&4294967295|p>>>18),p=g+(T^d&(_^T))+m[12]+2368359562&4294967295,g=_+(p<<20&4294967295|p>>>12),p=d+(g^_^T)+m[5]+4294588738&4294967295,d=g+(p<<4&4294967295|p>>>28),p=T+(d^g^_)+m[8]+2272392833&4294967295,T=d+(p<<11&4294967295|p>>>21),p=_+(T^d^g)+m[11]+1839030562&4294967295,_=T+(p<<16&4294967295|p>>>16),p=g+(_^T^d)+m[14]+4259657740&4294967295,g=_+(p<<23&4294967295|p>>>9),p=d+(g^_^T)+m[1]+2763975236&4294967295,d=g+(p<<4&4294967295|p>>>28),p=T+(d^g^_)+m[4]+1272893353&4294967295,T=d+(p<<11&4294967295|p>>>21),p=_+(T^d^g)+m[7]+4139469664&4294967295,_=T+(p<<16&4294967295|p>>>16),p=g+(_^T^d)+m[10]+3200236656&4294967295,g=_+(p<<23&4294967295|p>>>9),p=d+(g^_^T)+m[13]+681279174&4294967295,d=g+(p<<4&4294967295|p>>>28),p=T+(d^g^_)+m[0]+3936430074&4294967295,T=d+(p<<11&4294967295|p>>>21),p=_+(T^d^g)+m[3]+3572445317&4294967295,_=T+(p<<16&4294967295|p>>>16),p=g+(_^T^d)+m[6]+76029189&4294967295,g=_+(p<<23&4294967295|p>>>9),p=d+(g^_^T)+m[9]+3654602809&4294967295,d=g+(p<<4&4294967295|p>>>28),p=T+(d^g^_)+m[12]+3873151461&4294967295,T=d+(p<<11&4294967295|p>>>21),p=_+(T^d^g)+m[15]+530742520&4294967295,_=T+(p<<16&4294967295|p>>>16),p=g+(_^T^d)+m[2]+3299628645&4294967295,g=_+(p<<23&4294967295|p>>>9),p=d+(_^(g|~T))+m[0]+4096336452&4294967295,d=g+(p<<6&4294967295|p>>>26),p=T+(g^(d|~_))+m[7]+1126891415&4294967295,T=d+(p<<10&4294967295|p>>>22),p=_+(d^(T|~g))+m[14]+2878612391&4294967295,_=T+(p<<15&4294967295|p>>>17),p=g+(T^(_|~d))+m[5]+4237533241&4294967295,g=_+(p<<21&4294967295|p>>>11),p=d+(_^(g|~T))+m[12]+1700485571&4294967295,d=g+(p<<6&4294967295|p>>>26),p=T+(g^(d|~_))+m[3]+2399980690&4294967295,T=d+(p<<10&4294967295|p>>>22),p=_+(d^(T|~g))+m[10]+4293915773&4294967295,_=T+(p<<15&4294967295|p>>>17),p=g+(T^(_|~d))+m[1]+2240044497&4294967295,g=_+(p<<21&4294967295|p>>>11),p=d+(_^(g|~T))+m[8]+1873313359&4294967295,d=g+(p<<6&4294967295|p>>>26),p=T+(g^(d|~_))+m[15]+4264355552&4294967295,T=d+(p<<10&4294967295|p>>>22),p=_+(d^(T|~g))+m[6]+2734768916&4294967295,_=T+(p<<15&4294967295|p>>>17),p=g+(T^(_|~d))+m[13]+1309151649&4294967295,g=_+(p<<21&4294967295|p>>>11),p=d+(_^(g|~T))+m[4]+4149444226&4294967295,d=g+(p<<6&4294967295|p>>>26),p=T+(g^(d|~_))+m[11]+3174756917&4294967295,T=d+(p<<10&4294967295|p>>>22),p=_+(d^(T|~g))+m[2]+718787259&4294967295,_=T+(p<<15&4294967295|p>>>17),p=g+(T^(_|~d))+m[9]+3951481745&4294967295,v.g[0]=v.g[0]+d&4294967295,v.g[1]=v.g[1]+(_+(p<<21&4294967295|p>>>11))&4294967295,v.g[2]=v.g[2]+_&4294967295,v.g[3]=v.g[3]+T&4294967295}r.prototype.u=function(v,d){d===void 0&&(d=v.length);for(var g=d-this.blockSize,m=this.B,_=this.h,T=0;T<d;){if(_==0)for(;T<=g;)s(this,v,T),T+=this.blockSize;if(typeof v=="string"){for(;T<d;)if(m[_++]=v.charCodeAt(T++),_==this.blockSize){s(this,m),_=0;break}}else for(;T<d;
vendor: 8,296 bytes, lines 383-387
383)if(m[_++]=v[T++],_==this.blockSize){s(this,m),_=0;break}}this.h=_,this.o+=d},r.prototype.v=function(){var v=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);v[0]=128;for(var d=1;d<v.length-8;++d)v[d]=0;var g=8*this.o;for(d=v.length-8;d<v.length;++d)v[d]=g&255,g/=256;for(this.u(v),v=Array(16),d=g=0;4>d;++d)for(var m=0;32>m;m+=8)v[g++]=this.g[d]>>>m&255;return v};function a(v,d){var g=h;return Object.prototype.hasOwnProperty.call(g,v)?g[v]:g[v]=d(v)}function l(v,d){this.h=d;for(var g=[],m=!0,_=v.length-1;0<=_;_--){var T=v[_]|0;m&&T==d||(g[_]=T,m=!1)}this.g=g}var h={};function f(v){return-128<=v&&128>v?a(v,function(d){return new l([d|0],0>d?-1:0)}):new l([v|0],0>v?-1:0)}function I(v){if(isNaN(v)||!isFinite(v))return A;if(0>v)return C(I(-v));for(var d=[],g=1,m=0;v>=g;m++)d[m]=v/g|0,g*=4294967296;return new l(d,0)}function E(v,d){if(v.length==0)throw Error("number format error: empty string");if(d=d||10,2>d||36<d)throw Error("radix out of range: "+d);if(v.charAt(0)=="-")return C(E(v.substring(1),d));if(0<=v.indexOf("-"))throw Error('number format error: interior "-" character');for(var g=I(Math.pow(d,8)),m=A,_=0;_<v.length;_+=8){var T=Math.min(8,v.length-_),p=parseInt(v.substring(_,_+T),d);8>T?(T=I(Math.pow(d,T)),m=m.j(T).add(I(p))):(m=m.j(g),m=m.add(I(p)))}return m}var A=f(0),k=f(1),O=f(16777216);t=l.prototype,t.m=function(){if(U(this))return-C(this).m();for(var v=0,d=1,g=0;g<this.g.length;g++){var m=this.i(g);v+=(0<=m?m:4294967296+m)*d,d*=4294967296}return v},t.toString=function(v){if(v=v||10,2>v||36<v)throw Error("radix out of range: "+v);if(R(this))return"0";if(U(this))return"-"+C(this).toString(v);for(var d=I(Math.pow(v,6)),g=this,m="";;){var _=F(g,d).g;g=oe(g,_.j(d));var T=((0<g.g.length?g.g[0]:g.h)>>>0).toString(v);if(g=_,R(g))return T+m;for(;6>T.length;)T="0"+T;m=T+m}},t.i=function(v){return 0>v?0:v<this.g.length?this.g[v]:this.h};function R(v){if(v.h!=0)return!1;for(var d=0;d<v.g.length;d++)if(v.g[d]!=0)return!1;return!0}function U(v){return v.h==-1}t.l=function(v){return v=oe(this,v),U(v)?-1:R(v)?0:1};function C(v){for(var d=v.g.length,g=[],m=0;m<d;m++)g[m]=~v.g[m];return new l(g,~v.h).add(k)}t.abs=function(){return U(this)?C(this):this},t.add=function(v){for(var d=Math.max(this.g.length,v.g.length),g=[],m=0,_=0;_<=d;_++){var T=m+(this.i(_)&65535)+(v.i(_)&65535),p=(T>>>16)+(this.i(_)>>>16)+(v.i(_)>>>16);m=p>>>16,T&=65535,p&=65535,g[_]=p<<16|T}return new l(g,g[g.length-1]&-2147483648?-1:0)};function oe(v,d){return v.add(C(d))}t.j=function(v){if(R(this)||R(v))return A;if(U(this))return U(v)?C(this).j(C(v)):C(C(this).j(v));if(U(v))return C(this.j(C(v)));if(0>this.l(O)&&0>v.l(O))return I(this.m()*v.m());for(var d=this.g.length+v.g.length,g=[],m=0;m<2*d;m++)g[m]=0;for(m=0;m<this.g.length;m++)for(var _=0;_<v.g.length;_++){var T=this.i(m)>>>16,p=this.i(m)&65535,ke=v.i(_)>>>16,Et=v.i(_)&65535;g[2*m+2*_]+=p*Et,te(g,2*m+2*_),g[2*m+2*_+1]+=T*Et,te(g,2*m+2*_+1),g[2*m+2*_+1]+=p*ke,te(g,2*m+2*_+1),g[2*m+2*_+2]+=T*ke,te(g,2*m+2*_+2)}for(m=0;m<d;m++)g[m]=g[2*m+1]<<16|g[2*m];for(m=d;m<2*d;m++)g[m]=0;return new l(g,0)};function te(v,d){for(;(v[d]&65535)!=v[d];)v[d+1]+=v[d]>>>16,v[d]&=65535,d++}function x(v,d){this.g=v,this.h=d}function F(v,d){if(R(d))throw Error("division by zero");if(R(v))return new x(A,A);if(U(v))return d=F(C(v),d),new x(C(d.g),C(d.h));if(U(d))return d=F(v,C(d)),new x(C(d.g),d.h);if(30<v.g.length){if(U(v)||U(d))throw Error("slowDivide_ only works with positive integers.");for(var g=k,m=d;0>=m.l(v);)g=fe(g),m=fe(m);var _=B(g,1),T=B(m,1);for(m=B(m,2),g=B(g,2);!R(m);){var p=T.add(m);0>=p.l(v)&&(_=_.add(g),T=p),m=B(m,1),g=B(g,1)}return d=oe(v,_.j(d)),new x(_,d)}for(_=A;0<=v.l(d);){for(g=Math.max(1,Math.floor(v.m()/d.m())),m=Math.ceil(Math.log(g)/Math.LN2),m=48>=m?1:Math.pow(2,m-48),T=I(g),p=T.j(d);U(p)||0<p.l(v);)g-=m,T=I(g),p=T.j(d);R(T)&&(T=k),_=_.add(T),v=oe(v,p)}return new x(_,v)}t.A=function(v){return F(this,v).h},t.and=function(v){for(var d=Math.max(this.g.length,v.g.length),g=[],m=0;m<d;m++)g[m]=this.i(m)&v.i(m);return new l(g,this.h&v.h)},t.or=function(v){for(var d=Math.max(this.g.length,v.g.length),g=[],m=0;m<d;m++)g[m]=this.i(m)|v.i(m);return new l(g,this.h|v.h)},t.xor=function(v){for(var d=Math.max(this.g.length,v.g.length),g=[],m=0;m<d;m++)g[m]=this.i(m)^v.i(m);return new l(g,this.h^v.h)};function fe(v){for(var d=v.g.length+1,g=[],m=0;m<d;m++)g[m]=v.i(m)<<1|v.i(m-1)>>>31;return new l(g,v.h)}function B(v,d){var g=d>>5;d%=32;for(var m=v.g.length-g,_=[],T=0;T<m;T++)_[T]=0<d?v.i(T+g)>>>d|v.i(T+g+1)<<32-d:v.i(T+g);return new l(_,v.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,l.prototype.add=l.prototype.add,l.prototype.multiply=l.prototype.j,l.prototype.modulo=l.prototype.A,l.prototype.compare=l.prototype.l,l.prototype.toNumber=l.prototype.m,l.prototype.toString=l.prototype.toString,l.prototype.getBits=l.prototype.i,l.fromNumber=I,l.fromString=E,Qo=l}).apply(typeof Us<"u"?Us:typeof self<"u"?self:typeof window<"u"?window:{});var yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(i,o,c){return i==Array.prototype||i==Object.prototype||(i[o]=c.value),i};function n(i){i=[typeof globalThis=="object"&&globalThis,i,typeof window=="object"&&window,typeof self=="object"&&self,typeof yn=="object"&&yn];for(var o=0;o<i.length;++o){var c=i[o];if(c&&c.Math==Math)return c}throw Error("Cannot find global object")}var r=n(this);function s(i,o){if(o)e:{var c=r;i=i.split(".");for(var u=0;u<i.length-1;u++){var y=i[u];if(!(y in c))break e;c=c[y]}i=i[i.length-1],u=c[i],o=o(u),o!=u&&o!=null&&e(c,i,{configurable:!0,writable:!0,value:o})}}function a(i,o){i instanceof String&&(i+="");var c=0,u=!1,y={next:function(){if(!u&&c<i.length){var w=c++;return{value:o(w,i[w]),done:!1}}return u=!0,{done:!0,value:void 0}}};return y[Symbol.iterator]=function(){return y},y}s("Array.prototype.values",function(i){return i||function(){return a(this,function(o,c){return c})}});/** @license 384 385 Copyright The Closure Library Authors. 386 SPDX-License-Identifier: Apache-2.0 387*/var l=l||{},h=this||self;function f(i){var o=typeof i;return o=o!="object"?o:i?Array.isArray(i)?"array":o:"null",o=="array"||o=="object"&&typeof i.length=="number"}function I(i){var o=typeof i;return o=="object"&&i!=null||o=="function"}function E(i,o,c){return i.call.apply(i.bind,arguments)}function A(i,o,c){if(!i)throw Error();if(2<arguments.length){var u=Array.prototype.slice.call(arguments,2);return function(){var y=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(y,u),i.apply(o,y)}}return function(){return i.apply(o,arguments)}}function k(i,o,c){return k=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?E:A,k.apply(null,arguments)}function O(i,o){var c=Array.prototype.slice.call(arguments,1);return function(){var u=c.slice();return u.push.apply(u,arguments),i.apply(this,u)}}function R(i,o){function c(){}c.prototype=o.prototype,i.aa=o.prototype,i.prototype=new c,i.prototype.constructor=i,i.Qb=function(u,y,w){for(var b=Array(arguments.length-2),M=2;M<arguments.length;M++)b[M-2]=arguments[M];return o.prototype[y].apply(u,b)}}function U(i){const o=i.length;if(0<o){const c=Array(o);for(let u=0;u<o;u++)c[u]=i[u];return c}return[]}function C(i,o){for(let c=1;c<arguments.length;c++){const u=arguments[c];if(f(u)){const y=i.length||0,w=u.length||0;i.length=y+w;for(let b=0;b<w;b++)i[y+b]=u[b]}else i.push(u)}}class oe{constructor(o,c){this.i=o,this.j=c,this.h=0,this.g=null}get(){let o;return 0<this.h?(this.h--,o=this.g,this.g=o.next,o.next=null):o=this.i(),o}}function te(i){return/^[\s\xa0]*$/.test(i)}function x(){var i=h.navigator;return i&&(i=i.userAgent)?i:""}function F(i){return F[" "](i),i}F[" "]=function(){};var fe=x().indexOf("Gecko")!=-1&&!(x().toLowerCase().indexOf("webkit")!=-1&&x().indexOf("Edge")==-1)&&!(x().indexOf("Trident")!=-1||x().indexOf("MSIE")!=-1)&&x().indexOf("Edge")==-1;function B(i,o,c){for(const u in i)o.call(c,i[u],u,i)}function v(i,o){for(const c in i)o.call(void 0,i[c],c,i)}function d(i){const o={};for(const c in i)o[c]=i[c];return o}const g="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
387ing toString valueOf".split(" ");function m(i,o){let c,u;for(let y=1;y<arguments.length;y++){u=arguments[y];for(c in u)i[c]=u[c];for(let w=0;w<g.length;w++)c=g[w],Object.prototype.hasOwnProperty.call(u,c)&&(i[c]=u[c])}}function _(i){var o=1;i=i.split(":");const c=[];for(;0<o&&i.length;)c.push(i.shift()),o--;return i.length&&c.push(i.join(":")),c}function T(i){h.setTimeout(()=>{throw i},0)}function p(){var i=Xn;let o=null;return i.g&&(o=i.g,i.g=i.g.next,i.g||(i.h=null),o.next=null),o}class ke{constructor(){this.h=this.g=null}add(o,c){const u=Et.get();u.set(o,c),this.h?this.h.next=u:this.g=u,this.h=u}}var Et=new oe(()=>new Hc,i=>i.reset());class Hc{constructor(){this.next=this.g=this.h=null}set(o,c){this.h=o,this.g=c,this.next=null}reset(){this.next=this.g=this.h=null}}let bt,At=!1,Xn=new ke,Or=()=>{const i=h.Promise.resolve(void 0);bt=()=>{i.then(Vc)}};var Vc=()=>{for(var i;i=p();){try{i.h.call(i.g)}catch(c){T(c)}var o=Et;o.j(i),100>o.h&&(o.h++,i.next=o.g,o.g=i)}At=!1};function Ue(){this.s=this.s,this.C=this.C}Ue.prototype.s=!1,Ue.prototype.ma=function(){this.s||(this.s=!0,this.N())},Ue.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function q(i,o){this.type=i,this.g=this.target=o,this.defaultPrevented=!1}q.prototype.h=function(){this.defaultPrevented=!0};var Kc=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var i=!1,o=Object.defineProperty({},"passive",{get:function(){i=!0}});try{const c=()=>{};h.addEventListener("test",c,o),h.removeEventListener("test",c,o)}catch{}return i}();function kt(i,o){if(q.call(this,i?i.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,i){var c=this.type=i.type,u=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:null;if(this.target=i.target||i.srcElement,this.g=o,o=i.relatedTarget){if(fe){e:{try{F(o.nodeName);var y=!0;break e}catch{}y=!1}y||(o=null)}}else c=="mouseover"?o=i.fromElement:c=="mouseout"&&(o=i.toElement);this.relatedTarget=o,u?(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0):(this.clientX=i.clientX!==void 0?i.clientX:i.pageX,this.clientY=i.clientY!==void 0?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0),this.button=i.button,this.key=i.key||"",this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.shiftKey=i.shiftKey,this.metaKey=i.metaKey,this.pointerId=i.pointerId||0,this.pointerType=typeof i.pointerType=="string"?i.pointerType:zc[i.pointerType]||"",this.state=i.state,this.i=i,i.defaultPrevented&&kt.aa.h.call(this)}}R(kt,q);var zc={2:"touch",3:"pen",4:"mouse"};kt.prototype.h=function(){kt.aa.h.call(this);var i=this.i;i.preventDefault?i.preventDefault():i.returnValue=!1};var nn="closure_listenable_"+(1e6*Math.random()|0),qc=0;function Wc(i,o,c,u,y){this.listener=i,this.proxy=null,this.src=o,this.type=c,this.capture=!!u,this.ha=y,this.key=++qc,this.da=this.fa=!1}function rn(i){i.da=!0,i.listener=null,i.proxy=null,i.src=null,i.ha=null}function sn(i){this.src=i,this.g={},this.h=0}sn.prototype.add=function(i,o,c,u,y){var w=i.toString();i=this.g[w],i||(i=this.g[w]=[],this.h++);var b=Yn(i,o,u,y);return-1<b?(o=i[b],c||(o.fa=!1)):(o=new Wc(o,this.src,w,!!u,y),o.fa=c,i.push(o)),o};function Jn(i,o){var c=o.type;if(c in i.g){var u=i.g[c],y=Array.prototype.indexOf.call(u,o,void 0),w;(w=0<=y)&&Array.prototype.splice.call(u,y,1),w&&(rn(o),i.g[c].length==0&&(delete i.g[c],i.h--))}}function Yn(i,o,c,u){for(var y=0;y<i.length;++y){var w=i[y];if(!w.da&&w.listener==o&&w.capture==!!c&&w.ha==u)return y}return-1}var Qn="closure_lm_"+(1e6*Math.random()|0),Zn={};function Nr(i,o,c,u,y){if(Array.isArray(o)){for(var w=0;w<o.length;w++)Nr(i,o[w],c,u,y);return null}return c=Lr(c),i&&i[nn]?i.K(o,c,I(u)?!!u.capture:!!u,y):Gc(i,o,c,!1,u,y)}function Gc(i,o,c,u,y,w){if(!o)throw Error("Invalid event type");var b=I(y)?!!y.capture:!!y,M=ti(i);if(M||(i[Qn]=M=new sn(i)),c=M.add(o,c,u,b,w),c.proxy)return c;if(u=Xc(),c.proxy=u,u.src=i,u.listener=c,i.addEventListener)Kc||(y=b),y===void 0&&(y=!1),i.addEventListener(o.toString(),u,y);else if(i.attachEvent)i.attachEvent(Mr(o.toString()),u);else if(i.addListener&&i.removeListener)i.addListener(u);else throw Error("addEventListener and attachEvent are unavailable.");return c}function Xc(){function i(c){return o.call(i.src,i.listener,c)}const o=Jc;return i}function Dr(i,o,c,u,y){if(Array.isArray(o))for(var w=0;w<o.length;
vendor: 31,005 bytes, lines 387-395
387w++)Dr(i,o[w],c,u,y);else u=I(u)?!!u.capture:!!u,c=Lr(c),i&&i[nn]?(i=i.i,o=String(o).toString(),o in i.g&&(w=i.g[o],c=Yn(w,c,u,y),-1<c&&(rn(w[c]),Array.prototype.splice.call(w,c,1),w.length==0&&(delete i.g[o],i.h--)))):i&&(i=ti(i))&&(o=i.g[o.toString()],i=-1,o&&(i=Yn(o,c,u,y)),(c=-1<i?o[i]:null)&&ei(c))}function ei(i){if(typeof i!="number"&&i&&!i.da){var o=i.src;if(o&&o[nn])Jn(o.i,i);else{var c=i.type,u=i.proxy;o.removeEventListener?o.removeEventListener(c,u,i.capture):o.detachEvent?o.detachEvent(Mr(c),u):o.addListener&&o.removeListener&&o.removeListener(u),(c=ti(o))?(Jn(c,i),c.h==0&&(c.src=null,o[Qn]=null)):rn(i)}}}function Mr(i){return i in Zn?Zn[i]:Zn[i]="on"+i}function Jc(i,o){if(i.da)i=!0;else{o=new kt(o,this);var c=i.listener,u=i.ha||i.src;i.fa&&ei(i),i=c.call(u,o)}return i}function ti(i){return i=i[Qn],i instanceof sn?i:null}var ni="__closure_events_fn_"+(1e9*Math.random()>>>0);function Lr(i){return typeof i=="function"?i:(i[ni]||(i[ni]=function(o){return i.handleEvent(o)}),i[ni])}function W(){Ue.call(this),this.i=new sn(this),this.M=this,this.F=null}R(W,Ue),W.prototype[nn]=!0,W.prototype.removeEventListener=function(i,o,c,u){Dr(this,i,o,c,u)};function ne(i,o){var c,u=i.F;if(u)for(c=[];u;u=u.F)c.push(u);if(i=i.M,u=o.type||o,typeof o=="string")o=new q(o,i);else if(o instanceof q)o.target=o.target||i;else{var y=o;o=new q(u,i),m(o,y)}if(y=!0,c)for(var w=c.length-1;0<=w;w--){var b=o.g=c[w];y=on(b,u,!0,o)&&y}if(b=o.g=i,y=on(b,u,!0,o)&&y,y=on(b,u,!1,o)&&y,c)for(w=0;w<c.length;w++)b=o.g=c[w],y=on(b,u,!1,o)&&y}W.prototype.N=function(){if(W.aa.N.call(this),this.i){var i=this.i,o;for(o in i.g){for(var c=i.g[o],u=0;u<c.length;u++)rn(c[u]);delete i.g[o],i.h--}}this.F=null},W.prototype.K=function(i,o,c,u){return this.i.add(String(i),o,!1,c,u)},W.prototype.L=function(i,o,c,u){return this.i.add(String(i),o,!0,c,u)};function on(i,o,c,u){if(o=i.i.g[String(o)],!o)return!0;o=o.concat();for(var y=!0,w=0;w<o.length;++w){var b=o[w];if(b&&!b.da&&b.capture==c){var M=b.listener,K=b.ha||b.src;b.fa&&Jn(i.i,b),y=M.call(K,u)!==!1&&y}}return y&&!u.defaultPrevented}function Ur(i,o,c){if(typeof i=="function")c&&(i=k(i,c));else if(i&&typeof i.handleEvent=="function")i=k(i.handleEvent,i);else throw Error("Invalid listener argument");return 2147483647<Number(o)?-1:h.setTimeout(i,o||0)}function xr(i){i.g=Ur(()=>{i.g=null,i.i&&(i.i=!1,xr(i))},i.l);const o=i.h;i.h=null,i.m.apply(null,o)}class Yc extends Ue{constructor(o,c){super(),this.m=o,this.l=c,this.h=null,this.i=!1,this.g=null}j(o){this.h=arguments,this.g?this.i=!0:xr(this)}N(){super.N(),this.g&&(h.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function St(i){Ue.call(this),this.h=i,this.g={}}R(St,Ue);var Fr=[];function $r(i){B(i.g,function(o,c){this.g.hasOwnProperty(c)&&ei(o)},i),i.g={}}St.prototype.N=function(){St.aa.N.call(this),$r(this)},St.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var ii=h.JSON.stringify,Qc=h.JSON.parse,Zc=class{stringify(i){return h.JSON.stringify(i,void 0)}parse(i){return h.JSON.parse(i,void 0)}};function ri(){}ri.prototype.h=null;function jr(i){return i.h||(i.h=i.i())}function el(){}var Rt={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function si(){q.call(this,"d")}R(si,q);function oi(){q.call(this,"c")}R(oi,q);var ot={},Br=null;function ai(){return Br=Br||new W}ot.La="serverreachability";function Hr(i){q.call(this,ot.La,i)}R(Hr,q);function Ct(i){const o=ai();ne(o,new Hr(o))}ot.STAT_EVENT="statevent";function Vr(i,o){q.call(this,ot.STAT_EVENT,i),this.stat=o}R(Vr,q);function ie(i){const o=ai();ne(o,new Vr(o,i))}ot.Ma="timingevent";function Kr(i,o){q.call(this,ot.Ma,i),this.size=o}R(Kr,q);function Pt(i,o){if(typeof i!="function")throw Error("Fn must not be null and must be a function");return h.setTimeout(function(){i()},o)}function Ot(){this.g=!0}Ot.prototype.xa=function(){this.g=!1};function tl(i,o,c,u,y,w){i.info(function(){if(i.g)if(w)for(var b="",M=w.split("&"),K=0;K<M.length;K++){var N=M[K].split("=");if(1<N.length){var G=N[0];N=N[1];var X=G.split("_");b=2<=X.length&&X[1]=="type"?b+(G+"="+N+"&"):b+(G+"=redacted&")}}else b=null;else b=w;return"XMLHTTP REQ ("+u+") [attempt "+y+"]: "+o+` 388`+c+` 389`+b})}function nl(i,o,c,u,y,w,b){i.info(function(){return"XMLHTTP RESP ("+u+") [ attempt "+y+"]: "+o+` 390`+c+` 391`+w+" "+b})}function at(i,o,c,u){i.info(function(){return"XMLHTTP TEXT ("+o+"): "+rl(i,c)+(u?" "+u:"")})}function il(i,o){i.info(function(){return"TIMEOUT: "+o})}Ot.prototype.info=function(){};function rl(i,o){if(!i.g)return o;if(!o)return null;try{var c=JSON.parse(o);if(c){for(i=0;i<c.length;i++)if(Array.isArray(c[i])){var u=c[i];if(!(2>u.length)){var y=u[1];if(Array.isArray(y)&&!(1>y.length)){var w=y[0];if(w!="noop"&&w!="stop"&&w!="close")for(var b=1;b<y.length;b++)y[b]=""}}}}return ii(c)}catch{return o}}var ci={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},sl={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},li;function an(){}R(an,ri),an.prototype.g=function(){return new XMLHttpRequest},an.prototype.i=function(){return{}},li=new an;function xe(i,o,c,u){this.j=i,this.i=o,this.l=c,this.R=u||1,this.U=new St(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new zr}function zr(){this.i=null,this.g="",this.h=!1}var qr={},ui={};function hi(i,o,c){i.L=1,i.v=hn(Se(o)),i.m=c,i.P=!0,Wr(i,null)}function Wr(i,o){i.F=Date.now(),cn(i),i.A=Se(i.v);var c=i.A,u=i.R;Array.isArray(u)||(u=[String(u)]),as(c.i,"t",u),i.C=0,c=i.j.J,i.h=new zr,i.g=As(i.j,c?o:null,!i.m),0<i.O&&(i.M=new Yc(k(i.Y,i,i.g),i.O)),o=i.U,c=i.g,u=i.ca;var y="readystatechange";Array.isArray(y)||(y&&(Fr[0]=y.toString()),y=Fr);for(var w=0;w<y.length;w++){var b=Nr(c,y[w],u||o.handleEvent,!1,o.h||o);if(!b)break;o.g[b.key]=b}o=i.H?d(i.H):{},i.m?(i.u||(i.u="POST"),o["Content-Type"]="application/x-www-form-urlencoded",i.g.ea(i.A,i.u,i.m,o)):(i.u="GET",i.g.ea(i.A,i.u,null,o)),Ct(),tl(i.i,i.u,i.A,i.l,i.R,i.m)}xe.prototype.ca=function(i){i=i.target;const o=this.M;o&&Re(i)==3?o.j():this.Y(i)},xe.prototype.Y=function(i){try{if(i==this.g)e:{const X=Re(this.g);var o=this.g.Ba();const ut=this.g.Z();if(!(3>X)&&(X!=3||this.g&&(this.h.h||this.g.oa()||ps(this.g)))){this.J||X!=4||o==7||(o==8||0>=ut?Ct(3):Ct(2)),di(this);var c=this.g.Z();this.X=c;t:if(Gr(this)){var u=ps(this.g);i="";var y=u.length,w=Re(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Xe(this),Nt(this);var b="";break t}this.h.i=new h.TextDecoder}for(o=0;o<y;o++)this.h.h=!0,i+=this.h.i.decode(u[o],{stream:!(w&&o==y-1)});u.length=0,this.h.g+=i,this.C=0,b=this.h.g}else b=this.g.oa();if(this.o=c==200,nl(this.i,this.u,this.A,this.l,this.R,X,c),this.o){if(this.T&&!this.K){t:{if(this.g){var M,K=this.g;if((M=K.g?K.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!te(M)){var N=M;break t}}N=null}if(c=N)at(this.i,this.l,c,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,fi(this,c);else{this.o=!1,this.s=3,ie(12),Xe(this),Nt(this);break e}}if(this.P){c=!0;let _e;for(;!this.J&&this.C<b.length;)if(_e=ol(this,b),_e==ui){X==4&&(this.s=4,ie(14),c=!1),at(this.i,this.l,null,"[Incomplete Response]");break}else if(_e==qr){this.s=4,ie(15),at(this.i,this.l,b,"[Invalid Chunk]"),c=!1;break}else at(this.i,this.l,_e,null),fi(this,_e);if(Gr(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),X!=4||b.length!=0||this.h.h||(this.s=1,ie(16),c=!1),this.o=this.o&&c,!c)at(this.i,this.l,b,"[Invalid Chunked Response]"),Xe(this),Nt(this);else if(0<b.length&&!this.W){this.W=!0;var G=this.j;G.g==this&&G.ba&&!G.M&&(G.j.info("Great, no buffering proxy detected. Bytes received: "+b.length),yi(G),G.M=!0,ie(11))}}else at(this.i,this.l,b,null),fi(this,b);X==4&&Xe(this),this.o&&!this.J&&(X==4?Is(this.j,this):(this.o=!1,cn(this)))}else El(this.g),c==400&&0<b.indexOf("Unknown SID")?(this.s=3,ie(12)):(this.s=0,ie(13)),Xe(this),Nt(this)}}}catch{}finally{}};function Gr(i){return i.g?i.u=="GET"&&i.L!=2&&i.j.Ca:!1}function ol(i,o){var c=i.C,u=o.indexOf(` 392`,c);return u==-1?ui:(c=Number(o.substring(c,u)),isNaN(c)?qr:(u+=1,u+c>o.length?ui:(o=o.slice(u,u+c),i.C=u+c,o)))}xe.prototype.cancel=function(){this.J=!0,Xe(this)};function cn(i){i.S=Date.now()+i.I,Xr(i,i.I)}function Xr(i,o){if(i.B!=null)throw Error("WatchDog timer not null");i.B=Pt(k(i.ba,i),o)}function di(i){i.B&&(h.clearTimeout(i.B),i.B=null)}xe.prototype.ba=function(){this.B=null;const i=Date.now();0<=i-this.S?(il(this.i,this.A),this.L!=2&&(Ct(),ie(17)),Xe(this),this.s=2,Nt(this)):Xr(this,this.S-i)};function Nt(i){i.j.G==0||i.J||Is(i.j,i)}function Xe(i){di(i);var o=i.M;o&&typeof o.ma=="function"&&o.ma(),i.M=null,$r(i.U),i.g&&(o=i.g,i.g=null,o.abort(),o.ma())}function fi(i,o){try{var c=i.j;if(c.G!=0&&(c.g==i||pi(c.h,i))){if(!i.K&&pi(c.h,i)&&c.G==3){try{var u=c.Da.g.parse(o)}catch{u=null}if(Array.isArray(u)&&u.length==3){var y=u;if(y[0]==0){e:if(!c.u){if(c.g)if(c.g.F+3e3<i.F)_n(c),gn(c);else break e;vi(c),ie(18)}}else c.za=y[1],0<c.za-c.T&&37500>y[2]&&c.F&&c.v==0&&!c.C&&(c.C=Pt(k(c.Za,c),6e3));if(1>=Qr(c.h)&&c.ca){try{c.ca()}catch{}c.ca=void 0}}else Ye(c,11)}else if((i.K||c.g==i)&&_n(c),!te(o))for(y=c.Da.g.parse(o),o=0;o<y.length;o++){let N=y[o];if(c.T=N[0],N=N[1],c.G==2)if(N[0]=="c"){c.K=N[1],c.ia=N[2];const G=N[3];G!=null&&(c.la=G,c.j.info("VER="+c.la));const X=N[4];X!=null&&(c.Aa=X,c.j.info("SVER="+c.Aa));const ut=N[5];ut!=null&&typeof ut=="number"&&0<ut&&(u=1.5*ut,c.L=u,c.j.info("backChannelRequestTimeoutMs_="+u)),u=c;const _e=i.g;if(_e){const vn=_e.g?_e.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(vn){var w=u.h;w.g||vn.indexOf("spdy")==-1&&vn.indexOf("quic")==-1&&vn.indexOf("h2")==-1||(w.j=w.l,w.g=new Set,w.h&&(gi(w,w.h),w.h=null))}if(u.D){const Ti=_e.g?_e.g.getResponseHeader("X-HTTP-Session-Id"):null;Ti&&(u.ya=Ti,L(u.I,u.D,Ti))}}c.G=3,c.l&&c.l.ua(),c.ba&&(c.R=Date.now()-i.F,c.j.info("Handshake RTT: "+c.R+"ms")),u=c;var b=i;if(u.qa=bs(u,u.J?u.ia:null,u.W),b.K){Zr(u.h,b);var M=b,K=u.L;K&&(M.I=K),M.B&&(di(M),cn(M)),u.g=b}else ys(u);0<c.i.length&&mn(c)}else N[0]!="stop"&&N[0]!="close"||Ye(c,7);else c.G==3&&(N[0]=="stop"||N[0]=="close"?N[0]=="stop"?Ye(c,7):_i(c):N[0]!="noop"&&c.l&&c.l.ta(N),c.v=0)}}Ct(4)}catch{}}var al=class{constructor(i,o){this.g=i,this.map=o}};function Jr(i){this.l=i||10,h.PerformanceNavigationTiming?(i=h.performance.getEntriesByType("navigation"),i=0<i.length&&(i[0].nextHopProtocol=="hq"||i[0].nextHopProtocol=="h2")):i=!!(h.chrome&&h.chrome.loadTimes&&h.chrome.loadTimes()&&h.chrome.loadTimes().wasFetchedViaSpdy),this.j=i?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Yr(i){return i.h?!0:i.g?i.g.size>=i.j:!1}function Qr(i){return i.h?1:i.g?i.g.size:0}function pi(i,o){return i.h?i.h==o:i.g?i.g.has(o):!1}function gi(i,o){i.g?i.g.add(o):i.h=o}function Zr(i,o){i.h&&i.h==o?i.h=null:i.g&&i.g.has(o)&&i.g.delete(o)}Jr.prototype.cancel=function(){if(this.i=es(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const i of this.g.values())i.cancel();this.g.clear()}};function es(i){if(i.h!=null)return i.i.concat(i.h.D);if(i.g!=null&&i.g.size!==0){let o=i.i;for(const c of i.g.values())o=o.concat(c.D);return o}return U(i.i)}function cl(i){if(i.V&&typeof i.V=="function")return i.V();if(typeof Map<"u"&&i instanceof Map||typeof Set<"u"&&i instanceof Set)return Array.from(i.values());if(typeof i=="string")return i.split("");if(f(i)){for(var o=[],c=i.length,u=0;u<c;u++)o.push(i[u]);return o}o=[],c=0;for(u in i)o[c++]=i[u];return o}function ll(i){if(i.na&&typeof i.na=="function")return i.na();if(!i.V||typeof i.V!="function"){if(typeof Map<"u"&&i instanceof Map)return Array.from(i.keys());if(!(typeof Set<"u"&&i instanceof Set)){if(f(i)||typeof i=="string"){var o=[];i=i.length;for(var c=0;c<i;c++)o.push(c);return o}o=[],c=0;for(const u in i)o[c++]=u;return o}}}function ts(i,o){if(i.forEach&&typeof i.forEach=="function")i.forEach(o,void 0);else if(f(i)||typeof i=="string")Array.prototype.forEach.call(i,o,void 0);else for(var c=ll(i),u=cl(i),y=u.length,w=0;w<y;w++)o.call(void 0,u[w],c&&c[w],i)}var ns=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function ul(i,o){if(i){i=i.split("&");for(var c=0;c<i.length;c++){var u=i[c].indexOf("="),y=null;if(0<=u){var w=i[c].substring(0,u);y=i[c].substring(u+1)}else w=i[c];o(w,y?decodeURIComponent(y.replace(/\+/g," ")):"")}}}function Je(i){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,i instanceof Je){this.h=i.h,ln(this,i.j),this.o=i.o,this.g=i.g,un(this,i.s),this.l=i.l;var o=i.i,c=new Lt;c.i=o.i,o.g&&(c.g=new Map(o.g),c.h=o.h),is(this,c),this.m=i.m}else i&&(o=String(i).match(ns))?(this.h=!1,ln(this,o[1]||"",!0),this.o=Dt(o[2]||""),this.g=Dt(o[3]||"",!0),un(this,o[4]),this.l=Dt(o[5]||"",!0),is(this,o[6]||"",!0),this.m=Dt(o[7]||"")):(this.h=!1,this.i=new Lt(null,this.h))}Je.prototype.toString=function(){var i=[],o=this.j;o&&i.push(Mt(o,rs,!0),":");var c=this.g;return(c||o=="file")&&(i.push("//"),(o=this.o)&&i.push(Mt(o,rs,!0),"@"),i.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.s,c!=null&&i.push(":",String(c))),(c=this.l)&&(this.g&&c.charAt(0)!="/"&&i.push("/"),i.push(Mt(c,c.charAt(0)=="/"?fl:dl,!0))),(c=this.i.toString())&&i.push("?",c),(c=this.m)&&i.push("#",Mt(c,gl)),i.join("")};function Se(i){return new Je(i)}function ln(i,o,c){i.j=c?Dt(o,!0):o,i.j&&(i.j=i.j.replace(/:$/,""))}function un(i,o){if(o){if(o=Number(o),isNaN(o)||0>o)throw Error("Bad port number "+o);i.s=o}else i.s=null}function is(i,o,c){o instanceof Lt?(i.i=o,ml(i.i,i.h)):(c||(o=Mt(o,pl)),i.i=new Lt(o,i.h))}function L(i,o,c){i.i.set(o,c)}function hn(i){return L(i,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),i}function Dt(i,o){return i?o?decodeURI(i.replace(/%25/g,"%2525")):decodeURIComponent(i):""}function Mt(i,o,c){return typeof i=="string"?(i=encodeURI(i).replace(o,hl),c&&(i=i.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),i):null}function hl(i){return i=i.charCodeAt(0),"%"+(i>>4&15).toString(16)+(i&15).toString(16)}var rs=/[#\/\?@]/g,dl=/[#\?:]/g,fl=/[#\?]/g,pl=/[#\?@]/g,gl=/#/g;function Lt(i,o){this.h=this.g=null,this.i=i||null,this.j=!!o}function Fe(i){i.g||(i.g=new Map,i.h=0,i.i&&ul(i.i,function(o,c){i.add(decodeURIComponent(o.replace(/\+/g," ")),c)}))}t=Lt.prototype,t.add=function(i,o){Fe(this),this.i=null,i=ct(this,i);var c=this.g.get(i);return c||this.g.set(i,c=[]),c.push(o),this.h+=1,this};function ss(i,o){Fe(i),o=ct(i,o),i.g.has(o)&&(i.i=null,i.h-=i.g.get(o).length,i.g.delete(o))}function os(i,o){return Fe(i),o=ct(i,o),i.g.has(o)}t.forEach=function(i,o){Fe(this),this.g.forEach(function(c,u){c.forEach(function(y){i.call(o,y,u,this)},this)},this)},t.na=function(){Fe(this);const i=Array.from(this.g.values()),o=Array.from(this.g.keys()),c=[];for(let u=0;u<o.length;u++){const y=i[u];for(let w=0;w<y.length;w++)c.push(o[u])}return c},t.V=function(i){Fe(this);let o=[];if(typeof i=="string")os(this,i)&&(o=o.concat(this.g.get(ct(this,i))));else{i=Array.from(this.g.values());for(let c=0;c<i.length;c++)o=o.concat(i[c])}return o},t.set=function(i,o){return Fe(this),this.i=null,i=ct(this,i),os(this,i)&&(this.h-=this.g.get(i).length),this.g.set(i,[o]),this.h+=1,this},t.get=function(i,o){return i?(i=this.V(i),0<i.length?String(i[0]):o):o};function as(i,o,c){ss(i,o),0<c.length&&(i.i=null,i.g.set(ct(i,o),U(c)),i.h+=c.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const i=[],o=Array.from(this.g.keys());for(var c=0;c<o.length;c++){var u=o[c];const w=encodeURIComponent(String(u)),b=this.V(u);for(u=0;u<b.length;u++){var y=w;b[u]!==""&&(y+="="+encodeURIComponent(String(b[u]))),i.push(y)}}return this.i=i.join("&")};function ct(i,o){return o=String(o),i.j&&(o=o.toLowerCase()),o}function ml(i,o){o&&!i.j&&(Fe(i),i.i=null,i.g.forEach(function(c,u){var y=u.toLowerCase();u!=y&&(ss(this,u),as(this,y,c))},i)),i.j=o}function _l(i,o){const c=new Ot;if(h.Image){const u=new Image;u.onload=O($e,c,"TestLoadImage: loaded",!0,o,u),u.onerror=O($e,c,"TestLoadImage: error",!1,o,u),u.onabort=O($e,c,"TestLoadImage: abort",!1,o,u),u.ontimeout=O($e,c,"TestLoadImage: timeout",!1,o,u),h.setTimeout(function(){u.ontimeout&&u.ontimeout()},1e4),u.src=i}else o(!1)}function vl(i,o){const c=new Ot,u=new AbortController,y=setTimeout(()=>{u.abort(),$e(c,"TestPingServer: timeout",!1,o)},1e4);fetch(i,{signal:u.signal}).then(w=>{clearTimeout(y),w.ok?$e(c,"TestPingServer: ok",!0,o):$e(c,"TestPingServer: server error",!1,o)}).catch(()=>{clearTimeout(y),$e(c,"TestPingServer: error",!1,o)})}function $e(i,o,c,u,y){try{y&&(y.onload=null,y.onerror=null,y.onabort=null,y.ontimeout=null),u(c)}catch{}}function yl(){this.g=new Zc}function Tl(i,o,c){const u=c||"";try{ts(i,function(y,w){let b=y;I(y)&&(b=ii(y)),o.push(u+w+"="+encodeURIComponent(b))})}catch(y){throw o.push(u+"type="+encodeURIComponent("_badmap")),y}}function dn(i){this.l=i.Ub||null,this.j=i.eb||!1}R(dn,ri),dn.prototype.g=function(){return new fn(this.l,this.j)},dn.prototype.i=function(i){return function(){return i}}({});function fn(i,o){W.call(this),this.D=i,this.o=o,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}R(fn,W),t=fn.prototype,t.open=function(i,o){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=i,this.A=o,this.readyState=1,xt(this)},t.send=function(i){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const o={headers:this.u,method:this.B,credentials:this.m,cache:void 0};i&&(o.body=i),(this.D||h).fetch(new Request(this.A,o)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Ut(this)),this.readyState=0},t.Sa=function(i){if(this.g&&(this.l=i,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=i.headers,this.readyState=2,xt(this)),this.g&&(this.readyState=3,xt(this),this.g)))if(this.responseType==="arraybuffer")i.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof h.ReadableStream<"u"&&"body"in i){if(this.j=i.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;cs(this)}else i.text().then(this.Ra.bind(this),this.ga.bind(this))};function cs(i){i.j.read().then(i.Pa.bind(i)).catch(i.ga.bind(i))}t.Pa=function(i){if(this.g){if(this.o&&i.value)this.response.push(i.value);else if(!this.o){var o=i.value?i.value:new Uint8Array(0);(o=this.v.decode(o,{stream:!i.done}))&&(this.response=this.responseText+=o)}i.done?Ut(this):xt(this),this.readyState==3&&cs(this)}},t.Ra=function(i){this.g&&(this.response=this.responseText=i,Ut(this))},t.Qa=function(i){this.g&&(this.response=i,Ut(this))},t.ga=function(){this.g&&Ut(this)};function Ut(i){i.readyState=4,i.l=null,i.j=null,i.v=null,xt(i)}t.setRequestHeader=function(i,o){this.u.append(i,o)},t.getResponseHeader=function(i){return this.h&&this.h.get(i.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const i=[],o=this.h.entries();for(var c=o.next();!c.done;)c=c.value,i.push(c[0]+": "+c[1]),c=o.next();return i.join(`\r 393`)};function xt(i){i.onreadystatechange&&i.onreadystatechange.call(i)}Object.defineProperty(fn.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(i){this.m=i?"include":"same-origin"}});function ls(i){let o="";return B(i,function(c,u){o+=u,o+=":",o+=c,o+=`\r 394`}),o}function mi(i,o,c){e:{for(u in c){var u=!1;break e}u=!0}u||(c=ls(c),typeof i=="string"?c!=null&&encodeURIComponent(String(c)):L(i,o,c))}function $(i){W.call(this),this.headers=new Map,this.o=i||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}R($,W);var Il=/^https?$/i,wl=["POST","PUT"];t=$.prototype,t.Ha=function(i){this.J=i},t.ea=function(i,o,c,u){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+i);o=o?o.toUpperCase():"GET",this.D=i,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():li.g(),this.v=this.o?jr(this.o):jr(li),this.g.onreadystatechange=k(this.Ea,this);try{this.B=!0,this.g.open(o,String(i),!0),this.B=!1}catch(w){us(this,w);return}if(i=c||"",c=new Map(this.headers),u)if(Object.getPrototypeOf(u)===Object.prototype)for(var y in u)c.set(y,u[y]);else if(typeof u.keys=="function"&&typeof u.get=="function")for(const w of u.keys())c.set(w,u.get(w));else throw Error("Unknown input type for opt_headers: "+String(u));u=Array.from(c.keys()).find(w=>w.toLowerCase()=="content-type"),y=h.FormData&&i instanceof h.FormData,!(0<=Array.prototype.indexOf.call(wl,o,void 0))||u||y||c.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[w,b]of c)this.g.setRequestHeader(w,b);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{fs(this),this.u=!0,this.g.send(i),this.u=!1}catch(w){us(this,w)}};function us(i,o){i.h=!1,i.g&&(i.j=!0,i.g.abort(),i.j=!1),i.l=o,i.m=5,hs(i),pn(i)}function hs(i){i.A||(i.A=!0,ne(i,"complete"),ne(i,"error"))}t.abort=function(i){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=i||7,ne(this,"complete"),ne(this,"abort"),pn(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),pn(this,!0)),$.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?ds(this):this.bb())},t.bb=function(){ds(this)};function ds(i){if(i.h&&typeof l<"u"&&(!i.v[1]||Re(i)!=4||i.Z()!=2)){if(i.u&&Re(i)==4)Ur(i.Ea,0,i);else if(ne(i,"readystatechange"),Re(i)==4){i.h=!1;try{const b=i.Z();e:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break e;default:o=!1}var c;if(!(c=o)){var u;if(u=b===0){var y=String(i.D).match(ns)[1]||null;!y&&h.self&&h.self.location&&(y=h.self.location.protocol.slice(0,-1)),u=!Il.test(y?y.toLowerCase():"")}c=u}if(c)ne(i,"complete"),ne(i,"success");else{i.m=6;try{var w=2<Re(i)?i.g.statusText:""}catch{w=""}i.l=w+" ["+i.Z()+"]",hs(i)}}finally{pn(i)}}}}function pn(i,o){if(i.g){fs(i);const c=i.g,u=i.v[0]?()=>{}:null;i.g=null,i.v=null,o||ne(i,"ready");try{c.onreadystatechange=u}catch{}}}function fs(i){i.I&&(h.clearTimeout(i.I),i.I=null)}t.isActive=function(){return!!this.g};function Re(i){return i.g?i.g.readyState:0}t.Z=function(){try{return 2<Re(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(i){if(this.g){var o=this.g.responseText;return i&&o.indexOf(i)==0&&(o=o.substring(i.length)),Qc(o)}};function ps(i){try{if(!i.g)return null;if("response"in i.g)return i.g.response;switch(i.H){case"":case"text":return i.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in i.g)return i.g.mozResponseArrayBuffer}return null}catch{return null}}function El(i){const o={};i=(i.g&&2<=Re(i)&&i.g.getAllResponseHeaders()||"").split(`\r 395`);for(let u=0;u<i.length;u++){if(te(i[u]))continue;var c=_(i[u]);const y=c[0];if(c=c[1],typeof c!="string")continue;c=c.trim();const w=o[y]||[];o[y]=w,w.push(c)}v(o,function(u){return u.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Ft(i,o,c){return c&&c.internalChannelParams&&c.internalChannelParams[i]||o}function gs(i){this.Aa=0,this.i=[],this.j=new Ot,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Ft("failFast",!1,i),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Ft("baseRetryDelayMs",5e3,i),this.cb=Ft("retryDelaySeedMs",1e4,i),this.Wa=Ft("forwardChannelMaxRetries",2,i),this.wa=Ft("forwardChannelRequestTimeoutMs",2e4,i),this.pa=i&&i.xmlHttpFactory||void 0,this.Xa=i&&i.Tb||void 0,this.Ca=i&&i.useFetchStreams||!1,this.L=void 0,this.J=i&&i.supportsCrossDomainXhr||!1,this.K="",this.h=new Jr(i&&i.concurrentRequestLimit),this.Da=new yl,this.P=i&&i.fastHandshake||!1,this.O=i&&i.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=i&&i.Rb||!1,i&&i.xa&&this.j.xa(),i&&i.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&i&&i.detectBufferingProxy||!1,this.ja=void 0,i&&i.longPollingTimeout&&0<i.longPollingTimeout&&(this.ja=i.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=gs.prototype,t.la=8,t.G=1,t.connect=function(i,o,c,u){ie(0),this.W=i,this.H=o||{},c&&u!==void 0&&(this.H.OSID=c,this.H.OAID=u),this.F=this.X,this.I=bs(this,null,this.W),mn(this)};function _i(i){if(ms(i),i.G==3){var o=i.U++,c=Se(i.I);if(L(c,"SID",i.K),L(c,"RID",o),L(c,"TYPE","terminate"),$t(i,c),o=new xe(i,i.j,o),o.L=2,o.v=hn(Se(c)),c=!1,h.navigator&&h.navigator.sendBeacon)try{c=h.navigator.sendBeacon(o.v.toString(),"")}catch{}!c&&h.Image&&(new Image().src=o.v,c=!0),c||(o.g=As(o.j,null),o.g.ea(o.v)),o.F=Date.now(),cn(o)}Es(i)}function gn(i){i.g&&(yi(i),i.g.cancel(),i.g=null)}function ms(i){gn(i),i.u&&(h.clearTimeout(i.u),i.u=null),_n(i),i.h.cancel(),i.s&&(typeof i.s=="number"&&h.clearTimeout(i.s),i.s=null)}function mn(i){if(!Yr(i.h)&&!i.s){i.s=!0;var o=i.Ga;bt||Or(),At||(bt(),At=!0),Xn.add(o,i),i.B=0}}function bl(i,o){return Qr(i.h)>=i.h.j-(i.s?1:0)?!1:i.s?(i.i=o.D.concat(i.i),!0):i.G==1||i.G==2||i.B>=(i.Va?0:i.Wa)?!1:(i.s=Pt(k(i.Ga,i,o),ws(i,i.B)),i.B++,!0)}t.Ga=function(i){if(this.s)if(this.s=null,this.G==1){if(!i){this.U=Math.floor(1e5*Math.random()),i=this.U++;const y=new xe(this,this.j,i);let w=this.o;if(this.S&&(w?(w=d(w),m(w,this.S)):w=this.S),this.m!==null||this.O||(y.H=w,w=null),this.P)e:{for(var o=0,c=0;c<this.i.length;c++){t:{var u=this.i[c];if("__data__"in u.map&&(u=u.map.__data__,typeof u=="string")){u=u.length;break t}u=void 0}if(u===void 0)break;if(o+=u,4096<o){o=c;break e}if(o===4096||c===this.i.length-1){o=c+1;break e}}o=1e3}else o=1e3;o=vs(this,y,o),c=Se(this.I),L(c,"RID",i),L(c,"CVER",22),this.D&&L(c,"X-HTTP-Session-Id",this.D),$t(this,c),w&&(this.O?o="headers="+encodeURIComponent(String(ls(w)))+"&"+o:this.m&&mi(c,this.m,w)),gi(this.h,y),this.Ua&&L(c,"TYPE","init"),this.P?(L(c,"$req",o),L(c,"SID","null"),y.T=!0,hi(y,c,null)):hi(y,c,o),this.G=2}}else this.G==3&&(i?_s(this,i):this.i.length==0||Yr(this.h)||_s(this))};function _s(i,o){var c;o?c=o.l:c=i.U++;const u=Se(i.I);L(u,"SID",i.K),L(u,"RID",c),L(u,"AID",i.T),$t(i,u),i.m&&i.o&&mi(u,i.m,i.o),c=new xe(i,i.j,c,i.B+1),i.m===null&&(c.H=i.o),o&&(i.i=o.D.concat(i.i)),o=vs(i,c,1e3),c.I=Math.round(.5*i.wa)+Math.round(.5*i.wa*Math.random()),gi(i.h,c),hi(c,u,o)}function $t(i,o){i.H&&B(i.H,function(c,u){L(o,u,c)}),i.l&&ts({},function(c,u){L(o,u,c)})}function vs(i,o,c){c=Math.min(i.i.length,c);var u=i.l?k(i.l.Na,i.l,i):null;e:{var y=i.i;let w=-1;for(;;){const b=["count="+c];w==-1?0<c?(w=y[0].g,b.push("ofs="+w)):w=0:b.push("ofs="+w);let M=!0;for(let K=0;K<c;K++){let N=y[K].g;const G=y[K].map;if(N-=w,0>N)w=Math.max(0,y[K].g-100),M=!1;else try{Tl(G,b,"req"+N+"_")}catch{u&&u(G)}}if(M){u=b.join("&");break e}}}return i=i.i.splice(0,c),o.D=i,u}function ys(i){if(!i.g&&!i.u){i.Y=1;var o=i.Fa;bt||Or(),At||(bt(),At=!0),Xn.add(o,i),i.v=0}}function vi(i){return i.g||i.u||3<=i.v?!1:(i.Y++,i.u=Pt(k(i.Fa,i),ws(i,i.v)),i.v++,!0)}t.Fa=function(){if(this.u=null,Ts(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var i=2*this.R;this.j.info("BP detection timer enabled: "+i),this.A=Pt(k(this.ab,this),i)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,ie(10),gn(this),Ts(this))};function yi(i){i.A!=null&&(h.clearTimeout(i.A),i.A=null)}function Ts(i){i.g=new xe(i,i.j,"rpc",i.Y),i.m===null&&(i.g.H=i.o),i.g.O=0;var o=Se(i.qa);L(o,"RID","rpc"),L(o,"SID",i.K),L(o,"AID",i.T),L(o,"CI",i.F?"0":"1"),!i.F&&i.ja&&L(o,"TO",i.ja),L(o,"TYPE","xmlhttp"),$t(i,o),i.m&&i.o&&mi(o,i.m,i.o),i.L&&(i.g.I=i.L);var c=i.g;i=i.ia,c.L=1,c.v=hn(Se(o)),c.m=null,c.P=!0,Wr(c,i)}t.Za=function(){this.C!=null&&(this.C=null,gn(this),vi(this),ie(19))};function _n(i){i.C!=null&&(h.clearTimeout(i.C),i.C=null)}function Is(i,o){var c=null;if(i.g==o){_n(i),yi(i),i.g=null;var u=2}else if(pi(i.h,o))c=o.D,Zr(i.h,o),u=1;else return;if(i.G!=0){if(o.o)if(u==1){c=o.m?o.m.length:0,o=Date.now()-o.F;var y=i.B;u=ai(),ne(u,new Kr(u,c)),mn(i)}else ys(i);else if(y=o.s,y==3||y==0&&0<o.X||!(u==1&&bl(i,o)||u==2&&vi(i)))switch(c&&0<c.length&&(o=i.h,o.i=o.i.concat(c)),y){case 1:Ye(i,5);break;case 4:Ye(i,10);break;case 3:Ye(i,6);break;default:Ye(i,2)}}}function ws(i,o){let c=i.Ta+Math.floor(Math.random()*i.cb);return i.isActive()||(c*=2),c*o}function Ye(i,o){if(i.j.info("Error code "+o),o==2){var c=k(i.fb,i),u=i.Xa;const y=!u;u=new Je(u||"//www.google.com/images/cleardot.gif"),h.location&&h.location.protocol=="http"||ln(u,"https"),hn(u),y?_l(u.toString(),c):vl(u.toString(),c)}else ie(2);i.G=0,i.l&&i.l.sa(o),Es(i),ms(i)}t.fb=function(i){i?(this.j.info("Successfully pinged google.com"),ie(2)):(this.j.info("Failed to ping google.com"),ie(1))};function Es(i){if(i.G=0,i.ka=[],i.l){const o=es(i.h);(o.length!=0||i.i.length!=0)&&(C(i.ka,o),C(i.ka,i.i),i.h.i.length=0,U(i.i),i.i.length=0),i.l.ra()}}function bs(i,o,c){var u=c instanceof Je?Se(c):new Je(c);if(u.g!="")o&&(u.g=o+"."+u.g),un(u,u.s);else{var y=h.location;u=y.protocol,o=o?o+"."+y.hostname:y.hostname,y=+y.port;var w=new Je(null);u&&ln(w,u),o&&(w.g=o),y&&un(w,y),c&&(w.l=c),u=w}return c=i.D,o=i.ya,c&&o&&L(u,c,o),L(u,"VER",i.la),$t(i,u),u}function As(i,o,c){if(o&&!i.J)throw Error("Can't create secondary domain capable XhrIo object.");return o=i.Ca&&!i.pa?new $(new dn({eb:c})):new $(i.pa),o.Ha(i.J),o}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function ks(){}t=ks.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function pe(i,o){W.call(this),this.g=new gs(o),this.l=i,this.h=o&&o.messageUrlParams||null,i=o&&o.messageHeaders||null,o&&o.clientProtocolHeaderRequired&&(i?i["X-Client-Protocol"]="webchannel":i={"X-Client-Protocol":"webchannel"}),this.g.o=i,i=o&&o.initMessageHeaders||null,o&&o.messageContentType&&(i?i["X-WebChannel-Content-Type"]=o.messageContentType:i={"X-WebChannel-Content-Type":o.messageContentType}),o&&o.va&&(i?i["X-WebChannel-Client-Profile"]=o.va:i={"X-WebChannel-Client-Profile":o.va}),this.g.S=i,(i=o&&o.Sb)&&!te(i)&&(this.g.m=i),this.v=o&&o.supportsCrossDomainXhr||!1,this.u=o&&o.send
395RawJson||!1,(o=o&&o.httpSessionIdParam)&&!te(o)&&(this.g.D=o,i=this.h,i!==null&&o in i&&(i=this.h,o in i&&delete i[o])),this.j=new lt(this)}R(pe,W),pe.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},pe.prototype.close=function(){_i(this.g)},pe.prototype.o=function(i){var o=this.g;if(typeof i=="string"){var c={};c.__data__=i,i=c}else this.u&&(c={},c.__data__=ii(i),i=c);o.i.push(new al(o.Ya++,i)),o.G==3&&mn(o)},pe.prototype.N=function(){this.g.l=null,delete this.j,_i(this.g),delete this.g,pe.aa.N.call(this)};function Ss(i){si.call(this),i.__headers__&&(this.headers=i.__headers__,this.statusCode=i.__status__,delete i.__headers__,delete i.__status__);var o=i.__sm__;if(o){e:{for(const c in o){i=c;break e}i=void 0}(this.i=i)&&(i=this.i,o=o!==null&&i in o?o[i]:void 0),this.data=o}else this.data=i}R(Ss,si);function Rs(){oi.call(this),this.status=1}R(Rs,oi);function lt(i){this.g=i}R(lt,ks),lt.prototype.ua=function(){ne(this.g,"a")},lt.prototype.ta=function(i){ne(this.g,new Ss(i))},lt.prototype.sa=function(i){ne(this.g,new Rs)},lt.prototype.ra=function(){ne(this.g,"b")},pe.prototype.send=pe.prototype.o,pe.prototype.open=pe.prototype.m,pe.prototype.close=pe.prototype.close,ci.NO_ERROR=0,ci.TIMEOUT=8,ci.HTTP_ERROR=6,sl.COMPLETE="complete",el.EventType=Rt,Rt.OPEN="a",Rt.CLOSE="b",Rt.ERROR="c",Rt.MESSAGE="d",W.prototype.listen=W.prototype.K,$.prototype.listenOnce=$.prototype.L,$.prototype.getLastError=$.prototype.Ka,$.prototype.getLastErrorCode=$.prototype.Ba,$.prototype.getStatus=$.prototype.Z,$.prototype.getResponseJson=$.prototype.Oa,$.prototype.getResponseText=$.prototype.oa,$.prototype.send=$.prototype.ea,$.prototype.setWithCredentials=$.prototype.Ha}).apply(typeof yn<"u"?yn:typeof self<"u"?self:typeof window<"u"?window:{});const xs="@firebase/firestore";/** 396 * @license 397 * Copyright 2017 Google LLC 398 * 399 * Licensed under the Apache License, Version 2.0 (the "License"); 400 * you may not use this file except in compliance with the License. 401 * You may obtain a copy of the License at 402 * 403 * http://www.apache.org/licenses/LICENSE-2.0 404 * 405 * Unless required by applicable law or agreed to in writing, software 406 * distributed under the License is distributed on an "AS IS" BASIS, 407 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 408 * See the License for the specific language governing permissions and 409 * limitations under the License. 410 */class J{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}J.UNAUTHENTICATED=new J(null),J.GOOGLE_CREDENTIALS=new J("google-credentials-uid"),J.FIRST_PARTY=new J("first-party-uid"),J.MOCK_USER=new J("mock-user");/** 411 * @license 412 * Copyright 2017 Google LLC 413 * 414 * Licensed under the Apache License, Version 2.0 (the "License"); 415 * you may not use this file except in compliance with the License. 416 * You may obtain a copy of the License at 417 * 418 * http://www.apache.org/licenses/LICENSE-2.0 419 * 420 * Unless required by applicable law or agreed to in writing, software 421 * distributed under the License is distributed on an "AS IS" BASIS, 422 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 423 * See the License for the specific language governing permissions and 424 * limitations under the License. 425 */let Qt="10.13.1";/** 426 * @license 427 * Copyright 2017 Google LLC 428 * 429 * Licensed under the Apache License, Version 2.0 (the "License"); 430 * you may not use this file except in compliance with the License. 431 * You may obtain a copy of the License at 432 * 433 * http://www.apache.org/licenses/LICENSE-2.0 434 * 435 * Unless required by applicable law or agreed to in writing, software 436 * distributed under the License is distributed on an "AS IS" BASIS, 437 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 438 * See the License for the specific language governing permissions and 439 * limitations under the License. 440 */const vt=new It("@firebase/firestore");function le(t,...e){if(vt.logLevel<=D.DEBUG){const n=e.map(rr);vt.debug(`Firestore (${Qt}): ${t}`,...n)}}function ir(t,...e){if(vt.logLevel<=D.ERROR){const n=e.map(rr);vt.error(`Firestore (${Qt}): ${t}`,...n)}}function Hu(t,...e){if(vt.logLevel<=D.WARN){const n=e.map(rr);vt.warn(`Firestore (${Qt}): ${t}`,...n)}}function rr(t){if(typeof t=="string")return t;try{/** 441* @license 442* Copyright 2020 Google LLC 443* 444* Licensed under the Apache License, Version 2.0 (the "License");
445* you may not use this file except in compliance with the License. 446* You may obtain a copy of the License at 447* 448* http://www.apache.org/licenses/LICENSE-2.0 449* 450* Unless required by applicable law or agreed to in writing, software 451* distributed under the License is distributed on an "AS IS" BASIS, 452* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 453* See the License for the specific language governing permissions and 454* limitations under the License. 455*/return function(n){return JSON.stringify(n)}(t)}catch{return t}}/** 456 * @license 457 * Copyright 2017 Google LLC 458 * 459 * Licensed under the Apache License, Version 2.0 (the "License"); 460 * you may not use this file except in compliance with the License. 461 * You may obtain a copy of the License at 462 * 463 * http://www.apache.org/licenses/LICENSE-2.0 464 * 465 * Unless required by applicable law or agreed to in writing, software 466 * distributed under the License is distributed on an "AS IS" BASIS, 467 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 468 * See the License for the specific language governing permissions and 469 * limitations under the License. 470 */function sr(t="Unexpected state"){const e=`FIRESTORE (${Qt}) INTERNAL ASSERTION FAILED: `+t;throw ir(e),new Error(e)}function Ki(t,e){t||sr()}/** 471 * @license 472 * Copyright 2017 Google LLC 473 * 474 * Licensed under the Apache License, Version 2.0 (the "License"); 475 * you may not use this file except in compliance with the License. 476 * You may obtain a copy of the License at 477 * 478 * http://www.apache.org/licenses/LICENSE-2.0 479 * 480 * Unless required by applicable law or agreed to in writing, software 481 * distributed under the License is distributed on an "AS IS" BASIS, 482 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 483 * See the License for the specific language governing permissions and 484 * limitations under the License. 485 */const Q={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Z extends ge{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** 486 * @license 487 * Copyright 2017 Google LLC 488 * 489 * Licensed under the Apache License, Version 2.0 (the "License"); 490 * you may not use this file except in compliance with the License. 491 * You may obtain a copy of the License at 492 * 493 * http://www.apache.org/licenses/LICENSE-2.0 494 * 495 * Unless required by applicable law or agreed to in writing, software 496 * distributed under the License is distributed on an "AS IS" BASIS, 497 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 498 * See the License for the specific language governing permissions and 499 * limitations under the License. 500 */class ft{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/** 501 * @license 502 * Copyright 2017 Google LLC 503 * 504 * Licensed under the Apache License, Version 2.0 (the "License"); 505 * you may not use this file except in compliance with the License. 506 * You may obtain a copy of the License at 507 * 508 * http://www.apache.org/licenses/LICENSE-2.0 509 * 510 * Unless required by applicable law or agreed to in writing, software 511 * distributed under the License is distributed on an "AS IS" BASIS, 512 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 513 * See the License for the specific language governing permissions and 514 * limitations under the License. 515 */class Zo{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Vu{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(J.UNAUTHENTICATED))}shutdown(){}}class Ku{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class zu{constructor(e){this.t=e,this.currentUser=J.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){let r=this.i;const s=f=>this.i!==r?(r=this.i,n(f)):Promise.resolve();let a=new ft;this.o=()=>{this.i++,this.currentUser=this.u(),a.resolve(),a=new ft,e.enqueueRetryable(()=>s(this.currentUser))};const l=()=>{const f=a;e.enqueueRetryable(async()=>{await f.promise,await s(this.currentUser)})},h=f=>{le("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=f,this.auth.addAuthTokenListener(this.o),l()};this.t.onInit(f=>h(f)),setTimeout(()=>{if(!this.auth){const f=this.t.getImmediate({optional:!0});f?h(f):(le("FirebaseAuthCredentialsProvider","Auth not yet detected"),a.resolve(),a=new ft)}}
515,0),l()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(le("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Ki(typeof r.accessToken=="string"),new Zo(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return Ki(e===null||typeof e=="string"),new J(e)}}class qu{constructor(e,n,r){this.l=e,this.h=n,this.P=r,this.type="FirstParty",this.user=J.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class Wu{constructor(e,n,r){this.l=e,this.h=n,this.P=r}getToken(){return Promise.resolve(new qu(this.l,this.h,this.P))}start(e,n){e.enqueueRetryable(()=>n(J.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Gu{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Xu{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,n){const r=a=>{a.error!=null&&le("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${a.error.message}`);const l=a.token!==this.R;return this.R=a.token,le("FirebaseAppCheckTokenProvider",`Received ${l?"new":"existing"} token.`),l?n(a.token):Promise.resolve()};this.o=a=>{e.enqueueRetryable(()=>r(a))};const s=a=>{le("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=a,this.appCheck.addTokenListener(this.o)};this.A.onInit(a=>s(a)),setTimeout(()=>{if(!this.appCheck){const a=this.A.getImmediate({optional:!0});a?s(a):le("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Ki(typeof n.token=="string"),this.R=n.token,new Gu(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/** 516 * @license 517 * Copyright 2020 Google LLC 518 * 519 * Licensed under the Apache License, Version 2.0 (the "License"); 520 * you may not use this file except in compliance with the License. 521 * You may obtain a copy of the License at 522 * 523 * http://www.apache.org/licenses/LICENSE-2.0 524 * 525 * Unless required by applicable law or agreed to in writing, software 526 * distributed under the License is distributed on an "AS IS" BASIS, 527 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 528 * See the License for the specific language governing permissions and 529 * limitations under the License. 530 */function Ju(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}/** 531 * @license 532 * Copyright 2017 Google LLC 533 * 534 * Licensed under the Apache License, Version 2.0 (the "License"); 535 * you may not use this file except in compliance with the License. 536 * You may obtain a copy of the License at 537 * 538 * http://www.apache.org/licenses/LICENSE-2.0 539 * 540 * Unless required by applicable law or agreed to in writing, software 541 * distributed under the License is distributed on an "AS IS" BASIS, 542 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 543 * See the License for the specific language governing permissions and 544 * limitations under the License. 545 */class Yu{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=Math.floor(256/e.length)*e.length;let r="";for(;r.length<20;){const s=Ju(40);for(let a=0;a<s.length;++a)r.length<20&&s[a]<n&&(r+=e.charAt(s[a]%e.length))}return r}}function ea(t){return t.name==="IndexedDbTransactionError"}/** 546 * @license 547 * Copyright 2017 Google LLC 548 * 549 * Licensed under the Apache License, Version 2.0 (the "License");
550 * you may not use this file except in compliance with the License. 551 * You may obtain a copy of the License at 552 * 553 * http://www.apache.org/licenses/LICENSE-2.0 554 * 555 * Unless required by applicable law or agreed to in writing, software 556 * distributed under the License is distributed on an "AS IS" BASIS, 557 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 558 * See the License for the specific language governing permissions and 559 * limitations under the License. 560 */class Qu{constructor(e,n,r,s,a,l,h,f,I){this.databaseId=e,this.appId=n,this.persistenceKey=r,this.host=s,this.ssl=a,this.forceLongPolling=l,this.autoDetectLongPolling=h,this.longPollingOptions=f,this.useFetchStreams=I}}class Pn{constructor(e,n){this.projectId=e,this.database=n||"(default)"}static empty(){return new Pn("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(e){return e instanceof Pn&&e.projectId===this.projectId&&e.database===this.database}}/** 561 * @license 562 * Copyright 2017 Google LLC 563 * 564 * Licensed under the Apache License, Version 2.0 (the "License"); 565 * you may not use this file except in compliance with the License. 566 * You may obtain a copy of the License at 567 * 568 * http://www.apache.org/licenses/LICENSE-2.0 569 * 570 * Unless required by applicable law or agreed to in writing, software 571 * distributed under the License is distributed on an "AS IS" BASIS, 572 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 573 * See the License for the specific language governing permissions and 574 * limitations under the License. 575 */var Fs,P;(P=Fs||(Fs={}))[P.OK=0]="OK",P[P.CANCELLED=1]="CANCELLED",P[P.UNKNOWN=2]="UNKNOWN",P[P.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",P[P.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",P[P.NOT_FOUND=5]="NOT_FOUND",P[P.ALREADY_EXISTS=6]="ALREADY_EXISTS",P[P.PERMISSION_DENIED=7]="PERMISSION_DENIED",P[P.UNAUTHENTICATED=16]="UNAUTHENTICATED",P[P.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",P[P.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",P[P.ABORTED=10]="ABORTED",P[P.OUT_OF_RANGE=11]="OUT_OF_RANGE",P[P.UNIMPLEMENTED=12]="UNIMPLEMENTED",P[P.INTERNAL=13]="INTERNAL",P[P.UNAVAILABLE=14]="UNAVAILABLE",P[P.DATA_LOSS=15]="DATA_LOSS";/** 576 * @license 577 * Copyright 2022 Google LLC 578 * 579 * Licensed under the Apache License, Version 2.0 (the "License"); 580 * you may not use this file except in compliance with the License. 581 * You may obtain a copy of the License at 582 * 583 * http://www.apache.org/licenses/LICENSE-2.0 584 * 585 * Unless required by applicable law or agreed to in writing, software 586 * distributed under the License is distributed on an "AS IS" BASIS, 587 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 588 * See the License for the specific language governing permissions and 589 * limitations under the License. 590 */new Qo([4294967295,4294967295],0);function bi(){return typeof document<"u"?document:null}/** 591 * @license 592 * Copyright 2017 Google LLC 593 * 594 * Licensed under the Apache License, Version 2.0 (the "License"); 595 * you may not use this file except in compliance with the License. 596 * You may obtain a copy of the License at 597 * 598 * http://www.apache.org/licenses/LICENSE-2.0 599 * 600 * Unless required by applicable law or agreed to in writing, software 601 * distributed under the License is distributed on an "AS IS" BASIS, 602 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 603 * See the License for the specific language governing permissions and 604 * limitations under the License. 605 */class Zu{constructor(e,n,r=1e3,s=1.5,a=6e4){this.ui=e,this.timerId=n,this.ko=r,this.qo=s,this.Qo=a,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(e){this.cancel();const n=Math.floor(this.Ko+this.zo()),r=Math.max(0,Date.now()-this.Uo),s=Math.max(0,n-r);s>0&&le("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Ko} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.$o=this.ui.enqueueAfterDelay(this.timerId,s,()=>(this.Uo=Date.now(),e())),this.Ko*=this.qo,this.Ko<this.ko&&(this.Ko=this.ko),this.Ko>this.Qo&&(this.Ko=this.Qo)}jo(){this.$o!==null&&(this.$o.skipDelay(),this.$o=null)}
605cancel(){this.$o!==null&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}}/** 606 * @license 607 * Copyright 2017 Google LLC 608 * 609 * Licensed under the Apache License, Version 2.0 (the "License"); 610 * you may not use this file except in compliance with the License. 611 * You may obtain a copy of the License at 612 * 613 * http://www.apache.org/licenses/LICENSE-2.0 614 * 615 * Unless required by applicable law or agreed to in writing, software 616 * distributed under the License is distributed on an "AS IS" BASIS, 617 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 618 * See the License for the specific language governing permissions and 619 * limitations under the License. 620 */class or{constructor(e,n,r,s,a){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=s,this.removalCallback=a,this.deferred=new ft,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(l=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,s,a){const l=Date.now()+r,h=new or(e,n,l,s,a);return h.start(r),h}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Z(Q.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function eh(t,e){if(ir("AsyncQueue",`${e}: ${t}`),ea(t))return new Z(Q.UNAVAILABLE,`${e}: ${t}`);throw t}var $s,js;(js=$s||($s={})).ea="default",js.Cache="cache";/** 621 * @license 622 * Copyright 2017 Google LLC 623 * 624 * Licensed under the Apache License, Version 2.0 (the "License"); 625 * you may not use this file except in compliance with the License. 626 * You may obtain a copy of the License at 627 * 628 * http://www.apache.org/licenses/LICENSE-2.0 629 * 630 * Unless required by applicable law or agreed to in writing, software 631 * distributed under the License is distributed on an "AS IS" BASIS, 632 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 633 * See the License for the specific language governing permissions and 634 * limitations under the License. 635 */class th{constructor(e,n,r,s){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=s,this.user=J.UNAUTHENTICATED,this.clientId=Yu.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async a=>{le("FirestoreClient","Received user=",a.uid),await this.authCredentialListener(a),this.user=a}),this.appCheckCredentials.start(r,a=>(le("FirestoreClient","Received new app check token=",a),this.appCheckCredentialListener(a,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new Z(Q.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new ft;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=eh(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}/** 636 * @license 637 * Copyright 2023 Google LLC 638 * 639 * Licensed under the Apache License, Version 2.0 (the "License"); 640 * you may not use this file except in compliance with the License. 641 * You may obtain a copy of the License at 642 * 643 * http://www.apache.org/licenses/LICENSE-2.0 644 * 645 * Unless required by applicable law or agreed to in writing, softw
645are 646 * distributed under the License is distributed on an "AS IS" BASIS, 647 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 648 * See the License for the specific language governing permissions and 649 * limitations under the License. 650 */function ta(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** 651 * @license 652 * Copyright 2020 Google LLC 653 * 654 * Licensed under the Apache License, Version 2.0 (the "License"); 655 * you may not use this file except in compliance with the License. 656 * You may obtain a copy of the License at 657 * 658 * http://www.apache.org/licenses/LICENSE-2.0 659 * 660 * Unless required by applicable law or agreed to in writing, software 661 * distributed under the License is distributed on an "AS IS" BASIS, 662 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 663 * See the License for the specific language governing permissions and 664 * limitations under the License. 665 */const Bs=new Map;function nh(t,e,n,r){if(e===!0&&r===!0)throw new Z(Q.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function ih(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":sr()}function rh(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Z(Q.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=ih(t);throw new Z(Q.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** 666 * @license 667 * Copyright 2020 Google LLC 668 * 669 * Licensed under the Apache License, Version 2.0 (the "License"); 670 * you may not use this file except in compliance with the License. 671 * You may obtain a copy of the License at 672 * 673 * http://www.apache.org/licenses/LICENSE-2.0 674 * 675 * Unless required by applicable law or agreed to in writing, software 676 * distributed under the License is distributed on an "AS IS" BASIS, 677 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 678 * See the License for the specific language governing permissions and 679 * limitations under the License. 680 */class Hs{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new Z(Q.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new Z(Q.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}nh("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=ta((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(a){if(a.timeoutSeconds!==void 0){if(isNaN(a.timeoutSeconds))throw new Z(Q.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (must not be NaN)`);if(a.timeoutSeconds<5)throw new Z(Q.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (minimum allowed value is 5)`);if(a.timeoutSeconds>30)throw new Z(Q.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,s){return r.timeoutSeconds===s.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class na{constructor(e,n,r,s){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Hs({}),this._settingsFrozen=!1}
680get app(){if(!this._app)throw new Z(Q.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!==void 0}_setSettings(e){if(this._settingsFrozen)throw new Z(Q.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Hs(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new Vu;switch(r.type){case"firstParty":return new Wu(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new Z(Q.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=Bs.get(n);r&&(le("ComponentProvider","Removing Datastore"),Bs.delete(n),r.terminate())}(this),Promise.resolve()}}function sh(t,e,n,r={}){var s;const a=(t=rh(t,na))._getSettings(),l=`${e}:${n}`;if(a.host!=="firestore.googleapis.com"&&a.host!==l&&Hu("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},a),{host:l,ssl:!1})),r.mockUserToken){let h,f;if(typeof r.mockUserToken=="string")h=r.mockUserToken,f=J.MOCK_USER;else{h=Go(r.mockUserToken,(s=t._app)===null||s===void 0?void 0:s.options.projectId);const I=r.mockUserToken.sub||r.mockUserToken.user_id;if(!I)throw new Z(Q.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");f=new J(I)}t._authCredentials=new Ku(new Zo(h,f))}}/** 681 * @license 682 * Copyright 2020 Google LLC 683 * 684 * Licensed under the Apache License, Version 2.0 (the "License"); 685 * you may not use this file except in compliance with the License. 686 * You may obtain a copy of the License at 687 * 688 * http://www.apache.org/licenses/LICENSE-2.0 689 * 690 * Unless required by applicable law or agreed to in writing, software 691 * distributed under the License is distributed on an "AS IS" BASIS, 692 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 693 * See the License for the specific language governing permissions and 694 * limitations under the License. 695 */class oh{constructor(){this.au=Promise.resolve(),this.uu=[],this.cu=!1,this.lu=[],this.hu=null,this.Pu=!1,this.Iu=!1,this.Tu=[],this.t_=new Zu(this,"async_queue_retry"),this.Eu=()=>{const n=bi();n&&le("AsyncQueue","Visibility state changed to "+n.visibilityState),this.t_.jo()};const e=bi();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.Eu)}get isShuttingDown(){return this.cu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.du(),this.Au(e)}enterRestrictedMode(e){if(!this.cu){this.cu=!0,this.Iu=e||!1;const n=bi();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.Eu)}}enqueue(e){if(this.du(),this.cu)return new Promise(()=>{});const n=new ft;return this.Au(()=>this.cu&&this.Iu?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.uu.push(e),this.Ru()))}async Ru(){if(this.uu.length!==0){try{await this.uu[0](),this.uu.shift(),this.t_.reset()}catch(e){if(!ea(e))throw e;le("AsyncQueue","Operation failed with retryable error: "+e)}this.uu.length>0&&this.t_.Go(()=>this.Ru())}}Au(e){const n=this.au.then(()=>(this.Pu=!0,e().catch(r=>{this.hu=r,this.Pu=!1;const s=function(l){let h=l.message||"";return l.stack&&(h=l.stack.includes(l.message)?l.stack:l.message+` 696`+l.stack),h}(r);throw ir("INTERNAL UNHANDLED ERROR: ",s),r}).then(r=>(this.Pu=!1,r))));return this.au=n,n}enqueueAfterDelay(e,n,r){this.du(),this.Tu.indexOf(e)>-1&&(n=0);const s=or.createAndSchedule(this,e,n,r,a=>this.Vu(a));return this.lu.push(s),s}du(){this.hu&&sr()}verifyOperationInProgress(){}async mu(){let e;do e=this.au,await e;while(e!==this.au)}fu(e){for(const n of this.lu)if(n.timerId===e)return!0;return!1}gu(e){return this.mu().then(()=>{this.lu.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.lu)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.mu()})}pu(e){this.Tu.push(e)}Vu(e){const n=this.lu.indexOf(e);this.lu.splice(n,1)}}class ah extends na{constructor(e,n,r,s){super(e,n,r,s),this.type="firestore",this._queue=function(){return new oh}(),this._persistenceKey=(s==null?void 0:s.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||ch(this),this._firestoreClient.terminate()}}function w_(t,e){const n=typeof t=="object"?t:st(),r=typeof t=="string"?t:"(default)",s=me(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const a=zo("firestore");a&&sh(s,...a)}return s}function ch(t){var e,n,r;const s=t._freezeSettings(),a=function(h,f,I,E){return new Qu(h,f,I,E.host,E.ssl,E.experimentalForceLongPolling,E.experimentalAutoDetectLongPolling,ta(E.experimentalLongPollingOptions),E.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,s);t._firestoreClient=new th(t._authCredentials,t._appCheckCredentials,t._queue,a),!((n=s.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=s.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._firestoreClient._uninitializedComponentsProvider={_offlineKind:s.localCache.kind,_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider})}(function(e,n=!0){(function(s){Qt=s})(rt),ee(new z("firestore",(r,{instanceIdentifier:s,options:a})=>{const l=r.getProvider("app").getImmediate(),h=new ah(new zu(r.getProvider("auth-internal")),new Xu(r.getProvider("app-check-internal")),function(I,E){if(!Object.prototype.hasOwnProperty.apply(I.options,["projectId"]))throw new Z(
696Q.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Pn(I.options.projectId,E)}(l,s),l);return a=Object.assign({useFetchStreams:n},a),h._setSettings(a),h},"PUBLIC").setMultipleInstances(!0)),H(xs,"4.7.1",e),H(xs,"4.7.1","esm2017")})();const ia="@firebase/installations",ar="0.6.8";/** 697 * @license 698 * Copyright 2019 Google LLC 699 * 700 * Licensed under the Apache License, Version 2.0 (the "License"); 701 * you may not use this file except in compliance with the License. 702 * You may obtain a copy of the License at 703 * 704 * http://www.apache.org/licenses/LICENSE-2.0 705 * 706 * Unless required by applicable law or agreed to in writing, software 707 * distributed under the License is distributed on an "AS IS" BASIS, 708 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 709 * See the License for the specific language governing permissions and 710 * limitations under the License. 711 */const ra=1e4,sa=`w:${ar}`,oa="FIS_v2",lh="https://firebaseinstallations.googleapis.com/v1",uh=60*60*1e3,hh="installations",dh="Installations";/** 712 * @license 713 * Copyright 2019 Google LLC 714 * 715 * Licensed under the Apache License, Version 2.0 (the "License"); 716 * you may not use this file except in compliance with the License. 717 * You may obtain a copy of the License at 718 * 719 * http://www.apache.org/licenses/LICENSE-2.0 720 * 721 * Unless required by applicable law or agreed to in writing, software 722 * distributed under the License is distributed on an "AS IS" BASIS, 723 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 724 * See the License for the specific language governing permissions and 725 * limitations under the License. 726 */const fh={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},tt=new be(hh,dh,fh);function aa(t){return t instanceof ge&&t.code.includes("request-failed")}/** 727 * @license 728 * Copyright 2019 Google LLC 729 * 730 * Licensed under the Apache License, Version 2.0 (the "License"); 731 * you may not use this file except in compliance with the License. 732 * You may obtain a copy of the License at 733 * 734 * http://www.apache.org/licenses/LICENSE-2.0 735 * 736 * Unless required by applicable law or agreed to in writing, software 737 * distributed under the License is distributed on an "AS IS" BASIS, 738 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 739 * See the License for the specific language governing permissions and 740 * limitations under the License. 741 */function ca({projectId:t}){return`${lh}/projects/${t}/installations`}function la(t){return{token:t.token,requestStatus:2,expiresIn:gh(t.expiresIn),creationTime:Date.now()}}async function ua(t,e){const r=(await e.json()).error;return tt.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function ha({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function ph(t,{refreshToken:e}){const n=ha(t);return n.append("Authorization",mh(e)),n}async function da(t){const e=await t();return e.status>=500&&e.status<600?t():e}function gh(t){return Number(t.replace("s","000"))}function mh(t){return`${oa} ${t}`}/** 742 * @license 743 * Copyright 2019 Google LLC 744 * 745 * Licensed under the Apache License, Version 2.0 (the "License"); 746 * you may not use this file except in compliance with the License. 747 * You may obtain a copy of the License at 748 * 749 * http://www.apache.org/licenses/LICENSE-2.0 750 * 751 * Unless required by applicable law or agreed to in writing, software 752 * distributed under the License is distributed on an "AS IS" BASIS, 753 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 754 * See the License for the specific language governing permissions and 755 * limitations under the License. 756 */async function _h({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const r=ca(t),s=ha(t),a=e.getImmediate({optional:!0});if(a){const I=await a.getHeartbeatsHeader();I&&s.append("x-firebase-client",I)}const l={fid:n,authVersion:oa,appId:t.appId,sdkVersion:sa},h={method:"POST",headers:s,body:JSON.stringify(l)},f=await da(()=>fetch(r,h));if(f.ok){const I=await f.json();return{fid:I.fid||n,registrationStatus:2,refreshToken:I.refreshToken,authToken:la(I.authToken)}}else throw await ua("Create Installation",f)}/** 757 * @license 758 * Copyright 2019 Google LLC 759 * 760 * Licensed under the Apache License, Version 2.0 (the "License");
761 * you may not use this file except in compliance with the License. 762 * You may obtain a copy of the License at 763 * 764 * http://www.apache.org/licenses/LICENSE-2.0 765 * 766 * Unless required by applicable law or agreed to in writing, software 767 * distributed under the License is distributed on an "AS IS" BASIS, 768 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 769 * See the License for the specific language governing permissions and 770 * limitations under the License. 771 */function fa(t){return new Promise(e=>{setTimeout(e,t)})}/** 772 * @license 773 * Copyright 2019 Google LLC 774 * 775 * Licensed under the Apache License, Version 2.0 (the "License"); 776 * you may not use this file except in compliance with the License. 777 * You may obtain a copy of the License at 778 * 779 * http://www.apache.org/licenses/LICENSE-2.0 780 * 781 * Unless required by applicable law or agreed to in writing, software 782 * distributed under the License is distributed on an "AS IS" BASIS, 783 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 784 * See the License for the specific language governing permissions and 785 * limitations under the License. 786 */function vh(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/** 787 * @license 788 * Copyright 2019 Google LLC 789 * 790 * Licensed under the Apache License, Version 2.0 (the "License"); 791 * you may not use this file except in compliance with the License. 792 * You may obtain a copy of the License at 793 * 794 * http://www.apache.org/licenses/LICENSE-2.0 795 * 796 * Unless required by applicable law or agreed to in writing, software 797 * distributed under the License is distributed on an "AS IS" BASIS, 798 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 799 * See the License for the specific language governing permissions and 800 * limitations under the License. 801 */const yh=/^[cdef][\w-]{21}$/,zi="";function Th(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const n=Ih(t);return yh.test(n)?n:zi}catch{return zi}}function Ih(t){return vh(t).substr(0,22)}/** 802 * @license 803 * Copyright 2019 Google LLC 804 * 805 * Licensed under the Apache License, Version 2.0 (the "License"); 806 * you may not use this file except in compliance with the License. 807 * You may obtain a copy of the License at 808 * 809 * http://www.apache.org/licenses/LICENSE-2.0 810 * 811 * Unless required by applicable law or agreed to in writing, software 812 * distributed under the License is distributed on an "AS IS" BASIS, 813 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 814 * See the License for the specific language governing permissions and 815 * limitations under the License. 816 */function Vn(t){return`${t.appName}!${t.appId}`}/** 817 * @license 818 * Copyright 2019 Google LLC 819 * 820 * Licensed under the Apache License, Version 2.0 (the "License"); 821 * you may not use this file except in compliance with the License. 822 * You may obtain a copy of the License at 823 * 824 * http://www.apache.org/licenses/LICENSE-2.0 825 * 826 * Unless required by applicable law or agreed to in writing, software 827 * distributed under the License is distributed on an "AS IS" BASIS, 828 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 829 * See the License for the specific language governing permissions and 830 * limitations under the License. 831 */const pa=new Map;function ga(t,e){const n=Vn(t);ma(n,e),wh(n,e)}function ma(t,e){const n=pa.get(t);if(n)for(const r of n)r(e)}function wh(t,e){const n=Eh();n&&n.postMessage({key:t,fid:e}),bh()}let Ze=null;function Eh(){return!Ze&&"BroadcastChannel"in self&&(Ze=new BroadcastChannel("[Firebase] FID Change"),Ze.onmessage=t=>{ma(t.data.key,t.data.fid)}),Ze}function bh(){pa.size===0&&Ze&&(Ze.close(),Ze=null)}/** 832 * @license 833 * Copyright 2019 Google LLC 834 * 835 * Licensed under the Apache License, Version 2.0 (the "License"); 836 * you may not use this file except in compliance with the License. 837 * You may obtain a copy of the License at 838 * 839 * http://www.apache.org/licenses/LICENSE-2.0 840 * 841 * Unless required by applicable law or agreed to in writing, software 842 * distributed under the License is distributed on an "AS IS" BASIS, 843 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 844 * See the License for the specific language governing permissions and 845 * limitations under the License. 846 */const Ah="firebase-installations-database",kh=1,nt="firebase-installations-store";let Ai=null;function cr(){return Ai||(Ai=Bn(Ah,kh,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(nt)}}})),Ai}async function On(t,e){const n=Vn(t),s=(await cr()).transaction(nt,"readwrite"),a=s.objectStore(nt),l=await a.get(n);return await a.put(e,n),await s.done,(!l||l.fid!==e.fid)&&ga(t,e.fid),e}async function _a(t){const e=Vn(t),r=(await cr()).transaction(nt,"readwrite");await r.objectStore(nt).delete(e),await r.done}async function Kn(t,e){const n=Vn(t),s=(await cr()).transaction(nt,"readwrite"),a=s.objectStore(nt),l=await a.get(n),h=e(l);return h===void 0?await a.delete(n):await a.put(h,n),await s.done,h&&(!l||l.fid!==h.fid)&&ga(t,h.fid),h}/** 847 * @license 848 * Copyright 2019 Google LLC 849 * 850 * Licensed under the Apache License, Version 2.0 (the "License");
851 * you may not use this file except in compliance with the License. 852 * You may obtain a copy of the License at 853 * 854 * http://www.apache.org/licenses/LICENSE-2.0 855 * 856 * Unless required by applicable law or agreed to in writing, software 857 * distributed under the License is distributed on an "AS IS" BASIS, 858 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 859 * See the License for the specific language governing permissions and 860 * limitations under the License. 861 */async function lr(t){let e;const n=await Kn(t.appConfig,r=>{const s=Sh(r),a=Rh(t,s);return e=a.registrationPromise,a.installationEntry});return n.fid===zi?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}function Sh(t){const e=t||{fid:Th(),registrationStatus:0};return va(e)}function Rh(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const s=Promise.reject(tt.create("app-offline"));return{installationEntry:e,registrationPromise:s}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=Ch(t,n);return{installationEntry:n,registrationPromise:r}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:Ph(t)}:{installationEntry:e}}async function Ch(t,e){try{const n=await _h(t,e);return On(t.appConfig,n)}catch(n){throw aa(n)&&n.customData.serverCode===409?await _a(t.appConfig):await On(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}async function Ph(t){let e=await Vs(t.appConfig);for(;e.registrationStatus===1;)await fa(100),e=await Vs(t.appConfig);if(e.registrationStatus===0){const{installationEntry:n,registrationPromise:r}=await lr(t);return r||n}return e}function Vs(t){return Kn(t,e=>{if(!e)throw tt.create("installation-not-found");return va(e)})}function va(t){return Oh(t)?{fid:t.fid,registrationStatus:0}:t}function Oh(t){return t.registrationStatus===1&&t.registrationTime+ra<Date.now()}/** 862 * @license 863 * Copyright 2019 Google LLC 864 * 865 * Licensed under the Apache License, Version 2.0 (the "License"); 866 * you may not use this file except in compliance with the License. 867 * You may obtain a copy of the License at 868 * 869 * http://www.apache.org/licenses/LICENSE-2.0 870 * 871 * Unless required by applicable law or agreed to in writing, software 872 * distributed under the License is distributed on an "AS IS" BASIS, 873 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 874 * See the License for the specific language governing permissions and 875 * limitations under the License. 876 */async function Nh({appConfig:t,heartbeatServiceProvider:e},n){const r=Dh(t,n),s=ph(t,n),a=e.getImmediate({optional:!0});if(a){const I=await a.getHeartbeatsHeader();I&&s.append("x-firebase-client",I)}const l={installation:{sdkVersion:sa,appId:t.appId}},h={method:"POST",headers:s,body:JSON.stringify(l)},f=await da(()=>fetch(r,h));if(f.ok){const I=await f.json();return la(I)}else throw await ua("Generate Auth Token",f)}function Dh(t,{fid:e}){return`${ca(t)}/${e}/authTokens:generate`}/** 877 * @license 878 * Copyright 2019 Google LLC 879 * 880 * Licensed under the Apache License, Version 2.0 (the "License"); 881 * you may not use this file except in compliance with the License. 882 * You may obtain a copy of the License at 883 * 884 * http://www.apache.org/licenses/LICENSE-2.0 885 * 886 * Unless required by applicable law or agreed to in writing, software 887 * distributed under the License is distributed on an "AS IS" BASIS, 888 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 889 * See the License for the specific language governing permissions and 890 * limitations under the License. 891 */async function ur(t,e=!1){let n;const r=await Kn(t.appConfig,a=>{if(!ya(a))throw tt.create("not-registered");const l=a.authToken;if(!e&&Uh(l))return a;if(l.requestStatus===1)return n=Mh(t,e),a;{if(!navigator.onLine)throw tt.create("app-offline");const h=Fh(a);return n=Lh(t,h),h}});return n?await n:r.authToken}async function Mh(t,e){let n=await Ks(t.appConfig);for(;n.authToken.requestStatus===1;)await fa(100),n=await Ks(t.appConfig);const r=n.authToken;return r.requestStatus===0?ur(t,e):r}function Ks(t){return Kn(t,e=>{if(!ya(e))throw tt.create("not-registered");const n=e.authToken;return $h(n)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function Lh(t,e){try{const n=await Nh(t,e),r=Object.assign(Object.assign({},e),{authToken:n});return await On(t.appConfig,r),n}catch(n){if(aa(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await _a(t.appConfig);else{const r=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await On(t.appConfig,r)}throw n}}function ya(t){return t!==void 0&&t.registrationStatus===2}function Uh(t){return t.requestStatus===2&&!xh(t)}function xh(t){const e=Date.now();
891return e<t.creationTime||t.creationTime+t.expiresIn<e+uh}function Fh(t){const e={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},t),{authToken:e})}function $h(t){return t.requestStatus===1&&t.requestTime+ra<Date.now()}/** 892 * @license 893 * Copyright 2019 Google LLC 894 * 895 * Licensed under the Apache License, Version 2.0 (the "License"); 896 * you may not use this file except in compliance with the License. 897 * You may obtain a copy of the License at 898 * 899 * http://www.apache.org/licenses/LICENSE-2.0 900 * 901 * Unless required by applicable law or agreed to in writing, software 902 * distributed under the License is distributed on an "AS IS" BASIS, 903 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 904 * See the License for the specific language governing permissions and 905 * limitations under the License. 906 */async function jh(t){const e=t,{installationEntry:n,registrationPromise:r}=await lr(e);return r?r.catch(console.error):ur(e).catch(console.error),n.fid}/** 907 * @license 908 * Copyright 2019 Google LLC 909 * 910 * Licensed under the Apache License, Version 2.0 (the "License"); 911 * you may not use this file except in compliance with the License. 912 * You may obtain a copy of the License at 913 * 914 * http://www.apache.org/licenses/LICENSE-2.0 915 * 916 * Unless required by applicable law or agreed to in writing, software 917 * distributed under the License is distributed on an "AS IS" BASIS, 918 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 919 * See the License for the specific language governing permissions and 920 * limitations under the License. 921 */async function Bh(t,e=!1){const n=t;return await Hh(n),(await ur(n,e)).token}async function Hh(t){const{registrationPromise:e}=await lr(t);e&&await e}/** 922 * @license 923 * Copyright 2019 Google LLC 924 * 925 * Licensed under the Apache License, Version 2.0 (the "License"); 926 * you may not use this file except in compliance with the License. 927 * You may obtain a copy of the License at 928 * 929 * http://www.apache.org/licenses/LICENSE-2.0 930 * 931 * Unless required by applicable law or agreed to in writing, software 932 * distributed under the License is distributed on an "AS IS" BASIS, 933 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 934 * See the License for the specific language governing permissions and 935 * limitations under the License. 936 */function Vh(t){if(!t||!t.options)throw ki("App Configuration");if(!t.name)throw ki("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw ki(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function ki(t){return tt.create("missing-app-config-values",{valueName:t})}/** 937 * @license 938 * Copyright 2020 Google LLC 939 * 940 * Licensed under the Apache License, Version 2.0 (the "License"); 941 * you may not use this file except in compliance with the License. 942 * You may obtain a copy of the License at 943 * 944 * http://www.apache.org/licenses/LICENSE-2.0 945 * 946 * Unless required by applicable law or agreed to in writing, software 947 * distributed under the License is distributed on an "AS IS" BASIS, 948 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 949 * See the License for the specific language governing permissions and 950 * limitations under the License. 951 */const Ta="installations",Kh="installations-internal",zh=t=>{const e=t.getProvider("app").getImmediate(),n=Vh(e),r=me(e,"heartbeat");return{app:e,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},qh=t=>{const e=t.getProvider("app").getImmediate(),n=me(e,Ta).getImmediate();return{getId:()=>jh(n),getToken:s=>Bh(n,s)}};function Wh(){ee(new z(Ta,zh,"PUBLIC")),ee(new z(Kh,qh,"PRIVATE"))}Wh();H(ia,ar);H(ia,ar,"esm2017");/** 952 * @license 953 * Copyright 2019 Google LLC 954 * 955 * Licensed under the Apache License, Version 2.0 (the "License"); 956 * you may not use this file except in compliance with the License. 957 * You may obtain a copy of the License at 958 * 959 * http://www.apache.org/licenses/LICENSE-2.0 960 * 961 * Unless required by applicable law or agreed to in writing, softw
961are 962 * distributed under the License is distributed on an "AS IS" BASIS, 963 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 964 * See the License for the specific language governing permissions and 965 * limitations under the License. 966 */const Nn="analytics",Gh="firebase_id",Xh="origin",Jh=60*1e3,Yh="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",hr="https://www.googletagmanager.com/gtag/js";/** 967 * @license 968 * Copyright 2019 Google LLC 969 * 970 * Licensed under the Apache License, Version 2.0 (the "License"); 971 * you may not use this file except in compliance with the License. 972 * You may obtain a copy of the License at 973 * 974 * http://www.apache.org/licenses/LICENSE-2.0 975 * 976 * Unless required by applicable law or agreed to in writing, software 977 * distributed under the License is distributed on an "AS IS" BASIS, 978 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 979 * See the License for the specific language governing permissions and 980 * limitations under the License. 981 */const ce=new It("@firebase/analytics");/** 982 * @license 983 * Copyright 2019 Google LLC 984 * 985 * Licensed under the Apache License, Version 2.0 (the "License"); 986 * you may not use this file except in compliance with the License. 987 * You may obtain a copy of the License at 988 * 989 * http://www.apache.org/licenses/LICENSE-2.0 990 * 991 * Unless required by applicable law or agreed to in writing, software 992 * distributed under the License is distributed on an "AS IS" BASIS, 993 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 994 * See the License for the specific language governing permissions and 995 * limitations under the License. 996 */const Qh={"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."},he=new be("analytics","Analytics",Qh);/** 997 * @license 998 * Copyright 2019 Google LLC 999 * 1000 * Licensed under the Apache License, Version 2.0 (the "License"); 1001 * you may not use this file except in compliance with the License. 1002 * You may obtain a copy of the License at 1003 * 1004 * http://www.apache.org/licenses/LICENSE-2.0 1005 * 1006 * Unless required by applicable law or agreed to in writing, software 1007 * distributed under the License is distributed on an "AS IS" BASIS, 1008 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1009 * See the License for the specific language governing permissions and 1010 * limitations under the License. 1011 */function Zh(t){if(!t.startsWith(hr)){const e=he.create("invalid-gtag-resource",{gtagURL:t});return ce.warn(e.message),""}return t}function Ia(t){return Promise.all(t.map(e=>e.catch(n=>n)))}function ed(t,e){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(t,e)),n}function td(t,e){const n=ed("firebase-js-sdk-policy",{createScriptURL:Zh}),r=document.createElement("script"),s=`${hr}?l=${t}&id=${e}`;r.src=n?n==null?void 0:n.createScriptURL(s):s,r.async=!0,document.head.appendChild(r)}
1011function nd(t){let e=[];return Array.isArray(window[t])?e=window[t]:window[t]=e,e}async function id(t,e,n,r,s,a){const l=r[s];try{if(l)await e[l];else{const f=(await Ia(n)).find(I=>I.measurementId===s);f&&await e[f.appId]}}catch(h){ce.error(h)}t("config",s,a)}async function rd(t,e,n,r,s){try{let a=[];if(s&&s.send_to){let l=s.send_to;Array.isArray(l)||(l=[l]);const h=await Ia(n);for(const f of l){const I=h.find(A=>A.measurementId===f),E=I&&e[I.appId];if(E)a.push(E);else{a=[];break}}}a.length===0&&(a=Object.values(e)),await Promise.all(a),t("event",r,s||{})}catch(a){ce.error(a)}}function sd(t,e,n,r){async function s(a,...l){try{if(a==="event"){const[h,f]=l;await rd(t,e,n,h,f)}else if(a==="config"){const[h,f]=l;await id(t,e,n,r,h,f)}else if(a==="consent"){const[h,f]=l;t("consent",h,f)}else if(a==="get"){const[h,f,I]=l;t("get",h,f,I)}else if(a==="set"){const[h]=l;t("set",h)}else t(a,...l)}catch(h){ce.error(h)}}return s}function od(t,e,n,r,s){let a=function(...l){window[r].push(arguments)};return window[s]&&typeof window[s]=="function"&&(a=window[s]),window[s]=sd(a,t,e,n),{gtagCore:a,wrappedGtag:window[s]}}function ad(t){const e=window.document.getElementsByTagName("script");for(const n of Object.values(e))if(n.src&&n.src.includes(hr)&&n.src.includes(t))return n;return null}/** 1012 * @license 1013 * Copyright 2020 Google LLC 1014 * 1015 * Licensed under the Apache License, Version 2.0 (the "License"); 1016 * you may not use this file except in compliance with the License. 1017 * You may obtain a copy of the License at 1018 * 1019 * http://www.apache.org/licenses/LICENSE-2.0 1020 * 1021 * Unless required by applicable law or agreed to in writing, software 1022 * distributed under the License is distributed on an "AS IS" BASIS, 1023 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1024 * See the License for the specific language governing permissions and 1025 * limitations under the License. 1026 */const cd=30,ld=1e3;class ud{constructor(e={},n=ld){this.throttleMetadata=e,this.intervalMillis=n}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,n){this.throttleMetadata[e]=n}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}const wa=new ud;function hd(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function dd(t){var e;const{appId:n,apiKey:r}=t,s={method:"GET",headers:hd(r)},a=Yh.replace("{app-id}",n),l=await fetch(a,s);if(l.status!==200&&l.status!==304){let h="";try{const f=await l.json();!((e=f.error)===null||e===void 0)&&e.message&&(h=f.error.message)}catch{}throw he.create("config-fetch-failed",{httpStatus:l.status,responseMessage:h})}return l.json()}async function fd(t,e=wa,n){const{appId:r,apiKey:s,measurementId:a}=t.options;if(!r)throw he.create("no-app-id");if(!s){if(a)return{measurementId:a,appId:r};throw he.create("no-api-key")}const l=e.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()},h=new md;return setTimeout(async()=>{h.abort()},Jh),Ea({appId:r,apiKey:s,measurementId:a},l,h,e)}async function Ea(t,{throttleEndTimeMillis:e,backoffCount:n},r,s=wa){var a;const{appId:l,measurementId:h}=t;try{await pd(r,e)}catch(f){if(h)return ce.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${h} provided in the "measurementId" field in the local Firebase config. [${f==null?void 0:f.message}]`),{appId:l,measurementId:h};throw f}try{const f=await dd(t);return s.deleteThrottleMetadata(l),f}catch(f){const I=f;if(!gd(I)){if(s.deleteThrottleMetadata(l),h)return ce.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${h} provided in the "measurementId" field in the local Firebase config. [${I==null?void 0:I.message}]`),{appId:l,measurementId:h};throw f}const E=Number((a=I==null?void 0:I.customData)===null||a===void 0?void 0:a.httpStatus)===503?ji(n,s.intervalMillis,cd):ji(n,s.intervalMillis),A={throttleEndTimeMillis:Date.now()+E,backoffCount:n+1};return s.setThrottleMetadata(l,A),ce.debug(`Calling attemptFetch again in ${E} millis`),Ea(t,A,r,s)}}function pd(t,e){return new Promise((n,r)=>{const s=Math.max(e-Date.now(),0),a=setTimeout(n,s);t.addEventListener(()=>{clearTimeout(a),r(he.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}function gd(t){if(!(t instanceof ge)||!t.customData)return!1;const e=Number(t.customData.httpStatus);return e===429||e===500||e===503||e===504}class md{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}
1026abort(){this.listeners.forEach(e=>e())}}async function _d(t,e,n,r,s){if(s&&s.global){t("event",n,r);return}else{const a=await e,l=Object.assign(Object.assign({},r),{send_to:a});t("event",n,l)}}/** 1027 * @license 1028 * Copyright 2020 Google LLC 1029 * 1030 * Licensed under the Apache License, Version 2.0 (the "License"); 1031 * you may not use this file except in compliance with the License. 1032 * You may obtain a copy of the License at 1033 * 1034 * http://www.apache.org/licenses/LICENSE-2.0 1035 * 1036 * Unless required by applicable law or agreed to in writing, software 1037 * distributed under the License is distributed on an "AS IS" BASIS, 1038 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1039 * See the License for the specific language governing permissions and 1040 * limitations under the License. 1041 */async function vd(){if(Tt())try{await Hn()}catch(t){return ce.warn(he.create("indexeddb-unavailable",{errorInfo:t==null?void 0:t.toString()}).message),!1}else return ce.warn(he.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;return!0}async function yd(t,e,n,r,s,a,l){var h;const f=fd(t);f.then(O=>{n[O.measurementId]=O.appId,t.options.measurementId&&O.measurementId!==t.options.measurementId&&ce.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${O.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(O=>ce.error(O)),e.push(f);const I=vd().then(O=>{if(O)return r.getId()}),[E,A]=await Promise.all([f,I]);ad(a)||td(a,E.measurementId),s("js",new Date);const k=(h=l==null?void 0:l.config)!==null&&h!==void 0?h:{};return k[Xh]="firebase",k.update=!0,A!=null&&(k[Gh]=A),s("config",E.measurementId,k),E.measurementId}/** 1042 * @license 1043 * Copyright 2019 Google LLC 1044 * 1045 * Licensed under the Apache License, Version 2.0 (the "License"); 1046 * you may not use this file except in compliance with the License. 1047 * You may obtain a copy of the License at 1048 * 1049 * http://www.apache.org/licenses/LICENSE-2.0 1050 * 1051 * Unless required by applicable law or agreed to in writing, software 1052 * distributed under the License is distributed on an "AS IS" BASIS, 1053 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1054 * See the License for the specific language governing permissions and 1055 * limitations under the License. 1056 */class Td{constructor(e){this.app=e}_delete(){return delete jt[this.app.options.appId],Promise.resolve()}}let jt={},zs=[];const qs={};let Si="dataLayer",Id="gtag",Ws,ba,Gs=!1;function wd(){const t=[];if(Xo()&&t.push("This is a browser extension environment."),nr()||t.push("Cookies are not available."),t.length>0){const e=t.map((r,s)=>`(${s+1}) ${r}`).join(" "),n=he.create("invalid-analytics-context",{errorInfo:e});ce.warn(n.message)}}
1056function Ed(t,e,n){wd();const r=t.options.appId;if(!r)throw he.create("no-app-id");if(!t.options.apiKey)if(t.options.measurementId)ce.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw he.create("no-api-key");if(jt[r]!=null)throw he.create("already-exists",{id:r});if(!Gs){nd(Si);const{wrappedGtag:a,gtagCore:l}=od(jt,zs,qs,Si,Id);ba=a,Ws=l,Gs=!0}return jt[r]=yd(t,zs,qs,e,Ws,Si,n),new Td(t)}function E_(t=st()){t=de(t);const e=me(t,Nn);return e.isInitialized()?e.getImmediate():bd(t)}function bd(t,e={}){const n=me(t,Nn);if(n.isInitialized()){const s=n.getImmediate();if(Vt(e,n.getOptions()))return s;throw he.create("already-initialized")}return n.initialize({options:e})}function Ad(t,e,n,r){t=de(t),_d(ba,jt[t.app.options.appId],e,n,r).catch(s=>ce.error(s))}const Xs="@firebase/analytics",Js="0.10.7";function kd(){ee(new z(Nn,(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("installations-internal").getImmediate();return Ed(r,s,n)},"PUBLIC")),ee(new z("analytics-internal",t,"PRIVATE")),H(Xs,Js),H(Xs,Js,"esm2017");function t(e){try{const n=e.getProvider(Nn).getImmediate();return{logEvent:(r,s,a)=>Ad(n,r,s,a)}}catch(n){throw he.create("interop-component-reg-failed",{reason:n})}}}kd();/** 1057 * @license 1058 * Copyright 2017 Google LLC 1059 * 1060 * Licensed under the Apache License, Version 2.0 (the "License"); 1061 * you may not use this file except in compliance with the License. 1062 * You may obtain a copy of the License at 1063 * 1064 * http://www.apache.org/licenses/LICENSE-2.0 1065 * 1066 * Unless required by applicable law or agreed to in writing, software 1067 * distributed under the License is distributed on an "AS IS" BASIS, 1068 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1069 * See the License for the specific language governing permissions and 1070 * limitations under the License. 1071 */const Aa="firebasestorage.googleapis.com",Sd="storageBucket",Rd=2*60*1e3,Cd=10*60*1e3;/** 1072 * @license 1073 * Copyright 2017 Google LLC 1074 * 1075 * Licensed under the Apache License, Version 2.0 (the "License"); 1076 * you may not use this file except in compliance with the License. 1077 * You may obtain a copy of the License at 1078 * 1079 * http://www.apache.org/licenses/LICENSE-2.0 1080 * 1081 * Unless required by applicable law or agreed to in writing, software 1082 * distributed under the License is distributed on an "AS IS" BASIS, 1083 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1084 * See the License for the specific language governing permissions and 1085 * limitations under the License. 1086 */class Ae extends ge{constructor(e,n,r=0){super(Ri(e),`Firebase Storage: ${n} (${Ri(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Ae.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Ri(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage} 1087${this.customData.serverResponse}`:this.message=this._baseMessage}}var we;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(we||(we={}));function Ri(t){return"storage/"+t}function Pd(){const t="An unknown error occurred, please check the error payload for server response.";return new Ae(we.UNKNOWN,t)}function Od(){return new Ae(we.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Nd(){return new Ae(we.CANCELED,"User canceled the upload/download.")}function Dd(t){return new Ae(we.INVALID_URL,"Invalid URL '"+t+"'.")}function Md(t){return new Ae(we.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function Ys(t){return new Ae(we.INVALID_ARGUMENT,t)}function ka(){return new Ae(we.APP_DELETED,"The Firebase app was deleted.")}function Ld(t){return new Ae(we.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}/** 1088 * @license 1089 * Copyright 2017 Google LLC 1090 * 1091 * Licensed under the Apache License, Version 2.0 (the "License");
1092 * you may not use this file except in compliance with the License. 1093 * You may obtain a copy of the License at 1094 * 1095 * http://www.apache.org/licenses/LICENSE-2.0 1096 * 1097 * Unless required by applicable law or agreed to in writing, software 1098 * distributed under the License is distributed on an "AS IS" BASIS, 1099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1100 * See the License for the specific language governing permissions and 1101 * limitations under the License. 1102 */class ye{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=ye.makeFromUrl(e,n)}catch{return new ye(e,"")}if(r.path==="")return r;throw Md(e)}static makeFromUrl(e,n){let r=null;const s="([A-Za-z0-9.\\-_]+)";function a(F){F.path.charAt(F.path.length-1)==="/"&&(F.path_=F.path_.slice(0,-1))}const l="(/(.*))?$",h=new RegExp("^gs://"+s+l,"i"),f={bucket:1,path:3};function I(F){F.path_=decodeURIComponent(F.path)}const E="v[A-Za-z0-9_]+",A=n.replace(/[.]/g,"\\."),k="(/([^?#]*).*)?$",O=new RegExp(`^https?://${A}/${E}/b/${s}/o${k}`,"i"),R={bucket:1,path:3},U=n===Aa?"(?:storage.googleapis.com|storage.cloud.google.com)":n,C="([^?#]*)",oe=new RegExp(`^https?://${U}/${s}/${C}`,"i"),x=[{regex:h,indices:f,postModify:a},{regex:O,indices:R,postModify:I},{regex:oe,indices:{bucket:1,path:2},postModify:I}];for(let F=0;F<x.length;F++){const fe=x[F],B=fe.regex.exec(e);if(B){const v=B[fe.indices.bucket];let d=B[fe.indices.path];d||(d=""),r=new ye(v,d),fe.postModify(r);break}}if(r==null)throw Dd(e);return r}}class Ud{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/** 1103 * @license 1104 * Copyright 2017 Google LLC 1105 * 1106 * Licensed under the Apache License, Version 2.0 (the "License"); 1107 * you may not use this file except in compliance with the License. 1108 * You may obtain a copy of the License at 1109 * 1110 * http://www.apache.org/licenses/LICENSE-2.0 1111 * 1112 * Unless required by applicable law or agreed to in writing, software 1113 * distributed under the License is distributed on an "AS IS" BASIS, 1114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1115 * See the License for the specific language governing permissions and 1116 * limitations under the License. 1117 */function xd(t,e,n){let r=1,s=null,a=null,l=!1,h=0;function f(){return h===2}let I=!1;function E(...C){I||(I=!0,e.apply(null,C))}function A(C){s=setTimeout(()=>{s=null,t(O,f())},C)}function k(){a&&clearTimeout(a)}function O(C,...oe){if(I){k();return}if(C){k(),E.call(null,C,...oe);return}if(f()||l){k(),E.call(null,C,...oe);return}r<64&&(r*=2);let x;h===1?(h=2,x=0):x=(r+Math.random())*1e3,A(x)}let R=!1;function U(C){R||(R=!0,k(),!I&&(s!==null?(C||(h=2),clearTimeout(s),A(0)):C||(h=1)))}return A(0),a=setTimeout(()=>{l=!0,U(!0)},n),U}function Fd(t){t(!1)}/** 1118 * @license 1119 * Copyright 2017 Google LLC 1120 * 1121 * Licensed under the Apache License, Version 2.0 (the "License"); 1122 * you may not use this file except in compliance with the License. 1123 * You may obtain a copy of the License at 1124 * 1125 * http://www.apache.org/licenses/LICENSE-2.0 1126 * 1127 * Unless required by applicable law or agreed to in writing, software 1128 * distributed under the License is distributed on an "AS IS" BASIS, 1129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1130 * See the License for the specific language governing permissions and 1131 * limitations under the License. 1132 */function $d(t){return t!==void 0}function Qs(t,e,n,r){if(r<e)throw Ys(`Invalid value for '${t}'. Expected ${e} or greater.`);if(r>n)throw Ys(`Invalid value for '${t}'. Expected ${n} or less.`)}function jd(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const s=e(r)+"="+e(t[r]);n=n+s+"&"}return n=n.slice(0,-1),n}var Dn;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(Dn||(Dn={}));/** 1133 * @license 1134 * Copyright 2022 Google LLC 1135 * 1136 * Licensed under the Apache License, Version 2.0 (the "License");
1137 * you may not use this file except in compliance with the License. 1138 * You may obtain a copy of the License at 1139 * 1140 * http://www.apache.org/licenses/LICENSE-2.0 1141 * 1142 * Unless required by applicable law or agreed to in writing, software 1143 * distributed under the License is distributed on an "AS IS" BASIS, 1144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1145 * See the License for the specific language governing permissions and 1146 * limitations under the License. 1147 */function Bd(t,e){const n=t>=500&&t<600,s=[408,429].indexOf(t)!==-1,a=e.indexOf(t)!==-1;return n||s||a}/** 1148 * @license 1149 * Copyright 2017 Google LLC 1150 * 1151 * Licensed under the Apache License, Version 2.0 (the "License"); 1152 * you may not use this file except in compliance with the License. 1153 * You may obtain a copy of the License at 1154 * 1155 * http://www.apache.org/licenses/LICENSE-2.0 1156 * 1157 * Unless required by applicable law or agreed to in writing, software 1158 * distributed under the License is distributed on an "AS IS" BASIS, 1159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1160 * See the License for the specific language governing permissions and 1161 * limitations under the License. 1162 */class Hd{constructor(e,n,r,s,a,l,h,f,I,E,A,k=!0){this.url_=e,this.method_=n,this.headers_=r,this.body_=s,this.successCodes_=a,this.additionalRetryCodes_=l,this.callback_=h,this.errorCallback_=f,this.timeout_=I,this.progressCallback_=E,this.connectionFactory_=A,this.retry=k,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((O,R)=>{this.resolve_=O,this.reject_=R,this.start_()})}start_(){const e=(r,s)=>{if(s){r(!1,new Tn(!1,null,!0));return}const a=this.connectionFactory_();this.pendingConnection_=a;const l=h=>{const f=h.loaded,I=h.lengthComputable?h.total:-1;this.progressCallback_!==null&&this.progressCallback_(f,I)};this.progressCallback_!==null&&a.addUploadProgressListener(l),a.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&a.removeUploadProgressListener(l),this.pendingConnection_=null;const h=a.getErrorCode()===Dn.NO_ERROR,f=a.getStatus();if(!h||Bd(f,this.additionalRetryCodes_)&&this.retry){const E=a.getErrorCode()===Dn.ABORT;r(!1,new Tn(!1,null,E));return}const I=this.successCodes_.indexOf(f)!==-1;r(!0,new Tn(I,a))})},n=(r,s)=>{const a=this.resolve_,l=this.reject_,h=s.connection;if(s.wasSuccessCode)try{const f=this.callback_(h,h.getResponse());$d(f)?a(f):a()}catch(f){l(f)}else if(h!==null){const f=Pd();f.serverResponse=h.getErrorText(),this.errorCallback_?l(this.errorCallback_(h,f)):l(f)}else if(s.canceled){const f=this.appDelete_?ka():Nd();l(f)}else{const f=Od();l(f)}};this.canceled_?n(!1,new Tn(!1,null,!0)):this.backoffId_=xd(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&Fd(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class Tn{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function Vd(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function Kd(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function zd(t,e){e&&(t["X-Firebase-GMPID"]=e)}function qd(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function Wd(t,e,n,r,s,a,l=!0){const h=jd(t.urlParams),f=t.url+h,I=Object.assign({},t.headers);return zd(I,e),Vd(I,n),Kd(I,a),qd(I,r),new Hd(f,t.method,I,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,s,l)}/** 1163 * @license 1164 * Copyright 2017 Google LLC 1165 * 1166 * Licensed under the Apache License, Version 2.0 (the "License"); 1167 * you may not use this file except in compliance with the License. 1168 * You may obtain a copy of the License at 1169 * 1170 * http://www.apache.org/licenses/LICENSE-2.0 1171 * 1172 * Unless required by applicable law or agreed to in writing, software 1173 * distributed under the License is distributed on an "AS IS" BASIS, 1174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1175 * See the License for the specific language governing permissions and 1176 * limitations under the License. 1177 */function Gd(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function Xd(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/** 1178 * @license 1179 * Copyright 2019 Google LLC 1180 * 1181 * Licensed under the Apache License, Version 2.0 (the "License");
1182 * you may not use this file except in compliance with the License. 1183 * You may obtain a copy of the License at 1184 * 1185 * http://www.apache.org/licenses/LICENSE-2.0 1186 * 1187 * Unless required by applicable law or agreed to in writing, software 1188 * distributed under the License is distributed on an "AS IS" BASIS, 1189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1190 * See the License for the specific language governing permissions and 1191 * limitations under the License. 1192 */class Mn{constructor(e,n){this._service=e,n instanceof ye?this._location=n:this._location=ye.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new Mn(e,n)}get root(){const e=new ye(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return Xd(this._location.path)}get storage(){return this._service}get parent(){const e=Gd(this._location.path);if(e===null)return null;const n=new ye(this._location.bucket,e);return new Mn(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw Ld(e)}}function Zs(t,e){const n=e==null?void 0:e[Sd];return n==null?null:ye.makeFromBucketSpec(n,t)}function Jd(t,e,n,r={}){t.host=`${e}:${n}`,t._protocol="http";const{mockUserToken:s}=r;s&&(t._overrideAuthToken=typeof s=="string"?s:Go(s,t.app.options.projectId))}class Yd{constructor(e,n,r,s,a){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=s,this._firebaseVersion=a,this._bucket=null,this._host=Aa,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=Rd,this._maxUploadRetryTime=Cd,this._requests=new Set,s!=null?this._bucket=ye.makeFromBucketSpec(s,this._host):this._bucket=Zs(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=ye.makeFromBucketSpec(this._url,e):this._bucket=Zs(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){Qs("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){Qs("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Mn(this,e)}_makeRequest(e,n,r,s,a=!0){if(this._deleted)return new Ud(ka());{const l=Wd(e,this._appId,r,s,n,this._firebaseVersion,a);return this._requests.add(l),l.getPromise().then(()=>this._requests.delete(l),()=>this._requests.delete(l)),l}}async makeRequestWithTokens(e,n){const[r,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,s).getPromise()}}const eo="@firebase/storage",to="0.13.1";/** 1193 * @license 1194 * Copyright 2020 Google LLC 1195 * 1196 * Licensed under the Apache License, Version 2.0 (the "License"); 1197 * you may not use this file except in compliance with the License. 1198 * You may obtain a copy of the License at 1199 * 1200 * http://www.apache.org/licenses/LICENSE-2.0 1201 * 1202 * Unless required by applicable law or agreed to in writing, software 1203 * distributed under the License is distributed on an "AS IS" BASIS, 1204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1205 * See the License for the specific language governing permissions and 1206 * limitations under the License. 1207 */const Sa="storage";function b_(t=st(),e){t=de(t);const r=me(t,Sa).getImmediate({identifier:e}),s=zo("storage");return s&&Qd(r,...s),r}function Qd(t,e,n,r={}){Jd(t,e,n,r)}function Zd(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),s=t.getProvider("app-check-internal");return new Yd(n,r,s,e,rt)}function ef(){ee(new z(Sa,Zd,"PUBLIC").setMultipleInstances(!0)),H(eo,to,""),H(eo,to,"esm2017")}ef();/** 1208 * @license 1209 * Copyright 2020 Google LLC 1210 * 1211 * Licensed under the Apache License, Version 2.0 (the "License");
1212 * you may not use this file except in compliance with the License. 1213 * You may obtain a copy of the License at 1214 * 1215 * http://www.apache.org/licenses/LICENSE-2.0 1216 * 1217 * Unless required by applicable law or agreed to in writing, software 1218 * distributed under the License is distributed on an "AS IS" BASIS, 1219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1220 * See the License for the specific language governing permissions and 1221 * limitations under the License. 1222 */const qi=new Map,Ra={activated:!1,tokenObservers:[]},tf={initialized:!1,enabled:!1};function j(t){return qi.get(t)||Object.assign({},Ra)}function nf(t,e){return qi.set(t,e),qi.get(t)}function zn(){return tf}/** 1223 * @license 1224 * Copyright 2020 Google LLC 1225 * 1226 * Licensed under the Apache License, Version 2.0 (the "License"); 1227 * you may not use this file except in compliance with the License. 1228 * You may obtain a copy of the License at 1229 * 1230 * http://www.apache.org/licenses/LICENSE-2.0 1231 * 1232 * Unless required by applicable law or agreed to in writing, software 1233 * distributed under the License is distributed on an "AS IS" BASIS, 1234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1235 * See the License for the specific language governing permissions and 1236 * limitations under the License. 1237 */const Ca="https://content-firebaseappcheck.googleapis.com/v1",rf="exchangeRecaptchaEnterpriseToken",sf="exchangeDebugToken",no={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},of=24*60*60*1e3;/** 1238 * @license 1239 * Copyright 2020 Google LLC 1240 * 1241 * Licensed under the Apache License, Version 2.0 (the "License"); 1242 * you may not use this file except in compliance with the License. 1243 * You may obtain a copy of the License at 1244 * 1245 * http://www.apache.org/licenses/LICENSE-2.0 1246 * 1247 * Unless required by applicable law or agreed to in writing, software 1248 * distributed under the License is distributed on an "AS IS" BASIS, 1249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1250 * See the License for the specific language governing permissions and 1251 * limitations under the License. 1252 */class af{constructor(e,n,r,s,a){if(this.operation=e,this.retryPolicy=n,this.getWaitDuration=r,this.lowerBound=s,this.upperBound=a,this.pending=null,this.nextErrorWaitInterval=s,s>a)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new Ht,this.pending.promise.catch(n=>{}),await cf(this.getNextRun(e)),this.pending.resolve(),await this.pending.promise,this.pending=new Ht,this.pending.promise.catch(n=>{}),await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(n){this.retryPolicy(n)?this.process(!1).catch(()=>{}):this.stop()}}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const n=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),n}}}function cf(t){return new Promise(e=>{setTimeout(e,t)})}/** 1253 * @license 1254 * Copyright 2020 Google LLC 1255 * 1256 * Licensed under the Apache License, Version 2.0 (the "License"); 1257 * you may not use this file except in compliance with the License. 1258 * You may obtain a copy of the License at 1259 * 1260 * http://www.apache.org/licenses/LICENSE-2.0 1261 * 1262 * Unless required by applicable law or agreed to in writing, software 1263 * distributed under the License is distributed on an "AS IS" BASIS, 1264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1265 * See the License for the specific language governing permissions and 1266 * limitations under the License. 1267 */const lf={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},ae=new be("appCheck","AppCheck",lf);/** 1268 * @license 1269 * Copyright 2020 Google LLC 1270 * 1271 * Licensed under the Apache License, Version 2.0 (the "License");
1272 * you may not use this file except in compliance with the License. 1273 * You may obtain a copy of the License at 1274 * 1275 * http://www.apache.org/licenses/LICENSE-2.0 1276 * 1277 * Unless required by applicable law or agreed to in writing, software 1278 * distributed under the License is distributed on an "AS IS" BASIS, 1279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1280 * See the License for the specific language governing permissions and 1281 * limitations under the License. 1282 */function io(t=!1){var e;return t?(e=self.grecaptcha)===null||e===void 0?void 0:e.enterprise:self.grecaptcha}function dr(t){if(!j(t).activated)throw ae.create("use-before-activation",{appName:t.name})}function Pa(t){const e=Math.round(t/1e3),n=Math.floor(e/(3600*24)),r=Math.floor((e-n*3600*24)/3600),s=Math.floor((e-n*3600*24-r*3600)/60),a=e-n*3600*24-r*3600-s*60;let l="";return n&&(l+=In(n)+"d:"),r&&(l+=In(r)+"h:"),l+=In(s)+"m:"+In(a)+"s",l}function In(t){return t===0?"00":t>=10?t.toString():"0"+t}/** 1283 * @license 1284 * Copyright 2020 Google LLC 1285 * 1286 * Licensed under the Apache License, Version 2.0 (the "License"); 1287 * you may not use this file except in compliance with the License. 1288 * You may obtain a copy of the License at 1289 * 1290 * http://www.apache.org/licenses/LICENSE-2.0 1291 * 1292 * Unless required by applicable law or agreed to in writing, software 1293 * distributed under the License is distributed on an "AS IS" BASIS, 1294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1295 * See the License for the specific language governing permissions and 1296 * limitations under the License. 1297 */async function fr({url:t,body:e},n){const r={"Content-Type":"application/json"},s=n.getImmediate({optional:!0});if(s){const A=await s.getHeartbeatsHeader();A&&(r["X-Firebase-Client"]=A)}const a={method:"POST",body:JSON.stringify(e),headers:r};let l;try{l=await fetch(t,a)}catch(A){throw ae.create("fetch-network-error",{originalErrorMessage:A==null?void 0:A.message})}if(l.status!==200)throw ae.create("fetch-status-error",{httpStatus:l.status});let h;try{h=await l.json()}catch(A){throw ae.create("fetch-parse-error",{originalErrorMessage:A==null?void 0:A.message})}const f=h.ttl.match(/^([\d.]+)(s)$/);if(!f||!f[2]||isNaN(Number(f[1])))throw ae.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${h.ttl}`});const I=Number(f[1])*1e3,E=Date.now();return{token:h.token,expireTimeMillis:E+I,issuedAtTimeMillis:E}}function uf(t,e){const{projectId:n,appId:r,apiKey:s}=t.options;return{url:`${Ca}/projects/${n}/apps/${r}:${rf}?key=${s}`,body:{recaptcha_enterprise_token:e}}}function Oa(t,e){const{projectId:n,appId:r,apiKey:s}=t.options;return{url:`${Ca}/projects/${n}/apps/${r}:${sf}?key=${s}`,body:{debug_token:e}}}/** 1298 * @license 1299 * Copyright 2020 Google LLC 1300 * 1301 * Licensed under the Apache License, Version 2.0 (the "License"); 1302 * you may not use this file except in compliance with the License. 1303 * You may obtain a copy of the License at 1304 * 1305 * http://www.apache.org/licenses/LICENSE-2.0 1306 * 1307 * Unless required by applicable law or agreed to in writing, software 1308 * distributed under the License is distributed on an "AS IS" BASIS, 1309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1310 * See the License for the specific language governing permissions and 1311 * limitations under the License. 1312 */const hf="firebase-app-check-database",df=1,qt="firebase-app-check-store",Na="debug-token";let wn=null;function Da(){return wn||(wn=new Promise((t,e)=>{try{const n=indexedDB.open(hf,df);n.onsuccess=r=>{t(r.target.result)},n.onerror=r=>{var s;e(ae.create("storage-open",{originalErrorMessage:(s=r.target.error)===null||s===void 0?void 0:s.message}))},n.onupgradeneeded=r=>{const s=r.target.result;switch(r.oldVersion){case 0:s.createObjectStore(qt,{keyPath:"compositeKey"})}}}catch(n){e(ae.create("storage-open",{originalErrorMessage:n==null?void 0:n.message}))}}),wn)}function ff(t){return La(Ua(t))}function pf(t,e){return Ma(Ua(t),e)}function gf(t){return Ma(Na,t)}function mf(){return La(Na)}async function Ma(t,e){const r=(await Da()).transaction(qt,"readwrite"),a=r.objectStore(qt).put({compositeKey:t,value:e});return new Promise((l,h)=>{a.onsuccess=f=>{l()},r.onerror=f=>{var I;h(ae.create("storage-set",{originalErrorMessage:(I=f.target.error)===null||I===void 0?void 0:I.message}))}})}async function La(t){const n=(await Da()).transaction(qt,"readonly"),s=n.objectStore(qt).get(t);return new Promise((a,l)=>{s.onsuccess=h=>{const f=h.target.result;a(f?f.value:void 0)},n.onerror=h=>{var f;l(ae.create("storage-get",{originalErrorMessage:(f=h.target.error)===null||f===void 0?void 0:f.message}))}})}function Ua(t){return`${t.options.appId}-${t.name}`}/** 1313 * @license 1314 * Copyright 2020 Google LLC 1315 * 1316 * Licensed under the Apache License, Version 2.0 (the "License");
1317 * you may not use this file except in compliance with the License. 1318 * You may obtain a copy of the License at 1319 * 1320 * http://www.apache.org/licenses/LICENSE-2.0 1321 * 1322 * Unless required by applicable law or agreed to in writing, software 1323 * distributed under the License is distributed on an "AS IS" BASIS, 1324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1325 * See the License for the specific language governing permissions and 1326 * limitations under the License. 1327 */const Wt=new It("@firebase/app-check");/** 1328 * @license 1329 * Copyright 2020 Google LLC 1330 * 1331 * Licensed under the Apache License, Version 2.0 (the "License"); 1332 * you may not use this file except in compliance with the License. 1333 * You may obtain a copy of the License at 1334 * 1335 * http://www.apache.org/licenses/LICENSE-2.0 1336 * 1337 * Unless required by applicable law or agreed to in writing, software 1338 * distributed under the License is distributed on an "AS IS" BASIS, 1339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1340 * See the License for the specific language governing permissions and 1341 * limitations under the License. 1342 */async function _f(t){if(Tt()){let e;try{e=await ff(t)}catch(n){Wt.warn(`Failed to read token from IndexedDB. Error: ${n}`)}return e}}function Ci(t,e){return Tt()?pf(t,e).catch(n=>{Wt.warn(`Failed to write token to IndexedDB. Error: ${n}`)}):Promise.resolve()}async function vf(){let t;try{t=await mf()}catch{}if(t)return t;{const e=Bl();return gf(e).catch(n=>Wt.warn(`Failed to persist debug token to IndexedDB. Error: ${n}`)),e}}/** 1343 * @license 1344 * Copyright 2020 Google LLC 1345 * 1346 * Licensed under the Apache License, Version 2.0 (the "License"); 1347 * you may not use this file except in compliance with the License. 1348 * You may obtain a copy of the License at 1349 * 1350 * http://www.apache.org/licenses/LICENSE-2.0 1351 * 1352 * Unless required by applicable law or agreed to in writing, software 1353 * distributed under the License is distributed on an "AS IS" BASIS, 1354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1355 * See the License for the specific language governing permissions and 1356 * limitations under the License. 1357 */function pr(){return zn().enabled}async function gr(){const t=zn();if(t.enabled&&t.token)return t.token.promise;throw Error(` 1358 Can't get debug token in production mode. 1359 `)}function yf(){const t=Vo(),e=zn();if(e.initialized=!0,typeof t.FIREBASE_APPCHECK_DEBUG_TOKEN!="string"&&t.FIREBASE_APPCHECK_DEBUG_TOKEN!==!0)return;e.enabled=!0;const n=new Ht;e.token=n,typeof t.FIREBASE_APPCHECK_DEBUG_TOKEN=="string"?n.resolve(t.FIREBASE_APPCHECK_DEBUG_TOKEN):n.resolve(vf())}/** 1360 * @license 1361 * Copyright 2020 Google LLC 1362 * 1363 * Licensed under the Apache License, Version 2.0 (the "License"); 1364 * you may not use this file except in compliance with the License. 1365 * You may obtain a copy of the License at 1366 * 1367 * http://www.apache.org/licenses/LICENSE-2.0 1368 * 1369 * Unless required by applicable law or agreed to in writing, software 1370 * distributed under the License is distributed on an "AS IS" BASIS, 1371 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1372 * See the License for the specific language governing permissions and 1373 * limitations under the License. 1374 */const Tf={error:"UNKNOWN_ERROR"};function If(t){return er.encodeString(JSON.stringify(t),!1)}async function Wi(t,e=!1){const n=t.app;dr(n);const r=j(n);let s=r.token,a;if(s&&!ht(s)&&(r.token=void 0,s=void 0),!s){const f=await r.cachedTokenPromise;f&&(ht(f)?s=f:await Ci(n,void 0))}if(!e&&s&&ht(s))return{token:s.token};let l=!1;if(pr()){r.exchangeTokenPromise||(r.exchangeTokenPromise=fr(Oa(n,await gr()),t.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),l=!0);const f=await r.exchangeTokenPromise;return await Ci(n,f),r.token=f,{token:f.token}}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),l=!0),s=await j(n).exchangeTokenPromise}catch(f){f.code==="appCheck/throttled"?Wt.warn(f.message):Wt.error(f),a=f}let h;return s?a?ht(s)?h={token:s.token,internalError:a}:h=so(a):(h={token:s.token},r.token=s,await Ci(n,s)):h=so(a),l&&ja(n,h),h}async function xa(t){const e=t.app;dr(e);const{provider:n}=j(e);if(pr()){const r=await gr(),{token:s}=await fr(Oa(e,r),t.heartbeatServiceProvider);return{token:s}}else{const{token:r}=await n.getToken();return{token:r}}}function Fa(t,e,n,r){const{app:s}=t,a=j(s),l={next:n,error:r,type:e};if(a.tokenObservers=[...a.tokenObservers,l],a.token&&ht(a.token)){const h=a.token;Promise.resolve().then(()=>{n({token:h.token}),ro(t)}).catch(()=>{})}a.cachedTokenPromise.then(()=>ro(t))}function $a(t,e){const n=j(t),r=n.tokenObservers.filter(s=>s.next!==e);r.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=r}function ro(t){const{app:e}
1374=t,n=j(e);let r=n.tokenRefresher;r||(r=wf(t),n.tokenRefresher=r),!r.isRunning()&&n.isTokenAutoRefreshEnabled&&r.start()}function wf(t){const{app:e}=t;return new af(async()=>{const n=j(e);let r;if(n.token?r=await Wi(t,!0):r=await Wi(t),r.error)throw r.error;if(r.internalError)throw r.internalError},()=>!0,()=>{const n=j(e);if(n.token){let r=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5;const s=n.token.expireTimeMillis-5*60*1e3;return r=Math.min(r,s),Math.max(0,r-Date.now())}else return 0},no.RETRIAL_MIN_WAIT,no.RETRIAL_MAX_WAIT)}function ja(t,e){const n=j(t).tokenObservers;for(const r of n)try{r.type==="EXTERNAL"&&e.error!=null?r.error(e.error):r.next(e)}catch{}}function ht(t){return t.expireTimeMillis-Date.now()>0}function so(t){return{token:If(Tf),error:t}}/** 1375 * @license 1376 * Copyright 2020 Google LLC 1377 * 1378 * Licensed under the Apache License, Version 2.0 (the "License"); 1379 * you may not use this file except in compliance with the License. 1380 * You may obtain a copy of the License at 1381 * 1382 * http://www.apache.org/licenses/LICENSE-2.0 1383 * 1384 * Unless required by applicable law or agreed to in writing, software 1385 * distributed under the License is distributed on an "AS IS" BASIS, 1386 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1387 * See the License for the specific language governing permissions and 1388 * limitations under the License. 1389 */class Ef{constructor(e,n){this.app=e,this.heartbeatServiceProvider=n}_delete(){const{tokenObservers:e}=j(this.app);for(const n of e)$a(this.app,n.next);return Promise.resolve()}}function bf(t,e){return new Ef(t,e)}function Af(t){return{getToken:e=>Wi(t,e),getLimitedUseToken:()=>xa(t),addTokenListener:e=>Fa(t,"INTERNAL",e),removeTokenListener:e=>$a(t.app,e)}}const kf="@firebase/app-check",Sf="0.8.7",Rf="https://www.google.com/recaptcha/enterprise.js";function Cf(t,e){const n=new Ht,r=j(t);r.reCAPTCHAState={initialized:n};const s=Pf(t),a=io(!0);return a?oo(t,e,a,s,n):Df(()=>{const l=io(!0);if(!l)throw new Error("no recaptcha");oo(t,e,l,s,n)}),n.promise}function oo(t,e,n,r,s){n.ready(()=>{Nf(t,e,n,r),s.resolve(n)})}function Pf(t){const e=`fire_app_check_${t.name}`,n=document.createElement("div");return n.id=e,n.style.display="none",document.body.appendChild(n),e}async function Of(t){dr(t);const n=await j(t).reCAPTCHAState.initialized.promise;return new Promise((r,s)=>{const a=j(t).reCAPTCHAState;n.ready(()=>{r(n.execute(a.widgetId,{action:"fire_app_check"}))})})}function Nf(t,e,n,r){const s=n.render(r,{sitekey:e,size:"invisible",callback:()=>{j(t).reCAPTCHAState.succeeded=!0},"error-callback":()=>{j(t).reCAPTCHAState.succeeded=!1}}),a=j(t);a.reCAPTCHAState=Object.assign(Object.assign({},a.reCAPTCHAState),{widgetId:s})}function Df(t){const e=document.createElement("script");e.src=Rf,e.onload=t,document.head.appendChild(e)}class Ba{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){var e,n,r;Lf(this._throttleData);const s=await Of(this._app).catch(l=>{throw ae.create("recaptcha-error")});if(!(!((e=j(this._app).reCAPTCHAState)===null||e===void 0)&&e.succeeded))throw ae.create("recaptcha-error");let a;try{a=await fr(uf(this._app,s),this._heartbeatServiceProvider)}catch(l){throw!((n=l.code)===null||n===void 0)&&n.includes("fetch-status-error")?(this._throttleData=Mf(Number((r=l.customData)===null||r===void 0?void 0:r.httpStatus),this._throttleData),ae.create("throttled",{time:Pa(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):l}return this._throttleData=null,a}initialize(e){this._app=e,this._heartbeatServiceProvider=me(e,"heartbeat"),Cf(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof Ba?this._siteKey===e._siteKey:!1}}function Mf(t,e){if(t===404||t===403)return{backoffCount:1,allowRequestsAfter:Date.now()+of,httpStatus:t};{const n=e?e.backoffCount:0,r=ji(n,1e3,2);return{backoffCount:n+1,allowRequestsAfter:Date.now()+r,httpStatus:t}}}function Lf(t){if(t&&Date.now()-t.allowRequestsAfter<=0)throw ae.create("throttled",{time:Pa(t.allowRequestsAfter-Date.now()),httpStatus:t.httpStatus})}/** 1390 * @license 1391 * Copyright 2020 Google LLC 1392 * 1393 * Licensed under the Apache License, Version 2.0 (the "License");
1394 * you may not use this file except in compliance with the License. 1395 * You may obtain a copy of the License at 1396 * 1397 * http://www.apache.org/licenses/LICENSE-2.0 1398 * 1399 * Unless required by applicable law or agreed to in writing, software 1400 * distributed under the License is distributed on an "AS IS" BASIS, 1401 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1402 * See the License for the specific language governing permissions and 1403 * limitations under the License. 1404 */function A_(t=st(),e){t=de(t);const n=me(t,"app-check");if(zn().initialized||yf(),pr()&&gr().then(s=>console.log(`App Check debug token: ${s}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),n.isInitialized()){const s=n.getImmediate(),a=n.getOptions();if(a.isTokenAutoRefreshEnabled===e.isTokenAutoRefreshEnabled&&a.provider.isEqual(e.provider))return s;throw ae.create("already-initialized",{appName:t.name})}const r=n.initialize({options:e});return Uf(t,e.provider,e.isTokenAutoRefreshEnabled),j(t).isTokenAutoRefreshEnabled&&Fa(r,"INTERNAL",()=>{}),r}function Uf(t,e,n){const r=nf(t,Object.assign({},Ra));r.activated=!0,r.provider=e,r.cachedTokenPromise=_f(t).then(s=>(s&&ht(s)&&(r.token=s,ja(t,{token:s.token})),s)),r.isTokenAutoRefreshEnabled=n===void 0?t.automaticDataCollectionEnabled:n,r.provider.initialize(t)}function k_(t){return xa(t)}const xf="app-check",ao="app-check-internal";function Ff(){ee(new z(xf,t=>{const e=t.getProvider("app").getImmediate(),n=t.getProvider("heartbeat");return bf(e,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,e,n)=>{t.getProvider(ao).initialize()})),ee(new z(ao,t=>{const e=t.getProvider("app-check").getImmediate();return Af(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),H(kf,Sf)}Ff();const co="@firebase/performance",Gi="0.6.8";/** 1405 * @license 1406 * Copyright 2020 Google LLC 1407 * 1408 * Licensed under the Apache License, Version 2.0 (the "License"); 1409 * you may not use this file except in compliance with the License. 1410 * You may obtain a copy of the License at 1411 * 1412 * http://www.apache.org/licenses/LICENSE-2.0 1413 * 1414 * Unless required by applicable law or agreed to in writing, software 1415 * distributed under the License is distributed on an "AS IS" BASIS, 1416 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1417 * See the License for the specific language governing permissions and 1418 * limitations under the License. 1419 */const Ha=Gi,$f="FB-PERF-TRACE-START",jf="FB-PERF-TRACE-STOP",Xi="FB-PERF-TRACE-MEASURE",Va="_wt_",Ka="_fp",za="_fcp",qa="_fid",Wa="@firebase/performance/config",Ga="@firebase/performance/configexpire",Bf="performance",Xa="Performance";/** 1420 * @license 1421 * Copyright 2020 Google LLC 1422 * 1423 * Licensed under the Apache License, Version 2.0 (the "License"); 1424 * you may not use this file except in compliance with the License. 1425 * You may obtain a copy of the License at 1426 * 1427 * http://www.apache.org/licenses/LICENSE-2.0 1428 * 1429 * Unless required by applicable law or agreed to in writing, software 1430 * distributed under the License is distributed on an "AS IS" BASIS, 1431 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1432 * See the License for the specific language governing permissions and 1433 * limitations under the License. 1434 */const Hf={"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName}
1434 is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","already initialized":"initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance."},Y=new be(Bf,Xa,Hf);/** 1435 * @license 1436 * Copyright 2020 Google LLC 1437 * 1438 * Licensed under the Apache License, Version 2.0 (the "License"); 1439 * you may not use this file except in compliance with the License. 1440 * You may obtain a copy of the License at 1441 * 1442 * http://www.apache.org/licenses/LICENSE-2.0 1443 * 1444 * Unless required by applicable law or agreed to in writing, software 1445 * distributed under the License is distributed on an "AS IS" BASIS, 1446 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1447 * See the License for the specific language governing permissions and 1448 * limitations under the License. 1449 */const Ee=new It(Xa);Ee.logLevel=D.INFO;/** 1450 * @license 1451 * Copyright 2020 Google LLC 1452 * 1453 * Licensed under the Apache License, Version 2.0 (the "License"); 1454 * you may not use this file except in compliance with the License. 1455 * You may obtain a copy of the License at 1456 * 1457 * http://www.apache.org/licenses/LICENSE-2.0 1458 * 1459 * Unless required by applicable law or agreed to in writing, software 1460 * distributed under the License is distributed on an "AS IS" BASIS, 1461 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1462 * See the License for the specific language governing permissions and 1463 * limitations under the License. 1464 */let Pi,Ja;class V{constructor(e){if(this.window=e,!e)throw Y.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.navigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay)}getUrl(){return this.windowLocation.href.split("?")[0]}mark(e){!this.performance||!this.performance.mark||this.performance.mark(e)}measure(e,n,r){!this.performance||!this.performance.measure||this.performance.measure(e,n,r)}getEntriesByType(e){return!this.performance||!this.performance.getEntriesByType?[]:this.performance.getEntriesByType(e)}getEntriesByName(e){return!this.performance||!this.performance.getEntriesByName?[]:this.performance.getEntriesByName(e)}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return!fetch||!Promise||!nr()?(Ee.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1):Tt()?!0:(Ee.info("IndexedDB is not supported by current browser"),!1)}setupObserver(e,n){if(!this.PerformanceObserver)return;new this.PerformanceObserver(s=>{for(const a of s.getEntries())n(a)}).observe({entryTypes:[e]})}static getInstance(){return Pi===void 0&&(Pi=new V(Ja)),Pi}}function Vf(t){Ja=t}/** 1465 * @license 1466 * Copyright 2020 Google LLC 1467 * 1468 * Licensed under the Apache License, Version 2.0 (the "License"); 1469 * you may not use this file except in compliance with the License. 1470 * You may obtain a copy of the License at 1471 * 1472 * http://www.apache.org/licenses/LICENSE-2.0 1473 * 1474 * Unless required by applicable law or agreed to in writing, software 1475 * distributed under the License is distributed on an "AS IS" BASIS, 1476 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1477 * See the License for the specific language governing permissions and 1478 * limitations under the License. 1479 */let Ya;function Kf(t){const e=t.getId();return e.then(n=>{Ya=n}),e}function mr(){return Ya}function zf(t){const e=t.getToken();return e.then(n=>{}),e}/** 1480 * @license 1481 * Copyright 2020 Google LLC 1482 * 1483 * Licensed under the Apache License, Version 2.0 (the "License"); 1484 * you may not use this file except in compliance with the License. 1485 * You may obtain a copy of the License at 1486 * 1487 * http://www.apache.org/licenses/LICENSE-2.0 1488 * 1489 * Unless required by applicable law or agreed to in writing, softw
1489are 1490 * distributed under the License is distributed on an "AS IS" BASIS, 1491 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1492 * See the License for the specific language governing permissions and 1493 * limitations under the License. 1494 */function lo(t,e){const n=t.length-e.length;if(n<0||n>1)throw Y.create("invalid String merger input");const r=[];for(let s=0;s<t.length;s++)r.push(t.charAt(s)),e.length>s&&r.push(e.charAt(s));return r.join("")}/** 1495 * @license 1496 * Copyright 2019 Google LLC 1497 * 1498 * Licensed under the Apache License, Version 2.0 (the "License"); 1499 * you may not use this file except in compliance with the License. 1500 * You may obtain a copy of the License at 1501 * 1502 * http://www.apache.org/licenses/LICENSE-2.0 1503 * 1504 * Unless required by applicable law or agreed to in writing, software 1505 * distributed under the License is distributed on an "AS IS" BASIS, 1506 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1507 * See the License for the specific language governing permissions and 1508 * limitations under the License. 1509 */let Oi;class ue{constructor(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=lo("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=lo("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}getFlTransportFullUrl(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)}static getInstance(){return Oi===void 0&&(Oi=new ue),Oi}}/** 1510 * @license 1511 * Copyright 2020 Google LLC 1512 * 1513 * Licensed under the Apache License, Version 2.0 (the "License"); 1514 * you may not use this file except in compliance with the License. 1515 * You may obtain a copy of the License at 1516 * 1517 * http://www.apache.org/licenses/LICENSE-2.0 1518 * 1519 * Unless required by applicable law or agreed to in writing, software 1520 * distributed under the License is distributed on an "AS IS" BASIS, 1521 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1522 * See the License for the specific language governing permissions and 1523 * limitations under the License. 1524 */var pt;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.VISIBLE=1]="VISIBLE",t[t.HIDDEN=2]="HIDDEN"})(pt||(pt={}));const qf=["firebase_","google_","ga_"],Wf=new RegExp("^[a-zA-Z]\\w*$"),Gf=40,Xf=100;function Jf(){const t=V.getInstance().navigator;return t!=null&&t.serviceWorker?t.serviceWorker.controller?2:3:1}function Qa(){switch(V.getInstance().document.visibilityState){case"visible":return pt.VISIBLE;case"hidden":return pt.HIDDEN;default:return pt.UNKNOWN}}function Yf(){const e=V.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}function Qf(t){return t.length===0||t.length>Gf?!1:!qf.some(n=>t.startsWith(n))&&!!t.match(Wf)}function Zf(t){return t.length!==0&&t.length<=Xf}/** 1525 * @license 1526 * Copyright 2020 Google LLC 1527 * 1528 * Licensed under the Apache License, Version 2.0 (the "License"); 1529 * you may not use this file except in compliance with the License. 1530 * You may obtain a copy of the License at 1531 * 1532 * http://www.apache.org/licenses/LICENSE-2.0 1533 * 1534 * Unless required by applicable law or agreed to in writing, software 1535 * distributed under the License is distributed on an "AS IS" BASIS, 1536 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1537 * See the License for the specific language governing permissions and 1538 * limitations under the License. 1539 */function Za(t){var e;const n=(e=t.options)===null||e===void 0?void 0:e.appId;if(!n)throw Y.create("no app id");return n}function ep(t){var e;const n=(e=t.options)===null||e===void 0?void 0:e.projectId;if(!n)throw Y.create("no project id");return n}function tp(t){var e;const n=(e=t.options)===null||e===void 0?void 0:e.apiKey;if(!n)throw Y.create("no api key");return n}/** 1540 * @license 1541 * Copyright 2020 Google LLC 1542 * 1543 * Licensed under the Apache License, Version 2.0 (the "License");
1544 * you may not use this file except in compliance with the License. 1545 * You may obtain a copy of the License at 1546 * 1547 * http://www.apache.org/licenses/LICENSE-2.0 1548 * 1549 * Unless required by applicable law or agreed to in writing, software 1550 * distributed under the License is distributed on an "AS IS" BASIS, 1551 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1552 * See the License for the specific language governing permissions and 1553 * limitations under the License. 1554 */const np="0.0.1",ve={loggingEnabled:!0},ip="FIREBASE_INSTALLATIONS_AUTH";function rp(t,e){const n=sp();return n?(uo(n),Promise.resolve()):cp(t,e).then(uo).then(r=>op(r),()=>{})}function sp(){const t=V.getInstance().localStorage;if(!t)return;const e=t.getItem(Ga);if(!e||!lp(e))return;const n=t.getItem(Wa);if(n)try{return JSON.parse(n)}catch{return}}function op(t){const e=V.getInstance().localStorage;!t||!e||(e.setItem(Wa,JSON.stringify(t)),e.setItem(Ga,String(Date.now()+ue.getInstance().configTimeToLive*60*60*1e3)))}const ap="Could not fetch config, will use default configs";function cp(t,e){return zf(t.installations).then(n=>{const r=ep(t.app),s=tp(t.app),a=`https://firebaseremoteconfig.googleapis.com/v1/projects/${r}/namespaces/fireperf:fetch?key=${s}`,l=new Request(a,{method:"POST",headers:{Authorization:`${ip} ${n}`},body:JSON.stringify({app_instance_id:e,app_instance_id_token:n,app_id:Za(t.app),app_version:Ha,sdk_version:np})});return fetch(l).then(h=>{if(h.ok)return h.json();throw Y.create("RC response not ok")})}).catch(()=>{Ee.info(ap)})}function uo(t){if(!t)return t;const e=ue.getInstance(),n=t.entries||{};return n.fpr_enabled!==void 0?e.loggingEnabled=String(n.fpr_enabled)==="true":e.loggingEnabled=ve.loggingEnabled,n.fpr_log_source?e.logSource=Number(n.fpr_log_source):ve.logSource&&(e.logSource=ve.logSource),n.fpr_log_endpoint_url?e.logEndPointUrl=n.fpr_log_endpoint_url:ve.logEndPointUrl&&(e.logEndPointUrl=ve.logEndPointUrl),n.fpr_log_transport_key?e.transportKey=n.fpr_log_transport_key:ve.transportKey&&(e.transportKey=ve.transportKey),n.fpr_vc_network_request_sampling_rate!==void 0?e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate):ve.networkRequestsSamplingRate!==void 0&&(e.networkRequestsSamplingRate=ve.networkRequestsSamplingRate),n.fpr_vc_trace_sampling_rate!==void 0?e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate):ve.tracesSamplingRate!==void 0&&(e.tracesSamplingRate=ve.tracesSamplingRate),e.logTraceAfterSampling=ho(e.tracesSamplingRate),e.logNetworkAfterSampling=ho(e.networkRequestsSamplingRate),t}function lp(t){return Number(t)>Date.now()}function ho(t){return Math.random()<=t}/** 1555 * @license 1556 * Copyright 2020 Google LLC 1557 * 1558 * Licensed under the Apache License, Version 2.0 (the "License"); 1559 * you may not use this file except in compliance with the License. 1560 * You may obtain a copy of the License at 1561 * 1562 * http://www.apache.org/licenses/LICENSE-2.0 1563 * 1564 * Unless required by applicable law or agreed to in writing, software 1565 * distributed under the License is distributed on an "AS IS" BASIS, 1566 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1567 * See the License for the specific language governing permissions and 1568 * limitations under the License. 1569 */let _r=1,Ni;function ec(t){return _r=2,Ni=Ni||hp(t),Ni}function up(){return _r===3}function hp(t){return dp().then(()=>Kf(t.installations)).then(e=>rp(t,e)).then(()=>fo(),()=>fo())}function dp(){const t=V.getInstance().document;return new Promise(e=>{if(t&&t.readyState!=="complete"){const n=()=>{t.readyState==="complete"&&(t.removeEventListener("readystatechange",n),e())};t.addEventListener("readystatechange",n)}else e()})}function fo(){_r=3}/** 1570 * @license 1571 * Copyright 2020 Google LLC 1572 * 1573 * Licensed under the Apache License, Version 2.0 (the "License"); 1574 * you may not use this file except in compliance with the License. 1575 * You may obtain a copy of the License at 1576 * 1577 * http://www.apache.org/licenses/LICENSE-2.0 1578 * 1579 * Unless required by applicable law or agreed to in writing, software 1580 * distributed under the License is distributed on an "AS IS" BASIS, 1581 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1582 * See the License for the specific language governing permissions and 1583 * limitations under the License. 1584 */const vr=10*1e3,fp=5.5*1e3,tc=3,pp=1e3;let Ln=tc,We=[],po=!1;function gp(){po||(qn(fp),po=!0)}function qn(t){setTimeout(()=>{if(Ln!==0){if(!We.length)return qn(vr);mp()}},t)}function mp(){const t=We.splice(0,pp),e=t.map(r=>({source_extension_json_proto3:r.message,event_time_ms:String(r.eventTime)})),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:ue.getInstance().logSource,log_event:e};_p(n,t).catch(()=>{We=[...t,...We],Ln--,Ee.info(`Tries left: ${Ln}.`),qn(vr)})}function _p(t,e){return vp(t).then(n=>(n.ok||Ee.info("Call to Firebase backend failed."),n.json())).then(n=>{const r=Number(n.nextRequestWaitMillis);let s=vr;isNaN(r)||(s=Math.max(r,s));const a=n.logResponseDetails;Array.isArray(a)&&a.length>0&&a[0].responseAction==="RETRY_REQUEST_LATER"&&(We=[...e,...We],Ee.info("Retry transport request later.")),Ln=tc,qn(s)})}function vp(t){const e=ue.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}function yp(t){if(!t.eventTime||!t.message)throw Y.create("invalid cc log");We=[...We,t]}function Tp(t){return(...e)=>{const n=t(...e);yp({message:n,eventTime:Date.now()})}}/** 1585 * @license 1586 * Copyright 2020 Google LLC 1587 * 1588 * Licensed under the Apache License, Version 2.0 (the "License");
1589 * you may not use this file except in compliance with the License. 1590 * You may obtain a copy of the License at 1591 * 1592 * http://www.apache.org/licenses/LICENSE-2.0 1593 * 1594 * Unless required by applicable law or agreed to in writing, software 1595 * distributed under the License is distributed on an "AS IS" BASIS, 1596 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1597 * See the License for the specific language governing permissions and 1598 * limitations under the License. 1599 */let Di;function nc(t,e){Di||(Di=Tp(wp)),Di(t,e)}function En(t){const e=ue.getInstance();!e.instrumentationEnabled&&t.isAuto||!e.dataCollectionEnabled&&!t.isAuto||V.getInstance().requiredApisAvailable()&&(t.isAuto&&Qa()!==pt.VISIBLE||(up()?Mi(t):ec(t.performanceController).then(()=>Mi(t),()=>Mi(t))))}function Mi(t){if(!mr())return;const e=ue.getInstance();!e.loggingEnabled||!e.logTraceAfterSampling||setTimeout(()=>nc(t,1),0)}function Ip(t){const e=ue.getInstance();if(!e.instrumentationEnabled)return;const n=t.url,r=e.logEndPointUrl.split("?")[0],s=e.flTransportEndpointUrl.split("?")[0];n===r||n===s||!e.loggingEnabled||!e.logNetworkAfterSampling||setTimeout(()=>nc(t,0),0)}function wp(t,e){return e===0?Ep(t):bp(t)}function Ep(t){const e={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},n={application_info:ic(t.performanceController.app),network_request_metric:e};return JSON.stringify(n)}function bp(t){const e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};Object.keys(t.counters).length!==0&&(e.counters=t.counters);const n=t.getAttributes();Object.keys(n).length!==0&&(e.custom_attributes=n);const r={application_info:ic(t.performanceController.app),trace_metric:e};return JSON.stringify(r)}function ic(t){return{google_app_id:Za(t),app_instance_id:mr(),web_app_info:{sdk_version:Ha,page_url:V.getInstance().getUrl(),service_worker_status:Jf(),visibility_state:Qa(),effective_connection_type:Yf()},application_process_state:0}}/** 1600 * @license 1601 * Copyright 2020 Google LLC 1602 * 1603 * Licensed under the Apache License, Version 2.0 (the "License"); 1604 * you may not use this file except in compliance with the License. 1605 * You may obtain a copy of the License at 1606 * 1607 * http://www.apache.org/licenses/LICENSE-2.0 1608 * 1609 * Unless required by applicable law or agreed to in writing, software 1610 * distributed under the License is distributed on an "AS IS" BASIS, 1611 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1612 * See the License for the specific language governing permissions and 1613 * limitations under the License. 1614 */const Ap=100,kp="_",Sp=[Ka,za,qa];function Rp(t,e){return t.length===0||t.length>Ap?!1:e&&e.startsWith(Va)&&Sp.indexOf(t)>-1||!t.startsWith(kp)}function Cp(t){const e=Math.floor(t);return e<t&&Ee.info(`Metric value should be an Integer, setting the value as : ${e}.`),e}/** 1615 * @license 1616 * Copyright 2020 Google LLC 1617 * 1618 * Licensed under the Apache License, Version 2.0 (the "License"); 1619 * you may not use this file except in compliance with the License. 1620 * You may obtain a copy of the License at 1621 * 1622 * http://www.apache.org/licenses/LICENSE-2.0 1623 * 1624 * Unless required by applicable law or agreed to in writing, software 1625 * distributed under the License is distributed on an "AS IS" BASIS, 1626 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1627 * See the License for the specific language governing permissions and 1628 * limitations under the License. 1629 */class Ge{constructor(e,n,r=!1,s){this.performanceController=e,this.name=n,this.isAuto=r,this.state=1,this.customAttributes={},this.counters={},this.api=V.getInstance(),this.randomId=Math.floor(Math.random()*1e6),this.isAuto||(this.traceStartMark=`${$f}-${this.randomId}-${this.name}`,this.traceStopMark=`${jf}-${this.randomId}-${this.name}`,this.traceMeasure=s||`${Xi}-${this.randomId}-${this.name}`,s&&this.calculateTraceMetrics())}
1629start(){if(this.state!==1)throw Y.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2}stop(){if(this.state!==2)throw Y.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),En(this)}record(e,n,r){if(e<=0)throw Y.create("nonpositive trace startTime",{traceName:this.name});if(n<=0)throw Y.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(n*1e3),this.startTimeUs=Math.floor(e*1e3),r&&r.attributes&&(this.customAttributes=Object.assign({},r.attributes)),r&&r.metrics)for(const s of Object.keys(r.metrics))isNaN(Number(r.metrics[s]))||(this.counters[s]=Math.floor(Number(r.metrics[s])));En(this)}incrementMetric(e,n=1){this.counters[e]===void 0?this.putMetric(e,n):this.putMetric(e,this.counters[e]+n)}putMetric(e,n){if(Rp(e,this.name))this.counters[e]=Cp(n??0);else throw Y.create("invalid custom metric name",{customMetricName:e})}getMetric(e){return this.counters[e]||0}putAttribute(e,n){const r=Qf(e),s=Zf(n);if(r&&s){this.customAttributes[e]=n;return}if(!r)throw Y.create("invalid attribute name",{attributeName:e});if(!s)throw Y.create("invalid attribute value",{attributeValue:n})}getAttribute(e){return this.customAttributes[e]}removeAttribute(e){this.customAttributes[e]!==void 0&&delete this.customAttributes[e]}getAttributes(){return Object.assign({},this.customAttributes)}setStartTime(e){this.startTimeUs=e}setDuration(e){this.durationUs=e}calculateTraceMetrics(){const e=this.api.getEntriesByName(this.traceMeasure),n=e&&e[0];n&&(this.durationUs=Math.floor(n.duration*1e3),this.startTimeUs=Math.floor((n.startTime+this.api.getTimeOrigin())*1e3))}static createOobTrace(e,n,r,s){const a=V.getInstance().getUrl();if(!a)return;const l=new Ge(e,Va+a,!0),h=Math.floor(V.getInstance().getTimeOrigin()*1e3);l.setStartTime(h),n&&n[0]&&(l.setDuration(Math.floor(n[0].duration*1e3)),l.putMetric("domInteractive",Math.floor(n[0].domInteractive*1e3)),l.putMetric("domContentLoadedEventEnd",Math.floor(n[0].domContentLoadedEventEnd*1e3)),l.putMetric("loadEventEnd",Math.floor(n[0].loadEventEnd*1e3)));const f="first-paint",I="first-contentful-paint";if(r){const E=r.find(k=>k.name===f);E&&E.startTime&&l.putMetric(Ka,Math.floor(E.startTime*1e3));const A=r.find(k=>k.name===I);A&&A.startTime&&l.putMetric(za,Math.floor(A.startTime*1e3)),s&&l.putMetric(qa,Math.floor(s*1e3))}En(l)}static createUserTimingTrace(e,n){const r=new Ge(e,n,!1,n);En(r)}}/** 1630 * @license 1631 * Copyright 2020 Google LLC 1632 * 1633 * Licensed under the Apache License, Version 2.0 (the "License"); 1634 * you may not use this file except in compliance with the License. 1635 * You may obtain a copy of the License at 1636 * 1637 * http://www.apache.org/licenses/LICENSE-2.0 1638 * 1639 * Unless required by applicable law or agreed to in writing, software 1640 * distributed under the License is distributed on an "AS IS" BASIS, 1641 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1642 * See the License for the specific language governing permissions and 1643 * limitations under the License. 1644 */function go(t,e){const n=e;if(!n||n.responseStart===void 0)return;const r=V.getInstance().getTimeOrigin(),s=Math.floor((n.startTime+r)*1e3),a=n.responseStart?Math.floor((n.responseStart-n.startTime)*1e3):void 0,l=Math.floor((n.responseEnd-n.startTime)*1e3),h=n.name&&n.name.split("?")[0],f={performanceController:t,url:h,responsePayloadBytes:n.transferSize,startTimeUs:s,timeToResponseInitiatedUs:a,timeToResponseCompletedUs:l};Ip(f)}/** 1645 * @license 1646 * Copyright 2020 Google LLC 1647 * 1648 * Licensed under the Apache License, Version 2.0 (the "License"); 1649 * you may not use this file except in compliance with the License. 1650 * You may obtain a copy of the License at 1651 * 1652 * http://www.apache.org/licenses/LICENSE-2.0 1653 * 1654 * Unless required by applicable law or agreed to in writing, software 1655 * distributed under the License is distributed on an "AS IS" BASIS, 1656 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1657 * See the License for the specific language governing permissions and 1658 * limitations under the License. 1659 */const Pp=5e3;function mo(t){mr()&&(setTimeout(()=>Np(t),0),setTimeout(()=>Op(t),0),setTimeout(()=>Dp(t),0))}function Op(t){const e=V.getInstance(),n=e.getEntriesByType("resource");for(const r of n)go(t,r);e.setupObserver("resource",r=>go(t,r))}function Np(t){const e=V.getInstance(),n=e.getEntriesByType("navigation"),r=e.getEntriesByType("paint");if(e.onFirstInputDelay){let s=setTimeout(()=>{Ge.createOobTrace(t,n,r),s=void 0},Pp);e.onFirstInputDelay(a=>{s&&(clearTimeout(s),Ge.createOobTrace(t,n,r,a))})}else Ge.createOobTrace(t,n,r)}function Dp(t){const e=V.getInstance(),n=e.getEntriesByType("measure");for(const r of n)_o(t,r);e.setupObserver("measure",r=>_o(t,r))}function _o(t,e){const n=e.name;n.substring(0,Xi.length)!==Xi&&Ge.createUserTimingTrace(t,n)}/** 1660 * @license 1661 * Copyright 2020 Google LLC 1662 * 1663 * Licensed under the Apache License, Version 2.0 (the "License");
1664 * you may not use this file except in compliance with the License. 1665 * You may obtain a copy of the License at 1666 * 1667 * http://www.apache.org/licenses/LICENSE-2.0 1668 * 1669 * Unless required by applicable law or agreed to in writing, software 1670 * distributed under the License is distributed on an "AS IS" BASIS, 1671 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1672 * See the License for the specific language governing permissions and 1673 * limitations under the License. 1674 */class Mp{constructor(e,n){this.app=e,this.installations=n,this.initialized=!1}_init(e){this.initialized||((e==null?void 0:e.dataCollectionEnabled)!==void 0&&(this.dataCollectionEnabled=e.dataCollectionEnabled),(e==null?void 0:e.instrumentationEnabled)!==void 0&&(this.instrumentationEnabled=e.instrumentationEnabled),V.getInstance().requiredApisAvailable()?Hn().then(n=>{n&&(gp(),ec(this).then(()=>mo(this),()=>mo(this)),this.initialized=!0)}).catch(n=>{Ee.info(`Environment doesn't support IndexedDB: ${n}`)}):Ee.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))}set instrumentationEnabled(e){ue.getInstance().instrumentationEnabled=e}get instrumentationEnabled(){return ue.getInstance().instrumentationEnabled}set dataCollectionEnabled(e){ue.getInstance().dataCollectionEnabled=e}get dataCollectionEnabled(){return ue.getInstance().dataCollectionEnabled}}const Lp="[DEFAULT]";function S_(t=st()){return t=de(t),me(t,"performance").getImmediate()}function R_(t,e){return t=de(t),new Ge(t,e)}const Up=(t,{options:e})=>{const n=t.getProvider("app").getImmediate(),r=t.getProvider("installations-internal").getImmediate();if(n.name!==Lp)throw Y.create("FB not default");if(typeof window>"u")throw Y.create("no window");Vf(window);const s=new Mp(n,r);return s._init(e),s};function xp(){ee(new z("performance",Up,"PUBLIC")),H(co,Gi),H(co,Gi,"esm2017")}xp();function rc(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Fp=rc,sc=new be("auth","Firebase",rc());/** 1675 * @license 1676 * Copyright 2020 Google LLC 1677 * 1678 * Licensed under the Apache License, Version 2.0 (the "License"); 1679 * you may not use this file except in compliance with the License. 1680 * You may obtain a copy of the License at 1681 * 1682 * http://www.apache.org/licenses/LICENSE-2.0 1683 * 1684 * Unless required by applicable law or agreed to in writing, software 1685 * distributed under the License is distributed on an "AS IS" BASIS, 1686 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1687 * See the License for the specific language governing permissions and 1688 * limitations under the License. 1689 */const Un=new It("@firebase/auth");function $p(t,...e){Un.logLevel<=D.WARN&&Un.warn(`Auth (${rt}): ${t}`,...e)}function An(t,...e){Un.logLevel<=D.ERROR&&Un.error(`Auth (${rt}): ${t}`,...e)}/** 1690 * @license 1691 * Copyright 2020 Google LLC 1692 * 1693 * Licensed under the Apache License, Version 2.0 (the "License"); 1694 * you may not use this file except in compliance with the License. 1695 * You may obtain a copy of the License at 1696 * 1697 * http://www.apache.org/licenses/LICENSE-2.0 1698 * 1699 * Unless required by applicable law or agreed to in writing, software 1700 * distributed under the License is distributed on an "AS IS" BASIS, 1701 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1702 * See the License for the specific language governing permissions and 1703 * limitations under the License. 1704 */function Me(t,...e){throw yr(t,...e)}function Te(t,...e){return yr(t,...e)}function oc(t,e,n){const r=Object.assign(Object.assign({},Fp()),{[e]:n});return new be("auth","Firebase",r).create(e,{appName:t.name})}function et(t){return oc(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function yr(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return sc.create(t,...e)}function S(t,e,...n){if(!t)throw yr(e,...n)}function Pe(t){const e="INTERNAL ASSERTION FAILED: "+t;throw An(e),new Error(e)}function Le(t,e){t||Pe(e)}/** 1705 * @license 1706 * Copyright 2020 Google LLC 1707 * 1708 * Licensed under the Apache License, Version 2.0 (the "License");
1709 * you may not use this file except in compliance with the License. 1710 * You may obtain a copy of the License at 1711 * 1712 * http://www.apache.org/licenses/LICENSE-2.0 1713 * 1714 * Unless required by applicable law or agreed to in writing, software 1715 * distributed under the License is distributed on an "AS IS" BASIS, 1716 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1717 * See the License for the specific language governing permissions and 1718 * limitations under the License. 1719 */function Ji(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function jp(){return vo()==="http:"||vo()==="https:"}function vo(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/** 1720 * @license 1721 * Copyright 2020 Google LLC 1722 * 1723 * Licensed under the Apache License, Version 2.0 (the "License"); 1724 * you may not use this file except in compliance with the License. 1725 * You may obtain a copy of the License at 1726 * 1727 * http://www.apache.org/licenses/LICENSE-2.0 1728 * 1729 * Unless required by applicable law or agreed to in writing, software 1730 * distributed under the License is distributed on an "AS IS" BASIS, 1731 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1732 * See the License for the specific language governing permissions and 1733 * limitations under the License. 1734 */function Bp(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(jp()||Xo()||"connection"in navigator)?navigator.onLine:!0}function Hp(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** 1735 * @license 1736 * Copyright 2020 Google LLC 1737 * 1738 * Licensed under the Apache License, Version 2.0 (the "License"); 1739 * you may not use this file except in compliance with the License. 1740 * You may obtain a copy of the License at 1741 * 1742 * http://www.apache.org/licenses/LICENSE-2.0 1743 * 1744 * Unless required by applicable law or agreed to in writing, software 1745 * distributed under the License is distributed on an "AS IS" BASIS, 1746 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1747 * See the License for the specific language governing permissions and 1748 * limitations under the License. 1749 */class Zt{constructor(e,n){this.shortDelay=e,this.longDelay=n,Le(n>e,"Short delay should be less than long delay!"),this.isMobile=Ol()||Nl()}get(){return Bp()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** 1750 * @license 1751 * Copyright 2020 Google LLC 1752 * 1753 * Licensed under the Apache License, Version 2.0 (the "License"); 1754 * you may not use this file except in compliance with the License. 1755 * You may obtain a copy of the License at 1756 * 1757 * http://www.apache.org/licenses/LICENSE-2.0 1758 * 1759 * Unless required by applicable law or agreed to in writing, software 1760 * distributed under the License is distributed on an "AS IS" BASIS, 1761 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1762 * See the License for the specific language governing permissions and 1763 * limitations under the License. 1764 */function Tr(t,e){Le(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** 1765 * @license 1766 * Copyright 2020 Google LLC 1767 * 1768 * Licensed under the Apache License, Version 2.0 (the "License"); 1769 * you may not use this file except in compliance with the License. 1770 * You may obtain a copy of the License at 1771 * 1772 * http://www.apache.org/licenses/LICENSE-2.0 1773 * 1774 * Unless required by applicable law or agreed to in writing, software 1775 * distributed under the License is distributed on an "AS IS" BASIS, 1776 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1777 * See the License for the specific language governing permissions and 1778 * limitations under the License. 1779 */class ac{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Pe("Could not find fetch implementation, make sure you call FetchProvi
1779der.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Pe("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Pe("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** 1780 * @license 1781 * Copyright 2020 Google LLC 1782 * 1783 * Licensed under the Apache License, Version 2.0 (the "License"); 1784 * you may not use this file except in compliance with the License. 1785 * You may obtain a copy of the License at 1786 * 1787 * http://www.apache.org/licenses/LICENSE-2.0 1788 * 1789 * Unless required by applicable law or agreed to in writing, software 1790 * distributed under the License is distributed on an "AS IS" BASIS, 1791 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1792 * See the License for the specific language governing permissions and 1793 * limitations under the License. 1794 */const Vp={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** 1795 * @license 1796 * Copyright 2020 Google LLC 1797 * 1798 * Licensed under the Apache License, Version 2.0 (the "License"); 1799 * you may not use this file except in compliance with the License. 1800 * You may obtain a copy of the License at 1801 * 1802 * http://www.apache.org/licenses/LICENSE-2.0 1803 * 1804 * Unless required by applicable law or agreed to in writing, software 1805 * distributed under the License is distributed on an "AS IS" BASIS, 1806 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1807 * See the License for the specific language governing permissions and 1808 * limitations under the License. 1809 */const Kp=new Zt(3e4,6e4);function Ir(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function wt(t,e,n,r,s={}){return cc(t,s,async()=>{let a={},l={};r&&(e==="GET"?l=r:a={body:JSON.stringify(r)});const h=Yt(Object.assign({key:t.config.apiKey},l)).slice(1),f=await t._getAdditionalHeaders();return f["Content-Type"]="application/json",t.languageCode&&(f["X-Firebase-Locale"]=t.languageCode),ac.fetch()(lc(t,t.config.apiHost,n,h),Object.assign({method:e,headers:f,referrerPolicy:"no-referrer"},a))})}async function cc(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},Vp),e);try{const s=new qp(t),a=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const l=await a.json();if("needConfirmation"in l)throw bn(t,"account-exists-with-different-credential",l);if(a.ok&&!("errorMessage"in l))return l;{const h=a.ok?l.errorMessage:l.error.message,[f,I]=h.split(" : ");if(f==="FEDERATED_USER_ID_ALREADY_LINKED")throw bn(t,"credential-already-in-use",l);if(f==="EMAIL_EXISTS")throw bn(t,"email-already-in-use",l);if(f==="USER_DISABLED")throw bn(t,"user-disabled",l);const E=r[f]||f.toLowerCase().replace(/[_\s]+/g,"-");if(I)throw oc(t,E,I);Me(t,E)}}catch(s){if(s instanceof ge)throw s;Me(t,"network-request-failed",{message:String(s)})}}async function zp(t,e,n,r,s={}){const a=await wt(t,e,n,r,s);return"mfaPendingCredential"in a&&Me(t,"multi-factor-auth-required",{_serverResponse:a}),a}function lc(t,e,n,r){const s=`${e}${n}?${r}`;return t.config.emulator?Tr(t.config,s):`${t.config.apiScheme}://${s}`}class qp{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Te(this.auth,"network-request-failed")),Kp.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function bn(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=Te(t,e,r);return s.customData._tokenResponse=n,s}/** 1810 * @license 1811 * Copyright 2020 Google LLC 1812 * 1813 * Licensed under the Apache License, Version 2.0 (the "License");
1814 * you may not use this file except in compliance with the License. 1815 * You may obtain a copy of the License at 1816 * 1817 * http://www.apache.org/licenses/LICENSE-2.0 1818 * 1819 * Unless required by applicable law or agreed to in writing, software 1820 * distributed under the License is distributed on an "AS IS" BASIS, 1821 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1822 * See the License for the specific language governing permissions and 1823 * limitations under the License. 1824 */async function Wp(t,e){return wt(t,"POST","/v1/accounts:delete",e)}async function uc(t,e){return wt(t,"POST","/v1/accounts:lookup",e)}/** 1825 * @license 1826 * Copyright 2020 Google LLC 1827 * 1828 * Licensed under the Apache License, Version 2.0 (the "License"); 1829 * you may not use this file except in compliance with the License. 1830 * You may obtain a copy of the License at 1831 * 1832 * http://www.apache.org/licenses/LICENSE-2.0 1833 * 1834 * Unless required by applicable law or agreed to in writing, software 1835 * distributed under the License is distributed on an "AS IS" BASIS, 1836 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1837 * See the License for the specific language governing permissions and 1838 * limitations under the License. 1839 */function Bt(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Gp(t,e=!1){const n=de(t),r=await n.getIdToken(e),s=wr(r);S(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const a=typeof s.firebase=="object"?s.firebase:void 0,l=a==null?void 0:a.sign_in_provider;return{claims:s,token:r,authTime:Bt(Li(s.auth_time)),issuedAtTime:Bt(Li(s.iat)),expirationTime:Bt(Li(s.exp)),signInProvider:l||null,signInSecondFactor:(a==null?void 0:a.sign_in_second_factor)||null}}function Li(t){return Number(t)*1e3}function wr(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return An("JWT malformed, contained fewer than 3 sections"),null;try{const s=Ho(n);return s?JSON.parse(s):(An("Failed to decode base64 JWT payload"),null)}catch(s){return An("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function yo(t){const e=wr(t);return S(e,"internal-error"),S(typeof e.exp<"u","internal-error"),S(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** 1840 * @license 1841 * Copyright 2020 Google LLC 1842 * 1843 * Licensed under the Apache License, Version 2.0 (the "License"); 1844 * you may not use this file except in compliance with the License. 1845 * You may obtain a copy of the License at 1846 * 1847 * http://www.apache.org/licenses/LICENSE-2.0 1848 * 1849 * Unless required by applicable law or agreed to in writing, software 1850 * distributed under the License is distributed on an "AS IS" BASIS, 1851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1852 * See the License for the specific language governing permissions and 1853 * limitations under the License. 1854 */async function Gt(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof ge&&Xp(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function Xp({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** 1855 * @license 1856 * Copyright 2020 Google LLC 1857 * 1858 * Licensed under the Apache License, Version 2.0 (the "License"); 1859 * you may not use this file except in compliance with the License. 1860 * You may obtain a copy of the License at 1861 * 1862 * http://www.apache.org/licenses/LICENSE-2.0 1863 * 1864 * Unless required by applicable law or agreed to in writing, software 1865 * distributed under the License is distributed on an "AS IS" BASIS, 1866 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1867 * See the License for the specific language governing permissions and 1868 * limitations under the License. 1869 */class Jp{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const s=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,s)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** 1870 * @license 1871 * Copyright 2020 Google LLC 1872 * 1873 * Licensed under the Apache License, Version 2.0 (the "License");
1874 * you may not use this file except in compliance with the License. 1875 * You may obtain a copy of the License at 1876 * 1877 * http://www.apache.org/licenses/LICENSE-2.0 1878 * 1879 * Unless required by applicable law or agreed to in writing, software 1880 * distributed under the License is distributed on an "AS IS" BASIS, 1881 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1882 * See the License for the specific language governing permissions and 1883 * limitations under the License. 1884 */class Yi{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Bt(this.lastLoginAt),this.creationTime=Bt(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** 1885 * @license 1886 * Copyright 2019 Google LLC 1887 * 1888 * Licensed under the Apache License, Version 2.0 (the "License"); 1889 * you may not use this file except in compliance with the License. 1890 * You may obtain a copy of the License at 1891 * 1892 * http://www.apache.org/licenses/LICENSE-2.0 1893 * 1894 * Unless required by applicable law or agreed to in writing, software 1895 * distributed under the License is distributed on an "AS IS" BASIS, 1896 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1897 * See the License for the specific language governing permissions and 1898 * limitations under the License. 1899 */async function xn(t){var e;const n=t.auth,r=await t.getIdToken(),s=await Gt(t,uc(n,{idToken:r}));S(s==null?void 0:s.users.length,n,"internal-error");const a=s.users[0];t._notifyReloadListener(a);const l=!((e=a.providerUserInfo)===null||e===void 0)&&e.length?hc(a.providerUserInfo):[],h=Qp(t.providerData,l),f=t.isAnonymous,I=!(t.email&&a.passwordHash)&&!(h!=null&&h.length),E=f?I:!1,A={uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:h,metadata:new Yi(a.createdAt,a.lastLoginAt),isAnonymous:E};Object.assign(t,A)}async function Yp(t){const e=de(t);await xn(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Qp(t,e){return[...t.filter(r=>!e.some(s=>s.providerId===r.providerId)),...e]}function hc(t){return t.map(e=>{var{providerId:n}=e,r=Zi(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/** 1900 * @license 1901 * Copyright 2020 Google LLC 1902 * 1903 * Licensed under the Apache License, Version 2.0 (the "License"); 1904 * you may not use this file except in compliance with the License. 1905 * You may obtain a copy of the License at 1906 * 1907 * http://www.apache.org/licenses/LICENSE-2.0 1908 * 1909 * Unless required by applicable law or agreed to in writing, software 1910 * distributed under the License is distributed on an "AS IS" BASIS, 1911 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1912 * See the License for the specific language governing permissions and 1913 * limitations under the License. 1914 */async function Zp(t,e){const n=await cc(t,{},async()=>{const r=Yt({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:a}=t.config,l=lc(t,s,"/v1/token",`key=${a}`),h=await t._getAdditionalHeaders();return h["Content-Type"]="application/x-www-form-urlencoded",ac.fetch()(l,{method:"POST",headers:h,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function eg(t,e){return wt(t,"POST","/v2/accounts:revokeToken",Ir(t,e))}/** 1915 * @license 1916 * Copyright 2020 Google LLC 1917 * 1918 * Licensed under the Apache License, Version 2.0 (the "License"); 1919 * you may not use this file except in compliance with the License. 1920 * You may obtain a copy of the License at 1921 * 1922 * http://www.apache.org/licenses/LICENSE-2.0 1923 * 1924 * Unless required by applicable law or agreed to in writing, software 1925 * distributed under the License is distributed on an "AS IS" BASIS, 1926 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1927 * See the License for the specific language governing permissions and 1928 * limitations under the License. 1929 */class gt{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){S(e.idToken,"internal-error"),S(typeof e.idToken<"u","internal-error"),S(typeof e.refreshToken<"u","internal-error");
1929const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):yo(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){S(e.length!==0,"internal-error");const n=yo(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(S(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:s,expiresIn:a}=await Zp(e,n);this.updateTokensAndExpiration(r,s,Number(a))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:s,expirationTime:a}=n,l=new gt;return r&&(S(typeof r=="string","internal-error",{appName:e}),l.refreshToken=r),s&&(S(typeof s=="string","internal-error",{appName:e}),l.accessToken=s),a&&(S(typeof a=="number","internal-error",{appName:e}),l.expirationTime=a),l}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new gt,this.toJSON())}_performRefresh(){return Pe("not implemented")}}/** 1930 * @license 1931 * Copyright 2020 Google LLC 1932 * 1933 * Licensed under the Apache License, Version 2.0 (the "License"); 1934 * you may not use this file except in compliance with the License. 1935 * You may obtain a copy of the License at 1936 * 1937 * http://www.apache.org/licenses/LICENSE-2.0 1938 * 1939 * Unless required by applicable law or agreed to in writing, software 1940 * distributed under the License is distributed on an "AS IS" BASIS, 1941 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1942 * See the License for the specific language governing permissions and 1943 * limitations under the License. 1944 */function je(t,e){S(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Oe{constructor(e){var{uid:n,auth:r,stsTokenManager:s}=e,a=Zi(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Jp(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=s,this.accessToken=s.accessToken,this.displayName=a.displayName||null,this.email=a.email||null,this.emailVerified=a.emailVerified||!1,this.phoneNumber=a.phoneNumber||null,this.photoURL=a.photoURL||null,this.isAnonymous=a.isAnonymous||!1,this.tenantId=a.tenantId||null,this.providerData=a.providerData?[...a.providerData]:[],this.metadata=new Yi(a.createdAt||void 0,a.lastLoginAt||void 0)}async getIdToken(e){const n=await Gt(this,this.stsTokenManager.getToken(this.auth,e));return S(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return Gp(this,e)}reload(){return Yp(this)}_assign(e){this!==e&&(S(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(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Oe(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){S(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await xn(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(ze(this.auth.app))return Promise.reject(et(this.auth));const e=await this.getIdToken();return await Gt(this,Wp(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
1944nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var r,s,a,l,h,f,I,E;const A=(r=n.displayName)!==null&&r!==void 0?r:void 0,k=(s=n.email)!==null&&s!==void 0?s:void 0,O=(a=n.phoneNumber)!==null&&a!==void 0?a:void 0,R=(l=n.photoURL)!==null&&l!==void 0?l:void 0,U=(h=n.tenantId)!==null&&h!==void 0?h:void 0,C=(f=n._redirectEventId)!==null&&f!==void 0?f:void 0,oe=(I=n.createdAt)!==null&&I!==void 0?I:void 0,te=(E=n.lastLoginAt)!==null&&E!==void 0?E:void 0,{uid:x,emailVerified:F,isAnonymous:fe,providerData:B,stsTokenManager:v}=n;S(x&&v,e,"internal-error");const d=gt.fromJSON(this.name,v);S(typeof x=="string",e,"internal-error"),je(A,e.name),je(k,e.name),S(typeof F=="boolean",e,"internal-error"),S(typeof fe=="boolean",e,"internal-error"),je(O,e.name),je(R,e.name),je(U,e.name),je(C,e.name),je(oe,e.name),je(te,e.name);const g=new Oe({uid:x,auth:e,email:k,emailVerified:F,displayName:A,isAnonymous:fe,photoURL:R,phoneNumber:O,tenantId:U,stsTokenManager:d,createdAt:oe,lastLoginAt:te});return B&&Array.isArray(B)&&(g.providerData=B.map(m=>Object.assign({},m))),C&&(g._redirectEventId=C),g}static async _fromIdTokenResponse(e,n,r=!1){const s=new gt;s.updateFromServerResponse(n);const a=new Oe({uid:n.localId,auth:e,stsTokenManager:s,isAnonymous:r});return await xn(a),a}static async _fromGetAccountInfoResponse(e,n,r){const s=n.users[0];S(s.localId!==void 0,"internal-error");const a=s.providerUserInfo!==void 0?hc(s.providerUserInfo):[],l=!(s.email&&s.passwordHash)&&!(a!=null&&a.length),h=new gt;h.updateFromIdToken(r);const f=new Oe({uid:s.localId,auth:e,stsTokenManager:h,isAnonymous:l}),I={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new Yi(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(a!=null&&a.length)};return Object.assign(f,I),f}}/** 1945 * @license 1946 * Copyright 2020 Google LLC 1947 * 1948 * Licensed under the Apache License, Version 2.0 (the "License"); 1949 * you may not use this file except in compliance with the License. 1950 * You may obtain a copy of the License at 1951 * 1952 * http://www.apache.org/licenses/LICENSE-2.0 1953 * 1954 * Unless required by applicable law or agreed to in writing, software 1955 * distributed under the License is distributed on an "AS IS" BASIS, 1956 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1957 * See the License for the specific language governing permissions and 1958 * limitations under the License. 1959 */const To=new Map;function Ne(t){Le(t instanceof Function,"Expected a class definition");let e=To.get(t);return e?(Le(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,To.set(t,e),e)}/** 1960 * @license 1961 * Copyright 2019 Google LLC 1962 * 1963 * Licensed under the Apache License, Version 2.0 (the "License"); 1964 * you may not use this file except in compliance with the License. 1965 * You may obtain a copy of the License at 1966 * 1967 * http://www.apache.org/licenses/LICENSE-2.0 1968 * 1969 * Unless required by applicable law or agreed to in writing, software 1970 * distributed under the License is distributed on an "AS IS" BASIS, 1971 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1972 * See the License for the specific language governing permissions and 1973 * limitations under the License. 1974 */class dc{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}dc.type="NONE";const Io=dc;/** 1975 * @license 1976 * Copyright 2019 Google LLC 1977 * 1978 * Licensed under the Apache License, Version 2.0 (the "License");
1979 * you may not use this file except in compliance with the License. 1980 * You may obtain a copy of the License at 1981 * 1982 * http://www.apache.org/licenses/LICENSE-2.0 1983 * 1984 * Unless required by applicable law or agreed to in writing, software 1985 * distributed under the License is distributed on an "AS IS" BASIS, 1986 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1987 * See the License for the specific language governing permissions and 1988 * limitations under the License. 1989 */function kn(t,e,n){return`firebase:${t}:${e}:${n}`}class mt{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:s,name:a}=this.auth;this.fullUserKey=kn(this.userKey,s.apiKey,a),this.fullPersistenceKey=kn("persistence",s.apiKey,a),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?Oe._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new mt(Ne(Io),e,r);const s=(await Promise.all(n.map(async I=>{if(await I._isAvailable())return I}))).filter(I=>I);let a=s[0]||Ne(Io);const l=kn(r,e.config.apiKey,e.name);let h=null;for(const I of n)try{const E=await I._get(l);if(E){const A=Oe._fromJSON(e,E);I!==a&&(h=A),a=I;break}}catch{}const f=s.filter(I=>I._shouldAllowMigration);return!a._shouldAllowMigration||!f.length?new mt(a,e,r):(a=f[0],h&&await a._set(l,h.toJSON()),await Promise.all(n.map(async I=>{if(I!==a)try{await I._remove(l)}catch{}})),new mt(a,e,r))}}/** 1990 * @license 1991 * Copyright 2020 Google LLC 1992 * 1993 * Licensed under the Apache License, Version 2.0 (the "License"); 1994 * you may not use this file except in compliance with the License. 1995 * You may obtain a copy of the License at 1996 * 1997 * http://www.apache.org/licenses/LICENSE-2.0 1998 * 1999 * Unless required by applicable law or agreed to in writing, software 2000 * distributed under the License is distributed on an "AS IS" BASIS, 2001 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2002 * See the License for the specific language governing permissions and 2003 * limitations under the License. 2004 */function wo(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(mc(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(fc(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(vc(e))return"Blackberry";if(yc(e))return"Webos";if(pc(e))return"Safari";if((e.includes("chrome/")||gc(e))&&!e.includes("edge/"))return"Chrome";if(_c(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function fc(t=se()){return/firefox\//i.test(t)}function pc(t=se()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function gc(t=se()){return/crios\//i.test(t)}function mc(t=se()){return/iemobile/i.test(t)}function _c(t=se()){return/android/i.test(t)}function vc(t=se()){return/blackberry/i.test(t)}function yc(t=se()){return/webos/i.test(t)}function Er(t=se()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function tg(t=se()){var e;return Er(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function ng(){return Dl()&&document.documentMode===10}function Tc(t=se()){return Er(t)||_c(t)||yc(t)||vc(t)||/windows phone/i.test(t)||mc(t)}/** 2005 * @license 2006 * Copyright 2020 Google LLC 2007 * 2008 * Licensed under the Apache License, Version 2.0 (the "License");
2009 * you may not use this file except in compliance with the License. 2010 * You may obtain a copy of the License at 2011 * 2012 * http://www.apache.org/licenses/LICENSE-2.0 2013 * 2014 * Unless required by applicable law or agreed to in writing, software 2015 * distributed under the License is distributed on an "AS IS" BASIS, 2016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2017 * See the License for the specific language governing permissions and 2018 * limitations under the License. 2019 */function Ic(t,e=[]){let n;switch(t){case"Browser":n=wo(se());break;case"Worker":n=`${wo(se())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${rt}/${r}`}/** 2020 * @license 2021 * Copyright 2022 Google LLC 2022 * 2023 * Licensed under the Apache License, Version 2.0 (the "License"); 2024 * you may not use this file except in compliance with the License. 2025 * You may obtain a copy of the License at 2026 * 2027 * http://www.apache.org/licenses/LICENSE-2.0 2028 * 2029 * Unless required by applicable law or agreed to in writing, software 2030 * distributed under the License is distributed on an "AS IS" BASIS, 2031 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2032 * See the License for the specific language governing permissions and 2033 * limitations under the License. 2034 */class ig{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=a=>new Promise((l,h)=>{try{const f=e(a);l(f)}catch(f){h(f)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** 2035 * @license 2036 * Copyright 2023 Google LLC 2037 * 2038 * Licensed under the Apache License, Version 2.0 (the "License"); 2039 * you may not use this file except in compliance with the License. 2040 * You may obtain a copy of the License at 2041 * 2042 * http://www.apache.org/licenses/LICENSE-2.0 2043 * 2044 * Unless required by applicable law or agreed to in writing, software 2045 * distributed under the License is distributed on an "AS IS" BASIS, 2046 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2047 * See the License for the specific language governing permissions and 2048 * limitations under the License. 2049 */async function rg(t,e={}){return wt(t,"GET","/v2/passwordPolicy",Ir(t,e))}/** 2050 * @license 2051 * Copyright 2023 Google LLC 2052 * 2053 * Licensed under the Apache License, Version 2.0 (the "License"); 2054 * you may not use this file except in compliance with the License. 2055 * You may obtain a copy of the License at 2056 * 2057 * http://www.apache.org/licenses/LICENSE-2.0 2058 * 2059 * Unless required by applicable law or agreed to in writing, software 2060 * distributed under the License is distributed on an "AS IS" BASIS, 2061 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2062 * See the License for the specific language governing permissions and 2063 * limitations under the License. 2064 */const sg=6;class og{constructor(e){var n,r,s,a;const l=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=l.minPasswordLength)!==null&&n!==void 0?n:sg,l.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=l.maxPasswordLength),l.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=l.containsLowercaseCharacter),l.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=l.containsUppercaseCharacter),l.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=l.containsNumericCharacter),l.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=l.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(s=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&s!==void 0?s:"",this.forceUpgradeOnSignin=(a=e.forceUpgradeOnSignin)!==null&&a!==void 0?a:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,s,a,l,h;const f={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,f),this.validatePasswordCharacterOptions(e,f),f.isValid&&
2064(f.isValid=(n=f.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),f.isValid&&(f.isValid=(r=f.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),f.isValid&&(f.isValid=(s=f.containsLowercaseLetter)!==null&&s!==void 0?s:!0),f.isValid&&(f.isValid=(a=f.containsUppercaseLetter)!==null&&a!==void 0?a:!0),f.isValid&&(f.isValid=(l=f.containsNumericCharacter)!==null&&l!==void 0?l:!0),f.isValid&&(f.isValid=(h=f.containsNonAlphanumericCharacter)!==null&&h!==void 0?h:!0),f}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),s&&(n.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s<e.length;s++)r=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,s,a){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=a))}}/** 2065 * @license 2066 * Copyright 2020 Google LLC 2067 * 2068 * Licensed under the Apache License, Version 2.0 (the "License"); 2069 * you may not use this file except in compliance with the License. 2070 * You may obtain a copy of the License at 2071 * 2072 * http://www.apache.org/licenses/LICENSE-2.0 2073 * 2074 * Unless required by applicable law or agreed to in writing, software 2075 * distributed under the License is distributed on an "AS IS" BASIS, 2076 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2077 * See the License for the specific language governing permissions and 2078 * limitations under the License. 2079 */class ag{constructor(e,n,r,s){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Eo(this),this.idTokenSubscription=new Eo(this),this.beforeStateQueue=new ig(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=sc,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Ne(n)),this._initializationPromise=this.queue(async()=>{var r,s;if(!this._deleted&&(this.persistenceManager=await mt.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((s=this.currentUser)===null||s===void 0?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await uc(this,{idToken:e}),r=await Oe._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(ze(this.app)){const l=this.app.settings.authIdToken;return l?new Promise(h=>{setTimeout(()=>
2079this.initializeCurrentUserFromIdToken(l).then(h,h))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let s=r,a=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const l=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,h=s==null?void 0:s._redirectEventId,f=await this.tryRedirectSignIn(e);(!l||l===h)&&(f!=null&&f.user)&&(s=f.user,a=!0)}if(!s)return this.directlySetCurrentUser(null);if(!s._redirectEventId){if(a)try{await this.beforeStateQueue.runMiddleware(s)}catch(l){s=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(l))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return S(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===s._redirectEventId?this.directlySetCurrentUser(s):this.reloadAndSetCurrentUserOrClear(s)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await xn(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Hp()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(ze(this.app))return Promise.reject(et(this));const n=e?de(e):null;return n&&S(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&S(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return ze(this.app)?Promise.reject(et(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return ze(this.app)?Promise.reject(et(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Ne(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await rg(this),n=new og(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new be("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await eg(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Ne(e)||this._popupRedirectResolver;S(n,this,"argument-error"),this.redirectPersistenceManager=await mt.create(this,[Ne(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,s){if(this._deleted)return()=>{};const a=typeof n=="function"?n:n.next.bind(n);let l=!1;const h=this._isInitialized?Promise.resolve():this._initializationPromise;if(S(h,this,"internal-error"),h.then(()=>{l||a(this.currentUser)}),typeof n=="function"){const f=e.addObserver(n,r,s);return()=>{l=!0,f()}}else{const f=e.addObserver(n);return()=>{l=!0,f()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return S(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Ic(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const s=await this._getAppCheckToken();return s&&(n["X-Firebase-AppCheck"]=s),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&$p(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function br(t){return de(t)}class Eo{constructor(e){this.auth=e,this.observer=null,this.addObserver=Fl(n=>this.observer=n)}get next(){return S(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** 2080 * @license 2081 * Copyright 2020 Google LLC 2082 * 2083 * Licensed under the Apache License, Version 2.0 (the "License");
2084 * you may not use this file except in compliance with the License. 2085 * You may obtain a copy of the License at 2086 * 2087 * http://www.apache.org/licenses/LICENSE-2.0 2088 * 2089 * Unless required by applicable law or agreed to in writing, software 2090 * distributed under the License is distributed on an "AS IS" BASIS, 2091 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2092 * See the License for the specific language governing permissions and 2093 * limitations under the License. 2094 */let Ar={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function cg(t){Ar=t}function lg(t){return Ar.loadJS(t)}function ug(){return Ar.gapiScript}function hg(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/** 2095 * @license 2096 * Copyright 2020 Google LLC 2097 * 2098 * Licensed under the Apache License, Version 2.0 (the "License"); 2099 * you may not use this file except in compliance with the License. 2100 * You may obtain a copy of the License at 2101 * 2102 * http://www.apache.org/licenses/LICENSE-2.0 2103 * 2104 * Unless required by applicable law or agreed to in writing, software 2105 * distributed under the License is distributed on an "AS IS" BASIS, 2106 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2107 * See the License for the specific language governing permissions and 2108 * limitations under the License. 2109 */function dg(t,e){const n=me(t,"auth");if(n.isInitialized()){const s=n.getImmediate(),a=n.getOptions();if(Vt(a,e??{}))return s;Me(s,"already-initialized")}return n.initialize({options:e})}function fg(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Ne);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function pg(t,e,n){const r=br(t);S(r._canInitEmulator,r,"emulator-config-failed"),S(/^https?:\/\//.test(e),r,"invali
2109d-emulator-scheme");const s=!1,a=wc(e),{host:l,port:h}=gg(e),f=h===null?"":`:${h}`;r.config.emulator={url:`${a}//${l}${f}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:l,port:h,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:s})}),mg()}function wc(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function gg(t){const e=wc(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const a=s[1];return{host:a,port:bo(r.substr(a.length+1))}}else{const[a,l]=r.split(":");return{host:a,port:bo(l)}}}function bo(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function mg(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/** 2110 * @license 2111 * Copyright 2020 Google LLC 2112 * 2113 * Licensed under the Apache License, Version 2.0 (the "License"); 2114 * you may not use this file except in compliance with the License. 2115 * You may obtain a copy of the License at 2116 * 2117 * http://www.apache.org/licenses/LICENSE-2.0 2118 * 2119 * Unless required by applicable law or agreed to in writing, software 2120 * distributed under the License is distributed on an "AS IS" BASIS, 2121 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2122 * See the License for the specific language governing permissions and 2123 * limitations under the License. 2124 */class Ec{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Pe("not implemented")}_getIdTokenResponse(e){return Pe("not implemented")}_linkToIdToken(e,n){return Pe("not implemented")}_getReauthenticationResolver(e){return Pe("not implemented")}}/** 2125 * @license 2126 * Copyright 2020 Google LLC 2127 * 2128 * Licensed under the Apache License, Version 2.0 (the "License"); 2129 * you may not use this file except in compliance with the License. 2130 * You may obtain a copy of the License at 2131 * 2132 * http://www.apache.org/licenses/LICENSE-2.0 2133 * 2134 * Unless required by applicable law or agreed to in writing, software 2135 * distributed under the License is distributed on an "AS IS" BASIS, 2136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2137 * See the License for the specific language governing permissions and 2138 * limitations under the License. 2139 */async function _t(t,e){return zp(t,"POST","/v1/accounts:signInWithIdp",Ir(t,e))}/** 2140 * @license 2141 * Copyright 2020 Google LLC 2142 * 2143 * Licensed under the Apache License, Version 2.0 (the "License"); 2144 * you may not use this file except in compliance with the License. 2145 * You may obtain a copy of the License at 2146 * 2147 * http://www.apache.org/licenses/LICENSE-2.0 2148 * 2149 * Unless required by applicable law or agreed to in writing, software 2150 * distributed under the License is distributed on an "AS IS" BASIS, 2151 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2152 * See the License for the specific language governing permissions and 2153 * limitations under the License. 2154 */const _g="http://localhost";class it extends Ec{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new it(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):Me("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
2154once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:s}=n,a=Zi(n,["providerId","signInMethod"]);if(!r||!s)return null;const l=new it(r,s);return l.idToken=a.idToken||void 0,l.accessToken=a.accessToken||void 0,l.secret=a.secret,l.nonce=a.nonce,l.pendingToken=a.pendingToken||null,l}_getIdTokenResponse(e){const n=this.buildRequest();return _t(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,_t(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,_t(e,n)}buildRequest(){const e={requestUri:_g,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=Yt(n)}return e}}/** 2155 * @license 2156 * Copyright 2020 Google LLC 2157 * 2158 * Licensed under the Apache License, Version 2.0 (the "License"); 2159 * you may not use this file except in compliance with the License. 2160 * You may obtain a copy of the License at 2161 * 2162 * http://www.apache.org/licenses/LICENSE-2.0 2163 * 2164 * Unless required by applicable law or agreed to in writing, software 2165 * distributed under the License is distributed on an "AS IS" BASIS, 2166 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2167 * See the License for the specific language governing permissions and 2168 * limitations under the License. 2169 */class bc{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** 2170 * @license 2171 * Copyright 2019 Google LLC 2172 * 2173 * Licensed under the Apache License, Version 2.0 (the "License"); 2174 * you may not use this file except in compliance with the License. 2175 * You may obtain a copy of the License at 2176 * 2177 * http://www.apache.org/licenses/LICENSE-2.0 2178 * 2179 * Unless required by applicable law or agreed to in writing, software 2180 * distributed under the License is distributed on an "AS IS" BASIS, 2181 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2182 * See the License for the specific language governing permissions and 2183 * limitations under the License. 2184 */class en extends bc{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** 2185 * @license 2186 * Copyright 2020 Google LLC 2187 * 2188 * Licensed under the Apache License, Version 2.0 (the "License"); 2189 * you may not use this file except in compliance with the License. 2190 * You may obtain a copy of the License at 2191 * 2192 * http://www.apache.org/licenses/LICENSE-2.0 2193 * 2194 * Unless required by applicable law or agreed to in writing, software 2195 * distributed under the License is distributed on an "AS IS" BASIS, 2196 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2197 * See the License for the specific language governing permissions and 2198 * limitations under the License. 2199 */class Be extends en{constructor(){super("facebook.com")}static credential(e){return it._fromParams({providerId:Be.PROVIDER_ID,signInMethod:Be.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Be.credentialFromTaggedObject(e)}static credentialFromError(e){return Be.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Be.credential(e.oauthAccessToken)}catch{return null}}}Be.FACEBOOK_SIGN_IN_METHOD="facebook.com";Be.PROVIDER_ID="facebook.com";/** 2200 * @license 2201 * Copyright 2020 Google LLC 2202 * 2203 * Licensed under the Apache License, Version 2.0 (the "License"); 2204 * you may not use this file except in compliance with the License. 2205 * You may obtain a copy of the License at 2206 * 2207 * http://www.apache.org/licenses/LICENSE-2.0 2208 * 2209 * Unless required by applicable law or agreed to in writing, softw
2209are 2210 * distributed under the License is distributed on an "AS IS" BASIS, 2211 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2212 * See the License for the specific language governing permissions and 2213 * limitations under the License. 2214 */class He extends en{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return it._fromParams({providerId:He.PROVIDER_ID,signInMethod:He.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return He.credentialFromTaggedObject(e)}static credentialFromError(e){return He.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return He.credential(n,r)}catch{return null}}}He.GOOGLE_SIGN_IN_METHOD="google.com";He.PROVIDER_ID="google.com";/** 2215 * @license 2216 * Copyright 2020 Google LLC 2217 * 2218 * Licensed under the Apache License, Version 2.0 (the "License"); 2219 * you may not use this file except in compliance with the License. 2220 * You may obtain a copy of the License at 2221 * 2222 * http://www.apache.org/licenses/LICENSE-2.0 2223 * 2224 * Unless required by applicable law or agreed to in writing, software 2225 * distributed under the License is distributed on an "AS IS" BASIS, 2226 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2227 * See the License for the specific language governing permissions and 2228 * limitations under the License. 2229 */class Ve extends en{constructor(){super("github.com")}static credential(e){return it._fromParams({providerId:Ve.PROVIDER_ID,signInMethod:Ve.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ve.credentialFromTaggedObject(e)}static credentialFromError(e){return Ve.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Ve.credential(e.oauthAccessToken)}catch{return null}}}Ve.GITHUB_SIGN_IN_METHOD="github.com";Ve.PROVIDER_ID="github.com";/** 2230 * @license 2231 * Copyright 2020 Google LLC 2232 * 2233 * Licensed under the Apache License, Version 2.0 (the "License"); 2234 * you may not use this file except in compliance with the License. 2235 * You may obtain a copy of the License at 2236 * 2237 * http://www.apache.org/licenses/LICENSE-2.0 2238 * 2239 * Unless required by applicable law or agreed to in writing, software 2240 * distributed under the License is distributed on an "AS IS" BASIS, 2241 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2242 * See the License for the specific language governing permissions and 2243 * limitations under the License. 2244 */class Ke extends en{constructor(){super("twitter.com")}static credential(e,n){return it._fromParams({providerId:Ke.PROVIDER_ID,signInMethod:Ke.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Ke.credentialFromTaggedObject(e)}static credentialFromError(e){return Ke.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Ke.credential(n,r)}catch{return null}}}Ke.TWITTER_SIGN_IN_METHOD="twitter.com";Ke.PROVIDER_ID="twitter.com";/** 2245 * @license 2246 * Copyright 2020 Google LLC 2247 * 2248 * Licensed under the Apache License, Version 2.0 (the "License"); 2249 * you may not use this file except in compliance with the License. 2250 * You may obtain a copy of the License at 2251 * 2252 * http://www.apache.org/licenses/LICENSE-2.0 2253 * 2254 * Unless required by applicable law or agreed to in writing, software 2255 * distributed under the License is distributed on an "AS IS" BASIS, 2256 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2257 * See the License for the specific language governing permissions and 2258 * limitations under the License. 2259 */class yt{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,s=!1){const a=await Oe._fromIdTokenResponse(e,r,s),l=Ao(r);return new yt({user:a,providerId:l,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const s=Ao(r);return new yt({user:e,providerId:s,_tokenResponse:r,operationType:n})}}function Ao(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** 2260 * @license 2261 * Copyright 2020 Google LLC 2262 * 2263 * Licensed under the Apache License, Version 2.0 (the "License");
2264 * you may not use this file except in compliance with the License. 2265 * You may obtain a copy of the License at 2266 * 2267 * http://www.apache.org/licenses/LICENSE-2.0 2268 * 2269 * Unless required by applicable law or agreed to in writing, software 2270 * distributed under the License is distributed on an "AS IS" BASIS, 2271 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2272 * See the License for the specific language governing permissions and 2273 * limitations under the License. 2274 */class Fn extends ge{constructor(e,n,r,s){var a;super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Fn.prototype),this.customData={appName:e.name,tenantId:(a=e.tenantId)!==null&&a!==void 0?a:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,s){return new Fn(e,n,r,s)}}function Ac(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(a=>{throw a.code==="auth/multi-factor-auth-required"?Fn._fromErrorAndOperation(t,a,e,r):a})}async function vg(t,e,n=!1){const r=await Gt(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return yt._forOperation(t,"link",r)}/** 2275 * @license 2276 * Copyright 2019 Google LLC 2277 * 2278 * Licensed under the Apache License, Version 2.0 (the "License"); 2279 * you may not use this file except in compliance with the License. 2280 * You may obtain a copy of the License at 2281 * 2282 * http://www.apache.org/licenses/LICENSE-2.0 2283 * 2284 * Unless required by applicable law or agreed to in writing, software 2285 * distributed under the License is distributed on an "AS IS" BASIS, 2286 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2287 * See the License for the specific language governing permissions and 2288 * limitations under the License. 2289 */async function yg(t,e,n=!1){const{auth:r}=t;if(ze(r.app))return Promise.reject(et(r));const s="reauthenticate";try{const a=await Gt(t,Ac(r,s,e,t),n);S(a.idToken,r,"internal-error");const l=wr(a.idToken);S(l,r,"internal-error");const{sub:h}=l;return S(t.uid===h,r,"user-mismatch"),yt._forOperation(t,s,a)}catch(a){throw(a==null?void 0:a.code)==="auth/user-not-found"&&Me(r,"user-mismatch"),a}}/** 2290 * @license 2291 * Copyright 2020 Google LLC 2292 * 2293 * Licensed under the Apache License, Version 2.0 (the "License"); 2294 * you may not use this file except in compliance with the License. 2295 * You may obtain a copy of the License at 2296 * 2297 * http://www.apache.org/licenses/LICENSE-2.0 2298 * 2299 * Unless required by applicable law or agreed to in writing, software 2300 * distributed under the License is distributed on an "AS IS" BASIS, 2301 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2302 * See the License for the specific language governing permissions and 2303 * limitations under the License. 2304 */async function Tg(t,e,n=!1){if(ze(t.app))return Promise.reject(et(t));const r="signIn",s=await Ac(t,r,e),a=await yt._fromIdTokenResponse(t,r,s);return n||await t._updateCurrentUser(a.user),a}function Ig(t,e,n,r){return de(t).onIdTokenChanged(e,n,r)}function wg(t,e,n){return de(t).beforeAuthStateChanged(e,n)}const $n="__sak";/** 2305 * @license 2306 * Copyright 2019 Google LLC 2307 * 2308 * Licensed under the Apache License, Version 2.0 (the "License"); 2309 * you may not use this file except in compliance with the License. 2310 * You may obtain a copy of the License at 2311 * 2312 * http://www.apache.org/licenses/LICENSE-2.0 2313 * 2314 * Unless required by applicable law or agreed to in writing, software 2315 * distributed under the License is distributed on an "AS IS" BASIS, 2316 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2317 * See the License for the specific language governing permissions and 2318 * limitations under the License. 2319 */class kc{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem($n,"1"),this.storage.removeItem($n),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** 2320 * @license 2321 * Copyright 2020 Google LLC 2322 * 2323 * Licensed under the Apache License, Version 2.0 (the "License");
2324 * you may not use this file except in compliance with the License. 2325 * You may obtain a copy of the License at 2326 * 2327 * http://www.apache.org/licenses/LICENSE-2.0 2328 * 2329 * Unless required by applicable law or agreed to in writing, software 2330 * distributed under the License is distributed on an "AS IS" BASIS, 2331 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2332 * See the License for the specific language governing permissions and 2333 * limitations under the License. 2334 */const Eg=1e3,bg=10;class Sc extends kc{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Tc(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&e(n,s,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((l,h,f)=>{this.notifyListeners(l,f)});return}const r=e.key;n?this.detachListener():this.stopPolling();const s=()=>{const l=this.storage.getItem(r);!n&&this.localCache[r]===l||this.notifyListeners(r,l)},a=this.storage.getItem(r);ng()&&a!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,bg):s()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},Eg)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
2334ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}Sc.type="LOCAL";const Ag=Sc;/** 2335 * @license 2336 * Copyright 2020 Google LLC 2337 * 2338 * Licensed under the Apache License, Version 2.0 (the "License"); 2339 * you may not use this file except in compliance with the License. 2340 * You may obtain a copy of the License at 2341 * 2342 * http://www.apache.org/licenses/LICENSE-2.0 2343 * 2344 * Unless required by applicable law or agreed to in writing, software 2345 * distributed under the License is distributed on an "AS IS" BASIS, 2346 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2347 * See the License for the specific language governing permissions and 2348 * limitations under the License. 2349 */class Rc extends kc{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}Rc.type="SESSION";const Cc=Rc;/** 2350 * @license 2351 * Copyright 2019 Google LLC 2352 * 2353 * Licensed under the Apache License, Version 2.0 (the "License"); 2354 * you may not use this file except in compliance with the License. 2355 * You may obtain a copy of the License at 2356 * 2357 * http://www.apache.org/licenses/LICENSE-2.0 2358 * 2359 * Unless required by applicable law or agreed to in writing, software 2360 * distributed under the License is distributed on an "AS IS" BASIS, 2361 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2362 * See the License for the specific language governing permissions and 2363 * limitations under the License. 2364 */function kg(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** 2365 * @license 2366 * Copyright 2019 Google LLC 2367 * 2368 * Licensed under the Apache License, Version 2.0 (the "License"); 2369 * you may not use this file except in compliance with the License. 2370 * You may obtain a copy of the License at 2371 * 2372 * http://www.apache.org/licenses/LICENSE-2.0 2373 * 2374 * Unless required by applicable law or agreed to in writing, software 2375 * distributed under the License is distributed on an "AS IS" BASIS, 2376 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2377 * See the License for the specific language governing permissions and 2378 * limitations under the License. 2379 */class Wn{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(s=>s.isListeningto(e));if(n)return n;const r=new Wn(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:s,data:a}=n.data,l=this.handlersMap[s];if(!(l!=null&&l.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const h=Array.from(l).map(async I=>I(n.origin,a)),f=await kg(h);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:f})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Wn.receivers=[];/** 2380 * @license 2381 * Copyright 2020 Google LLC 2382 * 2383 * Licensed under the Apache License, Version 2.0 (the "License"); 2384 * you may not use this file except in compliance with the License. 2385 * You may obtain a copy of the License at 2386 * 2387 * http://www.apache.org/licenses/LICENSE-2.0 2388 * 2389 * Unless required by applicable law or agreed to in writing, software 2390 * distributed under the License is distributed on an "AS IS" BASIS, 2391 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2392 * See the License for the specific language governing permissions and 2393 * limitations under the License. 2394 */function kr(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}/** 2395 * @license 2396 * Copyright 2019 Google LLC 2397 * 2398 * Licensed under the Apache License, Version 2.0 (the "License");
2399 * you may not use this file except in compliance with the License. 2400 * You may obtain a copy of the License at 2401 * 2402 * http://www.apache.org/licenses/LICENSE-2.0 2403 * 2404 * Unless required by applicable law or agreed to in writing, software 2405 * distributed under the License is distributed on an "AS IS" BASIS, 2406 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2407 * See the License for the specific language governing permissions and 2408 * limitations under the License. 2409 */class Sg{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let a,l;return new Promise((h,f)=>{const I=kr("",20);s.port1.start();const E=setTimeout(()=>{f(new Error("unsupported_event"))},r);l={messageChannel:s,onMessage(A){const k=A;if(k.data.eventId===I)switch(k.data.status){case"ack":clearTimeout(E),a=setTimeout(()=>{f(new Error("timeout"))},3e3);break;case"done":clearTimeout(a),h(k.data.response);break;default:clearTimeout(E),clearTimeout(a),f(new Error("invalid_response"));break}}},this.handlers.add(l),s.port1.addEventListener("message",l.onMessage),this.target.postMessage({eventType:e,eventId:I,data:n},[s.port2])}).finally(()=>{l&&this.removeMessageHandler(l)})}}/** 2410 * @license 2411 * Copyright 2020 Google LLC 2412 * 2413 * Licensed under the Apache License, Version 2.0 (the "License"); 2414 * you may not use this file except in compliance with the License. 2415 * You may obtain a copy of the License at 2416 * 2417 * http://www.apache.org/licenses/LICENSE-2.0 2418 * 2419 * Unless required by applicable law or agreed to in writing, software 2420 * distributed under the License is distributed on an "AS IS" BASIS, 2421 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2422 * See the License for the specific language governing permissions and 2423 * limitations under the License. 2424 */function Ie(){return window}function Rg(t){Ie().location.href=t}/** 2425 * @license 2426 * Copyright 2020 Google LLC. 2427 * 2428 * Licensed under the Apache License, Version 2.0 (the "License"); 2429 * you may not use this file except in compliance with the License. 2430 * You may obtain a copy of the License at 2431 * 2432 * http://www.apache.org/licenses/LICENSE-2.0 2433 * 2434 * Unless required by applicable law or agreed to in writing, software 2435 * distributed under the License is distributed on an "AS IS" BASIS, 2436 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2437 * See the License for the specific language governing permissions and 2438 * limitations under the License. 2439 */function Pc(){return typeof Ie().WorkerGlobalScope<"u"&&typeof Ie().importScripts=="function"}async function Cg(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Pg(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function Og(){return Pc()?self:null}/** 2440 * @license 2441 * Copyright 2019 Google LLC 2442 * 2443 * Licensed under the Apache License, Version 2.0 (the "License"); 2444 * you may not use this file except in compliance with the License. 2445 * You may obtain a copy of the License at 2446 * 2447 * http://www.apache.org/licenses/LICENSE-2.0 2448 * 2449 * Unless required by applicable law or agreed to in writing, software 2450 * distributed under the License is distributed on an "AS IS" BASIS, 2451 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2452 * See the License for the specific language governing permissions and 2453 * limitations under the License. 2454 */const Oc="firebaseLocalStorageDb",Ng=1,jn="firebaseLocalStorage",Nc="fbase_key";class tn{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function Gn(t,e){return t.transaction([jn],e?"readwrite":"readonly").objectStore(jn)}function Dg(){const t=indexedDB.deleteDatabase(Oc);
2454return new tn(t).toPromise()}function Qi(){const t=indexedDB.open(Oc,Ng);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(jn,{keyPath:Nc})}catch(s){n(s)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(jn)?e(r):(r.close(),await Dg(),e(await Qi()))})})}async function ko(t,e,n){const r=Gn(t,!0).put({[Nc]:e,value:n});return new tn(r).toPromise()}async function Mg(t,e){const n=Gn(t,!1).get(e),r=await new tn(n).toPromise();return r===void 0?null:r.value}function So(t,e){const n=Gn(t,!0).delete(e);return new tn(n).toPromise()}const Lg=800,Ug=3;class Dc{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Qi(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Ug)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Pc()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Wn._getInstance(Og()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
2454)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await Cg(),!this.activeServiceWorker)return;this.sender=new Sg(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Pg()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Qi();return await ko(e,$n,"1"),await So(e,$n),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>ko(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>Mg(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>So(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(s=>{const a=Gn(s,!1).getAll();return new tn(a).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:s,value:a}of e)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(a)&&(this.notifyListeners(s,a),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Lg)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
2454ject.keys(this.listeners).length===0&&this.stopPolling()}}Dc.type="LOCAL";const xg=Dc;new Zt(3e4,6e4);/** 2455 * @license 2456 * Copyright 2021 Google LLC 2457 * 2458 * Licensed under the Apache License, Version 2.0 (the "License"); 2459 * you may not use this file except in compliance with the License. 2460 * You may obtain a copy of the License at 2461 * 2462 * http://www.apache.org/licenses/LICENSE-2.0 2463 * 2464 * Unless required by applicable law or agreed to in writing, software 2465 * distributed under the License is distributed on an "AS IS" BASIS, 2466 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2467 * See the License for the specific language governing permissions and 2468 * limitations under the License. 2469 */function Fg(t,e){return e?Ne(e):(S(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** 2470 * @license 2471 * Copyright 2019 Google LLC 2472 * 2473 * Licensed under the Apache License, Version 2.0 (the "License"); 2474 * you may not use this file except in compliance with the License. 2475 * You may obtain a copy of the License at 2476 * 2477 * http://www.apache.org/licenses/LICENSE-2.0 2478 * 2479 * Unless required by applicable law or agreed to in writing, software 2480 * distributed under the License is distributed on an "AS IS" BASIS, 2481 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2482 * See the License for the specific language governing permissions and 2483 * limitations under the License. 2484 */class Sr extends Ec{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return _t(e,this._buildIdpRequest())}_linkToIdToken(e,n){return _t(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return _t(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function $g(t){return Tg(t.auth,new Sr(t),t.bypassAuthState)}function jg(t){const{auth:e,user:n}=t;return S(n,e,"internal-error"),yg(n,new Sr(t),t.bypassAuthState)}async function Bg(t){const{auth:e,user:n}=t;return S(n,e,"internal-error"),vg(n,new Sr(t),t.bypassAuthState)}/** 2485 * @license 2486 * Copyright 2020 Google LLC 2487 * 2488 * Licensed under the Apache License, Version 2.0 (the "License"); 2489 * you may not use this file except in compliance with the License. 2490 * You may obtain a copy of the License at 2491 * 2492 * http://www.apache.org/licenses/LICENSE-2.0 2493 * 2494 * Unless required by applicable law or agreed to in writing, software 2495 * distributed under the License is distributed on an "AS IS" BASIS, 2496 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2497 * See the License for the specific language governing permissions and 2498 * limitations under the License. 2499 */class Mc{constructor(e,n,r,s,a=!1){this.auth=e,this.resolver=r,this.user=s,this.bypassAuthState=a,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:s,tenantId:a,error:l,type:h}=e;if(l){this.reject(l);return}const f={auth:this.auth,requestUri:n,sessionId:r,tenantId:a||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(h)(f))}catch(I){this.reject(I)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return $g;case"linkViaPopup":case"linkViaRedirect":return Bg;case"reauthViaPopup":case"reauthViaRedirect":return jg;default:Me(this.auth,"internal-error")}}resolve(e){Le(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Le(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** 2500 * @license 2501 * Copyright 2020 Google LLC 2502 * 2503 * Licensed under the Apache License, Version 2.0 (the "License");
2504 * you may not use this file except in compliance with the License. 2505 * You may obtain a copy of the License at 2506 * 2507 * http://www.apache.org/licenses/LICENSE-2.0 2508 * 2509 * Unless required by applicable law or agreed to in writing, software 2510 * distributed under the License is distributed on an "AS IS" BASIS, 2511 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2512 * See the License for the specific language governing permissions and 2513 * limitations under the License. 2514 */const Hg=new Zt(2e3,1e4);class dt extends Mc{constructor(e,n,r,s,a){super(e,n,s,a),this.provider=r,this.authWindow=null,this.pollId=null,dt.currentPopupAction&&dt.currentPopupAction.cancel(),dt.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return S(e,this.auth,"internal-error"),e}async onExecution(){Le(this.filter.length===1,"Popup operations only handle one event");const e=kr();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(Te(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(Te(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,dt.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Te(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Hg.get())};e()}}dt.currentPopupAction=null;/** 2515 * @license 2516 * Copyright 2020 Google LLC 2517 * 2518 * Licensed under the Apache License, Version 2.0 (the "License"); 2519 * you may not use this file except in compliance with the License. 2520 * You may obtain a copy of the License at 2521 * 2522 * http://www.apache.org/licenses/LICENSE-2.0 2523 * 2524 * Unless required by applicable law or agreed to in writing, software 2525 * distributed under the License is distributed on an "AS IS" BASIS, 2526 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2527 * See the License for the specific language governing permissions and 2528 * limitations under the License. 2529 */const Vg="pendingRedirect",Sn=new Map;class Kg extends Mc{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Sn.get(this.auth._key());if(!e){try{const r=await zg(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Sn.set(this.auth._key(),e)}return this.bypassAuthState||Sn.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function zg(t,e){const n=Gg(e),r=Wg(t);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function qg(t,e){Sn.set(t._key(),e)}function Wg(t){return Ne(t._redirectPersistence)}function Gg(t){return kn(Vg,t.config.apiKey,t.name)}async function Xg(t,e,n=!1){if(ze(t.app))return Promise.reject(et(t));const r=br(t),s=Fg(r,e),l=await new Kg(r,s,n).execute();return l&&!n&&(delete l.user._redirectEventId,await r._persistUserIfCurrent(l.user),await r._setRedirectUser(null,e)),l}/** 2530 * @license 2531 * Copyright 2020 Google LLC 2532 * 2533 * Licensed under the Apache License, Version 2.0 (the "License"); 2534 * you may not use this file except in compliance with the License. 2535 * You may obtain a copy of the License at 2536 * 2537 * http://www.apache.org/licenses/LICENSE-2.0 2538 * 2539 * Unless required by applicable law or agreed to in writing, softw
2539are 2540 * distributed under the License is distributed on an "AS IS" BASIS, 2541 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2542 * See the License for the specific language governing permissions and 2543 * limitations under the License. 2544 */const Jg=10*60*1e3;class Yg{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Qg(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!Lc(e)){const s=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(Te(this.auth,s))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Jg&&this.cachedEventUids.clear(),this.cachedEventUids.has(Ro(e))}saveEventToCache(e){this.cachedEventUids.add(Ro(e)),this.lastProcessedEventTime=Date.now()}}function Ro(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function Lc({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Qg(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Lc(t);default:return!1}}/** 2545 * @license 2546 * Copyright 2020 Google LLC 2547 * 2548 * Licensed under the Apache License, Version 2.0 (the "License"); 2549 * you may not use this file except in compliance with the License. 2550 * You may obtain a copy of the License at 2551 * 2552 * http://www.apache.org/licenses/LICENSE-2.0 2553 * 2554 * Unless required by applicable law or agreed to in writing, software 2555 * distributed under the License is distributed on an "AS IS" BASIS, 2556 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2557 * See the License for the specific language governing permissions and 2558 * limitations under the License. 2559 */async function Zg(t,e={}){return wt(t,"GET","/v1/projects",e)}/** 2560 * @license 2561 * Copyright 2020 Google LLC 2562 * 2563 * Licensed under the Apache License, Version 2.0 (the "License"); 2564 * you may not use this file except in compliance with the License. 2565 * You may obtain a copy of the License at 2566 * 2567 * http://www.apache.org/licenses/LICENSE-2.0 2568 * 2569 * Unless required by applicable law or agreed to in writing, software 2570 * distributed under the License is distributed on an "AS IS" BASIS, 2571 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2572 * See the License for the specific language governing permissions and 2573 * limitations under the License. 2574 */const em=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,tm=/^https?/;async function nm(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Zg(t);for(const n of e)try{if(im(n))return}catch{}Me(t,"unauthorized-domain")}function im(t){const e=Ji(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const l=new URL(t);return l.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&l.hostname===r}if(!tm.test(n))return!1;if(em.test(t))return r===t;const s=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/** 2575 * @license 2576 * Copyright 2020 Google LLC. 2577 * 2578 * Licensed under the Apache License, Version 2.0 (the "License"); 2579 * you may not use this file except in compliance with the License. 2580 * You may obtain a copy of the License at 2581 * 2582 * http://www.apache.org/licenses/LICENSE-2.0 2583 * 2584 * Unless required by applicable law or agreed to in writing, softw
2584are 2585 * distributed under the License is distributed on an "AS IS" BASIS, 2586 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2587 * See the License for the specific language governing permissions and 2588 * limitations under the License. 2589 */const rm=new Zt(3e4,6e4);function Co(){const t=Ie().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function sm(t){return new Promise((e,n)=>{var r,s,a;function l(){Co(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Co(),n(Te(t,"network-request-failed"))},timeout:rm.get()})}if(!((s=(r=Ie().gapi)===null||r===void 0?void 0:r.iframes)===null||s===void 0)&&s.Iframe)e(gapi.iframes.getContext());else if(!((a=Ie().gapi)===null||a===void 0)&&a.load)l();else{const h=hg("iframefcb");return Ie()[h]=()=>{gapi.load?l():n(Te(t,"network-request-failed"))},lg(`${ug()}?onload=${h}`).catch(f=>n(f))}}).catch(e=>{throw Rn=null,e})}let Rn=null;function om(t){return Rn=Rn||sm(t),Rn}/** 2590 * @license 2591 * Copyright 2020 Google LLC. 2592 * 2593 * Licensed under the Apache License, Version 2.0 (the "License"); 2594 * you may not use this file except in compliance with the License. 2595 * You may obtain a copy of the License at 2596 * 2597 * http://www.apache.org/licenses/LICENSE-2.0 2598 * 2599 * Unless required by applicable law or agreed to in writing, software 2600 * distributed under the License is distributed on an "AS IS" BASIS, 2601 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2602 * See the License for the specific language governing permissions and 2603 * limitations under the License. 2604 */const am=new Zt(5e3,15e3),cm="__/auth/iframe",lm="emulator/auth/iframe",um={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},hm=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function dm(t){const e=t.config;S(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Tr(e,lm):`https://${t.config.authDomain}/${cm}`,r={apiKey:e.apiKey,appName:t.name,v:rt},s=hm.get(t.config.apiHost);s&&(r.eid=s);const a=t._getFrameworks();return a.length&&(r.fw=a.join(",")),`${n}?${Yt(r).slice(1)}`}async function fm(t){const e=await om(t),n=Ie().gapi;return S(n,t,"internal-error"),e.open({where:document.body,url:dm(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:um,dontclear:!0},r=>new Promise(async(s,a)=>{await r.restyle({setHideOnLeave:!1});const l=Te(t,"network-request-failed"),h=Ie().setTimeout(()=>{a(l)},am.get());function f(){Ie().clearTimeout(h),s(r)}r.ping(f).then(f,()=>{a(l)})}))}/** 2605 * @license 2606 * Copyright 2020 Google LLC. 2607 * 2608 * Licensed under the Apache License, Version 2.0 (the "License"); 2609 * you may not use this file except in compliance with the License. 2610 * You may obtain a copy of the License at 2611 * 2612 * http://www.apache.org/licenses/LICENSE-2.0 2613 * 2614 * Unless required by applicable law or agreed to in writing, software 2615 * distributed under the License is distributed on an "AS IS" BASIS, 2616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2617 * See the License for the specific language governing permissions and 2618 * limitations under the License. 2619 */const pm={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},gm=500,mm=600,_m="_blank",vm="http://localhost";class Po{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function ym(t,e,n,r=gm,s=mm){const a=Math.max((window.screen.availHeight-s)/2,0).toString(),l=Math.max((window.screen.availWidth-r)/2,0).toString();let h="";const f=Object.assign(Object.assign({},pm),{width:r.toString(),height:s.toString(),top:a,left:l}),I=se().toLowerCase();n&&(h=gc(I)?_m:n),fc(I)&&(e=e||vm,f.scrollbars="yes");const E=Object.entries(f).reduce((k,[O,R])=>`${k}${O}=${R},`,"");if(tg(I)&&h!=="_self")return Tm(e||"",h),new Po(null);const A=window.open(e||"",h,E);S(A,t,"popup-blocked");try{A.focus()}catch{}return new Po(A)}function Tm(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");
2619r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** 2620 * @license 2621 * Copyright 2021 Google LLC 2622 * 2623 * Licensed under the Apache License, Version 2.0 (the "License"); 2624 * you may not use this file except in compliance with the License. 2625 * You may obtain a copy of the License at 2626 * 2627 * http://www.apache.org/licenses/LICENSE-2.0 2628 * 2629 * Unless required by applicable law or agreed to in writing, software 2630 * distributed under the License is distributed on an "AS IS" BASIS, 2631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2632 * See the License for the specific language governing permissions and 2633 * limitations under the License. 2634 */const Im="__/auth/handler",wm="emulator/auth/handler",Em=encodeURIComponent("fac");async function Oo(t,e,n,r,s,a){S(t.config.authDomain,t,"auth-domain-config-required"),S(t.config.apiKey,t,"invalid-api-key");const l={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:rt,eventId:s};if(e instanceof bc){e.setDefaultLanguage(t.languageCode),l.providerId=e.providerId||"",xl(e.getCustomParameters())||(l.customParameters=JSON.stringify(e.getCustomParameters()));for(const[E,A]of Object.entries({}))l[E]=A}if(e instanceof en){const E=e.getScopes().filter(A=>A!=="");E.length>0&&(l.scopes=E.join(","))}t.tenantId&&(l.tid=t.tenantId);const h=l;for(const E of Object.keys(h))h[E]===void 0&&delete h[E];const f=await t._getAppCheckToken(),I=f?`#${Em}=${encodeURIComponent(f)}`:"";return`${bm(t)}?${Yt(h).slice(1)}${I}`}function bm({config:t}){return t.emulator?Tr(t,wm):`https://${t.authDomain}/${Im}`}/** 2635 * @license 2636 * Copyright 2020 Google LLC 2637 * 2638 * Licensed under the Apache License, Version 2.0 (the "License"); 2639 * you may not use this file except in compliance with the License. 2640 * You may obtain a copy of the License at 2641 * 2642 * http://www.apache.org/licenses/LICENSE-2.0 2643 * 2644 * Unless required by applicable law or agreed to in writing, software 2645 * distributed under the License is distributed on an "AS IS" BASIS, 2646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2647 * See the License for the specific language governing permissions and 2648 * limitations under the License. 2649 */const Ui="webStorageSupport";class Am{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Cc,this._completeRedirectFn=Xg,this._overrideRedirectResult=qg}
2649async _openPopup(e,n,r,s){var a;Le((a=this.eventManagers[e._key()])===null||a===void 0?void 0:a.manager,"_initialize() not called before _openPopup()");const l=await Oo(e,n,r,Ji(),s);return ym(e,l,kr())}async _openRedirect(e,n,r,s){await this._originValidation(e);const a=await Oo(e,n,r,Ji(),s);return Rg(a),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:s,promise:a}=this.eventManagers[n];return s?Promise.resolve(s):(Le(a,"If manager is not set, promise should be"),a)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await fm(e),r=new Yg(e);return n.register("authEvent",s=>(S(s==null?void 0:s.authEvent,e,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Ui,{type:Ui},s=>{var a;const l=(a=s==null?void 0:s[0])===null||a===void 0?void 0:a[Ui];l!==void 0&&n(!!l),Me(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=nm(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return Tc()||pc()||Er()}}const km=Am;var No="@firebase/auth",Do="1.7.8";/** 2650 * @license 2651 * Copyright 2020 Google LLC 2652 * 2653 * Licensed under the Apache License, Version 2.0 (the "License"); 2654 * you may not use this file except in compliance with the License. 2655 * You may obtain a copy of the License at 2656 * 2657 * http://www.apache.org/licenses/LICENSE-2.0 2658 * 2659 * Unless required by applicable law or agreed to in writing, software 2660 * distributed under the License is distributed on an "AS IS" BASIS, 2661 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2662 * See the License for the specific language governing permissions and 2663 * limitations under the License. 2664 */class Sm{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){S(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** 2665 * @license 2666 * Copyright 2020 Google LLC 2667 * 2668 * Licensed under the Apache License, Version 2.0 (the "License"); 2669 * you may not use this file except in compliance with the License. 2670 * You may obtain a copy of the License at 2671 * 2672 * http://www.apache.org/licenses/LICENSE-2.0 2673 * 2674 * Unless required by applicable law or agreed to in writing, software 2675 * distributed under the License is distributed on an "AS IS" BASIS, 2676 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2677 * See the License for the specific language governing permissions and 2678 * limitations under the License. 2679 */function Rm(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Cm(t){ee(new z("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),a=e.getProvider("app-check-internal"),{apiKey:l,authDomain:h}=r.options;S(l&&!l.includes(":"),"invalid-api-key",{appName:r.name});const f={apiKey:l,authDomain:h,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Ic(t)},I=new ag(r,s,a,f);return fg(I,n),I},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),ee(new z("auth-internal",e=>{const n=br(e.getProvider("auth").getImmediate());return(r=>new Sm(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),H(No,Do,Rm(t)),H(No,Do,"esm2017")}/** 2680 * @license 2681 * Copyright 2021 Google LLC 2682 * 2683 * Licensed under the Apache License, Version 2.0 (the "License");
2684 * you may not use this file except in compliance with the License. 2685 * You may obtain a copy of the License at 2686 * 2687 * http://www.apache.org/licenses/LICENSE-2.0 2688 * 2689 * Unless required by applicable law or agreed to in writing, software 2690 * distributed under the License is distributed on an "AS IS" BASIS, 2691 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2692 * See the License for the specific language governing permissions and 2693 * limitations under the License. 2694 */const Pm=5*60,Om=Wo("authIdTokenMaxAge")||Pm;let Mo=null;const Nm=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>Om)return;const s=n==null?void 0:n.token;Mo!==s&&(Mo=s,await fetch(t,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function C_(t=st()){const e=me(t,"auth");if(e.isInitialized())return e.getImmediate();const n=dg(t,{popupRedirectResolver:km,persistence:[xg,Ag,Cc]}),r=Wo("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const a=new URL(r,location.origin);if(location.origin===a.origin){const l=Nm(a.toString());wg(n,l,()=>l(n.currentUser)),Ig(n,h=>l(h))}}const s=Ko("auth");return s&&pg(n,`http://${s}`),n}function Dm(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}cg({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=s=>{const a=Te("internal-error");a.customData=s,n(a)},r.type="text/javascript",r.charset="UTF-8",Dm().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Cm("Browser");/** 2695 * @license 2696 * Copyright 2019 Google LLC 2697 * 2698 * Licensed under the Apache License, Version 2.0 (the "License"); 2699 * you may not use this file except in compliance with the License. 2700 * You may obtain a copy of the License at 2701 * 2702 * http://www.apache.org/licenses/LICENSE-2.0 2703 * 2704 * Unless required by applicable law or agreed to in writing, software 2705 * distributed under the License is distributed on an "AS IS" BASIS, 2706 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2707 * See the License for the specific language governing permissions and 2708 * limitations under the License. 2709 */const Mm="/firebase-messaging-sw.js",Lm="/firebase-cloud-messaging-push-scope",Uc="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",Um="https://fcmregistrations.googleapis.com/v1",xc="google.c.a.c_id",xm="google.c.a.c_l",Fm="google.c.a.ts",$m="google.c.a.e";var Lo;(function(t){t[t.DATA_MESSAGE=1]="DATA_MESSAGE",t[t.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"})(Lo||(Lo={}));/** 2710 * @license 2711 * Copyright 2018 Google LLC 2712 * 2713 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 2714 * in compliance with the License. You may obtain a copy of the License at 2715 * 2716 * http://www.apache.org/licenses/LICENSE-2.0 2717 * 2718 * Unless required by applicable law or agreed to in writing, software distributed under the License 2719 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 2720 * or implied. See the License for the specific language governing permissions and limitations under 2721 * the License. 2722 */var Xt;(function(t){t.PUSH_RECEIVED="push-received",t.NOTIFICATION_CLICKED="notification-clicked"})(Xt||(Xt={}));/** 2723 * @license 2724 * Copyright 2017 Google LLC 2725 * 2726 * Licensed under the Apache License, Version 2.0 (the "License"); 2727 * you may not use this file except in compliance with the License. 2728 * You may obtain a copy of the License at 2729 * 2730 * http://www.apache.org/licenses/LICENSE-2.0 2731 * 2732 * Unless required by applicable law or agreed to in writing, software 2733 * distributed under the License is distributed on an "AS IS" BASIS, 2734 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2735 * See the License for the specific language governing permissions and 2736 * limitations under the License. 2737 */function Ce(t){const e=new Uint8Array(t);return btoa(String.fromCharCode(...e)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jm(t){const e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(n),s=new Uint8Array(r.length);for(let a=0;a<r.length;++a)s[a]=r.charCodeAt(a);return s}/** 2738 * @license 2739 * Copyright 2019 Google LLC 2740 * 2741 * Licensed under the Apache License, Version 2.0 (the "License");
2742 * you may not use this file except in compliance with the License. 2743 * You may obtain a copy of the License at 2744 * 2745 * http://www.apache.org/licenses/LICENSE-2.0 2746 * 2747 * Unless required by applicable law or agreed to in writing, software 2748 * distributed under the License is distributed on an "AS IS" BASIS, 2749 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2750 * See the License for the specific language governing permissions and 2751 * limitations under the License. 2752 */const xi="fcm_token_details_db",Bm=5,Uo="fcm_token_object_Store";async function Hm(t){if("databases"in indexedDB&&!(await indexedDB.databases()).map(a=>a.name).includes(xi))return null;let e=null;return(await Bn(xi,Bm,{upgrade:async(r,s,a,l)=>{var h;if(s<2||!r.objectStoreNames.contains(Uo))return;const f=l.objectStore(Uo),I=await f.index("fcmSenderId").get(t);if(await f.clear(),!!I){if(s===2){const E=I;if(!E.auth||!E.p256dh||!E.endpoint)return;e={token:E.fcmToken,createTime:(h=E.createTime)!==null&&h!==void 0?h:Date.now(),subscriptionOptions:{auth:E.auth,p256dh:E.p256dh,endpoint:E.endpoint,swScope:E.swScope,vapidKey:typeof E.vapidKey=="string"?E.vapidKey:Ce(E.vapidKey)}}}else if(s===3){const E=I;e={token:E.fcmToken,createTime:E.createTime,subscriptionOptions:{auth:Ce(E.auth),p256dh:Ce(E.p256dh),endpoint:E.endpoint,swScope:E.swScope,vapidKey:Ce(E.vapidKey)}}}else if(s===4){const E=I;e={token:E.fcmToken,createTime:E.createTime,subscriptionOptions:{auth:Ce(E.auth),p256dh:Ce(E.p256dh),endpoint:E.endpoint,swScope:E.swScope,vapidKey:Ce(E.vapidKey)}}}}}})).close(),await Ii(xi),await Ii("fcm_vapid_details_db"),await Ii("undefined"),Vm(e)?e:null}function Vm(t){if(!t||!t.subscriptionOptions)return!1;const{subscriptionOptions:e}=t;return typeof t.createTime=="number"&&t.createTime>0&&typeof t.token=="string"&&t.token.length>0&&typeof e.auth=="string"&&e.auth.length>0&&typeof e.p256dh=="string"&&e.p256dh.length>0&&typeof e.endpoint=="string"&&e.endpoint.length>0&&typeof e.swScope=="string"&&e.swScope.length>0&&typeof e.vapidKey=="string"&&e.vapidKey.length>0}/** 2753 * @license 2754 * Copyright 2019 Google LLC 2755 * 2756 * Licensed under the Apache License, Version 2.0 (the "License"); 2757 * you may not use this file except in compliance with the License. 2758 * You may obtain a copy of the License at 2759 * 2760 * http://www.apache.org/licenses/LICENSE-2.0 2761 * 2762 * Unless required by applicable law or agreed to in writing, software 2763 * distributed under the License is distributed on an "AS IS" BASIS, 2764 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2765 * See the License for the specific language governing permissions and 2766 * limitations under the License. 2767 */const Km="firebase-messaging-database",zm=1,Jt="firebase-messaging-store";let Fi=null;function Fc(){return Fi||(Fi=Bn(Km,zm,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(Jt)}}})),Fi}async function qm(t){const e=$c(t),r=await(await Fc()).transaction(Jt).objectStore(Jt).get(e);if(r)return r;{const s=await Hm(t.appConfig.senderId);if(s)return await Rr(t,s),s}}async function Rr(t,e){const n=$c(t),s=(await Fc()).transaction(Jt,"readwrite");return await s.objectStore(Jt).put(e,n),await s.done,e}function $c({appConfig:t}){return t.appId}/** 2768 * @license 2769 * Copyright 2017 Google LLC 2770 * 2771 * Licensed under the Apache License, Version 2.0 (the "License"); 2772 * you may not use this file except in compliance with the License. 2773 * You may obtain a copy of the License at 2774 * 2775 * http://www.apache.org/licenses/LICENSE-2.0 2776 * 2777 * Unless required by applicable law or agreed to in writing, software 2778 * distributed under the License is distributed on an "AS IS" BASIS, 2779 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2780 * See the License for the specific language governing permissions and 2781 * limitations under the License. 2782 */const Wm={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invali
2782d-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},re=new be("messaging","Messaging",Wm);/** 2783 * @license 2784 * Copyright 2019 Google LLC 2785 * 2786 * Licensed under the Apache License, Version 2.0 (the "License"); 2787 * you may not use this file except in compliance with the License. 2788 * You may obtain a copy of the License at 2789 * 2790 * http://www.apache.org/licenses/LICENSE-2.0 2791 * 2792 * Unless required by applicable law or agreed to in writing, software 2793 * distributed under the License is distributed on an "AS IS" BASIS, 2794 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2795 * See the License for the specific language governing permissions and 2796 * limitations under the License. 2797 */async function Gm(t,e){const n=await Pr(t),r=jc(e),s={method:"POST",headers:n,body:JSON.stringify(r)};let a;try{a=await(await fetch(Cr(t.appConfig),s)).json()}catch(l){throw re.create("token-subscribe-failed",{errorInfo:l==null?void 0:l.toString()})}if(a.error){const l=a.error.message;throw re.create("token-subscribe-failed",{errorInfo:l})}if(!a.token)throw re.create("token-subscribe-no-token");return a.token}async function Xm(t,e){const n=await Pr(t),r=jc(e.subscriptionOptions),s={method:"PATCH",headers:n,body:JSON.stringify(r)};let a;try{a=await(await fetch(`${Cr(t.appConfig)}/${e.token}`,s)).json()}catch(l){throw re.create("token-update-failed",{errorInfo:l==null?void 0:l.toString()})}if(a.error){const l=a.error.message;throw re.create("token-update-failed",{errorInfo:l})}if(!a.token)throw re.create("token-update-no-token");return a.token}async function Jm(t,e){const r={method:"DELETE",headers:await Pr(t)};try{const a=await(await fetch(`${Cr(t.appConfig)}/${e}`,r)).json();if(a.error){const l=a.error.message;throw re.create("token-unsubscribe-failed",{errorInfo:l})}}catch(s){throw re.create("token-unsubscribe-failed",{errorInfo:s==null?void 0:s.toString()})}}function Cr({projectId:t}){return`${Um}/projects/${t}/registrations`}async function Pr({appConfig:t,installations:e}){const n=await e.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function jc({p256dh:t,auth:e,endpoint:n,vapidKey:r}){const s={web:{endpoint:n,auth:e,p256dh:t}};return r!==Uc&&(s.web.applicationPubKey=r),s}/** 2798 * @license 2799 * Copyright 2019 Google LLC 2800 * 2801 * Licensed under the Apache License, Version 2.0 (the "License"); 2802 * you may not use this file except in compliance with the License. 2803 * You may obtain a copy of the License at 2804 * 2805 * http://www.apache.org/licenses/LICENSE-2.0 2806 * 2807 * Unless required by applicable law or agreed to in writing, software 2808 * distributed under the License is distributed on an "AS IS" BASIS, 2809 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2810 * See the License for the specific language governing permissions and 2811 * limitations under the License. 2812 */const Ym=7*24*60*60*1e3;async function Qm(t){const e=await e_(t.swRegistration,t.vapidKey),n={vapidKey:t.vapidKey,swScope:t.swRegistration.scope,endpoint:e.endpoint,auth:Ce(e.getKey("auth")),p256dh:Ce(e.getKey("p256dh"))},r=await qm(t.firebaseDependencies);if(r){if(t_(r.subscriptionOptions,n))return Date.now()>=r.createTime+Ym?Zm(t,{token:r.token,createTime:Date.now(),subscriptionOptions:n}):r.token;try{await Jm(t.firebaseDependencies,r.token)}catch(s){console.warn(s)}return xo(t.firebaseDependencies,n)}else return xo(t.firebaseDependencies,n)}async function Zm(t,e){try{const n=await Xm(t.firebaseDependencies,e),r=Object.assign(Object.assign({},e),{token:n,createTime:Date.now()});return await Rr(t.firebaseDependencies,r),n}catch(n){throw n}}async function xo(t,e){const r={token:await Gm(t,e),createTime:Date.now(),subscriptionOptions:e};return await Rr(t,r),r.token}async function e_(t,e){const n=await t.pushManager.getSubscription();
2812return n||t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:jm(e)})}function t_(t,e){const n=e.vapidKey===t.vapidKey,r=e.endpoint===t.endpoint,s=e.auth===t.auth,a=e.p256dh===t.p256dh;return n&&r&&s&&a}/** 2813 * @license 2814 * Copyright 2020 Google LLC 2815 * 2816 * Licensed under the Apache License, Version 2.0 (the "License"); 2817 * you may not use this file except in compliance with the License. 2818 * You may obtain a copy of the License at 2819 * 2820 * http://www.apache.org/licenses/LICENSE-2.0 2821 * 2822 * Unless required by applicable law or agreed to in writing, software 2823 * distributed under the License is distributed on an "AS IS" BASIS, 2824 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2825 * See the License for the specific language governing permissions and 2826 * limitations under the License. 2827 */function Fo(t){const e={from:t.from,collapseKey:t.collapse_key,messageId:t.fcmMessageId};return n_(e,t),i_(e,t),r_(e,t),e}function n_(t,e){if(!e.notification)return;t.notification={};const n=e.notification.title;n&&(t.notification.title=n);const r=e.notification.body;r&&(t.notification.body=r);const s=e.notification.image;s&&(t.notification.image=s);const a=e.notification.icon;a&&(t.notification.icon=a)}function i_(t,e){e.data&&(t.data=e.data)}function r_(t,e){var n,r,s,a,l;if(!e.fcmOptions&&!(!((n=e.notification)===null||n===void 0)&&n.click_action))return;t.fcmOptions={};const h=(s=(r=e.fcmOptions)===null||r===void 0?void 0:r.link)!==null&&s!==void 0?s:(a=e.notification)===null||a===void 0?void 0:a.click_action;h&&(t.fcmOptions.link=h);const f=(l=e.fcmOptions)===null||l===void 0?void 0:l.analytics_label;f&&(t.fcmOptions.analyticsLabel=f)}/** 2828 * @license 2829 * Copyright 2019 Google LLC 2830 * 2831 * Licensed under the Apache License, Version 2.0 (the "License"); 2832 * you may not use this file except in compliance with the License. 2833 * You may obtain a copy of the License at 2834 * 2835 * http://www.apache.org/licenses/LICENSE-2.0 2836 * 2837 * Unless required by applicable law or agreed to in writing, software 2838 * distributed under the License is distributed on an "AS IS" BASIS, 2839 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2840 * See the License for the specific language governing permissions and 2841 * limitations under the License. 2842 */function s_(t){return typeof t=="object"&&!!t&&xc in t}/** 2843 * @license 2844 * Copyright 2019 Google LLC 2845 * 2846 * Licensed under the Apache License, Version 2.0 (the "License"); 2847 * you may not use this file except in compliance with the License. 2848 * You may obtain a copy of the License at 2849 * 2850 * http://www.apache.org/licenses/LICENSE-2.0 2851 * 2852 * Unless required by applicable law or agreed to in writing, software 2853 * distributed under the License is distributed on an "AS IS" BASIS, 2854 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2855 * See the License for the specific language governing permissions and 2856 * limitations under the License. 2857 */Bc("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o");Bc("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");function Bc(t,e){const n=[];for(let r=0;r<t.length;r++)n.push(t.charAt(r)),r<e.length&&n.push(e.charAt(r));return n.join("")}/** 2858 * @license 2859 * Copyright 2019 Google LLC 2860 * 2861 * Licensed under the Apache License, Version 2.0 (the "License"); 2862 * you may not use this file except in compliance with the License. 2863 * You may obtain a copy of the License at 2864 * 2865 * http://www.apache.org/licenses/LICENSE-2.0 2866 * 2867 * Unless required by applicable law or agreed to in writing, software 2868 * distributed under the License is distributed on an "AS IS" BASIS, 2869 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2870 * See the License for the specific language governing permissions and 2871 * limitations under the License. 2872 */function o_(t){if(!t||!t.options)throw $i("App Configuration Object");if(!t.name)throw $i("App Name");const e=["projectId","apiKey","appId","messagingSenderId"],{options:n}=t;for(const r of e)if(!n[r])throw $i(r);return{appName:t.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}function $i(t){return re.create("missing-app-config-values",{valueName:t})}/** 2873 * @license 2874 * Copyright 2020 Google LLC 2875 * 2876 * Licensed under the Apache License, Version 2.0 (the "License");
2877 * you may not use this file except in compliance with the License. 2878 * You may obtain a copy of the License at 2879 * 2880 * http://www.apache.org/licenses/LICENSE-2.0 2881 * 2882 * Unless required by applicable law or agreed to in writing, software 2883 * distributed under the License is distributed on an "AS IS" BASIS, 2884 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2885 * See the License for the specific language governing permissions and 2886 * limitations under the License. 2887 */class a_{constructor(e,n,r){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const s=o_(e);this.firebaseDependencies={app:e,appConfig:s,installations:n,analyticsProvider:r}}_delete(){return Promise.resolve()}}/** 2888 * @license 2889 * Copyright 2020 Google LLC 2890 * 2891 * Licensed under the Apache License, Version 2.0 (the "License"); 2892 * you may not use this file except in compliance with the License. 2893 * You may obtain a copy of the License at 2894 * 2895 * http://www.apache.org/licenses/LICENSE-2.0 2896 * 2897 * Unless required by applicable law or agreed to in writing, software 2898 * distributed under the License is distributed on an "AS IS" BASIS, 2899 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2900 * See the License for the specific language governing permissions and 2901 * limitations under the License. 2902 */async function c_(t){try{t.swRegistration=await navigator.serviceWorker.register(Mm,{scope:Lm}),t.swRegistration.update().catch(()=>{})}catch(e){throw re.create("failed-service-worker-registration",{browserErrorMessage:e==null?void 0:e.message})}}/** 2903 * @license 2904 * Copyright 2020 Google LLC 2905 * 2906 * Licensed under the Apache License, Version 2.0 (the "License"); 2907 * you may not use this file except in compliance with the License. 2908 * You may obtain a copy of the License at 2909 * 2910 * http://www.apache.org/licenses/LICENSE-2.0 2911 * 2912 * Unless required by applicable law or agreed to in writing, software 2913 * distributed under the License is distributed on an "AS IS" BASIS, 2914 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2915 * See the License for the specific language governing permissions and 2916 * limitations under the License. 2917 */async function l_(t,e){if(!e&&!t.swRegistration&&await c_(t),!(!e&&t.swRegistration)){if(!(e instanceof ServiceWorkerRegistration))throw re.create("invalid-sw-registration");t.swRegistration=e}}/** 2918 * @license 2919 * Copyright 2020 Google LLC 2920 * 2921 * Licensed under the Apache License, Version 2.0 (the "License"); 2922 * you may not use this file except in compliance with the License. 2923 * You may obtain a copy of the License at 2924 * 2925 * http://www.apache.org/licenses/LICENSE-2.0 2926 * 2927 * Unless required by applicable law or agreed to in writing, software 2928 * distributed under the License is distributed on an "AS IS" BASIS, 2929 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2930 * See the License for the specific language governing permissions and 2931 * limitations under the License. 2932 */async function u_(t,e){e?t.vapidKey=e:t.vapidKey||(t.vapidKey=Uc)}/** 2933 * @license 2934 * Copyright 2020 Google LLC 2935 * 2936 * Licensed under the Apache License, Version 2.0 (the "License"); 2937 * you may not use this file except in compliance with the License. 2938 * You may obtain a copy of the License at 2939 * 2940 * http://www.apache.org/licenses/LICENSE-2.0 2941 * 2942 * Unless required by applicable law or agreed to in writing, software 2943 * distributed under the License is distributed on an "AS IS" BASIS, 2944 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2945 * See the License for the specific language governing permissions and 2946 * limitations under the License. 2947 */async function h_(t,e){if(!navigator)throw re.create("only-available-in-window");if(Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission!=="granted")throw re.create("permission-blocked");return await u_(t,e==null?void 0:e.vapidKey),await l_(t,e==null?void 0:e.serviceWorkerRegistration),Qm(t)}/** 2948 * @license 2949 * Copyright 2019 Google LLC 2950 * 2951 * Licensed under the Apache License, Version 2.0 (the "License");
2952 * you may not use this file except in compliance with the License. 2953 * You may obtain a copy of the License at 2954 * 2955 * http://www.apache.org/licenses/LICENSE-2.0 2956 * 2957 * Unless required by applicable law or agreed to in writing, software 2958 * distributed under the License is distributed on an "AS IS" BASIS, 2959 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2960 * See the License for the specific language governing permissions and 2961 * limitations under the License. 2962 */async function d_(t,e,n){const r=f_(e);(await t.firebaseDependencies.analyticsProvider.get()).logEvent(r,{message_id:n[xc],message_name:n[xm],message_time:n[Fm],message_device_time:Math.floor(Date.now()/1e3)})}function f_(t){switch(t){case Xt.NOTIFICATION_CLICKED:return"notification_open";case Xt.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}/** 2963 * @license 2964 * Copyright 2017 Google LLC 2965 * 2966 * Licensed under the Apache License, Version 2.0 (the "License"); 2967 * you may not use this file except in compliance with the License. 2968 * You may obtain a copy of the License at 2969 * 2970 * http://www.apache.org/licenses/LICENSE-2.0 2971 * 2972 * Unless required by applicable law or agreed to in writing, software 2973 * distributed under the License is distributed on an "AS IS" BASIS, 2974 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2975 * See the License for the specific language governing permissions and 2976 * limitations under the License. 2977 */async function p_(t,e){const n=e.data;if(!n.isFirebaseMessaging)return;t.onMessageHandler&&n.messageType===Xt.PUSH_RECEIVED&&(typeof t.onMessageHandler=="function"?t.onMessageHandler(Fo(n)):t.onMessageHandler.next(Fo(n)));const r=n.data;s_(r)&&r[$m]==="1"&&await d_(t,n.messageType,r)}const $o="@firebase/messaging",jo="0.12.10";/** 2978 * @license 2979 * Copyright 2020 Google LLC 2980 * 2981 * Licensed under the Apache License, Version 2.0 (the "License"); 2982 * you may not use this file except in compliance with the License. 2983 * You may obtain a copy of the License at 2984 * 2985 * http://www.apache.org/licenses/LICENSE-2.0 2986 * 2987 * Unless required by applicable law or agreed to in writing, software 2988 * distributed under the License is distributed on an "AS IS" BASIS, 2989 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2990 * See the License for the specific language governing permissions and 2991 * limitations under the License. 2992 */const g_=t=>{const e=new a_(t.getProvider("app").getImmediate(),t.getProvider("installations-internal").getImmediate(),t.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",n=>p_(e,n)),e},m_=t=>{const e=t.getProvider("messaging").getImmediate();return{getToken:r=>h_(e,r)}};function __(){ee(new z("messaging",g_,"PUBLIC")),ee(new z("messaging-internal",m_,"PRIVATE")),H($o,jo),H($o,jo,"esm2017")}/** 2993 * @license 2994 * Copyright 2020 Google LLC 2995 * 2996 * Licensed under the Apache License, Version 2.0 (the "License"); 2997 * you may not use this file except in compliance with the License. 2998 * You may obtain a copy of the License at 2999 * 3000 * http://www.apache.org/licenses/LICENSE-2.0 3001 * 3002 * Unless required by applicable law or agreed to in writing, software 3003 * distributed under the License is distributed on an "AS IS" BASIS, 3004 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3005 * See the License for the specific language governing permissions and 3006 * limitations under the License. 3007 */async function v_(){try{await Hn()}catch{return!1}return typeof window<"u"&&Tt()&&nr()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}/** 3008 * @license 3009 * Copyright 2017 Google LLC 3010 * 3011 * Licensed under the Apache License, Version 2.0 (the "License"); 3012 * you may not use this file except in compliance with the License. 3013 * You may obtain a copy of the License at 3014 * 3015 * http://www.apache.org/licenses/LICENSE-2.0 3016 * 3017 * Unless required by applicable law or agreed to in writing, software 3018 * distributed under the License is distributed on an "AS IS" BASIS, 3019 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3020 * See the License for the specific language governing permissions and 3021 * limitations under the License. 3022 */function P_(t=st()){return v_().then(e=>{if(!e)throw re.create("unsupported-browser")},e=>{throw re.create("indexed-db-unsupported")}),me(de(t),"messaging").getImmediate()}__();export{Ba as R,S_ as a,I_ as b,Nu as c,st as d,w_ as e,P_ as f,E_ as g,A_ as h,bd as i,b_ as j,C_ as k,Ad as l,k_ as m,H as r,R_ as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.