@feedmepos/mf-financing 0.0.2

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 (54) hide show
  1. package/README.md +11 -0
  2. package/dist/App.vue.d.ts +2 -0
  3. package/dist/Entry.vue.d.ts +2 -0
  4. package/dist/Financing-6bpYBvrC.js +14 -0
  5. package/dist/Forbidden-Dqw0MqyC.js +37 -0
  6. package/dist/api/index.d.ts +50 -0
  7. package/dist/api/pagination.d.ts +20 -0
  8. package/dist/api/restaurant/index.d.ts +6 -0
  9. package/dist/app.d.ts +13 -0
  10. package/dist/app.js +3687 -0
  11. package/dist/assets/icons/index.d.ts +21 -0
  12. package/dist/components/AdminLayout.vue.d.ts +21 -0
  13. package/dist/components/AsyncButton.vue.d.ts +21 -0
  14. package/dist/components/AutoCopyCell.vue.d.ts +6 -0
  15. package/dist/components/CursorTable/FmTableSelection.vue.d.ts +13 -0
  16. package/dist/components/CursorTable/index.vue.d.ts +64 -0
  17. package/dist/components/DateRangePicker.vue.d.ts +13 -0
  18. package/dist/components/ImagePreview.vue.d.ts +13 -0
  19. package/dist/components/Layout.vue.d.ts +21 -0
  20. package/dist/components/Modal.d.ts +3 -0
  21. package/dist/components/PDFViewer.vue.d.ts +25 -0
  22. package/dist/components/PagingTable/FmTableSelection.vue.d.ts +13 -0
  23. package/dist/components/PagingTable/index.vue.d.ts +48 -0
  24. package/dist/components/RestaurantSelector.vue.d.ts +2 -0
  25. package/dist/components/RouteCell.vue.d.ts +7 -0
  26. package/dist/components/SelectAll.vue.d.ts +57 -0
  27. package/dist/composable/loading/index.d.ts +8 -0
  28. package/dist/composable/query/index.d.ts +2 -0
  29. package/dist/helpers/clipboard.d.ts +1 -0
  30. package/dist/helpers/date.d.ts +22 -0
  31. package/dist/helpers/db.d.ts +2 -0
  32. package/dist/helpers/dinero.d.ts +2 -0
  33. package/dist/helpers/error.d.ts +1 -0
  34. package/dist/helpers/export.d.ts +12 -0
  35. package/dist/helpers/grafana.d.ts +8 -0
  36. package/dist/helpers/idToDate.d.ts +1 -0
  37. package/dist/helpers/iteration.d.ts +15 -0
  38. package/dist/helpers/number.d.ts +22 -0
  39. package/dist/helpers/object.d.ts +1 -0
  40. package/dist/helpers/string.d.ts +12 -0
  41. package/dist/helpers/time.d.ts +7 -0
  42. package/dist/helpers/validator.d.ts +4 -0
  43. package/dist/i18n.d.ts +10 -0
  44. package/dist/main.d.ts +1 -0
  45. package/dist/model/pagination.d.ts +14 -0
  46. package/dist/modules.d.ts +1 -0
  47. package/dist/package.json +101 -0
  48. package/dist/plugins.d.ts +37 -0
  49. package/dist/router/index.d.ts +13 -0
  50. package/dist/stores/iframe.d.ts +14 -0
  51. package/dist/tsconfig.app.tsbuildinfo +1 -0
  52. package/dist/views/Financing.vue.d.ts +2 -0
  53. package/dist/views/Forbidden.vue.d.ts +2 -0
  54. package/package.json +101 -0
