cloudcommerce 0.11.0 → 0.12.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 (160) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/ecomplus-stores/monocard/functions/ssr/index.js +2 -2
  3. package/ecomplus-stores/monocard/functions/ssr/src/env.d.ts +1 -0
  4. package/ecomplus-stores/monocard/functions/ssr/src/scripts/InlineScripts.astro +1 -1
  5. package/ecomplus-stores/tia-sonia/functions/ssr/index.js +2 -2
  6. package/ecomplus-stores/tia-sonia/functions/ssr/src/env.d.ts +3 -1
  7. package/ecomplus-stores/tia-sonia/functions/ssr/src/scripts/head-scripts.ts +2 -4
  8. package/ecomplus-stores/tia-sonia/functions/ssr/src/scripts/modules-info-preset.ts +1 -1
  9. package/package.json +8 -8
  10. package/packages/api/lib/types/orders.d.ts +15 -0
  11. package/packages/api/package.json +2 -3
  12. package/packages/api/src/types/orders.d.ts +15 -0
  13. package/packages/apps/correios/package.json +1 -1
  14. package/packages/apps/custom-payment/package.json +1 -1
  15. package/packages/apps/custom-shipping/package.json +1 -1
  16. package/packages/apps/datafrete/package.json +2 -2
  17. package/packages/apps/discounts/package.json +1 -1
  18. package/packages/apps/emails/package.json +1 -1
  19. package/packages/apps/fb-conversions/package.json +2 -2
  20. package/packages/apps/frenet/package.json +2 -2
  21. package/packages/apps/galaxpay/package.json +2 -2
  22. package/packages/apps/google-analytics/package.json +2 -2
  23. package/packages/apps/infinitepay/package.json +2 -2
  24. package/packages/apps/jadlog/package.json +1 -1
  25. package/packages/apps/loyalty-points/package.json +1 -1
  26. package/packages/apps/melhor-envio/package.json +2 -2
  27. package/packages/apps/mercadopago/package.json +2 -2
  28. package/packages/apps/pagarme/package.json +4 -4
  29. package/packages/apps/paghiper/package.json +2 -2
  30. package/packages/apps/pix/package.json +2 -2
  31. package/packages/apps/tiny-erp/package.json +2 -2
  32. package/packages/apps/webhooks/package.json +2 -2
  33. package/packages/cli/config/firebase.json +6 -16
  34. package/packages/cli/package.json +1 -1
  35. package/packages/config/package.json +1 -1
  36. package/packages/emails/package.json +3 -3
  37. package/packages/events/package.json +2 -2
  38. package/packages/feeds/CHANGELOG.md +1 -0
  39. package/packages/feeds/README.md +1 -0
  40. package/packages/feeds/firebase.js +1 -0
  41. package/packages/{ssr → feeds}/lib/firebase/serve-feeds.js +3 -2
  42. package/packages/{ssr → feeds}/lib/firebase/serve-feeds.js.map +1 -1
  43. package/packages/feeds/lib/firebase.js +17 -0
  44. package/packages/feeds/lib/firebase.js.map +1 -0
  45. package/packages/feeds/lib/index.js +1 -0
  46. package/packages/feeds/lib/index.js.map +1 -0
  47. package/packages/feeds/package.json +33 -0
  48. package/packages/{ssr → feeds}/src/firebase/serve-feeds.ts +3 -2
  49. package/packages/feeds/src/firebase.ts +17 -0
  50. package/packages/feeds/src/index.ts +0 -0
  51. package/packages/feeds/tsconfig.json +3 -0
  52. package/packages/firebase/lib/config.d.ts +1 -1
  53. package/packages/firebase/lib/config.js +1 -1
  54. package/packages/firebase/lib/config.js.map +1 -1
  55. package/packages/firebase/lib/handlers/check-store-events.d.ts +4 -0
  56. package/packages/firebase/lib/handlers/check-store-events.js +4 -7
  57. package/packages/firebase/lib/handlers/check-store-events.js.map +1 -1
  58. package/packages/firebase/package.json +3 -3
  59. package/packages/firebase/src/config.ts +1 -1
  60. package/packages/firebase/src/handlers/check-store-events.ts +20 -8
  61. package/packages/i18n/package.json +1 -1
  62. package/packages/modules/lib/firebase/call-app-module.js +6 -6
  63. package/packages/modules/lib/firebase/call-app-module.js.map +1 -1
  64. package/packages/modules/package.json +3 -3
  65. package/packages/modules/src/firebase/call-app-module.ts +17 -7
  66. package/packages/passport/package.json +2 -2
  67. package/packages/ssr/lib/firebase/serve-storefront.js +5 -6
  68. package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
  69. package/packages/ssr/lib/firebase.js +1 -13
  70. package/packages/ssr/lib/firebase.js.map +1 -1
  71. package/packages/ssr/package.json +7 -7
  72. package/packages/ssr/src/firebase/serve-storefront.ts +14 -9
  73. package/packages/ssr/src/firebase.ts +1 -13
  74. package/packages/storefront/client.d.ts +3 -3
  75. package/packages/storefront/config/storefront.cms.cjs +1 -1
  76. package/packages/storefront/config/storefront.cms.mjs +1 -1
  77. package/packages/storefront/dist/client/_astro/Carousel.e137cab2.js +1 -0
  78. package/packages/storefront/dist/client/_astro/HeroSlider.d677b64a.js +1 -0
  79. package/packages/storefront/dist/client/_astro/PitchBar.94f525f9.js +1 -0
  80. package/packages/storefront/dist/client/_astro/Prices.b8d4b8e4.js +1 -0
  81. package/packages/storefront/dist/client/_astro/ShopHeader.f12e72f6.js +4 -0
  82. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.116fec5b.js +1 -0
  83. package/packages/storefront/dist/client/_astro/client.c2102734.js +1 -0
  84. package/packages/storefront/dist/client/_astro/{firebase-app.f42d3d05.js → firebase-app.d513d4b8.js} +47 -47
  85. package/packages/storefront/dist/client/_astro/{format-money.d54c1237.js → format-money.1a95a3b5.js} +1 -1
  86. package/packages/storefront/dist/client/_astro/{hoisted.56fa2eff.js → hoisted.be7b77c7.js} +1 -1
  87. package/packages/storefront/dist/client/_astro/index.1190ddf5.js +1 -0
  88. package/packages/storefront/dist/client/_astro/{modules-info.ea748f9d.js → modules-info.bc2146d9.js} +1 -1
  89. package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.e2053595.js +1 -0
  90. package/packages/storefront/dist/client/_astro/session-utm.744b0db3.js +1 -0
  91. package/packages/storefront/dist/client/admin/.gitkeep +2 -0
  92. package/packages/storefront/dist/client/sw.js +1 -1
  93. package/packages/storefront/dist/server/chunks/{astro.5c9f0bea.mjs → astro.7ac24846.mjs} +320 -85
  94. package/packages/storefront/dist/server/chunks/pages/{all.5155c178.mjs → all.a42f9fc6.mjs} +87 -89
  95. package/packages/storefront/dist/server/entry.mjs +32 -25
  96. package/packages/storefront/package.json +12 -18
  97. package/packages/storefront/scripts/prepare-monorepo.sh +0 -1
  98. package/packages/storefront/server.d.ts +10 -6
  99. package/packages/storefront/src/lib/components/AccountLink.vue +2 -2
  100. package/packages/storefront/src/lib/components/globals/ALink.vue +1 -1
  101. package/packages/storefront/src/lib/composables/use-pitch-bar.ts +4 -7
  102. package/packages/storefront/src/lib/content.d.ts +10 -6
  103. package/packages/storefront/src/lib/layouts/BaseStateJson.astro +4 -4
  104. package/packages/storefront/src/lib/pages/_vue.ts +2 -2
  105. package/packages/storefront/src/lib/scripts/firebase-app.ts +1 -1
  106. package/packages/storefront/src/lib/scripts/modules-info-preset.ts +5 -5
  107. package/packages/storefront/src/lib/server-data.ts +1 -1
  108. package/packages/storefront/src/lib/ssr-context.ts +7 -9
  109. package/packages/storefront/src/lib/state/customer-session.ts +1 -1
  110. package/packages/storefront/src/lib/state/use-cms-preview.ts +15 -78
  111. package/packages/storefront/tailwind.config.cjs +5 -5
  112. package/packages/types/package.json +1 -1
  113. package/packages/api/fetch-polyfill.js +0 -21
  114. package/packages/storefront/dist/client/_astro/Carousel.06e8cee5.js +0 -1
  115. package/packages/storefront/dist/client/_astro/HeroSlider.2c4563ee.js +0 -1
  116. package/packages/storefront/dist/client/_astro/PitchBar.57e90997.js +0 -1
  117. package/packages/storefront/dist/client/_astro/Prices.bc136725.js +0 -1
  118. package/packages/storefront/dist/client/_astro/ShopHeader.0fddff0d.js +0 -4
  119. package/packages/storefront/dist/client/_astro/_commonjsHelpers.725317a4.js +0 -1
  120. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.d71c044e.js +0 -1
  121. package/packages/storefront/dist/client/_astro/client.5636c034.js +0 -128
  122. package/packages/storefront/dist/client/_astro/client.97e9e785.js +0 -1
  123. package/packages/storefront/dist/client/_astro/index.2402c50a.js +0 -9
  124. package/packages/storefront/dist/client/_astro/index.b12dff85.js +0 -1
  125. package/packages/storefront/dist/client/_astro/index.es.f69f3875.js +0 -1
  126. package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.e9908a78.js +0 -1
  127. package/packages/storefront/dist/client/_astro/server.browser.5ca16f46.js +0 -27
  128. package/packages/storefront/dist/client/_astro/session-utm.ac492493.js +0 -1
  129. package/packages/storefront/dist/client/admin/assets/Range.es-3e45690c.js +0 -1
  130. package/packages/storefront/dist/client/admin/assets/SchemaReference.es-68e2a833.js +0 -1
  131. package/packages/storefront/dist/client/admin/assets/brace-fold.es-f96db61f.js +0 -1
  132. package/packages/storefront/dist/client/admin/assets/closebrackets.es-0488b839.js +0 -2
  133. package/packages/storefront/dist/client/admin/assets/codemirror.es-15b9374a.js +0 -24
  134. package/packages/storefront/dist/client/admin/assets/comment.es-d4bed417.js +0 -2
  135. package/packages/storefront/dist/client/admin/assets/dialog.es-56aaee5b.js +0 -1
  136. package/packages/storefront/dist/client/admin/assets/foldgutter.es-55067bee.js +0 -1
  137. package/packages/storefront/dist/client/admin/assets/forEachState.es-1e367fb2.js +0 -1
  138. package/packages/storefront/dist/client/admin/assets/hint.es-07ec11aa.js +0 -1
  139. package/packages/storefront/dist/client/admin/assets/hint.es2-35fd7219.js +0 -1
  140. package/packages/storefront/dist/client/admin/assets/index-64cd926d.css +0 -1
  141. package/packages/storefront/dist/client/admin/assets/index-d5c6a1a9.js +0 -6332
  142. package/packages/storefront/dist/client/admin/assets/index-f1d880da.js +0 -216
  143. package/packages/storefront/dist/client/admin/assets/info-addon.es-eded2c26.js +0 -1
  144. package/packages/storefront/dist/client/admin/assets/info.es-93649208.js +0 -1
  145. package/packages/storefront/dist/client/admin/assets/javascript.es-634a06b1.js +0 -1
  146. package/packages/storefront/dist/client/admin/assets/jump-to-line.es-23d2d4a8.js +0 -1
  147. package/packages/storefront/dist/client/admin/assets/jump.es-732b233e.js +0 -1
  148. package/packages/storefront/dist/client/admin/assets/lint.es-240359bd.js +0 -6
  149. package/packages/storefront/dist/client/admin/assets/lint.es2-df11292b.js +0 -1
  150. package/packages/storefront/dist/client/admin/assets/lint.es3-aa543b52.js +0 -1
  151. package/packages/storefront/dist/client/admin/assets/matchbrackets.es-f5e3ac04.js +0 -1
  152. package/packages/storefront/dist/client/admin/assets/mode-indent.es-341daf63.js +0 -1
  153. package/packages/storefront/dist/client/admin/assets/mode.es-c74239d3.js +0 -1
  154. package/packages/storefront/dist/client/admin/assets/mode.es2-9319d2a9.js +0 -1
  155. package/packages/storefront/dist/client/admin/assets/mode.es3-deb92d78.js +0 -1
  156. package/packages/storefront/dist/client/admin/assets/search.es-143ba137.js +0 -2
  157. package/packages/storefront/dist/client/admin/assets/searchcursor.es-6069a13e.js +0 -7
  158. package/packages/storefront/dist/client/admin/assets/show-hint.es-ff4fde1d.js +0 -1
  159. package/packages/storefront/dist/client/admin/assets/sublime.es-23f726a0.js +0 -6
  160. package/packages/storefront/dist/client/admin/index.html +0 -15
