PageSourceSearch

https://truscope.app/_next/static/chunks/247e0ace80442ce8.js

js truscope.app collected 2026-10-02 01:15:33 UTC 336,279 bytes, 21 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79474,(e,t,r)=>{"use strict";var i=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return i.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},94909,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i={default:function(){return u},getImageProps:function(){return h}};for(var n in i)Object.defineProperty(r,n,{enumerable:!0,get:i[n]});let s=e.r(55682),a=e.r(8927),o=e.r(5500),l=s._(e.r(1948));function h(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let u=o.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},92953,97427,8070,83877,44435,e=>{"use strict";var t,r;let i,n,s;e.i(47167);let a=function(e){let t=[],r=0;for(let i=0;i<e.length;i++){let n=e.charCodeAt(i);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:((64512&n)==55296&&i+1<e.length&&(64512&e.charCodeAt(i+1))==56320?(n=65536+((1023&n)<<10)+(1023&e.charCodeAt(++i)),t[r++]=n>>18|240,t[r++]=n>>12&63|128):t[r++]=n>>12|224,t[r++]=n>>6&63|128),t[r++]=63&n|128)}return t},o=function(e){let t=[],r=0,i=0;for(;r<e.length;){let n=e[r++];if(n<128)t[i++]=String.fromCharCode(n);else if(n>191&&n<224){let s=e[r++];t[i++]=String.fromCharCode((31&n)<<6|63&s)}else if(n>239&&n<365){let s=((7&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[i++]=String.fromCharCode(55296+(s>>10)),t[i++]=String.fromCharCode(56320+(1023&s))}else{let s=e[r++],a=e[r++];t[i++]=String.fromCharCode((15&n)<<12|(63&s)<<6|63&a)}}return t.join("")},l={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:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();let r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let t=0;t<e.length;t+=3){let n=e[t],s=t+1<e.length,a=s?e[t+1]:0,o=t+2<e.length,l=o?e[t+2]:0,h=n>>2,u=(3&n)<<4|a>>4,c=(15&a)<<2|l>>6,d=63&l;!o&&(d=64,s||(c=64)),i.push(r[h],r[u],r[c],r[d])}return i.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(a(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):o(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let r=t?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let t=0;t<e.length;){let n=r[e.charAt(t++)],s=t<e.length?r[e.charAt(t)]:0,a=++t<e.length?r[e.charAt(t)]:64,o=++t<e.length?r[e.charAt(t)]:64;if(++t,null==n||null==s||null==a||null==o)throw new h;let l=n<<2|s>>4;if(i.push(l),64!==a){let e=s<<4&240|a>>2;if(i.push(e),64!==o){let e=a<<6&192|o;i.push(e)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};
1class h extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let u=function(e){let t=a(e);return l.encodeByteArray(t,!0)},c=function(e){return u(e).replace(/\./g,"")},d=function(e){try{return l.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function f(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:e.g}let p=()=>{try{return{config:{apiKey:"AIzaSyB07avalIpRbiwFjOqSguaoxS4lRswNl_U",appId:"1:664962798895:web:81f296bfec93bb7c603dda",authDomain:"biasdetectorextension.firebaseapp.com",databaseURL:"",messagingSenderId:"664962798895",projectId:"biasdetectorextension",storageBucket:"biasdetectorextension.firebasestorage.app"},emulatorHosts:{}}}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},g=e=>p()?.emulatorHosts?.[e],m=e=>{let t=g(e);if(!t)return;let r=t.lastIndexOf(":");if(r<=0||r+1===t.length)throw Error(`Invalid host ${t} with no separate hostname and port!`);let i=parseInt(t.substring(r+1),10);return"["===t[0]?[t.substring(1,r-1),i]:[t.substring(0,r),i]},y=()=>p()?.config,v=e=>p()?.[`_${e}`];class w{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}function E(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function _(e){return(await fetch(e,{credentials:"include"})).ok}function b(e,t){if(e.uid)throw Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let r=t||"demo-project",i=e.iat||0,n=e.sub||e.user_id;if(!n)throw Error("mockUserToken must contain 'sub' or 'user_id' field!");let s={iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:n,user_id:n,firebase:{sign_in_provider:"custom",identities:{}},...e};return[c(JSON.stringify({alg:"none",type:"JWT"})),c(JSON.stringify(s)),""].join(".")}let I={},T=!1;function S(e,t){if("undefined"==typeof window||"undefined"==typeof document||!E(window.location.host)||I[e]===t||I[e]||T)return;function r(e){return`__firebase__banner__${e}`}I[e]=t;let i="__firebase__banner",n=function(){let e={prod:[],emulator:[]};for(let t of Object.keys(I))I[t]?e.emulator.push(t):e.prod.push(t);return e}().prod.length>0;function s(){let e,t,s=(e=document.getElementById(i),t=!1,e||((e=document.createElement("div")).setAttribute("id",i),t=!0),{created:t,element:e}),a=r("text"),o=document.getElementById(a)||document.createElement("span"),l=r("learnmore"),h=document.getElementById(l)||document.createElement("a"),u=r("preprendIcon"),c=document.getElementById(u)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(s.created){let e,t=s.element;t.style.display="flex",t.style.background="#7faaf0",t.style.position="fixed",t.style.bottom="5px",t.style.left="5px",t.style.padding=".5em",t.style.borderRadius="5px",t.style.alignItems="center",h.setAttribute("id",l),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline";let r=((e=document.createElement("span")).style.cursor="pointer",e.style.marginLeft="16px",e.style.fontSize="24px",e.innerHTML=" &times;",e.onclick=()=>{let e;T=!0,(e=document.getElementById(i))&&e.remove()},e);c.setAttribute("width","24"),c.setAttribute("id",u),c.setAttribute("height","24"),c.setAttribute("viewBox","0 0 24 24"),c.setAttribute("fill","none"),c.style.marginLeft="-6px",t.append(c,o,h,r),document.body.appendChild(t)}n?(o.innerText="Preview backend disconnected.",c.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
2<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
3</g>
4<defs>
5<clipPath id="clip0_6013_33858">
6<rect width="24" height="24" fill="white"/>
7</clipPath>
8</defs>`):(c.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
9<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 
912.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
10</g>
11<defs>
12<clipPath id="clip0_6083_34804">
13<rect width="24" height="24" fill="white"/>
14</clipPath>
15</defs>`,o.innerText="Preview backend running in this workspace."),o.setAttribute("id",a)}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",s):s()}function A(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function C(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(A())}function k(){let t=p()?.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(e.g.process)}catch(e){return!1}}function R(){return"undefined"!=typeof window||P()}function P(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function N(){return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent}function O(){let e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function D(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function x(){let e=A();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function L(){return!k()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function M(){return!k()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function U(){try{return"object"==typeof indexedDB}catch(e){return!1}}function F(){return new Promise((e,t)=>{try{let r=!0,i="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(i);n.onsuccess=()=>{n.result.close(),r||self.indexedDB.deleteDatabase(i),e(!0)},n.onupgradeneeded=()=>{r=!1},n.onerror=()=>{t(n.error?.message||"")}}catch(e){t(e)}})}function V(){return"undefined"!=typeof navigator&&!!navigator.cookieEnabled}class B extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,B.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,j.prototype.create)}}class j{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var r,i;let n=t[0]||{},s=`${this.service}/${e}`,a=this.errors[e],o=a?(r=a,i=n,r.replace($,(e,t)=>{let r=i[t];return null!=r?String(r):`<${t}?>`})):"Error",l=`${this.serviceName}: ${o} (${s}).`;return new B(s,l,n)}}let $=/\{\$([^}]+)}/g;function H(e){return JSON.parse(e)}let q=function(e){let t={},r={},i={},n="";try{let s=e.split(".");t=H(d(s[0])||""),r=H(d(s[1])||""),n=s[2],i=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:i,signature:n}},z=function(e){let t=q(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null};function W(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function K(e,t){if(e===t)return!0;let r=Object.keys(e),i=Object.keys(t);for(let n of r){if(!i.includes(n))return!1;let r=e[n],s=t[n];if(G(r)&&G(s)){if(!K(r,s))return!1}else if(r!==s)return!1}for(let e of i)if(!r.includes(e))return!1;return!0}function G(e){return null!==e&&"object"==typeof e}function J(e){let t=[];
15for(let[r,i]of Object.entries(e))Array.isArray(i)?i.forEach(e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(i));return t.length?"&"+t.join("&"):""}function X(e){let t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){let[r,i]=e.split("=");t[decodeURIComponent(r)]=decodeURIComponent(i)}}),t}function Q(e){let t=e.indexOf("?");if(!t)return"";let r=e.indexOf("#",t);return e.substring(t,r>0?r:void 0)}function Y(e,t){let r=new Z(e,t);return r.subscribe.bind(r)}class Z{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(void 0===e&&void 0===t&&void 0===r)throw Error("Missing Observer.");void 0===(i=!function(e,t){if("object"!=typeof e||null===e)return!1;for(let r of t)if(r in e&&"function"==typeof e[r])return!0;return!1}(e,["next","error","complete"])?{next:e,error:t,complete:r}:e).next&&(i.next=ee),void 0===i.error&&(i.error=ee),void 0===i.complete&&(i.complete=ee);let n=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(e){}}),this.observers.push(i),n}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function ee(){}function et(e,t=1e3,r=2){let i=t*Math.pow(r,e),n=Math.round(.5*i*(Math.random()-.5)*2);return Math.min(144e5,i+n)}function er(e){return e&&e._delegate?e._delegate:e}e.s(["Deferred",()=>w,"ErrorFactory",()=>j,"FirebaseError",()=>B,"areCookiesEnabled",()=>V,"base64",()=>l,"base64Decode",()=>d,"base64urlEncodeWithoutPadding",()=>c,"calculateBackoffMillis",()=>et,"createMockUserToken",()=>b,"createSubscribe",()=>Y,"deepEqual",()=>K,"extractQuerystring",()=>Q,"getDefaultAppConfig",()=>y,"getDefaultEmulatorHost",()=>g,"getDefaultEmulatorHostnameAndPort",()=>m,"getExperimentalSetting",()=>v,"getGlobal",()=>f,"getModularInstance",()=>er,"getUA",()=>A,"isBrowser",()=>R,"isBrowserExtension",()=>O,"isCloudWorkstation",()=>E,"isCloudflareWorker",()=>N,"isEmpty",()=>W,"isIE",()=>x,"isIndexedDBAvailable",()=>U,"isMobileCordova",()=>C,"isReactNative",()=>D,"isSafari",()=>L,"isSafariOrWebkit",()=>M,"isWebWorker",()=>P,"issuedAtTime",()=>z,"pingServer",()=>_,"querystring",()=>J,"querystringDecode",()=>X,"updateEmulatorBanner",()=>S,"validateIndexedDBOpenable",()=>F],97427);class ei{constructor(e,t,r){this.name=e,this.instanceFactory=t,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}}let en="[DEFAULT]";class es{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new w;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&e.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){let t=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(r)return null;throw e}if(r)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("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:en})}catch(e){}for(let[e,t]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:r});t.resolve(e)}catch(e){}}}}clearInstance(e=en){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=en){return this.instances.has(e)}getOptions(e=en){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=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`);let i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[e,t]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(e)&&t.resolve(i);return i}onInit(e,t){let r=this.normalizeInstanceIdentifier(t),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);let n=this.instances.get(r);return n&&e(n,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){var r;let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e)===en?void 0:r,options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=en){return this.component?this.component.multipleInstances?e:en:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class ea{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.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);let t=new es(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}e.s(["Component",()=>ei,"ComponentContainer",()=>ea],8070);let eo=[];(t=r||(r={}))[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";let el={debug:r.DEBUG,verbose:r.VERBOSE,info:r.INFO,warn:r.WARN,error:r.ERROR,silent:r.SILENT},eh=r.INFO,eu={[r.DEBUG]:"log",[r.VERBOSE]:"log",[r.INFO]:"info",[r.WARN]:"warn",[r.ERROR]:"error"},ec=(e,t,...r)=>{if(t<e.logLevel)return;let i=new Date().toISOString(),n=eu[t];if(n)console[n](`[${i}]  ${e.name}:`,...r);
15else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class ed{constructor(e){this.name=e,this._logLevel=eh,this._logHandler=ec,this._userLogHandler=null,eo.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in r))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?el[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw 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,r.DEBUG,...e),this._logHandler(this,r.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,r.VERBOSE,...e),this._logHandler(this,r.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,r.INFO,...e),this._logHandler(this,r.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,r.WARN,...e),this._logHandler(this,r.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,r.ERROR,...e),this._logHandler(this,r.ERROR,...e)}}function ef(e){eo.forEach(t=>{t.setLogLevel(e)})}function ep(e,t){for(let i of eo){let n=null;t&&t.level&&(n=el[t.level]),null===e?i.userLogHandler=null:i.userLogHandler=(t,i,...s)=>{let a=s.map(e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(e=>e).join(" ");i>=(n??t.logLevel)&&e({level:r[i].toLowerCase(),message:a,args:s,type:t.name})}}}e.s(["LogLevel",()=>r,"Logger",()=>ed,"setLogLevel",()=>ef,"setUserLogHandler",()=>ep],83877);let eg=new WeakMap,em=new WeakMap,ey=new WeakMap,ev=new WeakMap,ew=new WeakMap,eE={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return em.get(e);if("objectStoreNames"===t)return e.objectStoreNames||ey.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return e_(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function e_(e){if(e instanceof IDBRequest){let t;return(t=new Promise((t,r)=>{let i=()=>{e.removeEventListener("success",n),e.removeEventListener("error",s)},n=()=>{t(e_(e.result)),i()},s=()=>{r(e.error),i()};e.addEventListener("success",n),e.addEventListener("error",s)})).then(t=>{t instanceof IDBCursor&&eg.set(t,e)}).catch(()=>{}),ew.set(t,e),t}if(ev.has(e))return ev.get(e);let t=function(e){if("function"==typeof e)return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(eb(this),t),e_(eg.get(this))}:function(...t){return e_(e.apply(eb(this),t))}:function(t,...r){let i=e.call(eb(this),t,...r);return ey.set(i,t.sort?t.sort():[t]),e_(i)};return e instanceof IDBTransaction&&function(e){if(em.has(e))return;let t=new Promise((t,r)=>{let i=()=>{e.removeEventListener("complete",n),e.removeEventListener("error",s),e.removeEventListener("abort",s)},n=()=>{t(),i()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",n),e.addEventListener("error",s),e.addEventListener("abort",s)});em.set(e,t)}(e),(i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(e,eE):e}(e);return t!==e&&(ev.set(e,t),ew.set(t,e)),t}let eb=e=>ew.get(e);function eI(e,t,{blocked:r,upgrade:i,blocking:n,terminated:s}={}){let a=indexedDB.open(e,t),o=e_(a);return i&&a.addEventListener("upgradeneeded",e=>{i(e_(a.result),e.oldVersion,e.newVersion,e_(a.transaction),e)}),r&&a.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),o.then(e=>{s&&e.addEventListener("close",()=>s()),n&&e.addEventListener("versionchange",e=>n(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}let eT=["get","getKey","getAll","getAllKeys","count"],eS=["put","add","delete","clear"],eA=new Map;function eC(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(eA.get(t))return eA.get(t);let r=t.replace(/FromIndex$/,""),i=t!==r,n=eS.includes(r);if(!(r in(i?IDBIndex:IDBObjectStore).prototype)||!(n||eT.includes(r)))return;let s=async function(e,...t){let s=this.transaction(e,n?"readwrite":"readonly"),a=s.store;
15return i&&(a=a.index(t.shift())),(await Promise.all([a[r](...t),n&&s.done]))[0]};return eA.set(t,s),s}eE={...s=eE,get:(e,t,r)=>eC(e,t)||s.get(e,t,r),has:(e,t)=>!!eC(e,t)||s.has(e,t)},e.s(["openDB",()=>eI],44435);class ek{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{let t;if(t=e.getComponent(),t?.type!=="VERSION")return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(" ")}}let eR="@firebase/app",eP="0.14.6",eN=new ed("@firebase/app"),eO="[DEFAULT]",eD={[eR]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/data-connect":"fire-data-connect","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/ai":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},ex=new Map,eL=new Map,eM=new Map;function eU(e,t){try{e.container.addComponent(t)}catch(r){eN.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function eF(e,t){e.container.addOrOverwriteComponent(t)}function eV(e){let t=e.name;if(eM.has(t))return eN.debug(`There were multiple attempts to register component ${t}.`),!1;for(let r of(eM.set(t,e),ex.values()))eU(r,e);for(let t of eL.values())eU(t,e);return!0}function eB(e,t){let r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function ej(e,t,r=eO){eB(e,t).clearInstance(r)}function e$(e){return void 0!==e.options}function eH(e){return!e$(e)&&("authIdToken"in e||"appCheckToken"in e||"releaseOnDeref"in e||"automaticDataCollectionEnabled"in e)}function eq(e){return null!=e&&void 0!==e.settings}function ez(){eM.clear()}let eW=new j("app","Firebase",{"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
15d-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."});class eK{constructor(e,t,r){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new ei("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 eW.create("app-deleted",{appName:this._name})}}function eG(e,t){let r=d(e.split(".")[1]);null===r?console.error(`FirebaseServerApp ${t} is invalid: second part could not be parsed.`):void 0===JSON.parse(r).exp?console.error(`FirebaseServerApp ${t} is invalid: expiration claim could not be parsed`):1e3*JSON.parse(r).exp-new Date().getTime()<=0&&console.error(`FirebaseServerApp ${t} is invalid: the token has expired.`)}
15class eJ extends eK{constructor(e,t,r,i){const n=void 0===t.automaticDataCollectionEnabled||t.automaticDataCollectionEnabled,s={name:r,automaticDataCollectionEnabled:n};void 0!==e.apiKey?super(e,s,i):super(e.options,s,i),this._serverConfig={automaticDataCollectionEnabled:n,...t},this._serverConfig.authIdToken&&eG(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&eG(this._serverConfig.appCheckToken,"appCheckToken"),this._finalizationRegistry=null,"undefined"!=typeof FinalizationRegistry&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,t.releaseOnDeref=void 0,e1(eR,eP,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,void 0!==e&&null!==this._finalizationRegistry&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){e0(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw eW.create("server-app-deleted")}}function eX(e,t={}){let r=e;"object"!=typeof t&&(t={name:t});let i={name:eO,automaticDataCollectionEnabled:!0,...t},n=i.name;if("string"!=typeof n||!n)throw eW.create("bad-app-name",{appName:String(n)});if(r||(r=y()),!r)throw eW.create("no-options");let s=ex.get(n);if(s)if(K(r,s.options)&&K(i,s.config))return s;else throw eW.create("duplicate-app",{appName:n});let a=new ea(n);for(let e of eM.values())a.addComponent(e);let o=new eK(r,i,a);return ex.set(n,o),o}function eQ(e,t={}){let r;if(R()&&!P())throw eW.create("invalid-server-app-environment");let i=t||{};if(e&&(e$(e)?r=e.options:eH(e)?i=e:r=e),void 0===i.automaticDataCollectionEnabled&&(i.automaticDataCollectionEnabled=!0),r||(r=y()),!r)throw eW.create("no-options");let n={...i,...r};if(void 0!==n.releaseOnDeref&&delete n.releaseOnDeref,void 0!==i.releaseOnDeref&&"undefined"==typeof FinalizationRegistry)throw eW.create("finalization-registry-not-supported",{});let s=""+[...JSON.stringify(n)].reduce((e,t)=>Math.imul(31,e)+t.charCodeAt(0)|0,0),a=eL.get(s);if(a)return a.incRefCount(i.releaseOnDeref),a;let o=new ea(s);for(let e of eM.values())o.addComponent(e);let l=new eJ(r,i,s,o);return eL.set(s,l),l}function eY(e=eO){let t=ex.get(e);if(!t&&e===eO&&y())return eX();if(!t)throw eW.create("no-app",{appName:e});return t}function eZ(){return Array.from(ex.values())}async function e0(e){let t=!1,r=e.name;ex.has(r)?(t=!0,ex.delete(r)):eL.has(r)&&0>=e.decRefCount()&&(eL.delete(r),t=!0),t&&(await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function e1(e,t,r){let i=eD[e]??e;r&&(i+=`-${r}`);let n=i.match(/\s|\//),s=t.match(/\s|\//);if(n||s){let e=[`Unable to register library "${i}" with version "${t}":`];n&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),n&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),eN.warn(e.join(" "));return}eV(new ei(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}function e2(e,t){if(null!==e&&"function"!=typeof e)throw eW.create("invalid-log-argument");ep(e,t)}function e6(e){ef(e)}let e3="firebase-heartbeat-store",e5=null;function e4(){return e5||(e5=eI("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(e3)}catch(e){console.warn(e)}}}).catch(e=>{throw eW.create("idb-open",{originalErrorMessage:e.message})})),e5}async function e8(e){try{let t=(await e4()).transaction(e3),r=await t.objectStore(e3).get(e9(e));return await t.done,r}catch(e){if(e instanceof B)eN.warn(e.message);else{let t=eW.create("idb-get",{originalErrorMessage:e?.message});eN.warn(t.message)}}}async function e7(e,t){try{let r=(await e4()).transaction(e3,"readwrite"),i=r.objectStore(e3);await i.put(t,e9(e)),await r.done}catch(e){if(e instanceof B)eN.warn(e.message);else{let t=eW.create("idb-set",{originalErrorMessage:e?.message});eN.warn(t.message)}}}function e9(e){return`${e.name}!${e.options.appId}`}class te{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new tr(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{let e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=tt();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>30){let e=function(e){if(0===e.length)return -1;let t=0,r=e[0].date;for(let i=1;i<e.length;i++)e[i].date<r&&(r=e[i].date,t=i);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){eN.warn(e)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||0===this._heartbeatsCache.heartbeats.length)return"";let e=tt(),{heartbeatsToSend:t,unsentEntries:r}=function(e,t=1024){let r=[],i=e.slice();for(let n of e){let e=r.find(e=>e.agent===n.agent);if(e){if(e.dates.push(n.date),ti(r)>t){e.dates.pop();break}}else if(r.push({agent:n.agent,dates:[n.date]}),ti(r)>t){r.pop();break}i=i.slice(1)}return{heartbeatsToSend:r,unsentEntries:i}}(this._heartbeatsCache.heartbeats),i=c(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return eN.warn(e),""}}}function tt(){return new Date().toISOString().substring(0,10)}class tr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!U()&&F().then(()=>!0).catch(()=>!1)}async read(){if(!await this._canUseIndexedDBPromise)return{heartbeats:[]};{let e=await e8(this.app);return e?.heartbeats?e:{heartbeats:[]}}}async overwrite(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return e7(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return e7(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function ti(e){return c(JSON.stringify({version:2,heartbeats:e})).length}eV(new ei("platform-logger",e=>new ek(e),"PRIVATE")),eV(new ei("heartbeat",e=>new te(e),"PRIVATE")),e1(eR,eP,""),e1(eR,eP,"esm2020"),e1("fire-js",""),e.s(["SDK_VERSION",()=>"12.6.0","_DEFAULT_ENTRY_NAME",()=>eO,"_addComponent",()=>eU,"_addOrOverwriteComponent",()=>eF,"_apps",()=>ex,"_clearComponents",()=>ez,"_components",()=>eM,"_getProvider",()=>eB,"_isFirebaseApp",()=>e$,"_isFirebaseServerApp",()=>eq,"_isFirebaseServerAppSettings",()=>eH,"_registerComponent",()=>eV,"_removeServiceInstance",()=>ej,"_serverApps",()=>eL,"deleteApp",()=>e0,"getApp",()=>eY,"getApps",()=>eZ,"initializeApp",()=>eX,"initializeServerApp",()=>eQ,"onLog",()=>e2,"registerVersion",()=>e1,"setLogLevel",()=>e6],92953)},51718,18357,e=>{"use strict";var t,r=e.i(92953),i=e.i(97427),n=e.i(83877),s=e.i(8070);function a(){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."}}let o=new i.ErrorFactory("auth","Firebase",a()),l=new n.Logger("@firebase/auth");function h(e,...t){l.logLevel<=n.LogLevel.ERROR&&l.error(`Auth (${r.SDK_VERSION}): ${e}`,...t)}function u(e,...t){throw p(e,...t)}function c(e,...t){return p(e,...t)}function d(e,t,r){let n={...a(),[t]:r};return new i.ErrorFactory("auth","Firebase",n).create(t,{appName:e.n
15ame})}function f(e){return d(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function p(e,...t){if("string"!=typeof e){let r=t[0],i=[...t.slice(1)];return i[0]&&(i[0].appName=e.name),e._errorFactory.create(r,...i)}return o.create(e,...t)}function g(e,t,...r){if(!e)throw p(t,...r)}function m(e){let t="INTERNAL ASSERTION FAILED: "+e;throw h(t),Error(t)}function y(){return"undefined"!=typeof self&&self.location?.href||""}function v(){return"undefined"!=typeof self&&self.location?.protocol||null}class w{constructor(e,t){var r;this.shortDelay=e,this.longDelay=t,r="Short delay should be less than long delay!",t>e||m(r),this.isMobile=(0,i.isMobileCordova)()||(0,i.isReactNative)()}get(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&("http:"===v()||"https:"===v()||(0,i.isBrowserExtension)()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function E(e,t){var r,i;r=e.emulator,i="Emulator should always be set here",r||m(i);let{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class _{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void m("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void m("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void m("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}let b={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-rec
15aptcha-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"},I=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],T=new w(3e4,6e4);function S(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function A(e,t,r,n,s={}){return C(e,s,async()=>{let s={},a={};n&&("GET"===t?a=n:s={body:JSON.stringify(n)});let o=(0,i.querystring)({key:e.config.apiKey,...a}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);let h={method:t,headers:l,...s};return(0,i.isCloudflareWorker)()||(h.referrerPolicy="no-referrer"),e.emulatorConfig&&(0,i.isCloudWorkstation)(e.emulatorConfig.host)&&(h.credentials="include"),_.fetch()(await R(e,e.config.apiHost,r,o),h)})}async function C(e,t,r){e._canInitEmulator=!1;let n={...b,...t};try{let t=new P(e),i=await Promise.race([r(),t.promise]);t.clearNetworkTimeout();let s=await i.json();if("needConfirmation"in s)throw N(e,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{let[t,r]=(i.ok?s.errorMessage:s.error.message).split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===t)throw N(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===t)throw N(e,"email-already-in-use",s);if("USER_DISABLED"===t)throw N(e,"user-disabled",s);let a=n[t]||t.toLowerCase().replace(/[_\s]+/g,"-");if(r)throw d(e,a,r);u(e,a)}}catch(t){if(t instanceof i.FirebaseError)throw t;u(e,"network-request-failed",{message:String(t)})}}async function k(e,t,r,i,n={}){let s=await A(e,t,r,i,n);return"mfaPendingCredential"in s&&u(e,"multi-factor-auth-required",{_serverResponse:s}),s}async function R(e,t,r,i){let n=`${t}${r}?${i}`,s=e.config.emulator?E(e.config,n):`${e.config.apiScheme}://${n}`;return I.includes(r)&&(await e._persistenceManagerAvailable,"COOKIE"===e._getPersistenceType())?e._getPersistence()._getFinalTarget(s).toString():s}class P{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(c(this.auth,"network-request-failed")),T.get())})}}function N(e,t,r){let i={appName:e.name};r.email&&(i.email=r.email),r.phoneNumber&&(i.phoneNumber=r.phoneNumber);let n=c(e,t,i);return n.customData._tokenResponse=r,n}function O(e){return void 0!==e&&void 0!==e.enterprise}class D{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)switch(t.enforcementState){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function x(e,t){return A(e,"GET","/v2/recaptchaConfig",S(e,t))}async function L(e,t){return A(e,"POST","/v1/accounts:delete",t)}async function M(e,t){return A(e,"POST","/v1/accounts:lookup",t)}function U(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function F(e,t=!1){let r=(0,i.getModularInstance)(e),n=await r.getIdToken(t),s=B(n);g(s&&s.exp&&s.auth_time&&s.iat,r.auth,"internal-error");let a="object"==typeof s.firebase?s.firebase:void 0,o=a?.sign_in_provider;return{claims:s,token:n,authTime:U(V(s.auth_time)),issuedAtTime:U(V(s.iat)),expirationTime:U(V(s.exp
15)),signInProvider:o||null,signInSecondFactor:a?.sign_in_second_factor||null}}function V(e){return 1e3*Number(e)}function B(e){let[t,r,n]=e.split(".");if(void 0===t||void 0===r||void 0===n)return h("JWT malformed, contained fewer than 3 sections"),null;try{let e=(0,i.base64Decode)(r);if(!e)return h("Failed to decode base64 JWT payload"),null;return JSON.parse(e)}catch(e){return h("Caught error parsing JWT payload as JSON",e?.toString()),null}}function j(e){let t=B(e);return g(t,"internal-error"),g(void 0!==t.exp,"internal-error"),g(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function $(e,t,r=!1){if(r)return t;try{return await t}catch(t){throw t instanceof i.FirebaseError&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class H{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,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(!e)return this.errorBackoff=3e4,Math.max(0,(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5);{let e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}class q{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=U(this.lastLoginAt),this.creationTime=U(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function z(e){var t,r;let i=e.auth,n=await e.getIdToken(),s=await $(e,M(i,{idToken:n}));g(s?.users.length,i,"internal-error");let a=s.users[0];e._notifyReloadListener(a);let o=a.providerUserInfo?.length?K(a.providerUserInfo):[],l=(t=e.providerData,r=o,[...t.filter(e=>!r.some(t=>t.providerId===e.providerId)),...r]),h=e.isAnonymous,u=!(e.email&&a.passwordHash)&&!l?.length;Object.assign(e,{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:l,metadata:new q(a.createdAt,a.lastLoginAt),isAnonymous:!!h&&u})}async function W(e){let t=(0,i.getModularInstance)(e);await z(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function K(e){return e.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}async function G(e,t){let r=await C(e,{},async()=>{let r=(0,i.querystring)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:n,apiKey:s}=e.config,a=await R(e,n,"/v1/token",`key=${s}`),o=await e._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";let l={method:"POST",headers:o,body:r};return e.emulatorConfig&&(0,i.isCloudWorkstation)(e.emulatorConfig.host)&&(l.credentials="include"),_.fetch()(a,l)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function J(e,t){return A(e,"POST","/v2/accounts:revokeToken",S(e,t))}class X{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){g(e.idToken,"internal-error"),g(void 0!==e.idToken,"internal-error"),g(void 0!==e.refreshToken,"internal-error");let t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):j(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){g(0!==e.length,"internal-error");let t=j(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(g(this.refreshToken,e,"user-token-expired"),this.refreshToken)?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:r,refreshToken:i,expiresIn:n}=await G(e,t);this.updateTokensAndExpiration(r,i,Number(n))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*r}static fromJSON(e,t){let{refreshToken:r,accessToken:i,expirationTime:n}=t,s=new X;return r&&(g("string"==typeof r,"internal-error",{appName:e}),s.refreshToken=r),i&&(g("string"==typeof i,"internal-error",{appName:e}),s.accessToken=i),n&&(g("number"==typeof n,"internal-error",{appName:e}),s.expirationTime=n),s}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 X,this.toJSON())}_performRefresh(){return m("not implemented")}}function Q(e,t){g("string"==typeof e||void 0===e,"internal-error",{appName:t})}class Y{constructor({uid:e,auth:t,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new H(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new q(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let t=await $(this,this.stsTokenManager.getToken(this.auth,e));return g(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return F(this,e)}reload(){return W(this)}_assign(e){this!==e&&(g(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
15otoURL,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(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new Y({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){g(!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,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await z(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if((0,r._isFirebaseServerApp)(this.auth.app))return Promise.reject(f(this.auth));let e=await this.getIdToken();return await $(this,L(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...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,t){let r=t.displayName??void 0,i=t.email??void 0,n=t.phoneNumber??void 0,s=t.photoURL??void 0,a=t.tenantId??void 0,o=t._redirectEventId??void 0,l=t.createdAt??void 0,h=t.lastLoginAt??void 0,{uid:u,emailVerified:c,isAnonymous:d,providerData:f,stsTokenManager:p}=t;g(u&&p,e,"internal-error");let m=X.fromJSON(this.name,p);g("string"==typeof u,e,"internal-error"),Q(r,e.name),Q(i,e.name),g("boolean"==typeof c,e,"internal-error"),g("boolean"==typeof d,e,"internal-error"),Q(n,e.name),Q(s,e.name),Q(a,e.name),Q(o,e.name),Q(l,e.name),Q(h,e.name);let y=new Y({uid:u,auth:e,email:i,emailVerified:c,displayName:r,isAnonymous:d,photoURL:s,phoneNumber:n,tenantId:a,stsTokenManager:m,createdAt:l,lastLoginAt:h});return f&&Array.isArray(f)&&(y.providerData=f.map(e=>({...e}))),o&&(y._redirectEventId=o),y}static async _fromIdTokenResponse(e,t,r=!1){let i=new X;i.updateFromServerResponse(t);let n=new Y({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await z(n),n}static async _fromGetAccountInfoResponse(e,t,r){let i=t.users[0];g(void 0!==i.localId,"internal-error");let n=void 0!==i.providerUserInfo?K(i.providerUserInfo):[],s=!(i.email&&i.passwordHash)&&!n?.length,a=new X;a.updateFromIdToken(r);let o=new Y({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:s});return Object.assign(o,{uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:n,metadata:new q(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!n?.length}),o}}let Z=new Map;function ee(e){var t,r;t="Expected a class definition",e instanceof Function||m(t);let i=Z.get(e);return i?(r="Instance stored in cache mismatched with class",i instanceof e||m(r)):(i=new e,Z.set(e,i)),i}class et{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}function er(e,t,r){return`firebase:${e}:${t}:${r}`}et.type="NONE";class ei{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:n}=this.auth;this.fullUserKey=er(this.userKey,i.apiKey,n),this.fullPersistenceKey=er("persistence",i.apiKey,n),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){let t=await M(this.auth,{idToken:e}).catch(()=>void 0);return t?Y._fromGetAccountInfoResponse(this.auth,t,e):null}return Y._fromJSON(this.auth,e)}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;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new ei(ee(et),e,r);let i=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),n=i[0]||ee(et),s=er(r,e.config.apiKey,e.name),a=null;for(let r of t)try{let t=await r._get(s);if(t){let i;if("string"==typeof t){let r=await M(e,{idToken:t}).catch(()=>void 0);if(!r)break;
15i=await Y._fromGetAccountInfoResponse(e,r,t)}else i=Y._fromJSON(e,t);r!==n&&(a=i),n=r;break}}catch{}let o=i.filter(e=>e._shouldAllowMigration);return n._shouldAllowMigration&&o.length&&(n=o[0],a&&await n._set(s,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==n)try{await e._remove(s)}catch{}}))),new ei(n,e,r)}}function en(e){let t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";{if(el(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(es(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(eu(t))return"Blackberry";if(ec(t))return"Webos";if(ea(t))return"Safari";if((t.includes("chrome/")||eo(t))&&!t.includes("edge/"))return"Chrome";if(eh(t))return"Android";let r=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(r?.length===2)return r[1]}return"Other"}function es(e=(0,i.getUA)()){return/firefox\//i.test(e)}function ea(e=(0,i.getUA)()){let t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function eo(e=(0,i.getUA)()){return/crios\//i.test(e)}function el(e=(0,i.getUA)()){return/iemobile/i.test(e)}function eh(e=(0,i.getUA)()){return/android/i.test(e)}function eu(e=(0,i.getUA)()){return/blackberry/i.test(e)}function ec(e=(0,i.getUA)()){return/webos/i.test(e)}function ed(e=(0,i.getUA)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function ef(e=(0,i.getUA)()){return ed(e)||eh(e)||ec(e)||eu(e)||/windows phone/i.test(e)||el(e)}function ep(e,t=[]){let n;switch(e){case"Browser":n=en((0,i.getUA)());break;case"Worker":n=`${en((0,i.getUA)())}-${e}`;break;default:n=e}let s=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${r.SDK_VERSION}/${s}`}class eg{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let r=t=>new Promise((r,i)=>{try{let i=e(t);r(i)}catch(e){i(e)}});r.onAbort=t,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(e){for(let e of(t.reverse(),t))try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:e?.message})}}}async function em(e,t={}){return A(e,"GET","/v2/passwordPolicy",S(e,t))}class ey{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){let t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let r;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,n){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=n))}}
15class ev{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new eE(this),this.idTokenSubscription=new eE(this),this.beforeStateQueue=new eg(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=o,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ee(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){if(this.persistenceManager=await ei.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let 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{let t=await M(this,{idToken:e}),r=await Y._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if((0,r._isFirebaseServerApp)(this.app)){let e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}let t=await this.assertedPersistence.getCurrentUser(),i=t,n=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let t=this.redirectUser?._redirectEventId,r=i?._redirectEventId,s=await this.tryRedirectSignIn(e);(!t||t===r)&&s?.user&&(i=s.user,n=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(n)try{await this.beforeStateQueue.runMiddleware(i)}catch(e){i=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return(g(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId)?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await z(e)}catch(e){if(e?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;let e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if((0,r._isFirebaseServerApp)(this.app))return Promise.reject(f(this));let t=e?(0,i.getModularInstance)(e):null;return t&&g(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&g(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return(0,r._isFirebaseServerApp)(this.app)?Promise.reject(f(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return(0,r._isFirebaseServerApp)(this.app)?Promise.reject(f(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ee(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=new ey(await em(this));null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new i.ErrorFactory("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>
15{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await J(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){let r=await this.getOrInitRedirectPersistenceManager(t);return null===e?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&ee(e)||this._popupRedirectResolver;g(t,this,"argument-error"),this.redirectPersistenceManager=await ei.create(this,[ee(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return(this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e)?this._currentUser:this.redirectUser?._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(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};let n="function"==typeof t?t:t.next.bind(t),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(g(a,this,"internal-error"),a.then(()=>{s||n(this.currentUser)}),"function"==typeof t){let n=e.addObserver(t,r,i);return()=>{s=!0,n()}}{let r=e.addObserver(t);return()=>{s=!0,r()}}}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 g(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ep(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){let e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);let t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e["X-Firebase-Client"]=t);let r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if((0,r._isFirebaseServerApp)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&function(e,...t){l.logLevel<=n.LogLevel.WARN&&l.warn(`Auth (${r.SDK_VERSION}): ${e}`,...t)}(`Error while retrieving App Check token: ${e.error}`),e?.token}}function ew(e){return(0,i.getModularInstance)(e)}class eE{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,i.createSubscribe)(e=>this.observer=e)}get next(){return g(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let e_={async loadJS(){throw Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function eb(e){return`__${e}${Math.floor(1e6*Math.random())}`}class eI{constructor(){this.enterprise=new eT}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class eT{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}let eS="NO_RECAPTCHA";class eA{constructor(e){this.type="recaptcha-enterprise",this.auth=ew(e)}async verify(e="verify",t=!1){async function r(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,r)=>
15{x(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(i=>{if(void 0===i.recaptchaKey)r(Error("recaptcha Enterprise site key undefined"));else{let r=new D(i);return null==e.tenantId?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,t(r.siteKey)}}).catch(e=>{r(e)})})}function i(t,r,i){let n=window.grecaptcha;O(n)?n.enterprise.ready(()=>{n.enterprise.execute(t,{action:e}).then(e=>{r(e)}).catch(()=>{r(eS)})}):i(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new eI().execute("siteKey",{action:"verify"}):new Promise((e,n)=>{r(this.auth).then(r=>{if(!t&&O(window.grecaptcha))i(r,e,n);else{var s;if("undefined"==typeof window)return void n(Error("RecaptchaVerifier is only supported in browser"));let t=e_.recaptchaEnterpriseScript;0!==t.length&&(t+=r),(s=t,e_.loadJS(s)).then(()=>{i(r,e,n)}).catch(e=>{n(e)})}}).catch(e=>{n(e)})})}}async function eC(e,t,r,i=!1,n=!1){let s,a=new eA(e);if(n)s=eS;else try{s=await a.verify(r)}catch(e){s=await a.verify(r,!0)}let o={...t};if("mfaSmsEnrollment"===r||"mfaSmsSignIn"===r){if("phoneEnrollmentInfo"in o){let e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){let e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return i?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function ek(e,t,r,i,n){if("EMAIL_PASSWORD_PROVIDER"===n)if(!e._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER"))return i(e,t).catch(async n=>{if("auth/missing-recaptcha-token"!==n.code)return Promise.reject(n);{console.log(`${r} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let n=await eC(e,t,r,"getOobCode"===r);return i(e,n)}});else{let n=await eC(e,t,r,"getOobCode"===r);return i(e,n)}if("PHONE_PROVIDER"!==n)return Promise.reject(n+" provider is not supported.");if(e._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){let n=await eC(e,t,r);return i(e,n).catch(async n=>{if(e._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&("auth/missing-recaptcha-token"===n.code||"auth/invalid-app-credential"===n.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${r} flow.`);let n=await eC(e,t,r,!1,!0);return i(e,n)}return Promise.reject(n)})}{let n=await eC(e,t,r,!1,!0);return i(e,n)}}async function eR(e){let t=ew(e),r=new D(await x(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}));null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isAnyProviderEnabled()&&new eA(t).verify()}function eP(e){let t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function eN(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}class eO{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return m("not implemented")}_getIdTokenResponse(e){return m("not implemented")}_linkToIdToken(e,t){return m("not implemented")}_getReauthenticationResolver(e){return m("not implemented")}}async function eD(e,t){return A(e,"POST","/v1/accounts:resetPassword",S(e,t))}async function ex(e,t){return A(e,"POST","/v1/accounts:update",t)}async function eL(e,t){return A(e,"POST","/v1/accounts:signUp",t)}async function eM(e,t){return k(e,"POST","/v1/accounts:signInWithPassword",S(e,t))}async function eU(e,t){return A(e,"POST","/v1/accounts:sendOobCode",S(e,t))}async function eF(e,t){return eU(e,t)}async function eV(e,t){return k(e,"POST","/v1/accounts:signInWithEmailLink",S(e,t))}async function eB(e,t){return k(e,"POST","/v1/accounts:signInWithEmailLink",S(e,t))}class ej extends eO{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new ej(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new ej(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);else if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return ek(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",eM,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return eV(e,{email:this._email,oobCode:this._password});default:u(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return ek(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",eL,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return eB(e,{idToken:t,email:this._email,oobCode:this._password});default:u(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function e$(e,t){return k(e,"POST","/v1/accounts:signInWithIdp",S(e,t))}class eH extends eO{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new eH(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&
15(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):u("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let{providerId:t,signInMethod:r,...i}="string"==typeof e?JSON.parse(e):e;if(!t||!r)return null;let n=new eH(t,r);return n.idToken=i.idToken||void 0,n.accessToken=i.accessToken||void 0,n.secret=i.secret,n.nonce=i.nonce,n.pendingToken=i.pendingToken||null,n}_getIdTokenResponse(e){return e$(e,this.buildRequest())}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,e$(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,e$(e,t)}buildRequest(){let e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,i.querystring)(t)}return e}}async function eq(e,t){return A(e,"POST","/v1/accounts:sendVerificationCode",S(e,t))}async function ez(e,t){return k(e,"POST","/v1/accounts:signInWithPhoneNumber",S(e,t))}async function eW(e,t){let r=await k(e,"POST","/v1/accounts:signInWithPhoneNumber",S(e,t));if(r.temporaryProof)throw N(e,"account-exists-with-different-credential",r);return r}let eK={USER_NOT_FOUND:"user-not-found"};async function eG(e,t){return k(e,"POST","/v1/accounts:signInWithPhoneNumber",S(e,{...t,operation:"REAUTH"}),eK)}class eJ extends eO{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new eJ({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new eJ({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return ez(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return eW(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return eG(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:i}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:i}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));let{verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:n}=e;return r||t||i||n?new eJ({verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:n}):null}}class eX{constructor(e){const t=(0,i.querystringDecode)((0,i.extractQuerystring)(e)),r=t.apiKey??null,n=t.oobCode??null,s=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(t.mode??null);g(r&&n&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=n,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){let t,r,n,s=(r=(t=(0,i.querystringDecode)((0,i.extractQuerystring)(e)).link)?(0,i.querystringDecode)((0,i.extractQuerystring)(t)).deep_link_id:null,((n=(0,i.querystringDecode)((0,i.extractQuerystring)(e)).deep_link_id)?(0,i.querystringDecode)((0,i.extractQuerystring)(n)).link:null)||n||r||t||e);try{return new eX(s)}catch{return null}}}class eQ{constructor(){this.providerId=eQ.PROVIDER_ID}static credential(e,t){return ej._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let r=eX.parseLink(t);return g(r,"argument-error"),ej._fromEmailAndCode(e,r.code,r.tenantId)}}eQ.PROVIDER_ID="password",eQ.EMAIL_PASSWORD_SIGN_IN_METHOD="password",eQ.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class eY{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}}class eZ extends eY{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class e0 extends eZ{constructor(){super("facebook.com")}static credential(e){return eH._fromParams({providerId:e0.PROVIDER_ID,signInMethod:e0.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return e0.credentialFromTaggedObject(e)}static credentialFromError(e){return e0.credentialFromTaggedObject(e.customData||{})}
15static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return e0.credential(e.oauthAccessToken)}catch{return null}}}e0.FACEBOOK_SIGN_IN_METHOD="facebook.com",e0.PROVIDER_ID="facebook.com";class e1 extends eZ{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return eH._fromParams({providerId:e1.PROVIDER_ID,signInMethod:e1.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return e1.credentialFromTaggedObject(e)}static credentialFromError(e){return e1.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return e1.credential(t,r)}catch{return null}}}e1.GOOGLE_SIGN_IN_METHOD="google.com",e1.PROVIDER_ID="google.com";class e2 extends eZ{constructor(){super("github.com")}static credential(e){return eH._fromParams({providerId:e2.PROVIDER_ID,signInMethod:e2.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return e2.credentialFromTaggedObject(e)}static credentialFromError(e){return e2.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return e2.credential(e.oauthAccessToken)}catch{return null}}}e2.GITHUB_SIGN_IN_METHOD="github.com",e2.PROVIDER_ID="github.com";class e6 extends eZ{constructor(){super("twitter.com")}static credential(e,t){return eH._fromParams({providerId:e6.PROVIDER_ID,signInMethod:e6.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return e6.credentialFromTaggedObject(e)}static credentialFromError(e){return e6.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return e6.credential(t,r)}catch{return null}}}async function e3(e,t){return k(e,"POST","/v1/accounts:signUp",S(e,t))}e6.TWITTER_SIGN_IN_METHOD="twitter.com",e6.PROVIDER_ID="twitter.com";class e5{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){return new e5({user:await Y._fromIdTokenResponse(e,r,i),providerId:e4(r),_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){return await e._updateTokensIfNecessary(r,!0),new e5({user:e,providerId:e4(r),_tokenResponse:r,operationType:t})}}function e4(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}
15class e8 extends i.FirebaseError{constructor(e,t,r,i){super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,e8.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new e8(e,t,r,i)}}function e7(e,t,r,i){return("reauthenticate"===t?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(r=>{if("auth/multi-factor-auth-required"===r.code)throw e8._fromErrorAndOperation(e,r,t,i);throw r})}async function e9(e,t,r=!1){let i=await $(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return e5._forOperation(e,"link",i)}async function te(e,t,i=!1){let{auth:n}=e;if((0,r._isFirebaseServerApp)(n.app))return Promise.reject(f(n));let s="reauthenticate";try{let r=await $(e,e7(n,s,t,e),i);g(r.idToken,n,"internal-error");let a=B(r.idToken);g(a,n,"internal-error");let{sub:o}=a;return g(e.uid===o,n,"user-mismatch"),e5._forOperation(e,s,r)}catch(e){throw e?.code==="auth/user-not-found"&&u(n,"user-mismatch"),e}}async function tt(e,t,i=!1){if((0,r._isFirebaseServerApp)(e.app))return Promise.reject(f(e));let n="signIn",s=await e7(e,n,t),a=await e5._fromIdTokenResponse(e,n,s);return i||await e._updateCurrentUser(a.user),a}async function tr(e,t){return tt(ew(e),t)}async function ti(e,t){return te((0,i.getModularInstance)(e),t)}class tn{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?ts._fromServerResponse(e,t):"totpInfo"in t?ta._fromServerResponse(e,t):u(e,"internal-error")}}class ts extends tn{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new ts(t)}}class ta extends tn{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new ta(t)}}async function to(e){let t=ew(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function tl(e,t,r){let i=ew(e),n={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};r&&(g(r.url?.length>0,i,"invalid-continue-uri"),g(void 0===r.dynamicLinkDomain||r.dynamicLinkDomain.length>0,i,"invalid-dynamic-link-domain"),g(void 0===r.linkDomain||r.linkDomain.length>0,i,"invalid-hosting-link-domain"),n.continueUrl=r.url,n.dynamicLinkDomain=r.dynamicLinkDomain,n.linkDomain=r.linkDomain,n.canHandleCodeInApp=r.handleCodeInApp,r.iOS&&(g(r.iOS.bundleId.length>0,i,"missing-ios-bundle-id"),n.iOSBundleId=r.iOS.bundleId),r.android&&(g(r.android.packageName.length>0,i,"missing-android-pkg-name"),n.androidInstallApp=r.android.installApp,n.androidMinimumVersionCode=r.android.minimumVersion,n.androidPackageName=r.android.packageName)),await ek(i,n,"getOobCode",eF,"EMAIL_PASSWORD_PROVIDER")}async function th(e,t,r){await eD((0,i.getModularInstance)(e),{oobCode:t,newPassword:r}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&to(e),t})}async function tu(e,t){let r=(0,i.getModularInstance)(e),n=await eD(r,{oobCode:t}),s=n.requestType;switch(g(s,r,"internal-error"),s){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":g(n.newEmail,r,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":g(n.mfaInfo,r,"internal-error");default:g(n.email,r,"internal-error")}let a=null;return n.mfaInfo&&(a=tn._fromServerResponse(ew(r),n.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===n.requestType?n.newEmail:n.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===n.requestType?n.email:n.newEmail)||null,multiFactorInfo:a},operation:s}}async function tc(e,t){let{data:r}=await tu((0,i.getModularInstance)(e),t);return r.email}async function td(e,t,i){if((0,r._isFirebaseServerApp)(e.app))return Promise.reject(f(e));let n=ew(e),s=ek(n,{returnSecureToken:!0,email:t,password:i,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",e3,"EMAIL_PASSWORD_PROVIDER"),a=await s.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&to(e),t}),o=await e5._fromIdTokenResponse(n,"signIn",a);return await n._updateCurrentUser(o.user),o}function tf(e,t,n){return(0,r._isFirebaseServerApp)(e.app)?Promise.reject(f(e)):tr((0,i.getModularInstance)(e),eQ.credential(t,n)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&to(e),t})}function tp(e,t){return tg((0,i.getModularInstance)(e),null,t)}async function tg(e,t,r){let{auth:i}=e,n={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(n.email=t),r&&(n.password=r);let s=await $(e,ex(i,n));await e._updateTokensIfNecessary(s,!0)}function tm(e,t,r,n){return(0,i.getModularInstance)(e).onAuthStateChanged(t,r,n)}function ty(e){return(0,i.getModularInstance)(e).signOut()}function tv(e,t){return A(e,"POST","/v2/accounts/mfaEnrollment:start",S(e,t))}new WeakMap;let tw="__sak";class tE{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(tw,"1"),this.storage.removeItem(tw),Promise.resolve(!0)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class t_ extends tE{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ef(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}
15onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,r)=>{this.notifyListeners(e,r)});let r=e.key;t?this.detachListener():this.stopPolling();let n=()=>{let e=this.storage.getItem(r);(t||this.localCache[r]!==e)&&this.notifyListeners(r,e)},s=this.storage.getItem(r);(0,i.isIE)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(n,10):n()}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let e of Array.from(r))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(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(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}t_.type="LOCAL";class tb extends tE{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}tb.type="SESSION";class tI{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;let r=new tI(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let{eventId:t,eventType:r,data:i}=e.data,n=this.handlersMap[r];if(!n?.size)return;e.ports[0].postMessage({status:"ack",eventId:t,eventType:r});let s=Array.from(n).map(async t=>t(e.origin,i)),a=await Promise.all(s.map(async e=>{try{let t=await e;return{fulfilled:!0,value:t}}catch(e){return{fulfilled:!1,reason:e}}}));e.ports[0].postMessage({status:"done",eventId:t,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function tT(e="",t=10){let r="";for(let e=0;e<t;e++)r+=Math.floor(10*Math.random());return e+r}tI.receivers=[];class tS{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,t,r=50){let i,n,s="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!s)throw Error("connection_unavailable");return new Promise((a,o)=>{let l=tT("",20);s.port1.start();let h=setTimeout(()=>{o(Error("unsupported_event"))},r);n={messageChannel:s,onMessage(e){if(e.data.eventId===l)switch(e.data.status){case"ack":clearTimeout(h),i=setTimeout(()=>{o(Error("timeout"))},3e3);break;case"done":clearTimeout(i),a(e.data.response);break;default:clearTimeout(h),clearTimeout(i),o(Error("invalid_response"))}}},this.handlers.add(n),s.port1.addEventListener("message",n.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[s.port2])}).finally(()=>{n&&this.removeMessageHandler(n)})}}function tA(){return window}function tC(){return void 0!==tA().WorkerGlobalScope&&"function"==typeof tA().importScripts}async function tk(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}let tR="firebaseLocalStorageDb",tP="firebaseLocalStorage",tN="fbase_key";class tO{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>
15{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function tD(e,t){return e.transaction([tP],t?"readwrite":"readonly").objectStore(tP)}function tx(){let e=indexedDB.open(tR,1);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{let t=e.result;try{t.createObjectStore(tP,{keyPath:tN})}catch(e){r(e)}}),e.addEventListener("success",async()=>{let r=e.result;r.objectStoreNames.contains(tP)?t(r):(r.close(),await new tO(indexedDB.deleteDatabase(tR)).toPromise(),t(await tx()))})})}async function tL(e,t,r){return new tO(tD(e,!0).put({[tN]:t,value:r})).toPromise()}async function tM(e,t){let r=tD(e,!1).get(t),i=await new tO(r).toPromise();return void 0===i?null:i.value}function tU(e,t){return new tO(tD(e,!0).delete(t)).toPromise()}class tF{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=await tx()),this.db}async _withRetries(e){let t=0;for(;;)try{let t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return tC()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=tI._getInstance(tC()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await tk(),!this.activeServiceWorker)return;this.sender=new tS(this.activeServiceWorker);let e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await tx();return await tL(e,tw,"1"),await tU(e,tw),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>tL(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>tM(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>tU(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new tO(tD(e,!1).getAll()).toPromise());if(!e||0!==this.pendingWrites)return[];let t=[],r=new Set;if(0!==e.length)for(let{fbase_key:i,value:n}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(n)&&(this.notifyListeners(i,n),t.push(i));for(let e of Object.keys(this.localCache))this.localCache[e]&&!r.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let e of Array.from(r))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}function tV(e,t){return A(e,"POST","/v2/accounts/mfaSignIn:start",S(e,t))}tF.type="LOCAL",eb("rcb"),new w(3e4,6e4);let tB="recaptcha";async function tj(e,t,r){if(!e._getRecaptchaConfig())try{await eR(e)}catch(e){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let i;if(i="string"==typeof t?{phoneNumber:t}
15:t,"session"in i){let t=i.session;if("phoneNumber"in i){g("enroll"===t.type,e,"internal-error");let n={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:i.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},s=async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===eS){g(r?.type===tB,e,"argument-error");let i=await t$(e,t,r);return tv(e,i)}return tv(e,t)},a=ek(e,n,"mfaSmsEnrollment",s,"PHONE_PROVIDER");return(await a.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{g("signin"===t.type,e,"internal-error");let n=i.multiFactorHint?.uid||i.multiFactorUid;g(n,e,"missing-multi-factor-info");let s={mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},a=async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===eS){g(r?.type===tB,e,"argument-error");let i=await t$(e,t,r);return tV(e,i)}return tV(e,t)},o=ek(e,s,"mfaSmsSignIn",a,"PHONE_PROVIDER");return(await o.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{let t={phoneNumber:i.phoneNumber,clientType:"CLIENT_TYPE_WEB"},n=async(e,t)=>{if(t.captchaResponse===eS){g(r?.type===tB,e,"argument-error");let i=await t$(e,t,r);return eq(e,i)}return eq(e,t)},s=ek(e,t,"sendVerificationCode",n,"PHONE_PROVIDER");return(await s.catch(e=>Promise.reject(e))).sessionInfo}}finally{r?._reset()}}async function t$(e,t,r){g(r.type===tB,e,"argument-error");let i=await r.verify();g("string"==typeof i,e,"argument-error");let n={...t};if("phoneEnrollmentInfo"in n){let e=n.phoneEnrollmentInfo.phoneNumber,t=n.phoneEnrollmentInfo.captchaResponse,r=n.phoneEnrollmentInfo.clientType,s=n.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(n,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:i,captchaResponse:t,clientType:r,recaptchaVersion:s}}),n}if(!("phoneSignInInfo"in n))return Object.assign(n,{recaptchaToken:i}),n;{let e=n.phoneSignInInfo.captchaResponse,t=n.phoneSignInInfo.clientType,r=n.phoneSignInInfo.recaptchaVersion;return Object.assign(n,{phoneSignInInfo:{recaptchaToken:i,captchaResponse:e,clientType:t,recaptchaVersion:r}}),n}}class tH{constructor(e){this.providerId=tH.PROVIDER_ID,this.auth=ew(e)}verifyPhoneNumber(e,t){return tj(this.auth,e,(0,i.getModularInstance)(t))}static credential(e,t){return eJ._fromVerification(e,t)}static credentialFromResult(e){return tH.credentialFromTaggedObject(e)}static credentialFromError(e){return tH.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:r}=e;return t&&r?eJ._fromTokenResponse(t,r):null}}function tq(e,t){return t?ee(t):(g(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}tH.PROVIDER_ID="phone",tH.PHONE_SIGN_IN_METHOD="phone";class tz extends eO{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return e$(e,this._buildIdpRequest())}_linkToIdToken(e,t){return e$(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return e$(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={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&&(t.idToken=e),t}}function tW(e){return tt(e.auth,new tz(e),e.bypassAuthState)}function tK(e){let{auth:t,user:r}=e;return g(r,t,"internal-error"),te(r,new tz(e),e.bypassAuthState)}async function tG(e){let{auth:t,user:r}=e;return g(r,t,"internal-error"),e9(r,new tz(e),e.bypassAuthState)}class tJ{constructor(e,t,r,i,n=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=n,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:r,postBody:i,tenantId:n,error:s,type:a}=e;if(s)return void this.reject(s);let o={auth:this.auth,requestUri:t,sessionId:r,tenantId:n||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return tW;case"linkViaPopup":case"linkViaRedirect":return tG;case"reauthViaPopup":case"reauthViaRedirect":return tK;default:u(this.auth,"internal-error")}}resolve(e){var t,r;t=this.pendingPromise,r="Pending promise was never set",t||m(r),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){var t,r;t=this.pendingPromise,r="Pending promise was never set",t||m(r),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}let tX=new w(2e3,1e4);async function tQ(e,t,i){if((0,r._isFirebaseServerApp)(e.app))return Promise.reject(c(e,"operation-not-supported-in-this-environment"));let n=ew(e);if(!(t instanceof eY))throw eY.name!==t.constructor.name&&u(e,"argument-error"),d(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`);let s=tq(n,i);return new tY(n,"signInViaPopup",t,s).executeNotNull()}class tY extends tJ{constructor(e,t,r,i,n){super(e,t,i,n),this.provider=r,this.authWindow=null,this.pollId=null,tY.currentPopupAction&&tY.currentPopupAction.cancel(),tY.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return g(e,this.auth,"internal-error"),e}async onExecution(){var e,t;e=1===this.filter.length,t="Popup operations only handle one event",e||m(t);let r=tT();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],r),this.authWindow.associatedEvent=r,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(c(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(c(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,tY.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(c(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,tX.get())};e()}}tY.currentPopupAction=null;let tZ=new Map;class t0 extends tJ{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=tZ.get(this.auth._key());if(!e){try{let t=await t1(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}tZ.set(this.auth._key(),e)}return this.bypassAuthState||tZ.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
15if("unknown"===e.type)return void this.resolve(null);if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function t1(e,t){var r;let i=er("pendingRedirect",(r=t).config.apiKey,r.name),n=ee(e._redirectPersistence);if(!await n._isAvailable())return!1;let s=await n._get(i)==="true";return await n._remove(i),s}function t2(e,t){tZ.set(e._key(),t)}async function t6(e,t,i=!1){if((0,r._isFirebaseServerApp)(e.app))return Promise.reject(f(e));let n=ew(e),s=tq(n,t),a=new t0(n,s,i),o=await a.execute();return o&&!i&&(delete o.user._redirectEventId,await n._persistUserIfCurrent(o.user),await n._setRedirectUser(null,t)),o}class t3{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 t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return t4(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!t4(e)){let r=e.error.code?.split("auth/")[1]||"internal-error";t.onError(c(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let r=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(t5(e))}saveEventToCache(e){this.cachedEventUids.add(t5(e)),this.lastProcessedEventTime=Date.now()}}function t5(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function t4({type:e,error:t}){return"unknown"===e&&t?.code==="auth/no-auth-event"}async function t8(e,t={}){return A(e,"GET","/v1/projects",t)}let t7=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,t9=/^https?/;async function re(e){if(e.config.emulator)return;let{authorizedDomains:t}=await t8(e);for(let e of t)try{if(function(e){let t=y(),{protocol:r,hostname:i}=new URL(t);if(e.startsWith("chrome-extension://")){let n=new URL(e);return""===n.hostname&&""===i?"chrome-extension:"===r&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===r&&n.hostname===i}if(!t9.test(r))return!1;if(t7.test(e))return i===e;let n=e.replace(/\./g,"\\.");return RegExp("^(.+\\."+n+"|"+n+")$","i").test(i)}(e))return}catch{}u(e,"unauthorized-domain")}let rt=new w(3e4,6e4);function rr(){let e=tA().___jsl;if(e?.H){for(let t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}}let ri=null,rn=new w(5e3,15e3),rs={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ra=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function ro(e){let t,n,s,a,o,l=await (ri=ri||new Promise((t,r)=>{function i(){rr(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{rr(),r(c(e,"network-request-failed"))},timeout:rt.get()})}if(tA().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else if(tA().gapi?.load)i();else{var n;let t=eb("iframefcb");return tA()[t]=()=>{gapi.load?i():r(c(e,"network-request-failed"))},(n=`${e_.gapiScript}?onload=${t}`,e_.loadJS(n)).catch(e=>r(e))}}).catch(e=>{throw ri=null,e})),h=tA().gapi;return g(h,e,"internal-error"),l.open({where:document.body,url:(g((t=e.config).authDomain,e,"auth-domain-config-required"),n=t.emulator?E(t,"emulator/auth/iframe"):`https://${e.config.authDomain}
15/__/auth/iframe`,s={apiKey:t.apiKey,appName:e.name,v:r.SDK_VERSION},(a=ra.get(e.config.apiHost))&&(s.eid=a),(o=e._getFrameworks()).length&&(s.fw=o.join(",")),`${n}?${(0,i.querystring)(s).slice(1)}`),messageHandlersFilter:h.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:rs,dontclear:!0},t=>new Promise(async(r,i)=>{await t.restyle({setHideOnLeave:!1});let n=c(e,"network-request-failed"),s=tA().setTimeout(()=>{i(n)},rn.get());function a(){tA().clearTimeout(s),r(t)}t.ping(a).then(a,()=>{i(n)})}))}let rl={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class rh{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}let ru=encodeURIComponent("fac");async function rc(e,t,n,s,a,o){g(e.config.authDomain,e,"auth-domain-config-required"),g(e.config.apiKey,e,"invalid-api-key");let l={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:s,v:r.SDK_VERSION,eventId:a};if(t instanceof eY)for(let[r,n]of(t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||"",(0,i.isEmpty)(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(o||{})))l[r]=n;if(t instanceof eZ){let e=t.getScopes().filter(e=>""!==e);e.length>0&&(l.scopes=e.join(","))}for(let t of(e.tenantId&&(l.tid=e.tenantId),Object.keys(l)))void 0===l[t]&&delete l[t];let h=await e._getAppCheckToken(),u=h?`#${ru}=${encodeURIComponent(h)}`:"";return`${function({config:e}){return e.emulator?E(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,i.querystring)(l).slice(1)}${u}`}let rd="webStorageSupport",rf=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=tb,this._completeRedirectFn=t6,this._overrideRedirectResult=t2}async _openPopup(e,t,r,n){var s,a;s=this.eventManagers[e._key()]?.manager,a="_initialize() not called before _openPopup()",s||m(a);let o=await rc(e,t,r,y(),n);return function(e,t,r,n=500,s=600){let a=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-n)/2,0).toString(),l="",h={...rl,width:n.toString(),height:s.toString(),top:a,left:o},u=(0,i.getUA)().toLowerCase();r&&(l=eo(u)?"_blank":r),es(u)&&(t=t||"http://localhost",h.scrollbars="yes");let c=Object.entries(h).reduce((e,[t,r])=>`${e}${t}=${r},`,"");if(function(e=(0,i.getUA)()){return ed(e)&&!!window.navigator?.standalone}(u)&&"_self"!==l){var d,f;let e,r;return d=t||"",f=l,(e=document.createElement("a")).href=d,e.target=f,(r=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),e.dispatchEvent(r),new rh(null)}let p=window.open(t||"",l,c);g(p,e,"popup-blocked");try{p.focus()}catch(e){}return new rh(p)}(e,o,tT())}
15async _openRedirect(e,t,r,i){var n;return await this._originValidation(e),n=await rc(e,t,r,y(),i),tA().location.href=n,new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){var r;let{manager:e,promise:i}=this.eventManagers[t];return e?Promise.resolve(e):(r="If manager is not set, promise should be",i||m(r),i)}let i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){let t=await ro(e),r=new t3(e);return t.register("authEvent",t=>(g(t?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(rd,{type:rd},r=>{let i=r?.[0]?.[rd];void 0!==i&&t(!!i),u(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=re(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ef()||ea()||ed()}};var rp="@firebase/auth",rg="1.12.0";class rm{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.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;let t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){g(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}let ry=(0,i.getExperimentalSetting)("authIdTokenMaxAge")||300,rv=null;function rw(e=(0,r.getApp)()){let t=(0,r._getProvider)(e,"auth");if(t.isInitialized())return t.getImmediate();let n=function(e,t){let n=(0,r._getProvider)(e,"auth");if(n.isInitialized()){let e=n.getImmediate(),r=n.getOptions();if((0,i.deepEqual)(r,t??{}))return e;u(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:rf,persistence:[tF,t_,tb]}),s=(0,i.getExperimentalSetting)("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){let e=new URL(s,location.origin);if(location.origin===e.origin){let t,r=(t=e.toString(),async e=>{let r=e&&await e.getIdTokenResult(),i=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(i&&i>ry)return;let n=r?.token;rv!==n&&(rv=n,await fetch(t,{method:n?"POST":"DELETE",headers:n?{Authorization:`Bearer ${n}`}:{}}))});(0,i.getModularInstance)(n).beforeAuthStateChanged(r,()=>r(n.currentUser)),(0,i.getModularInstance)(n).onIdTokenChanged(e=>r(e),void 0,void 0)}}let a=(0,i.getDefaultEmulatorHost)("auth");return a&&function(e,t,r){let n=ew(e);g(/^https?:\/\//.test(t),n,"invalid-emulator-scheme");let s=eP(t),{host:a,port:o}=function(e){let t=eP(e),r=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:"",port:null};let i=r[2].split("@").pop()||"",n=/^(\[[^\]]+\])(:|$)/.exec(i);if(n){let e=n[1];return{host:e,port:eN(i.substr(e.length+1))}}{let[e,t]=i.split(":");return{host:e,port:eN(t)}}}(t),l=null===o?"":`:${o}`,h={url:`${s}//${a}${l}/`},u=Object.freeze({host:a,port:o,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!n._canInitEmulator){g(n.config.emulator&&n.emulatorConfig,n,"emulator-config-failed"),g((0,i.deepEqual)(h,n.config.emulator)&&(0,i.deepEqual)(u,n.emulatorConfig),n,"emulator-config-failed");return}n.config.emulator=h,n.emulatorConfig=u,n.settings.appVerificationDisabledForTesting=!0,(0,i.isCloudWorkstation)(a)?((0,i.pingServer)(`${s}//${a}${l}`),(0,i.updateEmulatorBanner)("Auth",!0)):function(){function e(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}(n,`http://${a}`),n}e_={loadJS:e=>
15new Promise((t,r)=>{let i=document.createElement("script");i.setAttribute("src",e),i.onload=t,i.onerror=e=>{let t=c("internal-error");t.customData=e,r(t)},i.type="text/javascript",i.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(i)}),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="},t="Browser",(0,r._registerComponent)(new s.Component("auth",(e,{options:r})=>{let i,n,s=e.getProvider("app").getImmediate(),a=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:l,authDomain:h}=s.options;g(l&&!l.includes(":"),"invalid-api-key",{appName:s.name});let u=new ev(s,a,o,{apiKey:l,authDomain:h,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ep(t)});return n=(Array.isArray(i=r?.persistence||[])?i:[i]).map(ee),r?.errorMap&&u._updateErrorMap(r.errorMap),u._initializeWithPersistence(n,r?.popupRedirectResolver),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),(0,r._registerComponent)(new s.Component("auth-internal",e=>new rm(ew(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,r.registerVersion)(rp,rg,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(t)),(0,r.registerVersion)(rp,rg,"esm2020"),e.s([],58556),e.s([],51718),e.i(58556),e.s(["EmailAuthProvider",()=>eQ,"GoogleAuthProvider",()=>e1,"confirmPasswordReset",()=>th,"createUserWithEmailAndPassword",()=>td,"getAuth",()=>rw,"onAuthStateChanged",()=>tm,"reauthenticateWithCredential",()=>ti,"sendPasswordResetEmail",()=>tl,"signInWithEmailAndPassword",()=>tf,"signInWithPopup",()=>tQ,"signOut",()=>ty,"updatePassword",()=>tp,"verifyPasswordResetCode",()=>tc],18357)},46012,50239,e=>{"use strict";let t,r,i,n;var s=e.i(92953),a=e.i(83877),o=e.i(97427),l=e.i(8070),h=e.i(44435);let u="@firebase/installations",c="0.6.19",d=`w:${c}`,f="FIS_v2",p=new o.ErrorFactory("installations","Installations",{"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."});function g(e){return e instanceof o.FirebaseError&&e.code.includes("request-failed")}function m({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function y(e){return{token:e.token,requestStatus:2,expiresIn:Number(e.expiresIn.replace("s","000")),creationTime:Date.now()}}async function v(e,t){let r=(await t.json()).error;return p.create("request-failed",{requestName:e,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function w({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}async function E(e){let t=await e();return t.status>=500&&t.status<600?e():t}async function _({appConfig:e,heartbeatServiceProvider:t},{fid:r}){let i=m(e),n=w(e),s=t.getImmediate({optional:!0});if(s){let e=await s.getHeartbeatsHeader();e&&n.append("x-firebase-client",e)}let a={method:"POST",headers:n,body:JSON.stringify({fid:r,authVersion:f,appId:e.appId,sdkVersion:d})},o=await E(()=>fetch(i,a));if(o.ok){let e=await o.json();return{fid:e.fid||r,registrationStatus:2,refreshToken:e.refreshToken,authToken:y(e.authToken)}}throw await v("Create Installation",o)}function b(e){return new Promise(t=>{setTimeout(t,e)})}let I=/^[cdef][\w-]{21}$/;function T(e){return`${e.appName}!${e.appId}`}let S=new Map;function A(e,t){var r,i;let n,s=T(e);C(s,t),r=s,i=t,(n=(!k&&"BroadcastChannel"in self&&((k=new BroadcastChannel("[Firebase] FID Change")).onmessage=e=>{C(e.data.key,e.data.fid)}),k))&&n.postMessage({key:r,fid:i}
15),0===S.size&&k&&(k.close(),k=null)}function C(e,t){let r=S.get(e);if(r)for(let e of r)e(t)}let k=null,R="firebase-installations-store",P=null;function N(){return P||(P=(0,h.openDB)("firebase-installations-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(R)}})),P}async function O(e,t){let r=T(e),i=(await N()).transaction(R,"readwrite"),n=i.objectStore(R),s=await n.get(r);return await n.put(t,r),await i.done,s&&s.fid===t.fid||A(e,t.fid),t}async function D(e){let t=T(e),r=(await N()).transaction(R,"readwrite");await r.objectStore(R).delete(t),await r.done}async function x(e,t){let r=T(e),i=(await N()).transaction(R,"readwrite"),n=i.objectStore(R),s=await n.get(r),a=t(s);return void 0===a?await n.delete(r):await n.put(a,r),await i.done,a&&(!s||s.fid!==a.fid)&&A(e,a.fid),a}async function L(e){let t,r=await x(e.appConfig,r=>{let i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(p.create("app-offline"))};let r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},i=M(e,r);return{installationEntry:r,registrationPromise:i}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:U(e)}:{installationEntry:t}}(e,V(r||{fid:function(){try{var e;let t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;let r=(e=t,btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22));return I.test(r)?r:""}catch{return""}}(),registrationStatus:0}));return t=i.registrationPromise,i.installationEntry});return""===r.fid?{installationEntry:await t}:{installationEntry:r,registrationPromise:t}}async function M(e,t){try{let r=await _(e,t);return O(e.appConfig,r)}catch(r){throw g(r)&&409===r.customData.serverCode?await D(e.appConfig):await O(e.appConfig,{fid:t.fid,registrationStatus:0}),r}}async function U(e){let t=await F(e.appConfig);for(;1===t.registrationStatus;)await b(100),t=await F(e.appConfig);if(0===t.registrationStatus){let{installationEntry:t,registrationPromise:r}=await L(e);return r||t}return t}function F(e){return x(e,e=>{if(!e)throw p.create("installation-not-found");return V(e)})}function V(e){var t;return 1===(t=e).registrationStatus&&t.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e}async function B({appConfig:e,heartbeatServiceProvider:t},r){let i=function(e,{fid:t}){return`${m(e)}/${t}/authTokens:generate`}(e,r),n=function(e,{refreshToken:t}){var r;let i=w(e);return i.append("Authorization",(r=t,`${f} ${r}`)),i}(e,r),s=t.getImmediate({optional:!0});if(s){let e=await s.getHeartbeatsHeader();e&&n.append("x-firebase-client",e)}let a={method:"POST",headers:n,body:JSON.stringify({installation:{sdkVersion:d,appId:e.appId}})},o=await E(()=>fetch(i,a));if(o.ok)return y(await o.json());throw await v("Generate Auth Token",o)}async function j(e,t=!1){let r,i=await x(e.appConfig,i=>{var n,s,a;let o;if(!z(i))throw p.create("not-registered");let l=i.authToken;if(!t&&2===(n=l).requestStatus&&(s=n,!((o=Date.now())<s.creationTime)&&!(s.creationTime+s.expiresIn<o+36e5)))return i;if(1===l.requestStatus)return r=$(e,t),i;{let t;if(!navigator.onLine)throw p.create("app-offline");let n=(a=i,t={requestStatus:1,requestTime:Date.now()},{...a,authToken:t});return r=q(e,n),n}});return r?await r:i.authToken}async function $(e,t){let r=await H(e.appConfig);for(;1===r.authToken.requestStatus;)await b(100),r=await H(e.appConfig);let i=r.authToken;return 0===i.requestStatus?j(e,t):i}function H(e){return x(e,e=>{var t;if(!z(e))throw p.create("not-registered");return 1===(t=e.authToken).requestStatus&&t.requestTime+1e4<Date.now()?{...e,authToken:{requestStatus:0}}:e})}async function q(e,t){try{let r=await B(e,t),i={...t,authToken:r};return await O(e.appConfig,i),r}catch(r){if(g(r)&&(401===r.customData.serverCode||404===r.customData.serverCode))await D(e.appConfig);else{let r={...t,authToken:{requestStatus:0}};await O(e.appConfig,r)}throw r}}function z(e){return void 0!==e&&2===e.registrationStatus}async function W(e){let{installationEntry:t,registrationPromise:r}=await L(e);return r?r.catch(console.error):j(e).catch(console.error),t.fid}async function K(e,t=!1){return await G(e),(await j(e,t)).token}async function G(e){let{registrationPromise:t}=await L(e);t&&await t}function J(e){return p.create("missing-app-config-values",{valueName:e})}
15let X="installations";(0,s._registerComponent)(new l.Component(X,e=>{let t=e.getProvider("app").getImmediate(),r=function(e){if(!e||!e.options)throw J("App Configuration");if(!e.name)throw J("App Name");for(let t of["projectId","apiKey","appId"])if(!e.options[t])throw J(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),i=(0,s._getProvider)(t,"heartbeat");return{app:t,appConfig:r,heartbeatServiceProvider:i,_delete:()=>Promise.resolve()}},"PUBLIC")),(0,s._registerComponent)(new l.Component("installations-internal",e=>{let t=e.getProvider("app").getImmediate(),r=(0,s._getProvider)(t,X).getImmediate();return{getId:()=>W(r),getToken:e=>K(r,e)}},"PRIVATE")),(0,s.registerVersion)(u,c),(0,s.registerVersion)(u,c,"esm2020");let Q="analytics",Y="https://www.googletagmanager.com/gtag/js",Z=new a.Logger("@firebase/analytics"),ee=new o.ErrorFactory("analytics","Analytics",{"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}."});function et(e){if(!e.startsWith(Y)){let t=ee.create("invalid-gtag-resource",{gtagURL:e});return Z.warn(t.message),""}return e}function er(e){return Promise.all(e.map(e=>e.catch(e=>e)))}async function ei(e,t,r,i,n,s){let a=i[n];try{if(a)await t[a];else{let e=(await er(r)).find(e=>e.measurementId===n);e&&await t[e.appId]}}catch(e){Z.error(e)}e("config",n,s)}async function en(e,t,r,i,n){try{let s=[];if(n&&n.send_to){let e=n.send_to;Array.isArray(e)||(e=[e]);let i=await er(r);for(let r of e){let e=i.find(e=>e.measurementId===r),n=e&&t[e.appId];if(n)s.push(n);else{s=[];break}}}0===s.length&&(s=Object.values(t)),await Promise.all(s),e("event",i,n||{})}catch(e){Z.error(e)}}let es=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};async function ea(e){let{appId:t,apiKey:r}=e,i={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":r})},n="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",t),s=await fetch(n,i);if(200!==s.status&&304!==s.status){let e="";try{let t=await s.json();t.error?.message&&(e=t.error.message)}catch(e){}throw ee.create("config-fetch-failed",{httpStatus:s.status,responseMessage:e})}return s.json()}async function eo(e,t=es,r){let{appId:i,apiKey:n,measurementId:s}=e.options;if(!i)throw ee.create("no-app-id");
15if(!n){if(s)return{measurementId:s,appId:i};throw ee.create("no-api-key")}let a=t.getThrottleMetadata(i)||{backoffCount:0,throttleEndTimeMillis:Date.now()},o=new eh;return setTimeout(async()=>{o.abort()},void 0!==r?r:6e4),el({appId:i,apiKey:n,measurementId:s},a,o,t)}async function el(e,{throttleEndTimeMillis:t,backoffCount:r},i,n=es){let{appId:s,measurementId:a}=e;try{var l,h;await (l=i,h=t,new Promise((e,t)=>{let r=setTimeout(e,Math.max(h-Date.now(),0));l.addEventListener(()=>{clearTimeout(r),t(ee.create("fetch-throttle",{throttleEndTimeMillis:h}))})}))}catch(e){if(a)return Z.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${e?.message}]`),{appId:s,measurementId:a};throw e}try{let t=await ea(e);return n.deleteThrottleMetadata(s),t}catch(h){if(!function(e){if(!(e instanceof o.FirebaseError)||!e.customData)return!1;let t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(h)){if(n.deleteThrottleMetadata(s),a)return Z.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${h?.message}]`),{appId:s,measurementId:a};throw h}let t=503===Number(h?.customData?.httpStatus)?(0,o.calculateBackoffMillis)(r,n.intervalMillis,30):(0,o.calculateBackoffMillis)(r,n.intervalMillis),l={throttleEndTimeMillis:Date.now()+t,backoffCount:r+1};return n.setThrottleMetadata(s,l),Z.debug(`Calling attemptFetch again in ${t} millis`),el(e,l,i,n)}}class eh{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function eu(e,t,r,i,n){if(n&&n.global)return void e("event",r,i);{let n=await t;e("event",r,{...i,send_to:n})}}async function ec(e,t,r,i){if(i&&i.global){let t={};for(let e of Object.keys(r))t[`user_properties.${e}`]=r[e];return e("set",t),Promise.resolve()}e("config",await t,{update:!0,user_properties:r})}async function ed(){if(!(0,o.isIndexedDBAvailable)())return Z.warn(ee.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await (0,o.validateIndexedDBOpenable)()}catch(e){return Z.warn(ee.create("indexeddb-unavailable",{errorInfo:e?.toString()}).message),!1}return!0}async function ef(e,i,n,s,a,o,l){var h,u;let c,d,f,p,g=eo(e);g.then(t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&Z.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.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(e=>Z.error(e)),i.push(g);let m=ed().then(e=>e?s.getId():void 0),[y,v]=await Promise.all([g,m]);!function(e){for(let t of Object.values(window.document.getElementsByTagName("script")))if(t.src&&t.src.includes(Y)&&t.src.includes(e))return t;return null}(o)&&(h=y.measurementId,u={createScriptURL:et},window.trustedTypes&&(c=window.trustedTypes.createPolicy("firebase-js-sdk-policy",u)),d=c,f=document.createElement("script"),p=`${Y}?l=${o}&id=${h}`,f.src=d?d?.createScriptURL(p):p,f.async=!0,document.head.appendChild(f)),r&&(a("consent","default",r),r=void 0),a("js",new Date);let w=l?.config??{};return w.origin="firebase",w.update=!0,null!=v&&(w.firebase_id=v),a("config",y.measurementId,w),t&&(a("set",t),t=void 0),y.measurementId}class ep{constructor(e){this.app=e}_delete(){return delete eg[this.app.options.appId],Promise.resolve()}}let eg={},em=[],ey={},ev="dataLayer",ew=!1;function eE(e=(0,s.getApp)()){e=(0,o.getModularInstance)(e);let t=(0,s._getProvider)(e,Q);return t.isInitialized()?t.getImmediate():function(e,t={}){let r=(0,s._getProvider)(e,Q);if(r.isInitialized()){let e=r.getImmediate();if((0,o.deepEqual)(t,r.getOptions()))return e;throw ee.create("already-initialized")}return r.initialize({options:t})}(e)}async function e_(){if((0,o.isBrowserExtension)()||!(0,o.areCookiesEnabled)()||!(0,o.isIndexedDBAvailable)())return!1;try{return await (0,o.validateIndexedDBOpenable)()}catch(e){return!1}}
15function eb(e,t,r,i){e=(0,o.getModularInstance)(e),eu(n,eg[e.app.options.appId],t,r,i).catch(e=>Z.error(e))}let eI="@firebase/analytics",eT="0.10.19";(0,s._registerComponent)(new l.Component(Q,(e,{options:t})=>(function(e,t,r){let s=[];if((0,o.isBrowserExtension)()&&s.push("This is a browser extension environment."),(0,o.areCookiesEnabled)()||s.push("Cookies are not available."),s.length>0){let e=s.map((e,t)=>`(${t+1}) ${e}`).join(" "),t=ee.create("invalid-analytics-context",{errorInfo:e});Z.warn(t.message)}let a=e.options.appId;if(!a)throw ee.create("no-app-id");if(!e.options.apiKey)if(e.options.measurementId)Z.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 ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw ee.create("no-api-key");if(null!=eg[a])throw ee.create("already-exists",{id:a});if(!ew){var l,h;let e,t;e=[],Array.isArray(window[ev])?e=window[ev]:window[ev]=e;let{wrappedGtag:r,gtagCore:s}=(l="gtag",t=function(){window[ev].push(arguments)},window[l]&&"function"==typeof window[l]&&(t=window[l]),window[l]=(h=t,async function(e,...t){try{if("event"===e){let[e,r]=t;await en(h,eg,em,e,r)}else if("config"===e){let[e,r]=t;await ei(h,eg,em,ey,e,r)}else if("consent"===e){let[e,r]=t;h("consent",e,r)}else if("get"===e){let[e,r,i]=t;h("get",e,r,i)}else if("set"===e){let[e]=t;h("set",e)}else h(e,...t)}catch(e){Z.error(e)}}),{gtagCore:t,wrappedGtag:window[l]});n=r,i=s,ew=!0}return eg[a]=ef(e,em,ey,t,i,ev,r),new ep(e)})(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),(0,s._registerComponent)(new l.Component("analytics-internal",function(e){try{let t=e.getProvider(Q).getImmediate();return{logEvent:(e,r,i)=>eb(t,e,r,i),setUserProperties:(e,r)=>{var i;return i=t,void(i=(0,o.getModularInstance)(i),ec(n,eg[i.app.options.appId],e,r).catch(e=>Z.error(e)))}}}catch(e){throw ee.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),(0,s.registerVersion)(eI,eT),(0,s.registerVersion)(eI,eT,"esm2020"),e.s(["getAnalytics",()=>eE,"isSupported",()=>e_,"logEvent",()=>eb],50239),e.s([],46012)},14539,76510,e=>{"use strict";var t=e.i(92953);(0,t.registerVersion)("firebase","12.7.0","app"),e.s([],14539),e.i(97427),e.s(["getApp",()=>t.getApp,"getApps",()=>t.getApps,"initializeApp",()=>t.initializeApp],76510)},67034,(e,t,r)=>{var i={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],i=t[1];return(r+i)*3/4-i},t.toByteArray=function(e){var t,r,s=l(e),a=s[0],o=s[1],h=new n((a+o)*3/4-o),u=0,c=o>0?a-4:a;for(r=0;r<c;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],h[u++]=t>>16&255,h[u++]=t>>8&255,h[u++]=255&t;return 2===o&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,h[u++]=255&t),1===o&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,h[u++]=t>>8&255,h[u++]=255&t),h},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],a=0,o=i-n;a<o;a+=16383)s.push(function(e,t,i){for(var n,s=[],a=t;a<i;a+=3)n=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[n>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return s.join("")}(e,a,a+16383>o?o:a+16383));return 1===n?s.push(r[(t=e[i-1])>>2]+r[t<<4&63]+"=="):2===n&&s.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=s.length;a<o;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},72:function(e,t,r){"use strict";var i=r(675),n=r(783),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var i=e,n=t;if(("string"!=typeof n||""===n)&&(n="utf8"),!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);var s=0|f(i,n),l=a(s),h=l.write(i,n);return h!==s&&(l=l.slice(0,h)),l}if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(R(e,SharedArrayBuffer)||e&&R(e.buffer,SharedArrayBuffer)))return function(e,t,r){var i;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),i}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return o.from(u,t,r);var p=function(e){if(o.isBuffer(e)){var t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(p)return p;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');
vendor: 16,467 bytes, line 15
15if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return h(e),a(e<0?0:0|d(e))}function c(e){for(var t=e.length<0?0:0|d(e.length),r=a(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(h(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return u(e)},o.allocUnsafeSlow=function(e){return u(e)};function d(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||R(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(n)return i?-1:S(e).length;t=(""+t).toLowerCase(),n=!0}}function p(e,t,r){var n,s,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var n="",s=t;s<r;++s)n+=P[e[s]];return n}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}(this,t,r);case"latin1":case"binary":return function(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}(this,t,r);case"base64":return n=this,s=t,a=r,0===s&&a===n.length?i.fromByteArray(n):i.fromByteArray(n.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var i=e.slice(t,r),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+256*i[s+1]);return n}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function g(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){var s;if(0===e.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(n)return -1;else r=e.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,i)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,i,n);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,i,n)}throw TypeError("val must be string, number or Buffer")}function y(e,t,r,i,n){var s,a=1,o=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,r/=2}function h(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var u=-1;for(s=r;s<o;s++)if(h(e,s)===h(t,-1===u?0:s-u)){if(-1===u&&(u=s),s-u+1===l)return u*a}else -1!==u&&(s-=s-u),u=-1}else for(r+l>o&&(r=o-l),s=r;s>=0;s--){for(var c=!0,d=0;d<l;d++)if(h(e,s+d)!==h(t,d)){c=!1;break}if(c)return s}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(R(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),R(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,i=t.length,n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:+(i<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,i=o.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var s=e[r];if(R(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(o.prototype[s]=o.prototype.inspect),o.prototype.compare=function(e,t,r,i,n){if(R(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;for(var s=n-i,a=r-t,l=Math.min(s,a),h=this.slice(i,n),u=e.slice(t,r),c=0;c<l;++c)if(h[c]!==u[c]){s=h[c],a=u[c];break}return s<a?-1:+(a<s)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n<r;){var s,a,o,l,h=e[n],u=null,c=h>239?4:h>223?3:h>191?2:1;if(n+c<=r)switch(c){case 1:h<128&&(u=h);break;case 2:(192&(s=e[n+1]))==128&&(l=(31&h)<<6|63&s)>127&&(u=l);break;case 3:s=e[n+1],a=e[n+2],(192&s)==128&&(192&a)==128&&(l=(15&h)<<12|(63&s)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:s=e[n+1],a=e[n+2],o=e[n+3],(192&s)==128&&(192&a)==128&&(192&o)==128&&(l=(15&h)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(u=l)}null===u?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),n+=c}var d=i,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var p="",g=0;g<f;)p+=String.fromCharCode.apply(String,d.slice(g,g+=4096));return p}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function E(e,t,r,i,n,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw RangeError('"value" argument is out of bounds');if(r+i>e.length)throw RangeError("Index out of range")}function _(e,t,r,i,n,s){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function b(e,t,r,i,s){return t*=1,r>>>=0,s||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,s){return t*=1,r>>>=0,s||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}o.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n,s,a,o,l,h,u,c,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return function(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=t.length;i>s/2&&(i=s/2);for(var a=0;a<i;++a){var o,l=parseInt(t.substr(2*a,2),16);if((o=l)!=o)break;e[r+a]=l}return a}(this,e,t,r);case"utf8":case"utf-8":return n=t,s=r,k(S(e,this.length-n),this,n,s);case"ascii":return a=t,o=r,k(A(e),this,a,o);case"latin1":case"binary":return function(e,t,r,i){return k(A(t),e,r,i)}(this,e,t,r);case"base64":return l=t,h=r,k(C(e),this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,c=r,k(function(e,t){for(var r,i,n=[],s=0;s<e.length&&!((t-=2)<0);++s)i=(r=e.charCodeAt(s))>>8,n.push(r%256),n.push(i);return n}(e,this.length-u),this,u,c);default:if(f)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,o.prototype),i},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return i},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},o.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var i=t,n=1,s=this[e+--i];i>0&&(n*=256);)s+=this[e+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;E(this,e,t,r,n,0)}var s=1,a=0;for(this[t]=255&e;++a<r&&(s*=256);)this[t+a]=e/s&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;E(this,e,t,r,n,0)}var s=r-1,a=1;for(this[t+s]=255&e;--s>=0&&(a*=256);)this[t+s]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){var n=Math.pow(2,8*r-1);E(this,e,t,r,n-1,-n)}var s=0,a=1,o=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,i){if(e*=1,t>>>=0,!i){var n=Math.pow(2,8*r-1);E(this,e,t,r,n-1,-n)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return b(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return b(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,i){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var n=i-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,i);else if(this===e&&r<t&&t<i)for(var s=n-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n},o.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===e.length){var n,s=e.charCodeAt(0);("utf8"===i&&s<128||"latin1"===i)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;
15else{var a=o.isBuffer(e)?e:o.from(e,i),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=a[n%l]}return this};var T=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,i=e.length,n=null,s=[],a=0;a<i;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319||a+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function A(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function C(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length)&&!(n>=e.length);++n)t[n+r]=e[n];return n}function R(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var P=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()},783:function(e,t){t.read=function(e,t,r,i,n){var s,a,o=8*n-i-1,l=(1<<o)-1,h=l>>1,u=-7,c=r?n-1:0,d=r?-1:1,f=e[t+c];for(c+=d,s=f&(1<<-u)-1,f>>=-u,u+=o;u>0;s=256*s+e[t+c],c+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=i;u>0;a=256*a+e[t+c],c+=d,u-=8);if(0===s)s=1-h;else{if(s===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),s-=h}return(f?-1:1)*a*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var a,o,l,h=8*s-n-1,u=(1<<h)-1,c=u>>1,d=5960464477539062e-23*(23===n),f=i?0:s-1,p=i?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+c>=1?t+=d/l:t+=d*Math.pow(2,1-c),t*l>=2&&(a++,l/=2),a+c>=u?(o=0,a=u):a+c>=1?(o=(t*l-1)*Math.pow(2,n),a+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;e[r+f]=255&o,f+=p,o/=256,n-=8);for(a=a<<n|o,h+=n;h>0;e[r+f]=255&a,f+=p,a/=256,h-=8);e[r+f-p]|=128*g}}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}},a=!0;try{i[e](r,r.exports,s),a=!1}finally{a&&delete n[e]}return r.exports}s.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=s(72)},36180,98925,e=>{"use strict";e.i(47167),e.i(67034);var t,r,i,n,s,a,o,l,h,u,c,d,f,p=e.i(92953),g=e.i(8070),m=e.i(83877),y=e.i(97427),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:e.g,w={};(function(){function e(){this.blockSize=-1,this.blockSize=64,this.g=[,,,,],this.C=Array(this.blockSize),this.o=this.h=0,this.u()}var r=function(){this.blockSize=-1};function i(){}function n(e,t,r){r||(r=0);let i=Array(16);if("string"==typeof t)for(var n=0;n<16;++n)i[n]=t.charCodeAt(r++)|t.charCodeAt(r++)<<8|t.charCodeAt(r++)<<16|t.charCodeAt(r++)<<24;else for(n=0;n<16;++n)i[n]=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;t=e.g[0],r=e.g[1],n=e.g[2];let s=e.g[3],a;a=t+(s^r&(n^s))+i[0]+0xd76aa478|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[1]+0xe8c7b756|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[2]+0x242070db|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[3]+0xc1bdceee|0,a=t+(s^(r=n+(a<<22|a>>>10))&(n^s))+i[4]+0xf57c0faf|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[5]+0x4787c62a|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[6]+0xa8304613|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[7]+0xfd469501|0,a=t+(s^(r=n+(a<<22|a>>>10))&(n^s))+i[8]+0x698098d8|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[9]+0x8b44f7af|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[10]+0xffff5bb1|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[11]+0x895cd7be|0,a=t+(s^(r=n+(a<<22|a>>>10))&(n^s))+i[12]+0x6b901122|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[13]+0xfd987193|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[14]+0xa679438e|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[15]+0x49b40821|0,r=n+(a<<22|a>>>10),a=t+(n^s&(r^n))+i[1]+0xf61e2562|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[6]+0xc040b340|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[11]+0x265e5a51|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[0]+0xe9b6c7aa|0,r=n+(a<<20|a>>>12),a=t+(n^s&(r^n))+i[5]+0xd62f105d|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[10]+0x2441453|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[15]+0xd8a1e681|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[4]+0xe7d3fbc8|0,r=n+(a<<20|a>>>12),a=t+(n^s&(r^n))+i[9]+0x21e1cde6|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[14]+0xc33707d6|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[3]+0xf4d50d87|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[8]+0x455a14ed|0,r=n+(a<<20|a>>>12),a=t+(n^s&(r^n))+i[13]+0xa9e3e905|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[2]+0xfcefa3f8|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[7]+0x676f02d9|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[12]+0x8d2a4c8a|0,a=t+((r=n+(a<<20|a>>>
1512))^n^s)+i[5]+0xfffa3942|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[8]+0x8771f681|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[11]+0x6d9d6122|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[14]+0xfde5380c|0,a=t+((r=n+(a<<23|a>>>9))^n^s)+i[1]+0xa4beea44|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[4]+0x4bdecfa9|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[7]+0xf6bb4b60|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[10]+0xbebfbc70|0,a=t+((r=n+(a<<23|a>>>9))^n^s)+i[13]+0x289b7ec6|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[0]+0xeaa127fa|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[3]+0xd4ef3085|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[6]+0x4881d05|0,a=t+((r=n+(a<<23|a>>>9))^n^s)+i[9]+0xd9d4d039|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[12]+0xe6db99e5|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[15]+0x1fa27cf8|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[2]+0xc4ac5665|0,r=n+(a<<23|a>>>9),a=t+(n^(r|~s))+i[0]+0xf4292244|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[7]+0x432aff97|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[14]+0xab9423a7|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[5]+0xfc93a039|0,r=n+(a<<21|a>>>11),a=t+(n^(r|~s))+i[12]+0x655b59c3|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[3]+0x8f0ccc92|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[10]+0xffeff47d|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[1]+0x85845dd1|0,r=n+(a<<21|a>>>11),a=t+(n^(r|~s))+i[8]+0x6fa87e4f|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[15]+0xfe2ce6e0|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[6]+0xa3014314|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[13]+0x4e0811a1|0,r=n+(a<<21|a>>>11),a=t+(n^(r|~s))+i[4]+0xf7537e82|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[11]+0xbd3af235|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[2]+0x2ad7d2bb|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[9]+0xeb86d391|0,e.g[0]=e.g[0]+t|0,e.g[1]=e.g[1]+(n+(a<<21|a>>>11))|0,e.g[2]=e.g[2]+n|0,e.g[3]=e.g[3]+s|0}function s(e,t){this.h=t;let r=[],i=!0;for(let n=e.length-1;n>=0;n--){let s=0|e[n];i&&s==t||(r[n]=s,i=!1)}this.g=r}i.prototype=r.prototype,e.F=r.prototype,e.prototype=new i,e.prototype.constructor=e,e.D=function(e,t,i){for(var n=Array(arguments.length-2),s=2;s<arguments.length;s++)n[s-2]=arguments[s];return r.prototype[t].apply(e,n)},e.prototype.u=function(){this.g[0]=0x67452301,this.g[1]=0xefcdab89,this.g[2]=0x98badcfe,this.g[3]=0x10325476,this.o=this.h=0},e.prototype.v=function(e,t){void 0===t&&(t=e.length);let r=t-this.blockSize,i=this.C,s=this.h,a=0;for(;a<t;){if(0==s)for(;a<=r;)n(this,e,a),a+=this.blockSize;if("string"==typeof e){for(;a<t;)if(i[s++]=e.charCodeAt(a++),s==this.blockSize){n(this,i),s=0;break}}else for(;a<t;)if(i[s++]=e[a++],s==this.blockSize){n(this,i),s=0;break}}this.h=s,this.o+=t},e.prototype.A=function(){var e=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;t=8*this.o;for(var r=e.length-8;r<e.length;++r)e[r]=255&t,t/=256;for(this.v(e),e=Array(16),t=0,r=0;r<4;++r)for(let i=0;i<32;i+=8)e[t++]=this.g[r]>>>i&255;return e};var a,o={};function l(e){var t;return -128<=e&&e<128?(t=function(e){return new s([0|e],e<0?-1:0)},Object.prototype.hasOwnProperty.call(o,e)?o[e]:o[e]=t(e)):new s([0|e],e<0?-1:0)}function h(e){if(isNaN(e)||!isFinite(e))return u;if(e<0)return g(h(-e));let t=[],r=1;for(let i=0;e>=r;i++)t[i]=e/r|0,r*=0x100000000;return new s(t,0)}var u=l(0),c=l(1),d=l(0x1000000);function f(e){if(0!=e.h)return!1;for(let t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function p(e){return -1==e.h}function g(e){let t=e.g.length,r=[];for(let i=0;i<t;i++)r[i]=~e.g[i];return new s(r,~e.h).add(c)}function m(e,t){return e.add(g(t))}function y(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function v(e,t){this.g=e,this.h=t}function E(e,t){if(f(t))throw Error("division by zero");if(f(e))return new v(u,u);if(p(e))return t=E(g(e),t),new v(g(t.g),g(t.h));if(p(t))return t=E(e,g(t)),new v(g(t.g),t.h);if(e.g.length>30){if(p(e)||p(t))throw Error("slowDivide_ only works with positive integers.");for(var r=c,i=t;0>=i.l(e);)r=_(r),i=_(i);var n=b(r,1),s=b(i,1);for(i=b(i,2),r=b(r,2);!f(i);){var a=s.add(i);0>=a.l(e)&&(n=n.add(r),s=a),i=b(i,1),r=b(r,1)}return t=m(e,n.j(t)),new v(n,t)}for(n=u;e.l(t)>=0;){for(i=(i=Math.ceil(Math.log(r=Math.max(1,Math.floor(e.m()/t.m())))/Math.LN2))<=48?1:Math.pow(2,i-48),a=(s=h(r)).j(t);p(a)||a.l(e)>0;)r-=i,a=(s=h(r)).j(t);f(s)&&(s=c),n=n.add(s),e=m(e,a)}return new v(n,e)}function _(e){let t=e.g.length+1,r=[];for(let i=0;i<t;i++)r[i]=e.i(i)<<1|e.i(i-1)>>>31;return new s(r,e.h)}function b(e,t){let r=t>>5;t%=32;let i=e.g.length-r,n=[];for(let s=0;s<i;s++)n[s]=t>0?e.i(s+r)>>>t|e.i(s+r+1)<<32-t:e.i(s+r);return new s(n,e.h)}(a=s.prototype).m=function(){if(p(this))return-g(this).m();let e=0,t=1;for(let r=0;r<this.g.length;r++){let i=this.i(r);e+=(i>=0?i:0x100000000+i)*t,t*=0x100000000}return e},a.toString=function(e){if((e=e||10)<2||36<e)throw Error("radix out of range: "+e);if(f(this))return"0";if(p(this))return"-"+g(this).toString(e);let t=h(Math.pow(e,6));var r=this;let i="";for(;;){let n=E(r,t).g,s=(((r=m(r,n.j(t))).g.length>0?r.g[0]:r.h)>>>0).toString(e);if(f(r=n))return s+i;for(;s.length<6;)s="0"+s;i=s+i}},a.i=function(e){return e<0?0:e<this.g.length?this.g[e]:this.h},a.l=function(e){return p(e=m(this,e))?-1:+!f(e)},a.abs=function(){return p(this)?g(this):this},a.add=function(e){let t=Math.max(this.g.length,e.g.length),r=[],i=0;for(let n=0;n<=t;n++){let t=i+(65535&this.i(n))+(65535&e.i(n)),s=(t>>>16)+(this.i(n)>>>16)+(e.i(n)>>>16);i=s>>>16,t&=65535,s&=65535,r[n]=s<<16|t}return new s(r,-0x80000000&r[r.length-1]?-1:0)},a.j=function(e){if(f(this)||f(e))return u;if(p(this))return p(e)?g(this).j(g(e)):g(g(this).j(e));if(p(e))return g(this.j(g(e)));if(0>this.l(d)&&0>e.l(d))return h(this.m()*e.m());let t=this.g.length+e.g.length,r=[];for(var i=0;i<2*t;i++)r[i]=0;for(i=0;i<this.g.length;i++)for(let t=0;t<e.g.length;t++){let n=this.i(i)>>>16,s=65535&this.i(i),a=e.i(t)>>>16,o=65535&e.i(t);r[2*i+2*t]+=s*o,y(r,2*i+2*t),r[2*i+2*t+1]+=n*o,y(r,2*i+2*t+1),r[2*i+2*t+1]+=s*a,y(r,2*i+2*t+1),r[2*i+2*t+2]+=n*a,y(r,2*i+2*t+2)}for(e=0;e<t;e++)r[e]=r[2*e+1]<<16|r[2*e];for(e=t;e<2*t;e++)r[e]=0;return new s(r,0)},a.B=function(e){return E(this,e).h},a.and=function(e){let t=Math.max(this.g.length,e.g.length),r=[];for(let i=0;i<t;i++)r[i]=this.i(i)&e.i(i);return new s(r,this.h&e.h)},a.or=function(e){let t=Math.max(this.g.length,e.g.length),r=[];for(let i=0;i<t;i++)r[i]=this.i(i)|e.i(i);return new s(r,this.h|e.h)},a.xor=function(e){let t=Math.max(this.g.length,e.g.length),r=[];for(let i=0;i<t;i++)r[i]=this.i(i)^e.i(i);return new s(r,this.h^e.h)},e.prototype.digest=e.prototype.A,e.prototype.reset=e.prototype.u,e.prototype.update=e.prototype.v,w.Md5=e,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.B,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=h,s.fromString=function e(t,r){if(0==t.length)throw Error("number format error: empty string");if((r=r||10)<2||36<r)throw Error("radix out of range: "+r);if("-"==t.charAt(0))return g(e(t.substring(1),r));if(t.indexOf("-")>=0)throw Error('number format error: interior "-" character');let i=h(Math.pow(r,8)),n=u;for(let e=0;e<t.length;e+=8){var s=Math.min(8,t.length-e);let a=parseInt(t.substring(e,e+s),r);s<8?(s=h(Math.pow(r,s)),n=n.j(s).add(h(a))):n=(n=n.j(i)).add(h(a))}return n},t=w.Integer=s}
15).apply(void 0!==v?v:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:e.g,_={};(function(){var e,t,u=Object.defineProperty,c=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof E&&E];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function d(e,t){if(t)e:{var r=c;e=e.split(".");for(var i=0;i<e.length-1;i++){var n=e[i];if(!(n in r))break e;r=r[n]}(t=t(i=r[e=e[e.length-1]]))!=i&&null!=t&&u(r,e,{configurable:!0,writable:!0,value:t})}}d("Symbol.dispose",function(e){return e||Symbol("Symbol.dispose")}),d("Array.prototype.values",function(e){return e||function(){return this[Symbol.iterator]()}}),d("Object.entries",function(e){return e||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push([t,e[t]]);return r}});var f=f||{},p=this||self;function g(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function m(e,t,r){return e.call.apply(e.bind,arguments)}function y(e,t,r){return(y=m).apply(null,arguments)}function v(e,t){var r=Array.prototype.slice.call(arguments,1);return function(){var t=r.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function w(e,t){function r(){}r.prototype=t.prototype,e.Z=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.Ob=function(e,r,i){for(var n=Array(arguments.length-2),s=2;s<arguments.length;s++)n[s-2]=arguments[s];return t.prototype[r].apply(e,n)}}var b="undefined"!=typeof AsyncContext&&"function"==typeof AsyncContext.Snapshot?e=>e&&AsyncContext.Snapshot.wrap(e):e=>e;function I(e){let t=e.length;if(t>0){let r=Array(t);for(let i=0;i<t;i++)r[i]=e[i];return r}return[]}function T(e,t){for(let t=1;t<arguments.length;t++){let i=arguments[t];var r=typeof i;if("array"==(r="object"!=r?r:i?Array.isArray(i)?"array":r:"null")||"object"==r&&"number"==typeof i.length){r=e.length||0;let t=i.length||0;e.length=r+t;for(let n=0;n<t;n++)e[r+n]=i[n]}else e.push(i)}}var S=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return this.h>0?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new A,e=>e.reset());class A{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let C,k=!1,R=new class{constructor(){this.h=this.g=null}add(e,t){let r=S.get();r.set(e,t),this.h?this.h.next=r:this.g=r,this.h=r}},P=()=>{let e=Promise.resolve(void 0);C=()=>{e.then(N)}};function N(){let e;for(var t;e=null,R.g&&(e=R.g,R.g=R.g.next,R.g||(R.h=null),e.next=null),t=e;){try{t.h.call(t.g)}catch(e){!function(e){p.setTimeout(()=>{throw e},0)}(e)}S.j(t),S.h<100&&(S.h++,t.next=S.g,S.g=t)}k=!1}function O(){this.u=this.u,this.C=this.C}function D(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}O.prototype.u=!1,O.prototype.dispose=function(){this.u||(this.u=!0,this.N())},O.prototype[Symbol.dispose]=function(){this.dispose()},O.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},D.prototype.h=function(){this.defaultPrevented=!0};var x=function(){if(!p.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{let e=()=>{};p.addEventListener("test",e,t),p.removeEventListener("test",e,t)}catch(e){}return e}();function L(e){return/^[\s\xa0]*$/.test(e)}function M(e,t){D.call(this,e?e.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,e&&this.init(e,t)}w(M,D),M.prototype.init=function(e,t){let r=this.type=e.type,i=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;this.target=e.target||e.srcElement,this.g=t,(t=e.relatedTarget)||("mouseover"==r?t=e.fromElement:"mouseout"==r&&(t=e.toElement)),this.relatedTarget=t,i?(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=e.pointerType,this.state=e.state,this.i=e,e.defaultPrevented&&M.Z.h.call(this)},M.prototype.h=function(){M.Z.h.call(this);let e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var U="closure_listenable_"+(1e6*Math.random()|0),F=0;function V(e,t,r,i,n){this.listener=e,this.proxy=null,this.src=t,this.type=r,this.capture=!!i,this.ha=n,this.key=++F,this.da=this.fa=!1}function B(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function j(e,t,r){for(let i in e)t.call(r,e[i],i,e)}function $(e){let t={};for(let r in e)t[r]=e[r];return t}let H="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
15ing toString valueOf".split(" ");function q(e,t){let r,i;for(let t=1;t<arguments.length;t++){for(r in i=arguments[t])e[r]=i[r];for(let t=0;t<H.length;t++)r=H[t],Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}}function z(e){this.src=e,this.g={},this.h=0}function W(e,t){let r=t.type;if(r in e.g){var i,n=e.g[r],s=Array.prototype.indexOf.call(n,t,void 0);(i=s>=0)&&Array.prototype.splice.call(n,s,1),i&&(B(t),0==e.g[r].length&&(delete e.g[r],e.h--))}}function K(e,t,r,i){for(let n=0;n<e.length;++n){let s=e[n];if(!s.da&&s.listener==t&&!!r==s.capture&&s.ha==i)return n}return -1}z.prototype.add=function(e,t,r,i,n){let s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);let a=K(e,t,i,n);return a>-1?(t=e[a],r||(t.fa=!1)):((t=new V(t,this.src,s,!!i,n)).fa=r,e.push(t)),t};var G="closure_lm_"+(1e6*Math.random()|0),J={};function X(e,t,r,i,n,s){if(!t)throw Error("Invalid event type");let a=g(n)?!!n.capture:!!n,o=ee(e);if(o||(e[G]=o=new z(e)),(r=o.add(t,r,i,a,s)).proxy)return r;if(i=function e(t){return Z.call(e.src,e.listener,t)},r.proxy=i,i.src=e,i.listener=r,e.addEventListener)x||(n=a),void 0===n&&(n=!1),e.addEventListener(t.toString(),i,n);else if(e.attachEvent)e.attachEvent(Y(t.toString()),i);else if(e.addListener&&e.removeListener)e.addListener(i);else throw Error("addEventListener and attachEvent are unavailable.");return r}function Q(e){if("number"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[U])W(t.i,e);else{var r=e.type,i=e.proxy;t.removeEventListener?t.removeEventListener(r,i,e.capture):t.detachEvent?t.detachEvent(Y(r),i):t.addListener&&t.removeListener&&t.removeListener(i),(r=ee(t))?(W(r,e),0==r.h&&(r.src=null,t[G]=null)):B(e)}}}function Y(e){return e in J?J[e]:J[e]="on"+e}function Z(e,t){if(e.da)e=!0;else{t=new M(t,this);let r=e.listener,i=e.ha||e.src;e.fa&&Q(e),e=r.call(i,t)}return e}function ee(e){return(e=e[G])instanceof z?e:null}var et="__closure_events_fn_"+(1e9*Math.random()>>>0);function er(e){return"function"==typeof e?e:(e[et]||(e[et]=function(t){return e.handleEvent(t)}),e[et])}function ei(){O.call(this),this.i=new z(this),this.M=this,this.G=null}function en(e,t){let r,i;var n,s=e.G;if(s)for(n=[];s;s=s.G)n.push(s);if(e=e.M,s=t.type||t,"string"==typeof t)t=new D(t,e);else if(t instanceof D)t.target=t.target||e;else{var a=t;q(t=new D(s,e),a)}if(a=!0,n)for(i=n.length-1;i>=0;i--)a=es(r=t.g=n[i],s,!0,t)&&a;if(a=es(r=t.g=e,s,!0,t)&&a,a=es(r,s,!1,t)&&a,n)for(i=0;i<n.length;i++)a=es(r=t.g=n[i],s,!1,t)&&a}function es(e,t,r,i){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();let n=!0;for(let s=0;s<t.length;++s){let a=t[s];if(a&&!a.da&&a.capture==r){let t=a.listener,r=a.ha||a.src;a.fa&&W(e.i,a),n=!1!==t.call(r,i)&&n}}return n&&!i.defaultPrevented}w(ei,O),ei.prototype[U]=!0,ei.prototype.removeEventListener=function(e,t,r,i){!function e(t,r,i,n,s){if(Array.isArray(r))for(var a=0;a<r.length;a++)e(t,r[a],i,n,s);else(n=g(n)?!!n.capture:!!n,i=er(i),t&&t[U])?(t=t.i,(a=String(r).toString())in t.g&&(i=K(r=t.g[a],i,n,s))>-1&&(B(r[i]),Array.prototype.splice.call(r,i,1),0==r.length&&(delete t.g[a],t.h--))):t&&(t=ee(t))&&(r=t.g[r.toString()],t=-1,r&&(t=K(r,i,n,s)),(i=t>-1?r[t]:null)&&Q(i))}(this,e,t,r,i)},ei.prototype.N=function(){if(ei.Z.N.call(this),this.i){var e=this.i;for(let t in e.g){let r=e.g[t];for(let e=0;e<r.length;e++)B(r[e]);delete e.g[t],e.h--}}this.G=null},ei.prototype.J=function(e,t,r,i){return this.i.add(String(e),t,!1,r,i)},ei.prototype.K=function(e,t,r,i){return this.i.add(String(e),t,!0,r,i)};class ea extends O{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:function e(t){t.g=function(e,t){if("function"!=typeof e)if(e&&"function"==typeof e.handleEvent)e=y(e.handleEvent,e);else throw Error("Invalid listener argument");return Number(t)>0x7fffffff?-1:p.setTimeout(e,t||0)}(()=>{t.g=null,t.i&&(t.i=!1,e(t))},t.l);let r=t.h;t.h=null,t.m.apply(null,r)}(this)}N(){super.N(),this.g&&(p.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function eo(e){O.call(this),this.h=e,this.g={}}w(eo,O);var el=[];function eh(e){j(e.g,function(e,t){this.g.hasOwnProperty(t)&&Q(e)},e),e.g={}}eo.prototype.N=function(){eo.Z.N.call(this),eh(this)},eo.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var eu=p.JSON.stringify,ec=p.JSON.parse,ed=class{stringify(e){return p.JSON.stringify(e,void 0)}parse(e){return p.JSON.parse(e,void 0)}};function ef(){}function ep(){}var eg={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function em(){D.call(this,"d")}function ey(){D.call(this,"c")}w(em,D),w(ey,D);var ev={},ew=null;function eE(){return ew=ew||new ei}function e_(e){D.call(this,ev.Ia,e)}function eb(e){let t=eE();en(t,new e_(t))}function eI(e,t){D.call(this,ev.STAT_EVENT,e),this.stat=t}function eT(e){let t=eE();en(t,new eI(t,e))}function eS(e,t){D.call(this,ev.Ja,e),this.size=t}function eA(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return p.setTimeout(function(){e()},t)}function eC(){this.g=!0}function ek(e,t,r,i){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{let s=JSON.parse(t);if(s){for(e=0;e<s.length;e++)if(Array.isArray(s[e])){var r=s[e];if(!(r.length<2)){var i=r[1];if(Array.isArray(i)&&!(i.length<1)){var n=i[0];if("noop"!=n&&"stop"!=n&&"close"!=n)for(let e=1;e<i.length;e++)i[e]=""}}}}return eu(s)}catch(e){return t}}(e,r)+(i?" "+i:"")})}ev.Ia="serverreachability",w(e_,D),ev.STAT_EVENT="statevent",w(eI,D),ev.Ja="timingevent",w(eS,D),eC.prototype.ua=function(){this.g=!1},eC.prototype.info=function(){};var eR={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},eP={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function eN(){}function eO(e){return encodeURIComponent(String(e))}function eD(e,t,r,i){this.j=e,this.i=t,this.l=r,this.S=i||1,this.V=new eo(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new ex}function ex(){this.i=null,this.g="",this.h=!1}w(eN,ef),eN.prototype.g=function(){return new XMLHttpRequest},e=new eN;var eL={},eM={};function eU(e,t,r){e.M=1,e.A=e8(e2(t)),e.u=r,e.R=!0,eF(e,null)}function eF(e,t){e.F=Date.now(),eB(e),e.B=e2(e.A);var r,i,n,s,a,o,l=e.B,h=e.S;Array.isArray(h)||(h=[String(h)]),tc(l.i,"t",h),e.C=0,l=e.j.L,e.h=new ex,e.g=tQ(e.j,l?t:null,!e.u),e.P>0&&(e.O=new ea(y(e.Y,e,e.g),e.P)),t=e.V,l=e.g,h=e.ba;var u="readystatechange";Array.isArray(u)||(u&&(el[0]=u.toString()),u=el);for(let e=0;e<u.length;e++){let r=function e(t,r,i,n,s){if(n&&n.once)return function e(t,r,i,n,s){if(Array.isArray(r)){for(let a=0;a<r.length;a++)e(t,r[a],i,n,s);return null}return i=er(i),t&&t[U]?t.K(r,i,g(n)?!!n.capture:!!n,s):X(t,r,i,!0,n,s)}(t,r,i,n,s);if(Array.isArray(r)){for(let a=0;a<r.length;a++)e(t,r[a],i,n,s);return null}return i=er(i),t&&t[U]?t.J(r,i,g(n)?!!n.capture:!!n,s):X(t,r,i,!1,n,s)}(l,u[e],h||t.handleEvent,!1,t.h||t);if(!r)break;t.g[r.key]=r}t=e.J?$(e.J):{},e.u?(e.v||(e.v="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.B,e.v,e.u,t)):(e.v="GET",e.g.ea(e.B,e.v,null,t)),eb(),r=e.i,i=e.v,n=e.B,s=e.l,a=e.S,o=e.u,r.info(function(){if(r.g)if(o){var e="",t=o.split("&");for(let r=0;r<t.length;r++){var l=t[r].split("=");if(l.length>1){let t=l[0];l=l[1];let r=t.split("_");e=r.length>=2&&"type"==r[1]?e+(t+"=")+l+"&":e+(t+"=redacted&")}}}else e=null;else e=o;return"XMLHTTP REQ ("+s+") [attempt "+a+"]: "+i+"\n"+n+"\n"+e})}function eV(e){return!!e.g&&"GET"==e.v&&2!=e.M&&e.j.Aa}function eB(e){e.T=Date.now()+e.H,ej(e,e.H)}function ej(e,t){if(null!=e.D)throw Error("WatchDog timer not null");e.D=eA(y(e.aa,e),t)}function e$(e){e.D&&(p.clearTimeout(e.D),e.D=null)}function eH(e){0==e.j.I||e.K||tW(e.j,e)}function eq(e){e$(e);var t=e.O;t&&"function"==typeof t.dispose&&t.dispose(),e.O=null,eh(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.dis
15pose())}function ez(e,t){try{var r=e.j;if(0!=r.I&&(r.g==e||eX(r.h,e))){if(!e.L&&eX(r.h,e)&&3==r.I){try{var i=r.Ba.g.parse(t)}catch(e){i=null}if(Array.isArray(i)&&3==i.length){var n=i;if(0==n[0]){e:if(!r.v){if(r.g)if(r.g.F+3e3<e.F)tz(r),tL(r);else break e;t$(r),eT(18)}}else r.xa=n[1],0<r.xa-r.K&&n[2]<37500&&r.F&&0==r.A&&!r.C&&(r.C=eA(y(r.Va,r),6e3));1>=eJ(r.h)&&r.ta&&(r.ta=void 0)}else tG(r,11)}else if((e.L||r.g==e)&&tz(r),!L(t))for(n=r.Ba.g.parse(t),t=0;t<n.length;t++){let o=n[t],l=o[0];if(!(l<=r.K))if(r.K=l,o=o[1],2==r.I)if("c"==o[0]){r.M=o[1],r.ba=o[2];let t=o[3];null!=t&&(r.ka=t,r.j.info("VER="+r.ka));let n=o[4];null!=n&&(r.za=n,r.j.info("SVER="+r.za));let l=o[5];null!=l&&"number"==typeof l&&l>0&&(r.O=i=1.5*l,r.j.info("backChannelRequestTimeoutMs_="+i)),i=r;let h=e.g;if(h){let e=h.g?h.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var s=i.h;s.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(s.j=s.l,s.g=new Set,s.h&&(eQ(s,s.h),s.h=null))}if(i.G){let e=h.g?h.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(i.wa=e,e4(i.J,i.G,e))}}if(r.I=3,r.l&&r.l.ra(),r.aa&&(r.T=Date.now()-e.F,r.j.info("Handshake RTT: "+r.T+"ms")),(i=r).na=tX(i,i.L?i.ba:null,i.W),e.L){eY(i.h,e);var a=i.O;a&&(e.H=a),e.D&&(e$(e),eB(e)),i.g=e}else tj(i);r.i.length>0&&tU(r)}else"stop"!=o[0]&&"close"!=o[0]||tG(r,7);else 3==r.I&&("stop"==o[0]||"close"==o[0]?"stop"==o[0]?tG(r,7):tx(r):"noop"!=o[0]&&r.l&&r.l.qa(o),r.A=0)}}eb(4)}catch(e){}}eD.prototype.ba=function(e){e=e.target;let t=this.O;t&&3==tP(e)?t.j():this.Y(e)},eD.prototype.Y=function(e){try{if(e==this.g)e:{let d=tP(this.g),f=this.g.ya(),g=this.g.ca();if(!(d<3)&&(3!=d||this.g&&(this.h.h||this.g.la()||tN(this.g)))){this.K||4!=d||7==f||(8==f||g<=0?eb(3):eb(2)),e$(this);var t=this.g.ca();this.X=t;var r=function(e){if(!eV(e))return e.g.la();let t=tN(e.g);if(""===t)return"";let r="",i=t.length,n=4==tP(e.g);if(!e.h.i){if("undefined"==typeof TextDecoder)return eq(e),eH(e),"";e.h.i=new p.TextDecoder}for(let s=0;s<i;s++)e.h.h=!0,r+=e.h.i.decode(t[s],{stream:!(n&&s==i-1)});return t.length=0,e.h.g+=r,e.C=0,e.h.g}(this);if(this.o=200==t,i=this.i,n=this.v,s=this.B,a=this.l,o=this.S,i.info(function(){return"XMLHTTP RESP ("+a+") [ attempt "+o+"]: "+n+"\n"+s+"\n"+d+" "+t}),this.o){if(this.U&&!this.L){t:{if(this.g){var i,n,s,a,o,l,h=this.g;if((l=h.g?h.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!L(l)){var u=l;break t}}u=null}if(e=u)ek(this.i,this.l,e,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,ez(this,e);else{this.o=!1,this.m=3,eT(12),eq(this),eH(this);break e}}if(this.R){let t;for(e=!0;!this.K&&this.C<r.length;)if((t=function(e,t){var r=e.C,i=t.indexOf("\n",r);return -1==i?eM:isNaN(r=Number(t.substring(r,i)))?eL:(i+=1)+r>t.length?eM:(t=t.slice(i,i+r),e.C=i+r,t)}(this,r))==eM){4==d&&(this.m=4,eT(14),e=!1),ek(this.i,this.l,null,"[Incomplete Response]");break}else if(t==eL){this.m=4,eT(15),ek(this.i,this.l,r,"[Invalid Chunk]"),e=!1;break}else ek(this.i,this.l,t,null),ez(this,t);if(eV(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=d||0!=r.length||this.h.h||(this.m=1,eT(16),e=!1),this.o=this.o&&e,e){if(r.length>0&&!this.W){this.W=!0;var c=this.j;c.g==this&&c.aa&&!c.P&&(c.j.info("Great, no buffering proxy detected. Bytes received: "+r.length),tH(c),c.P=!0,eT(11))}}else ek(this.i,this.l,r,"[Invalid Chunked Response]"),eq(this),eH(this)}else ek(this.i,this.l,r,null),ez(this,r);4==d&&eq(this),this.o&&!this.K&&(4==d?tW(this.j,this):(this.o=!1,eB(this)))}else(function(e){let t={};e=(e.g&&tP(e)>=2&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let i=0;i<e.length;i++){if(L(e[i]))continue;var r=function(e){var t=1;e=e.split(":");let r=[];for(;t>0&&e.length;)r.push(e.shift()),t--;return e.length&&r.push(e.join(":")),r}(e[i]);let n=r[0];if("string"!=typeof(r=r[1]))continue;r=r.trim();let s=t[n]||[];t[n]=s,s.push(r)}var i=function(e){return e.join(", ")};for(let e in t)i.call(void 0,t[e],e,t)})(this.g),400==t&&r.indexOf("Unknown SID")>0?(this.m=3,eT(12)):(this.m=0,eT(13)),eq(this),eH(this)}}}catch(e){}finally{}},eD.prototype.cancel=function(){this.K=!0,eq(this)},eD.prototype.aa=function(){var e,t;this.D=null;let r=Date.now();r-this.T>=0?(e=this.i,t=this.B,e.info(function(){return"TIMEOUT: "+t}),2!=this.M&&(eb(),eT(17)),eq(this),this.m=2,eH(this)):ej(this,this.T-r)};var eW=class{constructor(e,t){this.g=e,this.map=t}};function eK(e){this.l=e||10,e=p.PerformanceNavigationTiming?(e=p.performance.getEntriesByType("navigation")).length>0&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):!!(p.chrome&&p.chrome.loadTimes&&p.chrome.loadTimes()&&p.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function eG(e){return!!e.h||!!e.g&&e.g.size>=e.j}function eJ(e){return e.h?1:e.g?e.g.size:0}function eX(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function eQ(e,t){e.g?e.g.add(t):e.h=t}function eY(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function eZ(e){if(null!=e.h)return e.i.concat(e.h.G);if(null!=e.g&&0!==e.g.size){let t=e.i;for(let r of e.g.values())t=t.concat(r.G);return t}return I(e.i)}eK.prototype.cancel=function(){if(this.i=eZ(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(let e of this.g.values())e.cancel();this.g.clear()}};var e0=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function e1(e){let t;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,e instanceof e1?(this.l=e.l,e6(this,e.j),this.o=e.o,this.g=e.g,e3(this,e.u),this.h=e.h,e5(this,td(e.i)),this.m=e.m):e&&(t=String(e).match(e0))?(this.l=!1,e6(this,t[1]||"",!0),this.o=e7(t[2]||""),this.g=e7(t[3]||"",!0),e3(this,t[4]),this.h=e7(t[5]||"",!0),e5(this,t[6]||"",!0),this.m=e7(t[7]||"")):(this.l=!1,this.i=new ta(null,this.l))}function e2(e){return new e1(e)}function e6(e,t,r){e.j=r?e7(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function e3(e,t){if(t){if(isNaN(t=Number(t))||t<0)throw Error("Bad port number "+t);e.u=t}else e.u=null}function e5(e,t,r){var i,n;t instanceof ta?(e.i=t,i=e.i,(n=e.l)&&!i.j&&(to(i),i.i=null,i.g.forEach(function(e,t){let r=t.toLowerCase();t!=r&&(tl(this,t),tc(this,r,e))},i)),i.j=n):(r||(t=e9(t,tn)),e.i=new ta(t,e.l))}function e4(e,t,r){e.i.set(t,r)}function e8(e){return e4(e,"zx",Math.floor(0x80000000*Math.random()).toString(36)+Math.abs(Math.floor(0x80000000*Math.random())^Date.now()).toString(36)),e}function e7(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function e9(e,t,r){return"string"==typeof e?(e=encodeURI(e).replace(t,te),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function te(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}e1.prototype.toString=function(){let e=[];var t=this.j;t&&e.push(e9(t,tt,!0),":");var r=this.g;return(r||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(e9(t,tt,!0),"@"),e.push(eO(r).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(r=this.u)&&e.push(":",String(r))),(r=this.h)&&(this.g&&"/"!=r.charAt(0)&&e.push("/"),e.push(e9(r,"/"==r.charAt(0)?ti:tr,!0))
15),(r=this.i.toString())&&e.push("?",r),(r=this.m)&&e.push("#",e9(r,ts)),e.join("")},e1.prototype.resolve=function(e){let t=e2(this),r=!!e.j;r?e6(t,e.j):r=!!e.o,r?t.o=e.o:r=!!e.g,r?t.g=e.g:r=null!=e.u;var i=e.h;if(r)e3(t,e.u);else if(r=!!e.h){if("/"!=i.charAt(0))if(this.g&&!this.h)i="/"+i;else{var n=t.h.lastIndexOf("/");-1!=n&&(i=t.h.slice(0,n+1)+i)}if(".."==(n=i)||"."==n)i="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){i=0==n.lastIndexOf("/",0),n=n.split("/");let e=[];for(let t=0;t<n.length;){let r=n[t++];"."==r?i&&t==n.length&&e.push(""):".."==r?((e.length>1||1==e.length&&""!=e[0])&&e.pop(),i&&t==n.length&&e.push("")):(e.push(r),i=!0)}i=e.join("/")}else i=n}return r?t.h=i:r=""!==e.i.toString(),r?e5(t,td(e.i)):r=!!e.m,r&&(t.m=e.m),t};var tt=/[#\/\?@]/g,tr=/[#\?:]/g,ti=/[#\?]/g,tn=/[#\?@]/g,ts=/#/g;function ta(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function to(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(let r=0;r<e.length;r++){let i=e[r].indexOf("="),n,s=null;i>=0?(n=e[r].substring(0,i),s=e[r].substring(i+1)):n=e[r],t(n,s?decodeURIComponent(s.replace(/\+/g," ")):"")}}}(e.i,function(t,r){e.add(decodeURIComponent(t.replace(/\+/g," ")),r)}))}function tl(e,t){to(e),t=tf(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function th(e,t){return to(e),t=tf(e,t),e.g.has(t)}function tu(e,t){to(e);let r=[];if("string"==typeof t)th(e,t)&&(r=r.concat(e.g.get(tf(e,t))));else for(e=Array.from(e.g.values()),t=0;t<e.length;t++)r=r.concat(e[t]);return r}function tc(e,t,r){tl(e,t),r.length>0&&(e.i=null,e.g.set(tf(e,t),I(r)),e.h+=r.length)}function td(e){let t=new ta;return t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),t}function tf(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function tp(e,t,r,i,n){try{n&&(n.onload=null,n.onerror=null,n.onabort=null,n.ontimeout=null),i(r)}catch(e){}}function tg(){this.g=new ed}function tm(e){this.i=e.Sb||null,this.h=e.ab||!1}function ty(e,t){ei.call(this),this.H=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function tv(e){e.j.read().then(e.Ma.bind(e)).catch(e.ga.bind(e))}function tw(e){e.readyState=4,e.l=null,e.j=null,e.B=null,tE(e)}function tE(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function t_(e){let t="";return j(e,function(e,r){t+=r,t+=":",t+=e,t+="\r\n"}),t}function tb(e,t,r){e:{for(i in r){var i=!1;break e}i=!0}i||(r=t_(r),"string"==typeof e?null!=r&&eO(r):e4(e,t,r))}function tI(e){ei.call(this),this.headers=new Map,this.L=e||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(t=ta.prototype).add=function(e,t){to(this),this.i=null,e=tf(this,e);let r=this.g.get(e);return r||this.g.set(e,r=[]),r.push(t),this.h+=1,this},t.forEach=function(e,t){to(this),this.g.forEach(function(r,i){r.forEach(function(r){e.call(t,r,i,this)},this)},this)},t.set=function(e,t){return to(this),this.i=null,th(this,e=tf(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},t.get=function(e,t){return e&&(e=tu(this,e)).length>0?String(e[0]):t},t.toString=function(){if(this.i)return this.i;if(!this.g)return"";let e=[],t=Array.from(this.g.keys());for(let i=0;i<t.length;i++){var r=t[i];let n=eO(r);r=tu(this,r);for(let t=0;t<r.length;t++){let i=n;""!==r[t]&&(i+="="+eO(r[t])),e.push(i)}}return this.i=e.join("&")},w(tm,ef),tm.prototype.g=function(){return new ty(this.i,this.h)},w(ty,ei),(t=ty.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=e,this.D=t,this.readyState=1,tE(this)},t.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;let t={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};e&&(t.body=e),(this.H||p).fetch(new Request(this.D,t)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,tw(this)),this.readyState=0},t.Pa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,tE(this)),this.g&&(this.readyState=3,tE(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==p.ReadableStream&&"body"in e){if(this.j=e.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.B=new TextDecoder;tv(this)}else e.text().then(this.Oa.bind(this),this.ga.bind(this))},t.Ma=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.B.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?tw(this):tE(this),3==this.readyState&&tv(this)}},t.Oa=function(e){this.g&&(this.response=this.responseText=e,tw(this))},t.Na=function(e){this.g&&(this.response=e,tw(this))},t.ga=function(){this.g&&tw(this)},t.setRequestHeader=function(e,t){this.A.append(e,t)},t.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";let e=[],t=this.h.entries();for(var r=t.next();!r.done;)e.push((r=r.value)[0]+": "+r[1]),r=t.next();return e.join("\r\n")},Object.defineProperty(ty.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),w(tI,ei);var tT=/^https?$/i,tS=["POST","PUT"];function tA(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.o=5,tC(e),tR(e)}function tC(e){e.A||(e.A=!0,en(e,"complete"),en(e,"error"))}function tk(e){if(e.h&&void 0!==f){if(e.v&&4==tP(e))setTimeout(e.Ca.bind(e),0);else if(en(e,"readystatechange"),4==tP(e)){e.h=!1;try{let s=e.ca();switch(s){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t,r,i=!0;break;default:i=!1}if(!(t=i)){if(r=0===s){let t=String(e.D).match(e0)[1]||null;!t&&p.self&&p.self.location&&(t=p.self.location.protocol.slice(0,-1)),r=!tT.test(t?t.toLowerCase():"")}t=r}if(t)en(e,"complete"),en(e,"success");else{e.o=6;try{var n=tP(e)>2?e.g.statusText:""}catch(e){n=""}e.l=n+" ["+e.ca()+"]",tC(e)}}finally{tR(e)}}}}function tR(e,t){if(e.g){e.m&&(clearTimeout(e.m),e.m=null);let r=e.g;e.g=null,t||en(e,"ready");try{r.onreadystatechange=null}catch(e){}}}function tP(e){return e.g?e.g.readyState:0}function tN(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.F){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}
15function tO(e,t,r){return r&&r.internalChannelParams&&r.internalChannelParams[e]||t}function tD(e){this.za=0,this.i=[],this.j=new eC,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=tO("failFast",!1,e),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=tO("baseRetryDelayMs",5e3,e),this.Za=tO("retryDelaySeedMs",1e4,e),this.Ta=tO("forwardChannelMaxRetries",2,e),this.va=tO("forwardChannelRequestTimeoutMs",2e4,e),this.ma=e&&e.xmlHttpFactory||void 0,this.Ua=e&&e.Rb||void 0,this.Aa=e&&e.useFetchStreams||!1,this.O=void 0,this.L=e&&e.supportsCrossDomainXhr||!1,this.M="",this.h=new eK(e&&e.concurrentRequestLimit),this.Ba=new tg,this.S=e&&e.fastHandshake||!1,this.R=e&&e.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=e&&e.Pb||!1,e&&e.ua&&this.j.ua(),e&&e.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&e&&e.detectBufferingProxy||!1,this.ia=void 0,e&&e.longPollingTimeout&&e.longPollingTimeout>0&&(this.ia=e.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function tx(e){if(tM(e),3==e.I){var t=e.V++,r=e2(e.J);if(e4(r,"SID",e.M),e4(r,"RID",t),e4(r,"TYPE","terminate"),tV(e,r),(t=new eD(e,e.j,t)).M=2,t.A=e8(e2(r)),r=!1,p.navigator&&p.navigator.sendBeacon)try{r=p.navigator.sendBeacon(t.A.toString(),"")}catch(e){}!r&&p.Image&&((new Image).src=t.A,r=!0),r||(t.g=tQ(t.j,null),t.g.ea(t.A)),t.F=Date.now(),eB(t)}tJ(e)}function tL(e){e.g&&(tH(e),e.g.cancel(),e.g=null)}function tM(e){tL(e),e.v&&(p.clearTimeout(e.v),e.v=null),tz(e),e.h.cancel(),e.m&&("number"==typeof e.m&&p.clearTimeout(e.m),e.m=null)}function tU(e){if(!eG(e.h)&&!e.m){e.m=!0;var t=e.Ea;C||P(),k||(C(),k=!0),R.add(t,e),e.D=0}}function tF(e,t){var r;r=t?t.l:e.V++;let i=e2(e.J);e4(i,"SID",e.M),e4(i,"RID",r),e4(i,"AID",e.K),tV(e,i),e.u&&e.o&&tb(i,e.u,e.o),r=new eD(e,e.j,r,e.D+1),null===e.u&&(r.J=e.o),t&&(e.i=t.G.concat(e.i)),t=tB(e,r,1e3),r.H=Math.round(.5*e.va)+Math.round(.5*e.va*Math.random()),eQ(e.h,r),eU(r,i,t)}function tV(e,t){e.H&&j(e.H,function(e,r){e4(t,r,e)}),e.l&&j({},function(e,r){e4(t,r,e)})}function tB(e,t,r){r=Math.min(e.i.length,r);let i=e.l?y(e.l.Ka,e.l,e):null;e:{var n=e.i;let t=-1;for(;;){let e=["count="+r];-1==t?r>0?(t=n[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let o=!0;for(let l=0;l<r;l++){var s=n[l].g;let r=n[l].map;if((s-=t)<0)t=Math.max(0,n[l].g-100),o=!1;else try{s="req"+s+"_";try{var a=r instanceof Map?r:Object.entries(r);for(let[t,r]of a){let i=r;g(r)&&(i=eu(r)),e.push(s+t+"="+encodeURIComponent(i))}}catch(t){throw e.push(s+"type="+encodeURIComponent("_badmap")),t}}catch(e){i&&i(r)}}if(o){a=e.join("&");break e}}a=void 0}return t.G=e=e.i.splice(0,r),a}function tj(e){if(!e.g&&!e.v){e.Y=1;var t=e.Da;C||P(),k||(C(),k=!0),R.add(t,e),e.A=0}}function t$(e){return!e.g&&!e.v&&!(e.A>=3)&&(e.Y++,e.v=eA(y(e.Da,e),tK(e,e.A)),e.A++,!0)}function tH(e){null!=e.B&&(p.clearTimeout(e.B),e.B=null)}function tq(e){e.g=new eD(e,e.j,"rpc",e.Y),null===e.u&&(e.g.J=e.o),e.g.P=0;var t=e2(e.na);e4(t,"RID","rpc"),e4(t,"SID",e.M),e4(t,"AID",e.K),e4(t,"CI",e.F?"0":"1"),!e.F&&e.ia&&e4(t,"TO",e.ia),e4(t,"TYPE","xmlhttp"),tV(e,t),e.u&&e.o&&tb(t,e.u,e.o),e.O&&(e.g.H=e.O);var r=e.g;e=e.ba,r.M=1,r.A=e8(e2(t)),r.u=null,r.R=!0,eF(r,e)}function tz(e){null!=e.C&&(p.clearTimeout(e.C),e.C=null)}function tW(e,t){var r,i=null;if(e.g==t){tz(e),tH(e),e.g=null;var n=2}else{if(!eX(e.h,t))return;i=t.G,eY(e.h,t),n=1}if(0!=e.I){if(t.o)if(1==n){i=t.u?t.u.length:0,t=Date.now()-t.F;var s=e.D;en(n=eE(),new eS(n,i)),tU(e)}else tj(e);else if(3==(s=t.m)||0==s&&t.X>0||!(1==n&&(r=t,!(eJ(e.h)>=e.h.j-!!e.m)&&(e.m?(e.i=r.G.concat(e.i),!0):1!=e.I&&2!=e.I&&!(e.D>=(e.Sa?0:e.Ta))&&(e.m=eA(y(e.Ea,e,r),tK(e,e.D)),e.D++,!0)))||2==n&&t$(e)))switch(i&&i.length>0&&((t=e.h).i=t.i.concat(i)),s){case 1:tG(e,5);break;case 4:tG(e,10);break;case 3:tG(e,6);break;default:tG(e,2)}}}function tK(e,t){let r=e.Qa+Math.floor(Math.random()*e.Za);return e.isActive()||(r*=2),r*t}function tG(e,t){if(e.j.info("Error code "+t),2==t){let t,s,a;var r,i=y(e.bb,e),n=e.Ua;let o=!n;n=new e1(n||"//www.google.com/images/cleardot.gif"),p.location&&"http"==p.location.protocol||e6(n,"https"),e8(n),o?function(e,t){let r=new eC;if(p.Image){let i=new Image;i.onload=v(tp,r,"TestLoadImage: loaded",!0,t,i),i.onerror=v(tp,r,"TestLoadImage: error",!1,t,i),i.onabort=v(tp,r,"TestLoadImage: abort",!1,t,i),i.ontimeout=v(tp,r,"TestLoadImage: timeout",!1,t,i),p.setTimeout(function(){i.ontimeout&&i.ontimeout()},1e4),i.src=e}else t(!1)}(n.toString(),i):(r=n.toString(),t=new eC,s=new AbortController,a=setTimeout(()=>{s.abort(),tp(t,"TestPingServer: timeout",!1,i)},1e4),fetch(r,{signal:s.signal}).then(e=>{clearTimeout(a),e.ok?tp(t,"TestPingServer: ok",!0,i):tp(t,"TestPingServer: server error",!1,i)}).catch(()=>{clearTimeout(a),tp(t,"TestPingServer: error",!1,i)}))}else eT(2);e.I=0,e.l&&e.l.pa(t),tJ(e),tM(e)}function tJ(e){if(e.I=0,e.ja=[],e.l){let t=eZ(e.h);
15(0!=t.length||0!=e.i.length)&&(T(e.ja,t),T(e.ja,e.i),e.h.i.length=0,I(e.i),e.i.length=0),e.l.oa()}}function tX(e,t,r){var i=r instanceof e1?e2(r):new e1(r);if(""!=i.g)t&&(i.g=t+"."+i.g),e3(i,i.u);else{var n=p.location;i=n.protocol,t=t?t+"."+n.hostname:n.hostname,n=+n.port;let e=new e1(null);i&&e6(e,i),t&&(e.g=t),n&&e3(e,n),r&&(e.h=r),i=e}return r=e.G,t=e.wa,r&&t&&e4(i,r,t),e4(i,"VER",e.ka),tV(e,i),i}function tQ(e,t,r){if(t&&!e.L)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new tI(e.Aa&&!e.ma?new tm({ab:r}):e.ma)).Fa(e.L),t}function tY(){}function tZ(){}function t0(e,t){ei.call(this),this.g=new tD(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.sa&&(e?e["X-WebChannel-Client-Profile"]=t.sa:e={"X-WebChannel-Client-Profile":t.sa}),this.g.U=e,(e=t&&t.Qb)&&!L(e)&&(this.g.u=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!L(t)&&(this.g.G=t,null!==(e=this.h)&&t in e&&t in(e=this.h)&&delete e[t]),this.j=new t6(this)}function t1(e){em.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(let r in t){e=r;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function t2(){ey.call(this),this.status=1}function t6(e){this.g=e}(t=tI.prototype).Fa=function(e){this.H=e},t.ea=function(t,r,i,n){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+t);r=r?r.toUpperCase():"GET",this.D=t,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():e.g(),this.g.onreadystatechange=b(y(this.Ca,this));try{this.B=!0,this.g.open(r,String(t),!0),this.B=!1}catch(e){tA(this,e);return}if(t=i||"",i=new Map(this.headers),n)if(Object.getPrototypeOf(n)===Object.prototype)for(var s in n)i.set(s,n[s]);else if("function"==typeof n.keys&&"function"==typeof n.get)for(let e of n.keys())i.set(e,n.get(e));else throw Error("Unknown input type for opt_headers: "+String(n));for(let[e,a]of(n=Array.from(i.keys()).find(e=>"content-type"==e.toLowerCase()),s=p.FormData&&t instanceof p.FormData,!(Array.prototype.indexOf.call(tS,r,void 0)>=0)||n||s||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i))this.g.setRequestHeader(e,a);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(t),this.v=!1}catch(e){tA(this,e)}},t.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=e||7,en(this,"complete"),en(this,"abort"),tR(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),tR(this,!0)),tI.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?tk(this):this.Xa())},t.Xa=function(){tk(this)},t.isActive=function(){return!!this.g},t.ca=function(){try{return tP(this)>2?this.g.status:-1}catch(e){return -1}},t.la=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},t.La=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),ec(t)}},t.ya=function(){return this.o},t.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(t=tD.prototype).ka=8,t.I=1,t.connect=function(e,t,r,i){eT(0),this.W=e,this.H=t||{},r&&void 0!==i&&(this.H.OSID=r,this.H.OAID=i),this.F=this.X,this.J=tX(this,null,this.W),tU(this)},t.Ea=function(e){if(this.m)if(this.m=null,1==this.I){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;let n=new eD(this,this.j,e),s=this.o;if(this.U&&(s?q(s=$(s),this.U):s=this.U),null!==this.u||this.R||(n.J=s,s=null),this.S)e:{for(var t=0,r=0;r<this.i.length;r++){t:{var i=this.i[r];if("__data__"in i.map&&"string"==typeof(i=i.map.__data__)){i=i.length;break t}i=void 0}if(void 0===i)break;if((t+=i)>4096){t=r;break e}if(4096===t||r===this.i.length-1){t=r+1;break e}}t=1e3}else t=1e3;t=tB(this,n,t),e4(r=e2(this.J),"RID",e),e4(r,"CVER",22),this.G&&e4(r,"X-HTTP-Session-Id",this.G),tV(this,r),s&&(this.R?t="headers="+eO(t_(s))+"&"+t:this.u&&tb(r,this.u,s)),eQ(this.h,n),this.Ra&&e4(r,"TYPE","init"),this.S?(e4(r,"$req",t),e4(r,"SID","null"),n.U=!0,eU(n,r,null)):eU(n,r,t),this.I=2}}else 3==this.I&&(e?tF(this,e):0==this.i.length||eG(this.h)||tF(this))}
15,t.Da=function(){if(this.v=null,tq(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var e=4*this.T;this.j.info("BP detection timer enabled: "+e),this.B=eA(y(this.Wa,this),e)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,eT(10),tL(this),tq(this))},t.Va=function(){null!=this.C&&(this.C=null,tL(this),t$(this),eT(19))},t.bb=function(e){e?(this.j.info("Successfully pinged google.com"),eT(2)):(this.j.info("Failed to ping google.com"),eT(1))},t.isActive=function(){return!!this.l&&this.l.isActive(this)},(t=tY.prototype).ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){},tZ.prototype.g=function(e,t){return new t0(e,t)},w(t0,ei),t0.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},t0.prototype.close=function(){tx(this.g)},t0.prototype.o=function(e){var t=this.g;if("string"==typeof e){var r={};r.__data__=e,e=r}else this.v&&((r={}).__data__=eu(e),e=r);t.i.push(new eW(t.Ya++,e)),3==t.I&&tU(t)},t0.prototype.N=function(){this.g.l=null,delete this.j,tx(this.g),delete this.g,t0.Z.N.call(this)},w(t1,em),w(t2,ey),w(t6,tY),t6.prototype.ra=function(){en(this.g,"a")},t6.prototype.qa=function(e){en(this.g,new t1(e))},t6.prototype.pa=function(e){en(this.g,new t2)},t6.prototype.oa=function(){en(this.g,"b")},tZ.prototype.createWebChannel=tZ.prototype.g,t0.prototype.send=t0.prototype.o,t0.prototype.open=t0.prototype.m,t0.prototype.close=t0.prototype.close,h=_.createWebChannelTransport=function(){return new tZ},l=_.getStatEventTarget=function(){return eE()},o=_.Event=ev,a=_.Stat={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},eR.NO_ERROR=0,eR.TIMEOUT=8,eR.HTTP_ERROR=6,s=_.ErrorCode=eR,eP.COMPLETE="complete",n=_.EventType=eP,ep.EventType=eg,eg.OPEN="a",eg.CLOSE="b",eg.ERROR="c",eg.MESSAGE="d",ei.prototype.listen=ei.prototype.J,i=_.WebChannel=ep,_.FetchXmlHttpFactory=tm,tI.prototype.listenOnce=tI.prototype.K,tI.prototype.getLastError=tI.prototype.Ha,tI.prototype.getLastErrorCode=tI.prototype.ya,tI.prototype.getStatus=tI.prototype.ca,tI.prototype.getResponseJson=tI.prototype.La,tI.prototype.getResponseText=tI.prototype.la,tI.prototype.send=tI.prototype.ea,tI.prototype.setWithCredentials=tI.prototype.Fa,r=_.XhrIo=tI}).apply(void 0!==E?E:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});let b="@firebase/firestore",I="4.9.3";class T{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}T.UNAUTHENTICATED=new T(null),T.GOOGLE_CREDENTIALS=new T("google-credentials-uid"),T.FIRST_PARTY=new T("first-party-uid"),T.MOCK_USER=new T("mock-user");let S="12.7.0",A=new m.Logger("@firebase/firestore");function C(){return A.logLevel}function k(e,...t){if(A.logLevel<=m.LogLevel.DEBUG){let r=t.map(N);A.debug(`Firestore (${S}): ${e}`,...r)}}function R(e,...t){if(A.logLevel<=m.LogLevel.ERROR){let r=t.map(N);A.error(`Firestore (${S}): ${e}`,...r)}}function P(e,...t){if(A.logLevel<=m.LogLevel.WARN){let r=t.map(N);A.warn(`Firestore (${S}): ${e}`,...r)}}function N(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}function O(e,t,r){let i="Unexpected state";"string"==typeof t?i=t:r=t,D(e,i,r)}function D(e,t,r){let i=`FIRESTORE (${S}) INTERNAL ASSERTION FAILED: ${t} (ID: ${e.toString(16)})`;if(void 0!==r)try{i+=" CONTEXT: "+JSON.stringify(r)}catch(e){i+=" CONTEXT: "+r}throw R(i),Error(i)}function x(e,t,r,i){let n="Unexpected state";"string"==typeof r?n=r:i=r,e||D(t,n,i)}let L={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",UNIMPLEMENT
15ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class M extends y.FirebaseError{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class U{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class F{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class V{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(T.UNAUTHENTICATED))}shutdown(){}}class B{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class j{constructor(e){this.t=e,this.currentUser=T.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){x(void 0===this.o,42304);let r=this.i,i=e=>this.i!==r?(r=this.i,t(e)):Promise.resolve(),n=new U;this.o=()=>{this.i++,this.currentUser=this.u(),n.resolve(),n=new U,e.enqueueRetryable(()=>i(this.currentUser))};let s=()=>{let t=n;e.enqueueRetryable(async()=>{await t.promise,await i(this.currentUser)})},a=e=>{k("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(e=>a(e)),setTimeout(()=>{if(!this.auth){let e=this.t.getImmediate({optional:!0});e?a(e):(k("FirebaseAuthCredentialsProvider","Auth not yet detected"),n.resolve(),n=new U)}},0),s()}getToken(){let e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(k("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(x("string"==typeof t.accessToken,31837,{l:t}),new F(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){let e=this.auth&&this.auth.getUid();return x(null===e||"string"==typeof e,2055,{h:e}),new T(e)}}class ${constructor(e,t,r){this.P=e,this.T=t,this.I=r,this.type="FirstParty",this.user=T.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);let e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class H{constructor(e,t,r){this.P=e,this.T=t,this.I=r}getToken(){return Promise.resolve(new $(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(T.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class q{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 z{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,(0,p._isFirebaseServerApp)(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){x(void 0===this.o,3512);let r=e=>{null!=e.error&&k("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);let r=e.token!==this.m;return this.m=e.token,k("FirebaseAppCheckTokenProvider",`Received ${r?"new":"existing"} token.`),r?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>r(t))};let i=e=>{k("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(e=>i(e)),setTimeout(()=>{if(!this.appCheck){let e=this.V.getImmediate({optional:!0});e?i(e):k("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new q(this.p));let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(x("string"==typeof e.token,44558,{tokenResult:e}),this.m=e.token,new q(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}class W{static newId(){let e=62*Math.floor(256/62),t="";for(;t.length<20;){let r=function(e){let t="undefined"!=typeof self&&(self.crypto||self.msCrypto),r=new 
15Uint8Array(40);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(r);else for(let e=0;e<40;e++)r[e]=Math.floor(256*Math.random());return r}(0);for(let i=0;i<r.length;++i)t.length<20&&r[i]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(r[i]%62))}return t}}function K(e,t){return e<t?-1:+(e>t)}function G(e,t){let r=Math.min(e.length,t.length);for(let i=0;i<r;i++){let r=e.charAt(i),n=t.charAt(i);if(r!==n)return J(r)===J(n)?K(r,n):J(r)?1:-1}return K(e.length,t.length)}function J(e){let t=e.charCodeAt(0);return t>=55296&&t<=57343}function X(e,t,r){return e.length===t.length&&e.every((e,i)=>r(e,t[i]))}let Q="__name__";class Y{constructor(e,t,r){void 0===t?t=0:t>e.length&&O(637,{offset:t,range:e.length}),void 0===r?r=e.length-t:r>e.length-t&&O(1746,{length:r,range:e.length-t}),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return 0===Y.comparator(this,e)}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof Y?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,r=this.limit();t<r;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){let r=Math.min(e.length,t.length);for(let i=0;i<r;i++){let r=Y.compareSegments(e.get(i),t.get(i));if(0!==r)return r}return K(e.length,t.length)}static compareSegments(e,t){let r=Y.isNumericId(e),i=Y.isNumericId(t);return r&&!i?-1:!r&&i?1:r&&i?Y.extractNumericId(e).compare(Y.extractNumericId(t)):G(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return t.fromString(e.substring(4,e.length-2))}}class Z extends Y{construct(e,t,r){return new Z(e,t,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){let t=[];for(let r of e){if(r.indexOf("//")>=0)throw new M(L.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(e=>e.length>0))}return new Z(t)}static emptyPath(){return new Z([])}}let ee=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class et extends Y{construct(e,t,r){return new et(e,t,r)}static isValidIdentifier(e){return ee.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),et.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===Q}static keyField(){return new et([Q])}static fromServerFormat(e){let t=[],r="",i=0,n=()=>{if(0===r.length)throw new M(L.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""},s=!1;for(;i<e.length;){let t=e[i];if("\\"===t){if(i+1===e.length)throw new M(L.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let t=e[i+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new M(L.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=t,i+=2}else"`"===t?s=!s:"."!==t||s?r+=t:n(),i++}if(n(),s)throw new M(L.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new et(t)}static emptyPath(){return new et([])}}class er{constructor(e){this.path=e}static fromPath(e){return new er(Z.fromString(e))}static fromName(e){return new er(Z.fromString(e).popFirst(5))}static empty(){return new er(Z.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===Z.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return Z.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new er(new Z(e.slice()))}}function ei(e,t){let r={typeString:e};return t&&(r.value=t),r}function en(e,t){let r;if("object"!=typeof e||null===e||Object.getPrototypeOf(e)!==Object.prototype&&null!==Object.getPrototypeOf(e))throw new M(L.INVALID_ARGUMENT,"JSON must be an object");for(let i in t)if(t[i]){let n=t[i].typeString,s="value"in t[i]?{value:t[i].value}:void 0;if(!(i in e)){r=`JSON missing required field: '${i}'`;break}let a=e[i];if(n&&typeof a!==n){r=`JSON field '${i}' must be a ${n}.`;break}if(void 0!==s&&a!==s.value){r=`Expected '${i}' field to equal '${s.value}'`;break}}if(r)throw new M(L.INVALID_ARGUMENT,r);return!0}class es{static now(){return es.fromMillis(Date.now())}static fromDate(e){return es.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3),r=Math.floor((e-1e3*t)*1e6);return new es(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0||t>=1e9)throw new M(L.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-0xe7791f700||e>=0x3afff44180)throw new M(L.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?K(this.nanoseconds,e.nanoseconds):K(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:es._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(en(e,es._jsonSchema))return new es(e.seconds,e.nanoseconds)}valueOf(){return String(this.seconds- -0xe7791f700).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
15}es._jsonSchemaVersion="firestore/timestamp/1.0",es._jsonSchema={type:ei("string",es._jsonSchemaVersion),seconds:ei("number"),nanoseconds:ei("number")};class ea{static fromTimestamp(e){return new ea(e)}static min(){return new ea(new es(0,0))}static max(){return new ea(new es(0x3afff4417f,0x3b9ac9ff))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class eo{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new eo(ea.min(),er.empty(),-1)}static max(){return new eo(ea.max(),er.empty(),-1)}}class el{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}class eh{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&O(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new eh((r,i)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(r,i)},this.catchCallback=e=>{this.wrapFailure(t,e).next(r,i)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof eh?t:eh.resolve(t)}catch(e){return eh.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):eh.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):eh.reject(t)}static resolve(e){return new eh((t,r)=>{t(e)})}static reject(e){return new eh((t,r)=>{r(e)})}static waitFor(e){return new eh((t,r)=>{let i=0,n=0,s=!1;e.forEach(e=>{++i,e.next(()=>{++n,s&&n===i&&t()},e=>r(e))}),s=!0,n===i&&t()})}static or(e){let t=eh.resolve(!1);for(let r of e)t=t.next(e=>e?eh.resolve(e):r());return t}static forEach(e,t){let r=[];return e.forEach((e,i)=>{r.push(t.call(this,e,i))}),this.waitFor(r)}static mapArray(e,t){return new eh((r,i)=>{let n=e.length,s=Array(n),a=0;for(let o=0;o<n;o++){let l=o;t(e[l]).next(e=>{s[l]=e,++a===n&&r(s)},e=>i(e))}})}static doWhile(e,t){return new eh((r,i)=>{let n=()=>{!0===e()?t().next(()=>{n()},i):r()};n()})}}function eu(e){return"IndexedDbTransactionError"===e.name}class ec{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ae(e),this.ue=e=>t.writeSequenceNumber(e))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this.ue&&this.ue(e),e}}ec.ce=-1;function ed(e){return 0===e&&1/e==-1/0}function ef(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function ep(e,t){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])}class eg{constructor(e,t){this.comparator=e,this.root=t||ey.EMPTY}insert(e,t){return new eg(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,ey.BLACK,null,null))}remove(e){return new eg(this.comparator,this.root.remove(e,this.comparator).copy(null,null,ey.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){let r=this.comparator(e,t.key);if(0===r)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){let i=this.comparator(e,r.key);if(0===i)return t+r.left.size;i<0?r=r.left:(t+=r.left.size+1,r=r.right)}return -1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,r)=>(e(t,r),!1))}toString(){let e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new em(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new em(this.root,e,this.comparator,!1)}getReverseIterator(){return new em(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new em(this.root,e,this.comparator,!0)}}
15class em{constructor(e,t,r,i){this.isReverse=i,this.nodeStack=[];let n=1;for(;!e.isEmpty();)if(n=t?r(e.key,t):1,t&&i&&(n*=-1),n<0)e=this.isReverse?e.left:e.right;else{if(0===n){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class ey{constructor(e,t,r,i,n){this.key=e,this.value=t,this.color=null!=r?r:ey.RED,this.left=null!=i?i:ey.EMPTY,this.right=null!=n?n:ey.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,i,n){return new ey(null!=e?e:this.key,null!=t?t:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=n?n:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let i=this,n=r(e,i.key);return(i=n<0?i.copy(null,null,null,i.left.insert(e,t,r),null):0===n?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,r))).fixUp()}removeMin(){if(this.left.isEmpty())return ey.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()}remove(e,t){let r,i=this;if(0>t(e,i.key))i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===t(e,i.key)){if(i.right.isEmpty())return ey.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e}rotateLeft(){let e=this.copy(null,null,ey.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,ey.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){return Math.pow(2,this.check())<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw O(43730,{key:this.key,value:this.value});if(this.right.isRed())throw O(14113,{key:this.key,value:this.value});let e=this.left.check();if(e!==this.right.check())throw O(27949);return e+ +!this.isRed()}}ey.EMPTY=null,ey.RED=!0,ey.BLACK=!1,ey.EMPTY=new class{constructor(){this.size=0}get key(){throw O(57766)}get value(){throw O(16141)}get color(){throw O(16727)}get left(){throw O(29726)}get right(){throw O(36894)}copy(e,t,r,i,n){return this}insert(e,t,r){return new ey(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class ev{constructor(e){this.comparator=e,this.data=new eg(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,r)=>(e(t),!1))}forEachInRange(e,t){let r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){let i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let r;for(r=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){let t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new ew(this.data.getIterator())}getIteratorFrom(e){return new ew(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;
15return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof ev)||this.size!==e.size)return!1;let t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){let e=t.getNext().key,i=r.getNext().key;if(0!==this.comparator(e,i))return!1}return!0}toArray(){let e=[];return this.forEach(t=>{e.push(t)}),e}toString(){let e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){let t=new ev(this.comparator);return t.data=e,t}}class ew{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class eE{constructor(e){this.fields=e,e.sort(et.comparator)}static empty(){return new eE([])}unionWith(e){let t=new ev(et.comparator);for(let e of this.fields)t=t.add(e);for(let r of e)t=t.add(r);return new eE(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return X(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class e_ extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class eb{constructor(e){this.binaryString=e}static fromBase64String(e){return new eb(function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new e_("Invalid base64 string: "+e):e}}(e))}static fromUint8Array(e){return new eb(function(e){let t="";for(let r=0;r<e.length;++r)t+=String.fromCharCode(e[r]);return t}(e))}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return btoa(this.binaryString)}toUint8Array(){var e=this.binaryString;let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return K(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}eb.EMPTY_BYTE_STRING=new eb("");let eI=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function eT(e){if(x(!!e,39018),"string"==typeof e){let t=0,r=eI.exec(e);if(x(!!r,46558,{timestamp:e}),r[1]){let e=r[1];t=Number(e=(e+"000000000").substr(0,9))}return{seconds:Math.floor(new Date(e).getTime()/1e3),nanos:t}}return{seconds:eS(e.seconds),nanos:eS(e.nanos)}}function eS(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function eA(e){return"string"==typeof e?eb.fromBase64String(e):eb.fromUint8Array(e)}let eC="server_timestamp",ek="__type__",eR="__previous_value__",eP="__local_write_time__";function eN(e){return(e?.mapValue?.fields||{})[ek]?.stringValue===eC}function eO(e){let t=eT(e.mapValue.fields[eP].timestampValue);return new es(t.seconds,t.nanos)}let eD="(default)";class ex{constructor(e,t){this.projectId=e,this.database=t||eD}static empty(){return new ex("","")}get isDefaultDatabase(){return this.database===eD}isEqual(e){return e instanceof ex&&e.projectId===this.projectId&&e.database===this.database}}let eL="__max__",eM={},eU="value";function eF(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?eN(e)?4:eX(e)?0x1fffffffffffff:eG(e)?10:11:O(28295,{value:e})}function eV(e,t){if(e===t)return!0;let r=eF(e);if(r!==eF(t))return!1;switch(r){case 0:case 0x1fffffffffffff:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return eO(e).isEqual(eO(t));case 3:if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;let i=eT(e.timestampValue),n=eT(t.timestampValue);return i.seconds===n.seconds&&i.nanos===n.nanos;case 5:return e.stringValue===t.stringValue;case 6:return eA(e.bytesValue).isEqual(eA(t.bytesValue));case 7:return e.referenceValue===t.referenceValue;case 8:return eS(e.geoPointValue.latitude)===eS(t.geoPointValue.latitude)&&eS(e.geoPointValue.longitude)===eS(t.geoPointValue.longitude);case 2:if("integerValue"in e&&"integerValue"in t)return eS(e.integerValue)===eS(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){let r=eS(e.doubleValue),i=eS(t.doubleValue);return r===i?ed(r)===ed(i):isNaN(r)&&isNaN(i)}return!1;case 9:return X(e.arrayValue.values||[],t.arrayValue.values||[],eV);case 10:case 11:let s=e.mapValue.fields||{},a=t.mapValue.fields||{};if(ef(s)!==ef(a))return!1;for(let e in s)if(s.hasOwnProperty(e)&&(void 0===a[e]||!eV(s[e],a[e])))return!1;return!0;default:return O(52216,{left:e})}}function eB(e,t){return void 0!==(e.values||[]).find(e=>eV(e,t))}function ej(e,t){var r,i,n,s,a,o;if(e===t)return 0;let l=eF(e),h=eF(t);if(l!==h)return K(l,h);switch(l){case 0:case 0x1fffffffffffff:return 0;case 1:return K(e.booleanValue,t.booleanValue);case 2:let u,c;return u=eS(e.integerValue||e.doubleValue),u<(c=eS(t.integerValue||t.doubleValue))?-1:u>c?1:u===c?0:isNaN(u)?isNaN(c)?0:-1:1;case 3:return e$(e.timestampValue,t.timestampValue);case 4:return e$(eO(e),eO(t));case 5:return G(e.stringValue,t.stringValue);case 6:let d,f;return r=e.bytesValue,i=t.bytesValue,d=eA(r),f=eA(i),d.compareTo(f);case 7:return function(e,t){let r=e.split("/"),i=t.split("/");for(let e=0;e<r.length&&e<i.length;e++){let t=K(r[e],i[e]);if(0!==t)return t}return K(r.length,i.length)}(e.referenceValue,t.referenceValue);case 8:let p;return n=e.geoPointValue,s=t.geoPointValue,0!==(p=K(eS(n.latitude),eS(s.latitude)))?p:K(eS(n.longitude),eS(s.longitude));case 9:return eH(e.arrayValue,t.arrayValue);case 10:let g,m,y,v,w;return a=e.mapValue,o=t.mapValue,g=a.fields||{},m=o.fields||{},y=g[eU]?.arrayValue,v=m[eU]?.arrayValue,0!==(w=K(y?.values?.length||0,v?.values?.length||0))?w:eH(y,v);case 11:return function(e,t){if(e===eM&&t===eM)return 0;if(e===eM)return 1;if(t===eM)return -1;let r=e.fields||{},i=Object.keys(r),n=t.fields||{},s=Object.keys(n);i.sort(),s.sort();for(let e=0;e<i.length&&e<s.length;++e){let t=G(i[e],s[e]);if(0!==t)return t;let a=ej(r[i[e]],n[s[e]]);if(0!==a)return a}return K(i.length,s.length)}(e.mapValue,t.mapValue);default:throw O(23264,{he:l})}}function e$(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return K(e,t);let r=eT(e),i=eT(t),n=K(r.seconds,i.seconds);return 0!==n?n:K(r.nanos,i.nanos)}function eH(e,t){let r=e.values||[],i=t.values||[];for(let e=0;e<r.length&&e<i.length;++e){let t=ej(r[e],i[e]);if(t)return t}return K(r.length,i.length)}function eq(e){var t,r;let i;return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?(i=eT(e.timestampValue),`time(${i.seconds},${i.nanos}
15)`):"stringValue"in e?e.stringValue:"bytesValue"in e?eA(e.bytesValue).toBase64():"referenceValue"in e?(t=e.referenceValue,er.fromName(t).toString()):"geoPointValue"in e?(r=e.geoPointValue,`geo(${r.latitude},${r.longitude})`):"arrayValue"in e?function(e){let t="[",r=!0;for(let i of e.values||[])r?r=!1:t+=",",t+=eq(i);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){let t=Object.keys(e.fields||{}).sort(),r="{",i=!0;for(let n of t)i?i=!1:r+=",",r+=`${n}:${eq(e.fields[n])}`;return r+"}"}(e.mapValue):O(61005,{value:e})}function ez(e){return!!e&&"integerValue"in e}function eW(e){return!!e&&"arrayValue"in e}function eK(e){return!!e&&"mapValue"in e}function eG(e){return(e?.mapValue?.fields||{}).__type__?.stringValue==="__vector__"}function eJ(e){if(e.geoPointValue)return{geoPointValue:{...e.geoPointValue}};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:{...e.timestampValue}};if(e.mapValue){let t={mapValue:{fields:{}}};return ep(e.mapValue.fields,(e,r)=>t.mapValue.fields[e]=eJ(r)),t}if(e.arrayValue){let t={arrayValue:{values:[]}};for(let r=0;r<(e.arrayValue.values||[]).length;++r)t.arrayValue.values[r]=eJ(e.arrayValue.values[r]);return t}return{...e}}function eX(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===eL}class eQ{constructor(e){this.value=e}static empty(){return new eQ({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(!eK(t=(t.mapValue.fields||{})[e.get(r)]))return null;return(t=(t.mapValue.fields||{})[e.lastSegment()])||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=eJ(t)}setAll(e){let t=et.emptyPath(),r={},i=[];e.forEach((e,n)=>{if(!t.isImmediateParentOf(n)){let e=this.getFieldsMap(t);this.applyChanges(e,r,i),r={},i=[],t=n.popLast()}e?r[n.lastSegment()]=eJ(e):i.push(n.lastSegment())});let n=this.getFieldsMap(t);this.applyChanges(n,r,i)}delete(e){let t=this.field(e.popLast());eK(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return eV(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;r<e.length;++r){let i=t.mapValue.fields[e.get(r)];eK(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=i),t=i}return t.mapValue.fields}applyChanges(e,t,r){for(let i of(ep(t,(t,r)=>e[t]=r),r))delete e[i]}clone(){return new eQ(eJ(this.value))}}class eY{constructor(e,t,r,i,n,s,a){this.key=e,this.documentType=t,this.version=r,this.readTime=i,this.createTime=n,this.data=s,this.documentState=a}static newInvalidDocument(e){return new eY(e,0,ea.min(),ea.min(),ea.min(),eQ.empty(),0)}static newFoundDocument(e,t,r,i){return new eY(e,1,t,ea.min(),r,i,0)}static newNoDocument(e,t){return new eY(e,2,t,ea.min(),ea.min(),eQ.empty(),0)}static newUnknownDocument(e,t){return new eY(e,3,t,ea.min(),ea.min(),eQ.empty(),2)}convertToFoundDocument(e,t){return this.createTime.isEqual(ea.min())&&(2===this.documentType||0===this.documentType)&&(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=eQ.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=eQ.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ea.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof eY&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new eY(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}
15class eZ{constructor(e,t){this.position=e,this.inclusive=t}}function e0(e,t,r){let i=0;for(let n=0;n<e.position.length;n++){let s=t[n],a=e.position[n];if(i=s.field.isKeyField()?er.comparator(er.fromName(a.referenceValue),r.key):ej(a,r.data.field(s.field)),"desc"===s.dir&&(i*=-1),0!==i)break}return i}function e1(e,t){if(null===e)return null===t;if(null===t||e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let r=0;r<e.position.length;r++)if(!eV(e.position[r],t.position[r]))return!1;return!0}class e2{constructor(e,t="asc"){this.field=e,this.dir=t}}class e6{}class e3 extends e6{constructor(e,t,r){super(),this.field=e,this.op=t,this.value=r}static create(e,t,r){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,r):new e7(e,t,r):"array-contains"===t?new tr(e,r):"in"===t?new ti(e,r):"not-in"===t?new tn(e,r):"array-contains-any"===t?new ts(e,r):new e3(e,t,r)}static createKeyFieldInFilter(e,t,r){return"in"===t?new e9(e,r):new te(e,r)}matches(e){let t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(ej(t,this.value)):null!==t&&eF(this.value)===eF(t)&&this.matchesComparison(ej(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return O(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class e5 extends e6{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new e5(e,t)}matches(e){return e4(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.Pe||(this.Pe=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function e4(e){return"and"===e.op}function e8(e){for(let t of e.filters)if(t instanceof e5)return!1;return!0}class e7 extends e3{constructor(e,t,r){super(e,t,r),this.key=er.fromName(r.referenceValue)}matches(e){let t=er.comparator(e.key,this.key);return this.matchesComparison(t)}}class e9 extends e3{constructor(e,t){super(e,"in",t),this.keys=tt("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class te extends e3{constructor(e,t){super(e,"not-in",t),this.keys=tt("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function tt(e,t){return(t.arrayValue?.values||[]).map(e=>er.fromName(e.referenceValue))}class tr extends e3{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return eW(t)&&eB(t.arrayValue,this.value)}}class ti extends e3{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return null!==t&&eB(this.value.arrayValue,t)}}class tn extends e3{constructor(e,t){super(e,"not-in",t)}matches(e){if(eB(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!eB(this.value.arrayValue,t)}}class ts extends e3{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!eW(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>eB(this.value.arrayValue,e))}}class ta{constructor(e,t=null,r=[],i=[],n=null,s=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=i,this.limit=n,this.startAt=s,this.endAt=a,this.Te=null}}function to(e,t=null,r=[],i=[],n=null,s=null,a=null){return new ta(e,t,r,i,n,s,a)}function tl(e){if(null===e.Te){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(e=>(function e(t){if(t instanceof e3)return t.field.canonicalString()+t.op.toString()+eq(t.value);if(e8(t)&&e4(t))return t.filters.map(t=>e(t)).join(",");{let r=t.filters.map(t=>e(t)).join(",");return`${t.op}(${r})`}})(e)).join(","),t+="|ob:",t+=e.orderBy.map(e=>e.field.canonicalString()+e.dir).join(","),null==e.limit||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>eq(e)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>eq(e)).join(",")),e.Te=t}return e.Te}function th(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++){var r,i;if(r=e.orderBy[n],i=t.orderBy[n],!(r.dir===i.dir&&r.field.isEqual(i.field)))return!1}if(e.filters.length!==t.filters.length)return!1;for(let r=0;r<e.filters.length;r++)if(!function e(t,r){return t instanceof e3?r instanceof e3&&t.op===r.op&&t.field.isEqual(r.field)&&eV(t.value,r.value):t instanceof e5?r instanceof e5&&t.op===r.op&&t.filters.length===r.filters.length&&t.filters.reduce((t,i,n)=>
15t&&e(i,r.filters[n]),!0):void O(19439)}(e.filters[r],t.filters[r]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!e1(e.startAt,t.startAt)&&e1(e.endAt,t.endAt)}class tu{constructor(e,t=null,r=[],i=[],n=null,s="F",a=null,o=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=i,this.limit=n,this.limitType=s,this.startAt=a,this.endAt=o,this.Ie=null,this.Ee=null,this.de=null,this.startAt,this.endAt}}function tc(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function td(e){if(null===e.Ie){let t;e.Ie=[];let r=new Set;for(let t of e.explicitOrderBy)e.Ie.push(t),r.add(t.field.canonicalString());let i=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(t=new ev(et.comparator),e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t).forEach(t=>{r.has(t.canonicalString())||t.isKeyField()||e.Ie.push(new e2(t,i))}),r.has(et.keyField().canonicalString())||e.Ie.push(new e2(et.keyField(),i))}return e.Ie}function tf(e){return e.Ee||(e.Ee=function(e,t){if("F"===e.limitType)return to(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{let t="desc"===e.dir?"asc":"desc";return new e2(e.field,t)});let r=e.endAt?new eZ(e.endAt.position,e.endAt.inclusive):null,i=e.startAt?new eZ(e.startAt.position,e.startAt.inclusive):null;return to(e.path,e.collectionGroup,t,e.filters,e.limit,r,i)}}(e,td(e))),e.Ee}function tp(e,t,r){return new tu(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,r,e.startAt,e.endAt)}function tg(e,t){return th(tf(e),tf(t))&&e.limitType===t.limitType}function tm(e){return`${tl(tf(e))}|lt:${e.limitType}`}function ty(e){var t;let r;return`Query(target=${r=(t=tf(e)).path.canonicalString(),null!==t.collectionGroup&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(e=>(function e(t){return t instanceof e3?`${t.field.canonicalString()} ${t.op} ${eq(t.value)}`:t instanceof e5?t.op.toString()+" {"+t.getFilters().map(e).join(" ,")+"}":"Filter"})(e)).join(", ")}]`),null==t.limit||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(e=>`${e.field.canonicalString()} (${e.dir})`).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(e=>eq(e)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(e=>eq(e)).join(",")),`Target(${r})`}; limitType=${e.limitType})`}function tv(e,t){var r,i,n,s;let a,o,l;return t.isFoundDocument()&&(a=t.key.path,null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(a):er.isDocumentKey(e.path)?e.path.isEqual(a):e.path.isImmediateParentOf(a))&&function(e,t){for(let r of td(e))if(!r.field.isKeyField()&&null===t.data.field(r.field))return!1;return!0}(e,t)&&function(e,t){for(let r of e.filters)if(!r.matches(t))return!1;return!0}(e,t)&&(r=e,i=t,(!r.startAt||(n=r.startAt,o=e0(n,td(r),i),n.inclusive?!!(o<=0):!!(o<0)))&&(!r.endAt||(s=r.endAt,l=e0(s,td(r),i),s.inclusive?!!(l>=0):!!(l>0))))}class tw{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){let t=this.mapKeyFn(e),r=this.inner[t];if(void 0!==r){for(let[t,i]of r)if(this.equalsFn(t,e))return i}}has(e){return void 0!==this.get(e)}set(e,t){let r=this.mapKeyFn(e),i=this.inner[r];if(void 0===i)return this.inner[r]=[[e,t]],void this.innerSize++;for(let r=0;r<i.length;r++)if(this.equalsFn(i[r][0],e))return void(i[r]=[e,t]);i.push([e,t]),this.innerSize++}delete(e){let t=this.mapKeyFn(e),r=this.inner[t];if(void 0===r)return!1;for(let i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return 1===r.length?delete this.inner[t]:r.splice(i,1),this.innerSize--,!0;return!1}forEach(e){ep(this.inner,(t,r)=>{for(let[t,i]of r)e(t,i)})}isEmpty(){var e=this.inner;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}size(){return this.innerSize}}let tE=new eg(er.comparator),t_=new eg(er.comparator);function tb(...e){let t=t_;for(let r of e)t=t.insert(r.key,r);return t}function tI(){return new tw(e=>e.toString(),(e,t)=>e.isEqual(t))}
15new eg(er.comparator);let tT=new ev(er.comparator);function tS(...e){let t=tT;for(let r of e)t=t.add(r);return t}let tA=new ev(K);class tC{constructor(){this._=void 0}}class tk extends tC{}class tR extends tC{constructor(e){super(),this.elements=e}}function tP(e,t){let r=tL(t);for(let t of e.elements)r.some(e=>eV(e,t))||r.push(t);return{arrayValue:{values:r}}}class tN extends tC{constructor(e){super(),this.elements=e}}function tO(e,t){let r=tL(t);for(let t of e.elements)r=r.filter(e=>!eV(e,t));return{arrayValue:{values:r}}}class tD extends tC{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function tx(e){return eS(e.integerValue||e.doubleValue)}function tL(e){return eW(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class tM{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new tM}static exists(e){return new tM(void 0,e)}static updateTime(e){return new tM(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function tU(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class tF{}function tV(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new tK(e.key,tM.none()):new t$(e.key,e.data,tM.none());{let r=e.data,i=eQ.empty(),n=new ev(et.comparator);for(let e of t.fields)if(!n.has(e)){let t=r.field(e);null===t&&e.length>1&&(e=e.popLast(),t=r.field(e)),null===t?i.delete(e):i.set(e,t),n=n.add(e)}return new tH(e.key,i,new eE(n.toArray()),tM.none())}}function tB(e,t,r,i){return e instanceof t$?function(e,t,r,i){if(!tU(e.precondition,t))return r;let n=e.value.clone(),s=tW(e.fieldTransforms,i,t);return n.setAll(s),t.convertToFoundDocument(t.version,n).setHasLocalMutations(),null}(e,t,r,i):e instanceof tH?function(e,t,r,i){if(!tU(e.precondition,t))return r;let n=tW(e.fieldTransforms,i,t),s=t.data;return(s.setAll(tq(e)),s.setAll(n),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===r)?null:r.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,r,i):tU(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):r}function tj(e,t){var r,i;return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&(r=e.fieldTransforms,i=t.fieldTransforms,!!(void 0===r&&void 0===i||!(!r||!i)&&X(r,i,(e,t)=>{var r,i;return e.field.isEqual(t.field)&&(r=e.transform,i=t.transform,r instanceof tR&&i instanceof tR||r instanceof tN&&i instanceof tN?X(r.elements,i.elements,eV):r instanceof tD&&i instanceof tD?eV(r.Ae,i.Ae):r instanceof tk&&i instanceof tk)})))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class t$ extends tF{constructor(e,t,r,i=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class tH extends tF{constructor(e,t,r,i,n=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=i,this.fieldTransforms=n,this.type=1}getFieldMask(){return this.fieldMask}}function tq(e){let t=new Map;return e.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){let i=e.data.field(r);t.set(r,i)}}),t}function tz(e,t,r){let i=new Map;x(e.length===r.length,32656,{Re:r.length,Ve:e.length});for(let s=0;s<r.length;s++){var n;let a=e[s],o=a.transform,l=t.data.field(a.field);i.set(a.field,(n=r[s],o instanceof tR?tP(o,l):o instanceof tN?tO(o,l):n))}return i}function tW(e,t,r){let i=new Map;for(let n of e){let e=n.transform,s=r.data.field(n.field);i.set(n.field,function(e,t,r){var i;let n,s,a;return e instanceof tk?(i=t,n={fields:{[ek]:{stringValue:eC},[eP]:{timestampValue:{seconds:r.seconds,nanos:r.nanoseconds}}}},i&&eN(i)&&(i=function e(t){let r=t.mapValue.fields[eR];return eN(r)?e(r):r}(i)),i&&(n.fields[eR]=i),{mapValue:n}):e instanceof tR?tP(e,t):e instanceof tN?tO(e,t):(a=tx(s=function(e,t){return e instanceof tD?ez(t)||t&&"doubleValue"in t?t:{integerValue:0}:null}(e,t))+tx(e.Ae),ez(s)&&ez(e.Ae)?{integerValue:""+a}:function(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ed(t)?"-0":t}}(e.serializer,a))}(e,s,t))}return i}class tK extends tF{constructor(e,t){super(),this.key=e,this.prec
15ondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class tG{constructor(e,t,r,i){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=i}applyToRemoteDocument(e,t){let r=t.mutationResults;for(let t=0;t<this.mutations.length;t++){let i=this.mutations[t];i.key.isEqual(e.key)&&function(e,t,r){let i,n;e instanceof t$?(i=e.value.clone(),n=tz(e.fieldTransforms,t,r.transformResults),i.setAll(n),t.convertToFoundDocument(r.version,i).setHasCommittedMutations()):e instanceof tH?function(e,t,r){if(!tU(e.precondition,t))return t.convertToUnknownDocument(r.version);let i=tz(e.fieldTransforms,t,r.transformResults),n=t.data;n.setAll(tq(e)),n.setAll(i),t.convertToFoundDocument(r.version,n).setHasCommittedMutations()}(e,t,r):t.convertToNoDocument(r.version).setHasCommittedMutations()}(i,e,r[t])}}applyToLocalView(e,t){for(let r of this.baseMutations)r.key.isEqual(e.key)&&(t=tB(r,e,t,this.localWriteTime));for(let r of this.mutations)r.key.isEqual(e.key)&&(t=tB(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){let r=tI();return this.mutations.forEach(i=>{let n=e.get(i.key),s=n.overlayedDocument,a=this.applyToLocalView(s,n.mutatedFields),o=tV(s,a=t.has(i.key)?null:a);null!==o&&r.set(i.key,o),s.isValidDocument()||s.convertToNoDocument(ea.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),tS())}isEqual(e){return this.batchId===e.batchId&&X(this.mutations,e.mutations,(e,t)=>tj(e,t))&&X(this.baseMutations,e.baseMutations,(e,t)=>tj(e,t))}}class tJ{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{
16      largestBatchId: ${this.largestBatchId},
17      mutation: ${this.mutation.toString()}
18    }`}}(c=u||(u={}))[c.OK=0]="OK",c[c.CANCELLED=1]="CANCELLED",c[c.UNKNOWN=2]="UNKNOWN",c[c.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",c[c.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",c[c.NOT_FOUND=5]="NOT_FOUND",c[c.ALREADY_EXISTS=6]="ALREADY_EXISTS",c[c.PERMISSION_DENIED=7]="PERMISSION_DENIED",c[c.UNAUTHENTICATED=16]="UNAUTHENTICATED",c[c.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",c[c.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",c[c.ABORTED=10]="ABORTED",c[c.OUT_OF_RANGE=11]="OUT_OF_RANGE",c[c.UNIMPLEMENTED=12]="UNIMPLEMENTED",c[c.INTERNAL=13]="INTERNAL",c[c.UNAVAILABLE=14]="UNAVAILABLE",c[c.DATA_LOSS=15]="DATA_LOSS",new t([0xffffffff,0xffffffff],0);class tX{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function tQ(e){let t;return x(!!e,49232),ea.fromTimestamp(new es((t=eT(e)).seconds,t.nanos))}function tY(e,t){let r=new Z(["projects",e.projectId,"databases",e.database]).child("documents");return void 0===t?r:r.child(t)}function tZ(e){return et.fromServerFormat(e.fieldPath)}class t0{constructor(e){this.yt=e}}class t1{Dt(e,t){this.Ct(e,t),t.vt()}Ct(e,t){if("nullValue"in e)this.Ft(t,5);else if("booleanValue"in e)this.Ft(t,10),t.Mt(+!!e.booleanValue);else if("integerValue"in e)this.Ft(t,15),t.Mt(eS(e.integerValue));else if("doubleValue"in e){let r=eS(e.doubleValue);isNaN(r)?this.Ft(t,13):(this.Ft(t,15),ed(r)?t.Mt(0):t.Mt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.Ft(t,20),"string"==typeof r&&(r=eT(r)),t.xt(`${r.seconds||""}`),t.Mt(r.nanos||0)}else if("stringValue"in e)this.Ot(e.stringValue,t),this.Nt(t);else if("bytesValue"in e)this.Ft(t,30),t.Bt(eA(e.bytesValue)),this.Nt(t);else if("referenceValue"in e)this.Lt(e.referenceValue,t);else if("geoPointValue"in e){let r=e.geoPointValue;this.Ft(t,45),t.Mt(r.latitude||0),t.Mt(r.longitude||0)}else"mapValue"in e?eX(e)?this.Ft(t,Number.MAX_SAFE_INTEGER):eG(e)?this.kt(e.mapValue,t):(this.qt(e.mapValue,t),this.Nt(t)):"arrayValue"in e?(this.Qt(e.arrayValue,t),this.Nt(t)):O(19022,{$t:e})}Ot(e,t){this.Ft(t,25),this.Ut(e,t)}Ut(e,t){t.xt(e)}qt(e,t){let r=e.fields||{};for(let e of(this.Ft(t,55),Object.keys(r)))this.Ot(e,t),this.Ct(r[e],t)}kt(e,t){let r=e.fields||{};this.Ft(t,53);let i=r[eU].arrayValue?.values?.length||0;this.Ft(t,15),t.Mt(eS(i)),this.Ot(eU,t),this.Ct(r[eU],t)}Qt(e,t){let r=e.values||[];for(let e of(this.Ft(t,50),r))this.Ct(e,t)}
vendor: 2,400 bytes, line 18
18Lt(e,t){this.Ft(t,37),er.fromName(e).path.forEach(e=>{this.Ft(t,60),this.Ut(e,t)})}Ft(e,t){e.Mt(t)}Nt(e){e.Mt(2)}}t1.Kt=new t1;class t2{constructor(){this.Cn=new t6}addToCollectionParentIndex(e,t){return this.Cn.add(t),eh.resolve()}getCollectionParents(e,t){return eh.resolve(this.Cn.getEntries(t))}addFieldIndex(e,t){return eh.resolve()}deleteFieldIndex(e,t){return eh.resolve()}deleteAllFieldIndexes(e){return eh.resolve()}createTargetIndexes(e,t){return eh.resolve()}getDocumentsMatchingTarget(e,t){return eh.resolve(null)}getIndexType(e,t){return eh.resolve(0)}getFieldIndexes(e,t){return eh.resolve([])}getNextCollectionGroupToUpdate(e){return eh.resolve(null)}getMinOffset(e,t){return eh.resolve(eo.min())}getMinOffsetFromCollectionGroup(e,t){return eh.resolve(eo.min())}updateCollectionGroup(e,t,r){return eh.resolve()}updateIndexEntries(e,t){return eh.resolve()}}class t6{constructor(){this.index={}}add(e){let t=e.lastSegment(),r=e.popLast(),i=this.index[t]||new ev(Z.comparator),n=!i.has(r);return this.index[t]=i.add(r),n}has(e){let t=e.lastSegment(),r=e.popLast(),i=this.index[t];return i&&i.has(r)}getEntries(e){return(this.index[e]||new ev(Z.comparator)).toArray()}}new Uint8Array(0);class t3{static withCacheSize(e){return new t3(e,t3.DEFAULT_COLLECTION_PERCENTILE,t3.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=r}}t3.DEFAULT_COLLECTION_PERCENTILE=10,t3.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,t3.DEFAULT=new t3(0x2800000,t3.DEFAULT_COLLECTION_PERCENTILE,t3.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),t3.DISABLED=new t3(-1,0,0);class t5{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new t5(0)}static cr(){return new t5(-1)}}class t4{constructor(){this.changes=new tw(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,eY.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let r=this.changes.get(t);return void 0!==r?eh.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class t8{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}
18class t7{constructor(e,t,r,i){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==r&&tB(r.mutation,e,eE.empty(),es.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,tS()).next(()=>t))}getLocalViewOfDocuments(e,t,r=tS()){let i=tI();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,r).next(e=>{let t=tb();return e.forEach((e,r)=>{t=t.insert(e,r.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){let r=tI();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,tS()))}populateOverlays(e,t,r){let i=[];return r.forEach(e=>{t.has(e)||i.push(e)}),this.documentOverlayCache.getOverlays(e,i).next(e=>{e.forEach((e,r)=>{t.set(e,r)})})}computeViews(e,t,r,i){let n=tE,s=tI(),a=tI();return t.forEach((e,t)=>{let a=r.get(t.key);i.has(t.key)&&(void 0===a||a.mutation instanceof tH)?n=n.insert(t.key,t):void 0!==a?(s.set(t.key,a.mutation.getFieldMask()),tB(a.mutation,t,a.mutation.getFieldMask(),es.now())):s.set(t.key,eE.empty())}),this.recalculateAndSaveOverlays(e,n).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>a.set(e,new t8(t,s.get(e)??null))),a))}recalculateAndSaveOverlays(e,t){let r=tI(),i=new eg((e,t)=>e-t),n=tS();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(let n of e)n.keys().forEach(e=>{let s=t.get(e);if(null===s)return;let a=r.get(e)||eE.empty();a=n.applyToLocalView(s,a),r.set(e,a);let o=(i.get(n.batchId)||tS()).add(e);i=i.insert(n.batchId,o)})}).next(()=>{let s=[],a=i.getReverseIterator();for(;a.hasNext();){let i=a.getNext(),o=i.key,l=i.value,h=tI();l.forEach(e=>{if(!n.has(e)){let i=tV(t.get(e),r.get(e));null!==i&&h.set(e,i),n=n.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,o,h))}return eh.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,r,i){return er.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):null!==t.collectionGroup?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,i):this.getDocumentsMatchingCollectionQuery(e,t,r,i)}getNextDocuments(e,t,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,i).next(n=>{let s=i-n.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,i-n.size):eh.resolve(tI()),a=-1,o=n;return s.next(t=>eh.forEach(t,(t,r)=>(a<r.largestBatchId&&(a=r.largestBatchId),n.get(t)?eh.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,n)).next(()=>this.computeViews(e,o,t,tS())).next(e=>{let t;return{batchId:a,changes:(t=t_,e.forEach((e,r)=>t=t.insert(e,r.overlayedDocument)),t)}}))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new er(t)).next(e=>{let t=tb();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,r,i){let n=t.collectionGroup,s=tb();return this.indexManager.getCollectionParents(e,n).next(a=>eh.forEach(a,a=>{let o=new tu(a.child(n),null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt);return this.getDocumentsMatchingCollectionQuery(e,o,r,i).next(e=>{e.forEach((e,t)=>{s=s.insert(e,t)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,r,i){let n;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(s=>(n=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,n,i))).next(e=>{n.forEach((t,r)=>{let i=r.getKey();null===e.get(i)&&(e=e.insert(i,eY.newInvalidDocument(i)))});let r=tb();return e.forEach((e,i)=>{let s=n.get(e);void 0!==s&&tB(s.mutation,i,eE.empty(),es.now()),tv(t,i)&&(r=r.insert(e,i))}),r})}}class t9{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,t){return eh.resolve(this.Lr.get(t))}
18saveBundleMetadata(e,t){return this.Lr.set(t.id,{id:t.id,version:t.version,createTime:tQ(t.createTime)}),eh.resolve()}getNamedQuery(e,t){return eh.resolve(this.kr.get(t))}saveNamedQuery(e,t){var r;let i;return this.kr.set(t.name,{name:t.name,query:(i=function(e){var t,r,i,n,s,a,o;let l,h,u,c,d,f,p=(t=e.parent,x((a=l=Z.fromString(t)).length>=4&&"projects"===a.get(0)&&"databases"===a.get(2),10190,{key:l.toString()}),4===(h=l).length?Z.emptyPath():(x((o=h).length>4&&"documents"===o.get(4),29091,{key:o.toString()}),o.popFirst(5))),g=e.structuredQuery,m=g.from?g.from.length:0,y=null;if(m>0){x(1===m,65062);let e=g.from[0];e.allDescendants?y=e.collectionId:p=p.child(e.collectionId)}let v=[];g.where&&(v=(u=function e(t){return void 0!==t.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":let t=tZ(e.unaryFilter.field);return e3.create(t,"==",{doubleValue:NaN});case"IS_NULL":let r=tZ(e.unaryFilter.field);return e3.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let i=tZ(e.unaryFilter.field);return e3.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let n=tZ(e.unaryFilter.field);return e3.create(n,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return O(61313);default:return O(60726)}}(t):void 0!==t.fieldFilter?e3.create(tZ(t.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return O(58110);default:return O(50506)}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==t.compositeFilter?e5.create(t.compositeFilter.filters.map(t=>e(t)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return O(1026)}}(t.compositeFilter.op)):O(30097,{filter:t})}(g.where))instanceof e5&&e8(r=u)&&e4(r)?u.getFilters():[u]);let w=[];g.orderBy&&(w=g.orderBy.map(e=>new e2(tZ(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))));let E=null;g.limit&&(E=null==(c="object"==typeof(i=g.limit)?i.value:i)?null:c);let _=null;g.startAt&&(d=!!(n=g.startAt).before,_=new eZ(n.values||[],d));let b=null;return g.endAt&&(f=!(s=g.endAt).before,b=new eZ(s.values||[],f)),new tu(p,y,w,v,E,"F",_,b)}({parent:(r=t.bundledQuery).parent,structuredQuery:r.structuredQuery}),"LAST"===r.limitType?tp(i,i.limit,"L"):i),readTime:tQ(t.readTime)}),eh.resolve()}}class re{constructor(){this.overlays=new eg(er.comparator),this.qr=new Map}getOverlay(e,t){return eh.resolve(this.overlays.get(t))}getOverlays(e,t){let r=tI();return eh.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&r.set(t,e)})).next(()=>r)}saveOverlays(e,t,r){return r.forEach((r,i)=>{this.St(e,t,i)}),eh.resolve()}removeOverlaysForBatchId(e,t,r){let i=this.qr.get(r);return void 0!==i&&(i.forEach(e=>this.overlays=this.overlays.remove(e)),this.qr.delete(r)),eh.resolve()}getOverlaysForCollection(e,t,r){let i=tI(),n=t.length+1,s=new er(t.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){let e=a.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===n&&e.largestBatchId>r&&i.set(e.getKey(),e)}return eh.resolve(i)}getOverlaysForCollectionGroup(e,t,r,i){let n=new eg((e,t)=>e-t),s=this.overlays.getIterator();for(;s.hasNext();){let e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>r){let t=n.get(e.largestBatchId);null===t&&(t=tI(),n=n.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}let a=tI(),o=n.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>a.set(e,t)),!(a.size()>=i)););return eh.resolve(a)}St(e,t,r){let i=this.overlays.get(r.key);if(null!==i){let e=this.qr.get(i.largestBatchId).delete(r.key);this.qr.set(i.largestBatchId,e)}this.overlays=this.overlays.insert(r.key,new tJ(t,r));let n=this.qr.get(t);void 0===n&&(n=tS(),this.qr.set(t,n)),this.qr.set(t,n.add(r.key))}}class rt{constructor(){this.sessionToken=eb.EMPTY_BYTE_STRING}getSessionToken(e){return eh.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,eh.resolve()}}class rr{constructor(){this.Qr=new ev(ri.$r),this.Ur=new ev(ri.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,t){let r=new ri(e,t);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}
18Wr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Gr(new ri(e,t))}zr(e,t){e.forEach(e=>this.removeReference(e,t))}jr(e){let t=new er(new Z([])),r=new ri(t,e),i=new ri(t,e+1),n=[];return this.Ur.forEachInRange([r,i],e=>{this.Gr(e),n.push(e.key)}),n}Jr(){this.Qr.forEach(e=>this.Gr(e))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){let t=new er(new Z([])),r=new ri(t,e),i=new ri(t,e+1),n=tS();return this.Ur.forEachInRange([r,i],e=>{n=n.add(e.key)}),n}containsKey(e){let t=new ri(e,0),r=this.Qr.firstAfterOrEqual(t);return null!==r&&e.isEqual(r.key)}}class ri{constructor(e,t){this.key=e,this.Yr=t}static $r(e,t){return er.comparator(e.key,t.key)||K(e.Yr,t.Yr)}static Kr(e,t){return K(e.Yr,t.Yr)||er.comparator(e.key,t.key)}}class rn{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.tr=1,this.Zr=new ev(ri.$r)}checkEmpty(e){return eh.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,r,i){let n=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let s=new tG(n,t,r,i);for(let t of(this.mutationQueue.push(s),i))this.Zr=this.Zr.add(new ri(t.key,n)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return eh.resolve(s)}lookupMutationBatch(e,t){return eh.resolve(this.Xr(t))}getNextMutationBatchAfterBatchId(e,t){let r=this.ei(t+1),i=r<0?0:r;return eh.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return eh.resolve(0===this.mutationQueue.length?-1:this.tr-1)}getAllMutationBatches(e){return eh.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let r=new ri(t,0),i=new ri(t,1/0),n=[];return this.Zr.forEachInRange([r,i],e=>{let t=this.Xr(e.Yr);n.push(t)}),eh.resolve(n)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new ev(K);return t.forEach(e=>{let t=new ri(e,0),i=new ri(e,1/0);this.Zr.forEachInRange([t,i],e=>{r=r.add(e.Yr)})}),eh.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,i=r.length+1,n=r;er.isDocumentKey(n)||(n=n.child(""));let s=new ri(new er(n),0),a=new ev(K);return this.Zr.forEachWhile(e=>{let t=e.key.path;return!!r.isPrefixOf(t)&&(t.length===i&&(a=a.add(e.Yr)),!0)},s),eh.resolve(this.ti(a))}ti(e){let t=[];return e.forEach(e=>{let r=this.Xr(e);null!==r&&t.push(r)}),t}removeMutationBatch(e,t){x(0===this.ni(t.batchId,"removed"),55003),this.mutationQueue.shift();let r=this.Zr;return eh.forEach(t.mutations,i=>{let n=new ri(i.key,t.batchId);return r=r.delete(n),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Zr=r})}ir(e){}containsKey(e,t){let r=new ri(t,0),i=this.Zr.firstAfterOrEqual(r);return eh.resolve(t.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,eh.resolve()}ni(e,t){return this.ei(e)}ei(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Xr(e){let t=this.ei(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class rs{constructor(e){this.ri=e,this.docs=new eg(er.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let r=t.key,i=this.docs.get(r),n=i?i.size:0,s=this.ri(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:s}),this.size+=s-n,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){let t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){let r=this.docs.get(t);return eh.resolve(r?r.document.mutableCopy():eY.newInvalidDocument(t))}getEntries(e,t){let r=tE;return t.forEach(e=>{let t=this.docs.get(e);r=r.insert(e,t?t.document.mutableCopy():eY.newInvalidDocument(e))}),eh.resolve(r)}getDocumentsMatchingQuery(e,t,r,i){let n=tE,s=t.path,a=new er(s.child("__id-9223372036854775808__")),o=this.docs.getIteratorFrom(a);for(;o.hasNext();){let{key:e,value:{document:a}}=o.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||0>=function(e,t){let r=e.readTime.compareTo(t.readTime);return 0!==r||0!==(r=er.comparator(e.documentKey,t.documentKey))?r:K(e.largestBatchId,t.largestBatchId)}(new eo(a.readTime,a.key,-1),r)||(i.has(a.key)||tv(t,a))&&(n=n.insert(a.key,a.mutableCopy()))}return eh.resolve(n)}getAllFromCollectionGroup(e,t,r,i){O(9500)}ii(e,t){return eh.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new ra(this)}getSize(e){return eh.resolve(this.size)}}class ra extends t4{constructor(e){super(),this.Nr=e}applyChanges(e){let t=[];
vendor: 4,471 bytes, line 18
18return this.changes.forEach((r,i)=>{i.isValidDocument()?t.push(this.Nr.addEntry(e,i)):this.Nr.removeEntry(r)}),eh.waitFor(t)}getFromCache(e,t){return this.Nr.getEntry(e,t)}getAllFromCache(e,t){return this.Nr.getEntries(e,t)}}class ro{constructor(e){this.persistence=e,this.si=new tw(e=>tl(e),th),this.lastRemoteSnapshotVersion=ea.min(),this.highestTargetId=0,this.oi=0,this._i=new rr,this.targetCount=0,this.ai=t5.ur()}forEachTarget(e,t){return this.si.forEach((e,r)=>t(r)),eh.resolve()}getLastRemoteSnapshotVersion(e){return eh.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return eh.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),eh.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.oi&&(this.oi=t),eh.resolve()}Pr(e){this.si.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.ai=new t5(t),this.highestTargetId=t),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,t){return this.Pr(t),this.targetCount+=1,eh.resolve()}updateTargetData(e,t){return this.Pr(t),eh.resolve()}removeTargetData(e,t){return this.si.delete(t.target),this._i.jr(t.targetId),this.targetCount-=1,eh.resolve()}removeTargets(e,t,r){let i=0,n=[];return this.si.forEach((s,a)=>{a.sequenceNumber<=t&&null===r.get(a.targetId)&&(this.si.delete(s),n.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),eh.waitFor(n).next(()=>i)}getTargetCount(e){return eh.resolve(this.targetCount)}getTargetData(e,t){let r=this.si.get(t)||null;return eh.resolve(r)}addMatchingKeys(e,t,r){return this._i.Wr(t,r),eh.resolve()}removeMatchingKeys(e,t,r){this._i.zr(t,r);let i=this.persistence.referenceDelegate,n=[];return i&&t.forEach(t=>{n.push(i.markPotentiallyOrphaned(e,t))}),eh.waitFor(n)}removeMatchingKeysForTargetId(e,t){return this._i.jr(t),eh.resolve()}getMatchingKeysForTargetId(e,t){let r=this._i.Hr(t);return eh.resolve(r)}containsKey(e,t){return eh.resolve(this._i.containsKey(t))}}class rl{constructor(e,t){this.ui={},this.overlays={},this.ci=new ec(0),this.li=!1,this.li=!0,this.hi=new rt,this.referenceDelegate=e(this),this.Pi=new ro(this),this.indexManager=new t2,this.remoteDocumentCache=new rs(e=>this.referenceDelegate.Ti(e)),this.serializer=new t0(t),this.Ii=new t9(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new re,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.ui[e.toKey()];return r||(r=new rn(t,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,t,r){k("MemoryPersistence","Starting transaction:",e);let i=new rh(this.ci.next());return this.referenceDelegate.Ei(),r(i).next(e=>this.referenceDelegate.di(i).next(()=>e)).toPromise().then(e=>(i.raiseOnCommittedEvent(),e))}Ai(e,t){return eh.or(Object.values(this.ui).map(r=>()=>r.containsKey(e,t)))}}class rh extends el{constructor(e){super(),this.currentSequenceNumber=e}}class ru{constructor(e){this.persistence=e,this.Ri=new rr,this.Vi=null}static mi(e){return new ru(e)}get fi(){if(this.Vi)return this.Vi;throw O(60996)}addReference(e,t,r){return this.Ri.addReference(r,t),this.fi.delete(r.toString()),eh.resolve()}removeReference(e,t,r){return this.Ri.removeReference(r,t),this.fi.add(r.toString()),eh.resolve()}markPotentiallyOrphaned(e,t){return this.fi.add(t.toString()),eh.resolve()}removeTarget(e,t){this.Ri.jr(t.targetId).forEach(e=>this.fi.add(e.toString()));let r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.fi.add(e.toString()))}).next(()=>r.removeTargetData(e,t))}Ei(){this.Vi=new Set}di(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return eh.forEach(this.fi,r=>{let i=er.fromPath(r);return this.gi(e,i).next(e=>{e||t.removeEntry(i,ea.min())})}).next(()=>(this.Vi=null,t.apply(e)))}updateLimboDocument(e,t){return this.gi(e,t).next(e=>{e?this.fi.delete(t.toString()):this.fi.add(t.toString())})}Ti(e){return 0}gi(e,t){return eh.or([()=>eh.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ai(e,t)])}}
18class rc{constructor(e,t,r,i){this.targetId=e,this.fromCache=t,this.Es=r,this.ds=i}static As(e,t){let r=tS(),i=tS();for(let e of t.docChanges)switch(e.type){case 0:r=r.add(e.doc.key);break;case 1:i=i.add(e.doc.key)}return new rc(e,t.fromCache,r,i)}}class rd{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class rf{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=function(){let e;return(0,y.isSafari)()?8:Number((e=(0,y.getUA)().match(/Android ([\d.]+)/i))?e[1].split(".").slice(0,2).join("."):"-1")>0?6:4}()}initialize(e,t){this.ps=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,r,i){let n={result:null};return this.ys(e,t).next(e=>{n.result=e}).next(()=>{if(!n.result)return this.ws(e,t,i,r).next(e=>{n.result=e})}).next(()=>{if(n.result)return;let r=new rd;return this.Ss(e,t,r).next(i=>{if(n.result=i,this.Vs)return this.bs(e,t,r,i.size)})}).next(()=>n.result)}bs(e,t,r,i){return r.documentReadCount<this.fs?(C()<=m.LogLevel.DEBUG&&k("QueryEngine","SDK will not create cache indexes for query:",ty(t),"since it only creates cache indexes for collection contains","more than or equal to",this.fs,"documents"),eh.resolve()):(C()<=m.LogLevel.DEBUG&&k("QueryEngine","Query:",ty(t),"scans",r.documentReadCount,"local documents and returns",i,"documents as results."),r.documentReadCount>this.gs*i?(C()<=m.LogLevel.DEBUG&&k("QueryEngine","The SDK decides to create cache indexes for query:",ty(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,tf(t))):eh.resolve())}ys(e,t){if(tc(t))return eh.resolve(null);let r=tf(t);return this.indexManager.getIndexType(e,r).next(i=>0===i?null:(null!==t.limit&&1===i&&(r=tf(t=tp(t,null,"F"))),this.indexManager.getDocumentsMatchingTarget(e,r).next(i=>{let n=tS(...i);return this.ps.getDocuments(e,n).next(i=>this.indexManager.getMinOffset(e,r).next(r=>{let s=this.Ds(t,i);return this.Cs(t,s,n,r.readTime)?this.ys(e,tp(t,null,"F")):this.vs(e,s,t,r)}))})))}ws(e,t,r,i){return tc(t)||i.isEqual(ea.min())?eh.resolve(null):this.ps.getDocuments(e,r).next(n=>{let s,a,o=this.Ds(t,n);return this.Cs(t,o,r,i)?eh.resolve(null):(C()<=m.LogLevel.DEBUG&&k("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),ty(t)),this.vs(e,o,t,(s=i.toTimestamp().seconds,a=i.toTimestamp().nanoseconds+1,new eo(ea.fromTimestamp(1e9===a?new es(s+1,0):new es(s,a)),er.empty(),-1))).next(e=>e))})}Ds(e,t){let r=new ev((t,r)=>{let i=!1;for(let n of td(e)){let e=function(e,t,r){var i;let n,s,a=e.field.isKeyField()?er.comparator(t.key,r.key):(i=e.field,n=t.data.field(i),s=r.data.field(i),null!==n&&null!==s?ej(n,s):O(42886));switch(e.dir){case"asc":return a;case"desc":return -1*a;default:return O(19790,{direction:e.dir})}}(n,t,r);if(0!==e)return e;i=i||n.field.isKeyField()}return 0});return t.forEach((t,i)=>{tv(e,i)&&(r=r.add(i))}),r}Cs(e,t,r,i){if(null===e.limit)return!1;if(r.size!==t.size)return!0;let n="F"===e.limitType?t.last():t.first();return!!n&&(n.hasPendingWrites||n.version.compareTo(i)>0)}Ss(e,t,r){return C()<=m.LogLevel.DEBUG&&k("QueryEngine","Using full collection scan to execute query:",ty(t)),this.ps.getDocumentsMatchingQuery(e,t,eo.min(),r)}vs(e,t,r,i){return this.ps.getDocumentsMatchingQuery(e,r,i).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}
18class rp{constructor(e,t,r,i){this.persistence=e,this.Fs=t,this.serializer=i,this.Ms=new eg(K),this.xs=new tw(e=>tl(e),th),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new t7(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ms))}}async function rg(e,t){return await e.persistence.runTransaction("Handle user change","readonly",r=>{let i;return e.mutationQueue.getAllMutationBatches(r).next(n=>(i=n,e.Bs(t),e.mutationQueue.getAllMutationBatches(r))).next(t=>{let n=[],s=[],a=tS();for(let e of i)for(let t of(n.push(e.batchId),e.mutations))a=a.add(t.key);for(let e of t)for(let t of(s.push(e.batchId),e.mutations))a=a.add(t.key);return e.localDocuments.getDocuments(r,a).next(e=>({Ls:e,removedBatchIds:n,addedBatchIds:s}))})})}class rm{constructor(){this.activeTargetIds=tA}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){return JSON.stringify({activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()})}}class ry{constructor(){this.Mo=new rm,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,t,r){this.xo[e]=t}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new rm,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class rv{Oo(e){}shutdown(){}}let rw="ConnectivityMonitor";class rE{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){for(let e of(k(rw,"Network connectivity changed: AVAILABLE"),this.qo))e(0)}ko(){for(let e of(k(rw,"Network connectivity changed: UNAVAILABLE"),this.qo))e(1)}static v(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let r_=null;function rb(){return null===r_?r_=0x10000000+Math.round(0x80000000*Math.random()):r_++,"0x"+r_.toString(16)}let rI="RestConnection",rT={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class rS{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Uo=t+"://"+e.host,this.Ko=`projects/${r}/databases/${i}`,this.Wo=this.databaseId.database===eD?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Go(e,t,r,i,n){let s=rb(),a=this.zo(e,t.toUriEncodedString());k(rI,`Sending RPC '${e}' ${s}:`,a,r);let o={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(o,i,n);let{host:l}=new URL(a),h=(0,y.isCloudWorkstation)(l);return this.Jo(e,a,o,r,h).then(t=>(k(rI,`Received RPC '${e}' ${s}: `,t),t),t=>{throw P(rI,`RPC '${e}' ${s} failed with error: `,t,"url: ",a,"request:",r),t})}Ho(e,t,r,i,n,s){return this.Go(e,t,r,i,n)}jo(e,t,r){e["X-Goog-Api-Client"]="gl-js/ fire/"+S,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,r)=>
18e[r]=t),r&&r.headers.forEach((t,r)=>e[r]=t)}zo(e,t){let r=rT[e];return`${this.Uo}/v1/${t}:${r}`}terminate(){}}class rA{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}let rC="WebChannelConnection";class rk extends rS{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,t,i,a,o){let l=rb();return new Promise((o,h)=>{let u=new r;u.setWithCredentials(!0),u.listenOnce(n.COMPLETE,()=>{try{switch(u.getLastErrorCode()){case s.NO_ERROR:let t=u.getResponseJson();k(rC,`XHR for RPC '${e}' ${l} received:`,JSON.stringify(t)),o(t);break;case s.TIMEOUT:k(rC,`RPC '${e}' ${l} timed out`),h(new M(L.DEADLINE_EXCEEDED,"Request time out"));break;case s.HTTP_ERROR:let r=u.getStatus();if(k(rC,`RPC '${e}' ${l} failed with status:`,r,"response text:",u.getResponseText()),r>0){let e=u.getResponseJson();Array.isArray(e)&&(e=e[0]);let t=e?.error;if(t&&t.status&&t.message){let e,r=(e=t.status.toLowerCase().replace(/_/g,"-"),Object.values(L).indexOf(e)>=0?e:L.UNKNOWN);h(new M(r,t.message))}else h(new M(L.UNKNOWN,"Server responded with status "+u.getStatus()))}else h(new M(L.UNAVAILABLE,"Connection failed."));break;default:O(9055,{l_:e,streamId:l,h_:u.getLastErrorCode(),P_:u.getLastError()})}}finally{k(rC,`RPC '${e}' ${l} completed.`)}});let c=JSON.stringify(a);k(rC,`RPC '${e}' ${l} sending request:`,a),u.send(t,"POST",c,i,15)})}T_(e,t,r){let n=rb(),s=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],c=h(),d=l(),f={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},p=this.longPollingOptions.timeoutSeconds;void 0!==p&&(f.longPollingTimeout=Math.round(1e3*p)),this.useFetchStreams&&(f.useFetchStreams=!0),this.jo(f.initMessageHeaders,t,r),f.encodeInitMessageHeaders=!0;let g=s.join("");k(rC,`Creating RPC '${e}' stream ${n}: ${g}`,f);let m=c.createWebChannel(g,f);this.I_(m);let y=!1,v=!1,w=new rA({Yo:t=>{v?k(rC,`Not sending because RPC '${e}' stream ${n} is closed:`,t):(y||(k(rC,`Opening RPC '${e}' stream ${n} transport.`),m.open(),y=!0),k(rC,`RPC '${e}' stream ${n} sending:`,t),m.send(t))},Zo:()=>m.close()}),E=(e,t,r)=>{e.listen(t,e=>{try{r(e)}catch(e){setTimeout(()=>{throw e},0)}})};return E(m,i.EventType.OPEN,()=>{v||(k(rC,`RPC '${e}' stream ${n} transport opened.`),w.o_())}),E(m,i.EventType.CLOSE,()=>{v||(v=!0,k(rC,`RPC '${e}' stream ${n} transport closed`),w.a_(),this.E_(m))}),E(m,i.EventType.ERROR,t=>{v||(v=!0,P(rC,`RPC '${e}' stream ${n} transport errored. Name:`,t.name,"Message:",t.message),w.a_(new M(L.UNAVAILABLE,"The operation could not be completed")))}),E(m,i.EventType.MESSAGE,t=>{if(!v){let r=t.data[0];x(!!r,16349);let i=r?.error||r[0]?.error;if(i){k(rC,`RPC '${e}' stream ${n} received error:`,i);let t=i.status,r=function(e){let t=u[e];if(void 0!==t){if(void 0===t)return R("GRPC error has no .code"),L.UNKNOWN;switch(t){case u.OK:return L.OK;case u.CANCELLED:return L.CANCELLED;case u.UNKNOWN:return L.UNKNOWN;case u.DEADLINE_EXCEEDED:return L.DEADLINE_EXCEEDED;case u.RESOURCE_EXHAUSTED:return L.RESOURCE_EXHAUSTED;case u.INTERNAL:return L.INTERNAL;case u.UNAVAILABLE:return L.UNAVAILABLE;case u.UNAUTHENTICATED:return L.UNAUTHENTICATED;case u.INVALID_ARGUMENT:return L.INVALID_ARGUMENT;case u.NOT_FOUND:return L.NOT_FOUND;case u.ALREADY_EXISTS:return L.ALREADY_EXISTS;case u.PERMISSION_DENIED:return L.PERMISSION_DENIED;case u.FAILED_PRECONDITION:return L.FAILED_PRECONDITION;case u.ABORTED:return L.ABORTED;case u.OUT_OF_RANGE:return L.OUT_OF_RANGE;case u.UNIMPLEMENTED:return L.UNIMPLEMENTED;case u.DATA_LOSS:return L.DATA_LOSS;default:return O(39323,{code:t})}}}(t),s=i.message;void 0===r&&(r=L.INTERNAL,s="Unknown error status: "+t+" with message "+i.message),v=!0,w.a_(new M(r,s)),m.close()}else k(rC,`RPC '${e}' stream ${n} received:`,r),w.u_(r)}}),E(d,o.STAT_EVENT,t=>{t.stat===a.PROXY?k(rC,`RPC '${e}' stream ${n} detected buffering proxy`):t.stat===a.NOPROXY&&k(rC,`RPC '${e}' stream ${n} detected no buffering proxy`)}),setTimeout(()=>{w.__()},0),w}
18terminate(){this.c_.forEach(e=>e.close()),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter(t=>t===e)}}function rR(){return"undefined"!=typeof document?document:null}class rP{constructor(e,t,r=1e3,i=1.5,n=6e4){this.Mi=e,this.timerId=t,this.d_=r,this.A_=i,this.R_=n,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();let t=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),i=Math.max(0,t-r);i>0&&k("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.V_} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.V_*=this.A_,this.V_<this.d_&&(this.V_=this.d_),this.V_>this.R_&&(this.V_=this.R_)}w_(){null!==this.m_&&(this.m_.skipDelay(),this.m_=null)}cancel(){null!==this.m_&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}class rN{}class rO extends rN{constructor(e,t,r,i){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=i,this.ia=!1}sa(){if(this.ia)throw new M(L.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,t,r,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([n,s])=>this.connection.Go(e,tY(t,r),i,n,s)).catch(e=>{throw"FirebaseError"===e.name?(e.code===L.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new M(L.UNKNOWN,e.toString())})}Ho(e,t,r,i,n){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.Ho(e,tY(t,r),i,s,a,n)).catch(e=>{throw"FirebaseError"===e.name?(e.code===L.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new M(L.UNKNOWN,e.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class rD{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){0===this.oa&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve())))}ha(e){"Online"===this.state?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,"Online"===e&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){let t=`Could not reach Cloud Firestore backend. ${e}
19This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(R(t),this.aa=!1):k("OnlineStateTracker",t)}Pa(){null!==this._a&&(this._a.cancel(),this._a=null)}}let rx="RemoteStore";class rL{constructor(e,t,r,i,n){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=n,this.Aa.Oo(e=>{r.enqueueAndForget(async()=>{rF(this)&&(k(rx,"Restarting streams for network reachability change."),await async function(e){e.Ea.add(4),await rU(e),e.Ra.set("Unknown"),e.Ea.delete(4),await rM(e)}(this))})}),this.Ra=new rD(r,i)}}async function rM(e){if(rF(e))for(let t of e.da)await t(!0)}async function rU(e){for(let t of e.da)await t(!1)}function rF(e){return 0===e.Ea.size}async function rV(e,t){t?(e.Ea.delete(2),await rM(e)):t||(e.Ea.add(2),await rU(e),e.Ra.set("Unknown"))}class rB{constructor(e,t,r,i,n){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=i,this.removalCallback=n,this.deferred=new U,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,i,n){let s=new rB(e,t,Date.now()+r,i,n);return s.start(r),s}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new M(L.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}class rj{constructor(){this.queries=r$(),this.onlineState="Unknown",this.Ca=new Set}terminate(){var e;let t;e=new M(L.ABORTED,"Firestore shutting down"),t=this.queries,this.queries=r$(),t.forEach((t,r)=>{for(let t of r.Sa)t.onError(e)})}}function r$(){return new tw(e=>tm(e),tg)}(f=d||(d={})).Ma="default",f.Cache="cache";class rH{constructor(e,t,r,i,n,s){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedCl
19ientState=i,this.currentUser=n,this.maxConcurrentLimboResolutions=s,this.Pu={},this.Tu=new tw(e=>tm(e),tg),this.Iu=new Map,this.Eu=new Set,this.du=new eg(er.comparator),this.Au=new Map,this.Ru=new rr,this.Vu={},this.mu=new Map,this.fu=t5.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return!0===this.gu}}function rq(e,t,r){var i;if(e.isPrimaryClient&&0===r||!e.isPrimaryClient&&1===r){let r,n=[];e.Tu.forEach((e,r)=>{let i=r.view.va(t);i.snapshot&&n.push(i.snapshot)}),(i=e.eventManager).onlineState=t,r=!1,i.queries.forEach((e,i)=>{for(let e of i.Sa)e.va(t)&&(r=!0)}),r&&i.Ca.forEach(e=>{e.next()}),n.length&&e.Pu.H_(n),e.onlineState=t,e.isPrimaryClient&&e.sharedClientState.setOnlineState(t)}}async function rz(e,t,r){let i=[],n=[],s=[];e.Tu.isEmpty()||(e.Tu.forEach((a,o)=>{s.push(e.pu(o,t,r).then(t=>{if((t||r)&&e.isPrimaryClient){let i=t?!t.fromCache:r?.targetChanges.get(o.targetId)?.current;e.sharedClientState.updateQueryState(o.targetId,i?"current":"not-current")}if(t){i.push(t);let e=rc.As(o.targetId,t);n.push(e)}}))}),await Promise.all(s),e.Pu.H_(i),await async function(e,t){try{await e.persistence.runTransaction("notifyLocalViewChanges","readwrite",r=>eh.forEach(t,t=>eh.forEach(t.Es,i=>e.persistence.referenceDelegate.addReference(r,t.targetId,i)).next(()=>eh.forEach(t.ds,i=>e.persistence.referenceDelegate.removeReference(r,t.targetId,i)))))}catch(e){if(!eu(e))throw e;k("LocalStore","Failed to update sequence numbers: "+e)}for(let r of t){let t=r.targetId;if(!r.fromCache){let r=e.Ms.get(t),i=r.snapshotVersion,n=r.withLastLimboFreeSnapshotVersion(i);e.Ms=e.Ms.insert(t,n)}}}(e.localStore,n))}async function rW(e,t){if(!e.currentUser.isEqual(t)){k("SyncEngine","User change. New user:",t.toKey());let r=await rg(e.localStore,t);e.currentUser=t,e.mu.forEach(e=>{e.forEach(e=>{e.reject(new M(L.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),e.mu.clear(),e.sharedClientState.handleUserChange(t,r.removedBatchIds,r.addedBatchIds),await rz(e,r.Ls)}}class rK{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=new tX(e.databaseInfo.databaseId,!0),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,t){return null}Mu(e,t){return null}vu(e){var t,r;return t=this.persistence,r=new rf,new rp(t,r,e.initialUser,this.serializer)}Cu(e){return new rl(ru.mi,this.serializer)}Du(e){return new ry}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}rK.provider={build:()=>new rK};class rG{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>rq(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=rW.bind(null,this.syncEngine),await rV(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new rj}createDatastore(e){var t;let r=new tX(e.databaseInfo.databaseId,!0),i=new rk(e.databaseInfo);return t=e.authCredentials,new rO(t,e.appCheckCredentials,i,r)}createRemoteStore(e){var t,r;return t=this.localStore,r=this.datastore,new rL(t,r,e.asyncQueue,e=>rq(this.syncEngine,e,0),rE.v()?new rE:new rv)}createSyncEngine(e,t){var r,i,n,s,a,o;let l;return r=this.localStore,i=this.remoteStore,n=this.eventManager,s=this.sharedClientState,a=e.initialUser,o=e.maxConcurrentLimboResolutions,l=new rH(r,i,n,s,a,o),t&&(l.gu=!0),l}async terminate(){await async function(e){k(rx,"RemoteStore shutting down."),e.Ea.add(5),await rU(e),e.Aa.shutdown(),e.Ra.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}rG.provider={build:()=>new rG};let rJ=new Map,rX="firestore.googleapis.com";class rQ{constructor(e){if(void 0===e.host){if(void 0!==e.ssl)throw new M(L.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=rX,this.ssl=!0}else this.host=e.host,this.ssl=e.ssl??!0;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=0x2800000;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new M(L.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,r,i){if(!0===t&&!0===i)throw new M(L.INVALID_ARGUMENT,`${e} and ${r} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=function(e){let t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}(e.experimentalLongPollingOptions??{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new M(L.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new M(L.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new M(L.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){var t,r;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&&(t=this.experimentalLongPollingOptions,r=e.experimentalLongPollingOptions,t.timeoutSeconds===r.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}
19class rY{constructor(e,t,r,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new rQ({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new M(L.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"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new M(L.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 rQ(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new V;switch(e.type){case"firstParty":return new H(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new M(L.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){let e;return(e=rJ.get(this))&&(k("ComponentProvider","Removing Datastore"),rJ.delete(this),e.terminate()),Promise.resolve()}}class rZ{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new rZ(this.firestore,e,this._query)}}class r0{constructor(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new r1(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new r0(this.firestore,e,this._key)}toJSON(){return{type:r0._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,r){if(en(t,r0._jsonSchema))return new r0(e,r||null,new er(Z.fromString(t.referencePath)))}}r0._jsonSchemaVersion="firestore/documentReference/1.0",r0._jsonSchema={type:ei("string",r0._jsonSchemaVersion),referencePath:ei("string")};class r1 extends rZ{constructor(e,t,r){super(e,t,new tu(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let e=this._path.popLast();return e.isEmpty()?null:new r0(this.firestore,null,new er(e))}withConverter(e){return new r1(this.firestore,e,this._path)}}let r2="AsyncQueue";class r6{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new rP(this,"async_queue_retry"),this._c=()=>{let e=rR();e&&k(r2,"Visibility state changed to "+e.visibilityState),this.M_.w_()},this.ac=e;const t=rR();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;let t=rR();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});let t=new U;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Xu.push(e),this.lc()))}async lc(){if(0!==this.Xu.length){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!eu(e))throw e;k(r2,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){let t=this.ac.then(()=>(this.rc=!0,e().catch(e=>{throw this.nc=e,this.rc=!1,R("INTERNAL UNHANDLED ERROR: ",r3(e)),e}).then(e=>(this.rc=!1,e))));return this.ac=t,t}enqueueAfterDelay(e,t,r){this.uc(),this.oc.indexOf(e)>-1&&(t=0);let i=rB.createAndSchedule(this,e,t,r,e=>this.hc(e));return this.tc.push(i),i}uc(){this.nc&&O(47125,{Pc:r3(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(let t of this.tc)if(t.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{for(let t of(this.tc.sort((e,t)=>
19e.targetTimeMs-t.targetTimeMs),this.tc))if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Tc()})}dc(e){this.oc.push(e)}hc(e){let t=this.tc.indexOf(e);this.tc.splice(t,1)}}function r3(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}class r5 extends rY{constructor(e,t,r,i){super(e,t,r,i),this.type="firestore",this._queue=new r6,this._persistenceKey=i?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new r6(e),this._firestoreClient=void 0,await e}}}function r4(e,t){let r="object"==typeof e?e:(0,p.getApp)(),i=(0,p._getProvider)(r,"firestore").getImmediate({identifier:"string"==typeof e?e:t||eD});if(!i._initialized){let e=(0,y.getDefaultEmulatorHostnameAndPort)("firestore");e&&function(e,t,r,i={}){e=function(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new M(L.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let r=function(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{var t;let r=(t=e).constructor?t.constructor.name:null;return r?`a custom ${r} object`:"an object"}}return"function"==typeof e?"a function":O(12329,{type:typeof e})}(e);throw new M(L.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${r}`)}}return e}(e,rY);let n=(0,y.isCloudWorkstation)(t),s=e._getSettings(),a={...s,emulatorOptions:e._getEmulatorOptions()},o=`${t}:${r}`;n&&((0,y.pingServer)(`https://${o}`),(0,y.updateEmulatorBanner)("Firestore",!0)),s.host!==rX&&s.host!==o&&P("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");let l={...s,host:o,ssl:n,emulatorOptions:i};if(!(0,y.deepEqual)(l,a)&&(e._setSettings(l),i.mockUserToken)){let t,r;if("string"==typeof i.mockUserToken)t=i.mockUserToken,r=T.MOCK_USER;else{t=(0,y.createMockUserToken)(i.mockUserToken,e._app?.options.projectId);let n=i.mockUserToken.sub||i.mockUserToken.user_id;if(!n)throw new M(L.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");r=new T(n)}e._authCredentials=new B(new F(t,r))}}(i,...e)}return i}class r8{constructor(e){this._byteString=e}static fromBase64String(e){try{return new r8(eb.fromBase64String(e))}catch(e){throw new M(L.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new r8(eb.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:r8._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(en(e,r8._jsonSchema))return r8.fromBase64String(e.bytes)}}r8._jsonSchemaVersion="firestore/bytes/1.0",r8._jsonSchema={type:ei("string",r8._jsonSchemaVersion),bytes:ei("string")};class r7{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new M(L.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new et(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class r9{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new M(L.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new M(L.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return K(this._lat,e._lat)||K(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:r9._jsonSchemaVersion}}static fromJSON(e){if(en(e,r9._jsonSchema))return new r9(e.latitude,e.longitude)}}r9._jsonSchemaVersion="firestore/geoPoint/1.0",r9._jsonSchema={type:ei("str
19ing",r9._jsonSchemaVersion),latitude:ei("number"),longitude:ei("number")};class ie{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}(this._values,e._values)}toJSON(){return{type:ie._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(en(e,ie._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(e=>"number"==typeof e))return new ie(e.vectorValues);throw new M(L.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}ie._jsonSchemaVersion="firestore/vectorValue/1.0",ie._jsonSchema={type:ei("string",ie._jsonSchemaVersion),vectorValues:ei("object")};let it=RegExp("[~\\*/\\[\\]]");function ir(e,t,r,i,n){let s=i&&!i.isEmpty(),a=void 0!==n,o=`Function ${t}() called with invalid data`;r&&(o+=" (via `toFirestore()`)"),o+=". ";let l="";return(s||a)&&(l+=" (found",s&&(l+=` in field ${i}`),a&&(l+=` in document ${n}`),l+=")"),new M(L.INVALID_ARGUMENT,o+e+l)}class ii{constructor(e,t,r,i,n){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=i,this._converter=n}get id(){return this._key.path.lastSegment()}get ref(){return new r0(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){let e=new is(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let t=this._document.data.field(ia("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class is extends ii{data(){return super.data()}}function ia(e,t){return"string"==typeof t?function(e,t,r){if(t.search(it)>=0)throw ir(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,void 0);try{return new r7(...t.split("."))._internalPath}catch(r){throw ir(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,void 0)}}(e,t):t instanceof r7?t._internalPath:t._delegate._internalPath}class io{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class il extends ii{constructor(e,t,r,i,n,s){super(e,t,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=n}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new ih(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){let r=this._document.data.field(ia("DocumentSnapshot.get",e));if(null!==r)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new M(L.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e=this._document,t={};return t.type=il._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()&&(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),this._firestore,this.ref.path,t.bundle="NOT SUPPORTED"),t}}il._jsonSchemaVersion="firestore/documentSnapshot/1.0",il._jsonSchema={type:ei("string",il._jsonSchemaVersion),bundleSource:ei("string","DocumentSnapshot"),bundleName:ei("string"),bundle:ei("str
19ing")};class ih extends il{data(e={}){return super.data(e)}}class iu{constructor(e,t,r,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new io(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){let e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new ih(this._firestore,this._userDataWriter,r.key,r,new io(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new M(L.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(r=>{let i=new ih(e._firestore,e._userDataWriter,r.doc.key,r.doc,new io(e._snapshot.mutatedKeys.has(r.doc.key),e._snapshot.fromCache),e.query.converter);return r.doc,{type:"added",doc:i,oldIndex:-1,newIndex:t++}})}{let r=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{let i=new ih(e._firestore,e._userDataWriter,t.doc.key,t.doc,new io(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),n=-1,s=-1;return 0!==t.type&&(n=r.indexOf(t.doc.key),r=r.delete(t.doc.key)),1!==t.type&&(s=(r=r.add(t.doc)).indexOf(t.doc.key)),{type:function(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return O(61501,{type:e})}}(t.type),doc:i,oldIndex:n,newIndex:s}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new M(L.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e={};e.type=iu._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=W.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;let t=[],r=[],i=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),r.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,"previous")),i.push(e.ref.path))}),this._firestore,this.query._query,e.bundleName,e.bundle="NOT SUPPORTED",e}}iu._jsonSchemaVersion="firestore/querySnapshot/1.0",iu._jsonSchema={type:ei("string",iu._jsonSchemaVersion),bundleSource:ei("string","QuerySnapshot"),bundleName:ei("string"),bundle:ei("str
19ing")},new WeakMap,function(e=!0){S=p.SDK_VERSION,(0,p._registerComponent)(new g.Component("firestore",(t,{instanceIdentifier:r,options:i})=>{let n=t.getProvider("app").getImmediate(),s=new r5(new j(t.getProvider("auth-internal")),new z(n,t.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new M(L.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new ex(e.options.projectId,t)}(n,r),n);return i={useFetchStreams:e,...i},s._setSettings(i),s},"PUBLIC").setMultipleInstances(!0)),(0,p.registerVersion)(b,I,void 0),(0,p.registerVersion)(b,I,"esm2020")}(),e.s(["getFirestore",()=>r4],98925),e.s([],36180)},21052,e=>{"use strict";let t;e.i(14539);var r=e.i(76510);e.i(51718);var i=e.i(18357);e.i(36180);var n=e.i(98925);e.i(46012);var s=e.i(50239),a=e.i(92953),o=e.i(8070),l=e.i(97427),h=e.i(83877);let u=new Map,c={activated:!1,tokenObservers:[]},d={initialized:!1,enabled:!1};function f(e){return u.get(e)||{...c}}let p="https://content-firebaseappcheck.googleapis.com/v1";class g{constructor(e,t,r,i,n){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=r,this.lowerBound=i,this.upperBound=n,this.pending=null,this.nextErrorWaitInterval=i,i>n)throw 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{var t;this.pending=new l.Deferred,this.pending.promise.catch(e=>{}),await (t=this.getNextRun(e),new Promise(e=>{setTimeout(e,t)})),this.pending.resolve(),await this.pending.promise,this.pending=new l.Deferred,this.pending.promise.catch(e=>{}),await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}}let m=new l.ErrorFactory("appCheck","AppCheck",{"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.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"});function y(e=!1){return e?self.grecaptcha?.enterprise:self.grecaptcha}function v(e){if(!f(e).activated)throw m.create("use-before-activation",{appName:e.name})}function w(e){let t=Math.round(e/1e3),r=Math.floor(t/86400),i=Math.floor((t-3600*r*24)/3600),n=Math.floor((t-3600*r*24-3600*i)/60),s="";return r&&(s+=E(r)+"d:"),i&&(s+=E(i)+"h:"),s+=E(n)+"m:"+E(t-3600*r*24-3600*i-60*n)+"s"}function E(e){return 0===e?"00":e>=10?e.toString():"0"+e}async function _({url:e,body:t},r){let i,n,s={"Content-Type":"application/json"},a=r.getImmediate({optional:!0});if(a){let e=await a.getHeartbeatsHeader();e&&(s["X-Firebase-Client"]=e)}let o={method:"POST",body:JSON.stringify(t),headers:s};try{i=await fetch(e,o)}catch(e){throw m.create("fetch-network-error",{originalErrorMessage:e?.message})}if(200!==i.status)throw m.create("fetch-status-error",{httpStatus:i.status});try{n=await i.json()}catch(e){throw m.create("fetch-parse-error",{originalErrorMessage:e?.message})}let l=n.ttl.match(/^([\d.]+)(s)$/);if(!l||!l[2]||isNaN(Number(l[1])))throw m.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${n.ttl}`});let h=1e3*Number(l[1]),u=Date.now();return{token:n.token,expireTimeMillis:u+h,issuedAtTimeMillis:u}}
19function b(e,t){let{projectId:r,appId:i,apiKey:n}=e.options;return{url:`${p}/projects/${r}/apps/${i}:exchangeDebugToken?key=${n}`,body:{debug_token:t}}}let I="firebase-app-check-store",T="debug-token",S=null;function A(){return S||(S=new Promise((e,t)=>{try{let r=indexedDB.open("firebase-app-check-database",1);r.onsuccess=t=>{e(t.target.result)},r.onerror=e=>{t(m.create("storage-open",{originalErrorMessage:e.target.error?.message}))},r.onupgradeneeded=e=>{let t=e.target.result;0===e.oldVersion&&t.createObjectStore(I,{keyPath:"compositeKey"})}}catch(e){t(m.create("storage-open",{originalErrorMessage:e?.message}))}}))}async function C(e,t){let r=(await A()).transaction(I,"readwrite"),i=r.objectStore(I).put({compositeKey:e,value:t});return new Promise((e,t)=>{i.onsuccess=t=>{e()},r.onerror=e=>{t(m.create("storage-set",{originalErrorMessage:e.target.error?.message}))}})}async function k(e){let t=(await A()).transaction(I,"readonly"),r=t.objectStore(I).get(e);return new Promise((e,i)=>{r.onsuccess=t=>{let r=t.target.result;r?e(r.value):e(void 0)},t.onerror=e=>{i(m.create("storage-get",{originalErrorMessage:e.target.error?.message}))}})}function R(e){return`${e.options.appId}-${e.name}`}let P=new h.Logger("@firebase/app-check");async function N(e){if((0,l.isIndexedDBAvailable)()){let t;try{t=await k(R(e))}catch(e){P.warn(`Failed to read token from IndexedDB. Error: ${e}`)}return t}}function O(e,t){if((0,l.isIndexedDBAvailable)())return C(R(e),t).catch(e=>{P.warn(`Failed to write token to IndexedDB. Error: ${e}`)});return Promise.resolve()}async function D(){let e;try{e=await k(T)}catch(e){}if(e)return e;{let e=crypto.randomUUID();return C(T,e).catch(e=>P.warn(`Failed to persist debug token to IndexedDB. Error: ${e}`)),e}}function x(){return d.enabled}async function L(){if(d.enabled&&d.token)return d.token.promise;throw Error(`
20            Can't get debug token in production mode.
21        `)}let M={error:"UNKNOWN_ERROR"};async function U(e,t=!1,r=!1){let i,n,s=e.app;v(s);let a=f(s),o=a.token;if(o&&!H(o)&&(a.token=void 0,o=void 0),!o){let e=await a.cachedTokenPromise;e&&(H(e)?o=e:await O(s,void 0))}if(!t&&o&&H(o))return{token:o.token};let l=!1;if(x())try{a.exchangeTokenPromise||(a.exchangeTokenPromise=_(b(s,await L()),e.heartbeatServiceProvider).finally(()=>{a.exchangeTokenPromise=void 0}),l=!0);let t=await a.exchangeTokenPromise;return await O(s,t),a.token=t,{token:t.token}}catch(e){return"appCheck/throttled"===e.code||"appCheck/initial-throttle"===e.code?P.warn(e.message):r&&P.error(e),q(e)}try{a.exchangeTokenPromise||(a.exchangeTokenPromise=a.provider.getToken().finally(()=>{a.exchangeTokenPromise=void 0}),l=!0),o=await f(s).exchangeTokenPromise}catch(e){"appCheck/throttled"===e.code||"appCheck/initial-throttle"===e.code?P.warn(e.message):r&&P.error(e),n=e}return o?n?i=H(o)?{token:o.token,internalError:n}:q(n):(i={token:o.token},a.token=o,await O(s,o)):i=q(n),l&&$(s,i),i}async function F(e){let t=e.app;v(t);let{provider:r}=f(t);if(x()){let r=await L(),{token:i}=await _(b(t,r),e.heartbeatServiceProvider);return{token:i}}{let{token:e}=await r.getToken();return{token:e}}}function V(e,t,r,i){let{app:n}=e,s=f(n);if(s.tokenObservers=[...s.tokenObservers,{next:r,error:i,type:t}],s.token&&H(s.token)){let t=s.token;Promise.resolve().then(()=>{r({token:t.token}),j(e)}).catch(()=>{})}s.cachedTokenPromise.then(()=>j(e))}function B(e,t){let r=f(e),i=r.tokenObservers.filter(e=>e.next!==t);0===i.length&&r.tokenRefresher&&r.tokenRefresher.isRunning()&&r.tokenRefresher.stop(),r.tokenObservers=i}function j(e){let{app:t}=e,r=f(t),i=r.tokenRefresher;i||(r.tokenRefresher=i=function(e){let{app:t}=e;return new g(async()=>{let r;if((r=f(t).token?await U(e,!0):await U(e)).error)throw r.error;if(r.internalError)throw r.internalError},()=>!0,()=>{let e=f(t);if(!e.token)return 0;{let t=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5;return Math.max(0,(t=Math.min(t,e.token.expireTimeMillis-3e5))-Date.now())}},3e4,96e4)}(e)),!i.isRunning()&&r.isTokenAutoRefreshEnabled&&i.start()}
21function $(e,t){for(let r of f(e).tokenObservers)try{"EXTERNAL"===r.type&&null!=t.error?r.error(t.error):r.next(t)}catch(e){}}function H(e){return e.expireTimeMillis-Date.now()>0}function q(e){return{token:l.base64.encodeString(JSON.stringify(M),!1),error:e}}class z{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:e}=f(this.app);for(let t of e)B(this.app,t.next);return Promise.resolve()}}function W(e,t,r,i,n){r.ready(()=>{var s,a,o,l;let h,u;s=e,a=t,o=r,l=i,h=o.render(l,{sitekey:a,size:"invisible",callback:()=>{f(s).reCAPTCHAState.succeeded=!0},"error-callback":()=>{f(s).reCAPTCHAState.succeeded=!1}}),(u=f(s)).reCAPTCHAState={...u.reCAPTCHAState,widgetId:h},n.resolve(r)})}async function K(e){v(e);let t=f(e).reCAPTCHAState,r=await t.initialized.promise;return new Promise((t,i)=>{let n=f(e).reCAPTCHAState;r.ready(()=>{t(r.execute(n.widgetId,{action:"fire_app_check"}))})})}class G{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){let e;var t=this._throttleData;if(t&&Date.now()-t.allowRequestsAfter<=0)throw m.create("throttled",{time:w(t.allowRequestsAfter-Date.now()),httpStatus:t.httpStatus});let r=await K(this._app).catch(e=>{throw m.create("recaptcha-error")});if(!f(this._app).reCAPTCHAState?.succeeded)throw m.create("recaptcha-error");try{e=await _(function(e,t){let{projectId:r,appId:i,apiKey:n}=e.options;return{url:`${p}/projects/${r}/apps/${i}:exchangeRecaptchaV3Token?key=${n}`,body:{recaptcha_v3_token:t}}}(this._app,r),this._heartbeatServiceProvider)}catch(e){if(e.code?.includes("fetch-status-error"))throw this._throttleData=function(e,t){if(404===e||403===e)return{backoffCount:1,allowRequestsAfter:Date.now()+864e5,httpStatus:e};{let r=t?t.backoffCount:0,i=(0,l.calculateBackoffMillis)(r,1e3,2);return{backoffCount:r+1,allowRequestsAfter:Date.now()+i,httpStatus:e}}}(Number(e.customData?.httpStatus),this._throttleData),m.create("initial-throttle",{time:w(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus});throw e}return this._throttleData=null,e}initialize(e){var t,r,i;let n,s,o,h,u,c;this._app=e,this._heartbeatServiceProvider=(0,a._getProvider)(e,"heartbeat");(t=this._siteKey,n=new l.Deferred,f(e).reCAPTCHAState={initialized:n},r=e,h=`fire_app_check_${r.name}`,(u=document.createElement("div")).id=h,u.style.display="none",document.body.appendChild(u),s=h,(o=y(!1))?W(e,t,o,s,n):(i=()=>{let r=y(!1);if(!r)throw Error("no recaptcha");W(e,t,r,s,n)},(c=document.createElement("script")).src="https://www.google.com/recaptcha/api.js",c.onload=i,document.head.appendChild(c)),n.promise).catch(()=>{})}isEqual(e){return e instanceof G&&this._siteKey===e._siteKey}}let J="app-check-internal";(0,a._registerComponent)(new o.Component("app-check",e=>new z(e.getProvider("app").getImmediate(),e.getProvider("heartbeat")),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider(J).initialize()})),(0,a._registerComponent)(new o.Component(J,e=>{var t;return t=e.getProvider("app-check").getImmediate(),{getToken:e=>U(t,e),getLimitedUseToken:()=>F(t),addTokenListener:e=>V(t,"INTERNAL",e),removeTokenListener:e=>B(t.app,e)}},"PUBLIC").setInstantiationMode("EXPLICIT")),(0,a.registerVersion)("@firebase/app-check","0.11.0");let X=(0,r.getApps)().length?(0,r.getApp)():(0,r.initializeApp)({apiKey:"AIzaSyB07avalIpRbiwFjOqSguaoxS4lRswNl_U",authDomain:"biasdetectorextension.firebaseapp.com",projectId:"biasdetectorextension",storageBucket:"biasdetectorextension.firebasestorage.app",messagingSenderId:"664962798895",appId:"1:664962798895:web:81f296bfec93bb7c603dda",measurementId:"G-ZK7XV5948Y"});if(!["localhost","127.0.0.1","::1"].includes(window.location.hostname)){(0,s.isSupported)().then(e=>{e&&(t=(0,s.getAnalytics)(X))});try{!function(e=(0,a.getApp)(),t){e=(0,l.getModularInstance)(e);let r=(0,a._getProvider)(e,"app-check");if(d.initialized||function(){let e=(0,l.getGlobal)();if(d.initialized=!0,"string"!=typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN&&!0!==e.FIREBASE_APPCHECK_DEBUG_TOKEN)return;d.enabled=!0;let t=new l.Deferred;d.token=t,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN?t.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):t.resolve(D())}(),x()&&L().then(e=>console.log(`App Check debug token: ${e}
21. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),r.isInitialized()){r.getImmediate();let i=r.getOptions();if(i.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&i.provider.isEqual(t.provider))return;throw m.create("already-initialized",{appName:e.name})}let i=r.initialize({options:t});(function(e,t,r=!1){var i;let n=(i={...c},u.set(e,i),u.get(e));n.activated=!0,n.provider=t,n.cachedTokenPromise=N(e).then(t=>(t&&H(t)&&(n.token=t,$(e,{token:t.token})),t)),n.isTokenAutoRefreshEnabled=r&&e.automaticDataCollectionEnabled,!e.automaticDataCollectionEnabled&&r&&P.warn("`isTokenAutoRefreshEnabled` is true but `automaticDataCollectionEnabled` was set to false during `initializeApp()`. This blocks automatic token refresh."),n.provider.initialize(e)})(e,t.provider,t.isTokenAutoRefreshEnabled),f(e).isTokenAutoRefreshEnabled&&V(i,"INTERNAL",()=>{})}(X,{provider:new G("6Lfdk0MsAAAAAHA14Ysc5pE5epy2jpzyK0jlpGXp"),isTokenAutoRefreshEnabled:!0})}catch(e){console.error("App Check init failed:",e)}}let Q=(0,i.getAuth)(X),Y=new i.GoogleAuthProvider;(0,n.getFirestore)(X),e.s(["analytics",()=>t,"auth",0,Q,"provider",0,Y],21052)}]);

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.