cloudcommerce 0.6.13 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/action.yml +2 -2
  3. package/ecomplus-stores/monocard/functions/core/package.json +1 -1
  4. package/ecomplus-stores/monocard/functions/events/package.json +2 -2
  5. package/ecomplus-stores/monocard/functions/modules/package.json +2 -2
  6. package/ecomplus-stores/monocard/functions/passport/package.json +2 -2
  7. package/ecomplus-stores/monocard/functions/ssr/content/settings.json +2 -2
  8. package/ecomplus-stores/monocard/functions/ssr/package.json +8 -8
  9. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/card-phone.png +0 -0
  10. package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/qrcode-camera.png +0 -0
  11. package/ecomplus-stores/monocard/functions/ssr/src/components/CasesGrid.astro +1 -1
  12. package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.astro +23 -0
  13. package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +225 -0
  14. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeaderMenu.vue +2 -2
  15. package/ecomplus-stores/monocard/functions/ssr/src/layouts/Base.astro +1 -0
  16. package/ecomplus-stores/monocard/functions/ssr/src/layouts/Pages.astro +0 -1
  17. package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +3 -3
  18. package/ecomplus-stores/monocard/package.json +1 -1
  19. package/ecomplus-stores/tia-sonia/functions/ssr/src/layouts/PagesHeader.astro +0 -11
  20. package/package.json +6 -6
  21. package/packages/api/package.json +1 -1
  22. package/packages/apps/correios/package.json +1 -1
  23. package/packages/apps/custom-payment/package.json +1 -1
  24. package/packages/apps/custom-shipping/package.json +1 -1
  25. package/packages/apps/datafrete/package.json +1 -1
  26. package/packages/apps/discounts/package.json +1 -1
  27. package/packages/apps/emails/package.json +1 -1
  28. package/packages/apps/fb-conversions/package.json +1 -1
  29. package/packages/apps/frenet/package.json +1 -1
  30. package/packages/apps/galaxpay/package.json +1 -1
  31. package/packages/apps/google-analytics/package.json +1 -1
  32. package/packages/apps/infinitepay/package.json +1 -1
  33. package/packages/apps/jadlog/package.json +1 -1
  34. package/packages/apps/loyalty-points/package.json +1 -1
  35. package/packages/apps/melhor-envio/package.json +1 -1
  36. package/packages/apps/mercadopago/package.json +1 -1
  37. package/packages/apps/pagarme/package.json +2 -2
  38. package/packages/apps/paghiper/package.json +1 -1
  39. package/packages/apps/pix/package.json +1 -1
  40. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +2 -2
  41. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js.map +1 -1
  42. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +4 -3
  43. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +1 -1
  44. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +19 -19
  45. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +1 -1
  46. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +5 -3
  47. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js.map +1 -1
  48. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +11 -11
  49. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +1 -1
  50. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +19 -10
  51. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js.map +1 -1
  52. package/packages/apps/tiny-erp/package.json +1 -1
  53. package/packages/apps/tiny-erp/src/integration/after-tiny-queue.ts +2 -2
  54. package/packages/apps/tiny-erp/src/integration/import-order-from-tiny.ts +4 -3
  55. package/packages/apps/tiny-erp/src/integration/import-product-from-tiny.ts +18 -18
  56. package/packages/apps/tiny-erp/src/integration/parsers/order-to-tiny.ts +5 -3
  57. package/packages/apps/tiny-erp/src/integration/parsers/product-from-tiny.ts +11 -11
  58. package/packages/apps/tiny-erp/src/integration/parsers/product-to-tiny.ts +21 -11
  59. package/packages/apps/webhooks/package.json +1 -1
  60. package/packages/cli/config/firebase.json +24 -6
  61. package/packages/cli/package.json +1 -1
  62. package/packages/config/package.json +1 -1
  63. package/packages/emails/package.json +2 -2
  64. package/packages/events/package.json +1 -1
  65. package/packages/firebase/package.json +2 -2
  66. package/packages/i18n/package.json +1 -1
  67. package/packages/modules/package.json +1 -1
  68. package/packages/passport/package.json +1 -1
  69. package/packages/ssr/package.json +5 -5
  70. package/packages/storefront/.base.eslintrc.cjs +1 -1
  71. package/packages/storefront/astro.config.mjs +1 -1
  72. package/packages/storefront/dist/client/_astro/ShopHeader.e93c8274.js +4 -0
  73. package/packages/storefront/dist/client/_astro/{firebase-app.7ce2ebb1.js → firebase-app.72e91a3e.js} +72 -72
  74. package/packages/storefront/dist/client/sw.js +1 -1
  75. package/packages/storefront/dist/server/chunks/{astro.2e59789d.mjs → astro.9781c0a7.mjs} +217 -272
  76. package/packages/storefront/dist/server/chunks/{image-pool.78b6d784.mjs → image-pool.c24d15b2.mjs} +1202 -1202
  77. package/packages/storefront/dist/server/chunks/pages/{all.f49a350f.mjs → all.3a2f4354.mjs} +218 -289
  78. package/packages/storefront/dist/server/entry.mjs +16 -363
  79. package/packages/storefront/package.json +11 -11
  80. package/packages/storefront/scripts/build-prod.sh +7 -0
  81. package/packages/storefront/src/lib/components/Picture.astro +94 -0
  82. package/packages/storefront/src/lib/layouts/BaseHead.astro +2 -8
  83. package/packages/storefront/ssr-runtime/Picture.ssr.astro +0 -0
  84. package/packages/storefront/ssr-runtime/get-image.ts +4 -0
  85. package/packages/storefront/ssr-runtime/get-picture.ts +126 -0
  86. package/packages/types/package.json +1 -1
  87. package/ecomplus-stores/monocard/functions/ssr/src/components/UsageSteps.astro +0 -21
  88. package/ecomplus-stores/monocard/functions/ssr/src/components/UsageSteps.vue +0 -155
  89. package/packages/storefront/dist/client/_astro/ShopHeader.301e109b.js +0 -4
  90. package/packages/storefront/src/lib/ssr/Picture.astro +0 -27
  91. package/packages/storefront/src/lib/ssr/image.ts +0 -68
@@ -28,7 +28,7 @@
28
28
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
29
  * See the License for the specific language governing permissions and
30
30
  * limitations under the License.
