@feedmepos/mf-mdm 1.6.8-beta.241 → 1.6.8-beta.243
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.
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as tt, i as
|
|
3
|
-
import { useCoreStore as
|
|
1
|
+
import { defineComponent as jt, ref as Wt, watch as ue, onMounted as Ht, resolveComponent as Ue, openBlock as de, createElementBlock as Me, createBlock as qt, createVNode as zt, nextTick as $t } from "vue";
|
|
2
|
+
import { r as pe, g as tt, i as Gt, a as Bt, _, b as De, C as Fe, c as nt, d as Kt, e as it, f as Jt, S as W, h as F, E as ve, j as Xt, k as Yt, L as rt, l as p, m as Qt, F as Ie, n as Zt, o as en, q as H, p as tn, s as nn, u as rn, t as sn, v as on, w as an } from "./index-b49fe254.js";
|
|
3
|
+
import { useCoreStore as cn } from "@feedmepos/mf-common";
|
|
4
4
|
import "pinia";
|
|
5
|
-
|
|
5
|
+
var ln = "firebase", un = "10.14.1";
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2020 Google LLC
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
pe(ln, un, "app");
|
|
23
|
+
function we(n, e) {
|
|
6
24
|
var t = {};
|
|
7
25
|
for (var i in n)
|
|
8
26
|
Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
@@ -11,12 +29,12 @@ function Ie(n, e) {
|
|
|
11
29
|
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
|
12
30
|
return t;
|
|
13
31
|
}
|
|
14
|
-
function
|
|
32
|
+
function st() {
|
|
15
33
|
return {
|
|
16
34
|
"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."
|
|
17
35
|
};
|
|
18
36
|
}
|
|
19
|
-
const
|
|
37
|
+
const dn = st, ot = new ve("auth", "Firebase", st());
|
|
20
38
|
/**
|
|
21
39
|
* @license
|
|
22
40
|
* Copyright 2020 Google LLC
|
|
@@ -34,11 +52,11 @@ const an = rt, st = new _e("auth", "Firebase", rt());
|
|
|
34
52
|
* limitations under the License.
|
|
35
53
|
*/
|
|
36
54
|
const Y = new Qt("@firebase/auth");
|
|
37
|
-
function
|
|
38
|
-
Y.logLevel <=
|
|
55
|
+
function hn(n, ...e) {
|
|
56
|
+
Y.logLevel <= rt.WARN && Y.warn(`Auth (${W}): ${n}`, ...e);
|
|
39
57
|
}
|
|
40
|
-
function
|
|
41
|
-
Y.logLevel <=
|
|
58
|
+
function B(n, ...e) {
|
|
59
|
+
Y.logLevel <= rt.ERROR && Y.error(`Auth (${W}): ${n}`, ...e);
|
|
42
60
|
}
|
|
43
61
|
/**
|
|
44
62
|
* @license
|
|
@@ -57,34 +75,34 @@ function G(n, ...e) {
|
|
|
57
75
|
* limitations under the License.
|
|
58
76
|
*/
|
|
59
77
|
function y(n, ...e) {
|
|
60
|
-
throw
|
|
78
|
+
throw ye(n, ...e);
|
|
61
79
|
}
|
|
62
80
|
function g(n, ...e) {
|
|
63
|
-
return
|
|
81
|
+
return ye(n, ...e);
|
|
64
82
|
}
|
|
65
|
-
function
|
|
66
|
-
const i = Object.assign(Object.assign({},
|
|
67
|
-
return new
|
|
83
|
+
function at(n, e, t) {
|
|
84
|
+
const i = Object.assign(Object.assign({}, dn()), { [e]: t });
|
|
85
|
+
return new ve("auth", "Firebase", i).create(e, {
|
|
68
86
|
appName: n.name
|
|
69
87
|
});
|
|
70
88
|
}
|
|
71
89
|
function A(n) {
|
|
72
|
-
return
|
|
90
|
+
return at(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
73
91
|
}
|
|
74
|
-
function
|
|
92
|
+
function ye(n, ...e) {
|
|
75
93
|
if (typeof n != "string") {
|
|
76
94
|
const t = e[0], i = [...e.slice(1)];
|
|
77
95
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
78
96
|
}
|
|
79
|
-
return
|
|
97
|
+
return ot.create(n, ...e);
|
|
80
98
|
}
|
|
81
99
|
function l(n, e, ...t) {
|
|
82
100
|
if (!n)
|
|
83
|
-
throw
|
|
101
|
+
throw ye(e, ...t);
|
|
84
102
|
}
|
|
85
103
|
function v(n) {
|
|
86
104
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
87
|
-
throw
|
|
105
|
+
throw B(e), new Error(e);
|
|
88
106
|
}
|
|
89
107
|
function T(n, e) {
|
|
90
108
|
n || v(e);
|
|
@@ -105,11 +123,11 @@ function T(n, e) {
|
|
|
105
123
|
* See the License for the specific language governing permissions and
|
|
106
124
|
* limitations under the License.
|
|
107
125
|
*/
|
|
108
|
-
function
|
|
126
|
+
function ge() {
|
|
109
127
|
var n;
|
|
110
128
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
111
129
|
}
|
|
112
|
-
function
|
|
130
|
+
function fn() {
|
|
113
131
|
return xe() === "http:" || xe() === "https:";
|
|
114
132
|
}
|
|
115
133
|
function xe() {
|
|
@@ -132,15 +150,15 @@ function xe() {
|
|
|
132
150
|
* See the License for the specific language governing permissions and
|
|
133
151
|
* limitations under the License.
|
|
134
152
|
*/
|
|
135
|
-
function
|
|
153
|
+
function pn() {
|
|
136
154
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
137
155
|
// This is especially true for Cordova apps which have unreliable
|
|
138
156
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
139
157
|
// installed which overwrites the native navigator.onLine value and
|
|
140
158
|
// defines navigator.connection.
|
|
141
|
-
(
|
|
159
|
+
(fn() || Jt() || "connection" in navigator) ? navigator.onLine : !0;
|
|
142
160
|
}
|
|
143
|
-
function
|
|
161
|
+
function gn() {
|
|
144
162
|
if (typeof navigator > "u")
|
|
145
163
|
return null;
|
|
146
164
|
const n = navigator;
|
|
@@ -170,10 +188,10 @@ function dn() {
|
|
|
170
188
|
*/
|
|
171
189
|
class q {
|
|
172
190
|
constructor(e, t) {
|
|
173
|
-
this.shortDelay = e, this.longDelay = t, T(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
|
191
|
+
this.shortDelay = e, this.longDelay = t, T(t > e, "Short delay should be less than long delay!"), this.isMobile = Gt() || Bt();
|
|
174
192
|
}
|
|
175
193
|
get() {
|
|
176
|
-
return
|
|
194
|
+
return pn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
177
195
|
}
|
|
178
196
|
}
|
|
179
197
|
/**
|
|
@@ -192,7 +210,7 @@ class q {
|
|
|
192
210
|
* See the License for the specific language governing permissions and
|
|
193
211
|
* limitations under the License.
|
|
194
212
|
*/
|
|
195
|
-
function
|
|
213
|
+
function Te(n, e) {
|
|
196
214
|
T(n.emulator, "Emulator should always be set here");
|
|
197
215
|
const { url: t } = n.emulator;
|
|
198
216
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
@@ -213,7 +231,7 @@ function ye(n, e) {
|
|
|
213
231
|
* See the License for the specific language governing permissions and
|
|
214
232
|
* limitations under the License.
|
|
215
233
|
*/
|
|
216
|
-
class
|
|
234
|
+
class ct {
|
|
217
235
|
static initialize(e, t, i) {
|
|
218
236
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
219
237
|
}
|
|
@@ -267,7 +285,7 @@ class at {
|
|
|
267
285
|
* See the License for the specific language governing permissions and
|
|
268
286
|
* limitations under the License.
|
|
269
287
|
*/
|
|
270
|
-
const
|
|
288
|
+
const mn = {
|
|
271
289
|
// Custom token errors.
|
|
272
290
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
273
291
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -358,12 +376,12 @@ const hn = {
|
|
|
358
376
|
* See the License for the specific language governing permissions and
|
|
359
377
|
* limitations under the License.
|
|
360
378
|
*/
|
|
361
|
-
const
|
|
379
|
+
const _n = new q(3e4, 6e4);
|
|
362
380
|
function ne(n, e) {
|
|
363
381
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
364
382
|
}
|
|
365
383
|
async function x(n, e, t, i, r = {}) {
|
|
366
|
-
return
|
|
384
|
+
return lt(n, r, async () => {
|
|
367
385
|
let s = {}, o = {};
|
|
368
386
|
i && (e === "GET" ? o = i : s = {
|
|
369
387
|
body: JSON.stringify(i)
|
|
@@ -380,67 +398,67 @@ async function x(n, e, t, i, r = {}) {
|
|
|
380
398
|
method: e,
|
|
381
399
|
headers: a
|
|
382
400
|
}, s);
|
|
383
|
-
return tn() || (u.referrerPolicy = "no-referrer"),
|
|
401
|
+
return tn() || (u.referrerPolicy = "no-referrer"), ct.fetch()(dt(n, n.config.apiHost, t, c), u);
|
|
384
402
|
});
|
|
385
403
|
}
|
|
386
|
-
async function
|
|
404
|
+
async function lt(n, e, t) {
|
|
387
405
|
n._canInitEmulator = !1;
|
|
388
|
-
const i = Object.assign(Object.assign({},
|
|
406
|
+
const i = Object.assign(Object.assign({}, mn), e);
|
|
389
407
|
try {
|
|
390
|
-
const r = new
|
|
408
|
+
const r = new vn(n), s = await Promise.race([
|
|
391
409
|
t(),
|
|
392
410
|
r.promise
|
|
393
411
|
]);
|
|
394
412
|
r.clearNetworkTimeout();
|
|
395
413
|
const o = await s.json();
|
|
396
414
|
if ("needConfirmation" in o)
|
|
397
|
-
throw
|
|
415
|
+
throw G(n, "account-exists-with-different-credential", o);
|
|
398
416
|
if (s.ok && !("errorMessage" in o))
|
|
399
417
|
return o;
|
|
400
418
|
{
|
|
401
419
|
const c = s.ok ? o.errorMessage : o.error.message, [a, u] = c.split(" : ");
|
|
402
420
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
403
|
-
throw
|
|
421
|
+
throw G(n, "credential-already-in-use", o);
|
|
404
422
|
if (a === "EMAIL_EXISTS")
|
|
405
|
-
throw
|
|
423
|
+
throw G(n, "email-already-in-use", o);
|
|
406
424
|
if (a === "USER_DISABLED")
|
|
407
|
-
throw
|
|
425
|
+
throw G(n, "user-disabled", o);
|
|
408
426
|
const h = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
409
427
|
if (u)
|
|
410
|
-
throw
|
|
428
|
+
throw at(n, h, u);
|
|
411
429
|
y(n, h);
|
|
412
430
|
}
|
|
413
431
|
} catch (r) {
|
|
414
|
-
if (r instanceof
|
|
432
|
+
if (r instanceof Ie)
|
|
415
433
|
throw r;
|
|
416
434
|
y(n, "network-request-failed", { message: String(r) });
|
|
417
435
|
}
|
|
418
436
|
}
|
|
419
|
-
async function
|
|
437
|
+
async function ut(n, e, t, i, r = {}) {
|
|
420
438
|
const s = await x(n, e, t, i, r);
|
|
421
439
|
return "mfaPendingCredential" in s && y(n, "multi-factor-auth-required", {
|
|
422
440
|
_serverResponse: s
|
|
423
441
|
}), s;
|
|
424
442
|
}
|
|
425
|
-
function
|
|
443
|
+
function dt(n, e, t, i) {
|
|
426
444
|
const r = `${e}${t}?${i}`;
|
|
427
|
-
return n.config.emulator ?
|
|
445
|
+
return n.config.emulator ? Te(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
428
446
|
}
|
|
429
|
-
class
|
|
447
|
+
class vn {
|
|
430
448
|
constructor(e) {
|
|
431
449
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
432
450
|
this.timer = setTimeout(() => i(g(
|
|
433
451
|
this.auth,
|
|
434
452
|
"network-request-failed"
|
|
435
453
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
436
|
-
)),
|
|
454
|
+
)), _n.get());
|
|
437
455
|
});
|
|
438
456
|
}
|
|
439
457
|
clearNetworkTimeout() {
|
|
440
458
|
clearTimeout(this.timer);
|
|
441
459
|
}
|
|
442
460
|
}
|
|
443
|
-
function
|
|
461
|
+
function G(n, e, t) {
|
|
444
462
|
const i = {
|
|
445
463
|
appName: n.name
|
|
446
464
|
};
|
|
@@ -464,10 +482,10 @@ function B(n, e, t) {
|
|
|
464
482
|
* See the License for the specific language governing permissions and
|
|
465
483
|
* limitations under the License.
|
|
466
484
|
*/
|
|
467
|
-
async function
|
|
485
|
+
async function In(n, e) {
|
|
468
486
|
return x(n, "POST", "/v1/accounts:delete", e);
|
|
469
487
|
}
|
|
470
|
-
async function
|
|
488
|
+
async function ht(n, e) {
|
|
471
489
|
return x(n, "POST", "/v1/accounts:lookup", e);
|
|
472
490
|
}
|
|
473
491
|
/**
|
|
@@ -495,8 +513,8 @@ function V(n) {
|
|
|
495
513
|
} catch {
|
|
496
514
|
}
|
|
497
515
|
}
|
|
498
|
-
async function
|
|
499
|
-
const t = F(n), i = await t.getIdToken(e), r =
|
|
516
|
+
async function wn(n, e = !1) {
|
|
517
|
+
const t = F(n), i = await t.getIdToken(e), r = Ee(i);
|
|
500
518
|
l(
|
|
501
519
|
r && r.exp && r.auth_time && r.iat,
|
|
502
520
|
t.auth,
|
|
@@ -517,19 +535,19 @@ async function mn(n, e = !1) {
|
|
|
517
535
|
function he(n) {
|
|
518
536
|
return Number(n) * 1e3;
|
|
519
537
|
}
|
|
520
|
-
function
|
|
538
|
+
function Ee(n) {
|
|
521
539
|
const [e, t, i] = n.split(".");
|
|
522
540
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
523
|
-
return
|
|
541
|
+
return B("JWT malformed, contained fewer than 3 sections"), null;
|
|
524
542
|
try {
|
|
525
543
|
const r = Zt(t);
|
|
526
|
-
return r ? JSON.parse(r) : (
|
|
544
|
+
return r ? JSON.parse(r) : (B("Failed to decode base64 JWT payload"), null);
|
|
527
545
|
} catch (r) {
|
|
528
|
-
return
|
|
546
|
+
return B("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
529
547
|
}
|
|
530
548
|
}
|
|
531
549
|
function Ve(n) {
|
|
532
|
-
const e =
|
|
550
|
+
const e = Ee(n);
|
|
533
551
|
return l(
|
|
534
552
|
e,
|
|
535
553
|
"internal-error"
|
|
@@ -566,10 +584,10 @@ async function j(n, e, t = !1) {
|
|
|
566
584
|
try {
|
|
567
585
|
return await e;
|
|
568
586
|
} catch (i) {
|
|
569
|
-
throw i instanceof
|
|
587
|
+
throw i instanceof Ie && yn(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
570
588
|
}
|
|
571
589
|
}
|
|
572
|
-
function
|
|
590
|
+
function yn({ code: n }) {
|
|
573
591
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
574
592
|
}
|
|
575
593
|
/**
|
|
@@ -588,7 +606,7 @@ function _n({ code: n }) {
|
|
|
588
606
|
* See the License for the specific language governing permissions and
|
|
589
607
|
* limitations under the License.
|
|
590
608
|
*/
|
|
591
|
-
class
|
|
609
|
+
class Tn {
|
|
592
610
|
constructor(e) {
|
|
593
611
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
594
612
|
}
|
|
@@ -650,7 +668,7 @@ class vn {
|
|
|
650
668
|
* See the License for the specific language governing permissions and
|
|
651
669
|
* limitations under the License.
|
|
652
670
|
*/
|
|
653
|
-
class
|
|
671
|
+
class me {
|
|
654
672
|
constructor(e, t) {
|
|
655
673
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
656
674
|
}
|
|
@@ -685,7 +703,7 @@ class ge {
|
|
|
685
703
|
*/
|
|
686
704
|
async function Q(n) {
|
|
687
705
|
var e;
|
|
688
|
-
const t = n.auth, i = await n.getIdToken(), r = await j(n,
|
|
706
|
+
const t = n.auth, i = await n.getIdToken(), r = await j(n, ht(t, { idToken: i }));
|
|
689
707
|
l(
|
|
690
708
|
r == null ? void 0 : r.users.length,
|
|
691
709
|
t,
|
|
@@ -694,7 +712,7 @@ async function Q(n) {
|
|
|
694
712
|
);
|
|
695
713
|
const s = r.users[0];
|
|
696
714
|
n._notifyReloadListener(s);
|
|
697
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
715
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? ft(s.providerUserInfo) : [], c = kn(n.providerData, o), a = n.isAnonymous, u = !(n.email && s.passwordHash) && !(c != null && c.length), h = a ? u : !1, d = {
|
|
698
716
|
uid: s.localId,
|
|
699
717
|
displayName: s.displayName || null,
|
|
700
718
|
photoURL: s.photoUrl || null,
|
|
@@ -703,21 +721,21 @@ async function Q(n) {
|
|
|
703
721
|
phoneNumber: s.phoneNumber || null,
|
|
704
722
|
tenantId: s.tenantId || null,
|
|
705
723
|
providerData: c,
|
|
706
|
-
metadata: new
|
|
724
|
+
metadata: new me(s.createdAt, s.lastLoginAt),
|
|
707
725
|
isAnonymous: h
|
|
708
726
|
};
|
|
709
727
|
Object.assign(n, d);
|
|
710
728
|
}
|
|
711
|
-
async function
|
|
729
|
+
async function En(n) {
|
|
712
730
|
const e = F(n);
|
|
713
731
|
await Q(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
714
732
|
}
|
|
715
|
-
function
|
|
733
|
+
function kn(n, e) {
|
|
716
734
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
717
735
|
}
|
|
718
|
-
function
|
|
736
|
+
function ft(n) {
|
|
719
737
|
return n.map((e) => {
|
|
720
|
-
var { providerId: t } = e, i =
|
|
738
|
+
var { providerId: t } = e, i = we(e, ["providerId"]);
|
|
721
739
|
return {
|
|
722
740
|
providerId: t,
|
|
723
741
|
uid: i.rawId || "",
|
|
@@ -744,16 +762,16 @@ function ht(n) {
|
|
|
744
762
|
* See the License for the specific language governing permissions and
|
|
745
763
|
* limitations under the License.
|
|
746
764
|
*/
|
|
747
|
-
async function
|
|
748
|
-
const t = await
|
|
765
|
+
async function Sn(n, e) {
|
|
766
|
+
const t = await lt(n, {}, async () => {
|
|
749
767
|
const i = H({
|
|
750
768
|
grant_type: "refresh_token",
|
|
751
769
|
refresh_token: e
|
|
752
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
770
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = dt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
753
771
|
return c[
|
|
754
772
|
"Content-Type"
|
|
755
773
|
/* HttpHeader.CONTENT_TYPE */
|
|
756
|
-
] = "application/x-www-form-urlencoded",
|
|
774
|
+
] = "application/x-www-form-urlencoded", ct.fetch()(o, {
|
|
757
775
|
method: "POST",
|
|
758
776
|
headers: c,
|
|
759
777
|
body: i
|
|
@@ -765,7 +783,7 @@ async function yn(n, e) {
|
|
|
765
783
|
refreshToken: t.refresh_token
|
|
766
784
|
};
|
|
767
785
|
}
|
|
768
|
-
async function
|
|
786
|
+
async function Pn(n, e) {
|
|
769
787
|
return x(n, "POST", "/v2/accounts:revokeToken", ne(n, e));
|
|
770
788
|
}
|
|
771
789
|
/**
|
|
@@ -829,7 +847,7 @@ class U {
|
|
|
829
847
|
this.refreshToken = null;
|
|
830
848
|
}
|
|
831
849
|
async refresh(e, t) {
|
|
832
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
850
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Sn(e, t);
|
|
833
851
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
834
852
|
}
|
|
835
853
|
updateTokensAndExpiration(e, t, i) {
|
|
@@ -883,8 +901,8 @@ function k(n, e) {
|
|
|
883
901
|
}
|
|
884
902
|
class I {
|
|
885
903
|
constructor(e) {
|
|
886
|
-
var { uid: t, auth: i, stsTokenManager: r } = e, s =
|
|
887
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
904
|
+
var { uid: t, auth: i, stsTokenManager: r } = e, s = we(e, ["uid", "auth", "stsTokenManager"]);
|
|
905
|
+
this.providerId = "firebase", this.proactiveRefresh = new Tn(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = i, this.stsTokenManager = r, this.accessToken = r.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 me(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
888
906
|
}
|
|
889
907
|
async getIdToken(e) {
|
|
890
908
|
const t = await j(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -896,10 +914,10 @@ class I {
|
|
|
896
914
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
897
915
|
}
|
|
898
916
|
getIdTokenResult(e) {
|
|
899
|
-
return
|
|
917
|
+
return wn(this, e);
|
|
900
918
|
}
|
|
901
919
|
reload() {
|
|
902
|
-
return
|
|
920
|
+
return En(this);
|
|
903
921
|
}
|
|
904
922
|
_assign(e) {
|
|
905
923
|
this !== e && (l(
|
|
@@ -938,7 +956,7 @@ class I {
|
|
|
938
956
|
if (_(this.auth.app))
|
|
939
957
|
return Promise.reject(A(this.auth));
|
|
940
958
|
const e = await this.getIdToken();
|
|
941
|
-
return await j(this,
|
|
959
|
+
return await j(this, In(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
942
960
|
}
|
|
943
961
|
toJSON() {
|
|
944
962
|
return Object.assign(Object.assign({
|
|
@@ -966,45 +984,45 @@ class I {
|
|
|
966
984
|
}
|
|
967
985
|
static _fromJSON(e, t) {
|
|
968
986
|
var i, r, s, o, c, a, u, h;
|
|
969
|
-
const d = (i = t.displayName) !== null && i !== void 0 ? i : void 0, f = (r = t.email) !== null && r !== void 0 ? r : void 0, E = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, N = (o = t.photoURL) !== null && o !== void 0 ? o : void 0,
|
|
987
|
+
const d = (i = t.displayName) !== null && i !== void 0 ? i : void 0, f = (r = t.email) !== null && r !== void 0 ? r : void 0, E = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, N = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, be = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, oe = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, Ae = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, Ce = (h = t.lastLoginAt) !== null && h !== void 0 ? h : void 0, { uid: ae, emailVerified: Oe, isAnonymous: Ne, providerData: ce, stsTokenManager: Le } = t;
|
|
970
988
|
l(
|
|
971
|
-
ae &&
|
|
989
|
+
ae && Le,
|
|
972
990
|
e,
|
|
973
991
|
"internal-error"
|
|
974
992
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
975
993
|
);
|
|
976
|
-
const
|
|
994
|
+
const xt = U.fromJSON(this.name, Le);
|
|
977
995
|
l(
|
|
978
996
|
typeof ae == "string",
|
|
979
997
|
e,
|
|
980
998
|
"internal-error"
|
|
981
999
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
982
1000
|
), k(d, e.name), k(f, e.name), l(
|
|
983
|
-
typeof
|
|
1001
|
+
typeof Oe == "boolean",
|
|
984
1002
|
e,
|
|
985
1003
|
"internal-error"
|
|
986
1004
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
987
1005
|
), l(
|
|
988
|
-
typeof
|
|
1006
|
+
typeof Ne == "boolean",
|
|
989
1007
|
e,
|
|
990
1008
|
"internal-error"
|
|
991
1009
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
992
|
-
), k(E, e.name), k(N, e.name), k(
|
|
1010
|
+
), k(E, e.name), k(N, e.name), k(be, e.name), k(oe, e.name), k(Ae, e.name), k(Ce, e.name);
|
|
993
1011
|
const le = new I({
|
|
994
1012
|
uid: ae,
|
|
995
1013
|
auth: e,
|
|
996
1014
|
email: f,
|
|
997
|
-
emailVerified:
|
|
1015
|
+
emailVerified: Oe,
|
|
998
1016
|
displayName: d,
|
|
999
|
-
isAnonymous:
|
|
1017
|
+
isAnonymous: Ne,
|
|
1000
1018
|
photoURL: N,
|
|
1001
1019
|
phoneNumber: E,
|
|
1002
|
-
tenantId:
|
|
1003
|
-
stsTokenManager:
|
|
1004
|
-
createdAt:
|
|
1005
|
-
lastLoginAt:
|
|
1020
|
+
tenantId: be,
|
|
1021
|
+
stsTokenManager: xt,
|
|
1022
|
+
createdAt: Ae,
|
|
1023
|
+
lastLoginAt: Ce
|
|
1006
1024
|
});
|
|
1007
|
-
return ce && Array.isArray(ce) && (le.providerData = ce.map((
|
|
1025
|
+
return ce && Array.isArray(ce) && (le.providerData = ce.map((Vt) => Object.assign({}, Vt))), oe && (le._redirectEventId = oe), le;
|
|
1008
1026
|
}
|
|
1009
1027
|
/**
|
|
1010
1028
|
* Initialize a User from an idToken server response
|
|
@@ -1034,7 +1052,7 @@ class I {
|
|
|
1034
1052
|
"internal-error"
|
|
1035
1053
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1036
1054
|
);
|
|
1037
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1055
|
+
const s = r.providerUserInfo !== void 0 ? ft(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new U();
|
|
1038
1056
|
c.updateFromIdToken(i);
|
|
1039
1057
|
const a = new I({
|
|
1040
1058
|
uid: r.localId,
|
|
@@ -1050,7 +1068,7 @@ class I {
|
|
|
1050
1068
|
phoneNumber: r.phoneNumber || null,
|
|
1051
1069
|
tenantId: r.tenantId || null,
|
|
1052
1070
|
providerData: s,
|
|
1053
|
-
metadata: new
|
|
1071
|
+
metadata: new me(r.createdAt, r.lastLoginAt),
|
|
1054
1072
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1055
1073
|
};
|
|
1056
1074
|
return Object.assign(a, u), a;
|
|
@@ -1094,7 +1112,7 @@ function w(n) {
|
|
|
1094
1112
|
* See the License for the specific language governing permissions and
|
|
1095
1113
|
* limitations under the License.
|
|
1096
1114
|
*/
|
|
1097
|
-
class
|
|
1115
|
+
class pt {
|
|
1098
1116
|
constructor() {
|
|
1099
1117
|
this.type = "NONE", this.storage = {};
|
|
1100
1118
|
}
|
|
@@ -1116,8 +1134,8 @@ class ft {
|
|
|
1116
1134
|
_removeListener(e, t) {
|
|
1117
1135
|
}
|
|
1118
1136
|
}
|
|
1119
|
-
|
|
1120
|
-
const We =
|
|
1137
|
+
pt.type = "NONE";
|
|
1138
|
+
const We = pt;
|
|
1121
1139
|
/**
|
|
1122
1140
|
* @license
|
|
1123
1141
|
* Copyright 2019 Google LLC
|
|
@@ -1216,25 +1234,25 @@ function He(n) {
|
|
|
1216
1234
|
const e = n.toLowerCase();
|
|
1217
1235
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1218
1236
|
return "Opera";
|
|
1219
|
-
if (
|
|
1237
|
+
if (vt(e))
|
|
1220
1238
|
return "IEMobile";
|
|
1221
1239
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1222
1240
|
return "IE";
|
|
1223
1241
|
if (e.includes("edge/"))
|
|
1224
1242
|
return "Edge";
|
|
1225
|
-
if (
|
|
1243
|
+
if (gt(e))
|
|
1226
1244
|
return "Firefox";
|
|
1227
1245
|
if (e.includes("silk/"))
|
|
1228
1246
|
return "Silk";
|
|
1229
|
-
if (It(e))
|
|
1230
|
-
return "Blackberry";
|
|
1231
1247
|
if (wt(e))
|
|
1248
|
+
return "Blackberry";
|
|
1249
|
+
if (yt(e))
|
|
1232
1250
|
return "Webos";
|
|
1233
|
-
if (
|
|
1251
|
+
if (mt(e))
|
|
1234
1252
|
return "Safari";
|
|
1235
|
-
if ((e.includes("chrome/") ||
|
|
1253
|
+
if ((e.includes("chrome/") || _t(e)) && !e.includes("edge/"))
|
|
1236
1254
|
return "Chrome";
|
|
1237
|
-
if (
|
|
1255
|
+
if (It(e))
|
|
1238
1256
|
return "Android";
|
|
1239
1257
|
{
|
|
1240
1258
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1243,40 +1261,40 @@ function He(n) {
|
|
|
1243
1261
|
}
|
|
1244
1262
|
return "Other";
|
|
1245
1263
|
}
|
|
1246
|
-
function
|
|
1264
|
+
function gt(n = p()) {
|
|
1247
1265
|
return /firefox\//i.test(n);
|
|
1248
1266
|
}
|
|
1249
|
-
function
|
|
1267
|
+
function mt(n = p()) {
|
|
1250
1268
|
const e = n.toLowerCase();
|
|
1251
1269
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1252
1270
|
}
|
|
1253
|
-
function
|
|
1271
|
+
function _t(n = p()) {
|
|
1254
1272
|
return /crios\//i.test(n);
|
|
1255
1273
|
}
|
|
1256
|
-
function
|
|
1274
|
+
function vt(n = p()) {
|
|
1257
1275
|
return /iemobile/i.test(n);
|
|
1258
1276
|
}
|
|
1259
|
-
function
|
|
1277
|
+
function It(n = p()) {
|
|
1260
1278
|
return /android/i.test(n);
|
|
1261
1279
|
}
|
|
1262
|
-
function
|
|
1280
|
+
function wt(n = p()) {
|
|
1263
1281
|
return /blackberry/i.test(n);
|
|
1264
1282
|
}
|
|
1265
|
-
function
|
|
1283
|
+
function yt(n = p()) {
|
|
1266
1284
|
return /webos/i.test(n);
|
|
1267
1285
|
}
|
|
1268
|
-
function
|
|
1286
|
+
function ke(n = p()) {
|
|
1269
1287
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1270
1288
|
}
|
|
1271
|
-
function
|
|
1289
|
+
function Rn(n = p()) {
|
|
1272
1290
|
var e;
|
|
1273
|
-
return
|
|
1291
|
+
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1274
1292
|
}
|
|
1275
|
-
function
|
|
1293
|
+
function bn() {
|
|
1276
1294
|
return en() && document.documentMode === 10;
|
|
1277
1295
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return
|
|
1296
|
+
function Tt(n = p()) {
|
|
1297
|
+
return ke(n) || It(n) || yt(n) || wt(n) || /windows phone/i.test(n) || vt(n);
|
|
1280
1298
|
}
|
|
1281
1299
|
/**
|
|
1282
1300
|
* @license
|
|
@@ -1294,7 +1312,7 @@ function yt(n = p()) {
|
|
|
1294
1312
|
* See the License for the specific language governing permissions and
|
|
1295
1313
|
* limitations under the License.
|
|
1296
1314
|
*/
|
|
1297
|
-
function
|
|
1315
|
+
function Et(n, e = []) {
|
|
1298
1316
|
let t;
|
|
1299
1317
|
switch (n) {
|
|
1300
1318
|
case "Browser":
|
|
@@ -1325,7 +1343,7 @@ function Tt(n, e = []) {
|
|
|
1325
1343
|
* See the License for the specific language governing permissions and
|
|
1326
1344
|
* limitations under the License.
|
|
1327
1345
|
*/
|
|
1328
|
-
class
|
|
1346
|
+
class An {
|
|
1329
1347
|
constructor(e) {
|
|
1330
1348
|
this.auth = e, this.queue = [];
|
|
1331
1349
|
}
|
|
@@ -1380,7 +1398,7 @@ class Sn {
|
|
|
1380
1398
|
* See the License for the specific language governing permissions and
|
|
1381
1399
|
* limitations under the License.
|
|
1382
1400
|
*/
|
|
1383
|
-
async function
|
|
1401
|
+
async function Cn(n, e = {}) {
|
|
1384
1402
|
return x(n, "GET", "/v2/passwordPolicy", ne(n, e));
|
|
1385
1403
|
}
|
|
1386
1404
|
/**
|
|
@@ -1399,12 +1417,12 @@ async function Rn(n, e = {}) {
|
|
|
1399
1417
|
* See the License for the specific language governing permissions and
|
|
1400
1418
|
* limitations under the License.
|
|
1401
1419
|
*/
|
|
1402
|
-
const
|
|
1403
|
-
class
|
|
1420
|
+
const On = 6;
|
|
1421
|
+
class Nn {
|
|
1404
1422
|
constructor(e) {
|
|
1405
1423
|
var t, i, r, s;
|
|
1406
1424
|
const o = e.customStrengthOptions;
|
|
1407
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1425
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : On, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (r = (i = e.allowedNonAlphanumericCharacters) === null || i === void 0 ? void 0 : i.join("")) !== null && r !== void 0 ? r : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
|
1408
1426
|
}
|
|
1409
1427
|
validatePassword(e) {
|
|
1410
1428
|
var t, i, r, s, o, c;
|
|
@@ -1487,9 +1505,9 @@ class bn {
|
|
|
1487
1505
|
* See the License for the specific language governing permissions and
|
|
1488
1506
|
* limitations under the License.
|
|
1489
1507
|
*/
|
|
1490
|
-
class
|
|
1508
|
+
class Ln {
|
|
1491
1509
|
constructor(e, t, i, r) {
|
|
1492
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new qe(this), this.idTokenSubscription = new qe(this), this.beforeStateQueue = new
|
|
1510
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new qe(this), this.idTokenSubscription = new qe(this), this.beforeStateQueue = new An(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 = ot, 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 = r.sdkClientVersion;
|
|
1493
1511
|
}
|
|
1494
1512
|
_initializeWithPersistence(e, t) {
|
|
1495
1513
|
return t && (this._popupRedirectResolver = w(t)), this._initializationPromise = this.queue(async () => {
|
|
@@ -1525,7 +1543,7 @@ class An {
|
|
|
1525
1543
|
}
|
|
1526
1544
|
async initializeCurrentUserFromIdToken(e) {
|
|
1527
1545
|
try {
|
|
1528
|
-
const t = await
|
|
1546
|
+
const t = await ht(this, { idToken: e }), i = await I._fromGetAccountInfoResponse(this, t, e);
|
|
1529
1547
|
await this.directlySetCurrentUser(i);
|
|
1530
1548
|
} catch (t) {
|
|
1531
1549
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1583,7 +1601,7 @@ class An {
|
|
|
1583
1601
|
return this.directlySetCurrentUser(e);
|
|
1584
1602
|
}
|
|
1585
1603
|
useDeviceLanguage() {
|
|
1586
|
-
this.languageCode =
|
|
1604
|
+
this.languageCode = gn();
|
|
1587
1605
|
}
|
|
1588
1606
|
async _delete() {
|
|
1589
1607
|
this._deleted = !0;
|
|
@@ -1634,14 +1652,14 @@ class An {
|
|
|
1634
1652
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1635
1653
|
}
|
|
1636
1654
|
async _updatePasswordPolicy() {
|
|
1637
|
-
const e = await
|
|
1655
|
+
const e = await Cn(this), t = new Nn(e);
|
|
1638
1656
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1639
1657
|
}
|
|
1640
1658
|
_getPersistence() {
|
|
1641
1659
|
return this.assertedPersistence.persistence.type;
|
|
1642
1660
|
}
|
|
1643
1661
|
_updateErrorMap(e) {
|
|
1644
|
-
this._errorFactory = new
|
|
1662
|
+
this._errorFactory = new ve("auth", "Firebase", e());
|
|
1645
1663
|
}
|
|
1646
1664
|
onAuthStateChanged(e, t, i) {
|
|
1647
1665
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1674,7 +1692,7 @@ class An {
|
|
|
1674
1692
|
token: e,
|
|
1675
1693
|
idToken: t
|
|
1676
1694
|
};
|
|
1677
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1695
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await Pn(this, i);
|
|
1678
1696
|
}
|
|
1679
1697
|
}
|
|
1680
1698
|
toJSON() {
|
|
@@ -1787,7 +1805,7 @@ class An {
|
|
|
1787
1805
|
), this.persistenceManager;
|
|
1788
1806
|
}
|
|
1789
1807
|
_logFramework(e) {
|
|
1790
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
1808
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Et(this.config.clientPlatform, this._getFrameworks()));
|
|
1791
1809
|
}
|
|
1792
1810
|
_getFrameworks() {
|
|
1793
1811
|
return this.frameworks;
|
|
@@ -1817,7 +1835,7 @@ class An {
|
|
|
1817
1835
|
async _getAppCheckToken() {
|
|
1818
1836
|
var e;
|
|
1819
1837
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1820
|
-
return t != null && t.error &&
|
|
1838
|
+
return t != null && t.error && hn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1821
1839
|
}
|
|
1822
1840
|
}
|
|
1823
1841
|
function ie(n) {
|
|
@@ -1852,7 +1870,7 @@ class qe {
|
|
|
1852
1870
|
* See the License for the specific language governing permissions and
|
|
1853
1871
|
* limitations under the License.
|
|
1854
1872
|
*/
|
|
1855
|
-
let
|
|
1873
|
+
let Se = {
|
|
1856
1874
|
async loadJS() {
|
|
1857
1875
|
throw new Error("Unable to load external scripts");
|
|
1858
1876
|
},
|
|
@@ -1860,16 +1878,16 @@ let ke = {
|
|
|
1860
1878
|
recaptchaEnterpriseScript: "",
|
|
1861
1879
|
gapiScript: ""
|
|
1862
1880
|
};
|
|
1863
|
-
function
|
|
1864
|
-
|
|
1881
|
+
function Un(n) {
|
|
1882
|
+
Se = n;
|
|
1865
1883
|
}
|
|
1866
|
-
function
|
|
1867
|
-
return
|
|
1884
|
+
function Mn(n) {
|
|
1885
|
+
return Se.loadJS(n);
|
|
1868
1886
|
}
|
|
1869
|
-
function
|
|
1870
|
-
return
|
|
1887
|
+
function Dn() {
|
|
1888
|
+
return Se.gapiScript;
|
|
1871
1889
|
}
|
|
1872
|
-
function
|
|
1890
|
+
function Fn(n) {
|
|
1873
1891
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
1874
1892
|
}
|
|
1875
1893
|
/**
|
|
@@ -1888,7 +1906,7 @@ function Ln(n) {
|
|
|
1888
1906
|
* See the License for the specific language governing permissions and
|
|
1889
1907
|
* limitations under the License.
|
|
1890
1908
|
*/
|
|
1891
|
-
function
|
|
1909
|
+
function xn(n, e) {
|
|
1892
1910
|
const t = nt(n, "auth");
|
|
1893
1911
|
if (t.isInitialized()) {
|
|
1894
1912
|
const r = t.getImmediate(), s = t.getOptions();
|
|
@@ -1902,11 +1920,11 @@ function Un(n, e) {
|
|
|
1902
1920
|
}
|
|
1903
1921
|
return t.initialize({ options: e });
|
|
1904
1922
|
}
|
|
1905
|
-
function
|
|
1923
|
+
function Vn(n, e) {
|
|
1906
1924
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(w);
|
|
1907
1925
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
1908
1926
|
}
|
|
1909
|
-
function
|
|
1927
|
+
function jn(n, e, t) {
|
|
1910
1928
|
const i = ie(n);
|
|
1911
1929
|
l(
|
|
1912
1930
|
i._canInitEmulator,
|
|
@@ -1919,20 +1937,20 @@ function Dn(n, e, t) {
|
|
|
1919
1937
|
"invalid-emulator-scheme"
|
|
1920
1938
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
1921
1939
|
);
|
|
1922
|
-
const r = !!(t != null && t.disableWarnings), s =
|
|
1940
|
+
const r = !!(t != null && t.disableWarnings), s = kt(e), { host: o, port: c } = Wn(e), a = c === null ? "" : `:${c}`;
|
|
1923
1941
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
1924
1942
|
host: o,
|
|
1925
1943
|
port: c,
|
|
1926
1944
|
protocol: s.replace(":", ""),
|
|
1927
1945
|
options: Object.freeze({ disableWarnings: r })
|
|
1928
|
-
}), r ||
|
|
1946
|
+
}), r || Hn();
|
|
1929
1947
|
}
|
|
1930
|
-
function
|
|
1948
|
+
function kt(n) {
|
|
1931
1949
|
const e = n.indexOf(":");
|
|
1932
1950
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
1933
1951
|
}
|
|
1934
|
-
function
|
|
1935
|
-
const e =
|
|
1952
|
+
function Wn(n) {
|
|
1953
|
+
const e = kt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
1936
1954
|
if (!t)
|
|
1937
1955
|
return { host: "", port: null };
|
|
1938
1956
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
@@ -1950,7 +1968,7 @@ function ze(n) {
|
|
|
1950
1968
|
const e = Number(n);
|
|
1951
1969
|
return isNaN(e) ? null : e;
|
|
1952
1970
|
}
|
|
1953
|
-
function
|
|
1971
|
+
function Hn() {
|
|
1954
1972
|
function n() {
|
|
1955
1973
|
const e = document.createElement("p"), t = e.style;
|
|
1956
1974
|
e.innerText = "Running in emulator mode. Do not use with production credentials.", t.position = "fixed", t.width = "100%", t.backgroundColor = "#ffffff", t.border = ".1em solid #000000", t.color = "#b50000", t.bottom = "0px", t.left = "0px", t.margin = "0px", t.zIndex = "10000", t.textAlign = "center", e.classList.add("firebase-emulator-warning"), document.body.appendChild(e);
|
|
@@ -1973,7 +1991,7 @@ function xn() {
|
|
|
1973
1991
|
* See the License for the specific language governing permissions and
|
|
1974
1992
|
* limitations under the License.
|
|
1975
1993
|
*/
|
|
1976
|
-
class
|
|
1994
|
+
class St {
|
|
1977
1995
|
/** @internal */
|
|
1978
1996
|
constructor(e, t) {
|
|
1979
1997
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2016,7 +2034,7 @@ class kt {
|
|
|
2016
2034
|
* limitations under the License.
|
|
2017
2035
|
*/
|
|
2018
2036
|
async function D(n, e) {
|
|
2019
|
-
return
|
|
2037
|
+
return ut(n, "POST", "/v1/accounts:signInWithIdp", ne(n, e));
|
|
2020
2038
|
}
|
|
2021
2039
|
/**
|
|
2022
2040
|
* @license
|
|
@@ -2034,8 +2052,8 @@ async function D(n, e) {
|
|
|
2034
2052
|
* See the License for the specific language governing permissions and
|
|
2035
2053
|
* limitations under the License.
|
|
2036
2054
|
*/
|
|
2037
|
-
const
|
|
2038
|
-
class C extends
|
|
2055
|
+
const qn = "http://localhost";
|
|
2056
|
+
class C extends St {
|
|
2039
2057
|
constructor() {
|
|
2040
2058
|
super(...arguments), this.pendingToken = null;
|
|
2041
2059
|
}
|
|
@@ -2069,7 +2087,7 @@ class C extends kt {
|
|
|
2069
2087
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
|
2070
2088
|
*/
|
|
2071
2089
|
static fromJSON(e) {
|
|
2072
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s =
|
|
2090
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = we(t, ["providerId", "signInMethod"]);
|
|
2073
2091
|
if (!i || !r)
|
|
2074
2092
|
return null;
|
|
2075
2093
|
const o = new C(i, r);
|
|
@@ -2092,7 +2110,7 @@ class C extends kt {
|
|
|
2092
2110
|
}
|
|
2093
2111
|
buildRequest() {
|
|
2094
2112
|
const e = {
|
|
2095
|
-
requestUri:
|
|
2113
|
+
requestUri: qn,
|
|
2096
2114
|
returnSecureToken: !0
|
|
2097
2115
|
};
|
|
2098
2116
|
if (this.pendingToken)
|
|
@@ -2120,7 +2138,7 @@ class C extends kt {
|
|
|
2120
2138
|
* See the License for the specific language governing permissions and
|
|
2121
2139
|
* limitations under the License.
|
|
2122
2140
|
*/
|
|
2123
|
-
class
|
|
2141
|
+
class Pt {
|
|
2124
2142
|
/**
|
|
2125
2143
|
* Constructor for generic OAuth providers.
|
|
2126
2144
|
*
|
|
@@ -2173,7 +2191,7 @@ class St {
|
|
|
2173
2191
|
* See the License for the specific language governing permissions and
|
|
2174
2192
|
* limitations under the License.
|
|
2175
2193
|
*/
|
|
2176
|
-
class z extends
|
|
2194
|
+
class z extends Pt {
|
|
2177
2195
|
constructor() {
|
|
2178
2196
|
super(...arguments), this.scopes = [];
|
|
2179
2197
|
}
|
|
@@ -2279,7 +2297,7 @@ S.PROVIDER_ID = "facebook.com";
|
|
|
2279
2297
|
* See the License for the specific language governing permissions and
|
|
2280
2298
|
* limitations under the License.
|
|
2281
2299
|
*/
|
|
2282
|
-
class
|
|
2300
|
+
class P extends z {
|
|
2283
2301
|
constructor() {
|
|
2284
2302
|
super(
|
|
2285
2303
|
"google.com"
|
|
@@ -2301,8 +2319,8 @@ class R extends z {
|
|
|
2301
2319
|
*/
|
|
2302
2320
|
static credential(e, t) {
|
|
2303
2321
|
return C._fromParams({
|
|
2304
|
-
providerId:
|
|
2305
|
-
signInMethod:
|
|
2322
|
+
providerId: P.PROVIDER_ID,
|
|
2323
|
+
signInMethod: P.GOOGLE_SIGN_IN_METHOD,
|
|
2306
2324
|
idToken: e,
|
|
2307
2325
|
accessToken: t
|
|
2308
2326
|
});
|
|
@@ -2313,7 +2331,7 @@ class R extends z {
|
|
|
2313
2331
|
* @param userCredential - The user credential.
|
|
2314
2332
|
*/
|
|
2315
2333
|
static credentialFromResult(e) {
|
|
2316
|
-
return
|
|
2334
|
+
return P.credentialFromTaggedObject(e);
|
|
2317
2335
|
}
|
|
2318
2336
|
/**
|
|
2319
2337
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2322,7 +2340,7 @@ class R extends z {
|
|
|
2322
2340
|
* @param userCredential - The user credential.
|
|
2323
2341
|
*/
|
|
2324
2342
|
static credentialFromError(e) {
|
|
2325
|
-
return
|
|
2343
|
+
return P.credentialFromTaggedObject(e.customData || {});
|
|
2326
2344
|
}
|
|
2327
2345
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2328
2346
|
if (!e)
|
|
@@ -2331,14 +2349,14 @@ class R extends z {
|
|
|
2331
2349
|
if (!t && !i)
|
|
2332
2350
|
return null;
|
|
2333
2351
|
try {
|
|
2334
|
-
return
|
|
2352
|
+
return P.credential(t, i);
|
|
2335
2353
|
} catch {
|
|
2336
2354
|
return null;
|
|
2337
2355
|
}
|
|
2338
2356
|
}
|
|
2339
2357
|
}
|
|
2340
|
-
|
|
2341
|
-
|
|
2358
|
+
P.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2359
|
+
P.PROVIDER_ID = "google.com";
|
|
2342
2360
|
/**
|
|
2343
2361
|
* @license
|
|
2344
2362
|
* Copyright 2020 Google LLC
|
|
@@ -2355,7 +2373,7 @@ R.PROVIDER_ID = "google.com";
|
|
|
2355
2373
|
* See the License for the specific language governing permissions and
|
|
2356
2374
|
* limitations under the License.
|
|
2357
2375
|
*/
|
|
2358
|
-
class
|
|
2376
|
+
class R extends z {
|
|
2359
2377
|
constructor() {
|
|
2360
2378
|
super(
|
|
2361
2379
|
"github.com"
|
|
@@ -2369,8 +2387,8 @@ class P extends z {
|
|
|
2369
2387
|
*/
|
|
2370
2388
|
static credential(e) {
|
|
2371
2389
|
return C._fromParams({
|
|
2372
|
-
providerId:
|
|
2373
|
-
signInMethod:
|
|
2390
|
+
providerId: R.PROVIDER_ID,
|
|
2391
|
+
signInMethod: R.GITHUB_SIGN_IN_METHOD,
|
|
2374
2392
|
accessToken: e
|
|
2375
2393
|
});
|
|
2376
2394
|
}
|
|
@@ -2380,7 +2398,7 @@ class P extends z {
|
|
|
2380
2398
|
* @param userCredential - The user credential.
|
|
2381
2399
|
*/
|
|
2382
2400
|
static credentialFromResult(e) {
|
|
2383
|
-
return
|
|
2401
|
+
return R.credentialFromTaggedObject(e);
|
|
2384
2402
|
}
|
|
2385
2403
|
/**
|
|
2386
2404
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2389,20 +2407,20 @@ class P extends z {
|
|
|
2389
2407
|
* @param userCredential - The user credential.
|
|
2390
2408
|
*/
|
|
2391
2409
|
static credentialFromError(e) {
|
|
2392
|
-
return
|
|
2410
|
+
return R.credentialFromTaggedObject(e.customData || {});
|
|
2393
2411
|
}
|
|
2394
2412
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2395
2413
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2396
2414
|
return null;
|
|
2397
2415
|
try {
|
|
2398
|
-
return
|
|
2416
|
+
return R.credential(e.oauthAccessToken);
|
|
2399
2417
|
} catch {
|
|
2400
2418
|
return null;
|
|
2401
2419
|
}
|
|
2402
2420
|
}
|
|
2403
2421
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2422
|
+
R.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2423
|
+
R.PROVIDER_ID = "github.com";
|
|
2406
2424
|
/**
|
|
2407
2425
|
* @license
|
|
2408
2426
|
* Copyright 2020 Google LLC
|
|
@@ -2535,7 +2553,7 @@ function $e(n) {
|
|
|
2535
2553
|
* See the License for the specific language governing permissions and
|
|
2536
2554
|
* limitations under the License.
|
|
2537
2555
|
*/
|
|
2538
|
-
class Z extends
|
|
2556
|
+
class Z extends Ie {
|
|
2539
2557
|
constructor(e, t, i, r) {
|
|
2540
2558
|
var s;
|
|
2541
2559
|
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, Z.prototype), this.customData = {
|
|
@@ -2554,7 +2572,7 @@ function Rt(n, e, t, i) {
|
|
|
2554
2572
|
throw s.code === "auth/multi-factor-auth-required" ? Z._fromErrorAndOperation(n, s, e, i) : s;
|
|
2555
2573
|
});
|
|
2556
2574
|
}
|
|
2557
|
-
async function
|
|
2575
|
+
async function zn(n, e, t = !1) {
|
|
2558
2576
|
const i = await j(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2559
2577
|
return O._forOperation(n, "link", i);
|
|
2560
2578
|
}
|
|
@@ -2574,7 +2592,7 @@ async function jn(n, e, t = !1) {
|
|
|
2574
2592
|
* See the License for the specific language governing permissions and
|
|
2575
2593
|
* limitations under the License.
|
|
2576
2594
|
*/
|
|
2577
|
-
async function
|
|
2595
|
+
async function $n(n, e, t = !1) {
|
|
2578
2596
|
const { auth: i } = n;
|
|
2579
2597
|
if (_(i.app))
|
|
2580
2598
|
return Promise.reject(A(i));
|
|
@@ -2587,7 +2605,7 @@ async function Wn(n, e, t = !1) {
|
|
|
2587
2605
|
"internal-error"
|
|
2588
2606
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2589
2607
|
);
|
|
2590
|
-
const o =
|
|
2608
|
+
const o = Ee(s.idToken);
|
|
2591
2609
|
l(
|
|
2592
2610
|
o,
|
|
2593
2611
|
i,
|
|
@@ -2625,7 +2643,7 @@ async function Wn(n, e, t = !1) {
|
|
|
2625
2643
|
* See the License for the specific language governing permissions and
|
|
2626
2644
|
* limitations under the License.
|
|
2627
2645
|
*/
|
|
2628
|
-
async function
|
|
2646
|
+
async function Gn(n, e, t = !1) {
|
|
2629
2647
|
if (_(n.app))
|
|
2630
2648
|
return Promise.reject(A(n));
|
|
2631
2649
|
const i = "signIn", r = await Rt(n, i, e), s = await O._fromIdTokenResponse(n, i, r);
|
|
@@ -2647,8 +2665,8 @@ async function Hn(n, e, t = !1) {
|
|
|
2647
2665
|
* See the License for the specific language governing permissions and
|
|
2648
2666
|
* limitations under the License.
|
|
2649
2667
|
*/
|
|
2650
|
-
async function
|
|
2651
|
-
return
|
|
2668
|
+
async function Bn(n, e) {
|
|
2669
|
+
return ut(n, "POST", "/v1/accounts:signInWithCustomToken", ne(n, e));
|
|
2652
2670
|
}
|
|
2653
2671
|
/**
|
|
2654
2672
|
* @license
|
|
@@ -2666,19 +2684,19 @@ async function qn(n, e) {
|
|
|
2666
2684
|
* See the License for the specific language governing permissions and
|
|
2667
2685
|
* limitations under the License.
|
|
2668
2686
|
*/
|
|
2669
|
-
async function
|
|
2687
|
+
async function Kn(n, e) {
|
|
2670
2688
|
if (_(n.app))
|
|
2671
2689
|
return Promise.reject(A(n));
|
|
2672
|
-
const t = ie(n), i = await
|
|
2690
|
+
const t = ie(n), i = await Bn(t, {
|
|
2673
2691
|
token: e,
|
|
2674
2692
|
returnSecureToken: !0
|
|
2675
2693
|
}), r = await O._fromIdTokenResponse(t, "signIn", i);
|
|
2676
2694
|
return await t._updateCurrentUser(r.user), r;
|
|
2677
2695
|
}
|
|
2678
|
-
function
|
|
2696
|
+
function Jn(n, e, t, i) {
|
|
2679
2697
|
return F(n).onIdTokenChanged(e, t, i);
|
|
2680
2698
|
}
|
|
2681
|
-
function
|
|
2699
|
+
function Xn(n, e, t) {
|
|
2682
2700
|
return F(n).beforeAuthStateChanged(e, t);
|
|
2683
2701
|
}
|
|
2684
2702
|
const ee = "__sak";
|
|
@@ -2698,7 +2716,7 @@ const ee = "__sak";
|
|
|
2698
2716
|
* See the License for the specific language governing permissions and
|
|
2699
2717
|
* limitations under the License.
|
|
2700
2718
|
*/
|
|
2701
|
-
class
|
|
2719
|
+
class bt {
|
|
2702
2720
|
constructor(e, t) {
|
|
2703
2721
|
this.storageRetriever = e, this.type = t;
|
|
2704
2722
|
}
|
|
@@ -2739,14 +2757,14 @@ class Pt {
|
|
|
2739
2757
|
* See the License for the specific language governing permissions and
|
|
2740
2758
|
* limitations under the License.
|
|
2741
2759
|
*/
|
|
2742
|
-
const
|
|
2743
|
-
class
|
|
2760
|
+
const Yn = 1e3, Qn = 10;
|
|
2761
|
+
class At extends bt {
|
|
2744
2762
|
constructor() {
|
|
2745
2763
|
super(
|
|
2746
2764
|
() => window.localStorage,
|
|
2747
2765
|
"LOCAL"
|
|
2748
2766
|
/* PersistenceType.LOCAL */
|
|
2749
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.fallbackToPolling =
|
|
2767
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.fallbackToPolling = Tt(), this._shouldAllowMigration = !0;
|
|
2750
2768
|
}
|
|
2751
2769
|
forAllChangedKeys(e) {
|
|
2752
2770
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2767,7 +2785,7 @@ class bt extends Pt {
|
|
|
2767
2785
|
const o = this.storage.getItem(i);
|
|
2768
2786
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2769
2787
|
}, s = this.storage.getItem(i);
|
|
2770
|
-
|
|
2788
|
+
bn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Qn) : r();
|
|
2771
2789
|
}
|
|
2772
2790
|
notifyListeners(e, t) {
|
|
2773
2791
|
this.localCache[e] = t;
|
|
@@ -2789,7 +2807,7 @@ class bt extends Pt {
|
|
|
2789
2807
|
!0
|
|
2790
2808
|
);
|
|
2791
2809
|
});
|
|
2792
|
-
},
|
|
2810
|
+
}, Yn);
|
|
2793
2811
|
}
|
|
2794
2812
|
stopPolling() {
|
|
2795
2813
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2818,8 +2836,8 @@ class bt extends Pt {
|
|
|
2818
2836
|
await super._remove(e), delete this.localCache[e];
|
|
2819
2837
|
}
|
|
2820
2838
|
}
|
|
2821
|
-
|
|
2822
|
-
const
|
|
2839
|
+
At.type = "LOCAL";
|
|
2840
|
+
const Zn = At;
|
|
2823
2841
|
/**
|
|
2824
2842
|
* @license
|
|
2825
2843
|
* Copyright 2020 Google LLC
|
|
@@ -2836,7 +2854,7 @@ const Jn = bt;
|
|
|
2836
2854
|
* See the License for the specific language governing permissions and
|
|
2837
2855
|
* limitations under the License.
|
|
2838
2856
|
*/
|
|
2839
|
-
class
|
|
2857
|
+
class Ct extends bt {
|
|
2840
2858
|
constructor() {
|
|
2841
2859
|
super(
|
|
2842
2860
|
() => window.sessionStorage,
|
|
@@ -2849,8 +2867,8 @@ class At extends Pt {
|
|
|
2849
2867
|
_removeListener(e, t) {
|
|
2850
2868
|
}
|
|
2851
2869
|
}
|
|
2852
|
-
|
|
2853
|
-
const
|
|
2870
|
+
Ct.type = "SESSION";
|
|
2871
|
+
const Ot = Ct;
|
|
2854
2872
|
/**
|
|
2855
2873
|
* @license
|
|
2856
2874
|
* Copyright 2019 Google LLC
|
|
@@ -2867,7 +2885,7 @@ const Ct = At;
|
|
|
2867
2885
|
* See the License for the specific language governing permissions and
|
|
2868
2886
|
* limitations under the License.
|
|
2869
2887
|
*/
|
|
2870
|
-
function
|
|
2888
|
+
function ei(n) {
|
|
2871
2889
|
return Promise.all(n.map(async (e) => {
|
|
2872
2890
|
try {
|
|
2873
2891
|
return {
|
|
@@ -2937,7 +2955,7 @@ class re {
|
|
|
2937
2955
|
eventId: i,
|
|
2938
2956
|
eventType: r
|
|
2939
2957
|
});
|
|
2940
|
-
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await
|
|
2958
|
+
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await ei(c);
|
|
2941
2959
|
t.ports[0].postMessage({
|
|
2942
2960
|
status: "done",
|
|
2943
2961
|
eventId: i,
|
|
@@ -2983,7 +3001,7 @@ re.receivers = [];
|
|
|
2983
3001
|
* See the License for the specific language governing permissions and
|
|
2984
3002
|
* limitations under the License.
|
|
2985
3003
|
*/
|
|
2986
|
-
function
|
|
3004
|
+
function Pe(n = "", e = 10) {
|
|
2987
3005
|
let t = "";
|
|
2988
3006
|
for (let i = 0; i < e; i++)
|
|
2989
3007
|
t += Math.floor(Math.random() * 10);
|
|
@@ -3005,7 +3023,7 @@ function Se(n = "", e = 10) {
|
|
|
3005
3023
|
* See the License for the specific language governing permissions and
|
|
3006
3024
|
* limitations under the License.
|
|
3007
3025
|
*/
|
|
3008
|
-
class
|
|
3026
|
+
class ti {
|
|
3009
3027
|
constructor(e) {
|
|
3010
3028
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3011
3029
|
}
|
|
@@ -3039,7 +3057,7 @@ class Yn {
|
|
|
3039
3057
|
);
|
|
3040
3058
|
let s, o;
|
|
3041
3059
|
return new Promise((c, a) => {
|
|
3042
|
-
const u =
|
|
3060
|
+
const u = Pe("", 20);
|
|
3043
3061
|
r.port1.start();
|
|
3044
3062
|
const h = setTimeout(() => {
|
|
3045
3063
|
a(new Error(
|
|
@@ -3105,7 +3123,7 @@ class Yn {
|
|
|
3105
3123
|
function m() {
|
|
3106
3124
|
return window;
|
|
3107
3125
|
}
|
|
3108
|
-
function
|
|
3126
|
+
function ni(n) {
|
|
3109
3127
|
m().location.href = n;
|
|
3110
3128
|
}
|
|
3111
3129
|
/**
|
|
@@ -3124,10 +3142,10 @@ function Qn(n) {
|
|
|
3124
3142
|
* See the License for the specific language governing permissions and
|
|
3125
3143
|
* limitations under the License.
|
|
3126
3144
|
*/
|
|
3127
|
-
function
|
|
3145
|
+
function Nt() {
|
|
3128
3146
|
return typeof m().WorkerGlobalScope < "u" && typeof m().importScripts == "function";
|
|
3129
3147
|
}
|
|
3130
|
-
async function
|
|
3148
|
+
async function ii() {
|
|
3131
3149
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3132
3150
|
return null;
|
|
3133
3151
|
try {
|
|
@@ -3136,12 +3154,12 @@ async function Zn() {
|
|
|
3136
3154
|
return null;
|
|
3137
3155
|
}
|
|
3138
3156
|
}
|
|
3139
|
-
function
|
|
3157
|
+
function ri() {
|
|
3140
3158
|
var n;
|
|
3141
3159
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3142
3160
|
}
|
|
3143
|
-
function
|
|
3144
|
-
return
|
|
3161
|
+
function si() {
|
|
3162
|
+
return Nt() ? self : null;
|
|
3145
3163
|
}
|
|
3146
3164
|
/**
|
|
3147
3165
|
* @license
|
|
@@ -3159,7 +3177,7 @@ function ti() {
|
|
|
3159
3177
|
* See the License for the specific language governing permissions and
|
|
3160
3178
|
* limitations under the License.
|
|
3161
3179
|
*/
|
|
3162
|
-
const
|
|
3180
|
+
const Lt = "firebaseLocalStorageDb", oi = 1, te = "firebaseLocalStorage", Ut = "fbase_key";
|
|
3163
3181
|
class $ {
|
|
3164
3182
|
constructor(e) {
|
|
3165
3183
|
this.request = e;
|
|
@@ -3177,52 +3195,52 @@ class $ {
|
|
|
3177
3195
|
function se(n, e) {
|
|
3178
3196
|
return n.transaction([te], e ? "readwrite" : "readonly").objectStore(te);
|
|
3179
3197
|
}
|
|
3180
|
-
function
|
|
3181
|
-
const n = indexedDB.deleteDatabase(
|
|
3198
|
+
function ai() {
|
|
3199
|
+
const n = indexedDB.deleteDatabase(Lt);
|
|
3182
3200
|
return new $(n).toPromise();
|
|
3183
3201
|
}
|
|
3184
|
-
function
|
|
3185
|
-
const n = indexedDB.open(
|
|
3202
|
+
function _e() {
|
|
3203
|
+
const n = indexedDB.open(Lt, oi);
|
|
3186
3204
|
return new Promise((e, t) => {
|
|
3187
3205
|
n.addEventListener("error", () => {
|
|
3188
3206
|
t(n.error);
|
|
3189
3207
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3190
3208
|
const i = n.result;
|
|
3191
3209
|
try {
|
|
3192
|
-
i.createObjectStore(te, { keyPath:
|
|
3210
|
+
i.createObjectStore(te, { keyPath: Ut });
|
|
3193
3211
|
} catch (r) {
|
|
3194
3212
|
t(r);
|
|
3195
3213
|
}
|
|
3196
3214
|
}), n.addEventListener("success", async () => {
|
|
3197
3215
|
const i = n.result;
|
|
3198
|
-
i.objectStoreNames.contains(te) ? e(i) : (i.close(), await
|
|
3216
|
+
i.objectStoreNames.contains(te) ? e(i) : (i.close(), await ai(), e(await _e()));
|
|
3199
3217
|
});
|
|
3200
3218
|
});
|
|
3201
3219
|
}
|
|
3202
|
-
async function
|
|
3220
|
+
async function Ge(n, e, t) {
|
|
3203
3221
|
const i = se(n, !0).put({
|
|
3204
|
-
[
|
|
3222
|
+
[Ut]: e,
|
|
3205
3223
|
value: t
|
|
3206
3224
|
});
|
|
3207
3225
|
return new $(i).toPromise();
|
|
3208
3226
|
}
|
|
3209
|
-
async function
|
|
3227
|
+
async function ci(n, e) {
|
|
3210
3228
|
const t = se(n, !1).get(e), i = await new $(t).toPromise();
|
|
3211
3229
|
return i === void 0 ? null : i.value;
|
|
3212
3230
|
}
|
|
3213
|
-
function
|
|
3231
|
+
function Be(n, e) {
|
|
3214
3232
|
const t = se(n, !0).delete(e);
|
|
3215
3233
|
return new $(t).toPromise();
|
|
3216
3234
|
}
|
|
3217
|
-
const
|
|
3218
|
-
class
|
|
3235
|
+
const li = 800, ui = 3;
|
|
3236
|
+
class Mt {
|
|
3219
3237
|
constructor() {
|
|
3220
3238
|
this.type = "LOCAL", this._shouldAllowMigration = !0, this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.pendingWrites = 0, this.receiver = null, this.sender = null, this.serviceWorkerReceiverAvailable = !1, this.activeServiceWorker = null, this._workerInitializationPromise = this.initializeServiceWorkerMessaging().then(() => {
|
|
3221
3239
|
}, () => {
|
|
3222
3240
|
});
|
|
3223
3241
|
}
|
|
3224
3242
|
async _openDb() {
|
|
3225
|
-
return this.db ? this.db : (this.db = await
|
|
3243
|
+
return this.db ? this.db : (this.db = await _e(), this.db);
|
|
3226
3244
|
}
|
|
3227
3245
|
async _withRetries(e) {
|
|
3228
3246
|
let t = 0;
|
|
@@ -3231,7 +3249,7 @@ class Ut {
|
|
|
3231
3249
|
const i = await this._openDb();
|
|
3232
3250
|
return await e(i);
|
|
3233
3251
|
} catch (i) {
|
|
3234
|
-
if (t++ >
|
|
3252
|
+
if (t++ > ui)
|
|
3235
3253
|
throw i;
|
|
3236
3254
|
this.db && (this.db.close(), this.db = void 0);
|
|
3237
3255
|
}
|
|
@@ -3241,13 +3259,13 @@ class Ut {
|
|
|
3241
3259
|
* postMessage interface to send these events to the worker ourselves.
|
|
3242
3260
|
*/
|
|
3243
3261
|
async initializeServiceWorkerMessaging() {
|
|
3244
|
-
return
|
|
3262
|
+
return Nt() ? this.initializeReceiver() : this.initializeSender();
|
|
3245
3263
|
}
|
|
3246
3264
|
/**
|
|
3247
3265
|
* As the worker we should listen to events from the main window.
|
|
3248
3266
|
*/
|
|
3249
3267
|
async initializeReceiver() {
|
|
3250
|
-
this.receiver = re._getInstance(
|
|
3268
|
+
this.receiver = re._getInstance(si()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3251
3269
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3252
3270
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3253
3271
|
"keyChanged"
|
|
@@ -3263,9 +3281,9 @@ class Ut {
|
|
|
3263
3281
|
*/
|
|
3264
3282
|
async initializeSender() {
|
|
3265
3283
|
var e, t;
|
|
3266
|
-
if (this.activeServiceWorker = await
|
|
3284
|
+
if (this.activeServiceWorker = await ii(), !this.activeServiceWorker)
|
|
3267
3285
|
return;
|
|
3268
|
-
this.sender = new
|
|
3286
|
+
this.sender = new ti(this.activeServiceWorker);
|
|
3269
3287
|
const i = await this.sender._send(
|
|
3270
3288
|
"ping",
|
|
3271
3289
|
{},
|
|
@@ -3287,7 +3305,7 @@ class Ut {
|
|
|
3287
3305
|
* @param key - Storage key which changed.
|
|
3288
3306
|
*/
|
|
3289
3307
|
async notifyServiceWorker(e) {
|
|
3290
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3308
|
+
if (!(!this.sender || !this.activeServiceWorker || ri() !== this.activeServiceWorker))
|
|
3291
3309
|
try {
|
|
3292
3310
|
await this.sender._send(
|
|
3293
3311
|
"keyChanged",
|
|
@@ -3303,8 +3321,8 @@ class Ut {
|
|
|
3303
3321
|
try {
|
|
3304
3322
|
if (!indexedDB)
|
|
3305
3323
|
return !1;
|
|
3306
|
-
const e = await
|
|
3307
|
-
return await
|
|
3324
|
+
const e = await _e();
|
|
3325
|
+
return await Ge(e, ee, "1"), await Be(e, ee), !0;
|
|
3308
3326
|
} catch {
|
|
3309
3327
|
}
|
|
3310
3328
|
return !1;
|
|
@@ -3318,14 +3336,14 @@ class Ut {
|
|
|
3318
3336
|
}
|
|
3319
3337
|
}
|
|
3320
3338
|
async _set(e, t) {
|
|
3321
|
-
return this._withPendingWrite(async () => (await this._withRetries((i) =>
|
|
3339
|
+
return this._withPendingWrite(async () => (await this._withRetries((i) => Ge(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3322
3340
|
}
|
|
3323
3341
|
async _get(e) {
|
|
3324
|
-
const t = await this._withRetries((i) =>
|
|
3342
|
+
const t = await this._withRetries((i) => ci(i, e));
|
|
3325
3343
|
return this.localCache[e] = t, t;
|
|
3326
3344
|
}
|
|
3327
3345
|
async _remove(e) {
|
|
3328
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
|
3346
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => Be(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
|
3329
3347
|
}
|
|
3330
3348
|
async _poll() {
|
|
3331
3349
|
const e = await this._withRetries((r) => {
|
|
@@ -3352,7 +3370,7 @@ class Ut {
|
|
|
3352
3370
|
r(t);
|
|
3353
3371
|
}
|
|
3354
3372
|
startPolling() {
|
|
3355
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3373
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), li);
|
|
3356
3374
|
}
|
|
3357
3375
|
stopPolling() {
|
|
3358
3376
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3364,8 +3382,8 @@ class Ut {
|
|
|
3364
3382
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
|
3365
3383
|
}
|
|
3366
3384
|
}
|
|
3367
|
-
|
|
3368
|
-
const
|
|
3385
|
+
Mt.type = "LOCAL";
|
|
3386
|
+
const di = Mt;
|
|
3369
3387
|
new q(3e4, 6e4);
|
|
3370
3388
|
/**
|
|
3371
3389
|
* @license
|
|
@@ -3383,7 +3401,7 @@ new q(3e4, 6e4);
|
|
|
3383
3401
|
* See the License for the specific language governing permissions and
|
|
3384
3402
|
* limitations under the License.
|
|
3385
3403
|
*/
|
|
3386
|
-
function
|
|
3404
|
+
function hi(n, e) {
|
|
3387
3405
|
return e ? w(e) : (l(
|
|
3388
3406
|
n._popupRedirectResolver,
|
|
3389
3407
|
n,
|
|
@@ -3407,7 +3425,7 @@ function ci(n, e) {
|
|
|
3407
3425
|
* See the License for the specific language governing permissions and
|
|
3408
3426
|
* limitations under the License.
|
|
3409
3427
|
*/
|
|
3410
|
-
class Re extends
|
|
3428
|
+
class Re extends St {
|
|
3411
3429
|
constructor(e) {
|
|
3412
3430
|
super(
|
|
3413
3431
|
"custom",
|
|
@@ -3437,26 +3455,26 @@ class Re extends kt {
|
|
|
3437
3455
|
return e && (t.idToken = e), t;
|
|
3438
3456
|
}
|
|
3439
3457
|
}
|
|
3440
|
-
function
|
|
3441
|
-
return
|
|
3458
|
+
function fi(n) {
|
|
3459
|
+
return Gn(n.auth, new Re(n), n.bypassAuthState);
|
|
3442
3460
|
}
|
|
3443
|
-
function
|
|
3461
|
+
function pi(n) {
|
|
3444
3462
|
const { auth: e, user: t } = n;
|
|
3445
3463
|
return l(
|
|
3446
3464
|
t,
|
|
3447
3465
|
e,
|
|
3448
3466
|
"internal-error"
|
|
3449
3467
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3450
|
-
),
|
|
3468
|
+
), $n(t, new Re(n), n.bypassAuthState);
|
|
3451
3469
|
}
|
|
3452
|
-
async function
|
|
3470
|
+
async function gi(n) {
|
|
3453
3471
|
const { auth: e, user: t } = n;
|
|
3454
3472
|
return l(
|
|
3455
3473
|
t,
|
|
3456
3474
|
e,
|
|
3457
3475
|
"internal-error"
|
|
3458
3476
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3459
|
-
),
|
|
3477
|
+
), zn(t, new Re(n), n.bypassAuthState);
|
|
3460
3478
|
}
|
|
3461
3479
|
/**
|
|
3462
3480
|
* @license
|
|
@@ -3474,7 +3492,7 @@ async function di(n) {
|
|
|
3474
3492
|
* See the License for the specific language governing permissions and
|
|
3475
3493
|
* limitations under the License.
|
|
3476
3494
|
*/
|
|
3477
|
-
class
|
|
3495
|
+
class Dt {
|
|
3478
3496
|
constructor(e, t, i, r, s = !1) {
|
|
3479
3497
|
this.auth = e, this.resolver = i, this.user = r, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
|
3480
3498
|
}
|
|
@@ -3516,13 +3534,13 @@ class Mt {
|
|
|
3516
3534
|
switch (e) {
|
|
3517
3535
|
case "signInViaPopup":
|
|
3518
3536
|
case "signInViaRedirect":
|
|
3519
|
-
return
|
|
3537
|
+
return fi;
|
|
3520
3538
|
case "linkViaPopup":
|
|
3521
3539
|
case "linkViaRedirect":
|
|
3522
|
-
return
|
|
3540
|
+
return gi;
|
|
3523
3541
|
case "reauthViaPopup":
|
|
3524
3542
|
case "reauthViaRedirect":
|
|
3525
|
-
return
|
|
3543
|
+
return pi;
|
|
3526
3544
|
default:
|
|
3527
3545
|
y(
|
|
3528
3546
|
this.auth,
|
|
@@ -3557,8 +3575,8 @@ class Mt {
|
|
|
3557
3575
|
* See the License for the specific language governing permissions and
|
|
3558
3576
|
* limitations under the License.
|
|
3559
3577
|
*/
|
|
3560
|
-
const
|
|
3561
|
-
class L extends
|
|
3578
|
+
const mi = new q(2e3, 1e4);
|
|
3579
|
+
class L extends Dt {
|
|
3562
3580
|
constructor(e, t, i, r, s) {
|
|
3563
3581
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, L.currentPopupAction && L.currentPopupAction.cancel(), L.currentPopupAction = this;
|
|
3564
3582
|
}
|
|
@@ -3573,7 +3591,7 @@ class L extends Mt {
|
|
|
3573
3591
|
}
|
|
3574
3592
|
async onExecution() {
|
|
3575
3593
|
T(this.filter.length === 1, "Popup operations only handle one event");
|
|
3576
|
-
const e =
|
|
3594
|
+
const e = Pe();
|
|
3577
3595
|
this.authWindow = await this.resolver._openPopup(
|
|
3578
3596
|
this.auth,
|
|
3579
3597
|
this.provider,
|
|
@@ -3621,7 +3639,7 @@ class L extends Mt {
|
|
|
3621
3639
|
);
|
|
3622
3640
|
return;
|
|
3623
3641
|
}
|
|
3624
|
-
this.pollId = window.setTimeout(e,
|
|
3642
|
+
this.pollId = window.setTimeout(e, mi.get());
|
|
3625
3643
|
};
|
|
3626
3644
|
e();
|
|
3627
3645
|
}
|
|
@@ -3643,8 +3661,8 @@ L.currentPopupAction = null;
|
|
|
3643
3661
|
* See the License for the specific language governing permissions and
|
|
3644
3662
|
* limitations under the License.
|
|
3645
3663
|
*/
|
|
3646
|
-
const
|
|
3647
|
-
class
|
|
3664
|
+
const _i = "pendingRedirect", J = /* @__PURE__ */ new Map();
|
|
3665
|
+
class vi extends Dt {
|
|
3648
3666
|
constructor(e, t, i = !1) {
|
|
3649
3667
|
super(e, [
|
|
3650
3668
|
"signInViaRedirect",
|
|
@@ -3662,7 +3680,7 @@ class pi extends Mt {
|
|
|
3662
3680
|
let e = J.get(this.auth._key());
|
|
3663
3681
|
if (!e) {
|
|
3664
3682
|
try {
|
|
3665
|
-
const i = await
|
|
3683
|
+
const i = await Ii(this.resolver, this.auth) ? await super.execute() : null;
|
|
3666
3684
|
e = () => Promise.resolve(i);
|
|
3667
3685
|
} catch (t) {
|
|
3668
3686
|
e = () => Promise.reject(t);
|
|
@@ -3690,26 +3708,26 @@ class pi extends Mt {
|
|
|
3690
3708
|
cleanUp() {
|
|
3691
3709
|
}
|
|
3692
3710
|
}
|
|
3693
|
-
async function
|
|
3694
|
-
const t =
|
|
3711
|
+
async function Ii(n, e) {
|
|
3712
|
+
const t = Ti(e), i = yi(n);
|
|
3695
3713
|
if (!await i._isAvailable())
|
|
3696
3714
|
return !1;
|
|
3697
3715
|
const r = await i._get(t) === "true";
|
|
3698
3716
|
return await i._remove(t), r;
|
|
3699
3717
|
}
|
|
3700
|
-
function
|
|
3718
|
+
function wi(n, e) {
|
|
3701
3719
|
J.set(n._key(), e);
|
|
3702
3720
|
}
|
|
3703
|
-
function
|
|
3721
|
+
function yi(n) {
|
|
3704
3722
|
return w(n._redirectPersistence);
|
|
3705
3723
|
}
|
|
3706
|
-
function
|
|
3707
|
-
return K(
|
|
3724
|
+
function Ti(n) {
|
|
3725
|
+
return K(_i, n.config.apiKey, n.name);
|
|
3708
3726
|
}
|
|
3709
|
-
async function
|
|
3727
|
+
async function Ei(n, e, t = !1) {
|
|
3710
3728
|
if (_(n.app))
|
|
3711
3729
|
return Promise.reject(A(n));
|
|
3712
|
-
const i = ie(n), r =
|
|
3730
|
+
const i = ie(n), r = hi(i, e), o = await new vi(i, r, t).execute();
|
|
3713
3731
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3714
3732
|
}
|
|
3715
3733
|
/**
|
|
@@ -3728,8 +3746,8 @@ async function Ii(n, e, t = !1) {
|
|
|
3728
3746
|
* See the License for the specific language governing permissions and
|
|
3729
3747
|
* limitations under the License.
|
|
3730
3748
|
*/
|
|
3731
|
-
const
|
|
3732
|
-
class
|
|
3749
|
+
const ki = 10 * 60 * 1e3;
|
|
3750
|
+
class Si {
|
|
3733
3751
|
constructor(e) {
|
|
3734
3752
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3735
3753
|
}
|
|
@@ -3745,11 +3763,11 @@ class yi {
|
|
|
3745
3763
|
let t = !1;
|
|
3746
3764
|
return this.consumers.forEach((i) => {
|
|
3747
3765
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3748
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3766
|
+
}), this.hasHandledPotentialRedirect || !Pi(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3749
3767
|
}
|
|
3750
3768
|
sendToConsumer(e, t) {
|
|
3751
3769
|
var i;
|
|
3752
|
-
if (e.error && !
|
|
3770
|
+
if (e.error && !Ft(e)) {
|
|
3753
3771
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
3754
3772
|
t.onError(g(this.auth, r));
|
|
3755
3773
|
} else
|
|
@@ -3760,7 +3778,7 @@ class yi {
|
|
|
3760
3778
|
return t.filter.includes(e.type) && i;
|
|
3761
3779
|
}
|
|
3762
3780
|
hasEventBeenHandled(e) {
|
|
3763
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3781
|
+
return Date.now() - this.lastProcessedEventTime >= ki && this.cachedEventUids.clear(), this.cachedEventUids.has(Ke(e));
|
|
3764
3782
|
}
|
|
3765
3783
|
saveEventToCache(e) {
|
|
3766
3784
|
this.cachedEventUids.add(Ke(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -3769,17 +3787,17 @@ class yi {
|
|
|
3769
3787
|
function Ke(n) {
|
|
3770
3788
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
3771
3789
|
}
|
|
3772
|
-
function
|
|
3790
|
+
function Ft({ type: n, error: e }) {
|
|
3773
3791
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3774
3792
|
}
|
|
3775
|
-
function
|
|
3793
|
+
function Pi(n) {
|
|
3776
3794
|
switch (n.type) {
|
|
3777
3795
|
case "signInViaRedirect":
|
|
3778
3796
|
case "linkViaRedirect":
|
|
3779
3797
|
case "reauthViaRedirect":
|
|
3780
3798
|
return !0;
|
|
3781
3799
|
case "unknown":
|
|
3782
|
-
return
|
|
3800
|
+
return Ft(n);
|
|
3783
3801
|
default:
|
|
3784
3802
|
return !1;
|
|
3785
3803
|
}
|
|
@@ -3800,7 +3818,7 @@ function Ti(n) {
|
|
|
3800
3818
|
* See the License for the specific language governing permissions and
|
|
3801
3819
|
* limitations under the License.
|
|
3802
3820
|
*/
|
|
3803
|
-
async function
|
|
3821
|
+
async function Ri(n, e = {}) {
|
|
3804
3822
|
return x(n, "GET", "/v1/projects", e);
|
|
3805
3823
|
}
|
|
3806
3824
|
/**
|
|
@@ -3819,14 +3837,14 @@ async function Ei(n, e = {}) {
|
|
|
3819
3837
|
* See the License for the specific language governing permissions and
|
|
3820
3838
|
* limitations under the License.
|
|
3821
3839
|
*/
|
|
3822
|
-
const
|
|
3823
|
-
async function
|
|
3840
|
+
const bi = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Ai = /^https?/;
|
|
3841
|
+
async function Ci(n) {
|
|
3824
3842
|
if (n.config.emulator)
|
|
3825
3843
|
return;
|
|
3826
|
-
const { authorizedDomains: e } = await
|
|
3844
|
+
const { authorizedDomains: e } = await Ri(n);
|
|
3827
3845
|
for (const t of e)
|
|
3828
3846
|
try {
|
|
3829
|
-
if (
|
|
3847
|
+
if (Oi(t))
|
|
3830
3848
|
return;
|
|
3831
3849
|
} catch {
|
|
3832
3850
|
}
|
|
@@ -3836,15 +3854,15 @@ async function Ri(n) {
|
|
|
3836
3854
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
3837
3855
|
);
|
|
3838
3856
|
}
|
|
3839
|
-
function
|
|
3840
|
-
const e =
|
|
3857
|
+
function Oi(n) {
|
|
3858
|
+
const e = ge(), { protocol: t, hostname: i } = new URL(e);
|
|
3841
3859
|
if (n.startsWith("chrome-extension://")) {
|
|
3842
3860
|
const o = new URL(n);
|
|
3843
3861
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
3844
3862
|
}
|
|
3845
|
-
if (!
|
|
3863
|
+
if (!Ai.test(t))
|
|
3846
3864
|
return !1;
|
|
3847
|
-
if (
|
|
3865
|
+
if (bi.test(n))
|
|
3848
3866
|
return i === n;
|
|
3849
3867
|
const r = n.replace(/\./g, "\\.");
|
|
3850
3868
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -3865,7 +3883,7 @@ function Pi(n) {
|
|
|
3865
3883
|
* See the License for the specific language governing permissions and
|
|
3866
3884
|
* limitations under the License.
|
|
3867
3885
|
*/
|
|
3868
|
-
const
|
|
3886
|
+
const Ni = new q(3e4, 6e4);
|
|
3869
3887
|
function Je() {
|
|
3870
3888
|
const n = m().___jsl;
|
|
3871
3889
|
if (n != null && n.H) {
|
|
@@ -3875,7 +3893,7 @@ function Je() {
|
|
|
3875
3893
|
n.CP[t] = null;
|
|
3876
3894
|
}
|
|
3877
3895
|
}
|
|
3878
|
-
function
|
|
3896
|
+
function Li(n) {
|
|
3879
3897
|
return new Promise((e, t) => {
|
|
3880
3898
|
var i, r, s;
|
|
3881
3899
|
function o() {
|
|
@@ -3890,7 +3908,7 @@ function Ai(n) {
|
|
|
3890
3908
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
3891
3909
|
));
|
|
3892
3910
|
},
|
|
3893
|
-
timeout:
|
|
3911
|
+
timeout: Ni.get()
|
|
3894
3912
|
});
|
|
3895
3913
|
}
|
|
3896
3914
|
if (!((r = (i = m().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
@@ -3898,22 +3916,22 @@ function Ai(n) {
|
|
|
3898
3916
|
else if (!((s = m().gapi) === null || s === void 0) && s.load)
|
|
3899
3917
|
o();
|
|
3900
3918
|
else {
|
|
3901
|
-
const c =
|
|
3919
|
+
const c = Fn("iframefcb");
|
|
3902
3920
|
return m()[c] = () => {
|
|
3903
3921
|
gapi.load ? o() : t(g(
|
|
3904
3922
|
n,
|
|
3905
3923
|
"network-request-failed"
|
|
3906
3924
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
3907
3925
|
));
|
|
3908
|
-
},
|
|
3926
|
+
}, Mn(`${Dn()}?onload=${c}`).catch((a) => t(a));
|
|
3909
3927
|
}
|
|
3910
3928
|
}).catch((e) => {
|
|
3911
3929
|
throw X = null, e;
|
|
3912
3930
|
});
|
|
3913
3931
|
}
|
|
3914
3932
|
let X = null;
|
|
3915
|
-
function
|
|
3916
|
-
return X = X ||
|
|
3933
|
+
function Ui(n) {
|
|
3934
|
+
return X = X || Li(n), X;
|
|
3917
3935
|
}
|
|
3918
3936
|
/**
|
|
3919
3937
|
* @license
|
|
@@ -3931,7 +3949,7 @@ function Ci(n) {
|
|
|
3931
3949
|
* See the License for the specific language governing permissions and
|
|
3932
3950
|
* limitations under the License.
|
|
3933
3951
|
*/
|
|
3934
|
-
const
|
|
3952
|
+
const Mi = new q(5e3, 15e3), Di = "__/auth/iframe", Fi = "emulator/auth/iframe", xi = {
|
|
3935
3953
|
style: {
|
|
3936
3954
|
position: "absolute",
|
|
3937
3955
|
top: "-100px",
|
|
@@ -3940,13 +3958,13 @@ const Oi = new q(5e3, 15e3), Ni = "__/auth/iframe", Li = "emulator/auth/iframe",
|
|
|
3940
3958
|
},
|
|
3941
3959
|
"aria-hidden": "true",
|
|
3942
3960
|
tabindex: "-1"
|
|
3943
|
-
},
|
|
3961
|
+
}, Vi = /* @__PURE__ */ new Map([
|
|
3944
3962
|
["identitytoolkit.googleapis.com", "p"],
|
|
3945
3963
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
3946
3964
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
3947
3965
|
// test
|
|
3948
3966
|
]);
|
|
3949
|
-
function
|
|
3967
|
+
function ji(n) {
|
|
3950
3968
|
const e = n.config;
|
|
3951
3969
|
l(
|
|
3952
3970
|
e.authDomain,
|
|
@@ -3954,17 +3972,17 @@ function Di(n) {
|
|
|
3954
3972
|
"auth-domain-config-required"
|
|
3955
3973
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
3956
3974
|
);
|
|
3957
|
-
const t = e.emulator ?
|
|
3975
|
+
const t = e.emulator ? Te(e, Fi) : `https://${n.config.authDomain}/${Di}`, i = {
|
|
3958
3976
|
apiKey: e.apiKey,
|
|
3959
3977
|
appName: n.name,
|
|
3960
3978
|
v: W
|
|
3961
|
-
}, r =
|
|
3979
|
+
}, r = Vi.get(n.config.apiHost);
|
|
3962
3980
|
r && (i.eid = r);
|
|
3963
3981
|
const s = n._getFrameworks();
|
|
3964
3982
|
return s.length && (i.fw = s.join(",")), `${t}?${H(i).slice(1)}`;
|
|
3965
3983
|
}
|
|
3966
|
-
async function
|
|
3967
|
-
const e = await
|
|
3984
|
+
async function Wi(n) {
|
|
3985
|
+
const e = await Ui(n), t = m().gapi;
|
|
3968
3986
|
return l(
|
|
3969
3987
|
t,
|
|
3970
3988
|
n,
|
|
@@ -3972,9 +3990,9 @@ async function Fi(n) {
|
|
|
3972
3990
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3973
3991
|
), e.open({
|
|
3974
3992
|
where: document.body,
|
|
3975
|
-
url:
|
|
3993
|
+
url: ji(n),
|
|
3976
3994
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
3977
|
-
attributes:
|
|
3995
|
+
attributes: xi,
|
|
3978
3996
|
dontclear: !0
|
|
3979
3997
|
}, (i) => new Promise(async (r, s) => {
|
|
3980
3998
|
await i.restyle({
|
|
@@ -3987,7 +4005,7 @@ async function Fi(n) {
|
|
|
3987
4005
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
3988
4006
|
), c = m().setTimeout(() => {
|
|
3989
4007
|
s(o);
|
|
3990
|
-
},
|
|
4008
|
+
}, Mi.get());
|
|
3991
4009
|
function a() {
|
|
3992
4010
|
m().clearTimeout(c), r(i);
|
|
3993
4011
|
}
|
|
@@ -4012,12 +4030,12 @@ async function Fi(n) {
|
|
|
4012
4030
|
* See the License for the specific language governing permissions and
|
|
4013
4031
|
* limitations under the License.
|
|
4014
4032
|
*/
|
|
4015
|
-
const
|
|
4033
|
+
const Hi = {
|
|
4016
4034
|
location: "yes",
|
|
4017
4035
|
resizable: "yes",
|
|
4018
4036
|
statusbar: "yes",
|
|
4019
4037
|
toolbar: "no"
|
|
4020
|
-
},
|
|
4038
|
+
}, qi = 500, zi = 600, $i = "_blank", Gi = "http://localhost";
|
|
4021
4039
|
class Xe {
|
|
4022
4040
|
constructor(e) {
|
|
4023
4041
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4030,19 +4048,19 @@ class Xe {
|
|
|
4030
4048
|
}
|
|
4031
4049
|
}
|
|
4032
4050
|
}
|
|
4033
|
-
function
|
|
4051
|
+
function Bi(n, e, t, i = qi, r = zi) {
|
|
4034
4052
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4035
4053
|
let c = "";
|
|
4036
|
-
const a = Object.assign(Object.assign({},
|
|
4054
|
+
const a = Object.assign(Object.assign({}, Hi), {
|
|
4037
4055
|
width: i.toString(),
|
|
4038
4056
|
height: r.toString(),
|
|
4039
4057
|
top: s,
|
|
4040
4058
|
left: o
|
|
4041
4059
|
}), u = p().toLowerCase();
|
|
4042
|
-
t && (c =
|
|
4060
|
+
t && (c = _t(u) ? $i : t), gt(u) && (e = e || Gi, a.scrollbars = "yes");
|
|
4043
4061
|
const h = Object.entries(a).reduce((f, [E, N]) => `${f}${E}=${N},`, "");
|
|
4044
|
-
if (
|
|
4045
|
-
return
|
|
4062
|
+
if (Rn(u) && c !== "_self")
|
|
4063
|
+
return Ki(e || "", c), new Xe(null);
|
|
4046
4064
|
const d = window.open(e || "", c, h);
|
|
4047
4065
|
l(
|
|
4048
4066
|
d,
|
|
@@ -4056,7 +4074,7 @@ function qi(n, e, t, i = Vi, r = ji) {
|
|
|
4056
4074
|
}
|
|
4057
4075
|
return new Xe(d);
|
|
4058
4076
|
}
|
|
4059
|
-
function
|
|
4077
|
+
function Ki(n, e) {
|
|
4060
4078
|
const t = document.createElement("a");
|
|
4061
4079
|
t.href = n, t.target = e;
|
|
4062
4080
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4078,7 +4096,7 @@ function zi(n, e) {
|
|
|
4078
4096
|
* See the License for the specific language governing permissions and
|
|
4079
4097
|
* limitations under the License.
|
|
4080
4098
|
*/
|
|
4081
|
-
const
|
|
4099
|
+
const Ji = "__/auth/handler", Xi = "emulator/auth/handler", Yi = encodeURIComponent("fac");
|
|
4082
4100
|
async function Ye(n, e, t, i, r, s) {
|
|
4083
4101
|
l(
|
|
4084
4102
|
n.config.authDomain,
|
|
@@ -4099,7 +4117,7 @@ async function Ye(n, e, t, i, r, s) {
|
|
|
4099
4117
|
v: W,
|
|
4100
4118
|
eventId: r
|
|
4101
4119
|
};
|
|
4102
|
-
if (e instanceof
|
|
4120
|
+
if (e instanceof Pt) {
|
|
4103
4121
|
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", nn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4104
4122
|
for (const [h, d] of Object.entries(s || {}))
|
|
4105
4123
|
o[h] = d;
|
|
@@ -4112,11 +4130,11 @@ async function Ye(n, e, t, i, r, s) {
|
|
|
4112
4130
|
const c = o;
|
|
4113
4131
|
for (const h of Object.keys(c))
|
|
4114
4132
|
c[h] === void 0 && delete c[h];
|
|
4115
|
-
const a = await n._getAppCheckToken(), u = a ? `#${
|
|
4116
|
-
return `${
|
|
4133
|
+
const a = await n._getAppCheckToken(), u = a ? `#${Yi}=${encodeURIComponent(a)}` : "";
|
|
4134
|
+
return `${Qi(n)}?${H(c).slice(1)}${u}`;
|
|
4117
4135
|
}
|
|
4118
|
-
function
|
|
4119
|
-
return n.emulator ?
|
|
4136
|
+
function Qi({ config: n }) {
|
|
4137
|
+
return n.emulator ? Te(n, Xi) : `https://${n.authDomain}/${Ji}`;
|
|
4120
4138
|
}
|
|
4121
4139
|
/**
|
|
4122
4140
|
* @license
|
|
@@ -4135,22 +4153,22 @@ function Ki({ config: n }) {
|
|
|
4135
4153
|
* limitations under the License.
|
|
4136
4154
|
*/
|
|
4137
4155
|
const fe = "webStorageSupport";
|
|
4138
|
-
class
|
|
4156
|
+
class Zi {
|
|
4139
4157
|
constructor() {
|
|
4140
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4158
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Ot, this._completeRedirectFn = Ei, this._overrideRedirectResult = wi;
|
|
4141
4159
|
}
|
|
4142
4160
|
// Wrapping in async even though we don't await anywhere in order
|
|
4143
4161
|
// to make sure errors are raised as promise rejections
|
|
4144
4162
|
async _openPopup(e, t, i, r) {
|
|
4145
4163
|
var s;
|
|
4146
4164
|
T((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4147
|
-
const o = await Ye(e, t, i,
|
|
4148
|
-
return
|
|
4165
|
+
const o = await Ye(e, t, i, ge(), r);
|
|
4166
|
+
return Bi(e, o, Pe());
|
|
4149
4167
|
}
|
|
4150
4168
|
async _openRedirect(e, t, i, r) {
|
|
4151
4169
|
await this._originValidation(e);
|
|
4152
|
-
const s = await Ye(e, t, i,
|
|
4153
|
-
return
|
|
4170
|
+
const s = await Ye(e, t, i, ge(), r);
|
|
4171
|
+
return ni(s), new Promise(() => {
|
|
4154
4172
|
});
|
|
4155
4173
|
}
|
|
4156
4174
|
_initialize(e) {
|
|
@@ -4165,7 +4183,7 @@ class Ji {
|
|
|
4165
4183
|
}), i;
|
|
4166
4184
|
}
|
|
4167
4185
|
async initAndGetManager(e) {
|
|
4168
|
-
const t = await
|
|
4186
|
+
const t = await Wi(e), i = new Si(e);
|
|
4169
4187
|
return t.register("authEvent", (r) => (l(
|
|
4170
4188
|
r == null ? void 0 : r.authEvent,
|
|
4171
4189
|
e,
|
|
@@ -4189,13 +4207,13 @@ class Ji {
|
|
|
4189
4207
|
}
|
|
4190
4208
|
_originValidation(e) {
|
|
4191
4209
|
const t = e._key();
|
|
4192
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4210
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Ci(e)), this.originValidationPromises[t];
|
|
4193
4211
|
}
|
|
4194
4212
|
get _shouldInitProactively() {
|
|
4195
|
-
return
|
|
4213
|
+
return Tt() || mt() || ke();
|
|
4196
4214
|
}
|
|
4197
4215
|
}
|
|
4198
|
-
const
|
|
4216
|
+
const er = Zi;
|
|
4199
4217
|
var Qe = "@firebase/auth", Ze = "1.7.9";
|
|
4200
4218
|
/**
|
|
4201
4219
|
* @license
|
|
@@ -4213,7 +4231,7 @@ var Qe = "@firebase/auth", Ze = "1.7.9";
|
|
|
4213
4231
|
* See the License for the specific language governing permissions and
|
|
4214
4232
|
* limitations under the License.
|
|
4215
4233
|
*/
|
|
4216
|
-
class
|
|
4234
|
+
class tr {
|
|
4217
4235
|
constructor(e) {
|
|
4218
4236
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4219
4237
|
}
|
|
@@ -4264,7 +4282,7 @@ class Yi {
|
|
|
4264
4282
|
* See the License for the specific language governing permissions and
|
|
4265
4283
|
* limitations under the License.
|
|
4266
4284
|
*/
|
|
4267
|
-
function
|
|
4285
|
+
function nr(n) {
|
|
4268
4286
|
switch (n) {
|
|
4269
4287
|
case "Node":
|
|
4270
4288
|
return "node";
|
|
@@ -4280,8 +4298,8 @@ function Qi(n) {
|
|
|
4280
4298
|
return;
|
|
4281
4299
|
}
|
|
4282
4300
|
}
|
|
4283
|
-
function
|
|
4284
|
-
|
|
4301
|
+
function ir(n) {
|
|
4302
|
+
De(new Fe(
|
|
4285
4303
|
"auth",
|
|
4286
4304
|
(e, { options: t }) => {
|
|
4287
4305
|
const i = e.getProvider("app").getImmediate(), r = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: c } = i.options;
|
|
@@ -4293,9 +4311,9 @@ function Zi(n) {
|
|
|
4293
4311
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4294
4312
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4295
4313
|
apiScheme: "https",
|
|
4296
|
-
sdkClientVersion:
|
|
4297
|
-
}, u = new
|
|
4298
|
-
return
|
|
4314
|
+
sdkClientVersion: Et(n)
|
|
4315
|
+
}, u = new Ln(i, r, s, a);
|
|
4316
|
+
return Vn(u, t), u;
|
|
4299
4317
|
},
|
|
4300
4318
|
"PUBLIC"
|
|
4301
4319
|
/* ComponentType.PUBLIC */
|
|
@@ -4307,21 +4325,21 @@ function Zi(n) {
|
|
|
4307
4325
|
"auth-internal"
|
|
4308
4326
|
/* _ComponentName.AUTH_INTERNAL */
|
|
4309
4327
|
).initialize();
|
|
4310
|
-
})),
|
|
4328
|
+
})), De(new Fe(
|
|
4311
4329
|
"auth-internal",
|
|
4312
4330
|
(e) => {
|
|
4313
4331
|
const t = ie(e.getProvider(
|
|
4314
4332
|
"auth"
|
|
4315
4333
|
/* _ComponentName.AUTH */
|
|
4316
4334
|
).getImmediate());
|
|
4317
|
-
return ((i) => new
|
|
4335
|
+
return ((i) => new tr(i))(t);
|
|
4318
4336
|
},
|
|
4319
4337
|
"PRIVATE"
|
|
4320
4338
|
/* ComponentType.PRIVATE */
|
|
4321
4339
|
).setInstantiationMode(
|
|
4322
4340
|
"EXPLICIT"
|
|
4323
4341
|
/* InstantiationMode.EXPLICIT */
|
|
4324
|
-
)),
|
|
4342
|
+
)), pe(Qe, Ze, nr(n)), pe(Qe, Ze, "esm2017");
|
|
4325
4343
|
}
|
|
4326
4344
|
/**
|
|
4327
4345
|
* @license
|
|
@@ -4339,11 +4357,11 @@ function Zi(n) {
|
|
|
4339
4357
|
* See the License for the specific language governing permissions and
|
|
4340
4358
|
* limitations under the License.
|
|
4341
4359
|
*/
|
|
4342
|
-
const
|
|
4360
|
+
const rr = 5 * 60, sr = tt("authIdTokenMaxAge") || rr;
|
|
4343
4361
|
let et = null;
|
|
4344
|
-
const
|
|
4362
|
+
const or = (n) => async (e) => {
|
|
4345
4363
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4346
|
-
if (i && i >
|
|
4364
|
+
if (i && i > sr)
|
|
4347
4365
|
return;
|
|
4348
4366
|
const r = t == null ? void 0 : t.token;
|
|
4349
4367
|
et !== r && (et = r, await fetch(n, {
|
|
@@ -4353,33 +4371,33 @@ const nr = (n) => async (e) => {
|
|
|
4353
4371
|
} : {}
|
|
4354
4372
|
}));
|
|
4355
4373
|
};
|
|
4356
|
-
function
|
|
4374
|
+
function ar(n = it()) {
|
|
4357
4375
|
const e = nt(n, "auth");
|
|
4358
4376
|
if (e.isInitialized())
|
|
4359
4377
|
return e.getImmediate();
|
|
4360
|
-
const t =
|
|
4361
|
-
popupRedirectResolver:
|
|
4378
|
+
const t = xn(n, {
|
|
4379
|
+
popupRedirectResolver: er,
|
|
4362
4380
|
persistence: [
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4381
|
+
di,
|
|
4382
|
+
Zn,
|
|
4383
|
+
Ot
|
|
4366
4384
|
]
|
|
4367
4385
|
}), i = tt("authTokenSyncURL");
|
|
4368
4386
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4369
4387
|
const s = new URL(i, location.origin);
|
|
4370
4388
|
if (location.origin === s.origin) {
|
|
4371
|
-
const o =
|
|
4372
|
-
|
|
4389
|
+
const o = or(s.toString());
|
|
4390
|
+
Xn(t, o, () => o(t.currentUser)), Jn(t, (c) => o(c));
|
|
4373
4391
|
}
|
|
4374
4392
|
}
|
|
4375
|
-
const r =
|
|
4376
|
-
return r &&
|
|
4393
|
+
const r = Kt("auth");
|
|
4394
|
+
return r && jn(t, `http://${r}`), t;
|
|
4377
4395
|
}
|
|
4378
|
-
function
|
|
4396
|
+
function cr() {
|
|
4379
4397
|
var n, e;
|
|
4380
4398
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4381
4399
|
}
|
|
4382
|
-
|
|
4400
|
+
Un({
|
|
4383
4401
|
loadJS(n) {
|
|
4384
4402
|
return new Promise((e, t) => {
|
|
4385
4403
|
const i = document.createElement("script");
|
|
@@ -4389,32 +4407,34 @@ Cn({
|
|
|
4389
4407
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4390
4408
|
);
|
|
4391
4409
|
s.customData = r, t(s);
|
|
4392
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4410
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", cr().appendChild(i);
|
|
4393
4411
|
});
|
|
4394
4412
|
},
|
|
4395
4413
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4396
4414
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4397
4415
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4398
4416
|
});
|
|
4399
|
-
|
|
4417
|
+
ir(
|
|
4400
4418
|
"Browser"
|
|
4401
4419
|
/* ClientPlatform.BROWSER */
|
|
4402
4420
|
);
|
|
4403
|
-
const
|
|
4421
|
+
const lr = { class: "bg-white flex flex-col max-h-dvh" }, ur = {
|
|
4404
4422
|
key: 1,
|
|
4405
4423
|
class: "flex h-screen justify-center items-center"
|
|
4406
|
-
},
|
|
4424
|
+
}, gr = /* @__PURE__ */ jt({
|
|
4407
4425
|
__name: "App",
|
|
4408
4426
|
setup(n) {
|
|
4409
|
-
const e =
|
|
4427
|
+
const e = Wt(!1), { currentBusiness: t, readRestaurants: i, fetchUserPermissions: r, sessionUser: s, signIn: o } = cn(), c = rn();
|
|
4428
|
+
sn().length === 0 ? on({ 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: "458797803788", measurementId: "G-YH5GZ1DF39" }) : it();
|
|
4429
|
+
const a = async () => {
|
|
4410
4430
|
var d;
|
|
4411
4431
|
try {
|
|
4412
|
-
e.value = !1, await Promise.all([r(), i()]), await
|
|
4432
|
+
e.value = !1, await Promise.all([r(), i()]), await $t(), e.value = !!((d = s.value) != null && d.token);
|
|
4413
4433
|
} catch (f) {
|
|
4414
4434
|
console.error("Page setup failed:", f), e.value = !1;
|
|
4415
4435
|
}
|
|
4416
4436
|
}, u = () => {
|
|
4417
|
-
const { init: d } =
|
|
4437
|
+
const { init: d } = an();
|
|
4418
4438
|
d({
|
|
4419
4439
|
apiKey: "MaGoXrEWuEJNpWgKTqseee",
|
|
4420
4440
|
url: {}.VITE_FEATURE_FLAG_URL
|
|
@@ -4423,8 +4443,8 @@ const sr = { class: "bg-white flex flex-col max-h-dvh" }, or = {
|
|
|
4423
4443
|
const d = s.value;
|
|
4424
4444
|
if (d != null && d.token)
|
|
4425
4445
|
try {
|
|
4426
|
-
const f = await d.getCustomToken(), E =
|
|
4427
|
-
await
|
|
4446
|
+
const f = await d.getCustomToken(), E = ar();
|
|
4447
|
+
await Kn(E, f);
|
|
4428
4448
|
} catch (f) {
|
|
4429
4449
|
console.error("Firebase login failed:", f);
|
|
4430
4450
|
}
|
|
@@ -4446,22 +4466,22 @@ const sr = { class: "bg-white flex flex-col max-h-dvh" }, or = {
|
|
|
4446
4466
|
d && f && await a();
|
|
4447
4467
|
},
|
|
4448
4468
|
{ immediate: !0 }
|
|
4449
|
-
), ue(s, h),
|
|
4469
|
+
), ue(s, h), Ht(async () => {
|
|
4450
4470
|
var d;
|
|
4451
4471
|
u(), (d = t.value) != null && d._id && await a(), await h();
|
|
4452
4472
|
}), (d, f) => {
|
|
4453
|
-
const E =
|
|
4454
|
-
return de(),
|
|
4455
|
-
e.value ? (de(),
|
|
4473
|
+
const E = Ue("RouterView"), N = Ue("FmCircularProgress");
|
|
4474
|
+
return de(), Me("div", lr, [
|
|
4475
|
+
e.value ? (de(), qt(E, {
|
|
4456
4476
|
key: 0,
|
|
4457
4477
|
class: "w-full flex-1"
|
|
4458
|
-
})) : (de(),
|
|
4459
|
-
|
|
4478
|
+
})) : (de(), Me("div", ur, [
|
|
4479
|
+
zt(N)
|
|
4460
4480
|
]))
|
|
4461
4481
|
]);
|
|
4462
4482
|
};
|
|
4463
4483
|
}
|
|
4464
4484
|
});
|
|
4465
4485
|
export {
|
|
4466
|
-
|
|
4486
|
+
gr as default
|
|
4467
4487
|
};
|