(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{74444:function(e,t,r){"use strict";r.d(t,{$s:function(){return $},BH:function(){return w},L:function(){return u},LL:function(){return R},P0:function(){return g},Pz:function(){return v},Sg:function(){return b},UG:function(){return T},ZR:function(){return O},aH:function(){return y},b$:function(){return I},eu:function(){return A},hl:function(){return C},m9:function(){return q},ne:function(){return j},pd:function(){return F},q4:function(){return m},ru:function(){return S},tV:function(){return c},uI:function(){return E},vZ:function(){return 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],a=r[s];if(P(n)&&P(a)){if(!e(n,a))return!1}else if(n!==a)return!1}for(let e of i)if(!n.includes(e))return!1;return!0}},w1:function(){return k},xO:function(){return M},xb:function(){return D},z$:function(){return _},zI:function(){return x},zd:function(){return L}});var n=r(83454);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let i=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},s=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=e[r++],a=e[r++],o=e[r++],l=((7&i)<<18|(63&s)<<12|(63&a)<<6|63&o)-65536;t[n++]=String.fromCharCode(55296+(l>>10)),t[n++]=String.fromCharCode(56320+(1023&l))}else{let s=e[r++],a=e[r++];t[n++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}}return t.join("")},a={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,a=s?e[t+1]:0,o=t+2<e.length,l=o?e[t+2]:0,u=i>>2,c=(3&i)<<4|a>>4,h=(15&a)<<2|l>>6,d=63&l;o||(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(i(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):s(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,a=s?r[e.charAt(t)]:0;++t;let l=t<e.length,u=l?r[e.charAt(t)]:64;++t;let c=t<e.length,h=c?r[e.charAt(t)]:64;if(++t,null==i||null==a||null==u||null==h)throw new o;let d=i<<2|a>>4;if(n.push(d),64!==u){let e=a<<4&240|u>>2;if(n.push(e),64!==h){let e=u<<6&192|h;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)}}};class o extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let l=function(e){let t=i(e);return a.encodeByteArray(t,!0)},u=function(e){return l(e).replace(/\./g,"")},c=function(e){try{return a.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},h=()=>/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(function(){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.")})().__FIREBASE_DEFAULTS__,d=()=>{if(void 0===n||void 0===n.env)return;let e=n.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},f=()=>{let e;if("undefined"==typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&c(e[1]);return t&&JSON.parse(t)},p=()=>{try{return h()||d()||f()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},m=e=>{var t,r;return null===(r=null===(t=p())||void 0===t?void 0:t.emulatorHosts)||void 0===r?void 0:r[e]},g=e=>{let t=m(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]},y=()=>{var e;return null===(e=p())||void 0===e?void 0:e.config},v=e=>{var t;return null===(t=p())||void 0===t?void 0:t[`_${e}`]};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class w{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function b(e,t){if(e.uid)throw Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let r=t||"demo-project",n=e.iat||0,i=e.sub||e.user_id;if(!i)throw Error("mockUserToken must contain 'sub' or 'user_id' field!");let s=Object.assign({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[u(JSON.stringify({alg:"none",type:"JWT"})),u(JSON.stringify(s)),""].join(".")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function E(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(_())}function T(){var e;let t=null===(e=p())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(r.g.process)}catch(e){return!1}}function S(){let e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function I(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function k(){let e=_();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function C(){try{return"object"==typeof indexedDB}catch(e){return!1}}function A(){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=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})}function x(){return"undefined"!=typeof navigator&&!!navigator.cookieEnabled}class O extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,O.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,R.prototype.create)}}class R{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(N,(e,t)=>{let n=r[t];return null!=n?String(n):`<${t}?>`}):"Error",a=`${this.serviceName}: ${s} (${n}).`,o=new O(n,a,r);return o}}let N=/\{\$([^}]+)}/g;function D(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function P(e){return null!==e&&"object"==typeof e}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function M(e){let t=[];for(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("&"):""}function L(e){let t={},r=e.replace(/^\?/,"").split("&");return r.forEach(e=>{if(e){let[r,n]=e.split("=");t[decodeURIComponent(r)]=decodeURIComponent(n)}}),t}function F(e){let t=e.indexOf("?");if(!t)return"";let r=e.indexOf("#",t);return e.substring(t,r>0?r:void 0)}function j(e,t){let r=new U(e,t);return r.subscribe.bind(r)}class U{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let 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=V),void 0===n.error&&(n.error=V),void 0===n.complete&&(n.complete=V);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 V(){}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))}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function q(e){return e&&e._delegate?e._delegate:e}},19477:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(85893),i=r(67294);t.default=function({html:e,height:t=null,width:r=null,children:s,dataNtpc:a=""}){return(0,i.useEffect)(()=>{a&&performance.mark("mark_feature_usage",{detail:{feature:`next-third-parties-${a}`}})},[a]),(0,n.jsxs)(n.Fragment,{children:[s,e?(0,n.jsx)("div",{style:{height:null!=t?`${t}px`:"auto",width:null!=r?`${r}px`:"auto"},"data-ntpc":a,dangerouslySetInnerHTML:{__html:e}}):null]})}},7834:function(e,t,r){"use strict";let n;var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sendGAEvent=t.GoogleAnalytics=void 0;let s=r(85893),a=r(67294),o=i(r(4298));t.GoogleAnalytics=function(e){let{gaId:t,dataLayerName:r="dataLayer"}=e;return void 0===n&&(n=r),(0,a.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-ga"}})},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.default,{id:"_next-ga-init",dangerouslySetInnerHTML:{__html:`
          window['${r}'] = window['${r}'] || [];
          function gtag(){window['${r}'].push(arguments);}
          gtag('js', new Date());

          gtag('config', '${t}');`}}),(0,s.jsx)(o.default,{id:"_next-ga",src:`https://www.googletagmanager.com/gtag/js?id=${t}`})]})},t.sendGAEvent=(...e)=>{if(void 0===n){console.warn("@next/third-parties: GA has not been initialized");return}window[n]?window[n].push(...e):console.warn(`@next/third-parties: GA dataLayer ${n} does not exist`)}},83632:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let i=r(85893),s=r(86257),a=n(r(19477));t.default=function(e){let{apiKey:t,...r}=e,n={...r,key:t},{html:o}=(0,s.GoogleMapsEmbed)(n);return(0,i.jsx)(a.default,{height:n.height||null,width:n.width||null,html:o,dataNtpc:"GoogleMapsEmbed"})}},30674:function(e,t,r){"use strict";let n;var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sendGTMEvent=t.GoogleTagManager=void 0;let s=r(85893),a=r(67294),o=i(r(4298));t.GoogleTagManager=function(e){let{gtmId:t,dataLayerName:r="dataLayer",auth:i,preview:l,dataLayer:u}=e;void 0===n&&(n=r);let c="dataLayer"!==r?`$l=${r}`:"",h=i?`&gtm_auth=${i}`:"",d=l?`&gtm_preview=${l}&gtm_cookies_win=x`:"";return(0,a.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-gtm"}})},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.default,{id:"_next-gtm-init",dangerouslySetInnerHTML:{__html:`
      (function(w,l){
        w[l]=w[l]||[];
        w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
        ${u?`w[l].push(${JSON.stringify(u)})`:""}
      })(window,'${r}');`}}),(0,s.jsx)(o.default,{id:"_next-gtm","data-ntpc":"GTM",src:`https://www.googletagmanager.com/gtm.js?id=${t}${c}${h}${d}`})]})},t.sendGTMEvent=e=>{if(void 0===n){console.warn("@next/third-parties: GTM has not been initialized");return}window[n]?window[n].push(e):console.warn(`@next/third-parties: GTM dataLayer ${n} does not exist`)}},19692:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sendGAEvent=t.GoogleAnalytics=t.sendGTMEvent=t.GoogleTagManager=t.YouTubeEmbed=t.GoogleMapsEmbed=void 0;var i=r(83632);Object.defineProperty(t,"GoogleMapsEmbed",{enumerable:!0,get:function(){return n(i).default}});var s=r(11494);Object.defineProperty(t,"YouTubeEmbed",{enumerable:!0,get:function(){return n(s).default}});var a=r(30674);Object.defineProperty(t,"GoogleTagManager",{enumerable:!0,get:function(){return a.GoogleTagManager}}),Object.defineProperty(t,"sendGTMEvent",{enumerable:!0,get:function(){return a.sendGTMEvent}});var o=r(7834);Object.defineProperty(t,"GoogleAnalytics",{enumerable:!0,get:function(){return o.GoogleAnalytics}}),Object.defineProperty(t,"sendGAEvent",{enumerable:!0,get:function(){return o.sendGAEvent}})},11494:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let i=r(85893),s=n(r(4298)),a=r(86257),o=n(r(19477)),l={server:"beforeInteractive",client:"afterInteractive",idle:"lazyOnload",worker:"worker"};t.default=function(e){let{html:t,scripts:r,stylesheets:n}=(0,a.YouTubeEmbed)(e);return(0,i.jsx)(o.default,{height:e.height||null,width:e.width||null,html:t,dataNtpc:"YouTubeEmbed",children:null==r?void 0:r.map(e=>(0,i.jsx)(s.default,{src:e.url,strategy:l[e.strategy],stylesheets:n},e.url))})}},86664:function(e,t,r){!function(e,t){"use strict";function r(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 n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=i){var s=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(s.push(r.value),!t||s.length!==t);a=!0);}catch(e){o=!0,n=e}finally{try{a||null==i.return||i.return()}finally{if(o)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(){}function u(){}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,u.resetWarningCache=l;var c,h,d=(c=h={exports:{}},h.exports,c.exports=function(){function e(e,t,r,n,i,s){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==s){var a=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:u,resetWarningCache:l};return r.PropTypes=r,r}(),h.exports),f=function(e){var r=t.useRef(e);return t.useEffect(function(){r.current=e},[e]),r.current},p=function(e){return null!==e&&"object"===i(e)},m="[object Object]",g=function e(t,r){if(!p(t)||!p(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var i=Object.prototype.toString.call(t)===m;if(i!==(Object.prototype.toString.call(r)===m))return!1;if(!i&&!n)return t===r;var s=Object.keys(t),a=Object.keys(r);if(s.length!==a.length)return!1;for(var o={},l=0;l<s.length;l+=1)o[s[l]]=!0;for(var u=0;u<a.length;u+=1)o[a[u]]=!0;var c=Object.keys(o);return c.length===s.length&&c.every(function(n){return e(t[n],r[n])})},y=function(e,t,r){return p(e)?Object.keys(e).reduce(function(i,a){var o=!p(t)||!g(e[a],t[a]);return r.includes(a)?(o&&console.warn("Unsupported prop change: options.".concat(a," is not a mutable property.")),i):o?n(n({},i||{}),{},s({},a,e[a])):i},null):null},v="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;if(null===e||p(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;if(p(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return w(e,t)})};var r=w(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},_=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"2.3.0"}),e.registerAppInfo({name:"react-stripe-js",version:"2.3.0",url:"https://stripe.com/docs/stripe-js/react"}))},E=["on","session"],T=t.createContext(null);T.displayName="CustomCheckoutSdkContext";var S=function(e,t){if(!e)throw Error("Could not find CustomCheckoutProvider context; You need to wrap the part of your app that ".concat(t," in an <CustomCheckoutProvider> provider."));return e},I=t.createContext(null);I.displayName="CustomCheckoutContext";var k=function(e,t){if(!e)return null;e.on,e.session;var r=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,E);return t?n(n({},r),t):n(n({},r),e.session())},C=function(e){var r=e.stripe,n=e.options,i=e.children,s=t.useMemo(function(){return b(r,"Invalid prop `stripe` supplied to `CustomCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},[r]),o=a(t.useState(null),2),l=o[0],u=o[1],c=a(t.useState(function(){return{stripe:"sync"===s.tag?s.stripe:null,customCheckoutSdk:null}}),2),h=c[0],d=c[1],m=function(e,t){d(function(r){return r.stripe&&r.customCheckoutSdk?r:{stripe:e,customCheckoutSdk:t}})},y=t.useRef(!1);t.useEffect(function(){var e=!0;return"async"!==s.tag||h.stripe?"sync"===s.tag&&s.stripe&&!y.current&&(y.current=!0,s.stripe.initCustomCheckout(n).then(function(e){e&&(m(s.stripe,e),e.on("change",u))})):s.stripePromise.then(function(t){t&&e&&!y.current&&(y.current=!0,t.initCustomCheckout(n).then(function(e){e&&(m(t,e),e.on("change",u))}))}),function(){e=!1}},[s,h,n,u]);var v=f(r);t.useEffect(function(){null!==v&&v!==r&&console.warn("Unsupported prop change on CustomCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[v,r]);var w=f(n);t.useEffect(function(){if(h.customCheckoutSdk){!n.clientSecret||p(w)||g(n.clientSecret,w.clientSecret)||console.warn("Unsupported prop change: options.client_secret is not a mutable property.");var e,t,r=null==w?void 0:null===(e=w.elementsOptions)||void 0===e?void 0:e.appearance,i=null==n?void 0:null===(t=n.elementsOptions)||void 0===t?void 0:t.appearance;i&&!g(i,r)&&h.customCheckoutSdk.changeAppearance(i)}},[n,w,h.customCheckoutSdk]),t.useEffect(function(){_(h.stripe)},[h.stripe]);var E=t.useMemo(function(){return k(h.customCheckoutSdk,l)},[h.customCheckoutSdk,l]);return h.customCheckoutSdk?t.createElement(T.Provider,{value:h},t.createElement(I.Provider,{value:E},i)):null};C.propTypes={stripe:d.any,options:d.shape({clientSecret:d.string.isRequired,elementsOptions:d.object}).isRequired};var A=function(e){var r=t.useContext(T),n=t.useContext(x);if(r&&n)throw Error("You cannot wrap the part of your app that ".concat(e," in both <CustomCheckoutProvider> and <Elements> providers."));return r?S(r,e):O(n,e)},x=t.createContext(null);x.displayName="ElementsContext";var O=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},R=t.createContext(null);R.displayName="CartElementContext";var N=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},D=function(e){var r=e.stripe,n=e.options,i=e.children,s=t.useMemo(function(){return b(r)},[r]),o=a(t.useState(null),2),l=o[0],u=o[1],c=a(t.useState(null),2),h=c[0],d=c[1],p=a(t.useState(function(){return{stripe:"sync"===s.tag?s.stripe:null,elements:"sync"===s.tag?s.stripe.elements(n):null}}),2),m=p[0],g=p[1];t.useEffect(function(){var e=!0,t=function(e){g(function(t){return t.stripe?t:{stripe:e,elements:e.elements(n)}})};return"async"!==s.tag||m.stripe?"sync"!==s.tag||m.stripe||t(s.stripe):s.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[s,m,n]);var v=f(r);t.useEffect(function(){null!==v&&v!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[v,r]);var w=f(n);return t.useEffect(function(){if(m.elements){var e=y(n,w,["clientSecret","fonts"]);e&&m.elements.update(e)}},[n,w,m.elements]),t.useEffect(function(){_(m.stripe)},[m.stripe]),t.createElement(x.Provider,{value:m},t.createElement(R.Provider,{value:{cart:l,setCart:u,cartState:h,setCartState:d}},i))};D.propTypes={stripe:d.any,options:d.object};var P=function(e){return O(t.useContext(x),e)},M={cart:null,cartState:null,setCart:function(){},setCartState:function(){}},L=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.useContext(R);return r?M:N(n,e)},F=function(e){return(0,e.children)(P("mounts <ElementsConsumer>"))};F.propTypes={children:d.func.isRequired};var j=function(e,r,n){var i=!!n,s=t.useRef(n);t.useEffect(function(){s.current=n},[n]),t.useEffect(function(){if(!i||!e)return function(){};var t=function(){s.current&&s.current.apply(s,arguments)};return e.on(r,t),function(){e.off(r,t)}},[i,r,e,s])},U=function(e,r){var n="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),i=r?function(e){var r=A("mounts <".concat(n,">"));L("mounts <".concat(n,">"),"customCheckoutSdk"in r);var i=e.id,s=e.className;return t.createElement("div",{id:i,className:s})}:function(r){var i,s=r.id,o=r.className,l=r.options,u=void 0===l?{}:l,c=r.onBlur,h=r.onFocus,d=r.onReady,p=r.onChange,m=r.onEscape,g=r.onClick,v=r.onLoadError,w=r.onLoaderStart,b=r.onNetworksChange,_=r.onCheckout,E=r.onLineItemClick,T=r.onConfirm,S=r.onCancel,I=r.onShippingAddressChange,k=r.onShippingRateChange,C=A("mounts <".concat(n,">")),x="elements"in C?C.elements:null,O="customCheckoutSdk"in C?C.customCheckoutSdk:null,R=a(t.useState(null),2),N=R[0],D=R[1],P=t.useRef(null),M=t.useRef(null),F=L("mounts <".concat(n,">"),"customCheckoutSdk"in C),U=F.setCart,V=F.setCartState;j(N,"blur",c),j(N,"focus",h),j(N,"escape",m),j(N,"click",g),j(N,"loaderror",v),j(N,"loaderstart",w),j(N,"networkschange",b),j(N,"lineitemclick",E),j(N,"confirm",T),j(N,"cancel",S),j(N,"shippingaddresschange",I),j(N,"shippingratechange",k),"cart"===e?i=function(e){V(e),d&&d(e)}:d&&(i="expressCheckout"===e?d:function(){d(N)}),j(N,"ready",i),j(N,"change","cart"===e?function(e){V(e),p&&p(e)}:p),j(N,"checkout","cart"===e?function(e){V(e),_&&_(e)}:_),t.useLayoutEffect(function(){if(null===P.current&&null!==M.current&&(x||O)){var t=null;O?t=O.createElement(e,u):x&&(t=x.create(e,u)),"cart"===e&&U&&U(t),P.current=t,D(t),t&&t.mount(M.current)}},[x,O,u,U]);var $=f(u);return t.useEffect(function(){if(P.current){var e=y(u,$,["paymentRequest"]);e&&P.current.update(e)}},[u,$]),t.useLayoutEffect(function(){return function(){if(P.current&&"function"==typeof P.current.destroy)try{P.current.destroy(),P.current=null}catch(e){}}},[]),t.createElement("div",{id:s,className:o,ref:M})};return i.propTypes={id:d.string,className:d.string,onChange:d.func,onBlur:d.func,onFocus:d.func,onReady:d.func,onEscape:d.func,onClick:d.func,onLoadError:d.func,onLoaderStart:d.func,onNetworksChange:d.func,onCheckout:d.func,onLineItemClick:d.func,onConfirm:d.func,onCancel:d.func,onShippingAddressChange:d.func,onShippingRateChange:d.func,options:d.object},i.displayName=n,i.__elementType=e,i},V="undefined"==typeof window,$=t.createContext(null);$.displayName="EmbeddedCheckoutProviderContext";var q=function(){var e=t.useContext($);if(!e)throw Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return e},z=V?function(e){var r=e.id,n=e.className;return q(),t.createElement("div",{id:r,className:n})}:function(e){var r=e.id,n=e.className,i=q().embeddedCheckout,s=t.useRef(!1),a=t.useRef(null);return t.useLayoutEffect(function(){return!s.current&&i&&null!==a.current&&(i.mount(a.current),s.current=!0),function(){s.current&&i&&(i.unmount(),s.current=!1)}},[i]),t.createElement("div",{ref:a,id:r,className:n})},B=U("auBankAccount",V),H=U("card",V),K=U("cardNumber",V),G=U("cardExpiry",V),W=U("cardCvc",V),Q=U("fpxBank",V),J=U("iban",V),Y=U("idealBank",V),X=U("p24Bank",V),Z=U("epsBank",V),ee=U("payment",V),et=U("expressCheckout",V),er=U("paymentRequestButton",V),en=U("linkAuthentication",V),ei=U("address",V),es=U("shippingAddress",V),ea=U("cart",V),eo=U("paymentMethodMessaging",V),el=U("affirmMessage",V),eu=U("afterpayClearpayMessage",V);e.AddressElement=ei,e.AffirmMessageElement=el,e.AfterpayClearpayMessageElement=eu,e.AuBankAccountElement=B,e.CardCvcElement=W,e.CardElement=H,e.CardExpiryElement=G,e.CardNumberElement=K,e.CartElement=ea,e.CustomCheckoutProvider=C,e.Elements=D,e.ElementsConsumer=F,e.EmbeddedCheckout=z,e.EmbeddedCheckoutProvider=function(e){var r=e.stripe,n=e.options,i=e.children,s=t.useMemo(function(){return b(r,"Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},[r]),o=t.useRef(null),l=t.useRef(null),u=a(t.useState({embeddedCheckout:null}),2),c=u[0],h=u[1];t.useEffect(function(){if(!l.current&&!o.current){var e=function(e){l.current||o.current||(l.current=e,o.current=l.current.initEmbeddedCheckout(n).then(function(e){h({embeddedCheckout:e})}))};"async"===s.tag&&!l.current&&n.clientSecret?s.stripePromise.then(function(t){t&&e(t)}):"sync"===s.tag&&!l.current&&n.clientSecret&&e(s.stripe)}},[s,n,c,l]),t.useEffect(function(){return function(){c.embeddedCheckout?(o.current=null,c.embeddedCheckout.destroy()):o.current&&o.current.then(function(){o.current=null,c.embeddedCheckout&&c.embeddedCheckout.destroy()})}},[c.embeddedCheckout]),t.useEffect(function(){_(l)},[l]);var d=f(r);t.useEffect(function(){null!==d&&d!==r&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[d,r]);var p=f(n);return t.useEffect(function(){if(null!=p){if(null==n){console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");return}null!=p.clientSecret&&n.clientSecret!==p.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=p.onComplete&&n.onComplete!==p.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it.")}},[p,n]),t.createElement($.Provider,{value:c},i)},e.EpsBankElement=Z,e.ExpressCheckoutElement=et,e.FpxBankElement=Q,e.IbanElement=J,e.IdealBankElement=Y,e.LinkAuthenticationElement=en,e.P24BankElement=X,e.PaymentElement=ee,e.PaymentMethodMessagingElement=eo,e.PaymentRequestButtonElement=er,e.ShippingAddressElement=es,e.useCartElement=function(){return L("calls useCartElement()").cart},e.useCartElementState=function(){return L("calls useCartElementState()").cartState},e.useCustomCheckout=function(){S(t.useContext(T),"calls useCustomCheckout()");var e=t.useContext(I);if(!e)throw Error("Could not find CustomCheckout Context; You need to wrap the part of your app that calls useCustomCheckout() in an <CustomCheckoutProvider> provider.");return e},e.useElements=function(){return P("calls useElements()").elements},e.useStripe=function(){return A("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,r(67294))},54465:function(e,t,r){"use strict";r.d(t,{J:function(){return d}});var n="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,s=function(){for(var e=document.querySelectorAll('script[src^="'.concat(n,'"]')),t=0;t<e.length;t++){var r=e[t];if(i.test(r.src))return r}return null},a=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(n).concat(t);var i=document.head||document.body;if(!i)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(r),r},o=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"2.1.5",startTime:t})},l=null,u=function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return o(n,r),n},c=Promise.resolve().then(function(){return null!==l?l:l=new Promise(function(e,t){if("undefined"==typeof window||"undefined"==typeof document){e(null);return}if(window.Stripe,window.Stripe){e(window.Stripe);return}try{var r=s();r||(r=a(null)),r.addEventListener("load",function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))}),r.addEventListener("error",function(){t(Error("Failed to load Stripe.js"))})}catch(e){t(e);return}})}),h=!1;c.catch(function(e){h||console.warn(e)});var d=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];h=!0;var n=Date.now();return c.then(function(e){return u(e,t,n)})}},83454:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(77663)},91118:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(17211)}])},76431:function(e,t,r){"use strict";var n=r(85893);t.Z=e=>{let{children:t,className:r,setIsOpenModal:i,isOpenModal:s}=e;return s?(0,n.jsx)("div",{className:r,children:t}):null}},11347:function(e,t,r){"use strict";r.d(t,{Az:function(){return u},IG:function(){return h},Ks:function(){return l},TU:function(){return d},mz:function(){return c}});var n=r(85893),i=r(41639),s=r(16786),a=r(67294),o=r(45292);function l(e){let{children:t,title:r,description:i,small:s=!1,onClose:a}=e;return(0,n.jsx)("div",{className:"z-50 fixed ".concat(s?"bg-givellblue bg-opacity-50 backdrop-blur-sm inset-0 justify-end":"inset-0 justify-center"," md:bg-givellblue md:bg-opacity-50 md:backdrop-blur-sm bg-givellblack text-white flex md:justify-center items-end md:items-center"),children:(0,n.jsx)("div",{className:"".concat(s?"h-4/5 md:h-full max-h-full justify-end":"h-full"," md:p-[24px] md:max-h-screen flex flex-col md:justify-center"),children:(0,n.jsxs)("div",{className:"relative container-givell ".concat(s?"rounded-t-[30px] rounded-b-[0px] md:rounded-[40px]":"rounded-[30px] md:rounded-[40px]"," w-screen md:w-[692px] ").concat(s?"h-auto max-h-full":"h-full"," md:h-auto md:max-h-full flex flex-col gap-[4px]"),children:[(0,n.jsx)(u,{textTitleHead:r,textDescriptionHead:i,onClose:a}),t]})})})}function u(e){let{textTitleHead:t,textDescriptionHead:r,onClose:o}=e,{setVisible:l}=(0,a.useContext)(i.MJ);return(0,n.jsxs)("div",{className:"max-w-full h-auto rounded-[30px] md:rounded-[40px] container-div",children:[(0,n.jsxs)("div",{className:"flex flex-row items-center justify-between w-full h-full",children:[(0,n.jsx)("span",{className:"font-medium italic title text-givellblack",children:t}),(0,n.jsx)("button",{onClick:()=>{o?o():l(!1)},className:"w-[24px] md:w-[32px] h-[24px] md:h-[32px] text-givellblack focus:outline-none hover:opacity-60 transition-opacity duration-300",children:(0,n.jsx)(s.Z,{className:"w-full h-full"})})]}),r&&(0,n.jsx)("span",{className:"w-full text-start text-givellblack body",children:r})]})}function c(e){let{textButtonFooter:t,handleSubmit:r,disabled:i,className:s,absolute:a,children:l}=e;return(0,n.jsxs)("div",{className:"w-full flex flex-row gap-[16px] md:gap-[24px] justify-end items-center ".concat(a?"absolute":"sticky"," ").concat(a?"bottom-[4px] px-[16px] md:px-[24px] rounded-b-[40px]":"-bottom-[0px] md:-bottom-[0px]"," left-0 right-0 bg-gradient-to-b from-transparent to-givellwhite py-[16px] md:py-[24px] z-20 ")+s,children:[l,(0,n.jsx)(o.Z,{disabled:i,className:"black-button flex-none",onClick:r,children:t})]})}function h(e){let{children:t,className:r,absolute:i}=e;return(0,n.jsx)("div",{className:"w-full flex justify-end items-center ".concat(i?"absolute":"sticky"," ").concat(i?"bottom-[4px] px-[16px] md:px-[24px] rounded-b-[40px]":"-bottom-[0px] md:-bottom-[0px]"," left-0 right-0 bg-gradient-to-b from-transparent to-givellwhite py-[16px] md:py-[24px] z-20 ")+r,children:t})}function d(e){let{activeTab:t,tabs:r,handleNavigation:i,disabled:s}=e;return(0,n.jsx)("div",{className:"w-auto h-auto bg-givellblack rounded-[30px] p-[16px] flex flex-row gap-[12px] justify-center items-start bg-transparent",children:[...Array(r)].map((e,r)=>(0,n.jsx)("button",{onClick:()=>{s||i(r)},disabled:s,className:"w-[8px] md:w-[12px] h-[8px] md:h-[12px] rounded-full border-solid border-[1px] border-givellwhite ".concat(t===r&&"bg-givellwhite")},r))})}},45292:function(e,t,r){"use strict";var n=r(85893),i=r(67294);t.Z=e=>{let{children:t,disabled:r,className:s,loading:a,onClick:o}=e,[l,u]=(0,i.useState)(!1),c=async()=>{u(!0),await o(),u(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{children:"\n    \n    .spinner {\n      animation: rotator 1.4s linear infinite;\n    }\n    \n    @keyframes rotator {\n      0% { transform: rotate(0deg); }\n      100% { transform: rotate(270deg); }\n    }\n    \n    .path {\n      stroke-dasharray: 187;\n      stroke-dashoffset: 0;\n      transform-origin: center;\n      animation:\n        dash 1.4s ease-in-out infinite, \n        colors 5.6s ease-in-out infinite;\n    }\n    \n    @keyframes colors {\n        0% { stroke: #FFFFFF; }\n        25% { stroke: #FFFFFF; }\n        50% { stroke: #FFFFFF; }\n        75% { stroke: #FFFFFF; }\n      100% { stroke: #FFFFFF; }\n    }\n    \n    @keyframes dash {\n     0% { stroke-dashoffset: 187; }\n     50% {\n       stroke-dashoffset: 46.75;\n       transform:rotate(135deg);\n     }\n     100% {\n       stroke-dashoffset: 187;\n       transform:rotate(450deg);\n     }\n    }"}),(0,n.jsxs)("button",{onClick:c,disabled:r||a,className:s,children:[l&&(0,n.jsx)("div",{className:"w-full h-full items-center flex flex-col justify-center",children:(0,n.jsx)("svg",{className:"spinner",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",style:{width:"60%",height:"60%"},children:(0,n.jsx)("circle",{className:"path",fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})}),(0,n.jsx)("div",{className:"w-full h-full items-center flex flex-col justify-center ".concat(l&&"opacity-0"),children:t})]})]})}},41639:function(e,t,r){"use strict";r.d(t,{MJ:function(){return u},Rh:function(){return h},Tu:function(){return c}});var n=r(85893);r(76431);var i=r(42545),s=r(9008),a=r.n(s),o=r(11163),l=r(67294);let u=(0,l.createContext)();function c(e){let{children:t}=e,[r,s]=(0,l.useState)(),[c,h]=(0,l.useState)(!1),d=(0,o.useRouter)(),[f,p]=(0,l.useState)(!1);return(0,n.jsxs)(u.Provider,{value:{setModalVisible:e=>{s(e),h(!0)},setVisible:h,setModal:s,setBlackTheme:p},children:[(0,n.jsxs)(a(),{children:[(0,n.jsx)("meta",{name:"theme-color",content:c||f?"#101010":"/login"==d.pathname||"/request"==d.pathname||"/stripe"==d.pathname||"/trouble"==d.pathname?"#C1F4F8":"#E3F7F9"}),(0,n.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"})]}),t,(0,n.jsx)(i.V,{open:c,onClose:()=>null,children:r})]})}let h=()=>(0,l.useContext)(u)},33272:function(e,t,r){"use strict";r.d(t,{aF:function(){return u},dr:function(){return l}});var n=r(85893),i=r(94743),s=r(78952),a=r(67294);let o=(0,a.createContext)(),l=e=>{let{children:t}=e,r=c();return(0,n.jsx)(o.Provider,{value:r,children:t})},u=()=>(0,a.useContext)(o),c=()=>{let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(null),[o,l]=(0,a.useState)([]),[u,c]=(0,a.useState)(!0),[h,d]=(0,a.useState)(!0),f=u||!r||!e;return(0,a.useEffect)(()=>{if(null==r?void 0:r.uid){let e=(0,i.e9)(r.uid,t);return e}},[r]),(0,a.useEffect)(()=>{let e=async e=>{e&&(0,i.gG)(e).then(e=>{e&&l(e),d(!1)})},t=(0,s.Aj)(i.I8,async t=>{n(t),c(!1),e(null==t?void 0:t.uid)});return t},[r]),{user:r,userData:e,loadingUser:u,loadingUserData:f,notifications:o,loadingNotifications:h,updateNotifications:()=>{(null==r?void 0:r.uid)&&(0,i.gG)(null==r?void 0:r.uid).then(e=>{e&&l(e),d(!1)})}}}},56456:function(e,t,r){"use strict";r.d(t,{u:function(){return ea}});var n,i=r(65849),s=r(15060),a=r(93513),o=r(19119);r(83454);var l=((n=l||{}).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected",n),u=e=>[].concat(...e),c=i.PO,h=class{constructor(e,t){this.value=e,this.meta=t}},d=(0,s.PH)("__rtkq/focused"),f=(0,s.PH)("__rtkq/unfocused"),p=(0,s.PH)("__rtkq/online"),m=(0,s.PH)("__rtkq/offline");function g(e){return"query"===e.type}function y(e,t,r,n,i,s){return"function"==typeof e?e(t,r,n,i).map(v).map(s):Array.isArray(e)?e.map(v).map(s):[]}function v(e){return"string"==typeof e?{type:e}:e}function w(e){return null!=e}function b(e){let t=0;for(let r in e)t++;return t}var _=Symbol("forceQueryFn"),E=e=>"function"==typeof e[_];function T(e){return e}function S(e,t,r,n){return y(r[e.meta.arg.endpointName][t],(0,s.KD)(e)?e.payload:void 0,(0,s.h_)(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function I(e,t,r){let n=e[t];n&&r(n)}function k(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function C(e,t,r){let n=e[k(t)];n&&r(n)}var A={},x=Symbol.for("RTKQ/skipToken"),O={status:"uninitialized"},R=(0,a.Uy)(O,()=>{}),N=(0,a.Uy)(O,()=>{}),D=WeakMap?new WeakMap:void 0,P=({endpointName:e,queryArgs:t})=>{let r="",n=D?.get(t);if("string"==typeof n)r=n;else{let e=JSON.stringify(t,(e,t)=>(t="bigint"==typeof t?{$bigint:t.toString()}:t,t=(0,i.PO)(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t));(0,i.PO)(t)&&D?.set(t,e),r=e}return`${e}(${r})`},M=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i})=>{let{removeQueryResult:a,unsubscribeQueryResult:o}=t.internalActions,l=(0,s.Q)(o.match,r.fulfilled,r.rejected);function u(e){let t=i.currentSubscriptions[e];return!!t&&!function(e){for(let t in e)return!1;return!0}(t)}let c={};function h(e,t,r,i){let s=n.endpointDefinitions[t],o=s?.keepUnusedDataFor??i.keepUnusedDataFor;if(o!==1/0&&!u(e)){let t=c[e];t&&clearTimeout(t),c[e]=setTimeout(()=>{u(e)||r.dispatch(a({queryCacheKey:e})),delete c[e]},1e3*Math.max(0,Math.min(o,2147482.647)))}}return(r,i,s)=>{if(l(r)){let t=i.getState()[e],{queryCacheKey:n}=o.match(r)?r.payload:r.meta.arg;h(n,t.queries[n]?.endpointName,i,t.config)}if(t.util.resetApiState.match(r))for(let[e,t]of Object.entries(c))t&&clearTimeout(t),delete c[e];if(n.hasRehydrationInfo(r)){let t=i.getState()[e],{queries:s}=n.extractRehydrationInfo(r);for(let[e,r]of Object.entries(s))h(e,r?.endpointName,i,t.config)}}},L=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:a,assertTagType:o,refetchQuery:l,internalState:u})=>{let{removeQueryResult:c}=a.internalActions,h=(0,s.Q)((0,s.KD)(n),(0,s.h_)(n)),d=(0,s.Q)((0,s.KD)(n,i),(0,s.Iv)(n,i)),f=[];function p(r,n){let i=n.getState(),s=i[e];if(f.push(...r),"delayed"===s.config.invalidationBehavior&&function(e){for(let t in e.queries)if(e.queries[t]?.status==="pending")return!0;for(let t in e.mutations)if(e.mutations[t]?.status==="pending")return!0;return!1}(s))return;let o=f;if(f=[],0===o.length)return;let h=a.util.selectInvalidatedBy(i,o);t.batch(()=>{let e=Array.from(h.values());for(let{queryCacheKey:t}of e){let e=s.queries[t],r=u.currentSubscriptions[t]??{};e&&(0===b(r)?n.dispatch(c({queryCacheKey:t})):"uninitialized"!==e.status&&n.dispatch(l(e,t)))}})}return(e,t)=>{h(e)?p(S(e,"invalidatesTags",r,o),t):d(e)?p([],t):a.util.invalidateTags.match(e)&&p(y(e.payload,void 0,void 0,void 0,void 0,o),t)}},F=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{let s={};function a({queryCacheKey:t},r){let o=r.getState()[e],l=o.queries[t],c=i.currentSubscriptions[t];if(!l||"uninitialized"===l.status)return;let{lowestPollingInterval:h,skipPollingIfUnfocused:d}=u(c);if(!Number.isFinite(h))return;let f=s[t];f?.timeout&&(clearTimeout(f.timeout),f.timeout=void 0);let p=Date.now()+h;s[t]={nextPollTimestamp:p,pollingInterval:h,timeout:setTimeout(()=>{(o.config.focused||!d)&&r.dispatch(n(l,t)),a({queryCacheKey:t},r)},h)}}function o({queryCacheKey:t},r){let n=r.getState()[e],o=n.queries[t],c=i.currentSubscriptions[t];if(!o||"uninitialized"===o.status)return;let{lowestPollingInterval:h}=u(c);if(!Number.isFinite(h)){l(t);return}let d=s[t],f=Date.now()+h;(!d||f<d.nextPollTimestamp)&&a({queryCacheKey:t},r)}function l(e){let t=s[e];t?.timeout&&clearTimeout(t.timeout),delete s[e]}function u(e={}){let t=!1,r=Number.POSITIVE_INFINITY;for(let n in e)e[n].pollingInterval&&(r=Math.min(e[n].pollingInterval,r),t=e[n].skipPollingIfUnfocused||t);return{lowestPollingInterval:r,skipPollingIfUnfocused:t}}return(e,n)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&o(e.payload,n),(t.pending.match(e)||t.rejected.match(e)&&e.meta.condition)&&o(e.meta.arg,n),(t.fulfilled.match(e)||t.rejected.match(e)&&!e.meta.condition)&&a(e.meta.arg,n),r.util.resetApiState.match(e)&&function(){for(let e of Object.keys(s))l(e)}()}},j=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{let{removeQueryResult:s}=r.internalActions;function a(r,a){let o=r.getState()[e],l=o.queries,u=i.currentSubscriptions;t.batch(()=>{for(let e of Object.keys(u)){let t=l[e],i=u[e];if(!i||!t)continue;let c=Object.values(i).some(e=>!0===e[a])||Object.values(i).every(e=>void 0===e[a])&&o.config[a];c&&(0===b(i)?r.dispatch(s({queryCacheKey:e})):"uninitialized"!==t.status&&r.dispatch(n(t,e)))}})}return(e,t)=>{d.match(e)&&a(t,"refetchOnFocus"),p.match(e)&&a(t,"refetchOnReconnect")}},U=Error("Promise never resolved before cacheEntryRemoved."),V=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:a})=>{let o=(0,s.Gx)(n),l=(0,s.Gx)(i),u=(0,s.KD)(n,i),c={};function h(t,n,i,s,a){let o=r.endpointDefinitions[t],l=o?.onCacheEntryAdded;if(!l)return;let u={},h=new Promise(e=>{u.cacheEntryRemoved=e}),d=Promise.race([new Promise(e=>{u.valueResolved=e}),h.then(()=>{throw U})]);d.catch(()=>{}),c[i]=u;let f=e.endpoints[t].select("query"===o.type?n:i),p=s.dispatch((e,t,r)=>r),m={...s,getCacheEntry:()=>f(s.getState()),requestId:a,extra:p,updateCachedData:"query"===o.type?r=>s.dispatch(e.util.updateQueryData(t,n,r)):void 0,cacheDataLoaded:d,cacheEntryRemoved:h},g=l(n,m);Promise.resolve(g).catch(e=>{if(e!==U)throw e})}return(r,s,a)=>{let d=o(r)?r.meta.arg.queryCacheKey:l(r)?r.meta.arg.fixedCacheKey??r.meta.requestId:e.internalActions.removeQueryResult.match(r)?r.payload.queryCacheKey:e.internalActions.removeMutationResult.match(r)?k(r.payload):"";if(n.pending.match(r)){let e=a[t].queries[d],n=s.getState()[t].queries[d];!e&&n&&h(r.meta.arg.endpointName,r.meta.arg.originalArgs,d,s,r.meta.requestId)}else if(i.pending.match(r)){let e=s.getState()[t].mutations[d];e&&h(r.meta.arg.endpointName,r.meta.arg.originalArgs,d,s,r.meta.requestId)}else if(u(r)){let e=c[d];e?.valueResolved&&(e.valueResolved({data:r.payload,meta:r.meta.baseQueryMeta}),delete e.valueResolved)}else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r)){let e=c[d];e&&(delete c[d],e.cacheEntryRemoved())}else if(e.util.resetApiState.match(r))for(let[e,t]of Object.entries(c))delete c[e],t.cacheEntryRemoved()}},$=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let i=(0,s.zR)(r,n),a=(0,s.Iv)(r,n),o=(0,s.KD)(r,n),l={};return(r,n)=>{if(i(r)){let{requestId:i,arg:{endpointName:s,originalArgs:a}}=r.meta,o=t.endpointDefinitions[s],u=o?.onQueryStarted;if(u){let t={},r=new Promise((e,r)=>{t.resolve=e,t.reject=r});r.catch(()=>{}),l[i]=t;let c=e.endpoints[s].select("query"===o.type?a:i),h=n.dispatch((e,t,r)=>r),d={...n,getCacheEntry:()=>c(n.getState()),requestId:i,extra:h,updateCachedData:"query"===o.type?t=>n.dispatch(e.util.updateQueryData(s,a,t)):void 0,queryFulfilled:r};u(a,d)}}else if(o(r)){let{requestId:e,baseQueryMeta:t}=r.meta;l[e]?.resolve({data:r.payload,meta:t}),delete l[e]}else if(a(r)){let{requestId:e,rejectedWithValue:t,baseQueryMeta:n}=r.meta;l[e]?.reject({error:r.payload??r.error,isUnhandledError:!t,meta:n}),delete l[e]}}},q=({api:e,context:{apiUid:t},reducerPath:r})=>(r,n)=>{e.util.resetApiState.match(r)&&n.dispatch(e.internalActions.middlewareRegistered(t))},z=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,i=null,s=null,{updateSubscriptionOptions:o,unsubscribeQueryResult:l}=e.internalActions,u=(r,n)=>{if(o.match(n)){let{queryCacheKey:e,requestId:t,options:i}=n.payload;return r?.[e]?.[t]&&(r[e][t]=i),!0}if(l.match(n)){let{queryCacheKey:e,requestId:t}=n.payload;return r[e]&&delete r[e][t],!0}if(e.internalActions.removeQueryResult.match(n))return delete r[n.payload.queryCacheKey],!0;if(t.pending.match(n)){let{meta:{arg:e,requestId:t}}=n,i=r[e.queryCacheKey]??={};return i[`${t}_running`]={},e.subscribe&&(i[t]=e.subscriptionOptions??i[t]??{}),!0}let i=!1;if(t.fulfilled.match(n)||t.rejected.match(n)){let e=r[n.meta.arg.queryCacheKey]||{},t=`${n.meta.requestId}_running`;i||=!!e[t],delete e[t]}if(t.rejected.match(n)){let{meta:{condition:e,arg:t,requestId:s}}=n;if(e&&t.subscribe){let e=r[t.queryCacheKey]??={};e[s]=t.subscriptionOptions??e[s]??{},i=!0}}return i},c=()=>r.currentSubscriptions,h={getSubscriptions:c,getSubscriptionCount:e=>{let t=c(),r=t[e]??{};return b(r)},isRequestSubscribed:(e,t)=>{let r=c();return!!r?.[e]?.[t]}};return(o,l)=>{if(i||(i=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(o))return i=r.currentSubscriptions={},s=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(o))return[!1,h];let c=u(r.currentSubscriptions,o),d=!0;if(c){s||(s=setTimeout(()=>{let t=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,n]=(0,a.aS)(i,()=>t);l.next(e.internalActions.subscriptionsUpdated(n)),i=t,s=null},500));let u="string"==typeof o.type&&!!o.type.startsWith(n),c=t.rejected.match(o)&&o.meta.condition&&!!o.meta.arg.subscribe;d=!u&&!c}return[d,!1]}};function B(e,...t){return Object.assign(e,...t)}var H=Symbol(),K=({createSelector:e=o.P1}={})=>({name:H,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:l,keepUnusedDataFor:O,refetchOnMountOrArgChange:D,refetchOnFocus:P,refetchOnReconnect:U,invalidationBehavior:K},G){(0,a.vI)();let W=e=>e;Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:p,onOffline:m,onFocus:d,onFocusLost:f},util:{}});let{queryThunk:Q,mutationThunk:J,patchQueryData:Y,updateQueryData:X,upsertQueryData:Z,prefetch:ee,buildMatchThunkActions:et}=function({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:o}){let l=async(e,{signal:n,abort:i,rejectWithValue:a,fulfillWithValue:o,dispatch:l,getState:c,extra:d})=>{let f=r[e.endpointName];try{let r,a=T,p={signal:n,abort:i,dispatch:l,getState:c,extra:d,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?u(e,c()):void 0},m="query"===e.type?e[_]:void 0;if(m?r=m():f.query?(r=await t(f.query(e.originalArgs),p,f.extraOptions),f.transformResponse&&(a=f.transformResponse)):r=await f.queryFn(e.originalArgs,p,f.extraOptions,e=>t(e,p,f.extraOptions)),r.error)throw new h(r.error,r.meta);return o(await a(r.data,r.meta,e.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta,[s.s4]:!0})}catch(r){let t=r;if(t instanceof h){let r=T;f.query&&f.transformErrorResponse&&(r=f.transformErrorResponse);try{return a(await r(t.value,t.meta,e.originalArgs),{baseQueryMeta:t.meta,[s.s4]:!0})}catch(e){t=e}}throw console.error(t),t}};function u(t,r){let n=r[e]?.queries?.[t.queryCacheKey],i=r[e]?.config.refetchOnMountOrArgChange,s=n?.fulfilledTimeStamp,a=t.forceRefetch??(t.subscribe&&i);return!!a&&(!0===a||(Number(new Date)-Number(s))/1e3>=a)}let c=(0,s.hg)(`${e}/executeQuery`,l,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[s.s4]:!0}),condition(t,{getState:n}){let i=n(),s=i[e]?.queries?.[t.queryCacheKey],a=s?.fulfilledTimeStamp,o=t.originalArgs,l=s?.originalArgs,c=r[t.endpointName];return!!E(t)||s?.status!=="pending"&&(!!(u(t,i)||g(c)&&c?.forceRefetch?.({currentArg:o,previousArg:l,endpointState:s,state:i}))||!a)},dispatchConditionRejection:!0}),d=(0,s.hg)(`${e}/executeMutation`,l,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[s.s4]:!0})}),f=e=>"force"in e,p=e=>"ifOlderThan"in e;function m(e){return t=>t?.meta?.arg?.endpointName===e}return{queryThunk:c,mutationThunk:d,prefetch:(e,t,r)=>(n,s)=>{let a=f(r)&&r.force,o=p(r)&&r.ifOlderThan,l=(r=!0)=>i.endpoints[e].initiate(t,{forceRefetch:r,isPrefetch:!0}),u=i.endpoints[e].select(t)(s());if(a)n(l());else if(o){let e=u?.fulfilledTimeStamp;if(!e){n(l());return}let t=(Number(new Date)-Number(new Date(e)))/1e3>=o;t&&n(l())}else n(l(!1))},updateQueryData:(e,t,r,n=!0)=>(s,o)=>{let l;let u=i.endpoints[e],c=u.select(t)(o()),h={patches:[],inversePatches:[],undo:()=>s(i.util.patchQueryData(e,t,h.inversePatches,n))};if("uninitialized"===c.status)return h;if("data"in c){if((0,a.o$)(c.data)){let[e,t,n]=(0,a.aS)(c.data,r);h.patches.push(...t),h.inversePatches.push(...n),l=e}else l=r(c.data),h.patches.push({op:"replace",path:[],value:l}),h.inversePatches.push({op:"replace",path:[],value:c.data})}return 0===h.patches.length||s(i.util.patchQueryData(e,t,h.patches,n)),h},upsertQueryData:(e,t,r)=>n=>n(i.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[_]:()=>({data:r})})),patchQueryData:(e,t,s,a)=>(l,u)=>{let c=r[e],h=n({queryArgs:t,endpointDefinition:c,endpointName:e});if(l(i.internalActions.queryResultPatched({queryCacheKey:h,patches:s})),!a)return;let d=i.endpoints[e].select(t)(u()),f=y(c.providesTags,d.data,void 0,t,{},o);l(i.internalActions.updateProvidedBy({queryCacheKey:h,providedTags:f}))},buildMatchThunkActions:function(e,t){return{matchPending:(0,s.A6)((0,s.zR)(e),m(t)),matchFulfilled:(0,s.A6)((0,s.KD)(e),m(t)),matchRejected:(0,s.A6)((0,s.Iv)(e),m(t))}}}}({baseQuery:r,reducerPath:o,context:G,api:t,serializeQueryArgs:l,assertTagType:W}),{reducer:er,actions:en}=function({reducerPath:e,queryThunk:t,mutationThunk:r,context:{endpointDefinitions:n,apiUid:o,extractRehydrationInfo:l,hasRehydrationInfo:u},assertTagType:h,config:g}){let y=(0,s.PH)(`${e}/resetApiState`),v=(0,s.oM)({name:`${e}/queries`,initialState:A,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:(0,s.cw)()},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:r}}){I(e,t,e=>{e.data=(0,a.QE)(e.data,r.concat())})},prepare:(0,s.cw)()}},extraReducers(e){e.addCase(t.pending,(e,{meta:t,meta:{arg:r}})=>{let n=E(r);e[r.queryCacheKey]??={status:"uninitialized",endpointName:r.endpointName},I(e,r.queryCacheKey,e=>{e.status="pending",e.requestId=n&&e.requestId?e.requestId:t.requestId,void 0!==r.originalArgs&&(e.originalArgs=r.originalArgs),e.startedTimeStamp=t.startedTimeStamp})}).addCase(t.fulfilled,(e,{meta:t,payload:r})=>{I(e,t.arg.queryCacheKey,e=>{if(e.requestId!==t.requestId&&!E(t.arg))return;let{merge:i}=n[t.arg.endpointName];if(e.status="fulfilled",i){if(void 0!==e.data){let{fulfilledTimeStamp:n,arg:s,baseQueryMeta:o,requestId:l}=t,u=(0,a.Uy)(e.data,e=>i(e,r,{arg:s.originalArgs,baseQueryMeta:o,fulfilledTimeStamp:n,requestId:l}));e.data=u}else e.data=r}else e.data=n[t.arg.endpointName].structuralSharing??!0?function e(t,r){if(t===r||!(c(t)&&c(r)||Array.isArray(t)&&Array.isArray(r)))return r;let n=Object.keys(r),i=Object.keys(t),s=n.length===i.length,a=Array.isArray(r)?[]:{};for(let i of n)a[i]=e(t[i],r[i]),s&&(s=t[i]===a[i]);return s?t:a}((0,a.mv)(e.data)?(0,a.Js)(e.data):e.data,r):r;delete e.error,e.fulfilledTimeStamp=t.fulfilledTimeStamp})}).addCase(t.rejected,(e,{meta:{condition:t,arg:r,requestId:n},error:i,payload:s})=>{I(e,r.queryCacheKey,e=>{if(t);else{if(e.requestId!==n)return;e.status="rejected",e.error=s??i}})}).addMatcher(u,(e,t)=>{let{queries:r}=l(t);for(let[t,n]of Object.entries(r))(n?.status==="fulfilled"||n?.status==="rejected")&&(e[t]=n)})}}),w=(0,s.oM)({name:`${e}/mutations`,initialState:A,reducers:{removeMutationResult:{reducer(e,{payload:t}){let r=k(t);r in e&&delete e[r]},prepare:(0,s.cw)()}},extraReducers(e){e.addCase(r.pending,(e,{meta:t,meta:{requestId:r,arg:n,startedTimeStamp:i}})=>{n.track&&(e[k(t)]={requestId:r,status:"pending",endpointName:n.endpointName,startedTimeStamp:i})}).addCase(r.fulfilled,(e,{payload:t,meta:r})=>{r.arg.track&&C(e,r,e=>{e.requestId===r.requestId&&(e.status="fulfilled",e.data=t,e.fulfilledTimeStamp=r.fulfilledTimeStamp)})}).addCase(r.rejected,(e,{payload:t,error:r,meta:n})=>{n.arg.track&&C(e,n,e=>{e.requestId===n.requestId&&(e.status="rejected",e.error=t??r)})}).addMatcher(u,(e,t)=>{let{mutations:r}=l(t);for(let[t,n]of Object.entries(r))(n?.status==="fulfilled"||n?.status==="rejected")&&t!==n?.requestId&&(e[t]=n)})}}),b=(0,s.oM)({name:`${e}/invalidation`,initialState:A,reducers:{updateProvidedBy:{reducer(e,t){let{queryCacheKey:r,providedTags:n}=t.payload;for(let t of Object.values(e))for(let e of Object.values(t)){let t=e.indexOf(r);-1!==t&&e.splice(t,1)}for(let{type:t,id:i}of n){let n=(e[t]??={})[i||"__internal_without_id"]??=[],s=n.includes(r);s||n.push(r)}},prepare:(0,s.cw)()}},extraReducers(e){e.addCase(v.actions.removeQueryResult,(e,{payload:{queryCacheKey:t}})=>{for(let r of Object.values(e))for(let e of Object.values(r)){let r=e.indexOf(t);-1!==r&&e.splice(r,1)}}).addMatcher(u,(e,t)=>{let{provided:r}=l(t);for(let[t,n]of Object.entries(r))for(let[r,i]of Object.entries(n)){let n=(e[t]??={})[r||"__internal_without_id"]??=[];for(let e of i){let t=n.includes(e);t||n.push(e)}}}).addMatcher((0,s.Q)((0,s.KD)(t),(0,s.h_)(t)),(e,t)=>{let r=S(t,"providesTags",n,h),{queryCacheKey:i}=t.meta.arg;b.caseReducers.updateProvidedBy(e,b.actions.updateProvidedBy({queryCacheKey:i,providedTags:r}))})}}),_=(0,s.oM)({name:`${e}/subscriptions`,initialState:A,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_getRTKQSubscriptions(){}}}),T=(0,s.oM)({name:`${e}/internalSubscriptions`,initialState:A,reducers:{subscriptionsUpdated:{reducer:(e,t)=>(0,a.QE)(e,t.payload),prepare:(0,s.cw)()}}}),x=(0,s.oM)({name:`${e}/config`,initialState:{online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1,...g},reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&o===t||"conflict"}},extraReducers:e=>{e.addCase(p,e=>{e.online=!0}).addCase(m,e=>{e.online=!1}).addCase(d,e=>{e.focused=!0}).addCase(f,e=>{e.focused=!1}).addMatcher(u,e=>({...e}))}}),O=(0,i.UY)({queries:v.reducer,mutations:w.reducer,provided:b.reducer,subscriptions:T.reducer,config:x.reducer}),R={...x.actions,...v.actions,..._.actions,...T.actions,...w.actions,...b.actions,resetApiState:y};return{reducer:(e,t)=>O(y.match(t)?void 0:e,t),actions:R}}({context:G,queryThunk:Q,mutationThunk:J,reducerPath:o,assertTagType:W,config:{refetchOnFocus:P,refetchOnReconnect:U,refetchOnMountOrArgChange:D,keepUnusedDataFor:O,reducerPath:o,invalidationBehavior:K}});B(t.util,{patchQueryData:Y,updateQueryData:X,upsertQueryData:Z,prefetch:ee,resetApiState:en.resetApiState}),B(t.internalActions,en);let{middleware:ei,actions:es}=function(e){let{reducerPath:t,queryThunk:r,api:n,context:a}=e,{apiUid:o}=a,l={invalidateTags:(0,s.PH)(`${t}/invalidateTags`)},u=e=>e.type.startsWith(`${t}/`),c=[q,M,L,F,V,$];return{middleware:r=>{let s=!1,l={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:u},d=c.map(e=>e(l)),f=z(l),p=j(l);return e=>l=>{let c;if(!(0,i.LG)(l))return e(l);s||(s=!0,r.dispatch(n.internalActions.middlewareRegistered(o)));let h={...r,next:e},m=r.getState(),[g,y]=f(l,h,m);if(c=g?e(l):y,r.getState()[t]&&(p(l,h,m),u(l)||a.hasRehydrationInfo(l)))for(let e of d)e(l,h,m);return c}},actions:l};function h(e,t,n={}){return r({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t,...n})}}({reducerPath:o,context:G,queryThunk:Q,mutationThunk:J,api:t,assertTagType:W});B(t.util,es),B(t,{reducer:er,middleware:ei});let{buildQuerySelector:ea,buildMutationSelector:eo,selectInvalidatedBy:el,selectCachedArgsForQuery:eu}=function({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=e=>R,i=e=>N;return{buildQuerySelector:function(t,i){return o=>{let l=e({queryArgs:o,endpointDefinition:i,endpointName:t}),u=o===x?n:e=>a(e)?.queries?.[l]??R;return r(u,s)}},buildMutationSelector:function(){return e=>{let t;t="object"==typeof e?k(e)??x:e;let n=t===x?i:e=>a(e)?.mutations?.[t]??N;return r(n,s)}},selectInvalidatedBy:function(e,r){let n=e[t],i=new Set;for(let e of r.map(v)){let t=n.provided[e.type];if(t)for(let r of(void 0!==e.id?t[e.id]:u(Object.values(t)))??[])i.add(r)}return u(Array.from(i.values()).map(e=>{let t=n.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]}))},selectCachedArgsForQuery:function(e,r){return Object.values(e[t].queries).filter(e=>e?.endpointName===r&&"uninitialized"!==e.status).map(e=>e.originalArgs)}};function s(e){var t;return{...e,status:t=e.status,isUninitialized:"uninitialized"===t,isLoading:"pending"===t,isSuccess:"fulfilled"===t,isError:"rejected"===t}}function a(e){let r=e[t];return r}}({serializeQueryArgs:l,reducerPath:o,createSelector:e});B(t.util,{selectInvalidatedBy:el,selectCachedArgsForQuery:eu});let{buildInitiateQuery:ec,buildInitiateMutation:eh,getRunningMutationThunk:ed,getRunningMutationsThunk:ef,getRunningQueriesThunk:ep,getRunningQueryThunk:em}=function({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:n,context:i}){let s=new Map,a=new Map,{unsubscribeQueryResult:o,removeMutationResult:l,updateSubscriptionOptions:u}=n.internalActions;return{buildInitiateQuery:function(r,i){let a=(l,{subscribe:c=!0,forceRefetch:h,subscriptionOptions:d,[_]:f,...p}={})=>(m,g)=>{let y=e({queryArgs:l,endpointDefinition:i,endpointName:r}),v=t({...p,type:"query",subscribe:c,forceRefetch:h,subscriptionOptions:d,endpointName:r,originalArgs:l,queryCacheKey:y,[_]:f}),w=n.endpoints[r].select(l),E=m(v),T=w(g()),{requestId:S,abort:I}=E,k=T.requestId!==S,C=s.get(m)?.[y],A=()=>w(g()),x=Object.assign(f?E.then(A):k&&!C?Promise.resolve(T):Promise.all([C,E]).then(A),{arg:l,requestId:S,subscriptionOptions:d,queryCacheKey:y,abort:I,async unwrap(){let e=await x;if(e.isError)throw e.error;return e.data},refetch:()=>m(a(l,{subscribe:!1,forceRefetch:!0})),unsubscribe(){c&&m(o({queryCacheKey:y,requestId:S}))},updateSubscriptionOptions(e){x.subscriptionOptions=e,m(u({endpointName:r,requestId:S,queryCacheKey:y,options:e}))}});if(!C&&!k&&!f){let e=s.get(m)||{};e[y]=x,s.set(m,e),x.then(()=>{delete e[y],b(e)||s.delete(m)})}return x};return a},buildInitiateMutation:function(e){return(t,{track:n=!0,fixedCacheKey:i}={})=>(s,o)=>{let u=r({type:"mutation",endpointName:e,originalArgs:t,track:n,fixedCacheKey:i}),c=s(u),{requestId:h,abort:d,unwrap:f}=c,p=c.unwrap().then(e=>({data:e})).catch(e=>({error:e})),m=Object.assign(p,{arg:c.arg,requestId:h,abort:d,unwrap:f,reset:()=>{s(l({requestId:h,fixedCacheKey:i}))}}),g=a.get(s)||{};return a.set(s,g),g[h]=m,m.then(()=>{delete g[h],b(g)||a.delete(s)}),i&&(g[i]=m,m.then(()=>{g[i]!==m||(delete g[i],b(g)||a.delete(s))})),m}},getRunningQueryThunk:function(t,r){return n=>{let a=i.endpointDefinitions[t],o=e({queryArgs:r,endpointDefinition:a,endpointName:t});return s.get(n)?.[o]}},getRunningMutationThunk:function(e,t){return e=>a.get(e)?.[t]},getRunningQueriesThunk:function(){return e=>Object.values(s.get(e)||{}).filter(w)},getRunningMutationsThunk:function(){return e=>Object.values(a.get(e)||{}).filter(w)}}}({queryThunk:Q,mutationThunk:J,api:t,serializeQueryArgs:l,context:G});return B(t.util,{getRunningMutationThunk:ed,getRunningMutationsThunk:ef,getRunningQueryThunk:em,getRunningQueriesThunk:ep}),{name:H,injectEndpoint(e,r){(t.endpoints[e]??={},g(r))?B(t.endpoints[e],{name:e,select:ea(e,r),initiate:ec(e,r)},et(Q,e)):"mutation"===r.type&&B(t.endpoints[e],{name:e,select:eo(),initiate:eh(e)},et(J,e))}}}});K();var G=r(67294),W=r(45007);function Q(e,...t){return Object.assign(e,...t)}function J(e){return e.replace(e[0],e[0].toUpperCase())}r(83454);var Y=WeakMap?new WeakMap:void 0,X=({endpointName:e,queryArgs:t})=>{let r="",n=Y?.get(t);if("string"==typeof n)r=n;else{let e=JSON.stringify(t,(e,t)=>(t="bigint"==typeof t?{$bigint:t.toString()}:t,t=(0,i.PO)(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t));(0,i.PO)(t)&&Y?.set(t,e),r=e}return`${e}(${r})`},Z=Symbol();function ee(e,t,r,n){let i=(0,G.useMemo)(()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),s=(0,G.useRef)(i);return(0,G.useEffect)(()=>{s.current.serialized!==i.serialized&&(s.current=i)},[i]),s.current.serialized===i.serialized?s.current.queryArgs:e}function et(e){let t=(0,G.useRef)(e);return(0,G.useEffect)(()=>{(0,W.wU)(t.current,e)||(t.current=e)},[e]),(0,W.wU)(t.current,e)?t.current:e}var er="undefined"!=typeof window&&window.document&&window.document.createElement?G.useLayoutEffect:G.useEffect,en=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:l.pending}:e,ei=Symbol(),es=function(...e){return function(t){let r=(0,o.kO)(e=>t.extractRehydrationInfo?.(e,{reducerPath:t.reducerPath??"api"})),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=P;if("serializeQueryArgs"in e.endpointDefinition){let t=e.endpointDefinition.serializeQueryArgs;r=e=>{let r=t(e);return"string"==typeof r?r:P({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},i={endpointDefinitions:{},batch(e){e()},apiUid:(0,s.x0)(),extractRehydrationInfo:r,hasRehydrationInfo:(0,o.kO)(e=>null!=r(e))},a={injectEndpoints:function(e){let t=e.endpoints({query:e=>({...e,type:"query"}),mutation:e=>({...e,type:"mutation"})});for(let[r,n]of Object.entries(t)){if(!0!==e.overrideExisting&&r in i.endpointDefinitions){if("throw"===e.overrideExisting)throw Error((0,s.rJ)(39));continue}for(let e of(i.endpointDefinitions[r]=n,l))e.injectEndpoint(r,n)}return a},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(let t of e)n.tagTypes.includes(t)||n.tagTypes.push(t);if(t)for(let[e,r]of Object.entries(t))"function"==typeof r?r(i.endpointDefinitions[e]):Object.assign(i.endpointDefinitions[e]||{},r);return a}},l=e.map(e=>e.init(a,n,i));return a.injectEndpoints({endpoints:t.endpoints})}}(K(),(({batch:e=W.dC,hooks:t={useDispatch:W.I0,useSelector:W.v9,useStore:W.oR},createSelector:r=o.P1,unstable__sideEffectsInRender:n=!1,...i}={})=>({name:ei,init(i,{serializeQueryArgs:a},o){let{buildQueryHooks:l,buildMutationHook:u,usePrefetch:c}=function({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:i},unstable__sideEffectsInRender:a,createSelector:o},serializeQueryArgs:l,context:u}){let c=a?e=>e():G.useEffect;return{buildQueryHooks:function(a){let d=(t,{refetchOnReconnect:n,refetchOnFocus:i,refetchOnMountOrArgChange:o,skip:l=!1,pollingInterval:h=0,skipPollingIfUnfocused:d=!1}={})=>{let{initiate:f}=e.endpoints[a],p=r(),m=(0,G.useRef)(void 0);if(!m.current){let t=p(e.internalActions.internal_getRTKQSubscriptions());m.current=t}let g=ee(l?x:t,X,u.endpointDefinitions[a],a),y=et({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:h,skipPollingIfUnfocused:d}),v=(0,G.useRef)(!1),w=(0,G.useRef)(void 0),{queryCacheKey:b,requestId:_}=w.current||{},E=!1;b&&_&&(E=m.current.isRequestSubscribed(b,_));let T=!E&&v.current;return c(()=>{v.current=E}),c(()=>{T&&(w.current=void 0)},[T]),c(()=>{let e=w.current;if(g===x){e?.unsubscribe(),w.current=void 0;return}let t=w.current?.subscriptionOptions;if(e&&e.arg===g)y!==t&&e.updateSubscriptionOptions(y);else{e?.unsubscribe();let t=p(f(g,{subscriptionOptions:y,forceRefetch:o}));w.current=t}},[p,f,o,g,y,T]),(0,G.useEffect)(()=>()=>{w.current?.unsubscribe(),w.current=void 0},[]),(0,G.useMemo)(()=>({refetch:()=>{if(!w.current)throw Error((0,s.rJ)(38));return w.current?.refetch()}}),[])},f=({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:s=0,skipPollingIfUnfocused:o=!1}={})=>{let{initiate:l}=e.endpoints[a],u=r(),[h,d]=(0,G.useState)(Z),f=(0,G.useRef)(void 0),p=et({refetchOnReconnect:n,refetchOnFocus:i,pollingInterval:s,skipPollingIfUnfocused:o});c(()=>{let e=f.current?.subscriptionOptions;p!==e&&f.current?.updateSubscriptionOptions(p)},[p]);let m=(0,G.useRef)(p);c(()=>{m.current=p},[p]);let g=(0,G.useCallback)(function(e,r=!1){let n;return t(()=>{f.current?.unsubscribe(),f.current=n=u(l(e,{subscriptionOptions:m.current,forceRefetch:!r})),d(e)}),n},[u,l]);return(0,G.useEffect)(()=>()=>{f?.current?.unsubscribe()},[]),(0,G.useEffect)(()=>{h===Z||f.current||g(h,!0)},[h,g]),(0,G.useMemo)(()=>[g,h],[g,h])},p=(t,{skip:r=!1,selectFromResult:s}={})=>{let{select:c}=e.endpoints[a],d=ee(r?x:t,l,u.endpointDefinitions[a],a),f=(0,G.useRef)(void 0),p=(0,G.useMemo)(()=>o([c(d),(e,t)=>t,e=>d],h,{memoizeOptions:{resultEqualityCheck:W.wU}}),[c,d]),m=(0,G.useMemo)(()=>s?o([p],s,{devModeChecks:{identityFunctionCheck:"never"}}):p,[p,s]),g=n(e=>m(e,f.current),W.wU),y=i(),v=p(y.getState(),f.current);return er(()=>{f.current=v},[v]),g};return{useQueryState:p,useQuerySubscription:d,useLazyQuerySubscription:f,useLazyQuery(e){let[t,r]=f(e),n=p(r,{...e,skip:r===Z}),i=(0,G.useMemo)(()=>({lastArg:r}),[r]);return(0,G.useMemo)(()=>[t,n,i],[t,n,i])},useQuery(e,t){let r=d(e,t),n=p(e,{selectFromResult:e===x||t?.skip?void 0:en,...t}),{data:i,status:s,isLoading:a,isSuccess:o,isError:l,error:u}=n;return(0,G.useDebugValue)({data:i,status:s,isLoading:a,isSuccess:o,isError:l,error:u}),(0,G.useMemo)(()=>({...n,...r}),[n,r])}}},buildMutationHook:function(i){return({selectFromResult:s,fixedCacheKey:a}={})=>{let{select:l,initiate:u}=e.endpoints[i],c=r(),[h,d]=(0,G.useState)();(0,G.useEffect)(()=>()=>{h?.arg.fixedCacheKey||h?.reset()},[h]);let f=(0,G.useCallback)(function(e){let t=c(u(e,{fixedCacheKey:a}));return d(t),t},[c,u,a]),{requestId:p}=h||{},m=(0,G.useMemo)(()=>l({fixedCacheKey:a,requestId:h?.requestId}),[a,h,l]),g=(0,G.useMemo)(()=>s?o([m],s):m,[s,m]),y=n(g,W.wU),v=null==a?h?.arg.originalArgs:void 0,w=(0,G.useCallback)(()=>{t(()=>{h&&d(void 0),a&&c(e.internalActions.removeMutationResult({requestId:p,fixedCacheKey:a}))})},[c,a,h,p]),{endpointName:b,data:_,status:E,isLoading:T,isSuccess:S,isError:I,error:k}=y;(0,G.useDebugValue)({endpointName:b,data:_,status:E,isLoading:T,isSuccess:S,isError:I,error:k});let C=(0,G.useMemo)(()=>({...y,originalArgs:v,reset:w}),[y,v,w]);return(0,G.useMemo)(()=>[f,C],[f,C])}},usePrefetch:function(t,n){let i=r(),s=et(n);return(0,G.useCallback)((r,n)=>i(e.util.prefetch(t,r,{...s,...n})),[t,i,s])}};function h(e,t,r){if(t?.endpointName&&e.isUninitialized){let{endpointName:e}=t,n=u.endpointDefinitions[e];l({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===l({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);let i=void 0!==n,s=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!i&&s,o=e.isSuccess||s&&i;return{...e,data:n,currentData:e.data,isFetching:s,isLoading:a,isSuccess:o}}}({api:i,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:a,context:o});return Q(i,{usePrefetch:c}),Q(o,{batch:e}),{injectEndpoint(e,t){if("query"===t.type){let{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:s,useQuerySubscription:a}=l(e);Q(i.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:s,useQuerySubscription:a}),i[`use${J(e)}Query`]=t,i[`useLazy${J(e)}Query`]=r}else if("mutation"===t.type){let t=u(e);Q(i.endpoints[e],{useMutation:t}),i[`use${J(e)}Mutation`]=t}}}}}))());let ea=es({reducerPath:"api",tagTypes:["Claimable_Pages"],baseQuery:function(){throw Error((0,s.rJ)(33))},endpoints:e=>({})})},73161:function(e,t,r){"use strict";r.d(t,{Bn:function(){return u},LW:function(){return c},UM:function(){return a},ZQ:function(){return l},ju:function(){return o}});var n=r(94743),i=r(56456),s=r(86650);let a=i.u.injectEndpoints({endpoints:e=>({getAllClaimablePages:e.query({providesTags:["Claimable_Pages"],async queryFn(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=await (0,n.H4)();return e}}),saveClaimblePage:e.mutation({invalidatesTags:["Claimable_Pages"],async queryFn(e){let t=(await (0,n.V$)(e)).data;return console.log(e),e.avatar&&await (0,s.KV)((0,s.iH)(n.tO,"Users/".concat(t.result)),e.avatar),{data:"ok"}}}),claimAPage:e.mutation({async queryFn(e){let t=await (0,n.yg)(e);return t}}),deleteClaimablePage:e.mutation({invalidatesTags:["Claimable_Pages"],async queryFn(e){let t=await (0,n.IC)(e);return t}})}),overrideExisting:!0}),{useGetAllClaimablePagesQuery:o,useSaveClaimblePageMutation:l,useClaimAPageMutation:u,useDeleteClaimablePageMutation:c}=a},89685:function(e,t,r){"use strict";r.d(t,{B:function(){return l},K:function(){return o}});var n=r(36100),i=r(56456),s=r(94743),a=r(9782);let o=i.u.injectEndpoints({endpoints:e=>({getAllTaskListsByUser:e.query({async queryFn(e){let t=(0,n.IO)((0,n.hJ)(s.RZ,"task-list"),(0,n.ar)("author_id","==",e));return{data:await (0,a.W)(t)}}})}),overrideExisting:!0}),{useGetAllTaskListsByUserQuery:l}=o},69453:function(e,t,r){"use strict";r.d(t,{Fk:function(){return c},lr:function(){return l},wv:function(){return h}});var n=r(36100),i=r(56456),s=r(94743),a=r(9782),o=r(86650);let l=i.u.injectEndpoints({endpoints:e=>({getAllTaskListsByUser:e.query({async queryFn(e){let t=(0,n.IO)((0,n.hJ)(s.RZ,"task-list"),(0,n.ar)("author_id","==",e));return{data:await (0,a.W)(t)}}}),getProfilePictureURL:e.query({async queryFn(e){let t=await (0,o.Jt)((0,o.iH)(s.tO,"Users/".concat(e,".jpg")));return{data:t}}}),getUserById:e.query({async queryFn(e){let t=(await (0,s.GA)({user_id:e})).data;return{data:null==t?void 0:t.data}}}),getAllUsers:e.query({async queryFn(){let e=(0,n.IO)((0,n.hJ)(s.RZ,"users"),(0,n.ar)("verified","==",!0),(0,n.Xo)("created_at","desc"));return{data:await (0,a.W)(e)}}})}),overrideExisting:!0}),{useGetProfilePictureURLQuery:u,useGetUserByIdQuery:c,useGetAllUsersQuery:h}=l},9782:function(e,t,r){"use strict";r.d(t,{W:function(){return i}});var n=r(36100);async function i(e){let t=[],r=await (0,n.PL)(e);return r.forEach(e=>t.push({id:e.id,...e.data()})),t}},94743:function(e,t,r){"use strict";let n,i,s,a,o,l;r.d(t,{CD:function(){return tk},MX:function(){return tG},TZ:function(){return tI},y5:function(){return tC},I8:function(){return e9},AE:function(){return t_},yg:function(){return td},V$:function(){return th},OE:function(){return tJ},CQ:function(){return tY},Ad:function(){return tE},Bo:function(){return tT},IC:function(){return tm},iH:function(){return t0},Ld:function(){return tZ},eR:function(){return tb},RZ:function(){return e2},Rk:function(){return tw},_w:function(){return tN},H4:function(){return tp},P$:function(){return tO},AW:function(){return tR},hq:function(){return tS},jS:function(){return tz},CV:function(){return tX},Kk:function(){return tM},lA:function(){return tK},b7:function(){return e4},tP:function(){return ty},gn:function(){return tD},VI:function(){return tP},GA:function(){return tf},gG:function(){return tV},OF:function(){return tj},e9:function(){return tU},ji:function(){return tv},Go:function(){return t$},Yi:function(){return tq},VL:function(){return tA},U$:function(){return tx},tO:function(){return e3},M$:function(){return tg},n1:function(){return tH},gU:function(){return tW},xy:function(){return tQ},OK:function(){return tF}});var u,c,h=r(25816);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(0,h.KN)("firebase","10.1.0","app");var d=r(53333),f=r(74444),p=r(8463);let m=(e,t)=>t.some(t=>e instanceof t),g=new WeakMap,y=new WeakMap,v=new WeakMap,w=new WeakMap,b=new WeakMap,_={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return y.get(e);if("objectStoreNames"===t)return e.objectStoreNames||v.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return E(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function E(e){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(E(e.result)),n()},s=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&g.set(t,e)}).catch(()=>{}),b.set(t,e),t}(e);if(w.has(e))return w.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(T(this),e),E(g.get(this))}:function(...e){return E(t.apply(T(this),e))}:function(e,...r){let n=t.call(T(this),e,...r);return v.set(n,e.sort?e.sort():[e]),E(n)}:(t instanceof IDBTransaction&&function(e){if(y.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)});y.set(e,t)}(t),m(t,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,_):t;return r!==e&&(w.set(e,r),b.set(r,e)),r}let T=e=>b.get(e),S=["get","getKey","getAll","getAllKeys","count"],I=["put","add","delete","clear"],k=new Map;function C(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(k.get(t))return k.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,i=I.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||S.includes(r)))return;let s=async function(e,...t){let s=this.transaction(e,i?"readwrite":"readonly"),a=s.store;return n&&(a=a.index(t.shift())),(await Promise.all([a[r](...t),i&&s.done]))[0]};return k.set(t,s),s}_={...u=_,get:(e,t,r)=>C(e,t)||u.get(e,t,r),has:(e,t)=>!!C(e,t)||u.has(e,t)};let A="@firebase/installations",x="0.6.4",O=`w:${x}`,R="FIS_v2",N=new f.LL("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 f.ZR&&e.code.includes("request-failed")}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function P({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function M(e){return{token:e.token,requestStatus:2,expiresIn:Number(e.expiresIn.replace("s","000")),creationTime:Date.now()}}async function L(e,t){let r=await t.json(),n=r.error;return N.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function F({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}async function j(e){let t=await e();return t.status>=500&&t.status<600?e():t}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function U({appConfig:e,heartbeatServiceProvider:t},{fid:r}){let n=P(e),i=F(e),s=t.getImmediate({optional:!0});if(s){let e=await s.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}let a={fid:r,authVersion:R,appId:e.appId,sdkVersion:O},o={method:"POST",headers:i,body:JSON.stringify(a)},l=await j(()=>fetch(n,o));if(l.ok){let e=await l.json(),t={fid:e.fid||r,registrationStatus:2,refreshToken:e.refreshToken,authToken:M(e.authToken)};return t}throw await L("Create Installation",l)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function V(e){return new Promise(t=>{setTimeout(t,e)})}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let $=/^[cdef][\w-]{21}$/;/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function q(e){return`${e.appName}!${e.appId}`}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let z=new Map;function B(e,t){let r=q(e);H(r,t),function(e,t){let r=(!K&&"BroadcastChannel"in self&&((K=new BroadcastChannel("[Firebase] FID Change")).onmessage=e=>{H(e.data.key,e.data.fid)}),K);r&&r.postMessage({key:e,fid:t}),0===z.size&&K&&(K.close(),K=null)}(r,t)}function H(e,t){let r=z.get(e);if(r)for(let e of r)e(t)}let K=null,G="firebase-installations-store",W=null;function Q(){return W||(W=function(e,t,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){let a=indexedDB.open(e,1),o=E(a);return n&&a.addEventListener("upgradeneeded",e=>{n(E(a.result),e.oldVersion,e.newVersion,E(a.transaction))}),r&&a.addEventListener("blocked",()=>r()),o.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",()=>i())}).catch(()=>{}),o}("firebase-installations-database",0,{upgrade:(e,t)=>{0===t&&e.createObjectStore(G)}})),W}async function J(e,t){let r=q(e),n=await Q(),i=n.transaction(G,"readwrite"),s=i.objectStore(G),a=await s.get(r);return await s.put(t,r),await i.done,a&&a.fid===t.fid||B(e,t.fid),t}async function Y(e){let t=q(e),r=await Q(),n=r.transaction(G,"readwrite");await n.objectStore(G).delete(t),await n.done}async function X(e,t){let r=q(e),n=await Q(),i=n.transaction(G,"readwrite"),s=i.objectStore(G),a=await s.get(r),o=t(a);return void 0===o?await s.delete(r):await s.put(o,r),await i.done,o&&(!a||a.fid!==o.fid)&&B(e,o.fid),o}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function Z(e){let t;let r=await X(e.appConfig,r=>{let n=function(e){let t=e||{fid:function(){try{let e=new Uint8Array(17),t=self.crypto||self.msCrypto;t.getRandomValues(e),e[0]=112+e[0]%16;let r=function(e){let t=/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){let t=btoa(String.fromCharCode(...e));return t.replace(/\+/g,"-").replace(/\//g,"_")}(e);return t.substr(0,22)}(e);return $.test(r)?r:""}catch(e){return""}}(),registrationStatus:0};return en(t)}(r),i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){let e=Promise.reject(N.create("app-offline"));return{installationEntry:t,registrationPromise:e}}let r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=ee(e,r);return{installationEntry:r,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:et(e)}:{installationEntry:t}}(e,n);return t=i.registrationPromise,i.installationEntry});return""===r.fid?{installationEntry:await t}:{installationEntry:r,registrationPromise:t}}async function ee(e,t){try{let r=await U(e,t);return J(e.appConfig,r)}catch(r){throw D(r)&&409===r.customData.serverCode?await Y(e.appConfig):await J(e.appConfig,{fid:t.fid,registrationStatus:0}),r}}async function et(e){let t=await er(e.appConfig);for(;1===t.registrationStatus;)await V(100),t=await er(e.appConfig);if(0===t.registrationStatus){let{installationEntry:t,registrationPromise:r}=await Z(e);return r||t}return t}function er(e){return X(e,e=>{if(!e)throw N.create("installation-not-found");return en(e)})}function en(e){return 1===e.registrationStatus&&e.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function ei({appConfig:e,heartbeatServiceProvider:t},r){let n=function(e,{fid:t}){return`${P(e)}/${t}/authTokens:generate`}(e,r),i=function(e,{refreshToken:t}){let r=F(e);return r.append("Authorization",`${R} ${t}`),r}(e,r),s=t.getImmediate({optional:!0});if(s){let e=await s.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}let a={installation:{sdkVersion:O,appId:e.appId}},o={method:"POST",headers:i,body:JSON.stringify(a)},l=await j(()=>fetch(n,o));if(l.ok){let e=await l.json(),t=M(e);return t}throw await L("Generate Auth Token",l)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function es(e,t=!1){let r;let n=await X(e.appConfig,n=>{var i;if(!eu(n))throw N.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=ea(e,t),n;{if(!navigator.onLine)throw N.create("app-offline");let t=function(e){let t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(n);return r=el(e,t),t}}),i=r?await r:n.authToken;return i}async function ea(e,t){let r=await eo(e.appConfig);for(;1===r.authToken.requestStatus;)await V(100),r=await eo(e.appConfig);let n=r.authToken;return 0===n.requestStatus?es(e,t):n}function eo(e){return X(e,e=>{if(!eu(e))throw N.create("not-registered");let t=e.authToken;return 1===t.requestStatus&&t.requestTime+1e4<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function el(e,t){try{let r=await ei(e,t),n=Object.assign(Object.assign({},t),{authToken:r});return await J(e.appConfig,n),r}catch(r){if(D(r)&&(401===r.customData.serverCode||404===r.customData.serverCode))await Y(e.appConfig);else{let r=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await J(e.appConfig,r)}throw r}}function eu(e){return void 0!==e&&2===e.registrationStatus}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function ec(e){let{installationEntry:t,registrationPromise:r}=await Z(e);return r?r.catch(console.error):es(e).catch(console.error),t.fid}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eh(e,t=!1){await ed(e);let r=await es(e,t);return r.token}async function ed(e){let{registrationPromise:t}=await Z(e);t&&await t}function ef(e){return N.create("missing-app-config-values",{valueName:e})}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ep="installations";(0,h.Xd)(new p.wA(ep,e=>{let t=e.getProvider("app").getImmediate(),r=/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){if(!e||!e.options)throw ef("App Configuration");if(!e.name)throw ef("App Name");for(let t of["projectId","apiKey","appId"])if(!e.options[t])throw ef(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),n=(0,h.qX)(t,"heartbeat");return{app:t,appConfig:r,heartbeatServiceProvider:n,_delete:()=>Promise.resolve()}},"PUBLIC")),(0,h.Xd)(new p.wA("installations-internal",e=>{let t=e.getProvider("app").getImmediate(),r=(0,h.qX)(t,ep).getImmediate();return{getId:()=>ec(r),getToken:e=>eh(r,e)}},"PRIVATE")),(0,h.KN)(A,x),(0,h.KN)(A,x,"esm2017");/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let em="analytics",eg="https://www.googletagmanager.com/gtag/js",ey=new d.Yd("@firebase/analytics"),ev=new f.LL("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-intialized 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}."});/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ew(e){if(!e.startsWith(eg)){let t=ev.create("invalid-gtag-resource",{gtagURL:e});return ey.warn(t.message),""}return e}function eb(e){return Promise.all(e.map(e=>e.catch(e=>e)))}async function e_(e,t,r,n,i,s){let a=n[i];try{if(a)await t[a];else{let e=await eb(r),n=e.find(e=>e.measurementId===i);n&&await t[n.appId]}}catch(e){ey.error(e)}e("config",i,s)}async function eE(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 eb(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){ey.error(e)}}let eT=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};async function eS(e){var t;let{appId:r,apiKey:n}=e,i={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":n})},s="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",r),a=await fetch(s,i);if(200!==a.status&&304!==a.status){let e="";try{let r=await a.json();(null===(t=r.error)||void 0===t?void 0:t.message)&&(e=r.error.message)}catch(e){}throw ev.create("config-fetch-failed",{httpStatus:a.status,responseMessage:e})}return a.json()}async function eI(e,t=eT,r){let{appId:n,apiKey:i,measurementId:s}=e.options;if(!n)throw ev.create("no-app-id");if(!i){if(s)return{measurementId:s,appId:n};throw ev.create("no-api-key")}let a=t.getThrottleMetadata(n)||{backoffCount:0,throttleEndTimeMillis:Date.now()},o=new eC;return setTimeout(async()=>{o.abort()},void 0!==r?r:6e4),ek({appId:n,apiKey:i,measurementId:s},a,o,t)}async function ek(e,{throttleEndTimeMillis:t,backoffCount:r},n,i=eT){var s;let{appId:a,measurementId:o}=e;try{await new Promise((e,r)=>{let i=Math.max(t-Date.now(),0),s=setTimeout(e,i);n.addEventListener(()=>{clearTimeout(s),r(ev.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}catch(e){if(o)return ey.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. [${null==e?void 0:e.message}]`),{appId:a,measurementId:o};throw e}try{let t=await eS(e);return i.deleteThrottleMetadata(a),t}catch(u){if(!function(e){if(!(e instanceof f.ZR)||!e.customData)return!1;let t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(u)){if(i.deleteThrottleMetadata(a),o)return ey.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. [${null==u?void 0:u.message}]`),{appId:a,measurementId:o};throw u}let t=503===Number(null===(s=null==u?void 0:u.customData)||void 0===s?void 0:s.httpStatus)?(0,f.$s)(r,i.intervalMillis,30):(0,f.$s)(r,i.intervalMillis),l={throttleEndTimeMillis:Date.now()+t,backoffCount:r+1};return i.setThrottleMetadata(a,l),ey.debug(`Calling attemptFetch again in ${t} millis`),ek(e,l,n,i)}}class eC{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function eA(e,t,r,n,i){if(i&&i.global){e("event",r,n);return}{let i=await t,s=Object.assign(Object.assign({},n),{send_to:i});e("event",r,s)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function ex(){if(!(0,f.hl)())return ey.warn(ev.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await (0,f.eu)()}catch(e){return ey.warn(ev.create("indexeddb-unavailable",{errorInfo:null==e?void 0:e.toString()}).message),!1}return!0}async function eO(e,t,r,n,i,o,l){var u;let c=eI(e);c.then(t=>{r[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&ey.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=>ey.error(e)),t.push(c);let h=ex().then(e=>e?n.getId():void 0),[d,f]=await Promise.all([c,h]);!function(e){let t=window.document.getElementsByTagName("script");for(let r of Object.values(t))if(r.src&&r.src.includes(eg)&&r.src.includes(e))return r;return null}(o)&&function(e,t){let r;let n=(window.trustedTypes&&(r=window.trustedTypes.createPolicy("firebase-js-sdk-policy",{createScriptURL:ew})),r),i=document.createElement("script"),s=`${eg}?l=${e}&id=${t}`;i.src=n?null==n?void 0:n.createScriptURL(s):s,i.async=!0,document.head.appendChild(i)}(o,d.measurementId),a&&(i("consent","default",a),a=void 0),i("js",new Date);let p=null!==(u=null==l?void 0:l.config)&&void 0!==u?u:{};return p.origin="firebase",p.update=!0,null!=f&&(p.firebase_id=f),i("config",d.measurementId,p),s&&(i("set",s),s=void 0),d.measurementId}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eR{constructor(e){this.app=e}_delete(){return delete eN[this.app.options.appId],Promise.resolve()}}let eN={},eD=[],eP={},eM="dataLayer",eL=!1,eF="@firebase/analytics",ej="0.10.0";(0,h.Xd)(new p.wA(em,(e,{options:t})=>{let r=e.getProvider("app").getImmediate(),n=e.getProvider("installations-internal").getImmediate();return function(e,t,r){!function(){let e=[];if((0,f.ru)()&&e.push("This is a browser extension environment."),(0,f.zI)()||e.push("Cookies are not available."),e.length>0){let t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),r=ev.create("invalid-analytics-context",{errorInfo:t});ey.warn(r.message)}}();let n=e.options.appId;if(!n)throw ev.create("no-app-id");if(!e.options.apiKey){if(e.options.measurementId)ey.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 ev.create("no-api-key")}if(null!=eN[n])throw ev.create("already-exists",{id:n});if(!eL){var i,s;let e,t;e=[],Array.isArray(window[eM])?e=window[eM]:window[eM]=e;let{wrappedGtag:r,gtagCore:n}=(i="gtag",t=function(...e){window[eM].push(arguments)},window[i]&&"function"==typeof window[i]&&(t=window[i]),window[i]=(s=t,async function(e,...t){try{if("event"===e){let[e,r]=t;await eE(s,eN,eD,e,r)}else if("config"===e){let[e,r]=t;await e_(s,eN,eD,eP,e,r)}else if("consent"===e){let[e]=t;s("consent","update",e)}else if("get"===e){let[e,r,n]=t;s("get",e,r,n)}else if("set"===e){let[e]=t;s("set",e)}else s(e,...t)}catch(e){ey.error(e)}}),{gtagCore:t,wrappedGtag:window[i]});l=r,o=n,eL=!0}eN[n]=eO(e,eD,eP,t,o,eM,r);let a=new eR(e);return a}(r,n,t)},"PUBLIC")),(0,h.Xd)(new p.wA("analytics-internal",function(e){try{let t=e.getProvider(em).getImmediate();return{logEvent:(e,r,n)=>(function(e,t,r,n){eA(l,eN[(e=(0,f.m9)(e)).app.options.appId],t,r,n).catch(e=>ey.error(e))})(t,e,r,n)}}catch(e){throw ev.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),(0,h.KN)(eF,ej),(0,h.KN)(eF,ej,"esm2017");var eU=r(36100),eV=r(78952);function e$(e,t){let r={};for(let n in e)e.hasOwnProperty(n)&&(r[n]=t(e[n]));return r}function eq(e){if(null==e)return e;if(e["@type"])switch(e["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":{let t=Number(e.value);if(isNaN(t))throw Error("Data cannot be decoded from JSON: "+e);return t}default:throw Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map(e=>eq(e)):"function"==typeof e||"object"==typeof e?e$(e,e=>eq(e)):e}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ez="functions",eB={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class eH extends f.ZR{constructor(e,t,r){super(`${ez}/${e}`,t||""),this.details=r}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eK{constructor(e,t,r){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then(e=>this.auth=e,()=>{}),this.messaging||t.get().then(e=>this.messaging=e,()=>{}),this.appCheck||r.get().then(e=>this.appCheck=e,()=>{})}async getAuthToken(){if(this.auth)try{let e=await this.auth.getToken();return null==e?void 0:e.accessToken}catch(e){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(e){return}}async getAppCheckToken(e){if(this.appCheck){let t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){let t=await this.getAuthToken(),r=await this.getMessagingToken(),n=await this.getAppCheckToken(e);return{authToken:t,messagingToken:r,appCheckToken:n}}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let eG="us-central1";class eW{constructor(e,t,r,n,i=eG,s){this.app=e,this.fetchImpl=s,this.emulatorOrigin=null,this.contextProvider=new eK(t,r,n),this.cancelAllRequests=new Promise(e=>{this.deleteService=()=>Promise.resolve(e())});try{let e=new URL(i);this.customDomain=e.origin,this.region=eG}catch(e){this.customDomain=null,this.region=i}}_delete(){return this.deleteService()}_url(e){let t=this.app.options.projectId;if(null!==this.emulatorOrigin){let r=this.emulatorOrigin;return`${r}/${t}/${this.region}/${e}`}return null!==this.customDomain?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`}}async function eQ(e,t,r,n){let i;r["Content-Type"]="application/json";try{i=await n(e,{method:"POST",body:JSON.stringify(t),headers:r})}catch(e){return{status:0,json:null}}let s=null;try{s=await i.json()}catch(e){}return{status:i.status,json:s}}async function eJ(e,t,r,n){let i;r=function e(t){if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"==typeof t&&isFinite(t)||!0===t||!1===t||"[object String]"===Object.prototype.toString.call(t))return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(t=>e(t));if("function"==typeof t||"object"==typeof t)return e$(t,t=>e(t));throw Error("Data cannot be encoded in JSON: "+t)}(r);let s={data:r},a={},o=await e.contextProvider.getContext(n.limitedUseAppCheckTokens);o.authToken&&(a.Authorization="Bearer "+o.authToken),o.messagingToken&&(a["Firebase-Instance-ID-Token"]=o.messagingToken),null!==o.appCheckToken&&(a["X-Firebase-AppCheck"]=o.appCheckToken);let l=n.timeout||7e4,u=(i=null,{promise:new Promise((e,t)=>{i=setTimeout(()=>{t(new eH("deadline-exceeded","deadline-exceeded"))},l)}),cancel:()=>{i&&clearTimeout(i)}}),c=await Promise.race([eQ(t,s,a,e.fetchImpl),u.promise,e.cancelAllRequests]);if(u.cancel(),!c)throw new eH("cancelled","Firebase Functions instance was deleted.");let h=function(e,t){let r,n=function(e){if(e>=200&&e<300)return"ok";switch(e){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),i=n;try{let e=t&&t.error;if(e){let t=e.status;if("string"==typeof t){if(!eB[t])return new eH("internal","internal");n=eB[t],i=t}let s=e.message;"string"==typeof s&&(i=s),r=e.details,void 0!==r&&(r=eq(r))}}catch(e){}return"ok"===n?null:new eH(n,i,r)}(c.status,c.json);if(h)throw h;if(!c.json)throw new eH("internal","Response is not valid JSON object.");let d=c.json.data;if(void 0===d&&(d=c.json.result),void 0===d)throw new eH("internal","Response is missing data field.");let f=eq(d);return{data:f}}let eY="@firebase/functions",eX="0.10.0";function eZ(e,t,r){var n;return n=(0,f.m9)(e),e=>(function(e,t,r,n){let i=e._url(t);return eJ(e,i,r,n)})(n,t,e,r||{})}c=fetch.bind(self),(0,h.Xd)(new p.wA(ez,(e,{instanceIdentifier:t})=>{let r=e.getProvider("app").getImmediate(),n=e.getProvider("auth-internal"),i=e.getProvider("messaging-internal"),s=e.getProvider("app-check-internal");return new eW(r,n,i,s,t,c)},"PUBLIC").setMultipleInstances(!0)),(0,h.KN)(eY,eX,void 0),(0,h.KN)(eY,eX,"esm2017");var e0=r(86650);let e1=(0,h.ZF)({apiKey:"AIzaSyDxVSNCjxYEY2WzetQP46OyU47xpyDvkJg",authDomain:"givell.firebaseapp.com",projectId:"givell",storageBucket:"givell.appspot.com",messagingSenderId:"540736662274",appId:"1:540736662274:web:a714482d9526efe229b01b",measurementId:"G-VT6GQGTRXK"}),e2=(0,eU.ad)(e1),e4=eU.Bt,e6=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e=(0,h.Mq)(),t=eG){let r=(0,h.qX)((0,f.m9)(e),ez),n=r.getImmediate({identifier:t}),i=(0,f.P0)("functions");return i&&function(e,t,r){(0,f.m9)(e).emulatorOrigin=`http://${t}:${r}`}(n,...i),n}(e1),e9=(0,eV.v0)(e1),e3=(0,e0.cF)(e1);console.log(e2._settingsFrozen);let e5=eZ(e6,"acceptrequest"),e8=eZ(e6,"sendrequest"),e7=eZ(e6,"sendcontactform"),te=eZ(e6,"sendloginproblem");eZ(e6,"acceptsecureid");let tt=eZ(e6,"loginrequest"),tr=eZ(e6,"stripeCreateIntent"),tn=eZ(e6,"sendNotification"),ti=eZ(e6,"getAccountLink"),ts=eZ(e6,"getStripeAccount"),ta=eZ(e6,"changeemail"),to=eZ(e6,"deleteaccount"),tl=eZ(e6,"deleteanyaccountadmin"),tu=eZ(e6,"getBalanceGivell"),tc=eZ(e6,"disconnectStripe"),th=eZ(e6,"createClaimablePage"),td=eZ(e6,"claimAPage"),tf=eZ(e6,"getUserById"),tp=eZ(e6,"getAllClaimablePages"),tm=eZ(e6,"deleteClaimablePage"),tg=async(e,t,r,n,i,s,a,o,l,u)=>{try{let c=await tr({amount:e,taskId:t,taskListId:r,author_email:n,author_first_name:i,author_last_name:s,creator_id:a,author_id:o,anonymous:l,feesCovered:u});return c.data}catch(e){return console.log(e),!1}},ty=async()=>{try{var e;let t=await ts();return null===(e=t.data)||void 0===e?void 0:e.result}catch(e){return console.log(e),!1}},tv=async e=>{try{let t=await tt({email:e,debug:!1});return t.data}catch(e){return console.log(e),!1}},tw=async e=>{try{let t=await ti({debug:!1,returnUrl:e});return t.data}catch(e){return console.log(e),!1}},tb=async e=>{try{var t;let r=await tc({debug:!1,returnUrl:e});return null===(t=r.data)||void 0===t?void 0:t.result}catch(e){return console.log(e),!1}},t_=async e=>{try{let t=await ta({email:e,debug:!1});return t.data}catch(e){return console.log(e),!1}},tE=async()=>{try{var e;let t=await to();return null===(e=t.data)||void 0===e?void 0:e.result}catch(e){return console.log(e),!1}},tT=async e=>{try{let t=await tl({uid:e});return t.data}catch(e){return console.log(e),!1}},tS=async e=>{try{var t;let r=await tu({uid:e});return null===(t=r.data)||void 0===t?void 0:t.result}catch(e){return console.log(e),!1}},tI=async e=>{try{let{valueInputEmail:t,valueInputFirstName:r,valueInputLastName:n,valueInputMainSocial:i}=e,s=await e8({email:t,firstName:r,lastName:n,socialLink:i});return s.data}catch(e){return console.log("ERROR addRequest: ",e),!1}},tk=async e=>{let{email:t,message:r,reason:n}=e;try{return await e7({email:t,message:r,reason:n}),!0}catch(e){return console.log("ERROR contact form: ",e),!1}},tC=async e=>{let{email:t,otherEmail:r,fullName:n,problem:i}=e;try{return await te({email:t,emailOther:r,fullName:n,problem:i}),!0}catch(e){return console.log("ERROR login problem form: ",e),!1}},tA=async(e,t,r)=>{var n=new Date;n.setMinutes(n.getMinutes()+5);try{return await tJ(null,"notifications",{title:e,buttonText:t,buttonLink:r,created_at:n,type:"givell",userId:"all"}),!0}catch(e){return console.log("ERROR notification: ",e),!1}},tx=async e=>{try{return await tn({notificationId:e}),!0}catch(e){return console.log("ERROR notification: ",e),!1}},tO=e=>{try{let t=(0,eU.hJ)(e2,"request"),r=(0,eU.IO)(t,(0,eU.Xo)("created_at","desc"));return tL(r,e)}catch(e){return console.log(e),e}},tR=e=>{try{let t=(0,eU.hJ)(e2,"users"),r=(0,eU.IO)(t,(0,eU.ar)("to_claim","==",!1),(0,eU.Xo)("created_at","desc"));return tL(r,e)}catch(e){return console.log(e),e}},tN=e=>{try{let t=(0,eU.hJ)(e2,"notifications"),r=(0,eU.IO)(t,(0,eU.Xo)("created_at","desc"));return tL(r,e)}catch(e){return console.log(e),e}},tD=(e,t)=>{try{let r=(0,eU.hJ)(e2,"task-list",t,"tasks"),n=(0,eU.IO)(r,(0,eU.Xo)("raised","desc"),(0,eU.Xo)("created_at","desc"));return tL(n,e)}catch(e){return console.log(e),e}},tP=(e,t)=>{try{let r=(0,eU.hJ)(e2,"task-list"),n=(0,eU.IO)(r,(0,eU.ar)("author_id","==",t),(0,eU.Xo)("created_at","desc"));return tL(n,e)}catch(e){return console.log(e),e}},tM=async e=>{try{let t=[],r=(0,eU.B$)(e2,"donation"),n=(0,eU.IO)(r,(0,eU.ar)("creator_id","==",e),(0,eU.Xo)("created_at","desc")),i=await (0,eU.PL)(n);for(let e=0;e<i.docs.length;e++){let r=i.docs[e];t=[...t,{...r.data(),id:r.id}]}return t}catch(e){return console.log(e),e}};function tL(e,t){try{let r=(0,eU.cf)(e,e=>{let r=[];e.forEach(e=>{r.push({...e.data(),id:e.id})}),t(r)});return r}catch(e){return console.log(e),e}}let tF=async(e,t)=>{try{let r=await e5({id:e,option:t});return r.data.error&&console.log(r.data.error),{error:r.data.error,result:r.data.result}}catch(e){return console.log(e),{error:e,result:null}}},tj=async e=>{try{let t=(0,eU.hJ)(e2,"users"),r=(0,eU.JU)(t,e),n=(await (0,eU.QT)(r)).data();if(null!=n)return{...n,id:e};return null}catch(e){return null}},tU=(e,t)=>{try{let r=(0,eU.hJ)(e2,"users"),n=(0,eU.JU)(r,e),i=(0,eU.cf)(n,async e=>{t({...e.data(),id:e.id})});return i}catch(e){return null}},tV=async e=>{try{let t=(0,eU.B$)(e2,"notifications"),r=(0,eU.IO)(t,(0,eU.ar)("userId","in",[e,"all"]),(0,eU.ar)("created_at","<",new Date),(0,eU.Xo)("created_at","desc")),n=await (0,eU.PL)(r),i=await Promise.all(n.docs.map(async t=>"all"==t.data().userId?{...t.data(),id:t.id,read:(await (0,eU.QT)((0,eU.JU)((0,eU.hJ)(e2,"notifications",t.id,"read"),e))).exists()}:{...t.data(),id:t.id}));return i}catch(e){return console.log(e),e}},t$=async(e,t)=>{try{let r;if("all"==e.userId)return r=(0,eU.JU)((0,eU.hJ)(e2,"notifications",e.id,"read"),t),await (0,eU.pl)(r,{read:!0},{merge:!0});return r=(0,eU.JU)((0,eU.hJ)(e2,"users",e.userId,"notifications"),e.id),await (0,eU.r7)(r,{read:!0})}catch(e){return console.log(e),e}},tq=async e=>{try{let t=(0,eU.JU)((0,eU.hJ)(e2,"users"),e);return await (0,eU.r7)(t,{tutorialRead:!0})}catch(e){return console.log(e),e}},tz=async(e,t)=>{try{let r=(0,eU.hJ)(e2,t),n=(0,eU.JU)(r,e),i=(await (0,eU.QT)(n)).data();if(null!=i)return{...i,id:e};return}catch(e){return console.log(e),e}};async function tB(e,t,r){let n=(0,e0.iH)(e3,e+"/"+r);return await (0,e0.KV)(n,t,{contentType:null==t?void 0:t.type}),await (0,e0.Jt)(n)}async function tH(e,t){try{let r=await tB("Users",e,t);return await tW(t,"users",{avatar:r}),{url:r,change:!0}}catch(e){console.log(e)}}function tK(e){return(0,eU.JU)((0,eU.hJ)(e2,"task-list",e,"tasks")).id}async function tG(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[];for(let i=0;i<e.length;i++){let s=e[i],a=r?"documents/filetask/"+t+"/"+s.name:"documents/"+t+"/"+s.name,o=(0,e0.iH)(e3,a);await (0,e0.KV)(o,s,{contentType:null==s?void 0:s.type});let l=await (0,e0.Jt)(o);n.push(l)}return n}let tW=async(e,t,r)=>{try{let n=(0,eU.JU)((0,eU.hJ)(e2,t),e);return await (0,eU.r7)(n,r),!0}catch(e){return console.log(e),!1}},tQ=async(e,t,r,n,i)=>{try{let s=(0,eU.JU)(e2,t,e,n,i);return await (0,eU.r7)(s,r)}catch(e){return console.log(e),e}},tJ=async(e,t,r)=>{try{let n=e?(0,eU.JU)((0,eU.hJ)(e2,t),e):(0,eU.JU)((0,eU.hJ)(e2,t));return await (0,eU.pl)(n,r,{merge:!0}),!0}catch(e){return console.log(e),!1}},tY=async(e,t,r,n)=>{try{let i=(0,eU.hJ)(e2,t,e,n);return await (0,eU.ET)(i,r)}catch(e){return console.log(e),e}},tX=async(e,t,r,n,i)=>{try{let s=[],a=(0,eU.hJ)(e2,t,e,r,n,i),o=(0,eU.IO)(a,(0,eU.Xo)("created_at","desc")),l=await (0,eU.PL)(o);for(let e=0;e<l.docs.length;e++){let t=l.docs[e];s=[...s,{...t.data(),id:t.id}]}return s}catch(e){return console.log(e),e}},tZ=async(e,t,r,n)=>{try{let i=(0,eU.JU)(e2,e,t,r,n);return await (0,eU.oe)(i),!0}catch(e){return console.log(e),e}},t0=async(e,t)=>{try{let r=(0,eU.JU)(e2,e,t);return await (0,eU.oe)(r),!0}catch(e){return console.log(e),e}}},38514:function(e,t,r){"use strict";r.d(t,{c4:function(){return a},hf:function(){return s}});var n=r(15060);let i=(0,n.oM)({name:"admin",initialState:{displayedPage:"list",currentClaimablePage:null},reducers:{navigate(e,t){"create"==e.displayedPage&&null!==e.currentClaimablePage&&(e.currentClaimablePage=null),e.displayedPage=t.payload},editClaimablePage(e,t){e.currentClaimablePage=t.payload,e.displayedPage="create"}}}),{editClaimablePage:s,navigate:a}=i.actions;t.ZP=i.reducer},88392:function(e,t,r){"use strict";r.d(t,{$:function(){return s}});var n=r(15060);let i=(0,n.oM)({name:"modal",initialState:{claimMyPageModal:!1,succesClaimModal:!1},reducers:{toggleModal(e,t){switch(t.payload){case"claim":e.claimMyPageModal=!e.claimMyPageModal;break;case"succes_claim":e.succesClaimModal=!e.succesClaimModal}}}}),{toggleModal:s}=i.actions;t.Z=i.reducer},10567:function(e,t,r){"use strict";r.d(t,{av:function(){return s}});var n=r(15060);let i=(0,n.oM)({name:"users",initialState:{user:null},reducers:{setUser(e,t){let r=t.payload;localStorage.setItem("current_user",JSON.stringify(r)),e.user=r},refreshUser(e){e.user=JSON.parse(localStorage.getItem("current_user"))}}}),{setUser:s,refreshUser:a}=i.actions;t.ZP=i.reducer},66973:function(e,t,r){"use strict";r.d(t,{S:function(){return s},t:function(){return i}});var n=r(54465);let i=(0,n.J)("pk_live_51NMEA0DLF2aH6WAK2ZBU93Q9FAYQLAsXwpErCYuGEp1mTeEN15H5XpgGPpwCeLlhruQj8yWp7YWb2onyllD5cCSD00RGgBvFYx"),s={labels:"floating",theme:"flat",variables:{fontLineHeight:"1.5",borderRadius:"20px",colorPrimaryText:"#101010",outline:"1px solid #101010",tabIconSelectedColor:"#fff",spacingUnit:"2px"},rules:{".Block":{backgroundColor:"var(--colorBackground)",boxShadow:"none",padding:"12px"},".Input":{padding:"12px",outline:"1px solid #101010",boxShadow:"none",backgroundColor:"transparent"},".Input:disabled, .Input--invalid:disabled":{color:"lightgray"},".Input:hover":{outline:"2px solid #101010"},".Input:focus":{boxShadow:"none",outline:"2px solid #101010"},".Tab":{padding:"10px 12px 8px 12px",backgroundColor:"#f3f3f3"},".Tab:hover":{outline:"2px solid #101010"},".Tab--selected, .Tab--selected:hover":{backgroundColor:"#101010",color:"#fff"},".Label":{fontWeight:"400",color:"#101010",opacity:"50%"},".Label--floating":{opacity:"100%"}}}},84805:function(e,t,r){"use strict";r.d(t,{B:function(){return i}});var n=r(67294);let i=()=>{let[e,t]=(0,n.useState)(!1),r=()=>{var e;let t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t};return(0,n.useEffect)(()=>{t(r())},[]),e}},28243:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return m}});let n=r(38754),i=r(61757),s=i._(r(67294)),a=n._(r(73902)),o=r(85257),l=r(2093),u=r(72493);r(92078);let c=n._(r(20414)),h={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function d(e,t,r,n,i,s){let a=null==e?void 0:e.src;if(!e||e["data-loaded-src"]===a)return;e["data-loaded-src"]=a;let o="decode"in e?e.decode():Promise.resolve();o.catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("blur"===t&&i(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,i=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}(null==n?void 0:n.current)&&n.current(e)}})}function f(e){let[t,r]=s.version.split("."),n=parseInt(t,10),i=parseInt(r,10);return n>18||18===n&&i>=3?{fetchPriority:e}:{fetchpriority:e}}let p=(0,s.forwardRef)((e,t)=>{let{src:r,srcSet:n,sizes:i,height:a,width:o,decoding:l,className:u,style:c,fetchPriority:h,placeholder:p,loading:m,unoptimized:g,fill:y,onLoadRef:v,onLoadingCompleteRef:w,setBlurComplete:b,setShowAltText:_,onLoad:E,onError:T,...S}=e;return s.default.createElement("img",{...S,...f(h),loading:m,width:o,height:a,decoding:l,"data-nimg":y?"fill":"1",className:u,style:c,sizes:i,srcSet:n,src:r,ref:(0,s.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(T&&(e.src=e.src),e.complete&&d(e,p,v,w,b,g))},[r,p,v,w,b,T,g,t]),onLoad:e=>{let t=e.currentTarget;d(t,p,v,w,b,g)},onError:e=>{_(!0),"blur"===p&&b(!0),T&&T(e)}})}),m=(0,s.forwardRef)((e,t)=>{let r=(0,s.useContext)(u.ImageConfigContext),n=(0,s.useMemo)(()=>{let e=h||r||l.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n}},[r]),{onLoad:i,onLoadingComplete:d}=e,m=(0,s.useRef)(i);(0,s.useEffect)(()=>{m.current=i},[i]);let g=(0,s.useRef)(d);(0,s.useEffect)(()=>{g.current=d},[d]);let[y,v]=(0,s.useState)(!1),[w,b]=(0,s.useState)(!1),{props:_,meta:E}=(0,o.getImgProps)(e,{defaultLoader:c.default,imgConf:n,blurComplete:y,showAltText:w});return s.default.createElement(s.default.Fragment,null,s.default.createElement(p,{..._,unoptimized:E.unoptimized,placeholder:E.placeholder,fill:E.fill,onLoadRef:m,onLoadingCompleteRef:g,setBlurComplete:v,setShowAltText:b,ref:t}),E.priority?s.default.createElement(a.default,null,s.default.createElement("link",{key:"__nimg-"+_.src+_.srcSet+_.sizes,rel:"preload",as:"image",href:_.srcSet?void 0:_.src,imageSrcSet:_.srcSet,imageSizes:_.sizes,crossOrigin:_.crossOrigin,referrerPolicy:_.referrerPolicy,...f(_.fetchPriority)})):null)});("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)},85257:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return o}}),r(92078);let n=r(58832),i=r(2093);function s(e){return void 0!==e.default}function a(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function o(e,t){var r;let o,l,u,{src:c,sizes:h,unoptimized:d=!1,priority:f=!1,loading:p,className:m,quality:g,width:y,height:v,fill:w=!1,style:b,onLoad:_,onLoadingComplete:E,placeholder:T="empty",blurDataURL:S,fetchPriority:I,layout:k,objectFit:C,objectPosition:A,lazyBoundary:x,lazyRoot:O,...R}=e,{imgConf:N,showAltText:D,blurComplete:P,defaultLoader:M}=t,L=N||i.imageConfigDefault;if("allSizes"in L)o=L;else{let e=[...L.deviceSizes,...L.imageSizes].sort((e,t)=>e-t),t=L.deviceSizes.sort((e,t)=>e-t);o={...L,allSizes:e,deviceSizes:t}}let F=R.loader||M;delete R.loader,delete R.srcSet;let j="__next_img_default"in F;if(j){if("custom"===o.loader)throw Error('Image with src "'+c+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=F;F=t=>{let{config:r,...n}=t;return e(n)}}if(k){"fill"===k&&(w=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[k];e&&(b={...b,...e});let t={responsive:"100vw",fill:"100vw"}[k];t&&!h&&(h=t)}let U="",V=a(y),$=a(v);if("object"==typeof(r=c)&&(s(r)||void 0!==r.src)){let e=s(c)?c.default:c;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(l=e.blurWidth,u=e.blurHeight,S=S||e.blurDataURL,U=e.src,!w){if(V||$){if(V&&!$){let t=V/e.width;$=Math.round(e.height*t)}else if(!V&&$){let t=$/e.height;V=Math.round(e.width*t)}}else V=e.width,$=e.height}}let q=!f&&("lazy"===p||void 0===p);(!(c="string"==typeof c?c:U)||c.startsWith("data:")||c.startsWith("blob:"))&&(d=!0,q=!1),o.unoptimized&&(d=!0),j&&c.endsWith(".svg")&&!o.dangerouslyAllowSVG&&(d=!0),f&&(I="high");let z=a(g),B=Object.assign(w?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:A}:{},D?{}:{color:"transparent"},b),H="blur"===T&&S&&!P?{backgroundSize:B.objectFit||"cover",backgroundPosition:B.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:V,heightInt:$,blurWidth:l,blurHeight:u,blurDataURL:S,objectFit:B.objectFit})+'")'}:{},K=function(e){let{config:t,src:r,unoptimized:n,width:i,quality:s,sizes:a,loader:o}=e;if(n)return{src:r,srcSet:void 0,sizes:void 0};let{widths:l,kind:u}=function(e,t,r){let{deviceSizes:n,allSizes:i}=e;if(r){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let n;n=e.exec(r);n)t.push(parseInt(n[2]));if(t.length){let e=.01*Math.min(...t);return{widths:i.filter(t=>t>=n[0]*e),kind:"w"}}return{widths:i,kind:"w"}}if("number"!=typeof t)return{widths:n,kind:"w"};let s=[...new Set([t,2*t].map(e=>i.find(t=>t>=e)||i[i.length-1]))];return{widths:s,kind:"x"}}(t,i,a),c=l.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:l.map((e,n)=>o({config:t,src:r,quality:s,width:e})+" "+("w"===u?e:n+1)+u).join(", "),src:o({config:t,src:r,quality:s,width:l[c]})}}({config:o,src:c,unoptimized:d,width:V,quality:z,sizes:h,loader:F}),G={...R,loading:q?"lazy":p,fetchPriority:I,width:V,height:$,decoding:"async",className:m,style:{...B,...H},sizes:K.sizes,srcSet:K.srcSet,src:K.src},W={unoptimized:d,priority:f,placeholder:T,fill:w};return{props:G,meta:W}}},58832:function(e,t){"use strict";function r(e){let{widthInt:t,heightInt:r,blurWidth:n,blurHeight:i,blurDataURL:s,objectFit:a}=e,o=n||t,l=i||r,u=s.startsWith("data:image/jpeg")?"%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1'/%3E%3C/feComponentTransfer%3E%":"";return o&&l?"%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 "+o+" "+l+"'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+(n&&i?"1":"20")+"'/%3E"+u+"%3C/filter%3E%3Cimage preserveAspectRatio='none' filter='url(%23b)' x='0' y='0' height='100%25' width='100%25' href='"+s+"'/%3E%3C/svg%3E":"%3Csvg xmlns='http%3A//www.w3.org/2000/svg'%3E%3Cimage style='filter:blur(20px)' preserveAspectRatio='"+("contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' x='0' y='0' height='100%25' width='100%25' href='"+s+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},20154: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 u},unstable_getImgProps:function(){return l}});let n=r(38754),i=r(85257),s=r(92078),a=r(28243),o=n._(r(20414)),l=e=>{(0,s.warnOnce)("Warning: unstable_getImgProps() is experimental and may change or be removed at any time. Use at your own risk.");let{props:t}=(0,i.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}},u=a.Image},20414:function(e,t){"use strict";function r(e){let{config:t,src:r,width:n,quality:i}=e;return t.path+"?url="+encodeURIComponent(r)+"&w="+n+"&q="+(i||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}}),r.__next_img_default=!0;let n=r},17211:function(e,t,r){"use strict";let n,i,s;r.r(t),r.d(t,{default:function(){return e$}});var a=r(85893),o=r(72498),l=r.n(o);r(54759);var u=r(86501),c=r(33272);r(9008);var h=r(11163),d=r(67294),f=e=>{let{children:t}=e,[r,n]=(0,d.useState)({x:-25,y:50}),[i,s]=(0,d.useState)({x:50,y:-50});(0,d.useEffect)(()=>{let e=setInterval(()=>{n({x:100*Math.random()-37.5,y:100*Math.random()-37.5}),s({x:100*Math.random()-37.5,y:100*Math.random()-37.5})},5e3);return()=>{clearInterval(e)}},[]);let o=(0,h.useRouter)();return(0,a.jsxs)("div",{className:"absolute inset-0 maw-w-screen h-full ".concat("/login"==o.pathname||"/request"==o.pathname||"/stripe"==o.pathname||"/trouble"==o.pathname?"bg-givellblue":"bg-givellblue-cake"),children:[(0,a.jsxs)("div",{className:"overflow-hidden absolute inset-0",children:[(0,a.jsx)("div",{className:"transition-all duration-[5000ms] ease-[cubic-bezier(0.5,0.1,0.5,0.9)] absolute rounded-full aspect-square w-[75%] bg-gradient-radial from-[#90A1F9] via-transparent to-transparent opacity-70",style:{left:"".concat(r.x,"%"),top:"".concat(r.y,"%")}}),(0,a.jsx)("div",{className:"transition-all duration-[5000ms] ease-[cubic-bezier(0.5,0.1,0.5,0.9)] absolute rounded-full aspect-square w-[75%] bg-gradient-radial from-[#90A1F9] via-transparent to-transparent opacity-70",style:{left:"".concat(i.x,"%"),top:"".concat(i.y,"%")}})]}),(0,a.jsx)("div",{className:"relative z-10 h-full overflow-x-hidden no-scrollbar",children:t})]})},p=r(41639),m=r(86664);r(83454).env.NEXT_GA4_TAG_ID;var g=r(19692),y=r(66973),v=r(45007),w=r(15060),b=r(73161),_=r(89685),E=r(69453),T=r(38514),S=r(88392),I=r(10567);let k=(0,w.xC)({reducer:{[b.UM.reducerPath]:b.UM.reducer,[_.K.reducerPath]:_.K.reducer,[E.lr.reducerPath]:E.lr.reducer,admin:T.ZP,modal:S.Z,users:I.ZP},middleware:e=>e().concat(b.UM.middleware,_.K.middleware)});var C=r(42545),A=r(11347),x=r(25675),O=r.n(x),R=r(87536),N=e=>{var t,r;let{Logo:n,placeholder:i,handleChange:s,inputValue:o,className:l,containerStyle:u,id:c=!1,currency:h=!1,currencyType:f="gbp",textarea:p=!1,name:m=!1,ImageNextjs:g=!1,type:y="text",disabled:v=!1,required:w=!1,error:b=!1,validation:_}=e,{register:E,getValues:T}=(0,R.Gc)(),[S,I]=(0,d.useState)(!1),k=()=>{I(!1)};return(0,a.jsxs)("div",{className:"".concat(p&&"h-full"," relative flex flex-col items-start ").concat(u),children:[(0,a.jsxs)("label",{className:"".concat((null==l?void 0:l.length)&&l," w-full border-solid ").concat(S?"border-[2px] p-[19px] md:p-[23px]":"border-[1px] p-[20px] md:p-[24px]"," ").concat(b?"border-givellred":"border-givellblack"," rounded-[30px] hover:p-[19px] md:hover:p-[23px] hover:border-[2px] relative flex flex-row cursor-pointer ").concat(p?"items-start":"items-center"),children:[(0,a.jsxs)("div",{className:"w-full flex flex-col ".concat(p&&"h-full"),children:[(0,a.jsx)("div",{className:"text-[14px] leading-[20px] ".concat(S||(null===(t=T(m))||void 0===t?void 0:t.length)!==0?"text-givellblack ":"absolute left-[20px] top-1/2 transform -translate-y-1/2 text-givellgray hidden"," z-0 "),children:i}),p?(0,a.jsx)("textarea",{className:"placeholder:text-givellblack/50 whitespace-pre-wrap w-full h-full focus:outline-none outline-none border-none text-givellblack text-[17px] md:text-[16px] resize-none",onFocus:()=>{I(!0)},onBlur:()=>{k()},id:c||"",placeholder:S||(null==o?void 0:o.length)!==0?"":i,disabled:v,...E(m,{required:w})}):(0,a.jsx)("input",{className:"py-2 placeholder:text-givellblack/50 leading-[19px] w-full focus:outline-none outline-none border-none text-givellblack z-10 text-[14px] md:text-[16px] placeholder:text-[14px] placeholder:md:text-[16px] overflow-visible",type:y||"text",required:w,onFocus:()=>{I(!0)},onBlur:()=>{k()},id:c||"",placeholder:h&&S?"0.00":S||(null===(r=T(m))||void 0===r?void 0:r.length)!==0?"":i,disabled:v,...E(m,{required:w})})]}),n&&(0,a.jsxs)("div",{className:"h-full flex-none flex flex-col ".concat(p?"justify-start":"justify-center"," items-center"),children:[(0,a.jsx)("div",{className:"md:hidden inline-flex text-givellblack",children:g?(0,a.jsx)(O(),{alt:"logo",src:n,width:20,height:20}):(0,a.jsx)(n,{size:20})}),(0,a.jsx)("div",{className:"hidden md:inline-flex text-givellblack",children:g?(0,a.jsx)(O(),{alt:"logo",src:n,width:24,height:24}):(0,a.jsx)(n,{size:24})})]})]}),b&&(0,a.jsx)("div",{className:"mt-[8px] text-givellred small",children:b})]})},D=r(45292),P=r(84805),M=r(10779),L=r(13534),F=r(55760),j=r(59885),U=r(94633),V=r.n(U);let $=Object.prototype.toString,q=Error.prototype.toString,z=RegExp.prototype.toString,B="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",H=/^Symbol\((.*)\)(.*)$/;function K(e,t=!1){if(null==e||!0===e||!1===e)return""+e;let r=typeof e;if("number"===r)return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e;if("string"===r)return t?`"${e}"`:e;if("function"===r)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===r)return B.call(e).replace(H,"Symbol($1)");let n=$.call(e).slice(8,-1);return"Date"===n?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===n||e instanceof Error?"["+q.call(e)+"]":"RegExp"===n?z.call(e):null}function G(e,t){let r=K(e,t);return null!==r?r:JSON.stringify(e,function(e,r){let n=K(this[e],t);return null!==n?n:r},2)}function W(e){return null==e?[]:[].concat(e)}let Q=/\$\{\s*(\w+)\s*\}/g;n=Symbol.toStringTag;class J{constructor(e,t,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[n]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=i,this.errors=[],this.inner=[],W(e).forEach(e=>{if(Y.isError(e)){this.errors.push(...e.errors);let t=e.inner.length?e.inner:[e];this.inner.push(...t)}else this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}i=Symbol.hasInstance,s=Symbol.toStringTag;class Y extends Error{static formatError(e,t){let r=t.label||t.path||"this";return(r!==t.path&&(t=Object.assign({},t,{path:r})),"string"==typeof e)?e.replace(Q,(e,r)=>G(t[r])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,r,n,i){let a=new J(e,t,r,n);if(i)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[s]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Y)}static[i](e){return J[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let X={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{let i=null!=n&&n!==r?` (cast from the value \`${G(n,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${G(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${G(r,!0)}\``+i}},Z={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},ee={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},et={noUnknown:"${path} field has unspecified keys: ${unknown}"};Object.assign(Object.create(null),{mixed:X,string:Z,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:ee,object:et,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"},tuple:{notType:e=>{let{path:t,value:r,spec:n}=e,i=n.types.length;if(Array.isArray(r)){if(r.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${r.length} for value: \`${G(r,!0)}\``;if(r.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${r.length} for value: \`${G(r,!0)}\``}return Y.formatError(X.notType,e)}}});let er=e=>e&&e.__isYupSchema__;class en{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:i}=t,s="function"==typeof r?r:(...e)=>e.every(e=>e===r);return new en(e,(e,t)=>{var r;let a=s(...e)?n:i;return null!=(r=null==a?void 0:a(t))?r:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),n=this.fn(r,e,t);if(void 0===n||n===e)return e;if(!er(n))throw TypeError("conditions must return a schema object");return n.resolve(t)}}let ei={context:"$",value:"."};class es{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw TypeError("ref must be a non-empty string");this.isContext=this.key[0]===ei.context,this.isValue=this.key[0]===ei.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?ei.context:this.isValue?ei.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&(0,F.getter)(this.path,!0),this.map=t.map}getValue(e,t,r){let n=this.isContext?r:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}es.prototype.__isYupRef=!0;let ea=e=>null==e;function eo(e){function t({value:t,path:r="",options:n,originalValue:i,schema:s},a,o){let l;let{name:u,test:c,params:h,message:d,skipAbsent:f}=e,{parent:p,context:m,abortEarly:g=s.spec.abortEarly,disableStackTrace:y=s.spec.disableStackTrace}=n;function v(e){return es.isRef(e)?e.getValue(t,p,m):e}function w(e={}){let n=Object.assign({value:t,originalValue:i,label:s.spec.label,path:e.path||r,spec:s.spec,disableStackTrace:e.disableStackTrace||y},h,e.params);for(let e of Object.keys(n))n[e]=v(n[e]);let a=new Y(Y.formatError(e.message||d,n),t,n.path,e.type||u,n.disableStackTrace);return a.params=n,a}let b=g?a:o,_={path:r,parent:p,type:u,from:n.from,createError:w,resolve:v,options:n,originalValue:i,schema:s},E=e=>{Y.isError(e)?b(e):e?o(null):b(w())},T=e=>{Y.isError(e)?b(e):a(e)},S=f&&ea(t);if(S)return E(!0);try{var I;if(l=c.call(_,t,_),"function"==typeof(null==(I=l)?void 0:I.then)){if(n.sync)throw Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(l).then(E,T)}}catch(e){T(e);return}E(l)}return t.OPTIONS=e,t}class el extends Set{describe(){let e=[];for(let t of this.values())e.push(es.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(let r of this.values())t.push(e(r));return t}clone(){return new el(this.values())}merge(e,t){let r=this.clone();return e.forEach(e=>r.add(e)),t.forEach(e=>r.delete(e)),r}}function eu(e,t=new Map){let r;if(er(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=eu(e[n],t)}else if(e instanceof Map)for(let[n,i]of(r=new Map,t.set(e,r),e.entries()))r.set(n,eu(i,t));else if(e instanceof Set)for(let n of(r=new Set,t.set(e,r),e))r.add(eu(n,t));else if(e instanceof Object)for(let[n,i]of(r={},t.set(e,r),Object.entries(e)))r[n]=eu(i,t);else throw Error(`Unable to clone ${e}`);return r}class ec{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new el,this._blacklist=new el,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(X.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=eu(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=e.clone(),r=Object.assign({},this.spec,t.spec);return t.spec=r,t.internalTests=Object.assign({},this.internalTests,t.internalTests),t._whitelist=this._whitelist.merge(e._whitelist,e._blacklist),t._blacklist=this._blacklist.merge(e._blacklist,e._whitelist),t.tests=this.tests,t.exclusiveTests=this.exclusiveTests,t.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),t.transforms=[...this.transforms,...t.transforms],t}isType(e){return null==e?!!this.spec.nullable&&null===e||!!this.spec.optional&&void 0===e:this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;(t=t.clone()).conditions=[],t=(t=r.reduce((t,r)=>r.resolve(t,e),t)).resolve(e)}return t}resolveOptions(e){var t,r,n,i;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(r=e.abortEarly)?r:this.spec.abortEarly,recursive:null!=(n=e.recursive)?n:this.spec.recursive,disableStackTrace:null!=(i=e.disableStackTrace)?i:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({value:e},t)),n="ignore-optionality"===t.assert,i=r._cast(e,t);if(!1!==t.assert&&!r.isType(i)){if(n&&ea(i))return i;let s=G(e),a=G(i);throw TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". 

attempted value: ${s} 
`+(a!==s?`result of cast: ${a}`:""))}return i}_cast(e,t){let r=void 0===e?e:this.transforms.reduce((t,r)=>r.call(this,t,e,this),e);return void 0===r&&(r=this.getDefault(t)),r}_validate(e,t={},r,n){let{path:i,originalValue:s=e,strict:a=this.spec.strict}=t,o=e;a||(o=this._cast(o,Object.assign({assert:!1},t)));let l=[];for(let e of Object.values(this.internalTests))e&&l.push(e);this.runTests({path:i,value:o,originalValue:s,options:t,tests:l},r,e=>{if(e.length)return n(e,o);this.runTests({path:i,value:o,originalValue:s,options:t,tests:this.tests},r,n)})}runTests(e,t,r){let n=!1,{tests:i,value:s,originalValue:a,path:o,options:l}=e,u=e=>{n||(n=!0,t(e,s))},c=e=>{n||(n=!0,r(e,s))},h=i.length,d=[];if(!h)return c([]);let f={value:s,originalValue:a,path:o,options:l,schema:this};for(let e=0;e<i.length;e++){let t=i[e];t(f,u,function(e){e&&(Array.isArray(e)?d.push(...e):d.push(e)),--h<=0&&c(d)})}}asNestedTest({key:e,index:t,parent:r,parentPath:n,originalParent:i,options:s}){let a=null!=e?e:t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");let o="number"==typeof a,l=r[a],u=Object.assign({},s,{strict:!0,parent:r,value:l,originalValue:i[a],key:void 0,[o?"index":"key"]:a,path:o||a.includes(".")?`${n||""}[${o?a:`"${a}"`}]`:(n?`${n}.`:"")+e});return(e,t,r)=>this.resolve(u)._validate(l,u,t,r)}validate(e,t){var r;let n=this.resolve(Object.assign({},t,{value:e})),i=null!=(r=null==t?void 0:t.disableStackTrace)?r:n.spec.disableStackTrace;return new Promise((r,s)=>n._validate(e,t,(e,t)=>{Y.isError(e)&&(e.value=t),s(e)},(e,t)=>{e.length?s(new Y(e,t,void 0,void 0,i)):r(t)}))}validateSync(e,t){var r;let n;let i=this.resolve(Object.assign({},t,{value:e})),s=null!=(r=null==t?void 0:t.disableStackTrace)?r:i.spec.disableStackTrace;return i._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw Y.isError(e)&&(e.value=t),e},(t,r)=>{if(t.length)throw new Y(t,e,void 0,void 0,s);n=r}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(Y.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(Y.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):eu(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0==arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){let r=this.clone({nullable:e});return r.internalTests.nullable=eo({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),r}optionality(e,t){let r=this.clone({optional:e});return r.internalTests.optionality=eo({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(e=X.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=X.notNull){return this.nullability(!1,e)}required(e=X.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(void 0===(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]}).message&&(t.message=X.default),"function"!=typeof t.test)throw TypeError("`test` is a required parameters");let r=this.clone(),n=eo(t),i=t.exclusive||t.name&&!0===r.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter(e=>e.OPTIONS.name!==t.name||!i&&e.OPTIONS.test!==n.OPTIONS.test),r.tests.push(n),r}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let r=this.clone(),n=W(e).map(e=>new es(e));return n.forEach(e=>{e.isSibling&&r.deps.push(e.key)}),r.conditions.push("function"==typeof t?new en(n,t):en.fromOptions(n,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=eo({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=X.oneOf){let r=this.clone();return e.forEach(e=>{r._whitelist.add(e),r._blacklist.delete(e)}),r.internalTests.whiteList=eo({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,r=t.resolveAll(this.resolve);return!!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}notOneOf(e,t=X.notOneOf){let r=this.clone();return e.forEach(e=>{r._blacklist.add(e),r._whitelist.delete(e)}),r.internalTests.blacklist=eo({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,r=t.resolveAll(this.resolve);return!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){let t=(e?this.resolve(e):this).clone(),{label:r,meta:n,optional:i,nullable:s}=t.spec,a={meta:n,label:r,optional:i,nullable:s,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(e=>({name:e.OPTIONS.name,params:e.OPTIONS.params})).filter((e,t,r)=>r.findIndex(t=>t.name===e.name)===t)};return a}}for(let e of(ec.prototype.__isYupSchema__=!0,["validate","validateSync"]))ec.prototype[`${e}At`]=function(t,r,n={}){let{parent:i,parentPath:s,schema:a}=function(e,t,r,n=r){let i,s,a;return t?((0,F.forEach)(t,(o,l,u)=>{let c=l?o.slice(1,o.length-1):o,h="tuple"===(e=e.resolve({context:n,parent:i,value:r})).type,d=u?parseInt(c,10):0;if(e.innerType||h){if(h&&!u)throw Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(r&&d>=r.length)throw Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[d],e=h?e.spec.types[d]:e.innerType}if(!u){if(!e.fields||!e.fields[c])throw Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=r,r=r&&r[c],e=e.fields[c]}s=c,a=l?"["+o+"]":"."+o}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}(this,t,r,n.context);return a[e](i&&i[s],Object.assign({},n,{parent:i,path:t}))};for(let e of["equals","is"])ec.prototype[e]=ec.prototype.oneOf;for(let e of["not","nope"])ec.prototype[e]=ec.prototype.notOneOf;let eh=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ed(e){var t,r;let n=eh.exec(e);return n?{year:ef(n[1]),month:ef(n[2],1)-1,day:ef(n[3],1),hour:ef(n[4]),minute:ef(n[5]),second:ef(n[6]),millisecond:n[7]?ef(n[7].substring(0,3)):0,precision:null!=(t=null==(r=n[7])?void 0:r.length)?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:ef(n[10]),minuteOffset:ef(n[11])}:null}function ef(e,t=0){return Number(e)||t}let ep=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,em=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,eg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ey=RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),ev=e=>ea(e)||e===e.trim(),ew=({}).toString();function eb(){return new e_}class e_ extends ec{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t,r)=>{if(!r.spec.coerce||r.isType(e)||Array.isArray(e))return e;let n=null!=e&&e.toString?e.toString():e;return n===ew?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||X.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=Z.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=Z.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=Z.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let r,n,i=!1;return t&&("object"==typeof t?{excludeEmptyString:i=!1,message:r,name:n}=t:r=t),this.test({name:n||"matches",message:r||Z.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&i||-1!==t.search(e)})}email(e=Z.email){return this.matches(ep,{name:"email",message:e,excludeEmptyString:!0})}url(e=Z.url){return this.matches(em,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Z.uuid){return this.matches(eg,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,r,n="";return e&&("object"==typeof e?{message:n="",allowOffset:t=!1,precision:r}=e:n=e),this.matches(ey,{name:"datetime",message:n||Z.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Z.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;let r=ed(e);return!!r&&!!r.z}}).test({name:"datetime_precision",message:n||Z.datetime_precision,params:{precision:r},skipAbsent:!0,test:e=>{if(!e||void 0==r)return!0;let t=ed(e);return!!t&&t.precision===r}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=Z.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:ev})}lowercase(e=Z.lowercase){return this.transform(e=>ea(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>ea(e)||e===e.toLowerCase()})}uppercase(e=Z.uppercase){return this.transform(e=>ea(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>ea(e)||e===e.toUpperCase()})}}eb.prototype=e_.prototype;let eE=new Date(""),eT=e=>"[object Date]"===Object.prototype.toString.call(e);function eS(){return new eI}class eI extends ec{constructor(){super({type:"date",check:e=>eT(e)&&!isNaN(e.getTime())}),this.withMutation(()=>{this.transform((e,t,r)=>!r.spec.coerce||r.isType(e)||null===e?e:isNaN(e=function(e){let t=ed(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(r=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}(e))?eI.INVALID_DATE:new Date(e))})}prepareParam(e,t){let r;if(es.isRef(e))r=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=n}return r}min(e,t=ee.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(r)}})}max(e,t=ee.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(r)}})}}function ek(e,t){let r=1/0;return e.some((e,n)=>{var i;if(null!=(i=t.path)&&i.includes(e))return r=n,!0}),r}function eC(e){return(t,r)=>ek(e,t)-ek(e,r)}eI.INVALID_DATE=eE,eS.prototype=eI.prototype,eS.INVALID_DATE=eE;let eA=(e,t,r)=>{if("string"!=typeof e)return e;let n=e;try{n=JSON.parse(e)}catch(e){}return r.isType(n)?n:e},ex=(e,t)=>{let r=[...(0,F.normalizePath)(t)];if(1===r.length)return r[0]in e;let n=r.pop(),i=(0,F.getter)((0,F.join)(r),!0)(e);return!!(i&&n in i)},eO=e=>"[object Object]"===Object.prototype.toString.call(e),eR=eC([]);function eN(e){return new eD(e)}class eD extends ec{constructor(e){super({type:"object",check:e=>eO(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=eR,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var r;let n=super._cast(e,t);if(void 0===n)return this.getDefault(t);if(!this._typeCheck(n))return n;let i=this.fields,s=null!=(r=t.stripUnknown)?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(n).filter(e=>!this._nodes.includes(e))),o={},l=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),u=!1;for(let e of a){let r=i[e],a=e in n;if(r){let i;let s=n[e];l.path=(t.path?`${t.path}.`:"")+e;let a=(r=r.resolve({value:s,context:t.context,parent:o}))instanceof ec?r.spec:void 0,c=null==a?void 0:a.strict;if(null!=a&&a.strip){u=u||e in n;continue}void 0!==(i=t.__validating&&c?n[e]:r.cast(n[e],l))&&(o[e]=i)}else a&&!s&&(o[e]=n[e]);(a!==e in o||o[e]!==n[e])&&(u=!0)}return u?o:n}_validate(e,t={},r,n){let{from:i=[],originalValue:s=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:s},...i],t.__validating=!0,t.originalValue=s,super._validate(e,t,r,(e,i)=>{if(!a||!eO(i)){n(e,i);return}s=s||i;let o=[];for(let e of this._nodes){let r=this.fields[e];!r||es.isRef(r)||o.push(r.asNestedTest({options:t,key:e,parent:i,parentPath:t.path,originalParent:s}))}this.runTests({tests:o,value:i,originalValue:s,options:t},r,t=>{n(t.sort(this._sortErrors).concat(e),i)})})}clone(e){let t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[e,t]of Object.entries(this.fields)){let n=r[e];r[e]=void 0===n?t:n}return t.withMutation(t=>t.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(r=>{var n;let i=this.fields[r],s=e;null!=(n=s)&&n.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),t[r]=i&&"getDefault"in i?i.getDefault(s):void 0}),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=function(e,t=[]){let r=[],n=new Set,i=new Set(t.map(([e,t])=>`${e}-${t}`));function s(e,t){let s=(0,F.split)(e)[0];n.add(s),i.has(`${t}-${s}`)||r.push([t,s])}for(let t of Object.keys(e)){let r=e[t];n.add(t),es.isRef(r)&&r.isSibling?s(r.path,t):er(r)&&"deps"in r&&r.deps.forEach(e=>s(e,t))}return V().array(Array.from(n),r).reverse()}(e,t),r._sortErrors=eC(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation(r=>{let n=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),n)})}partial(){let e={};for(let[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){let e=function e(t){if("fields"in t){let r={};for(let[n,i]of Object.entries(t.fields))r[n]=e(i);return t.setFields(r)}if("array"===t.type){let r=t.optional();return r.innerType&&(r.innerType=e(r.innerType)),r}return"tuple"===t.type?t.optional().clone({types:t.spec.types.map(e)}):"optional"in t?t.optional():t}(this);return e}pick(e){let t={};for(let r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t,this._excludedEdges.filter(([t,r])=>e.includes(t)&&e.includes(r)))}omit(e){let t=[];for(let r of Object.keys(this.fields))e.includes(r)||t.push(r);return this.pick(t)}from(e,t,r){let n=(0,F.getter)(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return ex(i,e)&&(s=Object.assign({},i),r||delete s[e],s[t]=n(i)),s})}json(){return this.transform(eA)}noUnknown(e=!0,t=et.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){let r;if(null==t)return!0;let n=(r=Object.keys(this.schema.fields),Object.keys(t).filter(e=>-1===r.indexOf(e)));return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=et.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;let r={};for(let n of Object.keys(t))r[e(n)]=t[n];return r})}camelCase(){return this.transformKeys(j.camelCase)}snakeCase(){return this.transformKeys(j.snakeCase)}constantCase(){return this.transformKeys(e=>(0,j.snakeCase)(e).toUpperCase())}describe(e){let t=(e?this.resolve(e):this).clone(),r=super.describe(e);for(let[i,s]of(r.fields={},Object.entries(t.fields))){var n;let t=e;null!=(n=t)&&n.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[i]})),r.fields[i]=s.describe(t)}return r}}eN.prototype=eD.prototype;var eP=function(e,t,r){if(e&&"reportValidity"in e){var n=(0,R.U2)(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},eM=function(e,t){var r=function(r){var n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?eP(n.ref,r,e):n.refs&&n.refs.forEach(function(t){return eP(t,r,e)})};for(var n in t.fields)r(n)},eL=function(e,t,r){for(var n,i=-1,s=/^\w*$/.test(t)?[t]:Array.isArray(n=t.replace(/["|']|\]/g,"").split(/\.|\[/))?n.filter(Boolean):[],a=s.length,o=a-1;++i<a;){var l=s[i],u=r;if(i!==o){var c=e[l];u=!(null!=c&&!Array.isArray(c)&&"object"==typeof c&&!(c instanceof Date)||Array.isArray(c))?isNaN(+s[i+1])?{}:[]:c}e[l]=u,e=e[l]}return e},eF=function(e,t){t.shouldUseNativeValidation&&eM(e,t);var r={};for(var n in e){var i=(0,R.U2)(t.fields,n),s=Object.assign(e[n]||{},{ref:i&&i.ref});if(ej(t.names||Object.keys(e),n)){var a=Object.assign({},(0,R.U2)(r,n));eL(a,"root",s),eL(r,n,a)}else eL(r,n,s)}return r},ej=function(e,t){return e.some(function(e){return e.startsWith(t+".")})};function eU(){var e,t;(0,h.useRouter)();let[r,n]=(0,b.Bn)(),i=(0,v.I0)(),{user:s}=(0,v.v9)(e=>e.users),{claimMyPageModal:o}=(0,v.v9)(e=>e.modal),[l,u]=(0,d.useState)(!1),c=(0,d.useCallback)(()=>i((0,S.$)("claim"))),f=eN().shape({email:eb().email().required()}),p=(0,R.cI)({mode:"onChange",resolver:(void 0===e&&(e={}),void 0===t&&(t={}),function(r,n,i){try{return Promise.resolve(function(s,a){try{var o=(e.context,Promise.resolve(f["sync"===t.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},e,{context:n}))).then(function(e){return i.shouldUseNativeValidation&&eM({},i),{values:t.raw?r:e,errors:{}}}))}catch(e){return a(e)}return o&&o.then?o.then(void 0,a):o}(0,function(e){var t;if(!e.inner)throw e;return{values:{},errors:eF((t=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(e.inner||[]).reduce(function(e,r){if(e[r.path]||(e[r.path]={message:r.message,type:r.type}),t){var n=e[r.path].types,i=n&&n[r.type];e[r.path]=(0,R.KN)(r.path,t,e,r.type,i?[].concat(i,r.message):r.message)}return e},{})),i)}}))}catch(e){return Promise.reject(e)}}),defaultValues:{email:""}}),m=(0,P.B)();return(0,a.jsx)(C.V,{open:o,onClose:c,children:(0,a.jsx)(R.RV,{...p,children:(0,a.jsx)("form",{onSubmit:p.handleSubmit(e=>{r({user_id:s.id,entered_email:e.email}).then(e=>{p.reset(),u(!0)})}),children:(0,a.jsx)(A.Ks,{onClose:c,small:m,title:"Claim Your Page",description:"Please confirm your email before claiming the page. Once you done so you will get a login link to your email.",children:l?(0,a.jsxs)("div",{className:"mobile: px-5 mobile: pt-4 mobile: pb-5 rounded-[40px] border-solid border-[1px] border-givellblack rounded-[30px] px-[20px] pt-5 bg-givellwhite text-black",children:[(0,a.jsx)(M.Z,{className:"w-[24px] h-[24px] md:w-[32px] md:h-[32px]"}),(0,a.jsxs)("p",{className:"mt-3 text-sm md:text-base",children:["You have successfully submitted a claim for your page. If the email you provided matches the email of"," "+(null==s?void 0:s.firstName)," ",null==s?void 0:s.lastName,", you will receive an email with instructions to set up your profile."]}),(0,a.jsx)("p",{className:"mt-3 mb-5 text-sm md:text-base",children:"If you haven’t received the email, please click the button below to try again, contact us at support@givell.co or reply to an invitation email you have received from us."}),(0,a.jsx)("div",{className:"flex justify-end w-full",children:(0,a.jsx)(D.Z,{className:" mt-[14px] h-[52px] ml-auto px-[24px] black-button grid col-start-9 black-outline-button lg:mt-[24px] lg:w-[121px] lg:h-[64px] ",onClick:()=>{u(!1)},children:"Try Again"})})]}):(0,a.jsxs)("div",{className:"flex-col border-givellblack border-[1px] rounded-[40px] bg-givellwhite text-black p-[24px] lg:p-[24px]",children:[(0,a.jsx)(N,{Logo:L.Z,className:"h-[80px] md:h-[92px]",placeholder:"Your Email *",name:"email",required:!0}),(0,a.jsx)(D.Z,{className:" mt-[14px] h-[52px] ml-auto px-[24px] black-button grid col-start-9 lg:mt-[24px] lg:h-[64px] ",onClick:()=>{},disabled:!p.formState.isValid,children:"Claim My Page"})]})})})})})}function eV(e){let{children:t}=e;return t}function e$(e){let{Component:t,pageProps:r}=e,[n,i]=(0,d.useState)(!1);return((0,d.useEffect)(()=>{y.t.then(e=>{i(!0)})},[y.t]),n)?(0,a.jsx)("main",{className:l().className,children:(0,a.jsx)(v.zt,{store:k,children:(0,a.jsxs)(d.Suspense,{fallback:(0,a.jsx)("p",{children:"Loading..."}),children:[(0,a.jsx)(g.GoogleTagManager,{gtmId:"GTM-KDJ4G87C"}),(0,a.jsx)(g.GoogleAnalytics,{gaId:"G-2YCHPG5RCP"}),(0,a.jsx)(c.dr,{children:(0,a.jsx)(m.Elements,{stripe:y.t,children:(0,a.jsx)(p.Tu,{children:(0,a.jsxs)(f,{children:[(0,a.jsx)(eV,{children:(0,a.jsx)(t,{...r})}),(0,a.jsx)(eU,{})]})})})}),(0,a.jsx)(u.x7,{toastOptions:{duration:5e3}})]})})}):(0,a.jsx)(a.Fragment,{})}},54759:function(){},72498:function(e){e.exports={style:{fontFamily:"'__Inter_36bd41', '__Inter_Fallback_36bd41'",fontStyle:"normal"},className:"__className_36bd41"}},77663:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function o(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}catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();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=o(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===a||!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||o(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}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}},a=!0;try{t[e](s,s.exports,n),a=!1}finally{a&&delete r[e]}return s.exports}n.ab="//";var i=n(229);e.exports=i}()},9008:function(e,t,r){e.exports=r(73902)},25675:function(e,t,r){e.exports=r(20154)},11163:function(e,t,r){e.exports=r(31247)},4298:function(e,t,r){e.exports=r(34294)},55760:function(e){"use strict";function t(e){this._maxSize=e,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(e){return this._values[e]},t.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),!(e in this._values)&&this._size++,this._values[e]=t};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=new t(512),l=new t(512),u=new t(512);function c(e){return o.get(e)||o.set(e,h(e).map(function(e){return e.replace(a,"$2")}))}function h(e){return e.match(r)||[""]}function d(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}e.exports={Cache:t,split:h,normalizePath:c,setter:function(e){var t=c(e);return l.get(e)||l.set(e,function(e,r){for(var n=0,i=t.length,s=e;n<i-1;){var a=t[n];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;s=s[t[n++]]}s[t[n]]=r})},getter:function(e,t){var r=c(e);return u.get(e)||u.set(e,function(e){for(var n=0,i=r.length;n<i;){if(null==e&&t)return;e=e[r[n++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(d(t)||n.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,r){!function(e,t,r){var a,o,l,u,c,h=e.length;for(l=0;l<h;l++){(o=e[l])&&(!d(a=o)&&(a.match(i)&&!a.match(n)||s.test(a))&&(o='"'+o+'"'),u=!(c=d(o))&&/^\d+$/.test(o),t.call(r,o,c,u,l,e))}}(Array.isArray(e)?e:h(e),t,r)}}},86257:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeEmbed=t.GoogleMapsEmbed=t.GoogleAnalytics=void 0;var n=r(53494);Object.defineProperty(t,"GoogleAnalytics",{enumerable:!0,get:function(){return n.GoogleAnalytics}});var i=r(34248);Object.defineProperty(t,"GoogleMapsEmbed",{enumerable:!0,get:function(){return i.GoogleMapsEmbed}});var s=r(92239);Object.defineProperty(t,"YouTubeEmbed",{enumerable:!0,get:function(){return s.YouTubeEmbed}})},53494:function(e,t,r){"use strict";var n=this&&this.__rest||function(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},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleAnalytics=void 0;let s=i(r(89426)),a=r(17058);t.GoogleAnalytics=e=>{var t=n(e,[]);return(0,a.formatData)(s.default,t)}},34248:function(e,t,r){"use strict";var n=this&&this.__rest||function(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},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleMapsEmbed=void 0;let s=i(r(27395)),a=r(17058);t.GoogleMapsEmbed=e=>{var t=n(e,[]);return(0,a.formatData)(s.default,t)}},92239:function(e,t,r){"use strict";var n=this&&this.__rest||function(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},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeEmbed=void 0;let s=i(r(88420)),a=r(17058);t.YouTubeEmbed=e=>{var t=n(e,[]);return(0,a.formatData)(s.default,t)}},17058:function(e,t){"use strict";function r(e,t,r=!1){return t?Object.keys(e).filter(e=>r?!t.includes(e):t.includes(e)).reduce((t,r)=>(t[r]=e[r],t),{}):{}}function n(e,t,r,n){let i=n&&Object.keys(n).length>0?new URL(Object.values(n)[0],e):new URL(e);return t&&r&&t.forEach(e=>{r[e]&&i.searchParams.set(e,r[e])}),i.toString()}function i(e,t,r,i,s){var a;if(!t)return`<${e}></${e}>`;let o=(null===(a=t.src)||void 0===a?void 0:a.url)?Object.assign(Object.assign({},t),{src:n(t.src.url,t.src.params,i,s)}):t,l=Object.keys(Object.assign(Object.assign({},o),r)).reduce((e,t)=>{let n=null==r?void 0:r[t],i=o[t],s=null!=n?n:i,a=!0===s?t:`${t}="${s}"`;return s?e+` ${a}`:e},"");return`<${e}${l}></${e}>`}Object.defineProperty(t,"__esModule",{value:!0}),t.formatData=t.createHtml=t.formatUrl=void 0,t.formatUrl=n,t.createHtml=i,t.formatData=function(e,t){var s,a,o,l,u;let c=null===(s=e.scripts)||void 0===s?void 0:s.reduce((e,t)=>[...e,...Array.isArray(t.params)?t.params:[]],[]),h=r(t,c),d=r(t,null===(o=null===(a=e.html)||void 0===a?void 0:a.attributes.src)||void 0===o?void 0:o.params),f=r(t,[null===(u=null===(l=e.html)||void 0===l?void 0:l.attributes.src)||void 0===u?void 0:u.slugParam]),p=r(t,[...Object.keys(h),...Object.keys(d),...Object.keys(f)],!0);return Object.assign(Object.assign({},e),{html:e.html?i(e.html.element,e.html.attributes,p,d,f):null,scripts:e.scripts?e.scripts.map(e=>Object.assign(Object.assign({},e),{url:n(e.url,e.params,h)})):null})}},59885:function(e){let t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,r=e=>e.match(t)||[],n=e=>e[0].toUpperCase()+e.slice(1),i=(e,t)=>r(e).join(t).toLowerCase(),s=e=>r(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,"");e.exports={words:r,upperFirst:n,camelCase:s,pascalCase:e=>n(s(e)),snakeCase:e=>i(e,"_"),kebabCase:e=>i(e,"-"),sentenceCase:e=>n(i(e," ")),titleCase:e=>r(e).map(n).join(" ")}},94633:function(e){function t(e,t){var r=e.length,n=Array(r),i={},s=r,a=function(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var i=e[r];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),o=function(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}(e);for(t.forEach(function(e){if(!o.has(e[0])||!o.has(e[1]))throw Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||function e(t,s,l){if(l.has(t)){var u;try{u=", node was:"+JSON.stringify(t)}catch(e){u=""}throw Error("Cyclic dependency"+u)}if(!o.has(t))throw Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(t));if(!i[s]){i[s]=!0;var c=a.get(t)||new Set;if(s=(c=Array.from(c)).length){l.add(t);do{var h=c[--s];e(h,o.get(h),l)}while(s);l.delete(t)}n[--r]=t}}(e[s],s,new Set);return n}e.exports=function(e){return t(function(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var i=e[r];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)},e.exports.array=t},53771:function(e,t,r){"use strict";/**
 * @license React
 * use-sync-external-store-with-selector.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var n=r(67294),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,a=n.useRef,o=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,c){var h=a(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;h=l(function(){function e(e){if(!o){if(o=!0,s=e,e=n(e),void 0!==c&&d.hasValue){var t=d.value;if(c(t,e))return a=t}return a=e}if(t=a,i(s,e))return t;var r=n(e);return void 0!==c&&c(t,r)?t:(s=e,a=r)}var s,a,o=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,c]);var f=s(e,h[0],h[1]);return o(function(){d.hasValue=!0,d.value=f},[f]),u(f),f}},31103:function(e,t,r){"use strict";e.exports=r(53771)},25816:function(e,t,r){"use strict";let n,i;r.d(t,{Jn:function(){return P},qX:function(){return R},Xd:function(){return O},Mq:function(){return L},ZF:function(){return M},KN:function(){return F}});var s,a=r(8463),o=r(53333),l=r(74444);let u=(e,t)=>t.some(t=>e instanceof t),c=new WeakMap,h=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("objectStoreNames"===t)return e.objectStoreNames||d.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return g(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function g(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(g(e.result)),n()},s=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&c.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(f.has(e))return f.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(y(this),e),g(c.get(this))}:function(...e){return g(t.apply(y(this),e))}:function(e,...r){let n=t.call(y(this),e,...r);return d.set(n,e.sort?e.sort():[e]),g(n)}:(t instanceof IDBTransaction&&function(e){if(h.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)});h.set(e,t)}(t),u(t,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,m):t;return r!==e&&(f.set(e,r),p.set(r,e)),r}let y=e=>p.get(e),v=["get","getKey","getAll","getAllKeys","count"],w=["put","add","delete","clear"],b=new Map;function _(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(b.get(t))return b.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,i=w.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||v.includes(r)))return;let s=async function(e,...t){let s=this.transaction(e,i?"readwrite":"readonly"),a=s.store;return n&&(a=a.index(t.shift())),(await Promise.all([a[r](...t),i&&s.done]))[0]};return b.set(t,s),s}m={...s=m,get:(e,t,r)=>_(e,t)||s.get(e,t,r),has:(e,t)=>!!_(e,t)||s.has(e,t)};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class E{constructor(e){this.container=e}getPlatformInfoString(){let e=this.container.getProviders();return e.map(e=>{if(!function(e){let t=e.getComponent();return(null==t?void 0:t.type)==="VERSION"}(e))return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(" ")}}let T="@firebase/app",S="0.9.15",I=new o.Yd("@firebase/app"),k="[DEFAULT]",C={[T]:"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/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","fire-js":"fire-js",firebase:"fire-js-all"},A=new Map,x=new Map;function O(e){let t=e.name;if(x.has(t))return I.debug(`There were multiple attempts to register component ${t}.`),!1;for(let r of(x.set(t,e),A.values()))!function(e,t){try{e.container.addComponent(t)}catch(r){I.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}(r,e);return!0}function R(e,t){let r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}let N=new l.LL("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","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}."});/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class D{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new a.wA("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 N.create("app-deleted",{appName:this._name})}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let P="10.1.0";function M(e,t={}){let r=e;if("object"!=typeof t){let e=t;t={name:e}}let n=Object.assign({name:k,automaticDataCollectionEnabled:!1},t),i=n.name;if("string"!=typeof i||!i)throw N.create("bad-app-name",{appName:String(i)});if(r||(r=(0,l.aH)()),!r)throw N.create("no-options");let s=A.get(i);if(s){if((0,l.vZ)(r,s.options)&&(0,l.vZ)(n,s.config))return s;throw N.create("duplicate-app",{appName:i})}let o=new a.H0(i);for(let e of x.values())o.addComponent(e);let u=new D(r,n,o);return A.set(i,u),u}function L(e=k){let t=A.get(e);if(!t&&e===k&&(0,l.aH)())return M();if(!t)throw N.create("no-app",{appName:e});return t}function F(e,t,r){var n;let i=null!==(n=C[e])&&void 0!==n?n:e;r&&(i+=`-${r}`);let s=i.match(/\s|\//),o=t.match(/\s|\//);if(s||o){let e=[`Unable to register library "${i}" with version "${t}":`];s&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),I.warn(e.join(" "));return}O(new a.wA(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}let j="firebase-heartbeat-store",U=null;function V(){return U||(U=(function(e,t,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){let a=indexedDB.open(e,1),o=g(a);return n&&a.addEventListener("upgradeneeded",e=>{n(g(a.result),e.oldVersion,e.newVersion,g(a.transaction),e)}),r&&a.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),o.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o})("firebase-heartbeat-database",0,{upgrade:(e,t)=>{0===t&&e.createObjectStore(j)}}).catch(e=>{throw N.create("idb-open",{originalErrorMessage:e.message})})),U}async function $(e){try{let t=await V(),r=await t.transaction(j).objectStore(j).get(z(e));return r}catch(e){if(e instanceof l.ZR)I.warn(e.message);else{let t=N.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});I.warn(t.message)}}}async function q(e,t){try{let r=await V(),n=r.transaction(j,"readwrite"),i=n.objectStore(j);await i.put(t,z(e)),await n.done}catch(e){if(e instanceof l.ZR)I.warn(e.message);else{let t=N.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});I.warn(t.message)}}}function z(e){return`${e.name}!${e.options.appId}`}class B{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new K(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){let e=this.container.getProvider("platform-logger").getImmediate(),t=e.getPlatformInfoString(),r=H();return(null===this._heartbeatsCache&&(this._heartbeatsCache=await this._heartbeatsCachePromise),this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(e=>e.date===r))?void 0:(this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{let t=new Date(e.date).valueOf(),r=Date.now();return r-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache))}async getHeartbeatsHeader(){if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length)return"";let e=H(),{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),G(r)>t){e.dates.pop();break}}else if(r.push({agent:i.agent,dates:[i.date]}),G(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}(this._heartbeatsCache.heartbeats),n=(0,l.L)(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}}function H(){let e=new Date;return e.toISOString().substring(0,10)}class K{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,l.hl)()&&(0,l.eu)().then(()=>!0).catch(()=>!1)}async read(){let e=await this._canUseIndexedDBPromise;if(!e)return{heartbeats:[]};{let e=await $(this.app);return e||{heartbeats:[]}}}async overwrite(e){var t;let r=await this._canUseIndexedDBPromise;if(r){let r=await this.read();return q(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;let r=await this._canUseIndexedDBPromise;if(r){let r=await this.read();return q(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}}}function G(e){return(0,l.L)(JSON.stringify({version:2,heartbeats:e})).length}O(new a.wA("platform-logger",e=>new E(e),"PRIVATE")),O(new a.wA("heartbeat",e=>new B(e),"PRIVATE")),F(T,S,""),F(T,S,"esm2017"),F("fire-js","")},8463:function(e,t,r){"use strict";r.d(t,{H0:function(){return o},wA:function(){return i}});var n=r(74444);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}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let s="[DEFAULT]";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a{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.BH;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){var t;let r=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(e){if(n)return null;throw e}else{if(n)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()){let i=this.normalizeInstanceIdentifier(e);r===i&&t.resolve(n)}return n}onInit(e,t){var r;let n=this.normalizeInstanceIdentifier(t),i=null!==(r=this.onInitCallbacks.get(n))&&void 0!==r?r:new Set;i.add(e),this.onInitCallbacks.set(n,i);let s=this.instances.get(n);return s&&e(s,n),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let n of r)try{n(e,t)}catch(e){}}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(e){}return r||null}normalizeInstanceIdentifier(e=s){return this.component?this.component.multipleInstances?e:s:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class o{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){let t=this.getProvider(e.name);t.isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new a(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},53333:function(e,t,r){"use strict";var n,i;r.d(t,{Yd:function(){return c},in:function(){return n}});/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let s=[];(i=n||(n={}))[i.DEBUG=0]="DEBUG",i[i.VERBOSE=1]="VERBOSE",i[i.INFO=2]="INFO",i[i.WARN=3]="WARN",i[i.ERROR=4]="ERROR",i[i.SILENT=5]="SILENT";let a={debug:n.DEBUG,verbose:n.VERBOSE,info:n.INFO,warn:n.WARN,error:n.ERROR,silent:n.SILENT},o=n.INFO,l={[n.DEBUG]:"log",[n.VERBOSE]:"log",[n.INFO]:"info",[n.WARN]:"warn",[n.ERROR]:"error"},u=(e,t,...r)=>{if(t<e.logLevel)return;let n=new Date().toISOString(),i=l[t];if(i)console[i](`[${n}]  ${e.name}:`,...r);else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class c{constructor(e){this.name=e,this._logLevel=o,this._logHandler=u,this._userLogHandler=null,s.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in n))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?a[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,n.DEBUG,...e),this._logHandler(this,n.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,n.VERBOSE,...e),this._logHandler(this,n.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,n.INFO,...e),this._logHandler(this,n.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,n.WARN,...e),this._logHandler(this,n.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,n.ERROR,...e),this._logHandler(this,n.ERROR,...e)}}},39516:function(e,t,r){"use strict";r.d(t,{d:function(){return h},f:function(){return c}});var n=r(67294),i=r(19946),s=r(12351),a=r(16723),o=r(23784),l=r(73781);let u=(0,n.createContext)(null);function c(){let[e,t]=(0,n.useState)([]);return[e.length>0?e.join(" "):void 0,(0,n.useMemo)(()=>function(e){let r=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let r=t.slice(),n=r.indexOf(e);return -1!==n&&r.splice(n,1),r}))),i=(0,n.useMemo)(()=>({register:r,slot:e.slot,name:e.name,props:e.props}),[r,e.slot,e.name,e.props]);return n.createElement(u.Provider,{value:i},e.children)},[t])]}let h=Object.assign((0,s.yV)(function(e,t){let r=(0,i.M)(),{id:l=`headlessui-description-${r}`,...c}=e,h=function e(){let t=(0,n.useContext)(u);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}(),d=(0,o.T)(t);(0,a.e)(()=>h.register(l),[l,h.register]);let f={ref:d,...h.props,id:l};return(0,s.sY)({ourProps:f,theirProps:c,slot:h.slot||{},defaultTag:"p",name:h.name||"Description"})}),{})},42545:function(e,t,r){"use strict";let n,i;r.d(t,{V:function(){return el}});var s,a,o,l,u,c=r(67294),h=r.t(c,2),d=r(32984),f=r(12351),p=r(23784),m=r(61363),g=r(64103),y=r(19946),v=r(82180),w=r(46045),b=r(84575),_=r(73781),E=r(45662),T=r(14879),S=r(51074),I=r(14007),k=r(81021);function C(e,t){let r=(0,c.useRef)([]),n=(0,_.z)(e);(0,c.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 A=r(94192),x=r(61595);function O(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}var R=((s=R||{})[s.None=1]="None",s[s.InitialFocus=2]="InitialFocus",s[s.TabLock=4]="TabLock",s[s.FocusLock=8]="FocusLock",s[s.RestoreFocus=16]="RestoreFocus",s[s.All=30]="All",s);let N=Object.assign((0,f.yV)(function(e,t){let r=(0,c.useRef)(null),n=(0,p.T)(r,t),{initialFocus:i,containers:s,features:a=30,...o}=e;(0,v.H)()||(a=1);let l=(0,S.i)(r);!function({ownerDocument:e},t){let r=function(e=!0){let t=(0,c.useRef)(D.slice());return C(([e],[r])=>{!0===r&&!1===e&&(0,k.Y)(()=>{t.current.splice(0)}),!1===r&&!0===e&&(t.current=D.slice())},[e,D,t]),(0,_.z)(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(t);C(()=>{t||(null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&(0,b.C5)(r())},[t]),(0,x.L)(()=>{t&&(0,b.C5)(r())})}({ownerDocument:l},!!(16&a));let u=function({ownerDocument:e,container:t,initialFocus:r},n){let i=(0,c.useRef)(null),s=(0,T.t)();return C(()=>{if(!n)return;let a=t.current;a&&(0,k.Y)(()=>{if(!s.current)return;let t=null==e?void 0:e.activeElement;if(null!=r&&r.current){if((null==r?void 0:r.current)===t){i.current=t;return}}else if(a.contains(t)){i.current=t;return}null!=r&&r.current?(0,b.C5)(r.current):(0,b.jA)(a,b.TO.First)===b.fE.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==e?void 0:e.activeElement})},[n]),i}({ownerDocument:l,container:r,initialFocus:i},!!(2&a));!function({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let s=(0,T.t)();(0,I.O)(null==e?void 0:e.defaultView,"focus",e=>{if(!i||!s.current)return;let a=O(r);t.current instanceof HTMLElement&&a.add(t.current);let o=n.current;if(!o)return;let l=e.target;l&&l instanceof HTMLElement?P(a,l)?(n.current=l,(0,b.C5)(l)):(e.preventDefault(),e.stopPropagation(),(0,b.C5)(o)):(0,b.C5)(n.current)},!0)}({ownerDocument:l,container:r,containers:s,previousActiveElement:u},!!(8&a));let h=(0,E.l)(),m=(0,_.z)(e=>{let t=r.current;t&&(0,d.E)(h.current,{[E.N.Forwards]:()=>{(0,b.jA)(t,b.TO.First,{skipElements:[e.relatedTarget]})},[E.N.Backwards]:()=>{(0,b.jA)(t,b.TO.Last,{skipElements:[e.relatedTarget]})}})}),g=(0,A.G)(),y=(0,c.useRef)(!1);return c.createElement(c.Fragment,null,!!(4&a)&&c.createElement(w._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:w.A.Focusable}),(0,f.sY)({ourProps:{ref:n,onKeyDown(e){"Tab"==e.key&&(y.current=!0,g.requestAnimationFrame(()=>{y.current=!1}))},onBlur(e){let t=O(s);r.current instanceof HTMLElement&&t.add(r.current);let n=e.relatedTarget;n instanceof HTMLElement&&"true"!==n.dataset.headlessuiFocusGuard&&(P(t,n)||(y.current?(0,b.jA)(r.current,(0,d.E)(h.current,{[E.N.Forwards]:()=>b.TO.Next,[E.N.Backwards]:()=>b.TO.Previous})|b.TO.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&(0,b.C5)(e.target)))}},theirProps:o,defaultTag:"div",name:"FocusTrap"}),!!(4&a)&&c.createElement(w._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:w.A.Focusable}))}),{features:R}),D=[];function P(e,t){for(let r of e)if(r.contains(t))return!0;return!1}!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&D[0]!==e.target&&(D.unshift(e.target),(D=D.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 M=r(2740),L=r(31438),F=r(39516),j=r(16567),U=r(16723);let V=(0,c.createContext)(()=>{});V.displayName="StackContext";var $=((a=$||{})[a.Add=0]="Add",a[a.Remove=1]="Remove",a);function q({children:e,onUpdate:t,type:r,element:n,enabled:i}){let s=(0,c.useContext)(V),a=(0,_.z)((...e)=>{null==t||t(...e),s(...e)});return(0,U.e)(()=>{let e=void 0===i||!0===i;return e&&a(0,r,n),()=>{e&&a(1,r,n)}},[a,r,n,i]),c.createElement(V.Provider,{value:a},e)}var z=r(39650);let{useState:B,useEffect:H,useLayoutEffect:K,useDebugValue:G}=h;"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;let W=h.useSyncExternalStore;var Q=r(9362);let J=(o={PUSH(e,t){var r;let n=null!=(r=this.get(e))?r:{doc:e,count:0,d:(0,Q.k)(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n,i;let s={doc:e,d:t,meta:function(e){let t={};for(let r of e)Object.assign(t,r(t));return t}(r)},a=[/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0?{before(){n=window.pageYOffset},after({doc:e,d:t,meta:r}){function i(e){return r.containers.flatMap(e=>e()).some(t=>t.contains(e))}t.style(e.body,"marginTop",`-${n}px`),window.scrollTo(0,0);let s=null;t.addEventListener(e,"click",t=>{if(t.target instanceof HTMLElement)try{let r=t.target.closest("a");if(!r)return;let{hash:n}=new URL(r.href),a=e.querySelector(n);a&&!i(a)&&(s=a)}catch{}},!0),t.addEventListener(e,"touchmove",e=>{e.target instanceof HTMLElement&&!i(e.target)&&e.preventDefault()},{passive:!1}),t.add(()=>{window.scrollTo(0,window.pageYOffset+n),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})}}:{},{before({doc:e}){var t;let r=e.documentElement;i=(null!=(t=e.defaultView)?t:window).innerWidth-r.clientWidth},after({doc:e,d:t}){let r=e.documentElement,n=i-(r.clientWidth-r.offsetWidth);t.style(r,"paddingRight",`${n}px`)}},{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];a.forEach(({before:e})=>null==e?void 0:e(s)),a.forEach(({after:e})=>null==e?void 0:e(s))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}},n=new Map,i=new Set,{getSnapshot:()=>n,subscribe:e=>(i.add(e),()=>i.delete(e)),dispatch(e,...t){let r=o[e].call(n,...t);r&&(n=r,i.forEach(e=>e()))}});J.subscribe(()=>{let e=J.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;(n&&!e||!n&&e)&&J.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),0===r.count&&J.dispatch("TEARDOWN",r)}});let Y=new Map,X=new Map;function Z(e,t=!0){(0,U.e)(()=>{var r;if(!t)return;let n="function"==typeof e?e():e.current;if(!n)return;let i=null!=(r=X.get(n))?r:0;return X.set(n,i+1),0!==i||(Y.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),function(){var e;if(!n)return;let t=null!=(e=X.get(n))?e:1;if(1===t?X.delete(n):X.set(n,t-1),1!==t)return;let r=Y.get(n);r&&(null===r["aria-hidden"]?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",r["aria-hidden"]),n.inert=r.inert,Y.delete(n))}},[e,t])}var ee=r(65958),et=((l=et||{})[l.Open=0]="Open",l[l.Closed=1]="Closed",l),er=((u=er||{})[u.SetTitleId=0]="SetTitleId",u);let en={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},ei=(0,c.createContext)(null);function es(e){let t=(0,c.useContext)(ei);if(null===t){let t=Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,es),t}return t}function ea(e,t){return(0,d.E)(t.type,en,e,t)}ei.displayName="DialogContext";let eo=f.AN.RenderStrategy|f.AN.Static,el=Object.assign((0,f.yV)(function(e,t){var r;let n=(0,y.M)(),{id:i=`headlessui-dialog-${n}`,open:s,onClose:a,initialFocus:o,__demoMode:l=!1,...u}=e,[h,g]=(0,c.useState)(0),w=(0,j.oJ)();void 0===s&&null!==w&&(s=(w&j.ZM.Open)===j.ZM.Open);let b=(0,c.useRef)(null),E=(0,p.T)(b,t),T=(0,S.i)(b),k=e.hasOwnProperty("open")||null!==w,C=e.hasOwnProperty("onClose");if(!k&&!C)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!k)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!C)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof s)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${s}`);if("function"!=typeof a)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let A=s?0:1,[x,O]=(0,c.useReducer)(ea,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),R=(0,_.z)(()=>a(!1)),D=(0,_.z)(e=>O({type:0,id:e})),P=!!(0,v.H)()&&!l&&0===A,V=h>1,B=null!==(0,c.useContext)(ei),[H,K]=(0,M.k)(),{resolveContainers:G,mainTreeNodeRef:Q,MainTreeNode:Y}=(0,ee.v)({portals:H,defaultContainers:[null!=(r=x.panelRef.current)?r:b.current]}),X=V?"parent":"leaf",et=null!==w&&(w&j.ZM.Closing)===j.ZM.Closing,er=!B&&!et&&P;Z((0,c.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==T?void 0:T.querySelectorAll("body > *"))?e:[]).find(e=>"headlessui-portal-root"!==e.id&&e.contains(Q.current)&&e instanceof HTMLElement))?t:null},[Q]),er);let en=!!V||P;Z((0,c.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==T?void 0:T.querySelectorAll("[data-headlessui-portal]"))?e:[]).find(e=>e.contains(Q.current)&&e instanceof HTMLElement))?t:null},[Q]),en);let es=!(!P||V);(0,z.O)(G,R,es);let el=!(V||0!==A);(0,I.O)(null==T?void 0:T.defaultView,"keydown",e=>{el&&(e.defaultPrevented||e.key===m.R.Escape&&(e.preventDefault(),e.stopPropagation(),R()))}),function(e,t,r=()=>[document.body]){var n;let i,s;n=e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],r]}},i=W(J.subscribe,J.getSnapshot,J.getSnapshot),(s=e?i.get(e):void 0)&&s.count,(0,U.e)(()=>{if(!(!e||!t))return J.dispatch("PUSH",e,n),()=>J.dispatch("POP",e,n)},[t,e])}(T,!(et||0!==A||B),G),(0,c.useEffect)(()=>{if(0!==A||!b.current)return;let e=new ResizeObserver(e=>{for(let t of e){let e=t.target.getBoundingClientRect();0===e.x&&0===e.y&&0===e.width&&0===e.height&&R()}});return e.observe(b.current),()=>e.disconnect()},[A,b,R]);let[eu,ec]=(0,F.f)(),eh=(0,c.useMemo)(()=>[{dialogState:A,close:R,setTitleId:D},x],[A,x,R,D]),ed=(0,c.useMemo)(()=>({open:0===A}),[A]),ef={ref:E,id:i,role:"dialog","aria-modal":0===A||void 0,"aria-labelledby":x.titleId,"aria-describedby":eu};return c.createElement(q,{type:"Dialog",enabled:0===A,element:b,onUpdate:(0,_.z)((e,t)=>{"Dialog"===t&&(0,d.E)(e,{[$.Add]:()=>g(e=>e+1),[$.Remove]:()=>g(e=>e-1)})})},c.createElement(L.O,{force:!0},c.createElement(M.h,null,c.createElement(ei.Provider,{value:eh},c.createElement(M.h.Group,{target:b},c.createElement(L.O,{force:!1},c.createElement(ec,{slot:ed,name:"Dialog.Description"},c.createElement(N,{initialFocus:o,containers:G,features:P?(0,d.E)(X,{parent:N.features.RestoreFocus,leaf:N.features.All&~N.features.FocusLock}):N.features.None},c.createElement(K,null,(0,f.sY)({ourProps:ef,theirProps:u,slot:ed,defaultTag:"div",features:eo,visible:0===A,name:"Dialog"}))))))))),c.createElement(Y,null))}),{Backdrop:(0,f.yV)(function(e,t){let r=(0,y.M)(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:s},a]=es("Dialog.Backdrop"),o=(0,p.T)(t);(0,c.useEffect)(()=>{if(null===a.panelRef.current)throw Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let l=(0,c.useMemo)(()=>({open:0===s}),[s]);return c.createElement(L.O,{force:!0},c.createElement(M.h,null,(0,f.sY)({ourProps:{ref:o,id:n,"aria-hidden":!0},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Backdrop"})))}),Panel:(0,f.yV)(function(e,t){let r=(0,y.M)(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:s},a]=es("Dialog.Panel"),o=(0,p.T)(t,a.panelRef),l=(0,c.useMemo)(()=>({open:0===s}),[s]),u=(0,_.z)(e=>{e.stopPropagation()});return(0,f.sY)({ourProps:{ref:o,id:n,onClick:u},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Panel"})}),Overlay:(0,f.yV)(function(e,t){let r=(0,y.M)(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:s,close:a}]=es("Dialog.Overlay"),o=(0,p.T)(t),l=(0,_.z)(e=>{if(e.target===e.currentTarget){if((0,g.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}}),u=(0,c.useMemo)(()=>({open:0===s}),[s]);return(0,f.sY)({ourProps:{ref:o,id:n,"aria-hidden":!0,onClick:l},theirProps:i,slot:u,defaultTag:"div",name:"Dialog.Overlay"})}),Title:(0,f.yV)(function(e,t){let r=(0,y.M)(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:s,setTitleId:a}]=es("Dialog.Title"),o=(0,p.T)(t);(0,c.useEffect)(()=>(a(n),()=>a(null)),[n,a]);let l=(0,c.useMemo)(()=>({open:0===s}),[s]);return(0,f.sY)({ourProps:{ref:o,id:n},theirProps:i,slot:l,defaultTag:"h2",name:"Dialog.Title"})}),Description:F.d})},61363:function(e,t,r){"use strict";r.d(t,{R:function(){return i}});var n,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)},2740:function(e,t,r){"use strict";r.d(t,{h:function(){return w},k:function(){return v}});var n=r(67294),i=r(73935),s=r(12351),a=r(16723),o=r(31438),l=r(82180),u=r(23784),c=r(61595),h=r(51074),d=r(77896),f=r(73781);let p=n.Fragment,m=n.Fragment,g=(0,n.createContext)(null),y=(0,n.createContext)(null);function v(){let e=(0,n.useContext)(y),t=(0,n.useRef)([]),r=(0,f.z)(r=>(t.current.push(r),e&&e.register(r),()=>i(r))),i=(0,f.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({children:e}){return n.createElement(y.Provider,{value:s},e)},[s])]}let w=Object.assign((0,s.yV)(function(e,t){let r=(0,n.useRef)(null),f=(0,u.T)((0,u.h)(e=>{r.current=e}),t),m=(0,h.i)(r),v=function(e){let t=(0,o.n)(),r=(0,n.useContext)(g),i=(0,h.i)(e),[s,a]=(0,n.useState)(()=>{if(!t&&null!==r||d.O.isServer)return null;let e=null==i?void 0:i.getElementById("headlessui-portal-root");if(e)return e;if(null===i)return null;let n=i.createElement("div");return n.setAttribute("id","headlessui-portal-root"),i.body.appendChild(n)});return(0,n.useEffect)(()=>{null!==s&&(null!=i&&i.body.contains(s)||null==i||i.body.appendChild(s))},[s,i]),(0,n.useEffect)(()=>{t||null!==r&&a(r.current)},[r,a,t]),s}(r),[w]=(0,n.useState)(()=>{var e;return d.O.isServer?null:null!=(e=null==m?void 0:m.createElement("div"))?e:null}),b=(0,n.useContext)(y),_=(0,l.H)();return(0,a.e)(()=>{!v||!w||v.contains(w)||(w.setAttribute("data-headlessui-portal",""),v.appendChild(w))},[v,w]),(0,a.e)(()=>{if(w&&b)return b.register(w)},[b,w]),(0,c.L)(()=>{var e;v&&w&&(w instanceof Node&&v.contains(w)&&v.removeChild(w),v.childNodes.length<=0&&(null==(e=v.parentElement)||e.removeChild(v)))}),_&&v&&w?(0,i.createPortal)((0,s.sY)({ourProps:{ref:f},theirProps:e,defaultTag:p,name:"Portal"}),w):null}),{Group:(0,s.yV)(function(e,t){let{target:r,...i}=e,a={ref:(0,u.T)(t)};return n.createElement(g.Provider,{value:r},(0,s.sY)({ourProps:a,theirProps:i,defaultTag:m,name:"Popover.Group"}))})})},94192:function(e,t,r){"use strict";r.d(t,{G:function(){return s}});var n=r(67294),i=r(9362);function s(){let[e]=(0,n.useState)(i.k);return(0,n.useEffect)(()=>()=>e.dispose(),[e]),e}},14007:function(e,t,r){"use strict";r.d(t,{O:function(){return s}});var n=r(67294),i=r(3855);function s(e,t,r,s){let a=(0,i.E)(r);(0,n.useEffect)(()=>{function r(e){a.current(e)}return(e=null!=e?e:window).addEventListener(t,r,s),()=>e.removeEventListener(t,r,s)},[e,t,s])}},73781:function(e,t,r){"use strict";r.d(t,{z:function(){return s}});var n=r(67294),i=r(3855);let s=function(e){let t=(0,i.E)(e);return n.useCallback((...e)=>t.current(...e),[t])}},19946:function(e,t,r){"use strict";r.d(t,{M:function(){return l}});var n,i=r(67294),s=r(16723),a=r(82180),o=r(77896);let l=null!=(n=i.useId)?n:function(){let e=(0,a.H)(),[t,r]=i.useState(e?()=>o.O.nextId():null);return(0,s.e)(()=>{null===t&&r(o.O.nextId())},[t]),null!=t?""+t:void 0}},14879:function(e,t,r){"use strict";r.d(t,{t:function(){return s}});var n=r(67294),i=r(16723);function s(){let e=(0,n.useRef)(!1);return(0,i.e)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}},16723:function(e,t,r){"use strict";r.d(t,{e:function(){return s}});var n=r(67294),i=r(77896);let s=(e,t)=>{i.O.isServer?(0,n.useEffect)(e,t):(0,n.useLayoutEffect)(e,t)}},3855:function(e,t,r){"use strict";r.d(t,{E:function(){return s}});var n=r(67294),i=r(16723);function s(e){let t=(0,n.useRef)(e);return(0,i.e)(()=>{t.current=e},[e]),t}},61595:function(e,t,r){"use strict";r.d(t,{L:function(){return a}});var n=r(67294),i=r(81021),s=r(73781);function a(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])}},39650:function(e,t,r){"use strict";r.d(t,{O:function(){return l}});var n=r(67294),i=r(84575),s=r(3855);function a(e,t,r){let i=(0,s.E)(t);(0,n.useEffect)(()=>{function t(e){i.current(e)}return document.addEventListener(e,t,r),()=>document.removeEventListener(e,t,r)},[e,r])}var o=r(7815);function l(e,t,r=!0){let s=(0,n.useRef)(!1);function l(r,n){if(!s.current||r.defaultPrevented)return;let a=n(r);if(null!==a&&a.getRootNode().contains(a)){for(let t of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e)){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(a)||r.composed&&r.composedPath().includes(e))return}return(0,i.sP)(a,i.tJ.Loose)||-1===a.tabIndex||r.preventDefault(),t(r,a)}}(0,n.useEffect)(()=>{requestAnimationFrame(()=>{s.current=r})},[r]);let u=(0,n.useRef)(null);a("mousedown",e=>{var t,r;s.current&&(u.current=(null==(r=null==(t=e.composedPath)?void 0:t.call(e))?void 0:r[0])||e.target)},!0),a("click",e=>{u.current&&(l(e,()=>u.current),u.current=null)},!0),(0,o.s)("blur",e=>l(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}},51074:function(e,t,r){"use strict";r.d(t,{i:function(){return s}});var n=r(67294),i=r(15466);function s(...e){return(0,n.useMemo)(()=>(0,i.r)(...e),[...e])}},65958:function(e,t,r){"use strict";r.d(t,{v:function(){return o}});var n=r(67294),i=r(46045),s=r(73781),a=r(51074);function o({defaultContainers:e=[],portals:t}={}){let r=(0,n.useRef)(null),o=(0,a.i)(r),l=(0,s.z)(()=>{var n;let i=[];for(let t of e)null!==t&&(t instanceof HTMLElement?i.push(t):"current"in t&&t.current instanceof HTMLElement&&i.push(t.current));if(null!=t&&t.current)for(let e of t.current)i.push(e);for(let e of null!=(n=null==o?void 0:o.querySelectorAll("html > *, body > *"))?n:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&"headlessui-portal-root"!==e.id&&(e.contains(r.current)||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:l,contains:(0,s.z)(e=>l().some(t=>t.contains(e))),mainTreeNodeRef:r,MainTreeNode:(0,n.useMemo)(()=>function(){return n.createElement(i._,{features:i.A.Hidden,ref:r})},[r])}}},82180:function(e,t,r){"use strict";r.d(t,{H:function(){return s}});var n=r(67294),i=r(77896);function s(){let[e,t]=(0,n.useState)(i.O.isHandoffComplete);return e&&!1===i.O.isHandoffComplete&&t(!1),(0,n.useEffect)(()=>{!0!==e&&t(!0)},[e]),(0,n.useEffect)(()=>i.O.handoff(),[]),e}},23784:function(e,t,r){"use strict";r.d(t,{T:function(){return o},h:function(){return a}});var n=r(67294),i=r(73781);let s=Symbol();function a(e,t=!0){return Object.assign(e,{[s]:t})}function o(...e){let t=(0,n.useRef)(e);(0,n.useEffect)(()=>{t.current=e},[e]);let r=(0,i.z)(e=>{for(let r of t.current)null!=r&&("function"==typeof r?r(e):r.current=e)});return e.every(e=>null==e||(null==e?void 0:e[s]))?void 0:r}},45662:function(e,t,r){"use strict";r.d(t,{N:function(){return a},l:function(){return o}});var n,i=r(67294),s=r(7815),a=((n=a||{})[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n);function o(){let e=(0,i.useRef)(0);return(0,s.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}},7815:function(e,t,r){"use strict";r.d(t,{s:function(){return s}});var n=r(67294),i=r(3855);function s(e,t,r){let s=(0,i.E)(t);(0,n.useEffect)(()=>{function t(e){s.current(e)}return window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)},[e,r])}},46045:function(e,t,r){"use strict";r.d(t,{A:function(){return s},_:function(){return a}});var n,i=r(12351),s=((n=s||{})[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n);let a=(0,i.yV)(function(e,t){let{features:r=1,...n}=e,s={ref:t,"aria-hidden":(2&r)==2||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&r)==4&&(2&r)!=2&&{display:"none"}}};return(0,i.sY)({ourProps:s,theirProps:n,slot:{},defaultTag:"div",name:"Hidden"})})},16567:function(e,t,r){"use strict";r.d(t,{ZM:function(){return a},oJ:function(){return o},up:function(){return l}});var n,i=r(67294);let s=(0,i.createContext)(null);s.displayName="OpenClosedContext";var a=((n=a||{})[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n);function o(){return(0,i.useContext)(s)}function l({value:e,children:t}){return i.createElement(s.Provider,{value:e},t)}},31438:function(e,t,r){"use strict";r.d(t,{O:function(){return a},n:function(){return s}});var n=r(67294);let i=(0,n.createContext)(!1);function s(){return(0,n.useContext)(i)}function a(e){return n.createElement(i.Provider,{value:e.force},e.children)}},64103:function(e,t,r){"use strict";function n(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(null==t?void 0:t.getAttribute("disabled"))==="";return!(n&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(r))&&n}r.d(t,{P:function(){return n}})},44067:function(e,t,r){"use strict";function n(...e){return e.filter(Boolean).join(" ")}r.d(t,{A:function(){return n}})},9362: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(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame:(...e)=>r.requestAnimationFrame(()=>r.requestAnimationFrame(...e)),setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return(0,n.Y)(()=>{t.current&&e[0]()}),r.add(()=>{t.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.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(81021)},77896: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);let a=new class{constructor(){s(this,"current",this.detect()),s(this,"handoffState","pending"),s(this,"currentId",0)}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 window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}}},84575:function(e,t,r){"use strict";r.d(t,{C5:function(){return v},GO:function(){return p},TO:function(){return h},fE:function(){return d},jA:function(){return b},sP:function(){return g},tJ:function(){return m},z2:function(){return w}});var n,i,s,a,o,l=r(32984),u=r(15466);let c=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var h=((n=h||{})[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),d=((i=d||{})[i.Error=0]="Error",i[i.Overflow=1]="Overflow",i[i.Success=2]="Success",i[i.Underflow=3]="Underflow",i),f=((s=f||{})[s.Previous=-1]="Previous",s[s.Next=1]="Next",s);function p(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(c)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var m=((a=m||{})[a.Strict=0]="Strict",a[a.Loose=1]="Loose",a);function g(e,t=0){var r;return e!==(null==(r=(0,u.r)(e))?void 0:r.body)&&(0,l.E)(t,{0:()=>e.matches(c),1(){let t=e;for(;null!==t;){if(t.matches(c))return!0;t=t.parentElement}return!1}})}var y=((o=y||{})[o.Keyboard=0]="Keyboard",o[o.Mouse=1]="Mouse",o);function v(e){null==e||e.focus({preventScroll:!0})}function w(e,t=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 b(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){var s,a,o;let l=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,u=Array.isArray(e)?r?w(e):e:p(e);i.length>0&&u.length>1&&(u=u.filter(e=>!i.includes(e))),n=null!=n?n: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")})(),h=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,u.indexOf(n))-1;if(4&t)return Math.max(0,u.indexOf(n))+1;if(8&t)return u.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=32&t?{preventScroll:!0}:{},f=0,m=u.length,g;do{if(f>=m||f+m<=0)return 0;let e=h+f;if(16&t)e=(e+m)%m;else{if(e<0)return 3;if(e>=m)return 1}null==(g=u[e])||g.focus(d),f+=c}while(g!==l.activeElement);return 6&t&&null!=(o=null==(a=null==(s=g)?void 0:s.matches)?void 0:a.call(s,"textarea,input"))&&o&&g.select(),2}"undefined"!=typeof window&&"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))},32984:function(e,t,r){"use strict";function n(e,t,...r){if(e in t){let n=t[e];return"function"==typeof n?n(...r):n}let i=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,n),i}r.d(t,{E:function(){return n}})},81021: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}})},15466:function(e,t,r){"use strict";r.d(t,{r:function(){return i}});var n=r(77896);function i(e){return n.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}},12351:function(e,t,r){"use strict";r.d(t,{AN:function(){return l},l4:function(){return u},oA:function(){return p},sY:function(){return c},yV:function(){return f}});var n,i,s=r(67294),a=r(44067),o=r(32984),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({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:s=!0,name:a}){let l=d(t,e);if(s)return h(l,r,n,a);let u=null!=i?i:0;if(2&u){let{static:e=!1,...t}=l;if(e)return h(t,r,n,a)}if(1&u){let{unmount:e=!0,...t}=l;return(0,o.E)(e?0:1,{0:()=>null,1:()=>h({...t,hidden:!0,style:{display:"none"}},r,n,a)})}return h(l,r,n,a)}function h(e,t={},r,n){let{as:i=r,children:o,refName:l="ref",...u}=m(e,["unmount","static"]),c=void 0!==e.ref?{[l]:e.ref}:{},h="function"==typeof o?o(t):o;"className"in u&&u.className&&"function"==typeof u.className&&(u.className=u.className(t));let f={};if(t){let e=!1,r=[];for(let[n,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&r.push(n);e&&(f["data-headlessui-state"]=r.join(" "))}if(i===s.Fragment&&Object.keys(p(u)).length>0){if(!(0,s.isValidElement)(h)||Array.isArray(h)&&h.length>1)throw Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(u).map(e=>`  - ${e}`).join(`
`),"","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=>`  - ${e}`).join(`
`)].join(`
`));let e=h.props,t="function"==typeof(null==e?void 0:e.className)?(...t)=>(0,a.A)(null==e?void 0:e.className(...t),u.className):(0,a.A)(null==e?void 0:e.className,u.className),r=t?{className:t}:{};return(0,s.cloneElement)(h,Object.assign({},d(h.props,p(m(u,["ref"]))),f,c,function(...e){return{ref:e.every(e=>null==e)?void 0:t=>{for(let r of e)null!=r&&("function"==typeof r?r(t):r.current=t)}}}(h.ref,c.ref),r))}return(0,s.createElement)(i,Object.assign({},m(u,["ref"]),i!==s.Fragment&&c,i!==s.Fragment&&f),h)}function d(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},r={};for(let n of e)for(let e in n)e.startsWith("on")&&"function"==typeof n[e]?(null!=r[e]||(r[e]=[]),r[e].push(n[e])):t[e]=n[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(e=>[e,void 0])));for(let e in r)Object.assign(t,{[e](t,...n){for(let i of r[e]){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;i(t,...n)}}});return t}function f(e){var t;return Object.assign((0,s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function p(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function m(e,t=[]){let r=Object.assign({},e);for(let e of t)e in r&&delete r[e];return r}},10779:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(67294),i=r(27589),s=Object.defineProperty,a=Object.defineProperties,o=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,h=(e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))u.call(t,r)&&h(e,r,t[r]);if(l)for(var r of l(t))c.call(t,r)&&h(e,r,t[r]);return e},f=(e,t)=>a(e,o(t));let p=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),m=(0,n.forwardRef)((e,t)=>n.createElement(i.Z,f(d({ref:t},e),{weights:p})));m.displayName="CheckCircle"},13534:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(67294),i=r(27589),s=Object.defineProperty,a=Object.defineProperties,o=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,h=(e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))u.call(t,r)&&h(e,r,t[r]);if(l)for(var r of l(t))c.call(t,r)&&h(e,r,t[r]);return e},f=(e,t)=>a(e,o(t));let p=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM193.15,68,128,127.72,62.85,68ZM44,188V83.28l75.89,69.57a12,12,0,0,0,16.22,0L212,83.28V188Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,56l-96,88L32,56Z",opacity:"0.2"}),n.createElement("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48Zm-8,144H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50ZM208.58,62,128,135.86,47.42,62ZM216,194H40a2,2,0,0,1-2-2V69.64l86,78.78a6,6,0,0,0,8.1,0L218,69.64V192A2,2,0,0,1,216,194Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52Zm-10.28,8L128,138.57,42.28,60ZM216,196H40a4,4,0,0,1-4-4V65.09L125.3,147a4,4,0,0,0,5.4,0L220,65.09V192A4,4,0,0,1,216,196Z"}))]]),m=(0,n.forwardRef)((e,t)=>n.createElement(i.Z,f(d({ref:t},e),{weights:p})));m.displayName="EnvelopeSimple"},16786:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(67294),i=r(27589),s=Object.defineProperty,a=Object.defineProperties,o=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,h=(e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))u.call(t,r)&&h(e,r,t[r]);if(l)for(var r of l(t))c.call(t,r)&&h(e,r,t[r]);return e},f=(e,t)=>a(e,o(t));let p=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),m=(0,n.forwardRef)((e,t)=>n.createElement(i.Z,f(d({ref:t},e),{weights:p})));m.displayName="XCircle"},27589:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(67294);let i=(0,n.createContext)({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var s=Object.defineProperty,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))o.call(t,r)&&u(e,r,t[r]);if(a)for(var r of a(t))l.call(t,r)&&u(e,r,t[r]);return e},h=(e,t)=>{var r={};for(var n in e)o.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&a)for(var n of a(e))0>t.indexOf(n)&&l.call(e,n)&&(r[n]=e[n]);return r};let d=(0,n.forwardRef)((e,t)=>{let{alt:r,color:s,size:a,weight:o,mirrored:l,children:u,weights:d}=e,f=h(e,["alt","color","size","weight","mirrored","children","weights"]),p=(0,n.useContext)(i),{color:m="currentColor",size:g,weight:y="regular",mirrored:v=!1}=p,w=h(p,["color","size","weight","mirrored"]);return n.createElement("svg",c(c({ref:t,xmlns:"http://www.w3.org/2000/svg",width:null!=a?a:g,height:null!=a?a:g,fill:null!=s?s:m,viewBox:"0 0 256 256",transform:l||v?"scale(-1, 1)":void 0},w),f),!!r&&n.createElement("title",null,r),u,d.get(null!=o?o:y))});d.displayName="IconBase"},15060:function(e,t,r){"use strict";r.d(t,{s4:function(){return g},xC:function(){return E},PH:function(){return h},hg:function(){return M},oM:function(){return U},rJ:function(){return W},A6:function(){return C},Q:function(){return k},Gx:function(){return function e(...t){return 0===t.length?e=>A(e,["pending","fulfilled","rejected"]):x(t)?k(...t.flatMap(e=>[e.pending,e.rejected,e.fulfilled])):e()(t[0])}},KD:function(){return function e(...t){return 0===t.length?e=>A(e,["fulfilled"]):x(t)?k(...t.map(e=>e.fulfilled)):e()(t[0])}},zR:function(){return function e(...t){return 0===t.length?e=>A(e,["pending"]):x(t)?k(...t.map(e=>e.pending)):e()(t[0])}},Iv:function(){return O},h_:function(){return function e(...t){let r=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===t.length?C(O(...t),r):x(t)?C(O(...t),r):e()(t[0])}},x0:function(){return S},cw:function(){return y}});var n,i=r(93513),s=r(19119),a=r(65849);function o(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var l=o();r(83454),((...e)=>{let t=(0,s.wN)(...e),r=Object.assign((...e)=>{let r=t(...e),n=(e,...t)=>r((0,i.mv)(e)?(0,i.Vk)(e):e,...t);return Object.assign(n,r),n},{withTypes:()=>r})})(s.kO);var u="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?a.qC:a.qC.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var c=e=>e&&"function"==typeof e.match;function h(e,t){function r(...n){if(t){let r=t(...n);if(!r)throw Error(W(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>(0,a.LG)(t)&&t.type===e,r}var d=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function f(e){return(0,i.o$)(e)?(0,i.Uy)(e,()=>{}):e}function p(e,t,r){if(e.has(t)){let n=e.get(t);return r.update&&(n=r.update(n,t,e),e.set(t,n)),n}if(!r.insert)throw Error(W(10));let n=r.insert(t,e);return e.set(t,n),n}var m=()=>function(e){let{thunk:t=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:i=!0}=e??{},s=new d;return t&&("boolean"==typeof t?s.push(l):s.push(o(t.extraArgument))),s},g="RTK_autoBatch",y=()=>e=>({payload:e,meta:{[g]:!0}}),v=e=>t=>{setTimeout(t,e)},w="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:v(10),b=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,s=!1,a=!1,o=new Set,l="tick"===e.type?queueMicrotask:"raf"===e.type?w:"callback"===e.type?e.queueNotification:v(e.timeout),u=()=>{a=!1,s&&(s=!1,o.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){let t=n.subscribe(()=>i&&e());return o.add(e),()=>{t(),o.delete(e)}},dispatch(e){try{return(s=!(i=!e?.meta?.[g]))&&!a&&(a=!0,l(u)),n.dispatch(e)}finally{i=!0}}})},_=e=>function(t){let{autoBatch:r=!0}=t??{},n=new d(e);return r&&n.push(b("object"==typeof r?r:void 0)),n};function E(e){let t,r;let n=m(),{reducer:i,middleware:s,devTools:o=!0,preloadedState:l,enhancers:c}=e||{};if("function"==typeof i)t=i;else if((0,a.PO)(i))t=(0,a.UY)(i);else throw Error(W(1));r="function"==typeof s?s(n):n();let h=a.qC;o&&(h=u({trace:!1,..."object"==typeof o&&o}));let d=(0,a.md)(...r),f=_(d),p="function"==typeof c?c(f):f(),g=h(...p);return(0,a.MT)(t,l,g)}function T(e){let t;let r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw Error(W(28));if(n in r)throw Error(W(29));return r[n]=t,i},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(t=e,i)};return e(i),[r,n,t]}var S=(e=21)=>{let t="",r=e;for(;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},I=(e,t)=>c(e)?e.match(t):e(t);function k(...e){return t=>e.some(e=>I(e,t))}function C(...e){return t=>e.every(e=>I(e,t))}function A(e,t){if(!e||!e.meta)return!1;let r="string"==typeof e.meta.requestId,n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function x(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function O(...e){return 0===e.length?e=>A(e,["rejected"]):x(e)?k(...e.map(e=>e.rejected)):O()(e[0])}var R=["name","message","stack","code"],N=class{constructor(e,t){this.payload=e,this.meta=t}_type},D=class{constructor(e,t){this.payload=e,this.meta=t}_type},P=e=>{if("object"==typeof e&&null!==e){let t={};for(let r of R)"string"==typeof e[r]&&(t[r]=e[r]);return t}return{message:String(e)}},M=(()=>{function e(e,t,r){let n=h(e+"/fulfilled",(e,t,r,n)=>({payload:e,meta:{...n||{},arg:r,requestId:t,requestStatus:"fulfilled"}})),i=h(e+"/pending",(e,t,r)=>({payload:void 0,meta:{...r||{},arg:t,requestId:e,requestStatus:"pending"}})),s=h(e+"/rejected",(e,t,n,i,s)=>({payload:i,error:(r&&r.serializeError||P)(e||"Rejected"),meta:{...s||{},arg:n,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:e?.name==="AbortError",condition:e?.name==="ConditionError"}}));return Object.assign(function(e){return(a,o,l)=>{let u,c;let h=r?.idGenerator?r.idGenerator(e):S(),d=new AbortController;function f(e){c=e,d.abort()}let p=async function(){let p;try{var m;let s=r?.condition?.(e,{getState:o,extra:l});if(m=s,null!==m&&"object"==typeof m&&"function"==typeof m.then&&(s=await s),!1===s||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let g=new Promise((e,t)=>{u=()=>{t({name:"AbortError",message:c||"Aborted"})},d.signal.addEventListener("abort",u)});a(i(h,e,r?.getPendingMeta?.({requestId:h,arg:e},{getState:o,extra:l}))),p=await Promise.race([g,Promise.resolve(t(e,{dispatch:a,getState:o,extra:l,requestId:h,signal:d.signal,abort:f,rejectWithValue:(e,t)=>new N(e,t),fulfillWithValue:(e,t)=>new D(e,t)})).then(t=>{if(t instanceof N)throw t;return t instanceof D?n(t.payload,h,e,t.meta):n(t,h,e)})])}catch(t){p=t instanceof N?s(null,h,e,t.payload,t.meta):s(t,h,e)}finally{u&&d.signal.removeEventListener("abort",u)}let g=r&&!r.dispatchConditionRejection&&s.match(p)&&p.meta.condition;return g||a(p),p}();return Object.assign(p,{abort:f,requestId:h,arg:e,unwrap:()=>p.then(L)})}},{pending:i,rejected:s,fulfilled:n,settled:k(s,n),typePrefix:e})}return e.withTypes=()=>e,e})();function L(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var F=Symbol.for("rtk-slice-createasyncthunk"),j=((n=j||{}).reducer="reducer",n.reducerWithPrepare="reducerWithPrepare",n.asyncThunk="asyncThunk",n),U=function({creators:e}={}){let t=e?.asyncThunk?.[F];return function(e){let r;let{name:n,reducerPath:s=n}=e;if(!n)throw Error(W(11));let a=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},o=Object.keys(a),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(e,t){let r="string"==typeof e?e:e.type;if(!r)throw Error(W(12));if(r in l.sliceCaseReducersByType)throw Error(W(13));return l.sliceCaseReducersByType[r]=t,u},addMatcher:(e,t)=>(l.sliceMatchers.push({matcher:e,reducer:t}),u),exposeAction:(e,t)=>(l.actionCreators[e]=t,u),exposeCaseReducer:(e,t)=>(l.sliceCaseReducersByName[e]=t,u)};function c(){let[t={},r=[],n]="function"==typeof e.extraReducers?T(e.extraReducers):[e.extraReducers],s={...t,...l.sliceCaseReducersByType};return function(e,t){let r;let[n,s,a]=T(t);if("function"==typeof e)r=()=>f(e());else{let t=f(e);r=()=>t}function o(e=r(),t){let o=[n[t.type],...s.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===o.filter(e=>!!e).length&&(o=[a]),o.reduce((e,r)=>{if(r){if((0,i.mv)(e)){let n=r(e,t);return void 0===n?e:n}if((0,i.o$)(e))return(0,i.Uy)(e,e=>r(e,t));{let n=r(e,t);if(void 0===n){if(null===e)return e;throw Error(W(9))}return n}}return e},e)}return o.getInitialState=r,o}(e.initialState,e=>{for(let t in s)e.addCase(t,s[t]);for(let t of l.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)})}o.forEach(r=>{let i=a[r],s={reducerName:r,type:`${n}/${r}`,createNotation:"function"==typeof e.reducers};"asyncThunk"===i._reducerDefinitionType?function({type:e,reducerName:t},r,n,i){if(!i)throw Error(W(18));let{payloadCreator:s,fulfilled:a,pending:o,rejected:l,settled:u,options:c}=r,h=i(e,s,c);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),o&&n.addCase(h.pending,o),l&&n.addCase(h.rejected,l),u&&n.addMatcher(h.settled,u),n.exposeCaseReducer(t,{fulfilled:a||V,pending:o||V,rejected:l||V,settled:u||V})}(s,i,u,t):function({type:e,reducerName:t,createNotation:r},n,i){let s,a;if("reducer"in n){if(r&&"reducerWithPrepare"!==n._reducerDefinitionType)throw Error(W(17));s=n.reducer,a=n.prepare}else s=n;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,a?h(e,a):h(e))}(s,i,u)});let d=e=>e,m=new Map;function g(e,t){return r||(r=c()),r(e,t)}function y(){return r||(r=c()),r.getInitialState()}function v(t,r=!1){function n(e){let n=e[t];return void 0===n&&r&&(n=y()),n}function i(t=d){let n=p(m,r,{insert:()=>new WeakMap});return p(n,t,{insert:()=>{let n={};for(let[i,s]of Object.entries(e.selectors??{}))n[i]=function(e,t,r,n){function i(s,...a){let o=t(s);return void 0===o&&n&&(o=r()),e(o,...a)}return i.unwrapped=e,i}(s,t,y,r);return n}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(n)},selectSlice:n}}let w={name:n,reducer:g,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:y,...v(s),injectInto(e,{reducerPath:t,...r}={}){let n=t??s;return e.inject({reducerPath:n,reducer:g},r),{...w,...v(n,!0)}}};return w}}();function V(){}var $=(e,t)=>{if("function"!=typeof e)throw Error(W(32))},{assign:q}=Object,z="listenerMiddleware",B=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:s}=e;if(t)i=h(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(i);else throw Error(W(21));return $(s,"options.listener"),{predicate:i,type:t,effect:s}},H=Object.assign(e=>{let{type:t,predicate:r,effect:n}=B(e),i=S(),s={id:i,effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw Error(W(22))}};return s},{withTypes:()=>H}),K=Object.assign(h(`${z}/add`),{withTypes:()=>K});h(`${z}/removeAll`);var G=Object.assign(h(`${z}/remove`),{withTypes:()=>G});function W(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original")},78952:function(e,t,r){"use strict";r.d(t,{v0:function(){return t2},JB:function(){return eX},Aj:function(){return e0},P6:function(){return eZ}});var n,i=r(74444),s=r(25816),a=r(97582),o=r(53333),l=r(8463);function u(){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 c=new i.LL("auth","Firebase",u()),h=new o.Yd("@firebase/auth");function d(e,...t){h.logLevel<=o.in.ERROR&&h.error(`Auth (${s.Jn}): ${e}`,...t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function f(e,...t){throw m(e,...t)}function p(e,...t){return m(e,...t)}function m(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 c.create(e,...t)}function g(e,t,...r){if(!e)throw m(t,...r)}function y(e){let t="INTERNAL ASSERTION FAILED: "+e;throw d(t),Error(t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function v(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function w(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class b{constructor(e,t){this.shortDelay=e,this.longDelay=t,t>e||y("Short delay should be less than long delay!"),this.isMobile=(0,i.uI)()||(0,i.b$)()}get(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&("http:"===w()||"https:"===w()||(0,i.ru)()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _(e,t){e.emulator||y("Emulator should always be set here");let{url:r}=e.emulator;return t?`${r}${t.startsWith("/")?t.slice(1):t}`:r}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class E{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:void y("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:void y("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:void y("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let T={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",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",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},S=new b(3e4,6e4);function I(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function k(e,t,r,n,s={}){return C(e,s,async()=>{let s={},a={};n&&("GET"===t?a=n:s={body:JSON.stringify(n)});let o=(0,i.xO)(Object.assign({key:e.config.apiKey},a)).slice(1),l=await e._getAdditionalHeaders();return l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode),E.fetch()(x(e,e.config.apiHost,r,o),Object.assign({method:t,headers:l,referrerPolicy:"no-referrer"},s))})}async function C(e,t,r){e._canInitEmulator=!1;let n=Object.assign(Object.assign({},T),t);try{let t=new O(e),s=await Promise.race([r(),t.promise]);t.clearNetworkTimeout();let a=await s.json();if("needConfirmation"in a)throw R(e,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{let t=s.ok?a.errorMessage:a.error.message,[r,o]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===r)throw R(e,"credential-already-in-use",a);if("EMAIL_EXISTS"===r)throw R(e,"email-already-in-use",a);if("USER_DISABLED"===r)throw R(e,"user-disabled",a);let l=n[r]||r.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw function(e,t,r){let n=Object.assign(Object.assign({},u()),{[t]:r}),s=new i.LL("auth","Firebase",n);return s.create(t,{appName:e.name})}(e,l,o);f(e,l)}}catch(t){if(t instanceof i.ZR)throw t;f(e,"network-request-failed",{message:String(t)})}}async function A(e,t,r,n,i={}){let s=await k(e,t,r,n,i);return"mfaPendingCredential"in s&&f(e,"multi-factor-auth-required",{_serverResponse:s}),s}function x(e,t,r,n){let i=`${t}${r}?${n}`;return e.config.emulator?_(e.config,i):`${e.config.apiScheme}://${i}`}class O{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(p(this.auth,"network-request-failed")),S.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function R(e,t,r){let n={appName:e.name};r.email&&(n.email=r.email),r.phoneNumber&&(n.phoneNumber=r.phoneNumber);let i=p(e,t,n);return i.customData._tokenResponse=r,i}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function N(e,t){return k(e,"POST","/v1/accounts:delete",t)}async function D(e,t){return k(e,"POST","/v1/accounts:lookup",t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function P(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function M(e,t=!1){let r=(0,i.m9)(e),n=await r.getIdToken(t),s=F(n);g(s&&s.exp&&s.auth_time&&s.iat,r.auth,"internal-error");let a="object"==typeof s.firebase?s.firebase:void 0,o=null==a?void 0:a.sign_in_provider;return{claims:s,token:n,authTime:P(L(s.auth_time)),issuedAtTime:P(L(s.iat)),expirationTime:P(L(s.exp)),signInProvider:o||null,signInSecondFactor:(null==a?void 0:a.sign_in_second_factor)||null}}function L(e){return 1e3*Number(e)}function F(e){let[t,r,n]=e.split(".");if(void 0===t||void 0===r||void 0===n)return d("JWT malformed, contained fewer than 3 sections"),null;try{let e=(0,i.tV)(r);if(!e)return d("Failed to decode base64 JWT payload"),null;return JSON.parse(e)}catch(e){return d("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function j(e,t,r=!1){if(r)return t;try{return await t}catch(t){throw t instanceof i.ZR&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class U{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){var t;if(e){let e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;let e=null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0,r=e-Date.now()-3e5;return Math.max(0,r)}}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){(null==e?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class V{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=P(this.lastLoginAt),this.creationTime=P(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function $(e){var t;let r=e.auth,n=await e.getIdToken(),i=await j(e,D(r,{idToken:n}));g(null==i?void 0:i.users.length,r,"internal-error");let s=i.users[0];e._notifyReloadListener(s);let o=(null===(t=s.providerUserInfo)||void 0===t?void 0:t.length)?s.providerUserInfo.map(e=>{var{providerId:t}=e,r=(0,a.__rest)(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}}):[],l=function(e,t){let r=e.filter(e=>!t.some(t=>t.providerId===e.providerId));return[...r,...t]}(e.providerData,o),u=e.isAnonymous,c=!(e.email&&s.passwordHash)&&!(null==l?void 0:l.length),h={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:l,metadata:new V(s.createdAt,s.lastLoginAt),isAnonymous:!!u&&c};Object.assign(e,h)}async function q(e){let t=(0,i.m9)(e);await $(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function z(e,t){let r=await C(e,{},async()=>{let r=(0,i.xO)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:n,apiKey:s}=e.config,a=x(e,n,"/v1/token",`key=${s}`),o=await e._getAdditionalHeaders();return o["Content-Type"]="application/x-www-form-urlencoded",E.fetch()(a,{method:"POST",headers:o,body:r})});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class B{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){g(e.idToken,"internal-error"),g(void 0!==e.idToken,"internal-error"),g(void 0!==e.refreshToken,"internal-error");let t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):function(e){let t=F(e);return g(t,"internal-error"),g(void 0!==t.exp,"internal-error"),g(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return(g(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired)?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 z(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 B;return r&&(g("string"==typeof r,"internal-error",{appName:e}),s.refreshToken=r),n&&(g("string"==typeof n,"internal-error",{appName:e}),s.accessToken=n),i&&(g("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 B,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function H(e,t){g("string"==typeof e||void 0===e,"internal-error",{appName:t})}class K{constructor(e){var{uid:t,auth:r,stsTokenManager:n}=e,i=(0,a.__rest)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new U(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new V(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let t=await j(this,this.stsTokenManager.getToken(this.auth,e));return g(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return M(this,e)}reload(){return q(this)}_assign(e){this!==e&&(g(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=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new K(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){g(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await $(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){let e=await this.getIdToken();return await j(this,N(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,n,i,s,a,o,l,u;let c=null!==(r=t.displayName)&&void 0!==r?r:void 0,h=null!==(n=t.email)&&void 0!==n?n:void 0,d=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,f=null!==(s=t.photoURL)&&void 0!==s?s:void 0,p=null!==(a=t.tenantId)&&void 0!==a?a:void 0,m=null!==(o=t._redirectEventId)&&void 0!==o?o:void 0,y=null!==(l=t.createdAt)&&void 0!==l?l:void 0,v=null!==(u=t.lastLoginAt)&&void 0!==u?u:void 0,{uid:w,emailVerified:b,isAnonymous:_,providerData:E,stsTokenManager:T}=t;g(w&&T,e,"internal-error");let S=B.fromJSON(this.name,T);g("string"==typeof w,e,"internal-error"),H(c,e.name),H(h,e.name),g("boolean"==typeof b,e,"internal-error"),g("boolean"==typeof _,e,"internal-error"),H(d,e.name),H(f,e.name),H(p,e.name),H(m,e.name),H(y,e.name),H(v,e.name);let I=new K({uid:w,auth:e,email:h,emailVerified:b,displayName:c,isAnonymous:_,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:S,createdAt:y,lastLoginAt:v});return E&&Array.isArray(E)&&(I.providerData=E.map(e=>Object.assign({},e))),m&&(I._redirectEventId=m),I}static async _fromIdTokenResponse(e,t,r=!1){let n=new B;n.updateFromServerResponse(t);let i=new K({uid:t.localId,auth:e,stsTokenManager:n,isAnonymous:r});return await $(i),i}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let G=new Map;function W(e){e instanceof Function||y("Expected a class definition");let t=G.get(e);return t?t instanceof e||y("Instance stored in cache mismatched with class"):(t=new e,G.set(e,t)),t}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Q{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){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function J(e,t,r){return`firebase:${e}:${t}:${r}`}Q.type="NONE";class Y{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;let{config:n,name:i}=this.auth;this.fullUserKey=J(this.userKey,n.apiKey,i),this.fullPersistenceKey=J("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);return e?K._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;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 Y(W(Q),e,r);let n=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),i=n[0]||W(Q),s=J(r,e.config.apiKey,e.name),a=null;for(let r of t)try{let t=await r._get(s);if(t){let n=K._fromJSON(e,t);r!==i&&(a=n),i=r;break}}catch(e){}let o=n.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&o.length&&(i=o[0],a&&await i._set(s,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(s)}catch(e){}}))),new Y(i,e,r)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function X(e){let t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(er(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";{if(t.includes("edge/"))return"Edge";if(Z(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(ei(t))return"Blackberry";if(es(t))return"Webos";if(ee(t))return"Safari";if((t.includes("chrome/")||et(t))&&!t.includes("edge/"))return"Chrome";if(en(t))return"Android";let r=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if((null==r?void 0:r.length)===2)return r[1]}return"Other"}function Z(e=(0,i.z$)()){return/firefox\//i.test(e)}function ee(e=(0,i.z$)()){let t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function et(e=(0,i.z$)()){return/crios\//i.test(e)}function er(e=(0,i.z$)()){return/iemobile/i.test(e)}function en(e=(0,i.z$)()){return/android/i.test(e)}function ei(e=(0,i.z$)()){return/blackberry/i.test(e)}function es(e=(0,i.z$)()){return/webos/i.test(e)}function ea(e=(0,i.z$)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function eo(e=(0,i.z$)()){return ea(e)||en(e)||es(e)||ei(e)||/windows phone/i.test(e)||er(e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function el(e,t=[]){let r;switch(e){case"Browser":r=X((0,i.z$)());break;case"Worker":r=`${X((0,i.z$)())}-${e}`;break;default:r=e}let n=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${s.Jn}/${n}`}async function eu(e,t){return k(e,"GET","/v2/recaptchaConfig",I(e,t))}function ec(e){return void 0!==e&&void 0!==e.enterprise}class eh{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,void 0===e.recaptchaKey)throw Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some(e=>"EMAIL_PASSWORD_PROVIDER"===e.provider&&"OFF"!==e.enforcementState)}}function ed(e){return new Promise((t,r)=>{var n,i;let s=document.createElement("script");s.setAttribute("src",e),s.onload=t,s.onerror=e=>{let t=p("internal-error");t.customData=e,r(t)},s.type="text/javascript",s.charset="UTF-8",(null!==(i=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==i?i:document).appendChild(s)})}function ef(e){return`__${e}${Math.floor(1e6*Math.random())}`}class ep{constructor(e){this.type="recaptcha-enterprise",this.auth=ev(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)=>{eu(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 eh(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;ec(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{r(e)}).catch(()=>{r("NO_RECAPTCHA")})}):n(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((e,i)=>{r(this.auth).then(r=>{if(!t&&ec(window.grecaptcha))n(r,e,i);else{if("undefined"==typeof window){i(Error("RecaptchaVerifier is only supported in browser"));return}ed("https://www.google.com/recaptcha/enterprise.js?render="+r).then(()=>{n(r,e,i)}).catch(e=>{i(e)})}}).catch(e=>{i(e)})})}}async function em(e,t,r,n=!1){let i;let s=new ep(e);try{i=await s.verify(r)}catch(e){i=await s.verify(r,!0)}let a=Object.assign({},t);return n?Object.assign(a,{captchaResp:i}):Object.assign(a,{captchaResponse:i}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eg{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:null==e?void 0:e.message})}}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ey{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 ew(this),this.idTokenSubscription=new ew(this),this.beforeStateQueue=new eg(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=c,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=n.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=W(t)),this._initializationPromise=this.queue(async()=>{var r,n;if(!this._deleted&&(this.persistenceManager=await Y.create(this,e),!this._deleted)){if(null===(r=this._popupRedirectResolver)||void 0===r?void 0:r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(n=this.currentUser)||void 0===n?void 0:n.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 initializeCurrentUser(e){var t;let r=await this.assertedPersistence.getCurrentUser(),n=r,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let r=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,s=null==n?void 0:n._redirectEventId,a=await this.tryRedirectSignIn(e);(!r||r===s)&&(null==a?void 0:a.user)&&(n=a.user,i=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(n)}catch(e){n=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return(g(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId)?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}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 $(e)}catch(e){if((null==e?void 0: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){let t=e?(0,i.m9)(e):null;return t&&g(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&g(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(W(e))})}async initializeRecaptchaConfig(){let e=await eu(this,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),t=new eh(e);if(null==this.tenantId?this._agentRecaptchaConfig=t:this._tenantRecaptchaConfigs[this.tenantId]=t,t.emailPasswordEnabled){let e=new ep(this);e.verify()}}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new i.LL("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)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},t)}})}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.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&&W(e)||this._popupRedirectResolver;g(t,this,"argument-error"),this.redirectPersistenceManager=await Y.create(this,[W(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return(this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e)?this._currentUser:(null===(r=this.redirectUser)||void 0===r?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let r=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,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=this._isInitialized?Promise.resolve():this._initializationPromise;return(g(s,this,"internal-error"),s.then(()=>i(this.currentUser)),"function"==typeof t)?e.addObserver(t,r,n):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return g(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=el(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let r=await (null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());r&&(t["X-Firebase-Client"]=r);let n=await this._getAppCheckToken();return n&&(t["X-Firebase-AppCheck"]=n),t}async _getAppCheckToken(){var e;let t=await (null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){h.logLevel<=o.in.WARN&&h.warn(`Auth (${s.Jn}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null==t?void 0:t.token}}function ev(e){return(0,i.m9)(e)}class ew{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,i.ne)(e=>this.observer=e)}get next(){return g(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function eb(e){let t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function e_(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eE{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return y("not implemented")}_getIdTokenResponse(e){return y("not implemented")}_linkToIdToken(e,t){return y("not implemented")}_getReauthenticationResolver(e){return y("not implemented")}}async function eT(e,t){return k(e,"POST","/v1/accounts:update",t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eS(e,t){return A(e,"POST","/v1/accounts:signInWithPassword",I(e,t))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eI(e,t){return A(e,"POST","/v1/accounts:signInWithEmailLink",I(e,t))}async function ek(e,t){return A(e,"POST","/v1/accounts:signInWithEmailLink",I(e,t))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eC extends eE{constructor(e,t,r,n=null){super("password",r),this._email=e,this._password=t,this._tenantId=n}static _fromEmailAndPassword(e,t){return new eC(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new eC(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((null==t?void 0:t.email)&&(null==t?void 0: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){var t;switch(this.signInMethod){case"password":let r={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};if(null===(t=e._getRecaptchaConfig())||void 0===t||!t.emailPasswordEnabled)return eS(e,r).catch(async t=>{if("auth/missing-recaptcha-token"!==t.code)return Promise.reject(t);{console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");let t=await em(e,r,"signInWithPassword");return eS(e,t)}});{let t=await em(e,r,"signInWithPassword");return eS(e,t)}case"emailLink":return eI(e,{email:this._email,oobCode:this._password});default:f(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return eT(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return ek(e,{idToken:t,email:this._email,oobCode:this._password});default:f(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eA(e,t){return A(e,"POST","/v1/accounts:signInWithIdp",I(e,t))}class ex extends eE{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new ex(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):f("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e,{providerId:r,signInMethod:n}=t,i=(0,a.__rest)(t,["providerId","signInMethod"]);if(!r||!n)return null;let s=new ex(r,n);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(e){let t=this.buildRequest();return eA(e,t)}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,eA(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,eA(e,t)}buildRequest(){let e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,i.xO)(t)}return e}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eO(e,t){return k(e,"POST","/v1/accounts:sendVerificationCode",I(e,t))}async function eR(e,t){return A(e,"POST","/v1/accounts:signInWithPhoneNumber",I(e,t))}async function eN(e,t){let r=await A(e,"POST","/v1/accounts:signInWithPhoneNumber",I(e,t));if(r.temporaryProof)throw R(e,"account-exists-with-different-credential",r);return r}let eD={USER_NOT_FOUND:"user-not-found"};async function eP(e,t){let r=Object.assign(Object.assign({},t),{operation:"REAUTH"});return A(e,"POST","/v1/accounts:signInWithPhoneNumber",I(e,r),eD)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eM extends eE{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new eM({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new eM({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return eR(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return eN(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return eP(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 eM({verificationId:t,verificationCode:r,phoneNumber:n,temporaryProof:i}):null}}class eL{constructor(e){var t,r,n,s,a,o;let l=(0,i.zd)((0,i.pd)(e)),u=null!==(t=l.apiKey)&&void 0!==t?t:null,c=null!==(r=l.oobCode)&&void 0!==r?r:null,h=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */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}}(null!==(n=l.mode)&&void 0!==n?n:null);g(u&&c&&h,"argument-error"),this.apiKey=u,this.operation=h,this.code=c,this.continueUrl=null!==(s=l.continueUrl)&&void 0!==s?s:null,this.languageCode=null!==(a=l.languageCode)&&void 0!==a?a:null,this.tenantId=null!==(o=l.tenantId)&&void 0!==o?o:null}static parseLink(e){let t=function(e){let t=(0,i.zd)((0,i.pd)(e)).link,r=t?(0,i.zd)((0,i.pd)(t)).deep_link_id:null,n=(0,i.zd)((0,i.pd)(e)).deep_link_id,s=n?(0,i.zd)((0,i.pd)(n)).link:null;return s||n||r||t||e}(e);try{return new eL(t)}catch(e){return null}}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eF{constructor(){this.providerId=eF.PROVIDER_ID}static credential(e,t){return eC._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let r=eL.parseLink(t);return g(r,"argument-error"),eC._fromEmailAndCode(e,r.code,r.tenantId)}}eF.PROVIDER_ID="password",eF.EMAIL_PASSWORD_SIGN_IN_METHOD="password",eF.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ej{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}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eU extends ej{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eV extends eU{constructor(){super("facebook.com")}static credential(e){return ex._fromParams({providerId:eV.PROVIDER_ID,signInMethod:eV.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return eV.credentialFromTaggedObject(e)}static credentialFromError(e){return eV.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return eV.credential(e.oauthAccessToken)}catch(e){return null}}}eV.FACEBOOK_SIGN_IN_METHOD="facebook.com",eV.PROVIDER_ID="facebook.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e$ extends eU{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return ex._fromParams({providerId:e$.PROVIDER_ID,signInMethod:e$.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return e$.credentialFromTaggedObject(e)}static credentialFromError(e){return e$.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return e$.credential(t,r)}catch(e){return null}}}e$.GOOGLE_SIGN_IN_METHOD="google.com",e$.PROVIDER_ID="google.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eq extends eU{constructor(){super("github.com")}static credential(e){return ex._fromParams({providerId:eq.PROVIDER_ID,signInMethod:eq.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return eq.credentialFromTaggedObject(e)}static credentialFromError(e){return eq.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return eq.credential(e.oauthAccessToken)}catch(e){return null}}}eq.GITHUB_SIGN_IN_METHOD="github.com",eq.PROVIDER_ID="github.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ez extends eU{constructor(){super("twitter.com")}static credential(e,t){return ex._fromParams({providerId:ez.PROVIDER_ID,signInMethod:ez.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return ez.credentialFromTaggedObject(e)}static credentialFromError(e){return ez.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return ez.credential(t,r)}catch(e){return null}}}ez.TWITTER_SIGN_IN_METHOD="twitter.com",ez.PROVIDER_ID="twitter.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eB{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){let i=await K._fromIdTokenResponse(e,r,n),s=eH(r),a=new eB({user:i,providerId:s,_tokenResponse:r,operationType:t});return a}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);let n=eH(r);return new eB({user:e,providerId:n,_tokenResponse:r,operationType:t})}}function eH(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eK extends i.ZR{constructor(e,t,r,n){var i;super(t.code,t.message),this.operationType=r,this.user=n,Object.setPrototypeOf(this,eK.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,n){return new eK(e,t,r,n)}}function eG(e,t,r,n){let i="reauthenticate"===t?r._getReauthenticationResolver(e):r._getIdTokenResponse(e);return i.catch(r=>{if("auth/multi-factor-auth-required"===r.code)throw eK._fromErrorAndOperation(e,r,t,n);throw r})}async function eW(e,t,r=!1){let n=await j(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return eB._forOperation(e,"link",n)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eQ(e,t,r=!1){let{auth:n}=e,i="reauthenticate";try{let s=await j(e,eG(n,i,t,e),r);g(s.idToken,n,"internal-error");let a=F(s.idToken);g(a,n,"internal-error");let{sub:o}=a;return g(e.uid===o,n,"user-mismatch"),eB._forOperation(e,i,s)}catch(e){throw(null==e?void 0:e.code)==="auth/user-not-found"&&f(n,"user-mismatch"),e}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eJ(e,t,r=!1){let n="signIn",i=await eG(e,n,t),s=await eB._fromIdTokenResponse(e,n,i);return r||await e._updateCurrentUser(s.user),s}async function eY(e,t){return eJ(ev(e),t)}function eX(e,t){let r=eL.parseLink(t);return(null==r?void 0:r.operation)==="EMAIL_SIGNIN"}async function eZ(e,t,r){let n=(0,i.m9)(e),s=eF.credentialWithLink(t,r||v());return g(s._tenantId===(n.tenantId||null),n,"tenant-id-mismatch"),eY(n,s)}function e0(e,t,r,n){return(0,i.m9)(e).onAuthStateChanged(t,r,n)}new WeakMap;let e1="__sak";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e2{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(e1,"1"),this.storage.removeItem(e1),Promise.resolve(!0)}catch(e){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 e4 extends e2{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(){let e=(0,i.z$)();return ee(e)||ea(e)}()&&function(){try{return!!(window&&window!==window.top)}catch(e){return!1}}(),this.fallbackToPolling=eo(),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;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){let n=this.storage.getItem(r);if(e.newValue!==n)null!==e.newValue?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}let n=()=>{let e=this.storage.getItem(r);(t||this.localCache[r]!==e)&&this.notifyListeners(r,e)},s=this.storage.getItem(r);(0,i.w1)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(n,10):n()}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let e of Array.from(r))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}e4.type="LOCAL";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e6 extends e2{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}e6.type="SESSION";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e9{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 e9(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(!(null==i?void 0: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)),a=await Promise.all(s.map(async e=>{try{let t=await e;return{fulfilled:!0,value:t}}catch(e){return{fulfilled:!1,reason:e}}}));e.ports[0].postMessage({status:"done",eventId:t,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function e3(e="",t=10){let r="";for(let e=0;e<t;e++)r+=Math.floor(10*Math.random());return e+r}e9.receivers=[];/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e5{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((a,o)=>{let l=e3("",20);s.port1.start();let u=setTimeout(()=>{o(Error("unsupported_event"))},r);i={messageChannel:s,onMessage(e){if(e.data.eventId===l)switch(e.data.status){case"ack":clearTimeout(u),n=setTimeout(()=>{o(Error("timeout"))},3e3);break;case"done":clearTimeout(n),a(e.data.response);break;default:clearTimeout(u),clearTimeout(n),o(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)})}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function e8(){return window}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function e7(){return void 0!==e8().WorkerGlobalScope&&"function"==typeof e8().importScripts}async function te(){if(!(null==navigator?void 0:navigator.serviceWorker))return null;try{let e=await navigator.serviceWorker.ready;return e.active}catch(e){return null}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tt="firebaseLocalStorageDb",tr="firebaseLocalStorage",tn="fbase_key";class ti{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 ts(e,t){return e.transaction([tr],t?"readwrite":"readonly").objectStore(tr)}function ta(){let e=indexedDB.open(tt,1);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{let t=e.result;try{t.createObjectStore(tr,{keyPath:tn})}catch(e){r(e)}}),e.addEventListener("success",async()=>{let r=e.result;r.objectStoreNames.contains(tr)?t(r):(r.close(),await function(){let e=indexedDB.deleteDatabase(tt);return new ti(e).toPromise()}(),t(await ta()))})})}async function to(e,t,r){let n=ts(e,!0).put({[tn]:t,value:r});return new ti(n).toPromise()}async function tl(e,t){let r=ts(e,!1).get(t),n=await new ti(r).toPromise();return void 0===n?null:n.value}function tu(e,t){let r=ts(e,!0).delete(t);return new ti(r).toPromise()}class tc{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 ta()),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 e7()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=e9._getInstance(e7()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>{let r=await this._poll();return{keyProcessed:r.includes(t.key)}}),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await te(),!this.activeServiceWorker)return;this.sender=new e5(this.activeServiceWorker);let r=await this.sender._send("ping",{},800);r&&(null===(e=r[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=r[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null==navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(e){}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await ta();return await to(e,e1,"1"),await tu(e,e1),!0}catch(e){}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=>to(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>tl(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>tu(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>{let t=ts(e,!1).getAll();return new ti(t).toPromise()});if(!e||0!==this.pendingWrites)return[];let t=[],r=new Set;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()}}async function th(e,t,r){var n,i,s;let a=await r.verify();try{let o;if(g("string"==typeof a,e,"argument-error"),g("recaptcha"===r.type,e,"argument-error"),o="string"==typeof t?{phoneNumber:t}:t,"session"in o){let t=o.session;if("phoneNumber"in o){g("enroll"===t.type,e,"internal-error");let r=await (i={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:o.phoneNumber,recaptchaToken:a}},k(e,"POST","/v2/accounts/mfaEnrollment:start",I(e,i)));return r.phoneSessionInfo.sessionInfo}{g("signin"===t.type,e,"internal-error");let r=(null===(n=o.multiFactorHint)||void 0===n?void 0:n.uid)||o.multiFactorUid;g(r,e,"missing-multi-factor-info");let i=await (s={mfaPendingCredential:t.credential,mfaEnrollmentId:r,phoneSignInInfo:{recaptchaToken:a}},k(e,"POST","/v2/accounts/mfaSignIn:start",I(e,s)));return i.phoneResponseInfo.sessionInfo}}{let{sessionInfo:t}=await eO(e,{phoneNumber:o.phoneNumber,recaptchaToken:a});return t}}finally{r._reset()}}tc.type="LOCAL",ef("rcb"),new b(3e4,6e4);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class td{constructor(e){this.providerId=td.PROVIDER_ID,this.auth=ev(e)}verifyPhoneNumber(e,t){return th(this.auth,e,(0,i.m9)(t))}static credential(e,t){return eM._fromVerification(e,t)}static credentialFromResult(e){return td.credentialFromTaggedObject(e)}static credentialFromError(e){return td.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:r}=e;return t&&r?eM._fromTokenResponse(t,r):null}}td.PROVIDER_ID="phone",td.PHONE_SIGN_IN_METHOD="phone";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class tf extends eE{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return eA(e,this._buildIdpRequest())}_linkToIdToken(e,t){return eA(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return eA(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 tp(e){return eJ(e.auth,new tf(e),e.bypassAuthState)}function tm(e){let{auth:t,user:r}=e;return g(r,t,"internal-error"),eQ(r,new tf(e),e.bypassAuthState)}async function tg(e){let{auth:t,user:r}=e;return g(r,t,"internal-error"),eW(r,new tf(e),e.bypassAuthState)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ty{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:a}=e;if(s){this.reject(s);return}let o={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(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return tp;case"linkViaPopup":case"linkViaRedirect":return tg;case"reauthViaPopup":case"reauthViaRedirect":return tm;default:f(this.auth,"internal-error")}}resolve(e){this.pendingPromise||y("Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){this.pendingPromise||y("Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tv=new b(2e3,1e4);class tw extends ty{constructor(e,t,r,n,i){super(e,t,n,i),this.provider=r,this.authWindow=null,this.pollId=null,tw.currentPopupAction&&tw.currentPopupAction.cancel(),tw.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return g(e,this.auth,"internal-error"),e}async onExecution(){1===this.filter.length||y("Popup operations only handle one event");let e=e3();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(p(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(p(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,tw.currentPopupAction=null}pollUserCancellation(){let e=()=>{var t,r;if(null===(r=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===r?void 0:r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(p(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,tv.get())};e()}}tw.currentPopupAction=null;let tb=new Map;class t_ extends ty{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=tb.get(this.auth._key());if(!e){try{let t=await tE(this.resolver,this.auth),r=t?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}tb.set(this.auth._key(),e)}return this.bypassAuthState||tb.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("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 tE(e,t){let r=J("pendingRedirect",t.config.apiKey,t.name),n=W(e._redirectPersistence);if(!await n._isAvailable())return!1;let i=await n._get(r)==="true";return await n._remove(r),i}function tT(e,t){tb.set(e._key(),t)}async function tS(e,t,r=!1){let n=ev(e),i=t?W(t):(g(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver),s=new t_(n,i,r),a=await s.execute();return a&&!r&&(delete a.user._redirectEventId,await n._persistUserIfCurrent(a.user),await n._setRedirectUser(null,t)),a}class tI{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 tC(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!tC(e)){let n=(null===(r=e.error.code)||void 0===r?void 0:r.split("auth/")[1])||"internal-error";t.onError(p(this.auth,n))}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(tk(e))}saveEventToCache(e){this.cachedEventUids.add(tk(e)),this.lastProcessedEventTime=Date.now()}}function tk(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function tC({type:e,error:t}){return"unknown"===e&&(null==t?void 0:t.code)==="auth/no-auth-event"}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function tA(e,t={}){return k(e,"GET","/v1/projects",t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tx=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,tO=/^https?/;async function tR(e){if(e.config.emulator)return;let{authorizedDomains:t}=await tA(e);for(let e of t)try{if(function(e){let t=v(),{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(!tO.test(r))return!1;if(tx.test(e))return n===e;let i=e.replace(/\./g,"\\."),s=RegExp("^(.+\\."+i+"|"+i+")$","i");return s.test(n)}(e))return}catch(e){}f(e,"unauthorized-domain")}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tN=new b(3e4,6e4);function tD(){let e=e8().___jsl;if(null==e?void 0: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 tP=null,tM=new b(5e3,15e3),tL={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},tF=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function tj(e){let t=await (tP=tP||new Promise((t,r)=>{var n,i,s;function a(){tD(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{tD(),r(p(e,"network-request-failed"))},timeout:tN.get()})}if(null===(i=null===(n=e8().gapi)||void 0===n?void 0:n.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else if(null===(s=e8().gapi)||void 0===s?void 0:s.load)a();else{let t=ef("iframefcb");return e8()[t]=()=>{gapi.load?a():r(p(e,"network-request-failed"))},ed(`https://apis.google.com/js/api.js?onload=${t}`).catch(e=>r(e))}}).catch(e=>{throw tP=null,e})),r=e8().gapi;return g(r,e,"internal-error"),t.open({where:document.body,url:function(e){let t=e.config;g(t.authDomain,e,"auth-domain-config-required");let r=t.emulator?_(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,n={apiKey:t.apiKey,appName:e.name,v:s.Jn},a=tF.get(e.config.apiHost);a&&(n.eid=a);let o=e._getFrameworks();return o.length&&(n.fw=o.join(",")),`${r}?${(0,i.xO)(n).slice(1)}`}(e),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:tL,dontclear:!0},t=>new Promise(async(r,n)=>{await t.restyle({setHideOnLeave:!1});let i=p(e,"network-request-failed"),s=e8().setTimeout(()=>{n(i)},tM.get());function a(){e8().clearTimeout(s),r(t)}t.ping(a).then(a,()=>{n(i)})}))}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tU={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class tV{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}let t$=encodeURIComponent("fac");async function tq(e,t,r,n,a,o){g(e.config.authDomain,e,"auth-domain-config-required"),g(e.config.apiKey,e,"invalid-api-key");let l={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:n,v:s.Jn,eventId:a};if(t instanceof ej)for(let[r,n]of(t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||"",(0,i.xb)(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(o||{})))l[r]=n;if(t instanceof eU){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?`#${t$}=${encodeURIComponent(u)}`:"";return`${function({config:e}){return e.emulator?_(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,i.xO)(l).slice(1)}${c}`}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tz="webStorageSupport",tB=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=e6,this._completeRedirectFn=tS,this._overrideRedirectResult=tT}async _openPopup(e,t,r,n){var s;(null===(s=this.eventManagers[e._key()])||void 0===s?void 0:s.manager)||y("_initialize() not called before _openPopup()");let a=await tq(e,t,r,v(),n);return function(e,t,r,n=500,s=600){let a=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-n)/2,0).toString(),l="",u=Object.assign(Object.assign({},tU),{width:n.toString(),height:s.toString(),top:a,left:o}),c=(0,i.z$)().toLowerCase();r&&(l=et(c)?"_blank":r),Z(c)&&(t=t||"http://localhost",u.scrollbars="yes");let h=Object.entries(u).reduce((e,[t,r])=>`${e}${t}=${r},`,"");if(function(e=(0,i.z$)()){var t;return ea(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.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 tV(null);let d=window.open(t||"",l,h);g(d,e,"popup-blocked");try{d.focus()}catch(e){}return new tV(d)}(e,a,e3())}async _openRedirect(e,t,r,n){await this._originValidation(e);let i=await tq(e,t,r,v(),n);return e8().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):(r||y("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 tj(e),r=new tI(e);return t.register("authEvent",t=>{g(null==t?void 0:t.authEvent,e,"invalid-auth-event");let n=r.onEvent(t.authEvent);return{status:n?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){let r=this.iframes[e._key()];r.send(tz,{type:tz},r=>{var n;let i=null===(n=null==r?void 0:r[0])||void 0===n?void 0:n[tz];void 0!==i&&t(!!i),f(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=tR(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return eo()||ee()||ea()}};class tH{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 y("unexpected MultiFactorSessionType")}}}class tK extends tH{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new tK(e)}_finalizeEnroll(e,t,r){return k(e,"POST","/v2/accounts/mfaEnrollment:finalize",I(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return k(e,"POST","/v2/accounts/mfaSignIn:finalize",I(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class tG extends tH{constructor(e,t,r){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=r}static _fromSecret(e,t){return new tG(t,void 0,e)}static _fromEnrollmentId(e,t){return new tG(t,e)}async _finalizeEnroll(e,t,r){return g(void 0!==this.secret,e,"argument-error"),k(e,"POST","/v2/accounts/mfaEnrollment:finalize",I(e,{idToken:t,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}))}async _finalizeSignIn(e,t){g(void 0!==this.enrollmentId&&void 0!==this.otp,e,"argument-error");let r={verificationCode:this.otp};return k(e,"POST","/v2/accounts/mfaSignIn:finalize",I(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r}))}}class tW{constructor(e,t,r,n,i,s,a){this.sessionInfo=s,this.auth=a,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=r,this.codeIntervalSeconds=n,this.enrollmentCompletionDeadline=i}static _fromStartTotpMfaEnrollmentResponse(e,t){return new tW(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){var r;let n=!1;return(tQ(e)||tQ(t))&&(n=!0),n&&(tQ(e)&&(e=(null===(r=this.auth.currentUser)||void 0===r?void 0:r.email)||"unknownuser"),tQ(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function tQ(e){return void 0===e||(null==e?void 0:e.length)===0}var tJ="@firebase/auth",tY="1.1.0";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class tX{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;let t=await this.auth.currentUser.getIdToken(e);return{accessToken:t}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){g(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}let tZ=(0,i.Pz)("authIdTokenMaxAge")||300,t0=null,t1=e=>async t=>{let r=t&&await t.getIdTokenResult(),n=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(n&&n>tZ)return;let i=null==r?void 0:r.token;t0!==i&&(t0=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function t2(e=(0,s.Mq)()){let t=(0,s.qX)(e,"auth");if(t.isInitialized())return t.getImmediate();let r=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e,t){let r=(0,s.qX)(e,"auth");if(r.isInitialized()){let e=r.getImmediate(),n=r.getOptions();if((0,i.vZ)(n,null!=t?t:{}))return e;f(e,"already-initialized")}let n=r.initialize({options:t});return n}(e,{popupRedirectResolver:tB,persistence:[tc,e4,e6]}),n=(0,i.Pz)("authTokenSyncURL");if(n){let e=t1(n);(0,i.m9)(r).beforeAuthStateChanged(e,()=>e(r.currentUser)),(0,i.m9)(r).onIdTokenChanged(t=>e(t),void 0,void 0)}let a=(0,i.q4)("auth");return a&&function(e,t,r){let n=ev(e);g(n._canInitEmulator,n,"emulator-config-failed"),g(/^https?:\/\//.test(t),n,"invalid-emulator-scheme");let i=!!(null==r?void 0:r.disableWarnings),s=eb(t),{host:a,port:o}=function(e){let t=eb(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:e_(n.substr(e.length+1))}}{let[e,t]=n.split(":");return{host:e,port:e_(t)}}}(t),l=null===o?"":`:${o}`;n.config.emulator={url:`${s}//${a}${l}/`},n.settings.appVerificationDisabledForTesting=!0,n.emulatorConfig=Object.freeze({host:a,port:o,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),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())}()}(r,`http://${a}`),r}n="Browser",(0,s.Xd)(new l.wA("auth",(e,{options:t})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:a,authDomain:o}=r.options;g(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});let l={apiKey:a,authDomain:o,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:el(n)},u=new ey(r,i,s,l);return function(e,t){let r=(null==t?void 0:t.persistence)||[],n=(Array.isArray(r)?r:[r]).map(W);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(n,null==t?void 0:t.popupRedirectResolver)}(u,t),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{let n=e.getProvider("auth-internal");n.initialize()})),(0,s.Xd)(new l.wA("auth-internal",e=>{let t=ev(e.getProvider("auth").getImmediate());return new tX(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),(0,s.KN)(tJ,tY,/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(n)),(0,s.KN)(tJ,tY,"esm2017")},36100:function(e,t,r){"use strict";r.d(t,{ET:function(){return lY},hJ:function(){return oZ},B$:function(){return o0},oe:function(){return lJ},JU:function(){return o1},QT:function(){return lH},PL:function(){return lG},ad:function(){return o9},b9:function(){return lP},cf:function(){return lX},Xo:function(){return lN},IO:function(){return lC},Bt:function(){return l1},pl:function(){return lW},r7:function(){return lQ},ar:function(){return lx}});var n,i,s,a,o,l,u,c=r(25816),h=r(8463),d=r(53333),f=r(74444),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m={},g=g||{},y=p||self;function v(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function w(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function b(e,t,r){return e.call.apply(e.bind,arguments)}function _(e,t,r){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,n),e.apply(t,r)}}return function(){return e.apply(t,arguments)}}function E(e,t,r){return(E=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?b:_).apply(null,arguments)}function T(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 S(e,t){function r(){}r.prototype=t.prototype,e.$=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.ac=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)}}function I(){this.s=this.s,this.o=this.o}I.prototype.s=!1,I.prototype.sa=function(){this.s||(this.s=!0,this.N())},I.prototype.N=function(){if(this.o)for(;this.o.length;)this.o.shift()()};let k=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(let r=0;r<e.length;r++)if(r in e&&e[r]===t)return r;return -1};function C(e){let t=e.length;if(0<t){let r=Array(t);for(let n=0;n<t;n++)r[n]=e[n];return r}return[]}function A(e,t){for(let t=1;t<arguments.length;t++){let r=arguments[t];if(v(r)){let t=e.length||0,n=r.length||0;e.length=t+n;for(let i=0;i<n;i++)e[t+i]=r[i]}else e.push(r)}}function x(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}x.prototype.h=function(){this.defaultPrevented=!0};var O=function(){if(!y.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{y.addEventListener("test",()=>{},t),y.removeEventListener("test",()=>{},t)}catch(e){}return e}();function R(e){return/^[\s\xa0]*$/.test(e)}function N(){var e=y.navigator;return e&&(e=e.userAgent)?e:""}function D(e){return -1!=N().indexOf(e)}function P(e){return P[" "](e),e}P[" "]=function(){};var M=D("Opera"),L=D("Trident")||D("MSIE"),F=D("Edge"),j=F||L,U=D("Gecko")&&!(-1!=N().toLowerCase().indexOf("webkit")&&!D("Edge"))&&!(D("Trident")||D("MSIE"))&&!D("Edge"),V=-1!=N().toLowerCase().indexOf("webkit")&&!D("Edge");function $(){var e=y.document;return e?e.documentMode:void 0}e:{var q,z="",B=(q=N(),U?/rv:([^\);]+)(\)|;)/.exec(q):F?/Edge\/([\d\.]+)/.exec(q):L?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(q):V?/WebKit\/(\S+)/.exec(q):M?/(?:Version)[ \/]?(\S+)/.exec(q):void 0);if(B&&(z=B?B[1]:""),L){var H=$();if(null!=H&&H>parseFloat(z)){i=String(H);break e}}i=z}var K=y.document&&L&&($()||parseInt(i,10))||void 0;function G(e,t){if(x.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){var r=this.type=e.type,n=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(U){e:{try{P(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"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="string"==typeof e.pointerType?e.pointerType:W[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&G.$.h.call(this)}}S(G,x);var W={2:"touch",3:"pen",4:"mouse"};G.prototype.h=function(){G.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var Q="closure_listenable_"+(1e6*Math.random()|0),J=0;function Y(e,t,r,n,i){this.listener=e,this.proxy=null,this.src=t,this.type=r,this.capture=!!n,this.la=i,this.key=++J,this.fa=this.ia=!1}function X(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function Z(e,t,r){for(let n in e)t.call(r,e[n],n,e)}function ee(e){let t={};for(let r in e)t[r]=e[r];return t}let et="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function er(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<et.length;t++)r=et[t],Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}}function en(e){this.src=e,this.g={},this.h=0}function ei(e,t){var r=t.type;if(r in e.g){var n,i=e.g[r],s=k(i,t);(n=0<=s)&&Array.prototype.splice.call(i,s,1),n&&(X(t),0==e.g[r].length&&(delete e.g[r],e.h--))}}function es(e,t,r,n){for(var i=0;i<e.length;++i){var s=e[i];if(!s.fa&&s.listener==t&&!!r==s.capture&&s.la==n)return i}return -1}en.prototype.add=function(e,t,r,n,i){var s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);var a=es(e,t,n,i);return -1<a?(t=e[a],r||(t.ia=!1)):((t=new Y(t,this.src,s,!!n,i)).ia=r,e.push(t)),t};var ea="closure_lm_"+(1e6*Math.random()|0),eo={};function el(e,t,r,n,i,s){if(!t)throw Error("Invalid event type");var a=w(i)?!!i.capture:!!i,o=ed(e);if(o||(e[ea]=o=new en(e)),(r=o.add(t,r,n,a,s)).proxy)return r;if(n=function e(t){return eh.call(e.src,e.listener,t)},r.proxy=n,n.src=e,n.listener=r,e.addEventListener)O||(i=a),void 0===i&&(i=!1),e.addEventListener(t.toString(),n,i);else if(e.attachEvent)e.attachEvent(ec(t.toString()),n);else if(e.addListener&&e.removeListener)e.addListener(n);else throw Error("addEventListener and attachEvent are unavailable.");return r}function eu(e){if("number"!=typeof e&&e&&!e.fa){var t=e.src;if(t&&t[Q])ei(t.i,e);else{var r=e.type,n=e.proxy;t.removeEventListener?t.removeEventListener(r,n,e.capture):t.detachEvent?t.detachEvent(ec(r),n):t.addListener&&t.removeListener&&t.removeListener(n),(r=ed(t))?(ei(r,e),0==r.h&&(r.src=null,t[ea]=null)):X(e)}}}function ec(e){return e in eo?eo[e]:eo[e]="on"+e}function eh(e,t){if(e.fa)e=!0;else{t=new G(t,this);var r=e.listener,n=e.la||e.src;e.ia&&eu(e),e=r.call(n,t)}return e}function ed(e){return(e=e[ea])instanceof en?e:null}var ef="__closure_events_fn_"+(1e9*Math.random()>>>0);function ep(e){return"function"==typeof e?e:(e[ef]||(e[ef]=function(t){return e.handleEvent(t)}),e[ef])}function em(){I.call(this),this.i=new en(this),this.S=this,this.J=null}function eg(e,t){var r,n=e.J;if(n)for(r=[];n;n=n.J)r.push(n);if(e=e.S,n=t.type||t,"string"==typeof t)t=new x(t,e);else if(t instanceof x)t.target=t.target||e;else{var i=t;er(t=new x(n,e),i)}if(i=!0,r)for(var s=r.length-1;0<=s;s--){var a=t.g=r[s];i=ey(a,n,!0,t)&&i}if(i=ey(a=t.g=e,n,!0,t)&&i,i=ey(a,n,!1,t)&&i,r)for(s=0;s<r.length;s++)i=ey(a=t.g=r[s],n,!1,t)&&i}function ey(e,t,r,n){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,s=0;s<t.length;++s){var a=t[s];if(a&&!a.fa&&a.capture==r){var o=a.listener,l=a.la||a.src;a.ia&&ei(e.i,a),i=!1!==o.call(l,n)&&i}}return i&&!n.defaultPrevented}S(em,I),em.prototype[Q]=!0,em.prototype.removeEventListener=function(e,t,r,n){!function e(t,r,n,i,s){if(Array.isArray(r))for(var a=0;a<r.length;a++)e(t,r[a],n,i,s);else(i=w(i)?!!i.capture:!!i,n=ep(n),t&&t[Q])?(t=t.i,(r=String(r).toString())in t.g&&-1<(n=es(a=t.g[r],n,i,s))&&(X(a[n]),Array.prototype.splice.call(a,n,1),0==a.length&&(delete t.g[r],t.h--))):t&&(t=ed(t))&&(r=t.g[r.toString()],t=-1,r&&(t=es(r,n,i,s)),(n=-1<t?r[t]:null)&&eu(n))}(this,e,t,r,n)},em.prototype.N=function(){if(em.$.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var r=t.g[e],n=0;n<r.length;n++)X(r[n]);delete t.g[e],t.h--}}this.J=null},em.prototype.O=function(e,t,r,n){return this.i.add(String(e),t,!1,r,n)},em.prototype.P=function(e,t,r,n){return this.i.add(String(e),t,!0,r,n)};var ev=y.JSON.stringify,ew=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new eb,e=>e.reset());class eb{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_,eE=!1,eT=new class{constructor(){this.h=this.g=null}add(e,t){let r=ew.get();r.set(e,t),this.h?this.h.next=r:this.g=r,this.h=r}},eS=()=>{let e=y.Promise.resolve(void 0);e_=()=>{e.then(eI)}};var eI=()=>{let e;for(var t;e=null,eT.g&&(e=eT.g,eT.g=eT.g.next,eT.g||(eT.h=null),e.next=null),t=e;){try{t.h.call(t.g)}catch(e){!function(e){y.setTimeout(()=>{throw e},0)}(e)}ew.j(t),100>ew.h&&(ew.h++,t.next=ew.g,ew.g=t)}eE=!1};function ek(e,t){em.call(this),this.h=e||1,this.g=t||y,this.j=E(this.qb,this),this.l=Date.now()}function eC(e){e.ga=!1,e.T&&(e.g.clearTimeout(e.T),e.T=null)}function eA(e,t,r){if("function"==typeof e)r&&(e=E(e,r));else if(e&&"function"==typeof e.handleEvent)e=E(e.handleEvent,e);else throw Error("Invalid listener argument");return 2147483647<Number(t)?-1:y.setTimeout(e,t||0)}S(ek,em),(u=ek.prototype).ga=!1,u.T=null,u.qb=function(){if(this.ga){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.T=this.g.setTimeout(this.j,this.h-e):(this.T&&(this.g.clearTimeout(this.T),this.T=null),eg(this,"tick"),this.ga&&(eC(this),this.start()))}},u.start=function(){this.ga=!0,this.T||(this.T=this.g.setTimeout(this.j,this.h),this.l=Date.now())},u.N=function(){ek.$.N.call(this),eC(this),delete this.g};class ex extends I{constructor(e,t){super(),this.m=e,this.j=t,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:function e(t){t.g=eA(()=>{t.g=null,t.i&&(t.i=!1,e(t))},t.j);let r=t.h;t.h=null,t.m.apply(null,r)}(this)}N(){super.N(),this.g&&(y.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function eO(e){I.call(this),this.h=e,this.g={}}S(eO,I);var eR=[];function eN(e,t,r,n){Array.isArray(r)||(r&&(eR[0]=r.toString()),r=eR);for(var i=0;i<r.length;i++){var 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(var a=0;a<r.length;a++)e(t,r[a],n,i,s);return null}return n=ep(n),t&&t[Q]?t.P(r,n,w(i)?!!i.capture:!!i,s):el(t,r,n,!0,i,s)}(t,r,n,i,s);if(Array.isArray(r)){for(var a=0;a<r.length;a++)e(t,r[a],n,i,s);return null}return n=ep(n),t&&t[Q]?t.O(r,n,w(i)?!!i.capture:!!i,s):el(t,r,n,!1,i,s)}(t,r[i],n||e.handleEvent,!1,e.h||e);if(!s)break;e.g[s.key]=s}}function eD(e){Z(e.g,function(e,t){this.g.hasOwnProperty(t)&&eu(e)},e),e.g={}}function eP(){this.g=!0}function eM(e,t,r,n){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var r=JSON.parse(t);if(r){for(e=0;e<r.length;e++)if(Array.isArray(r[e])){var n=r[e];if(!(2>n.length)){var i=n[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var a=1;a<i.length;a++)i[a]=""}}}}return ev(r)}catch(e){return t}}(e,r)+(n?" "+n:"")})}eO.prototype.N=function(){eO.$.N.call(this),eD(this)},eO.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},eP.prototype.Ea=function(){this.g=!1},eP.prototype.info=function(){};var eL={},eF=null;function ej(){return eF=eF||new em}function eU(e){x.call(this,eL.Ta,e)}function eV(e){let t=ej();eg(t,new eU(t))}function e$(e,t){x.call(this,eL.STAT_EVENT,e),this.stat=t}function eq(e){let t=ej();eg(t,new e$(t,e))}function ez(e,t){x.call(this,eL.Ua,e),this.size=t}function eB(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return y.setTimeout(function(){e()},t)}eL.Ta="serverreachability",S(eU,x),eL.STAT_EVENT="statevent",S(e$,x),eL.Ua="timingevent",S(ez,x);var eH={NO_ERROR:0,rb:1,Eb:2,Db:3,yb:4,Cb:5,Fb:6,Qa:7,TIMEOUT:8,Ib:9},eK={wb:"complete",Sb:"success",Ra:"error",Qa:"abort",Kb:"ready",Lb:"readystatechange",TIMEOUT:"timeout",Gb:"incrementaldata",Jb:"progress",zb:"downloadprogress",$b:"uploadprogress"};function eG(){}function eW(e){return e.h||(e.h=e.i())}function eQ(){}eG.prototype.h=null;var eJ={OPEN:"a",vb:"b",Ra:"c",Hb:"d"};function eY(){x.call(this,"d")}function eX(){x.call(this,"c")}function eZ(){}function e0(e,t,r,n){this.l=e,this.j=t,this.m=r,this.W=n||1,this.U=new eO(this),this.P=e2,e=j?125:void 0,this.V=new ek(e),this.I=null,this.i=!1,this.s=this.A=this.v=this.L=this.G=this.Y=this.B=null,this.F=[],this.g=null,this.C=0,this.o=this.u=null,this.ca=-1,this.J=!1,this.O=0,this.M=null,this.ba=this.K=this.aa=this.S=!1,this.h=new e1}function e1(){this.i=null,this.g="",this.h=!1}S(eY,x),S(eX,x),S(eZ,eG),eZ.prototype.g=function(){return new XMLHttpRequest},eZ.prototype.i=function(){return{}},a=new eZ;var e2=45e3,e4={},e6={};function e9(e,t,r){e.L=1,e.v=tf(tl(t)),e.s=r,e.S=!0,e3(e,null)}function e3(e,t){e.G=Date.now(),e7(e),e.A=tl(e.v);var r=e.A,n=e.W;Array.isArray(n)||(n=[String(n)]),tk(r.i,"t",n),e.C=0,r=e.l.J,e.h=new e1,e.g=rm(e.l,r?t:null,!e.s),0<e.O&&(e.M=new ex(E(e.Pa,e,e.g),e.O)),eN(e.U,e.g,"readystatechange",e.nb),t=e.I?ee(e.I):{},e.s?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ha(e.A,e.u,e.s,t)):(e.u="GET",e.g.ha(e.A,e.u,null,t)),eV(),function(e,t,r,n,i,s){e.info(function(){if(e.g){if(s)for(var a="",o=s.split("&"),l=0;l<o.length;l++){var u=o[l].split("=");if(1<u.length){var c=u[0];u=u[1];var h=c.split("_");a=2<=h.length&&"type"==h[1]?a+(c+"=")+u+"&":a+(c+"=redacted&")}}else a=null}else a=s;return"XMLHTTP REQ ("+n+") [attempt "+i+"]: "+t+"\n"+r+"\n"+a})}(e.j,e.u,e.A,e.m,e.W,e.s)}function e5(e){return!!e.g&&"GET"==e.u&&2!=e.L&&e.l.Ha}function e8(e,t,r){let n=!0,i;for(;!e.J&&e.C<r.length;)if((i=function(e,t){var r=e.C,n=t.indexOf("\n",r);return -1==n?e6:isNaN(r=Number(t.substring(r,n)))?e4:(n+=1)+r>t.length?e6:(t=t.slice(n,n+r),e.C=n+r,t)}(e,r))==e6){4==t&&(e.o=4,eq(14),n=!1),eM(e.j,e.m,null,"[Incomplete Response]");break}else if(i==e4){e.o=4,eq(15),eM(e.j,e.m,r,"[Invalid Chunk]"),n=!1;break}else eM(e.j,e.m,i,null),ti(e,i);e5(e)&&i!=e6&&i!=e4&&(e.h.g="",e.C=0),4!=t||0!=r.length||e.h.h||(e.o=1,eq(16),n=!1),e.i=e.i&&n,n?0<r.length&&!e.ba&&(e.ba=!0,(t=e.l).g==e&&t.ca&&!t.M&&(t.l.info("Great, no buffering proxy detected. Bytes received: "+r.length),ro(t),t.M=!0,eq(11))):(eM(e.j,e.m,r,"[Invalid Chunked Response]"),tn(e),tr(e))}function e7(e){e.Y=Date.now()+e.P,te(e,e.P)}function te(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=eB(E(e.lb,e),t)}function tt(e){e.B&&(y.clearTimeout(e.B),e.B=null)}function tr(e){0==e.l.H||e.J||rc(e.l,e)}function tn(e){tt(e);var t=e.M;t&&"function"==typeof t.sa&&t.sa(),e.M=null,eC(e.V),eD(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.sa())}function ti(e,t){try{var r=e.l;if(0!=r.H&&(r.g==e||tD(r.i,e))){if(!e.K&&tD(r.i,e)&&3==r.H){try{var n=r.Ja.g.parse(t)}catch(e){n=null}if(Array.isArray(n)&&3==n.length){var i=n;if(0==i[0]){e:if(!r.u){if(r.g){if(r.g.G+3e3<e.G)ru(r),t7(r);else break e}ra(r),eq(18)}}else r.Fa=i[1],0<r.Fa-r.V&&37500>i[2]&&r.G&&0==r.A&&!r.v&&(r.v=eB(E(r.ib,r),6e3));if(1>=tN(r.i)&&r.oa){try{r.oa()}catch(e){}r.oa=void 0}}else rd(r,11)}else if((e.K||r.g==e)&&ru(r),!R(t))for(i=r.Ja.g.parse(t),t=0;t<i.length;t++){let o=i[t];if(r.V=o[0],o=o[1],2==r.H){if("c"==o[0]){r.K=o[1],r.pa=o[2];let t=o[3];null!=t&&(r.ra=t,r.l.info("VER="+r.ra));let i=o[4];null!=i&&(r.Ga=i,r.l.info("SVER="+r.Ga));let l=o[5];null!=l&&"number"==typeof l&&0<l&&(n=1.5*l,r.L=n,r.l.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.i;s.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(s.j=s.l,s.g=new Set,s.h&&(tP(s,s.h),s.h=null))}if(n.F){let e=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(n.Da=e,td(n.I,n.F,e))}}if(r.H=3,r.h&&r.h.Ba(),r.ca&&(r.S=Date.now()-e.G,r.l.info("Handshake RTT: "+r.S+"ms")),(n=r).wa=rp(n,n.J?n.pa:null,n.Y),e.K){tM(n.i,e);var a=n.L;a&&e.setTimeout(a),e.B&&(tt(e),e7(e)),n.g=e}else rs(n);0<r.j.length&&rt(r)}else"stop"!=o[0]&&"close"!=o[0]||rd(r,7)}else 3==r.H&&("stop"==o[0]||"close"==o[0]?"stop"==o[0]?rd(r,7):t8(r):"noop"!=o[0]&&r.h&&r.h.Aa(o),r.A=0)}}eV(4)}catch(e){}}function ts(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(v(e)||"string"==typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var r=function(e){if(e.ta&&"function"==typeof e.ta)return e.ta();if(!e.Z||"function"!=typeof e.Z){if("undefined"!=typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!=typeof Set&&e instanceof Set)){if(v(e)||"string"==typeof e){var t=[];e=e.length;for(var r=0;r<e;r++)t.push(r);return t}for(let n in t=[],r=0,e)t[r++]=n;return t}}}(e),n=function(e){if(e.Z&&"function"==typeof e.Z)return e.Z();if("undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set)return Array.from(e.values());if("string"==typeof e)return e.split("");if(v(e)){for(var t=[],r=e.length,n=0;n<r;n++)t.push(e[n]);return t}for(n in t=[],r=0,e)t[r++]=e[n];return t}(e),i=n.length,s=0;s<i;s++)t.call(void 0,n[s],r&&r[s],e)}(u=e0.prototype).setTimeout=function(e){this.P=e},u.nb=function(e){e=e.target;let t=this.M;t&&3==t2(e)?t.l():this.Pa(e)},u.Pa=function(e){try{if(e==this.g)e:{let c=t2(this.g);var t=this.g.Ia();let h=this.g.da();if(!(3>c)&&(3!=c||j||this.g&&(this.h.h||this.g.ja()||t4(this.g)))){this.J||4!=c||7==t||(8==t||0>=h?eV(3):eV(2)),tt(this);var r=this.g.da();this.ca=r;t:if(e5(this)){var n=t4(this.g);e="";var i=n.length,s=4==t2(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){tn(this),tr(this);var a="";break t}this.h.i=new y.TextDecoder}for(t=0;t<i;t++)this.h.h=!0,e+=this.h.i.decode(n[t],{stream:s&&t==i-1});n.splice(0,i),this.h.g+=e,this.C=0,a=this.h.g}else a=this.g.ja();if(this.i=200==r,function(e,t,r,n,i,s,a){e.info(function(){return"XMLHTTP RESP ("+n+") [ attempt "+i+"]: "+t+"\n"+r+"\n"+s+" "+a})}(this.j,this.u,this.A,this.m,this.W,c,r),this.i){if(this.aa&&!this.K){t:{if(this.g){var o,l=this.g;if((o=l.g?l.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!R(o)){var u=o;break t}}u=null}if(r=u)eM(this.j,this.m,r,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,ti(this,r);else{this.i=!1,this.o=3,eq(12),tn(this),tr(this);break e}}this.S?(e8(this,c,a),j&&this.i&&3==c&&(eN(this.U,this.V,"tick",this.mb),this.V.start())):(eM(this.j,this.m,a,null),ti(this,a)),4==c&&tn(this),this.i&&!this.J&&(4==c?rc(this.l,this):(this.i=!1,e7(this)))}else(function(e){let t={};e=(e.g&&2<=t2(e)&&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(;0<t&&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==r&&0<a.indexOf("Unknown SID")?(this.o=3,eq(12)):(this.o=0,eq(13)),tn(this),tr(this)}}}catch(e){}finally{}},u.mb=function(){if(this.g){var e=t2(this.g),t=this.g.ja();this.C<t.length&&(tt(this),e8(this,e,t),this.i&&4!=e&&e7(this))}},u.cancel=function(){this.J=!0,tn(this)},u.lb=function(){this.B=null;let e=Date.now();0<=e-this.Y?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.j,this.A),2!=this.L&&(eV(),eq(17)),tn(this),this.o=2,tr(this)):te(this,this.Y-e)};var ta=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function to(e){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,e instanceof to){this.h=e.h,tu(this,e.j),this.s=e.s,this.g=e.g,tc(this,e.m),this.l=e.l;var t=e.i,r=new tE;r.i=t.i,t.g&&(r.g=new Map(t.g),r.h=t.h),th(this,r),this.o=e.o}else e&&(t=String(e).match(ta))?(this.h=!1,tu(this,t[1]||"",!0),this.s=tp(t[2]||""),this.g=tp(t[3]||"",!0),tc(this,t[4]),this.l=tp(t[5]||"",!0),th(this,t[6]||"",!0),this.o=tp(t[7]||"")):(this.h=!1,this.i=new tE(null,this.h))}function tl(e){return new to(e)}function tu(e,t,r){e.j=r?tp(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function tc(e,t){if(t){if(isNaN(t=Number(t))||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function th(e,t,r){var n,i;t instanceof tE?(e.i=t,n=e.i,(i=e.h)&&!n.j&&(tT(n),n.i=null,n.g.forEach(function(e,t){var r=t.toLowerCase();t!=r&&(tS(this,t),tk(this,r,e))},n)),n.j=i):(r||(t=tm(t,tb)),e.i=new tE(t,e.h))}function td(e,t,r){e.i.set(t,r)}function tf(e){return td(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function tp(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function tm(e,t,r){return"string"==typeof e?(e=encodeURI(e).replace(t,tg),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function tg(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}to.prototype.toString=function(){var e=[],t=this.j;t&&e.push(tm(t,ty,!0),":");var r=this.g;return(r||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(tm(t,ty,!0),"@"),e.push(encodeURIComponent(String(r)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(r=this.m)&&e.push(":",String(r))),(r=this.l)&&(this.g&&"/"!=r.charAt(0)&&e.push("/"),e.push(tm(r,"/"==r.charAt(0)?tw:tv,!0))),(r=this.i.toString())&&e.push("?",r),(r=this.o)&&e.push("#",tm(r,t_)),e.join("")};var ty=/[#\/\?@]/g,tv=/[#\?:]/g,tw=/[#\?]/g,tb=/[#\?@]/g,t_=/#/g;function tE(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function tT(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var r=0;r<e.length;r++){var n=e[r].indexOf("="),i=null;if(0<=n){var s=e[r].substring(0,n);i=e[r].substring(n+1)}else s=e[r];t(s,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,function(t,r){e.add(decodeURIComponent(t.replace(/\+/g," ")),r)}))}function tS(e,t){tT(e),t=tC(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 tT(e),t=tC(e,t),e.g.has(t)}function tk(e,t,r){tS(e,t),0<r.length&&(e.i=null,e.g.set(tC(e,t),C(r)),e.h+=r.length)}function tC(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}(u=tE.prototype).add=function(e,t){tT(this),this.i=null,e=tC(this,e);var r=this.g.get(e);return r||this.g.set(e,r=[]),r.push(t),this.h+=1,this},u.forEach=function(e,t){tT(this),this.g.forEach(function(r,n){r.forEach(function(r){e.call(t,r,n,this)},this)},this)},u.ta=function(){tT(this);let e=Array.from(this.g.values()),t=Array.from(this.g.keys()),r=[];for(let n=0;n<t.length;n++){let i=e[n];for(let e=0;e<i.length;e++)r.push(t[n])}return r},u.Z=function(e){tT(this);let t=[];if("string"==typeof e)tI(this,e)&&(t=t.concat(this.g.get(tC(this,e))));else{e=Array.from(this.g.values());for(let r=0;r<e.length;r++)t=t.concat(e[r])}return t},u.set=function(e,t){return tT(this),this.i=null,tI(this,e=tC(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},u.get=function(e,t){return e&&0<(e=this.Z(e)).length?String(e[0]):t},u.toString=function(){if(this.i)return this.i;if(!this.g)return"";let e=[],t=Array.from(this.g.keys());for(var r=0;r<t.length;r++){var n=t[r];let s=encodeURIComponent(String(n)),a=this.Z(n);for(n=0;n<a.length;n++){var i=s;""!==a[n]&&(i+="="+encodeURIComponent(String(a[n]))),e.push(i)}}return this.i=e.join("&")};var tA=class{constructor(e,t){this.g=e,this.map=t}};function tx(e){this.l=e||tO,e=y.PerformanceNavigationTiming?0<(e=y.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):!!(y.g&&y.g.Ka&&y.g.Ka()&&y.g.Ka().ec),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var tO=10;function tR(e){return!!e.h||!!e.g&&e.g.size>=e.j}function tN(e){return e.h?1:e.g?e.g.size:0}function tD(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function tP(e,t){e.g?e.g.add(t):e.h=t}function tM(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function tL(e){if(null!=e.h)return e.i.concat(e.h.F);if(null!=e.g&&0!==e.g.size){let t=e.i;for(let r of e.g.values())t=t.concat(r.F);return t}return C(e.i)}tx.prototype.cancel=function(){if(this.i=tL(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 tF=class{stringify(e){return y.JSON.stringify(e,void 0)}parse(e){return y.JSON.parse(e,void 0)}};function tj(){this.g=new tF}function tU(e,t,r,n,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(n)}catch(e){}}function tV(e){this.l=e.fc||null,this.j=e.ob||!1}function t$(e,t){em.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=tq,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}S(tV,eG),tV.prototype.g=function(){return new t$(this.l,this.j)},tV.prototype.i=(n={},function(){return n}),S(t$,em);var tq=0;function tz(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}function tB(e){e.readyState=4,e.l=null,e.j=null,e.A=null,tH(e)}function tH(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(u=t$.prototype).open=function(e,t){if(this.readyState!=tq)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,tH(this)},u.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;let t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||y).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))},u.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,tB(this)),this.readyState=tq},u.$a=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,tH(this)),this.g&&(this.readyState=3,tH(this),this.g))){if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(void 0!==y.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;tz(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))}},u.Xa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?tB(this):tH(this),3==this.readyState&&tz(this)}},u.Za=function(e){this.g&&(this.response=this.responseText=e,tB(this))},u.Ya=function(e){this.g&&(this.response=e,tB(this))},u.ka=function(){this.g&&tB(this)},u.setRequestHeader=function(e,t){this.v.append(e,t)},u.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},u.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(t$.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var tK=y.JSON.parse;function tG(e){em.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=tW,this.L=this.M=!1}S(tG,em);var tW="",tQ=/^https?$/i,tJ=["POST","PUT"];function tY(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,tX(e),t0(e)}function tX(e){e.F||(e.F=!0,eg(e,"complete"),eg(e,"error"))}function tZ(e){if(e.h&&void 0!==g&&(!e.C[1]||4!=t2(e)||2!=e.da())){if(e.v&&4==t2(e))eA(e.La,0,e);else if(eg(e,"readystatechange"),4==t2(e)){e.h=!1;try{let a=e.da();switch(a){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===a){var i=String(e.I).match(ta)[1]||null;!i&&y.self&&y.self.location&&(i=y.self.location.protocol.slice(0,-1)),r=!tQ.test(i?i.toLowerCase():"")}t=r}if(t)eg(e,"complete"),eg(e,"success");else{e.m=6;try{var s=2<t2(e)?e.g.statusText:""}catch(e){s=""}e.j=s+" ["+e.da()+"]",tX(e)}}finally{t0(e)}}}}function t0(e,t){if(e.g){t1(e);let r=e.g,n=e.C[0]?()=>{}:null;e.g=null,e.C=null,t||eg(e,"ready");try{r.onreadystatechange=n}catch(e){}}}function t1(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(y.clearTimeout(e.A),e.A=null)}function t2(e){return e.g?e.g.readyState:0}function t4(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.K){case tW:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function t6(e){let t="";return Z(e,function(e,r){t+=r+":"+e+"\r\n"}),t}function t9(e,t,r){e:{for(n in r){var n=!1;break e}n=!0}n||(r=t6(r),"string"==typeof e?null!=r&&encodeURIComponent(String(r)):td(e,t,r))}function t3(e,t,r){return r&&r.internalChannelParams&&r.internalChannelParams[e]||t}function t5(e){this.Ga=0,this.j=[],this.l=new eP,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=t3("failFast",!1,e),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=t3("baseRetryDelayMs",5e3,e),this.hb=t3("retryDelaySeedMs",1e4,e),this.eb=t3("forwardChannelMaxRetries",2,e),this.xa=t3("forwardChannelRequestTimeoutMs",2e4,e),this.va=e&&e.xmlHttpFactory||void 0,this.Ha=e&&e.dc||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.i=new tx(e&&e.concurrentRequestLimit),this.Ja=new tj,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=e&&e.bc||!1,e&&e.Ea&&this.l.Ea(),e&&e.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&e&&e.detectBufferingProxy||!1,this.qa=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.qa=e.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}function t8(e){if(re(e),3==e.H){var t=e.W++,r=tl(e.I);if(td(r,"SID",e.K),td(r,"RID",t),td(r,"TYPE","terminate"),rn(e,r),(t=new e0(e,e.l,t)).L=2,t.v=tf(tl(r)),r=!1,y.navigator&&y.navigator.sendBeacon)try{r=y.navigator.sendBeacon(t.v.toString(),"")}catch(e){}!r&&y.Image&&((new Image).src=t.v,r=!0),r||(t.g=rm(t.l,null),t.g.ha(t.v)),t.G=Date.now(),e7(t)}rf(e)}function t7(e){e.g&&(ro(e),e.g.cancel(),e.g=null)}function re(e){t7(e),e.u&&(y.clearTimeout(e.u),e.u=null),ru(e),e.i.cancel(),e.m&&("number"==typeof e.m&&y.clearTimeout(e.m),e.m=null)}function rt(e){if(!tR(e.i)&&!e.m){e.m=!0;var t=e.Na;e_||eS(),eE||(e_(),eE=!0),eT.add(t,e),e.C=0}}function rr(e,t){var r;r=t?t.m:e.W++;let n=tl(e.I);td(n,"SID",e.K),td(n,"RID",r),td(n,"AID",e.V),rn(e,n),e.o&&e.s&&t9(n,e.o,e.s),r=new e0(e,e.l,r,e.C+1),null===e.o&&(r.I=e.s),t&&(e.j=t.F.concat(e.j)),t=ri(e,r,1e3),r.setTimeout(Math.round(.5*e.xa)+Math.round(.5*e.xa*Math.random())),tP(e.i,r),e9(r,n,t)}function rn(e,t){e.na&&Z(e.na,function(e,r){td(t,r,e)}),e.h&&ts({},function(e,r){td(t,r,e)})}function ri(e,t,r){r=Math.min(e.j.length,r);var n=e.h?E(e.h.Va,e.h,e):null;e:{var i=e.j;let t=-1;for(;;){let e=["count="+r];-1==t?0<r?(t=i[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let s=!0;for(let a=0;a<r;a++){let r=i[a].g,o=i[a].map;if(0>(r-=t))t=Math.max(0,i[a].g-100),s=!1;else try{!function(e,t,r){let n=r||"";try{ts(e,function(e,r){let i=e;w(e)&&(i=ev(e)),t.push(n+r+"="+encodeURIComponent(i))})}catch(e){throw t.push(n+"type="+encodeURIComponent("_badmap")),e}}(o,e,"req"+r+"_")}catch(e){n&&n(o)}}if(s){n=e.join("&");break e}}}return e=e.j.splice(0,r),t.F=e,n}function rs(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;e_||eS(),eE||(e_(),eE=!0),eT.add(t,e),e.A=0}}function ra(e){return!e.g&&!e.u&&!(3<=e.A)&&(e.ba++,e.u=eB(E(e.Ma,e),rh(e,e.A)),e.A++,!0)}function ro(e){null!=e.B&&(y.clearTimeout(e.B),e.B=null)}function rl(e){e.g=new e0(e,e.l,"rpc",e.ba),null===e.o&&(e.g.I=e.s),e.g.O=0;var t=tl(e.wa);td(t,"RID","rpc"),td(t,"SID",e.K),td(t,"AID",e.V),td(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&td(t,"TO",e.qa),td(t,"TYPE","xmlhttp"),rn(e,t),e.o&&e.s&&t9(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var r=e.g;e=e.pa,r.L=1,r.v=tf(tl(t)),r.s=null,r.S=!0,e3(r,e)}function ru(e){null!=e.v&&(y.clearTimeout(e.v),e.v=null)}function rc(e,t){var r=null;if(e.g==t){ru(e),ro(e),e.g=null;var n=2}else{if(!tD(e.i,t))return;r=t.F,tM(e.i,t),n=1}if(0!=e.H){if(t.i){if(1==n){r=t.s?t.s.length:0,t=Date.now()-t.G;var i,s=e.C;eg(n=ej(),new ez(n,r)),rt(e)}else rs(e)}else if(3==(s=t.o)||0==s&&0<t.ca||!(1==n&&(i=t,!(tN(e.i)>=e.i.j-(e.m?1:0))&&(e.m?(e.j=i.F.concat(e.j),!0):1!=e.H&&2!=e.H&&!(e.C>=(e.cb?0:e.eb))&&(e.m=eB(E(e.Na,e,i),rh(e,e.C)),e.C++,!0)))||2==n&&ra(e)))switch(r&&0<r.length&&((t=e.i).i=t.i.concat(r)),s){case 1:rd(e,5);break;case 4:rd(e,10);break;case 3:rd(e,6);break;default:rd(e,2)}}}function rh(e,t){let r=e.ab+Math.floor(Math.random()*e.hb);return e.isActive()||(r*=2),r*t}function rd(e,t){if(e.l.info("Error code "+t),2==t){var r=null;e.h&&(r=null);var n=E(e.pb,e);r||(r=new to("//www.google.com/images/cleardot.gif"),y.location&&"http"==y.location.protocol||tu(r,"https"),tf(r)),function(e,t){let r=new eP;if(y.Image){let n=new Image;n.onload=T(tU,r,n,"TestLoadImage: loaded",!0,t),n.onerror=T(tU,r,n,"TestLoadImage: error",!1,t),n.onabort=T(tU,r,n,"TestLoadImage: abort",!1,t),n.ontimeout=T(tU,r,n,"TestLoadImage: timeout",!1,t),y.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=e}else t(!1)}(r.toString(),n)}else eq(2);e.H=0,e.h&&e.h.za(t),rf(e),re(e)}function rf(e){if(e.H=0,e.ma=[],e.h){let t=tL(e.i);(0!=t.length||0!=e.j.length)&&(A(e.ma,t),A(e.ma,e.j),e.i.i.length=0,C(e.j),e.j.length=0),e.h.ya()}}function rp(e,t,r){var n=r instanceof to?tl(r):new to(r);if(""!=n.g)t&&(n.g=t+"."+n.g),tc(n,n.m);else{var i=y.location;n=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;var s=new to(null);n&&tu(s,n),t&&(s.g=t),i&&tc(s,i),r&&(s.l=r),n=s}return r=e.F,t=e.Da,r&&t&&td(n,r,t),td(n,"VER",e.ra),rn(e,n),n}function rm(e,t,r){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new tG(r&&e.Ha&&!e.va?new tV({ob:!0}):e.va)).Oa(e.J),t}function rg(){}function ry(){if(L&&!(10<=Number(K)))throw Error("Environmental error: no available transport.")}function rv(e,t){em.call(this),this.g=new t5(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.s=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.Ca&&(e?e["X-WebChannel-Client-Profile"]=t.Ca:e={"X-WebChannel-Client-Profile":t.Ca}),this.g.U=e,(e=t&&t.cc)&&!R(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!R(t)&&(this.g.F=t,null!==(e=this.h)&&t in e&&t in(e=this.h)&&delete e[t]),this.j=new r_(this)}function rw(e){eY.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 rb(){eX.call(this),this.status=1}function r_(e){this.g=e}function rE(){this.blockSize=-1,this.blockSize=64,this.g=[,,,,],this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}function rT(e,t,r){r||(r=0);var n=Array(16);if("string"==typeof t)for(var i=0;16>i;++i)n[i]=t.charCodeAt(r++)|t.charCodeAt(r++)<<8|t.charCodeAt(r++)<<16|t.charCodeAt(r++)<<24;else for(i=0;16>i;++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];var s=e.g[3],a=t+(s^r&(i^s))+n[0]+3614090360&4294967295;a=s+(i^(t=r+(a<<7&4294967295|a>>>25))&(r^i))+n[1]+3905402710&4294967295,a=i+(r^(s=t+(a<<12&4294967295|a>>>20))&(t^r))+n[2]+606105819&4294967295,a=r+(t^(i=s+(a<<17&4294967295|a>>>15))&(s^t))+n[3]+3250441966&4294967295,a=t+(s^(r=i+(a<<22&4294967295|a>>>10))&(i^s))+n[4]+4118548399&4294967295,a=s+(i^(t=r+(a<<7&4294967295|a>>>25))&(r^i))+n[5]+1200080426&4294967295,a=i+(r^(s=t+(a<<12&4294967295|a>>>20))&(t^r))+n[6]+2821735955&4294967295,a=r+(t^(i=s+(a<<17&4294967295|a>>>15))&(s^t))+n[7]+4249261313&4294967295,a=t+(s^(r=i+(a<<22&4294967295|a>>>10))&(i^s))+n[8]+1770035416&4294967295,a=s+(i^(t=r+(a<<7&4294967295|a>>>25))&(r^i))+n[9]+2336552879&4294967295,a=i+(r^(s=t+(a<<12&4294967295|a>>>20))&(t^r))+n[10]+4294925233&4294967295,a=r+(t^(i=s+(a<<17&4294967295|a>>>15))&(s^t))+n[11]+2304563134&4294967295,a=t+(s^(r=i+(a<<22&4294967295|a>>>10))&(i^s))+n[12]+1804603682&4294967295,a=s+(i^(t=r+(a<<7&4294967295|a>>>25))&(r^i))+n[13]+4254626195&4294967295,a=i+(r^(s=t+(a<<12&4294967295|a>>>20))&(t^r))+n[14]+2792965006&4294967295,a=r+(t^(i=s+(a<<17&4294967295|a>>>15))&(s^t))+n[15]+1236535329&4294967295,r=i+(a<<22&4294967295|a>>>10),a=t+(i^s&(r^i))+n[1]+4129170786&4294967295,t=r+(a<<5&4294967295|a>>>27),a=s+(r^i&(t^r))+n[6]+3225465664&4294967295,s=t+(a<<9&4294967295|a>>>23),a=i+(t^r&(s^t))+n[11]+643717713&4294967295,i=s+(a<<14&4294967295|a>>>18),a=r+(s^t&(i^s))+n[0]+3921069994&4294967295,r=i+(a<<20&4294967295|a>>>12),a=t+(i^s&(r^i))+n[5]+3593408605&4294967295,t=r+(a<<5&4294967295|a>>>27),a=s+(r^i&(t^r))+n[10]+38016083&4294967295,s=t+(a<<9&4294967295|a>>>23),a=i+(t^r&(s^t))+n[15]+3634488961&4294967295,i=s+(a<<14&4294967295|a>>>18),a=r+(s^t&(i^s))+n[4]+3889429448&4294967295,r=i+(a<<20&4294967295|a>>>12),a=t+(i^s&(r^i))+n[9]+568446438&4294967295,t=r+(a<<5&4294967295|a>>>27),a=s+(r^i&(t^r))+n[14]+3275163606&4294967295,s=t+(a<<9&4294967295|a>>>23),a=i+(t^r&(s^t))+n[3]+4107603335&4294967295,i=s+(a<<14&4294967295|a>>>18),a=r+(s^t&(i^s))+n[8]+1163531501&4294967295,r=i+(a<<20&4294967295|a>>>12),a=t+(i^s&(r^i))+n[13]+2850285829&4294967295,t=r+(a<<5&4294967295|a>>>27),a=s+(r^i&(t^r))+n[2]+4243563512&4294967295,s=t+(a<<9&4294967295|a>>>23),a=i+(t^r&(s^t))+n[7]+1735328473&4294967295,i=s+(a<<14&4294967295|a>>>18),a=r+(s^t&(i^s))+n[12]+2368359562&4294967295,a=t+((r=i+(a<<20&4294967295|a>>>12))^i^s)+n[5]+4294588738&4294967295,a=s+((t=r+(a<<4&4294967295|a>>>28))^r^i)+n[8]+2272392833&4294967295,a=i+((s=t+(a<<11&4294967295|a>>>21))^t^r)+n[11]+1839030562&4294967295,a=r+((i=s+(a<<16&4294967295|a>>>16))^s^t)+n[14]+4259657740&4294967295,a=t+((r=i+(a<<23&4294967295|a>>>9))^i^s)+n[1]+2763975236&4294967295,a=s+((t=r+(a<<4&4294967295|a>>>28))^r^i)+n[4]+1272893353&4294967295,a=i+((s=t+(a<<11&4294967295|a>>>21))^t^r)+n[7]+4139469664&4294967295,a=r+((i=s+(a<<16&4294967295|a>>>16))^s^t)+n[10]+3200236656&4294967295,a=t+((r=i+(a<<23&4294967295|a>>>9))^i^s)+n[13]+681279174&4294967295,a=s+((t=r+(a<<4&4294967295|a>>>28))^r^i)+n[0]+3936430074&4294967295,a=i+((s=t+(a<<11&4294967295|a>>>21))^t^r)+n[3]+3572445317&4294967295,a=r+((i=s+(a<<16&4294967295|a>>>16))^s^t)+n[6]+76029189&4294967295,a=t+((r=i+(a<<23&4294967295|a>>>9))^i^s)+n[9]+3654602809&4294967295,a=s+((t=r+(a<<4&4294967295|a>>>28))^r^i)+n[12]+3873151461&4294967295,a=i+((s=t+(a<<11&4294967295|a>>>21))^t^r)+n[15]+530742520&4294967295,a=r+((i=s+(a<<16&4294967295|a>>>16))^s^t)+n[2]+3299628645&4294967295,r=i+(a<<23&4294967295|a>>>9),a=t+(i^(r|~s))+n[0]+4096336452&4294967295,t=r+(a<<6&4294967295|a>>>26),a=s+(r^(t|~i))+n[7]+1126891415&4294967295,s=t+(a<<10&4294967295|a>>>22),a=i+(t^(s|~r))+n[14]+2878612391&4294967295,i=s+(a<<15&4294967295|a>>>17),a=r+(s^(i|~t))+n[5]+4237533241&4294967295,r=i+(a<<21&4294967295|a>>>11),a=t+(i^(r|~s))+n[12]+1700485571&4294967295,t=r+(a<<6&4294967295|a>>>26),a=s+(r^(t|~i))+n[3]+2399980690&4294967295,s=t+(a<<10&4294967295|a>>>22),a=i+(t^(s|~r))+n[10]+4293915773&4294967295,i=s+(a<<15&4294967295|a>>>17),a=r+(s^(i|~t))+n[1]+2240044497&4294967295,r=i+(a<<21&4294967295|a>>>11),a=t+(i^(r|~s))+n[8]+1873313359&4294967295,t=r+(a<<6&4294967295|a>>>26),a=s+(r^(t|~i))+n[15]+4264355552&4294967295,s=t+(a<<10&4294967295|a>>>22),a=i+(t^(s|~r))+n[6]+2734768916&4294967295,i=s+(a<<15&4294967295|a>>>17),a=r+(s^(i|~t))+n[13]+1309151649&4294967295,r=i+(a<<21&4294967295|a>>>11),a=t+(i^(r|~s))+n[4]+4149444226&4294967295,t=r+(a<<6&4294967295|a>>>26),a=s+(r^(t|~i))+n[11]+3174756917&4294967295,s=t+(a<<10&4294967295|a>>>22),a=i+(t^(s|~r))+n[2]+718787259&4294967295,i=s+(a<<15&4294967295|a>>>17),a=r+(s^(i|~t))+n[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(a<<21&4294967295|a>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+s&4294967295}function rS(e,t){this.h=t;for(var r=[],n=!0,i=e.length-1;0<=i;i--){var s=0|e[i];n&&s==t||(r[i]=s,n=!1)}this.g=r}(u=tG.prototype).Oa=function(e){this.M=e},u.ha=function(e,t,r,n){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():a.g(),this.C=this.u?eW(this.u):eW(a),this.g.onreadystatechange=E(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(e){tY(this,e);return}if(e=r||"",r=new Map(this.headers),n){if(Object.getPrototypeOf(n)===Object.prototype)for(var i in n)r.set(i,n[i]);else if("function"==typeof n.keys&&"function"==typeof n.get)for(let e of n.keys())r.set(e,n.get(e));else throw Error("Unknown input type for opt_headers: "+String(n))}for(let[s,a]of(n=Array.from(r.keys()).find(e=>"content-type"==e.toLowerCase()),i=y.FormData&&e instanceof y.FormData,!(0<=k(tJ,t))||n||i||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r))this.g.setRequestHeader(s,a);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{var s;t1(this),0<this.B&&((this.L=(s=this.g,L&&"number"==typeof s.timeout&&void 0!==s.ontimeout))?(this.g.timeout=this.B,this.g.ontimeout=E(this.ua,this)):this.A=eA(this.ua,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(e){tY(this,e)}},u.ua=function(){void 0!==g&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,eg(this,"timeout"),this.abort(8))},u.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,eg(this,"complete"),eg(this,"abort"),t0(this))},u.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),t0(this,!0)),tG.$.N.call(this)},u.La=function(){this.s||(this.G||this.v||this.l?tZ(this):this.kb())},u.kb=function(){tZ(this)},u.isActive=function(){return!!this.g},u.da=function(){try{return 2<t2(this)?this.g.status:-1}catch(e){return -1}},u.ja=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},u.Wa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),tK(t)}},u.Ia=function(){return this.m},u.Sa=function(){return"string"==typeof this.j?this.j:String(this.j)},(u=t5.prototype).ra=8,u.H=1,u.Na=function(e){if(this.m){if(this.m=null,1==this.H){if(!e){this.W=Math.floor(1e5*Math.random()),e=this.W++;let i=new e0(this,this.l,e),s=this.s;if(this.U&&(s?er(s=ee(s),this.U):s=this.U),null!==this.o||this.O||(i.I=s,s=null),this.P)e:{for(var t=0,r=0;r<this.j.length;r++){t:{var n=this.j[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(4096<(t+=n)){t=r;break e}if(4096===t||r===this.j.length-1){t=r+1;break e}}t=1e3}else t=1e3;t=ri(this,i,t),td(r=tl(this.I),"RID",e),td(r,"CVER",22),this.F&&td(r,"X-HTTP-Session-Id",this.F),rn(this,r),s&&(this.O?t="headers="+encodeURIComponent(String(t6(s)))+"&"+t:this.o&&t9(r,this.o,s)),tP(this.i,i),this.bb&&td(r,"TYPE","init"),this.P?(td(r,"$req",t),td(r,"SID","null"),i.aa=!0,e9(i,r,null)):e9(i,r,t),this.H=2}}else 3==this.H&&(e?rr(this,e):0==this.j.length||tR(this.i)||rr(this))}},u.Ma=function(){if(this.u=null,rl(this),this.ca&&!(this.M||null==this.g||0>=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=eB(E(this.jb,this),e)}},u.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,eq(10),t7(this),rl(this))},u.ib=function(){null!=this.v&&(this.v=null,t7(this),ra(this),eq(19))},u.pb=function(e){e?(this.l.info("Successfully pinged google.com"),eq(2)):(this.l.info("Failed to ping google.com"),eq(1))},u.isActive=function(){return!!this.h&&this.h.isActive(this)},(u=rg.prototype).Ba=function(){},u.Aa=function(){},u.za=function(){},u.ya=function(){},u.isActive=function(){return!0},u.Va=function(){},ry.prototype.g=function(e,t){return new rv(e,t)},S(rv,em),rv.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var e=this.g,t=this.l,r=this.h||void 0;eq(0),e.Y=t,e.na=r||{},e.G=e.aa,e.I=rp(e,null,e.Y),rt(e)},rv.prototype.close=function(){t8(this.g)},rv.prototype.u=function(e){var t=this.g;if("string"==typeof e){var r={};r.__data__=e,e=r}else this.v&&((r={}).__data__=ev(e),e=r);t.j.push(new tA(t.fb++,e)),3==t.H&&rt(t)},rv.prototype.N=function(){this.g.h=null,delete this.j,t8(this.g),delete this.g,rv.$.N.call(this)},S(rw,eY),S(rb,eX),S(r_,rg),r_.prototype.Ba=function(){eg(this.g,"a")},r_.prototype.Aa=function(e){eg(this.g,new rw(e))},r_.prototype.za=function(e){eg(this.g,new rb)},r_.prototype.ya=function(){eg(this.g,"b")},S(rE,function(){this.blockSize=-1}),rE.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0},rE.prototype.j=function(e,t){void 0===t&&(t=e.length);for(var r=t-this.blockSize,n=this.m,i=this.h,s=0;s<t;){if(0==i)for(;s<=r;)rT(this,e,s),s+=this.blockSize;if("string"==typeof e){for(;s<t;)if(n[i++]=e.charCodeAt(s++),i==this.blockSize){rT(this,n),i=0;break}}else for(;s<t;)if(n[i++]=e[s++],i==this.blockSize){rT(this,n),i=0;break}}this.h=i,this.i+=t},rE.prototype.l=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var r=8*this.i;for(t=e.length-8;t<e.length;++t)e[t]=255&r,r/=256;for(this.j(e),e=Array(16),t=r=0;4>t;++t)for(var n=0;32>n;n+=8)e[r++]=this.g[t]>>>n&255;return e};var rI={};function rk(e){return -128<=e&&128>e?Object.prototype.hasOwnProperty.call(rI,e)?rI[e]:rI[e]=new rS([0|e],0>e?-1:0):new rS([0|e],0>e?-1:0)}function rC(e){if(isNaN(e)||!isFinite(e))return rx;if(0>e)return rP(rC(-e));for(var t=[],r=1,n=0;e>=r;n++)t[n]=e/r|0,r*=rA;return new rS(t,0)}var rA=4294967296,rx=rk(0),rO=rk(1),rR=rk(16777216);function rN(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function rD(e){return -1==e.h}function rP(e){for(var t=e.g.length,r=[],n=0;n<t;n++)r[n]=~e.g[n];return new rS(r,~e.h).add(rO)}function rM(e,t){return e.add(rP(t))}function rL(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function rF(e,t){this.g=e,this.h=t}function rj(e,t){if(rN(t))throw Error("division by zero");if(rN(e))return new rF(rx,rx);if(rD(e))return t=rj(rP(e),t),new rF(rP(t.g),rP(t.h));if(rD(t))return t=rj(e,rP(t)),new rF(rP(t.g),t.h);if(30<e.g.length){if(rD(e)||rD(t))throw Error("slowDivide_ only works with positive integers.");for(var r=rO,n=t;0>=n.X(e);)r=rU(r),n=rU(n);var i=rV(r,1),s=rV(n,1);for(n=rV(n,2),r=rV(r,2);!rN(n);){var a=s.add(n);0>=a.X(e)&&(i=i.add(r),s=a),n=rV(n,1),r=rV(r,1)}return t=rM(e,i.R(t)),new rF(i,t)}for(i=rx;0<=e.X(t);){for(n=48>=(n=Math.ceil(Math.log(r=Math.max(1,Math.floor(e.ea()/t.ea())))/Math.LN2))?1:Math.pow(2,n-48),a=(s=rC(r)).R(t);rD(a)||0<a.X(e);)r-=n,a=(s=rC(r)).R(t);rN(s)&&(s=rO),i=i.add(s),e=rM(e,a)}return new rF(i,e)}function rU(e){for(var t=e.g.length+1,r=[],n=0;n<t;n++)r[n]=e.D(n)<<1|e.D(n-1)>>>31;return new rS(r,e.h)}function rV(e,t){var r=t>>5;t%=32;for(var n=e.g.length-r,i=[],s=0;s<n;s++)i[s]=0<t?e.D(s+r)>>>t|e.D(s+r+1)<<32-t:e.D(s+r);return new rS(i,e.h)}(u=rS.prototype).ea=function(){if(rD(this))return-rP(this).ea();for(var e=0,t=1,r=0;r<this.g.length;r++){var n=this.D(r);e+=(0<=n?n:rA+n)*t,t*=rA}return e},u.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(rN(this))return"0";if(rD(this))return"-"+rP(this).toString(e);for(var t=rC(Math.pow(e,6)),r=this,n="";;){var i=rj(r,t).g,s=((0<(r=rM(r,i.R(t))).g.length?r.g[0]:r.h)>>>0).toString(e);if(rN(r=i))return s+n;for(;6>s.length;)s="0"+s;n=s+n}},u.D=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},u.X=function(e){return rD(e=rM(this,e))?-1:rN(e)?0:1},u.abs=function(){return rD(this)?rP(this):this},u.add=function(e){for(var t=Math.max(this.g.length,e.g.length),r=[],n=0,i=0;i<=t;i++){var s=n+(65535&this.D(i))+(65535&e.D(i)),a=(s>>>16)+(this.D(i)>>>16)+(e.D(i)>>>16);n=a>>>16,s&=65535,a&=65535,r[i]=a<<16|s}return new rS(r,-2147483648&r[r.length-1]?-1:0)},u.R=function(e){if(rN(this)||rN(e))return rx;if(rD(this))return rD(e)?rP(this).R(rP(e)):rP(rP(this).R(e));if(rD(e))return rP(this.R(rP(e)));if(0>this.X(rR)&&0>e.X(rR))return rC(this.ea()*e.ea());for(var t=this.g.length+e.g.length,r=[],n=0;n<2*t;n++)r[n]=0;for(n=0;n<this.g.length;n++)for(var i=0;i<e.g.length;i++){var s=this.D(n)>>>16,a=65535&this.D(n),o=e.D(i)>>>16,l=65535&e.D(i);r[2*n+2*i]+=a*l,rL(r,2*n+2*i),r[2*n+2*i+1]+=s*l,rL(r,2*n+2*i+1),r[2*n+2*i+1]+=a*o,rL(r,2*n+2*i+1),r[2*n+2*i+2]+=s*o,rL(r,2*n+2*i+2)}for(n=0;n<t;n++)r[n]=r[2*n+1]<<16|r[2*n];for(n=t;n<2*t;n++)r[n]=0;return new rS(r,0)},u.gb=function(e){return rj(this,e).h},u.and=function(e){for(var t=Math.max(this.g.length,e.g.length),r=[],n=0;n<t;n++)r[n]=this.D(n)&e.D(n);return new rS(r,this.h&e.h)},u.or=function(e){for(var t=Math.max(this.g.length,e.g.length),r=[],n=0;n<t;n++)r[n]=this.D(n)|e.D(n);return new rS(r,this.h|e.h)},u.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),r=[],n=0;n<t;n++)r[n]=this.D(n)^e.D(n);return new rS(r,this.h^e.h)},ry.prototype.createWebChannel=ry.prototype.g,rv.prototype.send=rv.prototype.u,rv.prototype.open=rv.prototype.m,rv.prototype.close=rv.prototype.close,eH.NO_ERROR=0,eH.TIMEOUT=8,eH.HTTP_ERROR=6,eK.COMPLETE="complete",eQ.EventType=eJ,eJ.OPEN="a",eJ.CLOSE="b",eJ.ERROR="c",eJ.MESSAGE="d",em.prototype.listen=em.prototype.O,tG.prototype.listenOnce=tG.prototype.P,tG.prototype.getLastError=tG.prototype.Sa,tG.prototype.getLastErrorCode=tG.prototype.Ia,tG.prototype.getStatus=tG.prototype.da,tG.prototype.getResponseJson=tG.prototype.Wa,tG.prototype.getResponseText=tG.prototype.ja,tG.prototype.send=tG.prototype.ha,tG.prototype.setWithCredentials=tG.prototype.Oa,rE.prototype.digest=rE.prototype.l,rE.prototype.reset=rE.prototype.reset,rE.prototype.update=rE.prototype.j,rS.prototype.add=rS.prototype.add,rS.prototype.multiply=rS.prototype.R,rS.prototype.modulo=rS.prototype.gb,rS.prototype.compare=rS.prototype.X,rS.prototype.toNumber=rS.prototype.ea,rS.prototype.toString=rS.prototype.toString,rS.prototype.getBits=rS.prototype.D,rS.fromNumber=rC,rS.fromString=function e(t,r){if(0==t.length)throw Error("number format error: empty string");if(2>(r=r||10)||36<r)throw Error("radix out of range: "+r);if("-"==t.charAt(0))return rP(e(t.substring(1),r));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var n=rC(Math.pow(r,8)),i=rx,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),o=parseInt(t.substring(s,s+a),r);8>a?(a=rC(Math.pow(r,a)),i=i.R(a).add(rC(o))):i=(i=i.R(n)).add(rC(o))}return i};var r$=m.createWebChannelTransport=function(){return new ry},rq=m.getStatEventTarget=function(){return ej()},rz=m.ErrorCode=eH,rB=m.EventType=eK,rH=m.Event=eL,rK=m.Stat={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},rG=m.FetchXmlHttpFactory=tV,rW=m.WebChannel=eQ,rQ=m.XhrIo=tG,rJ=m.Md5=rE,rY=m.Integer=rS;r(83454);let rX="@firebase/firestore";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rZ{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}}rZ.UNAUTHENTICATED=new rZ(null),rZ.GOOGLE_CREDENTIALS=new rZ("google-credentials-uid"),rZ.FIRST_PARTY=new rZ("first-party-uid"),rZ.MOCK_USER=new rZ("mock-user");/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let r0="10.1.0",r1=new d.Yd("@firebase/firestore");function r2(){return r1.logLevel}function r4(e,...t){if(r1.logLevel<=d.in.DEBUG){let r=t.map(r3);r1.debug(`Firestore (${r0}): ${e}`,...r)}}function r6(e,...t){if(r1.logLevel<=d.in.ERROR){let r=t.map(r3);r1.error(`Firestore (${r0}): ${e}`,...r)}}function r9(e,...t){if(r1.logLevel<=d.in.WARN){let r=t.map(r3);r1.warn(`Firestore (${r0}): ${e}`,...r)}}function r3(e){if("string"==typeof e)return e;try{/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */return JSON.stringify(e)}catch(t){return e}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function r5(e="Unexpected state"){let t=`FIRESTORE (${r0}) INTERNAL ASSERTION FAILED: `+e;throw r6(t),Error(t)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let r8={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class r7 extends f.ZR{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ne{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nt{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class nr{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(rZ.UNAUTHENTICATED))}shutdown(){}}class nn{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 ni{constructor(e){this.t=e,this.currentUser=rZ.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let r=this.i,n=e=>this.i!==r?(r=this.i,t(e)):Promise.resolve(),i=new ne;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new ne,e.enqueueRetryable(()=>n(this.currentUser))};let s=()=>{let t=i;e.enqueueRetryable(async()=>{await t.promise,await n(this.currentUser)})},a=e=>{r4("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit(e=>a(e)),setTimeout(()=>{if(!this.auth){let e=this.t.getImmediate({optional:!0});e?a(e):(r4("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new ne)}},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?(r4("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?("string"==typeof t.accessToken||r5(),new nt(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){let e=this.auth&&this.auth.getUid();return null===e||"string"==typeof e||r5(),new rZ(e)}}class ns{constructor(e,t,r){this.l=e,this.h=t,this.P=r,this.type="FirstParty",this.user=rZ.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);let e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class na{constructor(e,t,r){this.l=e,this.h=t,this.P=r}getToken(){return Promise.resolve(new ns(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(rZ.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class no{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 nl{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,t){let r=e=>{null!=e.error&&r4("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);let r=e.token!==this.R;return this.R=e.token,r4("FirebaseAppCheckTokenProvider",`Received ${r?"new":"existing"} token.`),r?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>r(t))};let n=e=>{r4("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.appCheck.addTokenListener(this.o)};this.A.onInit(e=>n(e)),setTimeout(()=>{if(!this.appCheck){let e=this.A.getImmediate({optional:!0});e?n(e):r4("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?("string"==typeof e.token||r5(),this.R=e.token,new no(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nu{static V(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length,r="";for(;r.length<20;){let n=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){let t="undefined"!=typeof self&&(self.crypto||self.msCrypto),r=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(r);else for(let t=0;t<e;t++)r[t]=Math.floor(256*Math.random());return r}(40);for(let i=0;i<n.length;++i)r.length<20&&n[i]<t&&(r+=e.charAt(n[i]%e.length))}return r}}function nc(e,t){return e<t?-1:e>t?1:0}function nh(e,t,r){return e.length===t.length&&e.every((e,n)=>r(e,t[n]))}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nd{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0||t>=1e9)throw new r7(r8.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800||e>=253402300800)throw new r7(r8.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return nd.fromMillis(Date.now())}static fromDate(e){return nd.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3),r=Math.floor(1e6*(e-1e3*t));return new nd(t,r)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?nc(this.nanoseconds,e.nanoseconds):nc(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{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){let e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nf{constructor(e){this.timestamp=e}static fromTimestamp(e){return new nf(e)}static min(){return new nf(new nd(0,0))}static max(){return new nf(new nd(253402300799,999999999))}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}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class np{constructor(e,t,r){void 0===t?t=0:t>e.length&&r5(),void 0===r?r=e.length-t:r>e.length-t&&r5(),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return 0===np.comparator(this,e)}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof np?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=e.get(n),i=t.get(n);if(r<i)return -1;if(r>i)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}class nm extends np{construct(e,t,r){return new nm(e,t,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){let t=[];for(let r of e){if(r.indexOf("//")>=0)throw new r7(r8.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(e=>e.length>0))}return new nm(t)}static emptyPath(){return new nm([])}}let ng=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class ny extends np{construct(e,t,r){return new ny(e,t,r)}static isValidIdentifier(e){return ng.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),ny.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new ny(["__name__"])}static fromServerFormat(e){let t=[],r="",n=0,i=()=>{if(0===r.length)throw new r7(r8.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 r7(r8.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let t=e[n+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new r7(r8.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 r7(r8.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new ny(t)}static emptyPath(){return new ny([])}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nv{constructor(e){this.path=e}static fromPath(e){return new nv(nm.fromString(e))}static fromName(e){return new nv(nm.fromString(e).popFirst(5))}static empty(){return new nv(nm.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===nm.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return nm.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new nv(new nm(e.slice()))}}class nw{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new nw(nf.min(),nv.empty(),-1)}static max(){return new nw(nf.max(),nv.empty(),-1)}}class nb{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function n_(e){if(e.code!==r8.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==e.message)throw e;r4("LocalStore","Unexpectedly lost primary lease")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nE{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&&r5(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new nE((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 nE?t:nE.resolve(t)}catch(e){return nE.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):nE.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):nE.reject(t)}static resolve(e){return new nE((t,r)=>{t(e)})}static reject(e){return new nE((t,r)=>{r(e)})}static waitFor(e){return new nE((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=nE.resolve(!1);for(let r of e)t=t.next(e=>e?nE.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 nE((r,n)=>{let i=e.length,s=Array(i),a=0;for(let o=0;o<i;o++){let l=o;t(e[l]).next(e=>{s[l]=e,++a===i&&r(s)},e=>n(e))}})}static doWhile(e,t){return new nE((r,n)=>{let i=()=>{!0===e()?t().next(()=>{i()},n):r()};i()})}}function nT(e){return"IndexedDbTransactionError"===e.name}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nS{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.oe(e),this._e=e=>t.writeSequenceNumber(e))}oe(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this._e&&this._e(e),e}}function nI(e){return 0===e&&1/e==-1/0}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function nk(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function nC(e,t){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])}function nA(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}nS.ae=-1;/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nx{constructor(e,t){this.comparator=e,this.root=t||nR.EMPTY}insert(e,t){return new nx(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,nR.BLACK,null,null))}remove(e){return new nx(this.comparator,this.root.remove(e,this.comparator).copy(null,null,nR.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 nO(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new nO(this.root,e,this.comparator,!1)}getReverseIterator(){return new nO(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new nO(this.root,e,this.comparator,!0)}}class nO{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 nR{constructor(e,t,r,n,i){this.key=e,this.value=t,this.color=null!=r?r:nR.RED,this.left=null!=n?n:nR.EMPTY,this.right=null!=i?i:nR.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,n,i){return new nR(null!=e?e:this.key,null!=t?t:this.value,null!=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 nR.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 nR.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,nR.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,nR.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(){let e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw r5();let e=this.left.check();if(e!==this.right.check())throw r5();return e+(this.isRed()?0:1)}}nR.EMPTY=null,nR.RED=!0,nR.BLACK=!1,nR.EMPTY=new class{constructor(){this.size=0}get key(){throw r5()}get value(){throw r5()}get color(){throw r5()}get left(){throw r5()}get right(){throw r5()}copy(e,t,r,n,i){return this}insert(e,t,r){return new nR(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}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nN{constructor(e){this.comparator=e,this.data=new nx(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 nD(this.data.getIterator())}getIteratorFrom(e){return new nD(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 nN)||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 nN(this.comparator);return t.data=e,t}}class nD{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nP{constructor(e){this.fields=e,e.sort(ny.comparator)}static empty(){return new nP([])}unionWith(e){let t=new nN(ny.comparator);for(let e of this.fields)t=t.add(e);for(let r of e)t=t.add(r);return new nP(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return nh(this.fields,e.fields,(e,t)=>e.isEqual(t))}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nM extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nL{constructor(e){this.binaryString=e}static fromBase64String(e){let t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new nM("Invalid base64 string: "+e):e}}(e);return new nL(t)}static fromUint8Array(e){let t=function(e){let t="";for(let r=0;r<e.length;++r)t+=String.fromCharCode(e[r]);return t}(e);return new nL(t)}[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 nc(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}nL.EMPTY_BYTE_STRING=new nL("");let nF=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function nj(e){if(e||r5(),"string"==typeof e){let t=0,r=nF.exec(e);if(r||r5(),r[1]){let e=r[1];t=Number(e=(e+"000000000").substr(0,9))}let n=new Date(e);return{seconds:Math.floor(n.getTime()/1e3),nanos:t}}return{seconds:nU(e.seconds),nanos:nU(e.nanos)}}function nU(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function nV(e){return"string"==typeof e?nL.fromBase64String(e):nL.fromUint8Array(e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function n$(e){var t,r;return"server_timestamp"===(null===(r=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===r?void 0:r.stringValue)}function nq(e){let t=e.mapValue.fields.__previous_value__;return n$(t)?nq(t):t}function nz(e){let t=nj(e.mapValue.fields.__local_write_time__.timestampValue);return new nd(t.seconds,t.nanos)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nB{constructor(e,t,r,n,i,s,a,o,l){this.databaseId=e,this.appId=t,this.persistenceKey=r,this.host=n,this.ssl=i,this.forceLongPolling=s,this.autoDetectLongPolling=a,this.longPollingOptions=o,this.useFetchStreams=l}}class nH{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new nH("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof nH&&e.projectId===this.projectId&&e.database===this.database}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let nK={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function nG(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?n$(e)?4:n3(e)?9007199254740991:10:r5()}function nW(e,t){if(e===t)return!0;let r=nG(e);if(r!==nG(t))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return nz(e).isEqual(nz(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=nj(e.timestampValue),n=nj(t.timestampValue);return r.seconds===n.seconds&&r.nanos===n.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return nV(e.bytesValue).isEqual(nV(t.bytesValue));case 7:return e.referenceValue===t.referenceValue;case 8:return nU(e.geoPointValue.latitude)===nU(t.geoPointValue.latitude)&&nU(e.geoPointValue.longitude)===nU(t.geoPointValue.longitude);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return nU(e.integerValue)===nU(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){let r=nU(e.doubleValue),n=nU(t.doubleValue);return r===n?nI(r)===nI(n):isNaN(r)&&isNaN(n)}return!1}(e,t);case 9:return nh(e.arrayValue.values||[],t.arrayValue.values||[],nW);case 10:return function(e,t){let r=e.mapValue.fields||{},n=t.mapValue.fields||{};if(nk(r)!==nk(n))return!1;for(let e in r)if(r.hasOwnProperty(e)&&(void 0===n[e]||!nW(r[e],n[e])))return!1;return!0}(e,t);default:return r5()}}function nQ(e,t){return void 0!==(e.values||[]).find(e=>nW(e,t))}function nJ(e,t){if(e===t)return 0;let r=nG(e),n=nG(t);if(r!==n)return nc(r,n);switch(r){case 0:case 9007199254740991:return 0;case 1:return nc(e.booleanValue,t.booleanValue);case 2:return function(e,t){let r=nU(e.integerValue||e.doubleValue),n=nU(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 nY(e.timestampValue,t.timestampValue);case 4:return nY(nz(e),nz(t));case 5:return nc(e.stringValue,t.stringValue);case 6:return function(e,t){let r=nV(e),n=nV(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=nc(r[e],n[e]);if(0!==t)return t}return nc(r.length,n.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){let r=nc(nU(e.latitude),nU(t.latitude));return 0!==r?r:nc(nU(e.longitude),nU(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){let r=e.values||[],n=t.values||[];for(let e=0;e<r.length&&e<n.length;++e){let t=nJ(r[e],n[e]);if(t)return t}return nc(r.length,n.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){if(e===nK.mapValue&&t===nK.mapValue)return 0;if(e===nK.mapValue)return 1;if(t===nK.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=nc(n[e],s[e]);if(0!==t)return t;let a=nJ(r[n[e]],i[s[e]]);if(0!==a)return a}return nc(n.length,s.length)}(e.mapValue,t.mapValue);default:throw r5()}}function nY(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return nc(e,t);let r=nj(e),n=nj(t),i=nc(r.seconds,n.seconds);return 0!==i?i:nc(r.nanos,n.nanos)}function nX(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=nj(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?nV(e.bytesValue).toBase64():"referenceValue"in e?(t=e.referenceValue,nv.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+=nX(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}:${nX(e.fields[i])}`;return r+"}"}(e.mapValue):r5()}function nZ(e,t){return{referenceValue:`projects/${e.projectId}/databases/${e.database}/documents/${t.path.canonicalString()}`}}function n0(e){return!!e&&"integerValue"in e}function n1(e){return!!e&&"arrayValue"in e}function n2(e){return!!e&&"nullValue"in e}function n4(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function n6(e){return!!e&&"mapValue"in e}function n9(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){let t={mapValue:{fields:{}}};return nC(e.mapValue.fields,(e,r)=>t.mapValue.fields[e]=n9(r)),t}if(e.arrayValue){let t={arrayValue:{values:[]}};for(let r=0;r<(e.arrayValue.values||[]).length;++r)t.arrayValue.values[r]=n9(e.arrayValue.values[r]);return t}return Object.assign({},e)}function n3(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class n5{constructor(e){this.value=e}static empty(){return new n5({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(!n6(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()]=n9(t)}setAll(e){let t=ny.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()]=n9(e):n.push(i.lastSegment())});let i=this.getFieldsMap(t);this.applyChanges(i,r,n)}delete(e){let t=this.field(e.popLast());n6(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return nW(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)];n6(n)&&n.mapValue.fields||(n={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=n),t=n}return t.mapValue.fields}applyChanges(e,t,r){for(let n of(nC(t,(t,r)=>e[t]=r),r))delete e[n]}clone(){return new n5(n9(this.value))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class n8{constructor(e,t,r,n,i,s,a){this.key=e,this.documentType=t,this.version=r,this.readTime=n,this.createTime=i,this.data=s,this.documentState=a}static newInvalidDocument(e){return new n8(e,0,nf.min(),nf.min(),nf.min(),n5.empty(),0)}static newFoundDocument(e,t,r,n){return new n8(e,1,t,nf.min(),r,n,0)}static newNoDocument(e,t){return new n8(e,2,t,nf.min(),nf.min(),n5.empty(),0)}static newUnknownDocument(e,t){return new n8(e,3,t,nf.min(),nf.min(),n5.empty(),2)}convertToFoundDocument(e,t){return this.createTime.isEqual(nf.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=n5.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=n5.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=nf.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 n8&&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 n8(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}})`}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class n7{constructor(e,t){this.position=e,this.inclusive=t}}function ie(e,t,r){let n=0;for(let i=0;i<e.position.length;i++){let s=t[i],a=e.position[i];if(n=s.field.isKeyField()?nv.comparator(nv.fromName(a.referenceValue),r.key):nJ(a,r.data.field(s.field)),"desc"===s.dir&&(n*=-1),0!==n)break}return n}function it(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(!nW(e.position[r],t.position[r]))return!1;return!0}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ir{constructor(e,t="asc"){this.field=e,this.dir=t}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ii{}class is extends ii{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 iu(e,t,r):"array-contains"===t?new ip(e,r):"in"===t?new im(e,r):"not-in"===t?new ig(e,r):"array-contains-any"===t?new iy(e,r):new is(e,t,r)}static createKeyFieldInFilter(e,t,r){return"in"===t?new ic(e,r):new ih(e,r)}matches(e){let t=e.data.field(this.field);return"!="===this.op?null!==t&&this.matchesComparison(nJ(t,this.value)):null!==t&&nG(this.value)===nG(t)&&this.matchesComparison(nJ(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 r5()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}getFirstInequalityField(){return this.isInequality()?this.field:null}}class ia extends ii{constructor(e,t){super(),this.filters=e,this.op=t,this.ce=null}static create(e,t){return new ia(e,t)}matches(e){return io(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.ce||(this.ce=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ce}getFilters(){return Object.assign([],this.filters)}getFirstInequalityField(){let e=this.le(e=>e.isInequality());return null!==e?e.field:null}le(e){for(let t of this.getFlattenedFilters())if(e(t))return t;return null}}function io(e){return"and"===e.op}function il(e){for(let t of e.filters)if(t instanceof ia)return!1;return!0}class iu extends is{constructor(e,t,r){super(e,t,r),this.key=nv.fromName(r.referenceValue)}matches(e){let t=nv.comparator(e.key,this.key);return this.matchesComparison(t)}}class ic extends is{constructor(e,t){super(e,"in",t),this.keys=id("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class ih extends is{constructor(e,t){super(e,"not-in",t),this.keys=id("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function id(e,t){var r;return((null===(r=t.arrayValue)||void 0===r?void 0:r.values)||[]).map(e=>nv.fromName(e.referenceValue))}class ip extends is{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return n1(t)&&nQ(t.arrayValue,this.value)}}class im extends is{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return null!==t&&nQ(this.value.arrayValue,t)}}class ig extends is{constructor(e,t){super(e,"not-in",t)}matches(e){if(nQ(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return null!==t&&!nQ(this.value.arrayValue,t)}}class iy extends is{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!n1(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>nQ(this.value.arrayValue,e))}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iv{constructor(e,t=null,r=[],n=[],i=null,s=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=n,this.limit=i,this.startAt=s,this.endAt=a,this.he=null}}function iw(e,t=null,r=[],n=[],i=null,s=null,a=null){return new iv(e,t,r,n,i,s,a)}function ib(e){if(null===e.he){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:"+e.filters.map(e=>(function e(t){if(t instanceof is)return t.field.canonicalString()+t.op.toString()+nX(t.value);if(il(t)&&io(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(","),null==e.limit||(t+="|l:"+e.limit),e.startAt&&(t+="|lb:"+(e.startAt.inclusive?"b:":"a:")+e.startAt.position.map(e=>nX(e)).join(",")),e.endAt&&(t+="|ub:"+(e.endAt.inclusive?"a:":"b:")+e.endAt.position.map(e=>nX(e)).join(",")),e.he=t}return e.he}function i_(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 is?r instanceof is&&t.op===r.op&&t.field.isEqual(r.field)&&nW(t.value,r.value):t instanceof ia?r instanceof ia&&t.op===r.op&&t.filters.length===r.filters.length&&t.filters.reduce((t,n,i)=>t&&e(n,r.filters[i]),!0):void r5()}(e.filters[r],t.filters[r]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!it(e.startAt,t.startAt)&&it(e.endAt,t.endAt)}function iE(e){return nv.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iT{constructor(e,t=null,r=[],n=[],i=null,s="F",a=null,o=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=n,this.limit=i,this.limitType=s,this.startAt=a,this.endAt=o,this.Pe=null,this.Ie=null,this.startAt,this.endAt}}function iS(e){return new iT(e)}function iI(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 ik(e){return e.explicitOrderBy.length>0?e.explicitOrderBy[0].field:null}function iC(e){for(let t of e.filters){let e=t.getFirstInequalityField();if(null!==e)return e}return null}function iA(e){return null!==e.collectionGroup}function ix(e){if(null===e.Pe){e.Pe=[];let t=iC(e),r=ik(e);if(null!==t&&null===r)t.isKeyField()||e.Pe.push(new ir(t)),e.Pe.push(new ir(ny.keyField(),"asc"));else{let t=!1;for(let r of e.explicitOrderBy)e.Pe.push(r),r.field.isKeyField()&&(t=!0);if(!t){let t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.Pe.push(new ir(ny.keyField(),t))}}}return e.Pe}function iO(e){if(!e.Ie){if("F"===e.limitType)e.Ie=iw(e.path,e.collectionGroup,ix(e),e.filters,e.limit,e.startAt,e.endAt);else{let t=[];for(let r of ix(e)){let e="desc"===r.dir?"asc":"desc";t.push(new ir(r.field,e))}let r=e.endAt?new n7(e.endAt.position,e.endAt.inclusive):null,n=e.startAt?new n7(e.startAt.position,e.startAt.inclusive):null;e.Ie=iw(e.path,e.collectionGroup,t,e.filters,e.limit,r,n)}}return e.Ie}function iR(e,t){t.getFirstInequalityField(),iC(e);let r=e.filters.concat([t]);return new iT(e.path,e.collectionGroup,e.explicitOrderBy.slice(),r,e.limit,e.limitType,e.startAt,e.endAt)}function iN(e,t,r){return new iT(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,r,e.startAt,e.endAt)}function iD(e,t){return i_(iO(e),iO(t))&&e.limitType===t.limitType}function iP(e){return`${ib(iO(e))}|lt:${e.limitType}`}function iM(e){var t;let r;return`Query(target=${r=(t=iO(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 is?`${t.field.canonicalString()} ${t.op} ${nX(t.value)}`:t instanceof ia?t.op.toString()+" {"+t.getFilters().map(e).join(" ,")+"}":"Filter"})(e)).join(", ")}]`),null==t.limit||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(e=>`${e.field.canonicalString()} (${e.dir})`).join(", ")}]`),t.startAt&&(r+=", startAt: "+(t.startAt.inclusive?"b:":"a:")+t.startAt.position.map(e=>nX(e)).join(",")),t.endAt&&(r+=", endAt: "+(t.endAt.inclusive?"a:":"b:")+t.endAt.position.map(e=>nX(e)).join(",")),`Target(${r})`}; limitType=${e.limitType})`}function iL(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):nv.isDocumentKey(e.path)?e.path.isEqual(r):e.path.isImmediateParentOf(r)}(e,t)&&function(e,t){for(let r of ix(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=ie(e,t,r);return e.inclusive?n<=0:n<0}(e.startAt,ix(e),t))&&(!e.endAt||!!function(e,t,r){let n=ie(e,t,r);return e.inclusive?n>=0:n>0}(e.endAt,ix(e),t))}function iF(e){return(t,r)=>{let n=!1;for(let i of ix(e)){let e=function(e,t,r){let n=e.field.isKeyField()?nv.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?nJ(n,i):r5()}(e.field,t,r);switch(e.dir){case"asc":return n;case"desc":return -1*n;default:return r5()}}(i,t,r);if(0!==e)return e;n=n||i.field.isKeyField()}return 0}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ij{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){nC(this.inner,(t,r)=>{for(let[t,n]of r)e(t,n)})}isEmpty(){return nA(this.inner)}size(){return this.innerSize}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let iU=new nx(nv.comparator),iV=new nx(nv.comparator);function i$(...e){let t=iV;for(let r of e)t=t.insert(r.key,r);return t}function iq(e){let t=iV;return e.forEach((e,r)=>t=t.insert(e,r.overlayedDocument)),t}function iz(){return new ij(e=>e.toString(),(e,t)=>e.isEqual(t))}let iB=new nx(nv.comparator),iH=new nN(nv.comparator);function iK(...e){let t=iH;for(let r of e)t=t.add(r);return t}let iG=new nN(nc);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function iW(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:nI(t)?"-0":t}}function iQ(e){return{integerValue:""+e}}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iJ{constructor(){this._=void 0}}function iY(e,t){return e instanceof i4?n0(t)||t&&"doubleValue"in t?t:{integerValue:0}:null}class iX extends iJ{}class iZ extends iJ{constructor(e){super(),this.elements=e}}function i0(e,t){let r=i9(t);for(let t of e.elements)r.some(e=>nW(e,t))||r.push(t);return{arrayValue:{values:r}}}class i1 extends iJ{constructor(e){super(),this.elements=e}}function i2(e,t){let r=i9(t);for(let t of e.elements)r=r.filter(e=>!nW(e,t));return{arrayValue:{values:r}}}class i4 extends iJ{constructor(e,t){super(),this.serializer=e,this.Te=t}}function i6(e){return nU(e.integerValue||e.doubleValue)}function i9(e){return n1(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class i3{constructor(e,t){this.field=e,this.transform=t}}class i5{constructor(e,t){this.version=e,this.transformResults=t}}class i8{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new i8}static exists(e){return new i8(void 0,e)}static updateTime(e){return new i8(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 i7(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class se{}function st(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new su(e.key,i8.none()):new si(e.key,e.data,i8.none());{let r=e.data,n=n5.empty(),i=new nN(ny.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 ss(e.key,n,new nP(i.toArray()),i8.none())}}function sr(e,t,r,n){return e instanceof si?function(e,t,r,n){if(!i7(e.precondition,t))return r;let i=e.value.clone(),s=sl(e.fieldTransforms,n,t);return i.setAll(s),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,r,n):e instanceof ss?function(e,t,r,n){if(!i7(e.precondition,t))return r;let i=sl(e.fieldTransforms,n,t),s=t.data;return(s.setAll(sa(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):i7(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):r}function sn(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)&&nh(r,n,(e,t)=>{var r,n;return e.field.isEqual(t.field)&&(r=e.transform,n=t.transform,r instanceof iZ&&n instanceof iZ||r instanceof i1&&n instanceof i1?nh(r.elements,n.elements,nW):r instanceof i4&&n instanceof i4?nW(r.Te,n.Te):r instanceof iX&&n instanceof iX)})))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class si extends se{constructor(e,t,r,n=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=n,this.type=0}getFieldMask(){return null}}class ss extends se{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 sa(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 so(e,t,r){var n;let i=new Map;e.length===r.length||r5();for(let s=0;s<r.length;s++){let a=e[s],o=a.transform,l=t.data.field(a.field);i.set(a.field,(n=r[s],o instanceof iZ?i0(o,l):o instanceof i1?i2(o,l):n))}return i}function sl(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 iX?function(e,t){let r={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&n$(t)&&(t=nq(t)),t&&(r.fields.__previous_value__=t),{mapValue:r}}(t,s):e instanceof iZ?i0(e,s):e instanceof i1?i2(e,s):function(e,t){let r=iY(e,t),n=i6(r)+i6(e.Te);return n0(r)&&n0(e.Te)?iQ(n):iW(e.serializer,n)}(e,s))}return n}class su extends se{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class sc extends se{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sh{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 si?function(e,t,r){let n=e.value.clone(),i=so(e.fieldTransforms,t,r.transformResults);n.setAll(i),t.convertToFoundDocument(r.version,n).setHasCommittedMutations()}(i,e,n):i instanceof ss?function(e,t,r){if(!i7(e.precondition,t))return void t.convertToUnknownDocument(r.version);let n=so(e.fieldTransforms,t,r.transformResults),i=t.data;i.setAll(sa(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=sr(r,e,t,this.localWriteTime));for(let r of this.mutations)r.key.isEqual(e.key)&&(t=sr(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){let r=iz();return this.mutations.forEach(n=>{let i=e.get(n.key),s=i.overlayedDocument,a=this.applyToLocalView(s,i.mutatedFields);a=t.has(n.key)?null:a;let o=st(s,a);null!==o&&r.set(n.key,o),s.isValidDocument()||s.convertToNoDocument(nf.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),iK())}isEqual(e){return this.batchId===e.batchId&&nh(this.mutations,e.mutations,(e,t)=>sn(e,t))&&nh(this.baseMutations,e.baseMutations,(e,t)=>sn(e,t))}}class sd{constructor(e,t,r,n){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=n}static from(e,t,r){e.mutations.length===r.length||r5();let n=iB,i=e.mutations;for(let e=0;e<i.length;e++)n=n.insert(i[e].key,r[e].version);return new sd(e,t,r,n)}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sf{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{
      largestBatchId: ${this.largestBatchId},
      mutation: ${this.mutation.toString()}
    }`}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sp{constructor(e,t){this.count=e,this.unchangedNames=t}}function sm(e){if(void 0===e)return r6("GRPC error has no .code"),r8.UNKNOWN;switch(e){case o.OK:return r8.OK;case o.CANCELLED:return r8.CANCELLED;case o.UNKNOWN:return r8.UNKNOWN;case o.DEADLINE_EXCEEDED:return r8.DEADLINE_EXCEEDED;case o.RESOURCE_EXHAUSTED:return r8.RESOURCE_EXHAUSTED;case o.INTERNAL:return r8.INTERNAL;case o.UNAVAILABLE:return r8.UNAVAILABLE;case o.UNAUTHENTICATED:return r8.UNAUTHENTICATED;case o.INVALID_ARGUMENT:return r8.INVALID_ARGUMENT;case o.NOT_FOUND:return r8.NOT_FOUND;case o.ALREADY_EXISTS:return r8.ALREADY_EXISTS;case o.PERMISSION_DENIED:return r8.PERMISSION_DENIED;case o.FAILED_PRECONDITION:return r8.FAILED_PRECONDITION;case o.ABORTED:return r8.ABORTED;case o.OUT_OF_RANGE:return r8.OUT_OF_RANGE;case o.UNIMPLEMENTED:return r8.UNIMPLEMENTED;case o.DATA_LOSS:return r8.DATA_LOSS;default:return r5()}}(l=o||(o={}))[l.OK=0]="OK",l[l.CANCELLED=1]="CANCELLED",l[l.UNKNOWN=2]="UNKNOWN",l[l.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",l[l.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",l[l.NOT_FOUND=5]="NOT_FOUND",l[l.ALREADY_EXISTS=6]="ALREADY_EXISTS",l[l.PERMISSION_DENIED=7]="PERMISSION_DENIED",l[l.UNAUTHENTICATED=16]="UNAUTHENTICATED",l[l.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",l[l.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",l[l.ABORTED=10]="ABORTED",l[l.OUT_OF_RANGE=11]="OUT_OF_RANGE",l[l.UNIMPLEMENTED=12]="UNIMPLEMENTED",l[l.INTERNAL=13]="INTERNAL",l[l.UNAVAILABLE=14]="UNAVAILABLE",l[l.DATA_LOSS=15]="DATA_LOSS";/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sg{constructor(){this.onExistenceFilterMismatchCallbacks=new Map}static get instance(){return sy}static getOrCreateInstance(){return null===sy&&(sy=new sg),sy}onExistenceFilterMismatch(e){let t=Symbol();return this.onExistenceFilterMismatchCallbacks.set(t,e),()=>this.onExistenceFilterMismatchCallbacks.delete(t)}notifyOnExistenceFilterMismatch(e){this.onExistenceFilterMismatchCallbacks.forEach(t=>t(e))}}let sy=null,sv=new rY([4294967295,4294967295],0);function sw(e){let t=(new TextEncoder).encode(e),r=new rJ;return r.update(t),new Uint8Array(r.digest())}function sb(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 rY([r,n],0),new rY([i,s],0)]}class s_{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new sE(`Invalid padding: ${t}`);if(r<0||e.length>0&&0===this.hashCount)throw new sE(`Invalid hash count: ${r}`);if(0===e.length&&0!==t)throw new sE(`Invalid padding when bitmap length is 0: ${t}`);this.de=8*e.length-t,this.Ae=rY.fromNumber(this.de)}Re(e,t,r){let n=e.add(t.multiply(rY.fromNumber(r)));return 1===n.compare(sv)&&(n=new rY([n.getBits(0),n.getBits(1)],0)),n.modulo(this.Ae).toNumber()}Ve(e){return 0!=(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.de)return!1;let t=sw(e),[r,n]=sb(t);for(let e=0;e<this.hashCount;e++){let t=this.Re(r,n,e);if(!this.Ve(t))return!1}return!0}static create(e,t,r){let n=new Uint8Array(Math.ceil(e/8)),i=new s_(n,e%8==0?0:8-e%8,t);return r.forEach(e=>i.insert(e)),i}insert(e){if(0===this.de)return;let t=sw(e),[r,n]=sb(t);for(let e=0;e<this.hashCount;e++){let t=this.Re(r,n,e);this.me(t)}}me(e){this.bitmap[Math.floor(e/8)]|=1<<e%8}}class sE extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sT{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,sS.createSynthesizedTargetChangeForCurrentChange(e,t,r)),new sT(nf.min(),n,new nx(nc),iU,iK())}}class sS{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 sS(r,t,iK(),iK(),iK())}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sI{constructor(e,t,r,n){this.fe=e,this.removedTargetIds=t,this.key=r,this.ge=n}}class sk{constructor(e,t){this.targetId=e,this.pe=t}}class sC{constructor(e,t,r=nL.EMPTY_BYTE_STRING,n=null){this.state=e,this.targetIds=t,this.resumeToken=r,this.cause=n}}class sA{constructor(){this.ye=0,this.we=sR(),this.Se=nL.EMPTY_BYTE_STRING,this.be=!1,this.De=!0}get current(){return this.be}get resumeToken(){return this.Se}get ve(){return 0!==this.ye}get Ce(){return this.De}Fe(e){e.approximateByteSize()>0&&(this.De=!0,this.Se=e)}Me(){let e=iK(),t=iK(),r=iK();return this.we.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:r5()}}),new sS(this.Se,this.be,e,t,r)}xe(){this.De=!1,this.we=sR()}Oe(e,t){this.De=!0,this.we=this.we.insert(e,t)}Ne(e){this.De=!0,this.we=this.we.remove(e)}Be(){this.ye+=1}Le(){this.ye-=1}ke(){this.De=!0,this.be=!0}}class sx{constructor(e){this.qe=e,this.Qe=new Map,this.Ke=iU,this.$e=sO(),this.Ue=new nx(nc)}We(e){for(let t of e.fe)e.ge&&e.ge.isFoundDocument()?this.Ge(t,e.ge):this.ze(t,e.key,e.ge);for(let t of e.removedTargetIds)this.ze(t,e.key,e.ge)}je(e){this.forEachTarget(e,t=>{let r=this.He(t);switch(e.state){case 0:this.Je(t)&&r.Fe(e.resumeToken);break;case 1:r.Le(),r.ve||r.xe(),r.Fe(e.resumeToken);break;case 2:r.Le(),r.ve||this.removeTarget(t);break;case 3:this.Je(t)&&(r.ke(),r.Fe(e.resumeToken));break;case 4:this.Je(t)&&(this.Ye(t),r.Fe(e.resumeToken));break;default:r5()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Qe.forEach((e,r)=>{this.Je(r)&&t(r)})}Ze(e){var t,r;let n=e.targetId,i=e.pe.count,s=this.Xe(n);if(s){let a=s.target;if(iE(a)){if(0===i){let e=new nv(a.path);this.ze(n,e,n8.newNoDocument(e,nf.min()))}else 1===i||r5()}else{let s=this.et(n);if(s!==i){let i=this.tt(e,s);if(0!==i.status){this.Ye(n);let e=2===i.status?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ue=this.Ue.insert(n,e)}null===(t=sg.instance)||void 0===t||t.notifyOnExistenceFilterMismatch(function(e,t,r,n){var i,s,a,o,l,u;let c={localCacheCount:r,existenceFilterCount:n.count},h=n.unchangedNames;return h&&(c.bloomFilter={applied:0===e,hashCount:null!==(i=null==h?void 0:h.hashCount)&&void 0!==i?i:0,bitmapLength:null!==(o=null===(a=null===(s=null==h?void 0:h.bits)||void 0===s?void 0:s.bitmap)||void 0===a?void 0:a.length)&&void 0!==o?o:0,padding:null!==(u=null===(l=null==h?void 0:h.bits)||void 0===l?void 0:l.padding)&&void 0!==u?u:0},t&&(c.bloomFilter.mightContain=t)),c}(i.status,null!==(r=i.nt)&&void 0!==r?r:null,s,e.pe))}}}}tt(e,t){let r,n;let{unchangedNames:i,count:s}=e.pe;if(!i||!i.bits)return{status:1};let{bits:{bitmap:a="",padding:o=0},hashCount:l=0}=i;try{r=nV(a).toUint8Array()}catch(e){if(e instanceof nM)return r9("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),{status:1};throw e}try{n=new s_(r,o,l)}catch(e){return r9(e instanceof sE?"BloomFilter error: ":"Applying bloom filter failed: ",e),{status:1}}let u=e=>{let t=this.qe.rt();return n.mightContain(`projects/${t.projectId}/databases/${t.database}/documents/${e}`)};return 0===n.de?{status:1}:{status:s===t-this.it(e.targetId,u)?0:2,nt:u}}it(e,t){let r=this.qe.getRemoteKeysForTarget(e),n=0;return r.forEach(r=>{t(r.path.canonicalString())||(this.ze(e,r,null),n++)}),n}st(e){let t=new Map;this.Qe.forEach((r,n)=>{let i=this.Xe(n);if(i){if(r.current&&iE(i.target)){let t=new nv(i.target.path);null!==this.Ke.get(t)||this.ot(n,t)||this.ze(n,t,n8.newNoDocument(t,e))}r.Ce&&(t.set(n,r.Me()),r.xe())}});let r=iK();this.$e.forEach((e,t)=>{let n=!0;t.forEachWhile(e=>{let t=this.Xe(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(n=!1,!1)}),n&&(r=r.add(e))}),this.Ke.forEach((t,r)=>r.setReadTime(e));let n=new sT(e,t,this.Ue,this.Ke,r);return this.Ke=iU,this.$e=sO(),this.Ue=new nx(nc),n}Ge(e,t){if(!this.Je(e))return;let r=this.ot(e,t.key)?2:0;this.He(e).Oe(t.key,r),this.Ke=this.Ke.insert(t.key,t),this.$e=this.$e.insert(t.key,this._t(t.key).add(e))}ze(e,t,r){if(!this.Je(e))return;let n=this.He(e);this.ot(e,t)?n.Oe(t,1):n.Ne(t),this.$e=this.$e.insert(t,this._t(t).delete(e)),r&&(this.Ke=this.Ke.insert(t,r))}removeTarget(e){this.Qe.delete(e)}et(e){let t=this.He(e).Me();return this.qe.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Be(e){this.He(e).Be()}He(e){let t=this.Qe.get(e);return t||(t=new sA,this.Qe.set(e,t)),t}_t(e){let t=this.$e.get(e);return t||(t=new nN(nc),this.$e=this.$e.insert(e,t)),t}Je(e){let t=null!==this.Xe(e);return t||r4("WatchChangeAggregator","Detected inactive target",e),t}Xe(e){let t=this.Qe.get(e);return t&&t.ve?null:this.qe.ut(e)}Ye(e){this.Qe.set(e,new sA),this.qe.getRemoteKeysForTarget(e).forEach(t=>{this.ze(e,t,null)})}ot(e,t){return this.qe.getRemoteKeysForTarget(e).has(t)}}function sO(){return new nx(nv.comparator)}function sR(){return new nx(nv.comparator)}let sN={asc:"ASCENDING",desc:"DESCENDING"},sD={"<":"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"},sP={and:"AND",or:"OR"};class sM{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function sL(e,t){return e.useProto3Json||null==t?t:{value:t}}function sF(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 sj(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function sU(e){return e||r5(),nf.fromTimestamp(function(e){let t=nj(e);return new nd(t.seconds,t.nanos)}(e))}function sV(e,t){return new nm(["projects",e.projectId,"databases",e.database]).child("documents").child(t).canonicalString()}function s$(e){let t=nm.fromString(e);return sJ(t)||r5(),t}function sq(e,t){return sV(e.databaseId,t.path)}function sz(e,t){let r=s$(t);if(r.get(1)!==e.databaseId.projectId)throw new r7(r8.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 r7(r8.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+e.databaseId.database);return new nv(sK(r))}function sB(e,t){return sV(e.databaseId,t)}function sH(e){return new nm(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function sK(e){return e.length>4&&"documents"===e.get(4)||r5(),e.popFirst(5)}function sG(e,t,r){return{name:sq(e,t),fields:r.value.mapValue.fields}}function sW(e){return{fieldPath:e.canonicalString()}}function sQ(e){return ny.fromServerFormat(e.fieldPath)}function sJ(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sY{constructor(e,t,r,n,i=nf.min(),s=nf.min(),a=nL.EMPTY_BYTE_STRING,o=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=n,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=o}withSequenceNumber(e){return new sY(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new sY(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new sY(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new sY(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sX{constructor(e){this.ct=e}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sZ{constructor(){}Pt(e,t){this.It(e,t),t.Tt()}It(e,t){if("nullValue"in e)this.Et(t,5);else if("booleanValue"in e)this.Et(t,10),t.dt(e.booleanValue?1:0);else if("integerValue"in e)this.Et(t,15),t.dt(nU(e.integerValue));else if("doubleValue"in e){let r=nU(e.doubleValue);isNaN(r)?this.Et(t,13):(this.Et(t,15),nI(r)?t.dt(0):t.dt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.Et(t,20),"string"==typeof r?t.At(r):(t.At(`${r.seconds||""}`),t.dt(r.nanos||0))}else if("stringValue"in e)this.Rt(e.stringValue,t),this.Vt(t);else if("bytesValue"in e)this.Et(t,30),t.ft(nV(e.bytesValue)),this.Vt(t);else if("referenceValue"in e)this.gt(e.referenceValue,t);else if("geoPointValue"in e){let r=e.geoPointValue;this.Et(t,45),t.dt(r.latitude||0),t.dt(r.longitude||0)}else"mapValue"in e?n3(e)?this.Et(t,Number.MAX_SAFE_INTEGER):(this.yt(e.mapValue,t),this.Vt(t)):"arrayValue"in e?(this.wt(e.arrayValue,t),this.Vt(t)):r5()}Rt(e,t){this.Et(t,25),this.St(e,t)}St(e,t){t.At(e)}yt(e,t){let r=e.fields||{};for(let e of(this.Et(t,55),Object.keys(r)))this.Rt(e,t),this.It(r[e],t)}wt(e,t){let r=e.values||[];for(let e of(this.Et(t,50),r))this.It(e,t)}gt(e,t){this.Et(t,37),nv.fromName(e).path.forEach(e=>{this.Et(t,60),this.St(e,t)})}Et(e,t){e.dt(t)}Vt(e){e.dt(2)}}sZ.bt=new sZ;/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s0{constructor(){this.sn=new s1}addToCollectionParentIndex(e,t){return this.sn.add(t),nE.resolve()}getCollectionParents(e,t){return nE.resolve(this.sn.getEntries(t))}addFieldIndex(e,t){return nE.resolve()}deleteFieldIndex(e,t){return nE.resolve()}getDocumentsMatchingTarget(e,t){return nE.resolve(null)}getIndexType(e,t){return nE.resolve(0)}getFieldIndexes(e,t){return nE.resolve([])}getNextCollectionGroupToUpdate(e){return nE.resolve(null)}getMinOffset(e,t){return nE.resolve(nw.min())}getMinOffsetFromCollectionGroup(e,t){return nE.resolve(nw.min())}updateCollectionGroup(e,t,r){return nE.resolve()}updateIndexEntries(e,t){return nE.resolve()}}class s1{constructor(){this.index={}}add(e){let t=e.lastSegment(),r=e.popLast(),n=this.index[t]||new nN(nm.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 nN(nm.comparator)).toArray()}}new Uint8Array(0);class s2{constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=r}static withCacheSize(e){return new s2(e,s2.DEFAULT_COLLECTION_PERCENTILE,s2.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */s2.DEFAULT_COLLECTION_PERCENTILE=10,s2.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,s2.DEFAULT=new s2(41943040,s2.DEFAULT_COLLECTION_PERCENTILE,s2.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),s2.DISABLED=new s2(-1,0,0);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s4{constructor(e){this.Mn=e}next(){return this.Mn+=2,this.Mn}static xn(){return new s4(0)}static On(){return new s4(-1)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s6{constructor(){this.changes=new ij(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,n8.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let r=this.changes.get(t);return void 0!==r?nE.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(){}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s9{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s3{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&&sr(r.mutation,e,nP.empty(),nd.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,iK()).next(()=>t))}getLocalViewOfDocuments(e,t,r=iK()){let n=iz();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,r).next(e=>{let t=i$();return e.forEach((e,r)=>{t=t.insert(e,r.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){let r=iz();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,iK()))}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=iU,s=iz(),a=iz();return t.forEach((e,t)=>{let a=r.get(t.key);n.has(t.key)&&(void 0===a||a.mutation instanceof ss)?i=i.insert(t.key,t):void 0!==a?(s.set(t.key,a.mutation.getFieldMask()),sr(a.mutation,t,a.mutation.getFieldMask(),nd.now())):s.set(t.key,nP.empty())}),this.recalculateAndSaveOverlays(e,i).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>{var r;return a.set(e,new s9(t,null!==(r=s.get(e))&&void 0!==r?r:null))}),a))}recalculateAndSaveOverlays(e,t){let r=iz(),n=new nx((e,t)=>e-t),i=iK();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 a=r.get(e)||nP.empty();a=i.applyToLocalView(s,a),r.set(e,a);let o=(n.get(i.batchId)||iK()).add(e);n=n.insert(i.batchId,o)})}).next(()=>{let s=[],a=n.getReverseIterator();for(;a.hasNext();){let n=a.getNext(),o=n.key,l=n.value,u=iz();l.forEach(e=>{if(!i.has(e)){let n=st(t.get(e),r.get(e));null!==n&&u.set(e,n),i=i.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,o,u))}return nE.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,r){return nv.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):iA(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r):this.getDocumentsMatchingCollectionQuery(e,t,r)}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):nE.resolve(iz()),a=-1,o=i;return s.next(t=>nE.forEach(t,(t,r)=>(a<r.largestBatchId&&(a=r.largestBatchId),i.get(t)?nE.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,i)).next(()=>this.computeViews(e,o,t,iK())).next(e=>({batchId:a,changes:iq(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new nv(t)).next(e=>{let t=i$();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,r){let n=t.collectionGroup,i=i$();return this.indexManager.getCollectionParents(e,n).next(s=>nE.forEach(s,s=>{var a;let o=(a=s.child(n),new iT(a,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt));return this.getDocumentsMatchingCollectionQuery(e,o,r).next(e=>{e.forEach((e,t)=>{i=i.insert(e,t)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,t,r){let n;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(i=>(n=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,n))).next(e=>{n.forEach((t,r)=>{let n=r.getKey();null===e.get(n)&&(e=e.insert(n,n8.newInvalidDocument(n)))});let r=i$();return e.forEach((e,i)=>{let s=n.get(e);void 0!==s&&sr(s.mutation,i,nP.empty(),nd.now()),iL(t,i)&&(r=r.insert(e,i))}),r})}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s5{constructor(e){this.serializer=e,this.ar=new Map,this.ur=new Map}getBundleMetadata(e,t){return nE.resolve(this.ar.get(t))}saveBundleMetadata(e,t){return this.ar.set(t.id,{id:t.id,version:t.version,createTime:sU(t.createTime)}),nE.resolve()}getNamedQuery(e,t){return nE.resolve(this.ur.get(t))}saveNamedQuery(e,t){return this.ur.set(t.name,{name:t.name,query:function(e){let t=function(e){var t,r,n,i,s,a,o,l;let u,c=function(e){let t=s$(e);return 4===t.length?nm.emptyPath():sK(t)}(e.parent),h=e.structuredQuery,d=h.from?h.from.length:0,f=null;if(d>0){1===d||r5();let e=h.from[0];e.allDescendants?f=e.collectionId:c=c.child(e.collectionId)}let p=[];h.where&&(p=function(e){var t;let r=function e(t){return void 0!==t.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":let t=sQ(e.unaryFilter.field);return is.create(t,"==",{doubleValue:NaN});case"IS_NULL":let r=sQ(e.unaryFilter.field);return is.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let n=sQ(e.unaryFilter.field);return is.create(n,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let i=sQ(e.unaryFilter.field);return is.create(i,"!=",{nullValue:"NULL_VALUE"});default:return r5()}}(t):void 0!==t.fieldFilter?is.create(sQ(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";default:return r5()}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==t.compositeFilter?ia.create(t.compositeFilter.filters.map(t=>e(t)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return r5()}}(t.compositeFilter.op)):r5()}(e);return r instanceof ia&&il(t=r)&&io(t)?r.getFilters():[r]}(h.where));let m=[];h.orderBy&&(m=h.orderBy.map(e=>new ir(sQ(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))));let g=null;h.limit&&(g=null==(u="object"==typeof(t=h.limit)?t.value:t)?null:u);let y=null;h.startAt&&(y=function(e){let t=!!e.before,r=e.values||[];return new n7(r,t)}(h.startAt));let v=null;return h.endAt&&(v=function(e){let t=!e.before,r=e.values||[];return new n7(r,t)}(h.endAt)),r=c,n=f,i=m,s=p,a=g,o=y,l=v,new iT(r,n,i,s,a,"F",o,l)}({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?iN(t,t.limit,"L"):t}(t.bundledQuery),readTime:sU(t.readTime)}),nE.resolve()}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s8{constructor(){this.overlays=new nx(nv.comparator),this.cr=new Map}getOverlay(e,t){return nE.resolve(this.overlays.get(t))}getOverlays(e,t){let r=iz();return nE.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.ht(e,t,n)}),nE.resolve()}removeOverlaysForBatchId(e,t,r){let n=this.cr.get(r);return void 0!==n&&(n.forEach(e=>this.overlays=this.overlays.remove(e)),this.cr.delete(r)),nE.resolve()}getOverlaysForCollection(e,t,r){let n=iz(),i=t.length+1,s=new nv(t.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){let e=a.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===i&&e.largestBatchId>r&&n.set(e.getKey(),e)}return nE.resolve(n)}getOverlaysForCollectionGroup(e,t,r,n){let i=new nx((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=iz(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}let a=iz(),o=i.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>a.set(e,t)),!(a.size()>=n)););return nE.resolve(a)}ht(e,t,r){let n=this.overlays.get(r.key);if(null!==n){let e=this.cr.get(n.largestBatchId).delete(r.key);this.cr.set(n.largestBatchId,e)}this.overlays=this.overlays.insert(r.key,new sf(t,r));let i=this.cr.get(t);void 0===i&&(i=iK(),this.cr.set(t,i)),this.cr.set(t,i.add(r.key))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s7{constructor(){this.lr=new nN(ae.hr),this.Pr=new nN(ae.Ir)}isEmpty(){return this.lr.isEmpty()}addReference(e,t){let r=new ae(e,t);this.lr=this.lr.add(r),this.Pr=this.Pr.add(r)}Tr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Er(new ae(e,t))}dr(e,t){e.forEach(e=>this.removeReference(e,t))}Ar(e){let t=new nv(new nm([])),r=new ae(t,e),n=new ae(t,e+1),i=[];return this.Pr.forEachInRange([r,n],e=>{this.Er(e),i.push(e.key)}),i}Rr(){this.lr.forEach(e=>this.Er(e))}Er(e){this.lr=this.lr.delete(e),this.Pr=this.Pr.delete(e)}Vr(e){let t=new nv(new nm([])),r=new ae(t,e),n=new ae(t,e+1),i=iK();return this.Pr.forEachInRange([r,n],e=>{i=i.add(e.key)}),i}containsKey(e){let t=new ae(e,0),r=this.lr.firstAfterOrEqual(t);return null!==r&&e.isEqual(r.key)}}class ae{constructor(e,t){this.key=e,this.mr=t}static hr(e,t){return nv.comparator(e.key,t.key)||nc(e.mr,t.mr)}static Ir(e,t){return nc(e.mr,t.mr)||nv.comparator(e.key,t.key)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class at{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.gr=1,this.pr=new nN(ae.hr)}checkEmpty(e){return nE.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,r,n){let i=this.gr;this.gr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let s=new sh(i,t,r,n);for(let t of(this.mutationQueue.push(s),n))this.pr=this.pr.add(new ae(t.key,i)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return nE.resolve(s)}lookupMutationBatch(e,t){return nE.resolve(this.yr(t))}getNextMutationBatchAfterBatchId(e,t){let r=this.wr(t+1),n=r<0?0:r;return nE.resolve(this.mutationQueue.length>n?this.mutationQueue[n]:null)}getHighestUnacknowledgedBatchId(){return nE.resolve(0===this.mutationQueue.length?-1:this.gr-1)}getAllMutationBatches(e){return nE.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let r=new ae(t,0),n=new ae(t,Number.POSITIVE_INFINITY),i=[];return this.pr.forEachInRange([r,n],e=>{let t=this.yr(e.mr);i.push(t)}),nE.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new nN(nc);return t.forEach(e=>{let t=new ae(e,0),n=new ae(e,Number.POSITIVE_INFINITY);this.pr.forEachInRange([t,n],e=>{r=r.add(e.mr)})}),nE.resolve(this.Sr(r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,n=r.length+1,i=r;nv.isDocumentKey(i)||(i=i.child(""));let s=new ae(new nv(i),0),a=new nN(nc);return this.pr.forEachWhile(e=>{let t=e.key.path;return!!r.isPrefixOf(t)&&(t.length===n&&(a=a.add(e.mr)),!0)},s),nE.resolve(this.Sr(a))}Sr(e){let t=[];return e.forEach(e=>{let r=this.yr(e);null!==r&&t.push(r)}),t}removeMutationBatch(e,t){0===this.br(t.batchId,"removed")||r5(),this.mutationQueue.shift();let r=this.pr;return nE.forEach(t.mutations,n=>{let i=new ae(n.key,t.batchId);return r=r.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,n.key)}).next(()=>{this.pr=r})}Cn(e){}containsKey(e,t){let r=new ae(t,0),n=this.pr.firstAfterOrEqual(r);return nE.resolve(t.isEqual(n&&n.key))}performConsistencyCheck(e){return this.mutationQueue.length,nE.resolve()}br(e,t){return this.wr(e)}wr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}yr(e){let t=this.wr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ar{constructor(e){this.Dr=e,this.docs=new nx(nv.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.Dr(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 nE.resolve(r?r.document.mutableCopy():n8.newInvalidDocument(t))}getEntries(e,t){let r=iU;return t.forEach(e=>{let t=this.docs.get(e);r=r.insert(e,t?t.document.mutableCopy():n8.newInvalidDocument(e))}),nE.resolve(r)}getDocumentsMatchingQuery(e,t,r,n){let i=iU,s=t.path,a=new nv(s.child("")),o=this.docs.getIteratorFrom(a);for(;o.hasNext();){let{key:e,value:{document:a}}=o.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||0>=function(e,t){let r=e.readTime.compareTo(t.readTime);return 0!==r?r:0!==(r=nv.comparator(e.documentKey,t.documentKey))?r:nc(e.largestBatchId,t.largestBatchId)}(new nw(a.readTime,a.key,-1),r)||(n.has(a.key)||iL(t,a))&&(i=i.insert(a.key,a.mutableCopy()))}return nE.resolve(i)}getAllFromCollectionGroup(e,t,r,n){r5()}vr(e,t){return nE.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new an(this)}getSize(e){return nE.resolve(this.size)}}class an extends s6{constructor(e){super(),this.sr=e}applyChanges(e){let t=[];return this.changes.forEach((r,n)=>{n.isValidDocument()?t.push(this.sr.addEntry(e,n)):this.sr.removeEntry(r)}),nE.waitFor(t)}getFromCache(e,t){return this.sr.getEntry(e,t)}getAllFromCache(e,t){return this.sr.getEntries(e,t)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ai{constructor(e){this.persistence=e,this.Cr=new ij(e=>ib(e),i_),this.lastRemoteSnapshotVersion=nf.min(),this.highestTargetId=0,this.Fr=0,this.Mr=new s7,this.targetCount=0,this.Or=s4.xn()}forEachTarget(e,t){return this.Cr.forEach((e,r)=>t(r)),nE.resolve()}getLastRemoteSnapshotVersion(e){return nE.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return nE.resolve(this.Fr)}allocateTargetId(e){return this.highestTargetId=this.Or.next(),nE.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.Fr&&(this.Fr=t),nE.resolve()}Ln(e){this.Cr.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.Or=new s4(t),this.highestTargetId=t),e.sequenceNumber>this.Fr&&(this.Fr=e.sequenceNumber)}addTargetData(e,t){return this.Ln(t),this.targetCount+=1,nE.resolve()}updateTargetData(e,t){return this.Ln(t),nE.resolve()}removeTargetData(e,t){return this.Cr.delete(t.target),this.Mr.Ar(t.targetId),this.targetCount-=1,nE.resolve()}removeTargets(e,t,r){let n=0,i=[];return this.Cr.forEach((s,a)=>{a.sequenceNumber<=t&&null===r.get(a.targetId)&&(this.Cr.delete(s),i.push(this.removeMatchingKeysForTargetId(e,a.targetId)),n++)}),nE.waitFor(i).next(()=>n)}getTargetCount(e){return nE.resolve(this.targetCount)}getTargetData(e,t){let r=this.Cr.get(t)||null;return nE.resolve(r)}addMatchingKeys(e,t,r){return this.Mr.Tr(t,r),nE.resolve()}removeMatchingKeys(e,t,r){this.Mr.dr(t,r);let n=this.persistence.referenceDelegate,i=[];return n&&t.forEach(t=>{i.push(n.markPotentiallyOrphaned(e,t))}),nE.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.Mr.Ar(t),nE.resolve()}getMatchingKeysForTargetId(e,t){let r=this.Mr.Vr(t);return nE.resolve(r)}containsKey(e,t){return nE.resolve(this.Mr.containsKey(t))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class as{constructor(e,t){this.Nr={},this.overlays={},this.Br=new nS(0),this.Lr=!1,this.Lr=!0,this.referenceDelegate=e(this),this.kr=new ai(this),this.indexManager=new s0,this.remoteDocumentCache=new ar(e=>this.referenceDelegate.qr(e)),this.serializer=new sX(t),this.Qr=new s5(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Lr=!1,Promise.resolve()}get started(){return this.Lr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new s8,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.Nr[e.toKey()];return r||(r=new at(t,this.referenceDelegate),this.Nr[e.toKey()]=r),r}getTargetCache(){return this.kr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Qr}runTransaction(e,t,r){r4("MemoryPersistence","Starting transaction:",e);let n=new aa(this.Br.next());return this.referenceDelegate.Kr(),r(n).next(e=>this.referenceDelegate.$r(n).next(()=>e)).toPromise().then(e=>(n.raiseOnCommittedEvent(),e))}Ur(e,t){return nE.or(Object.values(this.Nr).map(r=>()=>r.containsKey(e,t)))}}class aa extends nb{constructor(e){super(),this.currentSequenceNumber=e}}class ao{constructor(e){this.persistence=e,this.Wr=new s7,this.Gr=null}static zr(e){return new ao(e)}get jr(){if(this.Gr)return this.Gr;throw r5()}addReference(e,t,r){return this.Wr.addReference(r,t),this.jr.delete(r.toString()),nE.resolve()}removeReference(e,t,r){return this.Wr.removeReference(r,t),this.jr.add(r.toString()),nE.resolve()}markPotentiallyOrphaned(e,t){return this.jr.add(t.toString()),nE.resolve()}removeTarget(e,t){this.Wr.Ar(t.targetId).forEach(e=>this.jr.add(e.toString()));let r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.jr.add(e.toString()))}).next(()=>r.removeTargetData(e,t))}Kr(){this.Gr=new Set}$r(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return nE.forEach(this.jr,r=>{let n=nv.fromPath(r);return this.Hr(e,n).next(e=>{e||t.removeEntry(n,nf.min())})}).next(()=>(this.Gr=null,t.apply(e)))}updateLimboDocument(e,t){return this.Hr(e,t).next(e=>{e?this.jr.delete(t.toString()):this.jr.add(t.toString())})}qr(e){return 0}Hr(e,t){return nE.or([()=>nE.resolve(this.Wr.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ur(e,t)])}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class al{constructor(e,t,r,n){this.targetId=e,this.fromCache=t,this.Li=r,this.ki=n}static qi(e,t){let r=iK(),n=iK();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 al(e,t.fromCache,r,n)}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class au{constructor(){this.Qi=!1}initialize(e,t){this.Ki=e,this.indexManager=t,this.Qi=!0}getDocumentsMatchingQuery(e,t,r,n){return this.$i(e,t).next(i=>i||this.Ui(e,t,n,r)).next(r=>r||this.Wi(e,t))}$i(e,t){if(iI(t))return nE.resolve(null);let r=iO(t);return this.indexManager.getIndexType(e,r).next(n=>0===n?null:(null!==t.limit&&1===n&&(r=iO(t=iN(t,null,"F"))),this.indexManager.getDocumentsMatchingTarget(e,r).next(n=>{let i=iK(...n);return this.Ki.getDocuments(e,i).next(n=>this.indexManager.getMinOffset(e,r).next(r=>{let s=this.Gi(t,n);return this.zi(t,s,i,r.readTime)?this.$i(e,iN(t,null,"F")):this.ji(e,s,t,r)}))})))}Ui(e,t,r,n){return iI(t)||n.isEqual(nf.min())?this.Wi(e,t):this.Ki.getDocuments(e,r).next(i=>{let s=this.Gi(t,i);return this.zi(t,s,r,n)?this.Wi(e,t):(r2()<=d.in.DEBUG&&r4("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),iM(t)),this.ji(e,s,t,function(e,t){let r=e.toTimestamp().seconds,n=e.toTimestamp().nanoseconds+1,i=nf.fromTimestamp(1e9===n?new nd(r+1,0):new nd(r,n));return new nw(i,nv.empty(),-1)}(n,0)))})}Gi(e,t){let r=new nN(iF(e));return t.forEach((t,n)=>{iL(e,n)&&(r=r.add(n))}),r}zi(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)}Wi(e,t){return r2()<=d.in.DEBUG&&r4("QueryEngine","Using full collection scan to execute query:",iM(t)),this.Ki.getDocumentsMatchingQuery(e,t,nw.min())}ji(e,t,r,n){return this.Ki.getDocumentsMatchingQuery(e,r,n).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ac{constructor(e,t,r,n){this.persistence=e,this.Hi=t,this.serializer=n,this.Ji=new nx(nc),this.Yi=new ij(e=>ib(e),i_),this.Zi=new Map,this.Xi=e.getRemoteDocumentCache(),this.kr=e.getTargetCache(),this.Qr=e.getBundleCache(),this.es(r)}es(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new s3(this.Xi,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Xi.setIndexManager(this.indexManager),this.Hi.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ji))}}async function ah(e,t){return await e.persistence.runTransaction("Handle user change","readonly",r=>{let n;return e.mutationQueue.getAllMutationBatches(r).next(i=>(n=i,e.es(t),e.mutationQueue.getAllMutationBatches(r))).next(t=>{let i=[],s=[],a=iK();for(let e of n)for(let t of(i.push(e.batchId),e.mutations))a=a.add(t.key);for(let e of t)for(let t of(s.push(e.batchId),e.mutations))a=a.add(t.key);return e.localDocuments.getDocuments(r,a).next(e=>({ts:e,removedBatchIds:i,addedBatchIds:s}))})})}function ad(e){return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.kr.getLastRemoteSnapshotVersion(t))}async function af(e,t,r){let n=e.Ji.get(t);try{r||await e.persistence.runTransaction("Release target",r?"readwrite":"readwrite-primary",t=>e.persistence.referenceDelegate.removeTarget(t,n))}catch(e){if(!nT(e))throw e;r4("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}e.Ji=e.Ji.remove(t),e.Yi.delete(n.target)}function ap(e,t,r){let n=nf.min(),i=iK();return e.persistence.runTransaction("Execute query","readonly",s=>(function(e,t,r){let n=e.Yi.get(r);return void 0!==n?nE.resolve(e.Ji.get(n)):e.kr.getTargetData(t,r)})(e,s,iO(t)).next(t=>{if(t)return n=t.lastLimboFreeSnapshotVersion,e.kr.getMatchingKeysForTargetId(s,t.targetId).next(e=>{i=e})}).next(()=>e.Hi.getDocumentsMatchingQuery(s,t,r?n:nf.min(),r?i:iK())).next(r=>{var n;let s;return n=t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2)),s=e.Zi.get(n)||nf.min(),r.forEach((e,t)=>{t.readTime.compareTo(s)>0&&(s=t.readTime)}),e.Zi.set(n,s),{documents:r,ss:i}}))}class am{constructor(){this.activeTargetIds=iG}hs(e){this.activeTargetIds=this.activeTargetIds.add(e)}Ps(e){this.activeTargetIds=this.activeTargetIds.delete(e)}ls(){let e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class ag{constructor(){this.Hs=new am,this.Js={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e){return this.Hs.hs(e),this.Js[e]||"not-current"}updateQueryState(e,t,r){this.Js[e]=t}removeLocalQueryTarget(e){this.Hs.Ps(e)}isLocalQueryTarget(e){return this.Hs.activeTargetIds.has(e)}clearQueryState(e){delete this.Js[e]}getAllActiveQueryTargets(){return this.Hs.activeTargetIds}isActiveQueryTarget(e){return this.Hs.activeTargetIds.has(e)}start(){return this.Hs=new am,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ay{Ys(e){}shutdown(){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class av{constructor(){this.Zs=()=>this.Xs(),this.eo=()=>this.no(),this.ro=[],this.io()}Ys(e){this.ro.push(e)}shutdown(){window.removeEventListener("online",this.Zs),window.removeEventListener("offline",this.eo)}io(){window.addEventListener("online",this.Zs),window.addEventListener("offline",this.eo)}Xs(){for(let e of(r4("ConnectivityMonitor","Network connectivity changed: AVAILABLE"),this.ro))e(0)}no(){for(let e of(r4("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE"),this.ro))e(1)}static v(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let aw=null;function ab(){return null===aw?aw=268435456+Math.round(2147483648*Math.random()):aw++,"0x"+aw.toString(16)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let a_={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aE{constructor(e){this.so=e.so,this.oo=e.oo}_o(e){this.ao=e}uo(e){this.co=e}onMessage(e){this.lo=e}close(){this.oo()}send(e){this.so(e)}ho(){this.ao()}Po(e){this.co(e)}Io(e){this.lo(e)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let aT="WebChannelConnection";class aS extends class{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.To=t+"://"+e.host,this.Eo=`projects/${r}/databases/${n}`,this.Ao="(default)"===this.databaseId.database?`project_id=${r}`:`project_id=${r}&database_id=${n}`}get Ro(){return!1}Vo(e,t,r,n,i){let s=ab(),a=this.mo(e,t);r4("RestConnection",`Sending RPC '${e}' ${s}:`,a,r);let o={"google-cloud-resource-prefix":this.Eo,"x-goog-request-params":this.Ao};return this.fo(o,n,i),this.po(e,a,o,r).then(t=>(r4("RestConnection",`Received RPC '${e}' ${s}: `,t),t),t=>{throw r9("RestConnection",`RPC '${e}' ${s} failed with error: `,t,"url: ",a,"request:",r),t})}yo(e,t,r,n,i,s){return this.Vo(e,t,r,n,i)}fo(e,t,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+r0}(),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)}mo(e,t){let r=a_[e];return`${this.To}/v1/${t}:${r}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}po(e,t,r,n){let i=ab();return new Promise((s,a)=>{let o=new rQ;o.setWithCredentials(!0),o.listenOnce(rB.COMPLETE,()=>{try{switch(o.getLastErrorCode()){case rz.NO_ERROR:let t=o.getResponseJson();r4(aT,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),s(t);break;case rz.TIMEOUT:r4(aT,`RPC '${e}' ${i} timed out`),a(new r7(r8.DEADLINE_EXCEEDED,"Request time out"));break;case rz.HTTP_ERROR:let r=o.getStatus();if(r4(aT,`RPC '${e}' ${i} failed with status:`,r,"response text:",o.getResponseText()),r>0){let e=o.getResponseJson();Array.isArray(e)&&(e=e[0]);let t=null==e?void 0:e.error;if(t&&t.status&&t.message){let e=function(e){let t=e.toLowerCase().replace(/_/g,"-");return Object.values(r8).indexOf(t)>=0?t:r8.UNKNOWN}(t.status);a(new r7(e,t.message))}else a(new r7(r8.UNKNOWN,"Server responded with status "+o.getStatus()))}else a(new r7(r8.UNAVAILABLE,"Connection failed."));break;default:r5()}}finally{r4(aT,`RPC '${e}' ${i} completed.`)}});let l=JSON.stringify(n);r4(aT,`RPC '${e}' ${i} sending request:`,n),o.send(t,"POST",l,r,15)})}wo(e,t,r){let n=ab(),i=[this.To,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=r$(),a=rq(),l={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},u=this.longPollingOptions.timeoutSeconds;void 0!==u&&(l.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(l.xmlHttpFactory=new rG({})),this.fo(l.initMessageHeaders,t,r),l.encodeInitMessageHeaders=!0;let c=i.join("");r4(aT,`Creating RPC '${e}' stream ${n}: ${c}`,l);let h=s.createWebChannel(c,l),d=!1,f=!1,p=new aE({so:t=>{f?r4(aT,`Not sending because RPC '${e}' stream ${n} is closed:`,t):(d||(r4(aT,`Opening RPC '${e}' stream ${n} transport.`),h.open(),d=!0),r4(aT,`RPC '${e}' stream ${n} sending:`,t),h.send(t))},oo:()=>h.close()}),m=(e,t,r)=>{e.listen(t,e=>{try{r(e)}catch(e){setTimeout(()=>{throw e},0)}})};return m(h,rW.EventType.OPEN,()=>{f||r4(aT,`RPC '${e}' stream ${n} transport opened.`)}),m(h,rW.EventType.CLOSE,()=>{f||(f=!0,r4(aT,`RPC '${e}' stream ${n} transport closed`),p.Po())}),m(h,rW.EventType.ERROR,t=>{f||(f=!0,r9(aT,`RPC '${e}' stream ${n} transport errored:`,t),p.Po(new r7(r8.UNAVAILABLE,"The operation could not be completed")))}),m(h,rW.EventType.MESSAGE,t=>{var r;if(!f){let i=t.data[0];i||r5();let s=i.error||(null===(r=i[0])||void 0===r?void 0:r.error);if(s){r4(aT,`RPC '${e}' stream ${n} received error:`,s);let t=s.status,r=function(e){let t=o[e];if(void 0!==t)return sm(t)}(t),i=s.message;void 0===r&&(r=r8.INTERNAL,i="Unknown error status: "+t+" with message "+s.message),f=!0,p.Po(new r7(r,i)),h.close()}else r4(aT,`RPC '${e}' stream ${n} received:`,i),p.Io(i)}}),m(a,rH.STAT_EVENT,t=>{t.stat===rK.PROXY?r4(aT,`RPC '${e}' stream ${n} detected buffering proxy`):t.stat===rK.NOPROXY&&r4(aT,`RPC '${e}' stream ${n} detected no buffering proxy`)}),setTimeout(()=>{p.ho()},0),p}}function aI(){return"undefined"!=typeof document?document:null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ak(e){return new sM(e,!0)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aC{constructor(e,t,r=1e3,n=1.5,i=6e4){this.ii=e,this.timerId=t,this.So=r,this.bo=n,this.Do=i,this.vo=0,this.Co=null,this.Fo=Date.now(),this.reset()}reset(){this.vo=0}Mo(){this.vo=this.Do}xo(e){this.cancel();let t=Math.floor(this.vo+this.Oo()),r=Math.max(0,Date.now()-this.Fo),n=Math.max(0,t-r);n>0&&r4("ExponentialBackoff",`Backing off for ${n} ms (base delay: ${this.vo} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.Co=this.ii.enqueueAfterDelay(this.timerId,n,()=>(this.Fo=Date.now(),e())),this.vo*=this.bo,this.vo<this.So&&(this.vo=this.So),this.vo>this.Do&&(this.vo=this.Do)}No(){null!==this.Co&&(this.Co.skipDelay(),this.Co=null)}cancel(){null!==this.Co&&(this.Co.cancel(),this.Co=null)}Oo(){return(Math.random()-.5)*this.vo}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aA{constructor(e,t,r,n,i,s,a,o){this.ii=e,this.Bo=r,this.Lo=n,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=o,this.state=0,this.ko=0,this.qo=null,this.Qo=null,this.stream=null,this.Ko=new aC(e,t)}$o(){return 1===this.state||5===this.state||this.Uo()}Uo(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.Wo()}async stop(){this.$o()&&await this.close(0)}Go(){this.state=0,this.Ko.reset()}zo(){this.Uo()&&null===this.qo&&(this.qo=this.ii.enqueueAfterDelay(this.Bo,6e4,()=>this.jo()))}Ho(e){this.Jo(),this.stream.send(e)}async jo(){if(this.Uo())return this.close(0)}Jo(){this.qo&&(this.qo.cancel(),this.qo=null)}Yo(){this.Qo&&(this.Qo.cancel(),this.Qo=null)}async close(e,t){this.Jo(),this.Yo(),this.Ko.cancel(),this.ko++,4!==e?this.Ko.reset():t&&t.code===r8.RESOURCE_EXHAUSTED?(r6(t.toString()),r6("Using maximum backoff delay to prevent overloading the backend."),this.Ko.Mo()):t&&t.code===r8.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.Zo(),this.stream.close(),this.stream=null),this.state=e,await this.listener.uo(t)}Zo(){}auth(){this.state=1;let e=this.Xo(this.ko),t=this.ko;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,r])=>{this.ko===t&&this.e_(e,r)},t=>{e(()=>{let e=new r7(r8.UNKNOWN,"Fetching auth token failed: "+t.message);return this.t_(e)})})}e_(e,t){let r=this.Xo(this.ko);this.stream=this.n_(e,t),this.stream._o(()=>{r(()=>(this.state=2,this.Qo=this.ii.enqueueAfterDelay(this.Lo,1e4,()=>(this.Uo()&&(this.state=3),Promise.resolve())),this.listener._o()))}),this.stream.uo(e=>{r(()=>this.t_(e))}),this.stream.onMessage(e=>{r(()=>this.onMessage(e))})}Wo(){this.state=5,this.Ko.xo(async()=>{this.state=0,this.start()})}t_(e){return r4("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}Xo(e){return t=>{this.ii.enqueueAndForget(()=>this.ko===e?t():(r4("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class ax extends aA{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=i}n_(e,t){return this.connection.wo("Listen",e,t)}onMessage(e){this.Ko.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:r5(),a=t.targetChange.targetIds||[],o=(i=t.targetChange.resumeToken,e.useProto3Json?(void 0===i||"string"==typeof i||r5(),nL.fromBase64String(i||"")):(void 0===i||i instanceof Uint8Array||r5(),nL.fromUint8Array(i||new Uint8Array))),l=t.targetChange.cause,u=l&&function(e){let t=void 0===e.code?r8.UNKNOWN:sm(e.code);return new r7(t,e.message||"")}(l);r=new sC(s,a,o,u||null)}else if("documentChange"in t){t.documentChange;let n=t.documentChange;n.document,n.document.name,n.document.updateTime;let i=sz(e,n.document.name),s=sU(n.document.updateTime),a=n.document.createTime?sU(n.document.createTime):nf.min(),o=new n5({mapValue:{fields:n.document.fields}}),l=n8.newFoundDocument(i,s,a,o),u=n.targetIds||[],c=n.removedTargetIds||[];r=new sI(u,c,l.key,l)}else if("documentDelete"in t){t.documentDelete;let n=t.documentDelete;n.document;let i=sz(e,n.document),s=n.readTime?sU(n.readTime):nf.min(),a=n8.newNoDocument(i,s),o=n.removedTargetIds||[];r=new sI([],o,a.key,a)}else if("documentRemove"in t){t.documentRemove;let n=t.documentRemove;n.document;let i=sz(e,n.document),s=n.removedTargetIds||[];r=new sI([],s,i,null)}else{if(!("filter"in t))return r5();{t.filter;let e=t.filter;e.targetId;let{count:n=0,unchangedNames:i}=e,s=new sp(n,i),a=e.targetId;r=new sk(a,s)}}return r}(this.serializer,e),r=function(e){if(!("targetChange"in e))return nf.min();let t=e.targetChange;return t.targetIds&&t.targetIds.length?nf.min():t.readTime?sU(t.readTime):nf.min()}(e);return this.listener.r_(t,r)}i_(e){let t={};t.database=sH(this.serializer),t.addTarget=function(e,t){let r;let n=t.target;if((r=iE(n)?{documents:{documents:[sB(e,n.path)]}}:{query:function(e,t){var r,n;let i={structuredQuery:{}},s=t.path;null!==t.collectionGroup?(i.parent=sB(e,s),i.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(i.parent=sB(e,s.popLast()),i.structuredQuery.from=[{collectionId:s.lastSegment()}]);let a=function(e){if(0!==e.length)return function e(t){return t instanceof is?function(e){if("=="===e.op){if(n4(e.value))return{unaryFilter:{field:sW(e.field),op:"IS_NAN"}};if(n2(e.value))return{unaryFilter:{field:sW(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(n4(e.value))return{unaryFilter:{field:sW(e.field),op:"IS_NOT_NAN"}};if(n2(e.value))return{unaryFilter:{field:sW(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:sW(e.field),op:sD[e.op],value:e.value}}}(t):t instanceof ia?function(t){let r=t.getFilters().map(t=>e(t));return 1===r.length?r[0]:{compositeFilter:{op:sP[t.op],filters:r}}}(t):r5()}(ia.create(e,"and"))}(t.filters);a&&(i.structuredQuery.where=a);let o=function(e){if(0!==e.length)return e.map(e=>({field:sW(e.field),direction:sN[e.dir]}))}(t.orderBy);o&&(i.structuredQuery.orderBy=o);let l=sL(e,t.limit);return null!==l&&(i.structuredQuery.limit=l),t.startAt&&(i.structuredQuery.startAt={before:(r=t.startAt).inclusive,values:r.position}),t.endAt&&(i.structuredQuery.endAt={before:!(n=t.endAt).inclusive,values:n.position}),i}(e,n)}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0){r.resumeToken=sj(e,t.resumeToken);let n=sL(e,t.expectedCount);null!==n&&(r.expectedCount=n)}else if(t.snapshotVersion.compareTo(nf.min())>0){r.readTime=sF(e,t.snapshotVersion.toTimestamp());let n=sL(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 r5()}}(t.purpose);return null==r?null:{"goog-listen-tags":r}}(this.serializer,e);r&&(t.labels=r),this.Ho(t)}s_(e){let t={};t.database=sH(this.serializer),t.removeTarget=e,this.Ho(t)}}class aO extends aA{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,this.o_=!1}get __(){return this.o_}start(){this.o_=!1,this.lastStreamToken=void 0,super.start()}Zo(){this.o_&&this.a_([])}n_(e,t){return this.connection.wo("Write",e,t)}onMessage(e){var t,r;if(e.streamToken||r5(),this.lastStreamToken=e.streamToken,this.o_){this.Ko.reset();let n=(t=e.writeResults,r=e.commitTime,t&&t.length>0?(void 0!==r||r5(),t.map(e=>{let t;return(t=e.updateTime?sU(e.updateTime):sU(r)).isEqual(nf.min())&&(t=sU(r)),new i5(t,e.transformResults||[])})):[]),i=sU(e.commitTime);return this.listener.u_(i,n)}return e.writeResults&&0!==e.writeResults.length&&r5(),this.o_=!0,this.listener.c_()}l_(){let e={};e.database=sH(this.serializer),this.Ho(e)}a_(e){let t={streamToken:this.lastStreamToken,writes:e.map(e=>(function(e,t){var r;let n;if(t instanceof si)n={update:sG(e,t.key,t.value)};else if(t instanceof su)n={delete:sq(e,t.key)};else if(t instanceof ss)n={update:sG(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 sc))return r5();n={verify:sq(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>(function(e,t){let r=t.transform;if(r instanceof iX)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(r instanceof iZ)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:r.elements}};if(r instanceof i1)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:r.elements}};if(r instanceof i4)return{fieldPath:t.field.canonicalString(),increment:r.Te};throw r5()})(0,e))),t.precondition.isNone||(n.currentDocument=void 0!==(r=t.precondition).updateTime?{updateTime:sF(e,r.updateTime.toTimestamp())}:void 0!==r.exists?{exists:r.exists}:r5()),n})(this.serializer,e))};this.Ho(t)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aR extends class{}{constructor(e,t,r,n){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=n,this.h_=!1}P_(){if(this.h_)throw new r7(r8.FAILED_PRECONDITION,"The client has already been terminated.")}Vo(e,t,r){return this.P_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([n,i])=>this.connection.Vo(e,t,r,n,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===r8.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new r7(r8.UNKNOWN,e.toString())})}yo(e,t,r,n){return this.P_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,s])=>this.connection.yo(e,t,r,i,s,n)).catch(e=>{throw"FirebaseError"===e.name?(e.code===r8.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new r7(r8.UNKNOWN,e.toString())})}terminate(){this.h_=!0}}class aN{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.T_=0,this.E_=null,this.d_=!0}A_(){0===this.T_&&(this.R_("Unknown"),this.E_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.E_=null,this.V_("Backend didn't respond within 10 seconds."),this.R_("Offline"),Promise.resolve())))}m_(e){"Online"===this.state?this.R_("Unknown"):(this.T_++,this.T_>=1&&(this.f_(),this.V_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.R_("Offline")))}set(e){this.f_(),this.T_=0,"Online"===e&&(this.d_=!1),this.R_(e)}R_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}V_(e){let t=`Could not reach Cloud Firestore backend. ${e}
This 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.d_?(r6(t),this.d_=!1):r4("OnlineStateTracker",t)}f_(){null!==this.E_&&(this.E_.cancel(),this.E_=null)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aD{constructor(e,t,r,n,i){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.g_=[],this.p_=new Map,this.y_=new Set,this.w_=[],this.S_=i,this.S_.Ys(e=>{r.enqueueAndForget(async()=>{aq(this)&&(r4("RemoteStore","Restarting streams for network reachability change."),await async function(e){e.y_.add(4),await aM(e),e.b_.set("Unknown"),e.y_.delete(4),await aP(e)}(this))})}),this.b_=new aN(r,n)}}async function aP(e){if(aq(e))for(let t of e.w_)await t(!0)}async function aM(e){for(let t of e.w_)await t(!1)}function aL(e,t){e.p_.has(t.targetId)||(e.p_.set(t.targetId,t),a$(e)?aV(e):a4(e).Uo()&&aj(e,t))}function aF(e,t){let r=a4(e);e.p_.delete(t),r.Uo()&&aU(e,t),0===e.p_.size&&(r.Uo()?r.zo():aq(e)&&e.b_.set("Unknown"))}function aj(e,t){if(e.D_.Be(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(nf.min())>0){let r=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(r)}a4(e).i_(t)}function aU(e,t){e.D_.Be(t),a4(e).s_(t)}function aV(e){e.D_=new sx({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),ut:t=>e.p_.get(t)||null,rt:()=>e.datastore.serializer.databaseId}),a4(e).start(),e.b_.A_()}function a$(e){return aq(e)&&!a4(e).$o()&&e.p_.size>0}function aq(e){return 0===e.y_.size}async function az(e){e.p_.forEach((t,r)=>{aj(e,t)})}async function aB(e,t){e.D_=void 0,a$(e)?(e.b_.m_(t),aV(e)):e.b_.set("Unknown")}async function aH(e,t,r){if(e.b_.set("Online"),t instanceof sC&&2===t.state&&t.cause)try{await async function(e,t){let r=t.cause;for(let n of t.targetIds)e.p_.has(n)&&(await e.remoteSyncer.rejectListen(n,r),e.p_.delete(n),e.D_.removeTarget(n))}(e,t)}catch(r){r4("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),r),await aK(e,r)}else if(t instanceof sI?e.D_.We(t):t instanceof sk?e.D_.Ze(t):e.D_.je(t),!r.isEqual(nf.min()))try{let t=await ad(e.localStore);r.compareTo(t)>=0&&await function(e,t){let r=e.D_.st(t);return r.targetChanges.forEach((r,n)=>{if(r.resumeToken.approximateByteSize()>0){let i=e.p_.get(n);i&&e.p_.set(n,i.withResumeToken(r.resumeToken,t))}}),r.targetMismatches.forEach((t,r)=>{let n=e.p_.get(t);if(!n)return;e.p_.set(t,n.withResumeToken(nL.EMPTY_BYTE_STRING,n.snapshotVersion)),aU(e,t);let i=new sY(n.target,t,r,n.sequenceNumber);aj(e,i)}),e.remoteSyncer.applyRemoteEvent(r)}(e,r)}catch(t){r4("RemoteStore","Failed to raise snapshot:",t),await aK(e,t)}}async function aK(e,t,r){if(!nT(t))throw t;e.y_.add(1),await aM(e),e.b_.set("Offline"),r||(r=()=>ad(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{r4("RemoteStore","Retrying IndexedDB access"),await r(),e.y_.delete(1),await aP(e)})}function aG(e,t){return t().catch(r=>aK(e,r,t))}async function aW(e){let t=a6(e),r=e.g_.length>0?e.g_[e.g_.length-1].batchId:-1;for(;aq(e)&&e.g_.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.g_.length&&t.zo();break}r=n.batchId,function(e,t){e.g_.push(t);let r=a6(e);r.Uo()&&r.__&&r.a_(t.mutations)}(e,n)}catch(t){await aK(e,t)}aQ(e)&&aJ(e)}function aQ(e){return aq(e)&&!a6(e).$o()&&e.g_.length>0}function aJ(e){a6(e).start()}async function aY(e){a6(e).l_()}async function aX(e){let t=a6(e);for(let r of e.g_)t.a_(r.mutations)}async function aZ(e,t,r){let n=e.g_.shift(),i=sd.from(n,t,r);await aG(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await aW(e)}async function a0(e,t){t&&a6(e).__&&await async function(e,t){var r;if(function(e){switch(e){default:return r5();case r8.CANCELLED:case r8.UNKNOWN:case r8.DEADLINE_EXCEEDED:case r8.RESOURCE_EXHAUSTED:case r8.INTERNAL:case r8.UNAVAILABLE:case r8.UNAUTHENTICATED:return!1;case r8.INVALID_ARGUMENT:case r8.NOT_FOUND:case r8.ALREADY_EXISTS:case r8.PERMISSION_DENIED:case r8.FAILED_PRECONDITION:case r8.ABORTED:case r8.OUT_OF_RANGE:case r8.UNIMPLEMENTED:case r8.DATA_LOSS:return!0}}(r=t.code)&&r!==r8.ABORTED){let r=e.g_.shift();a6(e).Go(),await aG(e,()=>e.remoteSyncer.rejectFailedWrite(r.batchId,t)),await aW(e)}}(e,t),aQ(e)&&aJ(e)}async function a1(e,t){e.asyncQueue.verifyOperationInProgress(),r4("RemoteStore","RemoteStore received new credentials");let r=aq(e);e.y_.add(3),await aM(e),r&&e.b_.set("Unknown"),await e.remoteSyncer.handleCredentialChange(t),e.y_.delete(3),await aP(e)}async function a2(e,t){t?(e.y_.delete(2),await aP(e)):t||(e.y_.add(2),await aM(e),e.b_.set("Unknown"))}function a4(e){var t,r,n;return e.v_||(e.v_=(t=e.datastore,r=e.asyncQueue,n={_o:az.bind(null,e),uo:aB.bind(null,e),r_:aH.bind(null,e)},t.P_(),new ax(r,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,n)),e.w_.push(async t=>{t?(e.v_.Go(),a$(e)?aV(e):e.b_.set("Unknown")):(await e.v_.stop(),e.D_=void 0)})),e.v_}function a6(e){var t,r,n;return e.C_||(e.C_=(t=e.datastore,r=e.asyncQueue,n={_o:aY.bind(null,e),uo:a0.bind(null,e),c_:aX.bind(null,e),u_:aZ.bind(null,e)},t.P_(),new aO(r,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,n)),e.w_.push(async t=>{t?(e.C_.Go(),await aW(e)):(await e.C_.stop(),e.g_.length>0&&(r4("RemoteStore",`Stopping write stream with ${e.g_.length} pending writes`),e.g_=[]))})),e.C_}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a9{constructor(e,t,r,n,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=n,this.removalCallback=i,this.deferred=new ne,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}static createAndSchedule(e,t,r,n,i){let s=Date.now()+r,a=new a9(e,t,s,n,i);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new r7(r8.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 a3(e,t){if(r6("AsyncQueue",`${t}: ${e}`),nT(e))return new r7(r8.UNAVAILABLE,`${t}: ${e}`);throw e}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a5{constructor(e){this.comparator=e?(t,r)=>e(t,r)||nv.comparator(t.key,r.key):(e,t)=>nv.comparator(e.key,t.key),this.keyedMap=i$(),this.sortedSet=new nx(this.comparator)}static emptySet(e){return new a5(e.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 a5)||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 a5;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a8{constructor(){this.F_=new nx(nv.comparator)}track(e){let t=e.doc.key,r=this.F_.get(t);r?0!==e.type&&3===r.type?this.F_=this.F_.insert(t,e):3===e.type&&1!==r.type?this.F_=this.F_.insert(t,{type:r.type,doc:e.doc}):2===e.type&&2===r.type?this.F_=this.F_.insert(t,{type:2,doc:e.doc}):2===e.type&&0===r.type?this.F_=this.F_.insert(t,{type:0,doc:e.doc}):1===e.type&&0===r.type?this.F_=this.F_.remove(t):1===e.type&&2===r.type?this.F_=this.F_.insert(t,{type:1,doc:r.doc}):0===e.type&&1===r.type?this.F_=this.F_.insert(t,{type:2,doc:e.doc}):r5():this.F_=this.F_.insert(t,e)}M_(){let e=[];return this.F_.inorderTraversal((t,r)=>{e.push(r)}),e}}class a7{constructor(e,t,r,n,i,s,a,o,l){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=n,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=o,this.hasCachedResults=l}static fromInitialDocuments(e,t,r,n,i){let s=[];return t.forEach(e=>{s.push({type:0,doc:e})}),new a7(e,t,a5.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)&&iD(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}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oe{constructor(){this.x_=void 0,this.listeners=[]}}class ot{constructor(){this.queries=new ij(e=>iP(e),iD),this.onlineState="Unknown",this.O_=new Set}}async function or(e,t){let r=t.query,n=!1,i=e.queries.get(r);if(i||(n=!0,i=new oe),n)try{i.x_=await e.onListen(r)}catch(r){let e=a3(r,`Initialization of query '${iM(t.query)}' failed`);return void t.onError(e)}e.queries.set(r,i),i.listeners.push(t),t.N_(e.onlineState),i.x_&&t.B_(i.x_)&&oa(e)}async function on(e,t){let r=t.query,n=!1,i=e.queries.get(r);if(i){let e=i.listeners.indexOf(t);e>=0&&(i.listeners.splice(e,1),n=0===i.listeners.length)}if(n)return e.queries.delete(r),e.onUnlisten(r)}function oi(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.listeners)e.B_(n)&&(r=!0);i.x_=n}}r&&oa(e)}function os(e,t,r){let n=e.queries.get(t);if(n)for(let e of n.listeners)e.onError(r);e.queries.delete(t)}function oa(e){e.O_.forEach(e=>{e.next()})}class oo{constructor(e,t,r){this.query=e,this.L_=t,this.k_=!1,this.q_=null,this.onlineState="Unknown",this.options=r||{}}B_(e){if(!this.options.includeMetadataChanges){let t=[];for(let r of e.docChanges)3!==r.type&&t.push(r);e=new a7(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.k_?this.Q_(e)&&(this.L_.next(e),t=!0):this.K_(e,this.onlineState)&&(this.U_(e),t=!0),this.q_=e,t}onError(e){this.L_.error(e)}N_(e){this.onlineState=e;let t=!1;return this.q_&&!this.k_&&this.K_(this.q_,e)&&(this.U_(this.q_),t=!0),t}K_(e,t){return!e.fromCache||(!this.options.W_||!("Offline"!==t))&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}Q_(e){if(e.docChanges.length>0)return!0;let t=this.q_&&this.q_.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}U_(e){e=a7.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.k_=!0,this.L_.next(e)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ol{constructor(e){this.key=e}}class ou{constructor(e){this.key=e}}class oc{constructor(e,t){this.query=e,this.X_=t,this.ea=null,this.hasCachedResults=!1,this.current=!1,this.ta=iK(),this.mutatedKeys=iK(),this.na=iF(e),this.ra=new a5(this.na)}get ia(){return this.X_}sa(e,t){let r=t?t.oa:new a8,n=t?t.ra:this.ra,i=t?t.mutatedKeys:this.mutatedKeys,s=n,a=!1,o="F"===this.query.limitType&&n.size===this.query.limit?n.last():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=iL(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._a(u,c)||(r.track({type:2,doc:c}),f=!0,(o&&this.na(c,o)>0||l&&0>this.na(c,l))&&(a=!0)):!u&&c?(r.track({type:0,doc:c}),f=!0):u&&!c&&(r.track({type:1,doc:u}),f=!0,(o||l)&&(a=!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{ra:s,oa:r,zi:a,mutatedKeys:i}}_a(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r){let n=this.ra;this.ra=e.ra,this.mutatedKeys=e.mutatedKeys;let i=e.oa.M_();i.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 r5()}};return r(e)-r(t)})(e.type,t.type)||this.na(e.doc,t.doc)),this.aa(r);let s=t?this.ua():[],a=0===this.ta.size&&this.current?1:0,o=a!==this.ea;return(this.ea=a,0!==i.length||o)?{snapshot:new a7(this.query,e.ra,n,i,e.mutatedKeys,0===a,o,!1,!!r&&r.resumeToken.approximateByteSize()>0),ca:s}:{ca:s}}N_(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({ra:this.ra,oa:new a8,mutatedKeys:this.mutatedKeys,zi:!1},!1)):{ca:[]}}la(e){return!this.X_.has(e)&&!!this.ra.has(e)&&!this.ra.get(e).hasLocalMutations}aa(e){e&&(e.addedDocuments.forEach(e=>this.X_=this.X_.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.X_=this.X_.delete(e)),this.current=e.current)}ua(){if(!this.current)return[];let e=this.ta;this.ta=iK(),this.ra.forEach(e=>{this.la(e.key)&&(this.ta=this.ta.add(e.key))});let t=[];return e.forEach(e=>{this.ta.has(e)||t.push(new ou(e))}),this.ta.forEach(r=>{e.has(r)||t.push(new ol(r))}),t}ha(e){this.X_=e.ss,this.ta=iK();let t=this.sa(e.documents);return this.applyChanges(t,!0)}Pa(){return a7.fromInitialDocuments(this.query,this.ra,this.mutatedKeys,0===this.ea,this.hasCachedResults)}}class oh{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class od{constructor(e){this.key=e,this.Ia=!1}}class of{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.Ta={},this.Ea=new ij(e=>iP(e),iD),this.da=new Map,this.Aa=new Set,this.Ra=new nx(nv.comparator),this.Va=new Map,this.ma=new s7,this.fa={},this.ga=new Map,this.pa=s4.On(),this.onlineState="Unknown",this.ya=void 0}get isPrimaryClient(){return!0===this.ya}}async function op(e,t){var r,n;let i,s;let a=(e.remoteStore.remoteSyncer.applyRemoteEvent=ov.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=oR.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=ob.bind(null,e),e.Ta.r_=oi.bind(null,e.eventManager),e.Ta.Sa=os.bind(null,e.eventManager),e),o=a.Ea.get(t);if(o)i=o.targetId,a.sharedClientState.addLocalQueryTarget(i),s=o.view.Pa();else{let e=await (r=a.localStore,n=iO(t),r.persistence.runTransaction("Allocate target","readwrite",e=>{let t;return r.kr.getTargetData(e,n).next(i=>i?(t=i,nE.resolve(t)):r.kr.allocateTargetId(e).next(i=>(t=new sY(n,i,"TargetPurposeListen",e.currentSequenceNumber),r.kr.addTargetData(e,t).next(()=>t))))}).then(e=>{let t=r.Ji.get(e.targetId);return(null===t||e.snapshotVersion.compareTo(t.snapshotVersion)>0)&&(r.Ji=r.Ji.insert(e.targetId,e),r.Yi.set(n,e.targetId)),e})),o=a.sharedClientState.addLocalQueryTarget(e.targetId);i=e.targetId,s=await om(a,t,i,"current"===o,e.resumeToken),a.isPrimaryClient&&aL(a.remoteStore,e)}return s}async function om(e,t,r,n,i){e.wa=(t,r,n)=>(async function(e,t,r,n){let i=t.view.sa(r);i.zi&&(i=await ap(e.localStore,t.query,!1).then(({documents:e})=>t.view.sa(e,i)));let s=n&&n.targetChanges.get(t.targetId),a=t.view.applyChanges(i,e.isPrimaryClient,s);return oC(e,t.targetId,a.ca),a.snapshot})(e,t,r,n);let s=await ap(e.localStore,t,!0),a=new oc(t,s.ss),o=a.sa(s.documents),l=sS.createSynthesizedTargetChangeForCurrentChange(r,n&&"Offline"!==e.onlineState,i),u=a.applyChanges(o,e.isPrimaryClient,l);oC(e,r,u.ca);let c=new oh(t,r,a);return e.Ea.set(t,c),e.da.has(r)?e.da.get(r).push(t):e.da.set(r,[t]),u.snapshot}async function og(e,t){let r=e.Ea.get(t),n=e.da.get(r.targetId);if(n.length>1)return e.da.set(r.targetId,n.filter(e=>!iD(e,t))),void e.Ea.delete(t);e.isPrimaryClient?(e.sharedClientState.removeLocalQueryTarget(r.targetId),e.sharedClientState.isActiveQueryTarget(r.targetId)||await af(e.localStore,r.targetId,!1).then(()=>{e.sharedClientState.clearQueryState(r.targetId),aF(e.remoteStore,r.targetId),oI(e,r.targetId)}).catch(n_)):(oI(e,r.targetId),await af(e.localStore,r.targetId,!0))}async function oy(e,t,r){var n;let i=(e.remoteStore.remoteSyncer.applySuccessfulWrite=o_.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=oE.bind(null,e),e);try{let e;let s=await function(e,t){let r,n;let i=nd.now(),s=t.reduce((e,t)=>e.add(t.key),iK());return e.persistence.runTransaction("Locally write mutations","readwrite",a=>{let o=iU,l=iK();return e.Xi.getEntries(a,s).next(e=>{(o=e).forEach((e,t)=>{t.isValidDocument()||(l=l.add(e))})}).next(()=>e.localDocuments.getOverlayedDocuments(a,o)).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=iY(n.transform,e||null);null!=i&&(null===r&&(r=n5.empty()),r.set(n.field,i))}return r||null}(e,r.get(e.key).overlayedDocument);null!=t&&s.push(new ss(e.key,t,function e(t){let r=[];return nC(t.fields,(t,n)=>{let i=new ny([t]);if(n6(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 nP(r)}(t.value.mapValue),i8.exists(!0)))}return e.mutationQueue.addMutationBatch(a,i,s,t)}).next(t=>{n=t;let i=t.applyToLocalDocumentSet(r,l);return e.documentOverlayCache.saveOverlays(a,t.batchId,i)})}).then(()=>({batchId:n.batchId,changes:iq(r)}))}(i.localStore,t);i.sharedClientState.addPendingMutation(s.batchId),n=s.batchId,(e=i.fa[i.currentUser.toKey()])||(e=new nx(nc)),e=e.insert(n,r),i.fa[i.currentUser.toKey()]=e,await ox(i,s.changes),await aW(i.remoteStore)}catch(t){let e=a3(t,"Failed to persist write");r.reject(e)}}async function ov(e,t){try{let r=await function(e,t){let r=t.snapshotVersion,n=e.Ji;return e.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{var s;let a,o;let l=e.Xi.newChangeBuffer({trackRemovals:!0});n=e.Ji;let u=[];t.targetChanges.forEach((s,a)=>{var o;let l=n.get(a);if(!l)return;u.push(e.kr.removeMatchingKeys(i,s.removedDocuments,a).next(()=>e.kr.addMatchingKeys(i,s.addedDocuments,a)));let c=l.withSequenceNumber(i.currentSequenceNumber);null!==t.targetMismatches.get(a)?c=c.withResumeToken(nL.EMPTY_BYTE_STRING,nf.min()).withLastLimboFreeSnapshotVersion(nf.min()):s.resumeToken.approximateByteSize()>0&&(c=c.withResumeToken(s.resumeToken,r)),n=n.insert(a,c),o=c,(0===l.resumeToken.approximateByteSize()||o.snapshotVersion.toMicroseconds()-l.snapshotVersion.toMicroseconds()>=3e8||s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size>0)&&u.push(e.kr.updateTargetData(i,c))});let c=iU,h=iK();if(t.documentUpdates.forEach(r=>{t.resolvedLimboDocuments.has(r)&&u.push(e.persistence.referenceDelegate.updateLimboDocument(i,r))}),u.push((s=t.documentUpdates,a=iK(),o=iK(),s.forEach(e=>a=a.add(e)),l.getEntries(i,a).next(e=>{let t=iU;return s.forEach((r,n)=>{let i=e.get(r);n.isFoundDocument()!==i.isFoundDocument()&&(o=o.add(r)),n.isNoDocument()&&n.version.isEqual(nf.min())?(l.removeEntry(r,n.readTime),t=t.insert(r,n)):!i.isValidDocument()||n.version.compareTo(i.version)>0||0===n.version.compareTo(i.version)&&i.hasPendingWrites?(l.addEntry(n),t=t.insert(r,n)):r4("LocalStore","Ignoring outdated watch update for ",r,". Current version:",i.version," Watch version:",n.version)}),{ns:t,rs:o}})).next(e=>{c=e.ns,h=e.rs})),!r.isEqual(nf.min())){let t=e.kr.getLastRemoteSnapshotVersion(i).next(t=>e.kr.setTargetsMetadata(i,i.currentSequenceNumber,r));u.push(t)}return nE.waitFor(u).next(()=>l.apply(i)).next(()=>e.localDocuments.getLocalViewOfDocuments(i,c,h)).next(()=>c)}).then(t=>(e.Ji=n,t))}(e.localStore,t);t.targetChanges.forEach((t,r)=>{let n=e.Va.get(r);n&&(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1||r5(),t.addedDocuments.size>0?n.Ia=!0:t.modifiedDocuments.size>0?n.Ia||r5():t.removedDocuments.size>0&&(n.Ia||r5(),n.Ia=!1))}),await ox(e,r,t)}catch(e){await n_(e)}}function ow(e,t,r){var n;if(e.isPrimaryClient&&0===r||!e.isPrimaryClient&&1===r){let r;let i=[];e.Ea.forEach((e,r)=>{let n=r.view.N_(t);n.snapshot&&i.push(n.snapshot)}),(n=e.eventManager).onlineState=t,r=!1,n.queries.forEach((e,n)=>{for(let e of n.listeners)e.N_(t)&&(r=!0)}),r&&oa(n),i.length&&e.Ta.r_(i),e.onlineState=t,e.isPrimaryClient&&e.sharedClientState.setOnlineState(t)}}async function ob(e,t,r){e.sharedClientState.updateQueryState(t,"rejected",r);let n=e.Va.get(t),i=n&&n.key;if(i){let r=new nx(nv.comparator);r=r.insert(i,n8.newNoDocument(i,nf.min()));let n=iK().add(i),s=new sT(nf.min(),new Map,new nx(nc),r,n);await ov(e,s),e.Ra=e.Ra.remove(i),e.Va.delete(t),oA(e)}else await af(e.localStore,t,!1).then(()=>oI(e,t,r)).catch(n_)}async function o_(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.Xi.newChangeBuffer({trackRemovals:!0});return(function(e,t,r,n){let i=r.batch,s=i.keys(),a=nE.resolve();return s.forEach(e=>{a=a.next(()=>n.getEntry(t,e)).next(t=>{let s=r.docVersions.get(e);null!==s||r5(),0>t.version.compareTo(s)&&(i.applyToRemoteDocument(t,r),t.isValidDocument()&&(t.setReadTime(r.commitVersion),n.addEntry(t)))})}),a.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=iK();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))});oS(e,n,null),oT(e,n),e.sharedClientState.updateMutationState(n,"acknowledged"),await ox(e,i)}catch(e){await n_(e)}}async function oE(e,t,r){var n;try{let i=await (n=e.localStore).persistence.runTransaction("Reject batch","readwrite-primary",e=>{let r;return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(null!==t||r5(),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))});oS(e,t,r),oT(e,t),e.sharedClientState.updateMutationState(t,"rejected",r),await ox(e,i)}catch(e){await n_(e)}}function oT(e,t){(e.ga.get(t)||[]).forEach(e=>{e.resolve()}),e.ga.delete(t)}function oS(e,t,r){let n=e.fa[e.currentUser.toKey()];if(n){let i=n.get(t);i&&(r?i.reject(r):i.resolve(),n=n.remove(t)),e.fa[e.currentUser.toKey()]=n}}function oI(e,t,r=null){for(let n of(e.sharedClientState.removeLocalQueryTarget(t),e.da.get(t)))e.Ea.delete(n),r&&e.Ta.Sa(n,r);e.da.delete(t),e.isPrimaryClient&&e.ma.Ar(t).forEach(t=>{e.ma.containsKey(t)||ok(e,t)})}function ok(e,t){e.Aa.delete(t.path.canonicalString());let r=e.Ra.get(t);null!==r&&(aF(e.remoteStore,r),e.Ra=e.Ra.remove(t),e.Va.delete(r),oA(e))}function oC(e,t,r){for(let n of r)n instanceof ol?(e.ma.addReference(n.key,t),function(e,t){let r=t.key,n=r.path.canonicalString();e.Ra.get(r)||e.Aa.has(n)||(r4("SyncEngine","New document in limbo: "+r),e.Aa.add(n),oA(e))}(e,n)):n instanceof ou?(r4("SyncEngine","Document no longer in limbo: "+n.key),e.ma.removeReference(n.key,t),e.ma.containsKey(n.key)||ok(e,n.key)):r5()}function oA(e){for(;e.Aa.size>0&&e.Ra.size<e.maxConcurrentLimboResolutions;){let t=e.Aa.values().next().value;e.Aa.delete(t);let r=new nv(nm.fromString(t)),n=e.pa.next();e.Va.set(n,new od(r)),e.Ra=e.Ra.insert(r,n),aL(e.remoteStore,new sY(iO(iS(r.path)),n,"TargetPurposeLimboResolution",nS.ae))}}async function ox(e,t,r){let n=[],i=[],s=[];e.Ea.isEmpty()||(e.Ea.forEach((a,o)=>{s.push(e.wa(o,t,r).then(t=>{if((t||r)&&e.isPrimaryClient&&e.sharedClientState.updateQueryState(o.targetId,(null==t?void 0:t.fromCache)?"not-current":"current"),t){n.push(t);let e=al.qi(o.targetId,t);i.push(e)}}))}),await Promise.all(s),e.Ta.r_(n),await async function(e,t){try{await e.persistence.runTransaction("notifyLocalViewChanges","readwrite",r=>nE.forEach(t,t=>nE.forEach(t.Li,n=>e.persistence.referenceDelegate.addReference(r,t.targetId,n)).next(()=>nE.forEach(t.ki,n=>e.persistence.referenceDelegate.removeReference(r,t.targetId,n)))))}catch(e){if(!nT(e))throw e;r4("LocalStore","Failed to update sequence numbers: "+e)}for(let r of t){let t=r.targetId;if(!r.fromCache){let r=e.Ji.get(t),n=r.snapshotVersion,i=r.withLastLimboFreeSnapshotVersion(n);e.Ji=e.Ji.insert(t,i)}}}(e.localStore,i))}async function oO(e,t){if(!e.currentUser.isEqual(t)){r4("SyncEngine","User change. New user:",t.toKey());let r=await ah(e.localStore,t);e.currentUser=t,e.ga.forEach(e=>{e.forEach(e=>{e.reject(new r7(r8.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),e.ga.clear(),e.sharedClientState.handleUserChange(t,r.removedBatchIds,r.addedBatchIds),await ox(e,r.ts)}}function oR(e,t){let r=e.Va.get(t);if(r&&r.Ia)return iK().add(r.key);{let r=iK(),n=e.da.get(t);if(!n)return r;for(let t of n){let n=e.Ea.get(t);r=r.unionWith(n.view.ia)}return r}}class oN{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=ak(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){var t,r,n,i;return t=this.persistence,r=new au,n=e.initialUser,i=this.serializer,new ac(t,r,n,i)}createPersistence(e){return new as(ao.zr,this.serializer)}createSharedClientState(e){return new ag}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class oD{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=>ow(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=oO.bind(null,this.syncEngine),await a2(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new ot}createDatastore(e){var t,r,n;let i=ak(e.databaseInfo.databaseId),s=(t=e.databaseInfo,new aS(t));return r=e.authCredentials,n=e.appCheckCredentials,new aR(r,n,s,i)}createRemoteStore(e){var t,r,n,i;return t=this.localStore,r=this.datastore,n=e.asyncQueue,i=av.v()?new av:new ay,new aD(t,r,n,e=>ow(this.syncEngine,e,0),i)}createSyncEngine(e,t){return function(e,t,r,n,i,s,a){let o=new of(e,t,r,n,i,s);return a&&(o.ya=!0),o}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}terminate(){return async function(e){r4("RemoteStore","RemoteStore shutting down."),e.y_.add(5),await aM(e),e.S_.shutdown(),e.b_.set("Unknown")}(this.remoteStore)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oP{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.va(this.observer.next,e)}error(e){this.observer.error?this.va(this.observer.error,e):r6("Uncaught Error in snapshot listener:",e.toString())}Ca(){this.muted=!0}va(e,t){this.muted||setTimeout(()=>{this.muted||e(t)},0)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oM{constructor(e,t,r,n){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=n,this.user=rZ.UNAUTHENTICATED,this.clientId=nu.V(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async e=>{r4("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(r,e=>(r4("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new r7(r8.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();let e=new ne;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=a3(r,"Failed to shutdown persistence");e.reject(t)}}),e.promise}}async function oL(e,t){e.asyncQueue.verifyOperationInProgress(),r4("FirestoreClient","Initializing OfflineComponentProvider");let r=await e.getConfiguration();await t.initialize(r);let n=r.initialUser;e.setCredentialChangeListener(async e=>{n.isEqual(e)||(await ah(t.localStore,e),n=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function oF(e,t){e.asyncQueue.verifyOperationInProgress();let r=await oj(e);r4("FirestoreClient","Initializing OnlineComponentProvider");let n=await e.getConfiguration();await t.initialize(r,n),e.setCredentialChangeListener(e=>a1(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,r)=>a1(t.remoteStore,r)),e._onlineComponents=t}async function oj(e){if(!e._offlineComponents){if(e._uninitializedComponentsProvider){r4("FirestoreClient","Using user provided OfflineComponentProvider");try{await oL(e,e._uninitializedComponentsProvider._offline)}catch(t){if(!("FirebaseError"===t.name?t.code===r8.FAILED_PRECONDITION||t.code===r8.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code))throw t;r9("Error using user provided cache. Falling back to memory cache: "+t),await oL(e,new oN)}}else r4("FirestoreClient","Using default OfflineComponentProvider"),await oL(e,new oN)}return e._offlineComponents}async function oU(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(r4("FirestoreClient","Using user provided OnlineComponentProvider"),await oF(e,e._uninitializedComponentsProvider._online)):(r4("FirestoreClient","Using default OnlineComponentProvider"),await oF(e,new oD))),e._onlineComponents}async function oV(e){let t=await oU(e),r=t.eventManager;return r.onListen=op.bind(null,t.syncEngine),r.onUnlisten=og.bind(null,t.syncEngine),r}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function o$(e){let t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let oq=new Map;/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function oz(e,t,r){if(!r)throw new r7(r8.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function oB(e){if(!nv.isDocumentKey(e))throw new r7(r8.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function oH(e){if(nv.isDocumentKey(e))throw new r7(r8.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function oK(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":r5()}function oG(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new r7(r8.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let r=oK(e);throw new r7(r8.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${r}`)}}return e}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oW{constructor(e){var t,r;if(void 0===e.host){if(void 0!==e.ssl)throw new r7(r8.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(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 r7(r8.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,r,n){if(!0===t&&!0===n)throw new r7(r8.INVALID_ARGUMENT,`${e} and ${r} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=o$(null!==(r=e.experimentalLongPollingOptions)&&void 0!==r?r:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new r7(r8.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new r7(r8.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new r7(r8.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 oQ{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 oW({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new r7(r8.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 void 0!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new r7(r8.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 oW(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new nr;switch(e.type){case"firstParty":return new na(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new r7(r8.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){let t=oq.get(e);t&&(r4("ComponentProvider","Removing Datastore"),oq.delete(e),t.terminate())}(this),Promise.resolve()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oJ{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new oJ(this.firestore,e,this._query)}}class oY{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 oX(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new oY(this.firestore,e,this._key)}}class oX extends oJ{constructor(e,t,r){super(e,t,iS(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 oY(this.firestore,null,new nv(e))}withConverter(e){return new oX(this.firestore,e,this._path)}}function oZ(e,t,...r){if(e=(0,f.m9)(e),oz("collection","path",t),e instanceof oQ){let n=nm.fromString(t,...r);return oH(n),new oX(e,null,n)}{if(!(e instanceof oY||e instanceof oX))throw new r7(r8.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let n=e._path.child(nm.fromString(t,...r));return oH(n),new oX(e.firestore,null,n)}}function o0(e,t){if(e=oG(e,oQ),oz("collectionGroup","collection id",t),t.indexOf("/")>=0)throw new r7(r8.INVALID_ARGUMENT,`Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new oJ(e,null,new iT(nm.emptyPath(),t))}function o1(e,t,...r){if(e=(0,f.m9)(e),1==arguments.length&&(t=nu.V()),oz("doc","path",t),e instanceof oQ){let n=nm.fromString(t,...r);return oB(n),new oY(e,null,new nv(n))}{if(!(e instanceof oY||e instanceof oX))throw new r7(r8.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let n=e._path.child(nm.fromString(t,...r));return oB(n),new oY(e.firestore,e instanceof oX?e.converter:null,new nv(n))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class o2{constructor(){this.Wa=Promise.resolve(),this.Ga=[],this.za=!1,this.ja=[],this.Ha=null,this.Ja=!1,this.Ya=!1,this.Za=[],this.Ko=new aC(this,"async_queue_retry"),this.Xa=()=>{let e=aI();e&&r4("AsyncQueue","Visibility state changed to "+e.visibilityState),this.Ko.No()};let e=aI();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Xa)}get isShuttingDown(){return this.za}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.eu(),this.tu(e)}enterRestrictedMode(e){if(!this.za){this.za=!0,this.Ya=e||!1;let t=aI();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Xa)}}enqueue(e){if(this.eu(),this.za)return new Promise(()=>{});let t=new ne;return this.tu(()=>this.za&&this.Ya?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Ga.push(e),this.nu()))}async nu(){if(0!==this.Ga.length){try{await this.Ga[0](),this.Ga.shift(),this.Ko.reset()}catch(e){if(!nT(e))throw e;r4("AsyncQueue","Operation failed with retryable error: "+e)}this.Ga.length>0&&this.Ko.xo(()=>this.nu())}}tu(e){let t=this.Wa.then(()=>(this.Ja=!0,e().catch(e=>{let t;this.Ha=e,this.Ja=!1;let r=(t=e.message||"",e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t);throw r6("INTERNAL UNHANDLED ERROR: ",r),e}).then(e=>(this.Ja=!1,e))));return this.Wa=t,t}enqueueAfterDelay(e,t,r){this.eu(),this.Za.indexOf(e)>-1&&(t=0);let n=a9.createAndSchedule(this,e,t,r,e=>this.ru(e));return this.ja.push(n),n}eu(){this.Ha&&r5()}verifyOperationInProgress(){}async iu(){let e;do e=this.Wa,await e;while(e!==this.Wa)}su(e){for(let t of this.ja)if(t.timerId===e)return!0;return!1}ou(e){return this.iu().then(()=>{for(let t of(this.ja.sort((e,t)=>e.targetTimeMs-t.targetTimeMs),this.ja))if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.iu()})}_u(e){this.Za.push(e)}ru(e){let t=this.ja.indexOf(e);this.ja.splice(t,1)}}function o4(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 o6 extends oQ{constructor(e,t,r,n){super(e,t,r,n),this.type="firestore",this._queue=new o2,this._persistenceKey=(null==n?void 0:n.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||o5(this),this._firestoreClient.terminate()}}function o9(e,t){let r="object"==typeof e?e:(0,c.Mq)(),n=(0,c.qX)(r,"firestore").getImmediate({identifier:"string"==typeof e?e:t||"(default)"});if(!n._initialized){let e=(0,f.P0)("firestore");e&&function(e,t,r,n={}){var i;let s=(e=oG(e,oQ))._getSettings(),a=`${t}:${r}`;if("firestore.googleapis.com"!==s.host&&s.host!==a&&r9("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},s),{host:a,ssl:!1})),n.mockUserToken){let t,r;if("string"==typeof n.mockUserToken)t=n.mockUserToken,r=rZ.MOCK_USER;else{t=(0,f.Sg)(n.mockUserToken,null===(i=e._app)||void 0===i?void 0:i.options.projectId);let s=n.mockUserToken.sub||n.mockUserToken.user_id;if(!s)throw new r7(r8.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");r=new rZ(s)}e._authCredentials=new nn(new nt(t,r))}}(n,...e)}return n}function o3(e){return e._firestoreClient||o5(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function o5(e){var t,r,n,i,s,a;let o=e._freezeSettings(),l=(i=e._databaseId,s=(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",a=e._persistenceKey,new nB(i,s,a,o.host,o.ssl,o.experimentalForceLongPolling,o.experimentalAutoDetectLongPolling,o$(o.experimentalLongPollingOptions),o.useFetchStreams));e._firestoreClient=new oM(e._authCredentials,e._appCheckCredentials,e._queue,l),(null===(r=o.localCache)||void 0===r?void 0:r._offlineComponentProvider)&&(null===(n=o.localCache)||void 0===n?void 0:n._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:o.localCache.kind,_offline:o.localCache._offlineComponentProvider,_online:o.localCache._onlineComponentProvider})}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class o8{constructor(e){this._byteString=e}static fromBase64String(e){try{return new o8(nL.fromBase64String(e))}catch(e){throw new r7(r8.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new o8(nL.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)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class o7{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new r7(r8.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ny(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class le{constructor(e){this._methodName=e}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class lt{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new r7(r8.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new r7(r8.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}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return nc(this._lat,e._lat)||nc(this._long,e._long)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let lr=/^__.*__$/;class ln{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return null!==this.fieldMask?new ss(e,this.data,this.fieldMask,t,this.fieldTransforms):new si(e,this.data,t,this.fieldTransforms)}}class li{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new ss(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function ls(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw r5()}}class la{constructor(e,t,r,n,i,s){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=n,void 0===i&&this.au(),this.fieldTransforms=i||[],this.fieldMask=s||[]}get path(){return this.settings.path}get uu(){return this.settings.uu}cu(e){return new la(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}lu(e){var t;let r=null===(t=this.path)||void 0===t?void 0:t.child(e),n=this.cu({path:r,hu:!1});return n.Pu(e),n}Iu(e){var t;let r=null===(t=this.path)||void 0===t?void 0:t.child(e),n=this.cu({path:r,hu:!1});return n.au(),n}Tu(e){return this.cu({path:void 0,hu:!0})}Eu(e){return lw(e,this.settings.methodName,this.settings.du||!1,this.path,this.settings.Au)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}au(){if(this.path)for(let e=0;e<this.path.length;e++)this.Pu(this.path.get(e))}Pu(e){if(0===e.length)throw this.Eu("Document fields must not be empty");if(ls(this.uu)&&lr.test(e))throw this.Eu('Document fields cannot begin and end with "__"')}}class lo{constructor(e,t,r){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=r||ak(e)}Ru(e,t,r,n=!1){return new la({uu:e,methodName:t,Au:r,path:ny.emptyPath(),hu:!1,du:n},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function ll(e){let t=e._freezeSettings(),r=ak(e._databaseId);return new lo(e._databaseId,!!t.ignoreUndefinedProperties,r)}function lu(e,t,r,n,i,s={}){let a,o;let l=e.Ru(s.merge||s.mergeFields?2:0,t,r,i);lm("Data must be an object, but it was:",l,n);let u=lf(n,l);if(s.merge)a=new nP(l.fieldMask),o=l.fieldTransforms;else if(s.mergeFields){let e=[];for(let n of s.mergeFields){let i=lg(t,n,r);if(!l.contains(i))throw new r7(r8.INVALID_ARGUMENT,`Field '${i}' is specified in your field mask but missing from your input data.`);lb(e,i)||e.push(i)}a=new nP(e),o=l.fieldTransforms.filter(e=>a.covers(e.field))}else a=null,o=l.fieldTransforms;return new ln(new n5(u),a,o)}class lc extends le{_toFieldTransform(e){if(2!==e.uu)throw 1===e.uu?e.Eu(`${this._methodName}() can only appear at the top level of your update data`):e.Eu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof lc}}class lh extends le{_toFieldTransform(e){return new i3(e.path,new iX)}isEqual(e){return e instanceof lh}}function ld(e,t){if(lp(e=(0,f.m9)(e)))return lm("Unsupported field value:",t,e),lf(e,t);if(e instanceof le)return function(e,t){if(!ls(t.uu))throw t.Eu(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.Eu(`${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.hu&&4!==t.uu)throw t.Eu("Nested arrays are not supported");return function(e,t){let r=[],n=0;for(let i of e){let e=ld(i,t.Tu(n));null==e&&(e={nullValue:"NULL_VALUE"}),r.push(e),n++}return{arrayValue:{values:r}}}(e,t)}return function(e,t){if(null===(e=(0,f.m9)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e){var r,n,i;return r=t.serializer,"number"==typeof(i=n=e)&&Number.isInteger(i)&&!nI(i)&&i<=Number.MAX_SAFE_INTEGER&&i>=Number.MIN_SAFE_INTEGER?iQ(n):iW(r,n)}if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){let r=nd.fromDate(e);return{timestampValue:sF(t.serializer,r)}}if(e instanceof nd){let r=new nd(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:sF(t.serializer,r)}}if(e instanceof lt)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof o8)return{bytesValue:sj(t.serializer,e._byteString)};if(e instanceof oY){let r=t.databaseId,n=e.firestore._databaseId;if(!n.isEqual(r))throw t.Eu(`Document reference is for database ${n.projectId}/${n.database} but should be for database ${r.projectId}/${r.database}`);return{referenceValue:sV(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t.Eu(`Unsupported field value: ${oK(e)}`)}(e,t)}function lf(e,t){let r={};return nA(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):nC(e,(e,n)=>{let i=ld(n,t.lu(e));null!=i&&(r[e]=i)}),{mapValue:{fields:r}}}function lp(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof nd||e instanceof lt||e instanceof o8||e instanceof oY||e instanceof le)}function lm(e,t,r){if(!lp(r)||!("object"==typeof r&&null!==r&&(Object.getPrototypeOf(r)===Object.prototype||null===Object.getPrototypeOf(r)))){let n=oK(r);throw"an object"===n?t.Eu(e+" a custom object"):t.Eu(e+" "+n)}}function lg(e,t,r){if((t=(0,f.m9)(t))instanceof o7)return t._internalPath;if("string"==typeof t)return lv(e,t);throw lw("Field path arguments must be of type string or ",e,!1,void 0,r)}let ly=RegExp("[~\\*/\\[\\]]");function lv(e,t,r){if(t.search(ly)>=0)throw lw(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,r);try{return new o7(...t.split("."))._internalPath}catch(n){throw lw(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,r)}}function lw(e,t,r,n,i){let s=n&&!n.isEmpty(),a=void 0!==i,o=`Function ${t}() called with invalid data`;r&&(o+=" (via `toFirestore()`)"),o+=". ";let l="";return(s||a)&&(l+=" (found",s&&(l+=` in field ${n}`),a&&(l+=` in document ${i}`),l+=")"),new r7(r8.INVALID_ARGUMENT,o+e+l)}function lb(e,t){return e.some(e=>e.isEqual(t))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class l_{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 oY(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){let e=new lE(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let t=this._document.data.field(lT("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class lE extends l_{data(){return super.data()}}function lT(e,t){return"string"==typeof t?lv(e,t):t instanceof o7?t._internalPath:t._delegate._internalPath}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function lS(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new r7(r8.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class lI{}class lk extends lI{}function lC(e,t,...r){let n=[];for(let i of(t instanceof lI&&n.push(t),function(e){let t=e.filter(e=>e instanceof lO).length,r=e.filter(e=>e instanceof lA).length;if(t>1||t>0&&r>0)throw new r7(r8.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}class lA extends lk{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type="where"}static _create(e,t,r){return new lA(e,t,r)}_apply(e){let t=this._parse(e);return lF(e._query,t),new oJ(e.firestore,e.converter,iR(e._query,t))}_parse(e){let t=ll(e.firestore),r=function(e,t,r,n,i,s,a){let o;if(i.isKeyField()){if("array-contains"===s||"array-contains-any"===s)throw new r7(r8.INVALID_ARGUMENT,`Invalid Query. You can't perform '${s}' queries on documentId().`);if("in"===s||"not-in"===s){lL(a,s);let t=[];for(let r of a)t.push(lM(n,e,r));o={arrayValue:{values:t}}}else o=lM(n,e,a)}else"in"!==s&&"not-in"!==s&&"array-contains-any"!==s||lL(a,s),o=function(e,t,r,n=!1){return ld(r,e.Ru(n?4:3,t))}(r,t,a,"in"===s||"not-in"===s);return is.create(i,s,o)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value);return r}}function lx(e,t,r){let n=lT("where",e);return lA._create(n,t,r)}class lO extends lI{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new lO(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]:ia.create(t,this._getOperator())}_apply(e){let t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let r=e,n=t.getFlattenedFilters();for(let e of n)lF(r,e),r=iR(r,e)}(e._query,t),new oJ(e.firestore,e.converter,iR(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class lR extends lk{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new lR(e,t)}_apply(e){let t=function(e,t,r){if(null!==e.startAt)throw new r7(r8.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new r7(r8.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");let n=new ir(t,r);return function(e,t){if(null===ik(e)){let r=iC(e);null!==r&&lj(e,r,t.field)}}(e,n),n}(e._query,this._field,this._direction);return new oJ(e.firestore,e.converter,function(e,t){let r=e.explicitOrderBy.concat([t]);return new iT(e.path,e.collectionGroup,r,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function lN(e,t="asc"){let r=lT("orderBy",e);return lR._create(r,t)}class lD extends lk{constructor(e,t,r){super(),this.type=e,this._limit=t,this._limitType=r}static _create(e,t,r){return new lD(e,t,r)}_apply(e){return new oJ(e.firestore,e.converter,iN(e._query,this._limit,this._limitType))}}function lP(e){return function(e,t){if(t<=0)throw new r7(r8.INVALID_ARGUMENT,`Function ${e}() requires a positive number, but it was: ${t}.`)}("limit",e),lD._create("limit",e,"F")}function lM(e,t,r){if("string"==typeof(r=(0,f.m9)(r))){if(""===r)throw new r7(r8.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!iA(t)&&-1!==r.indexOf("/"))throw new r7(r8.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(nm.fromString(r));if(!nv.isDocumentKey(n))throw new r7(r8.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 nZ(e,new nv(n))}if(r instanceof oY)return nZ(e,r._key);throw new r7(r8.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${oK(r)}.`)}function lL(e,t){if(!Array.isArray(e)||0===e.length)throw new r7(r8.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${t.toString()}' filters.`)}function lF(e,t){if(t.isInequality()){let r=iC(e),n=t.field;if(null!==r&&!r.isEqual(n))throw new r7(r8.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${r.toString()}' and '${n.toString()}'`);let i=ik(e);null!==i&&lj(e,n,i)}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 r7(r8.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new r7(r8.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${r.toString()}' filters.`)}function lj(e,t,r){if(!r.isEqual(t))throw new r7(r8.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${t.toString()}' and so you must also use '${t.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${r.toString()}' instead.`)}class lU{convertValue(e,t="none"){switch(nG(e)){case 0:return null;case 1:return e.booleanValue;case 2:return nU(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(nV(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 10:return this.convertObject(e.mapValue,t);default:throw r5()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){let r={};return nC(e,(e,n)=>{r[e]=this.convertValue(n,t)}),r}convertGeoPoint(e){return new lt(nU(e.latitude),nU(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":let r=nq(e);return null==r?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(nz(e));default:return null}}convertTimestamp(e){let t=nj(e);return new nd(t.seconds,t.nanos)}convertDocumentKey(e,t){let r=nm.fromString(e);sJ(r)||r5();let n=new nH(r.get(1),r.get(3)),i=new nv(r.popFirst(5));return n.isEqual(t)||r6(`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}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function lV(e,t,r){return e?r&&(r.merge||r.mergeFields)?e.toFirestore(t,r):e.toFirestore(t):t}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class l${constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class lq extends l_{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 lz(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(lT("DocumentSnapshot.get",e));if(null!==r)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}}class lz extends lq{data(e={}){return super.data(e)}}class lB{constructor(e,t,r,n){this._firestore=e,this._userDataWriter=t,this._snapshot=n,this.metadata=new l$(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 lz(this._firestore,this._userDataWriter,r.key,r,new l$(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 r7(r8.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 lz(e._firestore,e._userDataWriter,r.doc.key,r.doc,new l$(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 lz(e._firestore,e._userDataWriter,t.doc.key,t.doc,new l$(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,s=-1;return 0!==t.type&&(i=r.indexOf(t.doc.key),r=r.delete(t.doc.key)),1!==t.type&&(s=(r=r.add(t.doc)).indexOf(t.doc.key)),{type:function(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return r5()}}(t.type),doc:n,oldIndex:i,newIndex:s}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function lH(e){e=oG(e,oY);let t=oG(e.firestore,o6);return(function(e,t,r={}){let n=new ne;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,r,n,i){let s=new oP({next:s=>{t.enqueueAndForget(()=>on(e,a));let o=s.docs.has(r);!o&&s.fromCache?i.reject(new r7(r8.UNAVAILABLE,"Failed to get document because the client is offline.")):o&&s.fromCache&&n&&"server"===n.source?i.reject(new r7(r8.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(s)},error:e=>i.reject(e)}),a=new oo(iS(r.path),s,{includeMetadataChanges:!0,W_:!0});return or(e,a)})(await oV(e),e.asyncQueue,t,r,n)),n.promise})(o3(t),e._key).then(r=>l0(t,e,r))}class lK extends lU{constructor(e){super(),this.firestore=e}convertBytes(e){return new o8(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new oY(this.firestore,null,t)}}function lG(e){e=oG(e,oJ);let t=oG(e.firestore,o6),r=o3(t),n=new lK(t);return lS(e._query),(function(e,t,r={}){let n=new ne;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,r,n,i){let s=new oP({next:r=>{t.enqueueAndForget(()=>on(e,a)),r.fromCache&&"server"===n.source?i.reject(new r7(r8.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)}),a=new oo(r,s,{includeMetadataChanges:!0,W_:!0});return or(e,a)})(await oV(e),e.asyncQueue,t,r,n)),n.promise})(r,e._query).then(r=>new lB(t,n,e,r))}function lW(e,t,r){e=oG(e,oY);let n=oG(e.firestore,o6),i=lV(e.converter,t,r);return lZ(n,[lu(ll(n),"setDoc",e._key,i,null!==e.converter,r).toMutation(e._key,i8.none())])}function lQ(e,t,r,...n){let i;e=oG(e,oY);let s=oG(e.firestore,o6),a=ll(s);return i="string"==typeof(t=(0,f.m9)(t))||t instanceof o7?function(e,t,r,n,i,s){let a=e.Ru(1,t,r),o=[lg(t,n,r)],l=[i];if(s.length%2!=0)throw new r7(r8.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)o.push(lg(t,s[e])),l.push(s[e+1]);let u=[],c=n5.empty();for(let e=o.length-1;e>=0;--e)if(!lb(u,o[e])){let t=o[e],r=l[e];r=(0,f.m9)(r);let n=a.Iu(t);if(r instanceof lc)u.push(t);else{let e=ld(r,n);null!=e&&(u.push(t),c.set(t,e))}}let h=new nP(u);return new li(c,h,a.fieldTransforms)}(a,"updateDoc",e._key,t,r,n):function(e,t,r,n){let i=e.Ru(1,t,r);lm("Data must be an object, but it was:",i,n);let s=[],a=n5.empty();nC(n,(e,n)=>{let o=lv(t,e,r);n=(0,f.m9)(n);let l=i.Iu(o);if(n instanceof lc)s.push(o);else{let e=ld(n,l);null!=e&&(s.push(o),a.set(o,e))}});let o=new nP(s);return new li(a,o,i.fieldTransforms)}(a,"updateDoc",e._key,t),lZ(s,[i.toMutation(e._key,i8.exists(!0))])}function lJ(e){return lZ(oG(e.firestore,o6),[new su(e._key,i8.none())])}function lY(e,t){let r=oG(e.firestore,o6),n=o1(e),i=lV(e.converter,t);return lZ(r,[lu(ll(e.firestore),"addDoc",n._key,i,null!==e.converter,{}).toMutation(n._key,i8.exists(!1))]).then(()=>n)}function lX(e,...t){var r,n,i;let s,a,o;e=(0,f.m9)(e);let l={includeMetadataChanges:!1},u=0;"object"!=typeof t[0]||o4(t[u])||(l=t[u],u++);let c={includeMetadataChanges:l.includeMetadataChanges};if(o4(t[u])){let e=t[u];t[u]=null===(r=e.next)||void 0===r?void 0:r.bind(e),t[u+1]=null===(n=e.error)||void 0===n?void 0:n.bind(e),t[u+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}if(e instanceof oY)a=oG(e.firestore,o6),o=iS(e._key.path),s={next:r=>{t[u]&&t[u](l0(a,e,r))},error:t[u+1],complete:t[u+2]};else{let r=oG(e,oJ);a=oG(r.firestore,o6),o=r._query;let n=new lK(a);s={next:e=>{t[u]&&t[u](new lB(a,n,r,e))},error:t[u+1],complete:t[u+2]},lS(e._query)}return function(e,t,r,n){let i=new oP(n),s=new oo(t,i,r);return e.asyncQueue.enqueueAndForget(async()=>or(await oV(e),s)),()=>{i.Ca(),e.asyncQueue.enqueueAndForget(async()=>on(await oV(e),s))}}(o3(a),o,c,s)}function lZ(e,t){return function(e,t){let r=new ne;return e.asyncQueue.enqueueAndForget(async()=>oy(await oU(e).then(e=>e.syncEngine),t,r)),r.promise}(o3(e),t)}function l0(e,t,r){let n=r.docs.get(t._key),i=new lK(e);return new lq(e,i,t._key,n,new l$(r.hasPendingWrites,r.fromCache),t.converter)}function l1(){return new lh("serverTimestamp")}!function(e,t=!0){r0=c.Jn,(0,c.Xd)(new h.wA("firestore",(e,{instanceIdentifier:r,options:n})=>{let i=e.getProvider("app").getImmediate(),s=new o6(new ni(e.getProvider("auth-internal")),new nl(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new r7(r8.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new nH(e.options.projectId,t)}(i,r),i);return n=Object.assign({useFetchStreams:t},n),s._setSettings(n),s},"PUBLIC").setMultipleInstances(!0)),(0,c.KN)(rX,"4.1.0",void 0),(0,c.KN)(rX,"4.1.0","esm2017")}()},86650:function(e,t,r){"use strict";r.d(t,{Jt:function(){return eu},sd:function(){return eo},cF:function(){return eh},aF:function(){return el},iH:function(){return ec},KV:function(){return ea}});var n,i,s,a,o=r(25816),l=r(74444),u=r(8463);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let c="firebasestorage.googleapis.com",h="storageBucket";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class d extends l.ZR{constructor(e,t,r=0){super(f(e),`Firebase Storage: ${t} (${f(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,d.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return f(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
${this.customData.serverResponse}`:this.message=this._baseMessage}}function f(e){return"storage/"+e}function p(){return new d(s.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function m(e){return new d(s.INVALID_ARGUMENT,e)}function g(){return new d(s.APP_DELETED,"The Firebase app was deleted.")}function y(e,t){return new d(s.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function v(e){throw new d(s.INTERNAL_ERROR,"Internal error: "+e)}(n=s||(s={})).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";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class w{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(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let r;try{r=w.makeFromUrl(e,t)}catch(t){return new w(e,"")}if(""===r.path)return r;throw new d(s.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}static makeFromUrl(e,t){let r=null,n="([A-Za-z0-9.\\-_]+)",i=RegExp("^gs://"+n+"(/(.*))?$","i");function a(e){e.path_=decodeURIComponent(e.path)}let o=t.replace(/[.]/g,"\\."),l=RegExp(`^https?://${o}/v[A-Za-z0-9_]+/b/${n}/o(/([^?#]*).*)?$`,"i"),u=RegExp(`^https?://${t===c?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${n}/([^?#]*)`,"i"),h=[{regex:i,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:l,indices:{bucket:1,path:3},postModify:a},{regex:u,indices:{bucket:1,path:2},postModify:a}];for(let t=0;t<h.length;t++){let n=h[t],i=n.regex.exec(e);if(i){let e=i[n.indices.bucket],t=i[n.indices.path];t||(t=""),r=new w(e,t),n.postModify(r);break}}if(null==r)throw new d(s.INVALID_URL,"Invalid URL '"+e+"'.");return r}}class b{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function _(e){return"string"==typeof e||e instanceof String}function E(e){return T()&&e instanceof Blob}function T(){return"undefined"!=typeof Blob&&!(0,l.UG)()}function S(e,t,r,n){if(n<t)throw m(`Invalid value for '${e}'. Expected ${t} or greater.`);if(n>r)throw m(`Invalid value for '${e}'. Expected ${r} or less.`)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function I(e,t,r){let n=t;return null==r&&(n=`https://${t}`),`${r}://${n}/v0${e}`}function k(e){let t=encodeURIComponent,r="?";for(let n in e)if(e.hasOwnProperty(n)){let i=t(n)+"="+t(e[n]);r=r+i+"&"}return r.slice(0,-1)}(i=a||(a={}))[i.NO_ERROR=0]="NO_ERROR",i[i.NETWORK_ERROR=1]="NETWORK_ERROR",i[i.ABORT=2]="ABORT";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class C{constructor(e,t,r,n,i,s,a,o,l,u,c,h=!0){this.url_=e,this.method_=t,this.headers_=r,this.body_=n,this.successCodes_=i,this.additionalRetryCodes_=s,this.callback_=a,this.errorCallback_=o,this.timeout_=l,this.progressCallback_=u,this.connectionFactory_=c,this.retry=h,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=p();e.serverResponse=i.getErrorText(),n(this.errorCallback_?this.errorCallback_(i,e):e)}else if(t.canceled){let e=this.appDelete_?g():new d(s.CANCELED,"User canceled the upload/download.");n(e)}else{let e=new d(s.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.");n(e)}};this.canceled_?e(!1,new A(!1,null,!0)):this.backoffId_=/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e,t,r){let n=1,i=null,s=null,a=!1,o=0,l=!1;function u(...e){l||(l=!0,t.apply(null,e))}function c(t){i=setTimeout(()=>{i=null,e(d,2===o)},t)}function h(){s&&clearTimeout(s)}function d(e,...t){let r;if(l){h();return}if(e){h(),u.call(null,e,...t);return}let i=2===o||a;if(i){h(),u.call(null,e,...t);return}n<64&&(n*=2),1===o?(o=2,r=0):r=(n+Math.random())*1e3,c(r)}let f=!1;function p(e){!f&&(f=!0,h(),!l&&(null!==i?(e||(o=2),clearTimeout(i),c(0)):e||(o=1)))}return c(0),s=setTimeout(()=>{a=!0,p(!0)},r),p}((e,t)=>{if(t){e(!1,new A(!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.body_,this.headers_).then(()=>{null!==this.progressCallback_&&r.removeUploadProgressListener(n),this.pendingConnection_=null;let t=r.getErrorCode()===a.NO_ERROR,i=r.getStatus();if(!t||/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e,t){let r=e>=500&&e<600,n=-1!==[408,429].indexOf(e),i=-1!==t.indexOf(e);return r||n||i}(i,this.additionalRetryCodes_)&&this.retry){let t=r.getErrorCode()===a.ABORT;e(!1,new A(!1,null,t));return}let s=-1!==this.successCodes_.indexOf(i);e(!0,new A(s,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 A{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function x(...e){let t="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0;if(void 0!==t){let r=new t;for(let t=0;t<e.length;t++)r.append(e[t]);return r.getBlob()}if(T())return new Blob(e);throw new d(s.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let O={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class R{constructor(e,t){this.data=e,this.contentType=t||null}}function N(e){let t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n<=127)t.push(n);else if(n<=2047)t.push(192|n>>6,128|63&n);else if((64512&n)==55296){let i=r<e.length-1&&(64512&e.charCodeAt(r+1))==56320;if(i){let i=n,s=e.charCodeAt(++r);n=65536|(1023&i)<<10|1023&s,t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}else t.push(239,191,189)}else(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 D(e,t){let r;switch(e){case O.BASE64:{let r=-1!==t.indexOf("-"),n=-1!==t.indexOf("_");if(r||n)throw y(e,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case O.BASE64URL:{let r=-1!==t.indexOf("+"),n=-1!==t.indexOf("/");if(r||n)throw y(e,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/")}}try{r=/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){if("undefined"==typeof atob)throw new d(s.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)}(t)}catch(t){if(t.message.includes("polyfill"))throw t;throw y(e,"Invalid character found")}let n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}class P{constructor(e){this.base64=!1,this.contentType=null;let t=e.match(/^data:([^,]+)?,/);if(null===t)throw y(O.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");let r=t[1]||null;null!=r&&(this.base64=function(e,t){let r=e.length>=t.length;return!!r&&e.substring(e.length-t.length)===t}(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=e.substring(e.indexOf(",")+1)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class M{constructor(e,t){let r=0,n="";E(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(E(this.data_)){let r=this.data_,n=r.webkitSlice?r.webkitSlice(e,t):r.mozSlice?r.mozSlice(e,t):r.slice?r.slice(e,t):null;return null===n?null:new M(n)}{let r=new Uint8Array(this.data_.buffer,e,t-e);return new M(r,!0)}}static getBlob(...e){if(T()){let t=e.map(e=>e instanceof M?e.data_:e);return new M(x.apply(null,t))}{let t=e.map(e=>_(e)?function(e,t){switch(e){case O.RAW:return new R(N(t));case O.BASE64:case O.BASE64URL:return new R(D(e,t));case O.DATA_URL:return new R(function(e){let t=new P(e);return t.base64?D(O.BASE64,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(e){throw y(O.DATA_URL,"Malformed data URL.")}return N(t)}(t.rest)}(t),function(e){let t=new P(e);return t.contentType}(t))}throw p()}(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 M(n,!0)}}uploadData(){return this.data_}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function L(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 F(e){let t=e.lastIndexOf("/",e.length-2);return -1===t?e:e.slice(t+1)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function j(e,t){return t}class U{constructor(e,t,r,n){this.server=e,this.local=t||e,this.writable=!!r,this.xform=n||j}}let V=null;function $(){if(V)return V;let e=[];e.push(new U("bucket")),e.push(new U("generation")),e.push(new U("metageneration")),e.push(new U("name","fullPath",!0));let t=new U("name");t.xform=function(e,t){return!_(t)||t.length<2?t:F(t)},e.push(t);let r=new U("size");return r.xform=function(e,t){return void 0!==t?Number(t):t},e.push(r),e.push(new U("timeCreated")),e.push(new U("updated")),e.push(new U("md5Hash",null,!0)),e.push(new U("cacheControl",null,!0)),e.push(new U("contentDisposition",null,!0)),e.push(new U("contentEncoding",null,!0)),e.push(new U("contentLanguage",null,!0)),e.push(new U("contentType",null,!0)),e.push(new U("metadata","customMetadata",!0)),V=e}function q(e,t,r){let n=L(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=n.bucket,r=n.fullPath,i=new w(t,r);return e._makeStorageReference(i)}}),n}(e,n,r)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let z="prefixes",B="items";class H{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=[]}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function K(e){if(!e)throw p()}function G(e,t){return function(r,n){let i=q(e,n,t);return K(null!==i),i}}function W(e){return function(t,r){var n,i;let a;return 401===t.getStatus()?a=t.getErrorText().includes("Firebase App Check token is invalid")?new d(s.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new d(s.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(n=e.bucket,a=new d(s.QUOTA_EXCEEDED,"Quota for bucket '"+n+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(i=e.path,a=new d(s.UNAUTHORIZED,"User does not have permission to access '"+i+"'.")):a=r,a.status=t.getStatus(),a.serverResponse=r.serverResponse,a}}function Q(e){let t=W(e);return function(r,n){let i=t(r,n);if(404===r.getStatus()){var a;a=e.path,i=new d(s.OBJECT_NOT_FOUND,"Object '"+a+"' does not exist.")}return i.serverResponse=n.serverResponse,i}}class J{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=a.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=a.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=a.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,r,n){if(this.sent_)throw v("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==n)for(let e in n)n.hasOwnProperty(e)&&this.xhr_.setRequestHeader(e,n[e].toString());return void 0!==r?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw v("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw v("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return -1}}getResponse(){if(!this.sent_)throw v("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw v("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 Y extends J{initXhr(){this.xhr_.responseType="text"}}function X(){return new Y}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Z{constructor(e,t){this._service=e,t instanceof w?this._location=t:this._location=w.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new Z(e,t)}get root(){let e=new w(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return F(this._location.path)}get storage(){return this._service}get parent(){let e=/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){if(0===e.length)return null;let t=e.lastIndexOf("/");if(-1===t)return"";let r=e.slice(0,t);return r}(this._location.path);if(null===e)return null;let t=new w(this._location.bucket,e);return new Z(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw new d(s.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').")}}async function ee(e,t,r){let n=await function(e,t){null!=t&&"number"==typeof t.maxResults&&S("options.maxResults",1,1e3,t.maxResults);let r=t||{},n=function(e,t,r,n,i){var s;let a={};t.isRoot?a.prefix="":a.prefix=t.path+"/",r&&r.length>0&&(a.delimiter=r),n&&(a.pageToken=n),i&&(a.maxResults=i);let o=t.bucketOnlyServerUrl(),l=I(o,e.host,e._protocol),u=e.maxOperationRetryTime,c=new H(l,"GET",(s=t.bucket,function(t,r){let n=function(e,t,r){let n=L(r);return null===n?null:function(e,t,r){let n={prefixes:[],items:[],nextPageToken:r.nextPageToken};if(r[z])for(let i of r[z]){let r=i.replace(/\/$/,""),s=e._makeStorageReference(new w(t,r));n.prefixes.push(s)}if(r[B])for(let i of r[B]){let r=e._makeStorageReference(new w(t,i.name));n.items.push(r)}return n}(e,t,n)}(e,s,r);return K(null!==n),n}),u);return c.urlParams=a,c.errorHandler=W(t),c}(e.storage,e._location,"/",r.pageToken,r.maxResults);return e.storage.makeRequestWithTokens(n,X)}(e,{pageToken:r});t.prefixes.push(...n.prefixes),t.items.push(...n.items),null!=n.nextPageToken&&await ee(e,t,n.nextPageToken)}function et(e,t){let r=null==t?void 0:t[h];return null==r?null:w.makeFromBucketSpec(r,e)}class er{constructor(e,t,r,n,i){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=n,this._firebaseVersion=i,this._bucket=null,this._host=c,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,null!=n?this._bucket=w.makeFromBucketSpec(n,this._host):this._bucket=et(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=w.makeFromBucketSpec(this._url,e):this._bucket=et(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){S("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){S("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(){let e=this._appCheckProvider.getImmediate({optional:!0});if(e){let t=await e.getToken();return t.token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Z(this,e)}_makeRequest(e,t,r,n,i=!0){if(this._deleted)return new b(g());{let s=function(e,t,r,n,i,s,a=!0){let o=k(e.urlParams),l=e.url+o,u=Object.assign({},e.headers);return t&&(u["X-Firebase-GMPID"]=t),null!==r&&r.length>0&&(u.Authorization="Firebase "+r),u["X-Firebase-Storage-Version"]="webjs/"+(null!=s?s:"AppManager"),null!==n&&(u["X-Firebase-AppCheck"]=n),new C(l,e.method,u,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,a)}(e,this._appId,r,n,t,this._firebaseVersion,i);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 en="@firebase/storage",ei="0.11.2",es="storage";function ea(e,t,r){return function(e,t,r){e._throwIfRoot("uploadBytes");let n=function(e,t,r,n,i){let a=t.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"},l=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();o["Content-Type"]="multipart/related; boundary="+l;let u=function(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}(t,n,i),c=function(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)}(u,r),h="--"+l+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+c+"\r\n--"+l+"\r\nContent-Type: "+u.contentType+"\r\n\r\n",f=M.getBlob(h,n,"\r\n--"+l+"--");if(null===f)throw new d(s.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.");let p={name:u.fullPath},m=I(a,e.host,e._protocol),g=e.maxUploadRetryTime,y=new H(m,"POST",G(e,r),g);return y.urlParams=p,y.headers=o,y.body=f.uploadData(),y.errorHandler=W(t),y}(e.storage,e._location,$(),new M(t,!0),r);return e.storage.makeRequestWithTokens(n,X).then(t=>({metadata:t,ref:e}))}(e=(0,l.m9)(e),t,r)}function eo(e){return function(e){e._throwIfRoot("getMetadata");let t=function(e,t,r){let n=t.fullServerUrl(),i=I(n,e.host,e._protocol),s=e.maxOperationRetryTime,a=new H(i,"GET",G(e,r),s);return a.errorHandler=Q(t),a}(e.storage,e._location,$());return e.storage.makeRequestWithTokens(t,X)}(e=(0,l.m9)(e))}function el(e){return function(e){let t={prefixes:[],items:[]};return ee(e,t).then(()=>t)}(e=(0,l.m9)(e))}function eu(e){return function(e){e._throwIfRoot("getDownloadURL");let t=function(e,t,r){let n=t.fullServerUrl(),i=I(n,e.host,e._protocol),s=e.maxOperationRetryTime,a=new H(i,"GET",function(t,n){let i=q(e,n,r);return K(null!==i),function(e,t,r,n){let i=L(t);if(null===i||!_(i.downloadTokens))return null;let s=i.downloadTokens;if(0===s.length)return null;let a=encodeURIComponent,o=s.split(","),l=o.map(t=>{let i=e.bucket,s=e.fullPath,o="/b/"+a(i)+"/o/"+a(s),l=I(o,r,n),u=k({alt:"media",token:t});return l+u});return l[0]}(i,n,e.host,e._protocol)},s);return a.errorHandler=Q(t),a}(e.storage,e._location,$());return e.storage.makeRequestWithTokens(t,X).then(e=>{if(null===e)throw new d(s.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}(e=(0,l.m9)(e))}function ec(e,t){return function(e,t){if(!(t&&/^[A-Za-z]+:\/\//.test(t)))return function e(t,r){if(t instanceof er){if(null==t._bucket)throw new d(s.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+h+"' property when initializing the app?");let n=new Z(t,t._bucket);return null!=r?e(n,r):n}return void 0!==r?function(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 w(e._location.bucket,r);return new Z(e.storage,n)}(t,r):t}(e,t);if(e instanceof er)return new Z(e,t);throw m("To use ref(service, url), the first argument must be a Storage instance.")}(e=(0,l.m9)(e),t)}function eh(e=(0,o.Mq)(),t){e=(0,l.m9)(e);let r=(0,o.qX)(e,es),n=r.getImmediate({identifier:t}),i=(0,l.P0)("storage");return i&&function(e,t,r,n={}){!function(e,t,r,n={}){e.host=`${t}:${r}`,e._protocol="http";let{mockUserToken:i}=n;i&&(e._overrideAuthToken="string"==typeof i?i:(0,l.Sg)(i,e.app.options.projectId))}(e,t,r,n)}(n,...i),n}(0,o.Xd)(new u.wA(es,function(e,{instanceIdentifier:t}){let r=e.getProvider("app").getImmediate(),n=e.getProvider("auth-internal"),i=e.getProvider("app-check-internal");return new er(r,n,i,t,o.Jn)},"PUBLIC").setMultipleInstances(!0)),(0,o.KN)(en,ei,""),(0,o.KN)(en,ei,"esm2017")},93513:function(e,t,r){"use strict";r.d(t,{Js:function(){return f},QE:function(){return Q},Uy:function(){return G},Vk:function(){return B},aS:function(){return W},mv:function(){return u},o$:function(){return c},vI:function(){return H}});var n,i=Symbol.for("immer-nothing"),s=Symbol.for("immer-draftable"),a=Symbol.for("immer-state");function o(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var l=Object.getPrototypeOf;function u(e){return!!e&&!!e[a]}function c(e){return!!e&&(d(e)||Array.isArray(e)||!!e[s]||!!e.constructor?.[s]||w(e)||b(e))}var h=Object.prototype.constructor.toString();function d(e){if(!e||"object"!=typeof e)return!1;let t=l(e);if(null===t)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===h}function f(e){return u(e)||o(15,e),e[a].base_}function p(e,t){0===m(e)?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function m(e){let t=e[a];return t?t.type_:Array.isArray(e)?1:w(e)?2:b(e)?3:0}function g(e,t){return 2===m(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function y(e,t){return 2===m(e)?e.get(t):e[t]}function v(e,t,r){let n=m(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function w(e){return e instanceof Map}function b(e){return e instanceof Set}function _(e){return e.copy_||e.base_}function E(e,t){if(w(e))return new Map(e);if(b(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=d(e);if(!0!==t&&("class_only"!==t||r)){let t=l(e);if(null!==t&&r)return{...e};let n=Object.create(t);return Object.assign(n,e)}{let t=Object.getOwnPropertyDescriptors(e);delete t[a];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){let i=r[n],s=t[i];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(l(e),t)}}function T(e,t=!1){return I(e)||u(e)||!c(e)||(m(e)>1&&(e.set=e.add=e.clear=e.delete=S),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>T(t,!0))),e}function S(){o(2)}function I(e){return Object.isFrozen(e)}var k={};function C(e){let t=k[e];return t||o(0,e),t}function A(e,t){t&&(C("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function x(e){O(e),e.drafts_.forEach(N),e.drafts_=null}function O(e){e===n&&(n=e.parent_)}function R(e){return n={drafts_:[],parent_:n,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function N(e){let t=e[a];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function D(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0],n=void 0!==e&&e!==r;return n?(r[a].modified_&&(x(t),o(4)),c(e)&&(e=P(t,e),t.parent_||L(t,e)),t.patches_&&C("Patches").generateReplacementPatches_(r[a].base_,e,t.patches_,t.inversePatches_)):e=P(t,r,[]),x(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==i?e:void 0}function P(e,t,r){if(I(t))return t;let n=t[a];if(!n)return p(t,(i,s)=>M(e,n,t,i,s,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return L(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let t=n.copy_,i=t,s=!1;3===n.type_&&(i=new Set(t),t.clear(),s=!0),p(i,(i,a)=>M(e,n,t,i,a,r,s)),L(e,t,!1),r&&e.patches_&&C("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function M(e,t,r,n,i,s,a){if(u(i)){let a=s&&t&&3!==t.type_&&!g(t.assigned_,n)?s.concat(n):void 0,o=P(e,i,a);if(v(r,n,o),!u(o))return;e.canAutoFreeze_=!1}else a&&r.add(i);if(c(i)&&!I(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;P(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&Object.prototype.propertyIsEnumerable.call(r,n)&&L(e,i)}}function L(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&T(t,r)}var F={get(e,t){if(t===a)return e;let r=_(e);if(!g(r,t))return function(e,t,r){let n=V(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);let n=r[t];return e.finalized_||!c(n)?n:n===U(e.base_,t)?(q(e),e.copy_[t]=z(n,e)):n},has:(e,t)=>t in _(e),ownKeys:e=>Reflect.ownKeys(_(e)),set(e,t,r){let n=V(_(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=U(_(e),t),i=n?.[a];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if((r===n?0!==r||1/r==1/n:r!=r&&n!=n)&&(void 0!==r||g(e.base_,t)))return!0;q(e),$(e)}return!!(e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=r,e.assigned_[t]=!0,!0)},deleteProperty:(e,t)=>(void 0!==U(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,q(e),$(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=_(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){o(11)},getPrototypeOf:e=>l(e.base_),setPrototypeOf(){o(12)}},j={};function U(e,t){let r=e[a],n=r?_(r):e;return n[t]}function V(e,t){if(!(t in e))return;let r=l(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=l(r)}}function $(e){!e.modified_&&(e.modified_=!0,e.parent_&&$(e.parent_))}function q(e){e.copy_||(e.copy_=E(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function z(e,t){let r=w(e)?C("MapSet").proxyMap_(e,t):b(e)?C("MapSet").proxySet_(e,t):function(e,t){let r=Array.isArray(e),i={type_:r?1:0,scope_:t?t.scope_:n,modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=i,a=F;r&&(s=[i],a=j);let{revoke:o,proxy:l}=Proxy.revocable(s,a);return i.draft_=l,i.revoke_=o,l}(e,t),i=t?t.scope_:n;return i.drafts_.push(r),r}function B(e){return u(e)||o(10,e),function e(t){let r;if(!c(t)||I(t))return t;let n=t[a];if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=E(t,n.scope_.immer_.useStrictShallowCopy_)}else r=E(t,!0);return p(r,(t,n)=>{v(r,t,e(n))}),n&&(n.finalized_=!1),r}(e)}function H(){var e;let t="replace",r="remove";function n(e){if(!c(e))return e;if(Array.isArray(e))return e.map(n);if(w(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,n(t)]));if(b(e))return new Set(Array.from(e).map(n));let t=Object.create(l(e));for(let r in e)t[r]=n(e[r]);return g(e,s)&&(t[s]=e[s]),t}function a(e){return u(e)?n(e):e}k[e="Patches"]||(k[e]={applyPatches_:function(e,i){return i.forEach(i=>{let{path:s,op:a}=i,l=e;for(let e=0;e<s.length-1;e++){let t=m(l),r=s[e];"string"!=typeof r&&"number"!=typeof r&&(r=""+r),(0===t||1===t)&&("__proto__"===r||"constructor"===r)&&o(19),"function"==typeof l&&"prototype"===r&&o(19),"object"!=typeof(l=y(l,r))&&o(18,s.join("/"))}let u=m(l),c=n(i.value),h=s[s.length-1];switch(a){case t:switch(u){case 2:return l.set(h,c);case 3:o(16);default:return l[h]=c}case"add":switch(u){case 1:return"-"===h?l.push(c):l.splice(h,0,c);case 2:return l.set(h,c);case 3:return l.add(c);default:return l[h]=c}case r:switch(u){case 1:return l.splice(h,1);case 2:return l.delete(h);case 3:return l.delete(i.value);default:return delete l[h]}default:o(17,a)}}),e},generatePatches_:function(e,n,i,s){switch(e.type_){case 0:case 2:return function(e,n,i,s){let{base_:o,copy_:l}=e;p(e.assigned_,(e,u)=>{let c=y(o,e),h=y(l,e),d=u?g(o,e)?t:"add":r;if(c===h&&d===t)return;let f=n.concat(e);i.push(d===r?{op:d,path:f}:{op:d,path:f,value:h}),s.push("add"===d?{op:r,path:f}:d===r?{op:"add",path:f,value:a(c)}:{op:t,path:f,value:a(c)})})}(e,n,i,s);case 1:return function(e,n,i,s){let{base_:o,assigned_:l}=e,u=e.copy_;u.length<o.length&&([o,u]=[u,o],[i,s]=[s,i]);for(let e=0;e<o.length;e++)if(l[e]&&u[e]!==o[e]){let r=n.concat([e]);i.push({op:t,path:r,value:a(u[e])}),s.push({op:t,path:r,value:a(o[e])})}for(let e=o.length;e<u.length;e++){let t=n.concat([e]);i.push({op:"add",path:t,value:a(u[e])})}for(let e=u.length-1;o.length<=e;--e){let t=n.concat([e]);s.push({op:r,path:t})}}(e,n,i,s);case 3:return function(e,t,n,i){let{base_:s,copy_:a}=e,o=0;s.forEach(e=>{if(!a.has(e)){let s=t.concat([o]);n.push({op:r,path:s,value:e}),i.unshift({op:"add",path:s,value:e})}o++}),o=0,a.forEach(e=>{if(!s.has(e)){let s=t.concat([o]);n.push({op:"add",path:s,value:e}),i.unshift({op:r,path:s,value:e})}o++})}(e,n,i,s)}},generateReplacementPatches_:function(e,r,n,s){n.push({op:t,path:[],value:r===i?void 0:r}),s.push({op:t,path:[],value:e})}})}p(F,(e,t)=>{j[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),j.deleteProperty=function(e,t){return j.set.call(this,e,t,void 0)},j.set=function(e,t,r){return F.set.call(this,e[0],t,r,e[0])};var K=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{let n;if("function"==typeof e&&"function"!=typeof t){let r=t;t=e;let n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}if("function"!=typeof t&&o(6),void 0!==r&&"function"!=typeof r&&o(7),c(e)){let i=R(this),s=z(e,void 0),a=!0;try{n=t(s),a=!1}finally{a?x(i):O(i)}return A(i,r),D(n,i)}if(e&&"object"==typeof e)o(1,e);else{if(void 0===(n=t(e))&&(n=e),n===i&&(n=void 0),this.autoFreeze_&&T(n,!0),r){let t=[],i=[];C("Patches").generateReplacementPatches_(e,n,t,i),r(t,i)}return n}},this.produceWithPatches=(e,t)=>{let r,n;if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let i=this.produce(e,t,(e,t)=>{r=e,n=t});return[i,r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){c(e)||o(8),u(e)&&(e=B(e));let t=R(this),r=z(e,void 0);return r[a].isManual_=!0,O(t),r}finishDraft(e,t){let r=e&&e[a];r&&r.isManual_||o(9);let{scope_:n}=r;return A(n,t),D(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=C("Patches").applyPatches_;return u(e)?n(e,t):this.produce(e,e=>n(e,t))}},G=K.produce,W=K.produceWithPatches.bind(K);K.setAutoFreeze.bind(K),K.setUseStrictShallowCopy.bind(K);var Q=K.applyPatches.bind(K);K.createDraft.bind(K),K.finishDraft.bind(K)},87536:function(e,t,r){"use strict";r.d(t,{Gc:function(){return k},KN:function(){return P},RV:function(){return C},U2:function(){return y},cI:function(){return ev}});var n=r(67294),i=e=>"checkbox"===e.type,s=e=>e instanceof Date,a=e=>null==e;let o=e=>"object"==typeof e;var l=e=>!a(e)&&!Array.isArray(e)&&o(e)&&!s(e),u=e=>l(e)&&e.target?i(e.target)?e.target.checked:e.target.value:e,c=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,h=(e,t)=>e.has(c(t)),d=e=>{let t=e.constructor&&e.constructor.prototype;return l(t)&&t.hasOwnProperty("isPrototypeOf")},f="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function p(e){let t;let r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(!(f&&(e instanceof Blob||e instanceof FileList))&&(r||l(e))))return e;else if(t=r?[]:{},r||d(e))for(let r in e)e.hasOwnProperty(r)&&(t[r]=p(e[r]));else t=e;return t}var m=e=>Array.isArray(e)?e.filter(Boolean):[],g=e=>void 0===e,y=(e,t,r)=>{if(!t||!l(e))return r;let n=m(t.split(/[,[\].]+?/)).reduce((e,t)=>a(e)?e:e[t],e);return g(n)||n===e?g(e[t])?r:e[t]:n},v=e=>"boolean"==typeof e,w=e=>/^\w*$/.test(e),b=e=>m(e.replace(/["|']|\]/g,"").split(/\.|\[/)),_=(e,t,r)=>{let n=-1,i=w(t)?[t]:b(t),s=i.length,a=s-1;for(;++n<s;){let t=i[n],s=r;if(n!==a){let r=e[t];s=l(r)||Array.isArray(r)?r:isNaN(+i[n+1])?{}:[]}if("__proto__"===t)return;e[t]=s,e=e[t]}return e};let E={BLUR:"blur",FOCUS_OUT:"focusout"},T={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},S={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},I=n.createContext(null),k=()=>n.useContext(I),C=e=>{let{children:t,...r}=e;return n.createElement(I.Provider,{value:r},t)};var A=(e,t,r,n=!0)=>{let i={defaultValues:t._defaultValues};for(let s in e)Object.defineProperty(i,s,{get:()=>(t._proxyFormState[s]!==T.all&&(t._proxyFormState[s]=!n||T.all),r&&(r[s]=!0),e[s])});return i},x=e=>l(e)&&!Object.keys(e).length,O=(e,t,r,n)=>{r(e);let{name:i,...s}=e;return x(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||T.all))},R=e=>Array.isArray(e)?e:[e],N=e=>"string"==typeof e,D=(e,t,r,n,i)=>N(e)?(n&&t.watch.add(e),y(r,e,i)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),y(r,e))):(n&&(t.watchAll=!0),r),P=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},M=e=>({isOnSubmit:!e||e===T.onSubmit,isOnBlur:e===T.onBlur,isOnChange:e===T.onChange,isOnAll:e===T.all,isOnTouch:e===T.onTouched}),L=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));let F=(e,t,r,n)=>{for(let i of r||Object.keys(e)){let r=y(e,i);if(r){let{_f:e,...s}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!n||e.ref&&t(e.ref,e.name)&&!n)break;F(s,t)}else l(s)&&F(s,t)}}};var j=(e,t,r)=>{let n=m(y(e,r));return _(n,"root",t[r]),_(e,r,n),e},U=e=>"file"===e.type,V=e=>"function"==typeof e,$=e=>{if(!f)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},q=e=>N(e),z=e=>"radio"===e.type,B=e=>e instanceof RegExp;let H={value:!1,isValid:!1},K={value:!0,isValid:!0};var G=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!g(e[0].attributes.value)?g(e[0].value)||""===e[0].value?K:{value:e[0].value,isValid:!0}:K:H}return H};let W={isValid:!1,value:null};var Q=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,W):W;function J(e,t,r="validate"){if(q(e)||Array.isArray(e)&&e.every(q)||v(e)&&!e)return{type:r,message:q(e)?e:"",ref:t}}var Y=e=>l(e)&&!B(e)?e:{value:e,message:""},X=async(e,t,r,n,s)=>{let{ref:o,refs:u,required:c,maxLength:h,minLength:d,min:f,max:p,pattern:m,validate:w,name:b,valueAsNumber:_,mount:E,disabled:T}=e._f,I=y(t,b);if(!E||T)return{};let k=u?u[0]:o,C=e=>{n&&k.reportValidity&&(k.setCustomValidity(v(e)?"":e||""),k.reportValidity())},A={},O=z(o),R=i(o),D=(_||U(o))&&g(o.value)&&g(I)||$(o)&&""===o.value||""===I||Array.isArray(I)&&!I.length,M=P.bind(null,b,r,A),L=(e,t,r,n=S.maxLength,i=S.minLength)=>{let s=e?t:r;A[b]={type:e?n:i,message:s,ref:o,...M(e?n:i,s)}};if(s?!Array.isArray(I)||!I.length:c&&(!(O||R)&&(D||a(I))||v(I)&&!I||R&&!G(u).isValid||O&&!Q(u).isValid)){let{value:e,message:t}=q(c)?{value:!!c,message:c}:Y(c);if(e&&(A[b]={type:S.required,message:t,ref:k,...M(S.required,t)},!r))return C(t),A}if(!D&&(!a(f)||!a(p))){let e,t;let n=Y(p),i=Y(f);if(a(I)||isNaN(I)){let r=o.valueAsDate||new Date(I),s=e=>new Date(new Date().toDateString()+" "+e),a="time"==o.type,l="week"==o.type;N(n.value)&&I&&(e=a?s(I)>s(n.value):l?I>n.value:r>new Date(n.value)),N(i.value)&&I&&(t=a?s(I)<s(i.value):l?I<i.value:r<new Date(i.value))}else{let r=o.valueAsNumber||(I?+I:I);a(n.value)||(e=r>n.value),a(i.value)||(t=r<i.value)}if((e||t)&&(L(!!e,n.message,i.message,S.max,S.min),!r))return C(A[b].message),A}if((h||d)&&!D&&(N(I)||s&&Array.isArray(I))){let e=Y(h),t=Y(d),n=!a(e.value)&&I.length>+e.value,i=!a(t.value)&&I.length<+t.value;if((n||i)&&(L(n,e.message,t.message),!r))return C(A[b].message),A}if(m&&!D&&N(I)){let{value:e,message:t}=Y(m);if(B(e)&&!I.match(e)&&(A[b]={type:S.pattern,message:t,ref:o,...M(S.pattern,t)},!r))return C(t),A}if(w){if(V(w)){let e=await w(I,t),n=J(e,k);if(n&&(A[b]={...n,...M(S.validate,n.message)},!r))return C(n.message),A}else if(l(w)){let e={};for(let n in w){if(!x(e)&&!r)break;let i=J(await w[n](I,t),k,n);i&&(e={...i,...M(n,i.message)},C(i.message),r&&(A[b]=e))}if(!x(e)&&(A[b]={ref:k,...e},!r))return A}}return C(!0),A};function Z(e,t){let r=Array.isArray(t)?t:w(t)?[t]:b(t),n=1===r.length?e:function(e,t){let r=t.slice(0,-1).length,n=0;for(;n<r;)e=g(e)?n++:e[t[n++]];return e}(e,r),i=r.length-1,s=r[i];return n&&delete n[s],0!==i&&(l(n)&&x(n)||Array.isArray(n)&&function(e){for(let t in e)if(e.hasOwnProperty(t)&&!g(e[t]))return!1;return!0}(n))&&Z(e,r.slice(0,-1)),e}var ee=()=>{let e=[];return{get observers(){return e},next:t=>{for(let r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},et=e=>a(e)||!o(e);function er(e,t){if(et(e)||et(t))return e===t;if(s(e)&&s(t))return e.getTime()===t.getTime();let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i of r){let r=e[i];if(!n.includes(i))return!1;if("ref"!==i){let e=t[i];if(s(r)&&s(e)||l(r)&&l(e)||Array.isArray(r)&&Array.isArray(e)?!er(r,e):r!==e)return!1}}return!0}var en=e=>"select-multiple"===e.type,ei=e=>z(e)||i(e),es=e=>$(e)&&e.isConnected,ea=e=>{for(let t in e)if(V(e[t]))return!0;return!1};function eo(e,t={}){let r=Array.isArray(e);if(l(e)||r)for(let r in e)Array.isArray(e[r])||l(e[r])&&!ea(e[r])?(t[r]=Array.isArray(e[r])?[]:{},eo(e[r],t[r])):a(e[r])||(t[r]=!0);return t}var el=(e,t)=>(function e(t,r,n){let i=Array.isArray(t);if(l(t)||i)for(let i in t)Array.isArray(t[i])||l(t[i])&&!ea(t[i])?g(r)||et(n[i])?n[i]=Array.isArray(t[i])?eo(t[i],[]):{...eo(t[i])}:e(t[i],a(r)?{}:r[i],n[i]):n[i]=!er(t[i],r[i]);return n})(e,t,eo(t)),eu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>g(e)?e:t?""===e?NaN:e?+e:e:r&&N(e)?new Date(e):n?n(e):e;function ec(e){let t=e.ref;return(e.refs?e.refs.every(e=>e.disabled):t.disabled)?void 0:U(t)?t.files:z(t)?Q(e.refs).value:en(t)?[...t.selectedOptions].map(({value:e})=>e):i(t)?G(e.refs).value:eu(g(t.value)?e.ref.value:t.value,e)}var eh=(e,t,r,n)=>{let i={};for(let r of e){let e=y(t,r);e&&_(i,r,e._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},ed=e=>g(e)?e:B(e)?e.source:l(e)?B(e.value)?e.value.source:e.value:e,ef=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function ep(e,t,r){let n=y(e,r);if(n||w(r))return{error:n,name:r};let i=r.split(".");for(;i.length;){let n=i.join("."),s=y(t,n),a=y(e,n);if(s&&!Array.isArray(s)&&r!==n)break;if(a&&a.type)return{name:n,error:a};i.pop()}return{name:r}}var em=(e,t,r,n,i)=>!i.isOnAll&&(!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?!n.isOnChange:!i.isOnChange)||e),eg=(e,t)=>!m(y(e,t)).length&&Z(e,t);let ey={mode:T.onSubmit,reValidateMode:T.onChange,shouldFocusError:!0};function ev(e={}){let t=n.useRef(),r=n.useRef(),[o,c]=n.useState({isDirty:!1,isValidating:!1,isLoading:V(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:V(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...function(e={}){let t,r={...ey,...e},n={submitCount:0,isDirty:!1,isLoading:V(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},c=(l(r.defaultValues)||l(r.values))&&p(r.defaultValues||r.values)||{},d=r.shouldUnregister?{}:p(c),w={action:!1,mount:!1,watch:!1},b={mount:new Set,unMount:new Set,array:new Set,watch:new Set},S=0,I={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},k={values:ee(),array:ee(),state:ee()},C=M(r.mode),A=M(r.reValidateMode),O=r.criteriaMode===T.all,P=e=>t=>{clearTimeout(S),S=setTimeout(e,t)},q=async e=>{if(I.isValid||e){let e=r.resolver?x((await W()).errors):await J(o,!0);e!==n.isValid&&k.state.next({isValid:e})}},z=(e,t)=>{(I.isValidating||I.validatingFields)&&((e||Array.from(b.mount)).forEach(e=>{e&&(t?_(n.validatingFields,e,t):Z(n.validatingFields,e))}),k.state.next({validatingFields:n.validatingFields,isValidating:!x(n.validatingFields)}))},B=(e,t)=>{_(n.errors,e,t),k.state.next({errors:n.errors})},H=(e,t,r,n)=>{let i=y(o,e);if(i){let s=y(d,e,g(r)?y(c,e):r);g(s)||n&&n.defaultChecked||t?_(d,e,t?s:ec(i._f)):eo(e,s),w.mount&&q()}},K=(e,t,r,i,s)=>{let a=!1,l=!1,u={name:e},h=!!(y(o,e)&&y(o,e)._f.disabled);if(!r||i){I.isDirty&&(l=n.isDirty,n.isDirty=u.isDirty=Y(),a=l!==u.isDirty);let r=h||er(y(c,e),t);l=!!(!h&&y(n.dirtyFields,e)),r||h?Z(n.dirtyFields,e):_(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,a=a||I.dirtyFields&&!r!==l}if(r){let t=y(n.touchedFields,e);t||(_(n.touchedFields,e,r),u.touchedFields=n.touchedFields,a=a||I.touchedFields&&t!==r)}return a&&s&&k.state.next(u),a?u:{}},G=(r,i,s,a)=>{let o=y(n.errors,r),l=I.isValid&&v(i)&&n.isValid!==i;if(e.delayError&&s?(t=P(()=>B(r,s)))(e.delayError):(clearTimeout(S),t=null,s?_(n.errors,r,s):Z(n.errors,r)),(s?!er(o,s):o)||!x(a)||l){let e={...a,...l&&v(i)?{isValid:i}:{},errors:n.errors,name:r};n={...n,...e},k.state.next(e)}},W=async e=>{z(e,!0);let t=await r.resolver(d,r.context,eh(e||b.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return z(e),t},Q=async e=>{let{errors:t}=await W(e);if(e)for(let r of e){let e=y(t,r);e?_(n.errors,r,e):Z(n.errors,r)}else n.errors=t;return t},J=async(e,t,i={valid:!0})=>{for(let s in e){let a=e[s];if(a){let{_f:e,...o}=a;if(e){let o=b.array.has(e.name);z([s],!0);let l=await X(a,d,O,r.shouldUseNativeValidation&&!t,o);if(z([s]),l[e.name]&&(i.valid=!1,t))break;t||(y(l,e.name)?o?j(n.errors,l,e.name):_(n.errors,e.name,l[e.name]):Z(n.errors,e.name))}o&&await J(o,t,i)}}return i.valid},Y=(e,t)=>(e&&t&&_(d,e,t),!er(eT(),c)),ea=(e,t,r)=>D(e,b,{...w.mount?d:g(t)?c:N(e)?{[e]:t}:t},r,t),eo=(e,t,r={})=>{let n=y(o,e),s=t;if(n){let r=n._f;r&&(r.disabled||_(d,e,eu(t,r)),s=$(r.ref)&&a(t)?"":t,en(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?i(r.ref)?r.refs.length>1?r.refs.forEach(e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(s)?!!s.find(t=>t===e.value):s===e.value)):r.refs[0]&&(r.refs[0].checked=!!s):r.refs.forEach(e=>e.checked=e.value===s):U(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||k.values.next({name:e,values:{...d}})))}(r.shouldDirty||r.shouldTouch)&&K(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&eE(e)},ev=(e,t,r)=>{for(let n in t){let i=t[n],a=`${e}.${n}`,l=y(o,a);!b.array.has(e)&&et(i)&&(!l||l._f)||s(i)?eo(a,i,r):ev(a,i,r)}},ew=(e,t,r={})=>{let i=y(o,e),s=b.array.has(e),l=p(t);_(d,e,l),s?(k.array.next({name:e,values:{...d}}),(I.isDirty||I.dirtyFields)&&r.shouldDirty&&k.state.next({name:e,dirtyFields:el(c,d),isDirty:Y(e,l)})):!i||i._f||a(l)?eo(e,l,r):ev(e,l,r),L(e,b)&&k.state.next({...n}),k.values.next({name:w.mount?e:void 0,values:{...d}})},eb=async e=>{w.mount=!0;let i=e.target,s=i.name,a=!0,l=y(o,s),c=e=>{a=Number.isNaN(e)||e===y(d,s,e)};if(l){let h,f;let p=i.type?ec(l._f):u(e),m=e.type===E.BLUR||e.type===E.FOCUS_OUT,g=!ef(l._f)&&!r.resolver&&!y(n.errors,s)&&!l._f.deps||em(m,y(n.touchedFields,s),n.isSubmitted,A,C),v=L(s,b,m);_(d,s,p),m?(l._f.onBlur&&l._f.onBlur(e),t&&t(0)):l._f.onChange&&l._f.onChange(e);let w=K(s,p,m,!1),T=!x(w)||v;if(m||k.values.next({name:s,type:e.type,values:{...d}}),g)return I.isValid&&q(),T&&k.state.next({name:s,...v?{}:w});if(!m&&v&&k.state.next({...n}),r.resolver){let{errors:e}=await W([s]);if(c(p),a){let t=ep(n.errors,o,s),r=ep(e,o,t.name||s);h=r.error,s=r.name,f=x(e)}}else z([s],!0),h=(await X(l,d,O,r.shouldUseNativeValidation))[s],z([s]),c(p),a&&(h?f=!1:I.isValid&&(f=await J(o,!0)));a&&(l._f.deps&&eE(l._f.deps),G(s,f,h,w))}},e_=(e,t)=>{if(y(n.errors,t)&&e.focus)return e.focus(),1},eE=async(e,t={})=>{let i,s;let a=R(e);if(r.resolver){let t=await Q(g(e)?e:a);i=x(t),s=e?!a.some(e=>y(t,e)):i}else e?((s=(await Promise.all(a.map(async e=>{let t=y(o,e);return await J(t&&t._f?{[e]:t}:t)}))).every(Boolean))||n.isValid)&&q():s=i=await J(o);return k.state.next({...!N(e)||I.isValid&&i!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:n.errors}),t.shouldFocus&&!s&&F(o,e_,e?a:b.mount),s},eT=e=>{let t={...w.mount?d:c};return g(e)?t:N(e)?y(t,e):e.map(e=>y(t,e))},eS=(e,t)=>({invalid:!!y((t||n).errors,e),isDirty:!!y((t||n).dirtyFields,e),isTouched:!!y((t||n).touchedFields,e),isValidating:!!y((t||n).validatingFields,e),error:y((t||n).errors,e)}),eI=(e,t,r)=>{let i=(y(o,e,{_f:{}})._f||{}).ref,s=y(n.errors,e)||{},{ref:a,message:l,type:u,...c}=s;_(n.errors,e,{...c,...t,ref:i}),k.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},ek=(e,t={})=>{for(let i of e?R(e):b.mount)b.mount.delete(i),b.array.delete(i),t.keepValue||(Z(o,i),Z(d,i)),t.keepError||Z(n.errors,i),t.keepDirty||Z(n.dirtyFields,i),t.keepTouched||Z(n.touchedFields,i),t.keepIsValidating||Z(n.validatingFields,i),r.shouldUnregister||t.keepDefaultValue||Z(c,i);k.values.next({values:{...d}}),k.state.next({...n,...t.keepDirty?{isDirty:Y()}:{}}),t.keepIsValid||q()},eC=({disabled:e,name:t,field:r,fields:n,value:i})=>{if(v(e)&&w.mount||e){let s=e?void 0:g(i)?ec(r?r._f:y(n,t)._f):i;_(d,t,s),K(t,s,!1,!1,!0)}},eA=(e,t={})=>{let n=y(o,e),i=v(t.disabled);return _(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),b.mount.add(e),n?eC({field:n,disabled:t.disabled,name:e,value:t.value}):H(e,!0,t.value),{...i?{disabled:t.disabled}:{},...r.progressive?{required:!!t.required,min:ed(t.min),max:ed(t.max),minLength:ed(t.minLength),maxLength:ed(t.maxLength),pattern:ed(t.pattern)}:{},name:e,onChange:eb,onBlur:eb,ref:i=>{if(i){eA(e,t),n=y(o,e);let r=g(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=ei(r),a=n._f.refs||[];(s?a.find(e=>e===r):r===n._f.ref)||(_(o,e,{_f:{...n._f,...s?{refs:[...a.filter(es),r,...Array.isArray(y(c,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),H(e,!1,void 0,r))}else(n=y(o,e,{}))._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&!(h(b.array,e)&&w.action)&&b.unMount.add(e)}}},ex=()=>r.shouldFocusError&&F(o,e_,b.mount),eO=(e,t)=>async i=>{let s;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let a=p(d);if(k.state.next({isSubmitting:!0}),r.resolver){let{errors:e,values:t}=await W();n.errors=e,a=t}else await J(o);if(Z(n.errors,"root"),x(n.errors)){k.state.next({errors:{}});try{await e(a,i)}catch(e){s=e}}else t&&await t({...n.errors},i),ex(),setTimeout(ex);if(k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:x(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},eR=(t,r={})=>{let i=t?p(t):c,s=p(i),a=x(t),l=a?c:s;if(r.keepDefaultValues||(c=i),!r.keepValues){if(r.keepDirtyValues)for(let e of b.mount)y(n.dirtyFields,e)?_(l,e,y(d,e)):ew(e,y(l,e));else{if(f&&g(t))for(let e of b.mount){let t=y(o,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if($(e)){let t=e.closest("form");if(t){t.reset();break}}}}o={}}d=e.shouldUnregister?r.keepDefaultValues?p(c):{}:p(l),k.array.next({values:{...l}}),k.values.next({values:{...l}})}b={mount:r.keepDirtyValues?b.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},w.mount=!I.isValid||!!r.keepIsValid||!!r.keepDirtyValues,w.watch=!!e.shouldUnregister,k.state.next({submitCount:r.keepSubmitCount?n.submitCount:0,isDirty:!a&&(r.keepDirty?n.isDirty:!!(r.keepDefaultValues&&!er(t,c))),isSubmitted:!!r.keepIsSubmitted&&n.isSubmitted,dirtyFields:a?[]:r.keepDirtyValues?r.keepDefaultValues&&d?el(c,d):n.dirtyFields:r.keepDefaultValues&&t?el(c,t):{},touchedFields:r.keepTouched?n.touchedFields:{},errors:r.keepErrors?n.errors:{},isSubmitSuccessful:!!r.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},eN=(e,t)=>eR(V(e)?e(d):e,t);return{control:{register:eA,unregister:ek,getFieldState:eS,handleSubmit:eO,setError:eI,_executeSchema:W,_getWatch:ea,_getDirty:Y,_updateValid:q,_removeUnmounted:()=>{for(let e of b.unMount){let t=y(o,e);t&&(t._f.refs?t._f.refs.every(e=>!es(e)):!es(t._f.ref))&&ek(e)}b.unMount=new Set},_updateFieldArray:(e,t=[],r,i,s=!0,a=!0)=>{if(i&&r){if(w.action=!0,a&&Array.isArray(y(o,e))){let t=r(y(o,e),i.argA,i.argB);s&&_(o,e,t)}if(a&&Array.isArray(y(n.errors,e))){let t=r(y(n.errors,e),i.argA,i.argB);s&&_(n.errors,e,t),eg(n.errors,e)}if(I.touchedFields&&a&&Array.isArray(y(n.touchedFields,e))){let t=r(y(n.touchedFields,e),i.argA,i.argB);s&&_(n.touchedFields,e,t)}I.dirtyFields&&(n.dirtyFields=el(c,d)),k.state.next({name:e,isDirty:Y(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else _(d,e,t)},_updateDisabledField:eC,_getFieldArray:t=>m(y(w.mount?d:c,t,e.shouldUnregister?y(c,t,[]):[])),_reset:eR,_resetDefaultValues:()=>V(r.defaultValues)&&r.defaultValues().then(e=>{eN(e,r.resetOptions),k.state.next({isLoading:!1})}),_updateFormState:e=>{n={...n,...e}},_disableForm:e=>{v(e)&&(k.state.next({disabled:e}),F(o,(t,r)=>{let n=y(o,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:k,_proxyFormState:I,_setErrors:e=>{n.errors=e,k.state.next({errors:n.errors,isValid:!1})},get _fields(){return o},get _formValues(){return d},get _state(){return w},set _state(value){w=value},get _defaultValues(){return c},get _names(){return b},set _names(value){b=value},get _formState(){return n},set _formState(value){n=value},get _options(){return r},set _options(value){r={...r,...value}}},trigger:eE,register:eA,handleSubmit:eO,watch:(e,t)=>V(e)?k.values.subscribe({next:r=>e(ea(void 0,t),r)}):ea(e,t,!0),setValue:ew,getValues:eT,reset:eN,resetField:(e,t={})=>{y(o,e)&&(g(t.defaultValue)?ew(e,p(y(c,e))):(ew(e,t.defaultValue),_(c,e,p(t.defaultValue))),t.keepTouched||Z(n.touchedFields,e),t.keepDirty||(Z(n.dirtyFields,e),n.isDirty=t.defaultValue?Y(e,p(y(c,e))):Y()),!t.keepError&&(Z(n.errors,e),I.isValid&&q()),k.state.next({...n}))},clearErrors:e=>{e&&R(e).forEach(e=>Z(n.errors,e)),k.state.next({errors:e?n.errors:{}})},unregister:ek,setError:eI,setFocus:(e,t={})=>{let r=y(o,e),n=r&&r._f;if(n){let e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:eS}}(e),formState:o});let d=t.current.control;return d._options=e,!function(e){let t=n.useRef(e);t.current=e,n.useEffect(()=>{let r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}({subject:d._subjects.state,next:e=>{O(e,d._proxyFormState,d._updateFormState,!0)&&c({...d._formState})}}),n.useEffect(()=>d._disableForm(e.disabled),[d,e.disabled]),n.useEffect(()=>{if(d._proxyFormState.isDirty){let e=d._getDirty();e!==o.isDirty&&d._subjects.state.next({isDirty:e})}},[d,o.isDirty]),n.useEffect(()=>{e.values&&!er(e.values,r.current)?(d._reset(e.values,d._options.resetOptions),r.current=e.values,c(e=>({...e}))):d._resetDefaultValues()},[e.values,d]),n.useEffect(()=>{e.errors&&d._setErrors(e.errors)},[e.errors,d]),n.useEffect(()=>{d._state.mount||(d._updateValid(),d._state.mount=!0),d._state.watch&&(d._state.watch=!1,d._subjects.state.next({...d._formState})),d._removeUnmounted()}),n.useEffect(()=>{e.shouldUnregister&&d._subjects.values.next({values:d._getWatch()})},[e.shouldUnregister,d]),t.current.formState=A(o,d),t.current}},86501:function(e,t,r){"use strict";let n,i;r.d(t,{x7:function(){return ei},ZP:function(){return es},Am:function(){return j}});var s,a=r(67294);let o={data:""},l=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||o,u=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,c=/\/\*[^]*?\*\/|  +/g,h=/\n+/g,d=(e,t)=>{let r="",n="",i="";for(let s in e){let a=e[s];"@"==s[0]?"i"==s[1]?r=s+" "+a+";":n+="f"==s[1]?d(a,s):s+"{"+d(a,"k"==s[1]?"":t)+"}":"object"==typeof a?n+=d(a,t?t.replace(/([^,])+/g,e=>s.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):s):null!=a&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=d.p?d.p(s,a):s+":"+a+";")}return r+(t&&i?t+"{"+i+"}":i)+n},f={},p=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+p(e[r]);return t}return e},m=(e,t,r,n,i)=>{var s;let a=p(e),o=f[a]||(f[a]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(a));if(!f[o]){let t=a!==e?e:(e=>{let t,r,n=[{}];for(;t=u.exec(e.replace(c,""));)t[4]?n.shift():t[3]?(r=t[3].replace(h," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(h," ").trim();return n[0]})(e);f[o]=d(i?{["@keyframes "+o]:t}:t,r?"":"."+o)}let l=r&&f.g?f.g:null;return r&&(f.g=f[o]),s=f[o],l?t.data=t.data.replace(l,s):-1===t.data.indexOf(s)&&(t.data=n?s+t.data:t.data+s),o},g=(e,t,r)=>e.reduce((e,n,i)=>{let s=t[i];if(s&&s.call){let e=s(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;s=t?"."+t:e&&"object"==typeof e?e.props?"":d(e,""):!1===e?"":e}return e+n+(null==s?"":s)},"");function y(e){let t=this||{},r=e.call?e(t.p):e;return m(r.unshift?r.raw?g(r,[].slice.call(arguments,1),t.p):r.reduce((e,r)=>Object.assign(e,r&&r.call?r(t.p):r),{}):r,l(t.target),t.g,t.o,t.k)}y.bind({g:1});let v,w,b,_=y.bind({k:1});function E(e,t){let r=this||{};return function(){let n=arguments;function i(s,a){let o=Object.assign({},s),l=o.className||i.className;r.p=Object.assign({theme:w&&w()},o),r.o=/ *go\d+/.test(l),o.className=y.apply(r,n)+(l?" "+l:""),t&&(o.ref=a);let u=e;return e[0]&&(u=o.as||e,delete o.as),b&&u[0]&&b(o),v(u,o)}return t?t(i):i}}var T=e=>"function"==typeof e,S=(e,t)=>T(e)?e(t):e,I=(n=0,()=>(++n).toString()),k=()=>{if(void 0===i&&"u">typeof window){let e=matchMedia("(prefers-reduced-motion: reduce)");i=!e||e.matches}return i},C=new Map,A=e=>{if(C.has(e))return;let t=setTimeout(()=>{C.delete(e),D({type:4,toastId:e})},1e3);C.set(e,t)},x=e=>{let t=C.get(e);t&&clearTimeout(t)},O=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return t.toast.id&&x(t.toast.id),{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return e.toasts.find(e=>e.id===r.id)?O(e,{type:1,toast:r}):O(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?A(n):e.toasts.forEach(e=>{A(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||void 0===n?{...e,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+i}))}}},R=[],N={toasts:[],pausedAt:void 0},D=e=>{N=O(N,e),R.forEach(e=>{e(N)})},P={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},M=(e={})=>{let[t,r]=(0,a.useState)(N);(0,a.useEffect)(()=>(R.push(r),()=>{let e=R.indexOf(r);e>-1&&R.splice(e,1)}),[t]);let n=t.toasts.map(t=>{var r,n;return{...e,...e[t.type],...t,duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==e?void 0:e.duration)||P[t.type],style:{...e.style,...null==(n=e[t.type])?void 0:n.style,...t.style}}});return{...t,toasts:n}},L=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(null==r?void 0:r.id)||I()}),F=e=>(t,r)=>{let n=L(t,e,r);return D({type:2,toast:n}),n.id},j=(e,t)=>F("blank")(e,t);j.error=F("error"),j.success=F("success"),j.loading=F("loading"),j.custom=F("custom"),j.dismiss=e=>{D({type:3,toastId:e})},j.remove=e=>D({type:4,toastId:e}),j.promise=(e,t,r)=>{let n=j.loading(t.loading,{...r,...null==r?void 0:r.loading});return e.then(e=>(j.success(S(t.success,e),{id:n,...r,...null==r?void 0:r.success}),e)).catch(e=>{j.error(S(t.error,e),{id:n,...r,...null==r?void 0:r.error})}),e};var U=(e,t)=>{D({type:1,toast:{id:e,height:t}})},V=()=>{D({type:5,time:Date.now()})},$=e=>{let{toasts:t,pausedAt:r}=M(e);(0,a.useEffect)(()=>{if(r)return;let e=Date.now(),n=t.map(t=>{if(t.duration===1/0)return;let r=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(r<0){t.visible&&j.dismiss(t.id);return}return setTimeout(()=>j.dismiss(t.id),r)});return()=>{n.forEach(e=>e&&clearTimeout(e))}},[t,r]);let n=(0,a.useCallback)(()=>{r&&D({type:6,time:Date.now()})},[r]),i=(0,a.useCallback)((e,r)=>{let{reverseOrder:n=!1,gutter:i=8,defaultPosition:s}=r||{},a=t.filter(t=>(t.position||s)===(e.position||s)&&t.height),o=a.findIndex(t=>t.id===e.id),l=a.filter((e,t)=>t<o&&e.visible).length;return a.filter(e=>e.visible).slice(...n?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+i,0)},[t]);return{toasts:t,handlers:{updateHeight:U,startPause:V,endPause:n,calculateOffset:i}}},q=E("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${_`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${_`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${e=>e.secondary||"#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${_`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,z=E("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${e=>e.secondary||"#e0e0e0"};
  border-right-color: ${e=>e.primary||"#616161"};
  animation: ${_`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`} 1s linear infinite;
`,B=E("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${_`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${_`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${e=>e.secondary||"#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`,H=E("div")`
  position: absolute;
`,K=E("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,G=E("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${_`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,W=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return void 0!==t?"string"==typeof t?a.createElement(G,null,t):t:"blank"===r?null:a.createElement(K,null,a.createElement(z,{...n}),"loading"!==r&&a.createElement(H,null,"error"===r?a.createElement(q,{...n}):a.createElement(B,{...n})))},Q=e=>`
0% {transform: translate3d(0,${-200*e}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,J=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${-150*e}%,-1px) scale(.6); opacity:0;}
`,Y=E("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`,X=E("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,Z=(e,t)=>{let r=e.includes("top")?1:-1,[n,i]=k()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[Q(r),J(r)];return{animation:t?`${_(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${_(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},ee=a.memo(({toast:e,position:t,style:r,children:n})=>{let i=e.height?Z(e.position||t||"top-center",e.visible):{opacity:0},s=a.createElement(W,{toast:e}),o=a.createElement(X,{...e.ariaProps},S(e.message,e));return a.createElement(Y,{className:e.className,style:{...i,...r,...e.style}},"function"==typeof n?n({icon:s,message:o}):a.createElement(a.Fragment,null,s,o))});s=a.createElement,d.p=void 0,v=s,w=void 0,b=void 0;var et=({id:e,className:t,style:r,onHeightUpdate:n,children:i})=>{let s=a.useCallback(t=>{if(t){let r=()=>{n(e,t.getBoundingClientRect().height)};r(),new MutationObserver(r).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return a.createElement("div",{ref:s,className:t,style:r},i)},er=(e,t)=>{let r=e.includes("top"),n=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:k()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...r?{top:0}:{bottom:0},...n}},en=y`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,ei=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:i,containerStyle:s,containerClassName:o})=>{let{toasts:l,handlers:u}=$(r);return a.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...s},className:o,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(r=>{let s=r.position||t,o=er(s,u.calculateOffset(r,{reverseOrder:e,gutter:n,defaultPosition:t}));return a.createElement(et,{id:r.id,key:r.id,onHeightUpdate:u.updateHeight,className:r.visible?en:"",style:o},"custom"===r.type?S(r.message,r):i?i(r):a.createElement(ee,{toast:r,position:s}))}))},es=j},45007:function(e,t,r){"use strict";r.d(t,{I0:function(){return E},dC:function(){return T},oR:function(){return _},v9:function(){return d},wU:function(){return v},zt:function(){return w}});var n=r(67294),i=r(31103),s=Symbol.for("react-redux-context"),a="undefined"!=typeof globalThis?globalThis:{},o=function(){if(!n.createContext)return{};let e=a[s]??(a[s]=new Map),t=e.get(n.createContext);return t||(t=n.createContext(null),e.set(n.createContext,t)),t}();function l(e=o){return function(){let t=n.useContext(e);return t}}var u=l(),c=()=>{throw Error("uSES not initialized!")},h=(e,t)=>e===t,d=function(e=o){let t=e===o?u:l(e),r=(e,r={})=>{let{equalityFn:i=h,devModeChecks:s={}}="function"==typeof r?{equalityFn:r}:r,{store:a,subscription:o,getServerState:l,stabilityCheck:u,identityFunctionCheck:d}=t();n.useRef(!0);let f=n.useCallback({[e.name](t){let r=e(t);return r}}[e.name],[e,u,s.stabilityCheck]),p=c(o.addNestedSub,a.getState,l||a.getState,f,i);return n.useDebugValue(p),p};return Object.assign(r,{withTypes:()=>r}),r}();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var f={notify(){},get:()=>[]},p=!!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement),m="undefined"!=typeof navigator&&"ReactNative"===navigator.product,g=p||m?n.useLayoutEffect:n.useEffect;function y(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function v(e,t){if(y(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!y(e[r[n]],t[r[n]]))return!1;return!0}var w=function({store:e,context:t,children:r,serverState:i,stabilityCheck:s="once",identityFunctionCheck:a="once"}){let l=n.useMemo(()=>{let t=function(e,t){let r;let n=f,i=0,s=!1;function a(){u.onStateChange&&u.onStateChange()}function o(){if(i++,!r){let i,s;r=t?t.addNestedSub(a):e.subscribe(a),i=null,s=null,n={clear(){i=null,s=null},notify(){(()=>{let e=i;for(;e;)e.callback(),e=e.next})()},get(){let e=[],t=i;for(;t;)e.push(t),t=t.next;return e},subscribe(e){let t=!0,r=s={callback:e,next:null,prev:s};return r.prev?r.prev.next=r:i=r,function(){t&&null!==i&&(t=!1,r.next?r.next.prev=r.prev:s=r.prev,r.prev?r.prev.next=r.next:i=r.next)}}}}}function l(){i--,r&&0===i&&(r(),r=void 0,n.clear(),n=f)}let u={addNestedSub:function(e){o();let t=n.subscribe(e),r=!1;return()=>{r||(r=!0,t(),l())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:a,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,o())},tryUnsubscribe:function(){s&&(s=!1,l())},getListeners:()=>n};return u}(e);return{store:e,subscription:t,getServerState:i?()=>i:void 0,stabilityCheck:s,identityFunctionCheck:a}},[e,i,s,a]),u=n.useMemo(()=>e.getState(),[e]);return g(()=>{let{subscription:t}=l;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),u!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}},[l,u]),n.createElement((t||o).Provider,{value:l},r)};function b(e=o){let t=e===o?u:l(e),r=()=>{let{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var _=b(),E=function(e=o){let t=e===o?_:b(e),r=()=>{let e=t();return e.dispatch};return Object.assign(r,{withTypes:()=>r}),r}(),T=function(e){e()};c=i.useSyncExternalStoreWithSelector,n.useSyncExternalStore},65849:function(e,t,r){"use strict";function n(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}r.d(t,{LG:function(){return d},MT:function(){return l},PO:function(){return o},UY:function(){return u},md:function(){return h},qC:function(){return c}});var i="function"==typeof Symbol&&Symbol.observable||"@@observable",s=()=>Math.random().toString(36).substring(7).split("").join("."),a={INIT:`@@redux/INIT${s()}`,REPLACE:`@@redux/REPLACE${s()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${s()}`};function o(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function l(e,t,r){if("function"!=typeof e)throw Error(n(2));if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error(n(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw Error(n(1));return r(l)(e,t)}let s=e,u=t,c=new Map,h=c,d=0,f=!1;function p(){h===c&&(h=new Map,c.forEach((e,t)=>{h.set(t,e)}))}function m(){if(f)throw Error(n(3));return u}function g(e){if("function"!=typeof e)throw Error(n(4));if(f)throw Error(n(5));let t=!0;p();let r=d++;return h.set(r,e),function(){if(t){if(f)throw Error(n(6));t=!1,p(),h.delete(r),c=null}}}function y(e){if(!o(e))throw Error(n(7));if(void 0===e.type)throw Error(n(8));if("string"!=typeof e.type)throw Error(n(17));if(f)throw Error(n(9));try{f=!0,u=s(u,e)}finally{f=!1}let t=c=h;return t.forEach(e=>{e()}),e}return y({type:a.INIT}),{dispatch:y,subscribe:g,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw Error(n(10));s=e,y({type:a.REPLACE})},[i]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(n(11));function t(){e.next&&e.next(m())}t();let r=g(t);return{unsubscribe:r}},[i](){return this}}}}}function u(e){let t;let r=Object.keys(e),i={};for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof e[n]&&(i[n]=e[n])}let s=Object.keys(i);try{!function(e){Object.keys(e).forEach(t=>{let r=e[t],i=r(void 0,{type:a.INIT});if(void 0===i)throw Error(n(12));if(void 0===r(void 0,{type:a.PROBE_UNKNOWN_ACTION()}))throw Error(n(13))})}(i)}catch(e){t=e}return function(e={},r){if(t)throw t;let a=!1,o={};for(let t=0;t<s.length;t++){let l=s[t],u=i[l],c=e[l],h=u(c,r);if(void 0===h)throw r&&r.type,Error(n(14));o[l]=h,a=a||h!==c}return(a=a||s.length!==Object.keys(e).length)?o:e}}function c(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function h(...e){return t=>(r,i)=>{let s=t(r,i),a=()=>{throw Error(n(15))},o={getState:s.getState,dispatch:(e,...t)=>a(e,...t)},l=e.map(e=>e(o));return a=c(...l)(s.dispatch),{...s,dispatch:a}}}function d(e){return o(e)&&"type"in e&&"string"==typeof e.type}},19119:function(e,t,r){"use strict";r.d(t,{P1:function(){return _},kO:function(){return w},wN:function(){return b}});var n=e=>Array.isArray(e)?e:[e],i=0,s=class{revision=i;_value;_lastValue;_isEqual=a;constructor(e,t=a){this._value=this._lastValue=e,this._isEqual=t}get value(){return this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++i)}};function a(e,t){return e===t}function o(e){return e instanceof s||console.warn("Not a valid cell! ",e),e.value}var l=(e,t)=>!1;function u(){return function(e,t=a){return new s(null,t)}(0,l)}var c=e=>{let t=e.collectionTag;null===t&&(t=e.collectionTag=u()),o(t)};Symbol();var h=0,d=Object.getPrototypeOf({}),f=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,p);tag=u();tags={};children={};collectionTag=null;id=h++},p={get(e,t){let r=function(){let{value:r}=e,n=Reflect.get(r,t);if("symbol"==typeof t||t in d)return n;if("object"==typeof n&&null!==n){let r=e.children[t];return void 0===r&&(r=e.children[t]=Array.isArray(n)?new m(n):new f(n)),r.tag&&o(r.tag),r.proxy}{let r=e.tags[t];return void 0===r&&((r=e.tags[t]=u()).value=n),o(r),n}}();return r},ownKeys:e=>(c(e),Reflect.ownKeys(e.value)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e.value,t),has:(e,t)=>Reflect.has(e.value,t)},m=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],g);tag=u();tags={};children={};collectionTag=null;id=h++},g={get:([e],t)=>("length"===t&&c(e),p.get(e,t)),ownKeys:([e])=>p.ownKeys(e),getOwnPropertyDescriptor:([e],t)=>p.getOwnPropertyDescriptor(e,t),has:([e],t)=>p.has(e,t)},y="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function v(){return{s:0,v:void 0,o:null,p:null}}function w(e,t={}){let r,n=v(),{resultEqualityCheck:i}=t,s=0;function a(){let t,a=n,{length:o}=arguments;for(let e=0;e<o;e++){let t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=a.o;null===e&&(a.o=e=new WeakMap);let r=e.get(t);void 0===r?(a=v(),e.set(t,a)):a=r}else{let e=a.p;null===e&&(a.p=e=new Map);let r=e.get(t);void 0===r?(a=v(),e.set(t,a)):a=r}}let l=a;if(1===a.s)t=a.v;else if(t=e.apply(null,arguments),s++,i){let e=r?.deref?.()??r;null!=e&&i(e,t)&&(t=e,0!==s&&s--);let n="object"==typeof t&&null!==t||"function"==typeof t;r=n?new y(t):t}return l.s=1,l.v=t,t}return a.clearCache=()=>{n=v(),a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function b(e,...t){let r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,i=(...e)=>{let t,i=0,s=0,a={},o=e.pop();"object"==typeof o&&(a=o,o=e.pop()),function(e,t=`expected a function, instead received ${typeof e}`){if("function"!=typeof e)throw TypeError(t)}(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let l={...r,...a},{memoize:u,memoizeOptions:c=[],argsMemoize:h=w,argsMemoizeOptions:d=[],devModeChecks:f={}}=l,p=n(c),m=n(d),g=function(e){let t=Array.isArray(e[0])?e[0]:e;return!function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let r=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw TypeError(`${t}[${r}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),y=u(function(){return i++,o.apply(null,arguments)},...p),v=h(function(){s++;let e=function(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}(g,arguments);return t=y.apply(null,e)},...m);return Object.assign(v,{resultFunc:o,memoizedResultFunc:y,dependencies:g,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>t,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:u,argsMemoize:h})};return Object.assign(i,{withTypes:()=>i}),i}var _=b(w),E=Object.assign((e,t=_)=>{!function(e,t=`expected an object, instead received ${typeof e}`){if("object"!=typeof e)throw TypeError(t)}(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(t=>e[t]),i=t(n,(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}));return i},{withTypes:()=>E})},97582:function(e,t,r){"use strict";r.r(t),r.d(t,{__addDisposableResource:function(){return P},__assign:function(){return s},__asyncDelegator:function(){return I},__asyncGenerator:function(){return S},__asyncValues:function(){return k},__await:function(){return T},__awaiter:function(){return p},__classPrivateFieldGet:function(){return R},__classPrivateFieldIn:function(){return D},__classPrivateFieldSet:function(){return N},__createBinding:function(){return g},__decorate:function(){return o},__disposeResources:function(){return L},__esDecorate:function(){return u},__exportStar:function(){return y},__extends:function(){return i},__generator:function(){return m},__importDefault:function(){return O},__importStar:function(){return x},__makeTemplateObject:function(){return C},__metadata:function(){return f},__param:function(){return l},__propKey:function(){return h},__read:function(){return w},__rest:function(){return a},__runInitializers:function(){return c},__setFunctionName:function(){return d},__spread:function(){return b},__spreadArray:function(){return E},__spreadArrays:function(){return _},__values:function(){return v}});var 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 a(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 o(e,t,r,n){var i,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(a=(s<3?i(a):s>3?i(t,r,a):i(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){return function(r,n){t(r,n,e)}}function u(e,t,r,n,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var o,l=n.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?n.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),d=!1,f=r.length-1;f>=0;f--){var p={};for(var m in n)p[m]="access"===m?{}:n[m];for(var m in n.access)p.access[m]=n.access[m];p.addInitializer=function(e){if(d)throw TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,r[f])("accessor"===l?{get:h.get,set:h.set}:h[u],p);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[u]=o)}c&&Object.defineProperty(c,n.name,h),d=!0}function c(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,r,n){return new(r||(r=Promise))(function(i,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}function m(e,t){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){return function(o){if(r)throw TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}var g=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]};function y(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||g(t,e,r)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function _(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function E(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 T(e){return this instanceof T?(this.v=e,this):new T(e)}function S(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){s.push([e,t,r,n])>1||o(e,t)})})}function o(e,t){try{var r;(r=i[e](t)).value instanceof T?Promise.resolve(r.value.v).then(l,u):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function l(e){o("next",e)}function u(e){o("throw",e)}function c(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function I(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:T(e[n](t)),done:!1}:i?i(t):t}:i}}function k(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=v(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&g(t,e,r);return A(t,e),t}function O(e){return e&&e.__esModule?e:{default:e}}function R(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function N(e,t,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function P(e,t,r){if(null!=t){var n;if("object"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var M="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function L(e){function t(t){e.error=e.hasError?new M(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(e){return t(e),r()})}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:i,__assign:s,__rest:a,__decorate:o,__param:l,__metadata:f,__awaiter:p,__generator:m,__createBinding:g,__exportStar:y,__values:v,__read:w,__spread:b,__spreadArrays:_,__spreadArray:E,__await:T,__asyncGenerator:S,__asyncDelegator:I,__asyncValues:k,__makeTemplateObject:C,__importStar:x,__importDefault:O,__classPrivateFieldGet:R,__classPrivateFieldSet:N,__classPrivateFieldIn:D,__addDisposableResource:P,__disposeResources:L}},89426:function(e){"use strict";e.exports=JSON.parse('{"id":"google-analytics","description":"Install a Google Analytics tag on your website","website":"https://analytics.google.com/analytics/web/","scripts":[{"url":"https://www.googletagmanager.com/gtag/js","params":["id"],"strategy":"worker","location":"head","action":"append"},{"code":"window.dataLayer=window.dataLayer||[];window.gtag=function gtag(){window.dataLayer.push(arguments);};gtag(\'js\',new Date());gtag(\'config\',\'${args.id}\')","strategy":"worker","location":"head","action":"append"}]}')},27395:function(e){"use strict";e.exports=JSON.parse('{"id":"google-maps-embed","description":"Embed a Google Maps embed on your webpage","website":"https://developers.google.com/maps/documentation/embed/get-started","html":{"element":"iframe","attributes":{"loading":"lazy","src":{"url":"https://www.google.com/maps/embed/v1/place","slugParam":"mode","params":["key","q","center","zoom","maptype","language","region"]},"referrerpolicy":"no-referrer-when-downgrade","frameborder":"0","style":"border:0","allowfullscreen":true,"width":null,"height":null}}}')},88420:function(e){"use strict";e.exports=JSON.parse('{"id":"youtube-embed","description":"Embed a YouTube embed on your webpage.","website":"https://github.com/paulirish/lite-youtube-embed","html":{"element":"lite-youtube","attributes":{"videoid":null,"playlabel":null}},"stylesheets":["https://cdn.jsdelivr.net/gh/paulirish/lite-youtube-embed@master/src/lite-yt-embed.css"],"scripts":[{"url":"https://cdn.jsdelivr.net/gh/paulirish/lite-youtube-embed@master/src/lite-yt-embed.js","strategy":"idle","location":"head","action":"append"}]}')}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(91118),t(31247)}),_N_E=e.O()}]);