31
- */const Rt=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},vn=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],a=n[t++],c=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Ct={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,a=o?n[i+1]:0,c=i+2<n.length,l=c?n[i+2]:0,d=s>>2,f=(s&3)<<4|a>>4;let g=(a&15)<<2|l>>6,I=l&63;c||(I=64,o||(g=64)),r.push(t[d],t[f],t[g],t[I])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Rt(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):vn(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],a=i<n.length?t[n.charAt(i)]:0;++i;const l=i<n.length?t[n.charAt(i)]:64;++i;const f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||a==null||l==null||f==null)throw Error();const g=s<<2|a>>4;if(r.push(g),l!==64){const I=a<<4&240|l>>2;if(r.push(I),f!==64){const U=l<<6&192|f;r.push(U)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},In=function(n){const e=Rt(n);return Ct.encodeByteArray(e,!0)},Ot=function(n){return In(n).replace(/\./g,"")},Dt=function(n){try{return Ct.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
31
+ */const Rt=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},vn=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],a=n[t++],c=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Ct={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,a=o?n[i+1]:0,c=i+2<n.length,l=c?n[i+2]:0,d=s>>2,f=(s&3)<<4|a>>4;let g=(a&15)<<2|l>>6,I=l&63;c||(I=64,o||(g=64)),r.push(t[d],t[f],t[g],t[I])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Rt(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):vn(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],a=i<n.length?t[n.charAt(i)]:0;++i;const l=i<n.length?t[n.charAt(i)]:64;++i;const f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||a==null||l==null||f==null)throw new In;const g=s<<2|a>>4;if(r.push(g),l!==64){const I=a<<4&240|l>>2;if(r.push(I),f!==64){const U=l<<6&192|f;r.push(U)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class In extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const yn=function(n){const e=Rt(n);return Ct.encodeByteArray(e,!0)},Ot=function(n){return yn(n).replace(/\./g,"")},Dt=function(n){try{return Ct.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
32
32
  * @license
33
33
  * Copyright 2022 Google LLC
34
34
  *
@@ -43,7 +43,7 @@
43
43
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
44
  * See the License for the specific language governing permissions and
45
45
  * limitations under the License.
46
- */function yn(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
46
+ */function bn(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
47
47
  * @license
48
48
  * Copyright 2022 Google LLC
49
49
  *
@@ -58,7 +58,7 @@
58
58
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
59
  * See the License for the specific language governing permissions and
60
60
  * limitations under the License.
61
- */const bn=()=>yn().__FIREBASE_DEFAULTS__,En=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},wn=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Dt(n[1]);return e&&JSON.parse(e)},He=()=>{try{return bn()||En()||wn()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Tn=n=>{var e,t;return(t=(e=He())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Sn=()=>{var n;return(n=He())===null||n===void 0?void 0:n.config},Pt=n=>{var e;return(e=He())===null||e===void 0?void 0:e[`_${n}`]};/**
61
+ */const En=()=>bn().__FIREBASE_DEFAULTS__,wn=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Tn=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Dt(n[1]);return e&&JSON.parse(e)},He=()=>{try{return En()||wn()||Tn()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Sn=n=>{var e,t;return(t=(e=He())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},kn=()=>{var n;return(n=He())===null||n===void 0?void 0:n.config},Pt=n=>{var e;return(e=He())===null||e===void 0?void 0:e[`_${n}`]};/**
62
62
  * @license
63
63
  * Copyright 2017 Google LLC
64
64
  *
@@ -73,7 +73,7 @@
73
73
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
74
  * See the License for the specific language governing permissions and
75
75
  * limitations under the License.
76
- */class kn{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),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
76
+ */class An{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),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
77
77
  * @license
78
78
  * Copyright 2017 Google LLC
79
79
  *
@@ -88,7 +88,7 @@
88
88
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
89
  * See the License for the specific language governing permissions and
90
90
  * limitations under the License.
91
- */function p(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function An(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())}function Rn(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Cn(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function On(){const n=p();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Dn(){try{return typeof indexedDB=="object"}catch{return!1}}function Pn(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
91
+ */function p(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Rn(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())}function Cn(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function On(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Dn(){const n=p();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Pn(){try{return typeof indexedDB=="object"}catch{return!1}}function Nn(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
92
92
  * @license
93
93
  * Copyright 2017 Google LLC
94
94
  *
@@ -103,7 +103,7 @@
103
103
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
104
  * See the License for the specific language governing permissions and
105
105
  * limitations under the License.
106
- */const Nn="FirebaseError";class O extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Nn,Object.setPrototypeOf(this,O.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Q.prototype.create)}}class Q{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Mn(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new O(i,a,r)}}function Mn(n,e){return n.replace(Ln,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Ln=/\{\$([^}]+)}/g;function Un(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function le(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(rt(s)&&rt(o)){if(!le(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function rt(n){return n!==null&&typeof n=="object"}/**
106
+ */const Mn="FirebaseError";class O extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Mn,Object.setPrototypeOf(this,O.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Q.prototype.create)}}class Q{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Ln(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new O(i,a,r)}}function Ln(n,e){return n.replace(Un,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Un=/\{\$([^}]+)}/g;function xn(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function le(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(rt(s)&&rt(o)){if(!le(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function rt(n){return n!==null&&typeof n=="object"}/**
107
107
  * @license
108
108
  * Copyright 2017 Google LLC
109
109
  *
@@ -118,7 +118,7 @@
118
118
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
119
  * See the License for the specific language governing permissions and
120
120
  * limitations under the License.
121
- */function Z(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function j(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function z(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function xn(n,e){const t=new Bn(n,e);return t.subscribe.bind(t)}class Bn{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(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");Fn(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Re),i.error===void 0&&(i.error=Re),i.complete===void 0&&(i.complete=Re);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Fn(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Re(){}/**
121
+ */function Z(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function j(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function z(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function Bn(n,e){const t=new Fn(n,e);return t.subscribe.bind(t)}class Fn{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(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");$n(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Re),i.error===void 0&&(i.error=Re),i.complete===void 0&&(i.complete=Re);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function $n(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Re(){}/**
122
122
  * @license
123
123
  * Copyright 2021 Google LLC
124
124
  *
@@ -163,7 +163,7 @@
163
163
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
164
  * See the License for the specific language governing permissions and
165
165
  * limitations under the License.
166
- */class $n{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){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new kn;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)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(Vn(e))try{this.getOrInitializeService({instanceIdentifier:P})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=P){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=P){return this.instances.has(e)}getOptions(e=P){return this.instancesOptions.get(e)||{}}initialize(e={}){const{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`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Hn(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=P){return this.component?this.component.multipleInstances?e:P:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Hn(n){return n===P?void 0:n}function Vn(n){return n.instantiationMode==="EAGER"}/**
166
+ */class Hn{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){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new An;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)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(Wn(e))try{this.getOrInitializeService({instanceIdentifier:P})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=P){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=P){return this.instances.has(e)}getOptions(e=P){return this.instancesOptions.get(e)||{}}initialize(e={}){const{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`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Vn(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=P){return this.component?this.component.multipleInstances?e:P:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Vn(n){return n===P?void 0:n}function Wn(n){return n.instantiationMode==="EAGER"}/**
167
167
  * @license
168
168
  * Copyright 2019 Google LLC
169
169
  *
@@ -178,7 +178,7 @@
178
178
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
179
  * See the License for the specific language governing permissions and
180
180
  * limitations under the License.
181
- */class Wn{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new $n(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
181
+ */class jn{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new Hn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
182
182
  * @license
183
183
  * Copyright 2017 Google LLC
184
184
  *
@@ -193,7 +193,7 @@
193
193
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
194
  * See the License for the specific language governing permissions and
195
195
  * limitations under the License.
196
- */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const jn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},zn=h.INFO,Gn={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},qn=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=Gn[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Nt{constructor(e){this.name=e,this._logLevel=zn,this._logHandler=qn,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in h))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?jn[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,h.DEBUG,...e),this._logHandler(this,h.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,h.VERBOSE,...e),this._logHandler(this,h.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,h.INFO,...e),this._logHandler(this,h.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,h.WARN,...e),this._logHandler(this,h.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,h.ERROR,...e),this._logHandler(this,h.ERROR,...e)}}const Kn=(n,e)=>e.some(t=>n instanceof t);let it,st;function Jn(){return it||(it=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Yn(){return st||(st=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Mt=new WeakMap,Le=new WeakMap,Lt=new WeakMap,Ce=new WeakMap,Ve=new WeakMap;function Xn(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(R(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Mt.set(t,n)}).catch(()=>{}),Ve.set(e,n),e}function Qn(n){if(Le.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});Le.set(n,e)}let Ue={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Le.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Lt.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return R(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Zn(n){Ue=n(Ue)}function er(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Oe(this),e,...t);return Lt.set(r,e.sort?e.sort():[e]),R(r)}:Yn().includes(n)?function(...e){return n.apply(Oe(this),e),R(Mt.get(this))}:function(...e){return R(n.apply(Oe(this),e))}}function tr(n){return typeof n=="function"?er(n):(n instanceof IDBTransaction&&Qn(n),Kn(n,Jn())?new Proxy(n,Ue):n)}function R(n){if(n instanceof IDBRequest)return Xn(n);if(Ce.has(n))return Ce.get(n);const e=tr(n);return e!==n&&(Ce.set(n,e),Ve.set(e,n)),e}const Oe=n=>Ve.get(n);function nr(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=R(o);return r&&o.addEventListener("upgradeneeded",c=>{r(R(o.result),c.oldVersion,c.newVersion,R(o.transaction))}),t&&o.addEventListener("blocked",()=>t()),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}const rr=["get","getKey","getAll","getAllKeys","count"],ir=["put","add","delete","clear"],De=new Map;function ot(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(De.get(e))return De.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=ir.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||rr.includes(t)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(a.shift())),(await Promise.all([l[t](...a),i&&c.done]))[0]};return De.set(e,s),s}Zn(n=>({...n,get:(e,t,r)=>ot(e,t)||n.get(e,t,r),has:(e,t)=>!!ot(e,t)||n.has(e,t)}));/**
196
+ */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const zn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Gn=h.INFO,Kn={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},qn=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=Kn[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Nt{constructor(e){this.name=e,this._logLevel=Gn,this._logHandler=qn,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in h))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?zn[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,h.DEBUG,...e),this._logHandler(this,h.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,h.VERBOSE,...e),this._logHandler(this,h.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,h.INFO,...e),this._logHandler(this,h.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,h.WARN,...e),this._logHandler(this,h.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,h.ERROR,...e),this._logHandler(this,h.ERROR,...e)}}const Jn=(n,e)=>e.some(t=>n instanceof t);let it,st;function Yn(){return it||(it=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Xn(){return st||(st=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Mt=new WeakMap,Le=new WeakMap,Lt=new WeakMap,Ce=new WeakMap,Ve=new WeakMap;function Qn(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(R(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Mt.set(t,n)}).catch(()=>{}),Ve.set(e,n),e}function Zn(n){if(Le.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});Le.set(n,e)}let Ue={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Le.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Lt.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return R(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function er(n){Ue=n(Ue)}function tr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Oe(this),e,...t);return Lt.set(r,e.sort?e.sort():[e]),R(r)}:Xn().includes(n)?function(...e){return n.apply(Oe(this),e),R(Mt.get(this))}:function(...e){return R(n.apply(Oe(this),e))}}function nr(n){return typeof n=="function"?tr(n):(n instanceof IDBTransaction&&Zn(n),Jn(n,Yn())?new Proxy(n,Ue):n)}function R(n){if(n instanceof IDBRequest)return Qn(n);if(Ce.has(n))return Ce.get(n);const e=nr(n);return e!==n&&(Ce.set(n,e),Ve.set(e,n)),e}const Oe=n=>Ve.get(n);function rr(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=R(o);return r&&o.addEventListener("upgradeneeded",c=>{r(R(o.result),c.oldVersion,c.newVersion,R(o.transaction))}),t&&o.addEventListener("blocked",()=>t()),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}const ir=["get","getKey","getAll","getAllKeys","count"],sr=["put","add","delete","clear"],De=new Map;function ot(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(De.get(e))return De.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=sr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||ir.includes(t)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(a.shift())),(await Promise.all([l[t](...a),i&&c.done]))[0]};return De.set(e,s),s}er(n=>({...n,get:(e,t,r)=>ot(e,t)||n.get(e,t,r),has:(e,t)=>!!ot(e,t)||n.has(e,t)}));/**
197
197
  * @license
198
198
  * Copyright 2019 Google LLC
199
199
  *
@@ -208,7 +208,7 @@
208
208
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
209
  * See the License for the specific language governing permissions and
210
210
  * limitations under the License.
211
- */class sr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(or(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function or(n){const e=n.getComponent();return e?.type==="VERSION"}const xe="@firebase/app",at="0.9.3";/**
211
+ */class or{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(ar(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function ar(n){const e=n.getComponent();return e?.type==="VERSION"}const xe="@firebase/app",at="0.9.4";/**
212
212
  * @license
213
213
  * Copyright 2019 Google LLC
214
214
  *
@@ -223,7 +223,7 @@
223
223
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
224
  * See the License for the specific language governing permissions and
225
225
  * limitations under the License.
226
- */const M=new Nt("@firebase/app"),ar="@firebase/app-compat",cr="@firebase/analytics-compat",lr="@firebase/analytics",ur="@firebase/app-check-compat",dr="@firebase/app-check",hr="@firebase/auth",fr="@firebase/auth-compat",pr="@firebase/database",gr="@firebase/database-compat",mr="@firebase/functions",_r="@firebase/functions-compat",vr="@firebase/installations",Ir="@firebase/installations-compat",yr="@firebase/messaging",br="@firebase/messaging-compat",Er="@firebase/performance",wr="@firebase/performance-compat",Tr="@firebase/remote-config",Sr="@firebase/remote-config-compat",kr="@firebase/storage",Ar="@firebase/storage-compat",Rr="@firebase/firestore",Cr="@firebase/firestore-compat",Or="firebase",Dr="9.17.1";/**
226
+ */const M=new Nt("@firebase/app"),cr="@firebase/app-compat",lr="@firebase/analytics-compat",ur="@firebase/analytics",dr="@firebase/app-check-compat",hr="@firebase/app-check",fr="@firebase/auth",pr="@firebase/auth-compat",gr="@firebase/database",mr="@firebase/database-compat",_r="@firebase/functions",vr="@firebase/functions-compat",Ir="@firebase/installations",yr="@firebase/installations-compat",br="@firebase/messaging",Er="@firebase/messaging-compat",wr="@firebase/performance",Tr="@firebase/performance-compat",Sr="@firebase/remote-config",kr="@firebase/remote-config-compat",Ar="@firebase/storage",Rr="@firebase/storage-compat",Cr="@firebase/firestore",Or="@firebase/firestore-compat",Dr="firebase",Pr="9.17.2";/**
227
227
  * @license
228
228
  * Copyright 2019 Google LLC
229
229
  *
@@ -238,7 +238,7 @@
238
238
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
239
  * See the License for the specific language governing permissions and
240
240
  * limitations under the License.
241
- */const Be="[DEFAULT]",Pr={[xe]:"fire-core",[ar]:"fire-core-compat",[lr]:"fire-analytics",[cr]:"fire-analytics-compat",[dr]:"fire-app-check",[ur]:"fire-app-check-compat",[hr]:"fire-auth",[fr]:"fire-auth-compat",[pr]:"fire-rtdb",[gr]:"fire-rtdb-compat",[mr]:"fire-fn",[_r]:"fire-fn-compat",[vr]:"fire-iid",[Ir]:"fire-iid-compat",[yr]:"fire-fcm",[br]:"fire-fcm-compat",[Er]:"fire-perf",[wr]:"fire-perf-compat",[Tr]:"fire-rc",[Sr]:"fire-rc-compat",[kr]:"fire-gcs",[Ar]:"fire-gcs-compat",[Rr]:"fire-fst",[Cr]:"fire-fst-compat","fire-js":"fire-js",[Or]:"fire-js-all"};/**
241
+ */const Be="[DEFAULT]",Nr={[xe]:"fire-core",[cr]:"fire-core-compat",[ur]:"fire-analytics",[lr]:"fire-analytics-compat",[hr]:"fire-app-check",[dr]:"fire-app-check-compat",[fr]:"fire-auth",[pr]:"fire-auth-compat",[gr]:"fire-rtdb",[mr]:"fire-rtdb-compat",[_r]:"fire-fn",[vr]:"fire-fn-compat",[Ir]:"fire-iid",[yr]:"fire-iid-compat",[br]:"fire-fcm",[Er]:"fire-fcm-compat",[wr]:"fire-perf",[Tr]:"fire-perf-compat",[Sr]:"fire-rc",[kr]:"fire-rc-compat",[Ar]:"fire-gcs",[Rr]:"fire-gcs-compat",[Cr]:"fire-fst",[Or]:"fire-fst-compat","fire-js":"fire-js",[Dr]:"fire-js-all"};/**
242
242
  * @license
243
243
  * Copyright 2019 Google LLC
244
244
  *
@@ -253,7 +253,7 @@
253
253
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
254
  * See the License for the specific language governing permissions and
255
255
  * limitations under the License.
256
- */const ue=new Map,Fe=new Map;function Nr(n,e){try{n.container.addComponent(e)}catch(t){M.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function q(n){const e=n.name;if(Fe.has(e))return M.debug(`There were multiple attempts to register component ${e}.`),!1;Fe.set(e,n);for(const t of ue.values())Nr(t,n);return!0}function Ut(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
256
+ */const ue=new Map,Fe=new Map;function Mr(n,e){try{n.container.addComponent(e)}catch(t){M.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function K(n){const e=n.name;if(Fe.has(e))return M.debug(`There were multiple attempts to register component ${e}.`),!1;Fe.set(e,n);for(const t of ue.values())Mr(t,n);return!0}function Ut(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
257
257
  * @license
258
258
  * Copyright 2019 Google LLC
259
259
  *
@@ -268,7 +268,7 @@
268
268
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
269
269
  * See the License for the specific language governing permissions and
270
270
  * limitations under the License.
271
- */const Mr={["no-app"]:"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",["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}."},C=new Q("app","Firebase",Mr);/**
271
+ */const Lr={["no-app"]:"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",["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}."},C=new Q("app","Firebase",Lr);/**
272
272
  * @license
273
273
  * Copyright 2019 Google LLC
274
274
  *
@@ -283,7 +283,7 @@
283
283
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
284
284
  * See the License for the specific language governing permissions and
285
285
  * limitations under the License.
286
- */class Lr{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 H("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 C.create("app-deleted",{appName:this._name})}}/**
286
+ */class Ur{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 H("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 C.create("app-deleted",{appName:this._name})}}/**
287
287
  * @license
288
288
  * Copyright 2019 Google LLC
289
289
  *
@@ -298,7 +298,7 @@
298
298
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
299
  * See the License for the specific language governing permissions and
300
300
  * limitations under the License.
301
- */const me=Dr;function xt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Be,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw C.create("bad-app-name",{appName:String(i)});if(t||(t=Sn()),!t)throw C.create("no-options");const s=ue.get(i);if(s){if(le(t,s.options)&&le(r,s.config))return s;throw C.create("duplicate-app",{appName:i})}const o=new Wn(i);for(const c of Fe.values())o.addComponent(c);const a=new Lr(t,r,o);return ue.set(i,a),a}function Ur(n=Be){const e=ue.get(n);if(!e&&n===Be)return xt();if(!e)throw C.create("no-app",{appName:n});return e}function B(n,e,t){var r;let i=(r=Pr[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),M.warn(a.join(" "));return}q(new H(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
301
+ */const me=Pr;function xt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Be,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw C.create("bad-app-name",{appName:String(i)});if(t||(t=kn()),!t)throw C.create("no-options");const s=ue.get(i);if(s){if(le(t,s.options)&&le(r,s.config))return s;throw C.create("duplicate-app",{appName:i})}const o=new jn(i);for(const c of Fe.values())o.addComponent(c);const a=new Ur(t,r,o);return ue.set(i,a),a}function xr(n=Be){const e=ue.get(n);if(!e&&n===Be)return xt();if(!e)throw C.create("no-app",{appName:n});return e}function B(n,e,t){var r;let i=(r=Nr[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),M.warn(a.join(" "));return}K(new H(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
302
302
  * @license
303
303
  * Copyright 2021 Google LLC
304
304
  *
@@ -313,7 +313,7 @@
313
313
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
314
314
  * See the License for the specific language governing permissions and
315
315
  * limitations under the License.
316
- */const xr="firebase-heartbeat-database",Br=1,K="firebase-heartbeat-store";let Pe=null;function Bt(){return Pe||(Pe=nr(xr,Br,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(K)}}}).catch(n=>{throw C.create("idb-open",{originalErrorMessage:n.message})})),Pe}async function Fr(n){try{return(await Bt()).transaction(K).objectStore(K).get(Ft(n))}catch(e){if(e instanceof O)M.warn(e.message);else{const t=C.create("idb-get",{originalErrorMessage:e?.message});M.warn(t.message)}}}async function ct(n,e){try{const r=(await Bt()).transaction(K,"readwrite");return await r.objectStore(K).put(e,Ft(n)),r.done}catch(t){if(t instanceof O)M.warn(t.message);else{const r=C.create("idb-set",{originalErrorMessage:t?.message});M.warn(r.message)}}}function Ft(n){return`${n.name}!${n.options.appId}`}/**
316
+ */const Br="firebase-heartbeat-database",Fr=1,q="firebase-heartbeat-store";let Pe=null;function Bt(){return Pe||(Pe=rr(Br,Fr,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(q)}}}).catch(n=>{throw C.create("idb-open",{originalErrorMessage:n.message})})),Pe}async function $r(n){try{return(await Bt()).transaction(q).objectStore(q).get(Ft(n))}catch(e){if(e instanceof O)M.warn(e.message);else{const t=C.create("idb-get",{originalErrorMessage:e?.message});M.warn(t.message)}}}async function ct(n,e){try{const r=(await Bt()).transaction(q,"readwrite");return await r.objectStore(q).put(e,Ft(n)),r.done}catch(t){if(t instanceof O)M.warn(t.message);else{const r=C.create("idb-set",{originalErrorMessage:t?.message});M.warn(r.message)}}}function Ft(n){return`${n.name}!${n.options.appId}`}/**
317
317
  * @license
318
318
  * Copyright 2021 Google LLC
319
319
  *
@@ -328,7 +328,7 @@
328
328
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
329
329
  * See the License for the specific language governing permissions and
330
330
  * limitations under the License.
331
- */const $r=1024,Hr=30*24*60*60*1e3;class Vr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new jr(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=lt();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const s=new Date(i.date).valueOf();return Date.now()-s<=Hr}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=lt(),{heartbeatsToSend:t,unsentEntries:r}=Wr(this._heartbeatsCache.heartbeats),i=Ot(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function lt(){return new Date().toISOString().substring(0,10)}function Wr(n,e=$r){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),ut(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),ut(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class jr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Dn()?Pn().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await Fr(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ct(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ct(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function ut(n){return Ot(JSON.stringify({version:2,heartbeats:n})).length}/**
331
+ */const Hr=1024,Vr=30*24*60*60*1e3;class Wr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new zr(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=lt();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const s=new Date(i.date).valueOf();return Date.now()-s<=Vr}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=lt(),{heartbeatsToSend:t,unsentEntries:r}=jr(this._heartbeatsCache.heartbeats),i=Ot(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function lt(){return new Date().toISOString().substring(0,10)}function jr(n,e=Hr){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),ut(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),ut(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class zr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Pn()?Nn().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await $r(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ct(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ct(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function ut(n){return Ot(JSON.stringify({version:2,heartbeats:n})).length}/**
332
332
  * @license
333
333
  * Copyright 2019 Google LLC
334
334
  *
@@ -343,7 +343,7 @@
343
343
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
344
344
  * See the License for the specific language governing permissions and
345
345
  * limitations under the License.
346
- */function zr(n){q(new H("platform-logger",e=>new sr(e),"PRIVATE")),q(new H("heartbeat",e=>new Vr(e),"PRIVATE")),B(xe,at,n),B(xe,at,"esm2017"),B("fire-js","")}zr("");var Gr="firebase",qr="9.17.1";/**
346
+ */function Gr(n){K(new H("platform-logger",e=>new or(e),"PRIVATE")),K(new H("heartbeat",e=>new Wr(e),"PRIVATE")),B(xe,at,n),B(xe,at,"esm2017"),B("fire-js","")}Gr("");var Kr="firebase",qr="9.17.2";/**
347
347
  * @license
348
348
  * Copyright 2020 Google LLC
349
349
  *
@@ -358,7 +358,7 @@
358
358
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
359
359
  * See the License for the specific language governing permissions and
360
360
  * limitations under the License.
361
- */B(Gr,qr,"app");function We(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function $t(){return{["dependent-sdk-initialized-before-auth"]:"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Kr=$t,Ht=new Q("auth","Firebase",$t());/**
361
+ */B(Kr,qr,"app");function We(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function $t(){return{["dependent-sdk-initialized-before-auth"]:"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Jr=$t,Ht=new Q("auth","Firebase",$t());/**
362
362
  * @license
363
363
  * Copyright 2020 Google LLC
364
364
  *
@@ -388,7 +388,7 @@
388
388
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
389
389
  * See the License for the specific language governing permissions and
390
390
  * limitations under the License.
391
- */function m(n,...e){throw je(n,...e)}function _(n,...e){return je(n,...e)}function Jr(n,e,t){const r=Object.assign(Object.assign({},Kr()),{[e]:t});return new Q("auth","Firebase",r).create(e,{appName:n.name})}function je(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return Ht.create(n,...e)}function u(n,e,...t){if(!n)throw je(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw se(e),new Error(e)}function E(n,e){n||y(e)}/**
391
+ */function m(n,...e){throw je(n,...e)}function _(n,...e){return je(n,...e)}function Yr(n,e,t){const r=Object.assign(Object.assign({},Jr()),{[e]:t});return new Q("auth","Firebase",r).create(e,{appName:n.name})}function je(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return Ht.create(n,...e)}function u(n,e,...t){if(!n)throw je(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw se(e),new Error(e)}function E(n,e){n||y(e)}/**
392
392
  * @license
393
393
  * Copyright 2020 Google LLC
394
394
  *
@@ -418,7 +418,7 @@
418
418
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
419
419
  * See the License for the specific language governing permissions and
420
420
  * limitations under the License.
421
- */function Yr(n,e){const t=Ut(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(le(s,e??{}))return i;m(i,"already-initialized")}return t.initialize({options:e})}function Xr(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(b);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}/**
421
+ */function Xr(n,e){const t=Ut(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(le(s,e??{}))return i;m(i,"already-initialized")}return t.initialize({options:e})}function Qr(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(b);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}/**
422
422
  * @license
423
423
  * Copyright 2020 Google LLC
424
424
  *
@@ -433,7 +433,7 @@
433
433
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
434
434
  * See the License for the specific language governing permissions and
435
435
  * limitations under the License.
436
- */function de(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function Qr(){return ft()==="http:"||ft()==="https:"}function ft(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
436
+ */function de(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function Zr(){return ft()==="http:"||ft()==="https:"}function ft(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
437
437
  * @license
438
438
  * Copyright 2020 Google LLC
439
439
  *
@@ -448,7 +448,7 @@
448
448
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
449
449
  * See the License for the specific language governing permissions and
450
450
  * limitations under the License.
451
- */function Zr(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Qr()||Rn()||"connection"in navigator)?navigator.onLine:!0}function ei(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
451
+ */function ei(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Zr()||Cn()||"connection"in navigator)?navigator.onLine:!0}function ti(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
452
452
  * @license
453
453
  * Copyright 2020 Google LLC
454
454
  *
@@ -463,7 +463,7 @@
463
463
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
464
464
  * See the License for the specific language governing permissions and
465
465
  * limitations under the License.
466
- */class ee{constructor(e,t){this.shortDelay=e,this.longDelay=t,E(t>e,"Short delay should be less than long delay!"),this.isMobile=An()||Cn()}get(){return Zr()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
466
+ */class ee{constructor(e,t){this.shortDelay=e,this.longDelay=t,E(t>e,"Short delay should be less than long delay!"),this.isMobile=Rn()||On()}get(){return ei()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
467
467
  * @license
468
468
  * Copyright 2020 Google LLC
469
469
  *
@@ -508,7 +508,7 @@
508
508
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
509
509
  * See the License for the specific language governing permissions and
510
510
  * limitations under the License.
511
- */const ti={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:"internal-error",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"};/**
511
+ */const ni={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:"internal-error",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"};/**
512
512
  * @license
513
513
  * Copyright 2020 Google LLC
514
514
  *
@@ -523,7 +523,7 @@
523
523
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
524
524
  * See the License for the specific language governing permissions and
525
525
  * limitations under the License.
526
- */const ni=new ee(3e4,6e4);function _e(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function te(n,e,t,r,i={}){return Wt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=Z(Object.assign({key:n.config.apiKey},o)).slice(1),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode),Vt.fetch()(jt(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function Wt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},ti),e);try{const i=new ri(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ie(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw ie(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw ie(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw ie(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw Jr(n,d,l);m(n,d)}}catch(i){if(i instanceof O)throw i;m(n,"network-request-failed")}}async function ve(n,e,t,r,i={}){const s=await te(n,e,t,r,i);return"mfaPendingCredential"in s&&m(n,"multi-factor-auth-required",{_serverResponse:s}),s}function jt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?ze(n.config,i):`${n.config.apiScheme}://${i}`}class ri{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),ni.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ie(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=_(n,e,r);return i.customData._tokenResponse=t,i}/**
526
+ */const ri=new ee(3e4,6e4);function _e(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function te(n,e,t,r,i={}){return Wt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=Z(Object.assign({key:n.config.apiKey},o)).slice(1),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode),Vt.fetch()(jt(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function Wt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},ni),e);try{const i=new ii(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ie(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw ie(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw ie(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw ie(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw Yr(n,d,l);m(n,d)}}catch(i){if(i instanceof O)throw i;m(n,"internal-error",{message:String(i)})}}async function ve(n,e,t,r,i={}){const s=await te(n,e,t,r,i);return"mfaPendingCredential"in s&&m(n,"multi-factor-auth-required",{_serverResponse:s}),s}function jt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?ze(n.config,i):`${n.config.apiScheme}://${i}`}class ii{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),ri.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ie(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=_(n,e,r);return i.customData._tokenResponse=t,i}/**
527
527
  * @license
528
528
  * Copyright 2020 Google LLC
529
529
  *
@@ -538,7 +538,7 @@
538
538
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
539
539
  * See the License for the specific language governing permissions and
540
540
  * limitations under the License.
541
- */async function ii(n,e){return te(n,"POST","/v1/accounts:delete",e)}async function si(n,e){return te(n,"POST","/v1/accounts:lookup",e)}/**
541
+ */async function si(n,e){return te(n,"POST","/v1/accounts:delete",e)}async function oi(n,e){return te(n,"POST","/v1/accounts:lookup",e)}/**
542
542
  * @license
543
543
  * Copyright 2020 Google LLC
544
544
  *
@@ -553,7 +553,7 @@
553
553
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554
554
  * See the License for the specific language governing permissions and
555
555
  * limitations under the License.
556
- */function G(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function oi(n,e=!1){const t=D(n),r=await t.getIdToken(e),i=Ge(r);u(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:G(Ne(i.auth_time)),issuedAtTime:G(Ne(i.iat)),expirationTime:G(Ne(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Ne(n){return Number(n)*1e3}function Ge(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return se("JWT malformed, contained fewer than 3 sections"),null;try{const i=Dt(t);return i?JSON.parse(i):(se("Failed to decode base64 JWT payload"),null)}catch(i){return se("Caught error parsing JWT payload as JSON",i?.toString()),null}}function ai(n){const e=Ge(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
556
+ */function G(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function ai(n,e=!1){const t=D(n),r=await t.getIdToken(e),i=Ge(r);u(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:G(Ne(i.auth_time)),issuedAtTime:G(Ne(i.iat)),expirationTime:G(Ne(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Ne(n){return Number(n)*1e3}function Ge(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return se("JWT malformed, contained fewer than 3 sections"),null;try{const i=Dt(t);return i?JSON.parse(i):(se("Failed to decode base64 JWT payload"),null)}catch(i){return se("Caught error parsing JWT payload as JSON",i?.toString()),null}}function ci(n){const e=Ge(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
557
557
  * @license
558
558
  * Copyright 2020 Google LLC
559
559
  *
@@ -568,7 +568,7 @@
568
568
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
569
569
  * See the License for the specific language governing permissions and
570
570
  * limitations under the License.
571
- */async function J(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof O&&ci(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function ci({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
571
+ */async function J(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof O&&li(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function li({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
572
572
  * @license
573
573
  * Copyright 2020 Google LLC
574
574
  *
@@ -583,7 +583,7 @@
583
583
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
584
584
  * See the License for the specific language governing permissions and
585
585
  * limitations under the License.
586
- */class li{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
586
+ */class ui{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
587
587
  * @license
588
588
  * Copyright 2020 Google LLC
589
589
  *
@@ -613,7 +613,7 @@
613
613
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
614
614
  * See the License for the specific language governing permissions and
615
615
  * limitations under the License.
616
- */async function he(n){var e;const t=n.auth,r=await n.getIdToken(),i=await J(n,si(t,{idToken:r}));u(i?.users.length,t,"internal-error");const s=i.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?hi(s.providerUserInfo):[],a=di(n.providerData,o),c=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!a?.length,d=c?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new zt(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function ui(n){const e=D(n);await he(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function di(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function hi(n){return n.map(e=>{var{providerId:t}=e,r=We(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
616
+ */async function he(n){var e;const t=n.auth,r=await n.getIdToken(),i=await J(n,oi(t,{idToken:r}));u(i?.users.length,t,"internal-error");const s=i.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?fi(s.providerUserInfo):[],a=hi(n.providerData,o),c=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!a?.length,d=c?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new zt(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function di(n){const e=D(n);await he(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function hi(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function fi(n){return n.map(e=>{var{providerId:t}=e,r=We(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
617
617
  * @license
618
618
  * Copyright 2020 Google LLC
619
619
  *
@@ -628,7 +628,7 @@
628
628
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629
629
  * See the License for the specific language governing permissions and
630
630
  * limitations under the License.
631
- */async function fi(n,e){const t=await Wt(n,{},async()=>{const r=Z({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=jt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Vt.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
631
+ */async function pi(n,e){const t=await Wt(n,{},async()=>{const r=Z({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=jt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Vt.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
632
632
  * @license
633
633
  * Copyright 2020 Google LLC
634
634
  *
@@ -643,7 +643,7 @@
643
643
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
644
644
  * See the License for the specific language governing permissions and
645
645
  * limitations under the License.
646
- */class Y{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):ai(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return u(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await fi(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new Y;return r&&(u(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}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 Y,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
646
+ */class Y{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):ci(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return u(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await pi(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new Y;return r&&(u(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}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 Y,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
647
647
  * @license
648
648
  * Copyright 2020 Google LLC
649
649
  *
@@ -658,7 +658,7 @@
658
658
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
659
659
  * See the License for the specific language governing permissions and
660
660
  * limitations under the License.
661
- */function w(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class N{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=We(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new li(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new zt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await J(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return oi(this,e)}reload(){return ui(this)}_assign(e){this!==e&&(u(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(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){return new N(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(e){u(!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 he(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await J(this,ii(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,i,s,o,a,c,l,d;const f=(r=t.displayName)!==null&&r!==void 0?r:void 0,g=(i=t.email)!==null&&i!==void 0?i:void 0,I=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,U=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Xe=(a=t.tenantId)!==null&&a!==void 0?a:void 0,Te=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,Qe=(l=t.createdAt)!==null&&l!==void 0?l:void 0,Ze=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:Se,emailVerified:et,isAnonymous:tt,providerData:ke,stsTokenManager:nt}=t;u(Se&&nt,e,"internal-error");const mn=Y.fromJSON(this.name,nt);u(typeof Se=="string",e,"internal-error"),w(f,e.name),w(g,e.name),u(typeof et=="boolean",e,"internal-error"),u(typeof tt=="boolean",e,"internal-error"),w(I,e.name),w(U,e.name),w(Xe,e.name),w(Te,e.name),w(Qe,e.name),w(Ze,e.name);const Ae=new N({uid:Se,auth:e,email:g,emailVerified:et,displayName:f,isAnonymous:tt,photoURL:U,phoneNumber:I,tenantId:Xe,stsTokenManager:mn,createdAt:Qe,lastLoginAt:Ze});return ke&&Array.isArray(ke)&&(Ae.providerData=ke.map(_n=>Object.assign({},_n))),Te&&(Ae._redirectEventId=Te),Ae}static async _fromIdTokenResponse(e,t,r=!1){const i=new Y;i.updateFromServerResponse(t);const s=new N({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await he(s),s}}/**
661
+ */function w(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class N{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=We(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ui(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new zt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await J(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return ai(this,e)}reload(){return di(this)}_assign(e){this!==e&&(u(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(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){return new N(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(e){u(!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 he(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await J(this,si(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,i,s,o,a,c,l,d;const f=(r=t.displayName)!==null&&r!==void 0?r:void 0,g=(i=t.email)!==null&&i!==void 0?i:void 0,I=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,U=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Xe=(a=t.tenantId)!==null&&a!==void 0?a:void 0,Te=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,Qe=(l=t.createdAt)!==null&&l!==void 0?l:void 0,Ze=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:Se,emailVerified:et,isAnonymous:tt,providerData:ke,stsTokenManager:nt}=t;u(Se&&nt,e,"internal-error");const mn=Y.fromJSON(this.name,nt);u(typeof Se=="string",e,"internal-error"),w(f,e.name),w(g,e.name),u(typeof et=="boolean",e,"internal-error"),u(typeof tt=="boolean",e,"internal-error"),w(I,e.name),w(U,e.name),w(Xe,e.name),w(Te,e.name),w(Qe,e.name),w(Ze,e.name);const Ae=new N({uid:Se,auth:e,email:g,emailVerified:et,displayName:f,isAnonymous:tt,photoURL:U,phoneNumber:I,tenantId:Xe,stsTokenManager:mn,createdAt:Qe,lastLoginAt:Ze});return ke&&Array.isArray(ke)&&(Ae.providerData=ke.map(_n=>Object.assign({},_n))),Te&&(Ae._redirectEventId=Te),Ae}static async _fromIdTokenResponse(e,t,r=!1){const i=new Y;i.updateFromServerResponse(t);const s=new N({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await he(s),s}}/**
662
662
  * @license
663
663
  * Copyright 2019 Google LLC
664
664
  *
@@ -703,7 +703,7 @@
703
703
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
704
704
  * See the License for the specific language governing permissions and
705
705
  * limitations under the License.
706
- */function gt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Jt(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(qt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Xt(e))return"Blackberry";if(Qt(e))return"Webos";if(qe(e))return"Safari";if((e.includes("chrome/")||Kt(e))&&!e.includes("edge/"))return"Chrome";if(Yt(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function qt(n=p()){return/firefox\//i.test(n)}function qe(n=p()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Kt(n=p()){return/crios\//i.test(n)}function Jt(n=p()){return/iemobile/i.test(n)}function Yt(n=p()){return/android/i.test(n)}function Xt(n=p()){return/blackberry/i.test(n)}function Qt(n=p()){return/webos/i.test(n)}function Ie(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function pi(n=p()){var e;return Ie(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function gi(){return On()&&document.documentMode===10}function Zt(n=p()){return Ie(n)||Yt(n)||Qt(n)||Xt(n)||/windows phone/i.test(n)||Jt(n)}function mi(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
706
+ */function gt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Jt(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Kt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Xt(e))return"Blackberry";if(Qt(e))return"Webos";if(Ke(e))return"Safari";if((e.includes("chrome/")||qt(e))&&!e.includes("edge/"))return"Chrome";if(Yt(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function Kt(n=p()){return/firefox\//i.test(n)}function Ke(n=p()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function qt(n=p()){return/crios\//i.test(n)}function Jt(n=p()){return/iemobile/i.test(n)}function Yt(n=p()){return/android/i.test(n)}function Xt(n=p()){return/blackberry/i.test(n)}function Qt(n=p()){return/webos/i.test(n)}function Ie(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function gi(n=p()){var e;return Ie(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function mi(){return Dn()&&document.documentMode===10}function Zt(n=p()){return Ie(n)||Yt(n)||Qt(n)||Xt(n)||/windows phone/i.test(n)||Jt(n)}function _i(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
707
707
  * @license
708
708
  * Copyright 2020 Google LLC
709
709
  *
@@ -733,7 +733,7 @@
733
733
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
734
734
  * See the License for the specific language governing permissions and
735
735
  * limitations under the License.
736
- */class _i{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,a)=>{try{const c=e(s);o(c)}catch(c){a(c)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}/**
736
+ */class vi{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,a)=>{try{const c=e(s);o(c)}catch(c){a(c)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}/**
737
737
  * @license
738
738
  * Copyright 2020 Google LLC
739
739
  *
@@ -748,7 +748,7 @@
748
748
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749
749
  * See the License for the specific language governing permissions and
750
750
  * limitations under the License.
751
- */class vi{constructor(e,t,r){this.app=e,this.heartbeatServiceProvider=t,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new mt(this),this.idTokenSubscription=new mt(this),this.beforeStateQueue=new _i(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Ht,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=b(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await F.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=i?._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&c?.user&&(i=c.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await he(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=ei()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?D(e):null;return t&&u(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&&u(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(b(e))})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Q("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)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&b(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await F.create(this,[b(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()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return u(o,this,"internal-error"),o.then(()=>s(this.currentUser)),typeof t=="function"?e.addObserver(t,r,i):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 u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=en(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={["X-Client-Version"]:this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());return r&&(t["X-Firebase-Client"]=r),t}}function ye(n){return D(n)}class mt{constructor(e){this.auth=e,this.observer=null,this.addObserver=xn(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function Ii(n,e,t){const r=ye(n);u(r._canInitEmulator,r,"emulator-config-failed"),u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=tn(e),{host:o,port:a}=yi(e),c=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||bi()}function tn(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function yi(n){const e=tn(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:_t(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:_t(o)}}}function _t(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function bi(){function n(){const 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)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
751
+ */class Ii{constructor(e,t,r){this.app=e,this.heartbeatServiceProvider=t,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new mt(this),this.idTokenSubscription=new mt(this),this.beforeStateQueue=new vi(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Ht,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=b(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await F.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=i?._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&c?.user&&(i=c.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await he(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=ti()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?D(e):null;return t&&u(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&&u(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(b(e))})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Q("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)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&b(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await F.create(this,[b(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()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return u(o,this,"internal-error"),o.then(()=>s(this.currentUser)),typeof t=="function"?e.addObserver(t,r,i):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 u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=en(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={["X-Client-Version"]:this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());return r&&(t["X-Firebase-Client"]=r),t}}function ye(n){return D(n)}class mt{constructor(e){this.auth=e,this.observer=null,this.addObserver=Bn(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function yi(n,e,t){const r=ye(n);u(r._canInitEmulator,r,"emulator-config-failed"),u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=tn(e),{host:o,port:a}=bi(e),c=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||Ei()}function tn(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function bi(n){const e=tn(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:_t(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:_t(o)}}}function _t(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Ei(){function n(){const 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)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
752
752
  * @license
753
753
  * Copyright 2020 Google LLC
754
754
  *
@@ -763,7 +763,7 @@
763
763
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
764
764
  * See the License for the specific language governing permissions and
765
765
  * limitations under the License.
766
- */class Ke{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 Ei(n,e){return te(n,"POST","/v1/accounts:update",e)}/**
766
+ */class qe{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 wi(n,e){return te(n,"POST","/v1/accounts:update",e)}/**
767
767
  * @license
768
768
  * Copyright 2020 Google LLC
769
769
  *
@@ -778,7 +778,7 @@
778
778
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
779
779
  * See the License for the specific language governing permissions and
780
780
  * limitations under the License.
781
- */async function wi(n,e){return ve(n,"POST","/v1/accounts:signInWithPassword",_e(n,e))}/**
781
+ */async function Ti(n,e){return ve(n,"POST","/v1/accounts:signInWithPassword",_e(n,e))}/**
782
782
  * @license
783
783
  * Copyright 2020 Google LLC
784
784
  *
@@ -793,7 +793,7 @@
793
793
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
794
794
  * See the License for the specific language governing permissions and
795
795
  * limitations under the License.
796
- */async function Ti(n,e){return ve(n,"POST","/v1/accounts:signInWithEmailLink",_e(n,e))}async function Si(n,e){return ve(n,"POST","/v1/accounts:signInWithEmailLink",_e(n,e))}/**
796
+ */async function Si(n,e){return ve(n,"POST","/v1/accounts:signInWithEmailLink",_e(n,e))}async function ki(n,e){return ve(n,"POST","/v1/accounts:signInWithEmailLink",_e(n,e))}/**
797
797
  * @license
798
798
  * Copyright 2020 Google LLC
799
799
  *
@@ -808,7 +808,7 @@
808
808
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809
809
  * See the License for the specific language governing permissions and
810
810
  * limitations under the License.
811
- */class X extends Ke{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new X(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new X(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return wi(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Ti(e,{email:this._email,oobCode:this._password});default:m(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Ei(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Si(e,{idToken:t,email:this._email,oobCode:this._password});default:m(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
811
+ */class X extends qe{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new X(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new X(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Ti(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Si(e,{email:this._email,oobCode:this._password});default:m(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return wi(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return ki(e,{idToken:t,email:this._email,oobCode:this._password});default:m(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
812
812
  * @license
813
813
  * Copyright 2020 Google LLC
814
814
  *
@@ -838,7 +838,7 @@
838
838
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
839
839
  * See the License for the specific language governing permissions and
840
840
  * limitations under the License.
841
- */const ki="http://localhost";class L extends Ke{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new L(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):m("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){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=We(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new L(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return $(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,$(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,$(e,t)}buildRequest(){const e={requestUri:ki,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const 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=Z(t)}return e}}/**
841
+ */const Ai="http://localhost";class L extends qe{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new L(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):m("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){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=We(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new L(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return $(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,$(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,$(e,t)}buildRequest(){const e={requestUri:Ai,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const 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=Z(t)}return e}}/**
842
842
  * @license
843
843
  * Copyright 2020 Google LLC
844
844
  *
@@ -853,7 +853,7 @@
853
853
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
854
854
  * See the License for the specific language governing permissions and
855
855
  * limitations under the License.
856
- */function Ai(n){switch(n){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}}function Ri(n){const e=j(z(n)).link,t=e?j(z(e)).deep_link_id:null,r=j(z(n)).deep_link_id;return(r?j(z(r)).link:null)||r||t||e||n}class be{constructor(e){var t,r,i,s,o,a;const c=j(z(e)),l=(t=c.apiKey)!==null&&t!==void 0?t:null,d=(r=c.oobCode)!==null&&r!==void 0?r:null,f=Ai((i=c.mode)!==null&&i!==void 0?i:null);u(l&&d&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=d,this.continueUrl=(s=c.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=c.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const t=Ri(e);try{return new be(t)}catch{return null}}}/**
856
+ */function Ri(n){switch(n){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}}function Ci(n){const e=j(z(n)).link,t=e?j(z(e)).deep_link_id:null,r=j(z(n)).deep_link_id;return(r?j(z(r)).link:null)||r||t||e||n}class be{constructor(e){var t,r,i,s,o,a;const c=j(z(e)),l=(t=c.apiKey)!==null&&t!==void 0?t:null,d=(r=c.oobCode)!==null&&r!==void 0?r:null,f=Ri((i=c.mode)!==null&&i!==void 0?i:null);u(l&&d&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=d,this.continueUrl=(s=c.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=c.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const t=Ci(e);try{return new be(t)}catch{return null}}}/**
857
857
  * @license
858
858
  * Copyright 2020 Google LLC
859
859
  *
@@ -988,7 +988,7 @@
988
988
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
989
989
  * See the License for the specific language governing permissions and
990
990
  * limitations under the License.
991
- */class fe extends O{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,fe.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new fe(e,t,r,i)}}function rn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?fe._fromErrorAndOperation(n,s,e,r):s})}async function Ci(n,e,t=!1){const r=await J(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return V._forOperation(n,"link",r)}/**
991
+ */class fe extends O{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,fe.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new fe(e,t,r,i)}}function rn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?fe._fromErrorAndOperation(n,s,e,r):s})}async function Oi(n,e,t=!1){const r=await J(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return V._forOperation(n,"link",r)}/**
992
992
  * @license
993
993
  * Copyright 2019 Google LLC
994
994
  *
@@ -1003,7 +1003,7 @@
1003
1003
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1004
1004
  * See the License for the specific language governing permissions and
1005
1005
  * limitations under the License.
1006
- */async function Oi(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=await J(n,rn(r,i,e,n),t);u(s.idToken,r,"internal-error");const o=Ge(s.idToken);u(o,r,"internal-error");const{sub:a}=o;return u(n.uid===a,r,"user-mismatch"),V._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&m(r,"user-mismatch"),s}}/**
1006
+ */async function Di(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=await J(n,rn(r,i,e,n),t);u(s.idToken,r,"internal-error");const o=Ge(s.idToken);u(o,r,"internal-error");const{sub:a}=o;return u(n.uid===a,r,"user-mismatch"),V._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&m(r,"user-mismatch"),s}}/**
1007
1007
  * @license
1008
1008
  * Copyright 2020 Google LLC
1009
1009
  *
@@ -1018,7 +1018,7 @@
1018
1018
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1019
1019
  * See the License for the specific language governing permissions and
1020
1020
  * limitations under the License.
1021
- */async function sn(n,e,t=!1){const r="signIn",i=await rn(n,r,e),s=await V._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Di(n,e){return sn(ye(n),e)}function qs(n,e){const t=be.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function Ks(n,e,t){const r=D(n),i=W.credentialWithLink(e,t||de());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Di(r,i)}function Pi(n,e,t,r){return D(n).onIdTokenChanged(e,t,r)}function Ni(n,e,t){return D(n).beforeAuthStateChanged(e,t)}function Js(n,e,t,r){return D(n).onAuthStateChanged(e,t,r)}const pe="__sak";/**
1021
+ */async function sn(n,e,t=!1){const r="signIn",i=await rn(n,r,e),s=await V._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Pi(n,e){return sn(ye(n),e)}function qs(n,e){const t=be.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function Js(n,e,t){const r=D(n),i=W.credentialWithLink(e,t||de());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Pi(r,i)}function Ni(n,e,t,r){return D(n).onIdTokenChanged(e,t,r)}function Mi(n,e,t){return D(n).beforeAuthStateChanged(e,t)}function Ys(n,e,t,r){return D(n).onAuthStateChanged(e,t,r)}const pe="__sak";/**
1022
1022
  * @license
1023
1023
  * Copyright 2019 Google LLC
1024
1024
  *
@@ -1048,7 +1048,7 @@
1048
1048
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1049
1049
  * See the License for the specific language governing permissions and
1050
1050
  * limitations under the License.
1051
- */function Mi(){const n=p();return qe(n)||Ie(n)}const Li=1e3,Ui=10;class an extends on{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Mi()&&mi(),this.fallbackToPolling=Zt(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);gi()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Ui):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},Li)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}an.type="LOCAL";const xi=an;/**
1051
+ */function Li(){const n=p();return Ke(n)||Ie(n)}const Ui=1e3,xi=10;class an extends on{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Li()&&_i(),this.fallbackToPolling=Zt(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);mi()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,xi):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},Ui)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}an.type="LOCAL";const Bi=an;/**
1052
1052
  * @license
1053
1053
  * Copyright 2020 Google LLC
1054
1054
  *
@@ -1078,7 +1078,7 @@
1078
1078
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1079
1079
  * See the License for the specific language governing permissions and
1080
1080
  * limitations under the License.
1081
- */function Bi(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1081
+ */function Fi(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1082
1082
  * @license
1083
1083
  * Copyright 2019 Google LLC
1084
1084
  *
@@ -1093,7 +1093,7 @@
1093
1093
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1094
1094
  * See the License for the specific language governing permissions and
1095
1095
  * limitations under the License.
1096
- */class Ee{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new Ee(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async l=>l(t.origin,s)),c=await Bi(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&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||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Ee.receivers=[];/**
1096
+ */class Ee{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new Ee(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async l=>l(t.origin,s)),c=await Fi(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&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||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Ee.receivers=[];/**
1097
1097
  * @license
1098
1098
  * Copyright 2020 Google LLC
1099
1099
  *
@@ -1123,7 +1123,7 @@
1123
1123
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1124
1124
  * See the License for the specific language governing permissions and
1125
1125
  * limitations under the License.
1126
- */class Fi{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){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const l=Je("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const g=f;if(g.data.eventId===l)switch(g.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(g.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1126
+ */class $i{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){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const l=Je("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const g=f;if(g.data.eventId===l)switch(g.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(g.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1127
1127
  * @license
1128
1128
  * Copyright 2020 Google LLC
1129
1129
  *
@@ -1138,7 +1138,7 @@
1138
1138
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1139
1139
  * See the License for the specific language governing permissions and
1140
1140
  * limitations under the License.
1141
- */function v(){return window}function $i(n){v().location.href=n}/**
1141
+ */function v(){return window}function Hi(n){v().location.href=n}/**
1142
1142
  * @license
1143
1143
  * Copyright 2020 Google LLC.
1144
1144
  *
@@ -1153,7 +1153,7 @@
1153
1153
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1154
1154
  * See the License for the specific language governing permissions and
1155
1155
  * limitations under the License.
1156
- */function un(){return typeof v().WorkerGlobalScope<"u"&&typeof v().importScripts=="function"}async function Hi(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Vi(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function Wi(){return un()?self:null}/**
1156
+ */function un(){return typeof v().WorkerGlobalScope<"u"&&typeof v().importScripts=="function"}async function Vi(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Wi(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function ji(){return un()?self:null}/**
1157
1157
  * @license
1158
1158
  * Copyright 2019 Google LLC
1159
1159
  *
@@ -1168,7 +1168,7 @@
1168
1168
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1169
1169
  * See the License for the specific language governing permissions and
1170
1170
  * limitations under the License.
1171
- */const dn="firebaseLocalStorageDb",ji=1,ge="firebaseLocalStorage",hn="fbase_key";class re{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 we(n,e){return n.transaction([ge],e?"readwrite":"readonly").objectStore(ge)}function zi(){const n=indexedDB.deleteDatabase(dn);return new re(n).toPromise()}function $e(){const n=indexedDB.open(dn,ji);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(ge,{keyPath:hn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(ge)?e(r):(r.close(),await zi(),e(await $e()))})})}async function It(n,e,t){const r=we(n,!0).put({[hn]:e,value:t});return new re(r).toPromise()}async function Gi(n,e){const t=we(n,!1).get(e),r=await new re(t).toPromise();return r===void 0?null:r.value}function yt(n,e){const t=we(n,!0).delete(e);return new re(t).toPromise()}const qi=800,Ki=3;class fn{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await $e(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Ki)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return un()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ee._getInstance(Wi()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Hi(),!this.activeServiceWorker)return;this.sender=new Fi(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((t=r[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Vi()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await $e();return await It(e,pe,"1"),await yt(e,pe),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>It(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>Gi(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>yt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=we(i,!1).getAll();return new re(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),qi)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&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),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}fn.type="LOCAL";const Ji=fn;/**
1171
+ */const dn="firebaseLocalStorageDb",zi=1,ge="firebaseLocalStorage",hn="fbase_key";class re{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 we(n,e){return n.transaction([ge],e?"readwrite":"readonly").objectStore(ge)}function Gi(){const n=indexedDB.deleteDatabase(dn);return new re(n).toPromise()}function $e(){const n=indexedDB.open(dn,zi);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(ge,{keyPath:hn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(ge)?e(r):(r.close(),await Gi(),e(await $e()))})})}async function It(n,e,t){const r=we(n,!0).put({[hn]:e,value:t});return new re(r).toPromise()}async function Ki(n,e){const t=we(n,!1).get(e),r=await new re(t).toPromise();return r===void 0?null:r.value}function yt(n,e){const t=we(n,!0).delete(e);return new re(t).toPromise()}const qi=800,Ji=3;class fn{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await $e(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Ji)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return un()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ee._getInstance(ji()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Vi(),!this.activeServiceWorker)return;this.sender=new $i(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((t=r[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Wi()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await $e();return await It(e,pe,"1"),await yt(e,pe),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>It(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>Ki(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>yt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=we(i,!1).getAll();return new re(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),qi)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&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),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}fn.type="LOCAL";const Yi=fn;/**
1172
1172
  * @license
1173
1173
  * Copyright 2020 Google LLC
1174
1174
  *
@@ -1183,7 +1183,7 @@
1183
1183
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1184
1184
  * See the License for the specific language governing permissions and
1185
1185
  * limitations under the License.
1186
- */function Yi(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function Xi(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=_("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Yi().appendChild(r)})}function Qi(n){return`__${n}${Math.floor(Math.random()*1e6)}`}new ee(3e4,6e4);/**
1186
+ */function Xi(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function Qi(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=_("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Xi().appendChild(r)})}function Zi(n){return`__${n}${Math.floor(Math.random()*1e6)}`}new ee(3e4,6e4);/**
1187
1187
  * @license
1188
1188
  * Copyright 2021 Google LLC
1189
1189
  *
@@ -1198,7 +1198,7 @@
1198
1198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1199
1199
  * See the License for the specific language governing permissions and
1200
1200
  * limitations under the License.
1201
- */function Zi(n,e){return e?b(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1201
+ */function es(n,e){return e?b(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1202
1202
  * @license
1203
1203
  * Copyright 2019 Google LLC
1204
1204
  *
@@ -1213,7 +1213,7 @@
1213
1213
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
1214
  * See the License for the specific language governing permissions and
1215
1215
  * limitations under the License.
1216
- */class Ye extends Ke{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return $(e,this._buildIdpRequest())}_linkToIdToken(e,t){return $(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return $(e,this._buildIdpRequest())}_buildIdpRequest(e){const 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 es(n){return sn(n.auth,new Ye(n),n.bypassAuthState)}function ts(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Oi(t,new Ye(n),n.bypassAuthState)}async function ns(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Ci(t,new Ye(n),n.bypassAuthState)}/**
1216
+ */class Ye extends qe{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return $(e,this._buildIdpRequest())}_linkToIdToken(e,t){return $(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return $(e,this._buildIdpRequest())}_buildIdpRequest(e){const 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 ts(n){return sn(n.auth,new Ye(n),n.bypassAuthState)}function ns(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Di(t,new Ye(n),n.bypassAuthState)}async function rs(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Oi(t,new Ye(n),n.bypassAuthState)}/**
1217
1217
  * @license
1218
1218
  * Copyright 2020 Google LLC
1219
1219
  *
@@ -1228,7 +1228,7 @@
1228
1228
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1229
1229
  * See the License for the specific language governing permissions and
1230
1230
  * limitations under the License.
1231
- */class pn{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,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(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return es;case"linkViaPopup":case"linkViaRedirect":return ns;case"reauthViaPopup":case"reauthViaRedirect":return ts;default:m(this.auth,"internal-error")}}resolve(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1231
+ */class pn{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,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(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return ts;case"linkViaPopup":case"linkViaRedirect":return rs;case"reauthViaPopup":case"reauthViaRedirect":return ns;default:m(this.auth,"internal-error")}}resolve(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1232
1232
  * @license
1233
1233
  * Copyright 2020 Google LLC
1234
1234
  *
@@ -1243,7 +1243,7 @@
1243
1243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1244
1244
  * See the License for the specific language governing permissions and
1245
1245
  * limitations under the License.
1246
- */const rs=new ee(2e3,1e4);class x extends pn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,x.currentPopupAction&&x.currentPopupAction.cancel(),x.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){E(this.filter.length===1,"Popup operations only handle one event");const e=Je();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(_(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(_(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,x.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(_(this.auth,"popup-closed-by-user"))},2e3);return}this.pollId=window.setTimeout(e,rs.get())};e()}}x.currentPopupAction=null;/**
1246
+ */const is=new ee(2e3,1e4);class x extends pn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,x.currentPopupAction&&x.currentPopupAction.cancel(),x.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){E(this.filter.length===1,"Popup operations only handle one event");const e=Je();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(_(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(_(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,x.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(_(this.auth,"popup-closed-by-user"))},2e3);return}this.pollId=window.setTimeout(e,is.get())};e()}}x.currentPopupAction=null;/**
1247
1247
  * @license
1248
1248
  * Copyright 2020 Google LLC
1249
1249
  *
@@ -1258,7 +1258,7 @@
1258
1258
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1259
1259
  * See the License for the specific language governing permissions and
1260
1260
  * limitations under the License.
1261
- */const is="pendingRedirect",ae=new Map;class ss extends pn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ae.get(this.auth._key());if(!e){try{const r=await os(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}ae.set(this.auth._key(),e)}return this.bypassAuthState||ae.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function os(n,e){const t=ls(e),r=cs(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function as(n,e){ae.set(n._key(),e)}function cs(n){return b(n._redirectPersistence)}function ls(n){return oe(is,n.config.apiKey,n.name)}async function us(n,e,t=!1){const r=ye(n),i=Zi(r,e),o=await new ss(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1261
+ */const ss="pendingRedirect",ae=new Map;class os extends pn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ae.get(this.auth._key());if(!e){try{const r=await as(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}ae.set(this.auth._key(),e)}return this.bypassAuthState||ae.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function as(n,e){const t=us(e),r=ls(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function cs(n,e){ae.set(n._key(),e)}function ls(n){return b(n._redirectPersistence)}function us(n){return oe(ss,n.config.apiKey,n.name)}async function ds(n,e,t=!1){const r=ye(n),i=es(r,e),o=await new os(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1262
1262
  * @license
1263
1263
  * Copyright 2020 Google LLC
1264
1264
  *
@@ -1273,7 +1273,7 @@
1273
1273
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1274
1274
  * See the License for the specific language governing permissions and
1275
1275
  * limitations under the License.
1276
- */const ds=10*60*1e3;class hs{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||!fs(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!gn(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(_(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=ds&&this.cachedEventUids.clear(),this.cachedEventUids.has(bt(e))}saveEventToCache(e){this.cachedEventUids.add(bt(e)),this.lastProcessedEventTime=Date.now()}}function bt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function gn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function fs(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return gn(n);default:return!1}}/**
1276
+ */const hs=10*60*1e3;class fs{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||!ps(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!gn(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(_(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=hs&&this.cachedEventUids.clear(),this.cachedEventUids.has(bt(e))}saveEventToCache(e){this.cachedEventUids.add(bt(e)),this.lastProcessedEventTime=Date.now()}}function bt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function gn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function ps(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return gn(n);default:return!1}}/**
1277
1277
  * @license
1278
1278
  * Copyright 2020 Google LLC
1279
1279
  *
@@ -1288,7 +1288,7 @@
1288
1288
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1289
1289
  * See the License for the specific language governing permissions and
1290
1290
  * limitations under the License.
1291
- */async function ps(n,e={}){return te(n,"GET","/v1/projects",e)}/**
1291
+ */async function gs(n,e={}){return te(n,"GET","/v1/projects",e)}/**
1292
1292
  * @license
1293
1293
  * Copyright 2020 Google LLC
1294
1294
  *
@@ -1303,7 +1303,7 @@
1303
1303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304
1304
  * See the License for the specific language governing permissions and
1305
1305
  * limitations under the License.
1306
- */const gs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ms=/^https?/;async function _s(n){if(n.config.emulator)return;const{authorizedDomains:e}=await ps(n);for(const t of e)try{if(vs(t))return}catch{}m(n,"unauthorized-domain")}function vs(n){const e=de(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!ms.test(t))return!1;if(gs.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1306
+ */const ms=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,_s=/^https?/;async function vs(n){if(n.config.emulator)return;const{authorizedDomains:e}=await gs(n);for(const t of e)try{if(Is(t))return}catch{}m(n,"unauthorized-domain")}function Is(n){const e=de(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!_s.test(t))return!1;if(ms.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1307
1307
  * @license
1308
1308
  * Copyright 2020 Google LLC.
1309
1309
  *
@@ -1318,7 +1318,7 @@
1318
1318
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1319
1319
  * See the License for the specific language governing permissions and
1320
1320
  * limitations under the License.
1321
- */const Is=new ee(3e4,6e4);function Et(){const n=v().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function ys(n){return new Promise((e,t)=>{var r,i,s;function o(){Et(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Et(),t(_(n,"network-request-failed"))},timeout:Is.get()})}if(!((i=(r=v().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=v().gapi)===null||s===void 0)&&s.load)o();else{const a=Qi("iframefcb");return v()[a]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},Xi(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw ce=null,e})}let ce=null;function bs(n){return ce=ce||ys(n),ce}/**
1321
+ */const ys=new ee(3e4,6e4);function Et(){const n=v().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function bs(n){return new Promise((e,t)=>{var r,i,s;function o(){Et(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Et(),t(_(n,"network-request-failed"))},timeout:ys.get()})}if(!((i=(r=v().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=v().gapi)===null||s===void 0)&&s.load)o();else{const a=Zi("iframefcb");return v()[a]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},Qi(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw ce=null,e})}let ce=null;function Es(n){return ce=ce||bs(n),ce}/**
1322
1322
  * @license
1323
1323
  * Copyright 2020 Google LLC.
1324
1324
  *
@@ -1333,7 +1333,7 @@
1333
1333
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1334
1334
  * See the License for the specific language governing permissions and
1335
1335
  * limitations under the License.
1336
- */const Es=new ee(5e3,15e3),ws="__/auth/iframe",Ts="emulator/auth/iframe",Ss={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ks=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function As(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?ze(e,Ts):`https://${n.config.authDomain}/${ws}`,r={apiKey:e.apiKey,appName:n.name,v:me},i=ks.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${Z(r).slice(1)}`}async function Rs(n){const e=await bs(n),t=v().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:As(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Ss,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=_(n,"network-request-failed"),a=v().setTimeout(()=>{s(o)},Es.get());function c(){v().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1336
+ */const ws=new ee(5e3,15e3),Ts="__/auth/iframe",Ss="emulator/auth/iframe",ks={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},As=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Rs(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?ze(e,Ss):`https://${n.config.authDomain}/${Ts}`,r={apiKey:e.apiKey,appName:n.name,v:me},i=As.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${Z(r).slice(1)}`}async function Cs(n){const e=await Es(n),t=v().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:Rs(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:ks,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=_(n,"network-request-failed"),a=v().setTimeout(()=>{s(o)},ws.get());function c(){v().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1337
1337
  * @license
1338
1338
  * Copyright 2020 Google LLC.
1339
1339
  *
@@ -1348,7 +1348,7 @@
1348
1348
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1349
1349
  * See the License for the specific language governing permissions and
1350
1350
  * limitations under the License.
1351
- */const Cs={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Os=500,Ds=600,Ps="_blank",Ns="http://localhost";class wt{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Ms(n,e,t,r=Os,i=Ds){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c=Object.assign(Object.assign({},Cs),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(a=Kt(l)?Ps:t),qt(l)&&(e=e||Ns,c.scrollbars="yes");const d=Object.entries(c).reduce((g,[I,U])=>`${g}${I}=${U},`,"");if(pi(l)&&a!=="_self")return Ls(e||"",a),new wt(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new wt(f)}function Ls(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
1351
+ */const Os={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Ds=500,Ps=600,Ns="_blank",Ms="http://localhost";class wt{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Ls(n,e,t,r=Ds,i=Ps){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c=Object.assign(Object.assign({},Os),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(a=qt(l)?Ns:t),Kt(l)&&(e=e||Ms,c.scrollbars="yes");const d=Object.entries(c).reduce((g,[I,U])=>`${g}${I}=${U},`,"");if(gi(l)&&a!=="_self")return Us(e||"",a),new wt(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new wt(f)}function Us(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
1352
1352
  * @license
1353
1353
  * Copyright 2021 Google LLC
1354
1354
  *
@@ -1363,7 +1363,7 @@
1363
1363
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1364
1364
  * See the License for the specific language governing permissions and
1365
1365
  * limitations under the License.
1366
- */const Us="__/auth/handler",xs="emulator/auth/handler";function Tt(n,e,t,r,i,s){u(n.config.authDomain,n,"auth-domain-config-required"),u(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:me,eventId:i};if(e instanceof nn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Un(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[c,l]of Object.entries(s||{}))o[c]=l}if(e instanceof ne){const c=e.getScopes().filter(l=>l!=="");c.length>0&&(o.scopes=c.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];return`${Bs(n)}?${Z(a).slice(1)}`}function Bs({config:n}){return n.emulator?ze(n,xs):`https://${n.authDomain}/${Us}`}/**
1366
+ */const xs="__/auth/handler",Bs="emulator/auth/handler";function Tt(n,e,t,r,i,s){u(n.config.authDomain,n,"auth-domain-config-required"),u(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:me,eventId:i};if(e instanceof nn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",xn(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[c,l]of Object.entries(s||{}))o[c]=l}if(e instanceof ne){const c=e.getScopes().filter(l=>l!=="");c.length>0&&(o.scopes=c.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];return`${Fs(n)}?${Z(a).slice(1)}`}function Fs({config:n}){return n.emulator?ze(n,Bs):`https://${n.authDomain}/${xs}`}/**
1367
1367
  * @license
1368
1368
  * Copyright 2020 Google LLC
1369
1369
  *
@@ -1378,7 +1378,7 @@
1378
1378
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1379
1379
  * See the License for the specific language governing permissions and
1380
1380
  * limitations under the License.
1381
- */const Me="webStorageSupport";class Fs{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ln,this._completeRedirectFn=us,this._overrideRedirectResult=as}async _openPopup(e,t,r,i){var s;E((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=Tt(e,t,r,de(),i);return Ms(e,o,Je())}async _openRedirect(e,t,r,i){return await this._originValidation(e),$i(Tt(e,t,r,de(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(E(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Rs(e),r=new hs(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Me,{type:Me},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Me];o!==void 0&&t(!!o),m(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=_s(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Zt()||qe()||Ie()}}const $s=Fs;var St="@firebase/auth",kt="0.21.3";/**
1381
+ */const Me="webStorageSupport";class $s{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ln,this._completeRedirectFn=ds,this._overrideRedirectResult=cs}async _openPopup(e,t,r,i){var s;E((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=Tt(e,t,r,de(),i);return Ls(e,o,Je())}async _openRedirect(e,t,r,i){return await this._originValidation(e),Hi(Tt(e,t,r,de(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(E(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Cs(e),r=new fs(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Me,{type:Me},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Me];o!==void 0&&t(!!o),m(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=vs(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Zt()||Ke()||Ie()}}const Hs=$s;var St="@firebase/auth",kt="0.21.4";/**
1382
1382
  * @license
1383
1383
  * Copyright 2020 Google LLC
1384
1384
  *
@@ -1393,7 +1393,7 @@
1393
1393
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394
1394
  * See the License for the specific language governing permissions and
1395
1395
  * limitations under the License.
1396
- */class Hs{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1396
+ */class Vs{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1397
1397
  * @license
1398
1398
  * Copyright 2020 Google LLC
1399
1399
  *
@@ -1408,7 +1408,7 @@
1408
1408
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1409
1409
  * See the License for the specific language governing permissions and
1410
1410
  * limitations under the License.
1411
- */function Vs(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function Ws(n){q(new H("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),{apiKey:s,authDomain:o}=r.options;return((a,c)=>{u(s&&!s.includes(":"),"invalid-api-key",{appName:a.name}),u(!o?.includes(":"),"argument-error",{appName:a.name});const l={apiKey:s,authDomain:o,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:en(n)},d=new vi(a,c,l);return Xr(d,t),d})(r,i)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),q(new H("auth-internal",e=>{const t=ye(e.getProvider("auth").getImmediate());return(r=>new Hs(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),B(St,kt,Vs(n)),B(St,kt,"esm2017")}/**
1411
+ */function Ws(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function js(n){K(new H("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),{apiKey:s,authDomain:o}=r.options;return((a,c)=>{u(s&&!s.includes(":"),"invalid-api-key",{appName:a.name}),u(!o?.includes(":"),"argument-error",{appName:a.name});const l={apiKey:s,authDomain:o,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:en(n)},d=new Ii(a,c,l);return Qr(d,t),d})(r,i)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),K(new H("auth-internal",e=>{const t=ye(e.getProvider("auth").getImmediate());return(r=>new Vs(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),B(St,kt,Ws(n)),B(St,kt,"esm2017")}/**
1412
1412
  * @license
1413
1413
  * Copyright 2021 Google LLC
1414
1414
  *
@@ -1423,4 +1423,4 @@
1423
1423
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1424
1424
  * See the License for the specific language governing permissions and
1425
1425
  * limitations under the License.
1426
- */const js=5*60,zs=Pt("authIdTokenMaxAge")||js;let At=null;const Gs=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>zs)return;const i=t?.token;At!==i&&(At=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Ys(n=Ur()){const e=Ut(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Yr(n,{popupRedirectResolver:$s,persistence:[Ji,xi,ln]}),r=Pt("authTokenSyncURL");if(r){const s=Gs(r);Ni(t,s,()=>s(t.currentUser)),Pi(t,o=>s(o))}const i=Tn("auth");return i&&Ii(t,`http://${i}`),t}Ws("Browser");const Xs=xt(window.firebaseConfig);export{Xs as default,Xs as firebaseApp,Ys as getAuth,qs as isSignInWithEmailLink,Js as onAuthStateChanged,Ks as signInWithEmailLink};
1426
+ */const zs=5*60,Gs=Pt("authIdTokenMaxAge")||zs;let At=null;const Ks=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>Gs)return;const i=t?.token;At!==i&&(At=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Xs(n=xr()){const e=Ut(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Xr(n,{popupRedirectResolver:Hs,persistence:[Yi,Bi,ln]}),r=Pt("authTokenSyncURL");if(r){const s=Ks(r);Mi(t,s,()=>s(t.currentUser)),Ni(t,o=>s(o))}const i=Sn("auth");return i&&yi(t,`http://${i}`),t}js("Browser");const Qs=xt(window.firebaseConfig);export{Qs as default,Qs as firebaseApp,Xs as getAuth,qs as isSignInWithEmailLink,Ys as onAuthStateChanged,Js as signInWithEmailLink};