package/dist/app.js ADDED
@@ -0,0 +1,3687 @@
1
+ import { createRouter as ht, createWebHistory as dt, useRoute as ut } from "vue-router";
2
+ import { computed as ft, defineComponent as pt, onMounted as mt, resolveComponent as gt, openBlock as _t, createBlock as bt, unref as vt } from "vue";
3
+ import { defineStore as It } from "pinia";
4
+ import { useCoreStore as yt } from "@feedmepos/mf-common";
5
+ const Et = {}, wt = {
6
+ financing: Et
7
+ }, St = {}, At = {
8
+ financing: St
9
+ }, Tt = ht({
10
+ history: dt(),
11
+ routes: [
12
+ {
13
+ path: "/",
14
+ name: "mf-financing",
15
+ component: () => import("./Financing-6bpYBvrC.js")
16
+ },
17
+ {
18
+ path: "/forbidden",
19
+ name: "mf-financing-forbidden",
20
+ component: () => import("./Forbidden-Dqw0MqyC.js")
21
+ }
22
+ ]
23
+ }), Ct = It("mf-financing-iframe", () => {
24
+ const r = {
25
+ isIframe: !1
26
+ }, e = ft(() => r);
27
+ function t(n) {
28
+ r.isIframe = n;
29
+ }
30
+ return {
31
+ state: e,
32
+ init: t
33
+ };
34
+ });
35
+ /**
36
+ * @license
37
+ * Copyright 2017 Google LLC
38
+ *
39
+ * Licensed under the Apache License, Version 2.0 (the "License");
40
+ * you may not use this file except in compliance with the License.
41
+ * You may obtain a copy of the License at
42
+ *
43
+ * http://www.apache.org/licenses/LICENSE-2.0
44
+ *
45
+ * Unless required by applicable law or agreed to in writing, software
46
+ * distributed under the License is distributed on an "AS IS" BASIS,
47
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48
+ * See the License for the specific language governing permissions and
49
+ * limitations under the License.
50
+ */
51
+ /**
52
+ * @license
53
+ * Copyright 2017 Google LLC
54
+ *
55
+ * Licensed under the Apache License, Version 2.0 (the "License");
56
+ * you may not use this file except in compliance with the License.
57
+ * You may obtain a copy of the License at
58
+ *
59
+ * http://www.apache.org/licenses/LICENSE-2.0
60
+ *
61
+ * Unless required by applicable law or agreed to in writing, software
62
+ * distributed under the License is distributed on an "AS IS" BASIS,
63
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64
+ * See the License for the specific language governing permissions and
65
+ * limitations under the License.
66
+ */
67
+ const Be = function(r) {
68
+ const e = [];
69
+ let t = 0;
70
+ for (let n = 0; n < r.length; n++) {
71
+ let i = r.charCodeAt(n);
72
+ i < 128 ? e[t++] = i : i < 2048 ? (e[t++] = i >> 6 | 192, e[t++] = i & 63 | 128) : (i & 64512) === 55296 && n + 1 < r.length && (r.charCodeAt(n + 1) & 64512) === 56320 ? (i = 65536 + ((i & 1023) << 10) + (r.charCodeAt(++n) & 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);
73
+ }
74
+ return e;
75
+ }, Nt = function(r) {
76
+ const e = [];
77
+ let t = 0, n = 0;
78
+ for (; t < r.length; ) {
79
+ const i = r[t++];
80
+ if (i < 128)
81
+ e[n++] = String.fromCharCode(i);
82
+ else if (i > 191 && i < 224) {
83
+ const s = r[t++];
84
+ e[n++] = String.fromCharCode((i & 31) << 6 | s & 63);
85
+ } else if (i > 239 && i < 365) {
86
+ const s = r[t++], a = r[t++], c = r[t++], o = ((i & 7) << 18 | (s & 63) << 12 | (a & 63) << 6 | c & 63) - 65536;
87
+ e[n++] = String.fromCharCode(55296 + (o >> 10)), e[n++] = String.fromCharCode(56320 + (o & 1023));
88
+ } else {
89
+ const s = r[t++], a = r[t++];
90
+ e[n++] = String.fromCharCode((i & 15) << 12 | (s & 63) << 6 | a & 63);
91
+ }
92
+ }
93
+ return e.join("");
94
+ }, xe = {
95
+ /**
96
+ * Maps bytes to characters.
97
+ */
98
+ byteToCharMap_: null,
99
+ /**
100
+ * Maps characters to bytes.
101
+ */
102
+ charToByteMap_: null,
103
+ /**
104
+ * Maps bytes to websafe characters.
105
+ * @private
106
+ */
107
+ byteToCharMapWebSafe_: null,
108
+ /**
109
+ * Maps websafe characters to bytes.
110
+ * @private
111
+ */
112
+ charToByteMapWebSafe_: null,
113
+ /**
114
+ * Our default alphabet, shared between
115
+ * ENCODED_VALS and ENCODED_VALS_WEBSAFE
116
+ */
117
+ ENCODED_VALS_BASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
118
+ /**
119
+ * Our default alphabet. Value 64 (=) is special; it means "nothing."
120
+ */
121
+ get ENCODED_VALS() {
122
+ return this.ENCODED_VALS_BASE + "+/=";
123
+ },
124
+ /**
125
+ * Our websafe alphabet.
126
+ */
127
+ get ENCODED_VALS_WEBSAFE() {
128
+ return this.ENCODED_VALS_BASE + "-_.";
129
+ },
130
+ /**
131
+ * Whether this browser supports the atob and btoa functions. This extension
132
+ * started at Mozilla but is now implemented by many browsers. We use the
133
+ * ASSUME_* variables to avoid pulling in the full useragent detection library
134
+ * but still allowing the standard per-browser compilations.
135
+ *
136
+ */
137
+ HAS_NATIVE_SUPPORT: typeof atob == "function",
138
+ /**
139
+ * Base64-encode an array of bytes.
140
+ *
141
+ * @param input An array of bytes (numbers with
142
+ * value in [0, 255]) to encode.
143
+ * @param webSafe Boolean indicating we should use the
144
+ * alternative alphabet.
145
+ * @return The base64 encoded string.
146
+ */
147
+ encodeByteArray(r, e) {
148
+ if (!Array.isArray(r))
149
+ throw Error("encodeByteArray takes an array as a parameter");
150
+ this.init_();
151
+ const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, n = [];
152
+ for (let i = 0; i < r.length; i += 3) {
153
+ const s = r[i], a = i + 1 < r.length, c = a ? r[i + 1] : 0, o = i + 2 < r.length, l = o ? r[i + 2] : 0, u = s >> 2, f = (s & 3) << 4 | c >> 4;
154
+ let v = (c & 15) << 2 | l >> 6, I = l & 63;
155
+ o || (I = 64, a || (v = 64)), n.push(t[u], t[f], t[v], t[I]);
156
+ }
157
+ return n.join("");
158
+ },
159
+ /**
160
+ * Base64-encode a string.
161
+ *
162
+ * @param input A string to encode.
163
+ * @param webSafe If true, we should use the
164
+ * alternative alphabet.
165
+ * @return The base64 encoded string.
166
+ */
167
+ encodeString(r, e) {
168
+ return this.HAS_NATIVE_SUPPORT && !e ? btoa(r) : this.encodeByteArray(Be(r), e);
169
+ },
170
+ /**
171
+ * Base64-decode a string.
172
+ *
173
+ * @param input to decode.
174
+ * @param webSafe True if we should use the
175
+ * alternative alphabet.
176
+ * @return string representing the decoded value.
177
+ */
178
+ decodeString(r, e) {
179
+ return this.HAS_NATIVE_SUPPORT && !e ? atob(r) : Nt(this.decodeStringToByteArray(r, e));
180
+ },
181
+ /**
182
+ * Base64-decode a string.
183
+ *
184
+ * In base-64 decoding, groups of four characters are converted into three
185
+ * bytes. If the encoder did not apply padding, the input length may not
186
+ * be a multiple of 4.
187
+ *
188
+ * In this case, the last group will have fewer than 4 characters, and
189
+ * padding will be inferred. If the group has one or two characters, it decodes
190
+ * to one byte. If the group has three characters, it decodes to two bytes.
191
+ *
192
+ * @param input Input to decode.
193
+ * @param webSafe True if we should use the web-safe alphabet.
194
+ * @return bytes representing the decoded value.
195
+ */
196
+ decodeStringToByteArray(r, e) {
197
+ this.init_();
198
+ const t = e ? this.charToByteMapWebSafe_ : this.charToByteMap_, n = [];
199
+ for (let i = 0; i < r.length; ) {
200
+ const s = t[r.charAt(i++)], c = i < r.length ? t[r.charAt(i)] : 0;
201
+ ++i;
202
+ const l = i < r.length ? t[r.charAt(i)] : 64;
203
+ ++i;
204
+ const f = i < r.length ? t[r.charAt(i)] : 64;
205
+ if (++i, s == null || c == null || l == null || f == null)
206
+ throw new Dt();
207
+ const v = s << 2 | c >> 4;
208
+ if (n.push(v), l !== 64) {
209
+ const I = c << 4 & 240 | l >> 2;
210
+ if (n.push(I), f !== 64) {
211
+ const M = l << 6 & 192 | f;
212
+ n.push(M);
213
+ }
214
+ }
215
+ }
216
+ return n;
217
+ },
218
+ /**
219
+ * Lazy static initialization function. Called before
220
+ * accessing any of the static map variables.
221
+ * @private
222
+ */
223
+ init_() {
224
+ if (!this.byteToCharMap_) {
225
+ this.byteToCharMap_ = {}, this.charToByteMap_ = {}, this.byteToCharMapWebSafe_ = {}, this.charToByteMapWebSafe_ = {};
226
+ for (let r = 0; r < this.ENCODED_VALS.length; r++)
227
+ this.byteToCharMap_[r] = this.ENCODED_VALS.charAt(r), this.charToByteMap_[this.byteToCharMap_[r]] = r, this.byteToCharMapWebSafe_[r] = this.ENCODED_VALS_WEBSAFE.charAt(r), this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[r]] = r, r >= this.ENCODED_VALS_BASE.length && (this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(r)] = r, this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(r)] = r);
228
+ }
229
+ }
230
+ };
231
+ class Dt extends Error {
232
+ constructor() {
233
+ super(...arguments), this.name = "DecodeBase64StringError";
234
+ }
235
+ }
236
+ const Ot = function(r) {
237
+ const e = Be(r);
238
+ return xe.encodeByteArray(e, !0);
239
+ }, Fe = function(r) {
240
+ return Ot(r).replace(/\./g, "");
241
+ }, $e = function(r) {
242
+ try {
243
+ return xe.decodeString(r, !0);
244
+ } catch (e) {
245
+ console.error("base64Decode failed: ", e);
246
+ }
247
+ return null;
248
+ };
249
+ /**
250
+ * @license
251
+ * Copyright 2022 Google LLC
252
+ *
253
+ * Licensed under the Apache License, Version 2.0 (the "License");
254
+ * you may not use this file except in compliance with the License.
255
+ * You may obtain a copy of the License at
256
+ *
257
+ * http://www.apache.org/licenses/LICENSE-2.0
258
+ *
259
+ * Unless required by applicable law or agreed to in writing, software
260
+ * distributed under the License is distributed on an "AS IS" BASIS,
261
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
262
+ * See the License for the specific language governing permissions and
263
+ * limitations under the License.
264
+ */
265
+ function kt() {
266
+ if (typeof self < "u")
267
+ return self;
268
+ if (typeof window < "u")
269
+ return window;
270
+ if (typeof global < "u")
271
+ return global;
272
+ throw new Error("Unable to locate global object.");
273
+ }
274
+ /**
275
+ * @license
276
+ * Copyright 2022 Google LLC
277
+ *
278
+ * Licensed under the Apache License, Version 2.0 (the "License");
279
+ * you may not use this file except in compliance with the License.
280
+ * You may obtain a copy of the License at
281
+ *
282
+ * http://www.apache.org/licenses/LICENSE-2.0
283
+ *
284
+ * Unless required by applicable law or agreed to in writing, software
285
+ * distributed under the License is distributed on an "AS IS" BASIS,
286
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
287
+ * See the License for the specific language governing permissions and
288
+ * limitations under the License.
289
+ */
290
+ const Pt = () => kt().__FIREBASE_DEFAULTS__, Rt = () => {
291
+ if (typeof process > "u" || typeof process.env > "u")
292
+ return;
293
+ const r = process.env.__FIREBASE_DEFAULTS__;
294
+ if (r)
295
+ return JSON.parse(r);
296
+ }, Lt = () => {
297
+ if (typeof document > "u")
298
+ return;
299
+ let r;
300
+ try {
301
+ r = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/);
302
+ } catch {
303
+ return;
304
+ }
305
+ const e = r && $e(r[1]);
306
+ return e && JSON.parse(e);
307
+ }, Ve = () => {
308
+ try {
309
+ return Pt() || Rt() || Lt();
310
+ } catch (r) {
311
+ console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${r}`);
312
+ return;
313
+ }
314
+ }, Ut = () => {
315
+ var r;
316
+ return (r = Ve()) === null || r === void 0 ? void 0 : r.config;
317
+ }, Mt = (r) => {
318
+ var e;
319
+ return (e = Ve()) === null || e === void 0 ? void 0 : e[`_${r}`];
320
+ };
321
+ /**
322
+ * @license
323
+ * Copyright 2017 Google LLC
324
+ *
325
+ * Licensed under the Apache License, Version 2.0 (the "License");
326
+ * you may not use this file except in compliance with the License.
327
+ * You may obtain a copy of the License at
328
+ *
329
+ * http://www.apache.org/licenses/LICENSE-2.0
330
+ *
331
+ * Unless required by applicable law or agreed to in writing, software
332
+ * distributed under the License is distributed on an "AS IS" BASIS,
333
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
334
+ * See the License for the specific language governing permissions and
335
+ * limitations under the License.
336
+ */
337
+ class Bt {
338
+ constructor() {
339
+ this.reject = () => {
340
+ }, this.resolve = () => {
341
+ }, this.promise = new Promise((e, t) => {
342
+ this.resolve = e, this.reject = t;
343
+ });
344
+ }
345
+ /**
346
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
347
+ * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
348
+ * and returns a node-style callback which will resolve or reject the Deferred's promise.
349
+ */
350
+ wrapCallback(e) {
351
+ return (t, n) => {
352
+ t ? this.reject(t) : this.resolve(n), typeof e == "function" && (this.promise.catch(() => {
353
+ }), e.length === 1 ? e(t) : e(t, n));
354
+ };
355
+ }
356
+ }
357
+ /**
358
+ * @license
359
+ * Copyright 2017 Google LLC
360
+ *
361
+ * Licensed under the Apache License, Version 2.0 (the "License");
362
+ * you may not use this file except in compliance with the License.
363
+ * You may obtain a copy of the License at
364
+ *
365
+ * http://www.apache.org/licenses/LICENSE-2.0
366
+ *
367
+ * Unless required by applicable law or agreed to in writing, software
368
+ * distributed under the License is distributed on an "AS IS" BASIS,
369
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
370
+ * See the License for the specific language governing permissions and
371
+ * limitations under the License.
372
+ */
373
+ function p() {
374
+ return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
375
+ }
376
+ function xt() {
377
+ return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
378
+ // just to deal with this case would probably be a bad idea.
379
+ !!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p());
380
+ }
381
+ function Ft() {
382
+ return typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers";
383
+ }
384
+ function $t() {
385
+ const r = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
386
+ return typeof r == "object" && r.id !== void 0;
387
+ }
388
+ function Vt() {
389
+ return typeof navigator == "object" && navigator.product === "ReactNative";
390
+ }
391
+ function Ht() {
392
+ try {
393
+ return typeof indexedDB == "object";
394
+ } catch {
395
+ return !1;
396
+ }
397
+ }
398
+ function zt() {
399
+ return new Promise((r, e) => {
400
+ try {
401
+ let t = !0;
402
+ const n = "validate-browser-context-for-indexeddb-analytics-module", i = self.indexedDB.open(n);
403
+ i.onsuccess = () => {
404
+ i.result.close(), t || self.indexedDB.deleteDatabase(n), r(!0);
405
+ }, i.onupgradeneeded = () => {
406
+ t = !1;
407
+ }, i.onerror = () => {
408
+ var s;
409
+ e(((s = i.error) === null || s === void 0 ? void 0 : s.message) || "");
410
+ };
411
+ } catch (t) {
412
+ e(t);
413
+ }
414
+ });
415
+ }
416
+ /**
417
+ * @license
418
+ * Copyright 2017 Google LLC
419
+ *
420
+ * Licensed under the Apache License, Version 2.0 (the "License");
421
+ * you may not use this file except in compliance with the License.
422
+ * You may obtain a copy of the License at
423
+ *
424
+ * http://www.apache.org/licenses/LICENSE-2.0
425
+ *
426
+ * Unless required by applicable law or agreed to in writing, software
427
+ * distributed under the License is distributed on an "AS IS" BASIS,
428
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
429
+ * See the License for the specific language governing permissions and
430
+ * limitations under the License.
431
+ */
432
+ const jt = "FirebaseError";
433
+ class S extends Error {
434
+ constructor(e, t, n) {
435
+ super(t), this.code = e, this.customData = n, this.name = jt, Object.setPrototypeOf(this, S.prototype), Error.captureStackTrace && Error.captureStackTrace(this, L.prototype.create);
436
+ }
437
+ }
438
+ class L {
439
+ constructor(e, t, n) {
440
+ this.service = e, this.serviceName = t, this.errors = n;
441
+ }
442
+ create(e, ...t) {
443
+ const n = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], a = s ? Wt(s, n) : "Error", c = `${this.serviceName}: ${a} (${i}).`;
444
+ return new S(i, c, n);
445
+ }
446
+ }
447
+ function Wt(r, e) {
448
+ return r.replace(Gt, (t, n) => {
449
+ const i = e[n];
450
+ return i != null ? String(i) : `<${n}?>`;
451
+ });
452
+ }
453
+ const Gt = /\{\$([^}]+)}/g;
454
+ function re(r, e) {
455
+ if (r === e)
456
+ return !0;
457
+ const t = Object.keys(r), n = Object.keys(e);
458
+ for (const i of t) {
459
+ if (!n.includes(i))
460
+ return !1;
461
+ const s = r[i], a = e[i];
462
+ if (ve(s) && ve(a)) {
463
+ if (!re(s, a))
464
+ return !1;
465
+ } else if (s !== a)
466
+ return !1;
467
+ }
468
+ for (const i of n)
469
+ if (!t.includes(i))
470
+ return !1;
471
+ return !0;
472
+ }
473
+ function ve(r) {
474
+ return r !== null && typeof r == "object";
475
+ }
476
+ /**
477
+ * @license
478
+ * Copyright 2017 Google LLC
479
+ *
480
+ * Licensed under the Apache License, Version 2.0 (the "License");
481
+ * you may not use this file except in compliance with the License.
482
+ * You may obtain a copy of the License at
483
+ *
484
+ * http://www.apache.org/licenses/LICENSE-2.0
485
+ *
486
+ * Unless required by applicable law or agreed to in writing, software
487
+ * distributed under the License is distributed on an "AS IS" BASIS,
488
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
489
+ * See the License for the specific language governing permissions and
490
+ * limitations under the License.
491
+ */
492
+ function He(r) {
493
+ const e = [];
494
+ for (const [t, n] of Object.entries(r))
495
+ Array.isArray(n) ? n.forEach((i) => {
496
+ e.push(encodeURIComponent(t) + "=" + encodeURIComponent(i));
497
+ }) : e.push(encodeURIComponent(t) + "=" + encodeURIComponent(n));
498
+ return e.length ? "&" + e.join("&") : "";
499
+ }
500
+ function Kt(r, e) {
501
+ const t = new Jt(r, e);
502
+ return t.subscribe.bind(t);
503
+ }
504
+ class Jt {
505
+ /**
506
+ * @param executor Function which can make calls to a single Observer
507
+ * as a proxy.
508
+ * @param onNoObservers Callback when count of Observers goes to zero.
509
+ */
510
+ constructor(e, t) {
511
+ this.observers = [], this.unsubscribes = [], this.observerCount = 0, this.task = Promise.resolve(), this.finalized = !1, this.onNoObservers = t, this.task.then(() => {
512
+ e(this);
513
+ }).catch((n) => {
514
+ this.error(n);
515
+ });
516
+ }
517
+ next(e) {
518
+ this.forEachObserver((t) => {
519
+ t.next(e);
520
+ });
521
+ }
522
+ error(e) {
523
+ this.forEachObserver((t) => {
524
+ t.error(e);
525
+ }), this.close(e);
526
+ }
527
+ complete() {
528
+ this.forEachObserver((e) => {
529
+ e.complete();
530
+ }), this.close();
531
+ }
532
+ /**
533
+ * Subscribe function that can be used to add an Observer to the fan-out list.
534
+ *
535
+ * - We require that no event is sent to a subscriber synchronously to their
536
+ * call to subscribe().
537
+ */
538
+ subscribe(e, t, n) {
539
+ let i;
540
+ if (e === void 0 && t === void 0 && n === void 0)
541
+ throw new Error("Missing Observer.");
542
+ qt(e, [
543
+ "next",
544
+ "error",
545
+ "complete"
546
+ ]) ? i = e : i = {
547
+ next: e,
548
+ error: t,
549
+ complete: n
550
+ }, i.next === void 0 && (i.next = q), i.error === void 0 && (i.error = q), i.complete === void 0 && (i.complete = q);
551
+ const s = this.unsubscribeOne.bind(this, this.observers.length);
552
+ return this.finalized && this.task.then(() => {
553
+ try {
554
+ this.finalError ? i.error(this.finalError) : i.complete();
555
+ } catch {
556
+ }
557
+ }), this.observers.push(i), s;
558
+ }
559
+ // Unsubscribe is synchronous - we guarantee that no events are sent to
560
+ // any unsubscribed Observer.
561
+ unsubscribeOne(e) {
562
+ 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));
563
+ }
564
+ forEachObserver(e) {
565
+ if (!this.finalized)
566
+ for (let t = 0; t < this.observers.length; t++)
567
+ this.sendOne(t, e);
568
+ }
569
+ // Call the Observer via one of it's callback function. We are careful to
570
+ // confirm that the observe has not been unsubscribed since this asynchronous
571
+ // function had been queued.
572
+ sendOne(e, t) {
573
+ this.task.then(() => {
574
+ if (this.observers !== void 0 && this.observers[e] !== void 0)
575
+ try {
576
+ t(this.observers[e]);
577
+ } catch (n) {
578
+ typeof console < "u" && console.error && console.error(n);
579
+ }
580
+ });
581
+ }
582
+ close(e) {
583
+ this.finalized || (this.finalized = !0, e !== void 0 && (this.finalError = e), this.task.then(() => {
584
+ this.observers = void 0, this.onNoObservers = void 0;
585
+ }));
586
+ }
587
+ }
588
+ function qt(r, e) {
589
+ if (typeof r != "object" || r === null)
590
+ return !1;
591
+ for (const t of e)
592
+ if (t in r && typeof r[t] == "function")
593
+ return !0;
594
+ return !1;
595
+ }
596
+ function q() {
597
+ }
598
+ /**
599
+ * @license
600
+ * Copyright 2021 Google LLC
601
+ *
602
+ * Licensed under the Apache License, Version 2.0 (the "License");
603
+ * you may not use this file except in compliance with the License.
604
+ * You may obtain a copy of the License at
605
+ *
606
+ * http://www.apache.org/licenses/LICENSE-2.0
607
+ *
608
+ * Unless required by applicable law or agreed to in writing, software
609
+ * distributed under the License is distributed on an "AS IS" BASIS,
610
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
611
+ * See the License for the specific language governing permissions and
612
+ * limitations under the License.
613
+ */
614
+ function z(r) {
615
+ return r && r._delegate ? r._delegate : r;
616
+ }
617
+ class N {
618
+ /**
619
+ *
620
+ * @param name The public service name, e.g. app, auth, firestore, database
621
+ * @param instanceFactory Service factory responsible for creating the public interface
622
+ * @param type whether the service provided by the component is public or private
623
+ */
624
+ constructor(e, t, n) {
625
+ this.name = e, this.instanceFactory = t, this.type = n, this.multipleInstances = !1, this.serviceProps = {}, this.instantiationMode = "LAZY", this.onInstanceCreated = null;
626
+ }
627
+ setInstantiationMode(e) {
628
+ return this.instantiationMode = e, this;
629
+ }
630
+ setMultipleInstances(e) {
631
+ return this.multipleInstances = e, this;
632
+ }
633
+ setServiceProps(e) {
634
+ return this.serviceProps = e, this;
635
+ }
636
+ setInstanceCreatedCallback(e) {
637
+ return this.onInstanceCreated = e, this;
638
+ }
639
+ }
640
+ /**
641
+ * @license
642
+ * Copyright 2019 Google LLC
643
+ *
644
+ * Licensed under the Apache License, Version 2.0 (the "License");
645
+ * you may not use this file except in compliance with the License.
646
+ * You may obtain a copy of the License at
647
+ *
648
+ * http://www.apache.org/licenses/LICENSE-2.0
649
+ *
650
+ * Unless required by applicable law or agreed to in writing, software
651
+ * distributed under the License is distributed on an "AS IS" BASIS,
652
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
653
+ * See the License for the specific language governing permissions and
654
+ * limitations under the License.
655
+ */
656
+ const y = "[DEFAULT]";
657
+ /**
658
+ * @license
659
+ * Copyright 2019 Google LLC
660
+ *
661
+ * Licensed under the Apache License, Version 2.0 (the "License");
662
+ * you may not use this file except in compliance with the License.
663
+ * You may obtain a copy of the License at
664
+ *
665
+ * http://www.apache.org/licenses/LICENSE-2.0
666
+ *
667
+ * Unless required by applicable law or agreed to in writing, software
668
+ * distributed under the License is distributed on an "AS IS" BASIS,
669
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
670
+ * See the License for the specific language governing permissions and
671
+ * limitations under the License.
672
+ */
673
+ class Xt {
674
+ constructor(e, t) {
675
+ this.name = e, this.container = t, this.component = null, this.instances = /* @__PURE__ */ new Map(), this.instancesDeferred = /* @__PURE__ */ new Map(), this.instancesOptions = /* @__PURE__ */ new Map(), this.onInitCallbacks = /* @__PURE__ */ new Map();
676
+ }
677
+ /**
678
+ * @param identifier A provider can provide multiple instances of a service
679
+ * if this.component.multipleInstances is true.
680
+ */
681
+ get(e) {
682
+ const t = this.normalizeInstanceIdentifier(e);
683
+ if (!this.instancesDeferred.has(t)) {
684
+ const n = new Bt();
685
+ if (this.instancesDeferred.set(t, n), this.isInitialized(t) || this.shouldAutoInitialize())
686
+ try {
687
+ const i = this.getOrInitializeService({
688
+ instanceIdentifier: t
689
+ });
690
+ i && n.resolve(i);
691
+ } catch {
692
+ }
693
+ }
694
+ return this.instancesDeferred.get(t).promise;
695
+ }
696
+ getImmediate(e) {
697
+ var t;
698
+ const n = this.normalizeInstanceIdentifier(e == null ? void 0 : e.identifier), i = (t = e == null ? void 0 : e.optional) !== null && t !== void 0 ? t : !1;
699
+ if (this.isInitialized(n) || this.shouldAutoInitialize())
700
+ try {
701
+ return this.getOrInitializeService({
702
+ instanceIdentifier: n
703
+ });
704
+ } catch (s) {
705
+ if (i)
706
+ return null;
707
+ throw s;
708
+ }
709
+ else {
710
+ if (i)
711
+ return null;
712
+ throw Error(`Service ${this.name} is not available`);
713
+ }
714
+ }
715
+ getComponent() {
716
+ return this.component;
717
+ }
718
+ setComponent(e) {
719
+ if (e.name !== this.name)
720
+ throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);
721
+ if (this.component)
722
+ throw Error(`Component for ${this.name} has already been provided`);
723
+ if (this.component = e, !!this.shouldAutoInitialize()) {
724
+ if (Qt(e))
725
+ try {
726
+ this.getOrInitializeService({ instanceIdentifier: y });
727
+ } catch {
728
+ }
729
+ for (const [t, n] of this.instancesDeferred.entries()) {
730
+ const i = this.normalizeInstanceIdentifier(t);
731
+ try {
732
+ const s = this.getOrInitializeService({
733
+ instanceIdentifier: i
734
+ });
735
+ n.resolve(s);
736
+ } catch {
737
+ }
738
+ }
739
+ }
740
+ }
741
+ clearInstance(e = y) {
742
+ this.instancesDeferred.delete(e), this.instancesOptions.delete(e), this.instances.delete(e);
743
+ }
744
+ // app.delete() will call this method on every provider to delete the services
745
+ // TODO: should we mark the provider as deleted?
746
+ async delete() {
747
+ const e = Array.from(this.instances.values());
748
+ await Promise.all([
749
+ ...e.filter((t) => "INTERNAL" in t).map((t) => t.INTERNAL.delete()),
750
+ ...e.filter((t) => "_delete" in t).map((t) => t._delete())
751
+ ]);
752
+ }
753
+ isComponentSet() {
754
+ return this.component != null;
755
+ }
756
+ isInitialized(e = y) {
757
+ return this.instances.has(e);
758
+ }
759
+ getOptions(e = y) {
760
+ return this.instancesOptions.get(e) || {};
761
+ }
762
+ initialize(e = {}) {
763
+ const { options: t = {} } = e, n = this.normalizeInstanceIdentifier(e.instanceIdentifier);
764
+ if (this.isInitialized(n))
765
+ throw Error(`${this.name}(${n}) has already been initialized`);
766
+ if (!this.isComponentSet())
767
+ throw Error(`Component ${this.name} has not been registered yet`);
768
+ const i = this.getOrInitializeService({
769
+ instanceIdentifier: n,
770
+ options: t
771
+ });
772
+ for (const [s, a] of this.instancesDeferred.entries()) {
773
+ const c = this.normalizeInstanceIdentifier(s);
774
+ n === c && a.resolve(i);
775
+ }
776
+ return i;
777
+ }
778
+ /**
779
+ *
780
+ * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize().
781
+ * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.
782
+ *
783
+ * @param identifier An optional instance identifier
784
+ * @returns a function to unregister the callback
785
+ */
786
+ onInit(e, t) {
787
+ var n;
788
+ const i = this.normalizeInstanceIdentifier(t), s = (n = this.onInitCallbacks.get(i)) !== null && n !== void 0 ? n : /* @__PURE__ */ new Set();
789
+ s.add(e), this.onInitCallbacks.set(i, s);
790
+ const a = this.instances.get(i);
791
+ return a && e(a, i), () => {
792
+ s.delete(e);
793
+ };
794
+ }
795
+ /**
796
+ * Invoke onInit callbacks synchronously
797
+ * @param instance the service instance`
798
+ */
799
+ invokeOnInitCallbacks(e, t) {
800
+ const n = this.onInitCallbacks.get(t);
801
+ if (n)
802
+ for (const i of n)
803
+ try {
804
+ i(e, t);
805
+ } catch {
806
+ }
807
+ }
808
+ getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
809
+ let n = this.instances.get(e);
810
+ if (!n && this.component && (n = this.component.instanceFactory(this.container, {
811
+ instanceIdentifier: Yt(e),
812
+ options: t
813
+ }), this.instances.set(e, n), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(n, e), this.component.onInstanceCreated))
814
+ try {
815
+ this.component.onInstanceCreated(this.container, e, n);
816
+ } catch {
817
+ }
818
+ return n || null;
819
+ }
820
+ normalizeInstanceIdentifier(e = y) {
821
+ return this.component ? this.component.multipleInstances ? e : y : e;
822
+ }
823
+ shouldAutoInitialize() {
824
+ return !!this.component && this.component.instantiationMode !== "EXPLICIT";
825
+ }
826
+ }
827
+ function Yt(r) {
828
+ return r === y ? void 0 : r;
829
+ }
830
+ function Qt(r) {
831
+ return r.instantiationMode === "EAGER";
832
+ }
833
+ /**
834
+ * @license
835
+ * Copyright 2019 Google LLC
836
+ *
837
+ * Licensed under the Apache License, Version 2.0 (the "License");
838
+ * you may not use this file except in compliance with the License.
839
+ * You may obtain a copy of the License at
840
+ *
841
+ * http://www.apache.org/licenses/LICENSE-2.0
842
+ *
843
+ * Unless required by applicable law or agreed to in writing, software
844
+ * distributed under the License is distributed on an "AS IS" BASIS,
845
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
846
+ * See the License for the specific language governing permissions and
847
+ * limitations under the License.
848
+ */
849
+ class Zt {
850
+ constructor(e) {
851
+ this.name = e, this.providers = /* @__PURE__ */ new Map();
852
+ }
853
+ /**
854
+ *
855
+ * @param component Component being added
856
+ * @param overwrite When a component with the same name has already been registered,
857
+ * if overwrite is true: overwrite the existing component with the new component and create a new
858
+ * provider with the new component. It can be useful in tests where you want to use different mocks
859
+ * for different tests.
860
+ * if overwrite is false: throw an exception
861
+ */
862
+ addComponent(e) {
863
+ const t = this.getProvider(e.name);
864
+ if (t.isComponentSet())
865
+ throw new Error(`Component ${e.name} has already been registered with ${this.name}`);
866
+ t.setComponent(e);
867
+ }
868
+ addOrOverwriteComponent(e) {
869
+ this.getProvider(e.name).isComponentSet() && this.providers.delete(e.name), this.addComponent(e);
870
+ }
871
+ /**
872
+ * getProvider provides a type safe interface where it can only be called with a field name
873
+ * present in NameServiceMapping interface.
874
+ *
875
+ * Firebase SDKs providing services should extend NameServiceMapping interface to register
876
+ * themselves.
877
+ */
878
+ getProvider(e) {
879
+ if (this.providers.has(e))
880
+ return this.providers.get(e);
881
+ const t = new Xt(e, this);
882
+ return this.providers.set(e, t), t;
883
+ }
884
+ getProviders() {
885
+ return Array.from(this.providers.values());
886
+ }
887
+ }
888
+ /**
889
+ * @license
890
+ * Copyright 2017 Google LLC
891
+ *
892
+ * Licensed under the Apache License, Version 2.0 (the "License");
893
+ * you may not use this file except in compliance with the License.
894
+ * You may obtain a copy of the License at
895
+ *
896
+ * http://www.apache.org/licenses/LICENSE-2.0
897
+ *
898
+ * Unless required by applicable law or agreed to in writing, software
899
+ * distributed under the License is distributed on an "AS IS" BASIS,
900
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
901
+ * See the License for the specific language governing permissions and
902
+ * limitations under the License.
903
+ */
904
+ var d;
905
+ (function(r) {
906
+ r[r.DEBUG = 0] = "DEBUG", r[r.VERBOSE = 1] = "VERBOSE", r[r.INFO = 2] = "INFO", r[r.WARN = 3] = "WARN", r[r.ERROR = 4] = "ERROR", r[r.SILENT = 5] = "SILENT";
907
+ })(d || (d = {}));
908
+ const er = {
909
+ debug: d.DEBUG,
910
+ verbose: d.VERBOSE,
911
+ info: d.INFO,
912
+ warn: d.WARN,
913
+ error: d.ERROR,
914
+ silent: d.SILENT
915
+ }, tr = d.INFO, rr = {
916
+ [d.DEBUG]: "log",
917
+ [d.VERBOSE]: "log",
918
+ [d.INFO]: "info",
919
+ [d.WARN]: "warn",
920
+ [d.ERROR]: "error"
921
+ }, nr = (r, e, ...t) => {
922
+ if (e < r.logLevel)
923
+ return;
924
+ const n = (/* @__PURE__ */ new Date()).toISOString(), i = rr[e];
925
+ if (i)
926
+ console[i](`[${n}] ${r.name}:`, ...t);
927
+ else
928
+ throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);
929
+ };
930
+ class ze {
931
+ /**
932
+ * Gives you an instance of a Logger to capture messages according to
933
+ * Firebase's logging scheme.
934
+ *
935
+ * @param name The name that the logs will be associated with
936
+ */
937
+ constructor(e) {
938
+ this.name = e, this._logLevel = tr, this._logHandler = nr, this._userLogHandler = null;
939
+ }
940
+ get logLevel() {
941
+ return this._logLevel;
942
+ }
943
+ set logLevel(e) {
944
+ if (!(e in d))
945
+ throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);
946
+ this._logLevel = e;
947
+ }
948
+ // Workaround for setter/getter having to be the same type.
949
+ setLogLevel(e) {
950
+ this._logLevel = typeof e == "string" ? er[e] : e;
951
+ }
952
+ get logHandler() {
953
+ return this._logHandler;
954
+ }
955
+ set logHandler(e) {
956
+ if (typeof e != "function")
957
+ throw new TypeError("Value assigned to `logHandler` must be a function");
958
+ this._logHandler = e;
959
+ }
960
+ get userLogHandler() {
961
+ return this._userLogHandler;
962
+ }
963
+ set userLogHandler(e) {
964
+ this._userLogHandler = e;
965
+ }
966
+ /**
967
+ * The functions below are all based on the `console` interface
968
+ */
969
+ debug(...e) {
970
+ this._userLogHandler && this._userLogHandler(this, d.DEBUG, ...e), this._logHandler(this, d.DEBUG, ...e);
971
+ }
972
+ log(...e) {
973
+ this._userLogHandler && this._userLogHandler(this, d.VERBOSE, ...e), this._logHandler(this, d.VERBOSE, ...e);
974
+ }
975
+ info(...e) {
976
+ this._userLogHandler && this._userLogHandler(this, d.INFO, ...e), this._logHandler(this, d.INFO, ...e);
977
+ }
978
+ warn(...e) {
979
+ this._userLogHandler && this._userLogHandler(this, d.WARN, ...e), this._logHandler(this, d.WARN, ...e);
980
+ }
981
+ error(...e) {
982
+ this._userLogHandler && this._userLogHandler(this, d.ERROR, ...e), this._logHandler(this, d.ERROR, ...e);
983
+ }
984
+ }
985
+ const ir = (r, e) => e.some((t) => r instanceof t);
986
+ let Ie, ye;
987
+ function sr() {
988
+ return Ie || (Ie = [
989
+ IDBDatabase,
990
+ IDBObjectStore,
991
+ IDBIndex,
992
+ IDBCursor,
993
+ IDBTransaction
994
+ ]);
995
+ }
996
+ function ar() {
997
+ return ye || (ye = [
998
+ IDBCursor.prototype.advance,
999
+ IDBCursor.prototype.continue,
1000
+ IDBCursor.prototype.continuePrimaryKey
1001
+ ]);
1002
+ }
1003
+ const je = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap();
1004
+ function or(r) {
1005
+ const e = new Promise((t, n) => {
1006
+ const i = () => {
1007
+ r.removeEventListener("success", s), r.removeEventListener("error", a);
1008
+ }, s = () => {
1009
+ t(b(r.result)), i();
1010
+ }, a = () => {
1011
+ n(r.error), i();
1012
+ };
1013
+ r.addEventListener("success", s), r.addEventListener("error", a);
1014
+ });
1015
+ return e.then((t) => {
1016
+ t instanceof IDBCursor && je.set(t, r);
1017
+ }).catch(() => {
1018
+ }), he.set(e, r), e;
1019
+ }
1020
+ function cr(r) {
1021
+ if (ne.has(r))
1022
+ return;
1023
+ const e = new Promise((t, n) => {
1024
+ const i = () => {
1025
+ r.removeEventListener("complete", s), r.removeEventListener("error", a), r.removeEventListener("abort", a);
1026
+ }, s = () => {
1027
+ t(), i();
1028
+ }, a = () => {
1029
+ n(r.error || new DOMException("AbortError", "AbortError")), i();
1030
+ };
1031
+ r.addEventListener("complete", s), r.addEventListener("error", a), r.addEventListener("abort", a);
1032
+ });
1033
+ ne.set(r, e);
1034
+ }
1035
+ let ie = {
1036
+ get(r, e, t) {
1037
+ if (r instanceof IDBTransaction) {
1038
+ if (e === "done")
1039
+ return ne.get(r);
1040
+ if (e === "objectStoreNames")
1041
+ return r.objectStoreNames || We.get(r);
1042
+ if (e === "store")
1043
+ return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
1044
+ }
1045
+ return b(r[e]);
1046
+ },
1047
+ set(r, e, t) {
1048
+ return r[e] = t, !0;
1049
+ },
1050
+ has(r, e) {
1051
+ return r instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in r;
1052
+ }
1053
+ };
1054
+ function lr(r) {
1055
+ ie = r(ie);
1056
+ }
1057
+ function hr(r) {
1058
+ return r === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
1059
+ const n = r.call(Y(this), e, ...t);
1060
+ return We.set(n, e.sort ? e.sort() : [e]), b(n);
1061
+ } : ar().includes(r) ? function(...e) {
1062
+ return r.apply(Y(this), e), b(je.get(this));
1063
+ } : function(...e) {
1064
+ return b(r.apply(Y(this), e));
1065
+ };
1066
+ }
1067
+ function dr(r) {
1068
+ return typeof r == "function" ? hr(r) : (r instanceof IDBTransaction && cr(r), ir(r, sr()) ? new Proxy(r, ie) : r);
1069
+ }
1070
+ function b(r) {
1071
+ if (r instanceof IDBRequest)
1072
+ return or(r);
1073
+ if (X.has(r))
1074
+ return X.get(r);
1075
+ const e = dr(r);
1076
+ return e !== r && (X.set(r, e), he.set(e, r)), e;
1077
+ }
1078
+ const Y = (r) => he.get(r);
1079
+ function ur(r, e, { blocked: t, upgrade: n, blocking: i, terminated: s } = {}) {
1080
+ const a = indexedDB.open(r, e), c = b(a);
1081
+ return n && a.addEventListener("upgradeneeded", (o) => {
1082
+ n(b(a.result), o.oldVersion, o.newVersion, b(a.transaction), o);
1083
+ }), t && a.addEventListener("blocked", (o) => t(
1084
+ // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
1085
+ o.oldVersion,
1086
+ o.newVersion,
1087
+ o
1088
+ )), c.then((o) => {
1089
+ s && o.addEventListener("close", () => s()), i && o.addEventListener("versionchange", (l) => i(l.oldVersion, l.newVersion, l));
1090
+ }).catch(() => {
1091
+ }), c;
1092
+ }
1093
+ const fr = ["get", "getKey", "getAll", "getAllKeys", "count"], pr = ["put", "add", "delete", "clear"], Q = /* @__PURE__ */ new Map();
1094
+ function Ee(r, e) {
1095
+ if (!(r instanceof IDBDatabase && !(e in r) && typeof e == "string"))
1096
+ return;
1097
+ if (Q.get(e))
1098
+ return Q.get(e);
1099
+ const t = e.replace(/FromIndex$/, ""), n = e !== t, i = pr.includes(t);
1100
+ if (
1101
+ // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
1102
+ !(t in (n ? IDBIndex : IDBObjectStore).prototype) || !(i || fr.includes(t))
1103
+ )
1104
+ return;
1105
+ const s = async function(a, ...c) {
1106
+ const o = this.transaction(a, i ? "readwrite" : "readonly");
1107
+ let l = o.store;
1108
+ return n && (l = l.index(c.shift())), (await Promise.all([
1109
+ l[t](...c),
1110
+ i && o.done
1111
+ ]))[0];
1112
+ };
1113
+ return Q.set(e, s), s;
1114
+ }
1115
+ lr((r) => ({
1116
+ ...r,
1117
+ get: (e, t, n) => Ee(e, t) || r.get(e, t, n),
1118
+ has: (e, t) => !!Ee(e, t) || r.has(e, t)
1119
+ }));
1120
+ /**
1121
+ * @license
1122
+ * Copyright 2019 Google LLC
1123
+ *
1124
+ * Licensed under the Apache License, Version 2.0 (the "License");
1125
+ * you may not use this file except in compliance with the License.
1126
+ * You may obtain a copy of the License at
1127
+ *
1128
+ * http://www.apache.org/licenses/LICENSE-2.0
1129
+ *
1130
+ * Unless required by applicable law or agreed to in writing, software
1131
+ * distributed under the License is distributed on an "AS IS" BASIS,
1132
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1133
+ * See the License for the specific language governing permissions and
1134
+ * limitations under the License.
1135
+ */
1136
+ class mr {
1137
+ constructor(e) {
1138
+ this.container = e;
1139
+ }
1140
+ // In initial implementation, this will be called by installations on
1141
+ // auth token refresh, and installations will send this string.
1142
+ getPlatformInfoString() {
1143
+ return this.container.getProviders().map((t) => {
1144
+ if (gr(t)) {
1145
+ const n = t.getImmediate();
1146
+ return `${n.library}/${n.version}`;
1147
+ } else
1148
+ return null;
1149
+ }).filter((t) => t).join(" ");
1150
+ }
1151
+ }
1152
+ function gr(r) {
1153
+ const e = r.getComponent();
1154
+ return (e == null ? void 0 : e.type) === "VERSION";
1155
+ }
1156
+ const se = "@firebase/app", we = "0.10.13";
1157
+ /**
1158
+ * @license
1159
+ * Copyright 2019 Google LLC
1160
+ *
1161
+ * Licensed under the Apache License, Version 2.0 (the "License");
1162
+ * you may not use this file except in compliance with the License.
1163
+ * You may obtain a copy of the License at
1164
+ *
1165
+ * http://www.apache.org/licenses/LICENSE-2.0
1166
+ *
1167
+ * Unless required by applicable law or agreed to in writing, software
1168
+ * distributed under the License is distributed on an "AS IS" BASIS,
1169
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1170
+ * See the License for the specific language governing permissions and
1171
+ * limitations under the License.
1172
+ */
1173
+ const m = new ze("@firebase/app"), _r = "@firebase/app-compat", br = "@firebase/analytics-compat", vr = "@firebase/analytics", Ir = "@firebase/app-check-compat", yr = "@firebase/app-check", Er = "@firebase/auth", wr = "@firebase/auth-compat", Sr = "@firebase/database", Ar = "@firebase/data-connect", Tr = "@firebase/database-compat", Cr = "@firebase/functions", Nr = "@firebase/functions-compat", Dr = "@firebase/installations", Or = "@firebase/installations-compat", kr = "@firebase/messaging", Pr = "@firebase/messaging-compat", Rr = "@firebase/performance", Lr = "@firebase/performance-compat", Ur = "@firebase/remote-config", Mr = "@firebase/remote-config-compat", Br = "@firebase/storage", xr = "@firebase/storage-compat", Fr = "@firebase/firestore", $r = "@firebase/vertexai-preview", Vr = "@firebase/firestore-compat", Hr = "firebase", zr = "10.14.1";
1174
+ /**
1175
+ * @license
1176
+ * Copyright 2019 Google LLC
1177
+ *
1178
+ * Licensed under the Apache License, Version 2.0 (the "License");
1179
+ * you may not use this file except in compliance with the License.
1180
+ * You may obtain a copy of the License at
1181
+ *
1182
+ * http://www.apache.org/licenses/LICENSE-2.0
1183
+ *
1184
+ * Unless required by applicable law or agreed to in writing, software
1185
+ * distributed under the License is distributed on an "AS IS" BASIS,
1186
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1187
+ * See the License for the specific language governing permissions and
1188
+ * limitations under the License.
1189
+ */
1190
+ const jr = "[DEFAULT]", Wr = {
1191
+ [se]: "fire-core",
1192
+ [_r]: "fire-core-compat",
1193
+ [vr]: "fire-analytics",
1194
+ [br]: "fire-analytics-compat",
1195
+ [yr]: "fire-app-check",
1196
+ [Ir]: "fire-app-check-compat",
1197
+ [Er]: "fire-auth",
1198
+ [wr]: "fire-auth-compat",
1199
+ [Sr]: "fire-rtdb",
1200
+ [Ar]: "fire-data-connect",
1201
+ [Tr]: "fire-rtdb-compat",
1202
+ [Cr]: "fire-fn",
1203
+ [Nr]: "fire-fn-compat",
1204
+ [Dr]: "fire-iid",
1205
+ [Or]: "fire-iid-compat",
1206
+ [kr]: "fire-fcm",
1207
+ [Pr]: "fire-fcm-compat",
1208
+ [Rr]: "fire-perf",
1209
+ [Lr]: "fire-perf-compat",
1210
+ [Ur]: "fire-rc",
1211
+ [Mr]: "fire-rc-compat",
1212
+ [Br]: "fire-gcs",
1213
+ [xr]: "fire-gcs-compat",
1214
+ [Fr]: "fire-fst",
1215
+ [Vr]: "fire-fst-compat",
1216
+ [$r]: "fire-vertex",
1217
+ "fire-js": "fire-js",
1218
+ [Hr]: "fire-js-all"
1219
+ };
1220
+ /**
1221
+ * @license
1222
+ * Copyright 2019 Google LLC
1223
+ *
1224
+ * Licensed under the Apache License, Version 2.0 (the "License");
1225
+ * you may not use this file except in compliance with the License.
1226
+ * You may obtain a copy of the License at
1227
+ *
1228
+ * http://www.apache.org/licenses/LICENSE-2.0
1229
+ *
1230
+ * Unless required by applicable law or agreed to in writing, software
1231
+ * distributed under the License is distributed on an "AS IS" BASIS,
1232
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1233
+ * See the License for the specific language governing permissions and
1234
+ * limitations under the License.
1235
+ */
1236
+ const ae = /* @__PURE__ */ new Map(), Gr = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
1237
+ function Se(r, e) {
1238
+ try {
1239
+ r.container.addComponent(e);
1240
+ } catch (t) {
1241
+ m.debug(`Component ${e.name} failed to register with FirebaseApp ${r.name}`, t);
1242
+ }
1243
+ }
1244
+ function P(r) {
1245
+ const e = r.name;
1246
+ if (oe.has(e))
1247
+ return m.debug(`There were multiple attempts to register component ${e}.`), !1;
1248
+ oe.set(e, r);
1249
+ for (const t of ae.values())
1250
+ Se(t, r);
1251
+ for (const t of Gr.values())
1252
+ Se(t, r);
1253
+ return !0;
1254
+ }
1255
+ function D(r) {
1256
+ return r.settings !== void 0;
1257
+ }
1258
+ /**
1259
+ * @license
1260
+ * Copyright 2019 Google LLC
1261
+ *
1262
+ * Licensed under the Apache License, Version 2.0 (the "License");
1263
+ * you may not use this file except in compliance with the License.
1264
+ * You may obtain a copy of the License at
1265
+ *
1266
+ * http://www.apache.org/licenses/LICENSE-2.0
1267
+ *
1268
+ * Unless required by applicable law or agreed to in writing, software
1269
+ * distributed under the License is distributed on an "AS IS" BASIS,
1270
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1271
+ * See the License for the specific language governing permissions and
1272
+ * limitations under the License.
1273
+ */
1274
+ const Kr = {
1275
+ "no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
1276
+ "bad-app-name": "Illegal App name: '{$appName}'",
1277
+ "duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
1278
+ "app-deleted": "Firebase App named '{$appName}' already deleted",
1279
+ "server-app-deleted": "Firebase Server App has been deleted",
1280
+ "no-options": "Need to provide options, when not being deployed to hosting via source.",
1281
+ "invalid-app-argument": "firebase.{$appName}() takes either no argument or a Firebase App instance.",
1282
+ "invalid-log-argument": "First argument to `onLog` must be null or a function.",
1283
+ "idb-open": "Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",
1284
+ "idb-get": "Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",
1285
+ "idb-set": "Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",
1286
+ "idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",
1287
+ "finalization-registry-not-supported": "FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.",
1288
+ "invalid-server-app-environment": "FirebaseServerApp is not for use in browser environments."
1289
+ }, w = new L("app", "Firebase", Kr);
1290
+ /**
1291
+ * @license
1292
+ * Copyright 2019 Google LLC
1293
+ *
1294
+ * Licensed under the Apache License, Version 2.0 (the "License");
1295
+ * you may not use this file except in compliance with the License.
1296
+ * You may obtain a copy of the License at
1297
+ *
1298
+ * http://www.apache.org/licenses/LICENSE-2.0
1299
+ *
1300
+ * Unless required by applicable law or agreed to in writing, software
1301
+ * distributed under the License is distributed on an "AS IS" BASIS,
1302
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1303
+ * See the License for the specific language governing permissions and
1304
+ * limitations under the License.
1305
+ */
1306
+ class Jr {
1307
+ constructor(e, t, n) {
1308
+ this._isDeleted = !1, this._options = Object.assign({}, e), this._config = Object.assign({}, t), this._name = t.name, this._automaticDataCollectionEnabled = t.automaticDataCollectionEnabled, this._container = n, this.container.addComponent(new N(
1309
+ "app",
1310
+ () => this,
1311
+ "PUBLIC"
1312
+ /* ComponentType.PUBLIC */
1313
+ ));
1314
+ }
1315
+ get automaticDataCollectionEnabled() {
1316
+ return this.checkDestroyed(), this._automaticDataCollectionEnabled;
1317
+ }
1318
+ set automaticDataCollectionEnabled(e) {
1319
+ this.checkDestroyed(), this._automaticDataCollectionEnabled = e;
1320
+ }
1321
+ get name() {
1322
+ return this.checkDestroyed(), this._name;
1323
+ }
1324
+ get options() {
1325
+ return this.checkDestroyed(), this._options;
1326
+ }
1327
+ get config() {
1328
+ return this.checkDestroyed(), this._config;
1329
+ }
1330
+ get container() {
1331
+ return this._container;
1332
+ }
1333
+ get isDeleted() {
1334
+ return this._isDeleted;
1335
+ }
1336
+ set isDeleted(e) {
1337
+ this._isDeleted = e;
1338
+ }
1339
+ /**
1340
+ * This function will throw an Error if the App has already been deleted -
1341
+ * use before performing API actions on the App.
1342
+ */
1343
+ checkDestroyed() {
1344
+ if (this.isDeleted)
1345
+ throw w.create("app-deleted", { appName: this._name });
1346
+ }
1347
+ }
1348
+ /**
1349
+ * @license
1350
+ * Copyright 2019 Google LLC
1351
+ *
1352
+ * Licensed under the Apache License, Version 2.0 (the "License");
1353
+ * you may not use this file except in compliance with the License.
1354
+ * You may obtain a copy of the License at
1355
+ *
1356
+ * http://www.apache.org/licenses/LICENSE-2.0
1357
+ *
1358
+ * Unless required by applicable law or agreed to in writing, software
1359
+ * distributed under the License is distributed on an "AS IS" BASIS,
1360
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1361
+ * See the License for the specific language governing permissions and
1362
+ * limitations under the License.
1363
+ */
1364
+ const de = zr;
1365
+ function qr(r, e = {}) {
1366
+ let t = r;
1367
+ typeof e != "object" && (e = { name: e });
1368
+ const n = Object.assign({ name: jr, automaticDataCollectionEnabled: !1 }, e), i = n.name;
1369
+ if (typeof i != "string" || !i)
1370
+ throw w.create("bad-app-name", {
1371
+ appName: String(i)
1372
+ });
1373
+ if (t || (t = Ut()), !t)
1374
+ throw w.create(
1375
+ "no-options"
1376
+ /* AppError.NO_OPTIONS */
1377
+ );
1378
+ const s = ae.get(i);
1379
+ if (s) {
1380
+ if (re(t, s.options) && re(n, s.config))
1381
+ return s;
1382
+ throw w.create("duplicate-app", { appName: i });
1383
+ }
1384
+ const a = new Zt(i);
1385
+ for (const o of oe.values())
1386
+ a.addComponent(o);
1387
+ const c = new Jr(t, n, a);
1388
+ return ae.set(i, c), c;
1389
+ }
1390
+ function A(r, e, t) {
1391
+ var n;
1392
+ let i = (n = Wr[r]) !== null && n !== void 0 ? n : r;
1393
+ t && (i += `-${t}`);
1394
+ const s = i.match(/\s|\//), a = e.match(/\s|\//);
1395
+ if (s || a) {
1396
+ const c = [
1397
+ `Unable to register library "${i}" with version "${e}":`
1398
+ ];
1399
+ s && c.push(`library name "${i}" contains illegal characters (whitespace or "/")`), s && a && c.push("and"), a && c.push(`version name "${e}" contains illegal characters (whitespace or "/")`), m.warn(c.join(" "));
1400
+ return;
1401
+ }
1402
+ P(new N(
1403
+ `${i}-version`,
1404
+ () => ({ library: i, version: e }),
1405
+ "VERSION"
1406
+ /* ComponentType.VERSION */
1407
+ ));
1408
+ }
1409
+ /**
1410
+ * @license
1411
+ * Copyright 2021 Google LLC
1412
+ *
1413
+ * Licensed under the Apache License, Version 2.0 (the "License");
1414
+ * you may not use this file except in compliance with the License.
1415
+ * You may obtain a copy of the License at
1416
+ *
1417
+ * http://www.apache.org/licenses/LICENSE-2.0
1418
+ *
1419
+ * Unless required by applicable law or agreed to in writing, software
1420
+ * distributed under the License is distributed on an "AS IS" BASIS,
1421
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1422
+ * See the License for the specific language governing permissions and
1423
+ * limitations under the License.
1424
+ */
1425
+ const Xr = "firebase-heartbeat-database", Yr = 1, R = "firebase-heartbeat-store";
1426
+ let Z = null;
1427
+ function Ge() {
1428
+ return Z || (Z = ur(Xr, Yr, {
1429
+ upgrade: (r, e) => {
1430
+ switch (e) {
1431
+ case 0:
1432
+ try {
1433
+ r.createObjectStore(R);
1434
+ } catch (t) {
1435
+ console.warn(t);
1436
+ }
1437
+ }
1438
+ }
1439
+ }).catch((r) => {
1440
+ throw w.create("idb-open", {
1441
+ originalErrorMessage: r.message
1442
+ });
1443
+ })), Z;
1444
+ }
1445
+ async function Qr(r) {
1446
+ try {
1447
+ const t = (await Ge()).transaction(R), n = await t.objectStore(R).get(Ke(r));
1448
+ return await t.done, n;
1449
+ } catch (e) {
1450
+ if (e instanceof S)
1451
+ m.warn(e.message);
1452
+ else {
1453
+ const t = w.create("idb-get", {
1454
+ originalErrorMessage: e == null ? void 0 : e.message
1455
+ });
1456
+ m.warn(t.message);
1457
+ }
1458
+ }
1459
+ }
1460
+ async function Ae(r, e) {
1461
+ try {
1462
+ const n = (await Ge()).transaction(R, "readwrite");
1463
+ await n.objectStore(R).put(e, Ke(r)), await n.done;
1464
+ } catch (t) {
1465
+ if (t instanceof S)
1466
+ m.warn(t.message);
1467
+ else {
1468
+ const n = w.create("idb-set", {
1469
+ originalErrorMessage: t == null ? void 0 : t.message
1470
+ });
1471
+ m.warn(n.message);
1472
+ }
1473
+ }
1474
+ }
1475
+ function Ke(r) {
1476
+ return `${r.name}!${r.options.appId}`;
1477
+ }
1478
+ /**
1479
+ * @license
1480
+ * Copyright 2021 Google LLC
1481
+ *
1482
+ * Licensed under the Apache License, Version 2.0 (the "License");
1483
+ * you may not use this file except in compliance with the License.
1484
+ * You may obtain a copy of the License at
1485
+ *
1486
+ * http://www.apache.org/licenses/LICENSE-2.0
1487
+ *
1488
+ * Unless required by applicable law or agreed to in writing, software
1489
+ * distributed under the License is distributed on an "AS IS" BASIS,
1490
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1491
+ * See the License for the specific language governing permissions and
1492
+ * limitations under the License.
1493
+ */
1494
+ const Zr = 1024, en = 30 * 24 * 60 * 60 * 1e3;
1495
+ class tn {
1496
+ constructor(e) {
1497
+ this.container = e, this._heartbeatsCache = null;
1498
+ const t = this.container.getProvider("app").getImmediate();
1499
+ this._storage = new nn(t), this._heartbeatsCachePromise = this._storage.read().then((n) => (this._heartbeatsCache = n, n));
1500
+ }
1501
+ /**
1502
+ * Called to report a heartbeat. The function will generate
1503
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
1504
+ * to IndexedDB.
1505
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
1506
+ * already logged, subsequent calls to this function in the same day will be ignored.
1507
+ */
1508
+ async triggerHeartbeat() {
1509
+ var e, t;
1510
+ try {
1511
+ const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s = Te();
1512
+ return ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null && (this._heartbeatsCache = await this._heartbeatsCachePromise, ((t = this._heartbeatsCache) === null || t === void 0 ? void 0 : t.heartbeats) == null) || this._heartbeatsCache.lastSentHeartbeatDate === s || this._heartbeatsCache.heartbeats.some((a) => a.date === s) ? void 0 : (this._heartbeatsCache.heartbeats.push({ date: s, agent: i }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((a) => {
1513
+ const c = new Date(a.date).valueOf();
1514
+ return Date.now() - c <= en;
1515
+ }), this._storage.overwrite(this._heartbeatsCache));
1516
+ } catch (n) {
1517
+ m.warn(n);
1518
+ }
1519
+ }
1520
+ /**
1521
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
1522
+ * It also clears all heartbeats from memory as well as in IndexedDB.
1523
+ *
1524
+ * NOTE: Consuming product SDKs should not send the header if this method
1525
+ * returns an empty string.
1526
+ */
1527
+ async getHeartbeatsHeader() {
1528
+ var e;
1529
+ try {
1530
+ if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
1531
+ return "";
1532
+ const t = Te(), { heartbeatsToSend: n, unsentEntries: i } = rn(this._heartbeatsCache.heartbeats), s = Fe(JSON.stringify({ version: 2, heartbeats: n }));
1533
+ return this._heartbeatsCache.lastSentHeartbeatDate = t, i.length > 0 ? (this._heartbeatsCache.heartbeats = i, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), s;
1534
+ } catch (t) {
1535
+ return m.warn(t), "";
1536
+ }
1537
+ }
1538
+ }
1539
+ function Te() {
1540
+ return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
1541
+ }
1542
+ function rn(r, e = Zr) {
1543
+ const t = [];
1544
+ let n = r.slice();
1545
+ for (const i of r) {
1546
+ const s = t.find((a) => a.agent === i.agent);
1547
+ if (s) {
1548
+ if (s.dates.push(i.date), Ce(t) > e) {
1549
+ s.dates.pop();
1550
+ break;
1551
+ }
1552
+ } else if (t.push({
1553
+ agent: i.agent,
1554
+ dates: [i.date]
1555
+ }), Ce(t) > e) {
1556
+ t.pop();
1557
+ break;
1558
+ }
1559
+ n = n.slice(1);
1560
+ }
1561
+ return {
1562
+ heartbeatsToSend: t,
1563
+ unsentEntries: n
1564
+ };
1565
+ }
1566
+ class nn {
1567
+ constructor(e) {
1568
+ this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
1569
+ }
1570
+ async runIndexedDBEnvironmentCheck() {
1571
+ return Ht() ? zt().then(() => !0).catch(() => !1) : !1;
1572
+ }
1573
+ /**
1574
+ * Read all heartbeats.
1575
+ */
1576
+ async read() {
1577
+ if (await this._canUseIndexedDBPromise) {
1578
+ const t = await Qr(this.app);
1579
+ return t != null && t.heartbeats ? t : { heartbeats: [] };
1580
+ } else
1581
+ return { heartbeats: [] };
1582
+ }
1583
+ // overwrite the storage with the provided heartbeats
1584
+ async overwrite(e) {
1585
+ var t;
1586
+ if (await this._canUseIndexedDBPromise) {
1587
+ const i = await this.read();
1588
+ return Ae(this.app, {
1589
+ lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
1590
+ heartbeats: e.heartbeats
1591
+ });
1592
+ } else
1593
+ return;
1594
+ }
1595
+ // add heartbeats
1596
+ async add(e) {
1597
+ var t;
1598
+ if (await this._canUseIndexedDBPromise) {
1599
+ const i = await this.read();
1600
+ return Ae(this.app, {
1601
+ lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
1602
+ heartbeats: [
1603
+ ...i.heartbeats,
1604
+ ...e.heartbeats
1605
+ ]
1606
+ });
1607
+ } else
1608
+ return;
1609
+ }
1610
+ }
1611
+ function Ce(r) {
1612
+ return Fe(
1613
+ // heartbeatsCache wrapper properties
1614
+ JSON.stringify({ version: 2, heartbeats: r })
1615
+ ).length;
1616
+ }
1617
+ /**
1618
+ * @license
1619
+ * Copyright 2019 Google LLC
1620
+ *
1621
+ * Licensed under the Apache License, Version 2.0 (the "License");
1622
+ * you may not use this file except in compliance with the License.
1623
+ * You may obtain a copy of the License at
1624
+ *
1625
+ * http://www.apache.org/licenses/LICENSE-2.0
1626
+ *
1627
+ * Unless required by applicable law or agreed to in writing, software
1628
+ * distributed under the License is distributed on an "AS IS" BASIS,
1629
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1630
+ * See the License for the specific language governing permissions and
1631
+ * limitations under the License.
1632
+ */
1633
+ function sn(r) {
1634
+ P(new N(
1635
+ "platform-logger",
1636
+ (e) => new mr(e),
1637
+ "PRIVATE"
1638
+ /* ComponentType.PRIVATE */
1639
+ )), P(new N(
1640
+ "heartbeat",
1641
+ (e) => new tn(e),
1642
+ "PRIVATE"
1643
+ /* ComponentType.PRIVATE */
1644
+ )), A(se, we, r), A(se, we, "esm2017"), A("fire-js", "");
1645
+ }
1646
+ sn("");
1647
+ var an = "firebase", on = "10.14.1";
1648
+ /**
1649
+ * @license
1650
+ * Copyright 2020 Google LLC
1651
+ *
1652
+ * Licensed under the Apache License, Version 2.0 (the "License");
1653
+ * you may not use this file except in compliance with the License.
1654
+ * You may obtain a copy of the License at
1655
+ *
1656
+ * http://www.apache.org/licenses/LICENSE-2.0
1657
+ *
1658
+ * Unless required by applicable law or agreed to in writing, software
1659
+ * distributed under the License is distributed on an "AS IS" BASIS,
1660
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1661
+ * See the License for the specific language governing permissions and
1662
+ * limitations under the License.
1663
+ */
1664
+ A(an, on, "app");
1665
+ function Je(r, e) {
1666
+ var t = {};
1667
+ for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
1668
+ if (r != null && typeof Object.getOwnPropertySymbols == "function")
1669
+ for (var i = 0, n = Object.getOwnPropertySymbols(r); i < n.length; i++)
1670
+ e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[i]) && (t[n[i]] = r[n[i]]);
1671
+ return t;
1672
+ }
1673
+ function qe() {
1674
+ return {
1675
+ "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."
1676
+ };
1677
+ }
1678
+ const cn = qe, Xe = new L("auth", "Firebase", qe());
1679
+ /**
1680
+ * @license
1681
+ * Copyright 2020 Google LLC
1682
+ *
1683
+ * Licensed under the Apache License, Version 2.0 (the "License");
1684
+ * you may not use this file except in compliance with the License.
1685
+ * You may obtain a copy of the License at
1686
+ *
1687
+ * http://www.apache.org/licenses/LICENSE-2.0
1688
+ *
1689
+ * Unless required by applicable law or agreed to in writing, software
1690
+ * distributed under the License is distributed on an "AS IS" BASIS,
1691
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1692
+ * See the License for the specific language governing permissions and
1693
+ * limitations under the License.
1694
+ */
1695
+ const $ = new ze("@firebase/auth");
1696
+ function ln(r, ...e) {
1697
+ $.logLevel <= d.WARN && $.warn(`Auth (${de}): ${r}`, ...e);
1698
+ }
1699
+ function x(r, ...e) {
1700
+ $.logLevel <= d.ERROR && $.error(`Auth (${de}): ${r}`, ...e);
1701
+ }
1702
+ /**
1703
+ * @license
1704
+ * Copyright 2020 Google LLC
1705
+ *
1706
+ * Licensed under the Apache License, Version 2.0 (the "License");
1707
+ * you may not use this file except in compliance with the License.
1708
+ * You may obtain a copy of the License at
1709
+ *
1710
+ * http://www.apache.org/licenses/LICENSE-2.0
1711
+ *
1712
+ * Unless required by applicable law or agreed to in writing, software
1713
+ * distributed under the License is distributed on an "AS IS" BASIS,
1714
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1715
+ * See the License for the specific language governing permissions and
1716
+ * limitations under the License.
1717
+ */
1718
+ function Ne(r, ...e) {
1719
+ throw ue(r, ...e);
1720
+ }
1721
+ function Ye(r, ...e) {
1722
+ return ue(r, ...e);
1723
+ }
1724
+ function Qe(r, e, t) {
1725
+ const n = Object.assign(Object.assign({}, cn()), { [e]: t });
1726
+ return new L("auth", "Firebase", n).create(e, {
1727
+ appName: r.name
1728
+ });
1729
+ }
1730
+ function F(r) {
1731
+ return Qe(r, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
1732
+ }
1733
+ function ue(r, ...e) {
1734
+ if (typeof r != "string") {
1735
+ const t = e[0], n = [...e.slice(1)];
1736
+ return n[0] && (n[0].appName = r.name), r._errorFactory.create(t, ...n);
1737
+ }
1738
+ return Xe.create(r, ...e);
1739
+ }
1740
+ function h(r, e, ...t) {
1741
+ if (!r)
1742
+ throw ue(e, ...t);
1743
+ }
1744
+ function O(r) {
1745
+ const e = "INTERNAL ASSERTION FAILED: " + r;
1746
+ throw x(e), new Error(e);
1747
+ }
1748
+ function V(r, e) {
1749
+ r || O(e);
1750
+ }
1751
+ function hn() {
1752
+ return De() === "http:" || De() === "https:";
1753
+ }
1754
+ function De() {
1755
+ var r;
1756
+ return typeof self < "u" && ((r = self.location) === null || r === void 0 ? void 0 : r.protocol) || null;
1757
+ }
1758
+ /**
1759
+ * @license
1760
+ * Copyright 2020 Google LLC
1761
+ *
1762
+ * Licensed under the Apache License, Version 2.0 (the "License");
1763
+ * you may not use this file except in compliance with the License.
1764
+ * You may obtain a copy of the License at
1765
+ *
1766
+ * http://www.apache.org/licenses/LICENSE-2.0
1767
+ *
1768
+ * Unless required by applicable law or agreed to in writing, software
1769
+ * distributed under the License is distributed on an "AS IS" BASIS,
1770
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1771
+ * See the License for the specific language governing permissions and
1772
+ * limitations under the License.
1773
+ */
1774
+ function dn() {
1775
+ return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
1776
+ // This is especially true for Cordova apps which have unreliable
1777
+ // navigator.onLine behavior unless cordova-plugin-network-information is
1778
+ // installed which overwrites the native navigator.onLine value and
1779
+ // defines navigator.connection.
1780
+ (hn() || $t() || "connection" in navigator) ? navigator.onLine : !0;
1781
+ }
1782
+ function un() {
1783
+ if (typeof navigator > "u")
1784
+ return null;
1785
+ const r = navigator;
1786
+ return (
1787
+ // Most reliable, but only supported in Chrome/Firefox.
1788
+ r.languages && r.languages[0] || // Supported in most browsers, but returns the language of the browser
1789
+ // UI, not the language set in browser settings.
1790
+ r.language || // Couldn't determine language.
1791
+ null
1792
+ );
1793
+ }
1794
+ /**
1795
+ * @license
1796
+ * Copyright 2020 Google LLC
1797
+ *
1798
+ * Licensed under the Apache License, Version 2.0 (the "License");
1799
+ * you may not use this file except in compliance with the License.
1800
+ * You may obtain a copy of the License at
1801
+ *
1802
+ * http://www.apache.org/licenses/LICENSE-2.0
1803
+ *
1804
+ * Unless required by applicable law or agreed to in writing, software
1805
+ * distributed under the License is distributed on an "AS IS" BASIS,
1806
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1807
+ * See the License for the specific language governing permissions and
1808
+ * limitations under the License.
1809
+ */
1810
+ class U {
1811
+ constructor(e, t) {
1812
+ this.shortDelay = e, this.longDelay = t, V(t > e, "Short delay should be less than long delay!"), this.isMobile = xt() || Vt();
1813
+ }
1814
+ get() {
1815
+ return dn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
1816
+ }
1817
+ }
1818
+ /**
1819
+ * @license
1820
+ * Copyright 2020 Google LLC
1821
+ *
1822
+ * Licensed under the Apache License, Version 2.0 (the "License");
1823
+ * you may not use this file except in compliance with the License.
1824
+ * You may obtain a copy of the License at
1825
+ *
1826
+ * http://www.apache.org/licenses/LICENSE-2.0
1827
+ *
1828
+ * Unless required by applicable law or agreed to in writing, software
1829
+ * distributed under the License is distributed on an "AS IS" BASIS,
1830
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1831
+ * See the License for the specific language governing permissions and
1832
+ * limitations under the License.
1833
+ */
1834
+ function fn(r, e) {
1835
+ V(r.emulator, "Emulator should always be set here");
1836
+ const { url: t } = r.emulator;
1837
+ return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
1838
+ }
1839
+ /**
1840
+ * @license
1841
+ * Copyright 2020 Google LLC
1842
+ *
1843
+ * Licensed under the Apache License, Version 2.0 (the "License");
1844
+ * you may not use this file except in compliance with the License.
1845
+ * You may obtain a copy of the License at
1846
+ *
1847
+ * http://www.apache.org/licenses/LICENSE-2.0
1848
+ *
1849
+ * Unless required by applicable law or agreed to in writing, software
1850
+ * distributed under the License is distributed on an "AS IS" BASIS,
1851
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1852
+ * See the License for the specific language governing permissions and
1853
+ * limitations under the License.
1854
+ */
1855
+ class Ze {
1856
+ static initialize(e, t, n) {
1857
+ this.fetchImpl = e, t && (this.headersImpl = t), n && (this.responseImpl = n);
1858
+ }
1859
+ static fetch() {
1860
+ if (this.fetchImpl)
1861
+ return this.fetchImpl;
1862
+ if (typeof self < "u" && "fetch" in self)
1863
+ return self.fetch;
1864
+ if (typeof globalThis < "u" && globalThis.fetch)
1865
+ return globalThis.fetch;
1866
+ if (typeof fetch < "u")
1867
+ return fetch;
1868
+ O("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
1869
+ }
1870
+ static headers() {
1871
+ if (this.headersImpl)
1872
+ return this.headersImpl;
1873
+ if (typeof self < "u" && "Headers" in self)
1874
+ return self.Headers;
1875
+ if (typeof globalThis < "u" && globalThis.Headers)
1876
+ return globalThis.Headers;
1877
+ if (typeof Headers < "u")
1878
+ return Headers;
1879
+ O("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
1880
+ }
1881
+ static response() {
1882
+ if (this.responseImpl)
1883
+ return this.responseImpl;
1884
+ if (typeof self < "u" && "Response" in self)
1885
+ return self.Response;
1886
+ if (typeof globalThis < "u" && globalThis.Response)
1887
+ return globalThis.Response;
1888
+ if (typeof Response < "u")
1889
+ return Response;
1890
+ O("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
1891
+ }
1892
+ }
1893
+ /**
1894
+ * @license
1895
+ * Copyright 2020 Google LLC
1896
+ *
1897
+ * Licensed under the Apache License, Version 2.0 (the "License");
1898
+ * you may not use this file except in compliance with the License.
1899
+ * You may obtain a copy of the License at
1900
+ *
1901
+ * http://www.apache.org/licenses/LICENSE-2.0
1902
+ *
1903
+ * Unless required by applicable law or agreed to in writing, software
1904
+ * distributed under the License is distributed on an "AS IS" BASIS,
1905
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1906
+ * See the License for the specific language governing permissions and
1907
+ * limitations under the License.
1908
+ */
1909
+ const pn = {
1910
+ // Custom token errors.
1911
+ CREDENTIAL_MISMATCH: "custom-token-mismatch",
1912
+ // This can only happen if the SDK sends a bad request.
1913
+ MISSING_CUSTOM_TOKEN: "internal-error",
1914
+ // Create Auth URI errors.
1915
+ INVALID_IDENTIFIER: "invalid-email",
1916
+ // This can only happen if the SDK sends a bad request.
1917
+ MISSING_CONTINUE_URI: "internal-error",
1918
+ // Sign in with email and password errors (some apply to sign up too).
1919
+ INVALID_PASSWORD: "wrong-password",
1920
+ // This can only happen if the SDK sends a bad request.
1921
+ MISSING_PASSWORD: "missing-password",
1922
+ // Thrown if Email Enumeration Protection is enabled in the project and the email or password is
1923
+ // invalid.
1924
+ INVALID_LOGIN_CREDENTIALS: "invalid-credential",
1925
+ // Sign up with email and password errors.
1926
+ EMAIL_EXISTS: "email-already-in-use",
1927
+ PASSWORD_LOGIN_DISABLED: "operation-not-allowed",
1928
+ // Verify assertion for sign in with credential errors:
1929
+ INVALID_IDP_RESPONSE: "invalid-credential",
1930
+ INVALID_PENDING_TOKEN: "invalid-credential",
1931
+ FEDERATED_USER_ID_ALREADY_LINKED: "credential-already-in-use",
1932
+ // This can only happen if the SDK sends a bad request.
1933
+ MISSING_REQ_TYPE: "internal-error",
1934
+ // Send Password reset email errors:
1935
+ EMAIL_NOT_FOUND: "user-not-found",
1936
+ RESET_PASSWORD_EXCEED_LIMIT: "too-many-requests",
1937
+ EXPIRED_OOB_CODE: "expired-action-code",
1938
+ INVALID_OOB_CODE: "invalid-action-code",
1939
+ // This can only happen if the SDK sends a bad request.
1940
+ MISSING_OOB_CODE: "internal-error",
1941
+ // Operations that require ID token in request:
1942
+ CREDENTIAL_TOO_OLD_LOGIN_AGAIN: "requires-recent-login",
1943
+ INVALID_ID_TOKEN: "invalid-user-token",
1944
+ TOKEN_EXPIRED: "user-token-expired",
1945
+ USER_NOT_FOUND: "user-token-expired",
1946
+ // Other errors.
1947
+ TOO_MANY_ATTEMPTS_TRY_LATER: "too-many-requests",
1948
+ PASSWORD_DOES_NOT_MEET_REQUIREMENTS: "password-does-not-meet-requirements",
1949
+ // Phone Auth related errors.
1950
+ INVALID_CODE: "invalid-verification-code",
1951
+ INVALID_SESSION_INFO: "invalid-verification-id",
1952
+ INVALID_TEMPORARY_PROOF: "invalid-credential",
1953
+ MISSING_SESSION_INFO: "missing-verification-id",
1954
+ SESSION_EXPIRED: "code-expired",
1955
+ // Other action code errors when additional settings passed.
1956
+ // MISSING_CONTINUE_URI is getting mapped to INTERNAL_ERROR above.
1957
+ // This is OK as this error will be caught by client side validation.
1958
+ MISSING_ANDROID_PACKAGE_NAME: "missing-android-pkg-name",
1959
+ UNAUTHORIZED_DOMAIN: "unauthorized-continue-uri",
1960
+ // getProjectConfig errors when clientId is passed.
1961
+ INVALID_OAUTH_CLIENT_ID: "invalid-oauth-client-id",
1962
+ // User actions (sign-up or deletion) disabled errors.
1963
+ ADMIN_ONLY_OPERATION: "admin-restricted-operation",
1964
+ // Multi factor related errors.
1965
+ INVALID_MFA_PENDING_CREDENTIAL: "invalid-multi-factor-session",
1966
+ MFA_ENROLLMENT_NOT_FOUND: "multi-factor-info-not-found",
1967
+ MISSING_MFA_ENROLLMENT_ID: "missing-multi-factor-info",
1968
+ MISSING_MFA_PENDING_CREDENTIAL: "missing-multi-factor-session",
1969
+ SECOND_FACTOR_EXISTS: "second-factor-already-in-use",
1970
+ SECOND_FACTOR_LIMIT_EXCEEDED: "maximum-second-factor-count-exceeded",
1971
+ // Blocking functions related errors.
1972
+ BLOCKING_FUNCTION_ERROR_RESPONSE: "internal-error",
1973
+ // Recaptcha related errors.
1974
+ RECAPTCHA_NOT_ENABLED: "recaptcha-not-enabled",
1975
+ MISSING_RECAPTCHA_TOKEN: "missing-recaptcha-token",
1976
+ INVALID_RECAPTCHA_TOKEN: "invalid-recaptcha-token",
1977
+ INVALID_RECAPTCHA_ACTION: "invalid-recaptcha-action",
1978
+ MISSING_CLIENT_TYPE: "missing-client-type",
1979
+ MISSING_RECAPTCHA_VERSION: "missing-recaptcha-version",
1980
+ INVALID_RECAPTCHA_VERSION: "invalid-recaptcha-version",
1981
+ INVALID_REQ_TYPE: "invalid-req-type"
1982
+ /* AuthErrorCode.INVALID_REQ_TYPE */
1983
+ };
1984
+ /**
1985
+ * @license
1986
+ * Copyright 2020 Google LLC
1987
+ *
1988
+ * Licensed under the Apache License, Version 2.0 (the "License");
1989
+ * you may not use this file except in compliance with the License.
1990
+ * You may obtain a copy of the License at
1991
+ *
1992
+ * http://www.apache.org/licenses/LICENSE-2.0
1993
+ *
1994
+ * Unless required by applicable law or agreed to in writing, software
1995
+ * distributed under the License is distributed on an "AS IS" BASIS,
1996
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1997
+ * See the License for the specific language governing permissions and
1998
+ * limitations under the License.
1999
+ */
2000
+ const mn = new U(3e4, 6e4);
2001
+ function et(r, e) {
2002
+ return r.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: r.tenantId }) : e;
2003
+ }
2004
+ async function j(r, e, t, n, i = {}) {
2005
+ return tt(r, i, async () => {
2006
+ let s = {}, a = {};
2007
+ n && (e === "GET" ? a = n : s = {
2008
+ body: JSON.stringify(n)
2009
+ });
2010
+ const c = He(Object.assign({ key: r.config.apiKey }, a)).slice(1), o = await r._getAdditionalHeaders();
2011
+ o[
2012
+ "Content-Type"
2013
+ /* HttpHeader.CONTENT_TYPE */
2014
+ ] = "application/json", r.languageCode && (o[
2015
+ "X-Firebase-Locale"
2016
+ /* HttpHeader.X_FIREBASE_LOCALE */
2017
+ ] = r.languageCode);
2018
+ const l = Object.assign({
2019
+ method: e,
2020
+ headers: o
2021
+ }, s);
2022
+ return Ft() || (l.referrerPolicy = "no-referrer"), Ze.fetch()(rt(r, r.config.apiHost, t, c), l);
2023
+ });
2024
+ }
2025
+ async function tt(r, e, t) {
2026
+ r._canInitEmulator = !1;
2027
+ const n = Object.assign(Object.assign({}, pn), e);
2028
+ try {
2029
+ const i = new gn(r), s = await Promise.race([
2030
+ t(),
2031
+ i.promise
2032
+ ]);
2033
+ i.clearNetworkTimeout();
2034
+ const a = await s.json();
2035
+ if ("needConfirmation" in a)
2036
+ throw B(r, "account-exists-with-different-credential", a);
2037
+ if (s.ok && !("errorMessage" in a))
2038
+ return a;
2039
+ {
2040
+ const c = s.ok ? a.errorMessage : a.error.message, [o, l] = c.split(" : ");
2041
+ if (o === "FEDERATED_USER_ID_ALREADY_LINKED")
2042
+ throw B(r, "credential-already-in-use", a);
2043
+ if (o === "EMAIL_EXISTS")
2044
+ throw B(r, "email-already-in-use", a);
2045
+ if (o === "USER_DISABLED")
2046
+ throw B(r, "user-disabled", a);
2047
+ const u = n[o] || o.toLowerCase().replace(/[_\s]+/g, "-");
2048
+ if (l)
2049
+ throw Qe(r, u, l);
2050
+ Ne(r, u);
2051
+ }
2052
+ } catch (i) {
2053
+ if (i instanceof S)
2054
+ throw i;
2055
+ Ne(r, "network-request-failed", { message: String(i) });
2056
+ }
2057
+ }
2058
+ function rt(r, e, t, n) {
2059
+ const i = `${e}${t}?${n}`;
2060
+ return r.config.emulator ? fn(r.config, i) : `${r.config.apiScheme}://${i}`;
2061
+ }
2062
+ class gn {
2063
+ constructor(e) {
2064
+ this.auth = e, this.timer = null, this.promise = new Promise((t, n) => {
2065
+ this.timer = setTimeout(() => n(Ye(
2066
+ this.auth,
2067
+ "network-request-failed"
2068
+ /* AuthErrorCode.NETWORK_REQUEST_FAILED */
2069
+ )), mn.get());
2070
+ });
2071
+ }
2072
+ clearNetworkTimeout() {
2073
+ clearTimeout(this.timer);
2074
+ }
2075
+ }
2076
+ function B(r, e, t) {
2077
+ const n = {
2078
+ appName: r.name
2079
+ };
2080
+ t.email && (n.email = t.email), t.phoneNumber && (n.phoneNumber = t.phoneNumber);
2081
+ const i = Ye(r, e, n);
2082
+ return i.customData._tokenResponse = t, i;
2083
+ }
2084
+ /**
2085
+ * @license
2086
+ * Copyright 2020 Google LLC
2087
+ *
2088
+ * Licensed under the Apache License, Version 2.0 (the "License");
2089
+ * you may not use this file except in compliance with the License.
2090
+ * You may obtain a copy of the License at
2091
+ *
2092
+ * http://www.apache.org/licenses/LICENSE-2.0
2093
+ *
2094
+ * Unless required by applicable law or agreed to in writing, software
2095
+ * distributed under the License is distributed on an "AS IS" BASIS,
2096
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2097
+ * See the License for the specific language governing permissions and
2098
+ * limitations under the License.
2099
+ */
2100
+ async function _n(r, e) {
2101
+ return j(r, "POST", "/v1/accounts:delete", e);
2102
+ }
2103
+ async function nt(r, e) {
2104
+ return j(r, "POST", "/v1/accounts:lookup", e);
2105
+ }
2106
+ /**
2107
+ * @license
2108
+ * Copyright 2020 Google LLC
2109
+ *
2110
+ * Licensed under the Apache License, Version 2.0 (the "License");
2111
+ * you may not use this file except in compliance with the License.
2112
+ * You may obtain a copy of the License at
2113
+ *
2114
+ * http://www.apache.org/licenses/LICENSE-2.0
2115
+ *
2116
+ * Unless required by applicable law or agreed to in writing, software
2117
+ * distributed under the License is distributed on an "AS IS" BASIS,
2118
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2119
+ * See the License for the specific language governing permissions and
2120
+ * limitations under the License.
2121
+ */
2122
+ function k(r) {
2123
+ if (r)
2124
+ try {
2125
+ const e = new Date(Number(r));
2126
+ if (!isNaN(e.getTime()))
2127
+ return e.toUTCString();
2128
+ } catch {
2129
+ }
2130
+ }
2131
+ async function bn(r, e = !1) {
2132
+ const t = z(r), n = await t.getIdToken(e), i = it(n);
2133
+ h(
2134
+ i && i.exp && i.auth_time && i.iat,
2135
+ t.auth,
2136
+ "internal-error"
2137
+ /* AuthErrorCode.INTERNAL_ERROR */
2138
+ );
2139
+ const s = typeof i.firebase == "object" ? i.firebase : void 0, a = s == null ? void 0 : s.sign_in_provider;
2140
+ return {
2141
+ claims: i,
2142
+ token: n,
2143
+ authTime: k(ee(i.auth_time)),
2144
+ issuedAtTime: k(ee(i.iat)),
2145
+ expirationTime: k(ee(i.exp)),
2146
+ signInProvider: a || null,
2147
+ signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
2148
+ };
2149
+ }
2150
+ function ee(r) {
2151
+ return Number(r) * 1e3;
2152
+ }
2153
+ function it(r) {
2154
+ const [e, t, n] = r.split(".");
2155
+ if (e === void 0 || t === void 0 || n === void 0)
2156
+ return x("JWT malformed, contained fewer than 3 sections"), null;
2157
+ try {
2158
+ const i = $e(t);
2159
+ return i ? JSON.parse(i) : (x("Failed to decode base64 JWT payload"), null);
2160
+ } catch (i) {
2161
+ return x("Caught error parsing JWT payload as JSON", i == null ? void 0 : i.toString()), null;
2162
+ }
2163
+ }
2164
+ function Oe(r) {
2165
+ const e = it(r);
2166
+ return h(
2167
+ e,
2168
+ "internal-error"
2169
+ /* AuthErrorCode.INTERNAL_ERROR */
2170
+ ), h(
2171
+ typeof e.exp < "u",
2172
+ "internal-error"
2173
+ /* AuthErrorCode.INTERNAL_ERROR */
2174
+ ), h(
2175
+ typeof e.iat < "u",
2176
+ "internal-error"
2177
+ /* AuthErrorCode.INTERNAL_ERROR */
2178
+ ), Number(e.exp) - Number(e.iat);
2179
+ }
2180
+ /**
2181
+ * @license
2182
+ * Copyright 2020 Google LLC
2183
+ *
2184
+ * Licensed under the Apache License, Version 2.0 (the "License");
2185
+ * you may not use this file except in compliance with the License.
2186
+ * You may obtain a copy of the License at
2187
+ *
2188
+ * http://www.apache.org/licenses/LICENSE-2.0
2189
+ *
2190
+ * Unless required by applicable law or agreed to in writing, software
2191
+ * distributed under the License is distributed on an "AS IS" BASIS,
2192
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2193
+ * See the License for the specific language governing permissions and
2194
+ * limitations under the License.
2195
+ */
2196
+ async function ce(r, e, t = !1) {
2197
+ if (t)
2198
+ return e;
2199
+ try {
2200
+ return await e;
2201
+ } catch (n) {
2202
+ throw n instanceof S && vn(n) && r.auth.currentUser === r && await r.auth.signOut(), n;
2203
+ }
2204
+ }
2205
+ function vn({ code: r }) {
2206
+ return r === "auth/user-disabled" || r === "auth/user-token-expired";
2207
+ }
2208
+ /**
2209
+ * @license
2210
+ * Copyright 2020 Google LLC
2211
+ *
2212
+ * Licensed under the Apache License, Version 2.0 (the "License");
2213
+ * you may not use this file except in compliance with the License.
2214
+ * You may obtain a copy of the License at
2215
+ *
2216
+ * http://www.apache.org/licenses/LICENSE-2.0
2217
+ *
2218
+ * Unless required by applicable law or agreed to in writing, software
2219
+ * distributed under the License is distributed on an "AS IS" BASIS,
2220
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2221
+ * See the License for the specific language governing permissions and
2222
+ * limitations under the License.
2223
+ */
2224
+ class In {
2225
+ constructor(e) {
2226
+ this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
2227
+ }
2228
+ _start() {
2229
+ this.isRunning || (this.isRunning = !0, this.schedule());
2230
+ }
2231
+ _stop() {
2232
+ this.isRunning && (this.isRunning = !1, this.timerId !== null && clearTimeout(this.timerId));
2233
+ }
2234
+ getInterval(e) {
2235
+ var t;
2236
+ if (e) {
2237
+ const n = this.errorBackoff;
2238
+ return this.errorBackoff = Math.min(
2239
+ this.errorBackoff * 2,
2240
+ 96e4
2241
+ /* Duration.RETRY_BACKOFF_MAX */
2242
+ ), n;
2243
+ } else {
2244
+ this.errorBackoff = 3e4;
2245
+ const i = ((t = this.user.stsTokenManager.expirationTime) !== null && t !== void 0 ? t : 0) - Date.now() - 3e5;
2246
+ return Math.max(0, i);
2247
+ }
2248
+ }
2249
+ schedule(e = !1) {
2250
+ if (!this.isRunning)
2251
+ return;
2252
+ const t = this.getInterval(e);
2253
+ this.timerId = setTimeout(async () => {
2254
+ await this.iteration();
2255
+ }, t);
2256
+ }
2257
+ async iteration() {
2258
+ try {
2259
+ await this.user.getIdToken(!0);
2260
+ } catch (e) {
2261
+ (e == null ? void 0 : e.code) === "auth/network-request-failed" && this.schedule(
2262
+ /* wasError */
2263
+ !0
2264
+ );
2265
+ return;
2266
+ }
2267
+ this.schedule();
2268
+ }
2269
+ }
2270
+ /**
2271
+ * @license
2272
+ * Copyright 2020 Google LLC
2273
+ *
2274
+ * Licensed under the Apache License, Version 2.0 (the "License");
2275
+ * you may not use this file except in compliance with the License.
2276
+ * You may obtain a copy of the License at
2277
+ *
2278
+ * http://www.apache.org/licenses/LICENSE-2.0
2279
+ *
2280
+ * Unless required by applicable law or agreed to in writing, software
2281
+ * distributed under the License is distributed on an "AS IS" BASIS,
2282
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2283
+ * See the License for the specific language governing permissions and
2284
+ * limitations under the License.
2285
+ */
2286
+ class le {
2287
+ constructor(e, t) {
2288
+ this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
2289
+ }
2290
+ _initializeTime() {
2291
+ this.lastSignInTime = k(this.lastLoginAt), this.creationTime = k(this.createdAt);
2292
+ }
2293
+ _copy(e) {
2294
+ this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
2295
+ }
2296
+ toJSON() {
2297
+ return {
2298
+ createdAt: this.createdAt,
2299
+ lastLoginAt: this.lastLoginAt
2300
+ };
2301
+ }
2302
+ }
2303
+ /**
2304
+ * @license
2305
+ * Copyright 2019 Google LLC
2306
+ *
2307
+ * Licensed under the Apache License, Version 2.0 (the "License");
2308
+ * you may not use this file except in compliance with the License.
2309
+ * You may obtain a copy of the License at
2310
+ *
2311
+ * http://www.apache.org/licenses/LICENSE-2.0
2312
+ *
2313
+ * Unless required by applicable law or agreed to in writing, software
2314
+ * distributed under the License is distributed on an "AS IS" BASIS,
2315
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2316
+ * See the License for the specific language governing permissions and
2317
+ * limitations under the License.
2318
+ */
2319
+ async function H(r) {
2320
+ var e;
2321
+ const t = r.auth, n = await r.getIdToken(), i = await ce(r, nt(t, { idToken: n }));
2322
+ h(
2323
+ i == null ? void 0 : i.users.length,
2324
+ t,
2325
+ "internal-error"
2326
+ /* AuthErrorCode.INTERNAL_ERROR */
2327
+ );
2328
+ const s = i.users[0];
2329
+ r._notifyReloadListener(s);
2330
+ const a = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? st(s.providerUserInfo) : [], c = En(r.providerData, a), o = r.isAnonymous, l = !(r.email && s.passwordHash) && !(c != null && c.length), u = o ? l : !1, f = {
2331
+ uid: s.localId,
2332
+ displayName: s.displayName || null,
2333
+ photoURL: s.photoUrl || null,
2334
+ email: s.email || null,
2335
+ emailVerified: s.emailVerified || !1,
2336
+ phoneNumber: s.phoneNumber || null,
2337
+ tenantId: s.tenantId || null,
2338
+ providerData: c,
2339
+ metadata: new le(s.createdAt, s.lastLoginAt),
2340
+ isAnonymous: u
2341
+ };
2342
+ Object.assign(r, f);
2343
+ }
2344
+ async function yn(r) {
2345
+ const e = z(r);
2346
+ await H(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
2347
+ }
2348
+ function En(r, e) {
2349
+ return [...r.filter((n) => !e.some((i) => i.providerId === n.providerId)), ...e];
2350
+ }
2351
+ function st(r) {
2352
+ return r.map((e) => {
2353
+ var { providerId: t } = e, n = Je(e, ["providerId"]);
2354
+ return {
2355
+ providerId: t,
2356
+ uid: n.rawId || "",
2357
+ displayName: n.displayName || null,
2358
+ email: n.email || null,
2359
+ phoneNumber: n.phoneNumber || null,
2360
+ photoURL: n.photoUrl || null
2361
+ };
2362
+ });
2363
+ }
2364
+ /**
2365
+ * @license
2366
+ * Copyright 2020 Google LLC
2367
+ *
2368
+ * Licensed under the Apache License, Version 2.0 (the "License");
2369
+ * you may not use this file except in compliance with the License.
2370
+ * You may obtain a copy of the License at
2371
+ *
2372
+ * http://www.apache.org/licenses/LICENSE-2.0
2373
+ *
2374
+ * Unless required by applicable law or agreed to in writing, software
2375
+ * distributed under the License is distributed on an "AS IS" BASIS,
2376
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2377
+ * See the License for the specific language governing permissions and
2378
+ * limitations under the License.
2379
+ */
2380
+ async function wn(r, e) {
2381
+ const t = await tt(r, {}, async () => {
2382
+ const n = He({
2383
+ grant_type: "refresh_token",
2384
+ refresh_token: e
2385
+ }).slice(1), { tokenApiHost: i, apiKey: s } = r.config, a = rt(r, i, "/v1/token", `key=${s}`), c = await r._getAdditionalHeaders();
2386
+ return c[
2387
+ "Content-Type"
2388
+ /* HttpHeader.CONTENT_TYPE */
2389
+ ] = "application/x-www-form-urlencoded", Ze.fetch()(a, {
2390
+ method: "POST",
2391
+ headers: c,
2392
+ body: n
2393
+ });
2394
+ });
2395
+ return {
2396
+ accessToken: t.access_token,
2397
+ expiresIn: t.expires_in,
2398
+ refreshToken: t.refresh_token
2399
+ };
2400
+ }
2401
+ async function Sn(r, e) {
2402
+ return j(r, "POST", "/v2/accounts:revokeToken", et(r, e));
2403
+ }
2404
+ /**
2405
+ * @license
2406
+ * Copyright 2020 Google LLC
2407
+ *
2408
+ * Licensed under the Apache License, Version 2.0 (the "License");
2409
+ * you may not use this file except in compliance with the License.
2410
+ * You may obtain a copy of the License at
2411
+ *
2412
+ * http://www.apache.org/licenses/LICENSE-2.0
2413
+ *
2414
+ * Unless required by applicable law or agreed to in writing, software
2415
+ * distributed under the License is distributed on an "AS IS" BASIS,
2416
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2417
+ * See the License for the specific language governing permissions and
2418
+ * limitations under the License.
2419
+ */
2420
+ class T {
2421
+ constructor() {
2422
+ this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
2423
+ }
2424
+ get isExpired() {
2425
+ return !this.expirationTime || Date.now() > this.expirationTime - 3e4;
2426
+ }
2427
+ updateFromServerResponse(e) {
2428
+ h(
2429
+ e.idToken,
2430
+ "internal-error"
2431
+ /* AuthErrorCode.INTERNAL_ERROR */
2432
+ ), h(
2433
+ typeof e.idToken < "u",
2434
+ "internal-error"
2435
+ /* AuthErrorCode.INTERNAL_ERROR */
2436
+ ), h(
2437
+ typeof e.refreshToken < "u",
2438
+ "internal-error"
2439
+ /* AuthErrorCode.INTERNAL_ERROR */
2440
+ );
2441
+ const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : Oe(e.idToken);
2442
+ this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
2443
+ }
2444
+ updateFromIdToken(e) {
2445
+ h(
2446
+ e.length !== 0,
2447
+ "internal-error"
2448
+ /* AuthErrorCode.INTERNAL_ERROR */
2449
+ );
2450
+ const t = Oe(e);
2451
+ this.updateTokensAndExpiration(e, null, t);
2452
+ }
2453
+ async getToken(e, t = !1) {
2454
+ return !t && this.accessToken && !this.isExpired ? this.accessToken : (h(
2455
+ this.refreshToken,
2456
+ e,
2457
+ "user-token-expired"
2458
+ /* AuthErrorCode.TOKEN_EXPIRED */
2459
+ ), this.refreshToken ? (await this.refresh(e, this.refreshToken), this.accessToken) : null);
2460
+ }
2461
+ clearRefreshToken() {
2462
+ this.refreshToken = null;
2463
+ }
2464
+ async refresh(e, t) {
2465
+ const { accessToken: n, refreshToken: i, expiresIn: s } = await wn(e, t);
2466
+ this.updateTokensAndExpiration(n, i, Number(s));
2467
+ }
2468
+ updateTokensAndExpiration(e, t, n) {
2469
+ this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + n * 1e3;
2470
+ }
2471
+ static fromJSON(e, t) {
2472
+ const { refreshToken: n, accessToken: i, expirationTime: s } = t, a = new T();
2473
+ return n && (h(typeof n == "string", "internal-error", {
2474
+ appName: e
2475
+ }), a.refreshToken = n), i && (h(typeof i == "string", "internal-error", {
2476
+ appName: e
2477
+ }), a.accessToken = i), s && (h(typeof s == "number", "internal-error", {
2478
+ appName: e
2479
+ }), a.expirationTime = s), a;
2480
+ }
2481
+ toJSON() {
2482
+ return {
2483
+ refreshToken: this.refreshToken,
2484
+ accessToken: this.accessToken,
2485
+ expirationTime: this.expirationTime
2486
+ };
2487
+ }
2488
+ _assign(e) {
2489
+ this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
2490
+ }
2491
+ _clone() {
2492
+ return Object.assign(new T(), this.toJSON());
2493
+ }
2494
+ _performRefresh() {
2495
+ return O("not implemented");
2496
+ }
2497
+ }
2498
+ /**
2499
+ * @license
2500
+ * Copyright 2020 Google LLC
2501
+ *
2502
+ * Licensed under the Apache License, Version 2.0 (the "License");
2503
+ * you may not use this file except in compliance with the License.
2504
+ * You may obtain a copy of the License at
2505
+ *
2506
+ * http://www.apache.org/licenses/LICENSE-2.0
2507
+ *
2508
+ * Unless required by applicable law or agreed to in writing, software
2509
+ * distributed under the License is distributed on an "AS IS" BASIS,
2510
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2511
+ * See the License for the specific language governing permissions and
2512
+ * limitations under the License.
2513
+ */
2514
+ function g(r, e) {
2515
+ h(typeof r == "string" || typeof r > "u", "internal-error", { appName: e });
2516
+ }
2517
+ class _ {
2518
+ constructor(e) {
2519
+ var { uid: t, auth: n, stsTokenManager: i } = e, s = Je(e, ["uid", "auth", "stsTokenManager"]);
2520
+ this.providerId = "firebase", this.proactiveRefresh = new In(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = n, 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 le(s.createdAt || void 0, s.lastLoginAt || void 0);
2521
+ }
2522
+ async getIdToken(e) {
2523
+ const t = await ce(this, this.stsTokenManager.getToken(this.auth, e));
2524
+ return h(
2525
+ t,
2526
+ this.auth,
2527
+ "internal-error"
2528
+ /* AuthErrorCode.INTERNAL_ERROR */
2529
+ ), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
2530
+ }
2531
+ getIdTokenResult(e) {
2532
+ return bn(this, e);
2533
+ }
2534
+ reload() {
2535
+ return yn(this);
2536
+ }
2537
+ _assign(e) {
2538
+ this !== e && (h(
2539
+ this.uid === e.uid,
2540
+ this.auth,
2541
+ "internal-error"
2542
+ /* AuthErrorCode.INTERNAL_ERROR */
2543
+ ), 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));
2544
+ }
2545
+ _clone(e) {
2546
+ const t = new _(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
2547
+ return t.metadata._copy(this.metadata), t;
2548
+ }
2549
+ _onReload(e) {
2550
+ h(
2551
+ !this.reloadListener,
2552
+ this.auth,
2553
+ "internal-error"
2554
+ /* AuthErrorCode.INTERNAL_ERROR */
2555
+ ), this.reloadListener = e, this.reloadUserInfo && (this._notifyReloadListener(this.reloadUserInfo), this.reloadUserInfo = null);
2556
+ }
2557
+ _notifyReloadListener(e) {
2558
+ this.reloadListener ? this.reloadListener(e) : this.reloadUserInfo = e;
2559
+ }
2560
+ _startProactiveRefresh() {
2561
+ this.proactiveRefresh._start();
2562
+ }
2563
+ _stopProactiveRefresh() {
2564
+ this.proactiveRefresh._stop();
2565
+ }
2566
+ async _updateTokensIfNecessary(e, t = !1) {
2567
+ let n = !1;
2568
+ e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), n = !0), t && await H(this), await this.auth._persistUserIfCurrent(this), n && this.auth._notifyListenersIfCurrent(this);
2569
+ }
2570
+ async delete() {
2571
+ if (D(this.auth.app))
2572
+ return Promise.reject(F(this.auth));
2573
+ const e = await this.getIdToken();
2574
+ return await ce(this, _n(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
2575
+ }
2576
+ toJSON() {
2577
+ return Object.assign(Object.assign({
2578
+ uid: this.uid,
2579
+ email: this.email || void 0,
2580
+ emailVerified: this.emailVerified,
2581
+ displayName: this.displayName || void 0,
2582
+ isAnonymous: this.isAnonymous,
2583
+ photoURL: this.photoURL || void 0,
2584
+ phoneNumber: this.phoneNumber || void 0,
2585
+ tenantId: this.tenantId || void 0,
2586
+ providerData: this.providerData.map((e) => Object.assign({}, e)),
2587
+ stsTokenManager: this.stsTokenManager.toJSON(),
2588
+ // Redirect event ID must be maintained in case there is a pending
2589
+ // redirect event.
2590
+ _redirectEventId: this._redirectEventId
2591
+ }, this.metadata.toJSON()), {
2592
+ // Required for compatibility with the legacy SDK (go/firebase-auth-sdk-persistence-parsing):
2593
+ apiKey: this.auth.config.apiKey,
2594
+ appName: this.auth.name
2595
+ });
2596
+ }
2597
+ get refreshToken() {
2598
+ return this.stsTokenManager.refreshToken || "";
2599
+ }
2600
+ static _fromJSON(e, t) {
2601
+ var n, i, s, a, c, o, l, u;
2602
+ const f = (n = t.displayName) !== null && n !== void 0 ? n : void 0, v = (i = t.email) !== null && i !== void 0 ? i : void 0, I = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, M = (a = t.photoURL) !== null && a !== void 0 ? a : void 0, fe = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, W = (o = t._redirectEventId) !== null && o !== void 0 ? o : void 0, pe = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, me = (u = t.lastLoginAt) !== null && u !== void 0 ? u : void 0, { uid: G, emailVerified: ge, isAnonymous: _e, providerData: K, stsTokenManager: be } = t;
2603
+ h(
2604
+ G && be,
2605
+ e,
2606
+ "internal-error"
2607
+ /* AuthErrorCode.INTERNAL_ERROR */
2608
+ );
2609
+ const ct = T.fromJSON(this.name, be);
2610
+ h(
2611
+ typeof G == "string",
2612
+ e,
2613
+ "internal-error"
2614
+ /* AuthErrorCode.INTERNAL_ERROR */
2615
+ ), g(f, e.name), g(v, e.name), h(
2616
+ typeof ge == "boolean",
2617
+ e,
2618
+ "internal-error"
2619
+ /* AuthErrorCode.INTERNAL_ERROR */
2620
+ ), h(
2621
+ typeof _e == "boolean",
2622
+ e,
2623
+ "internal-error"
2624
+ /* AuthErrorCode.INTERNAL_ERROR */
2625
+ ), g(I, e.name), g(M, e.name), g(fe, e.name), g(W, e.name), g(pe, e.name), g(me, e.name);
2626
+ const J = new _({
2627
+ uid: G,
2628
+ auth: e,
2629
+ email: v,
2630
+ emailVerified: ge,
2631
+ displayName: f,
2632
+ isAnonymous: _e,
2633
+ photoURL: M,
2634
+ phoneNumber: I,
2635
+ tenantId: fe,
2636
+ stsTokenManager: ct,
2637
+ createdAt: pe,
2638
+ lastLoginAt: me
2639
+ });
2640
+ return K && Array.isArray(K) && (J.providerData = K.map((lt) => Object.assign({}, lt))), W && (J._redirectEventId = W), J;
2641
+ }
2642
+ /**
2643
+ * Initialize a User from an idToken server response
2644
+ * @param auth
2645
+ * @param idTokenResponse
2646
+ */
2647
+ static async _fromIdTokenResponse(e, t, n = !1) {
2648
+ const i = new T();
2649
+ i.updateFromServerResponse(t);
2650
+ const s = new _({
2651
+ uid: t.localId,
2652
+ auth: e,
2653
+ stsTokenManager: i,
2654
+ isAnonymous: n
2655
+ });
2656
+ return await H(s), s;
2657
+ }
2658
+ /**
2659
+ * Initialize a User from an idToken server response
2660
+ * @param auth
2661
+ * @param idTokenResponse
2662
+ */
2663
+ static async _fromGetAccountInfoResponse(e, t, n) {
2664
+ const i = t.users[0];
2665
+ h(
2666
+ i.localId !== void 0,
2667
+ "internal-error"
2668
+ /* AuthErrorCode.INTERNAL_ERROR */
2669
+ );
2670
+ const s = i.providerUserInfo !== void 0 ? st(i.providerUserInfo) : [], a = !(i.email && i.passwordHash) && !(s != null && s.length), c = new T();
2671
+ c.updateFromIdToken(n);
2672
+ const o = new _({
2673
+ uid: i.localId,
2674
+ auth: e,
2675
+ stsTokenManager: c,
2676
+ isAnonymous: a
2677
+ }), l = {
2678
+ uid: i.localId,
2679
+ displayName: i.displayName || null,
2680
+ photoURL: i.photoUrl || null,
2681
+ email: i.email || null,
2682
+ emailVerified: i.emailVerified || !1,
2683
+ phoneNumber: i.phoneNumber || null,
2684
+ tenantId: i.tenantId || null,
2685
+ providerData: s,
2686
+ metadata: new le(i.createdAt, i.lastLoginAt),
2687
+ isAnonymous: !(i.email && i.passwordHash) && !(s != null && s.length)
2688
+ };
2689
+ return Object.assign(o, l), o;
2690
+ }
2691
+ }
2692
+ /**
2693
+ * @license
2694
+ * Copyright 2020 Google LLC
2695
+ *
2696
+ * Licensed under the Apache License, Version 2.0 (the "License");
2697
+ * you may not use this file except in compliance with the License.
2698
+ * You may obtain a copy of the License at
2699
+ *
2700
+ * http://www.apache.org/licenses/LICENSE-2.0
2701
+ *
2702
+ * Unless required by applicable law or agreed to in writing, software
2703
+ * distributed under the License is distributed on an "AS IS" BASIS,
2704
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2705
+ * See the License for the specific language governing permissions and
2706
+ * limitations under the License.
2707
+ */
2708
+ const ke = /* @__PURE__ */ new Map();
2709
+ function E(r) {
2710
+ V(r instanceof Function, "Expected a class definition");
2711
+ let e = ke.get(r);
2712
+ return e ? (V(e instanceof r, "Instance stored in cache mismatched with class"), e) : (e = new r(), ke.set(r, e), e);
2713
+ }
2714
+ /**
2715
+ * @license
2716
+ * Copyright 2019 Google LLC
2717
+ *
2718
+ * Licensed under the Apache License, Version 2.0 (the "License");
2719
+ * you may not use this file except in compliance with the License.
2720
+ * You may obtain a copy of the License at
2721
+ *
2722
+ * http://www.apache.org/licenses/LICENSE-2.0
2723
+ *
2724
+ * Unless required by applicable law or agreed to in writing, software
2725
+ * distributed under the License is distributed on an "AS IS" BASIS,
2726
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2727
+ * See the License for the specific language governing permissions and
2728
+ * limitations under the License.
2729
+ */
2730
+ class at {
2731
+ constructor() {
2732
+ this.type = "NONE", this.storage = {};
2733
+ }
2734
+ async _isAvailable() {
2735
+ return !0;
2736
+ }
2737
+ async _set(e, t) {
2738
+ this.storage[e] = t;
2739
+ }
2740
+ async _get(e) {
2741
+ const t = this.storage[e];
2742
+ return t === void 0 ? null : t;
2743
+ }
2744
+ async _remove(e) {
2745
+ delete this.storage[e];
2746
+ }
2747
+ _addListener(e, t) {
2748
+ }
2749
+ _removeListener(e, t) {
2750
+ }
2751
+ }
2752
+ at.type = "NONE";
2753
+ const Pe = at;
2754
+ /**
2755
+ * @license
2756
+ * Copyright 2019 Google LLC
2757
+ *
2758
+ * Licensed under the Apache License, Version 2.0 (the "License");
2759
+ * you may not use this file except in compliance with the License.
2760
+ * You may obtain a copy of the License at
2761
+ *
2762
+ * http://www.apache.org/licenses/LICENSE-2.0
2763
+ *
2764
+ * Unless required by applicable law or agreed to in writing, software
2765
+ * distributed under the License is distributed on an "AS IS" BASIS,
2766
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2767
+ * See the License for the specific language governing permissions and
2768
+ * limitations under the License.
2769
+ */
2770
+ function te(r, e, t) {
2771
+ return `firebase:${r}:${e}:${t}`;
2772
+ }
2773
+ class C {
2774
+ constructor(e, t, n) {
2775
+ this.persistence = e, this.auth = t, this.userKey = n;
2776
+ const { config: i, name: s } = this.auth;
2777
+ this.fullUserKey = te(this.userKey, i.apiKey, s), this.fullPersistenceKey = te("persistence", i.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
2778
+ }
2779
+ setCurrentUser(e) {
2780
+ return this.persistence._set(this.fullUserKey, e.toJSON());
2781
+ }
2782
+ async getCurrentUser() {
2783
+ const e = await this.persistence._get(this.fullUserKey);
2784
+ return e ? _._fromJSON(this.auth, e) : null;
2785
+ }
2786
+ removeCurrentUser() {
2787
+ return this.persistence._remove(this.fullUserKey);
2788
+ }
2789
+ savePersistenceForRedirect() {
2790
+ return this.persistence._set(this.fullPersistenceKey, this.persistence.type);
2791
+ }
2792
+ async setPersistence(e) {
2793
+ if (this.persistence === e)
2794
+ return;
2795
+ const t = await this.getCurrentUser();
2796
+ if (await this.removeCurrentUser(), this.persistence = e, t)
2797
+ return this.setCurrentUser(t);
2798
+ }
2799
+ delete() {
2800
+ this.persistence._removeListener(this.fullUserKey, this.boundEventHandler);
2801
+ }
2802
+ static async create(e, t, n = "authUser") {
2803
+ if (!t.length)
2804
+ return new C(E(Pe), e, n);
2805
+ const i = (await Promise.all(t.map(async (l) => {
2806
+ if (await l._isAvailable())
2807
+ return l;
2808
+ }))).filter((l) => l);
2809
+ let s = i[0] || E(Pe);
2810
+ const a = te(n, e.config.apiKey, e.name);
2811
+ let c = null;
2812
+ for (const l of t)
2813
+ try {
2814
+ const u = await l._get(a);
2815
+ if (u) {
2816
+ const f = _._fromJSON(e, u);
2817
+ l !== s && (c = f), s = l;
2818
+ break;
2819
+ }
2820
+ } catch {
2821
+ }
2822
+ const o = i.filter((l) => l._shouldAllowMigration);
2823
+ return !s._shouldAllowMigration || !o.length ? new C(s, e, n) : (s = o[0], c && await s._set(a, c.toJSON()), await Promise.all(t.map(async (l) => {
2824
+ if (l !== s)
2825
+ try {
2826
+ await l._remove(a);
2827
+ } catch {
2828
+ }
2829
+ })), new C(s, e, n));
2830
+ }
2831
+ }
2832
+ /**
2833
+ * @license
2834
+ * Copyright 2020 Google LLC
2835
+ *
2836
+ * Licensed under the Apache License, Version 2.0 (the "License");
2837
+ * you may not use this file except in compliance with the License.
2838
+ * You may obtain a copy of the License at
2839
+ *
2840
+ * http://www.apache.org/licenses/LICENSE-2.0
2841
+ *
2842
+ * Unless required by applicable law or agreed to in writing, software
2843
+ * distributed under the License is distributed on an "AS IS" BASIS,
2844
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2845
+ * See the License for the specific language governing permissions and
2846
+ * limitations under the License.
2847
+ */
2848
+ function Re(r) {
2849
+ const e = r.toLowerCase();
2850
+ if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
2851
+ return "Opera";
2852
+ if (Nn(e))
2853
+ return "IEMobile";
2854
+ if (e.includes("msie") || e.includes("trident/"))
2855
+ return "IE";
2856
+ if (e.includes("edge/"))
2857
+ return "Edge";
2858
+ if (An(e))
2859
+ return "Firefox";
2860
+ if (e.includes("silk/"))
2861
+ return "Silk";
2862
+ if (On(e))
2863
+ return "Blackberry";
2864
+ if (kn(e))
2865
+ return "Webos";
2866
+ if (Tn(e))
2867
+ return "Safari";
2868
+ if ((e.includes("chrome/") || Cn(e)) && !e.includes("edge/"))
2869
+ return "Chrome";
2870
+ if (Dn(e))
2871
+ return "Android";
2872
+ {
2873
+ const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, n = r.match(t);
2874
+ if ((n == null ? void 0 : n.length) === 2)
2875
+ return n[1];
2876
+ }
2877
+ return "Other";
2878
+ }
2879
+ function An(r = p()) {
2880
+ return /firefox\//i.test(r);
2881
+ }
2882
+ function Tn(r = p()) {
2883
+ const e = r.toLowerCase();
2884
+ return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
2885
+ }
2886
+ function Cn(r = p()) {
2887
+ return /crios\//i.test(r);
2888
+ }
2889
+ function Nn(r = p()) {
2890
+ return /iemobile/i.test(r);
2891
+ }
2892
+ function Dn(r = p()) {
2893
+ return /android/i.test(r);
2894
+ }
2895
+ function On(r = p()) {
2896
+ return /blackberry/i.test(r);
2897
+ }
2898
+ function kn(r = p()) {
2899
+ return /webos/i.test(r);
2900
+ }
2901
+ /**
2902
+ * @license
2903
+ * Copyright 2020 Google LLC
2904
+ *
2905
+ * Licensed under the Apache License, Version 2.0 (the "License");
2906
+ * you may not use this file except in compliance with the License.
2907
+ * You may obtain a copy of the License at
2908
+ *
2909
+ * http://www.apache.org/licenses/LICENSE-2.0
2910
+ *
2911
+ * Unless required by applicable law or agreed to in writing, software
2912
+ * distributed under the License is distributed on an "AS IS" BASIS,
2913
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2914
+ * See the License for the specific language governing permissions and
2915
+ * limitations under the License.
2916
+ */
2917
+ function ot(r, e = []) {
2918
+ let t;
2919
+ switch (r) {
2920
+ case "Browser":
2921
+ t = Re(p());
2922
+ break;
2923
+ case "Worker":
2924
+ t = `${Re(p())}-${r}`;
2925
+ break;
2926
+ default:
2927
+ t = r;
2928
+ }
2929
+ const n = e.length ? e.join(",") : "FirebaseCore-web";
2930
+ return `${t}/JsCore/${de}/${n}`;
2931
+ }
2932
+ /**
2933
+ * @license
2934
+ * Copyright 2022 Google LLC
2935
+ *
2936
+ * Licensed under the Apache License, Version 2.0 (the "License");
2937
+ * you may not use this file except in compliance with the License.
2938
+ * You may obtain a copy of the License at
2939
+ *
2940
+ * http://www.apache.org/licenses/LICENSE-2.0
2941
+ *
2942
+ * Unless required by applicable law or agreed to in writing, software
2943
+ * distributed under the License is distributed on an "AS IS" BASIS,
2944
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2945
+ * See the License for the specific language governing permissions and
2946
+ * limitations under the License.
2947
+ */
2948
+ class Pn {
2949
+ constructor(e) {
2950
+ this.auth = e, this.queue = [];
2951
+ }
2952
+ pushCallback(e, t) {
2953
+ const n = (s) => new Promise((a, c) => {
2954
+ try {
2955
+ const o = e(s);
2956
+ a(o);
2957
+ } catch (o) {
2958
+ c(o);
2959
+ }
2960
+ });
2961
+ n.onAbort = t, this.queue.push(n);
2962
+ const i = this.queue.length - 1;
2963
+ return () => {
2964
+ this.queue[i] = () => Promise.resolve();
2965
+ };
2966
+ }
2967
+ async runMiddleware(e) {
2968
+ if (this.auth.currentUser === e)
2969
+ return;
2970
+ const t = [];
2971
+ try {
2972
+ for (const n of this.queue)
2973
+ await n(e), n.onAbort && t.push(n.onAbort);
2974
+ } catch (n) {
2975
+ t.reverse();
2976
+ for (const i of t)
2977
+ try {
2978
+ i();
2979
+ } catch {
2980
+ }
2981
+ throw this.auth._errorFactory.create("login-blocked", {
2982
+ originalMessage: n == null ? void 0 : n.message
2983
+ });
2984
+ }
2985
+ }
2986
+ }
2987
+ /**
2988
+ * @license
2989
+ * Copyright 2023 Google LLC
2990
+ *
2991
+ * Licensed under the Apache License, Version 2.0 (the "License");
2992
+ * you may not use this file except in compliance with the License.
2993
+ * You may obtain a copy of the License at
2994
+ *
2995
+ * http://www.apache.org/licenses/LICENSE-2.0
2996
+ *
2997
+ * Unless required by applicable law or agreed to in writing, software
2998
+ * distributed under the License is distributed on an "AS IS" BASIS,
2999
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3000
+ * See the License for the specific language governing permissions and
3001
+ * limitations under the License.
3002
+ */
3003
+ async function Rn(r, e = {}) {
3004
+ return j(r, "GET", "/v2/passwordPolicy", et(r, e));
3005
+ }
3006
+ /**
3007
+ * @license
3008
+ * Copyright 2023 Google LLC
3009
+ *
3010
+ * Licensed under the Apache License, Version 2.0 (the "License");
3011
+ * you may not use this file except in compliance with the License.
3012
+ * You may obtain a copy of the License at
3013
+ *
3014
+ * http://www.apache.org/licenses/LICENSE-2.0
3015
+ *
3016
+ * Unless required by applicable law or agreed to in writing, software
3017
+ * distributed under the License is distributed on an "AS IS" BASIS,
3018
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3019
+ * See the License for the specific language governing permissions and
3020
+ * limitations under the License.
3021
+ */
3022
+ const Ln = 6;
3023
+ class Un {
3024
+ constructor(e) {
3025
+ var t, n, i, s;
3026
+ const a = e.customStrengthOptions;
3027
+ this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = a.minPasswordLength) !== null && t !== void 0 ? t : Ln, a.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = a.maxPasswordLength), a.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = a.containsLowercaseCharacter), a.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = a.containsUppercaseCharacter), a.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = a.containsNumericCharacter), a.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = a.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (i = (n = e.allowedNonAlphanumericCharacters) === null || n === void 0 ? void 0 : n.join("")) !== null && i !== void 0 ? i : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
3028
+ }
3029
+ validatePassword(e) {
3030
+ var t, n, i, s, a, c;
3031
+ const o = {
3032
+ isValid: !0,
3033
+ passwordPolicy: this
3034
+ };
3035
+ return this.validatePasswordLengthOptions(e, o), this.validatePasswordCharacterOptions(e, o), o.isValid && (o.isValid = (t = o.meetsMinPasswordLength) !== null && t !== void 0 ? t : !0), o.isValid && (o.isValid = (n = o.meetsMaxPasswordLength) !== null && n !== void 0 ? n : !0), o.isValid && (o.isValid = (i = o.containsLowercaseLetter) !== null && i !== void 0 ? i : !0), o.isValid && (o.isValid = (s = o.containsUppercaseLetter) !== null && s !== void 0 ? s : !0), o.isValid && (o.isValid = (a = o.containsNumericCharacter) !== null && a !== void 0 ? a : !0), o.isValid && (o.isValid = (c = o.containsNonAlphanumericCharacter) !== null && c !== void 0 ? c : !0), o;
3036
+ }
3037
+ /**
3038
+ * Validates that the password meets the length options for the policy.
3039
+ *
3040
+ * @param password Password to validate.
3041
+ * @param status Validation status.
3042
+ */
3043
+ validatePasswordLengthOptions(e, t) {
3044
+ const n = this.customStrengthOptions.minPasswordLength, i = this.customStrengthOptions.maxPasswordLength;
3045
+ n && (t.meetsMinPasswordLength = e.length >= n), i && (t.meetsMaxPasswordLength = e.length <= i);
3046
+ }
3047
+ /**
3048
+ * Validates that the password meets the character options for the policy.
3049
+ *
3050
+ * @param password Password to validate.
3051
+ * @param status Validation status.
3052
+ */
3053
+ validatePasswordCharacterOptions(e, t) {
3054
+ this.updatePasswordCharacterOptionsStatuses(
3055
+ t,
3056
+ /* containsLowercaseCharacter= */
3057
+ !1,
3058
+ /* containsUppercaseCharacter= */
3059
+ !1,
3060
+ /* containsNumericCharacter= */
3061
+ !1,
3062
+ /* containsNonAlphanumericCharacter= */
3063
+ !1
3064
+ );
3065
+ let n;
3066
+ for (let i = 0; i < e.length; i++)
3067
+ n = e.charAt(i), this.updatePasswordCharacterOptionsStatuses(
3068
+ t,
3069
+ /* containsLowercaseCharacter= */
3070
+ n >= "a" && n <= "z",
3071
+ /* containsUppercaseCharacter= */
3072
+ n >= "A" && n <= "Z",
3073
+ /* containsNumericCharacter= */
3074
+ n >= "0" && n <= "9",
3075
+ /* containsNonAlphanumericCharacter= */
3076
+ this.allowedNonAlphanumericCharacters.includes(n)
3077
+ );
3078
+ }
3079
+ /**
3080
+ * Updates the running validation status with the statuses for the character options.
3081
+ * Expected to be called each time a character is processed to update each option status
3082
+ * based on the current character.
3083
+ *
3084
+ * @param status Validation status.
3085
+ * @param containsLowercaseCharacter Whether the character is a lowercase letter.
3086
+ * @param containsUppercaseCharacter Whether the character is an uppercase letter.
3087
+ * @param containsNumericCharacter Whether the character is a numeric character.
3088
+ * @param containsNonAlphanumericCharacter Whether the character is a non-alphanumeric character.
3089
+ */
3090
+ updatePasswordCharacterOptionsStatuses(e, t, n, i, s) {
3091
+ this.customStrengthOptions.containsLowercaseLetter && (e.containsLowercaseLetter || (e.containsLowercaseLetter = t)), this.customStrengthOptions.containsUppercaseLetter && (e.containsUppercaseLetter || (e.containsUppercaseLetter = n)), this.customStrengthOptions.containsNumericCharacter && (e.containsNumericCharacter || (e.containsNumericCharacter = i)), this.customStrengthOptions.containsNonAlphanumericCharacter && (e.containsNonAlphanumericCharacter || (e.containsNonAlphanumericCharacter = s));
3092
+ }
3093
+ }
3094
+ /**
3095
+ * @license
3096
+ * Copyright 2020 Google LLC
3097
+ *
3098
+ * Licensed under the Apache License, Version 2.0 (the "License");
3099
+ * you may not use this file except in compliance with the License.
3100
+ * You may obtain a copy of the License at
3101
+ *
3102
+ * http://www.apache.org/licenses/LICENSE-2.0
3103
+ *
3104
+ * Unless required by applicable law or agreed to in writing, software
3105
+ * distributed under the License is distributed on an "AS IS" BASIS,
3106
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3107
+ * See the License for the specific language governing permissions and
3108
+ * limitations under the License.
3109
+ */
3110
+ class Mn {
3111
+ constructor(e, t, n, i) {
3112
+ this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = n, this.config = i, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new Le(this), this.idTokenSubscription = new Le(this), this.beforeStateQueue = new Pn(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 = Xe, 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;
3113
+ }
3114
+ _initializeWithPersistence(e, t) {
3115
+ return t && (this._popupRedirectResolver = E(t)), this._initializationPromise = this.queue(async () => {
3116
+ var n, i;
3117
+ if (!this._deleted && (this.persistenceManager = await C.create(this, e), !this._deleted)) {
3118
+ if (!((n = this._popupRedirectResolver) === null || n === void 0) && n._shouldInitProactively)
3119
+ try {
3120
+ await this._popupRedirectResolver._initialize(this);
3121
+ } catch {
3122
+ }
3123
+ await this.initializeCurrentUser(t), this.lastNotifiedUid = ((i = this.currentUser) === null || i === void 0 ? void 0 : i.uid) || null, !this._deleted && (this._isInitialized = !0);
3124
+ }
3125
+ }), this._initializationPromise;
3126
+ }
3127
+ /**
3128
+ * If the persistence is changed in another window, the user manager will let us know
3129
+ */
3130
+ async _onStorageEvent() {
3131
+ if (this._deleted)
3132
+ return;
3133
+ const e = await this.assertedPersistence.getCurrentUser();
3134
+ if (!(!this.currentUser && !e)) {
3135
+ if (this.currentUser && e && this.currentUser.uid === e.uid) {
3136
+ this._currentUser._assign(e), await this.currentUser.getIdToken();
3137
+ return;
3138
+ }
3139
+ await this._updateCurrentUser(
3140
+ e,
3141
+ /* skipBeforeStateCallbacks */
3142
+ !0
3143
+ );
3144
+ }
3145
+ }
3146
+ async initializeCurrentUserFromIdToken(e) {
3147
+ try {
3148
+ const t = await nt(this, { idToken: e }), n = await _._fromGetAccountInfoResponse(this, t, e);
3149
+ await this.directlySetCurrentUser(n);
3150
+ } catch (t) {
3151
+ console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
3152
+ }
3153
+ }
3154
+ async initializeCurrentUser(e) {
3155
+ var t;
3156
+ if (D(this.app)) {
3157
+ const a = this.app.settings.authIdToken;
3158
+ return a ? new Promise((c) => {
3159
+ setTimeout(() => this.initializeCurrentUserFromIdToken(a).then(c, c));
3160
+ }) : this.directlySetCurrentUser(null);
3161
+ }
3162
+ const n = await this.assertedPersistence.getCurrentUser();
3163
+ let i = n, s = !1;
3164
+ if (e && this.config.authDomain) {
3165
+ await this.getOrInitRedirectPersistenceManager();
3166
+ const a = (t = this.redirectUser) === null || t === void 0 ? void 0 : t._redirectEventId, c = i == null ? void 0 : i._redirectEventId, o = await this.tryRedirectSignIn(e);
3167
+ (!a || a === c) && (o != null && o.user) && (i = o.user, s = !0);
3168
+ }
3169
+ if (!i)
3170
+ return this.directlySetCurrentUser(null);
3171
+ if (!i._redirectEventId) {
3172
+ if (s)
3173
+ try {
3174
+ await this.beforeStateQueue.runMiddleware(i);
3175
+ } catch (a) {
3176
+ i = n, this._popupRedirectResolver._overrideRedirectResult(this, () => Promise.reject(a));
3177
+ }
3178
+ return i ? this.reloadAndSetCurrentUserOrClear(i) : this.directlySetCurrentUser(null);
3179
+ }
3180
+ return h(
3181
+ this._popupRedirectResolver,
3182
+ this,
3183
+ "argument-error"
3184
+ /* AuthErrorCode.ARGUMENT_ERROR */
3185
+ ), await this.getOrInitRedirectPersistenceManager(), this.redirectUser && this.redirectUser._redirectEventId === i._redirectEventId ? this.directlySetCurrentUser(i) : this.reloadAndSetCurrentUserOrClear(i);
3186
+ }
3187
+ async tryRedirectSignIn(e) {
3188
+ let t = null;
3189
+ try {
3190
+ t = await this._popupRedirectResolver._completeRedirectFn(this, e, !0);
3191
+ } catch {
3192
+ await this._setRedirectUser(null);
3193
+ }
3194
+ return t;
3195
+ }
3196
+ async reloadAndSetCurrentUserOrClear(e) {
3197
+ try {
3198
+ await H(e);
3199
+ } catch (t) {
3200
+ if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
3201
+ return this.directlySetCurrentUser(null);
3202
+ }
3203
+ return this.directlySetCurrentUser(e);
3204
+ }
3205
+ useDeviceLanguage() {
3206
+ this.languageCode = un();
3207
+ }
3208
+ async _delete() {
3209
+ this._deleted = !0;
3210
+ }
3211
+ async updateCurrentUser(e) {
3212
+ if (D(this.app))
3213
+ return Promise.reject(F(this));
3214
+ const t = e ? z(e) : null;
3215
+ return t && h(
3216
+ t.auth.config.apiKey === this.config.apiKey,
3217
+ this,
3218
+ "invalid-user-token"
3219
+ /* AuthErrorCode.INVALID_AUTH */
3220
+ ), this._updateCurrentUser(t && t._clone(this));
3221
+ }
3222
+ async _updateCurrentUser(e, t = !1) {
3223
+ if (!this._deleted)
3224
+ return e && h(
3225
+ this.tenantId === e.tenantId,
3226
+ this,
3227
+ "tenant-id-mismatch"
3228
+ /* AuthErrorCode.TENANT_ID_MISMATCH */
3229
+ ), t || await this.beforeStateQueue.runMiddleware(e), this.queue(async () => {
3230
+ await this.directlySetCurrentUser(e), this.notifyAuthListeners();
3231
+ });
3232
+ }
3233
+ async signOut() {
3234
+ return D(this.app) ? Promise.reject(F(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
3235
+ null,
3236
+ /* skipBeforeStateCallbacks */
3237
+ !0
3238
+ ));
3239
+ }
3240
+ setPersistence(e) {
3241
+ return D(this.app) ? Promise.reject(F(this)) : this.queue(async () => {
3242
+ await this.assertedPersistence.setPersistence(E(e));
3243
+ });
3244
+ }
3245
+ _getRecaptchaConfig() {
3246
+ return this.tenantId == null ? this._agentRecaptchaConfig : this._tenantRecaptchaConfigs[this.tenantId];
3247
+ }
3248
+ async validatePassword(e) {
3249
+ this._getPasswordPolicyInternal() || await this._updatePasswordPolicy();
3250
+ const t = this._getPasswordPolicyInternal();
3251
+ return t.schemaVersion !== this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION ? Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version", {})) : t.validatePassword(e);
3252
+ }
3253
+ _getPasswordPolicyInternal() {
3254
+ return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
3255
+ }
3256
+ async _updatePasswordPolicy() {
3257
+ const e = await Rn(this), t = new Un(e);
3258
+ this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
3259
+ }
3260
+ _getPersistence() {
3261
+ return this.assertedPersistence.persistence.type;
3262
+ }
3263
+ _updateErrorMap(e) {
3264
+ this._errorFactory = new L("auth", "Firebase", e());
3265
+ }
3266
+ onAuthStateChanged(e, t, n) {
3267
+ return this.registerStateListener(this.authStateSubscription, e, t, n);
3268
+ }
3269
+ beforeAuthStateChanged(e, t) {
3270
+ return this.beforeStateQueue.pushCallback(e, t);
3271
+ }
3272
+ onIdTokenChanged(e, t, n) {
3273
+ return this.registerStateListener(this.idTokenSubscription, e, t, n);
3274
+ }
3275
+ authStateReady() {
3276
+ return new Promise((e, t) => {
3277
+ if (this.currentUser)
3278
+ e();
3279
+ else {
3280
+ const n = this.onAuthStateChanged(() => {
3281
+ n(), e();
3282
+ }, t);
3283
+ }
3284
+ });
3285
+ }
3286
+ /**
3287
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
3288
+ */
3289
+ async revokeAccessToken(e) {
3290
+ if (this.currentUser) {
3291
+ const t = await this.currentUser.getIdToken(), n = {
3292
+ providerId: "apple.com",
3293
+ tokenType: "ACCESS_TOKEN",
3294
+ token: e,
3295
+ idToken: t
3296
+ };
3297
+ this.tenantId != null && (n.tenantId = this.tenantId), await Sn(this, n);
3298
+ }
3299
+ }
3300
+ toJSON() {
3301
+ var e;
3302
+ return {
3303
+ apiKey: this.config.apiKey,
3304
+ authDomain: this.config.authDomain,
3305
+ appName: this.name,
3306
+ currentUser: (e = this._currentUser) === null || e === void 0 ? void 0 : e.toJSON()
3307
+ };
3308
+ }
3309
+ async _setRedirectUser(e, t) {
3310
+ const n = await this.getOrInitRedirectPersistenceManager(t);
3311
+ return e === null ? n.removeCurrentUser() : n.setCurrentUser(e);
3312
+ }
3313
+ async getOrInitRedirectPersistenceManager(e) {
3314
+ if (!this.redirectPersistenceManager) {
3315
+ const t = e && E(e) || this._popupRedirectResolver;
3316
+ h(
3317
+ t,
3318
+ this,
3319
+ "argument-error"
3320
+ /* AuthErrorCode.ARGUMENT_ERROR */
3321
+ ), this.redirectPersistenceManager = await C.create(
3322
+ this,
3323
+ [E(t._redirectPersistence)],
3324
+ "redirectUser"
3325
+ /* KeyName.REDIRECT_USER */
3326
+ ), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
3327
+ }
3328
+ return this.redirectPersistenceManager;
3329
+ }
3330
+ async _redirectUserForId(e) {
3331
+ var t, n;
3332
+ return this._isInitialized && await this.queue(async () => {
3333
+ }), ((t = this._currentUser) === null || t === void 0 ? void 0 : t._redirectEventId) === e ? this._currentUser : ((n = this.redirectUser) === null || n === void 0 ? void 0 : n._redirectEventId) === e ? this.redirectUser : null;
3334
+ }
3335
+ async _persistUserIfCurrent(e) {
3336
+ if (e === this.currentUser)
3337
+ return this.queue(async () => this.directlySetCurrentUser(e));
3338
+ }
3339
+ /** Notifies listeners only if the user is current */
3340
+ _notifyListenersIfCurrent(e) {
3341
+ e === this.currentUser && this.notifyAuthListeners();
3342
+ }
3343
+ _key() {
3344
+ return `${this.config.authDomain}:${this.config.apiKey}:${this.name}`;
3345
+ }
3346
+ _startProactiveRefresh() {
3347
+ this.isProactiveRefreshEnabled = !0, this.currentUser && this._currentUser._startProactiveRefresh();
3348
+ }
3349
+ _stopProactiveRefresh() {
3350
+ this.isProactiveRefreshEnabled = !1, this.currentUser && this._currentUser._stopProactiveRefresh();
3351
+ }
3352
+ /** Returns the current user cast as the internal type */
3353
+ get _currentUser() {
3354
+ return this.currentUser;
3355
+ }
3356
+ notifyAuthListeners() {
3357
+ var e, t;
3358
+ if (!this._isInitialized)
3359
+ return;
3360
+ this.idTokenSubscription.next(this.currentUser);
3361
+ const n = (t = (e = this.currentUser) === null || e === void 0 ? void 0 : e.uid) !== null && t !== void 0 ? t : null;
3362
+ this.lastNotifiedUid !== n && (this.lastNotifiedUid = n, this.authStateSubscription.next(this.currentUser));
3363
+ }
3364
+ registerStateListener(e, t, n, i) {
3365
+ if (this._deleted)
3366
+ return () => {
3367
+ };
3368
+ const s = typeof t == "function" ? t : t.next.bind(t);
3369
+ let a = !1;
3370
+ const c = this._isInitialized ? Promise.resolve() : this._initializationPromise;
3371
+ if (h(
3372
+ c,
3373
+ this,
3374
+ "internal-error"
3375
+ /* AuthErrorCode.INTERNAL_ERROR */
3376
+ ), c.then(() => {
3377
+ a || s(this.currentUser);
3378
+ }), typeof t == "function") {
3379
+ const o = e.addObserver(t, n, i);
3380
+ return () => {
3381
+ a = !0, o();
3382
+ };
3383
+ } else {
3384
+ const o = e.addObserver(t);
3385
+ return () => {
3386
+ a = !0, o();
3387
+ };
3388
+ }
3389
+ }
3390
+ /**
3391
+ * Unprotected (from race conditions) method to set the current user. This
3392
+ * should only be called from within a queued callback. This is necessary
3393
+ * because the queue shouldn't rely on another queued callback.
3394
+ */
3395
+ async directlySetCurrentUser(e) {
3396
+ 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();
3397
+ }
3398
+ queue(e) {
3399
+ return this.operations = this.operations.then(e, e), this.operations;
3400
+ }
3401
+ get assertedPersistence() {
3402
+ return h(
3403
+ this.persistenceManager,
3404
+ this,
3405
+ "internal-error"
3406
+ /* AuthErrorCode.INTERNAL_ERROR */
3407
+ ), this.persistenceManager;
3408
+ }
3409
+ _logFramework(e) {
3410
+ !e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = ot(this.config.clientPlatform, this._getFrameworks()));
3411
+ }
3412
+ _getFrameworks() {
3413
+ return this.frameworks;
3414
+ }
3415
+ async _getAdditionalHeaders() {
3416
+ var e;
3417
+ const t = {
3418
+ "X-Client-Version": this.clientVersion
3419
+ };
3420
+ this.app.options.appId && (t[
3421
+ "X-Firebase-gmpid"
3422
+ /* HttpHeader.X_FIREBASE_GMPID */
3423
+ ] = this.app.options.appId);
3424
+ const n = await ((e = this.heartbeatServiceProvider.getImmediate({
3425
+ optional: !0
3426
+ })) === null || e === void 0 ? void 0 : e.getHeartbeatsHeader());
3427
+ n && (t[
3428
+ "X-Firebase-Client"
3429
+ /* HttpHeader.X_FIREBASE_CLIENT */
3430
+ ] = n);
3431
+ const i = await this._getAppCheckToken();
3432
+ return i && (t[
3433
+ "X-Firebase-AppCheck"
3434
+ /* HttpHeader.X_FIREBASE_APP_CHECK */
3435
+ ] = i), t;
3436
+ }
3437
+ async _getAppCheckToken() {
3438
+ var e;
3439
+ const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
3440
+ return t != null && t.error && ln(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
3441
+ }
3442
+ }
3443
+ function Bn(r) {
3444
+ return z(r);
3445
+ }
3446
+ class Le {
3447
+ constructor(e) {
3448
+ this.auth = e, this.observer = null, this.addObserver = Kt((t) => this.observer = t);
3449
+ }
3450
+ get next() {
3451
+ return h(
3452
+ this.observer,
3453
+ this.auth,
3454
+ "internal-error"
3455
+ /* AuthErrorCode.INTERNAL_ERROR */
3456
+ ), this.observer.next.bind(this.observer);
3457
+ }
3458
+ }
3459
+ function xn(r, e) {
3460
+ const t = (e == null ? void 0 : e.persistence) || [], n = (Array.isArray(t) ? t : [t]).map(E);
3461
+ e != null && e.errorMap && r._updateErrorMap(e.errorMap), r._initializeWithPersistence(n, e == null ? void 0 : e.popupRedirectResolver);
3462
+ }
3463
+ new U(3e4, 6e4);
3464
+ /**
3465
+ * @license
3466
+ * Copyright 2020 Google LLC
3467
+ *
3468
+ * Licensed under the Apache License, Version 2.0 (the "License");
3469
+ * you may not use this file except in compliance with the License.
3470
+ * You may obtain a copy of the License at
3471
+ *
3472
+ * http://www.apache.org/licenses/LICENSE-2.0
3473
+ *
3474
+ * Unless required by applicable law or agreed to in writing, software
3475
+ * distributed under the License is distributed on an "AS IS" BASIS,
3476
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3477
+ * See the License for the specific language governing permissions and
3478
+ * limitations under the License.
3479
+ */
3480
+ new U(2e3, 1e4);
3481
+ /**
3482
+ * @license
3483
+ * Copyright 2020 Google LLC.
3484
+ *
3485
+ * Licensed under the Apache License, Version 2.0 (the "License");
3486
+ * you may not use this file except in compliance with the License.
3487
+ * You may obtain a copy of the License at
3488
+ *
3489
+ * http://www.apache.org/licenses/LICENSE-2.0
3490
+ *
3491
+ * Unless required by applicable law or agreed to in writing, software
3492
+ * distributed under the License is distributed on an "AS IS" BASIS,
3493
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3494
+ * See the License for the specific language governing permissions and
3495
+ * limitations under the License.
3496
+ */
3497
+ new U(3e4, 6e4);
3498
+ /**
3499
+ * @license
3500
+ * Copyright 2020 Google LLC.
3501
+ *
3502
+ * Licensed under the Apache License, Version 2.0 (the "License");
3503
+ * you may not use this file except in compliance with the License.
3504
+ * You may obtain a copy of the License at
3505
+ *
3506
+ * http://www.apache.org/licenses/LICENSE-2.0
3507
+ *
3508
+ * Unless required by applicable law or agreed to in writing, software
3509
+ * distributed under the License is distributed on an "AS IS" BASIS,
3510
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3511
+ * See the License for the specific language governing permissions and
3512
+ * limitations under the License.
3513
+ */
3514
+ new U(5e3, 15e3);
3515
+ var Ue = "@firebase/auth", Me = "1.7.9";
3516
+ /**
3517
+ * @license
3518
+ * Copyright 2020 Google LLC
3519
+ *
3520
+ * Licensed under the Apache License, Version 2.0 (the "License");
3521
+ * you may not use this file except in compliance with the License.
3522
+ * You may obtain a copy of the License at
3523
+ *
3524
+ * http://www.apache.org/licenses/LICENSE-2.0
3525
+ *
3526
+ * Unless required by applicable law or agreed to in writing, software
3527
+ * distributed under the License is distributed on an "AS IS" BASIS,
3528
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3529
+ * See the License for the specific language governing permissions and
3530
+ * limitations under the License.
3531
+ */
3532
+ class Fn {
3533
+ constructor(e) {
3534
+ this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
3535
+ }
3536
+ getUid() {
3537
+ var e;
3538
+ return this.assertAuthConfigured(), ((e = this.auth.currentUser) === null || e === void 0 ? void 0 : e.uid) || null;
3539
+ }
3540
+ async getToken(e) {
3541
+ return this.assertAuthConfigured(), await this.auth._initializationPromise, this.auth.currentUser ? { accessToken: await this.auth.currentUser.getIdToken(e) } : null;
3542
+ }
3543
+ addAuthTokenListener(e) {
3544
+ if (this.assertAuthConfigured(), this.internalListeners.has(e))
3545
+ return;
3546
+ const t = this.auth.onIdTokenChanged((n) => {
3547
+ e((n == null ? void 0 : n.stsTokenManager.accessToken) || null);
3548
+ });
3549
+ this.internalListeners.set(e, t), this.updateProactiveRefresh();
3550
+ }
3551
+ removeAuthTokenListener(e) {
3552
+ this.assertAuthConfigured();
3553
+ const t = this.internalListeners.get(e);
3554
+ t && (this.internalListeners.delete(e), t(), this.updateProactiveRefresh());
3555
+ }
3556
+ assertAuthConfigured() {
3557
+ h(
3558
+ this.auth._initializationPromise,
3559
+ "dependent-sdk-initialized-before-auth"
3560
+ /* AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH */
3561
+ );
3562
+ }
3563
+ updateProactiveRefresh() {
3564
+ this.internalListeners.size > 0 ? this.auth._startProactiveRefresh() : this.auth._stopProactiveRefresh();
3565
+ }
3566
+ }
3567
+ /**
3568
+ * @license
3569
+ * Copyright 2020 Google LLC
3570
+ *
3571
+ * Licensed under the Apache License, Version 2.0 (the "License");
3572
+ * you may not use this file except in compliance with the License.
3573
+ * You may obtain a copy of the License at
3574
+ *
3575
+ * http://www.apache.org/licenses/LICENSE-2.0
3576
+ *
3577
+ * Unless required by applicable law or agreed to in writing, software
3578
+ * distributed under the License is distributed on an "AS IS" BASIS,
3579
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3580
+ * See the License for the specific language governing permissions and
3581
+ * limitations under the License.
3582
+ */
3583
+ function $n(r) {
3584
+ switch (r) {
3585
+ case "Node":
3586
+ return "node";
3587
+ case "ReactNative":
3588
+ return "rn";
3589
+ case "Worker":
3590
+ return "webworker";
3591
+ case "Cordova":
3592
+ return "cordova";
3593
+ case "WebExtension":
3594
+ return "web-extension";
3595
+ default:
3596
+ return;
3597
+ }
3598
+ }
3599
+ function Vn(r) {
3600
+ P(new N(
3601
+ "auth",
3602
+ (e, { options: t }) => {
3603
+ const n = e.getProvider("app").getImmediate(), i = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: a, authDomain: c } = n.options;
3604
+ h(a && !a.includes(":"), "invalid-api-key", { appName: n.name });
3605
+ const o = {
3606
+ apiKey: a,
3607
+ authDomain: c,
3608
+ clientPlatform: r,
3609
+ apiHost: "identitytoolkit.googleapis.com",
3610
+ tokenApiHost: "securetoken.googleapis.com",
3611
+ apiScheme: "https",
3612
+ sdkClientVersion: ot(r)
3613
+ }, l = new Mn(n, i, s, o);
3614
+ return xn(l, t), l;
3615
+ },
3616
+ "PUBLIC"
3617
+ /* ComponentType.PUBLIC */
3618
+ ).setInstantiationMode(
3619
+ "EXPLICIT"
3620
+ /* InstantiationMode.EXPLICIT */
3621
+ ).setInstanceCreatedCallback((e, t, n) => {
3622
+ e.getProvider(
3623
+ "auth-internal"
3624
+ /* _ComponentName.AUTH_INTERNAL */
3625
+ ).initialize();
3626
+ })), P(new N(
3627
+ "auth-internal",
3628
+ (e) => {
3629
+ const t = Bn(e.getProvider(
3630
+ "auth"
3631
+ /* _ComponentName.AUTH */
3632
+ ).getImmediate());
3633
+ return ((n) => new Fn(n))(t);
3634
+ },
3635
+ "PRIVATE"
3636
+ /* ComponentType.PRIVATE */
3637
+ ).setInstantiationMode(
3638
+ "EXPLICIT"
3639
+ /* InstantiationMode.EXPLICIT */
3640
+ )), A(Ue, Me, $n(r)), A(Ue, Me, "esm2017");
3641
+ }
3642
+ /**
3643
+ * @license
3644
+ * Copyright 2021 Google LLC
3645
+ *
3646
+ * Licensed under the Apache License, Version 2.0 (the "License");
3647
+ * you may not use this file except in compliance with the License.
3648
+ * You may obtain a copy of the License at
3649
+ *
3650
+ * http://www.apache.org/licenses/LICENSE-2.0
3651
+ *
3652
+ * Unless required by applicable law or agreed to in writing, software
3653
+ * distributed under the License is distributed on an "AS IS" BASIS,
3654
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3655
+ * See the License for the specific language governing permissions and
3656
+ * limitations under the License.
3657
+ */
3658
+ const Hn = 5 * 60;
3659
+ Mt("authIdTokenMaxAge");
3660
+ Vn(
3661
+ "Browser"
3662
+ /* ClientPlatform.BROWSER */
3663
+ );
3664
+ var zn = { authClientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" } };
3665
+ const Jn = /* @__PURE__ */ pt({
3666
+ __name: "App",
3667
+ setup(r) {
3668
+ yt();
3669
+ const { state: e } = Ct(), t = ut();
3670
+ return qr(zn.firebase), mt(() => {
3671
+ e.isIframe && parent.postMessage({ event: "ready" }, "*");
3672
+ }), (n, i) => {
3673
+ const s = gt("RouterView");
3674
+ return _t(), bt(s, {
3675
+ key: vt(t).path
3676
+ });
3677
+ };
3678
+ }
3679
+ }), qn = {
3680
+ "en-US": wt,
3681
+ "zh-CN": At
3682
+ }, Xn = Tt;
3683
+ export {
3684
+ Jn as FmApp,
3685
+ qn as i18nMessages,
3686
+ Xn as routers
3687
+ };