@@ -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 Pt=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},Sn=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("")},Dt={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,v=l&63;c||(v=64,o||(g=64)),r.push(t[d],t[f],t[g],t[v])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Pt(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Sn(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 Rn;const g=s<<2|a>>4;if(r.push(g),l!==64){const v=a<<4&240|l>>2;if(r.push(v),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 Rn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const kn=function(n){const e=Pt(n);return Dt.encodeByteArray(e,!0)},Nt=function(n){return kn(n).replace(/\./g,"")},Lt=function(n){try{return Dt.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
31
+ */const Pt=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},Rn=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("")},Dt={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,v=l&63;c||(v=64,o||(g=64)),r.push(t[d],t[f],t[g],t[v])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Pt(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Rn(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 kn;const g=s<<2|a>>4;if(r.push(g),l!==64){const v=a<<4&240|l>>2;if(r.push(v),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 kn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const An=function(n){const e=Pt(n);return Dt.encodeByteArray(e,!0)},Nt=function(n){return An(n).replace(/\./g,"")},Lt=function(n){try{return Dt.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 An(){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 Cn(){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 Cn=()=>An().__FIREBASE_DEFAULTS__,On=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Pn=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Lt(n[1]);return e&&JSON.parse(e)},We=()=>{try{return Cn()||On()||Pn()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Dn=n=>{var e,t;return(t=(e=We())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Nn=()=>{var n;return(n=We())===null||n===void 0?void 0:n.config},Mt=n=>{var e;return(e=We())===null||e===void 0?void 0:e[`_${n}`]};/**
61
+ */const On=()=>Cn().__FIREBASE_DEFAULTS__,Pn=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Dn=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Lt(n[1]);return e&&JSON.parse(e)},We=()=>{try{return On()||Pn()||Dn()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Nn=n=>{var e,t;return(t=(e=We())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Mt=()=>{var n;return(n=We())===null||n===void 0?void 0:n.config},Ut=n=>{var e;return(e=We())===null||e===void 0?void 0:e[`_${n}`]};/**
62
62
  * @license
63
63
  * Copyright 2017 Google LLC
64
64
  *
@@ -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 Qn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Zn=h.INFO,er={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},tr=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=er[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 Ut{constructor(e){this.name=e,this._logLevel=Zn,this._logHandler=tr,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"?Qn[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 nr=(n,e)=>e.some(t=>n instanceof t);let ot,at;function rr(){return ot||(ot=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ir(){return at||(at=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Bt=new WeakMap,Be=new WeakMap,xt=new WeakMap,Oe=new WeakMap,je=new WeakMap;function sr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(A(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Bt.set(t,n)}).catch(()=>{}),je.set(e,n),e}function or(n){if(Be.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)});Be.set(n,e)}let xe={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Be.get(n);if(e==="objectStoreNames")return n.objectStoreNames||xt.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return A(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 ar(n){xe=n(xe)}function cr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Pe(this),e,...t);return xt.set(r,e.sort?e.sort():[e]),A(r)}:ir().includes(n)?function(...e){return n.apply(Pe(this),e),A(Bt.get(this))}:function(...e){return A(n.apply(Pe(this),e))}}function lr(n){return typeof n=="function"?cr(n):(n instanceof IDBTransaction&&or(n),nr(n,rr())?new Proxy(n,xe):n)}function A(n){if(n instanceof IDBRequest)return sr(n);if(Oe.has(n))return Oe.get(n);const e=lr(n);return e!==n&&(Oe.set(n,e),je.set(e,n)),e}const Pe=n=>je.get(n);function ur(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=A(o);return r&&o.addEventListener("upgradeneeded",c=>{r(A(o.result),c.oldVersion,c.newVersion,A(o.transaction),c)}),t&&o.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const dr=["get","getKey","getAll","getAllKeys","count"],hr=["put","add","delete","clear"],De=new Map;function ct(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=hr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||dr.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}ar(n=>({...n,get:(e,t,r)=>ct(e,t)||n.get(e,t,r),has:(e,t)=>!!ct(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 Qn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Zn=h.INFO,er={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},tr=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=er[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 Bt{constructor(e){this.name=e,this._logLevel=Zn,this._logHandler=tr,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"?Qn[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 nr=(n,e)=>e.some(t=>n instanceof t);let ot,at;function rr(){return ot||(ot=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ir(){return at||(at=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const xt=new WeakMap,Be=new WeakMap,Ft=new WeakMap,Oe=new WeakMap,je=new WeakMap;function sr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(A(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&xt.set(t,n)}).catch(()=>{}),je.set(e,n),e}function or(n){if(Be.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)});Be.set(n,e)}let xe={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Be.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Ft.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return A(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 ar(n){xe=n(xe)}function cr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Pe(this),e,...t);return Ft.set(r,e.sort?e.sort():[e]),A(r)}:ir().includes(n)?function(...e){return n.apply(Pe(this),e),A(xt.get(this))}:function(...e){return A(n.apply(Pe(this),e))}}function lr(n){return typeof n=="function"?cr(n):(n instanceof IDBTransaction&&or(n),nr(n,rr())?new Proxy(n,xe):n)}function A(n){if(n instanceof IDBRequest)return sr(n);if(Oe.has(n))return Oe.get(n);const e=lr(n);return e!==n&&(Oe.set(n,e),je.set(e,n)),e}const Pe=n=>je.get(n);function ur(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=A(o);return r&&o.addEventListener("upgradeneeded",c=>{r(A(o.result),c.oldVersion,c.newVersion,A(o.transaction),c)}),t&&o.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const dr=["get","getKey","getAll","getAllKeys","count"],hr=["put","add","delete","clear"],De=new Map;function ct(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=hr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||dr.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}ar(n=>({...n,get:(e,t,r)=>ct(e,t)||n.get(e,t,r),has:(e,t)=>!!ct(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 fr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(pr(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function pr(n){const e=n.getComponent();return e?.type==="VERSION"}const Fe="@firebase/app",lt="0.9.9";/**
211
+ */class fr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(pr(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function pr(n){const e=n.getComponent();return e?.type==="VERSION"}const Fe="@firebase/app",lt="0.9.10";/**
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 L=new Ut("@firebase/app"),gr="@firebase/app-compat",mr="@firebase/analytics-compat",_r="@firebase/analytics",Ir="@firebase/app-check-compat",vr="@firebase/app-check",yr="@firebase/auth",Er="@firebase/auth-compat",br="@firebase/database",wr="@firebase/database-compat",Tr="@firebase/functions",Sr="@firebase/functions-compat",Rr="@firebase/installations",kr="@firebase/installations-compat",Ar="@firebase/messaging",Cr="@firebase/messaging-compat",Or="@firebase/performance",Pr="@firebase/performance-compat",Dr="@firebase/remote-config",Nr="@firebase/remote-config-compat",Lr="@firebase/storage",Mr="@firebase/storage-compat",Ur="@firebase/firestore",Br="@firebase/firestore-compat",xr="firebase",Fr="9.21.0";/**
226
+ */const L=new Bt("@firebase/app"),gr="@firebase/app-compat",mr="@firebase/analytics-compat",_r="@firebase/analytics",Ir="@firebase/app-check-compat",vr="@firebase/app-check",yr="@firebase/auth",Er="@firebase/auth-compat",br="@firebase/database",wr="@firebase/database-compat",Tr="@firebase/functions",Sr="@firebase/functions-compat",Rr="@firebase/installations",kr="@firebase/installations-compat",Ar="@firebase/messaging",Cr="@firebase/messaging-compat",Or="@firebase/performance",Pr="@firebase/performance-compat",Dr="@firebase/remote-config",Nr="@firebase/remote-config-compat",Lr="@firebase/storage",Mr="@firebase/storage-compat",Ur="@firebase/firestore",Br="@firebase/firestore-compat",xr="firebase",Fr="9.22.0";/**
227
227
  * @license
228
228
  * Copyright 2019 Google LLC
229
229
  *
@@ -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 fe=new Map,$e=new Map;function $r(n,e){try{n.container.addComponent(e)}catch(t){L.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function q(n){const e=n.name;if($e.has(e))return L.debug(`There were multiple attempts to register component ${e}.`),!1;$e.set(e,n);for(const t of fe.values())$r(t,n);return!0}function Ft(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}/**
256
+ */const fe=new Map,$e=new Map;function $r(n,e){try{n.container.addComponent(e)}catch(t){L.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function q(n){const e=n.name;if($e.has(e))return L.debug(`There were multiple attempts to register component ${e}.`),!1;$e.set(e,n);for(const t of fe.values())$r(t,n);return!0}function Ht(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 Vr={["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 Z("app","Firebase",Vr);/**
271
+ */const Vr={["no-app"]:"No Firebase App '{$appName}' has been created - call initializeApp() first",["bad-app-name"]:"Illegal App name: '{$appName}",["duplicate-app"]:"Firebase App named '{$appName}' already exists with different options or config",["app-deleted"]:"Firebase App named '{$appName}' already deleted",["no-options"]:"Need to provide options, when not being deployed to hosting via source.",["invalid-app-argument"]:"firebase.{$appName}() takes either no argument or a Firebase App instance.",["invalid-log-argument"]:"First argument to `onLog` must be null or a function.",["idb-open"]:"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",["idb-get"]:"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",["idb-set"]:"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",["idb-delete"]:"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},C=new Z("app","Firebase",Vr);/**
272
272
  * @license
273
273
  * Copyright 2019 Google LLC
274
274
  *
@@ -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 te=Fr;function Ht(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:He,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw C.create("bad-app-name",{appName:String(i)});if(t||(t=Nn()),!t)throw C.create("no-options");const s=fe.get(i);if(s){if(he(t,s.options)&&he(r,s.config))return s;throw C.create("duplicate-app",{appName:i})}const o=new Xn(i);for(const c of $e.values())o.addComponent(c);const a=new Wr(t,r,o);return fe.set(i,a),a}function jr(n=He){const e=fe.get(n);if(!e&&n===He)return Ht();if(!e)throw C.create("no-app",{appName:n});return e}function x(n,e,t){var r;let i=(r=Hr[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 "/")`),L.warn(a.join(" "));return}q(new $(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
301
+ */const te=Fr;function $t(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:He,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw C.create("bad-app-name",{appName:String(i)});if(t||(t=Mt()),!t)throw C.create("no-options");const s=fe.get(i);if(s){if(he(t,s.options)&&he(r,s.config))return s;throw C.create("duplicate-app",{appName:i})}const o=new Xn(i);for(const c of $e.values())o.addComponent(c);const a=new Wr(t,r,o);return fe.set(i,a),a}function jr(n=He){const e=fe.get(n);if(!e&&n===He&&Mt())return $t();if(!e)throw C.create("no-app",{appName:n});return e}function x(n,e,t){var r;let i=(r=Hr[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 "/")`),L.warn(a.join(" "));return}q(new $(`${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 zr="firebase-heartbeat-database",Gr=1,J="firebase-heartbeat-store";let Ne=null;function $t(){return Ne||(Ne=ur(zr,Gr,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(J)}}}).catch(n=>{throw C.create("idb-open",{originalErrorMessage:n.message})})),Ne}async function Kr(n){try{return(await $t()).transaction(J).objectStore(J).get(Vt(n))}catch(e){if(e instanceof O)L.warn(e.message);else{const t=C.create("idb-get",{originalErrorMessage:e?.message});L.warn(t.message)}}}async function ut(n,e){try{const r=(await $t()).transaction(J,"readwrite");return await r.objectStore(J).put(e,Vt(n)),r.done}catch(t){if(t instanceof O)L.warn(t.message);else{const r=C.create("idb-set",{originalErrorMessage:t?.message});L.warn(r.message)}}}function Vt(n){return`${n.name}!${n.options.appId}`}/**
316
+ */const zr="firebase-heartbeat-database",Gr=1,J="firebase-heartbeat-store";let Ne=null;function Vt(){return Ne||(Ne=ur(zr,Gr,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(J)}}}).catch(n=>{throw C.create("idb-open",{originalErrorMessage:n.message})})),Ne}async function Kr(n){try{return await(await Vt()).transaction(J).objectStore(J).get(Wt(n))}catch(e){if(e instanceof O)L.warn(e.message);else{const t=C.create("idb-get",{originalErrorMessage:e?.message});L.warn(t.message)}}}async function ut(n,e){try{const r=(await Vt()).transaction(J,"readwrite");await r.objectStore(J).put(e,Wt(n)),await r.done}catch(t){if(t instanceof O)L.warn(t.message);else{const r=C.create("idb-set",{originalErrorMessage:t?.message});L.warn(r.message)}}}function Wt(n){return`${n.name}!${n.options.appId}`}/**
317
317
  * @license
318
318
  * Copyright 2021 Google LLC
319
319
  *
@@ -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 $("platform-logger",e=>new fr(e),"PRIVATE")),q(new $("heartbeat",e=>new Yr(e),"PRIVATE")),x(Fe,lt,n),x(Fe,lt,"esm2017"),x("fire-js","")}Zr("");var ei="firebase",ti="9.21.0";/**
346
+ */function Zr(n){q(new $("platform-logger",e=>new fr(e),"PRIVATE")),q(new $("heartbeat",e=>new Yr(e),"PRIVATE")),x(Fe,lt,n),x(Fe,lt,"esm2017"),x("fire-js","")}Zr("");var ei="firebase",ti="9.22.0";/**
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
- */x(ei,ti,"app");function ze(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 Wt(){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 ni=Wt,jt=new Z("auth","Firebase",Wt());/**
361
+ */x(ei,ti,"app");function ze(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 jt(){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 ni=jt,zt=new Z("auth","Firebase",jt());/**
362
362
  * @license
363
363
  * Copyright 2020 Google LLC
364
364
  *
@@ -373,7 +373,7 @@
373
373
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
374
374
  * See the License for the specific language governing permissions and
375
375
  * limitations under the License.
376
- */const pe=new Ut("@firebase/auth");function ri(n,...e){pe.logLevel<=h.WARN&&pe.warn(`Auth (${te}): ${n}`,...e)}function ce(n,...e){pe.logLevel<=h.ERROR&&pe.error(`Auth (${te}): ${n}`,...e)}/**
376
+ */const pe=new Bt("@firebase/auth");function ri(n,...e){pe.logLevel<=h.WARN&&pe.warn(`Auth (${te}): ${n}`,...e)}function ce(n,...e){pe.logLevel<=h.ERROR&&pe.error(`Auth (${te}): ${n}`,...e)}/**
377
377
  * @license
378
378
  * Copyright 2020 Google LLC
379
379
  *
@@ -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 Ge(n,...e)}function _(n,...e){return Ge(n,...e)}function ii(n,e,t){const r=Object.assign(Object.assign({},ni()),{[e]:t});return new Z("auth","Firebase",r).create(e,{appName:n.name})}function Ge(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 jt.create(n,...e)}function u(n,e,...t){if(!n)throw Ge(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ce(e),new Error(e)}function b(n,e){n||y(e)}/**
391
+ */function m(n,...e){throw Ge(n,...e)}function _(n,...e){return Ge(n,...e)}function ii(n,e,t){const r=Object.assign(Object.assign({},ni()),{[e]:t});return new Z("auth","Firebase",r).create(e,{appName:n.name})}function Ge(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 zt.create(n,...e)}function u(n,e,...t){if(!n)throw Ge(e,...t)}function y(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ce(e),new Error(e)}function b(n,e){n||y(e)}/**
392
392
  * @license
393
393
  * Copyright 2020 Google LLC
394
394
  *
@@ -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 zt{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;y("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;y("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;y("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
466
+ */class Gt{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;y("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;y("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;y("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
467
467
  * @license
468
468
  * Copyright 2020 Google LLC
469
469
  *
@@ -493,7 +493,7 @@
493
493
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
494
  * See the License for the specific language governing permissions and
495
495
  * limitations under the License.
496
- */const li=new ne(3e4,6e4);function re(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function W(n,e,t,r,i={}){return Gt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=ee(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),zt.fetch()(Kt(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function Gt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},ci),e);try{const i=new ui(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ae(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 ae(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw ae(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw ae(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ii(n,d,l);m(n,d)}}catch(i){if(i instanceof O)throw i;m(n,"network-request-failed",{message:String(i)})}}async function ye(n,e,t,r,i={}){const s=await W(n,e,t,r,i);return"mfaPendingCredential"in s&&m(n,"multi-factor-auth-required",{_serverResponse:s}),s}function Kt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?Ke(n.config,i):`${n.config.apiScheme}://${i}`}class ui{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),li.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ae(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}/**
496
+ */const li=new ne(3e4,6e4);function re(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function W(n,e,t,r,i={}){return Kt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=ee(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),Gt.fetch()(qt(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function Kt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},ci),e);try{const i=new ui(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ae(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 ae(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw ae(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw ae(n,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ii(n,d,l);m(n,d)}}catch(i){if(i instanceof O)throw i;m(n,"network-request-failed",{message:String(i)})}}async function ye(n,e,t,r,i={}){const s=await W(n,e,t,r,i);return"mfaPendingCredential"in s&&m(n,"multi-factor-auth-required",{_serverResponse:s}),s}function qt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?Ke(n.config,i):`${n.config.apiScheme}://${i}`}class ui{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),li.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ae(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}/**
497
497
  * @license
498
498
  * Copyright 2020 Google LLC
499
499
  *
@@ -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
- */class qt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=K(this.lastLoginAt),this.creationTime=K(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
571
+ */class Jt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=K(this.lastLoginAt),this.creationTime=K(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
572
572
  * @license
573
573
  * Copyright 2019 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
- */async function me(n){var e;const t=n.auth,r=await n.getIdToken(),i=await Y(n,hi(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?vi(s.providerUserInfo):[],a=Ii(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 qt(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function _i(n){const e=P(n);await me(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Ii(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function vi(n){return n.map(e=>{var{providerId:t}=e,r=ze(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
586
+ */async function me(n){var e;const t=n.auth,r=await n.getIdToken(),i=await Y(n,hi(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?vi(s.providerUserInfo):[],a=Ii(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 Jt(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function _i(n){const e=P(n);await me(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Ii(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function vi(n){return n.map(e=>{var{providerId:t}=e,r=ze(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
587
587
  * @license
588
588
  * Copyright 2020 Google LLC
589
589
  *
@@ -598,7 +598,7 @@
598
598
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
599
  * See the License for the specific language governing permissions and
600
600
  * limitations under the License.
601
- */async function yi(n,e){const t=await Gt(n,{},async()=>{const r=ee({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Kt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",zt.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
601
+ */async function yi(n,e){const t=await Kt(n,{},async()=>{const r=ee({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=qt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Gt.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}/**
602
602
  * @license
603
603
  * Copyright 2020 Google LLC
604
604
  *
@@ -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
- */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=ze(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new mi(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 qt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Y(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 fi(this,e)}reload(){return _i(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){const t=new N(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_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 me(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await Y(this,di(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,v=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,U=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Ze=(a=t.tenantId)!==null&&a!==void 0?a:void 0,Se=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,et=(l=t.createdAt)!==null&&l!==void 0?l:void 0,tt=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:Re,emailVerified:nt,isAnonymous:rt,providerData:ke,stsTokenManager:it}=t;u(Re&&it,e,"internal-error");const wn=X.fromJSON(this.name,it);u(typeof Re=="string",e,"internal-error"),w(f,e.name),w(g,e.name),u(typeof nt=="boolean",e,"internal-error"),u(typeof rt=="boolean",e,"internal-error"),w(v,e.name),w(U,e.name),w(Ze,e.name),w(Se,e.name),w(et,e.name),w(tt,e.name);const Ae=new N({uid:Re,auth:e,email:g,emailVerified:nt,displayName:f,isAnonymous:rt,photoURL:U,phoneNumber:v,tenantId:Ze,stsTokenManager:wn,createdAt:et,lastLoginAt:tt});return ke&&Array.isArray(ke)&&(Ae.providerData=ke.map(Tn=>Object.assign({},Tn))),Se&&(Ae._redirectEventId=Se),Ae}static async _fromIdTokenResponse(e,t,r=!1){const i=new X;i.updateFromServerResponse(t);const s=new N({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await me(s),s}}/**
631
+ */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=ze(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new mi(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 Jt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Y(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 fi(this,e)}reload(){return _i(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){const t=new N(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_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 me(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await Y(this,di(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,v=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,U=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Ze=(a=t.tenantId)!==null&&a!==void 0?a:void 0,Se=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,et=(l=t.createdAt)!==null&&l!==void 0?l:void 0,tt=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:Re,emailVerified:nt,isAnonymous:rt,providerData:ke,stsTokenManager:it}=t;u(Re&&it,e,"internal-error");const Tn=X.fromJSON(this.name,it);u(typeof Re=="string",e,"internal-error"),w(f,e.name),w(g,e.name),u(typeof nt=="boolean",e,"internal-error"),u(typeof rt=="boolean",e,"internal-error"),w(v,e.name),w(U,e.name),w(Ze,e.name),w(Se,e.name),w(et,e.name),w(tt,e.name);const Ae=new N({uid:Re,auth:e,email:g,emailVerified:nt,displayName:f,isAnonymous:rt,photoURL:U,phoneNumber:v,tenantId:Ze,stsTokenManager:Tn,createdAt:et,lastLoginAt:tt});return ke&&Array.isArray(ke)&&(Ae.providerData=ke.map(Sn=>Object.assign({},Sn))),Se&&(Ae._redirectEventId=Se),Ae}static async _fromIdTokenResponse(e,t,r=!1){const i=new X;i.updateFromServerResponse(t);const s=new N({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await me(s),s}}/**
632
632
  * @license
633
633
  * Copyright 2020 Google LLC
634
634
  *
@@ -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
- */class Jt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Jt.type="NONE";const gt=Jt;/**
661
+ */class Yt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Yt.type="NONE";const gt=Yt;/**
662
662
  * @license
663
663
  * Copyright 2019 Google LLC
664
664
  *
@@ -688,7 +688,7 @@
688
688
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
689
689
  * See the License for the specific language governing permissions and
690
690
  * limitations under the License.
691
- */function mt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Qt(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Yt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(en(e))return"Blackberry";if(tn(e))return"Webos";if(Je(e))return"Safari";if((e.includes("chrome/")||Xt(e))&&!e.includes("edge/"))return"Chrome";if(Zt(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 Yt(n=p()){return/firefox\//i.test(n)}function Je(n=p()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Xt(n=p()){return/crios\//i.test(n)}function Qt(n=p()){return/iemobile/i.test(n)}function Zt(n=p()){return/android/i.test(n)}function en(n=p()){return/blackberry/i.test(n)}function tn(n=p()){return/webos/i.test(n)}function Ee(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Ei(n=p()){var e;return Ee(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function bi(){return xn()&&document.documentMode===10}function nn(n=p()){return Ee(n)||Zt(n)||tn(n)||en(n)||/windows phone/i.test(n)||Qt(n)}function wi(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
691
+ */function mt(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Zt(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Xt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(tn(e))return"Blackberry";if(nn(e))return"Webos";if(Je(e))return"Safari";if((e.includes("chrome/")||Qt(e))&&!e.includes("edge/"))return"Chrome";if(en(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 Xt(n=p()){return/firefox\//i.test(n)}function Je(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 Zt(n=p()){return/iemobile/i.test(n)}function en(n=p()){return/android/i.test(n)}function tn(n=p()){return/blackberry/i.test(n)}function nn(n=p()){return/webos/i.test(n)}function Ee(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Ei(n=p()){var e;return Ee(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function bi(){return xn()&&document.documentMode===10}function rn(n=p()){return Ee(n)||en(n)||nn(n)||tn(n)||/windows phone/i.test(n)||Zt(n)}function wi(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
692
692
  * @license
693
693
  * Copyright 2020 Google LLC
694
694
  *
@@ -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 rn(n,e=[]){let t;switch(n){case"Browser":t=mt(p());break;case"Worker":t=`${mt(p())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${te}/${r}`}async function sn(n,e){return W(n,"GET","/v2/recaptchaConfig",re(n,e))}function _t(n){return n!==void 0&&n.enterprise!==void 0}class on{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some(t=>t.provider==="EMAIL_PASSWORD_PROVIDER"&&t.enforcementState!=="OFF")}}/**
706
+ */function sn(n,e=[]){let t;switch(n){case"Browser":t=mt(p());break;case"Worker":t=`${mt(p())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${te}/${r}`}async function on(n,e){return W(n,"GET","/v2/recaptchaConfig",re(n,e))}function _t(n){return n!==void 0&&n.enterprise!==void 0}class an{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some(t=>t.provider==="EMAIL_PASSWORD_PROVIDER"&&t.enforcementState!=="OFF")}}/**
707
707
  * @license
708
708
  * Copyright 2020 Google LLC
709
709
  *
@@ -718,7 +718,7 @@
718
718
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
719
719
  * See the License for the specific language governing permissions and
720
720
  * limitations under the License.
721
- */function Ti(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function an(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",Ti().appendChild(r)})}function Si(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const Ri="https://www.google.com/recaptcha/enterprise.js?render=",ki="recaptcha-enterprise",Ai="NO_RECAPTCHA";class cn{constructor(e){this.type=ki,this.auth=ie(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{sn(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const l=new on(c);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(c=>{a(c)})})}function i(s,o,a){const c=window.grecaptcha;_t(c)?c.enterprise.ready(()=>{c.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(Ai)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(a=>{if(!t&&_t(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}an(Ri+a).then(()=>{i(a,s,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function It(n,e,t,r=!1){const i=new cn(n);let s;try{s=await i.verify(t)}catch{s=await i.verify(t,!0)}const o=Object.assign({},e);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}/**
721
+ */function Ti(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function cn(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",Ti().appendChild(r)})}function Si(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const Ri="https://www.google.com/recaptcha/enterprise.js?render=",ki="recaptcha-enterprise",Ai="NO_RECAPTCHA";class ln{constructor(e){this.type=ki,this.auth=ie(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{on(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const l=new an(c);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(c=>{a(c)})})}function i(s,o,a){const c=window.grecaptcha;_t(c)?c.enterprise.ready(()=>{c.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(Ai)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(a=>{if(!t&&_t(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}cn(Ri+a).then(()=>{i(a,s,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function It(n,e,t,r=!1){const i=new ln(n);let s;try{s=await i.verify(t)}catch{s=await i.verify(t,!0)}const o=Object.assign({},e);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}/**
722
722
  * @license
723
723
  * Copyright 2022 Google LLC
724
724
  *
@@ -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 Oi{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new vt(this),this.idTokenSubscription=new vt(this),this.beforeStateQueue=new Ci(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=jt,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=E(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 me(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=ai()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?P(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(E(e))})}async initializeRecaptchaConfig(){const e=await sn(this,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),t=new on(e);this.tenantId==null?this._agentRecaptchaConfig=t:this._tenantRecaptchaConfigs[this.tenantId]=t,t.emailPasswordEnabled&&new cn(this).verify()}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Z("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&&E(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await F.create(this,[E(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=rn(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());r&&(t["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t?.error&&ri(`Error while retrieving App Check token: ${t.error}`),t?.token}}function ie(n){return P(n)}class vt{constructor(e){this.auth=e,this.observer=null,this.addObserver=zn(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
751
+ */class Oi{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new vt(this),this.idTokenSubscription=new vt(this),this.beforeStateQueue=new Ci(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=zt,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=E(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 me(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=ai()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?P(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(E(e))})}async initializeRecaptchaConfig(){const e=await on(this,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),t=new an(e);this.tenantId==null?this._agentRecaptchaConfig=t:this._tenantRecaptchaConfigs[this.tenantId]=t,t.emailPasswordEnabled&&new ln(this).verify()}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Z("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&&E(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=await F.create(this,[E(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=sn(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());r&&(t["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t?.error&&ri(`Error while retrieving App Check token: ${t.error}`),t?.token}}function ie(n){return P(n)}class vt{constructor(e){this.auth=e,this.observer=null,this.addObserver=zn(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
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
- */function Pi(n,e){const t=Ft(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(he(s,e??{}))return i;m(i,"already-initialized")}return t.initialize({options:e})}function Di(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(E);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function Ni(n,e,t){const r=ie(n);u(r._canInitEmulator,r,"emulator-config-failed"),u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=ln(e),{host:o,port:a}=Li(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||Mi()}function ln(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Li(n){const e=ln(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:yt(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:yt(o)}}}function yt(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Mi(){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())}/**
766
+ */function Pi(n,e){const t=Ht(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(he(s,e??{}))return i;m(i,"already-initialized")}return t.initialize({options:e})}function Di(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(E);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function Ni(n,e,t){const r=ie(n);u(r._canInitEmulator,r,"emulator-config-failed"),u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=un(e),{host:o,port:a}=Li(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||Mi()}function un(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Li(n){const e=un(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:yt(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:yt(o)}}}function yt(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Mi(){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())}/**
767
767
  * @license
768
768
  * Copyright 2020 Google LLC
769
769
  *
@@ -898,7 +898,7 @@
898
898
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
899
899
  * See the License for the specific language governing permissions and
900
900
  * limitations under the License.
901
- */class un{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
901
+ */class dn{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
902
902
  * @license
903
903
  * Copyright 2019 Google LLC
904
904
  *
@@ -913,7 +913,7 @@
913
913
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
914
  * See the License for the specific language governing permissions and
915
915
  * limitations under the License.
916
- */class se extends un{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
916
+ */class se extends dn{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
917
917
  * @license
918
918
  * Copyright 2020 Google LLC
919
919
  *
@@ -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
- */class _e extends O{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,_e.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 _e(e,t,r,i)}}function dn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?_e._fromErrorAndOperation(n,s,e,r):s})}async function Vi(n,e,t=!1){const r=await Y(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return V._forOperation(n,"link",r)}/**
1006
+ */class _e extends O{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,_e.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 _e(e,t,r,i)}}function hn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?_e._fromErrorAndOperation(n,s,e,r):s})}async function Vi(n,e,t=!1){const r=await Y(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return V._forOperation(n,"link",r)}/**
1007
1007
  * @license
1008
1008
  * Copyright 2019 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 Wi(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=await Y(n,dn(r,i,e,n),t);u(s.idToken,r,"internal-error");const o=qe(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}}/**
1021
+ */async function Wi(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=await Y(n,hn(r,i,e,n),t);u(s.idToken,r,"internal-error");const o=qe(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}}/**
1022
1022
  * @license
1023
1023
  * Copyright 2020 Google LLC
1024
1024
  *
@@ -1033,7 +1033,7 @@
1033
1033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
1034
  * See the License for the specific language governing permissions and
1035
1035
  * limitations under the License.
1036
- */async function hn(n,e,t=!1){const r="signIn",i=await dn(n,r,e),s=await V._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function ji(n,e){return hn(ie(n),e)}function io(n,e){const t=be.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function so(n,e,t){const r=P(n),i=j.credentialWithLink(e,t||ge());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),ji(r,i)}function zi(n,e,t,r){return P(n).onIdTokenChanged(e,t,r)}function Gi(n,e,t){return P(n).beforeAuthStateChanged(e,t)}function oo(n,e,t,r){return P(n).onAuthStateChanged(e,t,r)}const Ie="__sak";/**
1036
+ */async function fn(n,e,t=!1){const r="signIn",i=await hn(n,r,e),s=await V._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function ji(n,e){return fn(ie(n),e)}function io(n,e){const t=be.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function so(n,e,t){const r=P(n),i=j.credentialWithLink(e,t||ge());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),ji(r,i)}function zi(n,e,t,r){return P(n).onIdTokenChanged(e,t,r)}function Gi(n,e,t){return P(n).beforeAuthStateChanged(e,t)}function oo(n,e,t,r){return P(n).onAuthStateChanged(e,t,r)}const Ie="__sak";/**
1037
1037
  * @license
1038
1038
  * Copyright 2019 Google LLC
1039
1039
  *
@@ -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
- */class fn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Ie,"1"),this.storage.removeItem(Ie),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1051
+ */class pn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Ie,"1"),this.storage.removeItem(Ie),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1052
1052
  * @license
1053
1053
  * Copyright 2020 Google LLC
1054
1054
  *
@@ -1063,7 +1063,7 @@
1063
1063
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
1064
  * See the License for the specific language governing permissions and
1065
1065
  * limitations under the License.
1066
- */function Ki(){const n=p();return Je(n)||Ee(n)}const qi=1e3,Ji=10;class pn extends fn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Ki()&&wi(),this.fallbackToPolling=nn(),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);bi()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Ji):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)})},qi)}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]}}pn.type="LOCAL";const Yi=pn;/**
1066
+ */function Ki(){const n=p();return Je(n)||Ee(n)}const qi=1e3,Ji=10;class gn extends pn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Ki()&&wi(),this.fallbackToPolling=rn(),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);bi()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Ji):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)})},qi)}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]}}gn.type="LOCAL";const Yi=gn;/**
1067
1067
  * @license
1068
1068
  * Copyright 2020 Google LLC
1069
1069
  *
@@ -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
- */class gn extends fn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}gn.type="SESSION";const mn=gn;/**
1081
+ */class mn extends pn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}mn.type="SESSION";const _n=mn;/**
1082
1082
  * @license
1083
1083
  * Copyright 2019 Google LLC
1084
1084
  *
@@ -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
- */function _n(){return typeof I().WorkerGlobalScope<"u"&&typeof I().importScripts=="function"}async function es(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function ts(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function ns(){return _n()?self:null}/**
1171
+ */function In(){return typeof I().WorkerGlobalScope<"u"&&typeof I().importScripts=="function"}async function es(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function ts(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function ns(){return In()?self:null}/**
1172
1172
  * @license
1173
1173
  * Copyright 2019 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
- */const In="firebaseLocalStorageDb",rs=1,ve="firebaseLocalStorage",vn="fbase_key";class oe{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 Te(n,e){return n.transaction([ve],e?"readwrite":"readonly").objectStore(ve)}function is(){const n=indexedDB.deleteDatabase(In);return new oe(n).toPromise()}function Ve(){const n=indexedDB.open(In,rs);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(ve,{keyPath:vn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(ve)?e(r):(r.close(),await is(),e(await Ve()))})})}async function bt(n,e,t){const r=Te(n,!0).put({[vn]:e,value:t});return new oe(r).toPromise()}async function ss(n,e){const t=Te(n,!1).get(e),r=await new oe(t).toPromise();return r===void 0?null:r.value}function wt(n,e){const t=Te(n,!0).delete(e);return new oe(t).toPromise()}const os=800,as=3;class yn{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 Ve(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>as)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return _n()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=we._getInstance(ns()),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 es(),!this.activeServiceWorker)return;this.sender=new Qi(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||ts()!==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 Ve();return await bt(e,Ie,"1"),await wt(e,Ie),!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=>bt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>ss(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>wt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Te(i,!1).getAll();return new oe(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(),os)}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()}}yn.type="LOCAL";const cs=yn;new ne(3e4,6e4);/**
1186
+ */const vn="firebaseLocalStorageDb",rs=1,ve="firebaseLocalStorage",yn="fbase_key";class oe{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 Te(n,e){return n.transaction([ve],e?"readwrite":"readonly").objectStore(ve)}function is(){const n=indexedDB.deleteDatabase(vn);return new oe(n).toPromise()}function Ve(){const n=indexedDB.open(vn,rs);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(ve,{keyPath:yn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(ve)?e(r):(r.close(),await is(),e(await Ve()))})})}async function bt(n,e,t){const r=Te(n,!0).put({[yn]:e,value:t});return new oe(r).toPromise()}async function ss(n,e){const t=Te(n,!1).get(e),r=await new oe(t).toPromise();return r===void 0?null:r.value}function wt(n,e){const t=Te(n,!0).delete(e);return new oe(t).toPromise()}const os=800,as=3;class En{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 Ve(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>as)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return In()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=we._getInstance(ns()),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 es(),!this.activeServiceWorker)return;this.sender=new Qi(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||ts()!==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 Ve();return await bt(e,Ie,"1"),await wt(e,Ie),!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=>bt(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>ss(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>wt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Te(i,!1).getAll();return new oe(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(),os)}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()}}En.type="LOCAL";const cs=En;new ne(3e4,6e4);/**
1187
1187
  * @license
1188
1188
  * Copyright 2021 Google LLC
1189
1189
  *
@@ -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 Qe extends Ye{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return H(e,this._buildIdpRequest())}_linkToIdToken(e,t){return H(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return H(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 us(n){return hn(n.auth,new Qe(n),n.bypassAuthState)}function ds(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Wi(t,new Qe(n),n.bypassAuthState)}async function hs(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Vi(t,new Qe(n),n.bypassAuthState)}/**
1216
+ */class Qe extends Ye{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return H(e,this._buildIdpRequest())}_linkToIdToken(e,t){return H(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return H(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 us(n){return fn(n.auth,new Qe(n),n.bypassAuthState)}function ds(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Wi(t,new Qe(n),n.bypassAuthState)}async function hs(n){const{auth:e,user:t}=n;return u(t,e,"internal-error"),Vi(t,new Qe(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 En{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 us;case"linkViaPopup":case"linkViaRedirect":return hs;case"reauthViaPopup":case"reauthViaRedirect":return ds;default:m(this.auth,"internal-error")}}resolve(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1231
+ */class bn{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 us;case"linkViaPopup":case"linkViaRedirect":return hs;case"reauthViaPopup":case"reauthViaRedirect":return ds;default:m(this.auth,"internal-error")}}resolve(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
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 fs=new ne(2e3,1e4);class B extends En{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,B.currentPopupAction&&B.currentPopupAction.cancel(),B.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){b(this.filter.length===1,"Popup operations only handle one event");const e=Xe();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,B.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"))},8e3);return}this.pollId=window.setTimeout(e,fs.get())};e()}}B.currentPopupAction=null;/**
1246
+ */const fs=new ne(2e3,1e4);class B extends bn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,B.currentPopupAction&&B.currentPopupAction.cancel(),B.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){b(this.filter.length===1,"Popup operations only handle one event");const e=Xe();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,B.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"))},8e3);return}this.pollId=window.setTimeout(e,fs.get())};e()}}B.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 ps="pendingRedirect",ue=new Map;class gs extends En{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ue.get(this.auth._key());if(!e){try{const r=await ms(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}ue.set(this.auth._key(),e)}return this.bypassAuthState||ue.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 ms(n,e){const t=vs(e),r=Is(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function _s(n,e){ue.set(n._key(),e)}function Is(n){return E(n._redirectPersistence)}function vs(n){return le(ps,n.config.apiKey,n.name)}async function ys(n,e,t=!1){const r=ie(n),i=ls(r,e),o=await new gs(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1261
+ */const ps="pendingRedirect",ue=new Map;class gs extends bn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ue.get(this.auth._key());if(!e){try{const r=await ms(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}ue.set(this.auth._key(),e)}return this.bypassAuthState||ue.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 ms(n,e){const t=vs(e),r=Is(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function _s(n,e){ue.set(n._key(),e)}function Is(n){return E(n._redirectPersistence)}function vs(n){return le(ps,n.config.apiKey,n.name)}async function ys(n,e,t=!1){const r=ie(n),i=ls(r,e),o=await new gs(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 Es=10*60*1e3;class bs{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||!ws(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!bn(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>=Es&&this.cachedEventUids.clear(),this.cachedEventUids.has(Tt(e))}saveEventToCache(e){this.cachedEventUids.add(Tt(e)),this.lastProcessedEventTime=Date.now()}}function Tt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function bn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function ws(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return bn(n);default:return!1}}/**
1276
+ */const Es=10*60*1e3;class bs{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||!ws(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!wn(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>=Es&&this.cachedEventUids.clear(),this.cachedEventUids.has(Tt(e))}saveEventToCache(e){this.cachedEventUids.add(Tt(e)),this.lastProcessedEventTime=Date.now()}}function Tt(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function wn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function ws(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return wn(n);default:return!1}}/**
1277
1277
  * @license
1278
1278
  * Copyright 2020 Google LLC
1279
1279
  *
@@ -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 Cs=new ne(3e4,6e4);function St(){const n=I().___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 Os(n){return new Promise((e,t)=>{var r,i,s;function o(){St(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{St(),t(_(n,"network-request-failed"))},timeout:Cs.get()})}if(!((i=(r=I().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=I().gapi)===null||s===void 0)&&s.load)o();else{const a=Si("iframefcb");return I()[a]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},an(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw de=null,e})}let de=null;function Ps(n){return de=de||Os(n),de}/**
1321
+ */const Cs=new ne(3e4,6e4);function St(){const n=I().___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 Os(n){return new Promise((e,t)=>{var r,i,s;function o(){St(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{St(),t(_(n,"network-request-failed"))},timeout:Cs.get()})}if(!((i=(r=I().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=I().gapi)===null||s===void 0)&&s.load)o();else{const a=Si("iframefcb");return I()[a]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},cn(`https://apis.google.com/js/api.js?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw de=null,e})}let de=null;function Ps(n){return de=de||Os(n),de}/**
1322
1322
  * @license
1323
1323
  * Copyright 2020 Google LLC.
1324
1324
  *
@@ -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 Fs={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Hs=500,$s=600,Vs="_blank",Ws="http://localhost";class Rt{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function js(n,e,t,r=Hs,i=$s){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({},Fs),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(a=Xt(l)?Vs:t),Yt(l)&&(e=e||Ws,c.scrollbars="yes");const d=Object.entries(c).reduce((g,[v,U])=>`${g}${v}=${U},`,"");if(Ei(l)&&a!=="_self")return zs(e||"",a),new Rt(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new Rt(f)}function zs(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 Fs={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Hs=500,$s=600,Vs="_blank",Ws="http://localhost";class Rt{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function js(n,e,t,r=Hs,i=$s){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({},Fs),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(a=Qt(l)?Vs:t),Xt(l)&&(e=e||Ws,c.scrollbars="yes");const d=Object.entries(c).reduce((g,[v,U])=>`${g}${v}=${U},`,"");if(Ei(l)&&a!=="_self")return zs(e||"",a),new Rt(null);const f=window.open(e||"",a,d);u(f,n,"popup-blocked");try{f.focus()}catch{}return new Rt(f)}function zs(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 Gs="__/auth/handler",Ks="emulator/auth/handler",qs=encodeURIComponent("fac");async function kt(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:te,eventId:i};if(e instanceof un){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",jn(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,f]of Object.entries(s||{}))o[d]=f}if(e instanceof se){const d=e.getScopes().filter(f=>f!=="");d.length>0&&(o.scopes=d.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const c=await n._getAppCheckToken(),l=c?`#${qs}=${encodeURIComponent(c)}`:"";return`${Js(n)}?${ee(a).slice(1)}${l}`}function Js({config:n}){return n.emulator?Ke(n,Ks):`https://${n.authDomain}/${Gs}`}/**
1366
+ */const Gs="__/auth/handler",Ks="emulator/auth/handler",qs=encodeURIComponent("fac");async function kt(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:te,eventId:i};if(e instanceof dn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",jn(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,f]of Object.entries(s||{}))o[d]=f}if(e instanceof se){const d=e.getScopes().filter(f=>f!=="");d.length>0&&(o.scopes=d.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const c=await n._getAppCheckToken(),l=c?`#${qs}=${encodeURIComponent(c)}`:"";return`${Js(n)}?${ee(a).slice(1)}${l}`}function Js({config:n}){return n.emulator?Ke(n,Ks):`https://${n.authDomain}/${Gs}`}/**
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 Ue="webStorageSupport";class Ys{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=mn,this._completeRedirectFn=ys,this._overrideRedirectResult=_s}async _openPopup(e,t,r,i){var s;b((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await kt(e,t,r,ge(),i);return js(e,o,Xe())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await kt(e,t,r,ge(),i);return Zi(s),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):(b(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 xs(e),r=new bs(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(Ue,{type:Ue},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Ue];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]=ks(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return nn()||Je()||Ee()}}const Xs=Ys;var At="@firebase/auth",Ct="0.23.1";/**
1381
+ */const Ue="webStorageSupport";class Ys{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=_n,this._completeRedirectFn=ys,this._overrideRedirectResult=_s}async _openPopup(e,t,r,i){var s;b((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await kt(e,t,r,ge(),i);return js(e,o,Xe())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await kt(e,t,r,ge(),i);return Zi(s),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):(b(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 xs(e),r=new bs(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(Ue,{type:Ue},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Ue];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]=ks(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return rn()||Je()||Ee()}}const Xs=Ys;var At="@firebase/auth",Ct="0.23.2";/**
1382
1382
  * @license
1383
1383
  * Copyright 2020 Google LLC
1384
1384
  *
@@ -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 Zs(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function eo(n){q(new $("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;u(o&&!o.includes(":"),"invalid-api-key",{appName:r.name}),u(!a?.includes(":"),"argument-error",{appName:r.name});const c={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:rn(n)},l=new Oi(r,i,s,c);return Di(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),q(new $("auth-internal",e=>{const t=ie(e.getProvider("auth").getImmediate());return(r=>new Qs(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),x(At,Ct,Zs(n)),x(At,Ct,"esm2017")}/**
1411
+ */function Zs(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function eo(n){q(new $("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;u(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:sn(n)},l=new Oi(r,i,s,c);return Di(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),q(new $("auth-internal",e=>{const t=ie(e.getProvider("auth").getImmediate());return(r=>new Qs(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),x(At,Ct,Zs(n)),x(At,Ct,"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 to=5*60,no=Mt("authIdTokenMaxAge")||to;let Ot=null;const ro=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>no)return;const i=t?.token;Ot!==i&&(Ot=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function ao(n=jr()){const e=Ft(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Pi(n,{popupRedirectResolver:Xs,persistence:[cs,Yi,mn]}),r=Mt("authTokenSyncURL");if(r){const s=ro(r);Gi(t,s,()=>s(t.currentUser)),zi(t,o=>s(o))}const i=Dn("auth");return i&&Ni(t,`http://${i}`),t}eo("Browser");const co=Ht(window.firebaseConfig);export{co as default,co as firebaseApp,ao as getAuth,io as isSignInWithEmailLink,oo as onAuthStateChanged,so as signInWithEmailLink};
1426
+ */const to=5*60,no=Ut("authIdTokenMaxAge")||to;let Ot=null;const ro=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>no)return;const i=t?.token;Ot!==i&&(Ot=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function ao(n=jr()){const e=Ht(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Pi(n,{popupRedirectResolver:Xs,persistence:[cs,Yi,_n]}),r=Ut("authTokenSyncURL");if(r){const s=ro(r);Gi(t,s,()=>s(t.currentUser)),zi(t,o=>s(o))}const i=Nn("auth");return i&&Ni(t,`http://${i}`),t}eo("Browser");const co=$t(window.$firebaseConfig);export{co as default,co as firebaseApp,ao as getAuth,io as isSignInWithEmailLink,oo as onAuthStateChanged,so as signInWithEmailLink};