PageSourceSearch

https://wavevisual.com/_next/static/chunks/pages/_app-b66aacb8816e0676.js

js wavevisual.com collected 2026-10-04 13:31:27 UTC 878,870 bytes, 10 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{62824:function(e,t,r){"use strict";let n,i,s,o;Object.defineProperty(t,"__esModule",{value:!0});var a=r(99413),l=r(4015),u=r(71470),c=r(56630);r(91363);let h="analytics",d="https://www.googletagmanager.com/gtag/js",f=new l.Logger("@firebase/analytics"),p=new u.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 m(e){if(!e.startsWith(d)){let t=p.create("invalid-gtag-resource",{gtagURL:e});return f.warn(t.message),""}return e}function g(e){return Promise.all(e.map(e=>e.catch(e=>e)))}async function y(e,t,r,n,i,s){let o=n[i];try{if(o)await t[o];else{let e=(await g(r)).find(e=>e.measurementId===i);e&&await t[e.appId]}}catch(e){f.error(e)}e("config",i,s)}async function v(e,t,r,n,i){try{let s=[];if(i&&i.send_to){let e=i.send_to;Array.isArray(e)||(e=[e]);let n=await g(r);for(let r of e){let e=n.find(e=>e.measurementId===r),i=e&&t[e.appId];if(i)s.push(i);else{s=[];break}}}0===s.length&&(s=Object.values(t)),await Promise.all(s),e("event",n,i||{})}catch(e){f.error(e)}}class w{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]}}let b=new w;async function _(e){let{appId:t,apiKey:r}=e,n={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":r})},i="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",t),s=await fetch(i,n);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 p.create("config-fetch-failed",{httpStatus:s.status,responseMessage:e})}return s.json()}async function E(e,t=b,r){let{appId:n,apiKey:i,measurementId:s}=e.options;if(!n)throw p.create("no-app-id");if(!i){if(s)return{measurementId:s,appId:n};throw p.create("no-api-key")}let o=t.getThrottleMetadata(n)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new T;return setTimeout(async()=>{a.abort()},void 0!==r?r:6e4),I({appId:n,apiKey:i,measurementId:s},o,a,t)}async function I(e,{throttleEndTimeMillis:t,backoffCount:r},n,i=b){let{appId:s,measurementId:o}=e;try{await new Promise((e,r)=>{let i=setTimeout(e,Math.max(t-Date.now(),0));n.addEventListener(()=>{clearTimeout(i),r(p.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}catch(e){if(o)return f.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${e?.message}
1]`),{appId:s,measurementId:o};throw e}try{let t=await _(e);return i.deleteThrottleMetadata(s),t}catch(l){if(!function(e){if(!(e instanceof u.FirebaseError)||!e.customData)return!1;let t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(l)){if(i.deleteThrottleMetadata(s),o)return f.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${l?.message}]`),{appId:s,measurementId:o};throw l}let t=503===Number(l?.customData?.httpStatus)?u.calculateBackoffMillis(r,i.intervalMillis,30):u.calculateBackoffMillis(r,i.intervalMillis),a={throttleEndTimeMillis:Date.now()+t,backoffCount:r+1};return i.setThrottleMetadata(s,a),f.debug(`Calling attemptFetch again in ${t} millis`),I(e,a,n,i)}}class T{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function S(e,t,r,n,i){if(i&&i.global){e("event",r,n);return}{let i=await t;e("event",r,{...n,send_to:i})}}async function A(e,t,r,n){if(n&&n.global)return e("set",{screen_name:r}),Promise.resolve();e("config",await t,{update:!0,screen_name:r})}async function C(e,t,r,n){if(n&&n.global)return e("set",{user_id:r}),Promise.resolve();e("config",await t,{update:!0,user_id:r})}async function P(e,t,r,n){if(n&&n.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 R(e,t){let r=await t;return new Promise((t,n)=>{e("get",r,"client_id",e=>{e||n(p.create("no-client-id")),t(e)})})}async function k(e,t){let r=await e;window[`ga-disable-${r}`]=!t}async function x(){if(!u.isIndexedDBAvailable())return f.warn(p.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await u.validateIndexedDBOpenable()}catch(e){return f.warn(p.create("indexeddb-unavailable",{errorInfo:e?.toString()}).message),!1}return!0}async function D(e,t,r,s,o,a,l){let u=E(e);u.then(t=>{r[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&f.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=>f.error(e)),t.push(u);let c=x().then(e=>e?s.getId():void 0),[h,p]=await Promise.all([u,c]);!function(e){for(let t of Object.values(window.document.getElementsByTagName("script")))if(t.src&&t.src.includes(d)&&t.src.includes(e))return t;return null}(a)&&function(e,t){var r,n;let i;let s=(r="firebase-js-sdk-policy",n={createScriptURL:m},window.trustedTypes&&(i=window.trustedTypes.createPolicy(r,n)),i),o=document.createElement("script"),a=`${d}?l=${e}&id=${t}`;o.src=s?s?.createScriptURL(a):a,o.async=!0,document.head.appendChild(o)}(a,h.measurementId),i&&(o("consent","default",i),i=void 0),o("js",new Date);let g=l?.config??{};return g.origin="firebase",g.update=!0,null!=p&&(g.firebase_id=p),o("config",h.measurementId,g),n&&(o("set",n),n=void 0),h.measurementId}class N{constructor(e){this.app=e}_delete(){return delete O[this.app.options.appId],Promise.resolve()}}let O={},M=[],L={},F="dataLayer",V="gtag",U=!1;function B(e,t={}){let r=a._getProvider(e,h);if(r.isInitialized()){let e=r.getImmediate();if(u.deepEqual(t,r.getOptions()))return e;throw p.create("already-initialized")}return r.initialize({options:t})}async function j(){if(u.isBrowserExtension()||!u.areCookiesEnabled()||!u.isIndexedDBAvailable())return!1;try{return await u.validateIndexedDBOpenable()}catch(e){return!1}}async function H(e){return e=u.getModularInstance(e),R(o,O[e.app.options.appId])}function z(e,t,r){e=u.getModularInstance(e),P(o,O[e.app.options.appId],t,r).catch(e=>f.error(e))}function q(e,t,r,n){e=u.getModularInstance(e),S(o,O[e.app.options.appId],t,r,n).catch(e=>f.error(e))}
1let G="@firebase/analytics",W="0.10.22";a._registerComponent(new c.Component(h,(e,{options:t})=>(function(e,t,r){!function(){let e=[];if(u.isBrowserExtension()&&e.push("This is a browser extension environment."),u.areCookiesEnabled()||e.push("Cookies are not available."),e.length>0){let t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),r=p.create("invalid-analytics-context",{errorInfo:t});f.warn(r.message)}}();let n=e.options.appId;if(!n)throw p.create("no-app-id");if(!e.options.apiKey){if(e.options.measurementId)f.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 p.create("no-api-key")}if(null!=O[n])throw p.create("already-exists",{id:n});if(!U){var i,a,l,c;let e,t;i=F,e=[],Array.isArray(window[i])?e=window[i]:window[i]=e;let{wrappedGtag:r,gtagCore:n}=(a=F,l=V,t=function(...e){window[a].push(arguments)},window[l]&&"function"==typeof window[l]&&(t=window[l]),window[l]=(c=t,async function(e,...t){try{if("event"===e){let[e,r]=t;await v(c,O,M,e,r)}else if("config"===e){let[e,r]=t;await y(c,O,M,L,e,r)}else if("consent"===e){let[e,r]=t;c("consent",e,r)}else if("get"===e){let[e,r,n]=t;c("get",e,r,n)}else if("set"===e){let[e]=t;c("set",e)}else c(e,...t)}catch(e){f.error(e)}}),{gtagCore:t,wrappedGtag:window[l]});o=r,s=n,U=!0}return O[n]=D(e,M,L,t,s,F,r),new N(e)})(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),a._registerComponent(new c.Component("analytics-internal",function(e){try{let t=e.getProvider(h).getImmediate();return{logEvent:(e,r,n)=>q(t,e,r,n),setUserProperties:(e,r)=>z(t,e,r)}}catch(e){throw p.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),a.registerVersion(G,W),a.registerVersion(G,W,"cjs2020"),t.getAnalytics=function(e=a.getApp()){e=u.getModularInstance(e);let t=a._getProvider(e,h);return t.isInitialized()?t.getImmediate():B(e)},t.getGoogleAnalyticsClientId=H,t.initializeAnalytics=B,t.isSupported=j,t.logEvent=q,t.setAnalyticsCollectionEnabled=function(e,t){k(O[(e=u.getModularInstance(e)).app.options.appId],t).catch(e=>f.error(e))},t.setConsent=function(e){o?o("consent","update",e):i=e},t.setCurrentScreen=function(e,t,r){e=u.getModularInstance(e),A(o,O[e.app.options.appId],t,r).catch(e=>f.error(e))},t.setDefaultEventParameters=function(e){o?o("set",e):n=e},t.setUserId=function(e,t,r){e=u.getModularInstance(e),C(o,O[e.app.options.appId],t,r).catch(e=>f.error(e))},t.setUserProperties=z,t.settings=function(e){if(U)throw p.create("already-initialized");e.dataLayerName&&(F=e.dataLayerName),e.gtagName&&(V=e.gtagName)}},99413:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(56630),s=r(4015),o=r(71470),a=r(55389);class l{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(!function(e){let t=e.getComponent();return t?.type==="VERSION"}(e))return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(" ")}}let u="@firebase/app",c="0.14.12",h=new s.Logger("@firebase/app"),d="[DEFAULT]",f={[u]:"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"},p=new Map,m=new Map,g=new Map;function y(e,t){try{e.container.addComponent(t)}catch(r){h.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function v(e){let t=e.name;if(g.has(t))return h.debug(`There were multiple attempts to register component ${t}.`),!1;
1for(let r of(g.set(t,e),p.values()))y(r,e);for(let t of m.values())y(t,e);return!0}function w(e,t){let r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function b(e){return void 0!==e.options}function _(e){return!b(e)&&("authIdToken"in e||"appCheckToken"in e||"releaseOnDeref"in e||"automaticDataCollectionEnabled"in e)}let E=new o.ErrorFactory("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.","invalid-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 I{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 i.Component("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 E.create("app-deleted",{appName:this._name})}}function T(e,t){let r=o.base64Decode(e.split(".")[1]);if(null===r){console.error(`FirebaseServerApp ${t} is invalid: second part could not be parsed.`);return}if(void 0===JSON.parse(r).exp){console.error(`FirebaseServerApp ${t} is invalid: expiration claim could not be parsed`);return}1e3*JSON.parse(r).exp-new Date().getTime()<=0&&console.error(`FirebaseServerApp ${t} is invalid: the token has expired.`)}class S extends I{constructor(e,t,r,n){let i=void 0===t.automaticDataCollectionEnabled||t.automaticDataCollectionEnabled,s={name:r,automaticDataCollectionEnabled:i};void 0!==e.apiKey?super(e,s,n):super(e.options,s,n),this._serverConfig={automaticDataCollectionEnabled:i,...t},this._serverConfig.authIdToken&&T(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&T(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,P(u,c,"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(){C(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw E.create("server-app-deleted")}}function A(e,t={}){let r=e;"object"!=typeof t&&(t={name:t});let n={name:d,automaticDataCollectionEnabled:!0,...t},s=n.name;if("string"!=typeof s||!s)throw E.create("bad-app-name",{appName:String(s)});if(r||(r=o.getDefaultAppConfig()),!r)throw E.create("no-options");let a=p.get(s);if(a){if(o.deepEqual(r,a.options)&&o.deepEqual(n,a.config))return a;throw E.create("duplicate-app",{appName:s})}let l=new i.ComponentContainer(s);for(let e of g.values())l.addComponent(e);let u=new I(r,n,l);return p.set(s,u),u}async function C(e){let t=!1,r=e.name;p.has(r)?(t=!0,p.delete(r)):m.has(r)&&0>=e.decRefCount()&&(m.delete(r),t=!0),t&&(await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function P(e,t,r){let n=f[e]??e;r&&(n+=`-${r}`);let s=n.match(/\s|\//),o=t.match(/\s|\//);if(s||o){let e=[`Unable to register library "${n}" with version "${t}":`];s&&e.push(`library name "${n}" contains illegal characters (whitespace or "/")`),s&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),h.warn(e.join(" "));return}v(new i.Component(`${n}-version`,()=>({library:n,version:t}),"VERSION"))}let R="firebase-heartbeat-store",k=null;function x(){return k||(k=a.openDB("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(R)}catch(e){console.warn(e)}}}).catch(e=>{throw E.create("idb-open",{originalErrorMessage:e.message})})),k}async function D(e){try{let t=(await x()).transaction(R),r=await t.objectStore(R).get(O(e));return await t.done,r}catch(e){if(e instanceof o.FirebaseError)h.warn(e.message);else{let t=E.create("idb-get",{originalErrorMessage:e?.message});h.warn(t.message)}}}async function N(e,t){try{let r=(await x()).transaction(R,"readwrite"),n=r.objectStore(R);await n.put(t,O(e)),await r.done}catch(e){if(e instanceof o.FirebaseError)h.warn(e.message);else{let t=E.create("idb-set",{originalErrorMessage:e?.message});h.warn(t.message)}}}function O(e){return`${e.name}!${e.options.appId}`}class M{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new F(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=L();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 n=1;n<e.length;n++)e[n].date<r&&(r=e[n].date,t=n);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){h.warn(e)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||0===this._heartbeatsCache.heartbeats.length)return"";let e=L(),{heartbeatsToSend:t,unsentEntries:r}=function(e,t=1024){let r=[],n=e.slice();for(let i of e){let e=r.find(e=>e.agent===i.agent);if(e){if(e.dates.push(i.date),V(r)>t){e.dates.pop();break}}else if(r.push({agent:i.agent,dates:[i.date]}),V(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}(this._heartbeatsCache.heartbeats),n=o.base64urlEncodeWithoutPadding(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)),n}catch(e){return h.warn(e),""}}}function L(){return new Date().toISOString().substring(0,10)}class F{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!o.isIndexedDBAvailable()&&o.validateIndexedDBOpenable().then(()=>!0).catch(()=>!1)}async read(){if(!await this._canUseIndexedDBPromise)return{heartbeats:[]};{let e=await D(this.app);return e?.heartbeats?e:{heartbeats:[]}}}async overwrite(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return N(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return N(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function V(e){return o.base64urlEncodeWithoutPadding(JSON.stringify({version:2,heartbeats:e})).length}n="node",v(new i.Component("platform-logger",e=>new l(e),"PRIVATE")),v(new i.Component("heartbeat",e=>new M(e),"PRIVATE")),P(u,c,n),P(u,c,"cjs2020"),P("fire-js",""),Object.defineProperty(t,"FirebaseError",{enumerable:!0,get:function(){return o.FirebaseError}}),t.SDK_VERSION="12.13.0",t._DEFAULT_ENTRY_NAME=d,t._addComponent=y,t._addOrOverwriteComponent=function(e,t){e.container.addOrOverwriteComponent(t)},t._apps=p,t._clearComponents=function(){g.clear()},t._components=g,t._getProvider=w,t._isFirebaseApp=b,t._isFirebaseServerApp=function(e){return null!=e&&void 0!==e.settings},t._isFirebaseServerAppSettings=_,t._registerComponent=v,t._removeServiceInstance=function(e,t,r=d){w(e,t).clearInstance(r)},t._serverApps=m,t.deleteApp=C,t.getApp=function(e=d){let t=p.get(e);if(!t&&e===d&&o.getDefaultAppConfig())return A();if(!t)throw E.create("no-app",{appName:e});return t},t.getApps=function(){return Array.from(p.values())},t.initializeApp=A,t.initializeServerApp=function(e,t={}){let r;if(o.isBrowser()&&!o.isWebWorker())throw E.create("invalid-server-app-environment");let n=t||{};if(e&&(b(e)?r=e.options:_(e)?n=e:r=e),void 0===n.automaticDataCollectionEnabled&&(n.automaticDataCollectionEnabled=!0),r||(r=o.getDefaultAppConfig()),!r)throw E.create("no-options");let s={...n,...r};if(void 0!==s.releaseOnDeref&&delete s.releaseOnDeref,void 0!==n.releaseOnDeref&&"undefined"==typeof FinalizationRegistry)throw E.create("finalization-registry-not-supported",{});let a=""+[...JSON.stringify(s)].reduce((e,t)=>
1Math.imul(31,e)+t.charCodeAt(0)|0,0),l=m.get(a);if(l)return l.incRefCount(n.releaseOnDeref),l;let u=new i.ComponentContainer(a);for(let e of g.values())u.addComponent(e);let c=new S(r,n,a,u);return m.set(a,c),c},t.onLog=function(e,t){if(null!==e&&"function"!=typeof e)throw E.create("invalid-log-argument");s.setUserLogHandler(e,t)},t.registerVersion=P,t.setLogLevel=function(e){s.setLogLevel(e)}},41123:function(e,t,r){"use strict";var n,i=r(99413),s=r(71470),o=r(4015),a=r(56630);function l(){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 u=new s.ErrorFactory("auth","Firebase",l()),c=new o.Logger("@firebase/auth");function h(e,...t){c.logLevel<=o.LogLevel.ERROR&&c.error(`Auth (${i.SDK_VERSION}): ${e}`,...t)}function d(e,...t){throw y(e,...t)}function f(e,...t){return y(e,...t)}function p(e,t,r){let n={...l(),[t]:r};return new s.ErrorFactory("auth","Firebase",n).create(t,{appName:e.name})}function m(e){return p(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function g(e,t,r){if(!(t instanceof r))throw r.name!==t.constructor.name&&d(e,"argument-error"),p(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function y(e,...t){if("string"!=typeof e){let r=t[0],n=[...t.slice(1)];return n[0]&&(n[0].appName=e.name),e._errorFactory.create(r,...n)}return u.create(e,...t)}function v(e,t,...r){if(!e)throw y(t,...r)}function w(e){let t="INTERNAL ASSERTION FAILED: "+e;throw h(t),Error(t)}function b(e,t){e||w(t)}function _(){return"undefined"!=typeof self&&self.location?.href||""}function E(){return"http:"===I()||"https:"===I()}function I(){return"undefined"!=typeof self&&self.location?.protocol||null}class T{constructor(e,t){this.shortDelay=e,this.longDelay=t,b(t>e,"Short delay should be less than long delay!"),this.isMobile=s.isMobileCordova()||s.isReactNative()}get(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(E()||s.isBrowserExtension()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function S(e,t){b(e.emulator,"Emulator should always be set here");let{url:r}=e.emulator;return t?`${r}${t.startsWith("/")?t.slice(1):t}`:r}class A{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 w("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 w("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 w("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}let C={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
1aptcha-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"},P=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],R=new T(3e4,6e4);function k(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function x(e,t,r,n,i={}){return D(e,i,async()=>{let i={},o={};n&&("GET"===t?o=n:i={body:JSON.stringify(n)});let a=s.querystring({key:e.config.apiKey,...o}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);let u={method:t,headers:l,...i};return s.isCloudflareWorker()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&s.isCloudWorkstation(e.emulatorConfig.host)&&(u.credentials="include"),A.fetch()(await O(e,e.config.apiHost,r,a),u)})}async function D(e,t,r){e._canInitEmulator=!1;let n={...C,...t};try{let t=new M(e),i=await Promise.race([r(),t.promise]);t.clearNetworkTimeout();let s=await i.json();if("needConfirmation"in s)throw L(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 L(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===t)throw L(e,"email-already-in-use",s);if("USER_DISABLED"===t)throw L(e,"user-disabled",s);let o=n[t]||t.toLowerCase().replace(/[_\s]+/g,"-");if(r)throw p(e,o,r);d(e,o)}}catch(t){if(t instanceof s.FirebaseError)throw t;d(e,"network-request-failed",{message:String(t)})}}async function N(e,t,r,n,i={}){let s=await x(e,t,r,n,i);return"mfaPendingCredential"in s&&d(e,"multi-factor-auth-required",{_serverResponse:s}),s}async function O(e,t,r,n){let i=`${t}${r}?${n}`,s=e.config.emulator?S(e.config,i):`${e.config.apiScheme}://${i}`;return P.includes(r)&&(await e._persistenceManagerAvailable,"COOKIE"===e._getPersistenceType())?e._getPersistence()._getFinalTarget(s).toString():s}class M{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(f(this.auth,"network-request-failed")),R.get())})}}function L(e,t,r){let n={appName:e.name};r.email&&(n.email=r.email),r.phoneNumber&&(n.phoneNumber=r.phoneNumber);let i=f(e,t,n);return i.customData._tokenResponse=r,i}function F(e){return void 0!==e&&void 0!==e.getResponse}function V(e){return void 0!==e&&void 0!==e.enterprise}class U{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)return function(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}(t.enforcementState);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 B(e){return(await x(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function j(e,t){return x(e,"GET","/v2/recaptchaConfig",k(e,t))}async function H(e,t){return x(e,"POST","/v1/accounts:delete",t)}async function z(e,t){return x(e,"POST","/v1/accounts:update",t)}async function q(e,t){return x(e,"POST","/v1/accounts:lookup",t)}function G(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function W(e,t=!1){let r=s.getModularInstance(e),n=await r.getIdToken(t),i=K(n);v(i&&i.exp&&i.auth_time&&i.iat,r.auth,"internal-error");let o="object"==typeof i.firebase?i.firebase:void 0,a=o?.sign_in_provider;return{claims:i,token:n,authTime:G($(i.auth_time)),issuedAtTime:G($(i.iat)),expirationTime:G($(i.exp)),signInProvider:a||null,signInSecondFactor:o?.sign_in_second_factor||null}}function $(e){return 1e3*Number(e)}function K(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=s.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 Q(e){let t=K(e);return v(t,"internal-error"),v(void 0!==t.exp,"internal-error"),v(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function Y(e,t,r=!1){if(r)return t;try{return await t}catch(t){throw t instanceof s.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 J{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 X{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=G(this.lastLoginAt),this.creationTime=G(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){let t=e.auth,r=await e.getIdToken(),n=await Y(e,q(t,{idToken:r}));v(n?.users.length,t,"internal-error");let i=n.users[0];e._notifyReloadListener(i);let s=i.providerUserInfo?.length?et(i.providerUserInfo):[],o=[...e.providerData.filter(e=>!s.some(t=>t.providerId===e.providerId)),...s],a=e.isAnonymous,l=!(e.email&&i.passwordHash)&&!o?.length;Object.assign(e,{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:o,metadata:new X(i.createdAt,i.lastLoginAt),isAnonymous:!!a&&l})}async function ee(e){let t=s.getModularInstance(e);await Z(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function et(e){return e.map(({providerId:e,...t})=>
1({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}async function er(e,t){let r=await D(e,{},async()=>{let r=s.querystring({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:n,apiKey:i}=e.config,o=await O(e,n,"/v1/token",`key=${i}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";let l={method:"POST",headers:a,body:r};return e.emulatorConfig&&s.isCloudWorkstation(e.emulatorConfig.host)&&(l.credentials="include"),A.fetch()(o,l)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function en(e,t){return x(e,"POST","/v2/accounts:revokeToken",k(e,t))}class ei{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){v(e.idToken,"internal-error"),v(void 0!==e.idToken,"internal-error"),v(void 0!==e.refreshToken,"internal-error");let t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):Q(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){v(0!==e.length,"internal-error");let t=Q(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(v(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:n,expiresIn:i}=await er(e,t);this.updateTokensAndExpiration(r,n,Number(i))}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:n,expirationTime:i}=t,s=new ei;return r&&(v("string"==typeof r,"internal-error",{appName:e}),s.refreshToken=r),n&&(v("string"==typeof n,"internal-error",{appName:e}),s.accessToken=n),i&&(v("number"==typeof i,"internal-error",{appName:e}),s.expirationTime=i),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 ei,this.toJSON())}_performRefresh(){return w("not implemented")}}function es(e,t){v("string"==typeof e||void 0===e,"internal-error",{appName:t})}class eo{constructor({uid:e,auth:t,stsTokenManager:r,...n}){this.providerId="firebase",this.proactiveRefresh=new J(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=n.displayName||null,this.email=n.email||null,this.emailVerified=n.emailVerified||!1,this.phoneNumber=n.phoneNumber||null,this.photoURL=n.photoURL||null,this.isAnonymous=n.isAnonymous||!1,this.tenantId=n.tenantId||null,this.providerData=n.providerData?[...n.providerData]:[],this.metadata=new X(n.createdAt||void 0,n.lastLoginAt||void 0)}async getIdToken(e){let t=await Y(this,this.stsTokenManager.getToken(this.auth,e));return v(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return W(this,e)}reload(){return ee(this)}_assign(e){this!==e&&(v(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new eo({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){v(!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(i._isFirebaseServerApp(this.auth.app))return Promise.reject(m(this.auth));let e=await this.getIdToken();return await Y(this,H(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,isA
1nonymous: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,n=t.email??void 0,i=t.phoneNumber??void 0,s=t.photoURL??void 0,o=t.tenantId??void 0,a=t._redirectEventId??void 0,l=t.createdAt??void 0,u=t.lastLoginAt??void 0,{uid:c,emailVerified:h,isAnonymous:d,providerData:f,stsTokenManager:p}=t;v(c&&p,e,"internal-error");let m=ei.fromJSON(this.name,p);v("string"==typeof c,e,"internal-error"),es(r,e.name),es(n,e.name),v("boolean"==typeof h,e,"internal-error"),v("boolean"==typeof d,e,"internal-error"),es(i,e.name),es(s,e.name),es(o,e.name),es(a,e.name),es(l,e.name),es(u,e.name);let g=new eo({uid:c,auth:e,email:n,emailVerified:h,displayName:r,isAnonymous:d,photoURL:s,phoneNumber:i,tenantId:o,stsTokenManager:m,createdAt:l,lastLoginAt:u});return f&&Array.isArray(f)&&(g.providerData=f.map(e=>({...e}))),a&&(g._redirectEventId=a),g}static async _fromIdTokenResponse(e,t,r=!1){let n=new ei;n.updateFromServerResponse(t);let i=new eo({uid:t.localId,auth:e,stsTokenManager:n,isAnonymous:r});return await Z(i),i}static async _fromGetAccountInfoResponse(e,t,r){let n=t.users[0];v(void 0!==n.localId,"internal-error");let i=void 0!==n.providerUserInfo?et(n.providerUserInfo):[],s=!(n.email&&n.passwordHash)&&!i?.length,o=new ei;o.updateFromIdToken(r);let a=new eo({uid:n.localId,auth:e,stsTokenManager:o,isAnonymous:s});return Object.assign(a,{uid:n.localId,displayName:n.displayName||null,photoURL:n.photoUrl||null,email:n.email||null,emailVerified:n.emailVerified||!1,phoneNumber:n.phoneNumber||null,tenantId:n.tenantId||null,providerData:i,metadata:new X(n.createdAt,n.lastLoginAt),isAnonymous:!(n.email&&n.passwordHash)&&!i?.length}),a}}let ea=new Map;function el(e){b(e instanceof Function,"Expected a class definition");let t=ea.get(e);return t?b(t instanceof e,"Instance stored in cache mismatched with class"):(t=new e,ea.set(e,t)),t}class eu{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 ec(e,t,r){return`firebase:${e}:${t}:${r}`}eu.type="NONE";class eh{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;let{config:n,name:i}=this.auth;this.fullUserKey=ec(this.userKey,n.apiKey,i),this.fullPersistenceKey=ec("persistence",n.apiKey,i),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 q(this.auth,{idToken:e}).catch(()=>void 0);return t?eo._fromGetAccountInfoResponse(this.auth,t,e):null}return eo._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 eh(el(eu),e,r);let n=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),i=n[0]||el(eu),s=ec(r,e.config.apiKey,e.name),o=null;for(let r of t)try{let t=await r._get(s);if(t){let n;if("string"==typeof t){let r=await q(e,{idToken:t}).catch(()=>void 0);if(!r)break;n=await eo._fromGetAccountInfoResponse(e,r,t)}else n=eo._fromJSON(e,t);r!==i&&(o=n),i=r;break}}catch{}let a=n.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&a.length&&(i=a[0],o&&await i._set(s,o.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(s)}catch{}}))),new eh(i,e,r)}}function ed(e){let t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(eg(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";{if(t.includes("edge/"))return"Edge";if(ef(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(ev(t))return"Blackberry";if(ew(t))return"Webos";if(ep(t))return"Safari";
1if((t.includes("chrome/")||em(t))&&!t.includes("edge/"))return"Chrome";if(ey(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 ef(e=s.getUA()){return/firefox\//i.test(e)}function ep(e=s.getUA()){let t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function em(e=s.getUA()){return/crios\//i.test(e)}function eg(e=s.getUA()){return/iemobile/i.test(e)}function ey(e=s.getUA()){return/android/i.test(e)}function ev(e=s.getUA()){return/blackberry/i.test(e)}function ew(e=s.getUA()){return/webos/i.test(e)}function eb(e=s.getUA()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function e_(e=s.getUA()){return eb(e)||ey(e)||ew(e)||ev(e)||/windows phone/i.test(e)||eg(e)}function eE(e,t=[]){let r;switch(e){case"Browser":r=ed(s.getUA());break;case"Worker":r=`${ed(s.getUA())}-${e}`;break;default:r=e}let n=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${i.SDK_VERSION}/${n}`}class eI{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let r=t=>new Promise((r,n)=>{try{let n=e(t);r(n)}catch(e){n(e)}});r.onAbort=t,this.queue.push(r);let n=this.queue.length-1;return()=>{this.queue[n]=()=>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 eT(e,t={}){return x(e,"GET","/v2/passwordPolicy",k(e,t))}class eS{constructor(e){let 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,n=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),n&&(t.meetsMaxPasswordLength=e.length<=n)}validatePasswordCharacterOptions(e,t){let r;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let n=0;n<e.length;n++)r=e.charAt(n),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,n,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=n)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class eA{constructor(e,t,r,n){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new eP(this),this.idTokenSubscription=new eP(this),this.beforeStateQueue=new eI(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=u,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=n.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=el(t)),this._initializationPromise=this.queue(async()=>
1{if(!this._deleted&&(this.persistenceManager=await eh.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 q(this,{idToken:e}),r=await eo._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(i._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(),r=t,n=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let t=this.redirectUser?._redirectEventId,i=r?._redirectEventId,s=await this.tryRedirectSignIn(e);(!t||t===i)&&s?.user&&(r=s.user,n=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(n)try{await this.beforeStateQueue.runMiddleware(r)}catch(e){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return(v(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId)?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}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(i._isFirebaseServerApp(this.app))return Promise.reject(m(this));let t=e?s.getModularInstance(e):null;return t&&v(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&&v(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 i._isFirebaseServerApp(this.app)?Promise.reject(m(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return i._isFirebaseServerApp(this.app)?Promise.reject(m(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(el(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 eS(await eT(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 s.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)=>
1{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 en(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&&el(e)||this._popupRedirectResolver;v(t,this,"argument-error"),this.redirectPersistenceManager=await eh.create(this,[el(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,n){if(this._deleted)return()=>{};let i="function"==typeof t?t:t.next.bind(t),s=!1,o=this._isInitialized?Promise.resolve():this._initializationPromise;if(v(o,this,"internal-error"),o.then(()=>{s||i(this.currentUser)}),"function"==typeof t){let i=e.addObserver(t,r,n);return()=>{s=!0,i()}}{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 v(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=eE(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(i._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){c.logLevel<=o.LogLevel.WARN&&c.warn(`Auth (${i.SDK_VERSION}): ${e}`,...t)}(`Error while retrieving App Check token: ${e.error}`),e?.token}}function eC(e){return s.getModularInstance(e)}class eP{constructor(e){this.auth=e,this.observer=null,this.addObserver=s.createSubscribe(e=>this.observer=e)}get next(){return v(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let eR={async loadJS(){throw Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function ek(e){return eR.loadJS(e)}function ex(e){return`__${e}${Math.floor(1e6*Math.random())}`}class eD{constructor(e){this.auth=e,this.counter=1e12,this._widgets=new Map}render(e,t){let r=this.counter;return this._widgets.set(r,new eM(e,this.auth.name,t||{})),this.counter++,r}reset(e){let t=e||1e12;this._widgets.get(t)?.delete(),this._widgets.delete(t)}getResponse(e){return this._widgets.get(e||1e12)?.getResponse()||""}async execute(e){return this._widgets.get(e||1e12)?.execute(),""}}class eN{constructor(){this.enterprise=new eO}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class eO{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class eM{constructor(e,t,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};let n="string"==typeof e?document.getElementById(e):e;v(n,"argument-error",{appName:t}),this.container=n,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(()=>{this.responseToken=function(e){let t=[],r="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let e=0;e<50;e++)t.push(r.charAt(Math.floor(Math.random()*r.length)));return t.join("")}(0);let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw Error("reCAPTCHA mock was already deleted!")}}let eL="NO_RECAPTCHA";class eF{constructor(e){this.type="recaptcha-enterprise",this.auth=eC(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)=>
1{j(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(n=>{if(void 0===n.recaptchaKey)r(Error("recaptcha Enterprise site key undefined"));else{let r=new U(n);return null==e.tenantId?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,t(r.siteKey)}}).catch(e=>{r(e)})})}function n(t,r,n){let i=window.grecaptcha;V(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{r(e)}).catch(()=>{r(eL)})}):n(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new eN().execute("siteKey",{action:"verify"}):new Promise((e,i)=>{r(this.auth).then(r=>{if(!t&&V(window.grecaptcha))n(r,e,i);else{if("undefined"==typeof window){i(Error("RecaptchaVerifier is only supported in browser"));return}let t=eR.recaptchaEnterpriseScript;0!==t.length&&(t+=r),ek(t).then(()=>{n(r,e,i)}).catch(e=>{i(e)})}}).catch(e=>{i(e)})})}}async function eV(e,t,r,n=!1,i=!1){let s;let o=new eF(e);if(i)s=eL;else try{s=await o.verify(r)}catch(e){s=await o.verify(r,!0)}let a={...t};if("mfaSmsEnrollment"===r||"mfaSmsSignIn"===r){if("phoneEnrollmentInfo"in a){let e=a.phoneEnrollmentInfo.phoneNumber,t=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){let e=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return n?Object.assign(a,{captchaResp:s}):Object.assign(a,{captchaResponse:s}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function eU(e,t,r,n,i){if("EMAIL_PASSWORD_PROVIDER"===i){if(!e._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER"))return n(e,t).catch(async i=>{if("auth/missing-recaptcha-token"!==i.code)return Promise.reject(i);{console.log(`${r} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let i=await eV(e,t,r,"getOobCode"===r);return n(e,i)}});{let i=await eV(e,t,r,"getOobCode"===r);return n(e,i)}}if("PHONE_PROVIDER"!==i)return Promise.reject(i+" provider is not supported.");if(e._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){let i=await eV(e,t,r);return n(e,i).catch(async i=>{if(e._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&("auth/missing-recaptcha-token"===i.code||"auth/invalid-app-credential"===i.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${r} flow.`);let i=await eV(e,t,r,!1,!0);return n(e,i)}return Promise.reject(i)})}{let i=await eV(e,t,r,!1,!0);return n(e,i)}}async function eB(e){let t=eC(e),r=new U(await j(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}));null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isAnyProviderEnabled()&&new eF(t).verify()}function ej(e,t){let r=i._getProvider(e,"auth");if(r.isInitialized()){let e=r.getImmediate(),n=r.getOptions();if(s.deepEqual(n,t??{}))return e;d(e,"already-initialized")}return r.initialize({options:t})}function eH(e,t,r){let n=eC(e);v(/^https?:\/\//.test(t),n,"invalid-emulator-scheme");let i=!!r?.disableWarnings,o=ez(t),{host:a,port:l}=function(e){let t=ez(e),r=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:"",port:null};let n=r[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(n);if(i){let e=i[1];return{host:e,port:eq(n.substr(e.length+1))}}{let[e,t]=n.split(":");return{host:e,port:eq(t)}}}(t),u=null===l?"":`:${l}`,c={url:`${o}//${a}${u}/`},h=Object.freeze({host:a,port:l,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!n._canInitEmulator){v(n.config.emulator&&n.emulatorConfig,n,"emulator-config-failed"),v(s.deepEqual(c,n.config.emulator)&&s.deepEqual(h,n.emulatorConfig),n,"emulator-config-failed");return}n.config.emulator=c,n.emulatorConfig=h,n.settings.appVerificationDisabledForTesting=!0,s.isCloudWorkstation(a)?s.pingServer(`${o}//${a}${u}`):i||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())}()}function ez(e){let t=e.indexOf(":");
1return t<0?"":e.substr(0,t+1)}function eq(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}class eG{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return w("not implemented")}_getIdTokenResponse(e){return w("not implemented")}_linkToIdToken(e,t){return w("not implemented")}_getReauthenticationResolver(e){return w("not implemented")}}async function eW(e,t){return x(e,"POST","/v1/accounts:resetPassword",k(e,t))}async function e$(e,t){return x(e,"POST","/v1/accounts:update",t)}async function eK(e,t){return x(e,"POST","/v1/accounts:signUp",t)}async function eQ(e,t){return x(e,"POST","/v1/accounts:update",k(e,t))}async function eY(e,t){return N(e,"POST","/v1/accounts:signInWithPassword",k(e,t))}async function eJ(e,t){return x(e,"POST","/v1/accounts:sendOobCode",k(e,t))}async function eX(e,t){return eJ(e,t)}async function eZ(e,t){return eJ(e,t)}async function e0(e,t){return eJ(e,t)}async function e1(e,t){return eJ(e,t)}async function e2(e,t){return N(e,"POST","/v1/accounts:signInWithEmailLink",k(e,t))}async function e4(e,t){return N(e,"POST","/v1/accounts:signInWithEmailLink",k(e,t))}class e6 extends eG{constructor(e,t,r,n=null){super("password",r),this._email=e,this._password=t,this._tenantId=n}static _fromEmailAndPassword(e,t){return new e6(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new e6(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);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return eU(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",eY,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return e2(e,{email:this._email,oobCode:this._password});default:d(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return eU(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",eK,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return e4(e,{idToken:t,email:this._email,oobCode:this._password});default:d(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function e8(e,t){return N(e,"POST","/v1/accounts:signInWithIdp",k(e,t))}class e3 extends eG{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new e3(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&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):d("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let{providerId:t,signInMethod:r,...n}="string"==typeof e?JSON.parse(e):e;if(!t||!r)return null;let i=new e3(t,r);return i.idToken=n.idToken||void 0,i.accessToken=n.accessToken||void 0,i.secret=n.secret,i.nonce=n.nonce,i.pendingToken=n.pendingToken||null,i}_getIdTokenResponse(e){return e8(e,this.buildRequest())}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,e8(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,e8(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=s.querystring(t)}return e}}async function e5(e,t){return x(e,"POST","/v1/accounts:sendVerificationCode",k(e,t))}async function e9(e,t){return N(e,"POST","/v1/accounts:signInWithPhoneNumber",k(e,t))}async function e7(e,t){let r=await N(e,"POST","/v1/accounts:signInWithPhoneNumber",k(e,t));if(r.temporaryProof)throw L(e,"account-exists-with-different-credential",r);return r}let te={USER_NOT_FOUND:"user-not-found"};async function tt(e,t){return N(e,"POST","/v1/accounts:signInWithPhoneNumber",k(e,{...t,operation:"REAUTH"}),te)}class tr extends eG{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new tr({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new tr({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return e9(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return e7(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return tt(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:n}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:n}}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:n,temporaryProof:i}=e;return r||t||n||i?new tr({verificationId:t,verificationCode:r,phoneNumber:n,temporaryProof:i}):null}}class tn{constructor(e){let t=s.querystringDecode(s.extractQuerystring(e)),r=t.apiKey??null,n=t.oobCode??null,i=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);v(r&&n&&i,"argument-error"),this.apiKey=r,this.operation=i,this.code=n,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){let t=function(e){let t=s.querystringDecode(s.extractQuerystring(e)).link,r=t?s.querystringDecode(s.extractQuerystring(t)).deep_link_id:null,n=s.querystringDecode(s.extractQuerystring(e)).deep_link_id;return(n?s.querystringDecode(s.extractQuerystring(n)).link:null)||n||r||t||e}(e);try{return new tn(t)}catch{return null}}}class ti{constructor(){this.providerId=ti.PROVIDER_ID}static credential(e,t){return e6._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let r=tn.parseLink(t);return v(r,"argument-error"),e6._fromEmailAndCode(e,r.code,r.tenantId)}}ti.PROVIDER_ID="password",ti.EMAIL_PASSWORD_SIGN_IN_METHOD="password",ti.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class ts{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 to extends ts{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class ta extends to{static credentialFromJSON(e){let t="string"==typeof e?JSON.parse(e):e;return v("providerId"in t&&"signInMethod"in t,"argument-error"),e3._fromParams(t)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return v(e.idToken||e.accessToken,"argument-error"),e3._fromParams({...e,providerId:this.providerId,sign
1InMethod:this.providerId})}static credentialFromResult(e){return ta.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return ta.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r,oauthTokenSecret:n,pendingToken:i,nonce:s,providerId:o}=e;if(!r&&!n&&!t&&!i||!o)return null;try{return new ta(o)._credential({idToken:t,accessToken:r,nonce:s,pendingToken:i})}catch(e){return null}}}class tl extends to{constructor(){super("facebook.com")}static credential(e){return e3._fromParams({providerId:tl.PROVIDER_ID,signInMethod:tl.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return tl.credentialFromTaggedObject(e)}static credentialFromError(e){return tl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return tl.credential(e.oauthAccessToken)}catch{return null}}}tl.FACEBOOK_SIGN_IN_METHOD="facebook.com",tl.PROVIDER_ID="facebook.com";class tu extends to{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return e3._fromParams({providerId:tu.PROVIDER_ID,signInMethod:tu.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return tu.credentialFromTaggedObject(e)}static credentialFromError(e){return tu.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return tu.credential(t,r)}catch{return null}}}tu.GOOGLE_SIGN_IN_METHOD="google.com",tu.PROVIDER_ID="google.com";class tc extends to{constructor(){super("github.com")}static credential(e){return e3._fromParams({providerId:tc.PROVIDER_ID,signInMethod:tc.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return tc.credentialFromTaggedObject(e)}static credentialFromError(e){return tc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return tc.credential(e.oauthAccessToken)}catch{return null}}}tc.GITHUB_SIGN_IN_METHOD="github.com",tc.PROVIDER_ID="github.com";class th extends eG{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return e8(e,this.buildRequest())}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,e8(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,e8(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let{providerId:t,signInMethod:r,pendingToken:n}="string"==typeof e?JSON.parse(e):e;return t&&r&&n&&t===r?new th(t,n):null}static _create(e,t){return new th(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class td extends ts{constructor(e){v(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return td.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return td.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let t=th.fromJSON(e);return v(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:t,providerId:r}=e;if(!t||!r)return null;try{return th._create(r,t)}catch(e){return null}}}class tf extends to{constructor(){super("twitter.com")}static credential(e,t){return e3._fromParams({providerId:tf.PROVIDER_ID,signInMethod:tf.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return tf.credentialFromTaggedObject(e)}static credentialFromError(e){return tf.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return tf.credential(t,r)}catch{return null}}}async function tp(e,t){return N(e,"POST","/v1/accounts:signUp",k(e,t))}tf.TWITTER_SIGN_IN_METHOD="twitter.com",tf.PROVIDER_ID="twitter.com";class tm{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,n=!1){return new tm({user:await eo._fromIdTokenResponse(e,r,n),providerId:tg(r),_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){return await e._updateTokensIfNecessary(r,!0),new tm({user:e,providerId:tg(r),_tokenResponse:r,operationType:t})}}function tg(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}async function ty(e){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let t=eC(e);if(await t._initializationPromise,t.currentUser?.isAnonymous)return new tm({user:t.currentUser,providerId:null,operationType:"signIn"});let r=await tp(t,{returnSecureToken:!0}),n=await tm._fromIdTokenResponse(t,"signIn",r,!0);return await t._updateCurrentUser(n.user),n}class tv extends s.FirebaseError{constructor(e,t,r,n){super(t.code,t.message),this.operationType=r,this.user=n,Object.setPrototypeOf(this,tv.prototype),this.customData={appName:e.n
1ame,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,n){return new tv(e,t,r,n)}}function tw(e,t,r,n){return("reauthenticate"===t?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(r=>{if("auth/multi-factor-auth-required"===r.code)throw tv._fromErrorAndOperation(e,r,t,n);throw r})}function tb(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}async function t_(e,t){let r=s.getModularInstance(e);await tI(!0,r,t);let{providerUserInfo:n}=await z(r.auth,{idToken:await r.getIdToken(),deleteProvider:[t]}),i=tb(n||[]);return r.providerData=r.providerData.filter(e=>i.has(e.providerId)),i.has("phone")||(r.phoneNumber=null),await r.auth._persistUserIfCurrent(r),r}async function tE(e,t,r=!1){let n=await Y(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return tm._forOperation(e,"link",n)}async function tI(e,t,r){await Z(t),v(tb(t.providerData).has(r)===e,t.auth,!1===e?"provider-already-linked":"no-such-provider")}async function tT(e,t,r=!1){let{auth:n}=e;if(i._isFirebaseServerApp(n.app))return Promise.reject(m(n));let s="reauthenticate";try{let i=await Y(e,tw(n,s,t,e),r);v(i.idToken,n,"internal-error");let o=K(i.idToken);v(o,n,"internal-error");let{sub:a}=o;return v(e.uid===a,n,"user-mismatch"),tm._forOperation(e,s,i)}catch(e){throw e?.code==="auth/user-not-found"&&d(n,"user-mismatch"),e}}async function tS(e,t,r=!1){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let n="signIn",s=await tw(e,n,t),o=await tm._fromIdTokenResponse(e,n,s);return r||await e._updateCurrentUser(o.user),o}async function tA(e,t){return tS(eC(e),t)}async function tC(e,t){let r=s.getModularInstance(e);return await tI(!1,r,t.providerId),tE(r,t)}async function tP(e,t){return tT(s.getModularInstance(e),t)}async function tR(e,t){return N(e,"POST","/v1/accounts:signInWithCustomToken",k(e,t))}async function tk(e,t){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let r=eC(e),n=await tR(r,{token:t,returnSecureToken:!0}),s=await tm._fromIdTokenResponse(r,"signIn",n);return await r._updateCurrentUser(s.user),s}class tx{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?tD._fromServerResponse(e,t):"totpInfo"in t?tN._fromServerResponse(e,t):d(e,"internal-error")}}class tD extends tx{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new tD(t)}}class tN extends tx{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new tN(t)}}function tO(e,t,r){v(r.url?.length>0,e,"invalid-continue-uri"),v(void 0===r.dynamicLinkDomain||r.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),v(void 0===r.linkDomain||r.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=r.url,t.dynamicLinkDomain=r.dynamicLinkDomain,t.linkDomain=r.linkDomain,t.canHandleCodeInApp=r.handleCodeInApp,r.iOS&&(v(r.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=r.iOS.bundleId),r.android&&(v(r.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=r.android.installApp,t.androidMinimumVersionCode=r.android.minimumVersion,t.androidPackageName=r.android.packageName)}async function tM(e){let t=eC(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function tL(e,t,r){let n=eC(e),i={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};r&&tO(n,i,r),await eU(n,i,"getOobCode",eZ,"EMAIL_PASSWORD_PROVIDER")}async function tF(e,t,r){await eW(s.getModularInstance(e),{oobCode:t,newPassword:r}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tM(e),t})}async function tV(e,t){await eQ(s.getModularInstance(e),{oobCode:t})}async function tU(e,t){let r=s.getModularInstance(e),n=await eW(r,{oobCode:t}),i=n.requestType;switch(v(i,r,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":v(n.newEmail,r,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":v(n.mfaInfo,r,"internal-error");default:v(n.email,r,"internal-error")}let o=null;return n.mfaInfo&&(o=tx._fromServerResponse(eC(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:o},operation:i}}async function tB(e,t){let{data:r}=await tU(s.getModularInstance(e),t);return r.email}async function tj(e,t,r){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let n=eC(e),s=eU(n,{returnSecureToken:!0,email:t,password:r,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",tp,"EMAIL_PASSWORD_PROVIDER"),o=await s.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tM(e),t}),a=await tm._fromIdTokenResponse(n,"signIn",o);return await n._updateCurrentUser(a.user),a}async function tH(e,t,r){let n=eC(e),i={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};v(r.handleCodeInApp,n,"argument-error"),r&&tO(n,i,r),await eU(n,i,"getOobCode",e0,"EMAIL_PASSWORD_PROVIDER")}async function tz(e,t,r){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let n=s.getModularInstance(e),o=ti.credentialWithLink(t,r||_());return v(o._tenantId===(n.tenantId||null),n,"tenant-id-mismatch"),tA(n,o)}async function tq(e,t){return x(e,"POST","/v1/accounts:createAuthUri",k(e,t))}async function tG(e,t){let r=E()?_():"http://localhost",{signinMethods:n}=await tq(s.getModularInstance(e),{identifier:t,continueUri:r});return n||[]}async function tW(e,t){let r=s.getModularInstance(e),n={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&tO(r.auth,n,t);let{email:i}=await eX(r.auth,n);i!==e.email&&await e.reload()}async function t$(e,t,r){let n=s.getModularInstance(e),i={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};r&&tO(n.auth,i,r);let{email:o}=await e1(n.auth,i);o!==e.email&&await e.reload()}async function tK(e,t){return x(e,"POST","/v1/accounts:update",t)}async function tQ(e,{displayName:t,photoURL:r}
1){if(void 0===t&&void 0===r)return;let n=s.getModularInstance(e),i=await n.getIdToken(),o=await Y(n,tK(n.auth,{idToken:i,displayName:t,photoUrl:r,returnSecureToken:!0}));n.displayName=o.displayName||null,n.photoURL=o.photoUrl||null;let a=n.providerData.find(({providerId:e})=>"password"===e);a&&(a.displayName=n.displayName,a.photoURL=n.photoURL),await n._updateTokensIfNecessary(o)}async function tY(e,t,r){let{auth:n}=e,i={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(i.email=t),r&&(i.password=r);let s=await Y(e,e$(n,i));await e._updateTokensIfNecessary(s,!0)}class tJ{constructor(e,t,r={}){this.isNewUser=e,this.providerId=t,this.profile=r}}class tX extends tJ{constructor(e,t,r,n){super(e,t,r),this.username=n}}class tZ extends tJ{constructor(e,t){super(e,"facebook.com",t)}}class t0 extends tX{constructor(e,t){super(e,"github.com",t,"string"==typeof t?.login?t?.login:null)}}class t1 extends tJ{constructor(e,t){super(e,"google.com",t)}}class t2 extends tX{constructor(e,t,r){super(e,"twitter.com",t,r)}}async function t4(e,t){return eC(e).validatePassword(t)}function t6(e,t,r,n){return s.getModularInstance(e).onIdTokenChanged(t,r,n)}function t8(e,t,r){return s.getModularInstance(e).beforeAuthStateChanged(t,r)}async function t3(e){return s.getModularInstance(e).delete()}class t5{constructor(e,t,r){this.type=e,this.credential=t,this.user=r}static _fromIdtoken(e,t){return new t5("enroll",e,t)}static _fromMfaPendingCredential(e){return new t5("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){if(e?.multiFactorSession){if(e.multiFactorSession?.pendingCredential)return t5._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(e.multiFactorSession?.idToken)return t5._fromIdtoken(e.multiFactorSession.idToken)}return null}}class t9{constructor(e,t,r){this.session=e,this.hints=t,this.signInResolver=r}static _fromError(e,t){let r=eC(e),n=t.customData._serverResponse,i=(n.mfaInfo||[]).map(e=>tx._fromServerResponse(r,e));v(n.mfaPendingCredential,r,"internal-error");let s=t5._fromMfaPendingCredential(n.mfaPendingCredential);return new t9(s,i,async e=>{let i=await e._process(r,s);delete n.mfaInfo,delete n.mfaPendingCredential;let o={...n,idToken:i.idToken,refreshToken:i.refreshToken};switch(t.operationType){case"signIn":let a=await tm._fromIdTokenResponse(r,t.operationType,o);return await r._updateCurrentUser(a.user),a;case"reauthenticate":return v(t.user,r,"internal-error"),tm._forOperation(t.user,t.operationType,o);default:d(r,"internal-error")}})}async resolveSignIn(e){return this.signInResolver(e)}}function t7(e,t){return x(e,"POST","/v2/accounts/mfaEnrollment:start",k(e,t))}class re{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(t=>tx._fromServerResponse(e.auth,t)))})}static _fromUser(e){return new re(e)}async getSession(){return t5._fromIdtoken(await this.user.getIdToken(),this.user)}
1async enroll(e,t){let r=await this.getSession(),n=await Y(this.user,e._process(this.user.auth,r,t));return await this.user._updateTokensIfNecessary(n),this.user.reload()}async unenroll(e){let t="string"==typeof e?e:e.uid,r=await this.user.getIdToken();try{var n,i;let e=await Y(this.user,(n=this.user.auth,i={idToken:r,mfaEnrollmentId:t},x(n,"POST","/v2/accounts/mfaEnrollment:withdraw",k(n,i))));this.enrolledFactors=this.enrolledFactors.filter(({uid:e})=>e!==t),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(e){throw e}}}let rt=new WeakMap,rr="__sak";class rn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(rr,"1"),this.storage.removeItem(rr),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 ri extends rn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=e_(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let r=this.storage.getItem(t),n=this.localCache[t];r!==n&&e(t,n,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((e,t,r)=>{this.notifyListeners(e,r)});return}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)},i=this.storage.getItem(r);s.isIE()&&10===document.documentMode&&i!==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]}}function rs(e){let t=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=RegExp(`${t}=([^;]+)`);return document.cookie.match(r)?.[1]??null}function ro(e){let t="http:"===window.location.protocol;return`${t?"__dev_":"__HOST-"}FIREBASE_${e.split(":")[3]}`}ri.type="LOCAL";class ra{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){let t=new URL(`${window.location.origin}/__cookies__`);return t.searchParams.set("finalTarget",e),t}async _isAvailable(){return!!("boolean"!=typeof isSecureContext||isSecureContext)&&"undefined"!=typeof navigator&&"undefined"!=typeof document&&(navigator.cookieEnabled??!0)}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;let t=ro(e);if(window.cookieStore){let e=await window.cookieStore.get(t);return e?.value}return rs(t)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let t=ro(e);document.cookie=`${t}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>void 0)}_addListener(e,t){if(!this._isAvailable())return;let r=ro(e);if(window.cookieStore){let e=e=>{let n=e.changed.find(e=>e.name===r);n&&t(n.value),e.deleted.find(e=>e.name===r)&&t(null)};return this.listenerUnsubscribes.set(t,()=>window.cookieStore.removeEventListener("change",e)),window.cookieStore.addEventListener("change",e)}let n=rs(r),i=setInterval(()=>{let e=rs(r);e!==n&&(t(e),n=e)},1e3);this.listenerUnsubscribes.set(t,()=>clearInterval(i))}_removeListener(e,t){let r=this.listenerUnsubscribes.get(t);r&&(r(),this.listenerUnsubscribes.delete(t))}}ra.type="COOKIE";class rl extends rn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}rl.type="SESSION";class ru{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 ru(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let{eventId:t,eventType:r,data:n}=e.data,i=this.handlersMap[r];if(!i?.size)return;e.ports[0].postMessage({status:"ack",eventId:t,eventType:r});let s=Array.from(i).map(async t=>t(e.origin,n)),o=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:o})}_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)}}
1function rc(e="",t=10){let r="";for(let e=0;e<t;e++)r+=Math.floor(10*Math.random());return e+r}ru.receivers=[];class rh{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 n,i;let s="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!s)throw Error("connection_unavailable");return new Promise((o,a)=>{let l=rc("",20);s.port1.start();let u=setTimeout(()=>{a(Error("unsupported_event"))},r);i={messageChannel:s,onMessage(e){if(e.data.eventId===l)switch(e.data.status){case"ack":clearTimeout(u),n=setTimeout(()=>{a(Error("timeout"))},3e3);break;case"done":clearTimeout(n),o(e.data.response);break;default:clearTimeout(u),clearTimeout(n),a(Error("invalid_response"))}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}function rd(){return window}function rf(){return void 0!==rd().WorkerGlobalScope&&"function"==typeof rd().importScripts}async function rp(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}let rm="firebaseLocalStorageDb",rg="firebaseLocalStorage",ry="fbase_key";class rv{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function rw(e,t){return e.transaction([rg],t?"readwrite":"readonly").objectStore(rg)}function rb(){let e=indexedDB.open(rm,1);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{let t=e.result;try{t.createObjectStore(rg,{keyPath:ry})}catch(e){r(e)}}),e.addEventListener("success",async()=>{let r=e.result;r.objectStoreNames.contains(rg)?t(r):(r.close(),await new rv(indexedDB.deleteDatabase(rm)).toPromise(),t(await rb()))})})}async function r_(e,t,r){return new rv(rw(e,!0).put({[ry]:t,value:r})).toPromise()}async function rE(e,t){let r=rw(e,!1).get(t),n=await new rv(r).toPromise();return void 0===n?null:n.value}function rI(e,t){return new rv(rw(e,!0).delete(t)).toPromise()}class rT{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 rb()),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 rf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ru._getInstance(rf()?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 rp(),!this.activeServiceWorker)return;this.sender=new rh(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 rb();return await r_(e,rr,"1"),await rI(e,rr),!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=>r_(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>rE(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>rI(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new rv(rw(e,!1).getAll()).toPromise());if(!e||0!==this.pendingWrites)return[];let t=[],r=new Set;if(0!==e.length)for(let{fbase_key:n,value:i}of e)r.add(n),JSON.stringify(this.localCache[n])!==JSON.stringify(i)&&(this.notifyListeners(n,i),t.push(n));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 rS(e,t){return x(e,"POST","/v2/accounts/mfaSignIn:start",k(e,t))}rT.type="LOCAL";let rA=ex("rcb"),rC=new T(3e4,6e4);class rP{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!rd().grecaptcha?.render}load(e,t=""){return(v(t.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(t),e,"argument-error"),this.shouldResolveImmediately(t)&&F(rd().grecaptcha))?Promise.resolve(rd().grecaptcha):new Promise((r,n)=>{let i=rd().setTimeout(()=>{n(f(e,"network-request-failed"))},rC.get());rd()[rA]=()=>{rd().clearTimeout(i),delete rd()[rA];let s=rd().grecaptcha;if(!s||!F(s)){n(f(e,"internal-error"));return}let o=s.render;s.render=(e,t)=>{let r=o(e,t);return this.counter++,r},this.hostLanguage=t,r(s)},ek(`${eR.recaptchaV2Script}?${s.querystring({onload:rA,render:"explicit",hl:t})}`).catch(()=>
1{clearTimeout(i),n(f(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!rd().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class rR{async load(e){return new eD(e)}clearedOneInstance(){}}let rk="recaptcha",rx={theme:"light",type:"image"};class rD{constructor(e,t,r={...rx}){this.parameters=r,this.type=rk,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=eC(e),this.isInvisible="invisible"===this.parameters.size,v("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment");let n="string"==typeof t?document.getElementById(t):t;v(n,this.auth,"argument-error"),this.container=n,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new rR:new rP,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),t=this.getAssertedRecaptcha();return t.getResponse(e)||new Promise(r=>{let n=e=>{e&&(this.tokenChangeListeners.delete(n),r(e))};this.tokenChangeListeners.add(n),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e})),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){v(!this.parameters.sitekey,this.auth,"argument-error"),v(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),v("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(e=>e(t)),"function"==typeof e)e(t);else if("string"==typeof e){let r=rd()[e];"function"==typeof r&&r(t)}}}assertNotDestroyed(){v(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}
1async init(){let e;v(E()&&!rf(),this.auth,"internal-error"),await (e=null,new Promise(t=>{if("complete"===document.readyState){t();return}e=()=>t(),window.addEventListener("load",e)}).catch(t=>{throw e&&window.removeEventListener("load",e),t})),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let t=await B(this.auth);v(t,this.auth,"internal-error"),this.parameters.sitekey=t}getAssertedRecaptcha(){return v(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class rN{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=tr._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function rO(e,t,r){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let n=eC(e);return new rN(await rF(n,t,s.getModularInstance(r)),e=>tA(n,e))}async function rM(e,t,r){let n=s.getModularInstance(e);return await tI(!1,n,"phone"),new rN(await rF(n.auth,t,s.getModularInstance(r)),e=>tC(n,e))}async function rL(e,t,r){let n=s.getModularInstance(e);return i._isFirebaseServerApp(n.auth.app)?Promise.reject(m(n.auth)):new rN(await rF(n.auth,t,s.getModularInstance(r)),e=>tP(n,e))}async function rF(e,t,r){if(!e._getRecaptchaConfig())try{await eB(e)}catch(e){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let n;if(n="string"==typeof t?{phoneNumber:t}:t,"session"in n){let t=n.session;if("phoneNumber"in n){v("enroll"===t.type,e,"internal-error");let i={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:n.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},s=async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===eL){v(r?.type===rk,e,"argument-error");let n=await rU(e,t,r);return t7(e,n)}return t7(e,t)},o=eU(e,i,"mfaSmsEnrollment",s,"PHONE_PROVIDER");return(await o.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{v("signin"===t.type,e,"internal-error");let i=n.multiFactorHint?.uid||n.multiFactorUid;v(i,e,"missing-multi-factor-info");let s={mfaPendingCredential:t.credential,mfaEnrollmentId:i,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},o=async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===eL){v(r?.type===rk,e,"argument-error");let n=await rU(e,t,r);return rS(e,n)}return rS(e,t)},a=eU(e,s,"mfaSmsSignIn",o,"PHONE_PROVIDER");return(await a.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{let t={phoneNumber:n.phoneNumber,clientType:"CLIENT_TYPE_WEB"},i=async(e,t)=>{if(t.captchaResponse===eL){v(r?.type===rk,e,"argument-error");let n=await rU(e,t,r);return e5(e,n)}return e5(e,t)},s=eU(e,t,"sendVerificationCode",i,"PHONE_PROVIDER");return(await s.catch(e=>Promise.reject(e))).sessionInfo}}finally{r?._reset()}}async function rV(e,t){let r=s.getModularInstance(e);if(i._isFirebaseServerApp(r.auth.app))return Promise.reject(m(r.auth));await tE(r,t)}async function rU(e,t,r){v(r.type===rk,e,"argument-error");let n=await r.verify();v("string"==typeof n,e,"argument-error");let i={...t};if("phoneEnrollmentInfo"in i){let e=i.phoneEnrollmentInfo.phoneNumber,t=i.phoneEnrollmentInfo.captchaResponse,r=i.phoneEnrollmentInfo.clientType,s=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:n,captchaResponse:t,clientType:r,recaptchaVersion:s}}),i}if(!("phoneSignInInfo"in i))return Object.assign(i,{recaptchaToken:n}),i;{let e=i.phoneSignInInfo.captchaResponse,t=i.phoneSignInInfo.clientType,r=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:n,captchaResponse:e,clientType:t,recaptchaVersion:r}}),i}}class rB{constructor(e){this.providerId=rB.PROVIDER_ID,this.auth=eC(e)}verifyPhoneNumber(e,t){return rF(this.auth,e,s.getModularInstance(t))}static credential(e,t){return tr._fromVerification(e,t)}static credentialFromResult(e){return rB.credentialFromTaggedObject(e)}static credentialFromError(e){return rB.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:r}=e;return t&&r?tr._fromTokenResponse(t,r):null}}function rj(e,t){return t?el(t):(v(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}
1rB.PROVIDER_ID="phone",rB.PHONE_SIGN_IN_METHOD="phone";class rH extends eG{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return e8(e,this._buildIdpRequest())}_linkToIdToken(e,t){return e8(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return e8(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 rz(e){return tS(e.auth,new rH(e),e.bypassAuthState)}function rq(e){let{auth:t,user:r}=e;return v(r,t,"internal-error"),tT(r,new rH(e),e.bypassAuthState)}async function rG(e){let{auth:t,user:r}=e;return v(r,t,"internal-error"),tE(r,new rH(e),e.bypassAuthState)}class rW{constructor(e,t,r,n,i=!1){this.auth=e,this.resolver=r,this.user=n,this.bypassAuthState=i,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:n,tenantId:i,error:s,type:o}=e;if(s){this.reject(s);return}let a={auth:this.auth,requestUri:t,sessionId:r,tenantId:i||void 0,postBody:n||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return rz;case"linkViaPopup":case"linkViaRedirect":return rG;case"reauthViaPopup":case"reauthViaRedirect":return rq;default:d(this.auth,"internal-error")}}resolve(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}let r$=new T(2e3,1e4);async function rK(e,t,r){if(i._isFirebaseServerApp(e.app))return Promise.reject(f(e,"operation-not-supported-in-this-environment"));let n=eC(e);g(e,t,ts);let s=rj(n,r);return new rJ(n,"signInViaPopup",t,s).executeNotNull()}async function rQ(e,t,r){let n=s.getModularInstance(e);if(i._isFirebaseServerApp(n.auth.app))return Promise.reject(f(n.auth,"operation-not-supported-in-this-environment"));g(n.auth,t,ts);let o=rj(n.auth,r);return new rJ(n.auth,"reauthViaPopup",t,o,n).executeNotNull()}async function rY(e,t,r){let n=s.getModularInstance(e);g(n.auth,t,ts);let i=rj(n.auth,r);return new rJ(n.auth,"linkViaPopup",t,i,n).executeNotNull()}class rJ extends rW{constructor(e,t,r,n,i){super(e,t,n,i),this.provider=r,this.authWindow=null,this.pollId=null,rJ.currentPopupAction&&rJ.currentPopupAction.cancel(),rJ.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return v(e,this.auth,"internal-error"),e}async onExecution(){b(1===this.filter.length,"Popup operations only handle one event");let e=rc();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(f(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(f(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,rJ.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(f(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,r$.get())};e()}}rJ.currentPopupAction=null;let rX=new Map;class rZ extends rW{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=rX.get(this.auth._key());if(!e){try{let t=await r0(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}rX.set(this.auth._key(),e)}return this.bypassAuthState||rX.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
1if("unknown"===e.type){this.resolve(null);return}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 r0(e,t){let r=r6(t),n=r4(e);if(!await n._isAvailable())return!1;let i=await n._get(r)==="true";return await n._remove(r),i}async function r1(e,t){return r4(e)._set(r6(t),"true")}function r2(e,t){rX.set(e._key(),t)}function r4(e){return el(e._redirectPersistence)}function r6(e){return ec("pendingRedirect",e.config.apiKey,e.name)}async function r8(e,t,r){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let n=eC(e);g(e,t,ts),await n._initializationPromise;let s=rj(n,r);return await r1(s,n),s._openRedirect(n,t,"signInViaRedirect")}async function r3(e,t,r){let n=s.getModularInstance(e);if(g(n.auth,t,ts),i._isFirebaseServerApp(n.auth.app))return Promise.reject(m(n.auth));await n.auth._initializationPromise;let o=rj(n.auth,r);await r1(o,n.auth);let a=await ne(n);return o._openRedirect(n.auth,t,"reauthViaRedirect",a)}async function r5(e,t,r){let n=s.getModularInstance(e);g(n.auth,t,ts),await n.auth._initializationPromise;let i=rj(n.auth,r);await tI(!1,n,t.providerId),await r1(i,n.auth);let o=await ne(n);return i._openRedirect(n.auth,t,"linkViaRedirect",o)}async function r9(e,t){return await eC(e)._initializationPromise,r7(e,t,!1)}async function r7(e,t,r=!1){if(i._isFirebaseServerApp(e.app))return Promise.reject(m(e));let n=eC(e),s=rj(n,t),o=new rZ(n,s,r),a=await o.execute();return a&&!r&&(delete a.user._redirectEventId,await n._persistUserIfCurrent(a.user),await n._setRedirectUser(null,t)),a}async function ne(e){let t=rc(`${e.uid}:::`);return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}class nt{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 nn(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!nn(e)){let r=e.error.code?.split("auth/")[1]||"internal-error";t.onError(f(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(nr(e))}saveEventToCache(e){this.cachedEventUids.add(nr(e)),this.lastProcessedEventTime=Date.now()}}function nr(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function nn({type:e,error:t}){return"unknown"===e&&t?.code==="auth/no-auth-event"}async function ni(e,t={}){return x(e,"GET","/v1/projects",t)}let ns=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,no=/^https?/;async function na(e){if(e.config.emulator)return;let{authorizedDomains:t}=await ni(e);for(let e of t)try{if(function(e){let t=_(),{protocol:r,hostname:n}=new URL(t);if(e.startsWith("chrome-extension://")){let i=new URL(e);return""===i.hostname&&""===n?"chrome-extension:"===r&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===r&&i.hostname===n}if(!no.test(r))return!1;if(ns.test(e))return n===e;let i=e.replace(/\./g,"\\.");return RegExp("^(.+\\."+i+"|"+i+")$","i").test(n)}(e))return}catch{}d(e,"unauthorized-domain")}let nl=new T(3e4,6e4);function nu(){let e=rd().___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 nc=null,nh=new T(5e3,15e3),nd={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},nf=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function np(e){let t=await (nc=nc||new Promise((t,r)=>{function n(){nu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{nu(),r(f(e,"network-request-failed"))},timeout:nl.get()})}if(rd().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else if(rd().gapi?.load)n();else{let t=ex("iframefcb");return rd()[t]=()=>{gapi.load?n():r(f(e,"network-request-failed"))},ek(`${eR.gapiScript}?onload=${t}`).catch(e=>r(e))}}).catch(e=>{throw nc=null,e})),r=rd().gapi;return v(r,e,"internal-error"),t.open({where:document.body,url:function(e){let t=e.config;v(t.authDomain,e,"auth-domain-config-required");let r=t.emulator?S(t,"emulator/auth/iframe"):`https://${e.config.authDomain}
1/__/auth/iframe`,n={apiKey:t.apiKey,appName:e.name,v:i.SDK_VERSION},o=nf.get(e.config.apiHost);o&&(n.eid=o);let a=e._getFrameworks();return a.length&&(n.fw=a.join(",")),`${r}?${s.querystring(n).slice(1)}`}(e),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:nd,dontclear:!0},t=>new Promise(async(r,n)=>{await t.restyle({setHideOnLeave:!1});let i=f(e,"network-request-failed"),s=rd().setTimeout(()=>{n(i)},nh.get());function o(){rd().clearTimeout(s),r(t)}t.ping(o).then(o,()=>{n(i)})}))}let nm={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class ng{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}let ny=encodeURIComponent("fac");async function nv(e,t,r,n,o,a){v(e.config.authDomain,e,"auth-domain-config-required"),v(e.config.apiKey,e,"invalid-api-key");let l={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:n,v:i.SDK_VERSION,eventId:o};if(t instanceof ts)for(let[r,n]of(t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||"",s.isEmpty(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(a||{})))l[r]=n;if(t instanceof to){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 u=await e._getAppCheckToken(),c=u?`#${ny}=${encodeURIComponent(u)}`:"";return`${function({config:e}){return e.emulator?S(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${s.querystring(l).slice(1)}${c}`}let nw="webStorageSupport";class nb{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=rl,this._completeRedirectFn=r7,this._overrideRedirectResult=r2}async _openPopup(e,t,r,n){b(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");let i=await nv(e,t,r,_(),n);return function(e,t,r,n=500,i=600){let o=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-n)/2,0).toString(),l="",u={...nm,width:n.toString(),height:i.toString(),top:o,left:a},c=s.getUA().toLowerCase();r&&(l=em(c)?"_blank":r),ef(c)&&(t=t||"http://localhost",u.scrollbars="yes");let h=Object.entries(u).reduce((e,[t,r])=>`${e}${t}=${r},`,"");if(function(e=s.getUA()){return eb(e)&&!!window.navigator?.standalone}(c)&&"_self"!==l)return function(e,t){let r=document.createElement("a");r.href=e,r.target=t;let n=document.createEvent("MouseEvent");n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),r.dispatchEvent(n)}(t||"",l),new ng(null);let d=window.open(t||"",l,h);v(d,e,"popup-blocked");try{d.focus()}catch(e){}return new ng(d)}(e,i,rc())}async _openRedirect(e,t,r,n){var i;return await this._originValidation(e),i=await nv(e,t,r,_(),n),rd().location.href=i,new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:e,promise:r}=this.eventManagers[t];return e?Promise.resolve(e):(b(r,"If manager is not set, promise should be"),r)}let r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){let t=await np(e),r=new nt(e);return t.register("authEvent",t=>(v(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(nw,{type:nw},r=>{let n=r?.[0]?.[nw];void 0!==n&&t(!!n),d(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=na(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return e_()||ep()||eb()}}class n_{constructor(e){this.factorId=e}_process(e,t,r){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,r);case"signin":return this._finalizeSignIn(e,t.credential);default:return w("unexpected MultiFactorSessionType")}}}class nE extends n_{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new nE(e)}_finalizeEnroll(e,t,r){return x(e,"POST","/v2/accounts/mfaEnrollment:finalize",k(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return x(e,"POST","/v2/accounts/mfaSignIn:finalize",k(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class nI{constructor(){}static assertion(e){return nE._fromCredential(e)}}nI.FACTOR_ID="phone";class nT{static assertionForEnrollment(e,t){return nS._fromSecret(e,t)}static assertionForSignIn(e,t){return nS._fromEnrollmentId(e,t)}static async generateSecret(e){var t;v(void 0!==e.user?.auth,"internal-error");let r=await x(t=e.user.auth,"POST","/v2/accounts/mfaEnrollment:start",k(t,{idToken:e.credential,totpEnrollmentInfo:{}}));return nA._fromStartTotpMfaEnrollmentResponse(r,e.user.auth)}}nT.FACTOR_ID="totp";class nS extends n_{constructor(e,t,r){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=r}static _fromSecret(e,t){return new nS(t,void 0,e)}static _fromEnrollmentId(e,t){return new nS(t,e)}async _finalizeEnroll(e,t,r){return v(void 0!==this.secret,e,"argument-error"),x(e,"POST","/v2/accounts/mfaEnrollment:finalize",k(e,{idToken:t,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}))}async _finalizeSignIn(e,t){v(void 0!==this.enrollmentId&&void 0!==this.otp,e,"argument-error");let r={verificationCode:this.otp};return x(e,"POST","/v2/accounts/mfaSignIn:finalize",k(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r}))}}class nA{constructor(e,t,r,n,i,s,o){this.sessionInfo=s,this.auth=o,this.secretKey=e,this.hashingAlgorithm=t,this.co
1deLength=r,this.codeIntervalSeconds=n,this.enrollmentCompletionDeadline=i}static _fromStartTotpMfaEnrollmentResponse(e,t){return new nA(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){let r=!1;return(nC(e)||nC(t))&&(r=!0),r&&(nC(e)&&(e=this.auth.currentUser?.email||"unknownuser"),nC(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function nC(e){return void 0===e||e?.length===0}var nP="@firebase/auth",nR="1.13.1";class nk{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(){v(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}let nx=s.getExperimentalSetting("authIdTokenMaxAge")||300,nD=null,nN=e=>async t=>{let r=t&&await t.getIdTokenResult(),n=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(n&&n>nx)return;let i=r?.token;nD!==i&&(nD=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};eR={loadJS:e=>new Promise((t,r)=>{let n=document.createElement("script");n.setAttribute("src",e),n.onload=t,n.onerror=e=>{let t=f("internal-error");t.customData=e,r(t)},n.type="text/javascript",n.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(n)}),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="},n="Browser",i._registerComponent(new a.Component("auth",(e,{options:t})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;v(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});let l=new eA(r,i,s,{apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:eE(n)});return function(e,t){let r=t?.persistence||[],n=(Array.isArray(r)?r:[r]).map(el);t?.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(n,t?.popupRedirectResolver)}(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),i._registerComponent(new a.Component("auth-internal",e=>new nk(eC(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),i.registerVersion(nP,nR,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}}(n)),i.registerVersion(nP,nR,"cjs2020"),t.AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVA
1LID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVALID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_LOGIN_CREDENTIALS:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_
1NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_PASSWORD:"auth/missing-password",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type",INVALID_HOSTING_LINK_DOMAIN:"auth/invalid-hosting-link-domain"},t.ActionCodeOperation={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"},t.ActionCodeURL=tn,t.AuthCredential=eG,t.AuthEventManager=nt,t.AuthImpl=eA,t.AuthPopup=ng,t.EmailAuthCredential=e6,t.EmailAuthProvider=ti,t.FacebookAuthProvider=tl,t.FactorId={PHONE:"phone",TOTP:"totp"},t.FetchProvider=A,t.GithubAuthProvider=tc,t.GoogleAuthProvider=tu,t.OAuthCredential=e3,t.OAuthProvider=ta,t.OperationType={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},t.PhoneAuthCredential=tr,t.PhoneAuthProvider=rB,t.PhoneMultiFactorGenerator=nI,t.ProviderId={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},t.RecaptchaVerifier=rD,t.SAMLAuthCredential=th,t.SAMLAuthProvider=td,t.SignInMethod={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},t.TotpMultiFactorGenerator=nT,t.TotpSecret=nA,t.TwitterAuthProvider=tf,t.UserImpl=eo,t._assert=v,t._castAuth=eC,t._clearRedirectOutcomes=function(){rX.clear()},t._createError=f,t._fail=d,t._generateEventId=rc,t._getClientVersion=eE,t._getInstance=el,t._getProjectConfig=ni,t._getRedirectResult=r7,t._getRedirectUrl=nv,t._isAndroid=ey,t._isIOS=eb,t._isIOS7Or8=function(e=s.getUA()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)},t._overrideRedirectResult=r2,t._persistenceKeyName=ec,t.applyActionCode=tV,t.beforeAuthStateChanged=t8,t.browserCookiePersistence=ra,t.browserLocalPersistence=ri,t.browserPopupRedirectResolver=nb,t.browserSessionPersistence=rl,t.checkActionCode=tU,t.confirmPasswordReset=tF,t.connectAuthEmulator=eH,t.createUserWithEmailAndPassword=tj,t.debugAssert=b,t.debugErrorMap=function
vendor: 12,062 bytes, line 1
1(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","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.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements.","invalid-hosting-link-domain":"The provided Hosting link domain is not configured in Firebase Hosting or is not owned by the current project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`)."}},
1t.deleteUser=t3,t.fetchSignInMethodsForEmail=tG,t.getAdditionalUserInfo=function(e){let{user:t,_tokenResponse:r}=e;return t.isAnonymous&&!r?{providerId:null,isNewUser:!1,profile:null}:function(e){if(!e)return null;let{providerId:t}=e,r=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},n=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!t&&e?.idToken){let t=K(e.idToken)?.firebase?.sign_in_provider;if(t)return new tJ(n,"anonymous"!==t&&"custom"!==t?t:null)}if(!t)return null;switch(t){case"facebook.com":return new tZ(n,r);case"github.com":return new t0(n,r);case"google.com":return new t1(n,r);case"twitter.com":return new t2(n,r,e.screenName||null);case"custom":case"anonymous":return new tJ(n,null);default:return new tJ(n,t,r)}}(r)},t.getAuth=function(e=i.getApp()){let t=i._getProvider(e,"auth");if(t.isInitialized())return t.getImmediate();let r=ej(e,{popupRedirectResolver:nb,persistence:[rT,ri,rl]}),n=s.getExperimentalSetting("authTokenSyncURL");if(n&&"boolean"==typeof isSecureContext&&isSecureContext){let e=new URL(n,location.origin);if(location.origin===e.origin){let t=nN(e.toString());t8(r,t,()=>t(r.currentUser)),t6(r,e=>t(e))}}let o=s.getDefaultEmulatorHost("auth");return o&&eH(r,`http://${o}`),r},t.getIdToken=function(e,t=!1){return s.getModularInstance(e).getIdToken(t)},t.getIdTokenResult=W,t.getMultiFactorResolver=function(e,t){let r=s.getModularInstance(e);return v(t.customData.operationType,r,"argument-error"),v(t.customData._serverResponse?.mfaPendingCredential,r,"argument-error"),t9._fromError(r,t)},t.getRedirectResult=r9,t.inMemoryPersistence=eu,t.indexedDBLocalPersistence=rT,t.initializeAuth=ej,t.initializeRecaptchaConfig=function(e){return eB(e)},t.isSignInWithEmailLink=function(e,t){let r=tn.parseLink(t);return r?.operation==="EMAIL_SIGNIN"},t.linkWithCredential=tC,t.linkWithPhoneNumber=rM,t.linkWithPopup=rY,t.linkWithRedirect=function(e,t,r){return r5(e,t,r)},t.multiFactor=function(e){let t=s.getModularInstance(e);return rt.has(t)||rt.set(t,re._fromUser(t)),rt.get(t)},t.onAuthStateChanged=function(e,t,r,n){return s.getModularInstance(e).onAuthStateChanged(t,r,n)},t.onIdTokenChanged=t6,t.parseActionCodeURL=function(e){return tn.parseLink(e)},t.prodErrorMap=l,t.reauthenticateWithCredential=tP,t.reauthenticateWithPhoneNumber=rL,t.reauthenticateWithPopup=rQ,t.reauthenticateWithRedirect=function(e,t,r){return r3(e,t,r)},t.reload=ee,t.revokeAccessToken=function(e,t){return eC(e).revokeAccessToken(t)},t.sendEmailVerification=tW,t.sendPasswordResetEmail=tL,t.sendSignInLinkToEmail=tH,t.setPersistence=function(e,t){return s.getModularInstance(e).setPersistence(t)},t.signInAnonymously=ty,t.signInWithCredential=tA,t.signInWithCustomToken=tk,t.signInWithEmailAndPassword=function(e,t,r){return i._isFirebaseServerApp(e.app)?Promise.reject(m(e)):tA(s.getModularInstance(e),ti.credential(t,r)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tM(e),t})},t.signInWithEmailLink=tz,t.signInWithPhoneNumber=rO,t.signInWithPopup=rK,t.signInWithRedirect=function(e,t,r){return r8(e,t,r)},t.signOut=function(e){return s.getModularInstance(e).signOut()},t.unlink=t_,t.updateCurrentUser=function(e,t){return s.getModularInstance(e).updateCurrentUser(t)},t.updateEmail=function(e,t){let r=s.getModularInstance(e);return i._isFirebaseServerApp(r.auth.app)?Promise.reject(m(r.auth)):tY(r,t,null)},t.updatePassword=function(e,t){return tY(s.getModularInstance(e),null,t)},t.updatePhoneNumber=rV,t.updateProfile=tQ,t.useDeviceLanguage=function(e){s.getModularInstance(e).useDeviceLanguage()},t.validatePassword=t4,t.verifyBeforeUpdateEmail=t$,t.verifyPasswordResetCode=tB},77661:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var n=r(41123);r(99413),r(71470),r(4015),r(56630),t.ActionCodeOperation=n.ActionCodeOperation,t.ActionCodeURL=n.ActionCodeURL,t.AuthCredential=n.AuthCredential,t.AuthErrorCodes=n.AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY,t.EmailAuthCredential=n.EmailAuthCredential,t.EmailAuthProvider=n.EmailAuthProvider,t.FacebookAuthProvider=n.FacebookAuthProvider,t.FactorId=n.FactorId,t.GithubAuthProvider=n.GithubAuthProvider,t.GoogleAuthProvider=n.GoogleAuthProvider,t.OAuthCredential=n.OAuthCredential,t.OAuthProvider=n.OAuthProvider,t.OperationType=n.OperationType,t.PhoneAuthCredential=n.PhoneAuthCredential,t.PhoneAuthProvider=n.PhoneAuthProvider,t.PhoneMultiFactorGenerator=n.PhoneMultiFactorGenerator,t.ProviderId=n.ProviderId,t.RecaptchaVerifier=n.RecaptchaVerifier,t.SAMLAuthProvider=n.SAMLAuthProvider,t.SignInMethod=n.SignInMethod,t.TotpMultiFactorGenerator=n.TotpMultiFactorGenerator,t.TotpSecret=n.TotpSecret,t.TwitterAuthProvider=n.TwitterAuthProvider,t.applyActionCode=n.applyActionCode,t.beforeAuthStateChanged=n.beforeAuthStateChanged,t.browserCookiePersistence=n.browserCookiePersistence,t.browserLocalPersistence=n.browserLocalPersistence,t.browserPopupRedirectResolver=n.browserPopupRedirectResolver,t.browserSessionPersistence=n.browserSessionPersistence,t.checkActionCode=n.checkActionCode,t.confirmPasswordReset=n.confirmPasswordReset,t.connectAuthEmulator=n.connectAuthEmulator,t.createUserWithEmailAndPassword=n.createUserWithEmailAndPassword,t.debugErrorMap=n.debugErrorMap,t.deleteUser=n.deleteUser,t.fetchSignInMethodsForEmail=n.fetchSignInMethodsForEmail,t.getAdditionalUserInfo=n.getAdditionalUserInfo,t.getAuth=n.getAuth,t.getIdToken=n.getIdToken,t.getIdTokenResult=n.getIdTokenResult,t.getMultiFactorResolver=n.getMultiFactorResolver,t.getRedirectResult=n.getRedirectResult,t.inMemoryPersistence=n.inMemoryPersistence,t.indexedDBLocalPersistence=n.indexedDBLocalPersistence,t.initializeAuth=n.initializeAuth,t.initializeRecaptchaConfig=n.initializeRecaptchaConfig,t.isSignInWithEmailLink=n.isSignInWithEmailLink,t.linkWithCredential=n.linkWithCredential,t.linkWithPhoneNumber=n.linkWithPhoneNumber,t.linkWithPopup=n.linkWithPopup,t.linkWithRedirect=n.linkWithRedirect,t.multiFactor=n.multiFactor,t.onAuthStateChanged=n.onAuthStateChanged,t.onIdTokenChanged=n.onIdTokenChanged,t.parseActionCodeURL=n.parseActionCodeURL,t.prodErrorMap=n.prodErrorMap,t.reauthenticateWithCredential=n.reauthenticateWithCredential,t.reauthenticateWithPhoneNumber=n.reauthenticateWithPhoneNumber,t.reauthenticateWithPopup=n.reauthenticateWithPopup,t.reauthenticateWithRedirect=n.reauthenticateWithRedirect,t.reload=n.reload,t.revokeAccessToken=n.revokeAccessToken,t.sendEmailVerification=n.sendEmailVerification,t.sendPasswordResetEmail=n.sendPasswordResetEmail,t.sendSignInLinkToEmail=n.sendSignInLinkToEmail,t.setPersistence=n.setPersistence,t.signInAnonymously=n.signInAnonymously,t.signInWithCredential=n.signInWithCredential,t.signInWithCustomToken=n.signInWithCustomToken,t.signInWithEmailAndPassword=n.signInWithEmailAndPassword,t.signInWithEmailLink=n.signInWithEmailLink,t.signInWithPhoneNumber=n.signInWithPhoneNumber,t.signInWithPopup=n.signInWithPopup,t.signInWithRedirect=n.signInWithRedirect,t.signOut=n.signOut,t.unlink=n.unlink,t.updateCurrentUser=n.updateCurrentUser,t.updateEmail=n.updateEmail,t.updatePassword=n.updatePassword,t.updatePhoneNumber=n.updatePhoneNumber,t.updateProfile=n.updateProfile,t.useDeviceLanguage=n.useDeviceLanguage,t.validatePassword=n.validatePassword,t.verifyBeforeUpdateEmail=n.verifyBeforeUpdateEmail,t.verifyPasswordResetCode=n.verifyPasswordResetCode},56630:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(71470);class i{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 s="[DEFAULT]";class o{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 n.Deferred;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}else{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:s})}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=s){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=s){return this.instances.has(e)}getOptions(e=s){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 n=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[e,t]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(e)&&t.resolve(n);return n}onInit(e,t){let r=this.normalizeInstanceIdentifier(t),n=this.onInitCallbacks.get(r)??new Set;n.add(e),this.onInitCallbacks.set(r,n);let i=this.instances.get(r);return i&&e(i,r),()=>{n.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let n of r)try{n(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:e===s?void 0:e,options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=s){return this.component?this.component.multipleInstances?e:s:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class a{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 o(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}t.Component=i,t.ComponentContainer=a,t.Provider=o},92090:function(e,t,r){"use strict";var n,i,s,o,a=r(34406),l=r(48834).lW,u=r(99413),c=r(71470),h=r(18779),d=r(4015),f=r(43462);class p{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}}p.UNAUTHENTICATED=new p(null),p.GOOGLE_CREDENTIALS=new p("google-credentials-uid"),p.FIRST_PARTY=new p("first-party-uid"),p.MOCK_USER=new p("mock-user");let m="12.13.0",g=new d.Logger("@firebase/firestore");function y(){return g.logLevel}function v(e,...t){if(g.logLevel<=d.LogLevel.DEBUG){let r=t.map(_);g.debug(`Firestore (${m}): ${e}`,...r)}}function w(e,...t){if(g.logLevel<=d.LogLevel.ERROR){let r=t.map(_);g.error(`Firestore (${m}): ${e}`,...r)}}function b(e,...t){if(g.logLevel<=d.LogLevel.WARN){let r=t.map(_);g.warn(`Firestore (${m}): ${e}`,...r)}}function _(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}function E(e,t,r){let n="Unexpected state";"string"==typeof t?n=t:r=t,I(e,n,r)}function I(e,t,r){let n=`FIRESTORE (${m}) INTERNAL ASSERTION FAILED: ${t} (ID: ${e.toString(16)})`;if(void 0!==r)try{n+=" CONTEXT: "+JSON.stringify(r)}catch(e){n+=" CONTEXT: "+r}throw w(n),Error(n)}function T(e,t,r,n){let i="Unexpected state";"string"==typeof r?i=r:n=r,e||I(t,i,n)}let S={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
1ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class A extends c.FirebaseError{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class C{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class P{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class R{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(p.UNAUTHENTICATED))}shutdown(){}}class k{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 x{constructor(e){this.t=e,this.currentUser=p.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){T(void 0===this.o,42304);let r=this.i,n=e=>this.i!==r?(r=this.i,t(e)):Promise.resolve(),i=new C;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new C,e.enqueueRetryable(()=>n(this.currentUser))};let s=()=>{let t=i;e.enqueueRetryable(async()=>{await t.promise,await n(this.currentUser)})},o=e=>{v("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(e=>o(e)),setTimeout(()=>{if(!this.auth){let e=this.t.getImmediate({optional:!0});e?o(e):(v("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new C)}},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?(v("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(T("string"==typeof t.accessToken,31837,{l:t}),new P(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 T(null===e||"string"==typeof e,2055,{h:e}),new p(e)}}class D{constructor(e,t,r){this.P=e,this.T=t,this.I=r,this.type="FirstParty",this.user=p.FIRST_PARTY,this.R=new Map}A(){return this.I?this.I():null}get headers(){this.R.set("X-Goog-AuthUser",this.P);let e=this.A();return e&&this.R.set("Authorization",e),this.T&&this.R.set("X-Goog-Iam-Authorization-Token",this.T),this.R}}class N{constructor(e,t,r){this.P=e,this.T=t,this.I=r}getToken(){return Promise.resolve(new D(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(p.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class O{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 M{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,u._isFirebaseServerApp(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){T(void 0===this.o,3512);let r=e=>{null!=e.error&&v("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,v("FirebaseAppCheckTokenProvider",`Received ${r?"new":"existing"} token.`),r?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>r(t))};let n=e=>{v("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(e=>n(e)),setTimeout(()=>{if(!this.appCheck){let e=this.V.getImmediate({optional:!0});e?n(e):v("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new O(this.p));let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(T("string"==typeof e.token,44558,{tokenResult:e}),this.m=e.token,new O(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 L{getToken(){return Promise.resolve(new O(""))}invalidateToken(){}start(e,t){}shutdown(){}}class F{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 
1Uint8Array(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 n=0;n<r.length;++n)t.length<20&&r[n]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(r[n]%62))}return t}}function V(e,t){return e<t?-1:e>t?1:0}function U(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){let r=e.charAt(n),i=t.charAt(n);if(r!==i)return B(r)===B(i)?V(r,i):B(r)?1:-1}return V(e.length,t.length)}function B(e){let t=e.charCodeAt(0);return t>=55296&&t<=57343}function j(e,t,r){return e.length===t.length&&e.every((e,n)=>r(e,t[n]))}let H="__name__";class z{constructor(e,t,r){void 0===t?t=0:t>e.length&&E(637,{offset:t,range:e.length}),void 0===r?r=e.length-t:r>e.length-t&&E(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===z.comparator(this,e)}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof z?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 n=0;n<r;n++){let r=z.compareSegments(e.get(n),t.get(n));if(0!==r)return r}return V(e.length,t.length)}static compareSegments(e,t){let r=z.isNumericId(e),n=z.isNumericId(t);return r&&!n?-1:!r&&n?1:r&&n?z.extractNumericId(e).compare(z.extractNumericId(t)):U(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return h.Integer.fromString(e.substring(4,e.length-2))}}class q extends z{construct(e,t,r){return new q(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 A(S.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(e=>e.length>0))}return new q(t)}static emptyPath(){return new q([])}}let G=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class W extends z{construct(e,t,r){return new W(e,t,r)}static isValidIdentifier(e){return G.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),W.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===H}static keyField(){return new W([H])}static fromServerFormat(e){let t=[],r="",n=0,i=()=>{if(0===r.length)throw new A(S.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""},s=!1;for(;n<e.length;){let t=e[n];if("\\"===t){if(n+1===e.length)throw new A(S.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let t=e[n+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new A(S.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=t,n+=2}else"`"===t?s=!s:"."!==t||s?r+=t:i(),n++}if(i(),s)throw new A(S.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new W(t)}static emptyPath(){return new W([])}}class ${constructor(e){this.path=e}static fromPath(e){return new $(q.fromString(e))}static fromName(e){return new $(q.fromString(e).popFirst(5))}static empty(){return new $(q.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===q.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return q.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new $(new q(e.slice()))}}function K(e,t,r){if(!r)throw new A(S.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function Q(e,t,r,n){if(!0===t&&!0===n)throw new A(S.INVALID_ARGUMENT,`${e} and ${r} cannot be used together.`)}function Y(e){if(!$.isDocumentKey(e))throw new A(S.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function J(e){if($.isDocumentKey(e))throw new A(S.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function X(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function Z(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":E(12329,{type:typeof e})}function ee(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new A(S.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let r=Z(e);throw new A(S.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${r}`)}}return e}function et(e,t){let r={typeString:e};return t&&(r.value=t),r}function er(e,t){let r;if(!X(e))throw new A(S.INVALID_ARGUMENT,"JSON must be an object");for(let n in t)if(t[n]){let i=t[n].typeString,s="value"in t[n]?{value:t[n].value}:void 0;if(!(n in e)){r=`JSON missing required field: '${n}'`;break}let o=e[n];if(i&&typeof o!==i){r=`JSON field '${n}' must be a ${i}.`;break}if(void 0!==s&&o!==s.value){r=`Expected '${n}' field to equal '${s.value}'`;break}}if(r)throw new A(S.INVALID_ARGUMENT,r);return!0}class en{static now(){return en.fromMillis(Date.now())}static fromDate(e){return en.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3);return new en(t,Math.floor((e-1e3*t)*1e6))}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0||t>=1e9)throw new A(S.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800||e>=253402300800)throw new A(S.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?V(this.nanoseconds,e.nanoseconds):V(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:en._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(er(e,en._jsonSchema))return new en(e.seconds,e.nanoseconds)}valueOf(){return String(this.seconds- -62135596800).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
1}en._jsonSchemaVersion="firestore/timestamp/1.0",en._jsonSchema={type:et("string",en._jsonSchemaVersion),seconds:et("number"),nanoseconds:et("number")};class ei{static fromTimestamp(e){return new ei(e)}static min(){return new ei(new en(0,0))}static max(){return new ei(new en(253402300799,999999999))}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 es{constructor(e,t,r,n){this.indexId=e,this.collectionGroup=t,this.fields=r,this.indexState=n}}function eo(e){return e.fields.find(e=>2===e.kind)}function ea(e){return e.fields.filter(e=>2!==e.kind)}function el(e,t){let r=V(e.collectionGroup,t.collectionGroup);if(0!==r)return r;for(let n=0;n<Math.min(e.fields.length,t.fields.length);++n)if(0!==(r=function(e,t){let r=W.comparator(e.fieldPath,t.fieldPath);return 0!==r?r:V(e.kind,t.kind)}(e.fields[n],t.fields[n])))return r;return V(e.fields.length,t.fields.length)}es.UNKNOWN_ID=-1;class eu{constructor(e,t){this.fieldPath=e,this.kind=t}}class ec{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new ec(0,ef.min())}}function eh(e,t){let r=e.toTimestamp().seconds,n=e.toTimestamp().nanoseconds+1;return new ef(ei.fromTimestamp(1e9===n?new en(r+1,0):new en(r,n)),$.empty(),t)}function ed(e){return new ef(e.readTime,e.key,-1)}class ef{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new ef(ei.min(),$.empty(),-1)}static max(){return new ef(ei.max(),$.empty(),-1)}}function ep(e,t){let r=e.readTime.compareTo(t.readTime);return 0!==r?r:0!==(r=$.comparator(e.documentKey,t.documentKey))?r:V(e.largestBatchId,t.largestBatchId)}let em="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class eg{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function ey(e){if(e.code!==S.FAILED_PRECONDITION||e.message!==em)throw e;v("LocalStore","Unexpectedly lost primary lease")}class ev{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&&E(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new ev((r,n)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(r,n)},this.catchCallback=e=>{this.wrapFailure(t,e).next(r,n)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof ev?t:ev.resolve(t)}catch(e){return ev.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):ev.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):ev.reject(t)}static resolve(e){return new ev((t,r)=>{t(e)})}static reject(e){return new ev((t,r)=>{r(e)})}static waitFor(e){return new ev((t,r)=>{let n=0,i=0,s=!1;e.forEach(e=>{++n,e.next(()=>{++i,s&&i===n&&t()},e=>r(e))}),s=!0,i===n&&t()})}static or(e){let t=ev.resolve(!1);for(let r of e)t=t.next(e=>e?ev.resolve(e):r());return t}static forEach(e,t){let r=[];return e.forEach((e,n)=>{r.push(t.call(this,e,n))}),this.waitFor(r)}static mapArray(e,t){return new ev((r,n)=>{let i=e.length,s=Array(i),o=0;for(let a=0;a<i;a++){let l=a;t(e[l]).next(e=>{s[l]=e,++o===i&&r(s)},e=>n(e))}})}static doWhile(e,t){return new ev((r,n)=>{let i=()=>{!0===e()?t().next(()=>{i()},n):r()};i()})}}let ew="SimpleDb";class eb{static open(e,t,r,n){try{return new eb(t,e.transaction(n,r))}catch(e){throw new eT(t,e)}}constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.S=new C,this.transaction.oncomplete=()=>{this.S.resolve()},this.transaction.onabort=()=>{t.error?this.S.reject(new eT(e,t.error)):this.S.resolve()},this.transaction.onerror=t=>{let r=eR(t.target.error);this.S.reject(new eT(e,r))}}get D(){return this.S.promise}abort(e){e&&this.S.reject(e),this.aborted||(v(ew,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}C(){let e=this.transaction;this.aborted||"function"!=typeof e.commit||e.commit()}store(e){return new eA(this.transaction.objectStore(e))}}class e_{static delete(e){return v(ew,"Removing database:",e),eC(c.getGlobal().indexedDB.deleteDatabase(e)).toPromise()}static v(){if(!c.isIndexedDBAvailable())return!1;if(e_.F())return!0;let e=c.getUA(),t=e_.M(e),r=eE(e);return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||0<t&&t<10||0<r&&r<4.5)}static F(){return void 0!==a&&"YES"===a.__PRIVATE_env?.__PRIVATE_USE_MOCK_PERSISTENCE}static O(e,t){return e.store(t)}static M(e){let t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i);return Number(t?t[1].split("_").slice(0,2).join("."):"-1")}constructor(e,t,r){this.name=e,this.version=t,this.N=r,this.B=null,12.2===e_.M(c.getUA())&&w("Firestore persistence suffers from a bug in 
1iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}async L(e){return this.db||(v(ew,"Opening database:",this.name),this.db=await new Promise((t,r)=>{let n=indexedDB.open(this.name,this.version);n.onsuccess=e=>{t(e.target.result)},n.onblocked=()=>{r(new eT(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},n.onerror=t=>{let n=t.target.error;"VersionError"===n.name?r(new A(S.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):"InvalidStateError"===n.name?r(new A(S.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+n)):r(new eT(e,n))},n.onupgradeneeded=e=>{v(ew,'Database "'+this.name+'" requires upgrade from version:',e.oldVersion);let t=e.target.result;this.N.k(t,n.transaction,e.oldVersion,this.version).next(()=>{v(ew,"Database upgrade to version "+this.version+" complete")})}})),this.K&&(this.db.onversionchange=e=>this.K(e)),this.db}q(e){this.K=e,this.db&&(this.db.onversionchange=t=>e(t))}async runTransaction(e,t,r,n){let i="readonly"===t,s=0;for(;;){++s;try{this.db=await this.L(e);let t=eb.open(this.db,e,i?"readonly":"readwrite",r),s=n(t).next(e=>(t.C(),e)).catch(e=>(t.abort(e),ev.reject(e))).toPromise();return s.catch(()=>{}),await t.D,s}catch(t){let e="FirebaseError"!==t.name&&s<3;if(v(ew,"Transaction failed with error:",t.message,"Retrying:",e),this.close(),!e)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}function eE(e){let t=e.match(/Android ([\d.]+)/i);return Number(t?t[1].split(".").slice(0,2).join("."):"-1")}class eI{constructor(e){this.U=e,this.$=!1,this.W=null}get isDone(){return this.$}get G(){return this.W}set cursor(e){this.U=e}done(){this.$=!0}j(e){this.W=e}delete(){return eC(this.U.delete())}}class eT extends A{constructor(e,t){super(S.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function eS(e){return"IndexedDbTransactionError"===e.name}class eA{constructor(e){this.store=e}put(e,t){let r;return void 0!==t?(v(ew,"PUT",this.store.name,e,t),r=this.store.put(t,e)):(v(ew,"PUT",this.store.name,"<auto-key>",e),r=this.store.put(e)),eC(r)}add(e){return v(ew,"ADD",this.store.name,e,e),eC(this.store.add(e))}get(e){return eC(this.store.get(e)).next(t=>(void 0===t&&(t=null),v(ew,"GET",this.store.name,e,t),t))}
1delete(e){return v(ew,"DELETE",this.store.name,e),eC(this.store.delete(e))}count(){return v(ew,"COUNT",this.store.name),eC(this.store.count())}J(e,t){let r=this.options(e,t),n=r.index?this.store.index(r.index):this.store;if("function"==typeof n.getAll){let e=n.getAll(r.range);return new ev((t,r)=>{e.onerror=e=>{r(e.target.error)},e.onsuccess=e=>{t(e.target.result)}})}{let e=this.cursor(r),t=[];return this.H(e,(e,r)=>{t.push(r)}).next(()=>t)}}Z(e,t){let r=this.store.getAll(e,null===t?void 0:t);return new ev((e,t)=>{r.onerror=e=>{t(e.target.error)},r.onsuccess=t=>{e(t.target.result)}})}X(e,t){v(ew,"DELETE ALL",this.store.name);let r=this.options(e,t);r.Y=!1;let n=this.cursor(r);return this.H(n,(e,t,r)=>r.delete())}ee(e,t){let r;t?r=e:(r={},t=e);let n=this.cursor(r);return this.H(n,t)}te(e){let t=this.cursor({});return new ev((r,n)=>{t.onerror=e=>{n(eR(e.target.error))},t.onsuccess=t=>{let n=t.target.result;n?e(n.primaryKey,n.value).next(e=>{e?n.continue():r()}):r()}})}H(e,t){let r=[];return new ev((n,i)=>{e.onerror=e=>{i(e.target.error)},e.onsuccess=e=>{let i=e.target.result;if(!i)return void n();let s=new eI(i),o=t(i.primaryKey,i.value,s);if(o instanceof ev){let e=o.catch(e=>(s.done(),ev.reject(e)));r.push(e)}s.isDone?n():null===s.G?i.continue():i.continue(s.G)}}).next(()=>ev.waitFor(r))}options(e,t){let r;return void 0!==e&&("string"==typeof e?r=e:t=e),{index:r,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){let r=this.store.index(e.index);return e.Y?r.openKeyCursor(e.range,t):r.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function eC(e){return new ev((t,r)=>{e.onsuccess=e=>{t(e.target.result)},e.onerror=e=>{r(eR(e.target.error))}})}let eP=!1;function eR(e){let t=e_.M(c.getUA());if(t>=12.2&&t<13){let t="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(t)>=0){let e=new A("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return eP||(eP=!0,setTimeout(()=>{throw e},0)),e}}return e}let ek="IndexBackfiller";class ex{constructor(e,t){this.asyncQueue=e,this.ne=t,this.task=null}start(){this.re(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return null!==this.task}re(e){v(ek,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,async()=>{this.task=null;try{let e=await this.ne.ie();v(ek,`Documents written: ${e}`)}catch(e){eS(e)?v(ek,"Ignoring IndexedDB error during index backfill: ",e):await ey(e)}await this.re(6e4)})}}class eD{constructor(e,t){this.localStore=e,this.persistence=t}async ie(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",t=>this.se(t,e))}se(e,t){let r=new Set,n=t,i=!0;return ev.doWhile(()=>!0===i&&n>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(t=>{if(null!==t&&!r.has(t))return v(ek,`Processing collection: ${t}`),this.oe(e,t,n).next(e=>{n-=e,r.add(t)});i=!1})).next(()=>t-n)}oe(e,t,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next(n=>this.localStore.localDocuments.getNextDocuments(e,t,n,r).next(r=>{let i=r.changes;return this.localStore.indexManager.updateIndexEntries(e,i).next(()=>this._e(n,r)).next(r=>(v(ek,`Updating offset: ${r}`),this.localStore.indexManager.updateCollectionGroup(e,t,r))).next(()=>i.size)}))}_e(e,t){let r=e;
1return t.changes.forEach((e,t)=>{let n=ed(t);ep(n,r)>0&&(r=n)}),new ef(r.readTime,r.documentKey,Math.max(t.batchId,e.largestBatchId))}}class eN{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}}function eO(e){return null==e}function eM(e){return 0===e&&1/e==-1/0}function eL(e){return"number"==typeof e&&Number.isInteger(e)&&!eM(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}function eF(e){let t="";for(let r=0;r<e.length;r++)t.length>0&&(t+="\x01\x01"),t=function(e,t){let r=t,n=e.length;for(let t=0;t<n;t++){let n=e.charAt(t);switch(n){case"\0":r+="\x01\x10";break;case"\x01":r+="\x01\x11";break;default:r+=n}}return r}(e.get(r),t);return t+"\x01\x01"}function eV(e){let t=e.length;if(T(t>=2,64408,{path:e}),2===t)return T("\x01"===e.charAt(0)&&"\x01"===e.charAt(1),56145,{path:e}),q.emptyPath();let r=t-2,n=[],i="";for(let s=0;s<t;){let t=e.indexOf("\x01",s);switch((t<0||t>r)&&E(50515,{path:e}),e.charAt(t+1)){case"\x01":let o;let a=e.substring(s,t);0===i.length?o=a:(i+=a,o=i,i=""),n.push(o);break;case"\x10":i+=e.substring(s,t)+"\0";break;case"\x11":i+=e.substring(s,t+1);break;default:E(61167,{path:e})}s=t+2}return new q(n)}eN.ce=-1;let eU="remoteDocuments",eB="owner",ej="owner",eH="mutationQueues",ez="mutations",eq="batchId",eG="userMutationsIndex",eW=["userId","batchId"],e$={},eK="documentMutations",eQ="remoteDocumentsV14",eY=["prefixPath","collectionGroup","readTime","documentId"],eJ="documentKeyIndex",eX=["prefixPath","collectionGroup","documentId"],eZ="collectionGroupIndex",e0=["collectionGroup","readTime","prefixPath","documentId"],e1="remoteDocumentGlobal",e2="remoteDocumentGlobalKey",e4="targets",e6="queryTargetsIndex",e8=["canonicalId","targetId"],e3="targetDocuments",e5=["targetId","path"],e9="documentTargetsIndex",e7=["path","targetId"],te="targetGlobalKey",tt="targetGlobal",tr="collectionParents",tn=["collectionId","parent"],ti="clientMetadata",ts="bundles",to="namedQueries",ta="indexConfiguration",tl="collectionGroupIndex",tu="indexState",tc=["indexId","uid"],th="sequenceNumberIndex",td=["uid","sequenceNumber"],tf="indexEntries",tp=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],tm="documentKeyIndex",tg=["indexId","uid","orderedDocumentKey"],ty="documentOverlays",tv=["userId","collectionPath","documentId"],tw="collectionPathOverlayIndex",tb=["userId","collectionPath","largestBatchId"],t_="collectionGroupOverlayIndex",tE=["userId","collectionGroup","largestBatchId"],tI="globals",tT=[eH,ez,eK,eU,e4,eB,tt,e3,ti,e1,tr,ts,to],tS=[...tT,ty],tA=[eH,ez,eK,eQ,e4,eB,tt,e3,ti,e1,tr,ts,to,ty],tC=[...tA,ta,tu,tf],tP=[...tC,tI];class tR extends eg{constructor(e,t){super(),this.le=e,this.currentSequenceNumber=t}}function tk(e,t){return e_.O(e.le,t)}function tx(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function tD(e,t){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])}function tN(e,t){let r=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.push(t(e[n],n,e));return r}function tO(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class tM{constructor(e,t){this.comparator=e,this.root=t||tF.EMPTY}insert(e,t){return new tM(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,tF.BLACK,null,null))}remove(e){return new tM(this.comparator,this.root.remove(e,this.comparator).copy(null,null,tF.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 n=this.comparator(e,r.key);if(0===n)return t+r.left.size;n<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 tL(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new tL(this.root,e,this.comparator,!1)}getReverseIterator(){return new tL(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new tL(this.root,e,this.comparator,!0)}}class tL{constructor(e,t,r,n){this.isReverse=n,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?r(e.key,t):1,t&&n&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){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 tF{constructor(e,t,r,n,i){this.key=e,this.value=t,this.color=null!=r?r:tF.RED,this.left=null!=n?n:tF.EMPTY,this.right=null!=i?i:tF.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,n,i){return new tF(null!=e?e:this.key,null!=t?t:this.value,
1null!=r?r:this.color,null!=n?n:this.left,null!=i?i: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 n=this,i=r(e,n.key);return(n=i<0?n.copy(null,null,null,n.left.insert(e,t,r),null):0===i?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(e,t,r))).fixUp()}removeMin(){if(this.left.isEmpty())return tF.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,n=this;if(0>t(e,n.key))n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),0===t(e,n.key)){if(n.right.isEmpty())return tF.EMPTY;r=n.right.min(),n=n.copy(r.key,r.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.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,tF.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,tF.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 E(43730,{key:this.key,value:this.value});if(this.right.isRed())throw E(14113,{key:this.key,value:this.value});let e=this.left.check();if(e!==this.right.check())throw E(27949);return e+(this.isRed()?0:1)}}tF.EMPTY=null,tF.RED=!0,tF.BLACK=!1,tF.EMPTY=new class{constructor(){this.size=0}get key(){throw E(57766)}get value(){throw E(16141)}get color(){throw E(16727)}get left(){throw E(29726)}get right(){throw E(36894)}copy(e,t,r,n,i){return this}insert(e,t,r){return new tF(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 tV{constructor(e){this.comparator=e,this.data=new tM(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 n=r.getNext();if(this.comparator(n.key,e[1])>=0)return;t(n.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 tU(this.data.getIterator())}getIteratorFrom(e){return new tU(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;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof tV)||this.size!==e.size)return!1;let t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){let e=t.getNext().key,n=r.getNext().key;if(0!==this.comparator(e,n))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 tV(this.comparator);return t.data=e,t}}
1class tU{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function tB(e){return e.hasNext()?e.getNext():void 0}class tj{constructor(e){this.fields=e,e.sort(W.comparator)}static empty(){return new tj([])}unionWith(e){let t=new tV(W.comparator);for(let e of this.fields)t=t.add(e);for(let r of e)t=t.add(r);return new tj(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return j(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class tH extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class tz{constructor(e){this.binaryString=e}static fromBase64String(e){return new tz(function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new tH("Invalid base64 string: "+e):e}}(e))}static fromUint8Array(e){return new tz(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(){return function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return V(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}tz.EMPTY_BYTE_STRING=new tz("");let tq=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function tG(e){if(T(!!e,39018),"string"==typeof e){let t=0,r=tq.exec(e);if(T(!!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:tW(e.seconds),nanos:tW(e.nanos)}}function tW(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function t$(e){return"string"==typeof e?tz.fromBase64String(e):tz.fromUint8Array(e)}let tK="server_timestamp",tQ="__type__",tY="__previous_value__",tJ="__local_write_time__";function tX(e){return(e?.mapValue?.fields||{})[tQ]?.stringValue===tK}function tZ(e){let t=e.mapValue.fields[tY];return tX(t)?tZ(t):t}function t0(e){let t=tG(e.mapValue.fields[tJ].timestampValue);return new en(t.seconds,t.nanos)}class t1{constructor(e,t,r,n,i,s,o,a,l,u,c){this.databaseId=e,this.appId=t,this.persistenceKey=r,this.host=n,this.ssl=i,this.forceLongPolling=s,this.autoDetectLongPolling=o,this.longPollingOptions=a,this.useFetchStreams=l,this.isUsingEmulator=u,this.apiKey=c}}let t2="(default)";class t4{constructor(e,t){this.projectId=e,this.database=t||t2}static empty(){return new t4("","")}get isDefaultDatabase(){return this.database===t2}isEqual(e){return e instanceof t4&&e.projectId===this.projectId&&e.database===this.database}}let t6="__type__",t8="__max__",t3={mapValue:{fields:{__type__:{stringValue:t8}}}},t5="__vector__",t9="value",t7={nullValue:"NULL_VALUE"};function re(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?tX(e)?4:rm(e)?9007199254740991:rf(e)?10:11:E(28295,{value:e})}function rt(e,t){if(e===t)return!0;let r=re(e);if(r!==re(t))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return t0(e).isEqual(t0(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;let r=tG(e.timestampValue),n=tG(t.timestampValue);return r.seconds===n.seconds&&r.nanos===n.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return t$(e.bytesValue).isEqual(t$(t.bytesValue));case 7:return e.referenceValue===t.referenceValue;case 8:return tW(e.geoPointValue.latitude)===tW(t.geoPointValue.latitude)&&tW(e.geoPointValue.longitude)===tW(t.geoPointValue.longitude);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return tW(e.integerValue)===tW(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){let r=tW(e.doubleValue),n=tW(t.doubleValue);return r===n?eM(r)===eM(n):isNaN(r)&&isNaN(n)}return!1}(e,t);case 9:return j(e.arrayValue.values||[],t.arrayValue.values||[],rt);case 10:case 11:return function(e,t){let r=e.mapValue.fields||{},n=t.mapValue.fields||{};if(tx(r)!==tx(n))return!1;for(let e in r)if(r.hasOwnProperty(e)&&(void 0===n[e]||!rt(r[e],n[e])))return!1;return!0}(e,t);default:return E(52216,{left:e})}}function rr(e,t){return void 0!==(e.values||[]).find(e=>rt(e,t))}function rn(e,t){if(e===t)return 0;let r=re(e),n=re(t);if(r!==n)return V(r,n);switch(r){case 0:case 9007199254740991:return 0;case 1:return V(e.booleanValue,t.booleanValue);case 2:return function(e,t){let r=tW(e.integerValue||e.doubleValue),n=tW(t.integerValue||t.doubleValue);return r<n?-1:r>n?1:r===n?0:isNaN(r)?isNaN(n)?0:-1:1}(e,t);case 3:return ri(e.timestampValue,t.timestampValue);case 4:return ri(t0(e),t0(t));case 5:return U(e.stringValue,t.stringValue);case 6:return function(e,t){let r=t$(e),n=t$(t);return r.compareTo(n)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){let r=e.split("/"),n=t.split("/");for(let e=0;e<r.length&&e<n.length;e++){let t=V(r[e],n[e]);if(0!==t)return t}return V(r.length,n.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){let r=V(tW(e.latitude),tW(t.latitude));return 0!==r?r:V(tW(e.longitude),tW(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return rs(e.arrayValue,t.arrayValue);case 10:return function(e,t){let r=e.fields||{},n=t.fields||{},i=r[t9]?.arrayValue,s=n[t9]?.arrayValue,o=V(i?.values?.length||0,s?.values?.length||0);return 0!==o?o:rs(i,s)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===t3.mapValue&&t===t3.mapValue)return 0;if(e===t3.mapValue)return 1;if(t===t3.mapValue)return -1;let r=e.fields||{},n=Object.keys(r),i=t.fields||{},s=Object.keys(i);n.sort(),s.sort();for(let e=0;e<n.length&&e<s.length;++e){let t=U(n[e],s[e]);if(0!==t)return t;let o=rn(r[n[e]],i[s[e]]);if(0!==o)return o}return V(n.length,s.length)}(e.mapValue,t.mapValue);default:throw E(23264,{he:r})}}function ri(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return V(e,t);let r=tG(e),n=tG(t),i=V(r.seconds,n.seconds);return 0!==i?i:V(r.nanos,n.nanos)}function rs(e,t){let r=e.values||[],n=t.values||[];for(let e=0;e<r.length&&e<n.length;++e){let t=rn(r[e],n[e]);if(t)return t}return V(r.length,n.length)}function ro(e){var t,r;return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){let t=tG(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?t$(e.bytesValue).toBase64():"referenceValue"in e?(t=e.referenceValue,$.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 n of e.values||[])r?r=!1:t+=",",t+=ro(n);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){let t=Object.keys(e.fields||{}).sort(),r="{",n=!0;for(let i of t)n?n=!1:r+=",",r+=`${i}:${ro(e.fields[i])}`;return r+"}"}(e.mapValue):E(61005,{value:e})}function ra(e,t){return{referenceValue:`projects/${e.projectId}/databases/${e.database}/documents/${t.path.canonicalString()}`}}function rl(e){return!!e&&"integerValue"in e}function ru(e){return!!e&&"arrayValue"in e}function rc(e){return!!e&&"nullValue"in e}function rh(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function rd(e){return!!e&&"mapValue"in e}function rf(e){return(e?.mapValue?.fields||{})[t6]?.stringValue===t5}function rp(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 tD(e.mapValue.fields,(e,r)=>t.mapValue.fields[e]=rp(r)),t}if(e.arrayValue){let t={arrayValue:{values:[]}};for(let r=0;r<(e.arrayValue.values||[]).length;++r)t.arrayValue.values[r]=rp(e.arrayValue.values[r]);return t}return{...e}}function rm(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===t8}let rg={mapValue:{fields:{[t6]:{stringValue:t5},[t9]:{arrayValue:{}}}}};function ry(e,t){let r=rn(e.value,t.value);return 0!==r?r:e.inclusive&&!t.inclusive?-1:!e.inclusive&&t.inclusive?1:0}function rv(e,t){let r=rn(e.value,t.value);return 0!==r?r:e.inclusive&&!t.inclusive?1:!e.inclusive&&t.inclusive?-1:0}class rw{constructor(e){this.value=e}static empty(){return new rw({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(!rd(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()]=rp(t)}setAll(e){let t=W.emptyPath(),r={},n=[];e.forEach((e,i)=>{if(!t.isImmediateParentOf(i)){let e=this.getFieldsMap(t);this.applyChanges(e,r,n),r={},n=[],t=i.popLast()}e?r[i.lastSegment()]=rp(e):n.push(i.lastSegment())});let i=this.getFieldsMap(t);this.applyChanges(i,r,n)}delete(e){let t=this.field(e.popLast());rd(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return rt(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 n=t.mapValue.fields[e.get(r)];rd(n)&&n.mapValue.fields||(n={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=n),t=n}return t.mapValue.fields}
1applyChanges(e,t,r){for(let n of(tD(t,(t,r)=>e[t]=r),r))delete e[n]}clone(){return new rw(rp(this.value))}}class rb{constructor(e,t,r,n,i,s,o){this.key=e,this.documentType=t,this.version=r,this.readTime=n,this.createTime=i,this.data=s,this.documentState=o}static newInvalidDocument(e){return new rb(e,0,ei.min(),ei.min(),ei.min(),rw.empty(),0)}static newFoundDocument(e,t,r,n){return new rb(e,1,t,ei.min(),r,n,0)}static newNoDocument(e,t){return new rb(e,2,t,ei.min(),ei.min(),rw.empty(),0)}static newUnknownDocument(e,t){return new rb(e,3,t,ei.min(),ei.min(),rw.empty(),2)}convertToFoundDocument(e,t){return this.createTime.isEqual(ei.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=rw.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=rw.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ei.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 rb&&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 rb(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}})`}}class r_{constructor(e,t){this.position=e,this.inclusive=t}}function rE(e,t,r){let n=0;for(let i=0;i<e.position.length;i++){let s=t[i],o=e.position[i];if(n=s.field.isKeyField()?$.comparator($.fromName(o.referenceValue),r.key):rn(o,r.data.field(s.field)),"desc"===s.dir&&(n*=-1),0!==n)break}return n}function rI(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(!rt(e.position[r],t.position[r]))return!1;return!0}class rT{constructor(e,t="asc"){this.field=e,this.dir=t}}class rS{}class rA extends rS{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 rN(e,t,r):"array-contains"===t?new rF(e,r):"in"===t?new rV(e,r):"not-in"===t?new rU(e,r):"array-contains-any"===t?new rB(e,r):new rA(e,t,r)}static createKeyFieldInFilter(e,t,r){return"in"===t?new rO(e,r):new rM(e,r)}matches(e){let t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(rn(t,this.value)):null!==t&&re(this.value)===re(t)&&this.matchesComparison(rn(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 E(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class rC extends rS{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new rC(e,t)}matches(e){return rP(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 rP(e){return"and"===e.op}function rR(e){return"or"===e.op}function rk(e){return rx(e)&&rP(e)}function rx(e){for(let t of e.filters)if(t instanceof rC)return!1;return!0}function rD(e,t){let r=e.filters.concat(t);return rC.create(r,e.op)}class rN extends rA{constructor(e,t,r){super(e,t,r),this.key=$.fromName(r.referenceValue)}matches(e){let t=$.comparator(e.key,this.key);return this.matchesComparison(t)}}class rO extends rA{constructor(e,t){super(e,"in",t),this.keys=rL("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class rM extends rA{constructor(e,t){super(e,"not-in",t),this.keys=rL("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function rL(e,t){return(t.arrayValue?.values||[]).map(e=>$.fromName(e.referenceValue))}class rF extends rA{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return ru(t)&&rr(t.arrayValue,this.value)}}class rV extends rA{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return null!==t&&rr(this.value.arrayValue,t)}}class rU extends rA{constructor(e,t){super(e,"not-in",t)}matches(e){if(rr(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!rr(this.value.arrayValue,t)}}class rB extends rA{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!ru(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>rr(this.value.arrayValue,e))}}class rj{constructor(e,t=null,r=[],n=[],i=null,s=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=n,this.limit=i,this.startAt=s,this.endAt=o,this.Te=null}}function rH(e,t=null,r=[],n=[],i=null,s=null,o=null){return new rj(e,t,r,n,i,s,o)}function rz(e){if(null===e.Te){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:"+e.filters.map(e=>(function e(t){if(t instanceof rA)return t.field.canonicalString()+t.op.toString()+ro(t.value);if(rk(t))return t.filters.map(t=>e(t)).join(",");{let r=t.filters.map(t=>e(t)).join(",");return`${t.op}(${r})`}})(e)).join(",")+"|ob:"+e.orderBy.map(e=>e.field.canonicalString()+e.dir).join(","),eO(e.limit)||(t+="|l:"+e.limit),e.startAt&&(t+="|lb:"+(e.startAt.inclusive?"b:":"a:")+e.startAt.position.map(e=>ro(e)).join(",")),e.endAt&&(t+="|ub:"+(e.endAt.inclusive?"a:":"b:")+e.endAt.position.map(e=>ro(e)).join(",")),e.Te=t}return e.Te}function rq(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let i=0;i<e.orderBy.length;i++){var r,n;if(r=e.orderBy[i],n=t.orderBy[i],!(r.dir===n.dir&&r.field.isEqual(n.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 rA?r instanceof rA&&t.op===r.op&&t.field.isEqual(r.field)&&rt(t.value,r.value):t instanceof rC?r instanceof rC&&t.op===r.op&&t.filters.length===r.filters.length&&t.filters.reduce((t,n,i)=>t&&e(n,r.filters[i]),!0):void E(19439)}(e.filters[r],t.filters[r]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!rI(e.startAt,t.startAt)&&rI(e.endAt,t.endAt)}function rG(e){return $.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}function rW(e,t){return e.filters.filter(e=>e instanceof rA&&e.field.isEqual(t))}function r$(e,t,r){let n=t7,i=!0;for(let r of rW(e,t)){let e=t7,t=!0;switch(r.op){case"<":case"<=":var s;
1e="nullValue"in(s=r.value)?t7:"booleanValue"in s?{booleanValue:!1}:"integerValue"in s||"doubleValue"in s?{doubleValue:NaN}:"timestampValue"in s?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in s?{stringValue:""}:"bytesValue"in s?{bytesValue:""}:"referenceValue"in s?ra(t4.empty(),$.empty()):"geoPointValue"in s?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in s?{arrayValue:{}}:"mapValue"in s?rf(s)?rg:{mapValue:{}}:E(35942,{value:s});break;case"==":case"in":case">=":e=r.value;break;case">":e=r.value,t=!1;break;case"!=":case"not-in":e=t7}0>ry({value:n,inclusive:i},{value:e,inclusive:t})&&(n=e,i=t)}if(null!==r){for(let s=0;s<e.orderBy.length;++s)if(e.orderBy[s].field.isEqual(t)){let e=r.position[s];0>ry({value:n,inclusive:i},{value:e,inclusive:r.inclusive})&&(n=e,i=r.inclusive);break}}return{value:n,inclusive:i}}function rK(e,t,r){let n=t3,i=!0;for(let r of rW(e,t)){let e=t3,t=!0;switch(r.op){case">=":case">":var s;e="nullValue"in(s=r.value)?{booleanValue:!1}:"booleanValue"in s?{doubleValue:NaN}:"integerValue"in s||"doubleValue"in s?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in s?{stringValue:""}:"stringValue"in s?{bytesValue:""}:"bytesValue"in s?ra(t4.empty(),$.empty()):"referenceValue"in s?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in s?{arrayValue:{}}:"arrayValue"in s?rg:"mapValue"in s?rf(s)?{mapValue:{}}:t3:E(61959,{value:s}),t=!1;break;case"==":case"in":case"<=":e=r.value;break;case"<":e=r.value,t=!1;break;case"!=":case"not-in":e=t3}rv({value:n,inclusive:i},{value:e,inclusive:t})>0&&(n=e,i=t)}if(null!==r){for(let s=0;s<e.orderBy.length;++s)if(e.orderBy[s].field.isEqual(t)){let e=r.position[s];rv({value:n,inclusive:i},{value:e,inclusive:r.inclusive})>0&&(n=e,i=r.inclusive);break}}return{value:n,inclusive:i}}class rQ{constructor(e,t=null,r=[],n=[],i=null,s="F",o=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=n,this.limit=i,this.limitType=s,this.startAt=o,this.endAt=a,this.Ie=null,this.Ee=null,this.Re=null,this.startAt,this.endAt}}function rY(e){return new rQ(e)}function rJ(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 rX(e){return $.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}function rZ(e){return null!==e.collectionGroup}function r0(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 n=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(t=new tV(W.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 rT(t,n))}),r.has(W.keyField().canonicalString())||e.Ie.push(new rT(W.keyField(),n))}return e.Ie}function r1(e){return e.Ee||(e.Ee=r4(e,r0(e))),e.Ee}function r2(e){return e.Re||(e.Re=r4(e,e.explicitOrderBy)),e.Re}function r4(e,t){if("F"===e.limitType)return rH(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 rT(e.field,t)});let r=e.endAt?new r_(e.endAt.position,e.endAt.inclusive):null,n=e.startAt?new r_(e.startAt.position,e.startAt.inclusive):null;return rH(e.path,e.collectionGroup,t,e.filters,e.limit,r,n)}}function r6(e,t,r){return new rQ(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,r,e.startAt,e.endAt)}function r8(e,t){return rq(r1(e),r1(t))&&e.limitType===t.limitType}function r3(e){return`${rz(r1(e))}|lt:${e.limitType}`}function r5(e){var t;let r;return`Query(target=${r=(t=r1(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 rA?`${t.field.canonicalString()} ${t.op} ${ro(t.value)}`:t instanceof rC?t.op.toString()+" {"+t.getFilters().map(e).join(" ,")+"}":"Filter"})(e)).join(", ")}]`),eO(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: "+(t.startAt.inclusive?"b:":"a:")+t.startAt.position.map(e=>ro(e)).join(",")),t.endAt&&(r+=", endAt: "+(t.endAt.inclusive?"a:":"b:")+t.endAt.position.map(e=>ro(e)).join(",")),`Target(${r})`}; limitType=${e.limitType})`}function r9(e,t){return t.isFoundDocument()&&function(e,t){let r=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(r):$.isDocumentKey(e.path)?e.path.isEqual(r):e.path.isImmediateParentOf(r)}(e,t)&&function(e,t){for(let r of r0(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)&&(!e.startAt||!!function(e,t,r){let n=rE(e,t,r);return e.inclusive?n<=0:n<0}(e.startAt,r0(e),t))&&(!e.endAt||!!function(e,t,r){let n=rE(e,t,r);return e.inclusive?n>=0:n>0}(e.endAt,r0(e),t))}function r7(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function ne(e){return(t,r)=>{let n=!1;for(let i of r0(e)){let e=function(e,t,r){let n=e.field.isKeyField()?$.comparator(t.key,r.key):function(e,t,r){let n=t.data.field(e),i=r.data.field(e);return null!==n&&null!==i?rn(n,i):E(42886)}(e.field,t,r);switch(e.dir){case"asc":return n;
1case"desc":return -1*n;default:return E(19790,{direction:e.dir})}}(i,t,r);if(0!==e)return e;n=n||i.field.isKeyField()}return 0}}class nt{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,n]of r)if(this.equalsFn(t,e))return n}}has(e){return void 0!==this.get(e)}set(e,t){let r=this.mapKeyFn(e),n=this.inner[r];if(void 0===n)return this.inner[r]=[[e,t]],void this.innerSize++;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return void(n[r]=[e,t]);n.push([e,t]),this.innerSize++}delete(e){let t=this.mapKeyFn(e),r=this.inner[t];if(void 0===r)return!1;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],e))return 1===r.length?delete this.inner[t]:r.splice(n,1),this.innerSize--,!0;return!1}forEach(e){tD(this.inner,(t,r)=>{for(let[t,n]of r)e(t,n)})}isEmpty(){return tO(this.inner)}size(){return this.innerSize}}let nr=new tM($.comparator),nn=new tM($.comparator);function ni(...e){let t=nn;for(let r of e)t=t.insert(r.key,r);return t}function ns(e){let t=nn;return e.forEach((e,r)=>t=t.insert(e,r.overlayedDocument)),t}function no(){return new nt(e=>e.toString(),(e,t)=>e.isEqual(t))}let na=new tM($.comparator),nl=new tV($.comparator);function nu(...e){let t=nl;for(let r of e)t=t.add(r);return t}let nc=new tV(V);function nh(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:eM(t)?"-0":t}}function nd(e){return{integerValue:""+e}}function nf(e,t){return eL(t)?nd(t):nh(e,t)}class np{constructor(){this._=void 0}}function nm(e,t){return e instanceof n_?rl(t)||t&&"doubleValue"in t?t:{integerValue:0}:null}class ng extends np{}class ny extends np{constructor(e){super(),this.elements=e}}function nv(e,t){let r=nI(t);for(let t of e.elements)r.some(e=>rt(e,t))||r.push(t);return{arrayValue:{values:r}}}class nw extends np{constructor(e){super(),this.elements=e}}function nb(e,t){let r=nI(t);for(let t of e.elements)r=r.filter(e=>!rt(e,t));return{arrayValue:{values:r}}}class n_ extends np{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function nE(e){return tW(e.integerValue||e.doubleValue)}function nI(e){return ru(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class nT{constructor(e,t){this.field=e,this.transform=t}}class nS{constructor(e,t){this.version=e,this.transformResults=t}}class nA{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new nA}static exists(e){return new nA(void 0,e)}static updateTime(e){return new nA(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 nC(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class nP{}function nR(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new nF(e.key,nA.none()):new nD(e.key,e.data,nA.none());{let r=e.data,n=rw.empty(),i=new tV(W.comparator);for(let e of t.fields)if(!i.has(e)){let t=r.field(e);null===t&&e.length>1&&(e=e.popLast(),t=r.field(e)),null===t?n.delete(e):n.set(e,t),i=i.add(e)}return new nN(e.key,n,new tj(i.toArray()),nA.none())}}function nk(e,t,r,n){return e instanceof nD?function(e,t,r,n){if(!nC(e.precondition,t))return r;let i=e.value.clone(),s=nL(e.fieldTransforms,n,t);return i.setAll(s),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,r,n):e instanceof nN?function(e,t,r,n){if(!nC(e.precondition,t))return r;let i=nL(e.fieldTransforms,n,t),s=t.data;return(s.setAll(nO(e)),s.setAll(i),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===r)?null:r.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,r,n):nC(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):r}function nx(e,t){var r,n;return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&(r=e.fieldTransforms,n=t.fieldTransforms,!!(void 0===r&&void 0===n||!(!r||!n)&&j(r,n,(e,t)=>{var r,n;return e.field.isEqual(t.field)&&(r=e.transform,n=t.transform,r instanceof ny&&n instanceof ny||r instanceof nw&&n instanceof nw?j(r.elements,n.elements,rt):r instanceof n_&&n instanceof n_?rt(r.Ae,n.Ae):r instanceof ng&&n instanceof ng)})))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class nD extends nP{constructor(e,t,r,n=[]){super(),this.key=e,this.value=t,this.prec
1ondition=r,this.fieldTransforms=n,this.type=0}getFieldMask(){return null}}class nN extends nP{constructor(e,t,r,n,i=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=n,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function nO(e){let t=new Map;return e.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){let n=e.data.field(r);t.set(r,n)}}),t}function nM(e,t,r){let n=new Map;T(e.length===r.length,32656,{Ve:r.length,de:e.length});for(let s=0;s<r.length;s++){var i;let o=e[s],a=o.transform,l=t.data.field(o.field);n.set(o.field,(i=r[s],a instanceof ny?nv(a,l):a instanceof nw?nb(a,l):i))}return n}function nL(e,t,r){let n=new Map;for(let i of e){let e=i.transform,s=r.data.field(i.field);n.set(i.field,e instanceof ng?function(e,t){let r={fields:{[tQ]:{stringValue:tK},[tJ]:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&tX(t)&&(t=tZ(t)),t&&(r.fields[tY]=t),{mapValue:r}}(t,s):e instanceof ny?nv(e,s):e instanceof nw?nb(e,s):function(e,t){let r=nm(e,t),n=nE(r)+nE(e.Ae);return rl(r)&&rl(e.Ae)?nd(n):nh(e.serializer,n)}(e,s))}return n}class nF extends nP{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class nV extends nP{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class nU{constructor(e,t,r,n){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=n}applyToRemoteDocument(e,t){let r=t.mutationResults;for(let t=0;t<this.mutations.length;t++){let i=this.mutations[t];if(i.key.isEqual(e.key)){var n;n=r[t],i instanceof nD?function(e,t,r){let n=e.value.clone(),i=nM(e.fieldTransforms,t,r.transformResults);n.setAll(i),t.convertToFoundDocument(r.version,n).setHasCommittedMutations()}(i,e,n):i instanceof nN?function(e,t,r){if(!nC(e.precondition,t))return void t.convertToUnknownDocument(r.version);let n=nM(e.fieldTransforms,t,r.transformResults),i=t.data;i.setAll(nO(e)),i.setAll(n),t.convertToFoundDocument(r.version,i).setHasCommittedMutations()}(i,e,n):function(e,t,r){t.convertToNoDocument(r.version).setHasCommittedMutations()}(0,e,n)}}}applyToLocalView(e,t){for(let r of this.baseMutations)r.key.isEqual(e.key)&&(t=nk(r,e,t,this.localWriteTime));for(let r of this.mutations)r.key.isEqual(e.key)&&(t=nk(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){let r=no();return this.mutations.forEach(n=>{let i=e.get(n.key),s=i.overlayedDocument,o=this.applyToLocalView(s,i.mutatedFields),a=nR(s,o=t.has(n.key)?null:o);null!==a&&r.set(n.key,a),s.isValidDocument()||s.convertToNoDocument(ei.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),nu())}isEqual(e){return this.batchId===e.batchId&&j(this.mutations,e.mutations,(e,t)=>nx(e,t))&&j(this.baseMutations,e.baseMutations,(e,t)=>nx(e,t))}}class nB{constructor(e,t,r,n){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=n}static from(e,t,r){T(e.mutations.length===r.length,58842,{me:e.mutations.length,fe:r.length});let n=na,i=e.mutations;for(let e=0;e<i.length;e++)n=n.insert(i[e].key,r[e].version);return new nB(e,t,r,n)}}class nj{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{
2      largestBatchId: ${this.largestBatchId},
3      mutation: ${this.mutation.toString()}
4    }`}}class nH{constructor(e,t,r){this.alias=e,this.aggregateType=t,this.fieldPath=r}}class nz{constructor(e,t){this.count=e,this.unchangedNames=t}}function nq(e){switch(e){case S.OK:return E(64938);case S.CANCELLED:case S.UNKNOWN:case S.DEADLINE_EXCEEDED:case S.RESOURCE_EXHAUSTED:case S.INTERNAL:case S.UNAVAILABLE:case S.UNAUTHENTICATED:return!1;case S.INVALID_ARGUMENT:case S.NOT_FOUND:case S.ALREADY_EXISTS:case S.PERMISSION_DENIED:case S.FAILED_PRECONDITION:case S.ABORTED:case S.OUT_OF_RANGE:case S.UNIMPLEMENTED:case S.DATA_LOSS:return!0;default:return E(15467,{code:e})}}function nG(e){if(void 0===e)return w("GRPC error has no .code"),S.UNKNOWN;switch(e){case n.OK:return S.OK;case n.CANCELLED:return S.CANCELLED;case n.UNKNOWN:return S.UNKNOWN;case n.DEADLINE_EXCEEDED:return S.DEADLINE_EXCEEDED;case n.RESOURCE_EXHAUSTED:return S.RESOURCE_EXHAUSTED;case n.INTERNAL:return S.INTERNAL;case n.UNAVAILABLE:return S.UNAVAILABLE;case n.UNAUTHENTICATED:return S.UNAUTHENTICATED;case n.INVALID_ARGUMENT:return S.INVALID_ARGUMENT;case n.NOT_FOUND:return S.NOT_FOUND;case n.ALREADY_EXISTS:return S.ALREADY_EXISTS;case n.PERMISSION_DENIED:return S.PERMISSION_DENIED;case n.FAILED_PRECONDITION:return S.FAILED_PRECONDITION;case n.ABORTED:return S.ABORTED;case n.OUT_OF_RANGE:return S.OUT_OF_RANGE;
4case n.UNIMPLEMENTED:return S.UNIMPLEMENTED;case n.DATA_LOSS:return S.DATA_LOSS;default:return E(39323,{code:e})}}(i=n||(n={}))[i.OK=0]="OK",i[i.CANCELLED=1]="CANCELLED",i[i.UNKNOWN=2]="UNKNOWN",i[i.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",i[i.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",i[i.NOT_FOUND=5]="NOT_FOUND",i[i.ALREADY_EXISTS=6]="ALREADY_EXISTS",i[i.PERMISSION_DENIED=7]="PERMISSION_DENIED",i[i.UNAUTHENTICATED=16]="UNAUTHENTICATED",i[i.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",i[i.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",i[i.ABORTED=10]="ABORTED",i[i.OUT_OF_RANGE=11]="OUT_OF_RANGE",i[i.UNIMPLEMENTED=12]="UNIMPLEMENTED",i[i.INTERNAL=13]="INTERNAL",i[i.UNAVAILABLE=14]="UNAVAILABLE",i[i.DATA_LOSS=15]="DATA_LOSS";let nW=null;function n$(){return new TextEncoder}let nK=new h.Integer([4294967295,4294967295],0);function nQ(e){let t=n$().encode(e),r=new h.Md5;return r.update(t),new Uint8Array(r.digest())}function nY(e){let t=new DataView(e.buffer),r=t.getUint32(0,!0),n=t.getUint32(4,!0),i=t.getUint32(8,!0),s=t.getUint32(12,!0);return[new h.Integer([r,n],0),new h.Integer([i,s],0)]}class nJ{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new nX(`Invalid padding: ${t}`);if(r<0||e.length>0&&0===this.hashCount)throw new nX(`Invalid hash count: ${r}`);if(0===e.length&&0!==t)throw new nX(`Invalid padding when bitmap length is 0: ${t}`);this.ge=8*e.length-t,this.pe=h.Integer.fromNumber(this.ge)}ye(e,t,r){let n=e.add(t.multiply(h.Integer.fromNumber(r)));return 1===n.compare(nK)&&(n=new h.Integer([n.getBits(0),n.getBits(1)],0)),n.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.ge)return!1;let[t,r]=nY(nQ(e));for(let e=0;e<this.hashCount;e++){let n=this.ye(t,r,e);if(!this.we(n))return!1}return!0}static create(e,t,r){let n=new nJ(new Uint8Array(Math.ceil(e/8)),e%8==0?0:8-e%8,t);return r.forEach(e=>n.insert(e)),n}insert(e){if(0===this.ge)return;let[t,r]=nY(nQ(e));for(let e=0;e<this.hashCount;e++){let n=this.ye(t,r,e);this.Se(n)}}Se(e){this.bitmap[Math.floor(e/8)]|=1<<e%8}}class nX extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class nZ{constructor(e,t,r,n,i){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=r,this.documentUpdates=n,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,t,r){let n=new Map;return n.set(e,n0.createSynthesizedTargetChangeForCurrentChange(e,t,r)),new nZ(ei.min(),n,new tM(V),nr,nu())}}class n0{constructor(e,t,r,n,i){this.resumeToken=e,this.current=t,this.addedDocuments=r,this.modifiedDocuments=n,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,t,r){return new n0(r,t,nu(),nu(),nu())}}class n1{constructor(e,t,r,n){this.be=e,this.removedTargetIds=t,this.key=r,this.De=n}}class n2{constructor(e,t){this.targetId=e,this.Ce=t}}class n4{constructor(e,t,r=tz.EMPTY_BYTE_STRING,n=null){this.state=e,this.targetIds=t,this.resumeToken=r,this.cause=n}}class n6{constructor(){this.ve=0,this.Fe=n5(),this.Me=tz.EMPTY_BYTE_STRING,this.xe=!1,this.Oe=!0}get current(){return this.xe}get resumeToken(){return this.Me}get Ne(){return 0!==this.ve}get Be(){return this.Oe}Le(e){e.approximateByteSize()>0&&(this.Oe=!0,this.Me=e)}ke(){let e=nu(),t=nu(),r=nu();return this.Fe.forEach((n,i)=>{switch(i){case 0:e=e.add(n);break;case 2:t=t.add(n);break;case 1:r=r.add(n);break;default:E(38017,{changeType:i})}}),new n0(this.Me,this.xe,e,t,r)}Ke(){this.Oe=!1,this.Fe=n5()}qe(e,t){this.Oe=!0,this.Fe=this.Fe.insert(e,t)}Ue(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}$e(){this.ve+=1}We(){this.ve-=1,T(this.ve>=0,3241,{ve:this.ve})}Qe(){this.Oe=!0,this.xe=!0}}class n8{constructor(e){this.Ge=e,this.ze=new Map,this.je=nr,this.Je=n3(),this.He=n3(),this.Ze=new tM(V)}Xe(e){for(let t of e.be)e.De&&e.De.isFoundDocument()?this.Ye(t,e.De):this.et(t,e.key,e.De);for(let t of e.removedTargetIds)this.et(t,e.key,e.De)}tt(e){this.forEachTarget(e,t=>{let r=this.nt(t);switch(e.state){case 0:this.rt(t)&&r.Le(e.resumeToken);break;case 1:r.We(),r.Ne||r.Ke(),r.Le(e.resumeToken);break;case 2:r.We(),r.Ne||this.removeTarget(t);break;case 3:this.rt(t)&&(r.Qe(),r.Le(e.resumeToken));break;case 4:this.rt(t)&&(this.it(t),r.Le(e.resumeToken));break;default:E(56790,{state:e.state})}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ze.forEach((e,r)=>{this.rt(r)&&t(r)})}st(e){let t=e.targetId,r=e.Ce.count,n=this.ot(t);if(n){let i=n.target;if(rG(i)){if(0===r){let e=new $(i.path);this.et(t,e,rb.newNoDocument(e,ei.min()))}else T(1===r,20013,{expectedCount:r})}else{let n=this._t(t);if(n!==r){let r=this.ut(e),i=r?this.ct(r,e,n):1;0!==i&&(this.it(t),this.Ze=this.Ze.insert(t,2===i?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch")),nW?.o(function(e,t,r,n,i){let s={localCacheCount:e,existenceFilterCount:t.count,databaseId:r.database,projectId:r.projectId},o=t.unchangedNames;return o&&(s.bloomFilter={applied:0===i,hashCount:o?.hashCount??0,bitmapLength:o?.bits?.bitmap?.length??0,padding:o?.bits?.padding??0,mightContain:e=>n?.mightContain(e)??!1}),s}(n,e.Ce,this.Ge.ht(),r,i))}}}}ut(e){let t,r;let n=e.Ce.unchangedNames;if(!n||!n.bits)return null;let{bits:{bitmap:i="",padding:s=0},hashCount:o=0}=n;try{t=t$(i).toUint8Array()}catch(e){if(e instanceof tH)return b("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw e}try{r=new nJ(t,s,o)}catch(e){return b(e instanceof nX?"BloomFilter error: ":"Applying bloom filter failed: ",e),null}return 0===r.ge?null:r}ct(e,t,r){return t.Ce.count===r-this.Pt(e,t.targetId)?0:2}Pt(e,t){let r=this.Ge.getRemoteKeysForTarget(t),n=0;return r.forEach(r=>{let i=this.Ge.ht(),s=`projects/${i.projectId}/databases/${i.database}/documents/${r.path.canonicalString()}`;e.mightContain(s)||(this.et(t,r,null),n++)}),n}Tt(e){let t=new Map;this.ze.forEach((r,n)=>{let i=this.ot(n);if(i){if(r.current&&rG(i.target)){let t=new $(i.target.path);this.It(t).has(n)||this.Et(n,t)||this.et(n,t,rb.newNoDocument(t,e))}r.Be&&(t.set(n,r.ke()),r.Ke())}});let r=nu();this.He.forEach((e,t)=>{let n=!0;t.forEachWhile(e=>{let t=this.ot(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(n=!1,!1)}),n&&(r=r.add(e))}),this.je.forEach((t,r)=>r.setReadTime(e));let n=new nZ(e,t,this.Ze,this.je,r);return this.je=nr,this.Je=n3(),this.He=n3(),this.Ze=new tM(V),n}Ye(e,t){if(!this.rt(e))return;
4let r=this.Et(e,t.key)?2:0;this.nt(e).qe(t.key,r),this.je=this.je.insert(t.key,t),this.Je=this.Je.insert(t.key,this.It(t.key).add(e)),this.He=this.He.insert(t.key,this.Rt(t.key).add(e))}et(e,t,r){if(!this.rt(e))return;let n=this.nt(e);this.Et(e,t)?n.qe(t,1):n.Ue(t),this.He=this.He.insert(t,this.Rt(t).delete(e)),this.He=this.He.insert(t,this.Rt(t).add(e)),r&&(this.je=this.je.insert(t,r))}removeTarget(e){this.ze.delete(e)}_t(e){let t=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}$e(e){this.nt(e).$e()}nt(e){let t=this.ze.get(e);return t||(t=new n6,this.ze.set(e,t)),t}Rt(e){let t=this.He.get(e);return t||(t=new tV(V),this.He=this.He.insert(e,t)),t}It(e){let t=this.Je.get(e);return t||(t=new tV(V),this.Je=this.Je.insert(e,t)),t}rt(e){let t=null!==this.ot(e);return t||v("WatchChangeAggregator","Detected inactive target",e),t}ot(e){let t=this.ze.get(e);return t&&t.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new n6),this.Ge.getRemoteKeysForTarget(e).forEach(t=>{this.et(e,t,null)})}Et(e,t){return this.Ge.getRemoteKeysForTarget(e).has(t)}}function n3(){return new tM($.comparator)}function n5(){return new tM($.comparator)}let n9={asc:"ASCENDING",desc:"DESCENDING"},n7={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ie={and:"AND",or:"OR"};class it{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function ir(e,t){return e.useProto3Json||eO(t)?t:{value:t}}function ii(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function is(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function io(e){return T(!!e,49232),ei.fromTimestamp(function(e){let t=tG(e);return new en(t.seconds,t.nanos)}(e))}function ia(e,t){return il(e,t).canonicalString()}function il(e,t){let r=new q(["projects",e.projectId,"databases",e.database]).child("documents");return void 0===t?r:r.child(t)}function iu(e){let t=q.fromString(e);return T(iP(t),10190,{key:t.toString()}),t}function ic(e,t){return ia(e.databaseId,t.path)}function ih(e,t){let r=iu(t);if(r.get(1)!==e.databaseId.projectId)throw new A(S.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+r.get(1)+" vs "+e.databaseId.projectId);if(r.get(3)!==e.databaseId.database)throw new A(S.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+e.databaseId.database);return new $(ig(r))}function id(e,t){return ia(e.databaseId,t)}function ip(e){let t=iu(e);return 4===t.length?q.emptyPath():ig(t)}function im(e){return new q(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function ig(e){return T(e.length>4&&"documents"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}function iy(e,t,r){return{name:ic(e,t),fields:r.value.mapValue.fields}}function iv(e,t,r){let n={};t.transaction?.length&&(n.transaction=t.transaction);let i=t.executionTime?io(t.executionTime):void 0;return n.executionTime=i,r&&(n.key=r.name?ih(e,r.name):void 0,n.fields=new rw({mapValue:{fields:r.fields}}),n.createTime=r.createTime?io(r.createTime):void 0,n.updateTime=r.updateTime?io(r.updateTime):void 0),n}function iw(e,t,r){let n=ih(e,t.name),i=io(t.updateTime),s=t.createTime?io(t.createTime):ei.min(),o=new rw({mapValue:{fields:t.fields}}),a=rb.newFoundDocument(n,i,s,o);return r&&a.setHasCommittedMutations(),r?a.setHasCommittedMutations():a}function ib(e,t){var r;let n;if(t instanceof nD)n={update:iy(e,t.key,t.value)};else if(t instanceof nF)n={delete:ic(e,t.key)};else if(t instanceof nN)n={update:iy(e,t.key,t.data),updateMask:function(e){let t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}(t.fieldMask)};else{if(!(t instanceof nV))return E(16599,{dt:t.type});n={verify:ic(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>(function(e,t){let r=t.transform;if(r instanceof ng)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(r instanceof ny)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:r.elements}};if(r instanceof nw)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:r.elements}};if(r instanceof n_)return{fieldPath:t.field.canonicalString(),increment:r.Ae};throw E(20930,{transform:t.transform})})(0,e))),t.precondition.isNone||(n.currentDocument=void 0!==(r=t.precondition).updateTime?{updateTime:ii(e,r.updateTime.toTimestamp())}:void 0!==r.exists?{exists:r.exists}:E(27497)),n}function i_(e,t){var r;let n=t.currentDocument?void 0!==(r=t.currentDocument).updateTime?nA.updateTime(io(r.updateTime)):void 0!==r.exists?nA.exists(r.exists):nA.none():nA.none(),i=t.updateTransforms?t.updateTransforms.map(t=>{let r;return r=null,"setToServerValue"in t?(T("REQUEST_TIME"===t.setToServerValue,16630,{proto:t}),r=new ng):"appendMissingElements"in t?r=new ny(t.appendMissingElements.values||[]):"removeAllFromArray"in t?r=new nw(t.removeAllFromArray.values||[]):"increment"in t?r=new n_(e,t.increment):E(16584,{proto:t}),new nT(W.fromServerFormat(t.fieldPath),r)}):[];if(t.update){t.update.name;let r=ih(e,t.update.name),s=new rw({mapValue:{fields:t.update.fields}});return t.updateMask?new nN(r,s,new tj((t.updateMask.fieldPaths||[]).map(e=>W.fromServerFormat(e))),n,i):new nD(r,s,n,i)}return t.delete?new nF(ih(e,t.delete),n):t.verify?new nV(ih(e,t.verify),n):E(1463,{proto:t})}function iE(e,t){return{documents:[id(e,t.path)]}}function iI(e,t){var r,n;let i;let s={structuredQuery:{}},o=t.path;null!==t.collectionGroup?(i=o,s.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(i=o.popLast(),s.structuredQuery.from=[{collectionId:o.lastSegment()}]),s.parent=id(e,i);let a=function(e){if(0!==e.length)return function e(t){return t instanceof rA?function(e){if("=="===e.op){if(rh(e.value))return{unaryFilter:{field:iA(e.field),op:"IS_NAN"}};if(rc(e.value))return{unaryFilter:{field:iA(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(rh(e.value))return{unaryFilter:{field:iA(e.field),op:"IS_NOT_NA
4N"}};if(rc(e.value))return{unaryFilter:{field:iA(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:iA(e.field),op:n7[e.op],value:e.value}}}(t):t instanceof rC?function(t){let r=t.getFilters().map(t=>e(t));return 1===r.length?r[0]:{compositeFilter:{op:ie[t.op],filters:r}}}(t):E(54877,{filter:t})}(rC.create(e,"and"))}(t.filters);a&&(s.structuredQuery.where=a);let l=function(e){if(0!==e.length)return e.map(e=>({field:iA(e.field),direction:n9[e.dir]}))}(t.orderBy);l&&(s.structuredQuery.orderBy=l);let u=ir(e,t.limit);return null!==u&&(s.structuredQuery.limit=u),t.startAt&&(s.structuredQuery.startAt={before:(r=t.startAt).inclusive,values:r.position}),t.endAt&&(s.structuredQuery.endAt={before:!(n=t.endAt).inclusive,values:n.position}),{ft:s,parent:i}}function iT(e,t,r,n){let{ft:i,parent:s}=iI(e,t),o={},a=[],l=0;return r.forEach(e=>{let t=n?e.alias:"aggregate_"+l++;o[t]=e.alias,"count"===e.aggregateType?a.push({alias:t,count:{}}):"avg"===e.aggregateType?a.push({alias:t,avg:{field:iA(e.fieldPath)}}):"sum"===e.aggregateType&&a.push({alias:t,sum:{field:iA(e.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:a,structuredQuery:i.structuredQuery},parent:i.parent},gt:o,parent:s}}function iS(e){var t;let r,n=ip(e.parent),i=e.structuredQuery,s=i.from?i.from.length:0,o=null;if(s>0){T(1===s,65062);let e=i.from[0];e.allDescendants?o=e.collectionId:n=n.child(e.collectionId)}let a=[];i.where&&(a=function(e){let t=function e(t){return void 0!==t.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":let t=iC(e.unaryFilter.field);return rA.create(t,"==",{doubleValue:NaN});case"IS_NULL":let r=iC(e.unaryFilter.field);return rA.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let n=iC(e.unaryFilter.field);return rA.create(n,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let i=iC(e.unaryFilter.field);return rA.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return E(61313);default:return E(60726)}}(t):void 0!==t.fieldFilter?rA.create(iC(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 E(58110);default:return E(50506)}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==t.compositeFilter?rC.create(t.compositeFilter.filters.map(t=>e(t)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return E(1026)}}(t.compositeFilter.op)):E(30097,{filter:t})}(e);return t instanceof rC&&rk(t)?t.getFilters():[t]}(i.where));let l=[];i.orderBy&&(l=i.orderBy.map(e=>new rT(iC(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))));let u=null;i.limit&&(u=eO(r="object"==typeof(t=i.limit)?t.value:t)?null:r);let c=null;i.startAt&&(c=function(e){let t=!!e.before;return new r_(e.values||[],t)}(i.startAt));let h=null;return i.endAt&&(h=function(e){let t=!e.before;return new r_(e.values||[],t)}(i.endAt)),new rQ(n,o,l,a,u,"F",c,h)}function iA(e){return{fieldPath:e.canonicalString()}}function iC(e){return W.fromServerFormat(e.fieldPath)}function iP(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}function iR(e){return!!e&&"function"==typeof e._toProto&&"ProtoValue"===e._protoValueType}class ik{constructor(e,t,r,n,i=ei.min(),s=ei.min(),o=tz.EMPTY_BYTE_STRING,a=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=n,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=o,this.expectedCount=a}withSequenceNumber(e){return new ik(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new ik(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new ik(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new ik(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class ix{constructor(e){this.yt=e}}function iD(e,t){let r=t.key,n={prefixPath:r.getCollectionPath().popLast().toArray(),collectionGroup:r.collectionGroup,documentId:r.path.lastSegment(),readTime:iN(t.readTime),hasCommittedMutations:t.hasCommittedMutations};if(t.isFoundDocument()){var i;n.document={name:ic(i=e.yt,t.key),fields:t.data.value.mapValue.fields,updateTime:ii(i,t.version.toTimestamp()),createTime:ii(i,t.createTime.toTimestamp())}}else if(t.isNoDocument())n.noDocument={path:r.path.toArray(),readTime:iO(t.version)};else{if(!t.isUnknownDocument())return E(57904,{document:t});n.unknownDocument={path:r.path.toArray(),version:iO(t.version)}}return n}function iN(e){let t=e.toTimestamp();return[t.seconds,t.nanoseconds]}function iO(e){let t=e.toTimestamp();return{seconds:t.seconds,nanoseconds:t.nanoseconds}}function iM(e){let t=new en(e.seconds,e.nanoseconds);return ei.fromTimestamp(t)}function iL(e,t){let r=(t.baseMutations||[]).map(t=>i_(e.yt,t));for(let e=0;e<t.mutations.length-1;++e){let r=t.mutations[e];if(e+1<t.mutations.length&&void 0!==t.mutations[e+1].transform){let n=t.mutations[e+1];r.updateTransforms=n.transform.fieldTransforms,t.mutations.splice(e+1,1),++e}}let n=t.mutations.map(t=>i_(e.yt,t)),i=en.fromMillis(t.localWriteTimeMs);return new nU(t.batchId,i,r,n)}function iF(e){let t=iM(e.readTime),r=void 0!==e.lastLimboFreeSnapshotVersion?iM(e.lastLimboFreeSnapshotVersion):ei.min();return new ik(void 0!==e.query.documents?function(e){let t=e.documents.length;return T(1===t,1966,{count:t}),r1(rY(ip(e.documents[0])))}(e.query):r1(iS(e.query)),e.targetId,"TargetPurposeListen",e.lastListenSequenceNumber,t,r,tz.fromBase64String(e.resumeToken))}function iV(e,t){let r;let n=iO(t.snapshotVersion),i=iO(t.lastLimboFreeSnapshotVersion);r=rG(t.target)?iE(e.yt,t.target):iI(e.yt,t.target).ft;let s=t.resumeToken.toBase64();return{targetId:t.targetId,canonicalId:rz(t.target),readTime:n,resumeToken:s,lastListenSequenceNumber:t.sequenceNumber,lastLimboFreeSnapshotVersion:i,query:r}}function iU(e){let t=iS({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?r6(t,t.limit,"L"):t}function iB(e,t){return new nj(t.largestBatchId,i_(e.yt,t.overlayMutation))}function ij(e,t){let r=t.path.lastSegment();return[e,eF(t.path.popLast()),r]}function iH(e,t,r,n){return{indexId:e,uid:t,sequenceNumber:r,readTime:iO(n.readTime),documentKey:eF(n.documentKey.path),largestBatchId:n.largestBatchId}}class iz{getBundleMetadata(e,t){return tk(e,ts).get(t).next(e=>{if(e)return{id:e.bundleId,createTime:iM(e.createTime),version:e.version}})}saveBundleMetadata(e,t){return tk(e,ts).put({bundleId:t.id,createTime:iO(io(t.createTime)),version:t.version})}getNamedQuery(e,t){return tk(e,to).get(t).next(e=>{if(e)return{name:e.name,query:iU(e.bundledQuery),readTime:iM(e.readTime)}})}saveNamedQuery(e,t){return tk(e,to).put({name:t.name,readTime:iO(io(t.readTime)),bundledQuery:t.bundledQuery})}}
4class iq{constructor(e,t){this.serializer=e,this.userId=t}static wt(e,t){return new iq(e,t.uid||"")}getOverlay(e,t){return tk(e,ty).get(ij(this.userId,t)).next(e=>e?iB(this.serializer,e):null)}getOverlays(e,t){let r=no();return ev.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&r.set(t,e)})).next(()=>r)}saveOverlays(e,t,r){let n=[];return r.forEach((r,i)=>{let s=new nj(t,i);n.push(this.St(e,s))}),ev.waitFor(n)}removeOverlaysForBatchId(e,t,r){let n=new Set;t.forEach(e=>n.add(eF(e.getCollectionPath())));let i=[];return n.forEach(t=>{let n=IDBKeyRange.bound([this.userId,t,r],[this.userId,t,r+1],!1,!0);i.push(tk(e,ty).X(tw,n))}),ev.waitFor(i)}getOverlaysForCollection(e,t,r){let n=no(),i=eF(t),s=IDBKeyRange.bound([this.userId,i,r],[this.userId,i,Number.POSITIVE_INFINITY],!0);return tk(e,ty).J(tw,s).next(e=>{for(let t of e){let e=iB(this.serializer,t);n.set(e.getKey(),e)}return n})}getOverlaysForCollectionGroup(e,t,r,n){let i;let s=no(),o=IDBKeyRange.bound([this.userId,t,r],[this.userId,t,Number.POSITIVE_INFINITY],!0);return tk(e,ty).ee({index:t_,range:o},(e,t,r)=>{let o=iB(this.serializer,t);s.size()<n||o.largestBatchId===i?(s.set(o.getKey(),o),i=o.largestBatchId):r.done()}).next(()=>s)}St(e,t){return tk(e,ty).put(function(e,t,r){let[n,i,s]=ij(t,r.mutation.key);return{userId:t,collectionPath:i,documentId:s,collectionGroup:r.mutation.key.getCollectionGroup(),largestBatchId:r.largestBatchId,overlayMutation:ib(e.yt,r.mutation)}}(this.serializer,this.userId,t))}}class iG{bt(e){return tk(e,tI)}getSessionToken(e){return this.bt(e).get("sessionToken").next(e=>{let t=e?.value;return t?tz.fromUint8Array(t):tz.EMPTY_BYTE_STRING})}setSessionToken(e,t){return this.bt(e).put({name:"sessionToken",value:t.toUint8Array()})}}class iW{constructor(){}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?1:0);else if("integerValue"in e)this.Ft(t,15),t.Mt(tW(e.integerValue));else if("doubleValue"in e){let r=tW(e.doubleValue);isNaN(r)?this.Ft(t,13):(this.Ft(t,15),eM(r)?t.Mt(0):t.Mt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.Ft(t,20),"string"==typeof r&&(r=tG(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(t$(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?rm(e)?this.Ft(t,Number.MAX_SAFE_INTEGER):rf(e)?this.kt(e.mapValue,t):(this.Kt(e.mapValue,t),this.Nt(t)):"arrayValue"in e?(this.qt(e.arrayValue,t),this.Nt(t)):E(19022,{Ut:e})}Ot(e,t){this.Ft(t,25),this.$t(e,t)}$t(e,t){t.xt(e)}Kt(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 n=r[t9].arrayValue?.values?.length||0;this.Ft(t,15),t.Mt(tW(n)),this.Ot(t9,t),this.Ct(r[t9],t)}qt(e,t){let r=e.values||[];for(let e of(this.Ft(t,50),r))this.Ct(e,t)}Lt(e,t){this.Ft(t,37),$.fromName(e).path.forEach(e=>{this.Ft(t,60),this.$t(e,t)})}Ft(e,t){e.Mt(t)}Nt(e){e.Mt(2)}}function i$(e){return Math.ceil((64-function(e){let t=0;for(let r=0;r<8;++r){let n=function(e){if(0===e)return 8;let t=0;return e>>4||(t+=4,e<<=4),e>>6||(t+=2,e<<=2),e>>7||(t+=1),t}(255&e[r]);if(t+=n,8!==n)break}return t}(e))/8)}iW.Wt=new iW;class iK{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Qt(e){let t=e[Symbol.iterator](),r=t.next();for(;!r.done;)this.Gt(r.value),r=t.next();this.zt()}jt(e){let t=e[Symbol.iterator](),r=t.next();for(;!r.done;)this.Jt(r.value),r=t.next();this.Ht()}Zt(e){for(let t of e){let e=t.charCodeAt(0);if(e<128)this.Gt(e);else if(e<2048)this.Gt(960|e>>>6),this.Gt(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.Gt(480|e>>>12),this.Gt(128|63&e>>>6),this.Gt(128|63&e);else{let e=t.codePointAt(0);this.Gt(240|e>>>18),this.Gt(128|63&e>>>12),this.Gt(128|63&e>>>6),this.Gt(128|63&e)}}this.zt()}Xt(e){for(let t of e){let e=t.charCodeAt(0);if(e<128)this.Jt(e);else if(e<2048)this.Jt(960|e>>>6),this.Jt(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.Jt(480|e>>>12),this.Jt(128|63&e>>>6),this.Jt(128|63&e);else{let e=t.codePointAt(0);this.Jt(240|e>>>18),this.Jt(128|63&e>>>12),this.Jt(128|63&e>>>6),this.Jt(128|63&e)}}this.Ht()}Yt(e){let t=this.en(e),r=i$(t);this.tn(1+r),this.buffer[this.position++]=255&r;for(let e=t.length-r;e<t.length;++e)this.buffer[this.position++]=255&t[e]}nn(e){let t=this.en(e),r=i$(t);this.tn(1+r),this.buffer[this.position++]=~(255&r);for(let e=t.length-r;e<t.length;++e)this.buffer[this.position++]=~(255&t[e])}rn(){this.sn(255),this.sn(255)}_n(){this.an(255),this.an(255)}reset(){this.position=0}seed(e){this.tn(e.length),this.buffer.set(e,this.position),this.position+=e.length}un(){return this.buffer.slice(0,this.position)}en(e){let t=function(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e,!1),new Uint8Array(t.buffer)}(e),r=!!(128&t[0]);t[0]^=r?255:128;for(let e=1;e<t.length;++e)t[e]^=r?255:0;return t}Gt(e){let t=255&e;0===t?(this.sn(0),this.sn(255)):255===t?(this.sn(255),this.sn(0)):this.sn(t)}Jt(e){let t=255&e;0===t?(this.an(0),this.an(255)):255===t?(this.an(255),this.an(0)):this.an(e)}zt(){this.sn(0),this.sn(1)}Ht(){this.an(0),this.an(1)}sn(e){this.tn(1),this.buffer[this.position++]=e}an(e){this.tn(1),this.buffer[this.position++]=~e}tn(e){let t=e+this.position;if(t<=this.buffer.length)return;let r=2*this.buffer.length;r<t&&(r=t);let n=new Uint8Array(r);n.set(this.buffer),this.buffer=n}}class iQ{constructor(e){this.cn=e}Bt(e){this.cn.Qt(e)}xt(e){this.cn.Zt(e)}Mt(e){this.cn.Yt(e)}vt(){this.cn.rn()}}class iY{constructor(e){this.cn=e}Bt(e){this.cn.jt(e)}xt(e){this.cn.Xt(e)}Mt(e){this.cn.nn(e)}vt(){this.cn._n()}}class iJ{constructor(){this.cn=new iK,this.ascending=new iQ(this.cn),this.descending=new iY(this.cn)}seed(e){this.cn.seed(e)}ln(e){return 0===e?this.ascending:this.descending}un(){return this.cn.un()}reset(){this.cn.reset()}}class iX{constructor(e,t,r,n){this.hn=e,this.Pn=t,this.Tn=r,this.In=n}En(){let e=this.In.length,t=0===e||255===this.In[e-1]?e+1:e,r=new Uint8Array(t);return r.set(this.In,0),t!==e?r.set([0],this.In.length):++r[r.length-1],new iX(this.hn,this.Pn,this.Tn,r)}Rn(e,t,r){return{indexId:this.hn,uid:e,arrayValue:i1(this.Tn),directionalValue:i1(this.In),orderedDocumentKey:i1(t),documentKey:r.path.toArray()}}An(e,t,r){let n=this.Rn(e,t,r);return[n.indexId,n.uid,n.arrayValue,n.directionalValue,n.orderedDocumentKey,n.documentKey]}}function iZ(e,t){let r=e.hn-t.hn;return 0!==r?r:0!==(r=i0(e.Tn,t.Tn))?r:0!==(r=i0(e.In,t.In))?r:$.comparator(e.Pn,t.Pn)}function i0(e,t){for(let r=0;r<e.length&&r<t.length;++r){let n=e[r]-t[r];if(0!==n)return n}return e.length-t.length}function i1(e){return c.isSafariOrWebkit()?function(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}(e):e}function i2(e){return"string"!=typeof e?e:function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}(e)}class i4{constructor(e){for(let t of(this.Vn=new tV((e,t)=>W.comparator(e.field,t.field)),this.collectionId=null!=e.collectionGroup?e.collectionGroup:e.path.lastSegment(),this.dn=e.orderBy,this.mn=[],e.filters))t.isInequality()?this.Vn=this.Vn.add(t):this.mn.push(t)}get fn(){return this.Vn.size>1}gn(e){if(T(e.collectionGroup===this.collectionId,49279),this.fn)return!1;let t=eo(e);if(void 0!==t&&!this.pn(t))return!1;let r=ea(e),n=new Set,i=0,s=0;for(;i<r.length&&this.pn(r[i]);++i)n=n.add(r[i].fieldPath.canonicalString());if(i===r.length)return!0;
4if(this.Vn.size>0){let e=this.Vn.getIterator().getNext();if(!n.has(e.field.canonicalString())){let t=r[i];if(!this.yn(e,t)||!this.wn(this.dn[s++],t))return!1}++i}for(;i<r.length;++i){let e=r[i];if(s>=this.dn.length||!this.wn(this.dn[s++],e))return!1}return!0}Sn(){if(this.fn)return null;let e=new tV(W.comparator),t=[];for(let r of this.mn)if(!r.field.isKeyField()){if("array-contains"===r.op||"array-contains-any"===r.op)t.push(new eu(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),t.push(new eu(r.field,0))}}for(let r of this.dn)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),t.push(new eu(r.field,"asc"===r.dir?0:1)));return new es(es.UNKNOWN_ID,this.collectionId,t,ec.empty())}pn(e){for(let t of this.mn)if(this.yn(t,e))return!0;return!1}yn(e,t){if(void 0===e||!e.field.isEqual(t.fieldPath))return!1;let r="array-contains"===e.op||"array-contains-any"===e.op;return 2===t.kind===r}wn(e,t){return!!e.field.isEqual(t.fieldPath)&&(0===t.kind&&"asc"===e.dir||1===t.kind&&"desc"===e.dir)}}function i6(e){return e instanceof rA}function i8(e){return e instanceof rC&&rk(e)}function i3(e){return i6(e)||i8(e)||function(e){if(e instanceof rC&&rR(e)){for(let t of e.getFilters())if(!i6(t)&&!i8(t))return!1;return!0}return!1}(e)}function i5(e,t){return T(e instanceof rA||e instanceof rC,38388),T(t instanceof rA||t instanceof rC,25473),i7(e instanceof rA?t instanceof rA?rC.create([e,t],"and"):i9(e,t):t instanceof rA?i9(t,e):function(e,t){if(T(e.filters.length>0&&t.filters.length>0,48005),rP(e)&&rP(t))return rD(e,t.getFilters());let r=rR(e)?e:t,n=rR(e)?t:e,i=r.filters.map(e=>i5(e,n));return rC.create(i,"or")}(e,t))}function i9(e,t){if(rP(t))return rD(t,e.getFilters());{let r=t.filters.map(t=>i5(e,t));return rC.create(r,"or")}}function i7(e){if(T(e instanceof rA||e instanceof rC,11850),e instanceof rA)return e;let t=e.getFilters();if(1===t.length)return i7(t[0]);if(rx(e))return e;let r=t.map(e=>i7(e)),n=[];return r.forEach(t=>{t instanceof rA?n.push(t):t instanceof rC&&(t.op===e.op?n.push(...t.filters):n.push(t))}),1===n.length?n[0]:rC.create(n,e.op)}class se{constructor(){this.bn=new st}addToCollectionParentIndex(e,t){return this.bn.add(t),ev.resolve()}getCollectionParents(e,t){return ev.resolve(this.bn.getEntries(t))}addFieldIndex(e,t){return ev.resolve()}deleteFieldIndex(e,t){return ev.resolve()}deleteAllFieldIndexes(e){return ev.resolve()}createTargetIndexes(e,t){return ev.resolve()}getDocumentsMatchingTarget(e,t){return ev.resolve(null)}getIndexType(e,t){return ev.resolve(0)}getFieldIndexes(e,t){return ev.resolve([])}getNextCollectionGroupToUpdate(e){return ev.resolve(null)}getMinOffset(e,t){return ev.resolve(ef.min())}getMinOffsetFromCollectionGroup(e,t){return ev.resolve(ef.min())}updateCollectionGroup(e,t,r){return ev.resolve()}updateIndexEntries(e,t){return ev.resolve()}}class st{constructor(){this.index={}}add(e){let t=e.lastSegment(),r=e.popLast(),n=this.index[t]||new tV(q.comparator),i=!n.has(r);return this.index[t]=n.add(r),i}has(e){let t=e.lastSegment(),r=e.popLast(),n=this.index[t];return n&&n.has(r)}getEntries(e){return(this.index[e]||new tV(q.comparator)).toArray()}}let sr="IndexedDbIndexManager",sn=new Uint8Array(0);class si{constructor(e,t){this.databaseId=t,this.Dn=new st,this.Cn=new nt(e=>rz(e),(e,t)=>rq(e,t)),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.Dn.has(t)){let r=t.lastSegment(),n=t.popLast();e.addOnCommittedListener(()=>{this.Dn.add(t)});let i={collectionId:r,parent:eF(n)};return tk(e,tr).put(i)}return ev.resolve()}getCollectionParents(e,t){let r=[],n=IDBKeyRange.bound([t,""],[t+"\0",""],!1,!0);return tk(e,tr).J(n).next(e=>{for(let n of e){if(n.collectionId!==t)break;r.push(eV(n.parent))}return r})}addFieldIndex(e,t){let r=tk(e,ta),n={indexId:t.indexId,collectionGroup:t.collectionGroup,fields:t.fields.map(e=>[e.fieldPath.canonicalString(),e.kind])};delete n.indexId;let i=r.add(n);if(t.indexState){let r=tk(e,tu);return i.next(e=>{r.put(iH(e,this.uid,t.indexState.sequenceNumber,t.indexState.offset))})}return i.next()}deleteFieldIndex(e,t){let r=tk(e,ta),n=tk(e,tu),i=tk(e,tf);return r.delete(t.indexId).next(()=>n.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))).next(()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))}deleteAllFieldIndexes(e){let t=tk(e,ta),r=tk(e,tf),n=tk(e,tu);return t.X().next(()=>r.X()).next(()=>n.X())}createTargetIndexes(e,t){return ev.forEach(this.vn(t),t=>this.getIndexType(e,t).next(r=>{if(0===r||1===r){let r=new i4(t).Sn();if(null!=r)return this.addFieldIndex(e,r)}}))}getDocumentsMatchingTarget(e,t){let r=tk(e,tf),n=!0,i=new Map;return ev.forEach(this.vn(t),t=>this.Fn(e,t).next(e=>{n&&(n=!!e),i.set(t,e)})).next(()=>{if(n){let e=nu(),n=[];return ev.forEach(i,(i,s)=>{v(sr,`Using index id=${i.indexId}|cg=${i.collectionGroup}|f=${i.fields.map(e=>`${e.fieldPath}:${e.kind}`).join(",")} to execute ${rz(t)}`);let o=function(e,t){let r=eo(t);if(void 0===r)return null;for(let t of rW(e,r.fieldPath))switch(t.op){case"array-contains-any":return t.value.arrayValue.values||[];case"array-contains":return[t.value]}return null}(s,i),a=function(e,t){let r=new Map;for(let n of ea(t))for(let t of rW(e,n.fieldPath))switch(t.op){case"==":case"in":r.set(n.fieldPath.canonicalString(),t.value);break;case"not-in":case"!=":return r.set(n.fieldPath.canonicalString(),t.value),Array.from(r.values())}return null}(s,i),l=function(e,t){let r=[],n=!0;for(let i of ea(t)){let t=0===i.kind?r$(e,i.fieldPath,e.startAt):rK(e,i.fieldPath,e.startAt);r.push(t.value),n&&(n=t.inclusive)}return new r_(r,n)}(s,i),u=function(e,t){let r=[],n=!0;for(let i of ea(t)){let t=0===i.kind?rK(e,i.fieldPath,e.endAt):r$(e,i.fieldPath,e.endAt);r.push(t.value),n&&(n=t.inclusive)}return new r_(r,n)}(s,i),c=this.Mn(i,s,l),h=this.Mn(i,s,u),d=this.xn(i,s,a),f=this.On(i.indexId,o,c,l.inclusive,h,u.inclusive,d);return ev.forEach(f,i=>r.Z(i,t.limit).next(t=>{t.forEach(t=>{let r=$.fromSegments(t.documentKey);e.has(r)||(e=e.add(r),n.push(r))})}))}).next(()=>n)}return ev.resolve(null)})}vn(e){let t=this.Cn.get(e);return t||(t=0===e.filters.length?[e]:(function(e){if(0===e.getFilters().length)return[];let t=function e(t){if(T(t instanceof rA||t instanceof rC,34018),t instanceof rA)return t;if(1===t.filters.length)return e(t.filters[0]);let r=t.filters.map(t=>e(t)),n=rC.create(r,t.op);return i3(n=i7(n))?n:(T(n instanceof rC,64498),T(rP(n),40251),T(n.filters.length>1,57927),n.filters.reduce((e,t)=>
4i5(e,t)))}(function e(t){if(T(t instanceof rA||t instanceof rC,20012),t instanceof rA){if(t instanceof rV){let e=t.value.arrayValue?.values?.map(e=>rA.create(t.field,"==",e))||[];return rC.create(e,"or")}return t}let r=t.filters.map(t=>e(t));return rC.create(r,t.op)}(e));return T(i3(t),7391),i6(t)||i8(t)?[t]:t.getFilters()})(rC.create(e.filters,"and")).map(t=>rH(e.path,e.collectionGroup,e.orderBy,t.getFilters(),e.limit,e.startAt,e.endAt)),this.Cn.set(e,t)),t}On(e,t,r,n,i,s,o){let a=(null!=t?t.length:1)*Math.max(r.length,i.length),l=a/(null!=t?t.length:1),u=[];for(let c=0;c<a;++c){let a=t?this.Nn(t[c/l]):sn,h=this.Bn(e,a,r[c%l],n),d=this.Ln(e,a,i[c%l],s),f=o.map(t=>this.Bn(e,a,t,!0));u.push(...this.createRange(h,d,f))}return u}Bn(e,t,r,n){let i=new iX(e,$.empty(),t,r);return n?i:i.En()}Ln(e,t,r,n){let i=new iX(e,$.empty(),t,r);return n?i.En():i}Fn(e,t){let r=new i4(t),n=null!=t.collectionGroup?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,n).next(e=>{let t=null;for(let n of e)r.gn(n)&&(!t||n.fields.length>t.fields.length)&&(t=n);return t})}getIndexType(e,t){let r=2,n=this.vn(t);return ev.forEach(n,t=>this.Fn(e,t).next(e=>{e?0!==r&&e.fields.length<function(e){let t=new tV(W.comparator),r=!1;for(let n of e.filters)for(let e of n.getFlattenedFilters())e.field.isKeyField()||("array-contains"===e.op||"array-contains-any"===e.op?r=!0:t=t.add(e.field));for(let r of e.orderBy)r.field.isKeyField()||(t=t.add(r.field));return t.size+(r?1:0)}(t)&&(r=1):r=0})).next(()=>null!==t.limit&&n.length>1&&2===r?1:r)}kn(e,t){let r=new iJ;for(let n of ea(e)){let e=t.data.field(n.fieldPath);if(null==e)return null;let i=r.ln(n.kind);iW.Wt.Dt(e,i)}return r.un()}Nn(e){let t=new iJ;return iW.Wt.Dt(e,t.ln(0)),t.un()}Kn(e,t){let r=new iJ;return iW.Wt.Dt(ra(this.databaseId,t),r.ln(function(e){let t=ea(e);return 0===t.length?0:t[t.length-1].kind}(e))),r.un()}xn(e,t,r){if(null===r)return[];let n=[];n.push(new iJ);let i=0;for(let s of ea(e)){let e=r[i++];for(let r of n)if(this.qn(t,s.fieldPath)&&ru(e))n=this.Un(n,s,e);else{let t=r.ln(s.kind);iW.Wt.Dt(e,t)}}return this.$n(n)}Mn(e,t,r){return this.xn(e,t,r.position)}$n(e){let t=[];for(let r=0;r<e.length;++r)t[r]=e[r].un();return t}Un(e,t,r){let n=[...e],i=[];for(let e of r.arrayValue.values||[])for(let r of n){let n=new iJ;n.seed(r.un()),iW.Wt.Dt(e,n.ln(t.kind)),i.push(n)}return i}qn(e,t){return!!e.filters.find(e=>e instanceof rA&&e.field.isEqual(t)&&("in"===e.op||"not-in"===e.op))}getFieldIndexes(e,t){let r=tk(e,ta),n=tk(e,tu);return(t?r.J(tl,IDBKeyRange.bound(t,t)):r.J()).next(e=>{let t=[];return ev.forEach(e,e=>n.get([e.indexId,this.uid]).next(r=>{t.push(function(e,t){let r=t?new ec(t.sequenceNumber,new ef(iM(t.readTime),new $(eV(t.documentKey)),t.largestBatchId)):ec.empty(),n=e.fields.map(([e,t])=>new eu(W.fromServerFormat(e),t));return new es(e.indexId,e.collectionGroup,n,r)}(e,r))})).next(()=>t)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(e=>0===e.length?null:(e.sort((e,t)=>{let r=e.indexState.sequenceNumber-t.indexState.sequenceNumber;return 0!==r?r:V(e.collectionGroup,t.collectionGroup)}),e[0].collectionGroup))}updateCollectionGroup(e,t,r){let n=tk(e,ta),i=tk(e,tu);return this.Wn(e).next(e=>n.J(tl,IDBKeyRange.bound(t,t)).next(t=>ev.forEach(t,t=>i.put(iH(t.indexId,this.uid,e,r)))))}updateIndexEntries(e,t){let r=new Map;return ev.forEach(t,(t,n)=>{let i=r.get(t.collectionGroup);return(i?ev.resolve(i):this.getFieldIndexes(e,t.collectionGroup)).next(i=>(r.set(t.collectionGroup,i),ev.forEach(i,r=>this.Qn(e,t,r).next(t=>{let i=this.Gn(n,r);return t.isEqual(i)?ev.resolve():this.zn(e,n,r,t,i)}))))})}jn(e,t,r,n){return tk(e,tf).put(n.Rn(this.uid,this.Kn(r,t.key),t.key))}Jn(e,t,r,n){return tk(e,tf).delete(n.An(this.uid,this.Kn(r,t.key),t.key))}Qn(e,t,r){let n=tk(e,tf),i=new tV(iZ);return n.ee({index:tm,range:IDBKeyRange.only([r.indexId,this.uid,i1(this.Kn(r,t))])},(e,n)=>{i=i.add(new iX(r.indexId,t,i2(n.arrayValue),i2(n.directionalValue)))}).next(()=>i)}Gn(e,t){let r=new tV(iZ),n=this.kn(t,e);if(null==n)return r;let i=eo(t);if(null!=i){let s=e.data.field(i.fieldPath);if(ru(s))for(let i of s.arrayValue.values||[])r=r.add(new iX(t.indexId,e.key,this.Nn(i),n))}else r=r.add(new iX(t.indexId,e.key,sn,n));return r}zn(e,t,r,n,i){v(sr,"Updating index entries for document '%s'",t.key);let s=[];return function(e,t,r,n,i){let s=e.getIterator(),o=t.getIterator(),a=tB(s),l=tB(o);for(;a||l;){let e=!1,t=!1;if(a&&l){let n=r(a,l);n<0?t=!0:n>0&&(e=!0)}else null!=a?t=!0:e=!0;e?(n(l),l=tB(o)):t?(i(a),a=tB(s)):(a=tB(s),l=tB(o))}}(n,i,iZ,n=>{s.push(this.jn(e,t,r,n))},n=>{s.push(this.Jn(e,t,r,n))}
4),ev.waitFor(s)}Wn(e){let t=1;return tk(e,tu).ee({index:th,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(e,r,n)=>{n.done(),t=r.sequenceNumber+1}).next(()=>t)}createRange(e,t,r){r=r.sort((e,t)=>iZ(e,t)).filter((e,t,r)=>!t||0!==iZ(e,r[t-1]));let n=[];for(let i of(n.push(e),r)){let r=iZ(i,e),s=iZ(i,t);if(0===r)n[0]=e.En();else if(r>0&&s<0)n.push(i),n.push(i.En());else if(s>0)break}n.push(t);let i=[];for(let e=0;e<n.length;e+=2){if(this.Hn(n[e],n[e+1]))return[];let t=n[e].An(this.uid,sn,$.empty()),r=n[e+1].An(this.uid,sn,$.empty());i.push(IDBKeyRange.bound(t,r))}return i}Hn(e,t){return iZ(e,t)>0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(ss)}getMinOffset(e,t){return ev.mapArray(this.vn(t),t=>this.Fn(e,t).next(e=>e||E(44426))).next(ss)}}function ss(e){T(0!==e.length,28825);let t=e[0].indexState.offset,r=t.largestBatchId;for(let n=1;n<e.length;n++){let i=e[n].indexState.offset;0>ep(i,t)&&(t=i),r<i.largestBatchId&&(r=i.largestBatchId)}return new ef(t.readTime,t.documentKey,r)}let so={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class sa{static withCacheSize(e){return new sa(e,sa.DEFAULT_COLLECTION_PERCENTILE,sa.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=r}}function sl(e,t,r){let n=e.store(ez),i=e.store(eK),s=[],o=IDBKeyRange.only(r.batchId),a=0,l=n.ee({range:o},(e,t,r)=>(a++,r.delete()));s.push(l.next(()=>{T(1===a,47070,{batchId:r.batchId})}));let u=[];for(let e of r.mutations){var c,h;let n=(c=e.key.path,h=r.batchId,[t,eF(c),h]);s.push(i.delete(n)),u.push(e.key)}return ev.waitFor(s).next(()=>u)}function su(e){let t;if(!e)return 0;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw E(14731);t=e.noDocument}return JSON.stringify(t).length}sa.DEFAULT_COLLECTION_PERCENTILE=10,sa.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,sa.DEFAULT=new sa(41943040,sa.DEFAULT_COLLECTION_PERCENTILE,sa.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),sa.DISABLED=new sa(-1,0,0);class sc{constructor(e,t,r,n){this.userId=e,this.serializer=t,this.indexManager=r,this.referenceDelegate=n,this.Zn={}}static wt(e,t,r,n){return T(""!==e.uid,64387),new sc(e.isAuthenticated()?e.uid:"",t,r,n)}checkEmpty(e){let t=!0,r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return sd(e).ee({index:eG,range:r},(e,r,n)=>{t=!1,n.done()}).next(()=>t)}addMutationBatch(e,t,r,n){let i=tk(e,eK),s=sd(e);return s.add({}).next(o=>{T("number"==typeof o,49019);let a=new nU(o,t,r,n),l=function(e,t,r){let n=r.baseMutations.map(t=>ib(e.yt,t)),i=r.mutations.map(t=>ib(e.yt,t));return{userId:t,batchId:r.batchId,localWriteTimeMs:r.localWriteTime.toMillis(),baseMutations:n,mutations:i}}(this.serializer,this.userId,a),u=[],c=new tV((e,t)=>V(e.canonicalString(),t.canonicalString()));for(let e of n){let t=[this.userId,eF(e.key.path),o];c=c.add(e.key.path.popLast()),u.push(s.put(l)),u.push(i.put(t,e$))}return c.forEach(t=>{u.push(this.indexManager.addToCollectionParentIndex(e,t))}),e.addOnCommittedListener(()=>{this.Zn[o]=a.keys()}),ev.waitFor(u).next(()=>a)})}lookupMutationBatch(e,t){return sd(e).get(t).next(e=>e?(T(e.userId===this.userId,48,"Unexpected user for mutation batch",{userId:e.userId,batchId:t}),iL(this.serializer,e)):null)}Xn(e,t){return this.Zn[t]?ev.resolve(this.Zn[t]):this.lookupMutationBatch(e,t).next(e=>{if(e){let r=e.keys();return this.Zn[t]=r,r}return null})}getNextMutationBatchAfterBatchId(e,t){let r=t+1,n=IDBKeyRange.lowerBound([this.userId,r]),i=null;return sd(e).ee({index:eG,range:n},(e,t,n)=>{t.userId===this.userId&&(T(t.batchId>=r,47524,{Yn:r}),i=iL(this.serializer,t)),n.done()}).next(()=>i)}getHighestUnacknowledgedBatchId(e){let t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),r=-1;return sd(e).ee({index:eG,range:t,reverse:!0},(e,t,n)=>{r=t.batchId,n.done()}).next(()=>r)}getAllMutationBatches(e){let t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return sd(e).J(eG,t).next(e=>e.map(e=>iL(this.serializer,e)))}getAllMutationBatchesAffectingDocumentKey(e,t){let r=[this.userId,eF(t.path)],n=IDBKeyRange.lowerBound(r),i=[];return tk(e,eK).ee({range:n},(r,n,s)=>{let[o,a,l]=r,u=eV(a);if(o===this.userId&&t.path.isEqual(u))return sd(e).get(l).next(e=>{if(!e)throw E(61480,{er:r,batchId:l});T(e.userId===this.userId,10503,"Unexpected user for mutation batch",{userId:e.userId,batchId:l}),i.push(iL(this.serializer,e))});s.done()}).next(()=>i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new tV(V),n=[];return t.forEach(t=>{let i=[this.userId,eF(t.path)],s=IDBKeyRange.lowerBound(i),o=tk(e,eK).ee({range:s},(e,n,i)=>{let[s,o,a]=e,l=eV(o);s===this.userId&&t.path.isEqual(l)?r=r.add(a):i.done()});n.push(o)}
4),ev.waitFor(n).next(()=>this.tr(e,r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,n=r.length+1,i=[this.userId,eF(r)],s=IDBKeyRange.lowerBound(i),o=new tV(V);return tk(e,eK).ee({range:s},(e,t,i)=>{let[s,a,l]=e,u=eV(a);s===this.userId&&r.isPrefixOf(u)?u.length===n&&(o=o.add(l)):i.done()}).next(()=>this.tr(e,o))}tr(e,t){let r=[],n=[];return t.forEach(t=>{n.push(sd(e).get(t).next(e=>{if(null===e)throw E(35274,{batchId:t});T(e.userId===this.userId,9748,"Unexpected user for mutation batch",{userId:e.userId,batchId:t}),r.push(iL(this.serializer,e))}))}),ev.waitFor(n).next(()=>r)}removeMutationBatch(e,t){return sl(e.le,this.userId,t).next(r=>(e.addOnCommittedListener(()=>{this.nr(t.batchId)}),ev.forEach(r,t=>this.referenceDelegate.markPotentiallyOrphaned(e,t))))}nr(e){delete this.Zn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(t=>{if(!t)return ev.resolve();let r=IDBKeyRange.lowerBound([this.userId]),n=[];return tk(e,eK).ee({range:r},(e,t,r)=>{if(e[0]===this.userId){let t=eV(e[1]);n.push(t)}else r.done()}).next(()=>{T(0===n.length,56720,{rr:n.map(e=>e.canonicalString())})})})}containsKey(e,t){return sh(e,this.userId,t)}ir(e){return tk(e,eH).get(this.userId).next(e=>e||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""})}}function sh(e,t,r){let n=[t,eF(r.path)],i=n[1],s=IDBKeyRange.lowerBound(n),o=!1;return tk(e,eK).ee({range:s,Y:!0},(e,r,n)=>{let[s,a,l]=e;s===t&&a===i&&(o=!0),n.done()}).next(()=>o)}function sd(e){return tk(e,ez)}class sf{constructor(e){this.sr=e}next(){return this.sr+=2,this.sr}static _r(){return new sf(0)}static ar(){return new sf(-1)}}class sp{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.ur(e).next(t=>{let r=new sf(t.highestTargetId);return t.highestTargetId=r.next(),this.cr(e,t).next(()=>t.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.ur(e).next(e=>ei.fromTimestamp(new en(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.ur(e).next(e=>e.highestListenSequenceNumber)}setTargetsMetadata(e,t,r){return this.ur(e).next(n=>(n.highestListenSequenceNumber=t,r&&(n.lastRemoteSnapshotVersion=r.toTimestamp()),t>n.highestListenSequenceNumber&&(n.highestListenSequenceNumber=t),this.cr(e,n)))}addTargetData(e,t){return this.lr(e,t).next(()=>this.ur(e).next(r=>(r.targetCount+=1,this.hr(t,r),this.cr(e,r))))}updateTargetData(e,t){return this.lr(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next(()=>tk(e,e4).delete(t.targetId)).next(()=>this.ur(e)).next(t=>(T(t.targetCount>0,8065),t.targetCount-=1,this.cr(e,t)))}removeTargets(e,t,r){let n=0,i=[];return tk(e,e4).ee((s,o)=>{let a=iF(o);a.sequenceNumber<=t&&null===r.get(a.targetId)&&(n++,i.push(this.removeTargetData(e,a)))}).next(()=>ev.waitFor(i)).next(()=>n)}forEachTarget(e,t){return tk(e,e4).ee((e,r)=>{t(iF(r))})}ur(e){return tk(e,tt).get(te).next(e=>(T(null!==e,2888),e))}cr(e,t){return tk(e,tt).put(te,t)}lr(e,t){return tk(e,e4).put(iV(this.serializer,t))}hr(e,t){let r=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,r=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.ur(e).next(e=>e.targetCount)}getTargetData(e,t){let r=rz(t),n=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),i=null;return tk(e,e4).ee({range:n,index:e6},(e,r,n)=>{let s=iF(r);rq(t,s.target)&&(i=s,n.done())}).next(()=>i)}addMatchingKeys(e,t,r){let n=[],i=sm(e);return t.forEach(t=>{let s=eF(t.path);n.push(i.put({targetId:r,path:s})),n.push(this.referenceDelegate.addReference(e,r,t))}),ev.waitFor(n)}removeMatchingKeys(e,t,r){let n=sm(e);return ev.forEach(t,t=>{let i=eF(t.path);return ev.waitFor([n.delete([r,i]),this.referenceDelegate.removeReference(e,r,t)])})}removeMatchingKeysForTargetId(e,t){let r=sm(e),n=IDBKeyRange.bound([t],[t+1],!1,!0);return r.delete(n)}getMatchingKeysForTargetId(e,t){let r=IDBKeyRange.bound([t],[t+1],!1,!0),n=sm(e),i=nu();return n.ee({range:r,Y:!0},(e,t,r)=>{let n=new $(eV(e[1]));i=i.add(n)}).next(()=>i)}containsKey(e,t){let r=eF(t.path),n=IDBKeyRange.bound([r],[r+"\0"],!1,!0),i=0;return sm(e).ee({index:e9,Y:!0,range:n},([e,t],r,n)=>{0!==e&&(i++,n.done())}).next(()=>i>0)}At(e,t){return tk(e,e4).get(t).next(e=>e?iF(e):null)}}function sm(e){return tk(e,e3)}let sg="LruGarbageCollector";function sy([e,t],[r,n]){let i=V(e,r);return 0===i?V(t,n):i}class sv{constructor(e){this.Pr=e,this.buffer=new tV(sy),this.Tr=0}Ir(){return++this.Tr}Er(e){let t=[e,this.Ir()];if(this.buffer.size<this.Pr)this.buffer=this.buffer.add(t);else{let e=this.buffer.last();0>sy(t,e)&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class sw{constructor(e,t,r){this.garbageCollector=e,this.asyncQueue=t,this.localStore=r,this.Rr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.Ar(6e4)}stop(){this.Rr&&(this.Rr.cancel(),this.Rr=null)}get started(){return null!==this.Rr}Ar(e){v(sg,`Garbage collection scheduled in ${e}ms`),this.Rr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){eS(e)?v(sg,"Ignoring IndexedDB error during garbage collection: ",e):await ey(e)}await this.Ar(3e5)})}}class sb{constructor(e,t){this.Vr=e,this.params=t}calculateTargetCount(e,t){return this.Vr.dr(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return ev.resolve(eN.ce);let r=new sv(t);return this.Vr.forEachTarget(e,e=>r.Er(e.sequenceNumber)).next(()=>this.Vr.mr(e,e=>r.Er(e))).next(()=>r.maxValue)}removeTargets(e,t,r){return this.Vr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.Vr.removeOrphanedDocuments(e,t)}collect(e,t){return -1===this.params.cacheSizeCollectionThreshold?(v("LruGarbageCollector","Garbage collection skipped; disabled"),ev.resolve(so)):this.getCacheSize(e).next(r=>r<this.params.cacheSizeCollectionThreshold?(v("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),so):this.gr(e,t))}getCacheSize(e){return this.Vr.getCacheSize(e)}gr(e,t){let r,n,i,s,o,a,l;let u=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(v("LruGarbageCollector",`C
4apping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),n=this.params.maximumSequenceNumbersToCollect):n=t,s=Date.now(),this.nthSequenceNumber(e,n))).next(n=>(r=n,o=Date.now(),this.removeTargets(e,r,t))).next(t=>(i=t,a=Date.now(),this.removeOrphanedDocuments(e,r))).next(e=>(l=Date.now(),y()<=d.LogLevel.DEBUG&&v("LruGarbageCollector",`LRU Garbage Collection
5	Counted targets in ${s-u}ms
6	Determined least recently used ${n} in `+(o-s)+"ms\n"+`	Removed ${i} targets in `+(a-o)+"ms\n"+`	Removed ${e} documents in `+(l-a)+"ms\n"+`Total Duration: ${l-u}ms`),ev.resolve({didRun:!0,sequenceNumbersCollected:n,targetsRemoved:i,documentsRemoved:e})))}}class s_{constructor(e,t){this.db=e,this.garbageCollector=new sb(this,t)}dr(e){let t=this.pr(e);return this.db.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}pr(e){let t=0;return this.mr(e,e=>{t++}).next(()=>t)}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}mr(e,t){return this.yr(e,(e,r)=>t(r))}addReference(e,t,r){return sE(e,r)}removeReference(e,t,r){return sE(e,r)}removeTargets(e,t,r){return this.db.getTargetCache().removeTargets(e,t,r)}markPotentiallyOrphaned(e,t){return sE(e,t)}wr(e,t){let r;return r=!1,tk(e,eH).te(n=>sh(e,n,t).next(e=>(e&&(r=!0),ev.resolve(!e)))).next(()=>r)}removeOrphanedDocuments(e,t){let r=this.db.getRemoteDocumentCache().newChangeBuffer(),n=[],i=0;return this.yr(e,(s,o)=>{if(o<=t){let t=this.wr(e,s).next(t=>{if(!t)return i++,r.getEntry(e,s).next(()=>(r.removeEntry(s,ei.min()),sm(e).delete([0,eF(s.path)])))});n.push(t)}}).next(()=>ev.waitFor(n)).next(()=>r.apply(e)).next(()=>i)}removeTarget(e,t){let r=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,t){return sE(e,t)}yr(e,t){let r=sm(e),n,i=eN.ce;return r.ee({index:e9},([e,r],{path:s,sequenceNumber:o})=>{0===e?(i!==eN.ce&&t(new $(eV(n)),i),i=o,n=s):i=eN.ce}).next(()=>{i!==eN.ce&&t(new $(eV(n)),i)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function sE(e,t){var r;return sm(e).put((r=e.currentSequenceNumber,{targetId:0,path:eF(t.path),sequenceNumber:r}))}class sI{constructor(){this.changes=new nt(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,rb.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let r=this.changes.get(t);return void 0!==r?ev.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 sT{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,r){return tk(e,eQ).put(r)}removeEntry(e,t,r){return tk(e,eQ).delete(function(e,t){let r=e.path.toArray();return[r.slice(0,r.length-2),r[r.length-2],iN(t),r[r.length-1]]}(t,r))}updateMetadata(e,t){return this.getMetadata(e).next(r=>(r.byteSize+=t,this.Sr(e,r)))}getEntry(e,t){let r=rb.newInvalidDocument(t);return tk(e,eQ).ee({index:eJ,range:IDBKeyRange.only(sA(t))},(e,n)=>{r=this.br(t,n)}).next(()=>r)}Dr(e,t){let r={size:0,document:rb.newInvalidDocument(t)};return tk(e,eQ).ee({index:eJ,range:IDBKeyRange.only(sA(t))},(e,n)=>{r={document:this.br(t,n),size:su(n)}}).next(()=>r)}getEntries(e,t){let r=nr;return this.Cr(e,t,(e,t)=>{let n=this.br(e,t);r=r.insert(e,n)}).next(()=>r)}vr(e,t){let r=nr,n=new tM($.comparator);return this.Cr(e,t,(e,t)=>{let i=this.br(e,t);r=r.insert(e,i),n=n.insert(e,su(t))}).next(()=>({documents:r,Fr:n}))}Cr(e,t,r){if(t.isEmpty())return ev.resolve();let n=new tV(sP);t.forEach(e=>n=n.add(e));let i=IDBKeyRange.bound(sA(n.first()),sA(n.last())),s=n.getIterator(),o=s.getNext();return tk(e,eQ).ee({index:eJ,range:i},(e,t,n)=>{let i=$.fromSegments([...t.prefixPath,t.collectionGroup,t.documentId]);for(;o&&0>sP(o,i);)r(o,null),o=s.getNext();o&&o.isEqual(i)&&(r(o,t),o=s.hasNext()?s.getNext():null),o?n.j(sA(o)):n.done()}).next(()=>{for(;o;)r(o,null),o=s.hasNext()?s.getNext():null})}getDocumentsMatchingQuery(e,t,r,n,i){let s=t.path,o=[s.popLast().toArray(),s.lastSegment(),iN(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],a=[s.popLast().toArray(),s.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return tk(e,eQ).J(IDBKeyRange.bound(o,a,!0)).next(e=>{i?.incrementDocumentReadCount(e.length);let r=nr;for(let i of e){let e=this.br($.fromSegments(i.prefixPath.concat(i.collectionGroup,i.documentId)),i);
6e.isFoundDocument()&&(r9(t,e)||n.has(e.key))&&(r=r.insert(e.key,e))}return r})}getAllFromCollectionGroup(e,t,r,n){let i=nr,s=sC(t,r),o=sC(t,ef.max());return tk(e,eQ).ee({index:eZ,range:IDBKeyRange.bound(s,o,!0)},(e,t,r)=>{let s=this.br($.fromSegments(t.prefixPath.concat(t.collectionGroup,t.documentId)),t);(i=i.insert(s.key,s)).size===n&&r.done()}).next(()=>i)}newChangeBuffer(e){return new sS(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(e=>e.byteSize)}getMetadata(e){return tk(e,e1).get(e2).next(e=>(T(!!e,20021),e))}Sr(e,t){return tk(e,e1).put(e2,t)}br(e,t){if(t){let e=function(e,t){let r;if(t.document)r=iw(e.yt,t.document,!!t.hasCommittedMutations);else if(t.noDocument){let e=$.fromSegments(t.noDocument.path),n=iM(t.noDocument.readTime);r=rb.newNoDocument(e,n),t.hasCommittedMutations&&r.setHasCommittedMutations()}else{if(!t.unknownDocument)return E(56709);{let e=$.fromSegments(t.unknownDocument.path),n=iM(t.unknownDocument.version);r=rb.newUnknownDocument(e,n)}}return t.readTime&&r.setReadTime(function(e){let t=new en(e[0],e[1]);return ei.fromTimestamp(t)}(t.readTime)),r}(this.serializer,t);if(!(e.isNoDocument()&&e.version.isEqual(ei.min())))return e}return rb.newInvalidDocument(e)}}class sS extends sI{constructor(e,t){super(),this.Mr=e,this.trackRemovals=t,this.Or=new nt(e=>e.toString(),(e,t)=>e.isEqual(t))}applyChanges(e){let t=[],r=0,n=new tV((e,t)=>V(e.canonicalString(),t.canonicalString()));
6return this.changes.forEach((i,s)=>{let o=this.Or.get(i);if(t.push(this.Mr.removeEntry(e,i,o.readTime)),s.isValidDocument()){let a=iD(this.Mr.serializer,s);n=n.add(i.path.popLast());let l=su(a);r+=l-o.size,t.push(this.Mr.addEntry(e,i,a))}else if(r-=o.size,this.trackRemovals){let r=iD(this.Mr.serializer,s.convertToNoDocument(ei.min()));t.push(this.Mr.addEntry(e,i,r))}}),n.forEach(r=>{t.push(this.Mr.indexManager.addToCollectionParentIndex(e,r))}),t.push(this.Mr.updateMetadata(e,r)),ev.waitFor(t)}getFromCache(e,t){return this.Mr.Dr(e,t).next(e=>(this.Or.set(t,{size:e.size,readTime:e.document.readTime}),e.document))}getAllFromCache(e,t){return this.Mr.vr(e,t).next(({documents:e,Fr:t})=>(t.forEach((t,r)=>{this.Or.set(t,{size:r,readTime:e.get(t).readTime})}),e))}}function sA(e){let t=e.path.toArray();return[t.slice(0,t.length-2),t[t.length-2],t[t.length-1]]}function sC(e,t){let r=t.documentKey.path.toArray();return[e,iN(t.readTime),r.slice(0,r.length-2),r.length>0?r[r.length-1]:""]}function sP(e,t){let r=e.path.toArray(),n=t.path.toArray(),i=0;for(let e=0;e<r.length-2&&e<n.length-2;++e)if(i=V(r[e],n[e]))return i;return(i=V(r.length,n.length))||(i=V(r[r.length-2],n[n.length-2]))||V(r[r.length-1],n[n.length-1])}class sR{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class sk{constructor(e,t,r,n){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=n}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(n=>(r=n,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==r&&nk(r.mutation,e,tj.empty(),en.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,nu()).next(()=>t))}getLocalViewOfDocuments(e,t,r=nu()){let n=no();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,r).next(e=>{let t=ni();return e.forEach((e,r)=>{t=t.insert(e,r.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){let r=no();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,nu()))}populateOverlays(e,t,r){let n=[];return r.forEach(e=>{t.has(e)||n.push(e)}),this.documentOverlayCache.getOverlays(e,n).next(e=>{e.forEach((e,r)=>{t.set(e,r)})})}computeViews(e,t,r,n){let i=nr,s=no(),o=no();return t.forEach((e,t)=>{let o=r.get(t.key);n.has(t.key)&&(void 0===o||o.mutation instanceof nN)?i=i.insert(t.key,t):void 0!==o?(s.set(t.key,o.mutation.getFieldMask()),nk(o.mutation,t,o.mutation.getFieldMask(),en.now())):s.set(t.key,tj.empty())}),this.recalculateAndSaveOverlays(e,i).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>o.set(e,new sR(t,s.get(e)??null))),o))}recalculateAndSaveOverlays(e,t){let r=no(),n=new tM((e,t)=>e-t),i=nu();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(let i of e)i.keys().forEach(e=>{let s=t.get(e);if(null===s)return;let o=r.get(e)||tj.empty();o=i.applyToLocalView(s,o),r.set(e,o);let a=(n.get(i.batchId)||nu()).add(e);n=n.insert(i.batchId,a)})}).next(()=>{let s=[],o=n.getReverseIterator();for(;o.hasNext();){let n=o.getNext(),a=n.key,l=n.value,u=no();l.forEach(e=>{if(!i.has(e)){let n=nR(t.get(e),r.get(e));null!==n&&u.set(e,n),i=i.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,a,u))}return ev.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,r,n){return rX(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):rZ(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,n):this.getDocumentsMatchingCollectionQuery(e,t,r,n)}getNextDocuments(e,t,r,n){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,n).next(i=>{let s=n-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,n-i.size):ev.resolve(no()),o=-1,a=i;return s.next(t=>ev.forEach(t,(t,r)=>(o<r.largestBatchId&&(o=r.largestBatchId),i.get(t)?ev.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{a=a.insert(t,e)}))).next(()=>this.populateOverlays(e,t,i)).next(()=>this.computeViews(e,a,t,nu())).next(e=>({batchId:o,changes:ns(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new $(t)).next(e=>{let t=ni();
vendor: 4,135 bytes, line 6
6return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,r,n){let i=t.collectionGroup,s=ni();return this.indexManager.getCollectionParents(e,i).next(o=>ev.forEach(o,o=>{let a=new rQ(o.child(i),null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt);return this.getDocumentsMatchingCollectionQuery(e,a,r,n).next(e=>{e.forEach((e,t)=>{s=s.insert(e,t)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,r,n){let i;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(s=>(i=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,i,n))).next(e=>{i.forEach((t,r)=>{let n=r.getKey();null===e.get(n)&&(e=e.insert(n,rb.newInvalidDocument(n)))});let r=ni();return e.forEach((e,n)=>{let s=i.get(e);void 0!==s&&nk(s.mutation,n,tj.empty(),en.now()),r9(t,n)&&(r=r.insert(e,n))}),r})}}class sx{constructor(e){this.serializer=e,this.Nr=new Map,this.Br=new Map}getBundleMetadata(e,t){return ev.resolve(this.Nr.get(t))}saveBundleMetadata(e,t){return this.Nr.set(t.id,{id:t.id,version:t.version,createTime:io(t.createTime)}),ev.resolve()}getNamedQuery(e,t){return ev.resolve(this.Br.get(t))}saveNamedQuery(e,t){return this.Br.set(t.name,{name:t.name,query:iU(t.bundledQuery),readTime:io(t.readTime)}),ev.resolve()}}class sD{constructor(){this.overlays=new tM($.comparator),this.Lr=new Map}getOverlay(e,t){return ev.resolve(this.overlays.get(t))}getOverlays(e,t){let r=no();return ev.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,n)=>{this.St(e,t,n)}),ev.resolve()}removeOverlaysForBatchId(e,t,r){let n=this.Lr.get(r);return void 0!==n&&(n.forEach(e=>this.overlays=this.overlays.remove(e)),this.Lr.delete(r)),ev.resolve()}getOverlaysForCollection(e,t,r){let n=no(),i=t.length+1,s=new $(t.child("")),o=this.overlays.getIteratorFrom(s);for(;o.hasNext();){let e=o.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===i&&e.largestBatchId>r&&n.set(e.getKey(),e)}return ev.resolve(n)}getOverlaysForCollectionGroup(e,t,r,n){let i=new tM((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=i.get(e.largestBatchId);null===t&&(t=no(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}let o=no(),a=i.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach((e,t)=>o.set(e,t)),!(o.size()>=n)););return ev.resolve(o)}St(e,t,r){let n=this.overlays.get(r.key);if(null!==n){let e=this.Lr.get(n.largestBatchId).delete(r.key);this.Lr.set(n.largestBatchId,e)}this.overlays=this.overlays.insert(r.key,new nj(t,r));let i=this.Lr.get(t);void 0===i&&(i=nu(),this.Lr.set(t,i)),this.Lr.set(t,i.add(r.key))}}class sN{constructor(){this.sessionToken=tz.EMPTY_BYTE_STRING}getSessionToken(e){return ev.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,ev.resolve()}}class sO{constructor(){this.kr=new tV(sM.Kr),this.qr=new tV(sM.Ur)}isEmpty(){return this.kr.isEmpty()}addReference(e,t){let r=new sM(e,t);this.kr=this.kr.add(r),this.qr=this.qr.add(r)}$r(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Wr(new sM(e,t))}Qr(e,t){e.forEach(e=>this.removeReference(e,t))}Gr(e){let t=new $(new q([])),r=new sM(t,e),n=new sM(t,e+1),i=[];return this.qr.forEachInRange([r,n],e=>{this.Wr(e),i.push(e.key)}),i}zr(){this.kr.forEach(e=>this.Wr(e))}Wr(e){this.kr=this.kr.delete(e),this.qr=this.qr.delete(e)}jr(e){let t=new $(new q([])),r=new sM(t,e),n=new sM(t,e+1),i=nu();return this.qr.forEachInRange([r,n],e=>{i=i.add(e.key)}),i}containsKey(e){let t=new sM(e,0),r=this.kr.firstAfterOrEqual(t);return null!==r&&e.isEqual(r.key)}}class sM{constructor(e,t){this.key=e,this.Jr=t}static Kr(e,t){return $.comparator(e.key,t.key)||V(e.Jr,t.Jr)}static Ur(e,t){return V(e.Jr,t.Jr)||$.comparator(e.key,t.key)}}class sL{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Yn=1,this.Hr=new tV(sM.Kr)}checkEmpty(e){return ev.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,r,n){let i=this.Yn;
6this.Yn++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let s=new nU(i,t,r,n);for(let t of(this.mutationQueue.push(s),n))this.Hr=this.Hr.add(new sM(t.key,i)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return ev.resolve(s)}lookupMutationBatch(e,t){return ev.resolve(this.Zr(t))}getNextMutationBatchAfterBatchId(e,t){let r=this.Xr(t+1),n=r<0?0:r;return ev.resolve(this.mutationQueue.length>n?this.mutationQueue[n]:null)}getHighestUnacknowledgedBatchId(){return ev.resolve(0===this.mutationQueue.length?-1:this.Yn-1)}getAllMutationBatches(e){return ev.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let r=new sM(t,0),n=new sM(t,Number.POSITIVE_INFINITY),i=[];return this.Hr.forEachInRange([r,n],e=>{let t=this.Zr(e.Jr);i.push(t)}),ev.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new tV(V);return t.forEach(e=>{let t=new sM(e,0),n=new sM(e,Number.POSITIVE_INFINITY);this.Hr.forEachInRange([t,n],e=>{r=r.add(e.Jr)})}),ev.resolve(this.Yr(r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,n=r.length+1,i=r;$.isDocumentKey(i)||(i=i.child(""));let s=new sM(new $(i),0),o=new tV(V);return this.Hr.forEachWhile(e=>{let t=e.key.path;return!!r.isPrefixOf(t)&&(t.length===n&&(o=o.add(e.Jr)),!0)},s),ev.resolve(this.Yr(o))}Yr(e){let t=[];return e.forEach(e=>{let r=this.Zr(e);null!==r&&t.push(r)}),t}removeMutationBatch(e,t){T(0===this.ei(t.batchId,"removed"),55003),this.mutationQueue.shift();let r=this.Hr;return ev.forEach(t.mutations,n=>{let i=new sM(n.key,t.batchId);return r=r.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,n.key)}).next(()=>{this.Hr=r})}nr(e){}containsKey(e,t){let r=new sM(t,0),n=this.Hr.firstAfterOrEqual(r);return ev.resolve(t.isEqual(n&&n.key))}performConsistencyCheck(e){return this.mutationQueue.length,ev.resolve()}ei(e,t){return this.Xr(e)}Xr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Zr(e){let t=this.Xr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class sF{constructor(e){this.ti=e,this.docs=new tM($.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let r=t.key,n=this.docs.get(r),i=n?n.size:0,s=this.ti(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:s}),this.size+=s-i,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 ev.resolve(r?r.document.mutableCopy():rb.newInvalidDocument(t))}getEntries(e,t){let r=nr;return t.forEach(e=>{let t=this.docs.get(e);r=r.insert(e,t?t.document.mutableCopy():rb.newInvalidDocument(e))}),ev.resolve(r)}getDocumentsMatchingQuery(e,t,r,n){let i=nr,s=t.path,o=new $(s.child("__id-9223372036854775808__")),a=this.docs.getIteratorFrom(o);for(;a.hasNext();){let{key:e,value:{document:o}}=a.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||0>=ep(ed(o),r)||(n.has(o.key)||r9(t,o))&&(i=i.insert(o.key,o.mutableCopy()))}return ev.resolve(i)}getAllFromCollectionGroup(e,t,r,n){E(9500)}ni(e,t){return ev.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new sV(this)}getSize(e){return ev.resolve(this.size)}}class sV extends sI{constructor(e){super(),this.Mr=e}applyChanges(e){let t=[];
vendor: 4,096 bytes, line 6
6return this.changes.forEach((r,n)=>{n.isValidDocument()?t.push(this.Mr.addEntry(e,n)):this.Mr.removeEntry(r)}),ev.waitFor(t)}getFromCache(e,t){return this.Mr.getEntry(e,t)}getAllFromCache(e,t){return this.Mr.getEntries(e,t)}}class sU{constructor(e){this.persistence=e,this.ri=new nt(e=>rz(e),rq),this.lastRemoteSnapshotVersion=ei.min(),this.highestTargetId=0,this.ii=0,this.si=new sO,this.targetCount=0,this.oi=sf._r()}forEachTarget(e,t){return this.ri.forEach((e,r)=>t(r)),ev.resolve()}getLastRemoteSnapshotVersion(e){return ev.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ev.resolve(this.ii)}allocateTargetId(e){return this.highestTargetId=this.oi.next(),ev.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.ii&&(this.ii=t),ev.resolve()}lr(e){this.ri.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.oi=new sf(t),this.highestTargetId=t),e.sequenceNumber>this.ii&&(this.ii=e.sequenceNumber)}addTargetData(e,t){return this.lr(t),this.targetCount+=1,ev.resolve()}updateTargetData(e,t){return this.lr(t),ev.resolve()}removeTargetData(e,t){return this.ri.delete(t.target),this.si.Gr(t.targetId),this.targetCount-=1,ev.resolve()}removeTargets(e,t,r){let n=0,i=[];return this.ri.forEach((s,o)=>{o.sequenceNumber<=t&&null===r.get(o.targetId)&&(this.ri.delete(s),i.push(this.removeMatchingKeysForTargetId(e,o.targetId)),n++)}),ev.waitFor(i).next(()=>n)}getTargetCount(e){return ev.resolve(this.targetCount)}getTargetData(e,t){let r=this.ri.get(t)||null;return ev.resolve(r)}addMatchingKeys(e,t,r){return this.si.$r(t,r),ev.resolve()}removeMatchingKeys(e,t,r){this.si.Qr(t,r);let n=this.persistence.referenceDelegate,i=[];return n&&t.forEach(t=>{i.push(n.markPotentiallyOrphaned(e,t))}),ev.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.si.Gr(t),ev.resolve()}getMatchingKeysForTargetId(e,t){let r=this.si.jr(t);return ev.resolve(r)}containsKey(e,t){return ev.resolve(this.si.containsKey(t))}}class sB{constructor(e,t){this._i={},this.overlays={},this.ai=new eN(0),this.ui=!1,this.ui=!0,this.ci=new sN,this.referenceDelegate=e(this),this.li=new sU(this),this.indexManager=new se,this.remoteDocumentCache=new sF(e=>this.referenceDelegate.hi(e)),this.serializer=new ix(t),this.Pi=new sx(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ui=!1,Promise.resolve()}get started(){return this.ui}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new sD,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this._i[e.toKey()];return r||(r=new sL(t,this.referenceDelegate),this._i[e.toKey()]=r),r}getGlobalsCache(){return this.ci}getTargetCache(){return this.li}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Pi}runTransaction(e,t,r){v("MemoryPersistence","Starting transaction:",e);let n=new sj(this.ai.next());return this.referenceDelegate.Ti(),r(n).next(e=>this.referenceDelegate.Ii(n).next(()=>e)).toPromise().then(e=>(n.raiseOnCommittedEvent(),e))}Ei(e,t){return ev.or(Object.values(this._i).map(r=>()=>r.containsKey(e,t)))}}class sj extends eg{constructor(e){super(),this.currentSequenceNumber=e}}class sH{constructor(e){this.persistence=e,this.Ri=new sO,this.Ai=null}static Vi(e){return new sH(e)}get di(){if(this.Ai)return this.Ai;throw E(60996)}addReference(e,t,r){return this.Ri.addReference(r,t),this.di.delete(r.toString()),ev.resolve()}removeReference(e,t,r){return this.Ri.removeReference(r,t),this.di.add(r.toString()),ev.resolve()}markPotentiallyOrphaned(e,t){return this.di.add(t.toString()),ev.resolve()}removeTarget(e,t){this.Ri.Gr(t.targetId).forEach(e=>this.di.add(e.toString()));let r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.di.add(e.toString()))}).next(()=>r.removeTargetData(e,t))}Ti(){this.Ai=new Set}Ii(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ev.forEach(this.di,r=>{let n=$.fromPath(r);
6return this.mi(e,n).next(e=>{e||t.removeEntry(n,ei.min())})}).next(()=>(this.Ai=null,t.apply(e)))}updateLimboDocument(e,t){return this.mi(e,t).next(e=>{e?this.di.delete(t.toString()):this.di.add(t.toString())})}hi(e){return 0}mi(e,t){return ev.or([()=>ev.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ei(e,t)])}}class sz{constructor(e,t){this.persistence=e,this.fi=new nt(e=>eF(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=new sb(this,t)}static Vi(e,t){return new sz(e,t)}Ti(){}Ii(e){return ev.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}dr(e){let t=this.pr(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}pr(e){let t=0;return this.mr(e,e=>{t++}).next(()=>t)}mr(e,t){return ev.forEach(this.fi,(r,n)=>this.wr(e,r,n).next(e=>e?ev.resolve():t(n)))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0,n=this.persistence.getRemoteDocumentCache(),i=n.newChangeBuffer();return n.ni(e,n=>this.wr(e,n,t).next(e=>{e||(r++,i.removeEntry(n,ei.min()))})).next(()=>i.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,t){return this.fi.set(t,e.currentSequenceNumber),ev.resolve()}removeTarget(e,t){let r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.fi.set(r,e.currentSequenceNumber),ev.resolve()}removeReference(e,t,r){return this.fi.set(r,e.currentSequenceNumber),ev.resolve()}updateLimboDocument(e,t){return this.fi.set(t,e.currentSequenceNumber),ev.resolve()}hi(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=function e(t){switch(re(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:let r=tZ(t);return r?16+e(r):16;case 5:return 2*t.stringValue.length;case 6:return t$(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return(t.arrayValue.values||[]).reduce((t,r)=>t+e(r),0);case 10:case 11:var n;let i;return n=t.mapValue,i=0,tD(n.fields,(t,r)=>{i+=t.length+e(r)}),i;default:throw E(13486,{value:t})}}(e.data.value)),t}wr(e,t,r){return ev.or([()=>this.persistence.Ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{let e=this.fi.get(t);return ev.resolve(void 0!==e&&e>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class sq{constructor(e){this.serializer=e}k(e,t,r,n){let i=new eb("createOrUpgrade",t);r<1&&n>=1&&(!function(e){e.createObjectStore(eB)}(e),e.createObjectStore(eH,{keyPath:"userId"}),e.createObjectStore(ez,{keyPath:eq,autoIncrement:!0}).createIndex(eG,eW,{unique:!0}),e.createObjectStore(eK),sG(e),function(e){e.createObjectStore(eU)}(e));let s=ev.resolve();return r<3&&n>=3&&(0!==r&&(e.deleteObjectStore(e3),e.deleteObjectStore(e4),e.deleteObjectStore(tt),sG(e)),s=s.next(()=>(function(e){let t=e.store(tt),r={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:ei.min().toTimestamp(),targetCount:0};return t.put(te,r)})(i))),r<4&&n>=4&&(0!==r&&(s=s.next(()=>i.store(ez).J().next(t=>{e.deleteObjectStore(ez),e.createObjectStore(ez,{keyPath:eq,autoIncrement:!0}).createIndex(eG,eW,{unique:!0});let r=i.store(ez),n=t.map(e=>r.put(e));return ev.waitFor(n)}))),s=s.next(()=>{!function(e){e.createObjectStore(ti,{keyPath:"clientId"})}(e)})),r<5&&n>=5&&(s=s.next(()=>this.gi(i))),r<6&&n>=6&&(s=s.next(()=>((function(e){e.createObjectStore(e1)})(e),this.pi(i)))),r<7&&n>=7&&(s=s.next(()=>this.yi(i))),r<8&&n>=8&&(s=s.next(()=>this.wi(e,i))),r<9&&n>=9&&(s=s.next(()=>{e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")})),r<10&&n>=10&&(s=s.next(()=>this.Si(i))),r<11&&n>=11&&(s=s.next(()=>{(function(e){e.createObjectStore(ts,{keyPath:"bundleId"})})(e),function(e){e.createObjectStore(to,{keyPath:"name"})}(e)})),r<12&&n>=12&&(s=s.next(()=>{!function(e){let t=e.createObjectStore(ty,{keyPath:tv});t.createIndex(tw,tb,{unique:!1}),t.createIndex(t_,tE,{unique:!1})}(e)})),r<13&&n>=13&&(s=s.next(()=>(function(e){let t=e.createObjectStore(eQ,{keyPath:eY});t.createIndex(eJ,eX),t.createIndex(eZ,e0)})(e)).next(()=>this.bi(e,i)).next(()=>e.deleteObjectStore(eU))),r<14&&n>=14&&(s=s.next(()=>this.Di(e,i))),r<15&&n>=15&&(s=s.next(()=>{e.createObjectStore(ta,{keyPath:"indexId",autoIncrement:!0}).createIndex(tl,"collectionGroup",{unique:!1}),e.createObjectStore(tu,{keyPath:tc}).createIndex(th,td,{unique:!1}),e.createObjectStore(tf,{keyPath:tp}).createIndex(tm,tg,{unique:!1})}
6)),r<16&&n>=16&&(s=s.next(()=>{t.objectStore(tu).clear()}).next(()=>{t.objectStore(tf).clear()})),r<17&&n>=17&&(s=s.next(()=>{!function(e){e.createObjectStore(tI,{keyPath:"name"})}(e)})),r<18&&n>=18&&c.isSafariOrWebkit()&&(s=s.next(()=>{t.objectStore(tu).clear()}).next(()=>{t.objectStore(tf).clear()})),s}pi(e){let t=0;return e.store(eU).ee((e,r)=>{t+=su(r)}).next(()=>{let r={byteSize:t};return e.store(e1).put(e2,r)})}gi(e){let t=e.store(eH),r=e.store(ez);return t.J().next(t=>ev.forEach(t,t=>{let n=IDBKeyRange.bound([t.userId,-1],[t.userId,t.lastAcknowledgedBatchId]);return r.J(eG,n).next(r=>ev.forEach(r,r=>{T(r.userId===t.userId,18650,"Cannot process batch from unexpected user",{batchId:r.batchId});let n=iL(this.serializer,r);return sl(e,t.userId,n).next(()=>{})}))}))}yi(e){let t=e.store(e3),r=e.store(eU);return e.store(tt).get(te).next(e=>{let n=[];return r.ee((r,i)=>{let s=new q(r),o=[0,eF(s)];n.push(t.get(o).next(r=>r?ev.resolve():t.put({targetId:0,path:eF(s),sequenceNumber:e.highestListenSequenceNumber})))}).next(()=>ev.waitFor(n))})}wi(e,t){e.createObjectStore(tr,{keyPath:tn});let r=t.store(tr),n=new st,i=e=>{if(n.add(e)){let t=e.lastSegment(),n=e.popLast();return r.put({collectionId:t,parent:eF(n)})}};return t.store(eU).ee({Y:!0},(e,t)=>i(new q(e).popLast())).next(()=>t.store(eK).ee({Y:!0},([e,t,r],n)=>i(eV(t).popLast())))}Si(e){let t=e.store(e4);return t.ee((e,r)=>{let n=iF(r),i=iV(this.serializer,n);return t.put(i)})}bi(e,t){let r=t.store(eU),n=[];return r.ee((e,r)=>{let i=t.store(eQ),s=(r.document?new $(q.fromString(r.document.name).popFirst(5)):r.noDocument?$.fromSegments(r.noDocument.path):r.unknownDocument?$.fromSegments(r.unknownDocument.path):E(36783)).path.toArray(),o={prefixPath:s.slice(0,s.length-2),collectionGroup:s[s.length-2],documentId:s[s.length-1],readTime:r.readTime||[0,0],unknownDocument:r.unknownDocument,noDocument:r.noDocument,document:r.document,hasCommittedMutations:!!r.hasCommittedMutations};n.push(i.put(o))}).next(()=>ev.waitFor(n))}Di(e,t){let r=t.store(ez),n=new sT(this.serializer),i=new sB(sH.Vi,this.serializer.yt);return r.J().next(e=>{let r=new Map;return e.forEach(e=>{let t=r.get(e.userId)??nu();iL(this.serializer,e).keys().forEach(e=>t=t.add(e)),r.set(e.userId,t)}),ev.forEach(r,(e,r)=>{let s=new p(r),o=iq.wt(this.serializer,s),a=i.getIndexManager(s);return new sk(n,sc.wt(s,this.serializer,a,i.referenceDelegate),o,a).recalculateAndSaveOverlaysForDocumentKeys(new tR(t,eN.ce),e).next()})})}}function sG(e){e.createObjectStore(e3,{keyPath:e5}).createIndex(e9,e7,{unique:!0}),e.createObjectStore(e4,{keyPath:"targetId"}).createIndex(e6,e8,{unique:!0}),e.createObjectStore(tt)}let sW="IndexedDbPersistence",s$="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",sK="main";class sQ{constructor(e,t,r,n,i,s,o,a,l,u,c=18){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=r,this.Ci=i,this.window=s,this.document=o,this.Fi=l,this.Mi=u,this.xi=c,this.ai=null,this.ui=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Oi=null,this.inForeground=!1,this.Ni=null,this.Bi=null,this.Li=Number.NEGATIVE_INFINITY,this.ki=e=>Promise.resolve(),!sQ.v())throw new A(S.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new s_(this,n),this.Ki=t+sK,this.serializer=new ix(a),this.qi=new e_(this.Ki,this.xi,new sq(this.serializer)),this.ci=new iG,this.li=new sp(this.referenceDelegate,this.serializer),this.remoteDocumentCache=new sT(this.serializer),this.Pi=new iz,this.window&&this.window.localStorage?this.Ui=this.window.localStorage:(this.Ui=null,!1===u&&w(sW,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.$i().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new A(S.FAILED_PRECONDITION,s$);return this.Wi(),this.Qi(),this.Gi(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.li.getHighestSequenceNumber(e))}).then(e=>{this.ai=new eN(e,this.Fi)}).then(()=>{this.ui=!0}).catch(e=>(this.qi&&this.qi.close(),Promise.reject(e)))}zi(e){return this.ki=async t=>{if(this.started)return e(t)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.qi.q(async t=>{null===t.newVersion&&await e()})}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Ci.enqueueAndForget(async()=>{this.started&&await this.$i()}))}$i(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>tk(e,ti).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.ji(e).next(e=>{e||(this.isPrimary=!1,this.Ci.enqueueRetryable(()=>this.ki(!1)))})}).next(()=>this.Ji(e)).next(t=>this.isPrimary&&!t?this.Hi(e).next(()=>!1):!!t&&this.Zi(e).next(()=>!0))).catch(e=>{if(eS(e))return v(sW,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return v(sW,"Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.Ci.enqueueRetryable(()=>this.ki(e)),this.isPrimary=e})}ji(e){return tk(e,eB).get(ej).next(e=>ev.resolve(this.Xi(e)))}Yi(e){return tk(e,ti).delete(this.clientId)}async es(){if(this.isPrimary&&!this.ts(this.Li,18e5)){this.Li=Date.now();let e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",e=>{let t=tk(e,ti);return t.J().next(e=>{let r=this.ns(e,18e5),n=e.filter(e=>-1===r.indexOf(e));return ev.forEach(n,e=>t.delete(e.clientId)).next(()=>n)})}).catch(()=>[]);if(this.Ui)for(let t of e)this.Ui.removeItem(this.rs(t.clientId))}}Gi(){this.Bi=this.Ci.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.$i().then(()=>this.es()).then(()=>this.Gi()))}Xi(e){return!!e&&e.ownerId===this.clientId}Ji(e){return this.Mi?ev.resolve(!0):tk(e,eB).get(ej).next(t=>
6{if(null!==t&&this.ts(t.leaseTimestampMs,5e3)&&!this.ss(t.ownerId)){if(this.Xi(t)&&this.networkEnabled)return!0;if(!this.Xi(t)){if(!t.allowTabSynchronization)throw new A(S.FAILED_PRECONDITION,s$);return!1}}return!(!this.networkEnabled||!this.inForeground)||tk(e,ti).J().next(e=>void 0===this.ns(e,5e3).find(e=>{if(this.clientId!==e.clientId){let t=!this.networkEnabled&&e.networkEnabled,r=!this.inForeground&&e.inForeground,n=this.networkEnabled===e.networkEnabled;if(t||r&&n)return!0}return!1}))}).next(e=>(this.isPrimary!==e&&v(sW,`Client ${e?"is":"is not"} eligible for a primary lease.`),e))}async shutdown(){this.ui=!1,this._s(),this.Bi&&(this.Bi.cancel(),this.Bi=null),this.us(),this.cs(),await this.qi.runTransaction("shutdown","readwrite",[eB,ti],e=>{let t=new tR(e,eN.ce);return this.Hi(t).next(()=>this.Yi(t))}),this.qi.close(),this.ls()}ns(e,t){return e.filter(e=>this.ts(e.updateTimeMs,t)&&!this.ss(e.clientId))}hs(){return this.runTransaction("getActiveClients","readonly",e=>tk(e,ti).J().next(e=>this.ns(e,18e5).map(e=>e.clientId)))}get started(){return this.ui}getGlobalsCache(){return this.ci}getMutationQueue(e,t){return sc.wt(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.li}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new si(e,this.serializer.yt.databaseId)}getDocumentOverlayCache(e){return iq.wt(this.serializer,e)}getBundleCache(){return this.Pi}runTransaction(e,t,r){var n;let i;v(sW,"Starting transaction:",e);let s=18===(n=this.xi)?tP:17===n?tP:16===n?tC:15===n?tC:14===n?tA:13===n?tA:12===n?tS:11===n?tT:void E(60245);return this.qi.runTransaction(e,"readonly"===t?"readonly":"readwrite",s,n=>(i=new tR(n,this.ai?this.ai.next():eN.ce),"readwrite-primary"===t?this.ji(i).next(e=>!!e||this.Ji(i)).next(t=>{if(!t)throw w(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Ci.enqueueRetryable(()=>this.ki(!1)),new A(S.FAILED_PRECONDITION,em);return r(i)}).next(e=>this.Zi(i).next(()=>e)):this.Ps(i).next(()=>r(i)))).then(e=>(i.raiseOnCommittedEvent(),e))}Ps(e){return tk(e,eB).get(ej).next(e=>{if(null!==e&&this.ts(e.leaseTimestampMs,5e3)&&!this.ss(e.ownerId)&&!this.Xi(e)&&!(this.Mi||this.allowTabSynchronization&&e.allowTabSynchronization))throw new A(S.FAILED_PRECONDITION,s$)})}Zi(e){let t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return tk(e,eB).put(ej,t)}static v(){return e_.v()}Hi(e){let t=tk(e,eB);return t.get(ej).next(e=>
6this.Xi(e)?(v(sW,"Releasing primary lease."),t.delete(ej)):ev.resolve())}ts(e,t){let r=Date.now();return!(e<r-t)&&(!(e>r)||(w(`Detected an update time that is in the future: ${e} > ${r}`),!1))}Wi(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Ni=()=>{this.Ci.enqueueAndForget(()=>(this.inForeground="visible"===this.document.visibilityState,this.$i()))},this.document.addEventListener("visibilitychange",this.Ni),this.inForeground="visible"===this.document.visibilityState)}us(){this.Ni&&(this.document.removeEventListener("visibilitychange",this.Ni),this.Ni=null)}Qi(){"function"==typeof this.window?.addEventListener&&(this.Oi=()=>{this._s();let e=/(?:Version|Mobile)\/1[456]/;c.isSafari()&&(navigator.appVersion.match(e)||navigator.userAgent.match(e))&&this.Ci.enterRestrictedMode(!0),this.Ci.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.Oi))}cs(){this.Oi&&(this.window.removeEventListener("pagehide",this.Oi),this.Oi=null)}ss(e){try{let t=null!==this.Ui?.getItem(this.rs(e));return v(sW,`Client '${e}' ${t?"is":"is not"} zombied in LocalStorage`),t}catch(e){return w(sW,"Failed to get zombied client id.",e),!1}}_s(){if(this.Ui)try{this.Ui.setItem(this.rs(this.clientId),String(Date.now()))}catch(e){w("Failed to set zombie client id.",e)}}ls(){if(this.Ui)try{this.Ui.removeItem(this.rs(this.clientId))}catch(e){}}rs(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function sY(e,t){let r=e.projectId;return e.isDefaultDatabase||(r+="."+e.database),"firestore/"+t+"/"+r+"/"}class sJ{constructor(e,t,r,n){this.targetId=e,this.fromCache=t,this.Ts=r,this.Is=n}static Es(e,t){let r=nu(),n=nu();for(let e of t.docChanges)switch(e.type){case 0:r=r.add(e.doc.key);break;case 1:n=n.add(e.doc.key)}return new sJ(e,t.fromCache,r,n)}}class sX{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class sZ{constructor(){this.Rs=!1,this.As=!1,this.Vs=100,this.ds=c.isSafari()?8:eE(c.getUA())>0?6:4}initialize(e,t){this.fs=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,r,n){let i={result:null};return this.gs(e,t).next(e=>{i.result=e}).next(()=>{if(!i.result)return this.ps(e,t,n,r).next(e=>{i.result=e})}).next(()=>{if(i.result)return;let r=new sX;return this.ys(e,t,r).next(n=>{if(i.result=n,this.As)return this.ws(e,t,r,n.size)})}).next(()=>i.result)}ws(e,t,r,n){return r.documentReadCount<this.Vs?(y()<=d.LogLevel.DEBUG&&v("QueryEngine","SDK will not create cache indexes for query:",r5(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),ev.resolve()):(y()<=d.LogLevel.DEBUG&&v("QueryEngine","Query:",r5(t),"scans",r.documentReadCount,"local documents and returns",n,"documents as results."),r.documentReadCount>this.ds*n?(y()<=d.LogLevel.DEBUG&&v("QueryEngine","The SDK decides to create cache indexes for query:",r5(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,r1(t))):ev.resolve())}gs(e,t){if(rJ(t))return ev.resolve(null);let r=r1(t);return this.indexManager.getIndexType(e,r).next(n=>0===n?null:(null!==t.limit&&1===n&&(r=r1(t=r6(t,null,"F"))),this.indexManager.getDocumentsMatchingTarget(e,r).next(n=>{let i=nu(...n);return this.fs.getDocuments(e,i).next(n=>this.indexManager.getMinOffset(e,r).next(r=>{let s=this.Ss(t,n);return this.bs(t,s,i,r.readTime)?this.gs(e,r6(t,null,"F")):this.Ds(e,s,t,r)}))})))}ps(e,t,r,n){return rJ(t)||n.isEqual(ei.min())?ev.resolve(null):this.fs.getDocuments(e,r).next(i=>{let s=this.Ss(t,i);return this.bs(t,s,r,n)?ev.resolve(null):(y()<=d.LogLevel.DEBUG&&v("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),r5(t)),this.Ds(e,s,t,eh(n,-1)).next(e=>e))})}Ss(e,t){let r=new tV(ne(e));return t.forEach((t,n)=>{r9(e,n)&&(r=r.add(n))}),r}bs(e,t,r,n){if(null===e.limit)return!1;if(r.size!==t.size)return!0;let i="F"===e.limitType?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(n)>0)}ys(e,t,r){return y()<=d.LogLevel.DEBUG&&v("QueryEngine","Using full collection scan to execute query:",r5(t)),this.fs.getDocumentsMatchingQuery(e,t,ef.min(),r)}Ds(e,t,r,n){return this.fs.getDocumentsMatchingQuery(e,r,n).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}let s0="LocalStore";class s1{constructor(e,t,r,n){this.persistence=e,this.Cs=t,this.serializer
6=n,this.vs=new tM(V),this.Fs=new nt(e=>rz(e),rq),this.Ms=new Map,this.xs=e.getRemoteDocumentCache(),this.li=e.getTargetCache(),this.Pi=e.getBundleCache(),this.Os(r)}Os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new sk(this.xs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.xs.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.vs))}}async function s2(e,t){return await e.persistence.runTransaction("Handle user change","readonly",r=>{let n;return e.mutationQueue.getAllMutationBatches(r).next(i=>(n=i,e.Os(t),e.mutationQueue.getAllMutationBatches(r))).next(t=>{let i=[],s=[],o=nu();for(let e of n)for(let t of(i.push(e.batchId),e.mutations))o=o.add(t.key);for(let e of t)for(let t of(s.push(e.batchId),e.mutations))o=o.add(t.key);return e.localDocuments.getDocuments(r,o).next(e=>({Ns:e,removedBatchIds:i,addedBatchIds:s}))})})}function s4(e){return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.li.getLastRemoteSnapshotVersion(t))}function s6(e,t,r){let n=nu(),i=nu();return r.forEach(e=>n=n.add(e)),t.getEntries(e,n).next(e=>{let n=nr;return r.forEach((r,s)=>{let o=e.get(r);s.isFoundDocument()!==o.isFoundDocument()&&(i=i.add(r)),s.isNoDocument()&&s.version.isEqual(ei.min())?(t.removeEntry(r,s.readTime),n=n.insert(r,s)):!o.isValidDocument()||s.version.compareTo(o.version)>0||0===s.version.compareTo(o.version)&&o.hasPendingWrites?(t.addEntry(s),n=n.insert(r,s)):v(s0,"Ignoring outdated watch update for ",r,". Current version:",o.version," Watch version:",s.version)}),{Bs:n,Ls:i}})}function s8(e,t){return e.persistence.runTransaction("Allocate target","readwrite",r=>{let n;return e.li.getTargetData(r,t).next(i=>i?(n=i,ev.resolve(n)):e.li.allocateTargetId(r).next(i=>(n=new ik(t,i,"TargetPurposeListen",r.currentSequenceNumber),e.li.addTargetData(r,n).next(()=>n))))}).then(r=>{let n=e.vs.get(r.targetId);return(null===n||r.snapshotVersion.compareTo(n.snapshotVersion)>0)&&(e.vs=e.vs.insert(r.targetId,r),e.Fs.set(t,r.targetId)),r})}async function s3(e,t,r){let n=e.vs.get(t);try{r||await e.persistence.runTransaction("Release target",r?"readwrite":"readwrite-primary",t=>e.persistence.referenceDelegate.removeTarget(t,n))}catch(e){if(!eS(e))throw e;v(s0,`Failed to update sequence numbers for target ${t}: ${e}`)}e.vs=e.vs.remove(t),e.Fs.delete(n.target)}function s5(e,t,r){let n=ei.min(),i=nu();return e.persistence.runTransaction("Execute query","readwrite",s=>(function(e,t,r){let n=e.Fs.get(r);return void 0!==n?ev.resolve(e.vs.get(n)):e.li.getTargetData(t,r)})(e,s,r1(t)).next(t=>{if(t)return n=t.lastLimboFreeSnapshotVersion,e.li.getMatchingKeysForTargetId(s,t.targetId).next(e=>{i=e})}).next(()=>e.Cs.getDocumentsMatchingQuery(s,t,r?n:ei.min(),r?i:nu())).next(r=>(oe(e,r7(t),r),{documents:r,ks:i})))}function s9(e,t){let r=e.li,n=e.vs.get(t);return n?Promise.resolve(n.target):e.persistence.runTransaction("Get target data","readonly",e=>r.At(e,t).next(e=>e?e.target:null))}function s7(e,t){let r=e.Ms.get(t)||ei.min();return e.persistence.runTransaction("Get new document changes","readonly",n=>e.xs.getAllFromCollectionGroup(n,t,eh(r,-1),Number.MAX_SAFE_INTEGER)).then(r=>(oe(e,t,r),r))}function oe(e,t,r){let n=e.Ms.get(t)||ei.min();r.forEach((e,t)=>{t.readTime.compareTo(n)>0&&(n=t.readTime)}),e.Ms.set(t,n)}async function ot(e,t,r,n){let i=nu(),s=nr;for(let e of r){let r=t.Ks(e.metadata.name);e.document&&(i=i.add(r));let n=t.qs(e);n.setReadTime(t.Us(e.metadata.readTime)),s=s.insert(r,n)}let o=e.xs.newChangeBuffer({trackRemovals:!0}),a=await s8(e,r1(rY(q.fromString(`__bundle__/docs/${n}`))));return e.persistence.runTransaction("Apply bundle documents","readwrite",t=>s6(t,o,s).next(e=>(o.apply(t),e)).next(r=>e.li.removeMatchingKeysForTargetId(t,a.targetId).next(()=>e.li.addMatchingKeys(t,i,a.targetId)).next(()=>e.localDocuments.getLocalViewOfDocuments(t,r.Bs,r.Ls)).next(()=>r.Bs)))}async function or(e,t,r=nu()){let n=await s8(e,r1(iU(t.bundledQuery)));return e.persistence.runTransaction("Save named query","readwrite",i=>{let s=io(t.readTime);if(n.snapshotVersion.compareTo(s)>=0)return e.Pi.saveNamedQuery(i,t);let o=n.withResumeToken(tz.EMPTY_BYTE_STRING,s);return e.vs=e.vs.insert(o.targetId,o),e.li.updateTargetData(i,o).next(()=>e.li.removeMatchingKeysForTargetId(i,n.targetId)).next(()=>e.li.addMatchingKeys(i,r,n.targetId)).next(()=>e.Pi.saveNamedQuery(i,t))})}let on="firestore_clients";function oi(e,t){return`${on}_${e}_${t}`}let os="firestore_mutations";function oo(e,t,r){let n=`${os}_${e}_${r}`;return t.isAuthenticated()&&(n+=`_${t.uid}`),n}let oa="firestore_targets";function ol(e,t){return`${oa}_${e}_${t}`}
6let ou="SharedClientState";class oc{constructor(e,t,r,n){this.user=e,this.batchId=t,this.state=r,this.error=n}static $s(e,t,r){let n=JSON.parse(r),i,s="object"==typeof n&&-1!==["pending","acknowledged","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return s&&n.error&&(s="string"==typeof n.error.message&&"string"==typeof n.error.code)&&(i=new A(n.error.code,n.error.message)),s?new oc(e,t,n.state,i):(w(ou,`Failed to parse mutation state for ID '${t}': ${r}`),null)}Ws(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class oh{constructor(e,t,r){this.targetId=e,this.state=t,this.error=r}static $s(e,t){let r=JSON.parse(t),n,i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(n=new A(r.error.code,r.error.message)),i?new oh(e,r.state,n):(w(ou,`Failed to parse target state for ID '${e}': ${t}`),null)}Ws(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class od{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static $s(e,t){let r=JSON.parse(t),n="object"==typeof r&&r.activeTargetIds instanceof Array,i=nc;for(let e=0;n&&e<r.activeTargetIds.length;++e)n=eL(r.activeTargetIds[e]),i=i.add(r.activeTargetIds[e]);return n?new od(e,i):(w(ou,`Failed to parse client data for instance '${e}': ${t}`),null)}}class of{constructor(e,t){this.clientId=e,this.onlineState=t}static $s(e){let t=JSON.parse(e);return"object"==typeof t&&-1!==["Unknown","Online","Offline"].indexOf(t.onlineState)&&"string"==typeof t.clientId?new of(t.clientId,t.onlineState):(w(ou,`Failed to parse online state: ${e}`),null)}}class op{constructor(){this.activeTargetIds=nc}Qs(e){this.activeTargetIds=this.activeTargetIds.add(e)}Gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){return JSON.stringify({activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()})}}class om{constructor(e,t,r,n,i){var s,o,a;this.window=e,this.Ci=t,this.persistenceKey=r,this.zs=n,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.js=this.Js.bind(this),this.Hs=new tM(V),this.started=!1,this.Zs=[];let l=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Xs=oi(this.persistenceKey,this.zs),this.Ys=(s=this.persistenceKey,`firestore_sequence_number_${s}`),this.Hs=this.Hs.insert(this.zs,new op),this.eo=RegExp(`^${on}_${l}_([^_]*)$`),this.no=RegExp(`^${os}_${l}_(\\d+)(?:_(.*))?$`),this.ro=RegExp(`^${oa}_${l}_(\\d+)$`),this.io=(o=this.persistenceKey,`firestore_online_state_${o}`),this.so=(a=this.persistenceKey,`firestore_bundle_loaded_v2_${a}`),this.window.addEventListener("storage",this.js)}static v(e){return!(!e||!e.localStorage)}async start(){for(let e of(await this.syncEngine.hs())){if(e===this.zs)continue;let t=this.getItem(oi(this.persistenceKey,e));if(t){let r=od.$s(e,t);r&&(this.Hs=this.Hs.insert(r.clientId,r))}}this.oo();let e=this.storage.getItem(this.io);if(e){let t=this._o(e);t&&this.ao(t)}for(let e of this.Zs)this.Js(e);this.Zs=[],this.window.addEventListener("pagehide",()=>this.shutdown()),this.started=!0}writeSequenceNumber(e){this.setItem(this.Ys,JSON.stringify(e))}getAllActiveQueryTargets(){return this.uo(this.Hs)}isActiveQueryTarget(e){let t=!1;return this.Hs.forEach((r,n)=>{n.activeTargetIds.has(e)&&(t=!0)}),t}addPendingMutation(e){this.co(e,"pending")}updateMutationState(e,t,r){this.co(e,t,r),this.lo(e)}addLocalQueryTarget(e,t=!0){let r="not-current";if(this.isActiveQueryTarget(e)){let t=this.storage.getItem(ol(this.persistenceKey,e));if(t){let n=oh.$s(e,t);n&&(r=n.state)}}return t&&this.ho.Qs(e),this.oo(),r}removeLocalQueryTarget(e){this.ho.Gs(e),this.oo()}isLocalQueryTarget(e){return this.ho.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(ol(this.persistenceKey,e))}updateQueryState(e,t,r){this.Po(e,t,r)}
6handleUserChange(e,t,r){t.forEach(e=>{this.lo(e)}),this.currentUser=e,r.forEach(e=>{this.addPendingMutation(e)})}setOnlineState(e){this.To(e)}notifyBundleLoaded(e){this.Io(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.js),this.removeItem(this.Xs),this.started=!1)}getItem(e){let t=this.storage.getItem(e);return v(ou,"READ",e,t),t}setItem(e,t){v(ou,"SET",e,t),this.storage.setItem(e,t)}removeItem(e){v(ou,"REMOVE",e),this.storage.removeItem(e)}Js(e){if(e.storageArea===this.storage){if(v(ou,"EVENT",e.key,e.newValue),e.key===this.Xs)return void w("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Ci.enqueueRetryable(async()=>{if(this.started){if(null!==e.key){if(this.eo.test(e.key)){if(null==e.newValue){let t=this.Eo(e.key);return this.Ro(t,null)}{let t=this.Ao(e.key,e.newValue);if(t)return this.Ro(t.clientId,t)}}else if(this.no.test(e.key)){if(null!==e.newValue){let t=this.Vo(e.key,e.newValue);if(t)return this.mo(t)}}else if(this.ro.test(e.key)){if(null!==e.newValue){let t=this.fo(e.key,e.newValue);if(t)return this.po(t)}}else if(e.key===this.io){if(null!==e.newValue){let t=this._o(e.newValue);if(t)return this.ao(t)}}else if(e.key===this.Ys){let t=function(e){let t=eN.ce;if(null!=e)try{let r=JSON.parse(e);T("number"==typeof r,30636,{yo:e}),t=r}catch(e){w(ou,"Failed to read sequence number from WebStorage",e)}return t}(e.newValue);t!==eN.ce&&this.sequenceNumberHandler(t)}else if(e.key===this.so){let t=this.wo(e.newValue);await Promise.all(t.map(e=>this.syncEngine.So(e)))}}}else this.Zs.push(e)})}}get ho(){return this.Hs.get(this.zs)}oo(){this.setItem(this.Xs,this.ho.Ws())}co(e,t,r){let n=new oc(this.currentUser,e,t,r),i=oo(this.persistenceKey,this.currentUser,e);this.setItem(i,n.Ws())}lo(e){let t=oo(this.persistenceKey,this.currentUser,e);this.removeItem(t)}To(e){let t={clientId:this.zs,onlineState:e};this.storage.setItem(this.io,JSON.stringify(t))}Po(e,t,r){let n=ol(this.persistenceKey,e),i=new oh(e,t,r);this.setItem(n,i.Ws())}Io(e){let t=JSON.stringify(Array.from(e));this.setItem(this.so,t)}Eo(e){let t=this.eo.exec(e);return t?t[1]:null}Ao(e,t){let r=this.Eo(e);return od.$s(r,t)}Vo(e,t){let r=this.no.exec(e),n=Number(r[1]),i=void 0!==r[2]?r[2]:null;return oc.$s(new p(i),n,t)}fo(e,t){let r=Number(this.ro.exec(e)[1]);return oh.$s(r,t)}_o(e){return of.$s(e)}wo(e){return JSON.parse(e)}async mo(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.bo(e.batchId,e.state,e.error);v(ou,`Ignoring mutation for non-active user ${e.user.uid}`)}po(e){return this.syncEngine.Do(e.targetId,e.state,e.error)}Ro(e,t){let r=t?this.Hs.insert(e,t):this.Hs.remove(e),n=this.uo(this.Hs),i=this.uo(r),s=[],o=[];return i.forEach(e=>{n.has(e)||s.push(e)}),n.forEach(e=>{i.has(e)||o.push(e)}),this.syncEngine.Co(s,o).then(()=>{this.Hs=r})}ao(e){this.Hs.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}uo(e){let t=nc;return e.forEach((e,r)=>{t=t.unionWith(r.activeTargetIds)}),t}}class og{constructor(){this.vo=new op,this.Fo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.vo.Qs(e),this.Fo[e]||"not-current"}updateQueryState(e,t,r){this.Fo[e]=t}removeLocalQueryTarget(e){this.vo.Gs(e)}isLocalQueryTarget(e){return this.vo.activeTargetIds.has(e)}clearQueryState(e){delete this.Fo[e]}getAllActiveQueryTargets(){return this.vo.activeTargetIds}isActiveQueryTarget(e){return this.vo.activeTargetIds.has(e)}start(){return this.vo=new op,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class oy{Mo(e){}shutdown(){}}let ov="ConnectivityMonitor";class ow{constructor(){this.xo=()=>this.Oo(),this.No=()=>this.Bo(),this.Lo=[],this.ko()}Mo(e){this.Lo.push(e)}shutdown(){window.removeEventListener("online",this.xo),window.removeEventListener("offline",this.No)}ko(){window.addEventListener("online",this.xo),window.addEventListener("offline",this.No)}Oo(){for(let e of(v(ov,"Network connectivity changed: AVAILABLE"),this.Lo))e(0)}Bo(){for(let e of(v(ov,"Network connectivity changed: UNAVAILABLE"),this.Lo))e(1)}static v(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let ob=null;function o_(){return null===ob?ob=268435456+Math.round(2147483648*Math.random()):ob++,"0x"+ob.toString(16)}let oE="RestConnection",oI={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregation
6Query:"runAggregationQuery",ExecutePipeline:"executePipeline"};class oT{get Ko(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;let t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),n=encodeURIComponent(this.databaseId.database);this.qo=t+"://"+e.host,this.Uo=`projects/${r}/databases/${n}`,this.$o=this.databaseId.database===t2?`project_id=${r}`:`project_id=${r}&database_id=${n}`}Wo(e,t,r,n,i){let s=o_(),o=this.Qo(e,t.toUriEncodedString());v(oE,`Sending RPC '${e}' ${s}:`,o,r);let a={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.$o};this.Go(a,n,i);let{host:l}=new URL(o),u=c.isCloudWorkstation(l);return this.zo(e,o,a,r,u).then(t=>(v(oE,`Received RPC '${e}' ${s}: `,t),t),t=>{throw b(oE,`RPC '${e}' ${s} failed with error: `,t,"url: ",o,"request:",r),t})}jo(e,t,r,n,i,s){return this.Wo(e,t,r,n,i)}Go(e,t,r){e["X-Goog-Api-Client"]="gl-js/ fire/"+m,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,r)=>e[r]=t),r&&r.headers.forEach((t,r)=>e[r]=t)}Qo(e,t){let r=oI[e],n=`${this.qo}/v1/${t}:${r}`;return this.databaseInfo.apiKey&&(n=`${n}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),n}terminate(){}}class oS{constructor(e){this.Jo=e.Jo,this.Ho=e.Ho}Zo(e){this.Xo=e}Yo(e){this.e_=e}t_(e){this.n_=e}onMessage(e){this.r_=e}close(){this.Ho()}send(e){this.Jo(e)}i_(){this.Xo()}s_(){this.e_()}o_(e){this.n_(e)}__(e){this.r_(e)}}let oA="WebChannelConnection",oC=(e,t,r)=>{e.listen(t,e=>{try{r(e)}catch(e){setTimeout(()=>{throw e},0)}})};class oP extends oT{constructor(e){super(e),this.a_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static u_(){oP.c_||(oC(f.getStatEventTarget(),f.Event.STAT_EVENT,e=>{e.stat===f.Stat.PROXY?v(oA,"STAT_EVENT: detected buffering proxy"):e.stat===f.Stat.NOPROXY&&v(oA,"STAT_EVENT: detected no buffering proxy")}),oP.c_=!0)}zo(e,t,r,n,i){let s=o_();return new Promise((i,o)=>{let a=new f.XhrIo;a.setWithCredentials(!0),a.listenOnce(f.EventType.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case f.ErrorCode.NO_ERROR:let t=a.getResponseJson();v(oA,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(t)),i(t);break;case f.ErrorCode.TIMEOUT:v(oA,`RPC '${e}' ${s} timed out`),o(new A(S.DEADLINE_EXCEEDED,"Request time out"));break;case f.ErrorCode.HTTP_ERROR:let r=a.getStatus();if(v(oA,`RPC '${e}' ${s} failed with status:`,r,"response text:",a.getResponseText()),r>0){let e=a.getResponseJson();Array.isArray(e)&&(e=e[0]);let t=e?.error;if(t&&t.status&&t.message){let e=function(e){let t=e.toLowerCase().replace(/_/g,"-");return Object.values(S).indexOf(t)>=0?t:S.UNKNOWN}(t.status);o(new A(e,t.message))}else o(new A(S.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new A(S.UNAVAILABLE,"Connection failed."));break;default:E(9055,{l_:e,streamId:s,h_:a.getLastErrorCode(),P_:a.getLastError()})}}finally{v(oA,`RPC '${e}' ${s} completed.`)}});let l=JSON.stringify(n);v(oA,`RPC '${e}' ${s} sending request:`,n),a.send(t,"POST",l,r,15)})}T_(e,t,r){let i=o_(),s=[this.qo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=this.createWebChannelTransport(),a={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},l=this.longPollingOptions.timeoutSeconds;void 0!==l&&(a.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(a.useFetchStreams=!0),this.Go(a.initMessageHeaders,t,r),a.encodeInitMessageHeaders=!0;let u=s.join("");v(oA,`Creating RPC '${e}' stream ${i}: ${u}`,a);let c=o.createWebChannel(u,a);this.I_(c);let h=!1,d=!1,p=new oS({Jo:t=>{d?v(oA,`Not sending because RPC '${e}' stream ${i} is closed:`,t):(h||(v(oA,`Opening RPC '${e}' stream ${i} transport.`),c.open(),h=!0),v(oA,`RPC '${e}' stream ${i} sending:`,t),c.send(t))},Ho:()=>c.close()});return oC(c,f.WebChannel.EventType.OPEN,()=>{d||(v(oA,`RPC '${e}' stream ${i} transport opened.`),p.i_())}),oC(c,f.WebChannel.EventType.CLOSE,()=>{d||(d=!0,v(oA,`RPC '${e}' stream ${i} transport closed`),p.o_(),this.E_(c))}
6),oC(c,f.WebChannel.EventType.ERROR,t=>{d||(d=!0,b(oA,`RPC '${e}' stream ${i} transport errored. Name:`,t.name,"Message:",t.message),p.o_(new A(S.UNAVAILABLE,"The operation could not be completed")))}),oC(c,f.WebChannel.EventType.MESSAGE,t=>{if(!d){let r=t.data[0];T(!!r,16349);let s=r?.error||r[0]?.error;if(s){v(oA,`RPC '${e}' stream ${i} received error:`,s);let t=s.status,r=function(e){let t=n[e];if(void 0!==t)return nG(t)}(t),o=s.message;"NOT_FOUND"===t&&o.includes("database")&&o.includes("does not exist")&&o.includes(this.databaseId.database)&&b(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),void 0===r&&(r=S.INTERNAL,o="Unknown error status: "+t+" with message "+s.message),d=!0,p.o_(new A(r,o)),c.close()}else v(oA,`RPC '${e}' stream ${i} received:`,r),p.__(r)}}),oP.u_(),setTimeout(()=>{p.s_()},0),p}terminate(){this.a_.forEach(e=>e.close()),this.a_=[]}I_(e){this.a_.push(e)}E_(e){this.a_=this.a_.filter(t=>t===e)}Go(e,t,r){super.Go(e,t,r),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return f.createWebChannelTransport()}}function oR(){return"undefined"!=typeof window?window:null}function ok(){return"undefined"!=typeof document?document:null}function ox(e){return new it(e,!0)}oP.c_=!1;class oD{constructor(e,t,r=1e3,n=1.5,i=6e4){this.Ci=e,this.timerId=t,this.R_=r,this.A_=n,this.V_=i,this.d_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.d_=0}g_(){this.d_=this.V_}p_(e){this.cancel();let t=Math.floor(this.d_+this.y_()),r=Math.max(0,Date.now()-this.f_),n=Math.max(0,t-r);n>0&&v("ExponentialBackoff",`Backing off for ${n} ms (base delay: ${this.d_} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.m_=this.Ci.enqueueAfterDelay(this.timerId,n,()=>(this.f_=Date.now(),e())),this.d_*=this.A_,this.d_<this.R_&&(this.d_=this.R_),this.d_>this.V_&&(this.d_=this.V_)}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.d_}}let oN="PersistentStream";class oO{constructor(e,t,r,n,i,s,o,a){this.Ci=e,this.S_=r,this.b_=n,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new oD(e,t)}x_(){return 1===this.state||5===this.state||this.O_()}O_(){return 2===this.state||3===this.state}start(){this.F_=0,4!==this.state?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&null===this.C_&&(this.C_=this.Ci.enqueueAfterDelay(this.S_,6e4,()=>this.k_()))}K_(e){this.q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.q_(),this.U_(),this.M_.cancel(),this.D_++,4!==e?this.M_.reset():t&&t.code===S.RESOURCE_EXHAUSTED?(w(t.toString()),w("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):t&&t.code===S.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.t_(t)}W_(){}auth(){this.state=1;let e=this.Q_(this.D_),t=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,r])=>{this.D_===t&&this.G_(e,r)},t=>{e(()=>{let e=new A(S.UNKNOWN,"Fetching auth token failed: "+t.message);return this.z_(e)})})}G_(e,t){let r=this.Q_(this.D_);this.stream=this.j_(e,t),this.stream.Zo(()=>{r(()=>this.listener.Zo())}),this.stream.Yo(()=>{r(()=>(this.state=2,this.v_=this.Ci.enqueueAfterDelay(this.b_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.Yo()))}),this.stream.t_(e=>{r(()=>this.z_(e))}),this.stream.onMessage(e=>{r(()=>1==++this.F_?this.J_(e):this.onNext(e))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return v(oN,`close with error: ${e}`),this.stream=null,this.close(4,e)}Q_(e){return t=>{this.Ci.enqueueAndForget(()=>this.D_===e?t():(v(oN,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class oM extends oO{constructor(e,t,r,n,i,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,n,s),this.serializer
6=i}j_(e,t){return this.connection.T_("Listen",e,t)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();let t=function(e,t){let r;if("targetChange"in t){var n,i;t.targetChange;let s="NO_CHANGE"===(n=t.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===n?1:"REMOVE"===n?2:"CURRENT"===n?3:"RESET"===n?4:E(39313,{state:n}),o=t.targetChange.targetIds||[],a=(i=t.targetChange.resumeToken,e.useProto3Json?(T(void 0===i||"string"==typeof i,58123),tz.fromBase64String(i||"")):(T(void 0===i||i instanceof l||i instanceof Uint8Array,16193),tz.fromUint8Array(i||new Uint8Array))),u=t.targetChange.cause;r=new n4(s,o,a,u&&new A(void 0===u.code?S.UNKNOWN:nG(u.code),u.message||"")||null)}else if("documentChange"in t){t.documentChange;let n=t.documentChange;n.document,n.document.name,n.document.updateTime;let i=ih(e,n.document.name),s=io(n.document.updateTime),o=n.document.createTime?io(n.document.createTime):ei.min(),a=new rw({mapValue:{fields:n.document.fields}}),l=rb.newFoundDocument(i,s,o,a);r=new n1(n.targetIds||[],n.removedTargetIds||[],l.key,l)}else if("documentDelete"in t){t.documentDelete;let n=t.documentDelete;n.document;let i=ih(e,n.document),s=n.readTime?io(n.readTime):ei.min(),o=rb.newNoDocument(i,s);r=new n1([],n.removedTargetIds||[],o.key,o)}else if("documentRemove"in t){t.documentRemove;let n=t.documentRemove;n.document;let i=ih(e,n.document);r=new n1([],n.removedTargetIds||[],i,null)}else{if(!("filter"in t))return E(11601,{Vt:t});{t.filter;let e=t.filter;e.targetId;let{count:n=0,unchangedNames:i}=e,s=new nz(n,i);r=new n2(e.targetId,s)}}return r}(this.serializer,e),r=function(e){if(!("targetChange"in e))return ei.min();let t=e.targetChange;return t.targetIds&&t.targetIds.length?ei.min():t.readTime?io(t.readTime):ei.min()}(e);return this.listener.H_(t,r)}Z_(e){let t={};t.database=im(this.serializer),t.addTarget=function(e,t){let r;let n=t.target;if((r=rG(n)?{documents:iE(e,n)}:{query:iI(e,n).ft}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0){r.resumeToken=is(e,t.resumeToken);let n=ir(e,t.expectedCount);null!==n&&(r.expectedCount=n)}else if(t.snapshotVersion.compareTo(ei.min())>0){r.readTime=ii(e,t.snapshotVersion.toTimestamp());let n=ir(e,t.expectedCount);null!==n&&(r.expectedCount=n)}return r}(this.serializer,e);let r=function(e,t){let r=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return E(28987,{purpose:e})}}(t.purpose);return null==r?null:{"goog-listen-tags":r}}(this.serializer,e);r&&(t.labels=r),this.K_(t)}X_(e){let t={};t.database=im(this.serializer),t.removeTarget=e,this.K_(t)}}class oL extends oO{constructor(e,t,r,n,i,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,n,s),this.serializer=i}get Y_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.Y_&&this.ea([])}j_(e,t){return this.connection.T_("Write",e,t)}J_(e){return T(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,T(!e.writeResults||0===e.writeResults.length,55816),this.listener.ta()}onNext(e){var t,r;T(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();let n=(t=e.writeResults,r=e.commitTime,t&&t.length>0?(T(void 0!==r,14353),t.map(e=>{let t;return(t=e.updateTime?io(e.updateTime):io(r)).isEqual(ei.min())&&(t=io(r)),new nS(t,e.transformResults||[])})):[]),i=io(e.commitTime);return this.listener.na(i,n)}ra(){let e={};e.database=im(this.serializer),this.K_(e)}ea(e){let t={streamToken:this.lastStreamToken,writes:e.map(e=>ib(this.serializer,e))};this.K_(t)}}class oF{}class oV extends oF{constructor(e,t,r,n){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=n,this.ia=!1}sa(){if(this.ia)throw new A(S.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,t,r,n){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,s])=>this.connection.Wo(e,il(t,r),n,i,s)).catch(e=>{throw"FirebaseError"===e.name?(e.code===S.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new A(S.UNKNOWN,e.toString())})}jo(e,t,r,n,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.jo(e,il(t,r),n,s,o,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===S.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new A(S.UNKNOWN,e.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class oU{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}
7This 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?(w(t),this.aa=!1):v("OnlineStateTracker",t)}Pa(){null!==this._a&&(this._a.cancel(),this._a=null)}}let oB="RemoteStore";class oj{constructor(e,t,r,n,i){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Map,this.Ra=new Map,this.Aa=new sf(1e3),this.Va=new sf(1001),this.da=new Set,this.ma=[],this.fa=i,this.fa.Mo(e=>{r.enqueueAndForget(async()=>
7{oJ(this)&&(v(oB,"Restarting streams for network reachability change."),await async function(e){e.da.add(4),await oz(e),e.ga.set("Unknown"),e.da.delete(4),await oH(e)}(this))})}),this.ga=new oU(r,n)}}async function oH(e){if(oJ(e))for(let t of e.ma)await t(!0)}async function oz(e){for(let t of e.ma)await t(!1)}function oq(e,t){return e.Ea.get(t)||void 0}function oG(e,t){let r=oq(e,t.targetId);if(void 0!==r&&e.Ia.has(r))return;let n=function(e,t){let r=oq(e,t);void 0!==r&&e.Ra.delete(r);let n=t%2!=0?e.Va.next():e.Aa.next();return e.Ea.set(t,n),e.Ra.set(n,t),n}(e,t.targetId);v(oB,"remoteStoreListen mapping SDK target ID to remote",t.targetId,n);let i=new ik(t.target,n,t.purpose,t.sequenceNumber,t.snapshotVersion,t.lastLimboFreeSnapshotVersion,t.resumeToken);e.Ia.set(n,i),oY(e)?oQ(e):an(e).O_()&&o$(e,i)}function oW(e,t){let r=an(e),n=oq(e,t);v(oB,"remoteStoreUnlisten removing mapping of SDK target ID to remote",t,n),e.Ia.delete(n),e.Ea.delete(t),e.Ra.delete(n),r.O_()&&oK(e,n),0===e.Ia.size&&(r.O_()?r.L_():oJ(e)&&e.ga.set("Unknown"))}function o$(e,t){if(e.pa.$e(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(ei.min())>0){let r=e.Ra.get(t.targetId);if(void 0===r)return void v(oB,"SDK target ID not found for remote ID: "+t.targetId);let n=e.remoteSyncer.getRemoteKeysForTarget(r).size;t=t.withExpectedCount(n)}an(e).Z_(t)}function oK(e,t){e.pa.$e(t),an(e).X_(t)}function oQ(e){e.pa=new n8({getRemoteKeysForTarget:t=>{let r=e.Ra.get(t);return void 0!==r?e.remoteSyncer.getRemoteKeysForTarget(r):nu()},At:t=>e.Ia.get(t)||null,ht:()=>e.datastore.serializer.databaseId}),an(e).start(),e.ga.ua()}function oY(e){return oJ(e)&&!an(e).x_()&&e.Ia.size>0}function oJ(e){return 0===e.da.size}async function oX(e){e.ga.set("Online")}async function oZ(e){e.Ia.forEach((t,r)=>{o$(e,t)})}async function o0(e,t){e.pa=void 0,oY(e)?(e.ga.ha(t),oQ(e)):e.ga.set("Unknown")}async function o1(e,t,r){if(e.ga.set("Online"),t instanceof n4&&2===t.state&&t.cause)try{await async function(e,t){let r=t.cause;for(let n of t.targetIds){if(e.Ia.has(n)){let t=e.Ra.get(n);void 0!==t&&(await e.remoteSyncer.rejectListen(t,r),e.Ea.delete(t),e.Ra.delete(n)),e.Ia.delete(n)}e.pa.removeTarget(n)}}(e,t)}catch(r){v(oB,"Failed to remove targets %s: %s ",t.targetIds.join(","),r),await o2(e,r)}else if(t instanceof n1?e.pa.Xe(t):t instanceof n2?e.pa.st(t):e.pa.tt(t),!r.isEqual(ei.min()))try{let t=await s4(e.localStore);r.compareTo(t)>=0&&await function(e,t){let r=e.pa.Tt(t);
7r.targetChanges.forEach((r,n)=>{if(r.resumeToken.approximateByteSize()>0){let i=e.Ia.get(n);i&&e.Ia.set(n,i.withResumeToken(r.resumeToken,t))}}),r.targetMismatches.forEach((t,r)=>{let n=e.Ia.get(t);if(!n)return;e.Ia.set(t,n.withResumeToken(tz.EMPTY_BYTE_STRING,n.snapshotVersion)),oK(e,t);let i=new ik(n.target,t,r,n.sequenceNumber);o$(e,i)});let n=function(e,t){let r=new Map;t.targetChanges.forEach((t,n)=>{let i=e.Ra.get(n);void 0!==i&&r.set(i,t)});let n=new tM(V);return t.targetMismatches.forEach((t,r)=>{let i=e.Ra.get(t);void 0!==i&&(n=n.insert(i,r))}),new nZ(t.snapshotVersion,r,n,t.documentUpdates,t.resolvedLimboDocuments)}(e,r);return e.remoteSyncer.applyRemoteEvent(n)}(e,r)}catch(t){v(oB,"Failed to raise snapshot:",t),await o2(e,t)}}async function o2(e,t,r){if(!eS(t))throw t;e.da.add(1),await oz(e),e.ga.set("Offline"),r||(r=()=>s4(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{v(oB,"Retrying IndexedDB access"),await r(),e.da.delete(1),await oH(e)})}function o4(e,t){return t().catch(r=>o2(e,r,t))}async function o6(e){let t=ai(e),r=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:-1;for(;oJ(e)&&e.Ta.length<10;)try{let n=await function(e,t){return e.persistence.runTransaction("Get next mutation batch","readonly",r=>(void 0===t&&(t=-1),e.mutationQueue.getNextMutationBatchAfterBatchId(r,t)))}(e.localStore,r);if(null===n){0===e.Ta.length&&t.L_();break}r=n.batchId,function(e,t){e.Ta.push(t);let r=ai(e);r.O_()&&r.Y_&&r.ea(t.mutations)}(e,n)}catch(t){await o2(e,t)}o8(e)&&o3(e)}function o8(e){return oJ(e)&&!ai(e).x_()&&e.Ta.length>0}function o3(e){ai(e).start()}async function o5(e){ai(e).ra()}async function o9(e){let t=ai(e);for(let r of e.Ta)t.ea(r.mutations)}async function o7(e,t,r){let n=e.Ta.shift(),i=nB.from(n,t,r);await o4(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await o6(e)}async function ae(e,t){t&&ai(e).Y_&&await async function(e,t){var r;if(nq(r=t.code)&&r!==S.ABORTED){let r=e.Ta.shift();ai(e).B_(),await o4(e,()=>e.remoteSyncer.rejectFailedWrite(r.batchId,t)),await o6(e)}}(e,t),o8(e)&&o3(e)}async function at(e,t){e.asyncQueue.verifyOperationInProgress(),v(oB,"RemoteStore received new credentials");let r=oJ(e);e.da.add(3),await oz(e),r&&e.ga.set("Unknown"),await e.remoteSyncer.handleCredentialChange(t),e.da.delete(3),await oH(e)}async function ar(e,t){t?(e.da.delete(2),await oH(e)):t||(e.da.add(2),await oz(e),e.ga.set("Unknown"))}function an(e){var t,r,n;return e.ya||(e.ya=(t=e.datastore,r=e.asyncQueue,n={Zo:oX.bind(null,e),Yo:oZ.bind(null,e),t_:o0.bind(null,e),H_:o1.bind(null,e)},t.sa(),new oM(r,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,n)),e.ma.push(async t=>{t?(e.ya.B_(),oY(e)?oQ(e):e.ga.set("Unknown")):(await e.ya.stop(),e.pa=void 0)})),e.ya}function ai(e){var t,r,n;return e.wa||(e.wa=(t=e.datastore,r=e.asyncQueue,n={Zo:()=>Promise.resolve(),Yo:o5.bind(null,e),t_:ae.bind(null,e),ta:o9.bind(null,e),na:o7.bind(null,e)},t.sa(),new oL(r,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,n)),e.ma.push(async t=>{t?(e.wa.B_(),await o6(e)):(await e.wa.stop(),e.Ta.length>0&&(v(oB,`Stopping write stream with ${e.Ta.length} pending writes`),e.Ta=[]))})),e.wa}class as{constructor(e,t,r,n,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=n,this.removalCallback=i,this.deferred=new C,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,n,i){let s=new as(e,t,Date.now()+r,n,i);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 A(S.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)}}function ao(e,t){if(w("AsyncQueue",`${t}: ${e}`),eS(e))return new A(S.UNAVAILABLE,`${t}: ${e}`);throw e}class aa{static emptySet(e){return new aa(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||$.comparator(t.key,r.key):(e,t)=>$.comparator(e.key,t.key),this.keyedMap=ni(),this.sortedSet=new tM(this.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){let t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){let t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof aa)||this.size!==e.size)return!1;let t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){let e=t.getNext().key,n=r.getNext().key;if(!e.isEqual(n))return!1}return!0}toString(){let e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}copy(e,t){let r=new aa;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}class al{constructor(){this.Sa=new tM($.comparator)}track(e){let t=e.doc.key,r=this.Sa.get(t);r?0!==e.type&&3===r.type?this.Sa=this.Sa.insert(t,e):3===e.type&&1!==r.type?this.Sa=this.Sa.insert(t,{type:r.type,doc:e.doc}):2===e.type&&2===r.type?this.Sa=this.Sa.insert(t,{type:2,doc:e.doc}):2===e.type&&0===r.type?this.Sa=this.Sa.insert(t,{type:0,doc:e.doc}):1===e.type&&0===r.type?this.Sa=this.Sa.remove(t):1===e.type&&2===r.type?this.Sa=this.Sa.insert(t,{type:1,doc:r.doc}):0===e.type&&1===r.type?this.Sa=this.Sa.insert(t,{type:2,doc:e.doc}):E(63341,{Vt:e,ba:r}):this.Sa=this.Sa.insert(t,e)}Da(){let e=[];return this.Sa.inorderTraversal((t,r)=>{e.push(r)}),e}}class au{constructor(e,t,r,n,i,s,o,a,l){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=n,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=o,this.excludesMetadataChanges=a,this.hasCachedResults=l}static fromInitialDocuments(e,t,r,n,i){let s=[];
7return t.forEach(e=>{s.push({type:0,doc:e})}),new au(e,t,aa.emptySet(t),s,r,n,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&r8(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e].type!==r[e].type||!t[e].doc.isEqual(r[e].doc))return!1;return!0}}class ac{constructor(){this.Ca=void 0,this.va=[]}Fa(){return this.va.some(e=>e.Ma())}}class ah{constructor(){this.queries=ad(),this.onlineState="Unknown",this.xa=new Set}terminate(){!function(e,t){let r=e.queries;e.queries=ad(),r.forEach((e,r)=>{for(let e of r.va)e.onError(t)})}(this,new A(S.ABORTED,"Firestore shutting down"))}}function ad(){return new nt(e=>r3(e),r8)}async function af(e,t){let r=3,n=t.query,i=e.queries.get(n);i?!i.Fa()&&t.Ma()&&(r=2):(i=new ac,r=t.Ma()?0:1);try{switch(r){case 0:i.Ca=await e.onListen(n,!0);break;case 1:i.Ca=await e.onListen(n,!1);break;case 2:await e.onFirstRemoteStoreListen(n)}}catch(r){let e=ao(r,`Initialization of query '${r5(t.query)}' failed`);return void t.onError(e)}e.queries.set(n,i),i.va.push(t),t.Oa(e.onlineState),i.Ca&&t.Na(i.Ca)&&ay(e)}async function ap(e,t){let r=t.query,n=3,i=e.queries.get(r);if(i){let e=i.va.indexOf(t);e>=0&&(i.va.splice(e,1),0===i.va.length?n=t.Ma()?0:1:!i.Fa()&&t.Ma()&&(n=2))}switch(n){case 0:return e.queries.delete(r),e.onUnlisten(r,!0);case 1:return e.queries.delete(r),e.onUnlisten(r,!1);case 2:return e.onLastRemoteStoreUnlisten(r);default:return}}function am(e,t){let r=!1;for(let n of t){let t=n.query,i=e.queries.get(t);if(i){for(let e of i.va)e.Na(n)&&(r=!0);i.Ca=n}}r&&ay(e)}function ag(e,t,r){let n=e.queries.get(t);if(n)for(let e of n.va)e.onError(r);e.queries.delete(t)}function ay(e){e.xa.forEach(e=>{e.next()})}(o=s||(s={})).Ba="default",o.Cache="cache";class av{constructor(e,t,r){this.query=e,this.La=t,this.ka=!1,this.Ka=null,this.onlineState="Unknown",this.options=r||{}}Na(e){if(!this.options.includeMetadataChanges){let t=[];for(let r of e.docChanges)3!==r.type&&t.push(r);e=new au(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.ka?this.qa(e)&&(this.La.next(e),t=!0):this.Ua(e,this.onlineState)&&(this.$a(e),t=!0),this.Ka=e,t}onError(e){this.La.error(e)}Oa(e){this.onlineState=e;let t=!1;return this.Ka&&!this.ka&&this.Ua(this.Ka,e)&&(this.$a(this.Ka),t=!0),t}Ua(e,t){return!(e.fromCache&&this.Ma())||(!this.options.Wa||!("Offline"!==t))&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}qa(e){if(e.docChanges.length>0)return!0;let t=this.Ka&&this.Ka.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}$a(e){e=au.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.ka=!0,this.La.next(e)}Ma(){return this.options.source!==s.Cache}}class aw{constructor(e,t){this.Qa=e,this.byteLength=t}Ga(){return"metadata"in this.Qa}}class ab{constructor(e){this.serializer=e}Ks(e){return ih(this.serializer,e)}qs(e){return e.metadata.exists?iw(this.serializer,e.document,!1):rb.newNoDocument(this.Ks(e.metadata.name),this.Us(e.metadata.readTime))}Us(e){return io(e)}}class a_{constructor(e,t){this.za=e,this.serializer=t,this.ja=[],this.Ja=[],this.collectionGroups=new Set,this.progress=aE(e)}get queries(){return this.ja}get documents(){return this.Ja}Ha(e){this.progress.bytesLoaded+=e.byteLength;let t=this.progress.documentsLoaded;if(e.Qa.namedQuery)this.ja.push(e.Qa.namedQuery);else if(e.Qa.documentMetadata){this.Ja.push({metadata:e.Qa.documentMetadata}),e.Qa.documentMetadata.exists||++t;let r=q.fromString(e.Qa.documentMetadata.name);this.collectionGroups.add(r.get(r.length-2))}else e.Qa.document&&(this.Ja[this.Ja.length-1].document=e.Qa.document,++t);return t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,{...this.progress}):null}Za(e){let t=new Map,r=new ab(this.serializer);for(let n of e)if(n.metadata.queries){let e=r.Ks(n.metadata.name);for(let r of n.metadata.queries){let n=(t.get(r)||nu()).add(e);t.set(r,n)}}return t}async Xa(e){let t=await ot(e,new ab(this.serializer),this.Ja,this.za.id),r=this.Za(this.documents);for(let t of this.ja)await or(e,t,r.get(t.name));return this.progress.taskState="Success",{progress:this.progress,Ya:this.collectionGroups,eu:t}}}function aE(e){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}class aI{constructor(e){this.key=e}}class aT{constructor(e){this.key=e}}class aS{constructor(e,t){this.query=e,this.tu=t,this.nu=null,this.hasCachedResults=!1,this.current=!1,this.ru=nu(),this.mutatedKeys=nu(),this.iu=ne(e),this.su=new aa(this.iu)}get ou(){return this.tu}_u(e,t){let r=t?t.au:new al,n=t?t.su:this.su,i=t?t.mutatedKeys:this.mutatedKeys,s=n,o=!1,a="F"===this.query.limitType&&n.size===this.query.limit?n.last(
7):null,l="L"===this.query.limitType&&n.size===this.query.limit?n.first():null;if(e.inorderTraversal((e,t)=>{let u=n.get(e),c=r9(this.query,t)?t:null,h=!!u&&this.mutatedKeys.has(u.key),d=!!c&&(c.hasLocalMutations||this.mutatedKeys.has(c.key)&&c.hasCommittedMutations),f=!1;u&&c?u.data.isEqual(c.data)?h!==d&&(r.track({type:3,doc:c}),f=!0):this.uu(u,c)||(r.track({type:2,doc:c}),f=!0,(a&&this.iu(c,a)>0||l&&0>this.iu(c,l))&&(o=!0)):!u&&c?(r.track({type:0,doc:c}),f=!0):u&&!c&&(r.track({type:1,doc:u}),f=!0,(a||l)&&(o=!0)),f&&(c?(s=s.add(c),i=d?i.add(e):i.delete(e)):(s=s.delete(e),i=i.delete(e)))}),null!==this.query.limit)for(;s.size>this.query.limit;){let e="F"===this.query.limitType?s.last():s.first();s=s.delete(e.key),i=i.delete(e.key),r.track({type:1,doc:e})}return{su:s,au:r,bs:o,mutatedKeys:i}}uu(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,n){let i=this.su;this.su=e.su,this.mutatedKeys=e.mutatedKeys;let s=e.au.Da();s.sort((e,t)=>(function(e,t){let r=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return E(20277,{Vt:e})}};return r(e)-r(t)})(e.type,t.type)||this.iu(e.doc,t.doc)),this.cu(r),n=n??!1;let o=t&&!n?this.lu():[],a=0===this.ru.size&&this.current&&!n?1:0,l=a!==this.nu;return(this.nu=a,0!==s.length||l)?{snapshot:new au(this.query,e.su,i,s,e.mutatedKeys,0===a,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),hu:o}:{hu:o}}Oa(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({su:this.su,au:new al,mutatedKeys:this.mutatedKeys,bs:!1},!1)):{hu:[]}}Pu(e){return!this.tu.has(e)&&!!this.su.has(e)&&!this.su.get(e).hasLocalMutations}cu(e){e&&(e.addedDocuments.forEach(e=>this.tu=this.tu.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.tu=this.tu.delete(e)),this.current=e.current)}lu(){if(!this.current)return[];let e=this.ru;this.ru=nu(),this.su.forEach(e=>
7{this.Pu(e.key)&&(this.ru=this.ru.add(e.key))});let t=[];return e.forEach(e=>{this.ru.has(e)||t.push(new aT(e))}),this.ru.forEach(r=>{e.has(r)||t.push(new aI(r))}),t}Tu(e){this.tu=e.ks,this.ru=nu();let t=this._u(e.documents);return this.applyChanges(t,!0)}Iu(){return au.fromInitialDocuments(this.query,this.su,this.mutatedKeys,0===this.nu,this.hasCachedResults)}}let aA="SyncEngine";class aC{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class aP{constructor(e){this.key=e,this.Eu=!1}}class aR{constructor(e,t,r,n,i,s){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=n,this.currentUser=i,this.maxConcurrentLimboResolutions=s,this.Ru={},this.Au=new nt(e=>r3(e),r8),this.Vu=new Map,this.du=new Set,this.mu=new tM($.comparator),this.fu=new Map,this.gu=new sO,this.pu={},this.yu=new Map,this.wu=sf.ar(),this.onlineState="Unknown",this.Su=void 0}get isPrimaryClient(){return!0===this.Su}}async function ak(e,t,r=!0){let n;let i=a5(e),s=i.Au.get(t);return s?(i.sharedClientState.addLocalQueryTarget(s.targetId),n=s.view.Iu()):n=await aD(i,t,r,!0),n}async function ax(e,t){let r=a5(e);await aD(r,t,!0,!1)}async function aD(e,t,r,n){let i;
7let s=await s8(e.localStore,r1(t)),o=s.targetId,a=e.sharedClientState.addLocalQueryTarget(o,r);return n&&(i=await aN(e,t,o,"current"===a,s.resumeToken)),e.isPrimaryClient&&r&&oG(e.remoteStore,s),i}async function aN(e,t,r,n,i){e.bu=(t,r,n)=>(async function(e,t,r,n){let i=t.view._u(r);i.bs&&(i=await s5(e.localStore,t.query,!1).then(({documents:e})=>t.view._u(e,i)));let s=n&&n.targetChanges.get(t.targetId),o=n&&null!=n.targetMismatches.get(t.targetId),a=t.view.applyChanges(i,e.isPrimaryClient,s,o);return a$(e,t.targetId,a.hu),a.snapshot})(e,t,r,n);let s=await s5(e.localStore,t,!0),o=new aS(t,s.ks),a=o._u(s.documents),l=n0.createSynthesizedTargetChangeForCurrentChange(r,n&&"Offline"!==e.onlineState,i),u=o.applyChanges(a,e.isPrimaryClient,l);a$(e,r,u.hu);let c=new aC(t,r,o);return e.Au.set(t,c),e.Vu.has(r)?e.Vu.get(r).push(t):e.Vu.set(r,[t]),u.snapshot}async function aO(e,t,r){let n=e.Au.get(t),i=e.Vu.get(n.targetId);if(i.length>1)return e.Vu.set(n.targetId,i.filter(e=>!r8(e,t))),void e.Au.delete(t);e.isPrimaryClient?(e.sharedClientState.removeLocalQueryTarget(n.targetId),e.sharedClientState.isActiveQueryTarget(n.targetId)||await s3(e.localStore,n.targetId,!1).then(()=>{e.sharedClientState.clearQueryState(n.targetId),r&&oW(e.remoteStore,n.targetId),aG(e,n.targetId)}).catch(ey)):(aG(e,n.targetId),await s3(e.localStore,n.targetId,!0))}async function aM(e,t){let r=e.Au.get(t),n=e.Vu.get(r.targetId);e.isPrimaryClient&&1===n.length&&(e.sharedClientState.removeLocalQueryTarget(r.targetId),oW(e.remoteStore,r.targetId))}async function aL(e,t,r){let n=a9(e);try{var i;let e;let s=await function(e,t){let r,n;let i=en.now(),s=t.reduce((e,t)=>e.add(t.key),nu());return e.persistence.runTransaction("Locally write mutations","readwrite",o=>{let a=nr,l=nu();return e.xs.getEntries(o,s).next(e=>{(a=e).forEach((e,t)=>{t.isValidDocument()||(l=l.add(e))})}).next(()=>e.localDocuments.getOverlayedDocuments(o,a)).next(n=>{r=n;let s=[];for(let e of t){let t=function(e,t){let r=null;for(let n of e.fieldTransforms){let e=t.data.field(n.field),i=nm(n.transform,e||null);null!=i&&(null===r&&(r=rw.empty()),r.set(n.field,i))}return r||null}(e,r.get(e.key).overlayedDocument);null!=t&&s.push(new nN(e.key,t,function e(t){let r=[];return tD(t.fields,(t,n)=>{let i=new W([t]);if(rd(n)){let t=e(n.mapValue).fields;if(0===t.length)r.push(i);else for(let e of t)r.push(i.child(e))}else r.push(i)}),new tj(r)}(t.value.mapValue),nA.exists(!0)))}return e.mutationQueue.addMutationBatch(o,i,s,t)}).next(t=>{n=t;let i=t.applyToLocalDocumentSet(r,l);return e.documentOverlayCache.saveOverlays(o,t.batchId,i)})}).then(()=>({batchId:n.batchId,changes:ns(r)}))}(n.localStore,t);n.sharedClientState.addPendingMutation(s.batchId),i=s.batchId,(e=n.pu[n.currentUser.toKey()])||(e=new tM(V)),e=e.insert(i,r),n.pu[n.currentUser.toKey()]=e,await aQ(n,s.changes),await o6(n.remoteStore)}catch(t){let e=ao(t,"Failed to persist write");r.reject(e)}}async function aF(e,t){try{let r=await function(e,t){let r=t.snapshotVersion,n=e.vs;return e.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{let s=e.xs.newChangeBuffer({trackRemovals:!0});n=e.vs;let o=[];
7t.targetChanges.forEach((s,a)=>{var l;let u=n.get(a);if(!u)return;o.push(e.li.removeMatchingKeys(i,s.removedDocuments,a).next(()=>e.li.addMatchingKeys(i,s.addedDocuments,a)));let c=u.withSequenceNumber(i.currentSequenceNumber);null!==t.targetMismatches.get(a)?c=c.withResumeToken(tz.EMPTY_BYTE_STRING,ei.min()).withLastLimboFreeSnapshotVersion(ei.min()):s.resumeToken.approximateByteSize()>0&&(c=c.withResumeToken(s.resumeToken,r)),n=n.insert(a,c),l=c,(0===u.resumeToken.approximateByteSize()||l.snapshotVersion.toMicroseconds()-u.snapshotVersion.toMicroseconds()>=3e8||s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size>0)&&o.push(e.li.updateTargetData(i,c))});let a=nr,l=nu();if(t.documentUpdates.forEach(r=>{t.resolvedLimboDocuments.has(r)&&o.push(e.persistence.referenceDelegate.updateLimboDocument(i,r))}),o.push(s6(i,s,t.documentUpdates).next(e=>{a=e.Bs,l=e.Ls})),!r.isEqual(ei.min())){let t=e.li.getLastRemoteSnapshotVersion(i).next(t=>e.li.setTargetsMetadata(i,i.currentSequenceNumber,r));o.push(t)}return ev.waitFor(o).next(()=>s.apply(i)).next(()=>e.localDocuments.getLocalViewOfDocuments(i,a,l)).next(()=>a)}).then(t=>(e.vs=n,t))}(e.localStore,t);
7t.targetChanges.forEach((t,r)=>{let n=e.fu.get(r);n&&(T(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1,22616),t.addedDocuments.size>0?n.Eu=!0:t.modifiedDocuments.size>0?T(n.Eu,14607):t.removedDocuments.size>0&&(T(n.Eu,42227),n.Eu=!1))}),await aQ(e,r,t)}catch(e){await ey(e)}}function aV(e,t,r){var n;if(e.isPrimaryClient&&0===r||!e.isPrimaryClient&&1===r){let r;let i=[];e.Au.forEach((e,r)=>{let n=r.view.Oa(t);n.snapshot&&i.push(n.snapshot)}),(n=e.eventManager).onlineState=t,r=!1,n.queries.forEach((e,n)=>{for(let e of n.va)e.Oa(t)&&(r=!0)}),r&&ay(n),i.length&&e.Ru.H_(i),e.onlineState=t,e.isPrimaryClient&&e.sharedClientState.setOnlineState(t)}}async function aU(e,t,r){e.sharedClientState.updateQueryState(t,"rejected",r);let n=e.fu.get(t),i=n&&n.key;if(i){let r=new tM($.comparator);r=r.insert(i,rb.newNoDocument(i,ei.min()));let n=nu().add(i),s=new nZ(ei.min(),new Map,new tM(V),r,n);await aF(e,s),e.mu=e.mu.remove(i),e.fu.delete(t),aK(e)}else await s3(e.localStore,t,!1).then(()=>aG(e,t,r)).catch(ey)}async function aB(e,t){var r;let n=t.batch.batchId;try{let i=await (r=e.localStore).persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{let n=t.batch.keys(),i=r.xs.newChangeBuffer({trackRemovals:!0});return(function(e,t,r,n){let i=r.batch,s=i.keys(),o=ev.resolve();return s.forEach(e=>{o=o.next(()=>n.getEntry(t,e)).next(t=>{let s=r.docVersions.get(e);T(null!==s,48541),0>t.version.compareTo(s)&&(i.applyToRemoteDocument(t,r),t.isValidDocument()&&(t.setReadTime(r.commitVersion),n.addEntry(t)))})}),o.next(()=>e.mutationQueue.removeMutationBatch(t,i))})(r,e,t,i).next(()=>i.apply(e)).next(()=>r.mutationQueue.performConsistencyCheck(e)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(e,n,t.batch.batchId)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=nu();for(let r=0;r<e.mutationResults.length;++r)e.mutationResults[r].transformResults.length>0&&(t=t.add(e.batch.mutations[r].key));return t}(t))).next(()=>r.localDocuments.getDocuments(e,n))});aq(e,n,null),az(e,n),e.sharedClientState.updateMutationState(n,"acknowledged"),await aQ(e,i)}catch(e){await ey(e)}}async function aj(e,t,r){var n;try{let i=await (n=e.localStore).persistence.runTransaction("Reject batch","readwrite-primary",e=>{let r;
7return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(T(null!==t,37113),r=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,r)).next(()=>n.localDocuments.getDocuments(e,r))});aq(e,t,r),az(e,t),e.sharedClientState.updateMutationState(t,"rejected",r),await aQ(e,i)}catch(e){await ey(e)}}async function aH(e,t){var r;oJ(e.remoteStore)||v(aA,"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{let n=await (r=e.localStore).persistence.runTransaction("Get highest unacknowledged batch id","readonly",e=>r.mutationQueue.getHighestUnacknowledgedBatchId(e));if(-1===n)return void t.resolve();let i=e.yu.get(n)||[];i.push(t),e.yu.set(n,i)}catch(r){let e=ao(r,"Initialization of waitForPendingWrites() operation failed");t.reject(e)}}function az(e,t){(e.yu.get(t)||[]).forEach(e=>{e.resolve()}),e.yu.delete(t)}function aq(e,t,r){let n=e.pu[e.currentUser.toKey()];if(n){let i=n.get(t);i&&(r?i.reject(r):i.resolve(),n=n.remove(t)),e.pu[e.currentUser.toKey()]=n}}function aG(e,t,r=null){for(let n of(e.sharedClientState.removeLocalQueryTarget(t),e.Vu.get(t)))e.Au.delete(n),r&&e.Ru.Du(n,r);e.Vu.delete(t),e.isPrimaryClient&&e.gu.Gr(t).forEach(t=>{e.gu.containsKey(t)||aW(e,t)})}function aW(e,t){e.du.delete(t.path.canonicalString());let r=e.mu.get(t);null!==r&&(oW(e.remoteStore,r),e.mu=e.mu.remove(t),e.fu.delete(r),aK(e))}function a$(e,t,r){for(let n of r)n instanceof aI?(e.gu.addReference(n.key,t),function(e,t){let r=t.key,n=r.path.canonicalString();e.mu.get(r)||e.du.has(n)||(v(aA,"New document in limbo: "+r),e.du.add(n),aK(e))}(e,n)):n instanceof aT?(v(aA,"Document no longer in limbo: "+n.key),e.gu.removeReference(n.key,t),e.gu.containsKey(n.key)||aW(e,n.key)):E(19791,{Cu:n})}function aK(e){for(;e.du.size>0&&e.mu.size<e.maxConcurrentLimboResolutions;){let t=e.du.values().next().value;e.du.delete(t);let r=new $(q.fromString(t)),n=e.wu.next();e.fu.set(n,new aP(r)),e.mu=e.mu.insert(r,n),oG(e.remoteStore,new ik(r1(rY(r.path)),n,"TargetPurposeLimboResolution",eN.ce))}}async function aQ(e,t,r){let n=[],i=[],s=[];e.Au.isEmpty()||(e.Au.forEach((o,a)=>{s.push(e.bu(a,t,r).then(t=>{if((t||r)&&e.isPrimaryClient){let n=t?!t.fromCache:r?.targetChanges.get(a.targetId)?.current;e.sharedClientState.updateQueryState(a.targetId,n?"current":"not-current")}if(t){n.push(t);let e=sJ.Es(a.targetId,t);i.push(e)}}))}),await Promise.all(s),e.Ru.H_(n),await async function(e,t){try{await e.persistence.runTransaction("notifyLocalViewChanges","readwrite",r=>ev.forEach(t,t=>ev.forEach(t.Ts,n=>e.persistence.referenceDelegate.addReference(r,t.targetId,n)).next(()=>ev.forEach(t.Is,n=>e.persistence.referenceDelegate.removeReference(r,t.targetId,n)))))}catch(e){if(!eS(e))throw e;v(s0,"Failed to update sequence numbers: "+e)}for(let r of t){let t=r.targetId;if(!r.fromCache){let r=e.vs.get(t),n=r.snapshotVersion,i=r.withLastLimboFreeSnapshotVersion(n);e.vs=e.vs.insert(t,i)}}}(e.localStore,i))}async function aY(e,t){var r;if(!e.currentUser.isEqual(t)){v(aA,"User change. New user:",t.toKey());let n=await s2(e.localStore,t);e.currentUser=t,r="'waitForPendingWrites' promise is rejected due to a user change.",e.yu.forEach(e=>{e.forEach(e=>{e.reject(new A(S.CANCELLED,r))})}),e.yu.clear(),e.sharedClientState.handleUserChange(t,n.removedBatchIds,n.addedBatchIds),await aQ(e,n.Ns)}}function aJ(e,t){let r=e.fu.get(t);if(r&&r.Eu)return nu().add(r.key);{let r=nu(),n=e.Vu.get(t);if(!n)return r;for(let t of n){let n=e.Au.get(t);r=r.unionWith(n.view.ou)}return r}}async function aX(e,t){let r=await s5(e.localStore,t.query,!0),n=t.view.Tu(r);return e.isPrimaryClient&&a$(e,t.targetId,n.hu),n}async function aZ(e,t){return s7(e.localStore,t).then(t=>aQ(e,t))}async function a0(e,t,r,n){let i=await function(e,t){let r=e.mutationQueue;return e.persistence.runTransaction("Lookup mutation documents","readonly",n=>r.Xn(n,t).next(t=>t?e.localDocuments.getDocuments(n,t):ev.resolve(null)))}(e.localStore,t);null!==i?("pending"===r?await o6(e.remoteStore):"acknowledged"===r||"rejected"===r?(aq(e,t,n||null),az(e,t),function(e,t){e.mutation
7Queue.nr(t)}(e.localStore,t)):E(6720,"Unknown batchState",{vu:r}),await aQ(e,i)):v(aA,"Cannot apply mutation batch with id: "+t)}async function a1(e,t){if(a5(e),a9(e),!0===t&&!0!==e.Su){let t=e.sharedClientState.getAllActiveQueryTargets(),r=await a2(e,t.toArray());for(let t of(e.Su=!0,await ar(e.remoteStore,!0),r))oG(e.remoteStore,t)}else if(!1===t&&!1!==e.Su){let t=[],r=Promise.resolve();e.Vu.forEach((n,i)=>{e.sharedClientState.isLocalQueryTarget(i)?t.push(i):r=r.then(()=>(aG(e,i),s3(e.localStore,i,!0))),oW(e.remoteStore,i)}),await r,await a2(e,t),e.fu.forEach((t,r)=>{oW(e.remoteStore,r)}),e.gu.zr(),e.fu=new Map,e.mu=new tM($.comparator),e.Su=!1,await ar(e.remoteStore,!1)}}async function a2(e,t,r){let n=[],i=[];for(let r of t){let t;let s=e.Vu.get(r);if(s&&0!==s.length)for(let r of(t=await s8(e.localStore,r1(s[0])),s)){let t=e.Au.get(r),n=await aX(e,t);n.snapshot&&i.push(n.snapshot)}else{let n=await s9(e.localStore,r);t=await s8(e.localStore,n),await aN(e,a4(n),r,!1,t.resumeToken)}n.push(t)}return e.Ru.H_(i),n}function a4(e){var t,r,n,i;return t=e.path,r=e.collectionGroup,n=e.orderBy,i=e.filters,new rQ(t,r,n,i,e.limit,"F",e.startAt,e.endAt)}function a6(e){return e.localStore.persistence.hs()}async function a8(e,t,r,n){if(e.Su)return void v(aA,"Ignoring unexpected query state notification.");let i=e.Vu.get(t);if(i&&i.length>0)switch(r){case"current":case"not-current":{let n=await s7(e.localStore,r7(i[0])),s=nZ.createSynthesizedRemoteEventForCurrentChange(t,"current"===r,tz.EMPTY_BYTE_STRING);await aQ(e,n,s);break}case"rejected":await s3(e.localStore,t,!0),aG(e,t,n);break;default:E(64155,r)}}async function a3(e,t,r){let n=a5(e);if(n.Su){for(let e of t){if(n.Vu.has(e)&&n.sharedClientState.isActiveQueryTarget(e)){v(aA,"Adding an already active target "+e);continue}let t=await s9(n.localStore,e),r=await s8(n.localStore,t);await aN(n,a4(t),r.targetId,!1,r.resumeToken),oG(n.remoteStore,r)}for(let e of r)n.Vu.has(e)&&await s3(n.localStore,e,!1).then(()=>{oW(n.remoteStore,e),aG(n,e)}).catch(ey)}}function a5(e){return e.remoteStore.remoteSyncer.applyRemoteEvent=aF.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=aJ.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=aU.bind(null,e),e.Ru.H_=am.bind(null,e.eventManager),e.Ru.Du=ag.bind(null,e.eventManager),e}function a9(e){return e.remoteStore.remoteSyncer.applySuccessfulWrite=aB.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=aj.bind(null,e),e}class a7{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=ox(e.databaseInfo.databaseId),this.sharedClientState=this.Mu(e),this.persistence=this.xu(e),await this.persistence.start(),this.localStore=this.Ou(e),this.gcScheduler=this.Nu(e,this.localStore),this.indexBackfillerScheduler=this.Bu(e,this.localStore)}Nu(e,t){return null}Bu(e,t){return null}Ou(e){var t;return t=this.persistence,new s1(t,new sZ,e.initialUser,this.serializer)}xu(e){return new sB(sH.Vi,this.serializer)}Mu(e){return new og}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}a7.provider={build:()=>new a7};class le extends a7{constructor(e){super(),this.cacheSizeBytes=e}Nu(e,t){return T(this.persistence.referenceDelegate instanceof sz,46915),new sw(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}xu(e){let t=void 0!==this.cacheSizeBytes?sa.withCacheSize(this.cacheSizeBytes):sa.DEFAULT;return new sB(e=>sz.Vi(e,t),this.serializer)}}
7class lt extends a7{constructor(e,t,r){super(),this.Lu=e,this.cacheSizeBytes=t,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.Lu.initialize(this,e),await a9(this.Lu.syncEngine),await o6(this.Lu.remoteStore),await this.persistence.zi(()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve()))}Ou(e){var t;return t=this.persistence,new s1(t,new sZ,e.initialUser,this.serializer)}Nu(e,t){return new sw(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}Bu(e,t){let r=new eD(t,this.persistence);return new ex(e.asyncQueue,r)}xu(e){let t=sY(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=void 0!==this.cacheSizeBytes?sa.withCacheSize(this.cacheSizeBytes):sa.DEFAULT;return new sQ(this.synchronizeTabs,t,e.clientId,r,e.asyncQueue,oR(),ok(),this.serializer,this.sharedClientState,!!this.forceOwnership)}Mu(e){return new og}}class lr extends lt{constructor(e,t){super(e,t,!1),this.Lu=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);let t=this.Lu.syncEngine;this.sharedClientState instanceof om&&(this.sharedClientState.syncEngine={bo:a0.bind(null,t),Do:a8.bind(null,t),Co:a3.bind(null,t),hs:a6.bind(null,t),So:aZ.bind(null,t)},await this.sharedClientState.start()),await this.persistence.zi(async e=>{await a1(this.Lu.syncEngine,e),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start():e||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(e&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():e||this.indexBackfillerScheduler.stop())})}Mu(e){let t=oR();if(!om.v(t))throw new A(S.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");let r=sY(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new om(t,e.asyncQueue,r,e.clientId,e.initialUser)}}class ln{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=>aV(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=aY.bind(null,this.syncEngine),await ar(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new ah}createDatastore(e){let t=ox(e.databaseInfo.databaseId),r=new oP(e.databaseInfo);return new oV(e.authCredentials,e.appCheckCredentials,r,t)}createRemoteStore(e){var t;return t=this.localStore,new oj(t,this.datastore,e.asyncQueue,e=>aV(this.syncEngine,e,0),ow.v()?new ow:new oy)}createSyncEngine(e,t){return function(e,t,r,n,i,s,o){let a=new aR(e,t,r,n,i,s);return o&&(a.Su=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){await async function(e){v(oB,"RemoteStore shutting down."),e.da.add(5),await oz(e),e.fa.shutdown(),e.ga.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}function li(e,t=10240){let r=0;return{async read(){if(r<e.byteLength){let n={value:e.slice(r,r+t),done:!1};return r+=t,n}return{done:!0}},async cancel(){},releaseLock(){},closed:Promise.resolve()}}ln.provider={build:()=>new ln};class ls{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.ku(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.ku(this.observer.error,e):w("Uncaught Error in snapshot listener:",e.toString()))}Ku(){this.muted=!0}ku(e,t){setTimeout(()=>{this.muted||e(t)},0)}}class lo{constructor(e,t){this.qu=e,this.serializer=t,this.metadata=new C,this.buffer=new Uint8Array,this.Uu=new TextDecoder("utf-8"),this.$u().then(e=>{e&&e.Ga()?this.metadata.resolve(e.Qa.metadata):this.metadata.reject(Error(`The first element of the bundle is not a metadata, it is
8             ${JSON.stringify(e?.Qa)}`))},e=>this.metadata.reject(e))}close(){return this.qu.cancel()}async getMetadata(){return this.metadata.promise}async Fu(){return await this.getMetadata(),this.$u()}async $u(){let e=await this.Wu();if(null===e)return null;let t=this.Uu.decode(e),r=Number(t);return isNaN(r)&&this.Qu(`length string (${t}
8) is not valid number`),new aw(JSON.parse(await this.Gu(r)),e.length+r)}zu(){return this.buffer.findIndex(e=>123===e)}async Wu(){for(;0>this.zu()&&!await this.ju(););if(0===this.buffer.length)return null;let e=this.zu();e<0&&this.Qu("Reached the end of bundle when a length string is expected.");let t=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),t}async Gu(e){for(;this.buffer.length<e;)await this.ju()&&this.Qu("Reached the end of bundle when more is expected.");let t=this.Uu.decode(this.buffer.slice(0,e));return this.buffer=this.buffer.slice(e),t}Qu(e){throw this.qu.cancel(),Error(`Invalid bundle format: ${e}`)}async ju(){let e=await this.qu.read();if(!e.done){let t=new Uint8Array(this.buffer.length+e.value.length);t.set(this.buffer),t.set(e.value,this.buffer.length),this.buffer=t}return e.done}}class la{constructor(e,t){this.bundleData=e,this.serializer=t,this.cursor=0,this.elements=[];let r=this.Fu();if(!r||!r.Ga())throw Error(`The first element of the bundle is not a metadata object, it is
9         ${JSON.stringify(r?.Qa)}`);this.metadata=r;do null!==(r=this.Fu())&&this.elements.push(r);while(null!==r)}getMetadata(){return this.metadata}Ju(){return this.elements}Fu(){if(this.cursor===this.bundleData.length)return null;let e=this.Wu();return new aw(JSON.parse(this.Gu(e)),e)}Gu(e){if(this.cursor+e>this.bundleData.length)throw new A(S.INTERNAL,"Reached the end of bundle when more is expected.");return this.bundleData.slice(this.cursor,this.cursor+=e)}Wu(){let e=this.cursor,t=this.cursor;for(;t<this.bundleData.length;){if("{"===this.bundleData[t]){if(t===e)throw Error("First character is a bracket and not a number");return this.cursor=t,Number(this.bundleData.slice(e,t))}t++}throw Error("Reached the end of bundle when more is expected.")}}class ll{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}async lookup(e){if(this.ensureCommitNotCalled(),this.mutations.length>0)throw this.lastTransactionError=new A(S.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;let t=await async function(e,t){let r={documents:t.map(t=>ic(e.serializer,t))},n=await e.jo("BatchGetDocuments",e.serializer.databaseId,q.emptyPath(),r,t.length),i=new Map;n.forEach(t=>{var r;let n=(r=e.serializer,"found"in t?function(e,t){T(!!t.found,43571),t.found.name,t.found.updateTime;let r=ih(e,t.found.name),n=io(t.found.updateTime),i=t.found.createTime?io(t.found.createTime):ei.min(),s=new rw({mapValue:{fields:t.found.fields}});return rb.newFoundDocument(r,n,i,s)}(r,t):"missing"in t?function(e,t){T(!!t.missing,3894),T(!!t.readTime,22933);let r=ih(e,t.missing),n=io(t.readTime);return rb.newNoDocument(r,n)}(r,t):E(7234,{result:t}));i.set(n.key.toString(),n)});let s=[];return t.forEach(e=>{let t=i.get(e.toString());T(!!t,55234,{key:e}),s.push(t)}),s}(this.datastore,e);return t.forEach(e=>this.recordVersion(e)),t}set(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastTransactionError=e}this.writtenDocs.add(e.toString())}delete(e){this.write(new nF(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;let e=this.readVersions;this.mutations.forEach(t=>{e.delete(t.key.toString())}),e.forEach((e,t)=>{let r=$.fromPath(t);this.mutations.push(new nV(r,this.precondition(r)))}),await async function(e,t){let r={writes:t.map(t=>ib(e.serializer,t))};await e.Wo("Commit",e.serializer.databaseId,q.emptyPath(),r)}(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw E(50498,{Hu:e.constructor.name});t=ei.min()}let r=this.readVersions.get(e.key.toString());if(r){if(!t.isEqual(r))throw new A(S.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)}precondition(e){let t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?t.isEqual(ei.min())?nA.exists(!1):nA.updateTime(t):nA.none()}preconditionForUpdate(e){let t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(ei.min()))throw new A(S.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return nA.updateTime(t)}return nA.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}}class lu{constructor(e,t,r,n,i){this.asyncQueue=e,this.datastore=t,this.options=r,this.updateFunction=n,this.deferred=i,this.Zu=r.maxAttempts,this.M_=new oD(this.asyncQueue,"transaction_retry")}Xu(){this.Zu-=1,this.Yu()}Yu(){this.M_.p_(async()=>{let e=new ll(this.datastore),t=this.ec(e);t&&t.then(t=>{this.asyncQueue.enqueueAndForget(()=>e.commit().then(()=>{this.deferred.resolve(t)}).catch(e=>{this.tc(e)}))}).catch(e=>{this.tc(e)})})}ec(e){try{let t=this.updateFunction(e);return!eO(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}}tc(e){this.Zu>0&&this.nc(e)?(this.Zu-=1,this.asyncQueue.enqueueAndForget(()=>(this.Yu(),Promise.resolve()))):this.deferred.reject(e)}nc(e){if("FirebaseError"===e?.name){let t=e.code;return"aborted"===t||"failed-precondition"===t||"already-exists"===t||!nq(t)}return!1}}let lc="FirestoreClient";class lh{constructor(e,t,r,n,i){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this._databaseInfo=n,this.user=p.UNAUTHENTICATED,this.clientId=F.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(r,async e=>{v(lc,"Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(r,e=>(v(lc,"Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();let e=new C;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(r){let t=ao(r,"Failed to shutdown persistence");e.reject(t)}}),e.promise}}async function ld(e,t){e.asyncQueue.verifyOperationInProgress(),v(lc,"Initializing OfflineComponentProvider");let r=e.configuration;await t.initialize(r);let n=r.initialUser;e.setCredentialChangeListener(async e=>{n.isEqual(e)||(await s2(t.localStore,e),n=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function lf(e,t){e.asyncQueue.verifyOperationInProgress();let r=await lp(e);v(lc,"Initializing OnlineComponentProvider"),await t.initialize(r,e.configuration),e.setCredentialChangeListener(e=>at(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,r)=>at(t.remoteStore,r)),e._onlineComponents=t}
9async function lp(e){if(!e._offlineComponents){if(e._uninitializedComponentsProvider){v(lc,"Using user provided OfflineComponentProvider");try{await ld(e,e._uninitializedComponentsProvider._offline)}catch(t){if(!("FirebaseError"===t.name?t.code===S.FAILED_PRECONDITION||t.code===S.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code))throw t;b("Error using user provided cache. Falling back to memory cache: "+t),await ld(e,new a7)}}else v(lc,"Using default OfflineComponentProvider"),await ld(e,new le(void 0))}return e._offlineComponents}async function lm(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(v(lc,"Using user provided OnlineComponentProvider"),await lf(e,e._uninitializedComponentsProvider._online)):(v(lc,"Using default OnlineComponentProvider"),await lf(e,new ln))),e._onlineComponents}function lg(e){return lp(e).then(e=>e.persistence)}function ly(e){return lp(e).then(e=>e.localStore)}function lv(e){return lm(e).then(e=>e.remoteStore)}function lw(e){return lm(e).then(e=>e.syncEngine)}function lb(e){return lm(e).then(e=>e.datastore)}async function l_(e){let t=await lm(e),r=t.eventManager;return r.onListen=ak.bind(null,t.syncEngine),r.onUnlisten=aO.bind(null,t.syncEngine),r.onFirstRemoteStoreListen=ax.bind(null,t.syncEngine),r.onLastRemoteStoreUnlisten=aM.bind(null,t.syncEngine),r}function lE(e){let t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}let lI="ComponentProvider",lT=new Map;function lS(e,t,r,n,i){return new t1(e,t,r,i.host,i.ssl,i.experimentalForceLongPolling,i.experimentalAutoDetectLongPolling,lE(i.experimentalLongPollingOptions),i.useFetchStreams,i.isUsingEmulator,n)}let lA="firestore.googleapis.com";class lC{constructor(e){if(void 0===e.host){if(void 0!==e.ssl)throw new A(S.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=lA,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=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new A(S.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Q("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=lE(e.experimentalLongPollingOptions??{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new A(S.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new A(S.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new A(S.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}}class lP{constructor(e,t,r,n){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=n,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new lC({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new A(S.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 A(S.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 lC(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new R;switch(e.type){case"firstParty":return new N(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new A(S.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
9d 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(){return function(e){let t=lT.get(e);t&&(v(lI,"Removing Datastore"),lT.delete(e),t.terminate())}(this),Promise.resolve()}}function lR(e,t,r,n={}){e=ee(e,lP);let i=c.isCloudWorkstation(t),s=e._getSettings(),o={...s,emulatorOptions:e._getEmulatorOptions()},a=`${t}:${r}`;i&&c.pingServer(`https://${a}`),s.host!==lA&&s.host!==a&&b("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");let l={...s,host:a,ssl:i,emulatorOptions:n};if(!c.deepEqual(l,o)&&(e._setSettings(l),n.mockUserToken)){let t,r;if("string"==typeof n.mockUserToken)t=n.mockUserToken,r=p.MOCK_USER;else{t=c.createMockUserToken(n.mockUserToken,e._app?.options.projectId);let i=n.mockUserToken.sub||n.mockUserToken.user_id;if(!i)throw new A(S.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");r=new p(i)}e._authCredentials=new k(new P(t,r))}}class lk{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new lk(this.firestore,e,this._query)}}class lx{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 lD(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new lx(this.firestore,e,this._key)}toJSON(){return{type:lx._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,r){if(er(t,lx._jsonSchema))return new lx(e,r||null,new $(q.fromString(t.referencePath)))}}lx._jsonSchemaVersion="firestore/documentReference/1.0",lx._jsonSchema={type:et("string",lx._jsonSchemaVersion),referencePath:et("string")};class lD extends lk{constructor(e,t,r){super(e,t,rY(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 lx(this.firestore,null,new $(e))}withConverter(e){return new lD(this.firestore,e,this._path)}}let lN="AsyncQueue";class lO{constructor(e=Promise.resolve()){this.rc=[],this.sc=!1,this.oc=[],this._c=null,this.ac=!1,this.uc=!1,this.cc=[],this.M_=new oD(this,"async_queue_retry"),this.lc=()=>{let e=ok();e&&v(lN,"Visibility state changed to "+e.visibilityState),this.M_.w_()},this.hc=e;let t=ok();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.lc)}get isShuttingDown(){return this.sc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Pc(),this.Tc(e)}enterRestrictedMode(e){if(!this.sc){this.sc=!0,this.uc=e||!1;let t=ok();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.lc)}}enqueue(e){if(this.Pc(),this.sc)return new Promise(()=>{});let t=new C;return this.Tc(()=>this.sc&&this.uc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.rc.push(e),this.Ic()))}async Ic(){if(0!==this.rc.length){try{await this.rc[0](),this.rc.shift(),this.M_.reset()}catch(e){if(!eS(e))throw e;v(lN,"Operation failed with retryable error: "+e)}this.rc.length>0&&this.M_.p_(()=>this.Ic())}}Tc(e){let t=this.hc.then(()=>(this.ac=!0,e().catch(e=>{throw this._c=e,this.ac=!1,w("INTERNAL UNHANDLED ERROR: ",lM(e)),e}).then(e=>(this.ac=!1,e))));return this.hc=t,t}enqueueAfterDelay(e,t,r){this.Pc(),this.cc.indexOf(e)>-1&&(t=0);let n=as.createAndSchedule(this,e,t,r,e=>this.Ec(e));return this.oc.push(n),n}Pc(){this._c&&E(47125,{Rc:lM(this._c)})}verifyOperationInProgress(){}async Ac(){let e;do e=this.hc,await e;while(e!==this.hc)}Vc(e){for(let t of this.oc)if(t.timerId===e)return!0;return!1}dc(e){return this.Ac().then(()=>{for(let t of(this.oc.sort((e,t)=>
9e.targetTimeMs-t.targetTimeMs),this.oc))if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Ac()})}mc(e){this.cc.push(e)}Ec(e){let t=this.oc.indexOf(e);this.oc.splice(t,1)}}function lM(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}class lL{constructor(){this._progressObserver={},this._taskCompletionResolver=new C,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(e,t,r){this._progressObserver={next:e,error:t,complete:r}}catch(e){return this._taskCompletionResolver.promise.catch(e)}then(e,t){return this._taskCompletionResolver.promise.then(e,t)}_completeWith(e){this._updateProgress(e),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(e)}_failWith(e){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(e),this._taskCompletionResolver.reject(e)}_updateProgress(e){this._lastProgress=e,this._progressObserver.next&&this._progressObserver.next(e)}}class lF extends lP{constructor(e,t,r,n){super(e,t,r,n),this.type="firestore",this._queue=new lO,this._persistenceKey=n?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new lO(e),this._firestoreClient=void 0,await e}}}function lV(e){if(e._terminated)throw new A(S.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||lU(e),e._firestoreClient}function lU(e){let t=e._freezeSettings(),r=lS(e._databaseId,e._app?.options.appId||"",e._persistenceKey,e._app?.options.apiKey,t);e._componentsProvider||t.localCache?._offlineComponentProvider&&t.localCache?._onlineComponentProvider&&(e._componentsProvider={_offline:t.localCache._offlineComponentProvider,_online:t.localCache._onlineComponentProvider}),e._firestoreClient=new lh(e._authCredentials,e._appCheckCredentials,e._queue,r,e._componentsProvider&&function(e){let t=e?._online.build();return{_offline:e?._offline.build(t),_online:t}}(e._componentsProvider))}async function lB(e){b("enableMultiTabIndexedDbPersistence() will be deprecated 
9in the future, you can use `FirestoreSettings.cache` instead.");let t=e._freezeSettings();lj(e,ln.provider,{build:e=>new lr(e,t.cacheSizeBytes)})}function lj(e,t,r){if((e=ee(e,lF))._firestoreClient||e._terminated)throw new A(S.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");if(e._componentsProvider||e._getSettings().localCache)throw new A(S.FAILED_PRECONDITION,"SDK cache is already specified.");e._componentsProvider={_online:t,_offline:r},lU(e)}class lH{constructor(e){this._byteString=e}static fromBase64String(e){try{return new lH(tz.fromBase64String(e))}catch(e){throw new A(S.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new lH(tz.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:lH._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(er(e,lH._jsonSchema))return lH.fromBase64String(e.bytes)}}lH._jsonSchemaVersion="firestore/bytes/1.0",lH._jsonSchema={type:et("string",lH._jsonSchemaVersion),bytes:et("string")};class lz{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new A(S.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new W(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class lq{constructor(e){this._methodName=e}}class lG{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new A(S.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new A(S.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 V(this._lat,e._lat)||V(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:lG._jsonSchemaVersion}}static fromJSON(e){if(er(e,lG._jsonSchema))return new lG(e.latitude,e.longitude)}}lG._jsonSchemaVersion="firestore/geoPoint/1.0",lG._jsonSchema={type:et("string",lG._jsonSchemaVersion),latitude:et("number"),longitude:et("number")};class lW{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:lW._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(er(e,lW._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(e=>"number"==typeof e))return new lW(e.vectorValues);throw new A(S.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}lW._jsonSchemaVersion="firestore/vectorValue/1.0",lW._jsonSchema={type:et("string",lW._jsonSchemaVersion),vectorValues:et("object")};let l$=/^__.*__$/;class lK{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return null!==this.fieldMask?new nN(e,this.data,this.fieldMask,t,this.fieldTransforms):new nD(e,this.data,t,this.fieldTransforms)}}class lQ{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new nN(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function lY(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw E(40011,{dataSource:e})}}class lJ{constructor(e,t,r,n,i,s){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=n,void 0===i&&this.fc(),this.fieldTransforms=i||[],this.fieldMask=s||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}i(e){return new lJ({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}yc(e){let t=this.path?.child(e),r=this.i({path:t,arrayElement:!1});return r.wc(e),r}Sc(e){let t=this.path?.child(e),r=this.i({path:t,arrayElement:!1});return r.fc(),r}bc(e){return this.i({path:void 0,arrayElement:!0})}Dc(e){return un(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}fc(){if(this.path)for(let e=0;e<this.path.length;e++)this.wc(this.path.get(e))}wc(e){if(0===e.length)throw this.Dc("Document fields must not be empty");if(lY(this.dataSource)&&l$.test(e))throw this.Dc('Document fields cannot begin and end with "__"')}}class lX{constructor(e,t,r){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer
9=r||ox(e)}V(e,t,r,n=!1){return new lJ({dataSource:e,methodName:t,targetDoc:r,path:W.emptyPath(),arrayElement:!1,hasConverter:n},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function lZ(e){let t=e._freezeSettings(),r=ox(e._databaseId);return new lX(e._databaseId,!!t.ignoreUndefinedProperties,r)}class l0 extends lq{_toFieldTransform(e){if(2!==e.dataSource)throw 1===e.dataSource?e.Dc(`${this._methodName}() can only appear at the top level of your update data`):e.Dc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof l0}}function l1(e,t,r){return new lJ({dataSource:3,targetDoc:t.settings.targetDoc,methodName:e._methodName,arrayElement:r},t.databaseId,t.serializer,t.ignoreUndefinedProperties)}class l2 extends lq{_toFieldTransform(e){return new nT(e.path,new ng)}isEqual(e){return e instanceof l2}}class l4 extends lq{constructor(e,t){super(e),this.vc=t}_toFieldTransform(e){let t=l1(this,e,!0),r=new ny(this.vc.map(e=>l3(e,t)));return new nT(e.path,r)}isEqual(e){return e instanceof l4&&c.deepEqual(this.vc,e.vc)}}class l6 extends lq{constructor(e,t){super(e),this.vc=t}_toFieldTransform(e){let t=l1(this,e,!0),r=new nw(this.vc.map(e=>l3(e,t)));return new nT(e.path,r)}isEqual(e){return e instanceof l6&&c.deepEqual(this.vc,e.vc)}}class l8 extends lq{constructor(e,t){super(e),this.Fc=t}_toFieldTransform(e){let t=new n_(e.serializer,nf(e.serializer,this.Fc));return new nT(e.path,t)}isEqual(e){return e instanceof l8&&this.Fc===e.Fc}}function l3(e,t){if(l9(e=c.getModularInstance(e)))return l7("Unsupported field value:",t,e),l5(e,t);if(e instanceof lq)return function(e,t){if(!lY(t.dataSource))throw t.Dc(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.Dc(`${e._methodName}() is not currently supported inside arrays`);let r=e._toFieldTransform(t);r&&t.fieldTransforms.push(r)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.arrayElement&&4!==t.dataSource)throw t.Dc("Nested arrays are not supported");return function(e,t){let r=[],n=0;for(let i of e){let e=l3(i,t.bc(n));null==e&&(e={nullValue:"NULL_VALUE"}),r.push(e),n++}return{arrayValue:{values:r}}}(e,t)}return function(e,t){if(null===(e=c.getModularInstance(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return nf(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){let r=en.fromDate(e);return{timestampValue:ii(t.serializer,r)}}if(e instanceof en){let r=new en(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:ii(t.serializer,r)}}if(e instanceof lG)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof lH)return{bytesValue:is(t.serializer,e._byteString)};if(e instanceof lx){let r=t.databaseId,n=e.firestore._databaseId;if(!n.isEqual(r))throw t.Dc(`Document reference is for database ${n.projectId}/${n.database} but should be for database ${r.projectId}/${r.database}`);return{referenceValue:ia(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof lW){var r;return{mapValue:{fields:{[t6]:{stringValue:t5},[t9]:{arrayValue:{values:((r=e)instanceof lW?r.toArray():r).map(e=>{if("number"!=typeof e)throw t.Dc("VectorValues must only contain numeric values.");return nh(t.serializer,e)})}}}}}}if(iR(e))return e._toProto(t.serializer);throw t.Dc(`Unsupported field value: ${Z(e)}`)}(e,t)}function l5(e,t){let r={};return tO(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):tD(e,(e,n)=>{let i=l3(n,t.yc(e));null!=i&&(r[e]=i)}),{mapValue:{fields:r}}}function l9(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof en||e instanceof lG||e instanceof lH||e instanceof lx||e instanceof lq||e instanceof lW||iR(e))}function l7(e,t,r){if(!l9(r)||!X(r)){let n=Z(r);throw"an object"===n?t.Dc(e+" a custom object"):t.Dc(e+" "+n)}}function ue(e,t,r){if((t=c.getModularInstance(t))instanceof lz)return t._internalPath;if("string"==typeof t)return ur(e,t);throw un("Field path arguments must be of type string or ",e,!1,void 0,r)}let ut=RegExp("[~\\*/\\[\\]]");function ur(e,t,r){if(t.search(ut)>
9=0)throw un(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,r);try{return new lz(...t.split("."))._internalPath}catch(n){throw un(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,r)}}function un(e,t,r,n,i){let s=n&&!n.isEmpty(),o=void 0!==i,a=`Function ${t}() called with invalid data`;r&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(s||o)&&(l+=" (found",s&&(l+=` in field ${n}`),o&&(l+=` in document ${i}`),l+=")"),new A(S.INVALID_ARGUMENT,a+e+l)}function ui(e,t){return e.some(e=>e.isEqual(t))}class us{convertValue(e,t="none"){switch(re(e)){case 0:return null;case 1:return e.booleanValue;case 2:return tW(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(t$(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw E(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){let r={};return tD(e,(e,n)=>{r[e]=this.convertValue(n,t)}),r}convertVectorValue(e){return new lW(e.fields?.[t9].arrayValue?.values?.map(e=>tW(e.doubleValue)))}convertGeoPoint(e){return new lG(tW(e.latitude),tW(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":let r=tZ(e);return null==r?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(t0(e));default:return null}}convertTimestamp(e){let t=tG(e);return new en(t.seconds,t.nanos)}convertDocumentKey(e,t){let r=q.fromString(e);T(iP(r),9688,{name:e});let n=new t4(r.get(1),r.get(3)),i=new $(r.popFirst(5));return n.isEqual(t)||w(`Document ${i} contains a document reference within a different database (${n.projectId}/${n.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}class uo extends us{constructor(e){super(),this.firestore=e}convertBytes(e){return new lH(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new lx(this.firestore,null,t)}}class ua{constructor(e){this.optionDefinitions=e}_getKnownOptions(e,t){let r=rw.empty();for(let n in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(n)){let i=this.optionDefinitions[n];if(n in e){let s;let o=e[n];i.nestedOptions&&X(o)?s={mapValue:{fields:new ua(i.nestedOptions).getOptionsProto(t,o)}}:o&&(s=l3(o,t)??void 0),s&&r.set(W.fromServerFormat(i.serverName),s)}}return r}getOptionsProto(e,t,r){let n=this._getKnownOptions(t,e);if(r){let t=new Map(tN(r,(t,r)=>[W.fromServerFormat(r),void 0!==t?l3(t,e):null]));n.setAll(t)}return n.value.mapValue.fields??{}}}class ul{constructor(e={},t={}){this.Mc=e,this.xc=t,this.Oc=new ua({indexMode:{serverName:"index_mode"}})}_readUserData(e){this.proto=this.Oc.getOptionsProto(e,this.Mc,this.xc)}}class uu{constructor(e,t){this.pipeline=e,this.options=t}_toProto(e){return{pipeline:this.pipeline._toProto(e),options:this.options.proto}}}t.AbstractUserDataWriter=us,t.Bound=r_,t.ByteString=tz,t.Bytes=lH,t.CollectionReference=lD,t.CompositeFilter=rC,t.D=S,t.DatabaseId=t4,t.DocumentKey=$,t.DocumentReference=lx,t.DocumentSet=aa,t.F=H,t.FieldFilter=rA,t.FieldIndex=es,t.FieldPath=lz,t.FieldPath$1=W,t.FieldValue=lq,t.Firestore=lF,t.FirestoreError=A,t.GeoPoint=lG,t.IndexSegment=eu,t.IndexState=ec,t.LoadBundleTask=lL,t.ObjectValue=rw,t.OnlineComponentProvider=ln,t.OptionsUtil=ua,t.OrderBy=rT,t.Precondition=nA,t.Query=lk,t.ResourcePath=q,t.StructuredPipeline=uu,t.Timestamp=en,t.VectorValue=lW,t.ViewSnapshot=au,t.__PRIVATE_AggregateImpl=nH,t.__PRIVATE_AutoId=F,t.__PRIVATE_BundleLoader=a_,t.__PRIVATE_DeleteMutation=nF,t.__PRIVATE_EmptyAppCheckTokenProvider=L,t.__PRIVATE_EmptyAuthCredentialsProvider=R,t.__PRIVATE_ExpUserDataWriter=uo,t.__PRIVATE_FirebaseAppCheckTokenProvider=M,t.__PRIVATE_FirebaseAuthCredentialsProvider=x,t.__PRIVATE_IndexedDbOfflineComponentProvider=lt,t.__PRIVATE_LruGcMemoryOfflineComponentProvider=le,t.__PRIVATE_MemoryOfflineComponentProvider=a7,t.__PRIVATE_MultiTabOfflineComponentProvider=lr,t.__PRIVATE_StructuredPipelineOptions=ul,t.__PRIVATE_cast=ee,t.__PRIVATE_createBundleReaderSync=function(e,t){return new la(e,t)},t.__PRIVATE_databaseIdFromApp=function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new A(S.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new t4(e.options.projectId,t)},t.__PRIVATE_debugAssert=function(e,t){e||E(57014,t)},t.__PRIVATE_documentKeySet=nu,t.__PRIVATE_fieldPathFromArgument=ue,t.__PRIVATE_fieldPathFromDotSeparatedString=ur,t.__PRIVATE_firestoreClientAddSnapshotsInSyncListener=function(e,t){let r=new ls(t);return e.asyncQueue.enqueueAndForget(async()=>{(await l_(e)).xa.add(r),r.next()}),()=>{r.Ku(),e.asyncQueue.enqueueAndForget(async()=>(function(e,t){e.xa.delete(t)})(await l_(e),r))}},t.__PRIVATE_firestoreClientDeleteAllFieldIndexes=function(e){return e.asyncQueue.enqueue(async()=>(function(e){let t=e.indexManager;return e.persistence.runTransaction("Delete All Indexes","readwrite",e=>t.deleteAllFieldIndexes(e))})(await ly(e)))},t.__PRIVATE_firestoreClientExecutePipeline=function(e,t){let r=new C;return e.asyncQueue.enqueueAndForget(async()=>{try{let n=await lb(e);r.resolve(async function(e,t){let r={database:im(e.serializer),structuredPipeline:t._toProto(e.serializer)},n=await e.jo("ExecutePipeline",e.serializer.databaseId,q.emptyPath(),r),i=[];
9return n.forEach(t=>{if(t.results&&0!==t.results.length)return t.results.forEach(r=>i.push(iv(e.serializer,t,r)));i.push(iv(e.serializer,t))}),i}(n,t))}catch(e){r.reject(e)}}),r.promise},t.__PRIVATE_firestoreClientGetDocumentFromLocalCache=function(e,t){let r=new C;return e.asyncQueue.enqueueAndForget(async()=>(async function(e,t,r){try{let n=await e.persistence.runTransaction("read document","readonly",r=>e.localDocuments.getDocument(r,t));n.isFoundDocument()?r.resolve(n):n.isNoDocument()?r.resolve(null):r.reject(new A(S.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(n){let e=ao(n,`Failed to get document '${t} from cache`);r.reject(e)}})(await ly(e),t,r)),r.promise},t.__PRIVATE_firestoreClientGetDocumentViaSnapshotListener=function(e,t,r={}){let n=new C;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,r,n,i){let s=new ls({next:a=>{s.Ku(),t.enqueueAndForget(()=>ap(e,o));let l=a.docs.has(r);!l&&a.fromCache?i.reject(new A(S.UNAVAILABLE,"Failed to get document because the client is offline.")):l&&a.fromCache&&n&&"server"===n.source?i.reject(new A(S.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(a)},error:e=>i.reject(e)}),o=new av(rY(r.path),s,{includeMetadataChanges:!0,Wa:!0});return af(e,o)})(await l_(e),e.asyncQueue,t,r,n)),n.promise},t.__PRIVATE_firestoreClientGetDocumentsFromLocalCache=function(e,t){let r=new C;return e.asyncQueue.enqueueAndForget(async()=>(async function(e,t,r){try{let n=await s5(e,t,!0),i=new aS(t,n.ks),s=i._u(n.documents),o=i.applyChanges(s,!1);r.resolve(o.snapshot)}catch(n){let e=ao(n,`Failed to execute query '${t} against cache`);r.reject(e)}})(await ly(e),t,r)),r.promise},t.__PRIVATE_firestoreClientGetDocumentsViaSnapshotListener=function(e,t,r={}){let n=new C;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,r,n,i){let s=new ls({next:r=>{s.Ku(),t.enqueueAndForget(()=>ap(e,o)),r.fromCache&&"server"===n.source?i.reject(new A(S.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(r)},error:e=>i.reject(e)}),o=new av(r,s,{includeMetadataChanges:!0,Wa:!0});return af(e,o)})(await l_(e),e.asyncQueue,t,r,n)),n.promise},t.__PRIVATE_firestoreClientListen=function(e,t,r,n){let i=new ls(n),s=new av(t,i,r);return e.asyncQueue.enqueueAndForget(async()=>af(await l_(e),s)),()=>{i.Ku(),e.asyncQueue.enqueueAndForget(async()=>ap(await l_(e),s))}},t.__PRIVATE_firestoreClientRunAggregateQuery=function(e,t,r){let n=new C;return e.asyncQueue.enqueueAndForget(async()=>{try{let i=await lb(e);n.resolve(async function(e,t,r){let{request:n,gt:i,parent:s}=iT(e.serializer,r2(t),r);e.connection.Ko||delete n.parent;let o=(await e.jo("RunAggregationQuery",e.serializer.databaseId,s,n,1)).filter(e=>!!e.result);T(1===o.length,64727);let a=o[0].result?.aggregateFields;return Object.keys(a).reduce((e,t)=>(e[i[t]]=a[t],e),{})}(i,t,r))}catch(e){n.reject(e)}}),n.promise},t.__PRIVATE_firestoreClientSetIndexConfiguration=function(e,t){return e.asyncQueue.enqueue(async()=>(async function(e,t){let r=e.indexManager,n=[];return e.persistence.runTransaction("Configure indexes","readwrite",e=>r.getFieldIndexes(e).next(i=>(function(e,t,r,n,i){t=[...t],(e=[...e]).sort(r),t.sort(r);let s=e.length,o=t.length,a=0,l=0;for(;a<o&&l<s;){let s=r(e[l],t[a]);s<0?i(e[l++]):s>0?n(t[a++]):(a++,l++)}for(;a<o;)n(t[a++]);for(;l<s;)i(e[l++])})(i,t,el,t=>{n.push(r.addFieldIndex(e,t))},t=>{n.push(r.deleteFieldIndex(e,t))})).next(()=>ev.waitFor(n)))})(await ly(e),t))},t.__PRIVATE_firestoreClientSetPersistentCacheIndexAutoCreationEnabled=function(e,t){return e.asyncQueue.enqueue(async()=>{(await ly(e)).Cs.As=t})},t.__PRIVATE_firestoreClientTransaction=function(e,t,r){let n=new C;return e.asyncQueue.enqueueAndForget(async()=>{let i=await lb(e);new lu(e.asyncQueue,i,r,t,n).Xu()}),n.promise},t.__PRIVATE_firestoreClientWrite=function(e,t){let r=new C;return e.asyncQueue.enqueueAndForget(async()=>aL(await lw(e),t,r)),r.promise},t.__PRIVATE_fromBundledQuery=iU,t.__PRIVATE_fromDocument=iw,t.__PRIVATE_hardAssert=T,t.__PRIVATE_isBase64Available=function(){return"undefined"!=typeof atob},t.__PRIVATE_isCollectionGroupQuery=rZ,t.__PRIVATE_isCollectionReference=function(e){return e instanceof lD},t.__PRIVATE_isDocumentQuery$1=rX,t.__PRIVATE_isNumber$1=function(e){return"number"==typeof e},t.__PRIVATE_isOptionalEqual=function(e,t,r){return void 0===e&&void 0===t||void 0!==e&&void 0!==t&&r(e,t)},t.__PRIVATE_isPlainObject=X,t.__PRIVATE_isServerTimestamp=tX,t.__PRIVATE_isString=function(e){return"string"==typeof e},t.__PRIVATE_isUserData=function(e){return"function"==typeof e._readUserData},t.__PRIVATE_logDebug=v,t.__PRIVATE_logWarn=b,t.__PRIVATE_mapToArray=tN,t.__PRIVATE_newQueryForPath=rY,t.__PRIVATE_newSerializer
9=ox,t.__PRIVATE_newUserDataReader=lZ,t.__PRIVATE_parseData=l3,t.__PRIVATE_parseQueryValue=function(e,t,r,n=!1){return l3(r,e.V(n?4:3,t))},t.__PRIVATE_parseSetData=function(e,t,r,n,i,s={}){let o,a;let l=e.V(s.merge||s.mergeFields?2:0,t,r,i);l7("Data must be an object, but it was:",l,n);let u=l5(n,l);if(s.merge)o=new tj(l.fieldMask),a=l.fieldTransforms;else if(s.mergeFields){let e=[];for(let n of s.mergeFields){let i=ue(t,n,r);if(!l.contains(i))throw new A(S.INVALID_ARGUMENT,`Field '${i}' is specified in your field mask but missing from your input data.`);ui(e,i)||e.push(i)}o=new tj(e),a=l.fieldTransforms.filter(e=>o.covers(e.field))}else o=null,a=l.fieldTransforms;return new lK(new rw(u),o,a)},t.__PRIVATE_parseUpdateData=function(e,t,r,n){let i=e.V(1,t,r);l7("Data must be an object, but it was:",i,n);let s=[],o=rw.empty();return tD(n,(e,n)=>{let a=ur(t,e,r);n=c.getModularInstance(n);let l=i.Sc(a);if(n instanceof l0)s.push(a);else{let e=l3(n,l);null!=e&&(s.push(a),o.set(a,e))}}),new lQ(o,new tj(s),i.fieldTransforms)},t.__PRIVATE_parseUpdateVarargs=function(e,t,r,n,i,s){let o=e.V(1,t,r),a=[ue(t,n,r)],l=[i];if(s.length%2!=0)throw new A(S.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let e=0;e<s.length;e+=2)a.push(ue(t,s[e])),l.push(s[e+1]);let u=[],h=rw.empty();for(let e=a.length-1;e>=0;--e)if(!ui(u,a[e])){let t=a[e],r=l[e];r=c.getModularInstance(r);let n=o.Sc(t);if(r instanceof l0)u.push(t);else{let e=l3(r,n);null!=e&&(u.push(t),h.set(t,e))}}return new lQ(h,new tj(u),o.fieldTransforms)},t.__PRIVATE_queryNormalizedOrderBy=r0,t.__PRIVATE_queryWithAddedFilter=function(e,t){let r=e.filters.concat([t]);return new rQ(e.path,e.collectionGroup,e.explicitOrderBy.slice(),r,e.limit,e.limitType,e.startAt,e.endAt)},t.__PRIVATE_queryWithAddedOrderBy=function(e,t){let r=e.explicitOrderBy.concat([t]);return new rQ(e.path,e.collectionGroup,r,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)},t.__PRIVATE_queryWithEndAt=function(e,t){return new rQ(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)},t.__PRIVATE_queryWithLimit=r6,t.__PRIVATE_queryWithStartAt=function(e,t){return new rQ(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)},t.__PRIVATE_refValue=ra,t.__PRIVATE_setSDKVersion=function(e){m=e},t.__PRIVATE_setTestingHooksSpi=function(e){if(nW)throw Error("a TestingHooksSpi instance is already set");nW=e},t.__PRIVATE_toMapValue=function(e,t){let r={fields:{}};return t.forEach((t,n)=>{if("string"!=typeof n)throw Error(`Cannot encode map with non-string key: ${n}`);r.fields[n]=t._toProto(e)}),{mapValue:r}},t.__PRIVATE_toPipelineValue=function(e){return{pipelineValue:e}},t.__PRIVATE_toStringValue=function(e){return{stringValue:e}},t.__PRIVATE_validateIsNotUsedTogether=Q,t.__PRIVATE_validateJSON=er,t.__PRIVATE_validatePositiveNumber=function(e,t){if(t<=0)throw new A(S.INVALID_ARGUMENT,`Function ${e}() requires a positive number, but it was: ${t}.`)},t.__PRIVATE_valueDescription=Z,t._internalAggregationQueryToProtoRunAggregationQueryRequest=function(e,t){let r=tN(t,(e,t)=>new nH(t,e.aggregateType,e._internalFieldPath)),n=lV(ee(e.firestore,lF)),i=n._onlineComponents?.datastore.serializer;return void 0===i?null:iT(i,r2(e._query),r,!0).request},t._internalPipelineToExecutePipelineRequestProto=function(e){if(!e._db)throw new A(S.FAILED_PRECONDITION,"This pipeline was created without a database and cannot be serialized for execution.");let t=ee(e._db,lF),r=lZ(t).V(3,"_internalPipelineToExecutePipelineRequestProto");e._readUserData(r);let n=function(e){if(e._terminated)throw new A(S.FAILED_PRECONDITION,"The client has already been terminated.");if(!lT.has(e)){v(lI,"Initializing Datastore");let t=new oP(lS(e._databaseId,e.app.options.appId||"",e._persistenceKey,e.app.options.apiKey,e._freezeSettings())),r=ox(e._databaseId),n=new oV(e._authCredentials,e._appCheckCredentials,t,r);lT.set(e,n)}return lT.get(e)}(t).serializer;if(void 0===n)return null;let i=new uu(e,new ul);return{database:im(n),structuredPipeline:i._toProto(n)}},t._internalQueryToProtoQueryTarget=function(e){let t=lV(ee(e.firestore,lF)),r=t._onlineComponents?.datastore.serializer;return void 0===r?null:iI(r,r1(e._query)).ft},t.arrayRemove=function(...e){return new l6("arrayRemove",e)},t.arrayUnion=function(...e){return new l4("arrayUnion",e)},t.clearIndexedDbPersistence=function(e){if(e._initialized&&!e._terminated)throw new A(S.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");let t=new C;return e._queue.enqueueAndForgetEvenWhileRestricted(async()=>{try{await async function(e){if(!e_.v())return Promise.resolve();await e_.delete(e+sK)}(sY(e._databaseId,e._persistenceKey)),t.resolve()}catch(e){t.reject(e)}}),t.promise},t.collection=function(e,t,...r){if(e=c.getModularInstance(e),K("collection","path",t),e instanceof lP){let n=q.fromString(t,...r);return J(n),new lD(e,null,n)}{if(!(e instanceof lx||e instanceof lD))throw new A(S.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let n=e._path.child(q.fromString(t,...r));
9return J(n),new lD(e.firestore,null,n)}},t.collectionGroup=function(e,t){if(e=ee(e,lP),K("collectionGroup","collection id",t),t.indexOf("/")>=0)throw new A(S.INVALID_ARGUMENT,`Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new lk(e,null,new rQ(q.emptyPath(),t))},t.connectFirestoreEmulator=lR,t.deleteField=function(){return new l0("deleteField")},t.disableNetwork=function(e){var t;return(t=lV(e=ee(e,lF))).asyncQueue.enqueue(async()=>{let e=await lg(t),r=await lv(t);return e.setNetworkEnabled(!1),async function(e){e.da.add(0),await oz(e),e.ga.set("Offline")}(r)})},t.doc=function(e,t,...r){if(e=c.getModularInstance(e),1==arguments.length&&(t=F.newId()),K("doc","path",t),e instanceof lP){let n=q.fromString(t,...r);return Y(n),new lx(e,null,new $(n))}{if(!(e instanceof lx||e instanceof lD))throw new A(S.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let n=e._path.child(q.fromString(t,...r));return Y(n),new lx(e.firestore,e instanceof lD?e.converter:null,new $(n))}},t.documentId=function(){return new lz(H)},t.enableIndexedDbPersistence=function(e,t){b("enableIndexedDbPersistence() will be deprecated 
9in the future, you can use `FirestoreSettings.cache` instead.");let r=e._freezeSettings();return lj(e,ln.provider,{build:e=>new lt(e,r.cacheSizeBytes,t?.forceOwnership)}),Promise.resolve()},t.enableMultiTabIndexedDbPersistence=lB,t.enableNetwork=function(e){var t;return(t=lV(e=ee(e,lF))).asyncQueue.enqueue(async()=>{let e=await lg(t),r=await lv(t);return e.setNetworkEnabled(!0),r.da.delete(0),oH(r)})},t.ensureFirestoreConfigured=lV,t.fail=E,t.getFirestore=function(e,t){let r="object"==typeof e?e:u.getApp(),n="string"==typeof e?e:t||t2,i=u._getProvider(r,"firestore").getImmediate({identifier:n});if(!i._initialized){let e=c.getDefaultEmulatorHostnameAndPort("firestore");e&&lR(i,...e)}return i},t.increment=function(e){return new l8("increment",e)},t.initializeFirestore=function(e,t,r){r||(r=t2);let n=u._getProvider(e,"firestore");if(n.isInitialized(r)){let e=n.getImmediate({identifier:r}),i=n.getOptions(r);if(c.deepEqual(i,t))return e;throw new A(S.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(void 0!==t.cacheSizeBytes&&void 0!==t.localCache)throw new A(S.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(void 0!==t.cacheSizeBytes&&-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new A(S.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return t.host&&c.isCloudWorkstation(t.host)&&c.pingServer(t.host),n.initialize({options:t,instanceIdentifier:r})},t.loadBundle=function(e,t){let r=lV(e=ee(e,lF)),n=new lL;return function(e,t,r,n){var i;let s=(i=ox(t),new lo(function(e,t){if(e instanceof Uint8Array)return li(e,void 0);if(e instanceof ArrayBuffer)return li(new Uint8Array(e),void 0);if(e instanceof ReadableStream)return e.getReader();throw Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}("string"==typeof r?n$().encode(r):r),i));e.asyncQueue.enqueueAndForget(async()=>{!function(e,t,r){(async function(e,t,r){try{var n;let i=await t.getMetadata();if(await function(e,t){let r=io(t.createTime);return e.persistence.runTransaction("hasNewerBundle","readonly",r=>e.Pi.getBundleMetadata(r,t.id)).then(e=>!!e&&e.createTime.compareTo(r)>=0)}(e.localStore,i))return await t.close(),r._completeWith({taskState:"Success",documentsLoaded:i.totalDocuments,bytesLoaded:i.totalBytes,totalDocuments:i.totalDocuments,totalBytes:i.totalBytes}),Promise.resolve(new Set);r._updateProgress(aE(i));let s=new a_(i,t.serializer),o=await t.Fu();for(;o;){let e=await s.Ha(o);e&&r._updateProgress(e),o=await t.Fu()}let a=await s.Xa(e.localStore);return await aQ(e,a.eu,void 0),await (n=e.localStore).persistence.runTransaction("Save bundle","readwrite",e=>n.Pi.saveBundleMetadata(e,i)),r._completeWith(a.progress),Promise.resolve(a.Ya)}catch(e){return b(aA,`Loading bundle failed with ${e}`),r._failWith(e),Promise.resolve(new Set)}})(e,t,r).then(t=>{e.sharedClientState.notifyBundleLoaded(t)})}(await lw(e),s,n)})}(r,e._databaseId,t,n),n},t.namedQuery=function(e,t){var r;return(r=lV(e=ee(e,lF))).asyncQueue.enqueue(async()=>{var e;return(e=await ly(r)).persistence.runTransaction("Get named query","readonly",r=>e.Pi.getNamedQuery(r,t))}).then(t=>t?new lk(e,null,t.query):null)},t.property=et,t.queryEqual=function(e,t){return e=c.getModularInstance(e),t=c.getModularInstance(t),e instanceof lk&&t instanceof lk&&e.firestore===t.firestore&&r8(e._query,t._query)&&e.converter===t.converter},t.refEqual=function(e,t){return e=c.getModularInstance(e),t=c.getModularInstance(t),(e instanceof lx||e instanceof lD)&&(t instanceof lx||t instanceof lD)&&e.firestore===t.firestore&&e.path===t.path&&e.converter===t.converter},t.serverTimestamp=function(){return new l2("serverTimestamp")},t.setLogLevel=function(e){g.setLogLevel(e)},t.sn=-1,t.terminate=function(e){return u._removeServiceInstance(e.app,"firestore",e._databaseId.database),e._delete()},t.toNumber=nf,t.vector=function(e){return new lW(e)},t.waitForPendingWrites=function(e){return function(e){let t=new C;return e.asyncQueue.enqueueAndForget(async()=>aH(await lw(e),t)),t.promise}(lV(e=ee(e,lF)))}},91779:function(e,t,r){"use strict";
9Object.defineProperty(t,"__esModule",{value:!0});var n=r(99413),i=r(56630),s=r(92090),o=r(71470);r(18779),r(4015),r(43462);let a="@firebase/firestore",l="4.14.1";function u(e){return 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"])}class c{constructor(e="count",t){this._internalFieldPath=t,this.type="AggregateField",this.aggregateType=e}}class h{constructor(e,t,r){this._userDataWriter=t,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}_fieldsProto(){return new s.ObjectValue({mapValue:{fields:this._data}}).clone().value.mapValue.fields}}class d{constructor(e,t,r,n,i){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=n,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new s.DocumentReference(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){let e=new f(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){return this._document?.data.clone().value.mapValue.fields??void 0}get(e){if(this._document){let t=this._document.data.field(s.__PRIVATE_fieldPathFromArgument("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class f extends d{data(){return super.data()}}function p(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new s.FirestoreError(s.D.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class m{}class g extends m{}class y extends g{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type="where"}static _create(e,t,r){return new y(e,t,r)}_apply(e){let t=this._parse(e);return A(e._query,t),new s.Query(e.firestore,e.converter,s.__PRIVATE_queryWithAddedFilter(e._query,t))}_parse(e){let t=s.__PRIVATE_newUserDataReader(e.firestore);return function(e,t,r,n,i,o,a){let l;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid Query. You can't perform '${o}' queries on documentId().`);if("in"===o||"not-in"===o){S(a,o);let t=[];for(let r of a)t.push(T(n,e,r));l={arrayValue:{values:t}}}else l=T(n,e,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||S(a,o),l=s.__PRIVATE_parseQueryValue(r,t,a,"in"===o||"not-in"===o);return s.FieldFilter.create(i,o,l)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}class v extends m{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new v(e,t)}_parse(e){let t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:s.CompositeFilter.create(t,this._getOperator())}_apply(e){let t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let r=e;for(let e of t.getFlattenedFilters())A(r,e),r=s.__PRIVATE_queryWithAddedFilter(r,e)}(e._query,t),new s.Query(e.firestore,e.converter,s.__PRIVATE_queryWithAddedFilter(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class w extends g{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new w(e,t)}_apply(e){let t=function(e,t,r){if(null!==e.startAt)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new s.OrderBy(t,r)}(e._query,this._field,this._direction);return new s.Query(e.firestore,e.converter,s.__PRIVATE_queryWithAddedOrderBy(e._query,t))}}class b extends g{constructor(e,t,r){super(),this.type=e,this._limit=t,this._limitType=r}static _create(e,t,r){return new b(e,t,r)}_apply(e){return new s.Query(e.firestore,e.converter,s.__PRIVATE_queryWithLimit(e._query,this._limit,this._limitType))}}class _ extends g{constructor(e,t,r){super(),this.type=e,this._docOrFields=t,this._inclusive=r}static _create(e,t,r){return new _(e,t,r)}_apply(e){let t=I(e,this.type,this._docOrFields,this._inclusive);return new s.Query(e.firestore,e.converter,s.__PRIVATE_queryWithStartAt(e._query,t))}}class E extends g{constructor(e,t,r){super(),this.type=e,this._docOrFields=t,this._inclusive=r}static _create(e,t,r){return new E(e,t,r)}_apply(e){let t=I(e,this.type,this._docOrFields,this._inclusive);return new s.Query(e.firestore,e.converter,s.__PRIVATE_queryWithEndAt(e._query,t))}}function I(e,t,r,n){if(r[0]=o.getModularInstance(r[0]),r[0]instanceof d)return function(e,t,r,n,i){if(!n)throw new s.FirestoreError(s.D.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${r}().`);let o=[];for(let r of s.__PRIVATE_queryNormalizedOrderBy(e))if(r.field.isKeyField())o.push(s.__PRIVATE_refValue(t,n.key));else{let e=n.data.field(r.field);if(s.__PRIVATE_isServerTimestamp(e))throw new s.FirestoreError(s.D.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+r.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===e){let e=r.field.canonicalString();throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`)}o.push(e)}return new s.Bound(o,i)}(e._query,e.firestore._databaseId,t,r[0]._document,n);{let i=s.__PRIVATE_newUserDataReader(e.firestore);return function(e,t,r,n,i,o){let a=e.explicitOrderBy;if(i.length>a.length)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);let l=[];for(let o=0;o<i.length;o++){let u=i[o];
9if(a[o].field.isKeyField()){if("string"!=typeof u)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);if(!s.__PRIVATE_isCollectionGroupQuery(e)&&-1!==u.indexOf("/"))throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${n}() must be a plain document ID, but '${u}' contains a slash.`);let r=e.path.child(s.ResourcePath.fromString(u));if(!s.DocumentKey.isDocumentKey(r))throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${n}() must result in a valid document path, but '${r}' is not because it contains an odd number of segments.`);let i=new s.DocumentKey(r);l.push(s.__PRIVATE_refValue(t,i))}else{let e=s.__PRIVATE_parseQueryValue(r,n,u);l.push(e)}}return new s.Bound(l,o)}(e._query,e.firestore._databaseId,i,t,r,n)}}function T(e,t,r){if("string"==typeof(r=o.getModularInstance(r))){if(""===r)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!s.__PRIVATE_isCollectionGroupQuery(t)&&-1!==r.indexOf("/"))throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);let n=t.path.child(s.ResourcePath.fromString(r));if(!s.DocumentKey.isDocumentKey(n))throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);return s.__PRIVATE_refValue(e,new s.DocumentKey(n))}if(r instanceof s.DocumentReference)return s.__PRIVATE_refValue(e,r._key);throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${s.__PRIVATE_valueDescription(r)}.`)}function S(e,t){if(!Array.isArray(e)||0===e.length)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${t.toString()}' filters.`)}function A(e,t){let r=function(e,t){for(let r of e)for(let e of r.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==r)throw r===t.op?new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new s.FirestoreError(s.D.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${r.toString()}' filters.`)}function C(e,t){if(!(t instanceof y||t instanceof v))throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}function P(e,t,r){return e?r&&(r.merge||r.mergeFields)?e.toFirestore(t,r):e.toFirestore(t):t}class R extends s.AbstractUserDataWriter{constructor(e){super(),this.firestore=e}convertBytes(e){return new s.Bytes(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new s.DocumentReference(this.firestore,null,t)}}function k(){return new c("count")}function x(e,t){let r=s.__PRIVATE_cast(e.firestore,s.Firestore),n=s.ensureFirestoreConfigured(r),i=s.__PRIVATE_mapToArray(t,(e,t)=>new s.__PRIVATE_AggregateImpl(t,e.aggregateType,e._internalFieldPath));return s.__PRIVATE_firestoreClientRunAggregateQuery(n,e._query,i).then(t=>new h(e,new s.__PRIVATE_ExpUserDataWriter(r),t))}class D{constructor(e){this.kind="memory",this._onlineComponentProvider=s.OnlineComponentProvider.provider,this._offlineComponentProvider=e?.garbageCollector?e.garbageCollector._offlineComponentProvider:{build:()=>new s.__PRIVATE_LruGcMemoryOfflineComponentProvider(void 0)}}toJSON(){return{kind:this.kind}}}class N{constructor(e){let t;this.kind="persistent",e?.tabManager?(e.tabManager._initialize(e),t=e.tabManager):(t=V(void 0))._initialize(e),this._onlineComponentProvider=t._onlineComponentProvider,this._offlineComponentProvider=t._offlineComponentProvider}toJSON(){return{kind:this.kind}}}class O{constructor(){this.kind="memoryEager",this._offlineComponentProvider=s.__PRIVATE_MemoryOfflineComponentProvider.provider}toJSON(){return{kind:this.kind}}}class M{constructor(e){this.kind="memoryLru",this._offlineComponentProvider={build:()=>new s.__PRIVATE_LruGcMemoryOfflineComponentProvider(e)}}toJSON(){return{kind:this.kind}}}class L{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=s.OnlineComponentProvider.provider,this._offlineComponentProvider={build:t=>new s.__PRIVATE_IndexedDbOfflineComponentProvider(t,e?.cacheSizeBytes,this.forceOwnership)}}}class F{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=s.OnlineComponentProvider.provider,this._offlineComponentProvider={build:t=>new s.__PRIVATE_MultiTabOfflineComponentProvider(t,e?.cacheSizeBytes)}}}function V(e){return new L(e?.forceOwnership)}let U="NOT SUPPORTED";class B{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class j extends d{constructor(e,t,r,n,i,s){super(e,t,r,n,s),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new H(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(s.__PRIVATE_fieldPathFromArgument("DocumentSnapshot.get",e));if(null!==r)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new s.FirestoreError(s.D.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=j._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()&&
9(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED")),t}}j._jsonSchemaVersion="firestore/documentSnapshot/1.0",j._jsonSchema={type:s.property("string",j._jsonSchemaVersion),bundleSource:s.property("string","DocumentSnapshot"),bundleName:s.property("string"),bundle:s.property("string")};class H extends j{data(e={}){return super.data(e)}}class z{constructor(e,t,r,n){this._firestore=e,this._userDataWriter=t,this._snapshot=n,this.metadata=new B(n.hasPendingWrites,n.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 H(this._firestore,this._userDataWriter,r.key,r,new B(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 s.FirestoreError(s.D.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 n=new H(e._firestore,e._userDataWriter,r.doc.key,r.doc,new B(e._snapshot.mutatedKeys.has(r.doc.key),e._snapshot.fromCache),e.query.converter);return r.doc,{type:"added",doc:n,oldIndex:-1,newIndex:t++}})}{let r=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{let n=new H(e._firestore,e._userDataWriter,t.doc.key,t.doc,new B(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,o=-1;return 0!==t.type&&(i=r.indexOf(t.doc.key),r=r.delete(t.doc.key)),1!==t.type&&(o=(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 s.fail(61501,{type:e})}}(t.type),doc:n,oldIndex:i,newIndex:o}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new s.FirestoreError(s.D.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e={};e.type=z._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=s.__PRIVATE_AutoId.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;let t=[],r=[],n=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),r.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,"previous")),n.push(e.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}z._jsonSchemaVersion="firestore/querySnapshot/1.0",z._jsonSchema={type:s.property("string",z._jsonSchemaVersion),bundleSource:s.property("string","QuerySnapshot"),bundleName:s.property("string"),bundle:s.property("string")};let q={maxAttempts:5};class G{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=s.__PRIVATE_newUserDataReader(e)}set(e,t,r){this._verifyNotCommitted();let n=W(e,this._firestore),i=P(n.converter,t,r),o=s.__PRIVATE_parseSetData(this._dataReader,"WriteBatch.set",n._key,i,null!==n.converter,r);return this._mutations.push(o.toMutation(n._key,s.Precondition.none())),this}update(e,t,r,...n){let i;this._verifyNotCommitted();let a=W(e,this._firestore);return i="string"==typeof(t=o.getModularInstance(t))||t instanceof s.FieldPath?s.__PRIVATE_parseUpdateVarargs(this._dataReader,"WriteBatch.update",a._key,t,r,n):s.__PRIVATE_parseUpdateData(this._dataReader,"WriteBatch.update",a._key,t),this._mutations.push(i.toMutation(a._key,s.Precondition.exists(!0))),this}delete(e){this._verifyNotCommitted();let t=W(e,this._firestore);return this._mutations=this._mutations.concat(new s.__PRIVATE_DeleteMutation(t._key,s.Precondition.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new s.FirestoreError(s.D.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function W(e,t){if((e=o.getModularInstance(e)).firestore!==t)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}class ${constructor(e,t){this._firestore=e,this._transaction=t,this._dataReader=s.__PRIVATE_newUserDataReader(e)}get(e){let t=W(e,this._firestore),r=new R(this._firestore);return this._transaction.lookup([t._key]).then(e=>{if(!e||1!==e.length)return s.fail(24041);let n=e[0];if(n.isFoundDocument())return new d(this._firestore,r,n.key,n,t.converter);if(n.isNoDocument())return new d(this._firestore,r,t._key,null,t.converter);throw s.fail(18433,{doc:n})})}set(e,t,r){let n=W(e,this._firestore),i=P(n.converter,t,r),o=s.__PRIVATE_parseSetData(this._dataReader,"Transaction.set",n._key,i,null!==n.converter,r);return this._transaction.set(n._key,o),this}update(e,t,r,...n){let i;let a=W(e,this._firestore);return i="string"==typeof(t=o.getModularInstance(t))||t instanceof s.FieldPath?s.__PRIVATE_parseUpd
9ateVarargs(this._dataReader,"Transaction.update",a._key,t,r,n):s.__PRIVATE_parseUpdateData(this._dataReader,"Transaction.update",a._key,t),this._transaction.update(a._key,i),this}delete(e){let t=W(e,this._firestore);return this._transaction.delete(t._key),this}}class K extends ${constructor(e,t){super(e,t),this._firestore=e}get(e){let t=W(e,this._firestore),r=new s.__PRIVATE_ExpUserDataWriter(this._firestore);return super.get(e).then(e=>new j(this._firestore,r,t._key,e._document,new B(!1,!1),t.converter))}}function Q(e,...t){let r,n,i;e=o.getModularInstance(e);let a={includeMetadataChanges:!1,source:"default"},l=0;"object"!=typeof t[0]||u(t[l])||(a=t[l++]);let c={includeMetadataChanges:a.includeMetadataChanges,source:a.source};if(u(t[l])){let e=t[l];t[l]=e.next?.bind(e),t[l+1]=e.error?.bind(e),t[l+2]=e.complete?.bind(e)}if(e instanceof s.DocumentReference)n=s.__PRIVATE_cast(e.firestore,s.Firestore),i=s.__PRIVATE_newQueryForPath(e._key.path),r={next:r=>{t[l]&&t[l](J(n,e,r))},error:t[l+1],complete:t[l+2]};else{let o=s.__PRIVATE_cast(e,s.Query);n=s.__PRIVATE_cast(o.firestore,s.Firestore),i=o._query;let a=new s.__PRIVATE_ExpUserDataWriter(n);r={next:e=>{t[l]&&t[l](new z(n,a,o,e))},error:t[l+1],complete:t[l+2]},p(e._query)}let h=s.ensureFirestoreConfigured(n);return s.__PRIVATE_firestoreClientListen(h,i,c,r)}function Y(e,t){let r=s.ensureFirestoreConfigured(e);return s.__PRIVATE_firestoreClientWrite(r,t)}function J(e,t,r){let n=r.docs.get(t._key),i=new s.__PRIVATE_ExpUserDataWriter(e);return new j(e,i,t._key,n,new B(r.hasPendingWrites,r.fromCache),t.converter)}function X(e,t){if("string"!=typeof e[t])throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"Missing string value for: "+t);return e[t]}class Z{constructor(e){this._firestore=e,this.type="PersistentCacheIndexManager"}}function ee(e,t){let r=s.ensureFirestoreConfigured(e._firestore);s.__PRIVATE_firestoreClientSetPersistentCacheIndexAutoCreationEnabled(r,t).then(e=>s.__PRIVATE_logDebug(`setting persistent cache index auto creation isEnabled=${t} succeeded`)).catch(e=>s.__PRIVATE_logWarn(`setting persistent cache index auto creation isEnabled=${t} failed`,e))}let et=new WeakMap;class er{constructor(){throw Error("instances of this class should not be created")}static onExistenceFilterMismatch(e){return en.instance.onExistenceFilterMismatch(e)}}class en{constructor(){this.t=new Map}static get instance(){return ei||(ei=new en,s.__PRIVATE_setTestingHooksSpi(ei)),ei}o(e){this.t.forEach(t=>t(e))}onExistenceFilterMismatch(e){let t=Symbol(),r=this.t;return r.set(t,e),()=>r.delete(t)}}let ei=null;!function(e=!0){s.__PRIVATE_setSDKVersion(n.SDK_VERSION),n._registerComponent(new i.Component("firestore",(t,{instanceIdentifier:r,options:n})=>{let i=t.getProvider("app").getImmediate(),o=new s.Firestore(new s.__PRIVATE_FirebaseAuthCredentialsProvider(t.getProvider("auth-internal")),new s.__PRIVATE_FirebaseAppCheckTokenProvider(i,t.getProvider("app-check-internal")),s.__PRIVATE_databaseIdFromApp(i,r),i);return n={useFetchStreams:e,...n},o._setSettings(n),o},"PUBLIC").setMultipleInstances(!0)),n.registerVersion(a,l,void 0),n.registerVersion(a,l,"cjs2020")}(),t.AbstractUserDataWriter=s.AbstractUserDataWriter,t.Bytes=s.Bytes,t.CACHE_SIZE_UNLIMITED=s.sn,t.CollectionReference=s.CollectionReference,t.DocumentReference=s.DocumentReference,t.FieldPath=s.FieldPath,t.FieldValue=s.FieldValue,t.Firestore=s.Firestore,t.FirestoreError=s.FirestoreError,t.GeoPoint=s.GeoPoint,t.LoadBundleTask=s.LoadBundleTask,t.Query=s.Query,t.Timestamp=s.Timestamp,t.VectorValue=s.VectorValue,t._AutoId=s.__PRIVATE_AutoId,t._ByteString=s.ByteString,t._DatabaseId=s.DatabaseId,t._DocumentKey=s.DocumentKey,t._EmptyAppCheckTokenProvider=s.__PRIVATE_EmptyAppCheckTokenProvider,t._EmptyAuthCredentialsProvider=s.__PRIVATE_EmptyAuthCredentialsProvider,t._FieldPath=s.FieldPath$1,t._cast=s.__PRIVATE_cast,t._debugAssert=s.__PRIVATE_debugAssert,t._internalAggregationQueryToProtoRunAggregationQueryRequest=s._internalAggregationQueryToProtoRunAggregationQueryRequest,t._internalQueryToProtoQueryTarget=s._internalQueryToProtoQueryTarget,t._isBase64Available=s.__PRIVATE_isBase64Available,t._logWarn=s.__PRIVATE_logWarn,t._validateIsNotUsedTogether=s.__PRIVATE_validateIsNotUsedTogether,t.arrayRemove=s.arrayRemove,t.arrayUnion=s.arrayUnion,t.clearIndexedDbPersistence=s.clearIndexedDbPersistence,t.collection=s.collection,t.collectionGroup=s.collectionGroup,t.connectFirestoreEmulator=s.connectFirestoreEmulator,t.deleteField=s.deleteField,t.disableNetwork=s.disableNetwork,t.doc=s.doc,t.documentId=s.documentId,t.enableIndexedDbPersistence=s.enableIndexedDbPersistence,t.enableMultiTabIndexedDbPersistence=s.enableMultiTabIndexedDbPersistence,t.enableNetwork=s.enableNetwork,t.ensureFirestoreConfigured=s.ensureFirestoreConfigured,t.getFirestore=s.getFirestore,t.increment=s.increment,t.initializeFirestore=s.initializeFirestore,t.loadBundle=s.loadBundle,t.namedQuery=s.namedQuery,t.queryEqual=s.queryEqual,t.refEqual=s.refEqual,t.serverTimestamp=s.serverTimestamp,t.setLogLevel=s.setLogLevel,t.terminate=s.terminate,t.vector=s.vector,t.waitForPendingWrites=s.waitForPendingWrites,t.AggregateField=c,t.AggregateQuerySnapsh
9ot=h,t.DocumentSnapshot=j,t.PersistentCacheIndexManager=Z,t.QueryCompositeFilterConstraint=v,t.QueryConstraint=g,t.QueryDocumentSnapshot=H,t.QueryEndAtConstraint=E,t.QueryFieldFilterConstraint=y,t.QueryLimitConstraint=b,t.QueryOrderByConstraint=w,t.QuerySnapshot=z,t.QueryStartAtConstraint=_,t.SnapshotMetadata=B,t.Transaction=K,t.WriteBatch=G,t._TestingHooks=er,t.addDoc=function(e,t){let r=s.__PRIVATE_cast(e.firestore,s.Firestore),n=s.doc(e),i=P(e.converter,t),o=s.__PRIVATE_newUserDataReader(e.firestore);return Y(r,[s.__PRIVATE_parseSetData(o,"addDoc",n._key,i,null!==e.converter,{}).toMutation(n._key,s.Precondition.exists(!1))]).then(()=>n)},t.aggregateFieldEqual=function(e,t){return e instanceof c&&t instanceof c&&e.aggregateType===t.aggregateType&&e._internalFieldPath?.canonicalString()===t._internalFieldPath?.canonicalString()},t.aggregateQuerySnapshotEqual=function(e,t){return s.queryEqual(e.query,t.query)&&o.deepEqual(e.data(),t.data())},t.and=function(...e){return e.forEach(e=>C("and",e)),v._create("and",e)},t.average=function(e){return new c("avg",s.__PRIVATE_fieldPathFromArgument("average",e))},t.count=k,t.deleteAllPersistentCacheIndexes=function(e){let t=s.ensureFirestoreConfigured(e._firestore);s.__PRIVATE_firestoreClientDeleteAllFieldIndexes(t).then(e=>s.__PRIVATE_logDebug("deleting all persistent cache indexes succeeded")).catch(e=>s.__PRIVATE_logWarn("deleting all persistent cache indexes failed",e))},t.deleteDoc=function(e){return Y(s.__PRIVATE_cast(e.firestore,s.Firestore),[new s.__PRIVATE_DeleteMutation(e._key,s.Precondition.none())])},t.disablePersistentCacheIndexAutoCreation=function(e){ee(e,!1)},t.documentSnapshotFromJSON=function(e,t,r){if(s.__PRIVATE_validateJSON(t,j._jsonSchema)){if(t.bundle===U)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"The provided JSON object was created in a client environment, which is not supported.");let n=s.__PRIVATE_newSerializer(e._databaseId),i=s.__PRIVATE_createBundleReaderSync(t.bundle,n),o=i.Ju(),a=new s.__PRIVATE_BundleLoader(i.getMetadata(),n);for(let e of o)a.Ha(e);let l=a.documents;if(1!==l.length)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Expected bundle data to contain 1 document, but it contains ${l.length} documents.`);let u=s.__PRIVATE_fromDocument(n,l[0].document),c=new s.DocumentKey(s.ResourcePath.fromString(t.bundleName));return new j(e,new R(e),c,u,new B(!1,!1),r||null)}},t.enablePersistentCacheIndexAutoCreation=function(e){ee(e,!0)},t.endAt=function(...e){return E._create("endAt",e,!0)},t.endBefore=function(...e){return E._create("endBefore",e,!1)},t.executeWrite=Y,t.getAggregateFromServer=x,t.getCountFromServer=function(e){return x(e,{count:k()})},t.getDoc=function(e){e=s.__PRIVATE_cast(e,s.DocumentReference);let t=s.__PRIVATE_cast(e.firestore,s.Firestore),r=s.ensureFirestoreConfigured(t);return s.__PRIVATE_firestoreClientGetDocumentViaSnapshotListener(r,e._key).then(r=>J(t,e,r))},t.getDocFromCache=function(e){e=s.__PRIVATE_cast(e,s.DocumentReference);let t=s.__PRIVATE_cast(e.firestore,s.Firestore),r=s.ensureFirestoreConfigured(t),n=new s.__PRIVATE_ExpUserDataWriter(t);return s.__PRIVATE_firestoreClientGetDocumentFromLocalCache(r,e._key).then(r=>new j(t,n,e._key,r,new B(null!==r&&r.hasLocalMutations,!0),e.converter))},t.getDocFromServer=function(e){e=s.__PRIVATE_cast(e,s.DocumentReference);let t=s.__PRIVATE_cast(e.firestore,s.Firestore),r=s.ensureFirestoreConfigured(t);return s.__PRIVATE_firestoreClientGetDocumentViaSnapshotListener(r,e._key,{source:"server"}).then(r=>J(t,e,r))},t.getDocs=function(e){e=s.__PRIVATE_cast(e,s.Query);let t=s.__PRIVATE_cast(e.firestore,s.Firestore),r=s.ensureFirestoreConfigured(t),n=new s.__PRIVATE_ExpUserDataWriter(t);return p(e._query),s.__PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(r,e._query).then(r=>new z(t,n,e,r))},t.getDocsFromCache=function(e){e=s.__PRIVATE_cast(e,s.Query);let t=s.__PRIVATE_cast(e.firestore,s.Firestore),r=s.ensureFirestoreConfigured(t),n=new s.__PRIVATE_ExpUserDataWriter(t);return s.__PRIVATE_firestoreClientGetDocumentsFromLocalCache(r,e._query).then(r=>new z(t,n,e,r))},t.getDocsFromServer=function(e){e=s.__PRIVATE_cast(e,s.Query);let t=s.__PRIVATE_cast(e.firestore,s.Firestore),r=s.ensureFirestoreConfigured(t),n=new s.__PRIVATE_ExpUserDataWriter(t);return s.__PRIVATE_firestoreClientGetDocumentsViaSnapshotListener(r,e._query,{source:"server"}).then(r=>new z(t,n,e,r))},t.getPersistentCacheIndexManager=function(e){e=s.__PRIVATE_cast(e,s.Firestore);let t=et.get(e);if(t)return t;let r=s.ensureFirestoreConfigured(e);if("persistent"!==r._uninitializedComponentsProvider?._offline.kind)return null;let n=new Z(e);return et.set(e,n),n},t.limit=function(e){return s.__PRIVATE_validatePositiveNumber("limit",e),b._create("limit",e,"F")},t.limitToLast=function(e){return s.__PRIVATE_validatePositiveNumber("limitToLast",e),b._create("limitToLast",e,"L")},t.memoryEagerGarbageCollector=function(){return new O},t.memoryLocalCache=function(e){return new D(e)},t.memoryLruGarbageCollector=function(e){return new M(e?.cacheSizeBytes)},t.onSnapshot=Q,t.onSnapshotResume=function(e,t,...r){var n,i,a,l,c,h;let d=o.getModularInstance(e),f=function(e){let t={bundle:"",bundleName:"",bundleSource:""};for(let r of["bundle","bundleName","bundleSource"]){if(!(r in e)){t.error=`snapshotJson missing required field: ${r}`;break}let n=e[r];if("string"!=typeof n){t.error=`snapshotJson field '${r}' must be a string.`;break}if(0===n.length){t.error=`snapshotJson field '${r}
9' cannot be an empty string.`;break}"bundle"===r?t.bundle=n:"bundleName"===r?t.bundleName=n:"bundleSource"===r&&(t.bundleSource=n)}return t}(t);if(f.error)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,f.error);let p,m=0;if("object"!=typeof r[0]||u(r[m])||(p=r[m++]),"QuerySnapshot"===f.bundleSource){let e,t,o=null;if("object"==typeof r[m]&&u(r[m])){let e=r[m++];o={next:e.next,error:e.error,complete:e.complete}}else o={next:r[m++],error:r[m++],complete:r[m++]};return n=p,i=o,a=r[m],t=!1,s.loadBundle(d,f.bundle).then(()=>s.namedQuery(d,f.bundleName)).then(r=>{r&&!t&&(a&&r.withConverter(a),e=Q(r,n||{},i))}).catch(e=>(i.error&&i.error(e),()=>{})),()=>{t||(t=!0,e&&e())}}if("DocumentSnapshot"===f.bundleSource){let e,t,n=null;if("object"==typeof r[m]&&u(r[m])){let e=r[m++];n={next:e.next,error:e.error,complete:e.complete}}else n={next:r[m++],error:r[m++],complete:r[m++]};return l=p,c=n,h=r[m],t=!1,s.loadBundle(d,f.bundle).then(()=>{t||(e=Q(new s.DocumentReference(d,h||null,s.DocumentKey.fromPath(f.bundleName)),l||{},c))}).catch(e=>(c.error&&c.error(e),()=>{})),()=>{t||(t=!0,e&&e())}}throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`unsupported bundle source: ${f.bundleSource}`)},t.onSnapshotsInSync=function(e,t){e=s.__PRIVATE_cast(e,s.Firestore);let r=s.ensureFirestoreConfigured(e),n=u(t)?t:{next:t};return s.__PRIVATE_firestoreClientAddSnapshotsInSyncListener(r,n)},t.or=function(...e){return e.forEach(e=>C("or",e)),v._create("or",e)},t.orderBy=function(e,t="asc"){let r=s.__PRIVATE_fieldPathFromArgument("orderBy",e);return w._create(r,t)},t.persistentLocalCache=function(e){return new N(e)},t.persistentMultipleTabManager=function(){return new F},t.persistentSingleTabManager=V,t.query=function(e,t,...r){let n=[];for(let i of(t instanceof m&&n.push(t),function(e){let t=e.filter(e=>e instanceof v).length,r=e.filter(e=>e instanceof y).length;if(t>1||t>0&&r>0)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(n=n.concat(r)),n))e=i._apply(e);return e},t.querySnapshotFromJSON=function(e,t,r){if(s.__PRIVATE_validateJSON(t,z._jsonSchema)){if(t.bundle===U)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"The provided JSON object was created in a client environment, which is not supported.");let n=s.__PRIVATE_newSerializer(e._databaseId),i=s.__PRIVATE_createBundleReaderSync(t.bundle,n),o=i.Ju(),a=new s.__PRIVATE_BundleLoader(i.getMetadata(),n);for(let e of o)a.Ha(e);if(1!==a.queries.length)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,`Snapshot data expected 1 query but found ${a.queries.length} queries.`);let l=s.__PRIVATE_fromBundledQuery(a.queries[0].bundledQuery),u=a.documents,c=new s.DocumentSet;u.map(e=>{let t=s.__PRIVATE_fromDocument(n,e.document);c=c.add(t)});let h=s.ViewSnapshot.fromInitialDocuments(l,c,s.__PRIVATE_documentKeySet(),!1,!1),d=new s.Query(e,r||null,l);return new z(e,new R(e),d,h)}},t.runTransaction=function(e,t,r){e=s.__PRIVATE_cast(e,s.Firestore);let n={...q,...r};!function(e){if(e.maxAttempts<1)throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"Max attempts must be at least 1")}(n);let i=s.ensureFirestoreConfigured(e);return s.__PRIVATE_firestoreClientTransaction(i,r=>t(new K(e,r)),n)},t.setDoc=function(e,t,r){e=s.__PRIVATE_cast(e,s.DocumentReference);let n=s.__PRIVATE_cast(e.firestore,s.Firestore),i=P(e.converter,t,r),o=s.__PRIVATE_newUserDataReader(n);return Y(n,[s.__PRIVATE_parseSetData(o,"setDoc",e._key,i,null!==e.converter,r).toMutation(e._key,s.Precondition.none())])},t.setIndexConfiguration=function(e,t){e=s.__PRIVATE_cast(e,s.Firestore);let r=s.ensureFirestoreConfigured(e);if(!r._uninitializedComponentsProvider||"memory"===r._uninitializedComponentsProvider._offline.kind)return s.__PRIVATE_logWarn("Cannot enable indexes when persistence is disabled"),Promise.resolve();let n=function(e){let t="string"==typeof e?function(e){try{return JSON.parse(e)}catch(e){throw new s.FirestoreError(s.D.INVALID_ARGUMENT,"Failed to parse JSON: "+e?.message)}}(e):e,r=[];if(Array.isArray(t.indexes))for(let e of t.indexes){let t=X(e,"collectionGroup"),n=[];if(Array.isArray(e.fields))for(let t of e.fields){let e=X(t,"fieldPath"),r=s.__PRIVATE_fieldPathFromDotSeparatedString("setIndexConfiguration",e);"CONTAINS"===t.arrayConfig?n.push(new s.IndexSegment(r,2)):"ASCENDING"===t.order?n.push(new s.IndexSegment(r,0)):"DESCENDING"===t.order&&n.push(new s.IndexSegment(r,1))}r.push(new s.FieldIndex(s.FieldIndex.UNKNOWN_ID,t,n,s.IndexState.empty()))}return r}(t);return s.__PRIVATE_firestoreClientSetIndexConfiguration(r,n)},t.snapshotEqual=function(e,t){return e instanceof j&&t instanceof j?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof z&&t instanceof z&&e._firestore===t._firestore&&s.queryEqual(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)},t.startAfter=function(...e){return _._create("startAfter",e,!1)},t.startAt=function(...e){return _._create("startAt",e,!0)},t.sum=function(e){return new c("sum",s.__PRIVATE_fieldPathFromArgument("sum",e))},t.updateDoc=function(e,t,r,...n){e=s.__PRIVATE_cast(e,s.DocumentReference);let i=s.__PRIVATE_cast(e.firestore,s.Firestore),a=s.__PRIVATE_newUserDataReader(i);return Y(i,[("string"==typeof(t=o.getModularInstance(t))||t instanceof s.FieldPath?s.__PRIVATE_parseUpd
9ateVarargs(a,"updateDoc",e._key,t,r,n):s.__PRIVATE_parseUpdateData(a,"updateDoc",e._key,t)).toMutation(e._key,s.Precondition.exists(!0))])},t.where=function(e,t,r){let n=s.__PRIVATE_fieldPathFromArgument("where",e);return y._create(n,t,r)},t.writeBatch=function(e){return e=s.__PRIVATE_cast(e,s.Firestore),s.ensureFirestoreConfigured(e),new G(e,t=>Y(e,t))}},91363:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(99413),i=r(56630),s=r(71470),o=r(55389);let a="@firebase/installations",l="0.6.22",u=`w:${l}`,c="FIS_v2",h=new s.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 d(e){return e instanceof s.FirebaseError&&e.code.includes("request-failed")}function f({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function p(e){return{token:e.token,requestStatus:2,expiresIn:Number(e.expiresIn.replace("s","000")),creationTime:Date.now()}}async function m(e,t){let r=(await t.json()).error;return h.create("request-failed",{requestName:e,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function g({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function y(e,{refreshToken:t}){let r=g(e);return r.append("Authorization",`${c} ${t}`),r}async function v(e){let t=await e();return t.status>=500&&t.status<600?e():t}async function w({appConfig:e,heartbeatServiceProvider:t},{fid:r}){let n=f(e),i=g(e),s=t.getImmediate({optional:!0});if(s){let e=await s.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}let o={method:"POST",headers:i,body:JSON.stringify({fid:r,authVersion:c,appId:e.appId,sdkVersion:u})},a=await v(()=>fetch(n,o));if(a.ok){let e=await a.json();return{fid:e.fid||r,registrationStatus:2,refreshToken:e.refreshToken,authToken:p(e.authToken)}}throw await m("Create Installation",a)}function b(e){return new Promise(t=>{setTimeout(t,e)})}let _=/^[cdef][\w-]{21}$/;function E(e){return`${e.appName}!${e.appId}`}let I=new Map;function T(e,t){let r=E(e);S(r,t),function(e,t){let r=C();r&&r.postMessage({key:e,fid:t}),P()}(r,t)}function S(e,t){let r=I.get(e);if(r)for(let e of r)e(t)}let A=null;function C(){return!A&&"BroadcastChannel"in self&&((A=new BroadcastChannel("[Firebase] FID Change")).onmessage=e=>{S(e.data.key,e.data.fid)}),A}function P(){0===I.size&&A&&(A.close(),A=null)}let R="firebase-installations-store",k=null;function x(){return k||(k=o.openDB("firebase-installations-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(R)}})),k}async function D(e,t){let r=E(e),n=(await x()).transaction(R,"readwrite"),i=n.objectStore(R),s=await i.get(r);return await i.put(t,r),await n.done,s&&s.fid===t.fid||T(e,t.fid),t}async function N(e){let t=E(e),r=(await x()).transaction(R,"readwrite");await r.objectStore(R).delete(t),await r.done}async function O(e,t){let r=E(e),n=(await x()).transaction(R,"readwrite"),i=n.objectStore(R),s=await i.get(r),o=t(s);return void 0===o?await i.delete(r):await i.put(o,r),await n.done,o&&(!s||s.fid!==o.fid)&&T(e,o.fid),o}async function M(e){let t;let r=await O(e.appConfig,r=>{let n=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(h.create("app-offline"))};let r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=L(e,r);return{installationEntry:r,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:F(e)}:{installationEntry:t}}(e,U(r||{fid:function(){try{let e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;let t=btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22);return _.test(t)?t:""}catch{return""}}(),registrationStatus:0}));return t=n.registrationPromise,n.installationEntry});
9return""===r.fid?{installationEntry:await t}:{installationEntry:r,registrationPromise:t}}async function L(e,t){try{let r=await w(e,t);return D(e.appConfig,r)}catch(r){throw d(r)&&409===r.customData.serverCode?await N(e.appConfig):await D(e.appConfig,{fid:t.fid,registrationStatus:0}),r}}async function F(e){let t=await V(e.appConfig);for(;1===t.registrationStatus;)await b(100),t=await V(e.appConfig);if(0===t.registrationStatus){let{installationEntry:t,registrationPromise:r}=await M(e);return r||t}return t}function V(e){return O(e,e=>{if(!e)throw h.create("installation-not-found");return U(e)})}function U(e){return 1===e.registrationStatus&&e.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e}async function B({appConfig:e,heartbeatServiceProvider:t},r){let n=function(e,{fid:t}){return`${f(e)}/${t}/authTokens:generate`}(e,r),i=y(e,r),s=t.getImmediate({optional:!0});if(s){let e=await s.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}let o={method:"POST",headers:i,body:JSON.stringify({installation:{sdkVersion:u,appId:e.appId}})},a=await v(()=>fetch(n,o));if(a.ok)return p(await a.json());throw await m("Generate Auth Token",a)}async function j(e,t=!1){let r;let n=await O(e.appConfig,n=>{var i;if(!G(n))throw h.create("not-registered");let s=n.authToken;if(!t&&2===(i=s).requestStatus&&!function(e){let t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+36e5}(i))return n;if(1===s.requestStatus)return r=H(e,t),n;{if(!navigator.onLine)throw h.create("app-offline");let t=function(e){let t={requestStatus:1,requestTime:Date.now()};return{...e,authToken:t}}(n);return r=q(e,t),t}});return r?await r:n.authToken}async function H(e,t){let r=await z(e.appConfig);for(;1===r.authToken.requestStatus;)await b(100),r=await z(e.appConfig);let n=r.authToken;return 0===n.requestStatus?j(e,t):n}function z(e){return O(e,e=>{var t;if(!G(e))throw h.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),n={...t,authToken:r};return await D(e.appConfig,n),r}catch(r){if(d(r)&&(401===r.customData.serverCode||404===r.customData.serverCode))await N(e.appConfig);else{let r={...t,authToken:{requestStatus:0}};await D(e.appConfig,r)}throw r}}function G(e){return void 0!==e&&2===e.registrationStatus}async function W(e){let{installationEntry:t,registrationPromise:r}=await M(e);return r?r.catch(console.error):j(e).catch(console.error),t.fid}async function $(e,t=!1){return await K(e),(await j(e,t)).token}async function K(e){let{registrationPromise:t}=await M(e);t&&await t}async function Q(e,t){let r=function(e,{fid:t}){return`${f(e)}/${t}`}(e,t),n={method:"DELETE",headers:y(e,t)},i=await v(()=>fetch(r,n));if(!i.ok)throw await m("Delete Installation",i)}async function Y(e){let{appConfig:t}=e,r=await O(t,e=>{if(!e||0!==e.registrationStatus)return e});if(r){if(1===r.registrationStatus)throw h.create("delete-pending-registration");if(2===r.registrationStatus){if(navigator.onLine)await Q(t,r),await N(t);else throw h.create("app-offline")}}}function J(e){return h.create("missing-app-config-values",{valueName:e})}let X="installations";n._registerComponent(new i.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=n._getProvider(t,"heartbeat");return{app:t,appConfig:r,heartbeatServiceProvider:i,_delete:()=>Promise.resolve()}},"PUBLIC")),n._registerComponent(new i.Component("installations-internal",e=>{let t=e.getProvider("app").getImmediate(),r=n._getProvider(t,X).getImmediate();return{getId:()=>W(r),getToken:e=>$(r,e)}},"PRIVATE")),n.registerVersion(a,l),n.registerVersion(a,l,"cjs2020"),t.deleteInstallations=Y,t.getId=W,t.getInstallations=function(e=n.getApp()){return n._getProvider(e,"installations").getImmediate()},t.getToken=$,t.onIdChange=function(e,t){let{appConfig:r}=e;return function(e,t){C();let r=E(e),n=I.get(r);n||(n=new Set,I.set(r,n)),n.add(t)}(r,t),()=>{!function(e,t){let r=E(e),n=I.get(r);
9n&&(n.delete(t),0===n.size&&I.delete(r),P())}(r,t)}}},4015:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0});let n=[];t.LogLevel=void 0,(r=t.LogLevel||(t.LogLevel={}))[r.DEBUG=0]="DEBUG",r[r.VERBOSE=1]="VERBOSE",r[r.INFO=2]="INFO",r[r.WARN=3]="WARN",r[r.ERROR=4]="ERROR",r[r.SILENT=5]="SILENT";let i={debug:t.LogLevel.DEBUG,verbose:t.LogLevel.VERBOSE,info:t.LogLevel.INFO,warn:t.LogLevel.WARN,error:t.LogLevel.ERROR,silent:t.LogLevel.SILENT},s=t.LogLevel.INFO,o={[t.LogLevel.DEBUG]:"log",[t.LogLevel.VERBOSE]:"log",[t.LogLevel.INFO]:"info",[t.LogLevel.WARN]:"warn",[t.LogLevel.ERROR]:"error"},a=(e,t,...r)=>{if(t<e.logLevel)return;let n=new Date().toISOString(),i=o[t];if(i)console[i](`[${n}]  ${e.name}:`,...r);else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class l{constructor(e){this.name=e,this._logLevel=s,this._logHandler=a,this._userLogHandler=null,n.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in t.LogLevel))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?i[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,t.LogLevel.DEBUG,...e),this._logHandler(this,t.LogLevel.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,t.LogLevel.VERBOSE,...e),this._logHandler(this,t.LogLevel.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,t.LogLevel.INFO,...e),this._logHandler(this,t.LogLevel.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,t.LogLevel.WARN,...e),this._logHandler(this,t.LogLevel.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,t.LogLevel.ERROR,...e),this._logHandler(this,t.LogLevel.ERROR,...e)}}t.Logger=l,t.setLogLevel=function(e){n.forEach(t=>{t.setLogLevel(e)})},t.setUserLogHandler=function(e,r){for(let s of n){let n=null;r&&r.level&&(n=i[r.level]),null===e?s.userLogHandler=null:s.userLogHandler=(r,i,...s)=>{let o=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??r.logLevel)&&e({level:t.LogLevel[i].toLowerCase(),message:o,args:s,type:r.name})}}}},41749:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i,s,o=r(99413),a=r(71470),l=r(56630);let u="firebasestorage.googleapis.com",c="storageBucket";class h extends a.FirebaseError{constructor(e,t,r=0){super(d(e),`Firebase Storage: ${t} (${d(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,h.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return d(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
10${this.customData.serverResponse}`:this.message=this._baseMessage}}function d(e){return"storage/"+e}function f(){return new h(t.StorageErrorCode.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function p(){return new h(t.StorageErrorCode.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function m(){return new h(t.StorageErrorCode.CANCELED,"User canceled the upload/download.")}function g(){return new h(t.StorageErrorCode.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function y(e){return new h(t.StorageErrorCode.INVALID_ARGUMENT,e)}function v(){return new h(t.StorageErrorCode.APP_DELETED,"The Firebase app was deleted.")}function w(e){return new h(t.StorageErrorCode.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function b(e,r){return new h(t.StorageErrorCode.INVALID_FORMAT,"String does not match format '"+e+"': "+r)}function _(e){throw new h(t.StorageErrorCode.INTERNAL_ERROR,"Internal error: "+e)}t.StorageErrorCode=void 0,(n=t.StorageErrorCode||(t.StorageErrorCode={})).UNKNOWN="unknown",n.OBJECT_NOT_FOUND="object-not-found",n.BUCKET_NOT_FOUND="bucket-not-found",n.PROJECT_NOT_FOUND="project-not-found",n.QUOTA_EXCEEDED="quota-exceeded",n.UNAUTHENTICATED="unauthenticated",n.UNAUTHORIZED="unauthorized",n.UNAUTHORIZED_APP="unauthorized-app",n.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",n.INVALID_CHECKSUM="invalid-checksum",n.CANCELED="canceled",n.INVALID_EVENT_NAME="invalid-event-name",n.INVALID_URL="invalid-url",n.INVALID_DEFAULT_BUCKET="invalid-default-bucket",n.NO_DEFAULT_BUCKET="no-default-bucket",n.CANNOT_SLICE_BLOB="cannot-slice-blob",n.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",n.NO_DOWNLOAD_URL="no-download-url",n.INVALID_ARGUMENT="invalid-argument",n.INVALID_ARGUMENT_COUNT="invalid-argument-count",n.APP_DELETED="app-deleted",n.INVALID_ROOT_OPERATION="invalid-root-operation",n.INVALID_FORMAT="invalid-format",n.INTERNAL_ERROR="internal-error",n.UNSUPPORTED_ENVIRONMENT="unsupported-environment";class E{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,r){let n;try{n=E.makeFromUrl(e,r)}catch(t){return new E(e,"")}if(""===n.path)return n;throw new h(t.StorageErrorCode.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}static makeFromUrl(e,r){let n=null,i="([A-Za-z0-9.\\-_]+)",s=RegExp("^gs://"+i+"(/(.*))?$","i");function o(e){e.path_=decodeURIComponent(e.path)}let a=r.replace(/[.]/g,"\\."),l=[{regex:s,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:RegExp(`^https?://${a}/v[A-Za-z0-9_]+/b/${i}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:o},{regex:RegExp(`^https?://${r===u?"(?:storage.googleapis.com|storage.cloud.google.com)":r}/${i}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:o}];for(let t=0;t<l.length;t++){let r=l[t],i=r.regex.exec(e);if(i){let e=i[r.indices.bucket],t=i[r.indices.path];t||(t=""),n=new E(e,t),r.postModify(n);break}}if(null==n)throw new h(t.StorageErrorCode.INVALID_URL,"Invalid URL '"+e+"'.");return n}}class I{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function T(e){return"string"==typeof e||e instanceof String}function S(e){return A()&&e instanceof Blob}function A(){return"undefined"!=typeof Blob}function C(e,t,r,n){if(n<t)throw y(`Invalid value for '${e}'. Expected ${t} or greater.`);if(n>r)throw y(`Invalid value for '${e}'. Expected ${r} or less.`)}function P(e,t,r){let n=t;return null==r&&(n=`https://${t}`),`${r}://${n}/v0${e}`}function R(e){let t=encodeURIComponent,r="?";for(let n in e)e.hasOwnProperty(n)&&(r=r+(t(n)+"=")+t(e[n])+"&");return r.slice(0,-1)}function k(e,t){let r=e>=500&&e<600,n=-1!==[408,429].indexOf(e),i=-1!==t.indexOf(e);return r||n||i}(i=s||(s={}
10))[i.NO_ERROR=0]="NO_ERROR",i[i.NETWORK_ERROR=1]="NETWORK_ERROR",i[i.ABORT=2]="ABORT";class x{constructor(e,t,r,n,i,s,o,a,l,u,c,h=!0,d=!1){this.url_=e,this.method_=t,this.headers_=r,this.body_=n,this.successCodes_=i,this.additionalRetryCodes_=s,this.callback_=o,this.errorCallback_=a,this.timeout_=l,this.progressCallback_=u,this.connectionFactory_=c,this.retry=h,this.isUsingEmulator=d,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){let e=(e,t)=>{let r=this.resolve_,n=this.reject_,i=t.connection;if(t.wasSuccessCode)try{let e=this.callback_(i,i.getResponse());void 0!==e?r(e):r()}catch(e){n(e)}else if(null!==i){let e=f();e.serverResponse=i.getErrorText(),n(this.errorCallback_?this.errorCallback_(i,e):e)}else n(t.canceled?this.appDelete_?v():m():p())};this.canceled_?e(!1,new D(!1,null,!0)):this.backoffId_=function(e,t,r){let n=1,i=null,s=null,o=!1,a=0,l=!1;function u(...e){l||(l=!0,t.apply(null,e))}function c(t){i=setTimeout(()=>{i=null,e(d,2===a)},t)}function h(){s&&clearTimeout(s)}function d(e,...t){let r;if(l){h();return}if(e||2===a||o){h(),u.call(null,e,...t);return}n<64&&(n*=2),1===a?(a=2,r=0):r=(n+Math.random())*1e3,c(r)}let f=!1;function p(e){!f&&(f=!0,h(),!l&&(null!==i?(e||(a=2),clearTimeout(i),c(0)):e||(a=1)))}return c(0),s=setTimeout(()=>{o=!0,p(!0)},r),p}((e,t)=>{if(t){e(!1,new D(!1,null,!0));return}let r=this.connectionFactory_();this.pendingConnection_=r;let n=e=>{let t=e.loaded,r=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,r)};null!==this.progressCallback_&&r.addUploadProgressListener(n),r.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&r.removeUploadProgressListener(n),this.pendingConnection_=null;let t=r.getErrorCode()===s.NO_ERROR,i=r.getStatus();if(!t||k(i,this.additionalRetryCodes_)&&this.retry){e(!1,new D(!1,null,r.getErrorCode()===s.ABORT));return}e(!0,new D(-1!==this.successCodes_.indexOf(i),r))})},e,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class D{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function N(...e){let r="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0;if(void 0!==r){let t=new r;for(let r=0;r<e.length;r++)t.append(e[r]);return t.getBlob()}if(A())return new Blob(e);throw new h(t.StorageErrorCode.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}let O={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class M{constructor(e,t){this.data=e,this.contentType=t||null}}function L(e,t){switch(e){case O.RAW:return new M(F(t));case O.BASE64:case O.BASE64URL:return new M(V(e,t));case O.DATA_URL:return new M(function(e){let t=new U(e);return t.base64?V(O.BASE64,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(e){throw b(O.DATA_URL,"Malformed data URL.")}return F(t)}(t.rest)}(t),new U(t).contentType)}throw f()}function F(e){let t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<=127?t.push(n):n<=2047?t.push(192|n>>6,128|63&n):(64512&n)==55296?r<e.length-1&&(64512&e.charCodeAt(r+1))==56320?(n=65536|(1023&n)<<10|1023&e.charCodeAt(++r),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)):t.push(239,191,189):(64512&n)==56320?t.push(239,191,189):t.push(224|n>>12,128|n>>6&63,128|63&n)}return new Uint8Array(t)}function V(e,r){let n;switch(e){case O.BASE64:{let t=-1!==r.indexOf("-"),n=-1!==r.indexOf("_");if(t||n)throw b(e,"Invalid character '"+(t?"-":"_")+"' found: is it base64url encoded?");break}case O.BASE64URL:{let t=-1!==r.indexOf("+"),n=-1!==r.indexOf("/");if(t||n)throw b(e,"Invalid character '"+(t?"+":"/")+"' found: is it base64 encoded?");r=r.replace(/-/g,"+").replace(/_/g,"/")}}try{n=function(e){if("undefined"==typeof atob)throw new h(t.StorageErrorCode.UNSUPPORTED_ENVIRONMENT,"base-64 is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.");return atob(e)}(r)}
10catch(t){if(t.message.includes("polyfill"))throw t;throw b(e,"Invalid character found")}let i=new Uint8Array(n.length);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return i}class U{constructor(e){var t;this.base64=!1,this.contentType=null;let r=e.match(/^data:([^,]+)?,/);if(null===r)throw b(O.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");let n=r[1]||null;null!=n&&(this.base64=(t=";base64",n.length>=t.length&&n.substring(n.length-t.length)===t),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}class B{constructor(e,t){let r=0,n="";S(e)?(this.data_=e,r=e.size,n=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),r=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),r=e.length),this.size_=r,this.type_=n}size(){return this.size_}type(){return this.type_}slice(e,t){if(!S(this.data_))return new B(new Uint8Array(this.data_.buffer,e,t-e),!0);{var r;let n=(r=this.data_).webkitSlice?r.webkitSlice(e,t):r.mozSlice?r.mozSlice(e,t):r.slice?r.slice(e,t):null;return null===n?null:new B(n)}}static getBlob(...e){if(A()){let t=e.map(e=>e instanceof B?e.data_:e);return new B(N.apply(null,t))}{let t=e.map(e=>T(e)?L(O.RAW,e).data:e.data_),r=0;t.forEach(e=>{r+=e.byteLength});let n=new Uint8Array(r),i=0;return t.forEach(e=>{for(let t=0;t<e.length;t++)n[i++]=e[t]}),new B(n,!0)}}uploadData(){return this.data_}}function j(e){var t;let r;try{r=JSON.parse(e)}catch(e){return null}return"object"!=typeof(t=r)||Array.isArray(t)?null:r}function H(e){let t=e.lastIndexOf("/",e.length-2);return -1===t?e:e.slice(t+1)}function z(e,t){return t}class q{constructor(e,t,r,n){this.server=e,this.local=t||e,this.writable=!!r,this.xform=n||z}}let G=null;function W(){if(G)return G;let e=[];e.push(new q("bucket")),e.push(new q("generation")),e.push(new q("metageneration")),e.push(new q("name","fullPath",!0));let t=new q("name");t.xform=function(e,t){return!T(t)||t.length<2?t:H(t)},e.push(t);let r=new q("size");return r.xform=function(e,t){return void 0!==t?Number(t):t},e.push(r),e.push(new q("timeCreated")),e.push(new q("updated")),e.push(new q("md5Hash",null,!0)),e.push(new q("cacheControl",null,!0)),e.push(new q("contentDisposition",null,!0)),e.push(new q("contentEncoding",null,!0)),e.push(new q("contentLanguage",null,!0)),e.push(new q("contentType",null,!0)),e.push(new q("metadata","customMetadata",!0)),G=e}function $(e,t,r){let n=j(t);return null===n?null:function(e,t,r){let n={};n.type="file";let i=r.length;for(let e=0;e<i;e++){let i=r[e];n[i.local]=i.xform(n,t[i.server])}return Object.defineProperty(n,"ref",{get:function(){let t=new E(n.bucket,n.fullPath);return e._makeStorageReference(t)}}),n}(e,n,r)}function K(e,t){let r={},n=t.length;for(let i=0;i<n;i++){let n=t[i];n.writable&&(r[n.server]=e[n.local])}return JSON.stringify(r)}let Q="prefixes",Y="items";class J{constructor(e,t,r,n){this.url=e,this.method=t,this.handler=r,this.timeout=n,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function X(e){if(!e)throw f()}function Z(e,t){return function(r,n){let i=$(e,n,t);return X(null!==i),i}}function ee(e){return function(r,n){var i,s;let o;return 401===r.getStatus()?o=r.getErrorText().includes("Firebase App Check token is invalid")?new h(t.StorageErrorCode.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new h(t.StorageErrorCode.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===r.getStatus()?(i=e.bucket,o=new h(t.StorageErrorCode.QUOTA_EXCEEDED,"Quota for bucket '"+i+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===r.getStatus()?(s=e.path,o=new h(t.StorageErrorCode.UNAUTHORIZED,"User does not have permission to access '"+s+"'.")):o=n,o.status=r.getStatus(),o.serverResponse=n.serverResponse,o}}function et(e){let r=ee(e);return function(n,i){let s=r(n,i);
10if(404===n.getStatus()){var o;o=e.path,s=new h(t.StorageErrorCode.OBJECT_NOT_FOUND,"Object '"+o+"' does not exist.")}return s.serverResponse=i.serverResponse,s}}function er(e,t,r){let n=P(t.fullServerUrl(),e.host,e._protocol),i=e.maxOperationRetryTime,s=new J(n,"GET",Z(e,r),i);return s.errorHandler=et(t),s}function en(e,t,r){let n=new J(P(t.fullServerUrl(),e.host,e._protocol)+"?alt=media","GET",(e,t)=>t,e.maxOperationRetryTime);return n.errorHandler=et(t),void 0!==r&&(n.headers.Range=`bytes=0-${r}`,n.successCodes=[200,206]),n}function ei(e,t,r){let n=Object.assign({},r);return n.fullPath=e.path,n.size=t.size(),!n.contentType&&(n.contentType=t&&t.type()||"application/octet-stream"),n}function es(e,t,r,n,i){let s=t.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"},a=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();o["Content-Type"]="multipart/related; boundary="+a;let l=ei(t,n,i),u="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+K(l,r)+"\r\n--"+a+"\r\nContent-Type: "+l.contentType+"\r\n\r\n",c=B.getBlob(u,n,"\r\n--"+a+"--");if(null===c)throw g();let h={name:l.fullPath},d=P(s,e.host,e._protocol),f=e.maxUploadRetryTime,p=new J(d,"POST",Z(e,r),f);return p.urlParams=h,p.headers=o,p.body=c.uploadData(),p.errorHandler=ee(t),p}class eo{constructor(e,t,r,n){this.current=e,this.total=t,this.finalized=!!r,this.metadata=n||null}}function ea(e,t){let r=null;try{r=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){X(!1)}return X(!!r&&-1!==(t||["active"]).indexOf(r)),r}let el={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function eu(e){switch(e){case"running":case"pausing":case"canceling":return el.RUNNING;case"paused":return el.PAUSED;case"success":return el.SUCCESS;case"canceled":return el.CANCELED;default:return el.ERROR}}class ec{constructor(e,t,r){"function"==typeof e||null!=t||null!=r?(this.next=e,this.error=t??void 0,this.complete=r??void 0):(this.next=e.next,this.error=e.error,this.complete=e.complete)}}function eh(e){return(...t)=>{Promise.resolve().then(()=>e(...t))}}class ed{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=s.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=s.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=s.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,r,n,i){if(this.sent_)throw _("cannot .send() more than once");if(a.isCloudWorkstation(e)&&r&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==i)for(let e in i)i.hasOwnProperty(e)&&this.xhr_.setRequestHeader(e,i[e].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw _("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw _("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return -1}}getResponse(){if(!this.sent_)throw _("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw _("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}class ef extends ed{initXhr(){this.xhr_.responseType="text"}}function ep(){return new ef}class em extends ed{initXhr(){this.xhr_.responseType="arraybuffer"}}function eg(){return new em}class ey extends ed{initXhr(){this.xhr_.responseType="blob"}}function ev(){return new ey}class ew{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(e,r,n=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=r,this._metadata=n,this._mappings=W(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{if(this._request=void 0,this._chunkMultiplier=1,e._codeEquals(t.StorageErrorCode.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{let t=this.isExponentialBackoffExpired();if(k(e.status,[])){if(t)e=p();else{this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,this.completeTransitions_();return}}this._error=e,this._transition("error")}},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals(t.StorageErrorCode.CANCELED)?this.completeTransitions_():(this._error=e,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((e,t)=>
10{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){let e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,r])=>{switch(this._state){case"running":e(t,r);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{let r=function(e,t,r,n,i){let s=t.bucketOnlyServerUrl(),o=ei(t,n,i),a={name:o.fullPath},l=P(s,e.host,e._protocol),u={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${n.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":"application/json; charset=utf-8"},c=K(o,r),h=new J(l,"POST",function(e){let t;ea(e);try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){X(!1)}return X(T(t)),t},e.maxUploadRetryTime);return h.urlParams=a,h.headers=u,h.body=c,h.errorHandler=ee(t),h}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),n=this._ref.storage._makeRequest(r,ep,e,t);this._request=n,n.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){let e=this._uploadUrl;this._resolveToken((t,r)=>{let n=function(e,t,r,n){let i=new J(r,"POST",function(e){let t=ea(e,["active","final"]),r=null;try{r=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){X(!1)}r||X(!1);let i=Number(r);return X(!isNaN(i)),new eo(i,n.size(),"final"===t)},e.maxUploadRetryTime);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=ee(t),i}(this._ref.storage,this._ref._location,e,this._blob),i=this._ref.storage._makeRequest(n,ep,t,r);this._request=i,i.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){let e=262144*this._chunkMultiplier,r=new eo(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((i,s)=>{let o;try{o=function(e,r,n,i,s,o,a,l){let u=new eo(0,0);if(a?(u.current=a.current,u.total=a.total):(u.current=0,u.total=i.size()),i.size()!==u.total)throw new h(t.StorageErrorCode.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");let c=u.total-u.current,d=c;s>0&&(d=Math.min(d,s));let f=u.current,p=f+d,m={"X-Goog-Upload-Command":0===d?"finalize":c===d?"upload, finalize":"upload","X-Goog-Upload-Offset":`${u.current}`},y=i.slice(f,p);if(null===y)throw g();let v=new J(n,"POST",function(e,t){let n;let s=ea(e,["active","final"]),a=u.current+d,l=i.size();return n="final"===s?Z(r,o)(e,t):null,new eo(a,l,"final"===s,n)},r.maxUploadRetryTime);return v.headers=m,v.body=y.uploadData(),v.progressCallback=l||null,v.errorHandler=ee(e),v}(this._ref._location,this._ref.storage,n,this._blob,e,this._mappings,r,this._makeProgressCallback())}catch(e){this._error=e,this._transition("error");return}let a=this._ref.storage._makeRequest(o,ep,i,s,!1);this._request=a,a.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){262144*this._chunkMultiplier*2<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{let r=er(this._ref.storage,this._ref._location,this._mappings),n=this._ref.storage._makeRequest(r,ep,e,t);this._request=n,n.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{let r=es(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),n=this._ref.storage._makeRequest
10(r,ep,e,t);this._request=n,n.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){let t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":let t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=e,this._notifyObservers();break;case"canceled":this._error=m(),this._state=e,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){let e=eu(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,r,n){let i=new ec(t||void 0,r||void 0,n||void 0);return this._addObserver(i),()=>{this._removeObserver(i)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){let t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(eu(this._state)){case el.SUCCESS:eh(this._resolve.bind(null,this.snapshot))();break;case el.CANCELED:case el.ERROR:eh(this._reject.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(eu(this._state)){case el.RUNNING:case el.PAUSED:e.next&&eh(e.next.bind(e,this.snapshot))();break;case el.SUCCESS:e.complete&&eh(e.complete.bind(e))();break;case el.CANCELED:case el.ERROR:default:e.error&&eh(e.error.bind(e,this._error))()}}resume(){let e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){let e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){let e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}}class eb{constructor(e,t){this._service=e,t instanceof E?this._location=t:this._location=E.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new eb(e,t)}get root(){let e=new E(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return H(this._location.path)}get storage(){return this._service}get parent(){let e=function(e){if(0===e.length)return null;let t=e.lastIndexOf("/");return -1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;let t=new E(this._location.bucket,e);return new eb(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw w(e)}}function e_(e,t,r){e._throwIfRoot("uploadBytes");let n=es(e.storage,e._location,W(),new B(t,!0),r);return e.storage.makeRequestWithTokens(n,ep).then(t=>({metadata:t,ref:e}))}async function eE(e,t,r){let n=await eI(e,{pageToken:r});t.prefixes.push(...n.prefixes),t.items.push(...n.items),null!=n.nextPageToken&&await eE(e,t,n.nextPageToken)}function eI(e,t){null!=t&&"number"==typeof t.maxResults&&C("options.maxResults",1,1e3,t.maxResults);let r=t||{},n=function(e,t,r,n,i){var s;let o={};t.isRoot?o.prefix="":o.prefix=t.path+"/",o.delimiter="/",n&&(o.pageToken=n),i&&(o.maxResults=i);let a=P(t.bucketOnlyServerUrl(),e.host,e._protocol),l=e.maxOperationRetryTime,u=new J(a,"GET",(s=t.bucket,function(t,r){let n=function(e,t,r){let n=j(r);return null===n?null:function(e,t,r){let n={prefixes:[],items:[],nextPageToken:r.nextPageToken};if(r[Q])for(let i of r[Q]){let r=i.replace(/\/$/,""),s=e._makeStorageReference(new E(t,r));n.prefixes.push(s)}if(r[Y])for(let i of r[Y]){let r=e._makeStorageReference(new E(t,i.name));n.items.push(r)}return n}
10(e,t,n)}(e,s,r);return X(null!==n),n}),l);return u.urlParams=o,u.errorHandler=ee(t),u}(e.storage,e._location,"/",r.pageToken,r.maxResults);return e.storage.makeRequestWithTokens(n,ep)}function eT(e,t){let r=function(e,t){let r=t.split("/").filter(e=>e.length>0).join("/");return 0===e.length?r:e+"/"+r}(e._location.path,t),n=new E(e._location.bucket,r);return new eb(e.storage,n)}function eS(e,t){let r=t?.[c];return null==r?null:E.makeFromBucketSpec(r,e)}class eA{constructor(e,t,r,n,i,s=!1){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=n,this._firebaseVersion=i,this._isUsingEmulator=s,this._bucket=null,this._host=u,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,null!=n?this._bucket=E.makeFromBucketSpec(n,this._host):this._bucket=eS(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=E.makeFromBucketSpec(this._url,e):this._bucket=eS(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){C("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){C("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){if(o._isFirebaseServerApp(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new eb(this,e)}_makeRequest(e,t,r,n,i=!0){if(this._deleted)return new I(v());{let s=function(e,t,r,n,i,s,o=!0,a=!1){let l=R(e.urlParams),u=e.url+l,c=Object.assign({},e.headers);return t&&(c["X-Firebase-GMPID"]=t),null!==r&&r.length>0&&(c.Authorization="Firebase "+r),c["X-Firebase-Storage-Version"]="webjs/"+(s??"AppManager"),null!==n&&(c["X-Firebase-AppCheck"]=n),new x(u,e.method,c,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,o,a)}(e,this._appId,r,n,t,this._firebaseVersion,i,this._isUsingEmulator);return this._requests.add(s),s.getPromise().then(()=>this._requests.delete(s),()=>this._requests.delete(s)),s}}async makeRequestWithTokens(e,t){let[r,n]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,r,n).getPromise()}}let eC="@firebase/storage",eP="0.14.3",eR="storage";function ek(e,t,r,n={}){!function(e,t,r,n={}){e.host=`${t}:${r}`;let i=a.isCloudWorkstation(t);i&&a.pingServer(`https://${e.host}/b`),e._isUsingEmulator=!0,e._protocol=i?"https":"http";let{mockUserToken:s}=n;s&&(e._overrideAuthToken="string"==typeof s?s:a.createMockUserToken(s,e.app.options.projectId))}(e,t,r,n)}o._registerComponent(new l.Component(eR,function(e,{instanceIdentifier:t}){return new eA(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),t,o.SDK_VERSION)},"PUBLIC").setMultipleInstances(!0)),o.registerVersion(eC,eP,""),o.registerVersion(eC,eP,"cjs2020"),t.StorageError=h,t.StringFormat=O,t._FbsBlob=B,t._Location=E,t._TaskEvent={STATE_CHANGED:"state_changed"},t._TaskState=el,t._UploadTask=ew,t._dataFromString=L,t._getChild=function(e,t){return eT(e,t)},t._invalidArgument=y,t._invalidRootOperation=w,t.connectStorageEmulator=ek,t.deleteObject=function(e){return function(e){e._throwIfRoot("deleteObject");let t=function(e,t){let r=new J(P(t.fullServerUrl(),e.host,e._protocol),"DELETE",function(e,t){},e.maxOperationRetryTime);return r.successCodes=[200,204],r.errorHandler=et(t),r}(e.storage,e._location);return e.storage.makeRequestWithTokens(t,ep)}(e=a.getModularInstance(e))},t.getBlob=function(e,t){return function(e,t){e._throwIfRoot("getBlob");let r=en(e.storage,e._location,t);return e.storage.makeRequestWithTokens(r,ev).then(e=>void 0!==t?e.slice(0,t):e)}(e=a.getModularInstance(e),t)},t.getBytes=function(e,t){return function(e,t){e._throwIfRoot("getBytes");let r=en(e.storage,e._location,t);return e.storage.makeRequestWithTokens(r,eg).then(e=>void 0!==t?e.slice(0,t):e)}(e=a.getModularInstance(e),t)},t.getDownloadURL=function(e){return function(e){e._throwIfRoot("getDownloadURL");let r=function(e,t,r){let n=new J(P(t.fullServerUrl(),e.host,e._protocol),"GET",function(t,n){let i=$(e,n,r);return X(null!==i),function(e,t,r,n){let i=j(t);if(null===i||!T(i.downloadTokens))return null;let s=i.downloadTokens;if(0===s.length)return null;let o=encodeURIComponent;return s.split(",").map(t=>{let i=e.bucket,s=e.fullPath;return P("/b/"+o(i)+"/o/"+o(s),r,n)+R({alt:"media",token:t})})[0]}(i,n,e.host,e._protocol)},e.maxOperationRetryTime);return n.errorHandler=et(t),n}(e.storage,e._location,W());return e.storage.makeRequestWithTokens(r,ep).then(e=>{if(null===e)throw new h(t.StorageErrorCode.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}(e=a.getModularInstance(e))},t.getMetadata=function(e){return function(e){e._throwIfRoot("getMetadata");let t=er(e.storage,e._location,W());return e.storage.makeRequestWithTokens(t,ep)}(e=a.getModularInstance(e))},t.getStorage=function(e=o.getApp(),t){e=a.getModularInstance(e);let r=o._getProvider(e,eR).getImmediate({identifier:t}),n=a.getDefaultEmulatorHostnameAndPort("storage");return n&&ek(r,...n),r},t.getStream=function(e,t){throw Error("getStream() is only supported by NodeJS builds")},t.list=function(e,t){return eI(e=a.getModularInstance(e),t)},t.listAll=function(e){return function(e){let t={prefixes:[],items:[]};return eE(e,t).then(()=>t)}
10(e=a.getModularInstance(e))},t.ref=function(e,r){return function(e,r){if(!(r&&/^[A-Za-z]+:\/\//.test(r)))return function e(r,n){if(r instanceof eA){if(null==r._bucket)throw new h(t.StorageErrorCode.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+c+"' property when initializing the app?");let i=new eb(r,r._bucket);return null!=n?e(i,n):i}return void 0!==n?eT(r,n):r}(e,r);if(e instanceof eA)return new eb(e,r);throw y("To use ref(service, url), the first argument must be a Storage instance.")}(e=a.getModularInstance(e),r)},t.updateMetadata=function(e,t){return function(e,t){e._throwIfRoot("updateMetadata");let r=function(e,t,r,n){let i=P(t.fullServerUrl(),e.host,e._protocol),s=K(r,n),o=e.maxOperationRetryTime,a=new J(i,"PATCH",Z(e,n),o);return a.headers={"Content-Type":"application/json; charset=utf-8"},a.body=s,a.errorHandler=et(t),a}(e.storage,e._location,t,W());return e.storage.makeRequestWithTokens(r,ep)}(e=a.getModularInstance(e),t)},t.uploadBytes=function(e,t,r){return e_(e=a.getModularInstance(e),t,r)},t.uploadBytesResumable=function(e,t,r){var n;return(n=e=a.getModularInstance(e))._throwIfRoot("uploadBytesResumable"),new ew(n,new B(t),r)},t.uploadString=function(e,t,r,n){return function(e,t,r=O.RAW,n){e._throwIfRoot("uploadString");let i=L(r,t),s={...n};return null==s.contentType&&null!=i.contentType&&(s.contentType=i.contentType),e_(e,i.data,s)}(e=a.getModularInstance(e),t,r,n)}},71470:function(e,t,r){"use strict";var n=r(34406);Object.defineProperty(t,"__esModule",{value:!0});var i=r(65995);let s={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(e,t){if(!e)throw a(t)},a=function(e){return Error("Firebase Database ("+s.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},l=function(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:((64512&i)==55296&&n+1<e.length&&(64512&e.charCodeAt(n+1))==56320?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128):t[r++]=i>>12|224,t[r++]=i>>6&63|128),t[r++]=63&i|128)}return t},u=function(e){let t=[],r=0,n=0;for(;r<e.length;){let i=e[r++];if(i<128)t[n++]=String.fromCharCode(i);else if(i>191&&i<224){let s=e[r++];t[n++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){let s=((7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else{let s=e[r++],o=e[r++];t[n++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")},c={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_,n=[];for(let t=0;t<e.length;t+=3){let i=e[t],s=t+1<e.length,o=s?e[t+1]:0,a=t+2<e.length,l=a?e[t+2]:0,u=i>>2,c=(3&i)<<4|o>>4,h=(15&o)<<2|l>>6,d=63&l;a||(d=64,s||(h=64)),n.push(r[u],r[c],r[h],r[d])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(l(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):u(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let t=0;t<e.length;){let i=r[e.charAt(t++)],s=t<e.length?r[e.charAt(t)]:0,o=++t<e.length?r[e.charAt(t)]:64,a=++t<e.length?r[e.charAt(t)]:64;if(++t,null==i||null==s||null==o||null==a)throw new h;let l=i<<2|s>>4;if(n.push(l),64!==o){let e=s<<4&240|o>>2;if(n.push(e),64!==a){let e=o<<6&192|a;n.push(e)}}}return n},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)}}};
10class h extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let d=function(e){let t=l(e);return c.encodeByteArray(t,!0)},f=function(e){return d(e).replace(/\./g,"")},p=function(e){try{return c.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function m(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(let r in t)t.hasOwnProperty(r)&&"__proto__"!==r&&(e[r]=m(e[r],t[r]));return e}function g(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("Unable to locate global object.")}let y=()=>g().__FIREBASE_DEFAULTS__,v=()=>{if(void 0===n||void 0===n.env)return;let e=n.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},w=()=>{let e;if("undefined"==typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&p(e[1]);return t&&JSON.parse(t)},b=()=>{try{return i.getDefaultsFromPostinstall()||y()||v()||w()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},_=e=>b()?.emulatorHosts?.[e];class E{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 I(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function T(){let e=b()?.forceEnvironment;if("node"===e)return!0;if("browser"===e)return!1;try{return"[object process]"===Object.prototype.toString.call(r.g.process)}catch(e){return!1}}function S(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}class A extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,A.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,C.prototype.create)}}class C{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){let r=t[0]||{},n=`${this.service}/${e}`,i=this.errors[e],s=i?i.replace(P,(e,t)=>{let n=r[t];return null!=n?String(n):`<${t}?>`}):"Error",o=`${this.serviceName}: ${s} (${n}).`;return new A(n,o,r)}}let P=/\{\$([^}]+)}/g;function R(e){return JSON.parse(e)}let k=function(e){let t={},r={},n={},i="";try{let s=e.split(".");t=R(p(s[0])||""),r=R(p(s[1])||""),i=s[2],n=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:n,signature:i}};function x(e){return null!==e&&"object"==typeof e}class D{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){let r,n;t||(t=0);let i=this.W_;if("string"==typeof e)for(let r=0;r<16;r++)i[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let r=0;r<16;r++)i[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){let t=i[e-3]^i[e-8]^i[e-14]^i[e-16];i[e]=(t<<1|t>>>31)&4294967295}let s=this.chain_[0],o=this.chain_[1],a=this.chain_[2],l=this.chain_[3],u=this.chain_[4];for(let e=0;e<80;e++){e<40?e<20?(r=l^o&(a^l),n=1518500249):(r=o^a^l,n=1859775393):e<60?(r=o&a|l&(o|a),n=2400959708):(r=o^a^l,n=3395469782);let t=(s<<5|s>>>27)+r+u+n+i[e]&4294967295;u=l,l=a,a=(o<<30|o>>>2)&4294967295,o=s,s=t}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+o&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+u&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);let r=t-this.blockSize,n=0,i=this.buf_,s=this.inbuf_;for(;n<t;){if(0===s)for(;n<=r;)this.compress_(e,n),n+=this.blockSize;if("string"==typeof e){for(;n<t;)if(i[s]=e.charCodeAt(n),++s,++n,s===this.blockSize){this.compress_(i),s=0;break}}else for(;n<t;)if(i[s]=e[n],++s,++n,s===this.blockSize){this.compress_(i),s=0;break}}this.inbuf_=s,this.total_+=t}digest(){let e=[],t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=255&t,t/=256;this.compress_(this.buf_);let r=0;for(let t=0;t<5;t++)for(let n=24;n>=0;n-=8)e[r]=this.chain_[t]>>n&255,++r;return e}}class N{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
10ise.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 n;if(void 0===e&&void 0===t&&void 0===r)throw Error("Missing Observer.");void 0===(n=!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&&(n.next=O),void 0===n.error&&(n.error=O),void 0===n.complete&&(n.complete=O);let i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?n.error(this.finalError):n.complete()}catch(e){}}),this.observers.push(n),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<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 O(){}function M(e,t){return`${e} failed: ${t} argument `}async function L(e){return(await fetch(e,{credentials:"include"})).ok}async function F(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>e.toString(16).padStart(2,"0")).join("")}t.CONSTANTS=s,t.DecodeBase64StringError=h,t.Deferred=E,t.ErrorFactory=C,t.FirebaseError=A,t.MAX_VALUE_MILLIS=144e5,t.RANDOM_FACTOR=.5,t.Sha1=D,t.areCookiesEnabled=function(){return"undefined"!=typeof navigator&&!!navigator.cookieEnabled},t.assert=o,t.assertionError=a,t.async=function(e,t){return(...r)=>{Promise.resolve(!0).then(()=>{e(...r)}).catch(e=>{t&&t(e)})}},t.base64=c,t.base64Decode=p,t.base64Encode=d,t.base64urlEncodeWithoutPadding=f,t.calculateBackoffMillis=function(e,t=1e3,r=2){let n=t*Math.pow(r,e);return Math.min(144e5,n+Math.round(.5*n*(Math.random()-.5)*2))},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.createMockUserToken=function(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",n=e.iat||0,i=e.sub||e.user_id;if(!i)throw Error("mockUserToken must contain 'sub' or 'user_id' field!");let s={iss:`https://securetoken.google.com/${r}`,aud:r,iat:n,exp:n+3600,auth_time:n,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}},...e};return[f(JSON.stringify({alg:"none",type:"JWT"})),f(JSON.stringify(s)),""].join(".")},t.createSubscribe=function(e,t){let r=new N(e,t);return r.subscribe.bind(r)},t.decode=k,t.deepCopy=function(e){return m(void 0,e)},t.deepEqual=function e(t,r){if(t===r)return!0;let n=Object.keys(t),i=Object.keys(r);for(let s of n){if(!i.includes(s))return!1;let n=t[s],o=r[s];if(x(n)&&x(o)){if(!e(n,o))return!1}else if(n!==o)return!1}for(let e of i)if(!n.includes(e))return!1;return!0},t.deepExtend=m,t.errorPrefix=M,t.extractQuerystring=function(e){let t=e.indexOf("?");if(!t)return"";let r=e.indexOf("#",t);return e.substring(t,r>0?r:void 0)},t.generateSHA256Hash=F,t.getDefaultAppConfig=()=>b()?.config,t.getDefaultEmulatorHost=_,t.getDefaultEmulatorHostnameAndPort=e=>{let t=_(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 n=parseInt(t.substring(r+1),10);return"["===t[0]?[t.substring(1,r-1),n]:[t.substring(0,r),n]},t.getDefaults=b,t.getExperimentalSetting=e=>b()?.[`_${e}`],t.getGlobal=g,t.getModularInstance=function(e){return e&&e._delegate?e._delegate:e},t.getUA=I,t.isAdmin=function(e){let t=k(e).claims;return"object"==typeof t&&!0===t.admin},t.isBrowser=function(){return"undefined"!=typeof window||S()},t.isBrowserExtension=function(){let e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id},t.isCloudWorkstation=function(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}},t.isCloudflareWorker=function(){return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent},t.isElectron=function(){return I().indexOf("Electron/")>=0},t.isEmpty=function(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isIE=function(){let e=I();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},t.isIndexedDBAvailable=function(){try{return"object"==typeof indexedDB}catch(e){return!1}},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(I())},t.isNode=T,t.isNodeSdk=function(){return!0===s.NODE_CLIENT||!0===s.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isSafari=function(){return!T()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},t.isSafariOrWebkit=function(){return!T()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")},t.isUWP=function(){return I().indexOf("MSAppHost/")>=0},t.isValidFormat=function(e){let t=k(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){let t=k(e).claims,r=Math.floor(new Date().getTime()/1e3),n=0,i=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?n=t.nbf:t.hasOwnProperty("iat")&&(n=t.iat),i=t.hasOwnProperty("exp")?t.exp:n+86400),!!r&&!!n&&!!i&&r>=n&&r<=i},t.isWebWorker=S,t.issuedAtTime=function(e){let t=k(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=R,t.map=function(e,t,r){let n={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=t.call(r,e[i],i,e));return n},t.ordinal=function(e){return Number.isFinite(e)?e+function(e){let t=(e=Math.abs(e))%100;if(t>=10&&t<=20)return"th";let r=e%10;return 1===r?"st":2===r?"nd":3===r?"rd":"th"}(e):`${e}`},t.pingServer=L,t.promiseWithTimeout=function(e,t=2e3){let r=new E;return setTimeout(()=>r.reject("timeout!"),t),e.then(r.resolve,r.reject),r.promise},t.querystring=function(e){let t=[];
10for(let[r,n]of Object.entries(e))Array.isArray(n)?n.forEach(e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){let t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){let[r,n]=e.split("=");t[decodeURIComponent(r)]=decodeURIComponent(n)}}),t},t.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},t.stringLength=function(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<128?t++:n<2048?t+=2:n>=55296&&n<=56319?(t+=4,r++):t+=3}return t},t.stringToByteArray=function(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(i>=55296&&i<=56319){let t=i-55296;o(++n<e.length,"Surrogate pair missing trail surrogate."),i=65536+(t<<10)+(e.charCodeAt(n)-56320)}i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.validateArgCount=function(e,t,r,n){let i;if(n<t?i="at least "+t:n>r&&(i=0===r?"none":"no more than "+r),i)throw Error(e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+i+".")},t.validateCallback=function(e,t,r,n){if((!n||r)&&"function"!=typeof r)throw Error(M(e,t)+"must be a valid function.")},t.validateContextObject=function(e,t,r,n){if((!n||r)&&("object"!=typeof r||null===r))throw Error(M(e,t)+"must be a valid context object.")},t.validateIndexedDBOpenable=function(){return new Promise((e,t)=>{try{let r=!0,n="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(n);i.onsuccess=()=>{i.result.close(),r||self.indexedDB.deleteDatabase(n),e(!0)},i.onupgradeneeded=()=>{r=!1},i.onerror=()=>{t(i.error?.message||"")}}catch(e){t(e)}})},t.validateNamespace=function(e,t,r){if((!r||t)&&"string"!=typeof t)throw Error(M(e,"namespace")+"must be a valid firebase namespace.")}},65995:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultsFromPostinstall=()=>void 0},18779:function(e,t,r){(function(){"use strict";function t(){this.blockSize=-1,this.blockSize=64,this.g=[,,,,],this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function r(e,t,r){r||(r=0);let n=Array(16);if("string"==typeof t)for(var i=0;i<16;++i)n[i]=t.charCodeAt(r++)|t.charCodeAt(r++)<<8|t.charCodeAt(r++)<<16|t.charCodeAt(r++)<<24;else for(i=0;i<16;++i)n[i]=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;t=e.g[0],r=e.g[1],i=e.g[2];let s=e.g[3],o;o=t+(s^r&(i^s))+n[0]+3614090360&4294967295,o=s+(i^(t=r+(o<<7&4294967295|o>>>25))&(r^i))+n[1]+3905402710&4294967295,o=i+(r^(s=t+(o<<12&4294967295|o>>>20))&(t^r))+n[2]+606105819&4294967295,o=r+(t^(i=s+(o<<17&4294967295|o>>>15))&(s^t))+n[3]+3250441966&4294967295,o=t+(s^(r=i+(o<<22&4294967295|o>>>10))&(i^s))+n[4]+4118548399&4294967295,o=s+(i^(t=r+(o<<7&4294967295|o>>>25))&(r^i))+n[5]+1200080426&4294967295,o=i+(r^(s=t+(o<<12&4294967295|o>>>20))&(t^r))+n[6]+2821735955&4294967295,o=r+(t^(i=s+(o<<17&4294967295|o>>>15))&(s^t))+n[7]+4249261313&4294967295,o=t+(s^(r=i+(o<<22&4294967295|o>>>10))&(i^s))+n[8]+1770035416&4294967295,o=s+(i^(t=r+(o<<7&4294967295|o>>>25))&(r^i))+n[9]+2336552879&4294967295,o=i+(r^(s=t+(o<<12&4294967295|o>>>20))&(t^r))+n[10]+4294925233&4294967295,o=r+(t^(i=s+(o<<17&4294967295|o>>>15))&(s^t))+n[11]+2304563134&4294967295,o=t+(s^(r=i+(o<<22&4294967295|o>>>10))&(i^s))+n[12]+1804603682&4294967295,o=s+(i^(t=r+(o<<7&4294967295|o>>>25))&(r^i))+n[13]+4254626195&4294967295,o=i+(r^(s=t+(o<<12&4294967295|o>>>20))&(t^r))+n[14]+2792965006&4294967295,o=r+(t^(i=s+(o<<17&4294967295|o>>>15))&(s^t))+n[15]+1236535329&4294967295,r=i+(o<<22&4294967295|o>>>10),o=t+(i^s&(r^i))+n[1]+4129170786&4294967295,t=r+(o<<5&4294967295|o>>>27),o=s+(r^i&(t^r))+n[6]+3225465664&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^r&(s^t))+n[11]+643717713&4294967295,i=s+(o<<14&4294967295|o>>>18),o=r+(s^t&(i^s))+n[0]+3921069994&4294967295,r=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(r^i))+n[5]+3593408605&4294967295,t=r+(o<<5&4294967295|o>>>27),o=s+(r^i&(t^r))+n[10]+38016083&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^r&(s^t))+n[15]+3634488961&4294967295,i=s+(o<<14&4294967295|o>>>18),o=r+(s^t&(i^s))+n[4]+3889429448&4294967295,r=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(r^i))+n[9]+568446438&4294967295,t=r+(o<<5&4294967295|o>>>27),o=s+(r^i&(t^r))+n[14]+3275163606&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^r&(s^t))+n[3]+4107603335&4294967295,i=s+(o<<14&4294967295|o>>>18),o=r+(s^t&(i^s))+n[8]+1163531501&4294967295,r=i+(o<<20&4294967295|o>>>12),o=t+(i^s&(r^i))+n[13]+2850285829&4294967295,t=r+(o<<5&4294967295|o>>>27),o=s+(r^i&(t^r))+n[2]+4243563512&4294967295,s=t+(o<<9&4294967295|o>>>23),o=i+(t^r&(s^t))+n[7]+1735328473&4294967295,i=s+(o<<14&4294967295|o>>>18),o=r+(s^t&(i^s))+n[12]+2368359562&4294967295,o=t+((r=i+(o<<20&4294967295|o>>>
1012))^i^s)+n[5]+4294588738&4294967295,o=s+((t=r+(o<<4&4294967295|o>>>28))^r^i)+n[8]+2272392833&4294967295,o=i+((s=t+(o<<11&4294967295|o>>>21))^t^r)+n[11]+1839030562&4294967295,o=r+((i=s+(o<<16&4294967295|o>>>16))^s^t)+n[14]+4259657740&4294967295,o=t+((r=i+(o<<23&4294967295|o>>>9))^i^s)+n[1]+2763975236&4294967295,o=s+((t=r+(o<<4&4294967295|o>>>28))^r^i)+n[4]+1272893353&4294967295,o=i+((s=t+(o<<11&4294967295|o>>>21))^t^r)+n[7]+4139469664&4294967295,o=r+((i=s+(o<<16&4294967295|o>>>16))^s^t)+n[10]+3200236656&4294967295,o=t+((r=i+(o<<23&4294967295|o>>>9))^i^s)+n[13]+681279174&4294967295,o=s+((t=r+(o<<4&4294967295|o>>>28))^r^i)+n[0]+3936430074&4294967295,o=i+((s=t+(o<<11&4294967295|o>>>21))^t^r)+n[3]+3572445317&4294967295,o=r+((i=s+(o<<16&4294967295|o>>>16))^s^t)+n[6]+76029189&4294967295,o=t+((r=i+(o<<23&4294967295|o>>>9))^i^s)+n[9]+3654602809&4294967295,o=s+((t=r+(o<<4&4294967295|o>>>28))^r^i)+n[12]+3873151461&4294967295,o=i+((s=t+(o<<11&4294967295|o>>>21))^t^r)+n[15]+530742520&4294967295,o=r+((i=s+(o<<16&4294967295|o>>>16))^s^t)+n[2]+3299628645&4294967295,r=i+(o<<23&4294967295|o>>>9),o=t+(i^(r|~s))+n[0]+4096336452&4294967295,t=r+(o<<6&4294967295|o>>>26),o=s+(r^(t|~i))+n[7]+1126891415&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~r))+n[14]+2878612391&4294967295,i=s+(o<<15&4294967295|o>>>17),o=r+(s^(i|~t))+n[5]+4237533241&4294967295,r=i+(o<<21&4294967295|o>>>11),o=t+(i^(r|~s))+n[12]+1700485571&4294967295,t=r+(o<<6&4294967295|o>>>26),o=s+(r^(t|~i))+n[3]+2399980690&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~r))+n[10]+4293915773&4294967295,i=s+(o<<15&4294967295|o>>>17),o=r+(s^(i|~t))+n[1]+2240044497&4294967295,r=i+(o<<21&4294967295|o>>>11),o=t+(i^(r|~s))+n[8]+1873313359&4294967295,t=r+(o<<6&4294967295|o>>>26),o=s+(r^(t|~i))+n[15]+4264355552&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~r))+n[6]+2734768916&4294967295,i=s+(o<<15&4294967295|o>>>17),o=r+(s^(i|~t))+n[13]+1309151649&4294967295,r=i+(o<<21&4294967295|o>>>11),o=t+(i^(r|~s))+n[4]+4149444226&4294967295,t=r+(o<<6&4294967295|o>>>26),o=s+(r^(t|~i))+n[11]+3174756917&4294967295,s=t+(o<<10&4294967295|o>>>22),o=i+(t^(s|~r))+n[2]+718787259&4294967295,i=s+(o<<15&4294967295|o>>>17),o=r+(s^(i|~t))+n[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(o<<21&4294967295|o>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+s&4294967295}function n(e,t){this.h=t;let r=[],n=!0;for(let i=e.length-1;i>=0;i--){let s=0|e[i];n&&s==t||(r[i]=s,n=!1)}this.g=r}!function(e,t){function r(){}r.prototype=t.prototype,e.F=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.D=function(e,r,n){for(var i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];return t.prototype[r].apply(e,i)}}(t,function(){this.blockSize=-1}),t.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.v=function(e,t){void 0===t&&(t=e.length);let n=t-this.blockSize,i=this.C,s=this.h,o=0;for(;o<t;){if(0==s)for(;o<=n;)r(this,e,o),o+=this.blockSize;if("string"==typeof e){for(;o<t;)if(i[s++]=e.charCodeAt(o++),s==this.blockSize){r(this,i),s=0;break}}else for(;o<t;)if(i[s++]=e[o++],s==this.blockSize){r(this,i),s=0;break}}this.h=s,this.o+=t},t.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 n=0;n<32;n+=8)e[t++]=this.g[r]>>>n&255;return e};var i,s={};function o(e){var t;return -128<=e&&e<128?(t=function(e){return new n([0|e],e<0?-1:0)},Object.prototype.hasOwnProperty.call(s,e)?s[e]:s[e]=t(e)):new n([0|e],e<0?-1:0)}function a(e){if(isNaN(e)||!isFinite(e))return l;if(e<0)return f(a(-e));let t=[],r=1;for(let n=0;e>=r;n++)t[n]=e/r|0,r*=4294967296;return new n(t,0)}var l=o(0),u=o(1),c=o(16777216);function h(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 d(e){return -1==e.h}function f(e){let t=e.g.length,r=[];for(let n=0;n<t;n++)r[n]=~e.g[n];return new n(r,~e.h).add(u)}function p(e,t){return e.add(f(t))}function m(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function g(e,t){this.g=e,this.h=t}function y(e,t){if(h(t))throw Error("division by zero");if(h(e))return new g(l,l);if(d(e))return t=y(f(e),t),new g(f(t.g),f(t.h));if(d(t))return t=y(e,f(t)),new g(f(t.g),t.h);if(e.g.length>
1030){if(d(e)||d(t))throw Error("slowDivide_ only works with positive integers.");for(var r=u,n=t;0>=n.l(e);)r=v(r),n=v(n);var i=w(r,1),s=w(n,1);for(n=w(n,2),r=w(r,2);!h(n);){var o=s.add(n);0>=o.l(e)&&(i=i.add(r),s=o),n=w(n,1),r=w(r,1)}return t=p(e,i.j(t)),new g(i,t)}for(i=l;e.l(t)>=0;){for(n=(n=Math.ceil(Math.log(r=Math.max(1,Math.floor(e.m()/t.m())))/Math.LN2))<=48?1:Math.pow(2,n-48),o=(s=a(r)).j(t);d(o)||o.l(e)>0;)r-=n,o=(s=a(r)).j(t);h(s)&&(s=u),i=i.add(s),e=p(e,o)}return new g(i,e)}function v(e){let t=e.g.length+1,r=[];for(let n=0;n<t;n++)r[n]=e.i(n)<<1|e.i(n-1)>>>31;return new n(r,e.h)}function w(e,t){let r=t>>5;t%=32;let i=e.g.length-r,s=[];for(let n=0;n<i;n++)s[n]=t>0?e.i(n+r)>>>t|e.i(n+r+1)<<32-t:e.i(n+r);return new n(s,e.h)}(i=n.prototype).m=function(){if(d(this))return-f(this).m();let e=0,t=1;for(let r=0;r<this.g.length;r++){let n=this.i(r);e+=(n>=0?n:4294967296+n)*t,t*=4294967296}return e},i.toString=function(e){if((e=e||10)<2||36<e)throw Error("radix out of range: "+e);if(h(this))return"0";if(d(this))return"-"+f(this).toString(e);let t=a(Math.pow(e,6));var r=this;let n="";for(;;){let i=y(r,t).g,s=(((r=p(r,i.j(t))).g.length>0?r.g[0]:r.h)>>>0).toString(e);if(h(r=i))return s+n;for(;s.length<6;)s="0"+s;n=s+n}},i.i=function(e){return e<0?0:e<this.g.length?this.g[e]:this.h},i.l=function(e){return d(e=p(this,e))?-1:h(e)?0:1},i.abs=function(){return d(this)?f(this):this},i.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 n(r,-2147483648&r[r.length-1]?-1:0)},i.j=function(e){if(h(this)||h(e))return l;if(d(this))return d(e)?f(this).j(f(e)):f(f(this).j(e));if(d(e))return f(this.j(f(e)));if(0>this.l(c)&&0>e.l(c))return a(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),o=e.i(t)>>>16,a=65535&e.i(t);r[2*i+2*t]+=s*a,m(r,2*i+2*t),r[2*i+2*t+1]+=n*a,m(r,2*i+2*t+1),r[2*i+2*t+1]+=s*o,m(r,2*i+2*t+1),r[2*i+2*t+2]+=n*o,m(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 n(r,0)},i.B=function(e){return y(this,e).h},i.and=function(e){let t=Math.max(this.g.length,e.g.length),r=[];for(let n=0;n<t;n++)r[n]=this.i(n)&e.i(n);return new n(r,this.h&e.h)},i.or=function(e){let t=Math.max(this.g.length,e.g.length),r=[];for(let n=0;n<t;n++)r[n]=this.i(n)|e.i(n);return new n(r,this.h|e.h)},i.xor=function(e){let t=Math.max(this.g.length,e.g.length),r=[];for(let n=0;n<t;n++)r[n]=this.i(n)^e.i(n);return new n(r,this.h^e.h)},t.prototype.digest=t.prototype.A,t.prototype.reset=t.prototype.u,t.prototype.update=t.prototype.v,e.exports.Md5=t,n.prototype.add=n.prototype.add,n.prototype.multiply=n.prototype.j,n.prototype.modulo=n.prototype.B,n.prototype.compare=n.prototype.l,n.prototype.toNumber=n.prototype.m,n.prototype.toString=n.prototype.toString,n.prototype.getBits=n.prototype.i,n.fromNumber=a,n.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 f(e(t.substring(1),r));if(t.indexOf("-")>=0)throw Error('number format error: interior "-" character');let n=a(Math.pow(r,8)),i=l;for(let e=0;e<t.length;e+=8){var s=Math.min(8,t.length-e);let o=parseInt(t.substring(e,e+s),r);s<8?(s=a(Math.pow(r,s)),i=i.j(s).add(a(o))):i=(i=i.j(n)).add(a(o))}return i},e.exports.Integer=n}).apply(void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},43462:function(e,t,r){(function(){"use strict";var t,n,i=Object.defineProperty,s=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof r.g&&r.g];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var r=s;e=e.split(".");for(var n=0;n<e.length-1;n++){var o=e[n];if(!(o in r))break e;r=r[o]}(t=t(n=r[e=e[e.length-1]]))!=n&&null!=t&&i(r,e,{configurable:!0,writable:!0,value:t})}}o("Symbol.dispose",function(e){return e||Symbol("Symbol.dispose")}),o("Array.prototype.values",function(e){return e||function(){return this[Symbol.iterator]()}}),o("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 a=a||{},l=this||self;function u(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function c(e,t,r){return e.call.apply(e.bind,arguments)}
10function h(e,t,r){return(h=c).apply(null,arguments)}function d(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 f(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,n){for(var i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];return t.prototype[r].apply(e,i)}}var p="undefined"!=typeof AsyncContext&&"function"==typeof AsyncContext.Snapshot?e=>e&&AsyncContext.Snapshot.wrap(e):e=>e;function m(e){let t=e.length;if(t>0){let r=Array(t);for(let n=0;n<t;n++)r[n]=e[n];return r}return[]}function g(e,t){for(let t=1;t<arguments.length;t++){let n=arguments[t];var r=typeof n;if("array"==(r="object"!=r?r:n?Array.isArray(n)?"array":r:"null")||"object"==r&&"number"==typeof n.length){r=e.length||0;let t=n.length||0;e.length=r+t;for(let i=0;i<t;i++)e[r+i]=n[i]}else e.push(n)}}class y{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}}class v{constructor(){this.h=this.g=null}add(e,t){let r=w.get();r.set(e,t),this.h?this.h.next=r:this.g=r,this.h=r}}var w=new y(()=>new b,e=>e.reset());class b{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 _,E=!1,I=new v,T=()=>{let e=Promise.resolve(void 0);_=()=>{e.then(S)}};function S(){let e;for(var t;e=null,I.g&&(e=I.g,I.g=I.g.next,I.g||(I.h=null),e.next=null),t=e;){try{t.h.call(t.g)}catch(e){!function(e){l.setTimeout(()=>{throw e},0)}(e)}w.j(t),w.h<100&&(w.h++,t.next=w.g,w.g=t)}E=!1}function A(){this.u=this.u,this.C=this.C}function C(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}A.prototype.u=!1,A.prototype.dispose=function(){this.u||(this.u=!0,this.N())},A.prototype[Symbol.dispose]=function(){this.dispose()},A.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},C.prototype.h=function(){this.defaultPrevented=!0};var P=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{let e=()=>{};l.addEventListener("test",e,t),l.removeEventListener("test",e,t)}catch(e){}return e}();function R(e){return/^[\s\xa0]*$/.test(e)}function k(e,t){C.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)}f(k,C),k.prototype.init=function(e,t){let r=this.type=e.type,n=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,n?(this.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.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&&k.Z.h.call(this)},k.prototype.h=function(){k.Z.h.call(this);let e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var x="closure_listenable_"+(1e6*Math.random()|0),D=0;function N(e,t,r,n,i){this.listener=e,this.proxy=null,this.src=t,this.type=r,this.capture=!!n,this.ha=i,this.key=++D,this.da=this.fa=!1}function O(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function M(e,t,r){for(let n in e)t.call(r,e[n],n,e)}function L(e){let t={};for(let r in e)t[r]=e[r];return t}let F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function V(e,t){let r,n;for(let t=1;t<arguments.length;t++){for(r in n=arguments[t])e[r]=n[r];for(let t=0;t<F.length;t++)r=F[t],Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}}function U(e){this.src=e,this.g={},this.h=0}function B(e,t){let r=t.type;if(r in e.g){var n,i=e.g[r],s=Array.prototype.indexOf.call(i,t,void 0);(n=s>=0)&&Array.prototype.splice.call(i,s,1),n&&(O(t),0==e.g[r].length&&(delete e.g[r],e.h--))}}function j(e,t,r,n){for(let i=0;i<e.length;++i){let s=e[i];if(!s.da&&s.listener==t&&!!r==s.capture&&s.ha==n)return i}return -1}U.prototype.add=function(e,t,r,n,i){let s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);let o=j(e,t,n,i);return o>-1?(t=e[o],r||(t.fa=!1)):((t=new N(t,this.src,s,!!n,i)).fa=r,e.push(t)),t};var H="closure_lm_"+(1e6*Math.random()|0),z={},q=0;function G(e,t,r,n,i,s){if(!t)throw Error("Invalid event type");let o=u(i)?!!i.capture:!!i,a=Q(e);if(a||(e[H]=a=new U(e)),(r=a.add(t,r,n,o,s)).proxy)return r;if(n=function e(t){return K.call(e.src,e.listener,t)},r.proxy=n,n.src=e,n.listener=r,e.addEventListener)P||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),n,i);else if(e.attachEvent)e.attachEvent($(t.toString()),n);else if(e.addListener&&e.removeListener)e.addListener(n);else throw Error("addEventListener and attachEvent are unavailable.");return q++,r}function W(e){if("number"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[x])B(t.i,e);else{var r=e.type,n=e.proxy;t.removeEventListener?t.removeEventListener(r,n,e.capture):t.detachEvent?t.detachEvent($(r),n):t.addListener&&t.removeListener&&t.removeListener(n),q--,(r=Q(t))?(B(r,e),0==r.h&&(r.src=null,t[H]=null)):O(e)}}}function $(e){return e in z?z[e]:z[e]="on"+e}function K(e,t){if(e.da)e=!0;else{t=new k(t,this);let r=e.listener,n=e.ha||e.src;e.fa&&W(e),e=r.call(n,t)}return e}function Q(e){return(e=e[H])instanceof U?e:null}var Y="__closure_events_fn_"+(1e9*Math.random()>>>0);function J(e){return"function"==typeof e?e:(e[Y]||(e[Y]=function(t){return e.handleEvent(t)}),e[Y])}function X(){A.call(this),this.i=new U(this),this.M=this,this.G=null}function Z(e,t){let r,n;var i,s=e.G;if(s)for(i=[];s;s=s.G)i.push(s);if(e=e.M,s=t.type||t,"string"==typeof t)t=new C(t,e);else if(t instanceof C)t.target=t.target||e;else{var o=t;V(t=new C(s,e),o)}if(o=!0,i)for(n=i.length-1;n>=0;n--)o=ee(r=t.g=i[n],s,!0,t)&&o;if(o=ee(r=t.g=e,s,!0,t)&&o,o=ee(r,s,!1,t)&&o,i)for(n=0;n<i.length;n++)o=ee(r=t.g=i[n],s,!1,t)&&o}function ee(e,t,r,n){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();let i=!0;for(let s=0;s<t.length;++s){let o=t[s];if(o&&!o.da&&o.capture==r){let t=o.listener,r=o.ha||o.src;o.fa&&B(e.i,o),i=!1!==t.call(r,n)&&i}}return i&&!n.defaultPrevented}f(X,A),X.prototype[x]=!0,X.prototype.removeEventListener=function(e,t,r,n){!function e(t,r,n,i,s){if(Array.isArray(r))for(var o=0;o<r.length;o++)e(t,r[o],n,i,s);else(i=u(i)?!!i.capture:!!i,n=J(n),t&&t[x])?(t=t.i,(o=String(r).toString())in t.g&&(n=j(r=t.g[o],n,i,s))>-1&&(O(r[n]),Array.prototype.splice.call(r,n,1),0==r.length&&(delete t.g[o],t.h--))):t&&(t=Q(t))&&(r=t.g[r.toString()],t=-1,r&&(t=j(r,n,i,s)
10),(n=t>-1?r[t]:null)&&W(n))}(this,e,t,r,n)},X.prototype.N=function(){if(X.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++)O(r[e]);delete e.g[t],e.h--}}this.G=null},X.prototype.J=function(e,t,r,n){return this.i.add(String(e),t,!1,r,n)},X.prototype.K=function(e,t,r,n){return this.i.add(String(e),t,!0,r,n)};class et extends A{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=h(e.handleEvent,e);else throw Error("Invalid listener argument")}return Number(t)>2147483647?-1:l.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&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function er(e){A.call(this),this.h=e,this.g={}}f(er,A);var en=[];function ei(e){M(e.g,function(e,t){this.g.hasOwnProperty(t)&&W(e)},e),e.g={}}er.prototype.N=function(){er.Z.N.call(this),ei(this)},er.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var es=l.JSON.stringify,eo=l.JSON.parse,ea=class{stringify(e){return l.JSON.stringify(e,void 0)}parse(e){return l.JSON.parse(e,void 0)}};function el(){}function eu(){}var ec={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function eh(){C.call(this,"d")}function ed(){C.call(this,"c")}f(eh,C),f(ed,C);var ef={},ep=null;function em(){return ep=ep||new X}function eg(e){C.call(this,ef.Ia,e)}function ey(e){let t=em();Z(t,new eg(t,e))}function ev(e,t){C.call(this,ef.STAT_EVENT,e),this.stat=t}function ew(e){let t=em();Z(t,new ev(t,e))}function eb(e,t){C.call(this,ef.Ja,e),this.size=t}function e_(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){e()},t)}function eE(){this.g=!0}function eI(e,t,r,n){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 n=r[1];if(Array.isArray(n)&&!(n.length<1)){var i=n[0];if("noop"!=i&&"stop"!=i&&"close"!=i)for(let e=1;e<n.length;e++)n[e]=""}}}}return es(s)}catch(e){return t}}(e,r)+(n?" "+n:"")})}ef.Ia="serverreachability",f(eg,C),ef.STAT_EVENT="statevent",f(ev,C),ef.Ja="timingevent",f(eb,C),eE.prototype.ua=function(){this.g=!1},eE.prototype.info=function(){};var eT={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},eS={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function eA(){}function eC(e){return encodeURIComponent(String(e))}function eP(e,t,r,n){this.j=e,this.i=t,this.l=r,this.S=n||1,this.V=new er(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 eR}function eR(){this.i=null,this.g="",this.h=!1}f(eA,el),eA.prototype.g=function(){return new XMLHttpRequest},t=new eA;var ek={},ex={};function eD(e,t,r){e.M=1,e.A=e2(eJ(t)),e.u=r,e.R=!0,eN(e,null)}function eN(e,t){e.F=Date.now(),eM(e),e.B=eJ(e.A);var r=e.B,n=e.S;Array.isArray(n)||(n=[String(n)]),to(r.i,"t",n),e.C=0,r=e.j.L,e.h=new eR,e.g=tW(e.j,r?t:null,!e.u),e.P>0&&(e.O=new et(h(e.Y,e,e.g),e.P)),t=e.V,r=e.g,n=e.ba;var i="readystatechange";Array.isArray(i)||(i&&(en[0]=i.toString()),i=en);for(let e=0;e<i.length;e++){let s=function e(t,r,n,i,s){if(i&&i.once)return function e(t,r,n,i,s){if(Array.isArray(r)){for(let o=0;o<r.length;o++)e(t,r[o],n,i,s);return null}return n=J(n),t&&t[x]?t.K(r,n,u(i)?!!i.capture:!!i,s):G(t,r,n,!0,i,s)}(t,r,n,i,s);if(Array.isArray(r)){for(let o=0;o<r.length;o++)e(t,r[o],n,i,s);return null}return n=J(n),t&&t[x]?t.J(r,n,u(i)?!!i.capture:!!i,s):G(t,r,n,!1,i,s)}(r,i[e],n||t.handleEvent,!1,t.h||t);if(!s)break;t.g[s.key]=s}t=e.J?L(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)),ey(1),function(e,t,r,n,i,s){e.info(function(){if(e.g){if(s){var o="",a=s.split("&");for(let e=0;e<a.length;e++){var l=a[e].split("=");if(l.length>1){let e=l[0];l=l[1];let t=e.split("_");o=t.length>=2&&"type"==t[1]?o+(e+"=")+l+"&":o+(e+"=redacted&")}}}else o=null}else o=s;return"XMLHTTP REQ ("+n+") [attempt "+i+"]: "+t+"\n"+r+"\n"+o})}(e.i,e.v,e.B,e.l,e.S,e.u)}function eO(e){return!!e.g&&"GET"==e.v&&2!=e.M&&e.j.Aa}function eM(e){e.T=Date.now()+e.H,eL(e,e.H)}function eL(e,t){if(null!=e.D)throw Error("WatchDog timer not null");e.D=e_(h(e.aa,e),t)}function eF(e){e.D&&(l.clearTimeout(e.D),e.D=null)}function eV(e){0==e.j.I||e.K||tj(e.j,e)}function eU(e){eF(e);var t=e.O;t&&"function"==typeof t.dispose&&t.dispose(),e.O=null,ei(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.dis
10pose())}function eB(e,t){try{var r=e.j;if(0!=r.I&&(r.g==e||eG(r.h,e))){if(!e.L&&eG(r.h,e)&&3==r.I){try{var n=r.Ba.g.parse(t)}catch(e){n=null}if(Array.isArray(n)&&3==n.length){var i=n;if(0==i[0]){e:if(!r.v){if(r.g){if(r.g.F+3e3<e.F)tB(r),tk(r);else break e}tF(r),ew(18)}}else r.xa=i[1],0<r.xa-r.K&&i[2]<37500&&r.F&&0==r.A&&!r.C&&(r.C=e_(h(r.Va,r),6e3));1>=eq(r.h)&&r.ta&&(r.ta=void 0)}else tz(r,11)}else if((e.L||r.g==e)&&tB(r),!R(t))for(i=r.Ba.g.parse(t),t=0;t<i.length;t++){let a=i[t],l=a[0];if(!(l<=r.K)){if(r.K=l,a=a[1],2==r.I){if("c"==a[0]){r.M=a[1],r.ba=a[2];let t=a[3];null!=t&&(r.ka=t,r.j.info("VER="+r.ka));let i=a[4];null!=i&&(r.za=i,r.j.info("SVER="+r.za));let l=a[5];null!=l&&"number"==typeof l&&l>0&&(n=1.5*l,r.O=n,r.j.info("backChannelRequestTimeoutMs_="+n)),n=r;let u=e.g;if(u){let e=u.g?u.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var s=n.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&&(eW(s,s.h),s.h=null))}if(n.G){let e=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(n.wa=e,e1(n.J,n.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")),(n=r).na=tG(n,n.L?n.ba:null,n.W),e.L){e$(n.h,e);var o=n.O;o&&(e.H=o),e.D&&(eF(e),eM(e)),n.g=e}else tL(n);r.i.length>0&&tD(r)}else"stop"!=a[0]&&"close"!=a[0]||tz(r,7)}else 3==r.I&&("stop"==a[0]||"close"==a[0]?"stop"==a[0]?tz(r,7):tR(r):"noop"!=a[0]&&r.l&&r.l.qa(a),r.A=0)}}}ey(4)}catch(e){}}eP.prototype.ba=function(e){e=e.target;let t=this.O;t&&3==tS(e)?t.j():this.Y(e)},eP.prototype.Y=function(e){try{if(e==this.g)e:{let a=tS(this.g),u=this.g.ya(),c=this.g.ca();if(!(a<3)&&(3!=a||this.g&&(this.h.h||this.g.la()||tA(this.g)))){this.K||4!=a||7==u||(8==u||c<=0?ey(3):ey(2)),eF(this);var t=this.g.ca();this.X=t;var r=function(e){if(!eO(e))return e.g.la();let t=tA(e.g);if(""===t)return"";let r="",n=t.length,i=4==tS(e.g);if(!e.h.i){if("undefined"==typeof TextDecoder)return eU(e),eV(e),"";e.h.i=new l.TextDecoder}for(let s=0;s<n;s++)e.h.h=!0,r+=e.h.i.decode(t[s],{stream:!(i&&s==n-1)});return t.length=0,e.h.g+=r,e.C=0,e.h.g}(this);if(this.o=200==t,function(e,t,r,n,i,s,o){e.info(function(){return"XMLHTTP RESP ("+n+") [ attempt "+i+"]: "+t+"\n"+r+"\n"+s+" "+o})}(this.i,this.v,this.B,this.l,this.S,a,t),this.o){if(this.U&&!this.L){t:{if(this.g){var n,i=this.g;if((n=i.g?i.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!R(n)){var s=n;break t}}s=null}if(e=s)eI(this.i,this.l,e,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,eB(this,e);else{this.o=!1,this.m=3,ew(12),eU(this),eV(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,n=t.indexOf("\n",r);return -1==n?ex:isNaN(r=Number(t.substring(r,n)))?ek:(n+=1)+r>t.length?ex:(t=t.slice(n,n+r),e.C=n+r,t)}(this,r))==ex){4==a&&(this.m=4,ew(14),e=!1),eI(this.i,this.l,null,"[Incomplete Response]");break}else if(t==ek){this.m=4,ew(15),eI(this.i,this.l,r,"[Invalid Chunk]"),e=!1;break}else eI(this.i,this.l,t,null),eB(this,t);if(eO(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=a||0!=r.length||this.h.h||(this.m=1,ew(16),e=!1),this.o=this.o&&e,e){if(r.length>0&&!this.W){this.W=!0;var o=this.j;o.g==this&&o.aa&&!o.P&&(o.j.info("Great, no buffering proxy detected. Bytes received: "+r.length),tV(o),o.P=!0,ew(11))}}else eI(this.i,this.l,r,"[Invalid Chunked Response]"),eU(this),eV(this)}else eI(this.i,this.l,r,null),eB(this,r);4==a&&eU(this),this.o&&!this.K&&(4==a?tj(this.j,this):(this.o=!1,eM(this)))}else(function(e){let t={};e=(e.g&&tS(e)>=2&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let n=0;n<e.length;n++){if(R(e[n]))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[n]);let i=r[0];if("string"!=typeof(r=r[1]))continue;r=r.trim();let s=t[i]||[];t[i]=s,s.push(r)}!function(e,t){for(let r in e)t.call(void 0,e[r],r,e)}(t,function(e){return e.join(", ")})})(this.g),400==t&&r.indexOf("Unknown SID")>0?(this.m=3,ew(12)):(this.m=0,ew(13)),eU(this),eV(this)}}}catch(e){}finally{}},eP.prototype.cancel=function(){this.K=!0,eU(this)},eP.prototype.aa=function(){this.D=null;let e=Date.now();e-this.T>=0?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.B),2!=this.M&&(ey(3),ew(17)),eU(this),this.m=2,eV(this)):eL(this,this.T-e)};var ej=class{constructor(e,t){this.g=e,this.map=t}};function eH(e){this.l=e||10,e=l.PerformanceNavigationTiming?(e=l.performance.getEntriesByType("navigation")).length>0&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):!!(l.chrome&&l.chrome.loadTimes&&l.chrome.loadTimes()&&l.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 ez(e){return!!e.h||!!e.g&&e.g.size>=e.j}function eq(e){return e.h?1:e.g?e.g.size:0}function eG(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function eW(e,t){e.g?e.g.add(t):e.h=t}function e$(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function eK(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 m(e.i)}eH.prototype.cancel=function(){if(this.i=eK(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 eQ=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function eY(e){let t;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,e instanceof eY?(this.l=e.l,eX(this,e.j),this.o=e.o,this.g=e.g,eZ(this,e.u),this.h=e.h,e0(this,ta(e.i)),this.m=e.m):e&&(t=String(e).match(eQ))?(this.l=!1,eX(this,t[1]||"",!0),this.o=e4(t[2]||""),this.g=e4(t[3]||"",!0),eZ(this,t[4]),this.h=e4(t[5]||"",!0),e0(this,t[6]||"",!0),this.m=e4(t[7]||"")):(this.l=!1,this.i=new tt(null,this.l))}function eJ(e){return new eY(e)}function eX(e,t,r){e.j=r?e4(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function eZ(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 e0(e,t,r){var n,i;t instanceof tt?(e.i=t,n=e.i,(i=e.l)&&!n.j&&(tr(n),n.i=null,n.g.forEach(function(e,t){let r=t.toLowerCase();t!=r&&(tn(this,t),to(this,r,e))}
10,n)),n.j=i):(r||(t=e6(t,e7)),e.i=new tt(t,e.l))}function e1(e,t,r){e.i.set(t,r)}function e2(e){return e1(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function e4(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function e6(e,t,r){return"string"==typeof e?(e=encodeURI(e).replace(t,e8),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function e8(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}eY.prototype.toString=function(){let e=[];var t=this.j;t&&e.push(e6(t,e3,!0),":");var r=this.g;return(r||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(e6(t,e3,!0),"@"),e.push(eC(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(e6(r,"/"==r.charAt(0)?e9:e5,!0))),(r=this.i.toString())&&e.push("?",r),(r=this.m)&&e.push("#",e6(r,te)),e.join("")},eY.prototype.resolve=function(e){let t=eJ(this),r=!!e.j;r?eX(t,e.j):r=!!e.o,r?t.o=e.o:r=!!e.g,r?t.g=e.g:r=null!=e.u;var n=e.h;if(r)eZ(t,e.u);else if(r=!!e.h){if("/"!=n.charAt(0)){if(this.g&&!this.h)n="/"+n;else{var i=t.h.lastIndexOf("/");-1!=i&&(n=t.h.slice(0,i+1)+n)}}if(".."==(i=n)||"."==i)n="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){n=0==i.lastIndexOf("/",0),i=i.split("/");let e=[];for(let t=0;t<i.length;){let r=i[t++];"."==r?n&&t==i.length&&e.push(""):".."==r?((e.length>1||1==e.length&&""!=e[0])&&e.pop(),n&&t==i.length&&e.push("")):(e.push(r),n=!0)}n=e.join("/")}else n=i}return r?t.h=n:r=""!==e.i.toString(),r?e0(t,ta(e.i)):r=!!e.m,r&&(t.m=e.m),t};var e3=/[#\/\?@]/g,e5=/[#\?:]/g,e9=/[#\?]/g,e7=/[#\?@]/g,te=/#/g;function tt(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function tr(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 n=e[r].indexOf("="),i,s=null;n>=0?(i=e[r].substring(0,n),s=e[r].substring(n+1)):i=e[r],t(i,s?decodeURIComponent(s.replace(/\+/g," ")):"")}}}(e.i,function(t,r){e.add(decodeURIComponent(t.replace(/\+/g," ")),r)}))}function tn(e,t){tr(e),t=tl(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function ti(e,t){return tr(e),t=tl(e,t),e.g.has(t)}function ts(e,t){tr(e);let r=[];if("string"==typeof t)ti(e,t)&&(r=r.concat(e.g.get(tl(e,t))));else for(e=Array.from(e.g.values()),t=0;t<e.length;t++)r=r.concat(e[t]);return r}function to(e,t,r){tn(e,t),r.length>0&&(e.i=null,e.g.set(tl(e,t),m(r)),e.h+=r.length)}function ta(e){let t=new tt;return t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),t}function tl(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function tu(e,t,r,n,i){try{i&&(i.onload=null,i.onerror=null,i.onabort=null,i.ontimeout=null),n(r)}catch(e){}}function tc(){this.g=new ea}function th(e){this.i=e.Sb||null,this.h=e.ab||!1}function td(e,t){X.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 tf(e){e.j.read().then(e.Ma.bind(e)).catch(e.ga.bind(e))}function tp(e){e.readyState=4,e.l=null,e.j=null,e.B=null,tm(e)}function tm(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function tg(e){let t="";return M(e,function(e,r){t+=r+":"+e+"\r\n"}),t}function ty(e,t,r){e:{for(n in r){var n=!1;break e}n=!0}n||(r=tg(r),"string"==typeof e?(eC(t),null!=r&&eC(r)):e1(e,t,r))}function tv(e){X.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}(n=tt.prototype).add=function(e,t){tr(this),this.i=null,e=tl(this,e);let r=this.g.get(e);return r||this.g.set(e,r=[]),r.push(t),this.h+=1,this},n.forEach=function(e,t){tr(this),this.g.forEach(function(r,n){r.forEach(function(r){e.call(t,r,n,this)},this)},this)},n.set=function(e,t){return tr(this),this.i=null,ti(this,e=tl(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},n.get=function(e,t){return e&&(e=ts(this,e)).length>0?String(e[0]):t},n.toString=function(){if(this.i)return this.i;if(!this.g)return"";let e=[],t=Array.from(this.g.keys());for(let n=0;n<t.length;n++){var r=t[n];let i=eC(r);r=ts(this,r);for(let t=0;t<r.length;t++){let n=i;""!==r[t]&&(n+="="+eC(r[t])),e.push(n)}}return this.i=e.join("&")},f(th,el),th.prototype.g=function(){return new td(this.i,this.h)},f(td,X),(n=td.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,tm(this)},n.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");
10if(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||l).fetch(new Request(this.D,t)).then(this.Pa.bind(this),this.ga.bind(this))},n.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,tp(this)),this.readyState=0},n.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,tm(this)),this.g&&(this.readyState=3,tm(this),this.g))){if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==l.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;tf(this)}else e.text().then(this.Oa.bind(this),this.ga.bind(this))}},n.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?tp(this):tm(this),3==this.readyState&&tf(this)}},n.Oa=function(e){this.g&&(this.response=this.responseText=e,tp(this))},n.Na=function(e){this.g&&(this.response=e,tp(this))},n.ga=function(){this.g&&tp(this)},n.setRequestHeader=function(e,t){this.A.append(e,t)},n.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},n.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(td.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),f(tv,X);var tw=/^https?$/i,tb=["POST","PUT"];function t_(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.o=5,tE(e),tT(e)}function tE(e){e.A||(e.A=!0,Z(e,"complete"),Z(e,"error"))}function tI(e){if(e.h&&void 0!==a){if(e.v&&4==tS(e))setTimeout(e.Ca.bind(e),0);else if(Z(e,"readystatechange"),4==tS(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,n=!0;break;default:n=!1}if(!(t=n)){if(r=0===s){let t=String(e.D).match(eQ)[1]||null;!t&&l.self&&l.self.location&&(t=l.self.location.protocol.slice(0,-1)),r=!tw.test(t?t.toLowerCase():"")}t=r}if(t)Z(e,"complete"),Z(e,"success");else{e.o=6;try{var i=tS(e)>2?e.g.statusText:""}catch(e){i=""}e.l=i+" ["+e.ca()+"]",tE(e)}}finally{tT(e)}}}}function tT(e,t){if(e.g){e.m&&(clearTimeout(e.m),e.m=null);let r=e.g;e.g=null,t||Z(e,"ready");try{r.onreadystatechange=null}catch(e){}}}function tS(e){return e.g?e.g.readyState:0}function tA(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}}function tC(e,t,r){return r&&r.internalChannelParams&&r.internalChannelParams[e]||t}function tP(e){this.za=0,this.i=[],this.j=new eE,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=tC("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=tC("baseRetryDelayMs",5e3,e),this.Za=tC("retryDelaySeedMs",1e4,e),this.Ta=tC("forwardChannelMaxRetries",2,e),this.va=tC("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 eH(e&&e.concurrentRequestLimit),this.Ba=new tc,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 tR(e){if(tx(e),3==e.I){var t=e.V++,r=eJ(e.J);if(e1(r,"SID",e.M),e1(r,"RID",t),e1(r,"TYPE","terminate"),tO(e,r),(t=new eP(e,e.j,t)).M=2,t.A=e2(eJ(r)),r=!1,l.navigator&&l.navigator.sendBeacon)try{r=l.navigator.sendBeacon(t.A.toString(),"")}catch(e){}!r&&l.Image&&((new Image).src=t.A,r=!0),r||(t.g=tW(t.j,null),t.g.ea(t.A)),t.F=Date.now(),eM(t)}tq(e)}function tk(e){e.g&&(tV(e),e.g.cancel(),e.g=null)}function tx(e){tk(e),e.v&&(l.clearTimeout(e.v),e.v=null),tB(e),e.h.cancel(),e.m&&("number"==typeof e.m&&l.clearTimeout(e.m),e.m=null)}function tD(e){if(!ez(e.h)&&!e.m){e.m=!0;var t=e.Ea;_||T(),E||(_(),E=!0),I.add(t,e),e.D=0}}function tN(e,t){var r;r=t?t.l:e.V++;let n=eJ(e.J);e1(n,"SID",e.M),e1(n,"RID",r),e1(n,"AID",e.K),tO(e,n),e.u&&e.o&&ty(n,e.u,e.o),r=new eP(e,e.j,r,e.D+1),null===e.u&&(r.J=e.o),t&&(e.i=t.G.concat(e.i)),t=tM(e,r,1e3),r.H=Math.round(.5*e.va)+Math.round(.5*e.va*Math.random()),eW(e.h,r),eD(r,n,t)}function tO(e,t){e.H&&M(e.H,function(e,r){e1(t,r,e)}),e.l&&M({},function(e,r){e1(t,r,e)})}function tM(e,t,r){r=Math.min(e.i.length,r);let n=e.l?h(e.l.Ka,e.l,e):null;e:{var i=e.i;let t=-1;for(;;){let e=["count="+r];-1==t?r>0?(t=i[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let a=!0;for(let l=0;l<r;l++){var s=i[l].g;let r=i[l].map;if((s-=t)<0)t=Math.max(0,i[l].g-100),a=!1;else try{s="req"+s+"_";try{var o=r instanceof Map?r:Object.entries(r);for(let[t,r]of o){let n=r;u(r)&&(n=es(r)),e.push(s+t+"="+encodeURIComponent(n))}}catch(t){throw e.push(s+"type="+encodeURIComponent("_badmap")),t}}catch(e){n&&n(r)}}if(a){o=e.join("&");break e}}o=void 0}return e=e.i.splice(0,r),t.G=e,o}function tL(e){if(!e.g&&!e.v){e.Y=1;var t=e.Da;
10_||T(),E||(_(),E=!0),I.add(t,e),e.A=0}}function tF(e){return!e.g&&!e.v&&!(e.A>=3)&&(e.Y++,e.v=e_(h(e.Da,e),tH(e,e.A)),e.A++,!0)}function tV(e){null!=e.B&&(l.clearTimeout(e.B),e.B=null)}function tU(e){e.g=new eP(e,e.j,"rpc",e.Y),null===e.u&&(e.g.J=e.o),e.g.P=0;var t=eJ(e.na);e1(t,"RID","rpc"),e1(t,"SID",e.M),e1(t,"AID",e.K),e1(t,"CI",e.F?"0":"1"),!e.F&&e.ia&&e1(t,"TO",e.ia),e1(t,"TYPE","xmlhttp"),tO(e,t),e.u&&e.o&&ty(t,e.u,e.o),e.O&&(e.g.H=e.O);var r=e.g;e=e.ba,r.M=1,r.A=e2(eJ(t)),r.u=null,r.R=!0,eN(r,e)}function tB(e){null!=e.C&&(l.clearTimeout(e.C),e.C=null)}function tj(e,t){var r=null;if(e.g==t){tB(e),tV(e),e.g=null;var n=2}else{if(!eG(e.h,t))return;r=t.G,e$(e.h,t),n=1}if(0!=e.I){if(t.o){if(1==n){r=t.u?t.u.length:0,t=Date.now()-t.F;var i,s=e.D;Z(n=em(),new eb(n,r,t,s)),tD(e)}else tL(e)}else if(3==(s=t.m)||0==s&&t.X>0||!(1==n&&(i=t,!(eq(e.h)>=e.h.j-(e.m?1:0))&&(e.m?(e.i=i.G.concat(e.i),!0):1!=e.I&&2!=e.I&&!(e.D>=(e.Sa?0:e.Ta))&&(e.m=e_(h(e.Ea,e,i),tH(e,e.D)),e.D++,!0)))||2==n&&tF(e)))switch(r&&r.length>0&&((t=e.h).i=t.i.concat(r)),s){case 1:tz(e,5);break;case 4:tz(e,10);break;case 3:tz(e,6);break;default:tz(e,2)}}}function tH(e,t){let r=e.Qa+Math.floor(Math.random()*e.Za);return e.isActive()||(r*=2),r*t}function tz(e,t){if(e.j.info("Error code "+t),2==t){var r=h(e.bb,e),n=e.Ua;let t=!n;n=new eY(n||"//www.google.com/images/cleardot.gif"),l.location&&"http"==l.location.protocol||eX(n,"https"),e2(n),t?function(e,t){let r=new eE;if(l.Image){let n=new Image;n.onload=d(tu,r,"TestLoadImage: loaded",!0,t,n),n.onerror=d(tu,r,"TestLoadImage: error",!1,t,n),n.onabort=d(tu,r,"TestLoadImage: abort",!1,t,n),n.ontimeout=d(tu,r,"TestLoadImage: timeout",!1,t,n),l.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=e}else t(!1)}(n.toString(),r):function(e,t){let r=new eE,n=new AbortController,i=setTimeout(()=>{n.abort(),tu(r,"TestPingServer: timeout",!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(i),e.ok?tu(r,"TestPingServer: ok",!0,t):tu(r,"TestPingServer: server error",!1,t)}).catch(()=>{clearTimeout(i),tu(r,"TestPingServer: error",!1,t)})}(n.toString(),r)}else ew(2);e.I=0,e.l&&e.l.pa(t),tq(e),tx(e)}function tq(e){if(e.I=0,e.ja=[],e.l){let t=eK(e.h);(0!=t.length||0!=e.i.length)&&(g(e.ja,t),g(e.ja,e.i),e.h.i.length=0,m(e.i),e.i.length=0),e.l.oa()}}function tG(e,t,r){var n=r instanceof eY?eJ(r):new eY(r);if(""!=n.g)t&&(n.g=t+"."+n.g),eZ(n,n.u);else{var i=l.location;n=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;let e=new eY(null);n&&eX(e,n),t&&(e.g=t),i&&eZ(e,i),r&&(e.h=r),n=e}return r=e.G,t=e.wa,r&&t&&e1(n,r,t),e1(n,"VER",e.ka),tO(e,n),n}function tW(e,t,r){if(t&&!e.L)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new tv(e.Aa&&!e.ma?new th({ab:r}):e.ma)).Fa(e.L),t}function t$(){}function tK(){}function tQ(e,t){X.call(this),this.g=new tP(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)&&!R(e)&&(this.g.u=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!R(t)&&(this.g.G=t,null!==(e=this.h)&&t in e&&t in(e=this.h)&&delete e[t]),this.j=new tX(this)}function tY(e){eh.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 tJ(){ed.call(this),this.status=1}function tX(e){this.g=e}(n=tv.prototype).Fa=function(e){this.H=e},n.ea=function(e,r,n,i){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);r=r?r.toUpperCase():"GET",this.D=e,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():t.g(),this.g.onreadystatechange=p(h(this.Ca,this));try{this.B=!0,this.g.open(r,String(e),!0),this.B=!1}catch(e){t_(this,e);return}if(e=n||"",n=new Map(this.headers),i){if(Object.getPrototypeOf(i)===Object.prototype)for(var s in i)n.set(s,i[s]);else if("function"==typeof i.keys&&"function"==typeof i.get)for(let e of i.keys())n.set(e,i.get(e));else throw Error("Unknown input type for opt_headers: "+String(i))}for(let[t,o]of(i=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),s=l.FormData&&e instanceof l.FormData,!(Array.prototype.indexOf.call(tb,r,void 0)>=0)||i||s||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),n))this.g.setRequestHeader(t,o);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(e),this.v=!1}catch(e){t_(this,e)}},n.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=e||7,Z(this,"complete"),Z(this,"abort"),tT(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),tT(this,!0)),tv.Z.N.call(this)}
10,n.Ca=function(){this.u||(this.B||this.v||this.j?tI(this):this.Xa())},n.Xa=function(){tI(this)},n.isActive=function(){return!!this.g},n.ca=function(){try{return tS(this)>2?this.g.status:-1}catch(e){return -1}},n.la=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},n.La=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),eo(t)}},n.ya=function(){return this.o},n.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(n=tP.prototype).ka=8,n.I=1,n.connect=function(e,t,r,n){ew(0),this.W=e,this.H=t||{},r&&void 0!==n&&(this.H.OSID=r,this.H.OAID=n),this.F=this.X,this.J=tG(this,null,this.W),tD(this)},n.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 i=new eP(this,this.j,e),s=this.o;if(this.U&&(s?V(s=L(s),this.U):s=this.U),null!==this.u||this.R||(i.J=s,s=null),this.S)e:{for(var t=0,r=0;r<this.i.length;r++){t:{var n=this.i[r];if("__data__"in n.map&&"string"==typeof(n=n.map.__data__)){n=n.length;break t}n=void 0}if(void 0===n)break;if((t+=n)>4096){t=r;break e}if(4096===t||r===this.i.length-1){t=r+1;break e}}t=1e3}else t=1e3;t=tM(this,i,t),e1(r=eJ(this.J),"RID",e),e1(r,"CVER",22),this.G&&e1(r,"X-HTTP-Session-Id",this.G),tO(this,r),s&&(this.R?t="headers="+eC(tg(s))+"&"+t:this.u&&ty(r,this.u,s)),eW(this.h,i),this.Ra&&e1(r,"TYPE","init"),this.S?(e1(r,"$req",t),e1(r,"SID","null"),i.U=!0,eD(i,r,null)):eD(i,r,t),this.I=2}}else 3==this.I&&(e?tN(this,e):0==this.i.length||ez(this.h)||tN(this))}},n.Da=function(){if(this.v=null,tU(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=e_(h(this.Wa,this),e)}},n.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,ew(10),tk(this),tU(this))},n.Va=function(){null!=this.C&&(this.C=null,tk(this),tF(this),ew(19))},n.bb=function(e){e?(this.j.info("Successfully pinged google.com"),ew(2)):(this.j.info("Failed to ping google.com"),ew(1))},n.isActive=function(){return!!this.l&&this.l.isActive(this)},(n=t$.prototype).ra=function(){},n.qa=function(){},n.pa=function(){},n.oa=function(){},n.isActive=function(){return!0},n.Ka=function(){},tK.prototype.g=function(e,t){return new tQ(e,t)},f(tQ,X),tQ.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},tQ.prototype.close=function(){tR(this.g)},tQ.prototype.o=function(e){var t=this.g;if("string"==typeof e){var r={};r.__data__=e,e=r}else this.v&&((r={}).__data__=es(e),e=r);t.i.push(new ej(t.Ya++,e)),3==t.I&&tD(t)},tQ.prototype.N=function(){this.g.l=null,delete this.j,tR(this.g),delete this.g,tQ.Z.N.call(this)},f(tY,eh),f(tJ,ed),f(tX,t$),tX.prototype.ra=function(){Z(this.g,"a")},tX.prototype.qa=function(e){Z(this.g,new tY(e))},tX.prototype.pa=function(e){Z(this.g,new tJ(e))},tX.prototype.oa=function(){Z(this.g,"b")},tK.prototype.createWebChannel=tK.prototype.g,tQ.prototype.send=tQ.prototype.o,tQ.prototype.open=tQ.prototype.m,tQ.prototype.close=tQ.prototype.close,e.exports.createWebChannelTransport=function(){return new tK},e.exports.getStatEventTarget=function(){return em()},e.exports.Event=ef,e.exports.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},eT.NO_ERROR=0,eT.TIMEOUT=8,eT.HTTP_ERROR=6,e.exports.ErrorCode=eT,eS.COMPLETE="complete",e.exports.EventType=eS,eu.EventType=ec,ec.OPEN="a",ec.CLOSE="b",ec.ERROR="c",ec.MESSAGE="d",X.prototype.listen=X.prototype.J,e.exports.WebChannel=eu,e.exports.FetchXmlHttpFactory=th,tv.prototype.listenOnce=tv.prototype.K,tv.prototype.getLastError=tv.prototype.Ha,tv.prototype.getLastErrorCode=tv.prototype.ya,tv.prototype.getStatus=tv.prototype.ca,tv.prototype.getResponseJson=tv.prototype.La,tv.prototype.getResponseText=tv.prototype.la,tv.prototype.send=tv.prototype.ea,tv.prototype.setWithCredentials=tv.prototype.Fa,e.exports.XhrIo=tv}).apply(void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},75413:function(e,t,r){"use strict";function n(e,t){var r=t&&t.cache?t.cache:l,n=t&&t.serializer?t.serializer:o;return(t&&t.strategy?t.strategy:function(e,t){var r,n,o=1===e.length?
10i:s;return r=t.cache.create(),n=t.serializer,o.bind(this,e,r,n)})(e,{cache:r,serializer:n})}function i(e,t,r,n){var i=null==n||"number"==typeof n||"boolean"==typeof n?n:r(n),s=t.get(i);return void 0===s&&(s=e.call(this,n),t.set(i,s)),s}function s(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),s=t.get(i);return void 0===s&&(s=e.apply(this,n),t.set(i,s)),s}r.d(t,{A:function(){return u},H:function(){return n}});var o=function(){return JSON.stringify(arguments)},a=function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(e){return this.cache[e]},e.prototype.set=function(e,t){this.cache[e]=t},e}(),l={create:function(){return new a}},u={variadic:function(e,t){var r,n;return r=t.cache.create(),n=t.serializer,s.bind(this,e,r,n)},monadic:function(e,t){var r,n;return r=t.cache.create(),n=t.serializer,i.bind(this,e,r,n)}}},56722:function(e,t,r){"use strict";r.d(t,{wD:function(){return a},VG:function(){return f},rp:function(){return m},Ii:function(){return E},O4:function(){return d},uf:function(){return p},Wh:function(){return _},Jo:function(){return v},yx:function(){return w},Wi:function(){return y},HI:function(){return b},pe:function(){return g},Qc:function(){return en}});var n,i,s,o,a,l,u,c,h=r(22970);function d(e){return e.type===a.literal}function f(e){return e.type===a.argument}function p(e){return e.type===a.number}function m(e){return e.type===a.date}function g(e){return e.type===a.time}function y(e){return e.type===a.select}function v(e){return e.type===a.plural}function w(e){return e.type===a.pound}function b(e){return e.type===a.tag}function _(e){return!!(e&&"object"==typeof e&&e.type===l.number)}function E(e){return!!(e&&"object"==typeof e&&e.type===l.dateTime)}(n=o||(o={}))[n.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",n[n.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",n[n.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",n[n.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",n[n.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",n[n.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",n[n.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",n[n.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",n[n.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",n[n.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",n[n.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",n[n.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",n[n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",n[n.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",n[n.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",n[n.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",n[n.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",n[n.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",n[n.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",n[n.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",n[n.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",n[n.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",n[n.INVALID_TAG=23]="INVALID_TAG",n[n.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",n[n.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",n[n.UNCLOSED_TAG=27]="UNCLOSED_TAG",(i=a||(a={}))[i.literal=0]="literal",i[i.argument=1]="argument",i[i.number=2]="number",i[i.date=3]="date",i[i.time=4]="time",i[i.select=5]="select",i[i.plural=6]="plural",i[i.pound=7]="pound",i[i.tag=8]="tag",(s=l||(l={}))[s.number=0]="number",s[s.dateTime=1]="dateTime";var I=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,T=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g,S=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,A=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,C=/^(@+)?(\+|#+)?[rs]?$/g,P=/(\*)(0+)|(#+)(0+)|(0+)/g,R=/^(0+)$/;function k(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(C,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function x(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function D(e){return x(e)||{}}var N={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA
10:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]},O=new RegExp("^".concat(I.source,"*")),M=new RegExp("".concat(I.source,"*$"));function L(e,t){return{start:e,end:t}}var F=!!String.prototype.startsWith&&"_a".startsWith("a",1),V=!!String.fromCodePoint,U=!!Object.fromEntries,B=!!String.prototype.codePointAt,j=!!String.prototype.trimStart,H=!!String.prototype.trimEnd,z=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&9007199254740991>=Math.abs(e)},q=!0;try{var G=X("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");q=(null===(u=G.exec("a"))||void 0===u?void 0:u[0])==="a"}catch(e){q=!1}var W=F?function(e,t,r){return e.startsWith(t,r)}:function(e,t,r){return e.slice(r,r+t.length)===t},$=V?String.fromCodePoint:function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n="",i=t.length,s=0;i>s;){if((e=t[s++])>1114111)throw RangeError(e+" is not a valid code point");n+=e<65536?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,e%1024+56320)}return n},K=U?Object.fromEntries:function(e){for(var t={},r=0;r<e.length;r++){var n=e[r],i=n[0],s=n[1];t[i]=s}return t},Q=B?function(e,t){return e.codePointAt(t)}:function(e,t){var r,n=e.length;if(!(t<0)&&!(t>=n)){var i=e.charCodeAt(t);return i<55296||i>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?i:(i-55296<<10)+(r-56320)+65536}},Y=j?function(e){return e.trimStart()}:function(e){return e.replace(O,"")},J=H?function(e){return e.trimEnd()}:function(e){return e.replace(M,"")};function X(e,t){return new RegExp(e,t)}if(q){var Z=X("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");c=function(e,t){var r;return Z.lastIndex=t,null!==(r=Z.exec(e)[1])&&void 0!==r?r:""}}else c=function(e,t){for(var r=[];;){var n,i=Q(e,t);if(void 0===i||er(i)||(n=i)>=33&&n<=35||36===n||n>=37&&n<=39||40===n||41===n||42===n||43===n||44===n||45===n||n>=46&&n<=47||n>=58&&n<=59||n>=60&&n<=62||n>=63&&n<=64||91===n||92===n||93===n||94===n||96===n||123===n||124===n||125===n||126===n||161===n||n>=162&&n<=165||166===n||167===n||169===n||171===n||172===n||174===n||176===n||177===n||182===n||187===n||191===n||215===n||247===n||n>=8208&&n<=8213||n>=8214&&n<=8215||8216===n||8217===n||8218===n||n>=8219&&n<=8220||8221===n||8222===n||8223===n||n>=8224&&n<=8231||n>=8240&&n<=8248||8249===n||8250===n||n>=8251&&n<=8254||n>=8257&&n<=8259||8260===n||8261===n||8262===n||n>=8263&&n<=8273||8274===n||8275===n||n>=8277&&n<=8286||n>=8592&&n<=8596||n>=8597&&n<=8601||n>=8602&&n<=8603||n>=8604&&n<=8607||8608===n||n>=8609&&n<=8610||8611===n||n>=8612&&n<=8613||8614===n||n>=8615&&n<=8621||8622===n||n>=8623&&n<=8653||n>=8654&&n<=8655||n>=8656&&n<=8657||8658===n||8659===n||8660===n||n>=8661&&n<=8691||n>=8692&&n<=8959||n>=8960&&n<=8967||8968===n||8969===n||8970===n||8971===n||n>=8972&&n<=8991||n>=8992&&n<=8993||n>=8994&&n<=9e3||9001===n||9002===n||n>=9003&&n<=9083||9084===n||n>=9085&&n<=9114||n>=9115&&n<=9139||n>=9140&&n<=9179||n>=9180&&n<=9185||n>=9186&&n<=9254||n>=9255&&n<=9279||n>=9280&&n<=9290||n>=9291&&n<=9311||n>=9472&&n<=9654||9655===n||n>
10=9656&&n<=9664||9665===n||n>=9666&&n<=9719||n>=9720&&n<=9727||n>=9728&&n<=9838||9839===n||n>=9840&&n<=10087||10088===n||10089===n||10090===n||10091===n||10092===n||10093===n||10094===n||10095===n||10096===n||10097===n||10098===n||10099===n||10100===n||10101===n||n>=10132&&n<=10175||n>=10176&&n<=10180||10181===n||10182===n||n>=10183&&n<=10213||10214===n||10215===n||10216===n||10217===n||10218===n||10219===n||10220===n||10221===n||10222===n||10223===n||n>=10224&&n<=10239||n>=10240&&n<=10495||n>=10496&&n<=10626||10627===n||10628===n||10629===n||10630===n||10631===n||10632===n||10633===n||10634===n||10635===n||10636===n||10637===n||10638===n||10639===n||10640===n||10641===n||10642===n||10643===n||10644===n||10645===n||10646===n||10647===n||10648===n||n>=10649&&n<=10711||10712===n||10713===n||10714===n||10715===n||n>=10716&&n<=10747||10748===n||10749===n||n>=10750&&n<=11007||n>=11008&&n<=11055||n>=11056&&n<=11076||n>=11077&&n<=11078||n>=11079&&n<=11084||n>=11085&&n<=11123||n>=11124&&n<=11125||n>=11126&&n<=11157||11158===n||n>=11159&&n<=11263||n>=11776&&n<=11777||11778===n||11779===n||11780===n||11781===n||n>=11782&&n<=11784||11785===n||11786===n||11787===n||11788===n||11789===n||n>=11790&&n<=11798||11799===n||n>=11800&&n<=11801||11802===n||11803===n||11804===n||11805===n||n>=11806&&n<=11807||11808===n||11809===n||11810===n||11811===n||11812===n||11813===n||11814===n||11815===n||11816===n||11817===n||n>=11818&&n<=11822||11823===n||n>=11824&&n<=11833||n>=11834&&n<=11835||n>=11836&&n<=11839||11840===n||11841===n||11842===n||n>=11843&&n<=11855||n>=11856&&n<=11857||11858===n||n>=11859&&n<=11903||n>=12289&&n<=12291||12296===n||12297===n||12298===n||12299===n||12300===n||12301===n||12302===n||12303===n||12304===n||12305===n||n>=12306&&n<=12307||12308===n||12309===n||12310===n||12311===n||12312===n||12313===n||12314===n||12315===n||12316===n||12317===n||n>=12318&&n<=12319||12320===n||12336===n||64830===n||64831===n||n>=65093&&n<=65094)break;r.push(i),t+=i>=65536?2:1}return $.apply(void 0,r)};var ee=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){var s=this.parseArgument(e,r);if(s.err)return s;n.push(s.val)}else if(125===i&&e>0)break;else if(35===i&&("plural"===t||"selectordinal"===t)){var l=this.clonePosition();this.bump(),n.push({type:a.pound,location:L(l,this.clonePosition())})}else if(60!==i||this.ignoreTag||47!==this.peek()){if(60===i&&!this.ignoreTag&&et(this.peek()||0)){var s=this.parseTag(e,t);if(s.err)return s;n.push(s.val)}else{var s=this.parseLiteral(e,t);if(s.err)return s;n.push(s.val)}}else{if(!r)return this.error(o.UNMATCHED_CLOSING_TAG,L(this.clonePosition(),this.clonePosition()));break}}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:a.literal,value:"<".concat(n,"/>"),location:L(r,this.clonePosition())},err:null};if(!this.bumpIf(">"))return this.error(o.INVALID_TAG,L(r,this.clonePosition()));var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var s=i.val,l=this.clonePosition();if(!this.bumpIf("</"))return this.error(o.UNCLOSED_TAG,L(r,this.clonePosition()));if(this.isEOF()||!et(this.char()))return this.error(o.INVALID_TAG,L(l,this.clonePosition()));var u=this.clonePosition();return n!==this.parseTagName()?this.error(o.UNMATCHED_CLOSING_TAG,L(u,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">"))?{val:{type:a.tag,value:n,children:s,location:L(r,this.clonePosition())},err:null}:this.error(o.INVALID_TAG,L(l,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(t);if(i){n+=i;continue}var s=this.tryParseUnquoted(e,t);if(s){n+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){n+=o;continue}break}var l=L(r,this.clonePosition());return{val:{type:a.literal,value:n,location:l},err:null}},e.prototype.tryParseLeftAngleBracket=function(){var e;return this.isEOF()||60!==this.char()||!this.ignoreTag&&(et(e=this.peek()||0)||47===e)?null:(this.bump(),"<")},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";
10case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39===this.peek())t.push(39),this.bump();else{this.bump();break}}else t.push(r);this.bump()}return $.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),$(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(o.EXPECT_ARGUMENT_CLOSING_BRACE,L(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(o.EMPTY_ARGUMENT,L(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(o.MALFORMED_ARGUMENT,L(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(o.EXPECT_ARGUMENT_CLOSING_BRACE,L(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:a.argument,value:n,location:L(r,this.clonePosition())},err:null};case 44:if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(o.EXPECT_ARGUMENT_CLOSING_BRACE,L(r,this.clonePosition()));return this.parseArgumentOptions(e,t,n,r);default:return this.error(o.MALFORMED_ARGUMENT,L(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=c(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:L(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,r,n){var i,s=this.clonePosition(),u=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(u){case"":return this.error(o.EXPECT_ARGUMENT_TYPE,L(s,c));case"number":case"date":case"time":this.bumpSpace();var d=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var m=J(p.val);if(0===m.length)return this.error(o.EXPECT_ARGUMENT_STYLE,L(this.clonePosition(),this.clonePosition()));d={style:m,styleLocation:L(f,this.clonePosition())}}var g=this.tryParseArgumentClose(n);if(g.err)return g;var y=L(n,this.clonePosition());if(d&&W(null==d?void 0:d.style,"::",0)){var v,w=Y(d.style.slice(2));if("number"===u){var p=this.parseNumberSkeletonFromString(w,d.styleLocation);if(p.err)return p;return{val:{type:a.number,value:r,location:y,style:p.val},err:null}}if(0===w.length)return this.error(o.EXPECT_DATE_TIME_SKELETON,y);var b=w;this.locale&&(b=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e.charAt(n);if("j"===i){for(var s=0;n+1<e.length&&e.charAt(n+1)===i;)s++,n++;var o=1+(1&s),a=s<2?1:3+(s>>1),l=function(e){var t,r=e.hourCycle;if(void 0===r&&e.hourCycles&&e.hourCycles.length&&(r=e.hourCycles[0]),r)switch(r){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw Error("Invalid hourCycle")}var n=e.language;return"root"!==n&&(t=e.maximize().region),(N[t||""]||N[n||""]||N["".concat(n,"-001")]||N["001"])[0]}(t);for(("H"==l||"k"==l)&&(a=0);a-- >0;)r+="a";for(;o-- >0;)r=l+r}else"J"===i?r+="H":r+=i}return r}(w,this.locale));var m={type:l.dateTime,pattern:b,location:d.styleLocation,parsedOptions:this.shouldParseSkeletons?(v={},b.replace(T,function(e){var t=e.length;switch(e[0]){case"G":v.era=4===t?"long":5===t?"narrow":"short";break;case"y":v.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":v.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw RangeError("`w/W` (week) patterns are not supported");case"d":v.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":v.weekday=4===t?"long":5===t?"narrow":"short";break;case"e":if(t<4)throw RangeError("`e..eee` (weekday) patterns are not supported");v.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");v.weekday=["short","long","narrow","short"][t-4];break;case"a":v.hour12=!0;break;case"b":case"B":throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":v.hourCycle="h12",v.hour=["numeric","2-digit"][t-1];break;case"H":v.hourCycle="h23",v.hour=["numeric","2-digit"][t-1];break;case"K":v.hourCycle="h11",v.hour=["numeric","2-digit"][t-1];break;case"k":v.hourCycle="h24",v.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":v.minute=["numeric","2-digit"][t-1];break;case"s":v.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":v.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),v):{}};return{val:{type:"date"===u?a.date:a.time,value:r,location:y,style:m},err:null}}return{val:{type:"number"===u?a.number:"date"===u?a.date:a.time,value:r,location:y,style:null!==(i=null==d?void 0:d.style)&&void 0!==i?i:null},err:null};
10case"plural":case"selectordinal":case"select":var _=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(o.EXPECT_SELECT_ARGUMENT_OPTIONS,L(_,(0,h.pi)({},_)));this.bumpSpace();var E=this.parseIdentifierIfPossible(),I=0;if("select"!==u&&"offset"===E.value){if(!this.bumpIf(":"))return this.error(o.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,L(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(o.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,o.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),E=this.parseIdentifierIfPossible(),I=p.val}var S=this.tryParsePluralOrSelectOptions(e,u,t,E);if(S.err)return S;var g=this.tryParseArgumentClose(n);if(g.err)return g;var A=L(n,this.clonePosition());if("select"===u)return{val:{type:a.select,value:r,options:K(S.val),location:A},err:null};return{val:{type:a.plural,value:r,options:K(S.val),offset:I,pluralType:"plural"===u?"cardinal":"ordinal",location:A},err:null};default:return this.error(o.INVALID_ARGUMENT_TYPE,L(s,c))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(o.EXPECT_ARGUMENT_CLOSING_BRACE,L(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(o.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,L(r,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw Error("Number skeleton cannot be empty");for(var t=e.split(S).filter(function(e){return e.length>0}),r=[],n=0;n<t.length;n++){var i=t[n].split("/");if(0===i.length)throw Error("Invalid number skeleton");for(var s=i[0],o=i.slice(1),a=0;a<o.length;a++)if(0===o[a].length)throw Error("Invalid number skeleton");r.push({stem:s,options:o})}return r}(e)}catch(e){return this.error(o.INVALID_NUMBER_SKELETON,t)}return{val:{type:l.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];switch(n.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=n.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=n.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=(0,h.pi)((0,h.pi)((0,h.pi)({},t),{notation:"scientific"}),n.options.reduce(function(e,t){return(0,h.pi)((0,h.pi)({},e),x(t)||{})},{}));continue;case"engineering":t=(0,h.pi)((0,h.pi)((0,h.pi)({},t),{notation:"engineering"}),n.options.reduce(function(e,t){return(0,h.pi)((0,h.pi)({},e),x(t)||{})},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(n.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(n.options.length>1)throw RangeError("integer-width stems only accept a single optional option");n.options[0].replace(P,function(e,r,n,i,s,o){if(r)t.minimumIntegerDigits=n.length;else if(i&&s)throw Error("We currently do not support maximum integer digits");else if(o)throw Error("We currently do not support exact integer digits");return""});continue}if(R.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(A.test(n.stem)){if(n.options.length>1)throw RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(A,function(e,r,n,i,s,o){return"*"===n?t.minimumFractionDigits=r.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:s&&o?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+o.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});var i=n.options[0];"w"===i?t=(0,h.pi)((0,h.pi)({}
10,t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=(0,h.pi)((0,h.pi)({},t),k(i)));continue}if(C.test(n.stem)){t=(0,h.pi)((0,h.pi)({},t),k(n.stem));continue}var s=x(n.stem);s&&(t=(0,h.pi)((0,h.pi)({},t),s));var o=function(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!R.test(e))throw Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}(n.stem);o&&(t=(0,h.pi)((0,h.pi)({},t),o))}return t}(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){for(var i,s=!1,a=[],l=new Set,u=n.value,c=n.location;;){if(0===u.length){var h=this.clonePosition();if("select"!==t&&this.bumpIf("=")){var d=this.tryParseDecimalInteger(o.EXPECT_PLURAL_ARGUMENT_SELECTOR,o.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=L(h,this.clonePosition()),u=this.message.slice(h.offset,this.offset())}else break}if(l.has(u))return this.error("select"===t?o.DUPLICATE_SELECT_ARGUMENT_SELECTOR:o.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===u&&(s=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?o.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:o.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,L(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,r);if(p.err)return p;var m=this.tryParseArgumentClose(f);if(m.err)return m;a.push([u,{value:p.val,location:L(f,this.clonePosition())}]),l.add(u),this.bumpSpace(),u=(i=this.parseIdentifierIfPossible()).value,c=i.location}return 0===a.length?this.error("select"===t?o.EXPECT_SELECT_ARGUMENT_SELECTOR:o.EXPECT_PLURAL_ARGUMENT_SELECTOR,L(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(o.MISSING_OTHER_CLAUSE,L(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)i=!0,s=10*s+(o-48),this.bump();else break}var a=L(n,this.clonePosition());return i?z(s*=r)?{val:s,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Q(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(W(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&er(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();function et(e){return e>=97&&e<=122||e>=65&&e<=90}function er(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function en(e,t){void 0===t&&(t={});var r=new ee(e,t=(0,h.pi)({shouldParseSkeletons:!0,requiresOtherClause:!0},t)).parse();if(r.err){var n=SyntaxError(o[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach(function(t){if(delete t.location,y(t)||v(t))for(var r in t.options)delete t.options[r].location,e(t.options[r].value);else p(t)&&_(t.style)?delete t.style.location:(m(t)||g(t))&&E(t.style)?delete t.style.location:b(t)&&e(t.children)})}(r.val),r.val}},40283:function(e,t,r){"use strict";r.d(t,{$6:function(){return d},OV:function(){return l},Qe:function(){return c},X9:function(){return h},gb:function(){return u},wI:function(){return a}});var n,i,s=r(22970);(n=i||(i={})).FORMAT_ERROR="FORMAT_ERROR",n.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",n.INVALID_CONFIG="INVALID_CONFIG",n.MISSING_DATA="MISSING_DATA",n.MISSING_TRANSLATION="MISSING_TRANSLATION";var o=function(e){function t(r,n,i){var s=this,o=i?i instanceof Error?i:Error(String(i)):void 0;return(s=e.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,"\n").concat(o?"\n".concat(o.message,"\n").concat(o.stack):""))||this).code=r,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s,t),s}return(0,s.ZT)(t,e),t}(Error),a=function(e){function t(t,r){return e.call(this,i.UNSUPPORTED_FORMATTER,t,r)||this}return(0,s.ZT)(t,e),t}(o),l=function(e){function t(t,r){return e.call(this,i.INVALID_CONFIG,t,r)||this}return(0,s.ZT)(t,e),t}(o),u=function(e){function t(t,r){return e.call(this,i.MISSING_DATA,t,r)||this}return(0,s.ZT)(t,e),t}(o),c=function(e){function t(t,r,n){var s=e.call(this,i.FORMAT_ERROR,"".concat(t,"\nLocale: ").concat(r,"\n"),n)||this;return s.locale=r,s}return(0,s.ZT)(t,e),t}(o),h=function(e){function t(t,r,n,i){var s=e.call(this,"".concat(t,"\nMessageID: ").concat(null==n?void 0:n.id,"\nDefault Message: ").concat(null==n?void 0:n.defaultMessage,"\nDescription: ").concat(null==n?void 0:n.description,"\n"),r,i)||this;return s.descriptor=n,s.locale=r,s}return(0,s.ZT)(t,e),t}(c),d=function(e){function t(t,r){var n=e.call(this,i.MISSING_TRANSLATION,'Missing message: "'.concat(t.id,'" for locale "').concat(r,'", using ').concat(t.defaultMessage?"default message (".concat("string"==typeof t.defaultMessage?t.defaultMessage:t.defaultMessage.map(function(e){var t;return null!==(t=e.value)&&void 0!==t?t:JSON.stringify(e)}).join(),")"):"id"," as fallback."))||this;return n.descriptor=t,n}return(0,s.ZT)(t,e),t}(o)},32428:function(e,t,r){"use strict";r.d(t,{L6:function(){return l},Sn:function(){return c},TB:function(){return f},Z0:function(){return u},ax:function(){return d},kG:function(){return a}});var n=r(22970),i=r(75413),s=r(77481),o=r(40283);function a(e,t,r){if(void 0===r&&(r=Error),!e)throw new r(t)}function l(e,t,r){return void 0===r&&(r={}),t.reduce(function(t,n){return n in e?t[n]=e[n]:n in r&&(t[n]=r[n]),t},{})}var u={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(e){},onWarn:function(e){}};function c(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function h(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function d(e){void 0===e&&(e=c());var t=Intl.RelativeTimeFormat,r=Intl.ListFormat,o=Intl.DisplayNames,a=(0,i.H)(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,(0,n.ev)([void 0],t,!1)))},{cache:h(e.dateTime),strategy:i.A.variadic}),l=(0,i.H)(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,(0,n.ev)([void 0],t,!1)))},{cache:h(e.number),strategy:i.A.variadic}),u=(0,i.H)(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,(0,n.ev)([void 0],t,!1)))},{cache:h(e.pluralRules),strategy:i.A.variadic});return{getDateTimeFormat:a,getNumberFormat:l,getMessageFormat:(0,i.H)(function(e,t,r,i){return new s.C(e,t,r,(0,n.pi)({formatters:{getNumberFormat:l,getDateTimeFormat:a,getPluralRules:u}},i||{}))},{cache:h(e.message),strategy:i.A.variadic}),getRelativeTimeFormat:(0,i.H)(function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new(t.bind.apply(t,(0,n.ev)([void 0],e,!1)))},{cache:h(e.relativeTime),strategy:i.A.variadic}),getPluralRules:u,getListFormat:(0,i.H)(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(r.bind.apply(r,(0,n.ev)([void 0],e,!1)))},{cache:h(e.list),strategy:i.A.variadic}),getDisplayNames:(0,i.H)(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(o.bind.apply(o,(0,n.ev)([void 0],e,!1)))},{cache:h(e.displayNames),strategy:i.A.variadic})}}function f(e,t,r,n){var i,s=e&&e[t];if(s&&(i=s[r]),i)return i;n(new o.wI("No ".concat(t," format named: ").concat(r)))}},95766:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=l(e),o=s[0],a=s[1],u=new i((o+a)*3/4-a),c=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=0,a=n-i;o<a;o+=16383)s.push(function(e,t,n){for(var i,s=[],o=t;o<n;o+=3)s.push(r[(i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,o,o+16383>a?a:o+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
10+/",o=0,a=s.length;o<a;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;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 n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48834:function(e,t,r){"use strict";var n=r(95766),i=r(62333),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(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 c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|f(e,t),n=o(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return h(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 n;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(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var i=function(e){if(a.isBuffer(e)){var t,r=0|d(e.length),n=o(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?o(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.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 u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(a.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,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!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(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i,s,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 n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=k[e[s]];return i}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=t,s=r,0===i&&s===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(i,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}
10else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var s,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===l)return c*o}else -1!==c&&(s-=s-c),c=-1}else for(r+l>a&&(r=a-l),s=r;s>=0;s--){for(var h=!0,d=0;d<l;d++)if(u(e,s+d)!==u(t,d)){h=!1;break}if(h)return s}return -1}function v(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,o,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:(192&(s=e[i+1]))==128&&(l=(31&u)<<6|63&s)>127&&(c=l);break;case 3:s=e[i+1],o=e[i+2],(192&s)==128&&(192&o)==128&&(l=(15&u)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],(192&s)==128&&(192&o)==128&&(192&a)==128&&(l=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}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 b(e,t,r,n,i,s){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function _(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function E(e,t,r,n,s){return t=+t,r>>>=0,s||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function I(e,t,r,n,s){return t=+t,r>>>=0,s||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.lW=a,t.h2=50,a.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}}(),a.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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(u(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(R(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),R(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.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,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.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}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];
vendor: 9,763 bytes, line 10
10if(R(s,Uint8Array)&&(s=a.from(s)),!a.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},a.byteLength=f,a.prototype._isBuffer=!0,a.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)m(this,t,t+1);return this},a.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)m(this,t,t+3),m(this,t+1,t+2);return this},a.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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(R(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.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===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,o=r-t,l=Math.min(s,o),u=this.slice(n,i),c=e.slice(t,r),h=0;h<l;++h)if(u[h]!==c[h]){s=u[h],o=c[h];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,s,o,a,l,u,c,h,d,f,p,m,g=this.length-t;if((void 0===r||r>g)&&(r=g),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var y=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(a!=a)break;e[r+o]=a}return o}(this,e,t,r);case"utf8":case"utf-8":return l=t,u=r,P(S(e,this.length-l),this,l,u);case"ascii":return c=t,h=r,P(A(e),this,c,h);case"latin1":case"binary":return i=this,s=e,o=t,a=r,P(A(s),i,o,a);case"base64":return d=t,f=r,P(C(e),this,d,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p=t,m=r,P(function(e,t){for(var r,n,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}(e,this.length-p),this,p,m);default:if(y)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),y=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.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 n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.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},a.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]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var s=1,o=0;for(this[t]=255&e;++o<r&&(s*=256);)this[t+o]=e/s&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var s=r-1,o=1;for(this[t+s]=255&e;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===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(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,s=e.charCodeAt(0);("utf8"===n&&s<128||"latin1"===n)&&(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(i=t;i<r;++i)this[i]=e;else{var o=a.isBuffer(e)?e:a.from(e,n),l=o.length;
10if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%l]}return this};var T=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=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 n.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 P(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function R(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var k=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},87819:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(62824);Object.keys(n).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},10475:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(99413);n.registerVersion("firebase","12.13.0","app"),Object.keys(n).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},84882:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(77661);Object.keys(n).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},52874:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(91779);Object.keys(n).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},70343:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(41749);Object.keys(n).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},73463:function(e,t,r){"use strict";var n=r(48570),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return n.isMemo(e)?o:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=o;var u=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=f(r);i&&i!==p&&e(t,i,n)}var o=c(r);h&&(o=o.concat(h(r)));for(var a=l(t),m=l(r),g=0;g<o.length;++g){var y=o[g];if(!s[y]&&!(n&&n[y])&&!(m&&m[y])&&!(a&&a[y])){var v=d(r,y);try{u(t,y,v)}catch(e){}}}}return t}},62333:function(e,t){t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+e[t+h],h+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+e[t+h],h+=d,c-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=u}return(f?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,l,u=8*s-i-1,c=(1<<u)-1,h=c>>1,d=23===i?5960464477539062e-23:0,f=n?0:s-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?t+=d/l:t+=d*Math.pow(2,1-h),t*l>=2&&(o++,l/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(t*l-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;e[r+f]=255&o,f+=p,o/=256,u-=8);e[r+f-p]|=128*m}},77481:function(e,t,r){"use strict";r.d(t,{C:function(){return l}});var n=r(22970),i=r(75413),s=r(56722),o=r(30087);function a(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}var l=function(){function e(t,r,s,l){void 0===r&&(r=e.defaultLocale);var u,c,h=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=h.formatToParts(e);if(1===t.length)return t[0].value;var r=t.reduce(function(e,t){return e.length&&t.type===o.du.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e},[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return(0,o.FK)(h.ast,h.locales,h.formatters,h.formats,e,void 0,h.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=h.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(h.locales)[0]}},this.getAst=function(){return h.ast},this.locales=r,this.resolvedLocale=e.resolveLocale(r),"string"==typeof t){if(this.message=t,!e.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var d=l||{},f=(d.formatters,(0,n._T)(d,["formatters"]));this.ast=e.__parse(t,(0,n.pi)((0,n.pi)({},f),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw TypeError("A message must be provided as a String or AST.");this.formats=(u=e.formats,s?Object.keys(u).reduce(function(e,t){var r,i;return e[t]=(r=u[t],(i=s[t])?(0,n.pi)((0,n.pi)((0,n.pi)({},r||{}),i||{}
10),Object.keys(r).reduce(function(e,t){return e[t]=(0,n.pi)((0,n.pi)({},r[t]),i[t]||{}),e},{})):r),e},(0,n.pi)({},u)):u),this.formatters=l&&l.formatters||(void 0===(c=this.formatterCache)&&(c={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:(0,i.H)(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,(0,n.ev)([void 0],t,!1)))},{cache:a(c.number),strategy:i.A.variadic}),getDateTimeFormat:(0,i.H)(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,(0,n.ev)([void 0],t,!1)))},{cache:a(c.dateTime),strategy:i.A.variadic}),getPluralRules:(0,i.H)(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,(0,n.ev)([void 0],t,!1)))},{cache:a(c.pluralRules),strategy:i.A.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return new Intl.Locale(t.length>0?t[0]:"string"==typeof e?e:e[0])}},e.__parse=s.Qc,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}()},56313:function(e,t,r){"use strict";r.d(t,{C8:function(){return a},HR:function(){return u},YR:function(){return l},jK:function(){return i},u_:function(){return o}});var n,i,s=r(22970);(n=i||(i={})).MISSING_VALUE="MISSING_VALUE",n.INVALID_VALUE="INVALID_VALUE",n.MISSING_INTL_API="MISSING_INTL_API";var o=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.code=r,i.originalMessage=n,i}return(0,s.ZT)(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),a=function(e){function t(t,r,n,s){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),i.INVALID_VALUE,s)||this}return(0,s.ZT)(t,e),t}(o),l=function(e){function t(t,r,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(r),i.INVALID_VALUE,n)||this}return(0,s.ZT)(t,e),t}(o),u=function(e){function t(t,r){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(r,'"'),i.MISSING_VALUE,r)||this}return(0,s.ZT)(t,e),t}(o)},30087:function(e,t,r){"use strict";r.d(t,{FK:function(){return function e(t,r,n,l,u,c,h){if(1===t.length&&(0,s.O4)(t[0]))return[{type:i.literal,value:t[0].value}];for(var d=[],f=0;f<t.length;f++){var p=t[f];if((0,s.O4)(p)){d.push({type:i.literal,value:p.value});continue}if((0,s.yx)(p)){"number"==typeof c&&d.push({type:i.literal,value:n.getNumberFormat(r).format(c)});continue}var m=p.value;if(!(u&&m in u))throw new o.HR(m,h);var g=u[m];if((0,s.VG)(p)){g&&"string"!=typeof g&&"number"!=typeof g||(g="string"==typeof g||"number"==typeof g?String(g):""),d.push({type:"string"==typeof g?i.literal:i.object,value:g});continue}if((0,s.rp)(p)){var y="string"==typeof p.style?l.date[p.style]:(0,s.Ii)(p.style)?p.style.parsedOptions:void 0;d.push({type:i.literal,value:n.getDateTimeFormat(r,y).format(g)});continue}if((0,s.pe)(p)){var y="string"==typeof p.style?l.time[p.style]:(0,s.Ii)(p.style)?p.style.parsedOptions:l.time.medium;d.push({type:i.literal,value:n.getDateTimeFormat(r,y).format(g)});continue}if((0,s.uf)(p)){var y="string"==typeof p.style?l.number[p.style]:(0,s.Wh)(p.style)?p.style.parsedOptions:void 0;y&&y.scale&&(g*=y.scale||1),d.push({type:i.literal,value:n.getNumberFormat(r,y).format(g)});continue}if((0,s.HI)(p)){var v=p.children,w=p.value,b=u[w];if(!a(b))throw new o.YR(w,"function",h);var _=b(e(v,r,n,l,u,c).map(function(e){return e.value}));Array.isArray(_)||(_=[_]),d.push.apply(d,_.map(function(e){return{type:"string"==typeof e?i.literal:i.object,value:e}}))}if((0,s.Wi)(p)){var E=p.options[g]||p.options.other;if(!E)throw new o.C8(p.value,g,Object.keys(p.options),h);d.push.apply(d,e(E.value,r,n,l,u));continue}if((0,s.Jo)(p)){var E=p.options["=".concat(g)];if(!E){if(!Intl.PluralRules)throw new o.u_('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',o.jK.MISSING_INTL_API,h);var I=n.getPluralRules(r,{type:p.pluralType}).select(g-(p.offset||0));E=p.options[I]||p.options.other}if(!E)throw new o.C8(p.value,g,Object.keys(p.options),h);d.push.apply(d,e(E.value,r,n,l,u,g-(p.offset||0)));continue}}return d.length<2?d:d.reduce(function(e,t){var r=e[e.length-1];return r&&r.type===i.literal&&t.type===i.literal?r.value+=t.value:e.push(t),e},[])}},Gt:function(){return a},du:function(){return i}});var n,i,s=r(56722),o=r(56313);function a(e){return"function"==typeof e}(n=i||(i={}))[n.literal=0]="literal",n[n.object=1]="object"},12041:function(e,t,r){e.exports=r(98966)},86570:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(2785)}])},23083:function(e,t,r){"use strict";r.d(t,{BO:function(){return w},Bh:function(){return a},Cw:function(){return o},Df:function(){return M},Ey:function(){return er},Fw:function(){return v},GF:function(){return u},GO:function(){return z},H6:function(){return ei},IG:function(){return g},Kx:function(){return Y},Lg:function(){return S},M9:function(){return W},Ny:function(){return T},OO:function(){return J},Ot:function(){return X},PZ:function(){return K},Ql:function(){return O},RH:function(){return P},T0:function(){return d},T3:function(){return A},TC:function(){return $},TD:function(){return I},Vy:function(){return H},Wn:function(){return eo},X4:function(){return et},Zz:function(){return m},_A:function(){return h},_e:function(){return B},_q:function(){return b},aL:function(){return k},ao:function(){return E},ap:function(){return D},c1:function(){return y},cE:function(){return x},eC:function(){return C},fe:function(){return c},fg:function(){return f},ie:function(){return es},kb:function(){return F},km:function(){return Q},lo:function(){return V},mA:function(){return j},mk:function(){return q},oH:function(){return Z},po:function(){return U},q5:function(){return N},rT:function(){return _},sH:function(){return G},sh:function(){return en},ts:function(){return l},um:function(){return L},vD:function(){return ee},z1:function(){return R},zl:function(){return p}});var n=r(21977);let{apiURL:i,appBackendApiURL:s}=r(74304).feconfig,o=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(i,"/auth/customToken?email=").concat(e),errorMessage:"generateUserCustomToken failed"}),a=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(i,"/admin/account-inquiry?email=").concat(encodeURIComponent(e.trim())),errorMessage:"accountInquiry failed"}),l=(0,n.buildGetFetch)({apiPathConcatenator:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"basic";return"".concat(s,"/auth/user?scope=").concat(e)},errorMessage:"getCurrentUser failed"}),u=(0,n.buildGetFetch)({apiPathConcatenator:()=>"".concat(s,"/auth/transactions"),errorMessage:"getUserTransactionsQuery failed"}),c=(0,n.buildGetFetch)({apiPathConcatenator:e=>{let{page:t,q:r,filter:n}=e;
10return"".concat(s,"/auth/designs?").concat(new URLSearchParams({page:(t||1).toString(),perPage:"32",filter:n||"all",q:r||"*"}))},errorMessage:"getUserDesignsRequest failed"}),h=(0,n.buildGetFetch)({apiPathConcatenator:e=>{let{teamId:t,q:r,page:n}=e,i=new URLSearchParams({teamId:t});return r&&i.set("q",r),n&&i.set("page",String(n)),"".concat(s,"/auth/team-designs?").concat(i)},errorMessage:"getTeamDesignsRequest failed"}),d=(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(i,"/classroom/handoff/exchange"),errorMessage:"exchangeClassroomHandoffRequest failed",noAuth:!0}),f=(0,n.buildPostFetch)({apiPathConcatenator:(e,t)=>"".concat(i,"/auth/classroom/teams/").concat(e,"/members/").concat(t,"/invite-link/regenerate"),errorMessage:"regenerateClassroomInviteLinkRequest failed"});(0,n.buildPatchFetch)({apiPathConcatenator:(e,t)=>"".concat(i,"/auth/classroom/teams/").concat(e,"/members/").concat(t,"/display-label"),errorMessage:"patchTeamMemberDisplayLabelRequest failed"});let p=(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(i,"/admin/classroom/teams"),errorMessage:"adminCreateClassroomTeamRequest failed"}),m=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/auth/classroom/teams/").concat(e,"/invite-links"),errorMessage:"mintClassroomInviteLinkRequest failed"}),g=(0,n.buildDeleteFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/images"),errorMessage:"deleteDesignImagesRequest failed"}),y=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/reassign"),errorMessage:"reassignDesignRequest failed"}),v=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/make-editable"),errorMessage:"makeDesignEditableRequest failed"});(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/jobs"),errorMessage:"getDesignJobsRequest failed"});let w=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/duplicate-to-sandbox"),errorMessage:"duplicateDesignToSandboxRequest failed"}),b=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/duplicate-from-sandbox"),errorMessage:"duplicateDesignFromSandboxRequest failed"}),_=(0,n.buildGetFetch)({apiPathConcatenator:(e,t)=>"".concat(s,"/designs/").concat(e).concat(t?"?scope=".concat(t):""),errorMessage:"getDesignQuery failed",noAuth:!0}),E=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(s,"/video-projects/").concat(e),errorMessage:"getVideoProjectQuery failed"});(0,n.buildGetFetch)({apiPathConcatenator:()=>"".concat(s,"/video-projects/latest"),errorMessage:"getLatestVideoProjectQuery failed"});let I=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(i,"/orders/").concat(e),errorMessage:"getOrderQuery failed"}),T=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(s,"/template/").concat(e),errorMessage:"getDesignTemplate failed"}),S=(0,n.buildGetFetch)({apiPathConcatenator:()=>"".concat(s,"/templates"),errorMessage:"getAllDesignTemplates failed"}),A=(0,n.buildGetFetch)({apiPathConcatenator:()=>"".concat(s,"/public/templates"),errorMessage:"getPublicDesignTemplates failed",noAuth:!0}),C=(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(s,"/user/templates"),errorMessage:"addTemplateRequest failed"}),P=(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(i,"/admin/templates"),errorMessage:"addPublicTemplateRequest failed"}),R=(0,n.buildPutFetch)({apiPathConcatenator:e=>"".concat(s,"/user/templates/").concat(e),errorMessage:"updateTemplateRequest failed"}),k=(0,n.buildPutFetch)({apiPathConcatenator:e=>"".concat(i,"/admin/templates/").concat(e),errorMessage:"updateTemplateAsAdminRequest failed"}),x=(0,n.buildDeleteFetch)({apiPathConcatenator:e=>"".concat(s,"/user/templates/").concat(e),errorMessage:"deleteTemplateRequest failed"}),D=(0,n.buildDeleteFetch)({apiPathConcatenator:e=>"".concat(i,"/admin/templates/").concat(e),errorMessage:"deleteTemplateAsAdminRequest failed"}),N=(0,n.buildGetFetch)({apiPathConcatenator:(e,t,r)=>{let n=function(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[r,n]=e;n&&t.set(r,n)}),t}({destination:t,customURL:r});return"".concat(i,"/designs/").concat(e,"/qrcode?").concat(n.toString())},errorMessage:"getDesignQRQuery failed"}),O=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/jobs"),errorMessage:"startDesignJobRequest failed"}),M=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/video-projects/").concat(e,"/jobs"),errorMessage:"startVideoProjectJobRequest failed"}),L=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/transcribe"),errorMessage:"startTranscriptionJobRequest failed"}),F=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/video-projects/").concat(e,"/transcribe"),errorMessage:"startVideoProjectTranscriptionRequest failed"});(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/analyze"),errorMessage:"startStemAnalysisJobRequest failed"});let V=(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(i,"/payment/stripe"),errorMessage:"beginStripeCheckoutMutation failed"}),U=(0,n.buildGetFetch)({apiPathConcatenator:function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"v11";return"".concat(i,"/designs/").concat(e,"/images/export?").concat(new 
10URLSearchParams({size:t,fileType:r,method:n}).toString())},errorMessage:"downloadDesignRequest failed"}),B=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/images/export"),errorMessage:"startExportRequest failed"}),j=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/video-projects/").concat(e,"/export"),errorMessage:"startVideoProjectExportRequest failed"}),H=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/images/export/cancel"),errorMessage:"cancelExportRequest failed"}),z=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/video-projects/").concat(e,"/export/cancel"),errorMessage:"cancelVideoProjectExportRequest failed"}),q=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/request-video-duration-extension"),errorMessage:"requestVideoDurationExtensionRequest failed"}),G=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(s,"/storage/signed-download-url?path=").concat(encodeURIComponent(e)),errorMessage:"getStorageDownloadUrlRequest failed"}),W=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(s,"/designs").concat(e?"/".concat(e):""),errorMessage:"saveDesignQuery failed"}),$=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(s,"/video-projects").concat(e?"/".concat(e):""),errorMessage:"saveVideoProjectQuery failed"}),K=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/payment/credit"),errorMessage:"validateCreditPayment failed"}),Q=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/video-projects/").concat(e,"/payment/credit"),errorMessage:"validateVideoProjectCreditPayment failed"}),Y=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/video-projects/").concat(e,"/payment/checkout"),errorMessage:"beginVideoProjectCheckoutRequest failed"}),J=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(s,"/spotify/track/").concat(e),errorMessage:"getSpotifyTrack failed"}),X=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(s,"/spotify/search?q=").concat(encodeURIComponent(e)),errorMessage:"searchSpotifySong failed"}),Z=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(s,"/spotify/waveform/").concat(e),errorMessage:"getSpotifyWaveform failed"}),ee=(0,n.buildGetFetch)({apiPathConcatenator:()=>"".concat(s,"/prices"),errorMessage:"getPrices failed"}),et=(0,n.buildPostFetch)({apiPathConcatenator:e=>"".concat(i,"/designs/").concat(e,"/move"),errorMessage:"moveDesignToFolder failed"}),er=(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(s,"/surveys/responses"),errorMessage:"postSurveyResponseRequest failed"}),en=(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(s,"/email-subscriptions"),errorMessage:"postEmailSubscriptionRequest failed",noAuth:!0}),ei=(0,n.buildGetFetch)({apiPathConcatenator:(e,t,r,n)=>{let s=new URLSearchParams;return s.set("productId",e),r?s.set("videoProjectId",r):t&&s.set("designId",t),n&&s.set("analyticsId",n),"".concat(i,"/paddle/paycode?").concat(s.toString())},errorMessage:"getPayCodeRequest failed"});(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(i,"/paddle/order-details/").concat(e),errorMessage:"getPaddleOrderDetails failed"});let es=(0,n.buildGetFetch)({apiPathConcatenator:()=>"".concat(s,"/app/version"),errorMessage:"getAppVersionQuery failed",noAuth:!0}),eo=(0,n.buildGetFetch)({apiPathConcatenator:e=>"".concat(s,"/reviews/status?orderId=").concat(encodeURIComponent(e)),errorMessage:"getReviewRequestStatus failed",noAuth:!0});(0,n.buildPostFetch)({apiPathConcatenator:()=>"".concat(s,"/reviews/submit"),errorMessage:"submitReviewRequest failed",noAuth:!0})},15644:function(e,t,r){"use strict";r.d(t,{Q:function(){return c}});var n=r(52322),i=r(2784),s=r(55048),o=r(75590),a=r(99127),l=r(12524),u=r.n(l);function c(e){let{open:t,onClose:r,children:l,className:c,fullscreen:h,dataTestId:d,disableCloseButton:f,header:p}=e,m=u()("relative bg-white text-left shadow-xl transition-all w-full",h?"flex min-h-[100dvh] max-w-none flex-col overflow-hidden !rounded-none sm:!my-0":"overflow-hidden rounded-lg sm:my-8",!p&&!h&&"px-4 pt-5 pb-4 sm:p-6",c);return(0,n.jsx)(s.u.Root,{show:t,as:i.Fragment,children:(0,n.jsxs)(o.Vq,{as:"div",className:"relative z-50",onClose:r,children:[(0,n.jsx)(s.u.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,n.jsx)("div",{className:"fixed inset-0 bg-gray-500/75 transition-opacity"})}),(0,n.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto","data-testid":d,children:(0,n.jsx)("div",{className:u()("flex min-h-full sm:p-0",{"w-full items-stretch justify-center p-0 text-left":h,"items-start justify-center p-4 text-center":!h}),children:(0,n.jsx)(s.u.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,n.jsx)(o.EM,{className:m,children:void 0!==p?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-row items-center h-12 p-4 md:px-6",children:[(0,n.jsx)("div",{className:"flex items-center w-full text-lg font-semibold",children:p}),!f&&(0,n.jsx)("button",{type:"button",className:"flex rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:r,"aria-label":"Close",children:(0,n.jsx)(a.oHP,{className:"h-6 w-6","aria-hidden":"true"})})]}),(0,n.jsx)("hr",{className:"border-gray-300"}),(0,n.jsx)("div",{className:u()("p-4 md:px-6",h&&"flex min-h-0 flex-1 flex-col overflow-hidden"),children:l})]}):(0,n.jsxs)(n.Fragment,{children:[l,!f&&(0,n.jsx)("div",{className:"absolute top-0 right-0 pt-4 pr-4 block",children:(0,n.jsxs)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:r,children:[(0,n.jsx)("span",{className:"sr-only",children:"Close"}),(0,n.jsx)(a.oHP,{className:"h-6 w-6","aria-hidden":"true"})]})})]})})})})})]})})}},4169:function(e,t,r){"use strict";r.d(t,{W:function(){return n},y:function(){return i}});let n="https://help.wavevisual.com",i={home:n,contact:"".concat(n,"/contact"),audioSources:"https://help.wavevisual.com/frequently-asked-questions/0a0230d8-c66e-444c-ac48-9764a881fc9f/what-sources-of-audio-or-music-can-i-use/420d90fe-f782-4fb6-a6ac-b0033e15053d",videoExport:"https://help.wavevisual.com/frequently-asked-questions/2c1f2648-352d-4b2a-809a-0f8edd2d821e/can-i-download-the-sound-wave-animation-as-a-video/0c388c52-9c27-4ac4-832e-dac24b037995",creditsUnlimitedAndCancel:"https://help.wavevisual.com/frequently-asked-questions/ab2d147f-5552-4ac3-a488-6f94fd34ba13/do-credits-expire-or-roll-over-at-the-end-of-the-month/fb3e368e-802a-46c9-801d-73fb2f3b44c0",whatHappensWhenYouCancelSubscription:"https://help.wavevisual.com/subscriptions/7a5a3a46-b292-41fd-a5b7-4b773d48d8da/what-happens-when-i-cancel-my-subscription/cdc0c61f-1108-4c26-af55-5df3d1281de4",cancellingSubscription:"https://help.wavevisual.com/subscriptions/7a5a3a46-b292-41fd-a5b7-4b773d48d8da/cancelling-a-subscription/7594782a-322e-4170-bba9-ac0d171f6e14",refundProcessingTime:"https://help.wavevisual.com/frequently-asked-questions/7637d0e4-df13-4b1f-adbf-29fec961922e/how-long-does-it-take-to-receive-a-refund/30ed7d11-b79d-43b1-bf31-8106ba729aad",imageFileFormats:"https://help.wavevisual.com/frequently-asked-questions/2c1f2648-352d-4b2a-809a-0f8edd2d821e/which-image-file-formats-are-supported-by-wavevisual/ab3c7de4-3abb-44ff-9627-09bc01cae6f2",exportResolution:"https://help.wavevisual.com/frequently-asked-questions/2c1f2648-352d-4b2a-809a-0f8edd2d821e/what-is-the-export-resolution/5e0245ae-a891-42bf-9770-1b76e212e79f"}},2785:function(e,t,r){"use strict";let n;r.r(t),r.d(t,{default:function(){return H}});var i=r(52322),s=r(79324),o=r.n(s),a=r(2784),l=r(12041),u=r.n(l),c=r(45847),h=r.n(c),d=r(5632),f=r(54935),p=r(7355),m=r(95658),g=r(23083);let y=e=>{let{onRefresh:t,onDismiss:r}=e;return(0,i.jsx)("div",{style:{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#fff",border:"1px solid #e2e8f0",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",padding:"16px 20px",zIndex:9999,maxWidth:"500px",width:"calc(100% - 40px)"},children:(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"16px"},children:[(0,i.jsxs)("div",{style:{flex:1},children:[(0,i.jsx)("p",{style:{margin:0,fontSize:"14px",fontWeight:600,color:"#1a202c"},children:"Update Available"}),(0,i.jsx)("p",{style:{margin:"4px 0 0 0",fontSize:"13px",color:"#4a5568"},children:"A new version is available. Please refresh to get the latest updates."})]}),(0,i.jsxs)("div",{style:{display:"flex",gap:"8px",flexShrink:0},children:[(0,i.jsx)("button",{onClick:r,style:{padding:"6px 12px",fontSize:"13px",fontWeight:500,color:"#4a5568",backgroundColor:"transparent",border:"1px solid #e2e8f0",borderRadius:"6px",cursor:"pointer",transition:"all 0.2s"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="#f7fafc"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="transparent"},children:"Later"}),(0,i.jsx)("button",{onClick:t,style:{padding:"6px 16px",fontSize:"13px",fontWeight:500,color:"#fff",backgroundColor:"#3182ce",border:"none",borderRadius:"6px",cursor:"pointer",transition:"all 0.2s"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="#2c5282"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="#3182ce"},children:"Refresh Now"})]})]})})},v=e=>{let{children:t}=e,[r,n]=(0,a.useState)(!1),s=(0,a.useRef)(null),o=(0,a.useCallback)(async()=>{try{let{refreshTimestamp:e}=await (0,g.ie)();s.current?s.current!==e&&n(!0):s.current=e}catch(e){console.error("Failed to check app version:",e)}},[]);(0,a.useEffect)(()=>{let e=setTimeout(o,6e4),t=setInterval(o,3e5);return()=>{clearTimeout(e),clearInterval(t)}},[o]);let l=(0,a.useCallback)(()=>{window.location.reload()},[]),u=(0,a.useCallback)(()=>{n(!1)},[]);return(0,i.jsxs)(i.Fragment,{children:[t,r&&(0,i.jsx)(y,{onRefresh:l,onDismiss:u})]})};var w=r(30506),b=r(56958);let _=e=>{let{...t}=e;return(0,i.jsx)(b.x7,{theme:"light",className:"group",toastOptions:{classNames:{toast:"group toast bg-white shadow-lg rounded-md border-0 px-4 py-2 !w-max !max-w-[356px]",success:"bg-green-50 text-green-800",error:"bg-red-50 text-red-800",info:"bg-sky-50 text-sky-800",description:"text-muted-foreground"},duration:3e3},...t})},E=e=>{let{children:t,headers:r,messages:n}=e,s="/my-account"===(0,d.useRouter)().pathname?f.sX.AccountPage:f.sX.Basic;return(0,i.jsx)(m.LocaleProvider,{headers:r,messages:n,children:(0,i.jsx)(v,{children:(0,i.jsx)(p.Ho,{initialScope:s,children:(0,i.jsxs)(w.x,{children:[t,(0,i.jsx)(_,{})]})})})})};var I=r(3741);r(92445);var T={en:JSON.parse('{"Home.H1":"Sound Wave Generator","Home.Title":"Generate a personalized sound wave art in seconds","Home.Subtitle":"Generate a personalized sound wave art in seconds. Upload your audio, search for your favorite song, or pick one from Spotify and let our sound wave generator create stunning sound waves.","Home.CTA":"Start Designing","Home.CTA2":"Go to Editor","Home.CTA.Noregister":"No sign-up required","Home.Paragraph":"Simply select the audio file and we\'ll convert it to a sound wave for you.","Action.Submit":"Submit","Editor.Menu.Backgroun
10d":"Background","Editor.Menu.Background.Colors":"Background Colors","Editor.Menu.Background.Image":"Background Image","Editor.Menu.Background.Transparent":"Transparent","Editor.Menu.Background.Aligning":"Align your image","Editor.Menu.Background.Zoom":"Zoom level","Editor.Menu.Background.Done":"Done","Editor.Menu.Background.Cancel":"Cancel","Editor.Menu.Source":"Audio","Editor.Menu.SoundWave":"Sound Wave","Editor.Header.Resize":"Resize","Editor.Header.ResizeDropdownHint":"Search, filter by category, then choose a preset.","Editor.PreEditSizeSelector.title":"Choose a canvas size","Editor.PreEditSizeSelector.subtitle":"Pick what you are creating so we can set the best aspect ratio. You can change this anytime from Resize.","Editor.PreEditSizeSelector.searchLabel":"Search canvas sizes","Editor.PreEditSizeSelector.searchPlaceholder":"Search (e.g. YouTube, A4, 16:9)","Editor.PreEditSizeSelector.noResults":"No sizes match your search.","Editor.PreEditSizeSelector.skip":"Skip for now","Editor.PreEditSizeSelector.subtitleShort":"Tap what you are creating. You can pick an exact size anytime from Resize.","Editor.PreEditSizeSelector.moreSizesHint":"Need a specific template? Use Resize in the toolbar.","Editor.PreEditUseCase.video":"Video","Editor.PreEditUseCase.story":"Story / Reel","Editor.PreEditUseCase.print":"Print","Editor.PreEditUseCase.social":"Social","Editor.PreEditUseCase.other":"Other","Editor.Menu.Dimensions":"Canvas Size","Editor.Menu.Dimensions.Horizontal":"Horizontal","Editor.Menu.Dimensions.Vertical":"Vertical","Editor.Menu.Dimensions.2/1":"Horizontal 2x1","Editor.Menu.Dimensions.2/3":"Vertical 2x3","Editor.Menu.Dimensions.5/4":"Horizontal 5x4","Editor.Menu.Dimensions.3/2":"Horizontal 3x2","Editor.Menu.Dimensions.3/1":"Horizontal 3x1","Editor.Menu.Dimensions.4/3":"Horizontal 4x3","Editor.Menu.Dimensions.4/5":"Vertical 4x5","Editor.Menu.Dimensions.16/9":"Widescreen 16x9","Editor.Menu.Dimensions.9/16":"Vertical 9x16 (stories)","Editor.Menu.Dimensions.11/14":"Photo 11\xd714","Editor.Menu.Dimensions.27/35":"Photo print (27\xd735)","Editor.Menu.Dimensions.1/1":"Square","Editor.Menu.Dimensions.1/2":"Vertical 1x2","Editor.Menu.Dimensions.297/210":"A4 Horizontal","Editor.Menu.Dimensions.210/297":"A4 Vertical","Editor.Menu.Dimensions.22/17":"US Letter Horizontal","Editor.Menu.Dimensions.17/22":"US Letter Vertical","Editor.Menu.Dimensions.Category.landscape":"Landscape","Editor.Menu.Dimensions.Category.square":"Square","Editor.Menu.Dimensions.Category.portrait":"Portrait","Editor.Menu.Dimensions.Category.print":"Print","Editor.Menu.Background.UploadImage":"Upload a Background Image","Editor.Menu.Colors":"Colors","Editor.Menu.Colors.Wave":"Wave Colors","Editor.Menu.Colors.Palettes":"Palettes","Editor.Menu.Colors.NewColor":"Add Color","Editor.Menu.Colors.Description":"Waveform will be divided into the number of colors you\'ve selected","Editor.Menu.Style":"Style","Editor.Menu.Style.SectionBars":"Bar appearance","Editor.Menu.Style.Thickness":"Bar thickness","Editor.Menu.Style.Space":"Space between bars","Editor.Menu.Style.Height":"Height","Editor.Menu.Style.Reset":"Reset","Editor.Animation.Spectrum":"Spectrum","Editor.Animation.SpectrumDescription":"Bars react to frequencies","Editor.Animation.Timeline":"Timeline","Editor.Animation.TimelineDescription":"Progress moves across the bars","Editor.Animation.RecorderStyle":"Recorder-style","Editor.Animation.RecorderStyleDescription":"A live envelope follows the recording","Editor.Animation.RecorderLook":"Recorder look","Editor.Animation.RecorderLookHint":"Bars stay discrete; sine draws a continuous ribbon.","Editor.Animation.RecorderLookBars":"Bars","Editor.Animation.RecorderLookSine":"Sine","Editor.Animation.StyleSection":"Animation style","Editor.Animation.PickerHint":"Choose how the waveform moves during playback.","Editor.Animation.SpectrumReactivity":"Spectrum reactivity","Editor.Animation.SpectrumReactivityHint":"Controls how quickly bars react to the music.","Editor.Animation.SpectrumReactivitySmooth":"Smooth","Editor.Animation.SpectrumReactivityReactive":"Reactive","Editor.Animation.CameraShake":"Camera shake","Editor.Animation.CameraShakeHint":"Slight zoom with viewport motion during preview and video export so edges stay filled.","Editor.Animation.CameraShakeIntensity":"Intensity (max px)","Editor.Animation.CameraShakeFrequency":"Speed","Editor.Animation.CameraShakeAudioReactive":"Audio reactive","Editor.Animation.CameraShakeAudioReactiveHint":"Shake harder on loud bass and transients.","Editor.Animation.Backgroun
10dPulse":"Background pulse","Editor.Animation.BackgroundPulseHint":"Zoom and brighten the cover on bass hits.","Editor.Animation.BackgroundPulseScale":"Extra scale","Editor.Animation.BackgroundPulseBrightness":"Brightness","Editor.Animation.BackgroundPulseAudioReactive":"Audio reactive","Editor.Animation.BackgroundPulseAudioReactiveHint":"Scale and brightness follow kick and bass, not hats.","Editor.Menu.Export":"Download","Editor.Menu.Templates":"Templates","Templates.AuthWall.Message":"Sign in to save your designs as reusable templates.","Templates.AuthWall.Tooltip":"Sign in to save templates","Editor.Menu.Layers":"Layers","Editor.Menu.Animation":"Animation","Editor.Menu.Layers.PageBackground":"Page background","Editor.Menu.Layers.Captions":"Captions","Editor.Menu.Layers.ImageLayer":"Image layer","Editor.Export.Export":"Download","Editor.Export.Continue":"Continue","Editor.Export.ContinuePay":"Continue to checkout","Editor.DigitalCheckout.SectionFormats":"Export formats","Editor.DigitalCheckout.FormatsStill":"Still images: PNG, JPG, PDF, SVG.","Editor.DigitalCheckout.FormatsMotion":"Video: MP4, GIF, WebM, MOV (1080p at 60fps).","Editor.DigitalCheckout.MaxRasterHint":"Image size at full quality","Editor.DigitalCheckout.MaxRasterSub":"Applies to PNG and JPG; PDF and SVG are vector.","Editor.DigitalCheckout.DpiTooltipAria":"How cm and inch sizes are calculated","Editor.DigitalCheckout.LabelPixels":"Pixels","Editor.DigitalCheckout.LabelCm":"Centimeters","Editor.DigitalCheckout.LabelInches":"Inches","Editor.DigitalCheckout.IncludedFormats":"Included file formats","Editor.DigitalCheckout.PngJpgResolutions":"PNG & JPG sizes for this canvas","Editor.DigitalCheckout.VectorFormats":"PDF and SVG export as vector graphics and stay sharp at any size.","Editor.DigitalCheckout.UploadPending":"Some resources are still uploading. Please wait until they are done.","Editor.DigitalCheckout.SaveFailed":"Couldn\'t save your design. Check your connection and try again.","Editor.Export.UnlockHD":"Unlock full resolution","Editor.Export.UnlockHDIncludes":"High-res PNG, and all formats + 3 days to keep editing","Editor.Export.UnlockHDIncludes.motion":"1080p MP4, and all formats + 3 days to keep editing","Editor.Export.SliderLabelFree":"Free (watermarked)","Editor.Export.SliderLabelFull":"Full quality","Editor.Export.Checkout":"Checkout","Editor.Export.CheckoutWithCredit":"Order with credit","Editor.Export.CheckoutWithCredit.Error":"Payment with credit has failed. Please contact us for help.","Editor.Source.GetStarted":"Add your audio","Editor.Source.GetStartedSubtitle":"Choose how you want to add audio to your design","Editor.Source.RecordAudio":"Record Audio","Editor.Source.DownloadAudio":"Download audio","Editor.Source.DownloadAudioFailed":"Failed to download audio.","Editor.Source.GetSpotify":"Get sound wave of a song on Spotify","Editor.Spotify.Errored":"Couldn\'t find this song on Spotify","Editor.Spotify.NotFound":"Couldn\'t find this song on Spotify","Editor.Spotify.Fetch":"Fetch the song","Editor.Spotify.InvalidURL":"Invalid Spotify link","Editor.Spotify.EmptyField":"Please enter a song link from Spotify","Editor.Spotify.Confirm":"Confirm song","Editor.Spotify.CannotPlayPreviewTooltip":"We can\'t play Spotify tracks in the editor. Open the link to listen on Spotify.","Editor.UseSampleWaveform":"Example Sound Wave","Editor.Title":"Editor","Editor.Export.Unit":"Unit","Editor.Export.PaidFormatHint":"Premium","Editor.Export.FileType":"File Format","Editor.Export.Pixel":"pixels","Editor.Export.CM":"cm","Editor.Export.Inch":"inch","Editor.Export.Success":"Thank you for using WaveVisual","Editor.Export.Preparing":"Preparing for download","Editor.Export.Processing":"Processing","Editor.Export.ThankYou":"Thanks for using WaveVisual","Editor.Export.PNG":"PNG (high quality)","Editor.Export.PNGDescription":"Best for complex images","Editor.Export.JPG":"JPG (optimized)","Editor.Export.JPGDescription":"Best for sharing","Editor.Export.MP4":"MP4 (1080p at 60fps)","Editor.Export.MP4Description":"Full HD video at 60fps","Editor.Export.GIF":"GIF (animated)","Editor.Export.GIFDescription":"Animated image for sharing","Editor.Export.WEBM":"WEBM (transparent)","Editor.Export.WEBMDescription":"Trans
10parent overlay for web / Chrome. Use MOV for CapCut.","Editor.Export.MOV":"MOV (CapCut)","Editor.Export.MOVDescription":"Transparent overlay for CapCut","Editor.Export.MOVProRes":"MOV (ProRes)","Editor.Export.MOVProResDescription":"Transparent overlay for Premiere, Final Cut & Resolve","Editor.Export.GroupImage":"Image","Editor.Export.GroupVideo":"Video","Editor.Export.SVG":"SVG (Vector)","Editor.Export.SVGDescription":"Best for scaling","Editor.Export.PDF":"PDF (Vector)","Editor.Export.PDFDescription":"Best for documents and printing","Editor.Export.Ready":"Your images are ready for download.","Editor.Export.NoVideo":"Exporting your design as a video is not available at the moment. We are developing this capability and hoping to make it available for you soon.","Editor.Export.VideoNoAudio":"MP4 export requires uploaded audio. Spotify tracks are not supported.","Editor.Export.VideoNoMedia":"Video export requires uploaded audio or video.","Editor.Export.RequestLimitExtension":"Request limit extension","Editor.Export.RequestLimitExtensionSent":"Request sent","Editor.Export.RequestLimitExtensionSuccess":"Request sent. We\'ll review it and get back to you.","Editor.Export.RequestLimitExtensionError":"Could not send your request. Please try again later.","Editor.Export.RequestLimitExtensionRateLimited":"You already requested an extension for this design recently.","Editor.Export.ErrorGeneric":"Export failed. Please try again.","Editor.Export.ErrorJobClientTimeoutVideo":"Video export timed out after {minutes} minutes. Please try again.","Editor.Export.ErrorJobClientTimeoutDefault":"Export timed out after {minutes} minutes. Please try again.","Editor.Export.ErrorSignedUrlTimeout":"Download link was not ready. Please try again.","Editor.Export.ErrorJobServerTimeout":"Export timed out on our servers. Try a shorter clip or lower resolution.","Editor.Export.ErrorJobServerFailed":"Export failed. Please try again.","Editor.Export.CancelExport":"Cancel export","Editor.Export.JobEndedCancelled":"Cancelled","Editor.Export.JobEndedFailed":"Failed","Editor.Export.JobEndedTimedOut":"Timed out","Editor.Background.Image":"Select an image","Nav.About":"About","Nav.PrivacyPolicy":"Privacy Policy","Nav.TOC":"Terms & Conditions","Nav.Pricing":"Pricing","Nav.Features":"Features","Nav.Home":"Home","Nav.Share":"Share","Nav.Imprint":"Imprint","Nav.Play":"Play","Nav.Loading":"Loading","Nav.Pause":"Pause","Nav.Stop":"Stop","Nav.FAQ":"FAQ","Nav.Blog":"Blog","About.Title":"About WaveVisual","About.ReachOut":"Want to know more about me or want to reach out to me? Go to","Editor.Tips.Draggable":"Tip: You can move or resize any item on the canvas","Editor.Text.Add":"Add a text box","Editor.Text.Remove":"Remove","Editor.Menu.Text":"Text","Editor.Menu.Text.Placeholder":"Type some text here","Editor.Menu.Text.Font":"Font Family","Editor.Menu.Text.FontSize":"Font Size","Editor.Menu.Text.Color":"Color","Editor.Menu.Text.Effects":"Effects","Editor.Menu.Text.EffectsUnavailable":"Effects are not available for this text","Editor.Menu.Text.SelectTextFirst":"Select a text element first","Editor.Menu.Text.ShadowBlur":"Blur","Editor.Menu.Text.ShadowOffsetX":"Offset X","Editor.Menu.Text.ShadowOffsetY":"Offset Y","Editor.Menu.QR.Title":"QR Code","Editor.Menu.QR.Desc":"Generate a QR code that leads to the current page","Editor.Menu.QR.YourCode":"Your QR code that leads to the current page","Editor.Menu.QR.Generate":"Generate QR code","Editor.Menu.QR.Remove":"Remove QR code from canvas","Editor.Menu.QR.Add":"Add QR code image to canvas","Editor.Menu.QR.Download":"Download QR code image","Editor.Header.Saved":"All changes saved","Editor.Header.Unsaved":"Unsaved changes","Editor.Header.Saving":"Saving changes","Editor.Header.Errored":"Save failed","Editor.Header.ErrorredDesc":"We\'ve encountered a problem while saving your design. This is likely to be an issue with your internet connection.","Editor.Header.ViewOnlySaved":"All changes saved","Editor.Header.ViewOnlySavedDesc":"This design can no longer be edited (the 3-day edit window has ended). You can still export your files.","Editor.Header.Undo":"Undo","Editor.Header.Redo":"Redo","Alert.Unpaid.Title":"Design is not paid yet","Alert.Upload.MAX_SIZE_EXCEEDED":"The file is too big. Maximum allowed file size is {maxSize}","Alert.Upload.UNSUPPORTED_FILE_FORMAT":"We do not support this file format yet. Please upload a file with one of the following extensions: WAV, AIF, AIFF, FLAC, ALAC, AAC, OGG, MP3, M4A, WEBM","Alert.Upload.UNSUPPORTED_FILE_FORMAT_WITH_VIDEO":"We do not support this file format yet. Please upload audio or a short video clip with one of the following extensions: WAV, AIF, AIFF, FLAC, ALAC, AAC, OGG, MP3, M4A, WEBM, MP4, MOV","E
10ditor.Source.UploadStatus.UploadingAudio":"Uploading audio...","Editor.Source.UploadStatus.UploadingVideo":"Uploading video...","Editor.Source.UploadStatus.ConvertingVideo":"Extracting audio from your video...","Editor.Source.UploadStatus.ConvertingVideoDescription":"Larger or high-bitrate videos can take a few minutes.","Editor.Source.UploadStatus.GeneratingWaveform":"Generating waveform from extracted audio...","Editor.Source.VideoUploadChoice.Title":"How should we use this video?","Editor.Source.VideoUploadChoice.FileLabel":"File: {fileName}","Editor.Source.VideoUploadChoice.Description":"Extract the audio for your waveform, or keep the video visible on the canvas as well.","Editor.Source.VideoUploadChoice.AudioOnly":"Audio only","Editor.Source.VideoUploadChoice.AudioAndVisuals":"Audio + video on canvas","Editor.Source.VideoUploadChoice.SilentTitle":"Add this video to the canvas?","Editor.Source.VideoUploadChoice.SilentDescription":"This clip has no audio we can extract, so it will not drive the waveform. You can still place it as a video layer.","Editor.Source.VideoUploadChoice.VisualsOnly":"Add as video layer","Editor.Source.VideoHasNoAudioVisualsOnly":"This video has no sound, so the waveform was left unchanged. The clip is on the canvas as a video layer.","Alert.Upload.CORRUPTED_FILE":"We cannot process this file. The file is probably corrupted.","Alert.Upload.Failed":"Upload failed","Export.Free":"Free","Pricing.Basic":"Basic","Pricing.Free":"Free","Pricing.Pro":"Pro","Pricing.SingleOrder":"Single Order","Pricing.Retail":"Retail","Pricing.Starter":"Starter","Pricing.Business":"Business","Pricing.Custom"
10:"Custom","Pricing.Sub.CTA":"Subscribe","Pricing.Print":"Premium Print","Pricing.Current":"Current plan","Pricing.Whitelable":"White-label","Home.Features.Sound":"Upload Your Favourite Sound","Home.Features.SoundDesc":"Select and upload your favourite songs or recordings to generate a sound wave art","Home.Features.Customize":"Customize Your Sound Wave","Home.Features.CustomizeDesc":"Use our many tools to customize your sound wave art to make something special","Home.Features.Download":"Download the Sound Wave","Home.Features.DownloadDesc":"Download your sound wave as PNG, vector or in various other formats and sizes","Footer.Legal":"Legal","Footer.Product":"Product","Footer.Blog":"WaveVisual Blog","Footer.Pricing":"Pricing","Footer.About":"About us","Cookie.Title":"This website uses cookies to ensure you get the best experience on our website. Please review our {privacyLink} to learn how we use your data.","Cookie.Accept":"Accept","Cookie.Reject":"Reject","Share.Copy":"Copy","Share.Twitter":"Share with Twitter","Share.Facebook":"Share with Facebook","Checkout.Paragraph1":"After you pay, you can download your design in different formats and resolutions. You\'ll have 3 days to keep editing and exporting it. We\'ll email you a link to your design, and it will always be accessible to you. If you have any questions, feel free to reach out to us via live chat!","Checkout.Paragraph2":"If you have any questions, feel free to reach out to us via the live chat.","Checkout.Finalising":"Finalising your payment...","Checkout.LoadingPaddle":"Loading secure checkout…","Checkout.UnknownError":"An unknown error occurred. If you were charged but still cannot download your design, please contact us.","Paddle.UnknownError":"An unknown error occurred. If you were charged, please contact us with the email address associated with your payment and we will help you immediately.","BlogPage.Empty":"Post not found","MyDesigns.Title":"Your Designs","MyDesigns.Loading":"Loading your designs","MyDesigns.BasedOn":"Based on {audioFileName}","MyDesigns.LastUpdated":"edited {updatedAt}","MyDesigns.InTrashSince":"placed in trash {inTrashSince}","MyDesigns.SignupCTA":"These are the designs we have associated with your session. Sign up to make sure you can find them again.","Error.Unexpected":"An unexpected error occurred. If this error persists, please contact us.","Error.DesignNotFound":"This design does not exist. Please verify the URL.","Error.InvalidAudioFile":"Couldn\'t process the audio file. Please try another file.","Error.VideoHasNoAudioTrack":"This video has no audio we can extract. Upload an audio file or a video that includes sound.","Error.VideoAudioExtractionFailed":"We couldn\'t extract audio from this video. Try a shorter clip, MP4 with AAC audio, or upload an audio file directly.","Error.VideoInvalidContainer":"This video file looks incomplete or corrupted. Please try uploading again or use a different file.","Error.CannotUploadImage":"File upload failed","SigninPanel.EmailAddress.Label":"Email address","SigninPanel.EmailAddress.FieldDescription":"We\'ll never share your email with anyone else","SigninPanel.EmailAddress.ErrorMessage.required":"Email is required","SigninPanel.EmailAddress.ErrorMessage.Invalid":"Email must be a valid email address","SigninPanel.EmailAddress.ErrorMessage.notfound":"Email address is not registered","SigninPanel.Password.Label":"Password","SigninPanel.Password.ErrorMessage.required":"Password is required","SigninPanel.Password.ErrorMessage.wrong":"Wrong password","SigninPanel.ForgotPassword":"Forgot password","SigninPanel.SubmitButton":"Submit","SigninPanel.RegisterInstead":"Don\'t have an account? Register instead","SigninPanel.Title":"Sign in to your account","SigninPanel.SuccessMessage":"Signed in as {email}","RegisterPanel.DisplayName.Label":"User Name","RegisterPanel.DisplayName.Placeholder":"Name that will be displayed to other users","RegisterPanel.DisplayName.FieldDescription":"We\'ll never share your email with anyone else.","RegisterPanel.DisplayName.ErrorMessage.required":"Display name is required","RegisterPanel.SubmitButton":"Register now","RegisterPanel.SigninInstead":"Already have an account? Sign in instead","RegisterPanel.Title":"Create a new account","RegisterPanel.Error.Exists":"This email address is already registered","Auth.ErrorMessage.auth/user-not-found":"Email address is not registered","Auth.ErrorMessage.auth/email-already-in-use":"Email address is already registered","Auth.ErrorMessage.auth/internal-error":"An unknown error occurred. If this error persists, please contact us.","Auth.ErrorMessage.auth/wrong-password":"Wrong password","Auth.ErrorMessage.auth/weak-password":"Password must be at least 8 characters","Auth.ErrorMessage.auth/cancelled-popup-request":"","Auth.ErrorMessage.auth/network-request-failed":"Something went wrong. Please check your internet connection and try again.","Auth.ErrorMessage.auth/password-does-not-meet-requirements":"Password must contain at least 8 characters, an upper case character, a non-alphanumeric character","Form.EmailAddress.Label":"Email address","Form.EmailAddress.ErrorMessage.required":"Email is required","Form.EmailAddress.ErrorMessage.Invalid":"Email must be a valid email address","Form.EmailAddress.ErrorMessage.undefined":"An unknown error occurred","Form.EmailAddress.ErrorMessage.auth/user-not-found":"Email address is not registered","Form.EmailAddress.ErrorMessage.internal":"An unknown error occurred","Form.EmailAddress.ErrorMessage.auth/email-already-in-use":"Email address is already in use","Form.EmailAddress.ErrorMessage.auth/requires-recent-login":"For security, sign out and sign in again, then try changing your email.","Form.EmailAddress.ErrorMessage.auth/invalid-email":"Enter a valid email address.","Form.Password.Label":"Password","Form.Password.ErrorMessage.required":"Password is required","Form.Password.ErrorMessage.minlength":"Password must be at least 8 characters","Form.Password.ErrorMessage.undefined":"An unknown error occurred","Form.PasswordAgain.Label":"Password Again","Form.PasswordAgain.ErrorMessage.required":"Please type your password again","Form.PasswordAgain.ErrorMessage.auth/incorrect":"Passwords are not the same","Form.PasswordAgain.ErrorMessage.undefined":"An unknown error occurred","Form.PasswordAgain.ErrorMessage.incorrect":"Please type your password again","ForgotPasswordPanel.SigninInstead":"Try signing in instead","ForgotPasswordPanel.SubmitButton":"Submit","ForgotPasswordPanel.Title":"Reset your password","ForgotPasswordPanel.SentEmail"
10:"An email with instructions to reset your password has been sent to you.","Auth.Register":"Register","Auth.SignIn":"Log in","Auth.SignOut":"Sign out","Auth.BoxLabel":"Your Account","Auth.AccountDetails":"Account Overview","Auth.MyDesigns":"Your Designs","Auth.MyOrders":"Your Orders","Auth.AdminPanel":"Admin","API.Payment.NoCredit":"No credit available","ContactUs":"Contact us","Nav.MyAccount":"Your Account","MyAccount.Title":"Account Details","MyAccount.Subscription.Title":"Subscription Details","MyAccount.Subscription.Upgrade":"To upgrade your subscription, please cancel your subscription and subscribe to a new plan. We will refund your previous subscription when you let us know about your upgrade.","MyAccount.EmailAddress":"Your Email Address","MyAccount.EmailUpdate.Success":"Confirmation sent to {email}. Open that message and confirm to finish updating your address.","MyAccount.NextBillingDate":"Next Billing Date","MyAccount.NextBillingAmount":"Next Billing Amount","MyAccount.Edit":"Change","MyAccount.Save":"Save","MyAccount.Cancel":"Cancel","MyAccount.ResetPassword":"Send password reset email","MyAccount.SentResetPassword":"Sent password reset email","MyAccount.UpdatePaymentMethod":"Update payment method","MyAccount.CancelSubscription":"Cancel subscription","MyAccount.ReResetPassword":"Resend password reset email","MyAccount.Transactions.Title":"Transaction History","MyAccount.Transactions.ViewDesign":"View design","MyAccount.Transactions.PaidWithPayPal":"Paid with PayPal","MyAccount.Transactions.CreditChange":"{amount} Credit","MyAccount.Transactions.Paid":"Paid {amount}","Editor.Export.ResolutionInfo":"Sizes in centimeters and inches are calculated assuming an image quality of 300 dots-per-inch (DPI).","MyAccount.account":"Account details","MyAccount.payments":"Payments","MyAccount.transactions":"Transactions"}')},S=r(18997);function A(e){window.dataLayer=window.dataLayer||[];let t="CLS"===e.name?Math.round(1e3*e.value):Math.round(e.value);window.dataLayer.push({event:"web_vitals",web_vitals_metric:e.name,web_vitals_value:t,web_vitals_rating:e.rating,web_vitals_id:e.id,web_vitals_delta:null==e.delta?void 0:Math.round(e.delta)})}var C=r(42670),P=r(21353),R=r(6993);let k=()=>{let[e,t]=(0,a.useState)(!1),r=()=>{t(!1),R.t8("cookieconsent_status","dismiss")};return((0,a.useEffect)(()=>{setTimeout(()=>{t("dismiss"!==R.U2("cookieconsent_status"))},100)},[]),(0,a.useEffect)(()=>{e||(0,S.uF)()},[e]),e)?(0,i.jsxs)("div",{className:"fixed bottom-0 z-20 flex flex-col items-start w-full px-8 py-4 text-white bg-gray-700 md:flex-row md:items-center",id:"cookie-consent",children:[(0,i.jsx)("div",{children:(0,i.jsx)(C.Z,{id:"Cookie.Title",values:{privacyLink:(0,i.jsx)("a",{className:"mx-1 text-blue-300 underline cursor-pointer hover:text-blue-100",href:"/privacy-policy",children:(0,i.jsx)(C.Z,{id:"Nav.PrivacyPolicy"})})}})}),(0,i.jsxs)("div",{className:"inline-flex mt-2 font-semibold md:ml-auto md:mt-0",children:[(0,i.jsx)(P.z,{theme:"success",size:null,onClick:r,className:"px-10 py-2 mr-4",children:(0,i.jsx)(C.Z,{id:"Cookie.Accept"})}),(0,i.jsx)(P.z,{theme:"danger",size:null,onClick:r,className:"px-10 py-2",children:(0,i.jsx)(C.Z,{id:"Cookie.Reject"})})]})]}):null};var x=r(25237),D=r.n(x),N=r(4169),O=r(99904);let M=D()(()=>Promise.all([r.e(5432),r.e(9266)]).then(r.bind(r,49266)).then(e=>e.HelpCenterWidget),{loadableGenerated:{webpack:()=>[null]},ssr:!1});function L(){return(0,i.jsx)(M,{apiUrl:N.W,onContactSupport:O.k,contactLabel:"Chat with us"})}var F=r(53093),V=r(72282);let U="wv-chunk-load-reload",B=/Loading chunk [\d]+ failed|Loading CSS chunk [\d]+ failed|Failed to fetch dynamically imported module|Importing a module script failed/i;function j(e){if(!function(e){let{name:t,message:r}=e instanceof Error?{name:e.name,message:e.message}
10:"string"==typeof e?{name:"",message:e}:{name:"",message:""};return"ChunkLoadError"===t||B.test(r)}(e))return!1;try{if("1"===window.sessionStorage.getItem(U))return!1;window.sessionStorage.setItem(U,"1")}catch(e){return!1}return window.location.reload(),!0}class H extends u(){componentDidMount(){(0,V.Ps)(),(0,S._H)(),this.uninstallChunkLoadReload=function(){let e=e=>{if(e.error&&j(e.error)||e.message&&j(e.message))return;let t=function(e){let t=function(e){if(!(e instanceof Element))return"";let t=e.tagName;return"SCRIPT"===t?e.src||e.getAttribute("src")||"":"LINK"===t&&(e.href||e.getAttribute("href"))||""}(e);return t.includes("/_next/static/")?t:null}(e.target);t&&!e.error&&j(Error("Loading chunk failed: ".concat(t)))},t=e=>{j(e.reason)};return window.addEventListener("error",e,!0),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e,!0),window.removeEventListener("unhandledrejection",t)}}(),(0,F.fq)(),n||!I.featureFlags.enableTracking||(n=!0,r.e(7641).then(r.bind(r,57641)).then(e=>{let{onCLS:t,onINP:r,onLCP:n,onFCP:i,onTTFB:s}=e;t(A),r(A),n(A),i(A),s(A)})),setTimeout(()=>{this.setState({loadDeferredScripts:!0}),(0,S.uF)()},"LandingPage"===this.props.Component.displayName?8e3:3e3)}componentDidCatch(e){j(e)}componentWillUnmount(){var e;null===(e=this.uninstallChunkLoadReload)||void 0===e||e.call(this)}render(){let{Component:e,pageProps:t,headers:r}=this.props;return(0,i.jsxs)(E,{headers:r,messages:T,children:[(0,i.jsx)("div",{className:o().variable,children:(0,i.jsx)(e,{...t})}),(0,i.jsx)(h(),{id:"gtag-init",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"window.dataLayer = window.dataLayer || [];"}}),I.featureFlags.enableTracking&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h(),{id:"gtm",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;
10j.src=\n        'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n        })(window,document,'script','dataLayer','GTM-WPPD6S9Q');"}}),(0,i.jsx)("noscript",{children:(0,i.jsx)("iframe",{src:"https://www.googletagmanager.com/ns.html?id=GTM-WPPD6S9Q",height:"0",width:"0",style:{display:"none",visibility:"hidden"}})})]}),!t.lean&&I.featureFlags.enableHelpCenterWidget&&this.state.loadDeferredScripts&&(0,i.jsx)(L,{}),!t.lean&&this.state.loadDeferredScripts&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h(),{id:"crisp-init",strategy:"lazyOnload",dangerouslySetInnerHTML:{__html:'\n                  window.$crisp=[];window.CRISP_WEBSITE_ID="353a6904-ab07-4dab-8775-fe6cf36442c1";\n                  '.concat(I.featureFlags.enableHelpCenterWidget?'window.$crisp.push(["do","chat:hide"]);window.$crisp.push(["on","chat:closed",function(){window.$crisp.push(["do","chat:hide"]);}]);':"",'\n                  (function(){var d=document,s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();\n                ')}}),(0,i.jsx)(h(),{id:"crisp-ready",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:'window.CRISP_READY_TRIGGER = function() {window.$crisp.push(["safe", true])};'}})]}),(0,i.jsx)(k,{})]})}constructor(e){super(e),this.state={loadDeferredScripts:!1}}}},7355:function(e,t,r){"use strict";r.d(t,{Ho:function(){return d},aC:function(){return f}});var n=r(52322),i=r(2784),s=r(23083);let o=(0,i.createContext)({isLoggedIn:!1,userDetails:null,status:"not-fetched",isAdmin:!1,signInWithEmailAndPassword:()=>Promise.resolve(),signInWithGoogle:()=>Promise.resolve(),signInWithCustomToken:()=>Promise.resolve(),createUserWithEmailAndPassword:()=>Promise.resolve(),signInAnonymously:()=>Promise.resolve(),sendPasswordResetEmail:()=>Promise.resolve(),updateEmailAddress:()=>Promise.resolve(),refetchUserDetails:()=>Promise.resolve(),sendEmailVerification:()=>Promise.resolve(),signOut:()=>void 0});var a=r(14067),l=r(6650),u=r(18997);let c=(0,r(43841).U)(e=>({setUserId:t=>e({userId:t})}));var h=r(54935);let d=e=>{var t;let{defaultAuthData:r,mocked:d,initialScope:f,...p}=e,m=(0,i.useRef)(!0),[g,y]=(0,i.useState)(r||{isLoggedIn:!1,userDetails:null,status:"not-fetched",isAdmin:!1});(0,i.useEffect)(()=>{d&&r&&y(r)},[d,r]),(0,i.useEffect)(()=>(m.current=!0,()=>{m.current=!1}),[]);let v=(0,i.useCallback)(async e=>{if(!m.current)return;if(!e){y({isLoggedIn:!1,userDetails:e,status:"fetched",isAdmin:!1});return}let t={credit:0,role:h.i4.user};try{t=await (0,s.ts)(f)}catch(e){(0,u.H)(e)}let r={...e,...t};y({isLoggedIn:!(null==e?void 0:e.isAnonymous),userDetails:r,status:"fetched",isAdmin:!(null==e?void 0:e.isAnonymous)&&(null==r?void 0:r.role)===h.i4.admin})},[f]),w=(0,i.useCallback)(e=>{(0,u.H)(e),m.current&&y({isLoggedIn:!1,userDetails:null,status:"fetched",isAdmin:!1})},[]);(0,i.useEffect)(()=>{let e;async function t(){e=(await (0,a.getFirebase)()).getAuth().onAuthStateChanged(v,w)}return d||t(),()=>{e&&e()}},[v,w,d]);let b=(0,i.useCallback)(async(e,t)=>{await (await (0,a.getFirebase)()).getAuth().signInWithEmailAndPassword(e,t)},[]),_=(0,i.useCallback)(async()=>{await (await (0,a.getFirebase)()).getAuth().signInWithGoogle()},[]),E=(0,i.useCallback)(async e=>{await (await (0,a.getFirebase)()).getAuth().sendPasswordResetEmail(e)},[]),I=(0,i.useCallback)(async e=>{await (await (0,a.getFirebase)()).getAuth(!0).verifyBeforeUpdateEmail(e)},[]),T=(0,i.useCallback)(async()=>{await (await (0,a.getFirebase)()).getAuth().sendEmailVerification()},[]),S=(0,i.useCallback)(async e=>{let t=await (0,s.Cw)(e);t&&(null==t?void 0:t.token)&&await (await (0,a.getFirebase)()).getAuth().signInWithCustomToken(null==t?void 0:t.token)},[]),A=(0,i.useCallback)(async(e,t)=>{if(!m.current)return;y({status:"loading",isLoggedIn:!1,userDetails:null,isAdmin:!1});let r=(await (0,a.getFirebase)()).getAuth(),n=r.EmailAuthProvider.credential(e,t);await (null==r?void 0:r.linkWithCredential(n)),v((await r.signInWithCredential(n)).user),null==r||r.sendEmailVerification({url:window.location.href})},[v]),C=(0,i.useCallback)(async()=>{try{await (0,a.singInAnon)()}catch(e){w(e)}},[w]),P=(0,i.useCallback)(async()=>{try{if((await (0,a.getFirebase)()).getAuth().signOut(),!m.current)return;
10y({userDetails:null,status:"fetched",isLoggedIn:!1,isAdmin:!1})}catch(e){w(e)}},[w]),R=(0,i.useCallback)(async function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.sX.Basic;if(m.current&&g.isLoggedIn&&g.userDetails&&(null===(t=(await (0,a.getFirebase)()).getAuth())||void 0===t||null===(e=t.currentUser)||void 0===e||e.reload(),m.current))try{let e=await (0,s.ts)(r);if(!m.current)return;y({...g,userDetails:{...g.userDetails,...e}})}catch(e){(0,u.H)(e)}},[g]),k=(0,i.useMemo)(()=>"fetched"===g.status,[g.status]),x=(0,i.useMemo)(()=>({...g,signInWithEmailAndPassword:b,createUserWithEmailAndPassword:A,signInAnonymously:C,signOut:P,sendPasswordResetEmail:E,refetchUserDetails:R,updateEmailAddress:I,sendEmailVerification:T,signInWithCustomToken:S,isFetched:k,signInWithGoogle:_}),[g,A,C,b,P,E,R,I,T,S,k,_]);return(0,i.useEffect)(()=>{g.userDetails||!k||(0,l.f$)()||C()},[g.userDetails,k,C]),(0,i.useEffect)(()=>{(0,u.eG)(()=>({userId:c.getState().userId}))},[]),(0,i.useEffect)(()=>{var e,t;k&&(function(e){let t=sessionStorage.getItem("lastAuthUserId");if(t&&t!==e){let e=[];for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);(null==r?void 0:r.startsWith("pay-code-"))&&e.push(r)}e.forEach(e=>localStorage.removeItem(e))}e?sessionStorage.setItem("lastAuthUserId",e):sessionStorage.removeItem("lastAuthUserId")}(null===(e=g.userDetails)||void 0===e?void 0:e.uid),c.getState().setUserId(null===(t=g.userDetails)||void 0===t?void 0:t.uid))},[null===(t=g.userDetails)||void 0===t?void 0:t.uid,k]),(0,n.jsx)(o.Provider,{value:x,...p,children:p.children})},f=()=>{let e=i.useContext(o);if(!e)throw Error("useAuth must be used within an AuthProvider");return e}},30506:function(e,t,r){"use strict";r.d(t,{x:function(){return d},G:function(){return n.G}});var n=r(44041),i=r(52322),s=r(2784),o=r(99127),a=r(19994),l=r(75590),u=r(12524),c=r.n(u),h=r(15644);let d=e=>{let{children:t}=e,r=(0,n.G)(e=>e.currentMessage),u=(0,n.G)(e=>e.clearMessage),[d,f]=(0,s.useState)(!1),[p,m]=(0,s.useState)(null),g=(0,s.useRef)(null),y=(0,s.useRef)(!1),v=(0,s.useCallback)(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]),w=(0,s.useCallback)(()=>{v(),y.current=!1,u(),m(null)},[v,u]),b=(0,s.useCallback)(()=>{v(),f(!1),g.current=setTimeout(w,200)},[v,w]);(0,s.useEffect)(()=>{if(r){y.current=!0,v(),m(r),f(!0);return}y.current&&(v(),f(!1),g.current=setTimeout(()=>{g.current=null,y.current=!1,m(null)},200))},[r,v]),(0,s.useEffect)(()=>()=>v(),[v]);let _=(null==p?void 0:p.theme)==="error";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Q,{open:d,onClose:b,className:"w-full max-w-md",disableCloseButton:!0,children:(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("span",{className:c()("mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-full",_?"bg-red-50 text-red-500":"bg-sky-50 text-sky-600"),children:_?(0,i.jsx)(a.I2T,{className:"h-6 w-6","aria-hidden":!0}):(0,i.jsx)(o.kA6,{className:"h-6 w-6","aria-hidden":!0})}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("div",{className:"flex items-start gap-2",children:[(0,i.jsx)(l.Vq.Title,{className:"min-w-0 flex-1 text-sm font-medium leading-5 text-gray-900",children:null==p?void 0:p.title}),(0,i.jsxs)("button",{type:"button",className:"-mr-1 -mt-0.5 shrink-0 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:b,children:[(0,i.jsx)("span",{className:"sr-only",children:"Close"}),(0,i.jsx)(o.oHP,{className:"h-4 w-4","aria-hidden":!0})]})]}),(null==p?void 0:p.content)?(0,i.jsx)("div",{className:"mt-2 text-sm leading-5 text-gray-600",children:p.content}):null]})]})}),t]})}},44041:function(e,t,r){"use strict";r.d(t,{G:function(){return s}});var n=r(43841);let i=null,s=(0,n.U)(e=>({currentMessage:null,info:(t,r,n)=>{i&&(clearTimeout(i),i=null),e({currentMessage:{theme:"info",title:t,content:r}}),n&&(i=setTimeout(()=>{e({currentMessage:null}),i=null},n))},error:(t,r,n)=>{i&&(clearTimeout(i),i=null),e({currentMessage:{theme:"error",title:t,content:r}}),n&&(i=setTimeout(()=>{e({currentMessage:null}),i=null},n))},clearMessage:()=>
10{i&&(clearTimeout(i),i=null),e({currentMessage:null})}}))},18997:function(e,t,r){"use strict";r.d(t,{ee:function(){return I},yo:function(){return w},sO:function(){return v},uF:function(){return b},H:function(){return s.logError},Kz:function(){return _},_H:function(){return A},eG:function(){return l}});var n=r(74304),i=r(14067),s=r(62995),o=r(19615);let a=()=>({});function l(e){a=e}let{isDEV:u}=n.feconfig,c=null,h=null,d=[];async function f(){return c=(await r.e(638).then(r.bind(r,16418))).default,u?c.capture=g:(function(){if("undefined"==typeof document)return;let e="wavevisual.com",{hostname:t}=window.location;document.cookie.split(";").map(e=>e.trim().split("=")[0]).filter(Boolean).filter(e=>e.startsWith("_ga")||e.startsWith("_gcl")||e.startsWith("ph_")).forEach(r=>{m(r),m(r,t),m(r,".".concat(t)),m(r,e),m(r,".".concat(e))})}(),c.init("phc_sl0WUbs8X0BoXRGfl7bXYbUeouUDq9B9MLC77rdlKUF",{api_host:"https://eu.posthog.com",persistence:"localStorage",cross_subdomain_cookie:!1,before_send:y,autocapture:{dom_event_allowlist:["click"],element_allowlist:["a","button"]}})),!function(e){for(;d.length>0;){let{eventName:t,params:r}=d.shift();e.capture(t,r)}}(c),c}function p(){return c?Promise.resolve(c):(h||(h=f().catch(e=>{throw h=null,e})),h)}function m(e,t){let r=["".concat(e,"="),"Path=/","Expires=Thu, 01 Jan 1970 00:00:00 GMT","SameSite=Lax"];t&&r.push("Domain=".concat(t)),document.cookie=r.join("; ")}function g(e,t){console.info("posthog:track",e,t)}let y=e=>{var t;if(!e||"$exception"!==e.event)return e;if(function(e){if(!e)return!1;let t=e.$exception_type;if("AbortError"===t||"DOMException"===t){let t=e.$exception_message;if("string"==typeof t&&/abort/i.test(t))return!0}let r=e.$exception_values;if(Array.isArray(r)&&r.some(e=>"string"==typeof e&&/^AbortError\b/i.test(e)))return!0;let n=e.$exception_list;return!!Array.isArray(n)&&n.some(e=>{if(!e||"object"!=typeof e)return!1;let{type:t,value:r}=e;return!!("string"==typeof r&&/^AbortError\b/i.test(r))||"AbortError"===t})}(e.properties))return null;let{pathname:r,hostname:n,search:i}=window.location,s=null!==(t=new URLSearchParams(i).get("id"))&&void 0!==t?t:"",{userId:o}=a();return{...e,properties:{...e.properties,wv_exception_pathname:r,wv_exception_host:n,...s?{wv_exception_design_id:s}:{},...o?{wv_exception_user_id:o}:{}}}};async function v(){return p()}function w(){try{return(null==c?void 0:c.get_distinct_id())||void 0}catch(e){return}}async function b(){return Promise.all([(await (0,i.getFirebase)()).getAnalytics(),v()])}let _=async function(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let[i,s]=r,{userId:o}=a(),l={...s,...o?{user_id:o}:{}};if(null===(e=window.dataLayer)||void 0===e||e.push({event:i,page_location:window.location.href,page_title:document.title,...l}),u&&console.info("DEV:logEvent",i,l),c){c.capture(i,l);return}d.push({eventName:i,params:l}),p().catch(()=>void 0)};function E(e,t){v().then(r=>{if(u){console.info("DEV:capturePosthogException",e.message,t);return}r.capture("$exception",{$exception_message:e.message,$exception_type:e.name,$exception_stack_trace_raw:e.stack,$exception_handled:!0,...t})}).catch(()=>void 0)}function I(e,t){let r=e instanceof Error?e:"string"==typeof e?Error(e):Error("Non-Error value captured in capturePosthogException");console.error(r,t),E(r,t)}let T=new Map;function S(e){var t;let r=null!==(t=T.get(e))&&void 0!==t?t:0;return T.set(e,r+1),r<5}function A(){(0,o.setErrorReporters)({error:(e,t)=>{S("error:".concat(e.message))&&E(e,function(e){let t={wv_exception_source:"logError"};return Object.entries({...null==e?void 0:e.tags,...null==e?void 0:e.extra}).forEach(e=>{let[r,n]=e;t[r]=function(e){if(null===e||["string","number","boolean"].includes(typeof e))return e;try{var t;return null===(t=JSON.stringify(e))||void 0===t?void 0:t.slice(0,500)}catch(t){return String(e)}}(n)}),(null==e?void 0:e.level)&&(t.wv_exception_level=e.level),t}(t))},apiFailure:e=>{S("api:".concat(e.request,":").concat(e.status))&&_("api_request_failed",e).catch(()=>void 0)}})}},6650:function(e,t,r){"use strict";r.d(t,{DJ:function(){return o},f$:function(){return a},nR:function(){return l}});var n=r(23083),i=r(14067);let s=new Map;async function o(e){let t="wv-classroom-handoff:".concat(e),r=function(e){try{var t;return null!==(t=sessionStorage.getItem(e))&&void 0!==t?t:void 0}catch(e){return}}(t);if(!r){let i=s.get(e);i||(i=(0,n.T0)({code:e}).then(e=>{let{customToken:r}=e;return function(e,t){try{sessionStorage.setItem(e,t)}catch(e){}}(t,r),r}),s.set(e,i),i.finally(()=>{s.delete(e)})),r=await i}let o=(await (0,i.getFirebase)()).getAuth();await o.signInWithCustomToken(r),function(e){try{sessionStorage.removeItem(e)}catch(e){}}(t)}function a(){return"/classroom/handoff"===window.location.pathname}function l(e){let t=e.query.code;if("string"==typeof t&&t.length>0)return t;if(Array.isArray(t)&&"string"==typeof t[0]&&t[0].length>0)return t[0];{let e=new URLSearchParams(window.location.search).get("code");if(e)return e}return null}},53093:function(e,t,r){"use strict";r.d(t,{a3:function(){return d},fq:function(){return c},ki:function(){return h},o2:function(){return f}});var n=r(3741);let i=null,s=null,o=null,a=null,l=null;function u(){let e=n.featureFlags.debugSDK?s?Promise.resolve(s):(i||(i=Prom
10ise.all([r.e(4280),r.e(6930),r.e(3903)]).then(r.bind(r,93779)).then(e=>(s=e,e.initDebugSDK(),o&&e.setEditorContextRef(o),a&&e.setCanvasContextRef(a),l&&e.setResourceContextRef(l),e))),i):null;e&&e.catch(()=>{})}function c(){u()}function h(e){if(n.featureFlags.debugSDK){if(o=e,s){s.setEditorContextRef(e);return}u()}}function d(e){if(n.featureFlags.debugSDK){if(a=e,s){s.setCanvasContextRef(e);return}u()}}function f(e){if(n.featureFlags.debugSDK){if(l=e,s){s.setResourceContextRef(e);return}u()}}},99904:function(e,t,r){"use strict";r.d(t,{k:function(){return i}});var n=r(3741);function i(){var e,t;n.featureFlags.enableHelpCenterWidget&&(null===(t=window.$crisp)||void 0===t||t.push(["do","chat:show"])),null===(e=window.$crisp)||void 0===e||e.push(["do","chat:open"])}},72282:function(e,t,r){"use strict";r.d(t,{Ps:function(){return i},Uy:function(){return s}});let n="wavevisual:sessionLandingPath";function i(){try{if(window.sessionStorage.getItem(n))return;let{pathname:e}=window.location,t=e.length>1?e.replace(/\/+$/,""):e;window.sessionStorage.setItem(n,t)}catch(e){}}function s(){try{var e;return null!==(e=window.sessionStorage.getItem(n))&&void 0!==e?e:void 0}catch(e){return}}},72392:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return a},noSSR:function(){return o}});let n=r(43219);r(52322),r(2784);let i=n._(r(23711));function s(e){return{default:(null==e?void 0:e.default)||e}}function o(e,t){return delete t.webpack,delete t.modules,e(t)}function a(e,t){let r=i.default,n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let a=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r({...n,loader:()=>null!=a?a().then(s):Promise.resolve(s(()=>null))}):(delete n.webpack,delete n.modules,o(r,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},79195:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=r(43219)._(r(2784)).default.createContext(null)},23711:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return d}});let n=r(43219)._(r(2784)),i=r(79195),s=[],o=[],a=!1;function l(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class u{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),s=null;function l(){if(!s){let t=new u(e,r);s={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return s.promise()}if(!a){let e=r.webpack?r.webpack():r.modules;e&&o.push(t=>{for(let r of e)if(t.includes(r))return l()})}function c(e,t){!function(){l();let e=n.default.useContext(i.LoadableContext);
10e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let o=n.default.useSyncExternalStore(s.subscribe,s.getCurrentValue,s.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:s.retry}),[]),n.default.useMemo(()=>{var t;return o.loading||o.error?n.default.createElement(r.loading,{isLoading:o.loading,pastDelay:o.pastDelay,timedOut:o.timedOut,error:o.error,retry:s.retry}):o.loaded?n.default.createElement((t=o.loaded)&&t.default?t.default:t,e):null},[e,o])}return c.preload=()=>l(),c.displayName="LoadableComponent",n.default.forwardRef(c)}(l,e)}function h(e,t){let r=[];for(;e.length;){let n=e.pop();r.push(n(t))}return Promise.all(r).then(()=>{if(e.length)return h(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{h(s).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(a=!0,t());h(o,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let d=c},21977:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiRequestError=void 0,t.buildGetFetch=function(e){let{apiPathConcatenator:t,errorMessage:r,noAuth:n}=e;return async function(){let e,i;for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];let h={...n?{}:await o(),"Content-Type":"application/json"};try{({status:e,body:i}=await l(t(...u),{headers:h},r))}catch(e){throw Error("".concat(r," - fetch failed - params:").concat(u.toString()))}if(!a(e))throw Error("".concat(r," - status: ").concat(e," - params:").concat(u.toString()));return i.data}},t.buildPostFetch=function(e){let{apiPathConcatenator:t,errorMessage:r,noAuth:n,rawResponse:i}=e;return async function(e){for(var u=arguments.length,c=Array(u>1?u-1:0),h=1;h<u;h++)c[h-1]=arguments[h];let d={...n?{}:await o(),"Content-Type":"application/json"},{status:f,body:p}=await l(t(...c),{headers:d,method:"POST",body:JSON.stringify(e)},r);if(!a(f)){let e=null==p?void 0:p.message;throw new s("".concat(r," - status: ").concat(f," - params:").concat(c.toString()),f,"string"==typeof e?e:void 0)}return i?p:p.data}},t.buildDeleteFetch=function(e){let{apiPathConcatenator:t,errorMessage:r,noAuth:n}=e;return async function(){for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];let u={...n?{}:await o(),"Content-Type":"application/json"},{status:c,body:h}=await l(t(...i),{headers:u,method:"DELETE"},r);if(!a(c))throw Error("".concat(r," - ").concat(i.toString()));return h.data}},t.buildPutFetch=function(e){let{apiPathConcatenator:t,errorMessage:r,noAuth:n}=e;return async function(e){for(var i=arguments.length,s=Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];let c={...n?{}:await o(),"Content-Type":"application/json"},{status:h,body:d}=await l(t(...s),{headers:c,method:"PUT",body:JSON.stringify(e)},r);if(!a(h))throw Error("".concat(r," - ").concat(s.toString()));return d.data}},t.buildPatchFetch=function(e){let{apiPathConcatenator:t,errorMessage:r,noAuth:n}=e;return async function(e){for(var i=arguments.length,s=Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];let c={...n?{}:await o(),"Content-Type":"application/json"},{status:h,body:d}=await l(t(...s),{headers:c,method:"PATCH",body:JSON.stringify(e)},r);if(!a(h))throw Error("".concat(r," - ").concat(s.toString()));return d.data}};let n=r(19615),i=r(14067);class s extends Error{constructor(e,t,r){super(e),this.name="ApiRequestError",this.httpStatus=t,this.serverMessage=r}}async function o(){let e=await (0,i.getIdToken)();if(!e)throw Error("No id token");return{authorization:"Bearer ".concat(e)}}t.ApiRequestError=s;let a=e=>200===e||204===e;async function l(e,t,r){let i;let s=i=>{var s;return(0,n.reportApiFailure)({request:(0,n.requestNameFromErrorMessage)(r),method:null!==(s=t.method)&&void 0!==s?s:"GET",...(0,n.describeRequestUrl)(e),status:i})};try{i=await fetch(e,t)}catch(e){throw s("network_error"),e}let o=a(i.status);if(o||s(i.status),204===i.status)return{status:204,body:{data:void 0}};try{return{status:i.status,body:await i.json()}}catch(e){if(o)throw s("invalid_json"),e;return{status:i.status,body:null}}}},74304:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.feconfig=void 0,t.feconfig=(()=>{try{return JSON.parse('{"apiURL":"https://wavevisual.com/api/v1","appBackendApiURL":"https://api.wavevisual.com/api/v1","siteURL":"https://wavevisual.com","dynamicImagesURL":"https://functions.wavevisual.com","videoRendererURL":"https://video-renderer.wavevisual.com","transcriptionServiceURL":"https://transcription.wavevisual.com","stemAnalysisServiceURL":"https://stem-analysis.wavevisual.com","firebaseConfig":{"apiKey":"AIzaSyA1ouBucaXa6fOQVCyvk8FPWj3epy9f1Ok","authDomain":"wavevisual.com","projectId":"wavevisual-36d2f","storageBucket":"wavevisual-36d2f.appspot.com","messagingSenderId":"1036153105053","a
10ppId":"1:1036153105053:web:bfd8ac576fa73e1860c274","measurementId":"G-QF78MWKGGR"},"resolveLinkURL":"https://wavevisual.com/l","OZI_ENV":"production","isDEV":false,"emulate":false,"paddle":{"vendorId":123004,"digitalDownloadProductId":650914,"starterPlanId":658109,"businessPlanId":662371,"proPlanId":726618,"unlimitedPlanId":915794,"starterAnnualPlanId":714301,"businessAnnualPlanId":714293,"proAnnualPlanId":726947,"unlimitedAnnualPlanId":915795,"creditPack100ProductId":801765,"creditPack250ProductId":801763,"creditPack1000ProductId":801764,"classroomDesignReviewExportProductId":924992},"frontendVersion":"1.0.12","releaseVersion":"0.0.493"}')}catch(e){return console.error("Error parsing feconfig",e),{}}})()},21353:function(e,t,r){"use strict";r.d(t,{z:function(){return c}});var n=r(52322),i=r(2784),s=r(12524),o=r.n(s),a=r(72818),l=r(48950);function u(e){return(0,l.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"},child:[]}]})(e)}class c extends i.Component{render(){let{children:e,theme:t,className:r,type:i,block:s,size:l,justify:c,layout:h="horizontal",rounded:d,loading:f,href:p,active:m,...g}=this.props,y="stacked"===h,{disabled:v}=g;return(f&&(v=!0),("link"===t||"blue-link"===t)&&p)?(0,n.jsx)("a",{className:o()(r,"link-button",{"flex w-full":s,"inline-flex":!s,"normal-button":void 0===l||"normal"===l,"large-button":"large"===l,"small-button":"small"===l,"xlarge-button":"xlarge"===l,"long-button":"long"===l,"justify-center":!c||"center"===c,"justify-start":"start"===c,"justify-end":"end"===c,"rounded-full":d}),...(0,a.CE)(g,"disabled","icon","iconSize","onClick"),href:p,onClick:v?void 0:g.onClick,children:(0,n.jsxs)(n.Fragment,{children:[g.icon&&!f&&(0,n.jsx)(g.icon,{fontSize:g.iconSize||18,className:"mr-2"}),e]})}):(0,n.jsx)("button",{type:i||"button",className:o()(r,{"flex w-full":s,"inline-flex":!s,"flex-col":y,"normal-button":void 0===l||"normal"===l,"large-button":"large"===l,"small-button":"small"===l,"xlarge-button":"xlarge"===l,"long-button":"long"===l,"justify-center":!c||"center"===c,"justify-start":"start"===c,"justify-end":"end"===c,"light-button":"light"===t,"secondary-light-button":"secondary-light"===t,"monochrome-light-button":"monochrome-light"===t,"monochrome-dark-button":"monochrome-dark"===t,"blue-button":"blue"===t,"primary-button":"primary"===t,"info-button":"info"===t,"danger-button":"danger"===t,"success-button":"success"===t,"primary-inverse-button":"primary-inverse"===t,"link-button":"link"===t,"blue-link-button":"blue-link"===t,"rounded-full":d,active:m}),...(0,a.CE)(g,"disabled","icon","iconSize","onClick"),onClick:v?void 0:g.onClick,disabled:v||m,children:(0,n.jsx)(n.Fragment,{children:y&&(g.icon||f)?(0,n.jsxs)("span",{className:"flex flex-col items-center justify-center",children:[e,f?(0,n.jsx)(u,{className:"animate-spin mt-2",fontSize:g.iconSize||24}):g.icon&&(0,n.jsx)(g.icon,{fontSize:g.iconSize||24,className:"mt-2"})]}):(0,n.jsxs)(n.Fragment,{children:[f&&(0,n.jsx)(u,{className:"animate-spin mr-2",fontSize:18}),g.icon&&!f&&(0,n.jsx)(g.icon,{fontSize:g.iconSize||18,className:"mr-2"}),e]})})})}}},69594:function(e,t,r){"use strict";r.r(t),r.d(t,{LocaleProvider:function(){return G}});var n=r(52322),i=r(2784),s=r(22970),o=r(32428),a=r(87576),l=r(56722),u=r(77481),c=r(40283);function h(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=(0,s.pi)({timeZone:t},e[n]),r},{})}function d(e,t){return Object.keys((0,s.pi)((0,s.pi)({},e),t)).reduce(function(r,n){return r[n]=(0,s.pi)((0,s.pi)({},e[n]||{}),t[n]||{}),r},{})}function f(e,t){if(!t)return e;var r=u.C.formats;return(0,s.pi)((0,s.pi)((0,s.pi)({},r),e),{date:d(h(r.date,t),h(e.date||{},t)),time:d(h(r.time,t),h(e.time||{},t))})}var p=function(e,t,r,n,i){var a=e.locale,u=e.formats,h=e.messages,d=e.defaultLocale,p=e.defaultFormats,m=e.fallbackOnEmptyString,g=e.onError,y=e.timeZone,v=e.defaultRichTextElements;void 0===r&&(r={id:""});var w=r.id,b=r.defaultMessage;(0,o.kG)(!!w,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.github.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.github.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.github.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var _=String(w),E=h&&Object.prototype.hasOwnProperty.call(h,_)&&h[_];if(Array.isArray(E)&&1===E.length&&E[0].type===l.wD.literal)return E[0].value;if(!n&&E&&"string"==typeof E&&!v)return E.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=(0,s.pi)((0,s.pi)({},v),n||{}),u=f(u,y),p=f(p,y),!E){if(!1===m&&""===E)return E;if((!b||a&&a.toLowerCase()!==d.toLowerCase())&&g(new c.$6(r,a)),b)try{var I=t.getMe
10ssageFormat(b,d,p,i);return I.format(n)}catch(e){return g(new c.X9('Error formatting default message for: "'.concat(_,'", rendering default message verbatim'),a,r,e)),"string"==typeof b?b:_}return _}try{var I=t.getMessageFormat(E,a,u,(0,s.pi)({formatters:t},i||{}));return I.format(n)}catch(e){g(new c.X9('Error formatting message: "'.concat(_,'", using ').concat(b?"default message":"id"," as fallback."),a,r,e))}if(b)try{var I=t.getMessageFormat(b,d,p,i);return I.format(n)}catch(e){g(new c.X9('Error formatting the default message for: "'.concat(_,'", rendering message verbatim'),a,r,e))}return"string"==typeof E?E:"string"==typeof b?b:_},m=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function g(e,t,r,n){var i=e.locale,a=e.formats,l=e.onError,u=e.timeZone;void 0===n&&(n={});var c=n.format,h=(0,s.pi)((0,s.pi)({},u&&{timeZone:u}),c&&(0,o.TB)(a,t,c,l)),d=(0,o.L6)(n,m,h);return"time"!==t||d.hour||d.minute||d.second||d.timeStyle||d.dateStyle||(d=(0,s.pi)((0,s.pi)({},d),{hour:"numeric",minute:"numeric"})),r(i,d)}function y(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],o="string"==typeof i?new Date(i||0):i;try{return g(e,"date",t,void 0===s?{}
10:s).format(o)}catch(t){e.onError(new c.Qe("Error formatting date.",e.locale,t))}return String(o)}function v(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],o="string"==typeof i?new Date(i||0):i;try{return g(e,"time",t,void 0===s?{}:s).format(o)}catch(t){e.onError(new c.Qe("Error formatting time.",e.locale,t))}return String(o)}function w(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],o=r[2],a="string"==typeof i?new Date(i||0):i,l="string"==typeof s?new Date(s||0):s;try{return g(e,"dateTimeRange",t,void 0===o?{}:o).formatRange(a,l)}catch(t){e.onError(new c.Qe("Error formatting date time range.",e.locale,t))}return String(a)}function b(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],o="string"==typeof i?new Date(i||0):i;try{return g(e,"date",t,void 0===s?{}:s).formatToParts(o)}catch(t){e.onError(new c.Qe("Error formatting date.",e.locale,t))}return[]}function _(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],o="string"==typeof i?new Date(i||0):i;try{return g(e,"time",t,void 0===s?{}:s).formatToParts(o)}catch(t){e.onError(new c.Qe("Error formatting time.",e.locale,t))}return[]}var E=r(56313),I=["style","type","fallback","languageDisplay"];function T(e,t,r,n){var i=e.locale,s=e.onError;Intl.DisplayNames||s(new E.u_('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n',E.jK.MISSING_INTL_API));var a=(0,o.L6)(n,I);try{return t(i,a).of(r)}catch(e){s(new c.Qe("Error formatting display name.",i,e))}}var S=["type","style"],A=Date.now();function C(e,t,r,n){void 0===n&&(n={});var i=P(e,t,r,n).reduce(function(e,t){var r=t.value;return"string"!=typeof r?e.push(r):"string"==typeof e[e.length-1]?e[e.length-1]+=r:e.push(r),e},[]);return 1===i.length?i[0]:0===i.length?"":i}function P(e,t,r,n){var i=e.locale,a=e.onError;void 0===n&&(n={}),Intl.ListFormat||a(new E.u_('Intl.ListFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-listformat"\n',E.jK.MISSING_INTL_API));var l=(0,o.L6)(n,S);try{var u={},h=r.map(function(e,t){if("object"==typeof e){var r="".concat(A,"_").concat(t,"_").concat(A);return u[r]=e,r}return String(e)});return t(i,l).formatToParts(h).map(function(e){return"literal"===e.type?e:(0,s.pi)((0,s.pi)({},e),{value:u[e.value]||e.value})})}catch(e){a(new c.Qe("Error formatting list.",i,e))}return r}var R=["style","currency","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem","trailingZeroDisplay","roundingPriority","roundingIncrement","roundingMode"];function k(e,t,r){var n=e.locale,i=e.formats,s=e.onError;void 0===r&&(r={});var a=r.format,l=a&&(0,o.TB)(i,"number",a,s)||{};return t(n,(0,o.L6)(r,R,l))}function x(e,t,r,n){void 0===n&&(n={});try{return k(e,t,n).format(r)}catch(t){e.onError(new c.Qe("Error formatting number.",e.locale,t))}return String(r)}function D(e,t,r,n){void 0===n&&(n={});try{return k(e,t,n).formatToParts(r)}catch(t){e.onError(new c.Qe("Error formatting number.",e.locale,t))}return[]}var N=["type"];function O(e,t,r,n){var i=e.locale,s=e.onError;void 0===n&&(n={}),Intl.PluralRules||s(new E.u_('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',E.jK.MISSING_INTL_API));var a=(0,o.L6)(n,N);try{return t(i,a).select(r)}catch(e){s(new c.Qe("Error formatting plural.",i,e))}return"other"}var M=["numeric","style"];function L(e,t,r,n,i){void 0===i&&(i={}),n||(n="second"),Intl.RelativeTimeFormat||e.onError(new E.u_('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n',E.jK.MISSING_INTL_API));try{var s,a,l,u,h,d;return(s=i,a=e.locale,l=e.formats,u=e.onError,void 0===s&&(s={}),d=!!(h=s.format)&&(0,o.TB)(l,"relative",h,u)||{},t(a,(0,o.L6)(s,M,d))).format(r,n)}catch(t){e.onError(new c.Qe("Error formatting relative time.",e.locale,t))}return String(r)}var F=r(30087);function V(e){return e?Object.keys(e).reduce(function(t,r){var n=e[r];return t[r]=(0,F.Gt)(n)?(0,a.dt)(n):n,t},{}):e}var U=function(e,t,r,n){for(var o=[],a=4;a<arguments.length;a++)o[a-4]=arguments[a];var l=V(n),u=p.apply(void 0,(0,s.ev)([e,t,r,l],o,!1));return Array.isArray(u)?i.Children.toArray(u):u},B=function(e,t){var r,n,i,l,u,h,d,f=e.defaultRichTextElements,m=(0,s._T)(e,["defaultRichTextElements"]),g=V(f),E=(n=(0,s.pi)((0,s.pi)((0,s.pi)({},a.Z0),m),{defaultRichTextElements:g}),i=(0,o.ax)(t),u=(l=(0,s.pi)((0,s.pi)({},o.Z0),n)).locale,h=l.defaultLocale,d=l.onError,u?!Intl.NumberFormat.supportedLocalesOf(u).length&&d?d(new c.gb('Missing locale data for locale: "'.concat(u,'" in Intl.NumberFormat. Using default locale: "').concat(h,'" as fallback. See https://formatjs.github.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(u).length&&d&&d(new c.gb('Missing locale data for locale: "'.concat(u,'" in Intl.DateTimeFormat. Using default locale: "').concat(h,'" as fallback. See https://formatjs.github.io/docs/react-intl#runtime-requirements for more details'))):(d&&d(new c.OV('"locale" was not configured, using "'.concat(h,'" as fallback. See https://formatjs.github.io/docs/react-intl/api#intlshape for more details'))),l.locale=l.defaultLocale||"en"),l.onWarn&&l.defaultRichTextElements&&"string"==typeof(r=l.messages||{})[Object.keys(r)[0]]&&l.onWarn('[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. \nPlease consider using "@formatjs/cli" to pre-compile your messages for performance.\nFor more details see https://formatjs.github.io/docs/getting-started/message-distribution'),(0,s.pi)((0,s.pi)({}
10,l),{formatters:i,formatNumber:x.bind(null,l,i.getNumberFormat),formatNumberToParts:D.bind(null,l,i.getNumberFormat),formatRelativeTime:L.bind(null,l,i.getRelativeTimeFormat),formatDate:y.bind(null,l,i.getDateTimeFormat),formatDateToParts:b.bind(null,l,i.getDateTimeFormat),formatTime:v.bind(null,l,i.getDateTimeFormat),formatDateTimeRange:w.bind(null,l,i.getDateTimeFormat),formatTimeToParts:_.bind(null,l,i.getDateTimeFormat),formatPlural:O.bind(null,l,i.getPluralRules),formatMessage:p.bind(null,l,i),$t:p.bind(null,l,i),formatList:C.bind(null,l,i.getListFormat),formatListToParts:P.bind(null,l,i.getListFormat),formatDisplayName:T.bind(null,l,i.getDisplayNames)})),I={locale:E.locale,timeZone:E.timeZone,fallbackOnEmptyString:E.fallbackOnEmptyString,formats:E.formats,defaultLocale:E.defaultLocale,defaultFormats:E.defaultFormats,messages:E.messages,onError:E.onError,defaultRichTextElements:g};return(0,s.pi)((0,s.pi)({},E),{formatMessage:U.bind(null,I,E.formatters),$t:U.bind(null,I,E.formatters)})},j=r(89274);function H(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,onWarn:e.onWarn,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}var z=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.cache=(0,o.Sn)(),t.state={cache:t.cache,intl:B(H(t.props),t.cache),prevConfig:H(t.props)},t}return(0,s.ZT)(t,e),t.getDerivedStateFromProps=function(e,t){var r=t.prevConfig,n=t.cache,i=H(e);return(0,a.wU)(r,i)?null:{intl:B(i,n),prevConfig:i}},t.prototype.render=function(){return(0,a.lq)(this.state.intl),i.createElement(j.zt,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=a.Z0,t}(i.PureComponent);let q="en",G=e=>{let{children:t,headers:r,messages:i}=e,s=[];r&&r["accept-language"]?s=r["accept-language"].split(",").map(e=>e.split(";")[0]):window.navigator&&(s=window.navigator.languages);let o=s.find(e=>2===e.length)||"en";return q="en"!==o?"en":o,(0,n.jsx)(z,{locale:q,messages:i[q]||{},children:t})}},95658:function(e,t,r){"use strict";var n=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)}(r(69594),t)},54935:function(e,t){"use strict";var r,n,i,s;t.i4=t.sX=void 0,(i=r||(t.sX=r={})).Basic="basic",i.AccountPage="account-page",(s=n||(t.i4=n={})).anonymous="anon",s.admin="admin",s.editor="editor",s.user="user"},19615:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setErrorReporters=function(e){r={...r,...e}},t.reportError=function(e,t){let{error:n}=r;n&&i(()=>n(e,t))},t.reportApiFailure=function(e){let{apiFailure:t}=r;t&&i(()=>t(e))},t.describeRequestUrl=function(e){try{let t=new URL(e,"http://relative.invalid"),r=t.pathname.split("/").map(e=>s.test(e)?":id":e).join("/");return{host:"relative.invalid"===t.host?"":t.host,path:r}}catch(e){return{host:"",path:""}}},t.requestNameFromErrorMessage=function(e){return(null!=e?e:"unknown").replace(/\s+failed$/,"")};let r={},n=!1;function i(e){if(!n){n=!0;try{e()}catch(e){}finally{n=!1}}}let s=/^(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[A-Za-z0-9_-]{16,})$/i},14067:function(e,t,r){"use strict";var n,i=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]},s=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},o=(n=function(e){return(n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)}
10,function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),o=0;o<r.length;o++)"default"!==r[o]&&i(t,e,r[o]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.getFirebase=h,t.reloadPage=d,t.singInAnon=f,t.getIdToken=p,t.reloadUser=m,t.getFirestore=g,t.getFirestoreSubcollection=y,t.getFirestoreCollection=v,t.queryFirestoreCollection=w,t.subscribeToFirestoreCollection=b,t.subscribeToFirestoreDocument=_;let a=r(62995),l=r(86767),u=null,c=!1;async function h(){return u||(c?new Promise(e=>{setTimeout(async()=>{e(await h())},50)}):(c=!0,u=await Promise.resolve().then(()=>o(r(82683)))))}function d(){let e=new URLSearchParams(window.location.search);return!e.has("reloaded")&&(e.set("reloaded","1"),window.location.search=e.toString(),!0)}async function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;try{await (await h()).getAuth().signInAnonymously();return}catch(e){t=e,(null==e?void 0:e.code)&&"auth/network-request-failed"===e.code||(0,a.logError)(e)}if(e>10){(0,a.logError)(Error("Failed to sign in anonymously")),t&&(0,a.logError)(t),d();return}await (0,l.wait)(200),await f(e+1,t)}async function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null;try{if(null==(t=(await h()).getAuth(e>5))?void 0:t.currentUser){let r=await t.currentUser.getIdToken(e>5);return r&&(e=0),r}}catch(e){(null==e?void 0:e.code)&&"auth/network-request-failed"===e.code||(0,a.logError)(e)}if(e>25){if(!d()){var r;(0,a.logError)(Error("Failed to get token for ".concat((null==t?void 0:t.currentUser)?null==t?void 0:null===(r=t.currentUser)||void 0===r?void 0:r.uid:"unknown")))}return null}return await (0,l.wait)(200),p(e+1)}async function m(){var e;return null===(e=(await h()).getAuth().currentUser)||void 0===e?void 0:e.reload()}async function g(){let{firestore:e}=await h();if(!e)throw Error("Firestore instance is not initialized. Make sure Firebase is properly initialized.");if("object"!=typeof e||!("app"in e))throw console.error("Invalid Firestore instance:",e),Error("Firestore instance is not a valid Firestore instance");return e}async function y(e,t,n){let[i,{collection:s,doc:a}]=await Promise.all([g(),Promise.resolve().then(()=>o(r(52874)))]);if(!i)throw Error("Firestore instance is not available");try{let r=a(i,e,t);if(!r)throw Error("doc() returned undefined for ".concat(e,"/").concat(t));if("object"!=typeof r)throw Error("doc() returned non-object for ".concat(e,"/").concat(t,": ").concat(typeof r));let o=s(r,n);if(!o)throw Error("collection() returned undefined for ".concat(e,"/").concat(t,"/").concat(n));return o}catch(e){throw console.error("Error in getFirestoreSubcollection:",e),e}}async function v(e){let[t,{collection:n}]=await Promise.all([g(),Promise.resolve().then(()=>o(r(52874)))]);if(!t)throw Error("Firestore instance is not available");let i=n(t,e);if(!i)throw Error("Failed to create collection reference for ".concat(e));return i}async function w(e,t){let{query:n,orderBy:i,getDocs:s}=await Promise.resolve().then(()=>o(r(52874))),a=e;if(null==t?void 0:t.orderBy)try{a=n(e,i(t.orderBy.field,t.orderBy.direction))}catch(e){console.warn("Failed to query with orderBy, using simple query:",e)}let l=await s(a),u={};return l.forEach(e=>{u[e.id]=e.data()}),u}async function b(e,t,n){let{query:i,orderBy:s,onSnapshot:a}=await Promise.resolve().then(()=>o(r(52874))),l=e;if(null==n?void 0:n.orderBy)try{l=i(e,s(n.orderBy.field,n.orderBy.direction))}catch(e){console.warn("Failed to create query with orderBy, using simple ref:",e)}return a(l,e=>{let r={};e.forEach(e=>{r[e.id]=e.data()}),t(r)},e=>{var r;console.error("Error in Firestore subscription:",e),null==n||null===(r=n.onError)||void 0===r||r.call(n,e),t({})})}async function _(e,t,n){let[i,{doc:s,onSnapshot:a}]=await Promise.all([g(),Promise.resolve().then(()=>o(r(52874)))]);return a(s(i,e,t),e=>{n(e.exists()?e.data():null)},e=>{console.error("Error in Firestore document subscription:",e),n(null)})}},40975:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapFunction=function(e,t){return function(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return t(e,...n)}},t.wrapFunctionWithUser=function(e,t){return function(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.currentUser?t(e.currentUser,...n):()=>{throw Error("No current user")}}}},82683:function(e,t,r){"use strict";var n=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
10(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)}(r(52309),t)},52309:function(e,t,r){"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.firestore=t.storage=void 0,t.getAuth=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(n&&(null==n?void 0:n.currentUser)&&!e)return n;if("test"===p)return(0,c.getTestAuth)(m);let t=(0,s.initializeAuth)(m,{persistence:[s.browserLocalPersistence,s.browserSessionPersistence],popupRedirectResolver:s.browserPopupRedirectResolver});return n=Object.assign(t,{signInWithEmailAndPassword:(0,u.wrapFunction)(t,s.signInWithEmailAndPassword),sendPasswordResetEmail:(0,u.wrapFunction)(t,s.sendPasswordResetEmail),signInWithCustomToken:(0,u.wrapFunction)(t,s.signInWithCustomToken),signInAnonymously:(0,u.wrapFunction)(t,s.signInAnonymously),signInWithCredential:(0,u.wrapFunction)(t,s.signInWithCredential),signInWithGoogle:()=>(0,s.signInWithPopup)(t,new s.GoogleAuthProvider),EmailAuthProvider:s.EmailAuthProvider,GoogleAuthProvider:s.GoogleAuthProvider,sendEmailVerification:(0,u.wrapFunctionWithUser)(t,s.sendEmailVerification),linkWithCredential:(0,u.wrapFunctionWithUser)(t,s.linkWithCredential),verifyBeforeUpdateEmail:(0,u.wrapFunctionWithUser)(t,s.verifyBeforeUpdateEmail)})},t.getAnalytics=b;
10let i=r(10475),s=r(84882),o=r(70343),a=r(52874),l=r(87819),u=r(40975),c=r(16924),h=r(74304),{firebaseConfig:d,isDEV:f,OZI_ENV:p}=h.feconfig,m=(0,i.initializeApp)(d),g=(0,o.getStorage)(m),y=Object.assign(g,{ref:(0,u.wrapFunction)(g,o.ref),uploadBytesResumable:o.uploadBytesResumable,getDownloadURL:o.getDownloadURL});t.storage=y;let v=h.feconfig.isDEV?"sandbox":"(default)";(0,a.initializeFirestore)(m,{ignoreUndefinedProperties:!0},v);let w=a.getFirestore(m,v);async function b(){if(!await (0,l.isSupported)()||f)return{isSupported:()=>!1,logEvent:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.info("track",...t)}};let e=(0,l.getAnalytics)(m);return Object.assign(e,{isSupported:l.isSupported,logEvent:(0,u.wrapFunction)(e,l.logEvent)})}t.firestore=w},16924:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTestAuth=function(e){let t={uid:"test",email:"[email protected]",emailVerified:!0,isAnonymous:!1,refreshToken:"",providerData:[],metadata:{creationTime:"",lastSignInTime:""}};return{signInWithEmailAndPassword:function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return Promise.resolve({user:t,providerId:"",operationType:n.OperationType.SIGN_IN})},signInWithCustomToken:function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return Promise.resolve({user:t})},sendPasswordResetEmail:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return Promise.resolve()},linkWithCredential:function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return Promise.resolve({user:t})},signInWithCredential:function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return Promise.resolve({user:t})},signInAnonymously:function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return Promise.resolve({user:{...t,email:null,emailVerified:!1,isAnonymous:!0}})},sendEmailVerification:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return Promise.resolve()},verifyBeforeUpdateEmail:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return Promise.resolve()},app:e,name:"mock",config:{},tenantId:"",setPersistence:()=>Promise.resolve(),languageCode:"",onAuthStateChanged:()=>()=>Promise.resolve(),onIdTokenChanged:()=>()=>Promise.resolve(),beforeAuthStateChanged:()=>()=>Promise.resolve(),updateCurrentUser:()=>Promise.resolve(),emulatorConfig:{},currentUser:null,useDeviceLanguage:()=>"en",signOut:()=>Promise.resolve(),settings:{},EmailAuthProvider:n.EmailAuthProvider}};let n=r(84882)},6993:function(e,t){"use strict";t.e$=t.Od=t.t8=void 0,t.U2=function(e){let t=null;try{if(!(t=r.getItem(e)))return t}catch(e){return console.error(e),t}try{return JSON.parse(t)}catch(e){return t}};let r=window.localStorage;t.t8=(e,t)=>{try{return r.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},t.Od=e=>r.removeItem(e),t.e$=e=>null!==r.getItem(e)},62995:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logError=void 0;let n=r(19615),i=async(e,t)=>{let r=(e=>{if(e instanceof Error)return{error:e};if("undefined"!=typeof Event&&e instanceof Event){let t="undefined"!=typeof CustomEvent&&e instanceof CustomEvent;return{error:Error("Non-Error ".concat(t?"CustomEvent":"Event"," captured in logError: ").concat(e.type||"unknown")),extra:{eventType:e.type,isTrusted:e.isTrusted,...t?{detail:e.detail}:{}}}}return"string"==typeof e?{error:Error(e)}:{error:Error("Non-Error value captured in logError"),extra:{valueType:typeof e,value:e}}})(e),i=r.extra?{...t,extra:{...(null==t?void 0:t.extra)||{},...r.extra}}:t;console.error(r.error,i),(0,n.reportError)(r.error,i)};t.logError=i},72818:function(e,t){"use strict";t.xb=void 0,t.CE=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return"object"!=typeof e||null===e?{}:Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return!r.includes(t)}))},t.xb=e=>"object"!=typeof e||null===e||0===Object.keys(e).length&&e.constructor===Object},86767:function(e,t){"use strict";async function r(e,r){return await (0,t.wait)(r),e()}async function n(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;for(;!e();)await (0,t.wait)(r)}
10Object.defineProperty(t,"__esModule",{value:!0}),t.wait=void 0,t.setTimeoutPromise=r,t.waitUntil=n,t.wait=e=>new Promise(t=>{setTimeout(()=>t(),e)})},3741:function(e,t,r){"use strict";var n=r(34406);Object.defineProperty(t,"__esModule",{value:!0}),t.featureFlags=t.FEATURE_FLAG_OVERRIDES_STORAGE_KEY=void 0,t.deepMerge=l,t.getFeatureFlagOverrides=function(){return d(!0)},t.setFeatureFlagOverrides=function(e){try{let t=d(!0)||{},r=l(t,e);window.localStorage.setItem(s,JSON.stringify(r)),c=r,h=!0,window.dispatchEvent(new Event("featureFlagsChanged"))}catch(e){console.error("[FeatureFlags] Failed to set localStorage overrides:",e)}},t.clearFeatureFlagOverrides=function(){try{window.localStorage.removeItem(s),c=null,h=!1,window.dispatchEvent(new Event("featureFlagsChanged"))}catch(e){console.error("[FeatureFlags] Failed to clear localStorage overrides:",e)}},t.getBaseFeatureFlags=function(){return u},t.refreshFeatureFlagOverrides=function(){c=null,h=!1};let i=r(74304);t.FEATURE_FLAG_OVERRIDES_STORAGE_KEY="wavevisual:featureFlags:overrides";let s=t.FEATURE_FLAG_OVERRIDES_STORAGE_KEY,o={spectrumHzRepresentation:!1,cameraShake:!1,backgroundPulse:!1,recorderSine:!1,enableTracking:!0,enableHelpCenterWidget:!0,playAudioSilently:!1,debugSDK:!1,enablePrinting:!1,framedPrintOption:!1,printPreview:!1,bezierSoundwave:!1,musicVisualizerV3:!1,podcastVisualizer:!1,podcastWizard:!1,giftPages:!1,mobileEditorChrome:!1,editorAudioPlayerBarMobile:!1,waveGradientDirectionPicker:!1,videoEditor:!1,stockAudio:!0,videoSourceUpload:!0,canvasVideoLayers:!1,editorCaptions:!0,freeDownloadsForReviews:!1,coupon:{enabled:!1,code:"MOTHERSDAY26",discount:25,validUntil:"May 11th, 2026",label:"Mother's Day Sale",bannerMessage:void 0,checkoutBannerText:"Save 25% before May 11 — Mother's Day Sale \xb7 code MOTHERSDAY26",generateOrderCoupon:!1},sendReviewRequests:!1,exportUseCaseSurvey:!0,hetznerBackend:!1,posthogOverrides:{freePreviewDownload:void 0,preEditSizeSelector:void 0,digitalDownloadPrice:void 0}},a={spectrumHzRepresentation:!1,cameraShake:!0,backgroundPulse:!0,recorderSine:!1,enableTracking:!1,enableHelpCenterWidget:!0,playAudioSilently:!1,debugSDK:!0,enablePrinting:!1,framedPrintOption:!1,printPreview:!1,bezierSoundwave:!1,musicVisualizerV3:!0,podcastVisualizer:!1,podcastWizard:!1,giftPages:!1,mobileEditorChrome:!0,editorAudioPlayerBarMobile:!1,waveGradientDirectionPicker:!0,videoEditor:!0,stockAudio:!0,videoSourceUpload:!0,canvasVideoLayers:!0,editorCaptions:!0,freeDownloadsForReviews:!1,coupon:{enabled:!1,code:"MOTHERSDAY26",discount:25,validUntil:"May 11th, 2026",label:"Mother's Day Sale",bannerMessage:void 0,checkoutBannerText:"Save 25% before May 11 — Mother's Day Sale \xb7 code MOTHERSDAY26",generateOrderCoupon:!1},sendReviewRequests:!1,exportUseCaseSurvey:!0,hetznerBackend:!1,posthogOverrides:{freePreviewDownload:void 0,preEditSizeSelector:void 0,digitalDownloadPrice:"test"}};function l(e,t){let r={...e};return Object.keys(t).forEach(n=>{let i=t[n];if(i&&"object"==typeof i&&!Array.isArray(i)){let t=e[n];r[n]=l(t||{},i)}else r[n]=i}),r}let u=(()=>{let{OZI_ENV:e}=i.feconfig;return(null!=e?e:n.env.OZI_ENV)==="production"?o:a})(),c=null,h=!1;function d(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&h)return c;try{let e=window.localStorage.getItem(s);if(!e)return c=null,h=!0,null;let t=JSON.parse(e);return c=t,h=!0,t}catch(e){return console.warn("[FeatureFlags] Failed to parse localStorage overrides:",e),c=null,h=!0,null}}t.featureFlags=new Proxy(u,{get(e,t){let r=d();if(r&&t in r){let n=r[t];if(n&&"object"==typeof n&&!Array.isArray(n)){let r=e[t];if(r&&"object"==typeof r&&!Array.isArray(r))return l(r,n)}return n}return e[t]}})},92445:function(){},79324:function(e){e.exports={style:{fontFamily:"'__Open_Sans_a5c3a7', '__Open_Sans_Fallback_a5c3a7'"},className:"__className_a5c3a7",variable:"__variable_a5c3a7"}},25237:function(e,t,r){e.exports=r(72392)},5632:function(e,t,r){e.exports=r(70743)},45847:function(e,t,r){e.exports=r(19406)},34406:function(e){var t,r,n,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}
10catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l=[],u=!1,c=-1;function h(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=a(h);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||u||a(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}},89274:function(e,t,r){"use strict";r.d(t,{_y:function(){return o},zt:function(){return s}}),r(73463);var n=r(2784),i="undefined"==typeof window||window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?n.createContext(null):window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=n.createContext(null));i.Consumer;var s=i.Provider,o=i},42670:function(e,t,r){"use strict";var n=r(22970),i=r(2784),s=r(87576),o=r(83112);function a(e){var t=(0,o.Z)(),r=t.formatMessage,n=t.textComponent,s=void 0===n?i.Fragment:n,a=e.id,l=e.description,u=e.defaultMessage,c=e.values,h=e.children,d=e.tagName,f=void 0===d?s:d,p=r({id:a,description:l,defaultMessage:u},c,{ignoreTag:e.ignoreTag});return"function"==typeof h?h(Array.isArray(p)?p:[p]):f?i.createElement(f,null,i.Children.toArray(p)):i.createElement(i.Fragment,null,p)}a.displayName="FormattedMessage";var l=i.memo(a,function(e,t){var r=e.values,i=(0,n._T)(e,["values"]),o=t.values,a=(0,n._T)(t,["values"]);return(0,s.wU)(o,r)&&(0,s.wU)(i,a)});l.displayName="MemoizedFormattedMessage",t.Z=l},83112:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(2784),i=r(87576),s=r(89274);function o(){var e=n.useContext(s._y);return(0,i.lq)(e),e}},87576:function(e,t,r){"use strict";r.d(t,{Z0:function(){return a},dt:function(){return l},lq:function(){return o},wU:function(){return u}});var n=r(22970),i=r(2784),s=r(32428);function o(e){!function(e,t,r){if(void 0===r&&(r=Error),!e)throw new r(t)}(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var a=(0,n.pi)((0,n.pi)({},s.Z0),{textComponent:i.Fragment});function l(e){return function(t){return e(i.Children.toArray(t))}}function u(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),i=r.length;if(n.length!==i)return!1;for(var s=0;s<i;s++){var o=r[s];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0}},66866:function(e,t){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,s=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,b=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case h:case s:case a:case o:case f:return e;default:switch(e=e&&e.$$typeof){case u:case d:case g:case m:case l:return e;default:return t}}case i:return t}}}function E(e){return _(e)===h}t.AsyncMode=c,t.ConcurrentMode=h,t.ContextConsumer=u,t.ContextProvider=l,t.Element=n,t.ForwardRef=d,t.Fragment=s,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=f,t.isAsyncMode=function(e){return E(e)||_(e)===c},t.isConcurrentMode=E,t.isContextConsumer=function(e){return _(e)===u},t.isContextProvider=function(e){return _(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===s},t.isLazy=function(e){return _(e)===g},t.isMemo=function(e){return _(e)===m},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===a},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===h||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===d||e.$$typeof===v||e.$$typeof===w||e.$$typeof===b||e.$$typeof===y)},t.typeOf=_},48570:function(e,t,r){"use strict";e.exports=r(66866)},45070:function(e,t,r){"use strict";var n=r(2784),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useSyncExternalStore,o=n.useRef,a=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,c){var h=o(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;var f=s(e,(h=l(function(){function e(e){if(!a){if(a=!0,s=e,e=n(e),void 0!==c&&d.hasValue){var t=d.value;if(c(t,e))return o=t}return o=e}if(t=o,i(s,e))return t;var r=n(e);return void 0!==c&&c(t,r)?(s=e,t):(s=e,o=r)}var s,o,a=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,c]))[0],h[1]);return a(function(){d.hasValue=!0,d.value=f},[f]),u(f),f}},69349:function(e,t,r){"use strict";e.exports=r(45070)},12524:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=s(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=s(t,r));return t}(r)))}return e}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0!==(r=(function(){return i}).apply(t,[]))&&(e.exports=r)}()},55389:function(e,t,r){"use strict";let n,i,s;r.r(t),r.d(t,{deleteDB:function(){return g},openDB:function(){return m},unwrap:function(){return p},wrap:function(){return f}});let o=(e,t)=>t.some(t=>e instanceof t),a=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,d={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return f(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function f(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(f(e.result)),n()},s=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&a.set(t,e)}).catch(()=>{}),h.set(t,e),t}(e);if(c.has(e))return c.get(e);let r="function"==typeof(t=e)?t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(p(this),e),f(a.get(this))}:function(...e){return f(t.apply(p(this),e))}:function(e,...r){let n=t.call(p(this),e,...r);return u.set(n,e.sort?e.sort():[e]),f(n)}:(t instanceof IDBTransaction&&function(e){if(l.has(e))return;let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),n()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});l.set(e,t)}(t),o(t,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,d):t;return r!==e&&(c.set(e,r),h.set(r,e)),r}let p=e=>h.get(e);function m(e,t,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){let o=indexedDB.open(e,t),a=f(o);return n&&o.addEventListener("upgradeneeded",e=>{n(f(o.result),e.oldVersion,e.newVersion,f(o.transaction),e)}),r&&o.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}function g(e,{blocked:t}={}){let r=indexedDB.deleteDatabase(e);return t&&r.addEventListener("blocked",e=>t(e.oldVersion,e)),f(r).then(()=>void 0)}let y=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],w=new Map;function b(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(w.get(t))return w.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,i=v.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||y.includes(r)))return;let s=async function(e,...t){let s=this.transaction(e,i?"readwrite":"readonly"),o=s.store;
10return n&&(o=o.index(t.shift())),(await Promise.all([o[r](...t),i&&s.done]))[0]};return w.set(t,s),s}d={...s=d,get:(e,t,r)=>b(e,t)||s.get(e,t,r),has:(e,t)=>!!b(e,t)||s.has(e,t)}},99127:function(e,t,r){"use strict";r.d(t,{AOF:function(){return S},As9:function(){return D},Bpw:function(){return x},Dme:function(){return N},E2A:function(){return V},ELj:function(){return u},JCu:function(){return R},KP3:function(){return _},LHV:function(){return s},Lfi:function(){return F},MbD:function(){return p},QML:function(){return l},RB5:function(){return U},RFS:function(){return C},SR5:function(){return z},SV5:function(){return I},V9Z:function(){return h},VPh:function(){return A},Xrf:function(){return a},Ypm:function(){return M},aBR:function(){return H},bzc:function(){return E},civ:function(){return f},dEn:function(){return L},dx5:function(){return o},kA6:function(){return d},mGl:function(){return w},mny:function(){return i},o3n:function(){return P},oHP:function(){return T},ocf:function(){return k},pHD:function(){return y},qTj:function(){return O},rJU:function(){return b},s5I:function(){return c},sT9:function(){return m},t5C:function(){return j},wod:function(){return v},x2q:function(){return B},znh:function(){return g}});var n=r(20042);function i(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 0 1-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"},child:[]}]})(e)}function s(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64Zm127.978 274.82-.034.006c-.023.007-.042.018-.083.059L512 466.745l-127.86-127.86c-.042-.041-.06-.052-.084-.059a.118.118 0 0 0-.07 0c-.022.007-.041.018-.082.059l-45.02 45.019c-.04.04-.05.06-.058.083a.118.118 0 0 0 0 .07l.01.022a.268.268 0 0 0 .049.06L466.745 512l-127.86 127.862c-.041.04-.052.06-.059.083a.118.118 0 0 0 0 .07c.007.022.018.041.059.082l45.019 45.02c.04.04.06.05.083.058a.118.118 0 0 0 .07 0c.022-.007.041-.018.082-.059L512 557.254l127.862 127.861c.04.041.06.052.083.059a.118.118 0 0 0 .07 0c.022-.007.041-.018.082-.059l45.02-45.019c.04-.04.05-.06.058-.083a.118.118 0 0 0 0-.07l-.01-.022a.268.268 0 0 0-.049-.06L557.254 512l127.861-127.86c.041-.042.052-.06.059-.084a.118.118 0 0 0 0-.07c-.007-.022-.018-.041-.059-.082l-45.019-45.02c-.04-.04-.06-.05-.083-.058a.118.118 0 0 0-.07 0Z"},child:[]}]})(e)}function o(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M928 160H96c-17.7 0-32 14.3-32 32v160h896V192c0-17.7-14.3-32-32-32zM64 832c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V440H64v392zm579-184c0-4.4 3.6-8 8-8h165c4.4 0 8 3.6 8 8v72c0 4.4-3.6 8-8 8H651c-4.4 0-8-3.6-8-8v-72z"},child:[]}]})(e)}function a(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M899.6 276.5L705 396.4 518.4 147.5a8.06 8.06 0 0 0-12.9 0L319 396.4 124.3 276.5c-5.7-3.5-13.1 1.2-12.2 7.9L188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.8-6.7-6.5-11.4-12.3-7.9zM512 734.2c-62.1 0-112.6-50.5-112.6-112.6S449.9 509 512 509s112.6 50.5 112.6 112.6S574.1 734.2 512 734.2zm0-160.9c-26.6 0-48.2 21.6-48.2 48.3 0 26.6 21.6 48.3 48.2 48.3s48.2-21.6 48.2-48.3c0-26.6-21.6-48.3-48.2-48.3z"},child:[]}]})(e)}function l(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 0 0 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 0 0 9.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9z"},child:[]}]})(e)}function u(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"},child:[]}]})(e)}function c(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-92.4 233.5h-63.9c-50.1 0-59.8 23.8-59.8 58.8v77.1h119.6l-15.6 120.7h-104V912H539.2V602.2H434.9V481.4h104.3v-89c0-103.3 63.1-159.6 155.3-159.6 44.2 0 82.1 3.3 93.2 4.8v107.9z"},child:[]}]})(e)}function h(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M946.5 505L534.6 93.4a31.93 31.93 0 0 0-45.2 0L77.5 505c-12 12-18.8 28.3-18.8 45.3 0 35.3 28.7 64 64 64h43.4V908c0 17.7 14.3 32 32 32H448V716h112v224h265.9c17.7 0 32-14.3 32-32V614.3h43.4c17 0 33.3-6.7 45.3-18.8 24.9-25 24.9-65.5-.1-90.5z"},child:[]}]})(e)}function d(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"},child:[]}]})(e)}function f(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-80 600c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V360c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v304zm224 0c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V360c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v304z"},child:[]}]})(e)}function p(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zM338 304c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm513.9 437.1a8.11 8.11 0 0 1-5.2 1.9H177.2c-4.4 0-8-3.6-8-8 0-1.9.7-3.7 1.9-5.2l170.3-202c2.8-3.4 7.9-3.8 11.3-1 .3.3.7.6 1 1l99.4 118 158.1-187.5c2.8-3.4 7.9-3.8 11.3-1 .3.3.7.6 1 1l229.6 271.6c2.6 3.3 2.2 8.4-1.2 11.2z"}
10,child:[]}]})(e)}function m(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm144.1 454.9L437.7 677.8a8.02 8.02 0 0 1-12.7-6.5V353.7a8 8 0 0 1 12.7-6.5L656.1 506a7.9 7.9 0 0 1 0 12.9z"},child:[]}]})(e)}function g(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 0 0-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z"},child:[]}]})(e)}function y(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 0 0 .6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0 0 46.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"},child:[]}]})(e)}function v(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm215.3 337.7c.3 4.7.3 9.6.3 14.4 0 146.8-111.8 315.9-316.1 315.9-63 0-121.4-18.3-170.6-49.8 9 1 17.6 1.4 26.8 1.4 52 0 99.8-17.6 137.9-47.4-48.8-1-89.8-33-103.8-77 17.1 2.5 32.5 2.5 50.1-2a111 111 0 0 1-88.9-109v-1.4c14.7 8.3 32 13.4 50.1 14.1a111.13 111.13 0 0 1-49.5-92.4c0-20.7 5.4-39.6 15.1-56a315.28 315.28 0 0 0 229 116.1C492 353.1 548.4 292 616.2 292c32 0 60.8 13.4 81.1 35 25.1-4.7 49.1-14.1 70.5-26.7-8.3 25.7-25.7 47.4-48.8 61.1 22.4-2.4 44-8.6 64-17.3-15.1 22.2-34 41.9-55.7 57.6z"},child:[]}]})(e)}function w(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 0 0 0-48.4z"},child:[]}]})(e)}function b(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M864 248H728l-32.4-90.8a32.07 32.07 0 0 0-30.2-21.2H358.6c-13.5 0-25.6 8.5-30.1 21.2L296 248H160c-44.2 0-80 35.8-80 80v456c0 44.2 35.8 80 80 80h704c44.2 0 80-35.8 80-80V328c0-44.2-35.8-80-80-80zm8 536c0 4.4-3.6 8-8 8H160c-4.4 0-8-3.6-8-8V328c0-4.4 3.6-8 8-8h186.7l17.1-47.8 22.9-64.2h250.5l22.9 64.2 17.1 47.8H864c4.4 0 8 3.6 8 8v456zM512 384c-88.4 0-160 71.6-160 160s71.6 160 160 160 160-71.6 160-160-71.6-160-160-160zm0 256c-53 0-96-43-96-96s43-96 96-96 96 43 96 96-43 96-96 96z"},child:[]}]})(e)}function _(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0 0 51.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"},child:[]},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]}]})(e)}function E(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"},child:[]}]})(e)}function I(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64Zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372Zm128.013 198.826c.023.007.042.018.083.059l45.02 45.019c.04.04.05.06.058.083a.118.118 0 0 1 0 .07c-.007.022-.018.041-.059.082L557.254 512l127.861 127.862a.268.268 0 0 1 .05.06l.009.023a.118.118 0 0 1 0 .07c-.007.022-.018.041-.059.082l-45.019 45.02c-.04.04-.06.05-.083.058a.118.118 0 0 1-.07 0c-.022-.007-.041-.018-.082-.059L512 557.254 384.14 685.115c-.042.041-.06.052-.084.059a.118.118 0 0 1-.07 0c-.022-.007-.041-.018-.082-.059l-45.02-45.019c-.04-.04-.05-.06-.058-.083a.118.118 0 0 1 0-.07c.007-.022.018-.041.059-.082L466.745 512l-127.86-127.86a.268.268 0 0 1-.05-.061l-.009-.023a.118.118 0 0 1 0-.07c.007-.022.018-.041.059-.082l45.019-45.02c.04-.04.06-.05.083-.058a.118.118 0 0 1 .07 0c.022.007.041.018.082.059L512 466.745l127.862-127.86c.
1004-.041.06-.052.083-.059a.118.118 0 0 1 .07 0Z"},child:[]}]})(e)}function T(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M799.855 166.312c.023.007.043.018.084.059l57.69 57.69c.041.041.052.06.059.084a.118.118 0 0 1 0 .069c-.007.023-.018.042-.059.083L569.926 512l287.703 287.703c.041.04.052.06.059.083a.118.118 0 0 1 0 .07c-.007.022-.018.042-.059.083l-57.69 57.69c-.041.041-.06.052-.084.059a.118.118 0 0 1-.069 0c-.023-.007-.042-.018-.083-.059L512 569.926 224.297 857.629c-.04.041-.06.052-.083.059a.118.118 0 0 1-.07 0c-.022-.007-.042-.018-.083-.059l-57.69-57.69c-.041-.041-.052-.06-.059-.084a.118.118 0 0 1 0-.069c.007-.023.018-.042.059-.083L454.073 512 166.371 224.297c-.041-.04-.052-.06-.059-.083a.118.118 0 0 1 0-.07c.007-.022.018-.042.059-.083l57.69-57.69c.041-.041.06-.052.084-.059a.118.118 0 0 1 .069 0c.023.007.042.018.083.059L512 454.073l287.703-287.702c.04-.041.06-.052.083-.059a.118.118 0 0 1 .07 0Z"},child:[]}]})(e)}function S(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"},child:[]}]})(e)}function A(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"},child:[]}]})(e)}function C(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function P(e){return(0,n.w_)({tag:"svg",attr:{t:"1569683683230",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M342 88H120c-17.7 0-32 14.3-32 32v224c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V168h174c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zM920 664h-48c-8.8 0-16 7.2-16 16v176H682c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h222c17.7 0 32-14.3 32-32V680c0-8.8-7.2-16-16-16zM342 856H168V680c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16v224c0 17.7 14.3 32 32 32h222c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zM904 88H682c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h174v176c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V120c0-17.7-14.3-32-32-32z"},child:[]}]})(e)}function R(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M920 416H616c-4.4 0-8 3.6-8 8v112c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-56h60v320h-46c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h164c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8h-46V480h60v56c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V424c0-4.4-3.6-8-8-8zM656 296V168c0-4.4-3.6-8-8-8H104c-4.4 0-8 3.6-8 8v128c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-64h168v560h-92c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-92V232h168v64c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8z"},child:[]}]})(e)}function k(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]},{tag:"path",attr:{d:"M464 336a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function x(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 306.9c-113.5 0-205.1 91.6-205.1 205.1S398.5 717.1 512 717.1 717.1 625.5 717.1 512 625.5 306.9 512 306.9zm0 338.4c-73.4 0-133.3-59.9-133.3-133.3S438.6 378.7 512 378.7 645.3 438.6 645.3 512 585.4 645.3 512 645.3zm213.5-394.6c-26.5 0-47.9 21.4-47.9 47.9s21.4 47.9 47.9 47.9 47.9-21.3 47.9-47.9a47.84 47.84 0 0 0-47.9-47.9zM911.8 512c0-55.2.5-109.9-2.6-165-3.1-64-17.7-120.8-64.5-167.6-46.9-46.9-103.6-61.4-167.6-64.5-55.2-3.1-109.9-2.6-165-2.6-55.2 0-109.9-.5-165 2.6-64 3.1-120.8 17.7-167.6 64.5C132.6 226.3 118.1 283 115 347c-3.1 55.2-2.6 109.9-2.6 165s-.5 109.9 2.6 165c3.1 64 17.7 120.8 64.5 167.6 46.9 46.9 103.6 61.4 167.6 64.5 55.2 3.1 109.9 2.6 165 2.6 55.2 0 109.9.5 165-2.6 64-3.1 120.8-17.7 167.6-64.5 46.9-46.9 61.4-103.6 64.5-167.6 3.2-55.1 2.6-109.8 2.6-165zm-88 235.8c-7.3 18.2-16.1 31.8-30.2 45.8-14.1 14.1-27.6 22.9-45.8 30.2C695.2 844.7 570.3 840 512 840c-58.3 0-183.3 4.7-235.9-16.1-18.2-7.3-31.8-16.1-45.8-30.2-14.1-14.1-22.9-27.6-30.2-45.8C179.3 695.2 184 570.3 184 512c0-58.3-4.7-183.3 16.1-235.9 7.3-18.2 16.1-31.8 30.2-45.8s27.6-22.9 45.8-30.2C328.7 179.3 453.7 184 512 184s183.3-4.7 235.9 16.1c18.2 7.3 31.8 16.1 45.8 30.2 14.1 14.1 22.9 27.6 30.2 45.8C844.7 328.7 840 453.7 840 512c0 58.3 4.7 183.2-16.2 235.8z"},child:[]}]})(e)}function D(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-696 72h136v656H184V184zm656 656H384V384h456v456zM384 320V184h456v136H384z"},child:[]}]})(e)}function N(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0 0 68.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"},child:[]}]})(e)}function O(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function M(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"},child:[]}]})(e)}function L(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"},child:[]},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]}]})(e)}function F(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(e)}function V(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M468 128H160c-17.7 0-32 14.3-32 32v308c0 4.4 3.6 8 8 8h332c4.4 0 8-3.6 8-8V136c0-4.4-3.6-8-8-8zm-56 284H192V192h220v220zm-138-74h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm194 210H136c-4.4 0-8 3.6-8 8v308c0 17.7 14.3 32 32 32h308c4.4 0 8-3.6 8-8V556c0-4.4-3.6-8-8-8zm-56 284H192V612h220v220zm-138-74h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm590-630H556c-4.4 0-8 3.6-8 8v332c0 4.4 3.6 8 8 8h332c4.4 0 8-3.6 8-8V160c0-17.7-14.3-32-32-32zm-32 284H612V192h220v220zm-138-74h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm194 210h-48c-4.4 0-8 3.6-8 8v134h-78V556c0-4.4-3.6-8-8-8H556c-4.4 0-8 3.6-8 8v332c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h78v102c0 4.4 3.6 8 8 8h190c4.4 0 8-3.6 8-8V556c0-4.4-3.6-8-8-8zM746 832h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm142 0h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function U(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"},child:[]}]})(e)}function B(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 0 0 0-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 
100 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"},child:[]}]})(e)}function j(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 284a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 284a56 56 0 1 0 112 0 56 56 0 1 0-112 0z"},child:[]}]})(e)}function H(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 0 0-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function z(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M464 720a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"},child:[]}]})(e)}},19994:function(e,t,r){"use strict";r.d(t,{DQ0:function(){return l},I2T:function(){return s},Zw4:function(){return o},oAZ:function(){return a},tDd:function(){return i}});var n=r(20042);function i(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 6.5C10 4.57 8.43 3 6.5 3S3 4.57 3 6.5 4.57 10 6.5 10a3.45 3.45 0 0 0 1.613-.413l2.357 2.528-2.318 2.318A3.46 3.46 0 0 0 6.5 14C4.57 14 3 15.57 3 17.5S4.57 21 6.5 21s3.5-1.57 3.5-3.5c0-.601-.166-1.158-.434-1.652l2.269-2.268L17 19.121a3 3 0 0 0 2.121.879H22L9.35 8.518c.406-.572.65-1.265.65-2.018zM6.5 8C5.673 8 5 7.327 5 6.5S5.673 5 6.5 5 8 5.673 8 6.5 7.327 8 6.5 8zm0 11c-.827 0-1.5-.673-1.5-1.5S5.673 16 6.5 16s1.5.673 1.5 1.5S7.327 19 6.5 19z"},child:[]},{tag:"path",attr:{d:"m17 4.879-3.707 4.414 1.414 1.414L22 4h-2.879A3 3 0 0 0 17 4.879z"},child:[]}]})(e)}function s(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.001 10h2v5h-2zM11 16h2v2h-2z"},child:[]},{tag:"path",attr:{d:"M13.768 4.2C13.42 3.545 12.742 3.138 12 3.138s-1.42.407-1.768 1.063L2.894 18.064a1.986 1.986 0 0 0 .054 1.968A1.984 1.984 0 0 0 4.661 21h14.678c.708 0 1.349-.362 1.714-.968a1.989 1.989 0 0 0 .054-1.968L13.768 4.2zM4.661 19 12 5.137 19.344 19H4.661z"},child:[]}]})(e)}function o(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 5h13v7h2V5c0-1.103-.897-2-2-2H4c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h8v-2H4V5z"},child:[]},{tag:"path",attr:{d:"m8 11-3 4h11l-4-6-3 4z"},child:[]},{tag:"path",attr:{d:"M19 14h-2v3h-3v2h3v3h2v-3h3v-2h-3z"},child:[]}]})(e)}function a(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"},child:[]},{tag:"path",attr:{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"},child:[]}]})(e)}function l(e){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.5 14.5c-1.58 0-2.903 1.06-3.337 2.5H2v2h2.163c.434 1.44 1.757 2.5 3.337 2.5s2.903-1.06 3.337-2.5H22v-2H10.837c-.434-1.44-1.757-2.5-3.337-2.5zm0 5c-.827 0-1.5-.673-1.5-1.5s.673-1.5 1.5-1.5S9 17.173 9 18s-.673 1.5-1.5 1.5zm9-11c-1.58 0-2.903 1.06-3.337 2.5H2v2h11.163c.434 1.44 1.757 2.5 3.337 2.5s2.903-1.06 3.337-2.5H22v-2h-2.163c-.434-1.44-1.757-2.5-3.337-2.5zm0 5c-.827 0-1.5-.673-1.5-1.5s.673-1.5 1.5-1.5 1.5.673 1.5 1.5-.673 1.5-1.5 1.5z"},child:[]},{tag:"path",attr:{d:"M12.837 5C12.403 3.56 11.08 2.5 9.5 2.5S6.597 3.56 6.163 5H2v2h4.163C6.597 8.44 7.92 9.5 9.5 9.5s2.903-1.06 3.337-2.5h9.288V5h-9.288zM9.5 7.5C8.673 7.5 8 6.827 8 6s.673-1.5 1.5-1.5S11 5.173 11 6s-.673 1.5-1.5 1.5z"},child:[]}]})(e)}},20042:function(e,t,r){"use strict";r.d(t,{w_:function(){return c}});var n=r(2784),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},s=n.createContext&&n.createContext(i),o=["attr","size","title"];function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
10for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){var n,i;n=t,i=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e){return t=>n.createElement(h,a({attr:u({},e.attr)},t),function e(t){return t&&t.map((t,r)=>n.createElement(t.tag,u({key:r},t.attr),e(t.child)))}(e.child))}function h(e){var t=t=>{var r,{attr:i,size:s,title:l}=e,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,o),h=s||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",a({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,c,{className:r,style:u(u({color:e.color||t.color},t.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),l&&n.createElement("title",null,l),e.children)};return void 0!==s?n.createElement(s.Consumer,null,e=>t(e)):t(i)}},34646:function(e,t,r){"use strict";r.d(t,{dk:function(){return f},fw:function(){return d},zH:function(){return h}});var n=r(2784),i=r(71232),s=r(25766),o=r(87366),a=r(80714),l=r(93129),u=r(78116);let c=(0,n.createContext)(null);function h(){var e,t;return null!=(t=null==(e=(0,n.useContext)(c))?void 0:e.value)?t:void 0}function d(){let[e,t]=(0,n.useState)([]);return[e.length>0?e.join(" "):void 0,(0,n.useMemo)(()=>function(e){let r=(0,i.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let r=t.slice(),n=r.indexOf(e);return -1!==n&&r.splice(n,1),r}))),s=(0,n.useMemo)(()=>({register:r,slot:e.slot,name:e.name,props:e.props,value:e.value}),[r,e.slot,e.name,e.props,e.value]);return n.createElement(c.Provider,{value:s},e.children)},[t])]}c.displayName="DescriptionContext";let f=Object.assign((0,u.yV)(function(e,t){let r=(0,n.useId)(),i=(0,l.B)(),{id:h="headlessui-description-".concat(r),...d}=e,f=function e(){let t=(0,n.useContext)(c);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),p=(0,a.T)(t);(0,s.e)(()=>f.register(h),[h,f.register]);let m=(0,o.x)({...f.slot,disabled:i||!1}),g={ref:p,...f.props,id:h};return(0,u.L6)()({ourProps:g,theirProps:d,slot:m,defaultTag:"p",name:f.name||"Description"})}),{})},75590:function(e,t,r){"use strict";let n,i,s,o;r.d(t,{Vq:function(){return ec},EM:function(){return el},$N:function(){return eu}});var a=r(2784),l=r(9947),u=r(2422);function c(e,t,r,n){let i=(0,u.E)(r);(0,a.useEffect)(()=>{function r(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)},[e,t,n])}var h=r(73513),d=r(71232),f=r(32983),p=r(25766),m=r(59484),g=r(87011),y=r(57241),v=r(91803),w=r(11655),b=r(34488);let _=(0,a.createContext)(null);function E(e){let{children:t,node:r}=e,[n,i]=(0,a.useState)(null),s=I(null!=r?r:n);return a.createElement(_.Provider,{value:s},t,null===s&&a.createElement(v._,{features:v.x.Hidden,ref:e=>{var t,r;if(e){for(let n of null!=(r=null==(t=(0,b.r3)(e))?void 0:t.querySelectorAll("html > *, body > *"))?r:[])if(n!==document.body&&n!==document.head&&w.kK(n)&&null!=n&&n.contains(e)){i(n);break}}}}))}function I(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null!=(e=(0,a.useContext)(_))?e:t}var T=r(66523),S=r(94913),A=r(87366),C=r(80714);let P=(0,a.createContext)(()=>{});function R(e){let{value:t,children:r}=e;return a.createElement(P.Provider,{value:t},r)}var k=r(28470),x=r(99121),D=r(24583),N=r(76239),O=r(78417),M=r(78116),L=r(34646),F=r(55635),V=r(93939),U=r(14488),B=r(40113),j=((n=j||{})[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n);function H(e,t){let r=(0,a.useRef)([]),n=(0,d.z)(e);(0,a.useEffect)(()=>{let e=[...r.current];for(let[i,s]of t.entries())if(r.current[i]!==s){let i=n(t,e);return r.current=t,i}},[n,...t])}var z=r(5179);let q=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){if(!w.sP(e.target)||e.target===document.body||q[0]===e.target)return;let t=e.target;t=t.closest(z.y),q.unshift(null!=t?t:e.target),(q=q.filter(e=>null!=e&&e.isConnected)).splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var G=r(62325);function W(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let r of e.current)w.kK(r.current)&&t.add(r.current);return t}var $=((i=$||{})[i.None=0]="None",i[i.InitialFocus=1]="InitialFocus",i[i.TabLock=2]="TabLock",i[i.FocusLock=4]="FocusLock",i[i.RestoreFocus=8]="RestoreFocus",i[i.AutoFocus=16]="AutoFocus",
10i);let K=Object.assign((0,M.yV)(function(e,t){let r,n=(0,a.useRef)(null),i=(0,C.T)(n,t),{initialFocus:s,initialFocusFallback:o,containers:l,features:u=15,...f}=e;(0,S.H)()||(u=0);let p=(0,y.i)(n.current);!function(e,t){let{ownerDocument:r}=t,n=!!(8&e),i=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,a.useRef)(q.slice());return H((e,r)=>{let[n]=e,[i]=r;!0===i&&!1===n&&(0,G.Y)(()=>{t.current.splice(0)}),!1===i&&!0===n&&(t.current=q.slice())},[e,q,t]),(0,d.z)(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(n);H(()=>{n||(0,b.H9)(null==r?void 0:r.body)&&(0,z.C5)(i())},[n]),(0,U.L)(()=>{n&&(0,z.C5)(i())})}(u,{ownerDocument:p});let m=function(e,t){let{ownerDocument:r,container:n,initialFocus:i,initialFocusFallback:s}=t,o=(0,a.useRef)(null),l=(0,h.g)(!!(1&e),"focus-trap#initial-focus"),u=(0,V.t)();return H(()=>{if(0===e)return;if(!l){null!=s&&s.current&&(0,z.C5)(s.current);return}let t=n.current;t&&(0,G.Y)(()=>{if(!u.current)return;let n=null==r?void 0:r.activeElement;if(null!=i&&i.current){if((null==i?void 0:i.current)===n){o.current=n;return}}else if(t.contains(n)){o.current=n;return}if(null!=i&&i.current)(0,z.C5)(i.current);else{if(16&e){if((0,z.jA)(t,z.TO.First|z.TO.AutoFocus)!==z.fE.Error)return}else if((0,z.jA)(t,z.TO.First)!==z.fE.Error)return;if(null!=s&&s.current&&((0,z.C5)(s.current),(null==r?void 0:r.activeElement)===s.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}o.current=null==r?void 0:r.activeElement})},[s,l,e]),o}(u,{ownerDocument:p,container:n,initialFocus:s,initialFocusFallback:o});!function(e,t){let{ownerDocument:r,container:n,containers:i,previousActiveElement:s}=t,o=(0,V.t)(),a=!!(4&e);c(null==r?void 0:r.defaultView,"focus",e=>{if(!a||!o.current)return;let t=W(i);w.Re(n.current)&&t.add(n.current);let r=s.current;if(!r)return;let l=e.target;w.Re(l)?Q(t,l)?(s.current=l,(0,z.C5)(l)):(e.preventDefault(),e.stopPropagation(),(0,z.C5)(r)):(0,z.C5)(s.current)},!0)}(u,{ownerDocument:p,container:n,containers:l,previousActiveElement:m});let g=(r=(0,a.useRef)(0),(0,B.s)(!0,"keydown",e=>{"Tab"===e.key&&(r.current=e.shiftKey?1:0)},!0),r),_=(0,d.z)(e=>{if(!w.Re(n.current))return;let t=n.current;(0,O.E)(g.current,{[j.Forwards]:()=>{(0,z.jA)(t,z.TO.First,{skipElements:[e.relatedTarget,o]})},[j.Backwards]:()=>{(0,z.jA)(t,z.TO.Last,{skipElements:[e.relatedTarget,o]})}})}),E=(0,h.g)(!!(2&u),"focus-trap#tab-lock"),I=(0,F.G)(),T=(0,a.useRef)(!1),A=(0,M.L6)();return a.createElement(a.Fragment,null,E&&a.createElement(v._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:_,features:v.x.Focusable}),A({ourProps:{ref:i,onKeyDown(e){"Tab"==e.key&&(T.current=!0,I.requestAnimationFrame(()=>{T.current=!1}))},onBlur(e){if(!(4&u))return;let t=W(l);w.Re(n.current)&&t.add(n.current);let r=e.relatedTarget;w.sP(r)&&"true"!==r.dataset.headlessuiFocusGuard&&(Q(t,r)||(T.current?(0,z.jA)(n.current,(0,O.E)(g.current,{[j.Forwards]:()=>z.TO.Next,[j.Backwards]:()=>z.TO.Previous})|z.TO.WrapAround,{relativeTo:e.target}):w.sP(e.target)&&(0,z.C5)(e.target)))}},theirProps:f,defaultTag:"div",name:"FocusTrap"}),E&&a.createElement(v._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:_,features:v.x.Focusable}))}),{features:$});function Q(e,t){for(let r of e)if(r.contains(t))return!0;return!1}var Y=r(73901),J=r(55048),X=((s=X||{})[s.Open=0]="Open",s[s.Closed=1]="Closed",s),Z=((o=Z||{})[o.SetTitleId=0]="SetTitleId",o);let ee={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},et=(0,a.createContext)(null);function er(e){let t=(0,a.useContext)(et);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Dialog /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,er),t}return t}function en(e,t){return(0,O.E)(t.type,ee,e,t)}et.displayName="DialogContext";let ei=(0,M.yV)(function(e,t){let r=(0,a.useId)(),{id:n="headlessui-dialog-".concat(r),open:i,onClose:s,initialFocus:o,role:u="dialog",autoFocus:v=!0,__demoMode:_=!1,unmount:E=!1,...P}=e,O=(0,a.useRef)(!1);
10u="dialog"===u||"alertdialog"===u?u:(O.current||(O.current=!0,console.warn("Invalid role [".concat(u,"] passed to <Dialog />. Only `dialog` and and `alertdialog` are supported. Using `dialog` instead."))),"dialog");let F=(0,k.oJ)();void 0===i&&null!==F&&(i=(F&k.ZM.Open)===k.ZM.Open);let V=(0,a.useRef)(null),U=(0,C.T)(V,t),B=(0,y.i)(V.current),j=i?0:1,[H,z]=(0,a.useReducer)(en,{titleId:null,descriptionId:null,panelRef:(0,a.createRef)()}),q=(0,d.z)(()=>s(!1)),G=(0,d.z)(e=>z({type:0,id:e})),W=!!(0,S.H)()&&0===j,[Q,J]=(0,Y.kF)(),X=I(),{resolveContainers:Z}=function(){let{defaultContainers:e=[],portals:t,mainTreeNode:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,d.z)(()=>{var n,i;let s=(0,b.r3)(r),o=[];for(let t of e)null!==t&&(w.kK(t)?o.push(t):"current"in t&&w.kK(t.current)&&o.push(t.current));if(null!=t&&t.current)for(let e of t.current)o.push(e);for(let e of null!=(n=null==s?void 0:s.querySelectorAll("html > *, body > *"))?n:[])e!==document.body&&e!==document.head&&w.kK(e)&&"headlessui-portal-root"!==e.id&&(r&&(e.contains(r)||e.contains(null==(i=null==r?void 0:r.getRootNode())?void 0:i.host))||o.some(t=>e.contains(t))||o.push(e));return o}
10);return{resolveContainers:n,contains:(0,d.z)(e=>n().some(t=>t.contains(e)))}}({mainTreeNode:X,portals:Q,defaultContainers:[{get current(){var ee;return null!=(ee=H.panelRef.current)?ee:V.current}}]}),er=null!==F&&(F&k.ZM.Closing)===k.ZM.Closing;(0,f.s)(!_&&!er&&W,{allowed:(0,d.z)(()=>{var e,t;return[null!=(t=null==(e=V.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]}),disallowed:(0,d.z)(()=>{var e;return[null!=(e=null==X?void 0:X.closest("body > *:not(#headlessui-portal-root)"))?e:null]})});let ei=D.n.get(null);(0,p.e)(()=>{if(W)return ei.actions.push(n),()=>ei.actions.pop(n)},[ei,n,W]);let ea=(0,N.M)(ei,(0,a.useCallback)(e=>ei.selectors.isTop(e,n),[ei,n]));(0,g.O)(ea,Z,e=>{e.preventDefault(),q()}),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"undefined"!=typeof document?document.defaultView:null,r=arguments.length>2?arguments[2]:void 0,n=(0,h.g)(e,"escape");c(t,"keydown",e=>{n&&(e.defaultPrevented||e.key===l.R.Escape&&r(e))})}(ea,null==B?void 0:B.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),q()}),(0,T.P)(!_&&!er&&W,B,Z),(0,m.m)(W,V,q);let[el,eu]=(0,L.fw)(),ec=(0,a.useMemo)(()=>[{dialogState:j,close:q,setTitleId:G,unmount:E},H],[j,q,G,E,H]),eh=(0,A.x)({open:0===j}),ed={ref:U,id:n,role:u,tabIndex:-1,"aria-modal":_?void 0:0===j||void 0,"aria-labelledby":H.titleId,"aria-describedby":el,unmount:E},ef=!function(){var e;let[t]=(0,a.useState)(()=>"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null),[r,n]=(0,a.useState)(null!=(e=null==t?void 0:t.matches)&&e);return(0,p.e)(()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){n(e.matches)}},[t]),r}(),ep=$.None;W&&!_&&(ep|=$.RestoreFocus,ep|=$.TabLock,v&&(ep|=$.AutoFocus),ef&&(ep|=$.InitialFocus));let em=(0,M.L6)();return a.createElement(k.uu,null,a.createElement(x.O,{force:!0},a.createElement(Y.h_,null,a.createElement(et.Provider,{value:ec},a.createElement(Y.wA,{target:V},a.createElement(x.O,{force:!1},a.createElement(eu,{slot:eh},a.createElement(J,null,a.createElement(K,{initialFocus:o,initialFocusFallback:V,containers:Z,features:ep},a.createElement(R,{value:q},em({ourProps:ed,theirProps:P,slot:eh,defaultTag:es,features:eo,visible:0===j,name:"Dialog"})))))))))))}),es="div",eo=M.VN.RenderStrategy|M.VN.Static,ea=(0,M.yV)(function(e,t){let{transition:r=!1,open:n,...i}=e,s=(0,k.oJ)(),o=e.hasOwnProperty("open")||null!==s,l=e.hasOwnProperty("onClose");if(!o&&!l)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&"boolean"!=typeof e.open)throw Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: ".concat(e.open));if("function"!=typeof e.onClose)throw Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: ".concat(e.onClose));return(void 0!==n||r)&&!i.static?a.createElement(E,null,a.createElement(J.u,{show:n,transition:r,unmount:i.unmount},a.createElement(ei,{ref:t,...i}))):a.createElement(E,null,a.createElement(ei,{ref:t,open:n,...i}))}),el=(0,M.yV)(function(e,t){let r=(0,a.useId)(),{id:n="headlessui-dialog-panel-".concat(r),transition:i=!1,...s}=e,[{dialogState:o,unmount:l},u]=er("Dialog.Panel"),c=(0,C.T)(t,u.panelRef),h=(0,A.x)({open:0===o}),f=(0,d.z)(e=>{e.stopPropagation()}),p=i?J.x:a.Fragment,m=(0,M.L6)();return a.createElement(p,{...i?{unmount:l}:{}},m({ourProps:{ref:c,id:n,onClick:f},theirProps:s,slot:h,defaultTag:"div",name:"Dialog.Panel"}))}),eu=((0,M.yV)(function(e,t){let{transition:r=!1,...n}=e,[{dialogState:i,unmount:s}]=er("Dialog.Backdrop"),o=(0,A.x)({open:0===i}),l=r?J.x:a.Fragment,u=(0,M.L6)();return a.createElement(l,{...r?{unmount:s}:{}},u({ourProps:{ref:t,"aria-hidden":!0},theirProps:n,slot:o,defaultTag:"div",name:"Dialog.Backdrop"}))}),(0,M.yV)(function(e,t){let r=(0,a.useId)(),{id:n="headlessui-dialog-title-".concat(r),...i}=e,[{dialogState:s,setTitleId:o}]=er("Dialog.Title"),l=(0,C.T)(t);(0,a.useEffect)(()=>(o(n),()=>o(null)),[n,o]);let u=(0,A.x)({open:0===s});return(0,M.L6)()({ourProps:{ref:l,id:n},theirProps:i,slot:u,defaultTag:"h2",name:"Dialog.Title"})})),ec=Object.assign(ea,{Panel:el,Title:eu,Description:L.dk})},9947:function(e,t,r){"use strict";let n;r.d(t,{R:function(){return i}});var i=((n=i||{}).Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n)},73901:function(e,t,r){"use strict";
10r.d(t,{h_:function(){return E},kF:function(){return w},wA:function(){return _}});var n=r(2784),i=r(28316),s=r(55635),o=r(71232),a=r(14488),l=r(57241),u=r(94913),c=r(80714),h=r(99121),d=r(60210),f=r(78116);let p=n.Fragment,m=(0,f.yV)(function(e,t){let{ownerDocument:r=null,...o}=e,m=(0,n.useRef)(null),g=(0,c.T)((0,c.h)(e=>{m.current=e}),t),w=(0,l.i)(m.current),b=function(e){let t=(0,h.n)(),r=(0,n.useContext)(y),[i,s]=(0,n.useState)(()=>{var n;if(!t&&null!==r)return null!=(n=r.current)?n:null;if(d.O.isServer)return null;let i=null==e?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(null===e)return null;let s=e.createElement("div");return s.setAttribute("id","headlessui-portal-root"),e.body.appendChild(s)});return(0,n.useEffect)(()=>{null!==i&&(null!=e&&e.body.contains(i)||null==e||e.body.appendChild(i))},[i,e]),(0,n.useEffect)(()=>{t||null!==r&&s(r.current)},[r,s,t]),i}(null!=r?r:w),_=(0,n.useContext)(v),E=(0,s.G)(),I=(0,u.H)(),T=(0,f.L6)();return(0,a.L)(()=>{var e;b&&b.childNodes.length<=0&&(null==(e=b.parentElement)||e.removeChild(b))}),b&&I?(0,i.createPortal)(n.createElement("div",{"data-headlessui-portal":"",ref:e=>{E.dispose(),_&&e&&E.add(_.register(e))}},T({ourProps:{ref:g},theirProps:o,slot:{},defaultTag:p,name:"Portal"})),b):null}),g=n.Fragment,y=(0,n.createContext)(null),v=(0,n.createContext)(null);function w(){let e=(0,n.useContext)(v),t=(0,n.useRef)([]),r=(0,o.z)(r=>(t.current.push(r),e&&e.register(r),()=>i(r))),i=(0,o.z)(r=>{let n=t.current.indexOf(r);-1!==n&&t.current.splice(n,1),e&&e.unregister(r)}),s=(0,n.useMemo)(()=>({register:r,unregister:i,portals:t}),[r,i,t]);return[t,(0,n.useMemo)(()=>function(e){let{children:t}=e;return n.createElement(v.Provider,{value:s},t)},[s])]}let b=(0,f.yV)(function(e,t){let r=(0,c.T)(t),{enabled:i=!0,ownerDocument:s,...o}=e,a=(0,f.L6)();return i?n.createElement(m,{...o,ownerDocument:s,ref:r}):a({ourProps:{ref:r},theirProps:o,slot:{},defaultTag:p,name:"Portal"})}),_=(0,f.yV)(function(e,t){let{target:r,...i}=e,s={ref:(0,c.T)(t)},o=(0,f.L6)();return n.createElement(y.Provider,{value:r},o({ourProps:s,theirProps:i,defaultTag:g,name:"Popover.Group"}))}),E=Object.assign(b,{Group:_})},55048:function(e,t,r){"use strict";let n;r.d(t,{u:function(){return P},x:function(){return C}});var i=r(2784),s=r(55635),o=r(71232),a=r(93939),l=r(25766),u=r(2422),c=r(94913),h=r(80714),d=r(7246),f=r(28470),p=r(22725),m=r(78417),g=r(78116);function y(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!(0,g.M2)(null!=(t=e.as)?t:I)||1===i.Children.count(e.children)}let v=(0,i.createContext)(null);v.displayName="TransitionContext";var w=((n=w||{}).Visible="visible",n.Hidden="hidden",n);let b=(0,i.createContext)(null);function _(e){return"children"in e?_(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function E(e,t){let r=(0,u.E)(e),n=(0,i.useRef)([]),l=(0,a.t)(),c=(0,s.G)(),h=(0,o.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.l4.Hidden,i=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==i&&((0,m.E)(t,{[g.l4.Unmount](){n.current.splice(i,1)},[g.l4.Hidden](){n.current[i].state="hidden"}}),c.microTask(()=>{var e;!_(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),d=(0,o.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>h(e,g.l4.Unmount)}),f=(0,i.useRef)([]),p=(0,i.useRef)(Promise.resolve()),y=(0,i.useRef)({enter:[],leave:[]}),v=(0,o.z)((e,r,n)=>{f.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{f.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(y.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())}
10)]),"enter"===r?p.current=p.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),w=(0,o.z)((e,t,r)=>{Promise.all(y.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=f.current.shift())||e()}).then(()=>r(t))});return(0,i.useMemo)(()=>({children:n,register:d,unregister:h,onStart:v,onStop:w,wait:p,chains:y}),[d,h,n,v,w,y,p])}b.displayName="NestingContext";let I=i.Fragment,T=g.VN.RenderStrategy,S=(0,g.yV)(function(e,t){let{show:r,appear:n=!1,unmount:s=!0,...a}=e,u=(0,i.useRef)(null),d=y(e),p=(0,h.T)(...d?[u,t]:null===t?[]:[t]);(0,c.H)();let m=(0,f.oJ)();if(void 0===r&&null!==m&&(r=(m&f.ZM.Open)===f.ZM.Open),void 0===r)throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[w,I]=(0,i.useState)(r?"visible":"hidden"),S=E(()=>{r||I("hidden")}),[C,P]=(0,i.useState)(!0),R=(0,i.useRef)([r]);(0,l.e)(()=>{!1!==C&&R.current[R.current.length-1]!==r&&(R.current.push(r),P(!1))},[R,r]);let k=(0,i.useMemo)(()=>({show:r,appear:n,initial:C}),[r,n,C]);(0,l.e)(()=>{r?I("visible"):_(S)||null===u.current||I("hidden")},[r,S]);let x={unmount:s},D=(0,o.z)(()=>{var t;C&&P(!1),null==(t=e.beforeEnter)||t.call(e)}),N=(0,o.z)(()=>{var t;C&&P(!1),null==(t=e.beforeLeave)||t.call(e)}),O=(0,g.L6)();return i.createElement(b.Provider,{value:S},i.createElement(v.Provider,{value:k},O({ourProps:{...x,as:i.Fragment,children:i.createElement(A,{ref:p,...x,...a,beforeEnter:D,beforeLeave:N})},theirProps:{},defaultTag:i.Fragment,features:T,visible:"visible"===w,name:"Transition"})))}),A=(0,g.yV)(function(e,t){var r,n;let{transition:s=!0,beforeEnter:a,afterEnter:u,beforeLeave:w,afterLeave:S,enter:A,enterFrom:C,enterTo:P,entered:R,leave:k,leaveFrom:x,leaveTo:D,...N}=e,[O,M]=(0,i.useState)(null),L=(0,i.useRef)(null),F=y(e),V=(0,h.T)(...F?[L,t,M]:null===t?[]:[t]),U=null==(r=N.unmount)||r?g.l4.Unmount:g.l4.Hidden,{show:B,appear:j,initial:H}=function(){let e=(0,i.useContext)(v);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[z,q]=(0,i.useState)(B?"visible":"hidden"),G=function(){let e=(0,i.useContext)(b);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:W,unregister:$}=G;(0,l.e)(()=>W(L),[W,L]),(0,l.e)(()=>{if(U===g.l4.Hidden&&L.current){if(B&&"visible"!==z){q("visible");return}return(0,m.E)(z,{hidden:()=>$(L),visible:()=>W(L)})}},[z,L,W,$,B,U]);let K=(0,c.H)();(0,l.e)(()=>{if(F&&K&&"visible"===z&&null===L.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[L,z,K,F]);let Q=H&&!j,Y=j&&B&&H,J=(0,i.useRef)(!1),X=E(()=>{J.current||(q("hidden"),$(L))},G),Z=(0,o.z)(e=>{J.current=!0,X.onStart(L,e?"enter":"leave",e=>{"enter"===e?null==a||a():"leave"===e&&(null==w||w())})}),ee=(0,o.z)(e=>{let t=e?"enter":"leave";J.current=!1,X.onStop(L,t,e=>{"enter"===e?null==u||u():"leave"===e&&(null==S||S())}),"leave"!==t||_(X)||(q("hidden"),$(L))});(0,i.useEffect)(()=>{F&&s||(Z(B),ee(B))},[B,F,s]);let et=!(!s||!F||!K||Q),[,er]=(0,d.Y)(et,O,B,{start:Z,end:ee}),en=(0,g.oA)({ref:V,className:(null==(n=(0,p.A)(N.className,Y&&A,Y&&C,er.enter&&A,er.enter&&er.closed&&C,er.enter&&!er.closed&&P,er.leave&&k,er.leave&&!er.closed&&x,er.leave&&er.closed&&D,!er.transition&&B&&R))?void 0:n.trim())||void 0,...(0,d.X)(er)}),ei=0;"visible"===z&&(ei|=f.ZM.Open),"hidden"===z&&(ei|=f.ZM.Closed),B&&"hidden"===z&&(ei|=f.ZM.Opening),B||"visible"!==z||(ei|=f.ZM.Closing);let es=(0,g.L6)();return i.createElement(b.Provider,{value:X},i.createElement(f.up,{value:ei},es({ourProps:en,theirProps:N,defaultTag:I,features:T,visible:"visible"===z,name:"Transition.Child"})))}),C=(0,g.yV)(function(e,t){let r=null!==(0,i.useContext)(v),n=null!==(0,f.oJ)();return i.createElement(i.Fragment,null,!r&&n?i.createElement(S,{ref:t,...e}):i.createElement(A,{ref:t,...e}))}),P=Object.assign(S,{Child:C,Root:S})},55635:function(e,t,r){"use strict";r.d(t,{G:function(){return s}});var n=r(2784),i=r(86519);function s(){let[e]=(0,n.useState)(i.k);return(0,n.useEffect)(()=>()=>
10e.dispose(),[e]),e}},59755:function(e,t,r){"use strict";r.d(t,{I:function(){return s}});var n=r(2784),i=r(2422);function s(e,t,r,s){let o=(0,i.E)(r);(0,n.useEffect)(()=>{if(e)return document.addEventListener(t,r,s),()=>document.removeEventListener(t,r,s);function r(e){o.current(e)}},[e,t,s])}},71232:function(e,t,r){"use strict";r.d(t,{z:function(){return s}});var n=r(2784),i=r(2422);let s=function(e){let t=(0,i.E)(e);return n.useCallback(function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current(...r)},[t])}},32983:function(e,t,r){"use strict";r.d(t,{s:function(){return c}});var n=r(86519),i=r(34488),s=r(73513),o=r(25766);let a=new Map,l=new Map;function u(e){var t;let r=null!=(t=l.get(e))?t:0;return l.set(e,r+1),0!==r||(a.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>(function(e){var t;let r=null!=(t=l.get(e))?t:1;if(1===r?l.delete(e):l.set(e,r-1),1!==r)return;let n=a.get(e);n&&(null===n["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,a.delete(e))})(e)}function c(e){let{allowed:t,disallowed:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(0,s.g)(e,"inert-others");(0,o.e)(()=>{var e,s;if(!a)return;let o=(0,n.k)();for(let t of null!=(e=null==r?void 0:r())?e:[])t&&o.add(u(t));let l=null!=(s=null==t?void 0:t())?s:[];for(let e of l){if(!e)continue;let t=(0,i.r3)(e);if(!t)continue;let r=e.parentElement;for(;r&&r!==t.body;){for(let e of r.children)l.some(t=>e.contains(t))||o.add(u(e));r=r.parentElement}}return o.dispose},[a,t,r])}},93939:function(e,t,r){"use strict";r.d(t,{t:function(){return s}});var n=r(2784),i=r(25766);function s(){let e=(0,n.useRef)(!1);return(0,i.e)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}},73513:function(e,t,r){"use strict";r.d(t,{g:function(){return a}});var n=r(2784),i=r(24583),s=r(76239),o=r(25766);function a(e,t){let r=(0,n.useId)(),a=i.n.get(t),[l,u]=(0,s.M)(a,(0,n.useCallback)(e=>[a.selectors.isTop(e,r),a.selectors.inStack(e,r)],[a,r]));return(0,o.e)(()=>{if(e)return a.actions.push(r),()=>a.actions.pop(r)},[a,e,r]),!!e&&(!u||l)}},25766:function(e,t,r){"use strict";r.d(t,{e:function(){return s}});var n=r(2784),i=r(60210);let s=(e,t)=>{i.O.isServer?(0,n.useEffect)(e,t):(0,n.useLayoutEffect)(e,t)}},2422:function(e,t,r){"use strict";r.d(t,{E:function(){return s}});var n=r(2784),i=r(25766);function s(e){let t=(0,n.useRef)(e);return(0,i.e)(()=>{t.current=e},[e]),t}},59484:function(e,t,r){"use strict";r.d(t,{m:function(){return a}});var n=r(2784),i=r(86519),s=r(11655),o=r(2422);function a(e,t,r){let a=(0,o.E)(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&r()});(0,n.useEffect)(()=>{if(!e)return;let r=null===t?null:s.Re(t)?t:t.current;if(!r)return;let n=(0,i.k)();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(()=>a.current(r));e.observe(r),n.add(()=>e.disconnect())}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver(()=>a.current(r));e.observe(r),n.add(()=>e.disconnect())}return()=>n.dispose()},[t,a,e])}},14488:function(e,t,r){"use strict";r.d(t,{L:function(){return o}});var n=r(2784),i=r(62325),s=r(71232);function o(e){let t=(0,s.z)(e),r=(0,n.useRef)(!1);(0,n.useEffect)(()=>(r.current=!1,()=>{r.current=!0,(0,i.Y)(()=>{r.current&&t()})}),[t])}},87011:function(e,t,r){"use strict";r.d(t,{O:function(){return c}});var n=r(2784),i=r(11655),s=r(5179),o=r(37625),a=r(59755),l=r(2422),u=r(40113);function c(e,t,r){let c=(0,l.E)(r),h=(0,n.useCallback)(function(e,r){if(e.defaultPrevented)return;let n=r(e);if(null!==n&&n.getRootNode().contains(n)&&n.isConnected){for(let r of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t))if(null!==r&&(r.contains(n)||e.composed&&e.composedPath().includes(r)))return;return(0,s.sP)(n,s.tJ.Loose)||-1===n.tabIndex||e.preventDefault(),c.current(e,n)}},[c,t]),d=(0,n.useRef)(null);(0,a.I)(e,"pointerdown",e=>{var t,r;(0,o.tq)()||(d.current=(null==(r=null==(t=e.composedPath)?void 0:t.call(e))?void 0:r[0])||e.target)},!0),(0,a.I)(e,"pointerup",e=>{if((0,o.tq)()||!d.current)return;let t=d.current;return d.current=null,h(e,()=>t)},!0);let f=(0,n.useRef)({x:0,y:0});(0,a.I)(e,"touchstart",e=>{f.current.x=e.touches[0].clientX,f.current.y=e.touches[0].clientY},!0),(0,a.I)(e,"touchend",e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-f.current.x)>=30||Math.abs(t.y-f.current.y)>=30))return h(e,()=>i.sP(e.target)?e.target:null)},!0),(0,u.s)(e,"blur",e=>h(e,()=>i.jQ(window.document.activeElement)?window.document.activeElement:null),!0)}},57241:function(e,t,r){"use strict";r.d(t,{i:function(){return s}});var n=r(2784),i=r(34488);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.useMemo)(()=>(0,i.r3)(...t),[...t])}},66523:function(e,t,r){"use strict";let n,i;r.d(t,{P:function(){return m}});var s,o,a=r(2784),l=r(25766),u=r(86519),c=r(11655),h=r(37625);function d(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let f=(s=()=>new Map,o={PUSH(e,t){var r;let n=null!=(r=this.get(e))?r:{doc:e,count:0,d:(0,u.k)(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=d(n.meta),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t),r.computedMeta=d(r.meta)),this},SCROLL_PREVENT(e){let t;let r={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[(0,h.gn)()?{before(e){let{doc:t,d:r,meta:n}=e;
10function i(e){for(let t of n().containers)for(let r of t())if(r.contains(e))return!0;return!1}r.microTask(()=>{var e;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let e=(0,u.k)();e.style(t.documentElement,"scrollBehavior","auto"),r.add(()=>r.microTask(()=>e.dispose()))}let n=null!=(e=window.scrollY)?e:window.pageYOffset,s=null;r.addEventListener(t,"click",e=>{if(c.sP(e.target))try{let r=e.target.closest("a");if(!r)return;let{hash:n}=new URL(r.href),o=t.querySelector(n);c.sP(o)&&!i(o)&&(s=o)}catch(e){}},!0),r.group(e=>{r.addEventListener(t,"touchstart",t=>{if(e.dispose(),c.sP(t.target)&&c.nR(t.target)){if(i(t.target)){let r=t.target;for(;r.parentElement&&i(r.parentElement);)r=r.parentElement;e.style(r,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")}})}),r.addEventListener(t,"touchmove",e=>{if(c.sP(e.target)&&!c.LL(e.target)){if(i(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),r.add(()=>{var e;n!==(null!=(e=window.scrollY)?e:window.pageYOffset)&&window.scrollTo(0,n),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{},{before(e){var r;let{doc:n}=e,i=n.documentElement;t=Math.max(0,(null!=(r=n.defaultView)?r:window).innerWidth-i.clientWidth)},after(e){let{doc:r,d:n}=e,i=r.documentElement,s=Math.max(0,i.clientWidth-i.offsetWidth),o=Math.max(0,t-s);n.style(i,"paddingRight","".concat(o,"px"))}},{before(e){let{doc:t,d:r}=e;r.style(t.documentElement,"overflow","hidden")}}];n.forEach(e=>{let{before:t}=e;return null==t?void 0:t(r)}),n.forEach(e=>{let{after:t}=e;return null==t?void 0:t(r)})},SCROLL_ALLOW(e){let{d:t}=e;t.dispose()},TEARDOWN(e){let{doc:t}=e;this.delete(t)}},n=s(),i=new Set,{getSnapshot:()=>n,subscribe:e=>(i.add(e),()=>i.delete(e)),dispatch(e){for(var t=arguments.length,r=Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];let a=o[e].call(n,...r);a&&(n=a,i.forEach(e=>e()))}});f.subscribe(()=>{let e=f.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let e="hidden"===t.get(r.doc),n=0!==r.count;
10(n&&!e||!n&&e)&&f.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),0===r.count&&f.dispatch("TEARDOWN",r)}});var p=r(73513);function m(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[document.body];!function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>({containers:[]}),n=(0,a.useSyncExternalStore)(f.subscribe,f.getSnapshot,f.getSnapshot),i=t?n.get(t):void 0;i&&i.count,(0,l.e)(()=>{if(!(!t||!e))return f.dispatch("PUSH",t,r),()=>f.dispatch("POP",t,r)},[e,t])}((0,p.g)(e,"scroll-lock"),t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],r]}})}},94913:function(e,t,r){"use strict";r.d(t,{H:function(){return o}});var n,i=r(2784),s=r(60210);function o(){let e;let t=(e="undefined"==typeof document,(0,(n||(n=r.t(i,2))).useSyncExternalStore)(()=>()=>{},()=>!1,()=>!e)),[o,a]=i.useState(s.O.isHandoffComplete);return o&&!1===s.O.isHandoffComplete&&a(!1),i.useEffect(()=>{!0!==o&&a(!0)},[o]),i.useEffect(()=>s.O.handoff(),[]),!t&&o}},87366:function(e,t,r){"use strict";r.d(t,{x:function(){return i}});var n=r(2784);function i(e){return(0,n.useMemo)(()=>e,Object.values(e))}},80714:function(e,t,r){"use strict";r.d(t,{T:function(){return a},h:function(){return o}});var n=r(2784),i=r(71232);let s=Symbol();function o(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return Object.assign(e,{[s]:t})}function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=(0,n.useRef)(t);(0,n.useEffect)(()=>{o.current=t},[t]);let a=(0,i.z)(e=>{for(let t of o.current)null!=t&&("function"==typeof t?t(e):t.current=e)});return t.every(e=>null==e||(null==e?void 0:e[s]))?void 0:a}},7246:function(e,t,r){"use strict";let n;r.d(t,{X:function(){return d},Y:function(){return f}});var i,s,o=r(2784),a=r(86519),l=r(55635),u=r(25766),c=r(34406);void 0!==c&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&(null==(i=null==c?void 0:c.env)?void 0:i.NODE_ENV)==="test"&&void 0===(null==(s=null==Element?void 0:Element.prototype)?void 0:s.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn("Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.\nPlease install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.\n\nExample usage:\n```js\nimport { mockAnimationsApi } from 'jsdom-testing-mocks'\nmockAnimationsApi()\n```"),[]});var h=((n=h||{})[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n);function d(e){let t={};for(let r in e)!0===e[r]&&(t["data-".concat(r)]="");return t}function f(e,t,r,n){let[i,s]=(0,o.useState)(r),{hasFlag:c,addFlag:h,removeFlag:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,r]=(0,o.useState)(e),n=(0,o.useCallback)(e=>r(e),[]),i=(0,o.useCallback)(e=>r(t=>t|e),[]),s=(0,o.useCallback)(e=>(t&e)===e,[t]);return{flags:t,setFlag:n,addFlag:i,hasFlag:s,removeFlag:(0,o.useCallback)(e=>r(t=>t&~e),[]),toggleFlag:(0,o.useCallback)(e=>r(t=>t^e),[])}}(e&&i?3:0),f=(0,o.useRef)(!1),p=(0,o.useRef)(!1),m=(0,l.G)();return(0,u.e)(()=>{var i;if(e){if(r&&s(!0),!t){r&&h(3);return}return null==(i=null==n?void 0:n.start)||i.call(n,r),function(e,t){let{prepare:r,run:n,done:i,inFlight:s}=t,o=(0,a.k)();return function(e,t){let{inFlight:r,prepare:n}=t;if(null!=r&&r.current){n();return}let i=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=i}(e,{prepare:r,inFlight:s}),o.nextFrame(()=>{n(),o.requestAnimationFrame(()=>{o.add(function(e,t){var r,n;let i=(0,a.k)();if(!e)return i.dispose;let s=!1;i.add(()=>{s=!0});let o=null!=(n=null==(r=e.getAnimations)?void 0:r.call(e).filter(e=>e instanceof CSSTransition))?n:[];return 0===o.length?t():Promise.allSettled(o.map(e=>e.finished)).then(()=>{s||t()}),i.dispose}(e,i))})}),o.dispose}(t,{inFlight:f,prepare(){p.current?p.current=!1:p.current=f.current,f.current=!0,p.current||(r?(h(3),d(4)):(h(4),d(2)))},run(){p.current?r?(d(3),h(4)):(d(4),h(3)):r?d(1):h(1)},done(){var e,i,o;p.current&&(null!=(o=null==(i=t.getAnimations)?void 0:i.call(t))?o:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)||(f.current=!1,d(7),r||s(!1),null==(e=null==n?void 0:n.end)||e.call(n,r))}})}},[e,r,t,m]),e?[i,{closed:c(1),enter:c(2),leave:c(4),transition:c(2)||c(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}},40113:function(e,t,r){"use strict";r.d(t,{s:function(){return s}});var n=r(2784),i=r(2422);function s(e,t,r,s){let o=(0,i.E)(r);(0,n.useEffect)(()=>
10{if(e)return window.addEventListener(t,r,s),()=>window.removeEventListener(t,r,s);function r(e){o.current(e)}},[e,t,s])}},93129:function(e,t,r){"use strict";r.d(t,{B:function(){return s}});var n=r(2784);let i=(0,n.createContext)(void 0);function s(){return(0,n.useContext)(i)}},91803:function(e,t,r){"use strict";let n;r.d(t,{_:function(){return o},x:function(){return s}});var i=r(78116),s=((n=s||{})[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n);let o=(0,i.yV)(function(e,t){var r;let{features:n=1,...s}=e,o={ref:t,"aria-hidden":(2&n)==2||(null!=(r=s["aria-hidden"])?r:void 0),hidden:(4&n)==4||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(4&n)==4&&(2&n)!=2&&{display:"none"}}};return(0,i.L6)()({ourProps:o,theirProps:s,slot:{},defaultTag:"span",name:"Hidden"})})},28470:function(e,t,r){"use strict";let n;r.d(t,{ZM:function(){return o},oJ:function(){return a},up:function(){return l},uu:function(){return u}});var i=r(2784);let s=(0,i.createContext)(null);s.displayName="OpenClosedContext";var o=((n=o||{})[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n);function a(){return(0,i.useContext)(s)}function l(e){let{value:t,children:r}=e;return i.createElement(s.Provider,{value:t},r)}function u(e){let{children:t}=e;return i.createElement(s.Provider,{value:null},t)}},99121:function(e,t,r){"use strict";r.d(t,{O:function(){return o},n:function(){return s}});var n=r(2784);let i=(0,n.createContext)(!1);function s(){return(0,n.useContext)(i)}function o(e){return n.createElement(i.Provider,{value:e.force},e.children)}},82195:function(e,t,r){"use strict";r.d(t,{J:function(){return g},dC:function(){return b},wU:function(){return y}});var n,i,s,o=r(75426),a=r(86519),l=r(60210),u=Object.defineProperty,c=(e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t,r)=>(c(e,"symbol"!=typeof t?t+"":t,r),r),d=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},f=(e,t,r)=>(d(e,t,"read from private field"),r?r.call(e):t.get(e)),p=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},m=(e,t,r,n)=>(d(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class g{dispose(){this.disposables.dispose()}get state(){return f(this,n)}subscribe(e,t){if(l.O.isServer)return()=>{};let r={selector:e,callback:t,current:e(f(this,n))};return f(this,s).add(r),this.disposables.add(()=>{f(this,s).delete(r)})}on(e,t){return l.O.isServer?()=>{}:(f(this,i).get(e).add(t),this.disposables.add(()=>{f(this,i).get(e).delete(t)}))}send(e){let t=this.reduce(f(this,n),e);if(t!==f(this,n)){for(let e of(m(this,n,t),f(this,s))){let t=e.selector(f(this,n));y(e.current,t)||(e.current=t,e.callback(t))}for(let t of f(this,i).get(e.type))t(f(this,n),e)}}constructor(e){p(this,n,{}),p(this,i,new o.G(()=>new Set)),p(this,s,new Set),h(this,"disposables",(0,a.k)()),m(this,n,e),l.O.isServer&&this.disposables.microTask(()=>{this.dispose()})}}function y(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&v(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&v(e.entries(),t.entries()):!!(w(e)&&w(t))&&v(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function v(e,t){for(;;){let r=e.next(),n=t.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}}function w(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function b(e){let[t,r]=e(),n=(0,a.k)();return function(){for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];t(...i),n.dispose(),n.microTask(r)}}n=new WeakMap,i=new WeakMap,s=new WeakMap},24583:function(e,t,r){"use strict";let n;r.d(t,{M:function(){return c},n:function(){return f}});var i=r(82195),s=r(75426),o=r(78417),a=Object.defineProperty,l=(e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,u=(e,t,r)=>(l(e,"symbol"!=typeof t?t+"":t,r),r),c=((n=c||{})[n.Push=0]="Push",n[n.Pop=1]="Pop",n);let h={0(e,t){let r=t.id,n=e.stack,i=e.stack.indexOf(r);if(-1!==i){let t=e.stack.slice();return t.splice(i,1),t.push(r),n=t,{...e,stack:n}}return{...e,stack:[...e.stack,r]}},1(e,t){let r=t.id,n=e.stack.indexOf(r);if(-1===n)return e;let i=e.stack.slice();return i.splice(n,1),{...e,stack:i}}};class d extends i.J{static new(){return new d({stack:[]})}reduce(e,t){return(0,o.E)(t.type,h,e,t)}constructor(){super(...arguments),u(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),u(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}}let f=new s.G(()=>d.new())},76239:function(e,t,r){"use strict";r.d(t,{M:function(){return o}});var n=r(69349),i=r(71232),s=r(82195);function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.wU;
10return(0,n.useSyncExternalStoreWithSelector)((0,i.z)(t=>e.subscribe(a,t)),(0,i.z)(()=>e.state),(0,i.z)(()=>e.state),(0,i.z)(t),r)}function a(e){return e}},22725:function(e,t,r){"use strict";function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return Array.from(new Set(t.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}r.d(t,{A:function(){return n}})},75426:function(e,t,r){"use strict";r.d(t,{G:function(){return n}});class n extends Map{get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}constructor(e){super(),this.factory=e}}},86519:function(e,t,r){"use strict";r.d(t,{k:function(){return function e(){let t=[],r={addEventListener:(e,t,n,i)=>(e.addEventListener(t,n,i),r.add(()=>e.removeEventListener(t,n,i))),requestAnimationFrame(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=requestAnimationFrame(...t);return r.add(()=>cancelAnimationFrame(i))},nextFrame(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.requestAnimationFrame(()=>r.requestAnimationFrame(...t))},setTimeout(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=setTimeout(...t);return r.add(()=>clearTimeout(i))},microTask(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let s={current:!0};return(0,n.Y)(()=>{s.current&&t[0]()}),r.add(()=>{s.current=!1})},style(e,t,r){let n=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:r}),this.add(()=>{Object.assign(e.style,{[t]:n})})},group(t){let r=e();return t(r),this.add(()=>r.dispose())},add:e=>(t.includes(e)||t.push(e),()=>{let r=t.indexOf(e);if(r>=0)for(let e of t.splice(r,1))e()}),dispose(){for(let e of t.splice(0))e()}};return r}}});var n=r(62325)},11655:function(e,t,r){"use strict";function n(e){return"object"==typeof e&&null!==e&&"nodeType"in e}function i(e){return n(e)&&"tagName"in e}function s(e){return i(e)&&"accessKey"in e}function o(e){return i(e)&&"tabIndex"in e}function a(e){return i(e)&&"style"in e}function l(e){return s(e)&&"IFRAME"===e.nodeName}function u(e){return s(e)&&"INPUT"===e.nodeName}function c(e){return s(e)&&"LABEL"===e.nodeName}function h(e){return s(e)&&"FIELDSET"===e.nodeName}function d(e){return s(e)&&"LEGEND"===e.nodeName}function f(e){return!!i(e)&&e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]')}r.d(t,{CD:function(){return d},LL:function(){return u},Re:function(){return s},UG:function(){return n},dz:function(){return c},jF:function(){return f},jQ:function(){return l},kK:function(){return i},nR:function(){return a},sP:function(){return o},zO:function(){return h}})},60210:function(e,t,r){"use strict";r.d(t,{O:function(){return a}});var n=Object.defineProperty,i=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,s=(e,t,r)=>(i(e,"symbol"!=typeof t?t+"":t,r),r);class o{set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}constructor(){s(this,"current",this.detect()),s(this,"handoffState","pending"),s(this,"currentId",0)}}let a=new o},5179:function(e,t,r){"use strict";let n,i,s,o,a;r.d(t,{C5:function(){return E},EO:function(){return T},TO:function(){return p},fE:function(){return m},jA:function(){return S},sP:function(){return w},tJ:function(){return v},wI:function(){return b},y:function(){return d},z2:function(){return I}});var l=r(86519),u=r(11655),c=r(78417),h=r(34488);let d=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(","),f=["[data-autofocus]"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(",");var p=((n=p||{})[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n[n.AutoFocus=64]="AutoFocus",n),m=((i=m||{})[i.Error=0]="Error",i[i.Overflow=1]="Overflow",i[i.Success=2]="Success",i[i.Underflow=3]="Underflow",i),g=((s=g||{})[s.Previous=-1]="Previous",s[s.Next=1]="Next",s);function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(d)).sort((e,t)=>
10Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var v=((o=v||{})[o.Strict=0]="Strict",o[o.Loose=1]="Loose",o);function w(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e!==(null==(t=(0,h.r3)(e))?void 0:t.body)&&(0,c.E)(r,{0:()=>e.matches(d),1(){let t=e;for(;null!==t;){if(t.matches(d))return!0;t=t.parentElement}return!1}})}function b(e){(0,l.k)().nextFrame(()=>{let t=(0,h.vY)(e);t&&u.sP(t)&&!w(t,0)&&E(e)})}var _=((a=_||{})[a.Keyboard=0]="Keyboard",a[a.Mouse=1]="Mouse",a);function E(e){null==e||e.focus({preventScroll:!0})}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return e.slice().sort((e,r)=>{let n=t(e),i=t(r);if(null===n||null===i)return 0;let s=n.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function T(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null===e?document.body:(0,h.k3)(e);return S(y(r),t,{relativeTo:e})}function S(e,t){var r,n,i;let{sorted:s=!0,relativeTo:o=null,skipElements:a=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=Array.isArray(e)?e.length>0?(0,h.k3)(e[0]):document:(0,h.k3)(e),u=Array.isArray(e)?s?I(e):e:64&t?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(f)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):y(e);a.length>0&&u.length>1&&(u=u.filter(e=>!a.some(t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))),o=null!=o?o:null==l?void 0:l.activeElement;let c=(()=>{if(5&t)return 1;if(10&t)return -1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,u.indexOf(o))-1;if(4&t)return Math.max(0,u.indexOf(o))+1;if(8&t)return u.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=32&t?{preventScroll:!0}:{},m=0,g=u.length,v;do{if(m>=g||m+g<=0)return 0;let e=d+m;if(16&t)e=(e+g)%g;else{if(e<0)return 3;if(e>=g)return 1}null==(v=u[e])||v.focus(p),m+=c}while(v!==(0,h.vY)(v));return 6&t&&null!=(i=null==(n=null==(r=v)?void 0:r.matches)?void 0:n.call(r,"textarea,input"))&&i&&v.select(),2}"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0))},78417:function(e,t,r){"use strict";function n(e,t){for(var r=arguments.length,i=Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(e in t){let r=t[e];return"function"==typeof r?r(...i):r}let o=Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map(e=>'"'.concat(e,'"')).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(o,n),o}r.d(t,{E:function(){return n}})},62325:function(e,t,r){"use strict";function n(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}r.d(t,{Y:function(){return n}})},34488:function(e,t,r){"use strict";r.d(t,{H9:function(){return a},k3:function(){return s},r3:function(){return i},vY:function(){return o}});var n=r(60210);function i(e){var t;return n.O.isServer?null:null==e?document:null!=(t=null==e?void 0:e.ownerDocument)?t:document}function s(e){var t,r;return n.O.isServer?null:null==e?document:null!=(r=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))?r:document}function o(e){var t,r;return null!=(r=null==(t=s(e))?void 0:t.activeElement)?r:null}function a(e){return o(e)===e}},37625:function(e,t,r){"use strict";function n(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function i(){return n()||/Android/gi.test(window.navigator.userAgent)}r.d(t,{gn:function(){return n},tq:function(){return i}})},78116:function(e,t,r){"use strict";let n,i;r.d(t,{L6:function(){return c},M2:function(){return v},VN:function(){return l},dG:function(){return p},l4:function(){return u},oA:function(){return g},yV:function(){return m}});var s=r(2784),o=r(22725),a=r(78417),l=((n=l||{})[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n),u=((i=u||{})[i.Unmount=0]="Unmount",i[i.Hidden=1]="Hidden",i);function c(){let e,t;let r=(e=(0,s.useRef)([]),t=(0,s.useCallback)(t=>{for(let r of e.current)null!=r&&("function"==typeof r?r(t):r.current=t)},[]),function(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];if(!n.every(e=>null==e))return e.current=n,t});return(0,s.useCallback)(e=>(function(e){let{ourProps:t,theirProps:r,slot:n,defaultTag:i,features:s,visible:o=!0,name:l,mergeRefs:u}=e;u=null!=u?u:d;let c=f(r,t);if(o)return h(c,n,i,l,u);let p=null!=s?s:0;if(2&p){let{static:e=!1,...t}=c;if(e)return h(t,n,i,l,u)}if(1&p){let{unmount:e=!0,...t}=c;return(0,a.E)(e?0:1,{0:()=>null,1:()=>h({...t,hidden:!0,style:{display:"none"}},n,i,l,u)})}return h(c,n,i,l,u)})({mergeRefs:r,...e}),[r])}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,{as:a=r,children:l,refName:u="ref",...c}=y(e,["unmount","static"]),h=void 0!==e.ref?{[u]:e.ref}:{},d="function"==typeof l?l(t):l;d=function e(t){if(null!=t&&t.$$typeof===Symbol.for("react.lazy")){let r=t._payload;if(null!=r&&"fulfilled"===r.status)return e(r.value)}return t}(d),"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let p={};if(t){let e=!1,r=[];for(let[n,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&r.push(n.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase())));if(e)for(let e of(p["data-headlessui-state"]=r.join(" "),r))p["data-".concat(e)
10]=""}if(v(a)&&(Object.keys(g(c)).length>0||Object.keys(g(p)).length>0)){if(!(0,s.isValidElement)(d)||Array.isArray(d)&&d.length>1||v(d.type)){if(Object.keys(g(c)).length>0)throw Error(['Passing props on "Fragment"!',"","The current component <".concat(n,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(g(c)).concat(Object.keys(g(p))).map(e=>"  - ".concat(e)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>"  - ".concat(e)).join("\n")].join("\n"))}else{var m;let e=d.props,t=null==e?void 0:e.className,r="function"==typeof t?function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,o.A)(t(...r),c.className)}:(0,o.A)(t,c.className),n=f(d.props,g(y(c,["ref"])));for(let e in p)e in n&&delete p[e];return(0,s.cloneElement)(d,Object.assign({},n,p,h,{ref:i((m=d,s.version.split(".")[0]>="19"?m.props.ref:m.ref),h.ref)},r?{className:r}:{}))}}return(0,s.createElement)(a,Object.assign({},y(c,["ref"]),!v(a)&&h,!v(a)&&p),d)}function d(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.every(e=>null==e)?void 0:e=>{for(let r of t)null!=r&&("function"==typeof r?r(e):r.current=e)}}function f(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(0===t.length)return{};if(1===t.length)return t[0];let n={},i={};for(let e of t)for(let t in e)t.startsWith("on")&&"function"==typeof e[t]?(null!=i[t]||(i[t]=[]),i[t].push(e[t])):n[t]=e[t];if(n.disabled||n["aria-disabled"])for(let e in i)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(i[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in i)Object.assign(n,{[e](t){for(var r=arguments.length,n=Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];for(let r of i[e]){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;r(t,...n)}}});return n}function p(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(0===t.length)return{};if(1===t.length)return t[0];let n={},i={};for(let e of t)for(let t in e)t.startsWith("on")&&"function"==typeof e[t]?(null!=i[t]||(i[t]=[]),i[t].push(e[t])):n[t]=e[t];for(let e in i)Object.assign(n,{[e](){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(let t of i[e])null==t||t(...r)}});return n}function m(e){var t;return Object.assign((0,s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function g(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e);for(let e of t)e in r&&delete r[e];return r}function v(e){return e===s.Fragment||e===Symbol.for("react.fragment")}},48950:function(e,t,r){"use strict";r.d(t,{w_:function(){return c}});var n=r(2784),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},s=n.createContext&&n.createContext(i),o=["attr","size","title"];function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){var n,i;n=t,i=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEac
10h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e){return t=>n.createElement(h,a({attr:u({},e.attr)},t),function e(t){return t&&t.map((t,r)=>n.createElement(t.tag,u({key:r},t.attr),e(t.child)))}(e.child))}function h(e){var t=t=>{var r,{attr:i,size:s,title:l}=e,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,o),h=s||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",a({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,c,{className:r,style:u(u({color:e.color||t.color},t.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),l&&n.createElement("title",null,l),e.children)};return void 0!==s?n.createElement(s.Consumer,null,e=>t(e)):t(i)}},56958:function(e,t,r){"use strict";r.d(t,{Am:function(){return v},x7:function(){return I}});var n=r(2784),i=r(28316);let s=e=>{switch(e){case"success":return l;case"info":return c;case"warning":return u;case"error":return h;default:return null}},o=Array(12).fill(0),a=({visible:e,className:t})=>n.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},n.createElement("div",{className:"sonner-spinner"},o.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),c=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),h=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),d=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),f=()=>{let[e,t]=n.useState(document.hidden);return n.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e},p=1;class m{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,i="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:p++,s=this.toasts.find(e=>e.id===i),o=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(t=>
10t.id===i?(this.publish({...t,...e,id:i,title:r}),{...t,...e,id:i,dismissible:o,title:r}):t):this.addToast({title:r,...n,dismissible:o,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r,i;if(!t)return;void 0!==t.loading&&(i=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let s=Promise.resolve(e instanceof Function?e():e),o=void 0!==i,a=s.then(async e=>{if(r=["resolve",e],n.isValidElement(e))o=!1,this.create({id:i,type:"default",message:e});else if(y(e)&&!e.ok){o=!1;let r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,s="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,a="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:i,type:"error",description:s,...a})}else if(e instanceof Error){o=!1;let r="function"==typeof t.error?await t.error(e):t.error,s="function"==typeof t.description?await t.description(e):t.description,a="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:i,type:"error",description:s,...a})}else if(void 0!==t.success){o=!1;let r="function"==typeof t.success?await t.success(e):t.success,s="function"==typeof t.description?await t.description(e):t.description,a="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:i,type:"success",description:s,...a})}}).catch(async e=>{if(r=["reject",e],void 0!==t.error){o=!1;let r="function"==typeof t.error?await t.error(e):t.error,s="function"==typeof t.description?await t.description(e):t.description,a="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:i,type:"error",description:s,...a})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),null==t.finally||t.finally.call(t)}),l=()=>new Promise((e,t)=>a.then(()=>"reject"===r[0]?t(r[1]):e(r[1])).catch(t));return"string"!=typeof i&&"number"!=typeof i?{unwrap:l}:Object.assign(i,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||p++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}let g=new m,y=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,v=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||p++;return g.addToast({title:e,...t,id:r}),r},{success:g.success,info:g.info,warning:g.warning,error:g.error,custom:g.custom,message:g.message,promise:g.promise,dismiss:g.dismiss,loading:g.loading},{getHistory:()=>g.toasts,getToasts:()=>g.getActiveToasts()});function w(e){return void 0!==e.label}function b(...e){return e.filter(Boolean).join(" ")}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}
vendor: 14,864 bytes, line 10
10("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
10let _=e=>{var t,r,i,o,l,u,c,h,p,m,g,y,v;let{invert:_,toast:E,unstyled:I,interacting:T,setHeights:S,visibleToasts:A,heights:C,index:P,toasts:R,expanded:k,removeToast:x,defaultRichColors:D,closeButton:N,style:O,cancelButtonStyle:M,actionButtonStyle:L,className:F="",descriptionClassName:V="",duration:U,position:B,gap:j,expandByDefault:H,classNames:z,icons:q,closeButtonAriaLabel:G="Close toast"}=e,[W,$]=n.useState(null),[K,Q]=n.useState(null),[Y,J]=n.useState(!1),[X,Z]=n.useState(!1),[ee,et]=n.useState(!1),[er,en]=n.useState(!1),[ei,es]=n.useState(!1),[eo,ea]=n.useState(0),[el,eu]=n.useState(0),ec=n.useRef(E.duration||U||4e3),eh=n.useRef(null),ed=n.useRef(null),ef=0===P,ep=P+1<=A,em=E.type,eg=!1!==E.dismissible,ey=E.className||"",ev=E.descriptionClassName||"",ew=n.useMemo(()=>C.findIndex(e=>e.toastId===E.id)||0,[C,E.id]),eb=n.useMemo(()=>{var e;return null!=(e=E.closeButton)?e:N},[E.closeButton,N]),e_=n.useMemo(()=>E.duration||U||4e3,[E.duration,U]),eE=n.useRef(0),eI=n.useRef(0),eT=n.useRef(0),eS=n.useRef(null),[eA,eC]=B.split("-"),eP=n.useMemo(()=>C.reduce((e,t,r)=>r>=ew?e:e+t.height,0),[C,ew]),eR=f(),ek=E.invert||_,ex="loading"===em;eI.current=n.useMemo(()=>ew*j+eP,[ew,eP]),n.useEffect(()=>{ec.current=e_},[e_]),n.useEffect(()=>{J(!0)},[]),n.useEffect(()=>{let e=ed.current;if(e){let t=e.getBoundingClientRect().height;return eu(t),S(e=>[{toastId:E.id,height:t,position:E.position},...e]),()=>S(e=>e.filter(e=>e.toastId!==E.id))}},[S,E.id]),n.useLayoutEffect(()=>{if(!Y)return;let e=ed.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,eu(r),S(e=>e.find(e=>e.toastId===E.id)?e.map(e=>e.toastId===E.id?{...e,height:r}:e):[{toastId:E.id,height:r,position:E.position},...e])},[Y,E.title,E.description,S,E.id,E.jsx,E.action,E.cancel]);let eD=n.useCallback(()=>{Z(!0),ea(eI.current),S(e=>e.filter(e=>e.toastId!==E.id)),setTimeout(()=>{x(E)},200)},[E,x,S,eI]);n.useEffect(()=>{let e;if((!E.promise||"loading"!==em)&&E.duration!==1/0&&"loading"!==E.type)return k||T||eR?(()=>{if(eT.current<eE.current){let e=new Date().getTime()-eE.current;ec.current=ec.current-e}eT.current=new Date().getTime()})():ec.current!==1/0&&(eE.current=new Date().getTime(),e=setTimeout(()=>{null==E.onAutoClose||E.onAutoClose.call(E,E),eD()},ec.current)),()=>clearTimeout(e)},[k,T,E,em,eR,eD]),n.useEffect(()=>{E.delete&&(eD(),null==E.onDismiss||E.onDismiss.call(E,E))},[eD,E.delete]);let eN=E.icon||(null==q?void 0:q[em])||s(em);return n.createElement("li",{tabIndex:0,ref:ed,className:b(F,ey,null==z?void 0:z.toast,null==E?void 0:null==(t=E.classNames)?void 0:t.toast,null==z?void 0:z.default,null==z?void 0:z[em],null==E?void 0:null==(r=E.classNames)?void 0:r[em]),"data-sonner-toast":"","data-rich-colors":null!=(m=E.richColors)?m:D,"data-styled":!(E.jsx||E.unstyled||I),"data-mounted":Y,"data-promise":!!E.promise,"data-swiped":ei,"data-removed":X,"data-visible":ep,"data-y-position":eA,"data-x-position":eC,"data-index":P,"data-front":ef,"data-swiping":ee,"data-dismissible":eg,"data-type":em,"data-invert":ek,"data-swipe-out":er,"data-swipe-direction":K,"data-expanded":!!(k||H&&Y),"data-testid":E.testId,style:{"--index":P,"--toasts-before":P,"--z-index":R.length-P,"--offset":`${X?eo:eI.current}px`,"--initial-height":H?"auto":`${el}px`,...O,...E.style},onDragEnd:()=>{et(!1),$(null),eS.current=null},onPointerDown:e=>{2!==e.button&&!ex&&eg&&(eh.current=new Date,ea(eI.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(et(!0),eS.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n,i;if(er||!eg)return;eS.current=null;let s=Number((null==(e=ed.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),o=Number((null==(t=ed.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),a=new Date().getTime()-(null==(r=eh.current)?void 0:r.getTime()),l="x"===W?s:o;if(Math.abs(l)>=45||Math.abs(l)/a>.11){ea(eI.current),null==E.onDismiss||E.onDismiss.call(E,E),"x"===W?Q(s>0?"right":"left"):Q(o>0?"down":"up"),eD(),en(!0);return}null==(n=ed.current)||n.style.setProperty("--swipe-amount-x","0px"),null==(i=ed.current)||i.style.setProperty("--swipe-amount-y","0px"),es(!1),et(!1),$(null)},onPointerMove:t=>{var r,n,i,s;if(!eS.current||!eg||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let o=t.clientY-eS.current.y,a=t.clientX-eS.current.x,l=null!=(s=e.swipeDirections)?s:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(B);!W&&(Math.abs(a)>1||Math.abs(o)>1)&&$(Math.abs(a)>Math.abs(o)?"x":"y");let u={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if("y"===W){if(l.includes("top")||l.includes("bottom")){if(l.includes("top")&&o<0||l.includes("bottom")&&o>0)u.y=o;else{let e=o*c(o);u.y=Math.abs(e)<Math.abs(o)?e:o}}}else if("x"===W&&(l.includes("left")||l.includes("right"))){if(l.includes("left")&&a<0||l.includes("right")&&a>0)u.x=a;else{let e=a*c(a);u.x=Math.abs(e)<Math.abs(a)?e:a}}(Math.abs(u.x)>0||Math.abs(u.y)>0)&&es(!0),null==(n=ed.current)||n.style.setProperty("--swipe-amount-x",`${u.x}px`),null==(i=ed.current)||i.style.setProperty("--swipe-amount-y",`${u.y}px`)}},eb&&!E.jsx&&"loading"!==em?n.createElement("button",{"aria-label":G,"data-disabled":ex,"data-close-button":!0,onClick:ex||!eg?()=>{}:()=>{eD(),null==E.onDismiss||E.onDismiss.call(E,E)},className:b(null==z?void 0:z.closeButton,null==E?void 0:null==(i=E.classNames)?void 0:i.closeButton)},null!=(g=null==q?void 0:q.close)?g:d):null,(em||E.icon||E.promise)&&null!==E.icon&&((null==q?void 0:q[em])!==null||E.icon)?n.createElement("div",{"data-icon":"",className:b(null==z?void 0:z.icon,null==E?void 0:null==(o=E.classNames)?void 0:o.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||((null==q?void 0:q.loading)?n.createElement("div",{className:b(null==z?void 0:z.loader,null==E?void 0:null==(v=E.classNames)?void 0:v.loader,"sonner-loader"),"data-visible":"loading"===em},q.loading):n.createElement(a,{className:b(null==z?void 0:z.loader,null==E?void 0:null==(y=E.classNames)?void 0:y.loader),visible:"loading"===em})):null,"loading"!==E.type?eN:null):null,n.createElement("div",{"data-content":"",className:b(null==z?void 0:z.content,null==E?void 0:null==(l=E.classNames)?void 0:l.content)},n.createElement("div",{"data-title":"",className:b(null==z?void 0:z.title,null==E?void 0:null==(u=E.classNames)?void 0:u.title)},E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title),E.description?n.createElement("div",{"data-description":"",className:b(V,ev,null==z?void 0:z.description,null==E?void 0:null==(c=E.classNames)?void 0:c.description)},"function"==typeof E.description?E.description():E.description):null),n.isValidElement(E.cancel)?E.cancel:E.cancel&&w(E.cancel)?n.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||M,onClick:e=>{w(E.cancel)&&eg&&(null==E.cancel.onClick||E.cancel.onClick.call(E.cancel,e),eD())},className:b(null==z?void 0:z.cancelButton,null==E?void 0:null==(h=E.classNames)?void 0:h.cancelButton)},E.cancel.label):null,n.isValidElement(E.action)?E.action:E.action&&w(E.action)?n.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||L,onClick:e=>{w(E.action)&&(null==E.action.onClick||E.action.onClick.call(E.action,e),e.defaultPrevented||eD())},className:b(null==z?void 0:z.actionButton,null==E?void 0:null==(p=E.classNames)?void 0:p.actionButton)},E.action.label):null)};
10function E(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}let I=n.forwardRef(function(e,t){let{id:r,invert:s,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:l,closeButton:u,className:c,offset:h,mobileOffset:d,theme:f="light",richColors:p,duration:m,style:y,visibleToasts:v=3,toastOptions:w,dir:b=E(),gap:I=14,icons:T,containerAriaLabel:S="Notifications"}=e,[A,C]=n.useState([]),P=n.useMemo(()=>r?A.filter(e=>e.toasterId===r):A.filter(e=>!e.toasterId),[A,r]),R=n.useMemo(()=>Array.from(new Set([o].concat(P.filter(e=>e.position).map(e=>e.position)))),[P,o]),[k,x]=n.useState([]),[D,N]=n.useState(!1),[O,M]=n.useState(!1),[L,F]=n.useState("system"!==f?f:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=n.useRef(null),U=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=n.useRef(null),j=n.useRef(!1),H=n.useCallback(e=>{C(t=>{var r;return(null==(r=t.find(t=>t.id===e.id))?void 0:r.delete)||g.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return n.useEffect(()=>g.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{i.flushSync(()=>{C(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[A]),n.useEffect(()=>{if("system"!==f){F(f);return}if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{e?F("dark"):F("light")})}catch(t){e.addListener(({matches:e})=>{try{e?F("dark"):F("light")}catch(e){console.error(e)}})}},[f]),n.useEffect(()=>{A.length<=1&&N(!1)},[A]),n.useEffect(()=>{let e=e=>{var t,r;a.every(t=>e[t]||e.code===t)&&(N(!0),null==(r=V.current)||r.focus()),"Escape"===e.code&&(document.activeElement===V.current||(null==(t=V.current)?void 0:t.contains(document.activeElement)))&&N(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),n.useEffect(()=>{if(V.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,j.current=!1)}},[V.current]),n.createElement("section",{ref:t,"aria-label":`${S} ${U}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((t,r)=>{var i;let[o,a]=t.split("-");return P.length?n.createElement("ol",{key:t,dir:"auto"===b?E():b,tabIndex:-1,ref:V,className:c,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":o,"data-x-position":a,style:{"--front-toast-height":`${(null==(i=k[0])?void 0:i.height)||0}px`,"--width":"356px","--gap":`${I}px`,...y,...function(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,i=n?"--mobile-offset":"--offset",s=n?"16px":"24px";function o(e){["top","right","bottom","left"].forEach(t=>{r[`${i}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?o(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${i}-${t}`]=s:r[`${i}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):o(s)}),r}(h,d)},onBlur:e=>{j.current&&!e.currentTarget.contains(e.relatedTarget)&&(j.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||j.current||(j.current=!0,B.current=e.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{O||N(!1)},onDragEnd:()=>N(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||M(!0)},onPointerUp:()=>M(!1)},P.filter(e=>!e.position&&0===r||e.position===t).map((r,i)=>{var o,a;return n.createElement(_,{key:r.id,icons:T,index:i,toast:r,defaultRichColors:p,duration:null!=(o=null==w?void 0:w.duration)?o:m,className:null==w?void 0:w.className,descriptionClassName:null==w?void 0:w.descriptionClassName,invert:s,visibleToasts:v,closeButton:null!=(a=null==w?void 0:w.closeButton)?a:u,interacting:O,position:t,style:null==w?void 0:w.style,unstyled:null==w?void 0:w.unstyled,classNames:null==w?void 0:w.classNames,cancelButtonStyle:null==w?void 0:w.cancelButtonStyle,actionButtonStyle:null==w?void 0:w.actionButtonStyle,closeButtonAriaLabel:null==w?void 0:w.closeButtonAriaLabel,removeToast:H,toasts:P.filter(e=>e.position==r.position),heights:k.filter(e=>e.position==r.position),setHeights:x,expandByDefault:l,gap:I,expanded:D,swipeDirections:e.swipeDirections})})):null}))})},22970:function(e,t,r){"use strict";r.d(t,{ZT:function(){return i},_T:function(){return o},ev:function(){return a},pi:function(){return s}});
10var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError},43841:function(e,t,r){"use strict";r.d(t,{U:function(){return l}});var n=r(2784);let i=e=>{let t;let r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>o,subscribe:e=>(r.add(e),()=>r.delete(e))},o=t=e(n,i,s);return s},s=e=>e?i(e):i,o=e=>e,a=e=>{let t=s(e),r=e=>(function(e,t=o){let r=n.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return n.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},l=e=>e?a(e):a}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],function(){return t(86570),t(70743)}),_N_E=e.O()}]);

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.