cloudcommerce 0.24.1 → 0.26.0

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 (217) hide show
  1. package/.github/workflows/test-e2e.yml +2 -2
  2. package/CHANGELOG.md +43 -0
  3. package/action.yml +2 -2
  4. package/ecomplus-stores/barra-doce/.idx/dev.nix +24 -0
  5. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  6. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.json +11 -0
  7. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.json +11 -0
  8. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.json +11 -0
  9. package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +30 -0
  10. package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +3 -3
  11. package/ecomplus-stores/barra-doce/functions/ssr/package.json +7 -7
  12. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +2 -2
  13. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +149 -0
  14. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +2 -2
  15. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +68 -0
  16. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +1 -1
  17. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +6 -6
  18. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +2 -0
  19. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  20. package/ecomplus-stores/barra-doce/package.json +2 -2
  21. package/ecomplus-stores/iluminim/.idx/dev.nix +24 -0
  22. package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
  23. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/contato.json +11 -0
  24. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/terms.json +11 -0
  25. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/trocas.json +11 -0
  26. package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +30 -0
  27. package/ecomplus-stores/iluminim/functions/ssr/package.json +7 -7
  28. package/ecomplus-stores/iluminim/functions/ssr/src/assets/style.css +2 -2
  29. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopFooter.vue +149 -0
  30. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +2 -2
  31. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageFooter.astro +68 -0
  32. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +1 -1
  33. package/ecomplus-stores/iluminim/functions/ssr/src/pages/index.astro +2 -0
  34. package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
  35. package/ecomplus-stores/iluminim/package.json +2 -2
  36. package/ecomplus-stores/monocard/.idx/dev.nix +24 -0
  37. package/ecomplus-stores/monocard/functions/ssr/package.json +1 -1
  38. package/ecomplus-stores/tia-sonia/.idx/dev.nix +24 -0
  39. package/package.json +6 -6
  40. package/packages/api/package.json +1 -1
  41. package/packages/apps/affilate-program/package.json +1 -1
  42. package/packages/apps/correios/package.json +5 -3
  43. package/packages/apps/correios/tests/calculate-shipping.test.mjs +45 -0
  44. package/packages/apps/custom-payment/package.json +1 -1
  45. package/packages/apps/custom-shipping/package.json +4 -2
  46. package/packages/apps/custom-shipping/tests/calculate-shipping.test.mjs +37 -0
  47. package/packages/apps/datafrete/package.json +2 -2
  48. package/packages/apps/discounts/package.json +1 -1
  49. package/packages/apps/emails/package.json +1 -1
  50. package/packages/apps/fb-conversions/package.json +2 -2
  51. package/packages/apps/flash-courier/package.json +2 -2
  52. package/packages/apps/frenet/package.json +2 -2
  53. package/packages/apps/galaxpay/package.json +2 -2
  54. package/packages/apps/google-analytics/package.json +2 -2
  55. package/packages/apps/jadlog/package.json +2 -2
  56. package/packages/apps/loyalty-points/package.json +4 -2
  57. package/packages/apps/loyalty-points/tests/1-list-payments.test.mjs +37 -0
  58. package/packages/apps/loyalty-points/tests/2-create-transaction.test.mjs +41 -0
  59. package/packages/apps/melhor-envio/package.json +2 -2
  60. package/packages/apps/mercadopago/package.json +5 -3
  61. package/packages/apps/mercadopago/tests/1-list-payments.test.mjs +37 -0
  62. package/packages/apps/mercadopago/tests/2-create-transaction.test.mjs +42 -0
  63. package/packages/apps/pagarme/package.json +2 -2
  64. package/packages/apps/paghiper/package.json +2 -2
  65. package/packages/apps/pix/package.json +2 -2
  66. package/packages/apps/tiny-erp/package.json +2 -2
  67. package/packages/apps/webhooks/package.json +2 -2
  68. package/packages/cli/lib/cli.js +5 -1
  69. package/packages/cli/package.json +1 -1
  70. package/packages/cli/src/cli.ts +5 -1
  71. package/packages/config/package.json +1 -1
  72. package/packages/emails/package.json +2 -2
  73. package/packages/eslint/package.json +5 -5
  74. package/packages/events/package.json +1 -1
  75. package/packages/feeds/package.json +1 -1
  76. package/packages/firebase/package.json +2 -2
  77. package/packages/i18n/lib/en_us/i19allProducts.txt +1 -0
  78. package/packages/i18n/lib/en_us/i19institutional.txt +1 -0
  79. package/packages/i18n/lib/en_us.d.ts +2 -0
  80. package/packages/i18n/lib/en_us.js +2 -0
  81. package/packages/i18n/lib/en_us.js.map +1 -1
  82. package/packages/i18n/lib/pt_br/i19allProducts.txt +1 -0
  83. package/packages/i18n/lib/pt_br/i19institutional.txt +1 -0
  84. package/packages/i18n/lib/pt_br.d.ts +2 -0
  85. package/packages/i18n/lib/pt_br.js +2 -0
  86. package/packages/i18n/lib/pt_br.js.map +1 -1
  87. package/packages/i18n/package.json +1 -1
  88. package/packages/i18n/src/en_us.ts +2 -0
  89. package/packages/i18n/src/pt_br.ts +2 -0
  90. package/packages/modules/package.json +4 -3
  91. package/packages/modules/tests/modules.test.mjs +7 -8
  92. package/packages/passport/package.json +1 -1
  93. package/packages/ssr/lib/firebase/serve-storefront.js +44 -33
  94. package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
  95. package/packages/ssr/package.json +6 -6
  96. package/packages/ssr/src/firebase/serve-storefront.ts +45 -34
  97. package/packages/storefront/config/storefront.cms.js +3 -1
  98. package/packages/storefront/config/storefront.config.mjs +8 -2
  99. package/packages/storefront/dist/client/_astro/{Carousel.63d511ab.js → Carousel.926668f2.js} +1 -1
  100. package/packages/storefront/dist/client/_astro/CartSidebar.eadba34f.js +1 -0
  101. package/packages/storefront/dist/client/_astro/HeroSlider.1f0524aa.js +1 -0
  102. package/packages/storefront/dist/client/_astro/PitchBar.7407eeaf.js +1 -0
  103. package/packages/storefront/dist/client/_astro/Prices.562a32ab.js +1 -0
  104. package/packages/storefront/dist/client/_astro/ProductShelf.763cd2ca.js +1 -0
  105. package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +1 -0
  106. package/packages/storefront/dist/client/_astro/ShopHeader.126900a6.js +4 -0
  107. package/packages/storefront/dist/client/_astro/_...slug_.36cd433d.css +1 -0
  108. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.ee681fa8.js +1 -0
  109. package/packages/storefront/dist/client/_astro/api.a2eda23e.js +1 -0
  110. package/packages/storefront/dist/client/_astro/client.e6d9439a.js +1 -0
  111. package/packages/storefront/dist/client/_astro/{firebase-app.1df8af9a.js → firebase-app.93857bfb.js} +121 -91
  112. package/packages/storefront/dist/client/_astro/format-money.923559cc.js +1 -0
  113. package/packages/storefront/dist/client/_astro/img.ec6ba316.js +1 -0
  114. package/packages/storefront/dist/client/_astro/index.709ac149.js +1 -0
  115. package/packages/storefront/dist/client/_astro/modules-info.48980668.js +1 -0
  116. package/packages/storefront/dist/client/manifest.webmanifest +1 -1
  117. package/packages/storefront/dist/client/sw.js +1 -1
  118. package/packages/storefront/dist/server/chunks/CartSidebar.2b555408.mjs +393 -0
  119. package/packages/storefront/dist/server/chunks/SearchModal.f418e188.mjs +44 -0
  120. package/packages/storefront/dist/server/chunks/_...d32bcc0c.mjs +35 -0
  121. package/packages/storefront/dist/server/chunks/{account@_@astro.a02ffb0b.mjs → account@_@astro.0106855f.mjs} +12 -4
  122. package/packages/storefront/dist/server/chunks/{astro.a7611b51.mjs → astro.bb5b7191.mjs} +141 -91
  123. package/packages/storefront/dist/server/chunks/{_...5323ec5a.mjs → endpoint@_@js.35807882.mjs} +12 -4
  124. package/packages/storefront/dist/server/chunks/{index@_@astro.d898498a.mjs → index@_@astro.477f5af1.mjs} +12 -4
  125. package/packages/storefront/dist/server/chunks/{index@_@astro.42c693b9.mjs → index@_@astro.e5a61d6e.mjs} +12 -4
  126. package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.0f33557e.mjs → _...slug_.astro.fd8a229f.mjs} +673 -937
  127. package/packages/storefront/dist/server/chunks/pages/{account.astro.9325adb2.mjs → account.astro.3b21bff8.mjs} +1 -1
  128. package/packages/storefront/dist/server/chunks/pages/endpoint.js.247079ba.mjs +119 -0
  129. package/packages/storefront/dist/server/chunks/pages/{index.astro.0f31fa39.mjs → index.astro.dab642f5.mjs} +605 -58
  130. package/packages/storefront/dist/server/chunks/pages/{~fallback.astro.bd93f01e.mjs → ~fallback.astro.7630c0d6.mjs} +25 -7
  131. package/packages/storefront/dist/server/chunks/{~fallback@_@astro.d17419ae.mjs → ~fallback@_@astro.65227dd7.mjs} +12 -4
  132. package/packages/storefront/dist/server/entry.mjs +28 -11
  133. package/packages/storefront/dist/server/manifest.webmanifest +1 -1
  134. package/packages/storefront/dist/server/renderers.mjs +80 -25
  135. package/packages/storefront/package.json +9 -8
  136. package/packages/storefront/src/helpers/server-data.ts +14 -17
  137. package/packages/storefront/src/images/use-ssr-picture.ts +18 -3
  138. package/packages/storefront/src/lib/components/BannerPictures.astro +4 -4
  139. package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +2 -2
  140. package/packages/storefront/src/lib/components/SharedData.astro +1 -1
  141. package/packages/storefront/src/lib/composables/use-shared-data.ts +18 -3
  142. package/packages/storefront/src/lib/content.d.ts +36 -2
  143. package/packages/storefront/src/lib/layouts/Base.astro +3 -2
  144. package/packages/storefront/src/lib/layouts/use-page-main.ts +2 -2
  145. package/packages/storefront/src/lib/ssr-context.ts +1 -1
  146. package/packages/test-base/CHANGELOG.md +1 -0
  147. package/packages/test-base/README.md +7 -0
  148. package/packages/test-base/lib/endpoints.js +23 -0
  149. package/packages/test-base/lib/endpoints.js.map +1 -0
  150. package/packages/test-base/lib/index.js +4 -0
  151. package/packages/test-base/lib/index.js.map +1 -0
  152. package/packages/test-base/lib/playloads.js +14 -0
  153. package/packages/test-base/lib/playloads.js.map +1 -0
  154. package/packages/test-base/package.json +28 -0
  155. package/packages/test-base/payloads/calculate-shipping.json +37 -0
  156. package/packages/test-base/payloads/create-transaction.json +116 -0
  157. package/packages/test-base/payloads/list-payments.json +125 -0
  158. package/packages/test-base/src/endpoints.ts +37 -0
  159. package/packages/test-base/src/index.ts +3 -0
  160. package/packages/test-base/src/playloads.ts +24 -0
  161. package/packages/test-base/tsconfig.json +3 -0
  162. package/packages/types/package.json +1 -1
  163. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/.gitkeep +0 -0
  164. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/.gitkeep +0 -0
  165. package/packages/storefront/dist/client/_astro/HeroSlider.8d2ea532.js +0 -1
  166. package/packages/storefront/dist/client/_astro/PitchBar.c2a2ad79.js +0 -1
  167. package/packages/storefront/dist/client/_astro/Prices.8572765c.js +0 -1
  168. package/packages/storefront/dist/client/_astro/ProductShelf.4a105932.js +0 -1
  169. package/packages/storefront/dist/client/_astro/ShopHeader.2400b065.js +0 -4
  170. package/packages/storefront/dist/client/_astro/_...slug_.a786e016.css +0 -1
  171. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.48e557ba.js +0 -1
  172. package/packages/storefront/dist/client/_astro/client.9dbf6b61.js +0 -1
  173. package/packages/storefront/dist/client/_astro/ecom-icon_CDmhA.png +0 -0
  174. package/packages/storefront/dist/client/_astro/ecom-icon_Z27EX9f.png +0 -0
  175. package/packages/storefront/dist/client/_astro/ecom-icon_Zo1CLq.png +0 -0
  176. package/packages/storefront/dist/client/_astro/headphone_22qtrt.avif +0 -0
  177. package/packages/storefront/dist/client/_astro/headphone_247ud8.avif +0 -0
  178. package/packages/storefront/dist/client/_astro/headphone_Z1hoMcQ.webp +0 -0
  179. package/packages/storefront/dist/client/_astro/headphone_Z1j5MXv.webp +0 -0
  180. package/packages/storefront/dist/client/_astro/img.7def76a1.js +0 -1
  181. package/packages/storefront/dist/client/_astro/index.c0c35ead.js +0 -1
  182. package/packages/storefront/dist/client/_astro/logo_144owC.webp +0 -0
  183. package/packages/storefront/dist/client/_astro/logo_1ug3XF.png +0 -0
  184. package/packages/storefront/dist/client/_astro/logo_Z1EIN1I.avif +0 -0
  185. package/packages/storefront/dist/client/_astro/passion_29BEzB.webp +0 -0
  186. package/packages/storefront/dist/client/_astro/passion_2sykkb.avif +0 -0
  187. package/packages/storefront/dist/client/_astro/passion_HYj6i.webp +0 -0
  188. package/packages/storefront/dist/client/_astro/passion_Z18ANwS.avif +0 -0
  189. package/packages/storefront/dist/client/_astro/passion_ZK2FPz.webp +0 -0
  190. package/packages/storefront/dist/client/_astro/passion_pVNbE.avif +0 -0
  191. package/packages/storefront/dist/client/_astro/rect8589_1EUYOa.webp +0 -0
  192. package/packages/storefront/dist/client/_astro/rect8589_1Sqf3x.png +0 -0
  193. package/packages/storefront/dist/client/_astro/rect8589_1VeSii.avif +0 -0
  194. package/packages/storefront/dist/client/_astro/rect8589_2wFECM.png +0 -0
  195. package/packages/storefront/dist/client/_astro/rect8589_7mg8W.png +0 -0
  196. package/packages/storefront/dist/client/_astro/rect8589_Kv492.webp +0 -0
  197. package/packages/storefront/dist/client/_astro/rect8589_Z1DNkkN.webp +0 -0
  198. package/packages/storefront/dist/client/_astro/rect8589_Z1IS4wy.avif +0 -0
  199. package/packages/storefront/dist/client/_astro/rect8589_Zt4vbx.avif +0 -0
  200. package/packages/storefront/dist/client/_astro/rect859_1Bqr36.webp +0 -0
  201. package/packages/storefront/dist/client/_astro/rect859_1pj5UP.png +0 -0
  202. package/packages/storefront/dist/client/_astro/rect859_2dVuzq.avif +0 -0
  203. package/packages/storefront/dist/client/_astro/rect859_HaXay.png +0 -0
  204. package/packages/storefront/dist/client/_astro/rect859_Z100iy0.png +0 -0
  205. package/packages/storefront/dist/client/_astro/rect859_Z2i1RBz.avif +0 -0
  206. package/packages/storefront/dist/client/_astro/rect859_ZMRWqJ.webp +0 -0
  207. package/packages/storefront/dist/client/_astro/rect859_mPQHw.avif +0 -0
  208. package/packages/storefront/dist/client/_astro/rect859_xyq7d.webp +0 -0
  209. package/packages/storefront/dist/client/_astro/rect89_1DkX0O.webp +0 -0
  210. package/packages/storefront/dist/client/_astro/rect89_2uIqYp.avif +0 -0
  211. package/packages/storefront/dist/client/_astro/rect89_Z1rGPGT.webp +0 -0
  212. package/packages/storefront/dist/client/_astro/rect89_ZAjmIj.avif +0 -0
  213. package/packages/storefront/dist/client/~fallback.html +0 -98
  214. package/packages/storefront/dist/client/~index.html +0 -134
  215. package/packages/storefront/dist/server/images.dist.csv +0 -38
  216. package/packages/storefront/dist/server/images.src.csv +0 -11
  217. package/packages/storefront/dist/server/stylesheets.csv +0 -1
@@ -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},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};/**
31
+ */const Ot=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},bn=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++],c=n[t++],a=((i&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(a&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Nt={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,c=o?n[i+1]:0,a=i+2<n.length,l=a?n[i+2]:0,u=s>>2,f=(s&3)<<4|c>>4;let g=(c&15)<<2|l>>6,v=l&63;a||(v=64,o||(g=64)),r.push(t[u],t[f],t[g],t[v])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Ot(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):bn(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++)],c=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||c==null||l==null||f==null)throw new Tn;const g=s<<2|c>>4;if(r.push(g),l!==64){const v=c<<4&240|l>>2;if(r.push(v),f!==64){const x=l<<6&192|f;r.push(x)}}}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 Tn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Sn=function(n){const e=Ot(n);return Nt.encodeByteArray(e,!0)},Dt=function(n){return Sn(n).replace(/\./g,"")},Lt=function(n){try{return Nt.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
32
32
  * @license
33
33
  * Copyright 2022 Google LLC
34
34
  *
@@ -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 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}`]};/**
61
+ */const An=()=>Cn().__FIREBASE_DEFAULTS__,Rn=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},kn=()=>{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 An()||Rn()||kn()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Pn=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
  *
@@ -73,7 +73,7 @@
73
73
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
74
  * See the License for the specific language governing permissions and
75
75
  * limitations under the License.
76
- */class Ln{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
76
+ */class On{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
77
77
  * @license
78
78
  * Copyright 2017 Google LLC
79
79
  *
@@ -88,7 +88,7 @@
88
88
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
89
  * See the License for the specific language governing permissions and
90
90
  * limitations under the License.
91
- */function p(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Mn(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())}function Un(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Bn(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function xn(){const n=p();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Fn(){try{return typeof indexedDB=="object"}catch{return!1}}function Hn(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
91
+ */function p(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Nn(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())}function Dn(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Ln(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Mn(){const n=p();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Un(){try{return typeof indexedDB=="object"}catch{return!1}}function xn(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
92
92
  * @license
93
93
  * Copyright 2017 Google LLC
94
94
  *
@@ -103,7 +103,7 @@
103
103
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
104
  * See the License for the specific language governing permissions and
105
105
  * limitations under the License.
106
- */const $n="FirebaseError";class O extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=$n,Object.setPrototypeOf(this,O.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Z.prototype.create)}}class Z{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Vn(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new O(i,a,r)}}function Vn(n,e){return n.replace(Wn,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Wn=/\{\$([^}]+)}/g;function jn(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function he(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(st(s)&&st(o)){if(!he(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function st(n){return n!==null&&typeof n=="object"}/**
106
+ */const Bn="FirebaseError";class P extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Bn,Object.setPrototypeOf(this,P.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ee.prototype.create)}}class ee{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Fn(s,r):"Error",c=`${this.serviceName}: ${o} (${i}).`;return new P(i,c,r)}}function Fn(n,e){return n.replace(Vn,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Vn=/\{\$([^}]+)}/g;function Hn(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function he(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(st(s)&&st(o)){if(!he(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function st(n){return n!==null&&typeof n=="object"}/**
107
107
  * @license
108
108
  * Copyright 2017 Google LLC
109
109
  *
@@ -118,7 +118,7 @@
118
118
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
119
  * See the License for the specific language governing permissions and
120
120
  * limitations under the License.
121
- */function ee(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function z(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function G(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function zn(n,e){const t=new Gn(n,e);return t.subscribe.bind(t)}class Gn{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");Kn(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=Ce),i.error===void 0&&(i.error=Ce),i.complete===void 0&&(i.complete=Ce);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Kn(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Ce(){}/**
121
+ */function te(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function G(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function K(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function $n(n,e){const t=new Wn(n,e);return t.subscribe.bind(t)}class Wn{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");jn(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=ke),i.error===void 0&&(i.error=ke),i.complete===void 0&&(i.complete=ke);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function jn(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function ke(){}/**
122
122
  * @license
123
123
  * Copyright 2021 Google LLC
124
124
  *
@@ -133,7 +133,7 @@
133
133
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134
134
  * See the License for the specific language governing permissions and
135
135
  * limitations under the License.
136
- */function P(n){return n&&n._delegate?n._delegate:n}class ${constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
136
+ */function O(n){return n&&n._delegate?n._delegate:n}class ${constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
137
137
  * @license
138
138
  * Copyright 2019 Google LLC
139
139
  *
@@ -148,7 +148,7 @@
148
148
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
149
  * See the License for the specific language governing permissions and
150
150
  * limitations under the License.
151
- */const D="[DEFAULT]";/**
151
+ */const N="[DEFAULT]";/**
152
152
  * @license
153
153
  * Copyright 2019 Google LLC
154
154
  *
@@ -163,7 +163,7 @@
163
163
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
164
  * See the License for the specific language governing permissions and
165
165
  * limitations under the License.
166
- */class qn{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new Ln;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Yn(e))try{this.getOrInitializeService({instanceIdentifier:D})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=D){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=D){return this.instances.has(e)}getOptions(e=D){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Jn(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=D){return this.component?this.component.multipleInstances?e:D:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Jn(n){return n===D?void 0:n}function Yn(n){return n.instantiationMode==="EAGER"}/**
166
+ */class zn{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new On;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Kn(e))try{this.getOrInitializeService({instanceIdentifier:N})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=N){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=N){return this.instances.has(e)}getOptions(e=N){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const c=this.normalizeInstanceIdentifier(s);r===c&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Gn(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=N){return this.component?this.component.multipleInstances?e:N:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Gn(n){return n===N?void 0:n}function Kn(n){return n.instantiationMode==="EAGER"}/**
167
167
  * @license
168
168
  * Copyright 2019 Google LLC
169
169
  *
@@ -178,7 +178,7 @@
178
178
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
179
  * See the License for the specific language governing permissions and
180
180
  * limitations under the License.
181
- */class Xn{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new qn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
181
+ */class qn{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new zn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
182
182
  * @license
183
183
  * Copyright 2017 Google LLC
184
184
  *
@@ -193,7 +193,7 @@
193
193
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
194
  * See the License for the specific language governing permissions and
195
195
  * limitations under the License.
196
- */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const 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)}));/**
196
+ */var h;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(h||(h={}));const Jn={debug:h.DEBUG,verbose:h.VERBOSE,info:h.INFO,warn:h.WARN,error:h.ERROR,silent:h.SILENT},Yn=h.INFO,Xn={[h.DEBUG]:"log",[h.VERBOSE]:"log",[h.INFO]:"info",[h.WARN]:"warn",[h.ERROR]:"error"},Qn=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=Xn[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 xt{constructor(e){this.name=e,this._logLevel=Yn,this._logHandler=Qn,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in h))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Jn[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,h.DEBUG,...e),this._logHandler(this,h.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,h.VERBOSE,...e),this._logHandler(this,h.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,h.INFO,...e),this._logHandler(this,h.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,h.WARN,...e),this._logHandler(this,h.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,h.ERROR,...e),this._logHandler(this,h.ERROR,...e)}}const Zn=(n,e)=>e.some(t=>n instanceof t);let ot,at;function er(){return ot||(ot=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function tr(){return at||(at=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Bt=new WeakMap,xe=new WeakMap,Ft=new WeakMap,Pe=new WeakMap,je=new WeakMap;function nr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(R(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Bt.set(t,n)}).catch(()=>{}),je.set(e,n),e}function rr(n){if(xe.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)});xe.set(n,e)}let Be={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return xe.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 R(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function ir(n){Be=n(Be)}function sr(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Oe(this),e,...t);return Ft.set(r,e.sort?e.sort():[e]),R(r)}:tr().includes(n)?function(...e){return n.apply(Oe(this),e),R(Bt.get(this))}:function(...e){return R(n.apply(Oe(this),e))}}function or(n){return typeof n=="function"?sr(n):(n instanceof IDBTransaction&&rr(n),Zn(n,er())?new Proxy(n,Be):n)}function R(n){if(n instanceof IDBRequest)return nr(n);if(Pe.has(n))return Pe.get(n);const e=or(n);return e!==n&&(Pe.set(n,e),je.set(e,n)),e}const Oe=n=>je.get(n);function ar(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),c=R(o);return r&&o.addEventListener("upgradeneeded",a=>{r(R(o.result),a.oldVersion,a.newVersion,R(o.transaction),a)}),t&&o.addEventListener("blocked",a=>t(a.oldVersion,a.newVersion,a)),c.then(a=>{s&&a.addEventListener("close",()=>s()),i&&a.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}const cr=["get","getKey","getAll","getAllKeys","count"],lr=["put","add","delete","clear"],Ne=new Map;function ct(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ne.get(e))return Ne.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=lr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||cr.includes(t)))return;const s=async function(o,...c){const a=this.transaction(o,i?"readwrite":"readonly");let l=a.store;return r&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),i&&a.done]))[0]};return Ne.set(e,s),s}ir(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.15";/**
211
+ */class dr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(ur(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function ur(n){const e=n.getComponent();return e?.type==="VERSION"}const Fe="@firebase/app",lt="0.9.17";/**
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 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="10.1.0";/**
226
+ */const L=new xt("@firebase/app"),hr="@firebase/app-compat",fr="@firebase/analytics-compat",pr="@firebase/analytics",gr="@firebase/app-check-compat",mr="@firebase/app-check",_r="@firebase/auth",Ir="@firebase/auth-compat",vr="@firebase/database",yr="@firebase/database-compat",wr="@firebase/functions",Er="@firebase/functions-compat",br="@firebase/installations",Tr="@firebase/installations-compat",Sr="@firebase/messaging",Cr="@firebase/messaging-compat",Ar="@firebase/performance",Rr="@firebase/performance-compat",kr="@firebase/remote-config",Pr="@firebase/remote-config-compat",Or="@firebase/storage",Nr="@firebase/storage-compat",Dr="@firebase/firestore",Lr="@firebase/firestore-compat",Mr="firebase",Ur="10.3.0";/**
227
227
  * @license
228
228
  * Copyright 2019 Google LLC
229
229
  *
@@ -238,7 +238,7 @@
238
238
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
239
  * See the License for the specific language governing permissions and
240
240
  * limitations under the License.
241
- */const He="[DEFAULT]",Hr={[Fe]:"fire-core",[gr]:"fire-core-compat",[_r]:"fire-analytics",[mr]:"fire-analytics-compat",[vr]:"fire-app-check",[Ir]:"fire-app-check-compat",[yr]:"fire-auth",[Er]:"fire-auth-compat",[br]:"fire-rtdb",[wr]:"fire-rtdb-compat",[Tr]:"fire-fn",[Sr]:"fire-fn-compat",[Rr]:"fire-iid",[kr]:"fire-iid-compat",[Ar]:"fire-fcm",[Cr]:"fire-fcm-compat",[Or]:"fire-perf",[Pr]:"fire-perf-compat",[Dr]:"fire-rc",[Nr]:"fire-rc-compat",[Lr]:"fire-gcs",[Mr]:"fire-gcs-compat",[Ur]:"fire-fst",[Br]:"fire-fst-compat","fire-js":"fire-js",[xr]:"fire-js-all"};/**
241
+ */const Ve="[DEFAULT]",xr={[Fe]:"fire-core",[hr]:"fire-core-compat",[pr]:"fire-analytics",[fr]:"fire-analytics-compat",[mr]:"fire-app-check",[gr]:"fire-app-check-compat",[_r]:"fire-auth",[Ir]:"fire-auth-compat",[vr]:"fire-rtdb",[yr]:"fire-rtdb-compat",[wr]:"fire-fn",[Er]:"fire-fn-compat",[br]:"fire-iid",[Tr]:"fire-iid-compat",[Sr]:"fire-fcm",[Cr]:"fire-fcm-compat",[Ar]:"fire-perf",[Rr]:"fire-perf-compat",[kr]:"fire-rc",[Pr]:"fire-rc-compat",[Or]:"fire-gcs",[Nr]:"fire-gcs-compat",[Dr]:"fire-fst",[Lr]:"fire-fst-compat","fire-js":"fire-js",[Mr]:"fire-js-all"};/**
242
242
  * @license
243
243
  * Copyright 2019 Google LLC
244
244
  *
@@ -253,7 +253,7 @@
253
253
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
254
  * See the License for the specific language governing permissions and
255
255
  * limitations under the License.
256
- */const 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)}/**
256
+ */const fe=new Map,He=new Map;function Br(n,e){try{n.container.addComponent(e)}catch(t){L.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function J(n){const e=n.name;if(He.has(e))return L.debug(`There were multiple attempts to register component ${e}.`),!1;He.set(e,n);for(const t of fe.values())Br(t,n);return!0}function Vt(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 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);/**
271
+ */const Fr={"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}."},k=new ee("app","Firebase",Fr);/**
272
272
  * @license
273
273
  * Copyright 2019 Google LLC
274
274
  *
@@ -283,7 +283,7 @@
283
283
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
284
284
  * See the License for the specific language governing permissions and
285
285
  * limitations under the License.
286
- */class Wr{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new $("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw C.create("app-deleted",{appName:this._name})}}/**
286
+ */class Vr{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new $("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw k.create("app-deleted",{appName:this._name})}}/**
287
287
  * @license
288
288
  * Copyright 2019 Google LLC
289
289
  *
@@ -298,7 +298,7 @@
298
298
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
299
  * See the License for the specific language governing permissions and
300
300
  * limitations under the License.
301
- */const 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"))}/**
301
+ */const ne=Ur;function Ht(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Ve,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw k.create("bad-app-name",{appName:String(i)});if(t||(t=Mt()),!t)throw k.create("no-options");const s=fe.get(i);if(s){if(he(t,s.options)&&he(r,s.config))return s;throw k.create("duplicate-app",{appName:i})}const o=new qn(i);for(const a of He.values())o.addComponent(a);const c=new Vr(t,r,o);return fe.set(i,c),c}function Hr(n=Ve){const e=fe.get(n);if(!e&&n===Ve&&Mt())return Ht();if(!e)throw k.create("no-app",{appName:n});return e}function F(n,e,t){var r;let i=(r=xr[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const c=[`Unable to register library "${i}" with version "${e}":`];s&&c.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),L.warn(c.join(" "));return}J(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 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}`}/**
316
+ */const $r="firebase-heartbeat-database",Wr=1,Y="firebase-heartbeat-store";let De=null;function $t(){return De||(De=ar($r,Wr,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(Y)}}}).catch(n=>{throw k.create("idb-open",{originalErrorMessage:n.message})})),De}async function jr(n){try{return await(await $t()).transaction(Y).objectStore(Y).get(Wt(n))}catch(e){if(e instanceof P)L.warn(e.message);else{const t=k.create("idb-get",{originalErrorMessage:e?.message});L.warn(t.message)}}}async function dt(n,e){try{const r=(await $t()).transaction(Y,"readwrite");await r.objectStore(Y).put(e,Wt(n)),await r.done}catch(t){if(t instanceof P)L.warn(t.message);else{const r=k.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
  *
@@ -328,7 +328,7 @@
328
328
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
329
329
  * See the License for the specific language governing permissions and
330
330
  * limitations under the License.
331
- */const qr=1024,Jr=30*24*60*60*1e3;class Yr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Qr(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=dt();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const s=new Date(i.date).valueOf();return Date.now()-s<=Jr}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=dt(),{heartbeatsToSend:t,unsentEntries:r}=Xr(this._heartbeatsCache.heartbeats),i=Nt(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function dt(){return new Date().toISOString().substring(0,10)}function Xr(n,e=qr){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),ht(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),ht(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Qr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Fn()?Hn().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await Kr(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ut(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return ut(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function ht(n){return Nt(JSON.stringify({version:2,heartbeats:n})).length}/**
331
+ */const zr=1024,Gr=30*24*60*60*1e3;class Kr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Jr(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=ut();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const s=new Date(i.date).valueOf();return Date.now()-s<=Gr}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=ut(),{heartbeatsToSend:t,unsentEntries:r}=qr(this._heartbeatsCache.heartbeats),i=Dt(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function ut(){return new Date().toISOString().substring(0,10)}function qr(n,e=zr){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),ht(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),ht(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Jr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Un()?xn().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await jr(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return dt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return dt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function ht(n){return Dt(JSON.stringify({version:2,heartbeats:n})).length}/**
332
332
  * @license
333
333
  * Copyright 2019 Google LLC
334
334
  *
@@ -343,7 +343,7 @@
343
343
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
344
344
  * See the License for the specific language governing permissions and
345
345
  * limitations under the License.
346
- */function Zr(n){q(new $("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="10.1.0";/**
346
+ */function Yr(n){J(new $("platform-logger",e=>new dr(e),"PRIVATE")),J(new $("heartbeat",e=>new Kr(e),"PRIVATE")),F(Fe,lt,n),F(Fe,lt,"esm2017"),F("fire-js","")}Yr("");var Xr="firebase",Qr="10.3.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 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());/**
361
+ */F(Xr,Qr,"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 ft(n){return n!==void 0&&n.enterprise!==void 0}class Zr{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")}}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 ei=jt,zt=new ee("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 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)}/**
376
+ */const pe=new xt("@firebase/auth");function ti(n,...e){pe.logLevel<=h.WARN&&pe.warn(`Auth (${ne}): ${n}`,...e)}function ce(n,...e){pe.logLevel<=h.ERROR&&pe.error(`Auth (${ne}): ${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 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)}/**
391
+ */function m(n,...e){throw Ge(n,...e)}function _(n,...e){return Ge(n,...e)}function ni(n,e,t){const r=Object.assign(Object.assign({},ei()),{[e]:t});return new ee("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 d(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 E(n,e){n||y(e)}/**
392
392
  * @license
393
393
  * Copyright 2020 Google LLC
394
394
  *
@@ -403,7 +403,7 @@
403
403
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
404
404
  * See the License for the specific language governing permissions and
405
405
  * limitations under the License.
406
- */function ge(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function si(){return ft()==="http:"||ft()==="https:"}function ft(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
406
+ */function ge(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function ri(){return pt()==="http:"||pt()==="https:"}function pt(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/**
407
407
  * @license
408
408
  * Copyright 2020 Google LLC
409
409
  *
@@ -418,7 +418,7 @@
418
418
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
419
419
  * See the License for the specific language governing permissions and
420
420
  * limitations under the License.
421
- */function oi(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(si()||Un()||"connection"in navigator)?navigator.onLine:!0}function ai(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
421
+ */function ii(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(ri()||Dn()||"connection"in navigator)?navigator.onLine:!0}function si(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
422
422
  * @license
423
423
  * Copyright 2020 Google LLC
424
424
  *
@@ -433,7 +433,7 @@
433
433
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
434
434
  * See the License for the specific language governing permissions and
435
435
  * limitations under the License.
436
- */class ne{constructor(e,t){this.shortDelay=e,this.longDelay=t,b(t>e,"Short delay should be less than long delay!"),this.isMobile=Mn()||Bn()}get(){return oi()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
436
+ */class re{constructor(e,t){this.shortDelay=e,this.longDelay=t,E(t>e,"Short delay should be less than long delay!"),this.isMobile=Nn()||Ln()}get(){return ii()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
437
437
  * @license
438
438
  * Copyright 2020 Google LLC
439
439
  *
@@ -448,7 +448,7 @@
448
448
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
449
449
  * See the License for the specific language governing permissions and
450
450
  * limitations under the License.
451
- */function Ke(n,e){b(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
451
+ */function Ke(n,e){E(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
452
452
  * @license
453
453
  * Copyright 2020 Google LLC
454
454
  *
@@ -478,7 +478,7 @@
478
478
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
479
479
  * See the License for the specific language governing permissions and
480
480
  * limitations under the License.
481
- */const ci={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
481
+ */const oi={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
482
482
  * @license
483
483
  * Copyright 2020 Google LLC
484
484
  *
@@ -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 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}/**
496
+ */const ai=new re(3e4,6e4);function j(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function U(n,e,t,r,i={}){return Kt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const c=te(Object.assign({key:n.config.apiKey},o)).slice(1),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/json",n.languageCode&&(a["X-Firebase-Locale"]=n.languageCode),Gt.fetch()(qt(n,n.config.apiHost,t,c),Object.assign({method:e,headers:a,referrerPolicy:"no-referrer"},s))})}async function Kt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},oi),e);try{const i=new ci(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 c=s.ok?o.errorMessage:o.error.message,[a,l]=c.split(" : ");if(a==="FEDERATED_USER_ID_ALREADY_LINKED")throw ae(n,"credential-already-in-use",o);if(a==="EMAIL_EXISTS")throw ae(n,"email-already-in-use",o);if(a==="USER_DISABLED")throw ae(n,"user-disabled",o);const u=r[a]||a.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ni(n,u,l);m(n,u)}}catch(i){if(i instanceof P)throw i;m(n,"network-request-failed",{message:String(i)})}}async function ye(n,e,t,r,i={}){const s=await U(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 ci{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(_(this.auth,"network-request-failed")),ai.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}async function li(n,e){return U(n,"GET","/v2/recaptchaConfig",j(n,e))}/**
497
497
  * @license
498
498
  * Copyright 2020 Google LLC
499
499
  *
@@ -508,7 +508,7 @@
508
508
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
509
509
  * See the License for the specific language governing permissions and
510
510
  * limitations under the License.
511
- */async function di(n,e){return W(n,"POST","/v1/accounts:delete",e)}async function hi(n,e){return W(n,"POST","/v1/accounts:lookup",e)}/**
511
+ */async function di(n,e){return U(n,"POST","/v1/accounts:delete",e)}async function ui(n,e){return U(n,"POST","/v1/accounts:lookup",e)}/**
512
512
  * @license
513
513
  * Copyright 2020 Google LLC
514
514
  *
@@ -523,7 +523,7 @@
523
523
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
524
524
  * See the License for the specific language governing permissions and
525
525
  * limitations under the License.
526
- */function K(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function fi(n,e=!1){const t=P(n),r=await t.getIdToken(e),i=qe(r);u(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:K(Le(i.auth_time)),issuedAtTime:K(Le(i.iat)),expirationTime:K(Le(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Le(n){return Number(n)*1e3}function qe(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return ce("JWT malformed, contained fewer than 3 sections"),null;try{const i=Lt(t);return i?JSON.parse(i):(ce("Failed to decode base64 JWT payload"),null)}catch(i){return ce("Caught error parsing JWT payload as JSON",i?.toString()),null}}function pi(n){const e=qe(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
526
+ */function q(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function hi(n,e=!1){const t=O(n),r=await t.getIdToken(e),i=qe(r);d(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:q(Le(i.auth_time)),issuedAtTime:q(Le(i.iat)),expirationTime:q(Le(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Le(n){return Number(n)*1e3}function qe(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return ce("JWT malformed, contained fewer than 3 sections"),null;try{const i=Lt(t);return i?JSON.parse(i):(ce("Failed to decode base64 JWT payload"),null)}catch(i){return ce("Caught error parsing JWT payload as JSON",i?.toString()),null}}function fi(n){const e=qe(n);return d(e,"internal-error"),d(typeof e.exp<"u","internal-error"),d(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
527
527
  * @license
528
528
  * Copyright 2020 Google LLC
529
529
  *
@@ -538,7 +538,7 @@
538
538
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
539
539
  * See the License for the specific language governing permissions and
540
540
  * limitations under the License.
541
- */async function Y(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof O&&gi(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function gi({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
541
+ */async function X(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof P&&pi(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function pi({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
542
542
  * @license
543
543
  * Copyright 2020 Google LLC
544
544
  *
@@ -553,7 +553,7 @@
553
553
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554
554
  * See the License for the specific language governing permissions and
555
555
  * limitations under the License.
556
- */class mi{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
556
+ */class gi{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
557
557
  * @license
558
558
  * Copyright 2020 Google LLC
559
559
  *
@@ -568,7 +568,7 @@
568
568
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
569
569
  * See the License for the specific language governing permissions and
570
570
  * limitations under the License.
571
- */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}}}/**
571
+ */class Jt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=q(this.lastLoginAt),this.creationTime=q(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 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}})}/**
586
+ */async function me(n){var e;const t=n.auth,r=await n.getIdToken(),i=await X(n,ui(t,{idToken:r}));d(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?Ii(s.providerUserInfo):[],c=_i(n.providerData,o),a=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!c?.length,u=a?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:c,metadata:new Jt(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(n,f)}async function mi(n){const e=O(n);await me(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function _i(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function Ii(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 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}}/**
601
+ */async function vi(n,e){const t=await Kt(n,{},async()=>{const r=te({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=qt(n,i,"/v1/token",`key=${s}`),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/x-www-form-urlencoded",Gt.fetch()(o,{method:"POST",headers:c,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
  *
@@ -613,7 +613,7 @@
613
613
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
614
614
  * See the License for the specific language governing permissions and
615
615
  * limitations under the License.
616
- */class X{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):pi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return u(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await yi(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new X;return r&&(u(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new X,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
616
+ */class Q{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){d(e.idToken,"internal-error"),d(typeof e.idToken<"u","internal-error"),d(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):fi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return d(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await vi(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new Q;return r&&(d(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(d(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(d(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Q,this.toJSON())}_performRefresh(){return y("not implemented")}}/**
617
617
  * @license
618
618
  * Copyright 2020 Google LLC
619
619
  *
@@ -628,7 +628,7 @@
628
628
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629
629
  * See the License for the specific language governing permissions and
630
630
  * limitations under the License.
631
- */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}}/**
631
+ */function b(n,e){d(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class D{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=ze(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new gi(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 X(this,this.stsTokenManager.getToken(this.auth,e));return d(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return hi(this,e)}reload(){return mi(this)}_assign(e){this!==e&&(d(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 D(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){d(!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 X(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,c,a,l,u;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,x=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Ze=(c=t.tenantId)!==null&&c!==void 0?c:void 0,Se=(a=t._redirectEventId)!==null&&a!==void 0?a:void 0,et=(l=t.createdAt)!==null&&l!==void 0?l:void 0,tt=(u=t.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:Ce,emailVerified:nt,isAnonymous:rt,providerData:Ae,stsTokenManager:it}=t;d(Ce&&it,e,"internal-error");const wn=Q.fromJSON(this.name,it);d(typeof Ce=="string",e,"internal-error"),b(f,e.name),b(g,e.name),d(typeof nt=="boolean",e,"internal-error"),d(typeof rt=="boolean",e,"internal-error"),b(v,e.name),b(x,e.name),b(Ze,e.name),b(Se,e.name),b(et,e.name),b(tt,e.name);const Re=new D({uid:Ce,auth:e,email:g,emailVerified:nt,displayName:f,isAnonymous:rt,photoURL:x,phoneNumber:v,tenantId:Ze,stsTokenManager:wn,createdAt:et,lastLoginAt:tt});return Ae&&Array.isArray(Ae)&&(Re.providerData=Ae.map(En=>Object.assign({},En))),Se&&(Re._redirectEventId=Se),Re}static async _fromIdTokenResponse(e,t,r=!1){const i=new Q;i.updateFromServerResponse(t);const s=new D({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
  *
@@ -643,7 +643,7 @@
643
643
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
644
644
  * See the License for the specific language governing permissions and
645
645
  * limitations under the License.
646
- */const pt=new Map;function E(n){b(n instanceof Function,"Expected a class definition");let e=pt.get(n);return e?(b(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,pt.set(n,e),e)}/**
646
+ */const gt=new Map;function w(n){E(n instanceof Function,"Expected a class definition");let e=gt.get(n);return e?(E(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,gt.set(n,e),e)}/**
647
647
  * @license
648
648
  * Copyright 2019 Google LLC
649
649
  *
@@ -658,7 +658,7 @@
658
658
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
659
659
  * See the License for the specific language governing permissions and
660
660
  * limitations under the License.
661
- */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;/**
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 mt=Yt;/**
662
662
  * @license
663
663
  * Copyright 2019 Google LLC
664
664
  *
@@ -673,7 +673,7 @@
673
673
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
674
674
  * See the License for the specific language governing permissions and
675
675
  * limitations under the License.
676
- */function le(n,e,t){return`firebase:${n}:${e}:${t}`}class F{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=le(this.userKey,i.apiKey,s),this.fullPersistenceKey=le("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?N._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new F(E(gt),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||E(gt);const o=le(r,e.config.apiKey,e.name);let a=null;for(const l of t)try{const d=await l._get(o);if(d){const f=N._fromJSON(e,d);l!==s&&(a=f),s=l;break}}catch{}const c=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new F(s,e,r):(s=c[0],a&&await s._set(o,a.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new F(s,e,r))}}/**
676
+ */function le(n,e,t){return`firebase:${n}:${e}:${t}`}class V{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=le(this.userKey,i.apiKey,s),this.fullPersistenceKey=le("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?D._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new V(w(mt),e,r);const i=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let s=i[0]||w(mt);const o=le(r,e.config.apiKey,e.name);let c=null;for(const l of t)try{const u=await l._get(o);if(u){const f=D._fromJSON(e,u);l!==s&&(c=f),s=l;break}}catch{}const a=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!a.length?new V(s,e,r):(s=a[0],c&&await s._set(o,c.toJSON()),await Promise.all(t.map(async l=>{if(l!==s)try{await l._remove(o)}catch{}})),new V(s,e,r))}}/**
677
677
  * @license
678
678
  * Copyright 2020 Google LLC
679
679
  *
@@ -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(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}}/**
691
+ */function _t(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 we(n=p()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function yi(n=p()){var e;return we(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function wi(){return Mn()&&document.documentMode===10}function rn(n=p()){return we(n)||en(n)||nn(n)||tn(n)||/windows phone/i.test(n)||Zt(n)}function Ei(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
692
692
  * @license
693
693
  * Copyright 2020 Google LLC
694
694
  *
@@ -703,9 +703,9 @@
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 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")}}/**
706
+ */function sn(n,e=[]){let t;switch(n){case"Browser":t=_t(p());break;case"Worker":t=`${_t(p())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${ne}/${r}`}/**
707
707
  * @license
708
- * Copyright 2020 Google LLC
708
+ * Copyright 2022 Google LLC
709
709
  *
710
710
  * Licensed under the Apache License, Version 2.0 (the "License");
711
711
  * you may not use this file except in compliance with the License.
@@ -718,9 +718,39 @@
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 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}/**
721
+ */class bi{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,c)=>{try{const a=e(s);o(a)}catch(a){c(a)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}/**
722
722
  * @license
723
- * Copyright 2022 Google LLC
723
+ * Copyright 2023 Google LLC
724
+ *
725
+ * Licensed under the Apache License, Version 2.0 (the "License");
726
+ * you may not use this file except in compliance with the License.
727
+ * You may obtain a copy of the License at
728
+ *
729
+ * http://www.apache.org/licenses/LICENSE-2.0
730
+ *
731
+ * Unless required by applicable law or agreed to in writing, software
732
+ * distributed under the License is distributed on an "AS IS" BASIS,
733
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
734
+ * See the License for the specific language governing permissions and
735
+ * limitations under the License.
736
+ */async function Ti(n,e={}){return U(n,"GET","/v2/passwordPolicy",j(n,e))}/**
737
+ * @license
738
+ * Copyright 2023 Google LLC
739
+ *
740
+ * Licensed under the Apache License, Version 2.0 (the "License");
741
+ * you may not use this file except in compliance with the License.
742
+ * You may obtain a copy of the License at
743
+ *
744
+ * http://www.apache.org/licenses/LICENSE-2.0
745
+ *
746
+ * Unless required by applicable law or agreed to in writing, software
747
+ * distributed under the License is distributed on an "AS IS" BASIS,
748
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749
+ * See the License for the specific language governing permissions and
750
+ * limitations under the License.
751
+ */const Si=6;class Ci{constructor(e){var t,r,i,s;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=o.minPasswordLength)!==null&&t!==void 0?t:Si,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,r,i,s,o,c;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,a),this.validatePasswordCharacterOptions(e,a),a.isValid&&(a.isValid=(t=a.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),a.isValid&&(a.isValid=(r=a.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),a.isValid&&(a.isValid=(i=a.containsLowercaseLetter)!==null&&i!==void 0?i:!0),a.isValid&&(a.isValid=(s=a.containsUppercaseLetter)!==null&&s!==void 0?s:!0),a.isValid&&(a.isValid=(o=a.containsNumericCharacter)!==null&&o!==void 0?o:!0),a.isValid&&(a.isValid=(c=a.containsNonAlphanumericCharacter)!==null&&c!==void 0?c:!0),a}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
752
+ * @license
753
+ * Copyright 2020 Google LLC
724
754
  *
725
755
  * Licensed under the Apache License, Version 2.0 (the "License");
726
756
  * you may not use this file except in compliance with the License.
@@ -733,7 +763,7 @@
733
763
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
734
764
  * See the License for the specific language governing permissions and
735
765
  * limitations under the License.
736
- */class Ci{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,a)=>{try{const c=e(s);o(c)}catch(c){a(c)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}/**
766
+ */class Ai{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 It(this),this.idTokenSubscription=new It(this),this.beforeStateQueue=new bi(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=zt,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},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=w(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await V.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,c=i?._redirectEventId,a=await this.tryRedirectSignIn(e);(!o||o===c)&&a?.user&&(i=a.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 d(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=si()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?O(e):null;return t&&d(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&&d(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(w(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await Ti(this),t=new Ci(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new ee("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}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&&w(e)||this._popupRedirectResolver;d(t,this,"argument-error"),this.redirectPersistenceManager=await V.create(this,[w(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((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);let o=!1;const c=this._isInitialized?Promise.resolve():this._initializationPromise;if(d(c,this,"internal-error"),c.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const a=e.addObserver(t,r,i);return()=>{o=!0,a()}}else{const a=e.addObserver(t);return()=>{o=!0,a()}}}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 d(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&&ti(`Error while retrieving App Check token: ${t.error}`),t?.token}}function ie(n){return O(n)}class It{constructor(e){this.auth=e,this.observer=null,this.addObserver=$n(t=>this.observer=t)}get next(){return d(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
737
767
  * @license
738
768
  * Copyright 2020 Google LLC
739
769
  *
@@ -748,7 +778,7 @@
748
778
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749
779
  * See the License for the specific language governing permissions and
750
780
  * 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=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)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}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)}}/**
781
+ */function Ri(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}function on(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",Ri().appendChild(r)})}function ki(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const Pi="https://www.google.com/recaptcha/enterprise.js?render=",Oi="recaptcha-enterprise",Ni="NO_RECAPTCHA";class Di{constructor(e){this.type=Oi,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,c)=>{li(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(a=>{if(a.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{const l=new Zr(a);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(a=>{c(a)})})}function i(s,o,c){const a=window.grecaptcha;ft(a)?a.enterprise.ready(()=>{a.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(Ni)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(c=>{if(!t&&ft(window.grecaptcha))i(c,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}on(Pi+c).then(()=>{i(c,s,o)}).catch(a=>{o(a)})}}).catch(c=>{o(c)})})}}async function vt(n,e,t,r=!1){const i=new Di(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}/**
752
782
  * @license
753
783
  * Copyright 2020 Google LLC
754
784
  *
@@ -763,7 +793,7 @@
763
793
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
764
794
  * See the License for the specific language governing permissions and
765
795
  * limitations under the License.
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())}/**
796
+ */function Li(n,e){const t=Vt(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 Mi(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(w);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function Ui(n,e,t){const r=ie(n);d(r._canInitEmulator,r,"emulator-config-failed"),d(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,s=an(e),{host:o,port:c}=xi(e),a=c===null?"":`:${c}`;r.config.emulator={url:`${s}//${o}${a}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||Bi()}function an(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function xi(n){const e=an(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 Bi(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
767
797
  * @license
768
798
  * Copyright 2020 Google LLC
769
799
  *
@@ -778,7 +808,7 @@
778
808
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
779
809
  * See the License for the specific language governing permissions and
780
810
  * limitations under the License.
781
- */class Ye{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return y("not implemented")}_getIdTokenResponse(e){return y("not implemented")}_linkToIdToken(e,t){return y("not implemented")}_getReauthenticationResolver(e){return y("not implemented")}}async function Ui(n,e){return W(n,"POST","/v1/accounts:update",e)}/**
811
+ */class Ye{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return y("not implemented")}_getIdTokenResponse(e){return y("not implemented")}_linkToIdToken(e,t){return y("not implemented")}_getReauthenticationResolver(e){return y("not implemented")}}async function Fi(n,e){return U(n,"POST","/v1/accounts:update",e)}/**
782
812
  * @license
783
813
  * Copyright 2020 Google LLC
784
814
  *
@@ -793,7 +823,7 @@
793
823
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
794
824
  * See the License for the specific language governing permissions and
795
825
  * limitations under the License.
796
- */async function Me(n,e){return ye(n,"POST","/v1/accounts:signInWithPassword",re(n,e))}/**
826
+ */async function Me(n,e){return ye(n,"POST","/v1/accounts:signInWithPassword",j(n,e))}/**
797
827
  * @license
798
828
  * Copyright 2020 Google LLC
799
829
  *
@@ -808,7 +838,7 @@
808
838
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809
839
  * See the License for the specific language governing permissions and
810
840
  * limitations under the License.
811
- */async function Bi(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",re(n,e))}async function xi(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",re(n,e))}/**
841
+ */async function Vi(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",j(n,e))}async function Hi(n,e){return ye(n,"POST","/v1/accounts:signInWithEmailLink",j(n,e))}/**
812
842
  * @license
813
843
  * Copyright 2020 Google LLC
814
844
  *
@@ -823,7 +853,7 @@
823
853
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
824
854
  * See the License for the specific language governing permissions and
825
855
  * limitations under the License.
826
- */class Q extends Ye{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new Q(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new Q(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){var t;switch(this.signInMethod){case"password":const r={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};if(!((t=e._getRecaptchaConfig())===null||t===void 0)&&t.emailPasswordEnabled){const i=await It(e,r,"signInWithPassword");return Me(e,i)}else return Me(e,r).catch(async i=>{if(i.code==="auth/missing-recaptcha-token"){console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const s=await It(e,r,"signInWithPassword");return Me(e,s)}else return Promise.reject(i)});case"emailLink":return Bi(e,{email:this._email,oobCode:this._password});default:m(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Ui(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return xi(e,{idToken:t,email:this._email,oobCode:this._password});default:m(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
856
+ */class Z extends Ye{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new Z(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new Z(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){var t;switch(this.signInMethod){case"password":const r={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};if(!((t=e._getRecaptchaConfig())===null||t===void 0)&&t.emailPasswordEnabled){const i=await vt(e,r,"signInWithPassword");return Me(e,i)}else return Me(e,r).catch(async i=>{if(i.code==="auth/missing-recaptcha-token"){console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const s=await vt(e,r,"signInWithPassword");return Me(e,s)}else return Promise.reject(i)});case"emailLink":return Vi(e,{email:this._email,oobCode:this._password});default:m(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Fi(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Hi(e,{idToken:t,email:this._email,oobCode:this._password});default:m(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
827
857
  * @license
828
858
  * Copyright 2020 Google LLC
829
859
  *
@@ -838,7 +868,7 @@
838
868
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
839
869
  * See the License for the specific language governing permissions and
840
870
  * limitations under the License.
841
- */async function H(n,e){return ye(n,"POST","/v1/accounts:signInWithIdp",re(n,e))}/**
871
+ */async function H(n,e){return ye(n,"POST","/v1/accounts:signInWithIdp",j(n,e))}/**
842
872
  * @license
843
873
  * Copyright 2020 Google LLC
844
874
  *
@@ -853,7 +883,7 @@
853
883
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
854
884
  * See the License for the specific language governing permissions and
855
885
  * limitations under the License.
856
- */const Fi="http://localhost";class M extends Ye{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new M(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):m("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=ze(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new M(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return H(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,H(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,H(e,t)}buildRequest(){const e={requestUri:Fi,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ee(t)}return e}}/**
886
+ */const $i="http://localhost";class M extends Ye{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new M(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):m("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=ze(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new M(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return H(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,H(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,H(e,t)}buildRequest(){const e={requestUri:$i,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=te(t)}return e}}/**
857
887
  * @license
858
888
  * Copyright 2020 Google LLC
859
889
  *
@@ -868,7 +898,7 @@
868
898
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
869
899
  * See the License for the specific language governing permissions and
870
900
  * limitations under the License.
871
- */function Hi(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function $i(n){const e=z(G(n)).link,t=e?z(G(e)).deep_link_id:null,r=z(G(n)).deep_link_id;return(r?z(G(r)).link:null)||r||t||e||n}class be{constructor(e){var t,r,i,s,o,a;const c=z(G(e)),l=(t=c.apiKey)!==null&&t!==void 0?t:null,d=(r=c.oobCode)!==null&&r!==void 0?r:null,f=Hi((i=c.mode)!==null&&i!==void 0?i:null);u(l&&d&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=d,this.continueUrl=(s=c.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=c.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const t=$i(e);try{return new be(t)}catch{return null}}}/**
901
+ */function Wi(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function ji(n){const e=G(K(n)).link,t=e?G(K(e)).deep_link_id:null,r=G(K(n)).deep_link_id;return(r?G(K(r)).link:null)||r||t||e||n}class Ee{constructor(e){var t,r,i,s,o,c;const a=G(K(e)),l=(t=a.apiKey)!==null&&t!==void 0?t:null,u=(r=a.oobCode)!==null&&r!==void 0?r:null,f=Wi((i=a.mode)!==null&&i!==void 0?i:null);d(l&&u&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=u,this.continueUrl=(s=a.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=a.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(c=a.tenantId)!==null&&c!==void 0?c:null}static parseLink(e){const t=ji(e);try{return new Ee(t)}catch{return null}}}/**
872
902
  * @license
873
903
  * Copyright 2020 Google LLC
874
904
  *
@@ -883,7 +913,7 @@
883
913
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
884
914
  * See the License for the specific language governing permissions and
885
915
  * limitations under the License.
886
- */class j{constructor(){this.providerId=j.PROVIDER_ID}static credential(e,t){return Q._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=be.parseLink(t);return u(r,"argument-error"),Q._fromEmailAndCode(e,r.code,r.tenantId)}}j.PROVIDER_ID="password";j.EMAIL_PASSWORD_SIGN_IN_METHOD="password";j.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
916
+ */class z{constructor(){this.providerId=z.PROVIDER_ID}static credential(e,t){return Z._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=Ee.parseLink(t);return d(r,"argument-error"),Z._fromEmailAndCode(e,r.code,r.tenantId)}}z.PROVIDER_ID="password";z.EMAIL_PASSWORD_SIGN_IN_METHOD="password";z.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
887
917
  * @license
888
918
  * Copyright 2020 Google LLC
889
919
  *
@@ -898,7 +928,7 @@
898
928
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
899
929
  * See the License for the specific language governing permissions and
900
930
  * limitations under the License.
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}}/**
931
+ */class cn{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
932
  * @license
903
933
  * Copyright 2019 Google LLC
904
934
  *
@@ -913,7 +943,7 @@
913
943
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
944
  * See the License for the specific language governing permissions and
915
945
  * limitations under the License.
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]}}/**
946
+ */class se extends cn{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
917
947
  * @license
918
948
  * Copyright 2020 Google LLC
919
949
  *
@@ -958,7 +988,7 @@
958
988
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
959
989
  * See the License for the specific language governing permissions and
960
990
  * limitations under the License.
961
- */class R extends se{constructor(){super("github.com")}static credential(e){return M._fromParams({providerId:R.PROVIDER_ID,signInMethod:R.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return R.credentialFromTaggedObject(e)}static credentialFromError(e){return R.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return R.credential(e.oauthAccessToken)}catch{return null}}}R.GITHUB_SIGN_IN_METHOD="github.com";R.PROVIDER_ID="github.com";/**
991
+ */class C extends se{constructor(){super("github.com")}static credential(e){return M._fromParams({providerId:C.PROVIDER_ID,signInMethod:C.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return C.credentialFromTaggedObject(e)}static credentialFromError(e){return C.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return C.credential(e.oauthAccessToken)}catch{return null}}}C.GITHUB_SIGN_IN_METHOD="github.com";C.PROVIDER_ID="github.com";/**
962
992
  * @license
963
993
  * Copyright 2020 Google LLC
964
994
  *
@@ -973,7 +1003,7 @@
973
1003
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
974
1004
  * See the License for the specific language governing permissions and
975
1005
  * limitations under the License.
976
- */class k extends se{constructor(){super("twitter.com")}static credential(e,t){return M._fromParams({providerId:k.PROVIDER_ID,signInMethod:k.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return k.credentialFromTaggedObject(e)}static credentialFromError(e){return k.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return k.credential(t,r)}catch{return null}}}k.TWITTER_SIGN_IN_METHOD="twitter.com";k.PROVIDER_ID="twitter.com";/**
1006
+ */class A extends se{constructor(){super("twitter.com")}static credential(e,t){return M._fromParams({providerId:A.PROVIDER_ID,signInMethod:A.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return A.credentialFromTaggedObject(e)}static credentialFromError(e){return A.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return A.credential(t,r)}catch{return null}}}A.TWITTER_SIGN_IN_METHOD="twitter.com";A.PROVIDER_ID="twitter.com";/**
977
1007
  * @license
978
1008
  * Copyright 2020 Google LLC
979
1009
  *
@@ -988,7 +1018,7 @@
988
1018
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
989
1019
  * See the License for the specific language governing permissions and
990
1020
  * limitations under the License.
991
- */class V{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await N._fromIdTokenResponse(e,r,i),o=Et(r);return new V({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=Et(r);return new V({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function Et(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
1021
+ */class W{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await D._fromIdTokenResponse(e,r,i),o=wt(r);return new W({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=wt(r);return new W({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function wt(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
992
1022
  * @license
993
1023
  * Copyright 2020 Google LLC
994
1024
  *
@@ -1003,7 +1033,7 @@
1003
1033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1004
1034
  * See the License for the specific language governing permissions and
1005
1035
  * 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 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)}/**
1036
+ */class _e extends P{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 ln(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 zi(n,e,t=!1){const r=await X(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return W._forOperation(n,"link",r)}/**
1007
1037
  * @license
1008
1038
  * Copyright 2019 Google LLC
1009
1039
  *
@@ -1018,7 +1048,7 @@
1018
1048
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1019
1049
  * See the License for the specific language governing permissions and
1020
1050
  * limitations under the License.
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}}/**
1051
+ */async function Gi(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=await X(n,ln(r,i,e,n),t);d(s.idToken,r,"internal-error");const o=qe(s.idToken);d(o,r,"internal-error");const{sub:c}=o;return d(n.uid===c,r,"user-mismatch"),W._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&m(r,"user-mismatch"),s}}/**
1022
1052
  * @license
1023
1053
  * Copyright 2020 Google LLC
1024
1054
  *
@@ -1033,7 +1063,7 @@
1033
1063
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
1064
  * See the License for the specific language governing permissions and
1035
1065
  * limitations under the License.
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";/**
1066
+ */async function dn(n,e,t=!1){const r="signIn",i=await ln(n,r,e),s=await W._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function Ki(n,e){return dn(ie(n),e)}function ao(n,e){const t=Ee.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}async function co(n,e,t){const r=O(n),i=z.credentialWithLink(e,t||ge());return d(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Ki(r,i)}function qi(n,e,t,r){return O(n).onIdTokenChanged(e,t,r)}function Ji(n,e,t){return O(n).beforeAuthStateChanged(e,t)}function lo(n,e,t,r){return O(n).onAuthStateChanged(e,t,r)}const Ie="__sak";/**
1037
1067
  * @license
1038
1068
  * Copyright 2019 Google LLC
1039
1069
  *
@@ -1048,7 +1078,7 @@
1048
1078
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1049
1079
  * See the License for the specific language governing permissions and
1050
1080
  * limitations under the License.
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()}}/**
1081
+ */class un{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
1082
  * @license
1053
1083
  * Copyright 2020 Google LLC
1054
1084
  *
@@ -1063,7 +1093,7 @@
1063
1093
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
1094
  * See the License for the specific language governing permissions and
1065
1095
  * limitations under the License.
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;/**
1096
+ */function Yi(){const n=p();return Je(n)||we(n)}const Xi=1e3,Qi=10;class hn extends un{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Yi()&&Ei(),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,c,a)=>{this.notifyListeners(o,a)});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);wi()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Qi):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)})},Xi)}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]}}hn.type="LOCAL";const Zi=hn;/**
1067
1097
  * @license
1068
1098
  * Copyright 2020 Google LLC
1069
1099
  *
@@ -1078,7 +1108,7 @@
1078
1108
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1079
1109
  * See the License for the specific language governing permissions and
1080
1110
  * limitations under the License.
1081
- */class mn extends pn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}mn.type="SESSION";const _n=mn;/**
1111
+ */class fn extends un{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}fn.type="SESSION";const pn=fn;/**
1082
1112
  * @license
1083
1113
  * Copyright 2019 Google LLC
1084
1114
  *
@@ -1093,7 +1123,7 @@
1093
1123
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1094
1124
  * See the License for the specific language governing permissions and
1095
1125
  * limitations under the License.
1096
- */function Xi(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1126
+ */function es(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1097
1127
  * @license
1098
1128
  * Copyright 2019 Google LLC
1099
1129
  *
@@ -1108,7 +1138,7 @@
1108
1138
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1109
1139
  * See the License for the specific language governing permissions and
1110
1140
  * limitations under the License.
1111
- */class we{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new we(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async l=>l(t.origin,s)),c=await Xi(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}we.receivers=[];/**
1141
+ */class be{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new be(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!o?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const c=Array.from(o).map(async l=>l(t.origin,s)),a=await es(c);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:a})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}be.receivers=[];/**
1112
1142
  * @license
1113
1143
  * Copyright 2020 Google LLC
1114
1144
  *
@@ -1138,7 +1168,7 @@
1138
1168
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1139
1169
  * See the License for the specific language governing permissions and
1140
1170
  * limitations under the License.
1141
- */class Qi{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const l=Xe("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const g=f;if(g.data.eventId===l)switch(g.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(g.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1171
+ */class ts{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((c,a)=>{const l=Xe("",20);i.port1.start();const u=setTimeout(()=>{a(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const g=f;if(g.data.eventId===l)switch(g.data.status){case"ack":clearTimeout(u),s=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(g.data.response);break;default:clearTimeout(u),clearTimeout(s),a(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1142
1172
  * @license
1143
1173
  * Copyright 2020 Google LLC
1144
1174
  *
@@ -1153,7 +1183,7 @@
1153
1183
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1154
1184
  * See the License for the specific language governing permissions and
1155
1185
  * limitations under the License.
1156
- */function I(){return window}function Zi(n){I().location.href=n}/**
1186
+ */function I(){return window}function ns(n){I().location.href=n}/**
1157
1187
  * @license
1158
1188
  * Copyright 2020 Google LLC.
1159
1189
  *
@@ -1168,7 +1198,7 @@
1168
1198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1169
1199
  * See the License for the specific language governing permissions and
1170
1200
  * limitations under the License.
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}/**
1201
+ */function gn(){return typeof I().WorkerGlobalScope<"u"&&typeof I().importScripts=="function"}async function rs(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function is(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function ss(){return gn()?self:null}/**
1172
1202
  * @license
1173
1203
  * Copyright 2019 Google LLC
1174
1204
  *
@@ -1183,7 +1213,7 @@
1183
1213
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1184
1214
  * See the License for the specific language governing permissions and
1185
1215
  * limitations under the License.
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);/**
1216
+ */const mn="firebaseLocalStorageDb",os=1,ve="firebaseLocalStorage",_n="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 as(){const n=indexedDB.deleteDatabase(mn);return new oe(n).toPromise()}function $e(){const n=indexedDB.open(mn,os);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(ve,{keyPath:_n})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(ve)?e(r):(r.close(),await as(),e(await $e()))})})}async function Et(n,e,t){const r=Te(n,!0).put({[_n]:e,value:t});return new oe(r).toPromise()}async function cs(n,e){const t=Te(n,!1).get(e),r=await new oe(t).toPromise();return r===void 0?null:r.value}function bt(n,e){const t=Te(n,!0).delete(e);return new oe(t).toPromise()}const ls=800,ds=3;class In{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await $e(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>ds)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return gn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=be._getInstance(ss()),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 rs(),!this.activeServiceWorker)return;this.sender=new ts(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||is()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await $e();return await Et(e,Ie,"1"),await bt(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=>Et(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>cs(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>bt(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(),ls)}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()}}In.type="LOCAL";const us=In;new re(3e4,6e4);/**
1187
1217
  * @license
1188
1218
  * Copyright 2021 Google LLC
1189
1219
  *
@@ -1198,7 +1228,7 @@
1198
1228
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1199
1229
  * See the License for the specific language governing permissions and
1200
1230
  * limitations under the License.
1201
- */function ls(n,e){return e?E(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1231
+ */function hs(n,e){return e?w(e):(d(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1202
1232
  * @license
1203
1233
  * Copyright 2019 Google LLC
1204
1234
  *
@@ -1213,7 +1243,7 @@
1213
1243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
1244
  * See the License for the specific language governing permissions and
1215
1245
  * 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 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)}/**
1246
+ */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 fs(n){return dn(n.auth,new Qe(n),n.bypassAuthState)}function ps(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),Gi(t,new Qe(n),n.bypassAuthState)}async function gs(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),zi(t,new Qe(n),n.bypassAuthState)}/**
1217
1247
  * @license
1218
1248
  * Copyright 2020 Google LLC
1219
1249
  *
@@ -1228,7 +1258,7 @@
1228
1258
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1229
1259
  * See the License for the specific language governing permissions and
1230
1260
  * limitations under the License.
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()}}/**
1261
+ */class vn{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:c}=e;if(o){this.reject(o);return}const a={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(c)(a))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return fs;case"linkViaPopup":case"linkViaRedirect":return gs;case"reauthViaPopup":case"reauthViaRedirect":return ps;default:m(this.auth,"internal-error")}}resolve(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1232
1262
  * @license
1233
1263
  * Copyright 2020 Google LLC
1234
1264
  *
@@ -1243,7 +1273,7 @@
1243
1273
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1244
1274
  * See the License for the specific language governing permissions and
1245
1275
  * limitations under the License.
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;/**
1276
+ */const ms=new re(2e3,1e4);class B extends vn{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 d(e,this.auth,"internal-error"),e}async onExecution(){E(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,ms.get())};e()}}B.currentPopupAction=null;/**
1247
1277
  * @license
1248
1278
  * Copyright 2020 Google LLC
1249
1279
  *
@@ -1258,7 +1288,7 @@
1258
1288
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1259
1289
  * See the License for the specific language governing permissions and
1260
1290
  * limitations under the License.
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}/**
1291
+ */const _s="pendingRedirect",de=new Map;class Is extends vn{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=de.get(this.auth._key());if(!e){try{const r=await vs(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}de.set(this.auth._key(),e)}return this.bypassAuthState||de.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 vs(n,e){const t=Es(e),r=ws(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}function ys(n,e){de.set(n._key(),e)}function ws(n){return w(n._redirectPersistence)}function Es(n){return le(_s,n.config.apiKey,n.name)}async function bs(n,e,t=!1){const r=ie(n),i=hs(r,e),o=await new Is(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1262
1292
  * @license
1263
1293
  * Copyright 2020 Google LLC
1264
1294
  *
@@ -1273,7 +1303,7 @@
1273
1303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1274
1304
  * See the License for the specific language governing permissions and
1275
1305
  * 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&&!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}}/**
1306
+ */const Ts=10*60*1e3;class Ss{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||!Cs(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!yn(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>=Ts&&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 yn({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function Cs(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return yn(n);default:return!1}}/**
1277
1307
  * @license
1278
1308
  * Copyright 2020 Google LLC
1279
1309
  *
@@ -1288,7 +1318,7 @@
1288
1318
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1289
1319
  * See the License for the specific language governing permissions and
1290
1320
  * limitations under the License.
1291
- */async function Ts(n,e={}){return W(n,"GET","/v1/projects",e)}/**
1321
+ */async function As(n,e={}){return U(n,"GET","/v1/projects",e)}/**
1292
1322
  * @license
1293
1323
  * Copyright 2020 Google LLC
1294
1324
  *
@@ -1303,7 +1333,7 @@
1303
1333
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304
1334
  * See the License for the specific language governing permissions and
1305
1335
  * limitations under the License.
1306
- */const Ss=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Rs=/^https?/;async function ks(n){if(n.config.emulator)return;const{authorizedDomains:e}=await Ts(n);for(const t of e)try{if(As(t))return}catch{}m(n,"unauthorized-domain")}function As(n){const e=ge(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!Rs.test(t))return!1;if(Ss.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1336
+ */const Rs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ks=/^https?/;async function Ps(n){if(n.config.emulator)return;const{authorizedDomains:e}=await As(n);for(const t of e)try{if(Os(t))return}catch{}m(n,"unauthorized-domain")}function Os(n){const e=ge(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!ks.test(t))return!1;if(Rs.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1307
1337
  * @license
1308
1338
  * Copyright 2020 Google LLC.
1309
1339
  *
@@ -1318,7 +1348,7 @@
1318
1348
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1319
1349
  * See the License for the specific language governing permissions and
1320
1350
  * 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"))},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}/**
1351
+ */const Ns=new re(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 Ds(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:Ns.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 c=ki("iframefcb");return I()[c]=()=>{gapi.load?o():t(_(n,"network-request-failed"))},on(`https://apis.google.com/js/api.js?onload=${c}`).catch(a=>t(a))}}).catch(e=>{throw ue=null,e})}let ue=null;function Ls(n){return ue=ue||Ds(n),ue}/**
1322
1352
  * @license
1323
1353
  * Copyright 2020 Google LLC.
1324
1354
  *
@@ -1333,7 +1363,7 @@
1333
1363
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1334
1364
  * See the License for the specific language governing permissions and
1335
1365
  * limitations under the License.
1336
- */const Ds=new ne(5e3,15e3),Ns="__/auth/iframe",Ls="emulator/auth/iframe",Ms={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Us=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Bs(n){const e=n.config;u(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Ke(e,Ls):`https://${n.config.authDomain}/${Ns}`,r={apiKey:e.apiKey,appName:n.name,v:te},i=Us.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ee(r).slice(1)}`}async function xs(n){const e=await Ps(n),t=I().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:Bs(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Ms,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=_(n,"network-request-failed"),a=I().setTimeout(()=>{s(o)},Ds.get());function c(){I().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1366
+ */const Ms=new re(5e3,15e3),Us="__/auth/iframe",xs="emulator/auth/iframe",Bs={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Fs=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Vs(n){const e=n.config;d(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Ke(e,xs):`https://${n.config.authDomain}/${Us}`,r={apiKey:e.apiKey,appName:n.name,v:ne},i=Fs.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${te(r).slice(1)}`}async function Hs(n){const e=await Ls(n),t=I().gapi;return d(t,n,"internal-error"),e.open({where:document.body,url:Vs(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Bs,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=_(n,"network-request-failed"),c=I().setTimeout(()=>{s(o)},Ms.get());function a(){I().clearTimeout(c),i(r)}r.ping(a).then(a,()=>{s(o)})}))}/**
1337
1367
  * @license
1338
1368
  * Copyright 2020 Google LLC.
1339
1369
  *
@@ -1348,7 +1378,7 @@
1348
1378
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1349
1379
  * See the License for the specific language governing permissions and
1350
1380
  * 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=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)}/**
1381
+ */const $s={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Ws=500,js=600,zs="_blank",Gs="http://localhost";class Ct{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Ks(n,e,t,r=Ws,i=js){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const a=Object.assign(Object.assign({},$s),{width:r.toString(),height:i.toString(),top:s,left:o}),l=p().toLowerCase();t&&(c=Qt(l)?zs:t),Xt(l)&&(e=e||Gs,a.scrollbars="yes");const u=Object.entries(a).reduce((g,[v,x])=>`${g}${v}=${x},`,"");if(yi(l)&&c!=="_self")return qs(e||"",c),new Ct(null);const f=window.open(e||"",c,u);d(f,n,"popup-blocked");try{f.focus()}catch{}return new Ct(f)}function qs(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
1382
  * @license
1353
1383
  * Copyright 2021 Google LLC
1354
1384
  *
@@ -1363,7 +1393,7 @@
1363
1393
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1364
1394
  * See the License for the specific language governing permissions and
1365
1395
  * 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 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}`}/**
1396
+ */const Js="__/auth/handler",Ys="emulator/auth/handler",Xs=encodeURIComponent("fac");async function At(n,e,t,r,i,s){d(n.config.authDomain,n,"auth-domain-config-required"),d(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:ne,eventId:i};if(e instanceof cn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",Hn(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,f]of Object.entries(s||{}))o[u]=f}if(e instanceof se){const u=e.getScopes().filter(f=>f!=="");u.length>0&&(o.scopes=u.join(","))}n.tenantId&&(o.tid=n.tenantId);const c=o;for(const u of Object.keys(c))c[u]===void 0&&delete c[u];const a=await n._getAppCheckToken(),l=a?`#${Xs}=${encodeURIComponent(a)}`:"";return`${Qs(n)}?${te(c).slice(1)}${l}`}function Qs({config:n}){return n.emulator?Ke(n,Ys):`https://${n.authDomain}/${Js}`}/**
1367
1397
  * @license
1368
1398
  * Copyright 2020 Google LLC
1369
1399
  *
@@ -1378,7 +1408,7 @@
1378
1408
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1379
1409
  * See the License for the specific language governing permissions and
1380
1410
  * limitations under the License.
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="1.1.0";/**
1411
+ */const Ue="webStorageSupport";class Zs{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=pn,this._completeRedirectFn=bs,this._overrideRedirectResult=ys}async _openPopup(e,t,r,i){var s;E((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await At(e,t,r,ge(),i);return Ks(e,o,Xe())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await At(e,t,r,ge(),i);return ns(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):(E(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Hs(e),r=new Ss(e);return t.register("authEvent",i=>(d(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]=Ps(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return rn()||Je()||we()}}const eo=Zs;var Rt="@firebase/auth",kt="1.3.0";/**
1382
1412
  * @license
1383
1413
  * Copyright 2020 Google LLC
1384
1414
  *
@@ -1393,7 +1423,7 @@
1393
1423
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394
1424
  * See the License for the specific language governing permissions and
1395
1425
  * limitations under the License.
1396
- */class Qs{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1426
+ */class to{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){d(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1397
1427
  * @license
1398
1428
  * Copyright 2020 Google LLC
1399
1429
  *
@@ -1408,7 +1438,7 @@
1408
1438
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1409
1439
  * See the License for the specific language governing permissions and
1410
1440
  * 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});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")}/**
1441
+ */function no(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function ro(n){J(new $("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:c}=r.options;d(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const a={apiKey:o,authDomain:c,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:sn(n)},l=new Ai(r,i,s,a);return Mi(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),J(new $("auth-internal",e=>{const t=ie(e.getProvider("auth").getImmediate());return(r=>new to(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),F(Rt,kt,no(n)),F(Rt,kt,"esm2017")}/**
1412
1442
  * @license
1413
1443
  * Copyright 2021 Google LLC
1414
1444
  *
@@ -1423,4 +1453,4 @@
1423
1453
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1424
1454
  * See the License for the specific language governing permissions and
1425
1455
  * limitations under the License.
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};
1456
+ */const io=5*60,so=Ut("authIdTokenMaxAge")||io;let Pt=null;const oo=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>so)return;const i=t?.token;Pt!==i&&(Pt=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function uo(n=Hr()){const e=Vt(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Li(n,{popupRedirectResolver:eo,persistence:[us,Zi,pn]}),r=Ut("authTokenSyncURL");if(r){const s=oo(r);Ji(t,s,()=>s(t.currentUser)),qi(t,o=>s(o))}const i=Pn("auth");return i&&Ui(t,`http://${i}`),t}ro("Browser");const ho=Ht(window.$firebaseConfig);export{ho as default,ho as firebaseApp,uo as getAuth,ao as isSignInWithEmailLink,lo as onAuthStateChanged,co as signInWithEmailLink};