@laboratoria/sdk-js 6.1.0-beta.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/laboratoria-sdk-es.js +823 -780
- package/dist/laboratoria-sdk-umd.js +91 -91
- package/package.json +3 -3
@@ -30,7 +30,7 @@
|
|
30
30
|
* See the License for the specific language governing permissions and
|
31
31
|
* limitations under the License.
|
32
32
|
*/
|
33
|
-
const
|
33
|
+
const Vt = function(n) {
|
34
34
|
const e = [];
|
35
35
|
let t = 0;
|
36
36
|
for (let r = 0; r < n.length; r++) {
|
@@ -38,7 +38,7 @@ const qt = function(n) {
|
|
38
38
|
i < 128 ? e[t++] = i : i < 2048 ? (e[t++] = i >> 6 | 192, e[t++] = i & 63 | 128) : (i & 64512) === 55296 && r + 1 < n.length && (n.charCodeAt(r + 1) & 64512) === 56320 ? (i = 65536 + ((i & 1023) << 10) + (n.charCodeAt(++r) & 1023), e[t++] = i >> 18 | 240, e[t++] = i >> 12 & 63 | 128, e[t++] = i >> 6 & 63 | 128, e[t++] = i & 63 | 128) : (e[t++] = i >> 12 | 224, e[t++] = i >> 6 & 63 | 128, e[t++] = i & 63 | 128);
|
39
39
|
}
|
40
40
|
return e;
|
41
|
-
},
|
41
|
+
}, Ln = function(n) {
|
42
42
|
const e = [];
|
43
43
|
let t = 0, r = 0;
|
44
44
|
for (; t < n.length; ) {
|
@@ -57,7 +57,7 @@ const qt = function(n) {
|
|
57
57
|
}
|
58
58
|
}
|
59
59
|
return e.join("");
|
60
|
-
},
|
60
|
+
}, Wt = {
|
61
61
|
/**
|
62
62
|
* Maps bytes to characters.
|
63
63
|
*/
|
@@ -116,9 +116,9 @@ const qt = function(n) {
|
|
116
116
|
this.init_();
|
117
117
|
const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
|
118
118
|
for (let i = 0; i < n.length; i += 3) {
|
119
|
-
const s = n[i], o = i + 1 < n.length, c = o ? n[i + 1] : 0, a = i + 2 < n.length, u = a ? n[i + 2] : 0, y = s >> 2,
|
119
|
+
const s = n[i], o = i + 1 < n.length, c = o ? n[i + 1] : 0, a = i + 2 < n.length, u = a ? n[i + 2] : 0, y = s >> 2, v = (s & 3) << 4 | c >> 4;
|
120
120
|
let A = (c & 15) << 2 | u >> 6, P = u & 63;
|
121
|
-
a || (P = 64, o || (A = 64)), r.push(t[y], t[
|
121
|
+
a || (P = 64, o || (A = 64)), r.push(t[y], t[v], t[A], t[P]);
|
122
122
|
}
|
123
123
|
return r.join("");
|
124
124
|
},
|
@@ -131,7 +131,7 @@ const qt = function(n) {
|
|
131
131
|
* @return The base64 encoded string.
|
132
132
|
*/
|
133
133
|
encodeString(n, e) {
|
134
|
-
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray(
|
134
|
+
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray(Vt(n), e);
|
135
135
|
},
|
136
136
|
/**
|
137
137
|
* Base64-decode a string.
|
@@ -142,7 +142,7 @@ const qt = function(n) {
|
|
142
142
|
* @return string representing the decoded value.
|
143
143
|
*/
|
144
144
|
decodeString(n, e) {
|
145
|
-
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) :
|
145
|
+
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) : Ln(this.decodeStringToByteArray(n, e));
|
146
146
|
},
|
147
147
|
/**
|
148
148
|
* Base64-decode a string.
|
@@ -167,14 +167,14 @@ const qt = function(n) {
|
|
167
167
|
++i;
|
168
168
|
const u = i < n.length ? t[n.charAt(i)] : 64;
|
169
169
|
++i;
|
170
|
-
const
|
171
|
-
if (++i, s == null || c == null || u == null ||
|
172
|
-
throw new
|
170
|
+
const v = i < n.length ? t[n.charAt(i)] : 64;
|
171
|
+
if (++i, s == null || c == null || u == null || v == null)
|
172
|
+
throw new $n();
|
173
173
|
const A = s << 2 | c >> 4;
|
174
174
|
if (r.push(A), u !== 64) {
|
175
175
|
const P = c << 4 & 240 | u >> 2;
|
176
|
-
if (r.push(P),
|
177
|
-
const k = u << 6 & 192 |
|
176
|
+
if (r.push(P), v !== 64) {
|
177
|
+
const k = u << 6 & 192 | v;
|
178
178
|
r.push(k);
|
179
179
|
}
|
180
180
|
}
|
@@ -194,19 +194,19 @@ const qt = function(n) {
|
|
194
194
|
}
|
195
195
|
}
|
196
196
|
};
|
197
|
-
class
|
197
|
+
class $n extends Error {
|
198
198
|
constructor() {
|
199
199
|
super(...arguments), this.name = "DecodeBase64StringError";
|
200
200
|
}
|
201
201
|
}
|
202
|
-
const
|
203
|
-
const e =
|
204
|
-
return
|
205
|
-
},
|
206
|
-
return
|
207
|
-
},
|
202
|
+
const Mn = function(n) {
|
203
|
+
const e = Vt(n);
|
204
|
+
return Wt.encodeByteArray(e, !0);
|
205
|
+
}, xt = function(n) {
|
206
|
+
return Mn(n).replace(/\./g, "");
|
207
|
+
}, zt = function(n) {
|
208
208
|
try {
|
209
|
-
return
|
209
|
+
return Wt.decodeString(n, !0);
|
210
210
|
} catch (e) {
|
211
211
|
console.error("base64Decode failed: ", e);
|
212
212
|
}
|
@@ -228,7 +228,7 @@ const jn = function(n) {
|
|
228
228
|
* See the License for the specific language governing permissions and
|
229
229
|
* limitations under the License.
|
230
230
|
*/
|
231
|
-
function
|
231
|
+
function Un() {
|
232
232
|
if (typeof self < "u")
|
233
233
|
return self;
|
234
234
|
if (typeof window < "u")
|
@@ -253,13 +253,13 @@ function Bn() {
|
|
253
253
|
* See the License for the specific language governing permissions and
|
254
254
|
* limitations under the License.
|
255
255
|
*/
|
256
|
-
const
|
256
|
+
const jn = () => Un().__FIREBASE_DEFAULTS__, Fn = () => {
|
257
257
|
if (typeof process > "u" || typeof process.env > "u")
|
258
258
|
return;
|
259
259
|
const n = process.env.__FIREBASE_DEFAULTS__;
|
260
260
|
if (n)
|
261
261
|
return JSON.parse(n);
|
262
|
-
},
|
262
|
+
}, Bn = () => {
|
263
263
|
if (typeof document > "u")
|
264
264
|
return;
|
265
265
|
let n;
|
@@ -268,24 +268,24 @@ const Fn = () => Bn().__FIREBASE_DEFAULTS__, Hn = () => {
|
|
268
268
|
} catch {
|
269
269
|
return;
|
270
270
|
}
|
271
|
-
const e = n &&
|
271
|
+
const e = n && zt(n[1]);
|
272
272
|
return e && JSON.parse(e);
|
273
|
-
},
|
273
|
+
}, tt = () => {
|
274
274
|
try {
|
275
|
-
return
|
275
|
+
return jn() || Fn() || Bn();
|
276
276
|
} catch (n) {
|
277
277
|
console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);
|
278
278
|
return;
|
279
279
|
}
|
280
|
-
},
|
280
|
+
}, Hn = (n) => {
|
281
281
|
var e, t;
|
282
|
-
return (t = (e =
|
283
|
-
},
|
282
|
+
return (t = (e = tt()) === null || e === void 0 ? void 0 : e.emulatorHosts) === null || t === void 0 ? void 0 : t[n];
|
283
|
+
}, qt = () => {
|
284
284
|
var n;
|
285
|
-
return (n =
|
286
|
-
},
|
285
|
+
return (n = tt()) === null || n === void 0 ? void 0 : n.config;
|
286
|
+
}, Jt = (n) => {
|
287
287
|
var e;
|
288
|
-
return (e =
|
288
|
+
return (e = tt()) === null || e === void 0 ? void 0 : e[`_${n}`];
|
289
289
|
};
|
290
290
|
/**
|
291
291
|
* @license
|
@@ -303,7 +303,7 @@ const Fn = () => Bn().__FIREBASE_DEFAULTS__, Hn = () => {
|
|
303
303
|
* See the License for the specific language governing permissions and
|
304
304
|
* limitations under the License.
|
305
305
|
*/
|
306
|
-
class
|
306
|
+
class Vn {
|
307
307
|
constructor() {
|
308
308
|
this.reject = () => {
|
309
309
|
}, this.resolve = () => {
|
@@ -342,30 +342,30 @@ class xn {
|
|
342
342
|
function R() {
|
343
343
|
return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
|
344
344
|
}
|
345
|
-
function
|
345
|
+
function Wn() {
|
346
346
|
return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
|
347
347
|
// just to deal with this case would probably be a bad idea.
|
348
348
|
!!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(R());
|
349
349
|
}
|
350
|
-
function
|
350
|
+
function xn() {
|
351
351
|
const n = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
|
352
352
|
return typeof n == "object" && n.id !== void 0;
|
353
353
|
}
|
354
|
-
function
|
354
|
+
function zn() {
|
355
355
|
return typeof navigator == "object" && navigator.product === "ReactNative";
|
356
356
|
}
|
357
|
-
function
|
357
|
+
function qn() {
|
358
358
|
const n = R();
|
359
359
|
return n.indexOf("MSIE ") >= 0 || n.indexOf("Trident/") >= 0;
|
360
360
|
}
|
361
|
-
function
|
361
|
+
function Jn() {
|
362
362
|
try {
|
363
363
|
return typeof indexedDB == "object";
|
364
364
|
} catch {
|
365
365
|
return !1;
|
366
366
|
}
|
367
367
|
}
|
368
|
-
function
|
368
|
+
function Gn() {
|
369
369
|
return new Promise((n, e) => {
|
370
370
|
try {
|
371
371
|
let t = !0;
|
@@ -399,10 +399,10 @@ function Yn() {
|
|
399
399
|
* See the License for the specific language governing permissions and
|
400
400
|
* limitations under the License.
|
401
401
|
*/
|
402
|
-
const
|
402
|
+
const Kn = "FirebaseError";
|
403
403
|
class G extends Error {
|
404
404
|
constructor(e, t, r) {
|
405
|
-
super(t), this.code = e, this.customData = r, this.name =
|
405
|
+
super(t), this.code = e, this.customData = r, this.name = Kn, Object.setPrototypeOf(this, G.prototype), Error.captureStackTrace && Error.captureStackTrace(this, _e.prototype.create);
|
406
406
|
}
|
407
407
|
}
|
408
408
|
class _e {
|
@@ -410,18 +410,18 @@ class _e {
|
|
410
410
|
this.service = e, this.serviceName = t, this.errors = r;
|
411
411
|
}
|
412
412
|
create(e, ...t) {
|
413
|
-
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], o = s ?
|
413
|
+
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], o = s ? Yn(s, r) : "Error", c = `${this.serviceName}: ${o} (${i}).`;
|
414
414
|
return new G(i, c, r);
|
415
415
|
}
|
416
416
|
}
|
417
|
-
function
|
418
|
-
return n.replace(
|
417
|
+
function Yn(n, e) {
|
418
|
+
return n.replace(Qn, (t, r) => {
|
419
419
|
const i = e[r];
|
420
420
|
return i != null ? String(i) : `<${r}?>`;
|
421
421
|
});
|
422
422
|
}
|
423
|
-
const
|
424
|
-
function
|
423
|
+
const Qn = /\{\$([^}]+)}/g;
|
424
|
+
function Xn(n) {
|
425
425
|
for (const e in n)
|
426
426
|
if (Object.prototype.hasOwnProperty.call(n, e))
|
427
427
|
return !1;
|
@@ -435,7 +435,7 @@ function Pe(n, e) {
|
|
435
435
|
if (!r.includes(i))
|
436
436
|
return !1;
|
437
437
|
const s = n[i], o = e[i];
|
438
|
-
if (
|
438
|
+
if (ft(s) && ft(o)) {
|
439
439
|
if (!Pe(s, o))
|
440
440
|
return !1;
|
441
441
|
} else if (s !== o)
|
@@ -446,7 +446,7 @@ function Pe(n, e) {
|
|
446
446
|
return !1;
|
447
447
|
return !0;
|
448
448
|
}
|
449
|
-
function
|
449
|
+
function ft(n) {
|
450
450
|
return n !== null && typeof n == "object";
|
451
451
|
}
|
452
452
|
/**
|
@@ -465,7 +465,7 @@ function yt(n) {
|
|
465
465
|
* See the License for the specific language governing permissions and
|
466
466
|
* limitations under the License.
|
467
467
|
*/
|
468
|
-
function
|
468
|
+
function be(n) {
|
469
469
|
const e = [];
|
470
470
|
for (const [t, r] of Object.entries(n))
|
471
471
|
Array.isArray(r) ? r.forEach((i) => {
|
@@ -489,11 +489,11 @@ function ue(n) {
|
|
489
489
|
const t = n.indexOf("#", e);
|
490
490
|
return n.substring(e, t > 0 ? t : void 0);
|
491
491
|
}
|
492
|
-
function
|
493
|
-
const t = new
|
492
|
+
function Zn(n, e) {
|
493
|
+
const t = new er(n, e);
|
494
494
|
return t.subscribe.bind(t);
|
495
495
|
}
|
496
|
-
class
|
496
|
+
class er {
|
497
497
|
/**
|
498
498
|
* @param executor Function which can make calls to a single Observer
|
499
499
|
* as a proxy.
|
@@ -531,7 +531,7 @@ class nr {
|
|
531
531
|
let i;
|
532
532
|
if (e === void 0 && t === void 0 && r === void 0)
|
533
533
|
throw new Error("Missing Observer.");
|
534
|
-
|
534
|
+
tr(e, [
|
535
535
|
"next",
|
536
536
|
"error",
|
537
537
|
"complete"
|
@@ -539,7 +539,7 @@ class nr {
|
|
539
539
|
next: e,
|
540
540
|
error: t,
|
541
541
|
complete: r
|
542
|
-
}, i.next === void 0 && (i.next =
|
542
|
+
}, i.next === void 0 && (i.next = He), i.error === void 0 && (i.error = He), i.complete === void 0 && (i.complete = He);
|
543
543
|
const s = this.unsubscribeOne.bind(this, this.observers.length);
|
544
544
|
return this.finalized && this.task.then(() => {
|
545
545
|
try {
|
@@ -577,7 +577,7 @@ class nr {
|
|
577
577
|
}));
|
578
578
|
}
|
579
579
|
}
|
580
|
-
function
|
580
|
+
function tr(n, e) {
|
581
581
|
if (typeof n != "object" || n === null)
|
582
582
|
return !1;
|
583
583
|
for (const t of e)
|
@@ -585,7 +585,7 @@ function rr(n, e) {
|
|
585
585
|
return !0;
|
586
586
|
return !1;
|
587
587
|
}
|
588
|
-
function
|
588
|
+
function He() {
|
589
589
|
}
|
590
590
|
/**
|
591
591
|
* @license
|
@@ -603,7 +603,7 @@ function Ve() {
|
|
603
603
|
* See the License for the specific language governing permissions and
|
604
604
|
* limitations under the License.
|
605
605
|
*/
|
606
|
-
function
|
606
|
+
function F(n) {
|
607
607
|
return n && n._delegate ? n._delegate : n;
|
608
608
|
}
|
609
609
|
class ae {
|
@@ -662,7 +662,7 @@ const Q = "[DEFAULT]";
|
|
662
662
|
* See the License for the specific language governing permissions and
|
663
663
|
* limitations under the License.
|
664
664
|
*/
|
665
|
-
class
|
665
|
+
class nr {
|
666
666
|
constructor(e, t) {
|
667
667
|
this.name = e, this.container = t, this.component = null, this.instances = /* @__PURE__ */ new Map(), this.instancesDeferred = /* @__PURE__ */ new Map(), this.instancesOptions = /* @__PURE__ */ new Map(), this.onInitCallbacks = /* @__PURE__ */ new Map();
|
668
668
|
}
|
@@ -673,7 +673,7 @@ class ir {
|
|
673
673
|
get(e) {
|
674
674
|
const t = this.normalizeInstanceIdentifier(e);
|
675
675
|
if (!this.instancesDeferred.has(t)) {
|
676
|
-
const r = new
|
676
|
+
const r = new Vn();
|
677
677
|
if (this.instancesDeferred.set(t, r), this.isInitialized(t) || this.shouldAutoInitialize())
|
678
678
|
try {
|
679
679
|
const i = this.getOrInitializeService({
|
@@ -713,7 +713,7 @@ class ir {
|
|
713
713
|
if (this.component)
|
714
714
|
throw Error(`Component for ${this.name} has already been provided`);
|
715
715
|
if (this.component = e, !!this.shouldAutoInitialize()) {
|
716
|
-
if (
|
716
|
+
if (ir(e))
|
717
717
|
try {
|
718
718
|
this.getOrInitializeService({ instanceIdentifier: Q });
|
719
719
|
} catch {
|
@@ -800,7 +800,7 @@ class ir {
|
|
800
800
|
getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
|
801
801
|
let r = this.instances.get(e);
|
802
802
|
if (!r && this.component && (r = this.component.instanceFactory(this.container, {
|
803
|
-
instanceIdentifier:
|
803
|
+
instanceIdentifier: rr(e),
|
804
804
|
options: t
|
805
805
|
}), this.instances.set(e, r), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(r, e), this.component.onInstanceCreated))
|
806
806
|
try {
|
@@ -816,10 +816,10 @@ class ir {
|
|
816
816
|
return !!this.component && this.component.instantiationMode !== "EXPLICIT";
|
817
817
|
}
|
818
818
|
}
|
819
|
-
function
|
819
|
+
function rr(n) {
|
820
820
|
return n === Q ? void 0 : n;
|
821
821
|
}
|
822
|
-
function
|
822
|
+
function ir(n) {
|
823
823
|
return n.instantiationMode === "EAGER";
|
824
824
|
}
|
825
825
|
/**
|
@@ -838,7 +838,7 @@ function or(n) {
|
|
838
838
|
* See the License for the specific language governing permissions and
|
839
839
|
* limitations under the License.
|
840
840
|
*/
|
841
|
-
class
|
841
|
+
class sr {
|
842
842
|
constructor(e) {
|
843
843
|
this.name = e, this.providers = /* @__PURE__ */ new Map();
|
844
844
|
}
|
@@ -870,7 +870,7 @@ class ar {
|
|
870
870
|
getProvider(e) {
|
871
871
|
if (this.providers.has(e))
|
872
872
|
return this.providers.get(e);
|
873
|
-
const t = new
|
873
|
+
const t = new nr(e, this);
|
874
874
|
return this.providers.set(e, t), t;
|
875
875
|
}
|
876
876
|
getProviders() {
|
@@ -897,29 +897,29 @@ var T;
|
|
897
897
|
(function(n) {
|
898
898
|
n[n.DEBUG = 0] = "DEBUG", n[n.VERBOSE = 1] = "VERBOSE", n[n.INFO = 2] = "INFO", n[n.WARN = 3] = "WARN", n[n.ERROR = 4] = "ERROR", n[n.SILENT = 5] = "SILENT";
|
899
899
|
})(T || (T = {}));
|
900
|
-
const
|
900
|
+
const or = {
|
901
901
|
debug: T.DEBUG,
|
902
902
|
verbose: T.VERBOSE,
|
903
903
|
info: T.INFO,
|
904
904
|
warn: T.WARN,
|
905
905
|
error: T.ERROR,
|
906
906
|
silent: T.SILENT
|
907
|
-
},
|
907
|
+
}, ar = T.INFO, cr = {
|
908
908
|
[T.DEBUG]: "log",
|
909
909
|
[T.VERBOSE]: "log",
|
910
910
|
[T.INFO]: "info",
|
911
911
|
[T.WARN]: "warn",
|
912
912
|
[T.ERROR]: "error"
|
913
|
-
},
|
913
|
+
}, lr = (n, e, ...t) => {
|
914
914
|
if (e < n.logLevel)
|
915
915
|
return;
|
916
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), i =
|
916
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), i = cr[e];
|
917
917
|
if (i)
|
918
918
|
console[i](`[${r}] ${n.name}:`, ...t);
|
919
919
|
else
|
920
920
|
throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);
|
921
921
|
};
|
922
|
-
class
|
922
|
+
class Gt {
|
923
923
|
/**
|
924
924
|
* Gives you an instance of a Logger to capture messages according to
|
925
925
|
* Firebase's logging scheme.
|
@@ -927,7 +927,7 @@ class Qt {
|
|
927
927
|
* @param name The name that the logs will be associated with
|
928
928
|
*/
|
929
929
|
constructor(e) {
|
930
|
-
this.name = e, this._logLevel =
|
930
|
+
this.name = e, this._logLevel = ar, this._logHandler = lr, this._userLogHandler = null;
|
931
931
|
}
|
932
932
|
get logLevel() {
|
933
933
|
return this._logLevel;
|
@@ -939,7 +939,7 @@ class Qt {
|
|
939
939
|
}
|
940
940
|
// Workaround for setter/getter having to be the same type.
|
941
941
|
setLogLevel(e) {
|
942
|
-
this._logLevel = typeof e == "string" ?
|
942
|
+
this._logLevel = typeof e == "string" ? or[e] : e;
|
943
943
|
}
|
944
944
|
get logHandler() {
|
945
945
|
return this._logHandler;
|
@@ -974,10 +974,10 @@ class Qt {
|
|
974
974
|
this._userLogHandler && this._userLogHandler(this, T.ERROR, ...e), this._logHandler(this, T.ERROR, ...e);
|
975
975
|
}
|
976
976
|
}
|
977
|
-
const
|
978
|
-
let
|
979
|
-
function
|
980
|
-
return
|
977
|
+
const dr = (n, e) => e.some((t) => n instanceof t);
|
978
|
+
let pt, gt;
|
979
|
+
function ur() {
|
980
|
+
return pt || (pt = [
|
981
981
|
IDBDatabase,
|
982
982
|
IDBObjectStore,
|
983
983
|
IDBIndex,
|
@@ -985,32 +985,32 @@ function fr() {
|
|
985
985
|
IDBTransaction
|
986
986
|
]);
|
987
987
|
}
|
988
|
-
function
|
989
|
-
return
|
988
|
+
function hr() {
|
989
|
+
return gt || (gt = [
|
990
990
|
IDBCursor.prototype.advance,
|
991
991
|
IDBCursor.prototype.continue,
|
992
992
|
IDBCursor.prototype.continuePrimaryKey
|
993
993
|
]);
|
994
994
|
}
|
995
|
-
const
|
996
|
-
function
|
995
|
+
const Kt = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap();
|
996
|
+
function fr(n) {
|
997
997
|
const e = new Promise((t, r) => {
|
998
998
|
const i = () => {
|
999
999
|
n.removeEventListener("success", s), n.removeEventListener("error", o);
|
1000
1000
|
}, s = () => {
|
1001
|
-
t(
|
1001
|
+
t(q(n.result)), i();
|
1002
1002
|
}, o = () => {
|
1003
1003
|
r(n.error), i();
|
1004
1004
|
};
|
1005
1005
|
n.addEventListener("success", s), n.addEventListener("error", o);
|
1006
1006
|
});
|
1007
1007
|
return e.then((t) => {
|
1008
|
-
t instanceof IDBCursor &&
|
1008
|
+
t instanceof IDBCursor && Kt.set(t, n);
|
1009
1009
|
}).catch(() => {
|
1010
|
-
}),
|
1010
|
+
}), nt.set(e, n), e;
|
1011
1011
|
}
|
1012
|
-
function
|
1013
|
-
if (
|
1012
|
+
function pr(n) {
|
1013
|
+
if (Ge.has(n))
|
1014
1014
|
return;
|
1015
1015
|
const e = new Promise((t, r) => {
|
1016
1016
|
const i = () => {
|
@@ -1022,19 +1022,19 @@ function mr(n) {
|
|
1022
1022
|
};
|
1023
1023
|
n.addEventListener("complete", s), n.addEventListener("error", o), n.addEventListener("abort", o);
|
1024
1024
|
});
|
1025
|
-
|
1025
|
+
Ge.set(n, e);
|
1026
1026
|
}
|
1027
|
-
let
|
1027
|
+
let Ke = {
|
1028
1028
|
get(n, e, t) {
|
1029
1029
|
if (n instanceof IDBTransaction) {
|
1030
1030
|
if (e === "done")
|
1031
|
-
return
|
1031
|
+
return Ge.get(n);
|
1032
1032
|
if (e === "objectStoreNames")
|
1033
|
-
return n.objectStoreNames ||
|
1033
|
+
return n.objectStoreNames || Yt.get(n);
|
1034
1034
|
if (e === "store")
|
1035
1035
|
return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
|
1036
1036
|
}
|
1037
|
-
return
|
1037
|
+
return q(n[e]);
|
1038
1038
|
},
|
1039
1039
|
set(n, e, t) {
|
1040
1040
|
return n[e] = t, !0;
|
@@ -1043,35 +1043,35 @@ let Ze = {
|
|
1043
1043
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
1044
1044
|
}
|
1045
1045
|
};
|
1046
|
-
function
|
1047
|
-
|
1046
|
+
function gr(n) {
|
1047
|
+
Ke = n(Ke);
|
1048
1048
|
}
|
1049
|
-
function
|
1049
|
+
function mr(n) {
|
1050
1050
|
return n === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
|
1051
|
-
const r = n.call(
|
1052
|
-
return
|
1053
|
-
} :
|
1054
|
-
return n.apply(
|
1051
|
+
const r = n.call(We(this), e, ...t);
|
1052
|
+
return Yt.set(r, e.sort ? e.sort() : [e]), q(r);
|
1053
|
+
} : hr().includes(n) ? function(...e) {
|
1054
|
+
return n.apply(We(this), e), q(Kt.get(this));
|
1055
1055
|
} : function(...e) {
|
1056
|
-
return
|
1056
|
+
return q(n.apply(We(this), e));
|
1057
1057
|
};
|
1058
1058
|
}
|
1059
|
-
function
|
1060
|
-
return typeof n == "function" ?
|
1059
|
+
function yr(n) {
|
1060
|
+
return typeof n == "function" ? mr(n) : (n instanceof IDBTransaction && pr(n), dr(n, ur()) ? new Proxy(n, Ke) : n);
|
1061
1061
|
}
|
1062
|
-
function
|
1062
|
+
function q(n) {
|
1063
1063
|
if (n instanceof IDBRequest)
|
1064
|
-
return
|
1065
|
-
if (
|
1066
|
-
return
|
1067
|
-
const e =
|
1068
|
-
return e !== n && (
|
1069
|
-
}
|
1070
|
-
const
|
1071
|
-
function
|
1072
|
-
const o = indexedDB.open(n, e), c =
|
1064
|
+
return fr(n);
|
1065
|
+
if (Ve.has(n))
|
1066
|
+
return Ve.get(n);
|
1067
|
+
const e = yr(n);
|
1068
|
+
return e !== n && (Ve.set(n, e), nt.set(e, n)), e;
|
1069
|
+
}
|
1070
|
+
const We = (n) => nt.get(n);
|
1071
|
+
function _r(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
1072
|
+
const o = indexedDB.open(n, e), c = q(o);
|
1073
1073
|
return r && o.addEventListener("upgradeneeded", (a) => {
|
1074
|
-
r(
|
1074
|
+
r(q(o.result), a.oldVersion, a.newVersion, q(o.transaction), a);
|
1075
1075
|
}), t && o.addEventListener("blocked", (a) => t(
|
1076
1076
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
1077
1077
|
a.oldVersion,
|
@@ -1082,16 +1082,16 @@ function br(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
|
1082
1082
|
}).catch(() => {
|
1083
1083
|
}), c;
|
1084
1084
|
}
|
1085
|
-
const
|
1086
|
-
function
|
1085
|
+
const br = ["get", "getKey", "getAll", "getAllKeys", "count"], vr = ["put", "add", "delete", "clear"], xe = /* @__PURE__ */ new Map();
|
1086
|
+
function mt(n, e) {
|
1087
1087
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
1088
1088
|
return;
|
1089
|
-
if (
|
1090
|
-
return
|
1091
|
-
const t = e.replace(/FromIndex$/, ""), r = e !== t, i =
|
1089
|
+
if (xe.get(e))
|
1090
|
+
return xe.get(e);
|
1091
|
+
const t = e.replace(/FromIndex$/, ""), r = e !== t, i = vr.includes(t);
|
1092
1092
|
if (
|
1093
1093
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
1094
|
-
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i ||
|
1094
|
+
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i || br.includes(t))
|
1095
1095
|
)
|
1096
1096
|
return;
|
1097
1097
|
const s = async function(o, ...c) {
|
@@ -1102,12 +1102,12 @@ function bt(n, e) {
|
|
1102
1102
|
i && a.done
|
1103
1103
|
]))[0];
|
1104
1104
|
};
|
1105
|
-
return
|
1105
|
+
return xe.set(e, s), s;
|
1106
1106
|
}
|
1107
|
-
|
1107
|
+
gr((n) => ({
|
1108
1108
|
...n,
|
1109
|
-
get: (e, t, r) =>
|
1110
|
-
has: (e, t) => !!
|
1109
|
+
get: (e, t, r) => mt(e, t) || n.get(e, t, r),
|
1110
|
+
has: (e, t) => !!mt(e, t) || n.has(e, t)
|
1111
1111
|
}));
|
1112
1112
|
/**
|
1113
1113
|
* @license
|
@@ -1125,7 +1125,7 @@ yr((n) => ({
|
|
1125
1125
|
* See the License for the specific language governing permissions and
|
1126
1126
|
* limitations under the License.
|
1127
1127
|
*/
|
1128
|
-
class
|
1128
|
+
class Ir {
|
1129
1129
|
constructor(e) {
|
1130
1130
|
this.container = e;
|
1131
1131
|
}
|
@@ -1133,7 +1133,7 @@ class Er {
|
|
1133
1133
|
// auth token refresh, and installations will send this string.
|
1134
1134
|
getPlatformInfoString() {
|
1135
1135
|
return this.container.getProviders().map((t) => {
|
1136
|
-
if (
|
1136
|
+
if (wr(t)) {
|
1137
1137
|
const r = t.getImmediate();
|
1138
1138
|
return `${r.library}/${r.version}`;
|
1139
1139
|
} else
|
@@ -1141,11 +1141,11 @@ class Er {
|
|
1141
1141
|
}).filter((t) => t).join(" ");
|
1142
1142
|
}
|
1143
1143
|
}
|
1144
|
-
function
|
1144
|
+
function wr(n) {
|
1145
1145
|
const e = n.getComponent();
|
1146
1146
|
return (e == null ? void 0 : e.type) === "VERSION";
|
1147
1147
|
}
|
1148
|
-
const
|
1148
|
+
const Ye = "@firebase/app", yt = "0.9.22";
|
1149
1149
|
/**
|
1150
1150
|
* @license
|
1151
1151
|
* Copyright 2019 Google LLC
|
@@ -1162,7 +1162,7 @@ const et = "@firebase/app", It = "0.9.20";
|
|
1162
1162
|
* See the License for the specific language governing permissions and
|
1163
1163
|
* limitations under the License.
|
1164
1164
|
*/
|
1165
|
-
const Z = new
|
1165
|
+
const Z = new Gt("@firebase/app"), Er = "@firebase/app-compat", Tr = "@firebase/analytics-compat", Ar = "@firebase/analytics", Sr = "@firebase/app-check-compat", Cr = "@firebase/app-check", Rr = "@firebase/auth", Pr = "@firebase/auth-compat", Or = "@firebase/database", kr = "@firebase/database-compat", Nr = "@firebase/functions", Dr = "@firebase/functions-compat", Lr = "@firebase/installations", $r = "@firebase/installations-compat", Mr = "@firebase/messaging", Ur = "@firebase/messaging-compat", jr = "@firebase/performance", Fr = "@firebase/performance-compat", Br = "@firebase/remote-config", Hr = "@firebase/remote-config-compat", Vr = "@firebase/storage", Wr = "@firebase/storage-compat", xr = "@firebase/firestore", zr = "@firebase/firestore-compat", qr = "firebase", Jr = "10.5.2";
|
1166
1166
|
/**
|
1167
1167
|
* @license
|
1168
1168
|
* Copyright 2019 Google LLC
|
@@ -1179,33 +1179,33 @@ const Z = new Qt("@firebase/app"), Ar = "@firebase/app-compat", Sr = "@firebase/
|
|
1179
1179
|
* See the License for the specific language governing permissions and
|
1180
1180
|
* limitations under the License.
|
1181
1181
|
*/
|
1182
|
-
const
|
1183
|
-
[
|
1184
|
-
[
|
1185
|
-
[
|
1186
|
-
[
|
1187
|
-
[
|
1188
|
-
[
|
1189
|
-
[
|
1190
|
-
[
|
1191
|
-
[
|
1192
|
-
[
|
1193
|
-
[
|
1194
|
-
[
|
1195
|
-
[
|
1196
|
-
[
|
1197
|
-
[
|
1198
|
-
[
|
1199
|
-
[
|
1200
|
-
[
|
1201
|
-
[
|
1202
|
-
[
|
1203
|
-
[
|
1204
|
-
[
|
1205
|
-
[
|
1206
|
-
[
|
1182
|
+
const Qe = "[DEFAULT]", Gr = {
|
1183
|
+
[Ye]: "fire-core",
|
1184
|
+
[Er]: "fire-core-compat",
|
1185
|
+
[Ar]: "fire-analytics",
|
1186
|
+
[Tr]: "fire-analytics-compat",
|
1187
|
+
[Cr]: "fire-app-check",
|
1188
|
+
[Sr]: "fire-app-check-compat",
|
1189
|
+
[Rr]: "fire-auth",
|
1190
|
+
[Pr]: "fire-auth-compat",
|
1191
|
+
[Or]: "fire-rtdb",
|
1192
|
+
[kr]: "fire-rtdb-compat",
|
1193
|
+
[Nr]: "fire-fn",
|
1194
|
+
[Dr]: "fire-fn-compat",
|
1195
|
+
[Lr]: "fire-iid",
|
1196
|
+
[$r]: "fire-iid-compat",
|
1197
|
+
[Mr]: "fire-fcm",
|
1198
|
+
[Ur]: "fire-fcm-compat",
|
1199
|
+
[jr]: "fire-perf",
|
1200
|
+
[Fr]: "fire-perf-compat",
|
1201
|
+
[Br]: "fire-rc",
|
1202
|
+
[Hr]: "fire-rc-compat",
|
1203
|
+
[Vr]: "fire-gcs",
|
1204
|
+
[Wr]: "fire-gcs-compat",
|
1205
|
+
[xr]: "fire-fst",
|
1206
|
+
[zr]: "fire-fst-compat",
|
1207
1207
|
"fire-js": "fire-js",
|
1208
|
-
[
|
1208
|
+
[qr]: "fire-js-all"
|
1209
1209
|
};
|
1210
1210
|
/**
|
1211
1211
|
* @license
|
@@ -1223,8 +1223,8 @@ const tt = "[DEFAULT]", Yr = {
|
|
1223
1223
|
* See the License for the specific language governing permissions and
|
1224
1224
|
* limitations under the License.
|
1225
1225
|
*/
|
1226
|
-
const Oe = /* @__PURE__ */ new Map(),
|
1227
|
-
function
|
1226
|
+
const Oe = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map();
|
1227
|
+
function Kr(n, e) {
|
1228
1228
|
try {
|
1229
1229
|
n.container.addComponent(e);
|
1230
1230
|
} catch (t) {
|
@@ -1233,14 +1233,14 @@ function Qr(n, e) {
|
|
1233
1233
|
}
|
1234
1234
|
function fe(n) {
|
1235
1235
|
const e = n.name;
|
1236
|
-
if (
|
1236
|
+
if (Xe.has(e))
|
1237
1237
|
return Z.debug(`There were multiple attempts to register component ${e}.`), !1;
|
1238
|
-
|
1238
|
+
Xe.set(e, n);
|
1239
1239
|
for (const t of Oe.values())
|
1240
|
-
|
1240
|
+
Kr(t, n);
|
1241
1241
|
return !0;
|
1242
1242
|
}
|
1243
|
-
function
|
1243
|
+
function Qt(n, e) {
|
1244
1244
|
const t = n.container.getProvider("heartbeat").getImmediate({ optional: !0 });
|
1245
1245
|
return t && t.triggerHeartbeat(), n.container.getProvider(e);
|
1246
1246
|
}
|
@@ -1260,7 +1260,7 @@ function en(n, e) {
|
|
1260
1260
|
* See the License for the specific language governing permissions and
|
1261
1261
|
* limitations under the License.
|
1262
1262
|
*/
|
1263
|
-
const
|
1263
|
+
const Yr = {
|
1264
1264
|
"no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
|
1265
1265
|
"bad-app-name": "Illegal App name: '{$appName}",
|
1266
1266
|
"duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
|
@@ -1272,7 +1272,7 @@ const Xr = {
|
|
1272
1272
|
"idb-get": "Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",
|
1273
1273
|
"idb-set": "Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",
|
1274
1274
|
"idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."
|
1275
|
-
}, J = new _e("app", "Firebase",
|
1275
|
+
}, J = new _e("app", "Firebase", Yr);
|
1276
1276
|
/**
|
1277
1277
|
* @license
|
1278
1278
|
* Copyright 2019 Google LLC
|
@@ -1289,7 +1289,7 @@ const Xr = {
|
|
1289
1289
|
* See the License for the specific language governing permissions and
|
1290
1290
|
* limitations under the License.
|
1291
1291
|
*/
|
1292
|
-
class
|
1292
|
+
class Qr {
|
1293
1293
|
constructor(e, t, r) {
|
1294
1294
|
this._isDeleted = !1, this._options = Object.assign({}, e), this._config = Object.assign({}, t), this._name = t.name, this._automaticDataCollectionEnabled = t.automaticDataCollectionEnabled, this._container = r, this.container.addComponent(new ae(
|
1295
1295
|
"app",
|
@@ -1347,16 +1347,16 @@ class Zr {
|
|
1347
1347
|
* See the License for the specific language governing permissions and
|
1348
1348
|
* limitations under the License.
|
1349
1349
|
*/
|
1350
|
-
const
|
1351
|
-
function
|
1350
|
+
const ve = Jr;
|
1351
|
+
function Xt(n, e = {}) {
|
1352
1352
|
let t = n;
|
1353
1353
|
typeof e != "object" && (e = { name: e });
|
1354
|
-
const r = Object.assign({ name:
|
1354
|
+
const r = Object.assign({ name: Qe, automaticDataCollectionEnabled: !1 }, e), i = r.name;
|
1355
1355
|
if (typeof i != "string" || !i)
|
1356
1356
|
throw J.create("bad-app-name", {
|
1357
1357
|
appName: String(i)
|
1358
1358
|
});
|
1359
|
-
if (t || (t =
|
1359
|
+
if (t || (t = qt()), !t)
|
1360
1360
|
throw J.create(
|
1361
1361
|
"no-options"
|
1362
1362
|
/* AppError.NO_OPTIONS */
|
@@ -1367,23 +1367,23 @@ function tn(n, e = {}) {
|
|
1367
1367
|
return s;
|
1368
1368
|
throw J.create("duplicate-app", { appName: i });
|
1369
1369
|
}
|
1370
|
-
const o = new
|
1371
|
-
for (const a of
|
1370
|
+
const o = new sr(i);
|
1371
|
+
for (const a of Xe.values())
|
1372
1372
|
o.addComponent(a);
|
1373
|
-
const c = new
|
1373
|
+
const c = new Qr(t, r, o);
|
1374
1374
|
return Oe.set(i, c), c;
|
1375
1375
|
}
|
1376
|
-
function
|
1376
|
+
function Xr(n = Qe) {
|
1377
1377
|
const e = Oe.get(n);
|
1378
|
-
if (!e && n ===
|
1379
|
-
return
|
1378
|
+
if (!e && n === Qe && qt())
|
1379
|
+
return Xt();
|
1380
1380
|
if (!e)
|
1381
1381
|
throw J.create("no-app", { appName: n });
|
1382
1382
|
return e;
|
1383
1383
|
}
|
1384
1384
|
function ie(n, e, t) {
|
1385
1385
|
var r;
|
1386
|
-
let i = (r =
|
1386
|
+
let i = (r = Gr[n]) !== null && r !== void 0 ? r : n;
|
1387
1387
|
t && (i += `-${t}`);
|
1388
1388
|
const s = i.match(/\s|\//), o = e.match(/\s|\//);
|
1389
1389
|
if (s || o) {
|
@@ -1416,10 +1416,10 @@ function ie(n, e, t) {
|
|
1416
1416
|
* See the License for the specific language governing permissions and
|
1417
1417
|
* limitations under the License.
|
1418
1418
|
*/
|
1419
|
-
const
|
1419
|
+
const Zr = "firebase-heartbeat-database", ei = 1, pe = "firebase-heartbeat-store";
|
1420
1420
|
let ze = null;
|
1421
|
-
function
|
1422
|
-
return ze || (ze =
|
1421
|
+
function Zt() {
|
1422
|
+
return ze || (ze = _r(Zr, ei, {
|
1423
1423
|
upgrade: (n, e) => {
|
1424
1424
|
switch (e) {
|
1425
1425
|
case 0:
|
@@ -1432,9 +1432,9 @@ function nn() {
|
|
1432
1432
|
});
|
1433
1433
|
})), ze;
|
1434
1434
|
}
|
1435
|
-
async function
|
1435
|
+
async function ti(n) {
|
1436
1436
|
try {
|
1437
|
-
return await (await
|
1437
|
+
return await (await Zt()).transaction(pe).objectStore(pe).get(en(n));
|
1438
1438
|
} catch (e) {
|
1439
1439
|
if (e instanceof G)
|
1440
1440
|
Z.warn(e.message);
|
@@ -1446,10 +1446,10 @@ async function ri(n) {
|
|
1446
1446
|
}
|
1447
1447
|
}
|
1448
1448
|
}
|
1449
|
-
async function
|
1449
|
+
async function _t(n, e) {
|
1450
1450
|
try {
|
1451
|
-
const r = (await
|
1452
|
-
await r.objectStore(pe).put(e,
|
1451
|
+
const r = (await Zt()).transaction(pe, "readwrite");
|
1452
|
+
await r.objectStore(pe).put(e, en(n)), await r.done;
|
1453
1453
|
} catch (t) {
|
1454
1454
|
if (t instanceof G)
|
1455
1455
|
Z.warn(t.message);
|
@@ -1461,7 +1461,7 @@ async function wt(n, e) {
|
|
1461
1461
|
}
|
1462
1462
|
}
|
1463
1463
|
}
|
1464
|
-
function
|
1464
|
+
function en(n) {
|
1465
1465
|
return `${n.name}!${n.options.appId}`;
|
1466
1466
|
}
|
1467
1467
|
/**
|
@@ -1480,12 +1480,12 @@ function rn(n) {
|
|
1480
1480
|
* See the License for the specific language governing permissions and
|
1481
1481
|
* limitations under the License.
|
1482
1482
|
*/
|
1483
|
-
const
|
1484
|
-
class
|
1483
|
+
const ni = 1024, ri = 30 * 24 * 60 * 60 * 1e3;
|
1484
|
+
class ii {
|
1485
1485
|
constructor(e) {
|
1486
1486
|
this.container = e, this._heartbeatsCache = null;
|
1487
1487
|
const t = this.container.getProvider("app").getImmediate();
|
1488
|
-
this._storage = new
|
1488
|
+
this._storage = new oi(t), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
|
1489
1489
|
}
|
1490
1490
|
/**
|
1491
1491
|
* Called to report a heartbeat. The function will generate
|
@@ -1495,11 +1495,11 @@ class oi {
|
|
1495
1495
|
* already logged, subsequent calls to this function in the same day will be ignored.
|
1496
1496
|
*/
|
1497
1497
|
async triggerHeartbeat() {
|
1498
|
-
const t = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), r =
|
1498
|
+
const t = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), r = bt();
|
1499
1499
|
if (this._heartbeatsCache === null && (this._heartbeatsCache = await this._heartbeatsCachePromise), !(this._heartbeatsCache.lastSentHeartbeatDate === r || this._heartbeatsCache.heartbeats.some((i) => i.date === r)))
|
1500
1500
|
return this._heartbeatsCache.heartbeats.push({ date: r, agent: t }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((i) => {
|
1501
1501
|
const s = new Date(i.date).valueOf();
|
1502
|
-
return Date.now() - s <=
|
1502
|
+
return Date.now() - s <= ri;
|
1503
1503
|
}), this._storage.overwrite(this._heartbeatsCache);
|
1504
1504
|
}
|
1505
1505
|
/**
|
@@ -1512,27 +1512,27 @@ class oi {
|
|
1512
1512
|
async getHeartbeatsHeader() {
|
1513
1513
|
if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, this._heartbeatsCache === null || this._heartbeatsCache.heartbeats.length === 0)
|
1514
1514
|
return "";
|
1515
|
-
const e =
|
1515
|
+
const e = bt(), { heartbeatsToSend: t, unsentEntries: r } = si(this._heartbeatsCache.heartbeats), i = xt(JSON.stringify({ version: 2, heartbeats: t }));
|
1516
1516
|
return this._heartbeatsCache.lastSentHeartbeatDate = e, r.length > 0 ? (this._heartbeatsCache.heartbeats = r, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), i;
|
1517
1517
|
}
|
1518
1518
|
}
|
1519
|
-
function
|
1519
|
+
function bt() {
|
1520
1520
|
return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
1521
1521
|
}
|
1522
|
-
function
|
1522
|
+
function si(n, e = ni) {
|
1523
1523
|
const t = [];
|
1524
1524
|
let r = n.slice();
|
1525
1525
|
for (const i of n) {
|
1526
1526
|
const s = t.find((o) => o.agent === i.agent);
|
1527
1527
|
if (s) {
|
1528
|
-
if (s.dates.push(i.date),
|
1528
|
+
if (s.dates.push(i.date), vt(t) > e) {
|
1529
1529
|
s.dates.pop();
|
1530
1530
|
break;
|
1531
1531
|
}
|
1532
1532
|
} else if (t.push({
|
1533
1533
|
agent: i.agent,
|
1534
1534
|
dates: [i.date]
|
1535
|
-
}),
|
1535
|
+
}), vt(t) > e) {
|
1536
1536
|
t.pop();
|
1537
1537
|
break;
|
1538
1538
|
}
|
@@ -1543,25 +1543,25 @@ function ai(n, e = ii) {
|
|
1543
1543
|
unsentEntries: r
|
1544
1544
|
};
|
1545
1545
|
}
|
1546
|
-
class
|
1546
|
+
class oi {
|
1547
1547
|
constructor(e) {
|
1548
1548
|
this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
1549
1549
|
}
|
1550
1550
|
async runIndexedDBEnvironmentCheck() {
|
1551
|
-
return
|
1551
|
+
return Jn() ? Gn().then(() => !0).catch(() => !1) : !1;
|
1552
1552
|
}
|
1553
1553
|
/**
|
1554
1554
|
* Read all heartbeats.
|
1555
1555
|
*/
|
1556
1556
|
async read() {
|
1557
|
-
return await this._canUseIndexedDBPromise ? await
|
1557
|
+
return await this._canUseIndexedDBPromise ? await ti(this.app) || { heartbeats: [] } : { heartbeats: [] };
|
1558
1558
|
}
|
1559
1559
|
// overwrite the storage with the provided heartbeats
|
1560
1560
|
async overwrite(e) {
|
1561
1561
|
var t;
|
1562
1562
|
if (await this._canUseIndexedDBPromise) {
|
1563
1563
|
const i = await this.read();
|
1564
|
-
return
|
1564
|
+
return _t(this.app, {
|
1565
1565
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1566
1566
|
heartbeats: e.heartbeats
|
1567
1567
|
});
|
@@ -1573,7 +1573,7 @@ class ci {
|
|
1573
1573
|
var t;
|
1574
1574
|
if (await this._canUseIndexedDBPromise) {
|
1575
1575
|
const i = await this.read();
|
1576
|
-
return
|
1576
|
+
return _t(this.app, {
|
1577
1577
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1578
1578
|
heartbeats: [
|
1579
1579
|
...i.heartbeats,
|
@@ -1584,8 +1584,8 @@ class ci {
|
|
1584
1584
|
return;
|
1585
1585
|
}
|
1586
1586
|
}
|
1587
|
-
function
|
1588
|
-
return
|
1587
|
+
function vt(n) {
|
1588
|
+
return xt(
|
1589
1589
|
// heartbeatsCache wrapper properties
|
1590
1590
|
JSON.stringify({ version: 2, heartbeats: n })
|
1591
1591
|
).length;
|
@@ -1606,21 +1606,21 @@ function Tt(n) {
|
|
1606
1606
|
* See the License for the specific language governing permissions and
|
1607
1607
|
* limitations under the License.
|
1608
1608
|
*/
|
1609
|
-
function
|
1609
|
+
function ai(n) {
|
1610
1610
|
fe(new ae(
|
1611
1611
|
"platform-logger",
|
1612
|
-
(e) => new
|
1612
|
+
(e) => new Ir(e),
|
1613
1613
|
"PRIVATE"
|
1614
1614
|
/* ComponentType.PRIVATE */
|
1615
1615
|
)), fe(new ae(
|
1616
1616
|
"heartbeat",
|
1617
|
-
(e) => new
|
1617
|
+
(e) => new ii(e),
|
1618
1618
|
"PRIVATE"
|
1619
1619
|
/* ComponentType.PRIVATE */
|
1620
|
-
)), ie(
|
1620
|
+
)), ie(Ye, yt, n), ie(Ye, yt, "esm2017"), ie("fire-js", "");
|
1621
1621
|
}
|
1622
|
-
|
1623
|
-
var
|
1622
|
+
ai("");
|
1623
|
+
var ci = "firebase", li = "10.5.2";
|
1624
1624
|
/**
|
1625
1625
|
* @license
|
1626
1626
|
* Copyright 2020 Google LLC
|
@@ -1637,8 +1637,8 @@ var di = "firebase", ui = "10.5.0";
|
|
1637
1637
|
* See the License for the specific language governing permissions and
|
1638
1638
|
* limitations under the License.
|
1639
1639
|
*/
|
1640
|
-
ie(
|
1641
|
-
function
|
1640
|
+
ie(ci, li, "app");
|
1641
|
+
function rt(n, e) {
|
1642
1642
|
var t = {};
|
1643
1643
|
for (var r in n)
|
1644
1644
|
Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
@@ -1647,22 +1647,12 @@ function at(n, e) {
|
|
1647
1647
|
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[i]) && (t[r[i]] = n[r[i]]);
|
1648
1648
|
return t;
|
1649
1649
|
}
|
1650
|
-
function
|
1651
|
-
return n !== void 0 && n.enterprise !== void 0;
|
1652
|
-
}
|
1653
|
-
class hi {
|
1654
|
-
constructor(e) {
|
1655
|
-
if (this.siteKey = "", this.emailPasswordEnabled = !1, e.recaptchaKey === void 0)
|
1656
|
-
throw new Error("recaptchaKey undefined");
|
1657
|
-
this.siteKey = e.recaptchaKey.split("/")[3], this.emailPasswordEnabled = e.recaptchaEnforcementState.some((t) => t.provider === "EMAIL_PASSWORD_PROVIDER" && t.enforcementState !== "OFF");
|
1658
|
-
}
|
1659
|
-
}
|
1660
|
-
function sn() {
|
1650
|
+
function tn() {
|
1661
1651
|
return {
|
1662
1652
|
"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."
|
1663
1653
|
};
|
1664
1654
|
}
|
1665
|
-
const
|
1655
|
+
const di = tn, nn = new _e("auth", "Firebase", tn());
|
1666
1656
|
/**
|
1667
1657
|
* @license
|
1668
1658
|
* Copyright 2020 Google LLC
|
@@ -1679,12 +1669,12 @@ const fi = sn, on = new _e("auth", "Firebase", sn());
|
|
1679
1669
|
* See the License for the specific language governing permissions and
|
1680
1670
|
* limitations under the License.
|
1681
1671
|
*/
|
1682
|
-
const ke = new
|
1683
|
-
function
|
1684
|
-
ke.logLevel <= T.WARN && ke.warn(`Auth (${
|
1672
|
+
const ke = new Gt("@firebase/auth");
|
1673
|
+
function ui(n, ...e) {
|
1674
|
+
ke.logLevel <= T.WARN && ke.warn(`Auth (${ve}): ${n}`, ...e);
|
1685
1675
|
}
|
1686
1676
|
function Ae(n, ...e) {
|
1687
|
-
ke.logLevel <= T.ERROR && ke.error(`Auth (${
|
1677
|
+
ke.logLevel <= T.ERROR && ke.error(`Auth (${ve}): ${n}`, ...e);
|
1688
1678
|
}
|
1689
1679
|
/**
|
1690
1680
|
* @license
|
@@ -1703,27 +1693,27 @@ function Ae(n, ...e) {
|
|
1703
1693
|
* limitations under the License.
|
1704
1694
|
*/
|
1705
1695
|
function N(n, ...e) {
|
1706
|
-
throw
|
1696
|
+
throw it(n, ...e);
|
1707
1697
|
}
|
1708
1698
|
function L(n, ...e) {
|
1709
|
-
return
|
1699
|
+
return it(n, ...e);
|
1710
1700
|
}
|
1711
|
-
function
|
1712
|
-
const r = Object.assign(Object.assign({},
|
1701
|
+
function hi(n, e, t) {
|
1702
|
+
const r = Object.assign(Object.assign({}, di()), { [e]: t });
|
1713
1703
|
return new _e("auth", "Firebase", r).create(e, {
|
1714
1704
|
appName: n.name
|
1715
1705
|
});
|
1716
1706
|
}
|
1717
|
-
function
|
1707
|
+
function it(n, ...e) {
|
1718
1708
|
if (typeof n != "string") {
|
1719
1709
|
const t = e[0], r = [...e.slice(1)];
|
1720
1710
|
return r[0] && (r[0].appName = n.name), n._errorFactory.create(t, ...r);
|
1721
1711
|
}
|
1722
|
-
return
|
1712
|
+
return nn.create(n, ...e);
|
1723
1713
|
}
|
1724
1714
|
function _(n, e, ...t) {
|
1725
1715
|
if (!n)
|
1726
|
-
throw
|
1716
|
+
throw it(e, ...t);
|
1727
1717
|
}
|
1728
1718
|
function M(n) {
|
1729
1719
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
@@ -1748,14 +1738,14 @@ function j(n, e) {
|
|
1748
1738
|
* See the License for the specific language governing permissions and
|
1749
1739
|
* limitations under the License.
|
1750
1740
|
*/
|
1751
|
-
function
|
1741
|
+
function Ze() {
|
1752
1742
|
var n;
|
1753
1743
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
1754
1744
|
}
|
1755
|
-
function
|
1756
|
-
return
|
1745
|
+
function fi() {
|
1746
|
+
return It() === "http:" || It() === "https:";
|
1757
1747
|
}
|
1758
|
-
function
|
1748
|
+
function It() {
|
1759
1749
|
var n;
|
1760
1750
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
1761
1751
|
}
|
@@ -1775,15 +1765,15 @@ function St() {
|
|
1775
1765
|
* See the License for the specific language governing permissions and
|
1776
1766
|
* limitations under the License.
|
1777
1767
|
*/
|
1778
|
-
function
|
1768
|
+
function pi() {
|
1779
1769
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
1780
1770
|
// This is especially true for Cordova apps which have unreliable
|
1781
1771
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
1782
1772
|
// installed which overwrites the native navigator.onLine value and
|
1783
1773
|
// defines navigator.connection.
|
1784
|
-
(
|
1774
|
+
(fi() || xn() || "connection" in navigator) ? navigator.onLine : !0;
|
1785
1775
|
}
|
1786
|
-
function
|
1776
|
+
function gi() {
|
1787
1777
|
if (typeof navigator > "u")
|
1788
1778
|
return null;
|
1789
1779
|
const n = navigator;
|
@@ -1813,10 +1803,10 @@ function _i() {
|
|
1813
1803
|
*/
|
1814
1804
|
class Ie {
|
1815
1805
|
constructor(e, t) {
|
1816
|
-
this.shortDelay = e, this.longDelay = t, j(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
1806
|
+
this.shortDelay = e, this.longDelay = t, j(t > e, "Short delay should be less than long delay!"), this.isMobile = Wn() || zn();
|
1817
1807
|
}
|
1818
1808
|
get() {
|
1819
|
-
return
|
1809
|
+
return pi() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
1820
1810
|
}
|
1821
1811
|
}
|
1822
1812
|
/**
|
@@ -1835,7 +1825,7 @@ class Ie {
|
|
1835
1825
|
* See the License for the specific language governing permissions and
|
1836
1826
|
* limitations under the License.
|
1837
1827
|
*/
|
1838
|
-
function
|
1828
|
+
function st(n, e) {
|
1839
1829
|
j(n.emulator, "Emulator should always be set here");
|
1840
1830
|
const { url: t } = n.emulator;
|
1841
1831
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
@@ -1856,7 +1846,7 @@ function lt(n, e) {
|
|
1856
1846
|
* See the License for the specific language governing permissions and
|
1857
1847
|
* limitations under the License.
|
1858
1848
|
*/
|
1859
|
-
class
|
1849
|
+
class rn {
|
1860
1850
|
static initialize(e, t, r) {
|
1861
1851
|
this.fetchImpl = e, t && (this.headersImpl = t), r && (this.responseImpl = r);
|
1862
1852
|
}
|
@@ -1865,6 +1855,10 @@ class an {
|
|
1865
1855
|
return this.fetchImpl;
|
1866
1856
|
if (typeof self < "u" && "fetch" in self)
|
1867
1857
|
return self.fetch;
|
1858
|
+
if (typeof globalThis < "u" && globalThis.fetch)
|
1859
|
+
return globalThis.fetch;
|
1860
|
+
if (typeof fetch < "u")
|
1861
|
+
return fetch;
|
1868
1862
|
M("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
1869
1863
|
}
|
1870
1864
|
static headers() {
|
@@ -1872,6 +1866,10 @@ class an {
|
|
1872
1866
|
return this.headersImpl;
|
1873
1867
|
if (typeof self < "u" && "Headers" in self)
|
1874
1868
|
return self.Headers;
|
1869
|
+
if (typeof globalThis < "u" && globalThis.Headers)
|
1870
|
+
return globalThis.Headers;
|
1871
|
+
if (typeof Headers < "u")
|
1872
|
+
return Headers;
|
1875
1873
|
M("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
1876
1874
|
}
|
1877
1875
|
static response() {
|
@@ -1879,6 +1877,10 @@ class an {
|
|
1879
1877
|
return this.responseImpl;
|
1880
1878
|
if (typeof self < "u" && "Response" in self)
|
1881
1879
|
return self.Response;
|
1880
|
+
if (typeof globalThis < "u" && globalThis.Response)
|
1881
|
+
return globalThis.Response;
|
1882
|
+
if (typeof Response < "u")
|
1883
|
+
return Response;
|
1882
1884
|
M("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
1883
1885
|
}
|
1884
1886
|
}
|
@@ -1898,7 +1900,7 @@ class an {
|
|
1898
1900
|
* See the License for the specific language governing permissions and
|
1899
1901
|
* limitations under the License.
|
1900
1902
|
*/
|
1901
|
-
const
|
1903
|
+
const mi = {
|
1902
1904
|
// Custom token errors.
|
1903
1905
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
1904
1906
|
// This can only happen if the SDK sends a bad request.
|
@@ -1986,35 +1988,35 @@ const vi = {
|
|
1986
1988
|
* See the License for the specific language governing permissions and
|
1987
1989
|
* limitations under the License.
|
1988
1990
|
*/
|
1989
|
-
const
|
1991
|
+
const yi = new Ie(3e4, 6e4);
|
1990
1992
|
function te(n, e) {
|
1991
1993
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
1992
1994
|
}
|
1993
1995
|
async function K(n, e, t, r, i = {}) {
|
1994
|
-
return
|
1996
|
+
return sn(n, i, async () => {
|
1995
1997
|
let s = {}, o = {};
|
1996
1998
|
r && (e === "GET" ? o = r : s = {
|
1997
1999
|
body: JSON.stringify(r)
|
1998
2000
|
});
|
1999
|
-
const c =
|
2001
|
+
const c = be(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
2000
2002
|
return a[
|
2001
2003
|
"Content-Type"
|
2002
2004
|
/* HttpHeader.CONTENT_TYPE */
|
2003
2005
|
] = "application/json", n.languageCode && (a[
|
2004
2006
|
"X-Firebase-Locale"
|
2005
2007
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
2006
|
-
] = n.languageCode),
|
2008
|
+
] = n.languageCode), rn.fetch()(on(n, n.config.apiHost, t, c), Object.assign({
|
2007
2009
|
method: e,
|
2008
2010
|
headers: a,
|
2009
2011
|
referrerPolicy: "no-referrer"
|
2010
2012
|
}, s));
|
2011
2013
|
});
|
2012
2014
|
}
|
2013
|
-
async function
|
2015
|
+
async function sn(n, e, t) {
|
2014
2016
|
n._canInitEmulator = !1;
|
2015
|
-
const r = Object.assign(Object.assign({},
|
2017
|
+
const r = Object.assign(Object.assign({}, mi), e);
|
2016
2018
|
try {
|
2017
|
-
const i = new
|
2019
|
+
const i = new bi(n), s = await Promise.race([
|
2018
2020
|
t(),
|
2019
2021
|
i.promise
|
2020
2022
|
]);
|
@@ -2034,7 +2036,7 @@ async function cn(n, e, t) {
|
|
2034
2036
|
throw Te(n, "user-disabled", o);
|
2035
2037
|
const y = r[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
2036
2038
|
if (u)
|
2037
|
-
throw
|
2039
|
+
throw hi(n, y, u);
|
2038
2040
|
N(n, y);
|
2039
2041
|
}
|
2040
2042
|
} catch (i) {
|
@@ -2043,24 +2045,36 @@ async function cn(n, e, t) {
|
|
2043
2045
|
N(n, "network-request-failed", { message: String(i) });
|
2044
2046
|
}
|
2045
2047
|
}
|
2046
|
-
async function
|
2048
|
+
async function Ue(n, e, t, r, i = {}) {
|
2047
2049
|
const s = await K(n, e, t, r, i);
|
2048
2050
|
return "mfaPendingCredential" in s && N(n, "multi-factor-auth-required", {
|
2049
2051
|
_serverResponse: s
|
2050
2052
|
}), s;
|
2051
2053
|
}
|
2052
|
-
function
|
2054
|
+
function on(n, e, t, r) {
|
2053
2055
|
const i = `${e}${t}?${r}`;
|
2054
|
-
return n.config.emulator ?
|
2056
|
+
return n.config.emulator ? st(n.config, i) : `${n.config.apiScheme}://${i}`;
|
2055
2057
|
}
|
2056
|
-
|
2058
|
+
function _i(n) {
|
2059
|
+
switch (n) {
|
2060
|
+
case "ENFORCE":
|
2061
|
+
return "ENFORCE";
|
2062
|
+
case "AUDIT":
|
2063
|
+
return "AUDIT";
|
2064
|
+
case "OFF":
|
2065
|
+
return "OFF";
|
2066
|
+
default:
|
2067
|
+
return "ENFORCEMENT_STATE_UNSPECIFIED";
|
2068
|
+
}
|
2069
|
+
}
|
2070
|
+
class bi {
|
2057
2071
|
constructor(e) {
|
2058
2072
|
this.auth = e, this.timer = null, this.promise = new Promise((t, r) => {
|
2059
2073
|
this.timer = setTimeout(() => r(L(
|
2060
2074
|
this.auth,
|
2061
2075
|
"network-request-failed"
|
2062
2076
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
2063
|
-
)),
|
2077
|
+
)), yi.get());
|
2064
2078
|
});
|
2065
2079
|
}
|
2066
2080
|
clearNetworkTimeout() {
|
@@ -2075,7 +2089,40 @@ function Te(n, e, t) {
|
|
2075
2089
|
const i = L(n, e, r);
|
2076
2090
|
return i.customData._tokenResponse = t, i;
|
2077
2091
|
}
|
2078
|
-
|
2092
|
+
function wt(n) {
|
2093
|
+
return n !== void 0 && n.enterprise !== void 0;
|
2094
|
+
}
|
2095
|
+
class vi {
|
2096
|
+
constructor(e) {
|
2097
|
+
if (this.siteKey = "", this.recaptchaEnforcementState = [], e.recaptchaKey === void 0)
|
2098
|
+
throw new Error("recaptchaKey undefined");
|
2099
|
+
this.siteKey = e.recaptchaKey.split("/")[3], this.recaptchaEnforcementState = e.recaptchaEnforcementState;
|
2100
|
+
}
|
2101
|
+
/**
|
2102
|
+
* Returns the reCAPTCHA Enterprise enforcement state for the given provider.
|
2103
|
+
*
|
2104
|
+
* @param providerStr - The provider whose enforcement state is to be returned.
|
2105
|
+
* @returns The reCAPTCHA Enterprise enforcement state for the given provider.
|
2106
|
+
*/
|
2107
|
+
getProviderEnforcementState(e) {
|
2108
|
+
if (!this.recaptchaEnforcementState || this.recaptchaEnforcementState.length === 0)
|
2109
|
+
return null;
|
2110
|
+
for (const t of this.recaptchaEnforcementState)
|
2111
|
+
if (t.provider && t.provider === e)
|
2112
|
+
return _i(t.enforcementState);
|
2113
|
+
return null;
|
2114
|
+
}
|
2115
|
+
/**
|
2116
|
+
* Returns true if the reCAPTCHA Enterprise enforcement state for the provider is set to ENFORCE or AUDIT.
|
2117
|
+
*
|
2118
|
+
* @param providerStr - The provider whose enablement state is to be returned.
|
2119
|
+
* @returns Whether or not reCAPTCHA Enterprise protection is enabled for the given provider.
|
2120
|
+
*/
|
2121
|
+
isProviderEnabled(e) {
|
2122
|
+
return this.getProviderEnforcementState(e) === "ENFORCE" || this.getProviderEnforcementState(e) === "AUDIT";
|
2123
|
+
}
|
2124
|
+
}
|
2125
|
+
async function Ii(n, e) {
|
2079
2126
|
return K(n, "GET", "/v2/recaptchaConfig", te(n, e));
|
2080
2127
|
}
|
2081
2128
|
/**
|
@@ -2094,10 +2141,10 @@ async function wi(n, e) {
|
|
2094
2141
|
* See the License for the specific language governing permissions and
|
2095
2142
|
* limitations under the License.
|
2096
2143
|
*/
|
2097
|
-
async function
|
2144
|
+
async function wi(n, e) {
|
2098
2145
|
return K(n, "POST", "/v1/accounts:delete", e);
|
2099
2146
|
}
|
2100
|
-
async function
|
2147
|
+
async function Ei(n, e) {
|
2101
2148
|
return K(n, "POST", "/v1/accounts:lookup", e);
|
2102
2149
|
}
|
2103
2150
|
/**
|
@@ -2125,8 +2172,8 @@ function he(n) {
|
|
2125
2172
|
} catch {
|
2126
2173
|
}
|
2127
2174
|
}
|
2128
|
-
async function
|
2129
|
-
const t =
|
2175
|
+
async function Ti(n, e = !1) {
|
2176
|
+
const t = F(n), r = await t.getIdToken(e), i = ot(r);
|
2130
2177
|
_(
|
2131
2178
|
i && i.exp && i.auth_time && i.iat,
|
2132
2179
|
t.auth,
|
@@ -2137,29 +2184,29 @@ async function Ai(n, e = !1) {
|
|
2137
2184
|
return {
|
2138
2185
|
claims: i,
|
2139
2186
|
token: r,
|
2140
|
-
authTime: he(
|
2141
|
-
issuedAtTime: he(
|
2142
|
-
expirationTime: he(
|
2187
|
+
authTime: he(qe(i.auth_time)),
|
2188
|
+
issuedAtTime: he(qe(i.iat)),
|
2189
|
+
expirationTime: he(qe(i.exp)),
|
2143
2190
|
signInProvider: o || null,
|
2144
2191
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
2145
2192
|
};
|
2146
2193
|
}
|
2147
|
-
function
|
2194
|
+
function qe(n) {
|
2148
2195
|
return Number(n) * 1e3;
|
2149
2196
|
}
|
2150
|
-
function
|
2197
|
+
function ot(n) {
|
2151
2198
|
const [e, t, r] = n.split(".");
|
2152
2199
|
if (e === void 0 || t === void 0 || r === void 0)
|
2153
2200
|
return Ae("JWT malformed, contained fewer than 3 sections"), null;
|
2154
2201
|
try {
|
2155
|
-
const i =
|
2202
|
+
const i = zt(t);
|
2156
2203
|
return i ? JSON.parse(i) : (Ae("Failed to decode base64 JWT payload"), null);
|
2157
2204
|
} catch (i) {
|
2158
2205
|
return Ae("Caught error parsing JWT payload as JSON", i == null ? void 0 : i.toString()), null;
|
2159
2206
|
}
|
2160
2207
|
}
|
2161
|
-
function
|
2162
|
-
const e =
|
2208
|
+
function Ai(n) {
|
2209
|
+
const e = ot(n);
|
2163
2210
|
return _(
|
2164
2211
|
e,
|
2165
2212
|
"internal-error"
|
@@ -2196,10 +2243,10 @@ async function ge(n, e, t = !1) {
|
|
2196
2243
|
try {
|
2197
2244
|
return await e;
|
2198
2245
|
} catch (r) {
|
2199
|
-
throw r instanceof G &&
|
2246
|
+
throw r instanceof G && Si(r) && n.auth.currentUser === n && await n.auth.signOut(), r;
|
2200
2247
|
}
|
2201
2248
|
}
|
2202
|
-
function
|
2249
|
+
function Si({ code: n }) {
|
2203
2250
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
2204
2251
|
}
|
2205
2252
|
/**
|
@@ -2218,7 +2265,7 @@ function Ci({ code: n }) {
|
|
2218
2265
|
* See the License for the specific language governing permissions and
|
2219
2266
|
* limitations under the License.
|
2220
2267
|
*/
|
2221
|
-
class
|
2268
|
+
class Ci {
|
2222
2269
|
constructor(e) {
|
2223
2270
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
2224
2271
|
}
|
@@ -2280,7 +2327,7 @@ class Ri {
|
|
2280
2327
|
* See the License for the specific language governing permissions and
|
2281
2328
|
* limitations under the License.
|
2282
2329
|
*/
|
2283
|
-
class
|
2330
|
+
class an {
|
2284
2331
|
constructor(e, t) {
|
2285
2332
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
2286
2333
|
}
|
@@ -2315,7 +2362,7 @@ class dn {
|
|
2315
2362
|
*/
|
2316
2363
|
async function Ne(n) {
|
2317
2364
|
var e;
|
2318
|
-
const t = n.auth, r = await n.getIdToken(), i = await ge(n,
|
2365
|
+
const t = n.auth, r = await n.getIdToken(), i = await ge(n, Ei(t, { idToken: r }));
|
2319
2366
|
_(
|
2320
2367
|
i == null ? void 0 : i.users.length,
|
2321
2368
|
t,
|
@@ -2324,7 +2371,7 @@ async function Ne(n) {
|
|
2324
2371
|
);
|
2325
2372
|
const s = i.users[0];
|
2326
2373
|
n._notifyReloadListener(s);
|
2327
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
2374
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Oi(s.providerUserInfo) : [], c = Pi(n.providerData, o), a = n.isAnonymous, u = !(n.email && s.passwordHash) && !(c != null && c.length), y = a ? u : !1, v = {
|
2328
2375
|
uid: s.localId,
|
2329
2376
|
displayName: s.displayName || null,
|
2330
2377
|
photoURL: s.photoUrl || null,
|
@@ -2333,21 +2380,21 @@ async function Ne(n) {
|
|
2333
2380
|
phoneNumber: s.phoneNumber || null,
|
2334
2381
|
tenantId: s.tenantId || null,
|
2335
2382
|
providerData: c,
|
2336
|
-
metadata: new
|
2383
|
+
metadata: new an(s.createdAt, s.lastLoginAt),
|
2337
2384
|
isAnonymous: y
|
2338
2385
|
};
|
2339
|
-
Object.assign(n,
|
2386
|
+
Object.assign(n, v);
|
2340
2387
|
}
|
2341
|
-
async function
|
2342
|
-
const e =
|
2388
|
+
async function Ri(n) {
|
2389
|
+
const e = F(n);
|
2343
2390
|
await Ne(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
2344
2391
|
}
|
2345
|
-
function
|
2392
|
+
function Pi(n, e) {
|
2346
2393
|
return [...n.filter((r) => !e.some((i) => i.providerId === r.providerId)), ...e];
|
2347
2394
|
}
|
2348
|
-
function
|
2395
|
+
function Oi(n) {
|
2349
2396
|
return n.map((e) => {
|
2350
|
-
var { providerId: t } = e, r =
|
2397
|
+
var { providerId: t } = e, r = rt(e, ["providerId"]);
|
2351
2398
|
return {
|
2352
2399
|
providerId: t,
|
2353
2400
|
uid: r.rawId || "",
|
@@ -2374,16 +2421,16 @@ function ki(n) {
|
|
2374
2421
|
* See the License for the specific language governing permissions and
|
2375
2422
|
* limitations under the License.
|
2376
2423
|
*/
|
2377
|
-
async function
|
2378
|
-
const t = await
|
2379
|
-
const r =
|
2424
|
+
async function ki(n, e) {
|
2425
|
+
const t = await sn(n, {}, async () => {
|
2426
|
+
const r = be({
|
2380
2427
|
grant_type: "refresh_token",
|
2381
2428
|
refresh_token: e
|
2382
|
-
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, o =
|
2429
|
+
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, o = on(n, i, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
2383
2430
|
return c[
|
2384
2431
|
"Content-Type"
|
2385
2432
|
/* HttpHeader.CONTENT_TYPE */
|
2386
|
-
] = "application/x-www-form-urlencoded",
|
2433
|
+
] = "application/x-www-form-urlencoded", rn.fetch()(o, {
|
2387
2434
|
method: "POST",
|
2388
2435
|
headers: c,
|
2389
2436
|
body: r
|
@@ -2432,7 +2479,7 @@ class me {
|
|
2432
2479
|
"internal-error"
|
2433
2480
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2434
2481
|
);
|
2435
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
2482
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : Ai(e.idToken);
|
2436
2483
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
2437
2484
|
}
|
2438
2485
|
async getToken(e, t = !1) {
|
@@ -2447,7 +2494,7 @@ class me {
|
|
2447
2494
|
this.refreshToken = null;
|
2448
2495
|
}
|
2449
2496
|
async refresh(e, t) {
|
2450
|
-
const { accessToken: r, refreshToken: i, expiresIn: s } = await
|
2497
|
+
const { accessToken: r, refreshToken: i, expiresIn: s } = await ki(e, t);
|
2451
2498
|
this.updateTokensAndExpiration(r, i, Number(s));
|
2452
2499
|
}
|
2453
2500
|
updateTokensAndExpiration(e, t, r) {
|
@@ -2501,8 +2548,8 @@ function H(n, e) {
|
|
2501
2548
|
}
|
2502
2549
|
class X {
|
2503
2550
|
constructor(e) {
|
2504
|
-
var { uid: t, auth: r, stsTokenManager: i } = e, s =
|
2505
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
2551
|
+
var { uid: t, auth: r, stsTokenManager: i } = e, s = rt(e, ["uid", "auth", "stsTokenManager"]);
|
2552
|
+
this.providerId = "firebase", this.proactiveRefresh = new Ci(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = r, this.stsTokenManager = i, this.accessToken = i.accessToken, this.displayName = s.displayName || null, this.email = s.email || null, this.emailVerified = s.emailVerified || !1, this.phoneNumber = s.phoneNumber || null, this.photoURL = s.photoURL || null, this.isAnonymous = s.isAnonymous || !1, this.tenantId = s.tenantId || null, this.providerData = s.providerData ? [...s.providerData] : [], this.metadata = new an(s.createdAt || void 0, s.lastLoginAt || void 0);
|
2506
2553
|
}
|
2507
2554
|
async getIdToken(e) {
|
2508
2555
|
const t = await ge(this, this.stsTokenManager.getToken(this.auth, e));
|
@@ -2514,10 +2561,10 @@ class X {
|
|
2514
2561
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
2515
2562
|
}
|
2516
2563
|
getIdTokenResult(e) {
|
2517
|
-
return
|
2564
|
+
return Ti(this, e);
|
2518
2565
|
}
|
2519
2566
|
reload() {
|
2520
|
-
return
|
2567
|
+
return Ri(this);
|
2521
2568
|
}
|
2522
2569
|
_assign(e) {
|
2523
2570
|
this !== e && (_(
|
@@ -2554,7 +2601,7 @@ class X {
|
|
2554
2601
|
}
|
2555
2602
|
async delete() {
|
2556
2603
|
const e = await this.getIdToken();
|
2557
|
-
return await ge(this,
|
2604
|
+
return await ge(this, wi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
2558
2605
|
}
|
2559
2606
|
toJSON() {
|
2560
2607
|
return Object.assign(Object.assign({
|
@@ -2582,7 +2629,7 @@ class X {
|
|
2582
2629
|
}
|
2583
2630
|
static _fromJSON(e, t) {
|
2584
2631
|
var r, i, s, o, c, a, u, y;
|
2585
|
-
const
|
2632
|
+
const v = (r = t.displayName) !== null && r !== void 0 ? r : void 0, A = (i = t.email) !== null && i !== void 0 ? i : void 0, P = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, k = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, b = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, D = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, C = (y = t.lastLoginAt) !== null && y !== void 0 ? y : void 0, { uid: Y, emailVerified: B, isAnonymous: l, providerData: m, stsTokenManager: d } = t;
|
2586
2633
|
_(
|
2587
2634
|
Y && d,
|
2588
2635
|
e,
|
@@ -2595,8 +2642,8 @@ class X {
|
|
2595
2642
|
e,
|
2596
2643
|
"internal-error"
|
2597
2644
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2598
|
-
), H(
|
2599
|
-
typeof
|
2645
|
+
), H(v, e.name), H(A, e.name), _(
|
2646
|
+
typeof B == "boolean",
|
2600
2647
|
e,
|
2601
2648
|
"internal-error"
|
2602
2649
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -2605,17 +2652,17 @@ class X {
|
|
2605
2652
|
e,
|
2606
2653
|
"internal-error"
|
2607
2654
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2608
|
-
), H(P, e.name), H(k, e.name), H(
|
2655
|
+
), H(P, e.name), H(k, e.name), H(b, e.name), H(I, e.name), H(D, e.name), H(C, e.name);
|
2609
2656
|
const E = new X({
|
2610
2657
|
uid: Y,
|
2611
2658
|
auth: e,
|
2612
2659
|
email: A,
|
2613
|
-
emailVerified:
|
2614
|
-
displayName:
|
2660
|
+
emailVerified: B,
|
2661
|
+
displayName: v,
|
2615
2662
|
isAnonymous: l,
|
2616
2663
|
photoURL: k,
|
2617
2664
|
phoneNumber: P,
|
2618
|
-
tenantId:
|
2665
|
+
tenantId: b,
|
2619
2666
|
stsTokenManager: w,
|
2620
2667
|
createdAt: D,
|
2621
2668
|
lastLoginAt: C
|
@@ -2655,11 +2702,11 @@ class X {
|
|
2655
2702
|
* See the License for the specific language governing permissions and
|
2656
2703
|
* limitations under the License.
|
2657
2704
|
*/
|
2658
|
-
const
|
2705
|
+
const Et = /* @__PURE__ */ new Map();
|
2659
2706
|
function U(n) {
|
2660
2707
|
j(n instanceof Function, "Expected a class definition");
|
2661
|
-
let e =
|
2662
|
-
return e ? (j(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(),
|
2708
|
+
let e = Et.get(n);
|
2709
|
+
return e ? (j(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Et.set(n, e), e);
|
2663
2710
|
}
|
2664
2711
|
/**
|
2665
2712
|
* @license
|
@@ -2677,7 +2724,7 @@ function U(n) {
|
|
2677
2724
|
* See the License for the specific language governing permissions and
|
2678
2725
|
* limitations under the License.
|
2679
2726
|
*/
|
2680
|
-
class
|
2727
|
+
class cn {
|
2681
2728
|
constructor() {
|
2682
2729
|
this.type = "NONE", this.storage = {};
|
2683
2730
|
}
|
@@ -2699,8 +2746,8 @@ class un {
|
|
2699
2746
|
_removeListener(e, t) {
|
2700
2747
|
}
|
2701
2748
|
}
|
2702
|
-
|
2703
|
-
const
|
2749
|
+
cn.type = "NONE";
|
2750
|
+
const Tt = cn;
|
2704
2751
|
/**
|
2705
2752
|
* @license
|
2706
2753
|
* Copyright 2019 Google LLC
|
@@ -2751,20 +2798,20 @@ class se {
|
|
2751
2798
|
}
|
2752
2799
|
static async create(e, t, r = "authUser") {
|
2753
2800
|
if (!t.length)
|
2754
|
-
return new se(U(
|
2801
|
+
return new se(U(Tt), e, r);
|
2755
2802
|
const i = (await Promise.all(t.map(async (u) => {
|
2756
2803
|
if (await u._isAvailable())
|
2757
2804
|
return u;
|
2758
2805
|
}))).filter((u) => u);
|
2759
|
-
let s = i[0] || U(
|
2806
|
+
let s = i[0] || U(Tt);
|
2760
2807
|
const o = Se(r, e.config.apiKey, e.name);
|
2761
2808
|
let c = null;
|
2762
2809
|
for (const u of t)
|
2763
2810
|
try {
|
2764
2811
|
const y = await u._get(o);
|
2765
2812
|
if (y) {
|
2766
|
-
const
|
2767
|
-
u !== s && (c =
|
2813
|
+
const v = X._fromJSON(e, y);
|
2814
|
+
u !== s && (c = v), s = u;
|
2768
2815
|
break;
|
2769
2816
|
}
|
2770
2817
|
} catch {
|
@@ -2795,29 +2842,29 @@ class se {
|
|
2795
2842
|
* See the License for the specific language governing permissions and
|
2796
2843
|
* limitations under the License.
|
2797
2844
|
*/
|
2798
|
-
function
|
2845
|
+
function At(n) {
|
2799
2846
|
const e = n.toLowerCase();
|
2800
2847
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
2801
2848
|
return "Opera";
|
2802
|
-
if (
|
2849
|
+
if (un(e))
|
2803
2850
|
return "IEMobile";
|
2804
2851
|
if (e.includes("msie") || e.includes("trident/"))
|
2805
2852
|
return "IE";
|
2806
2853
|
if (e.includes("edge/"))
|
2807
2854
|
return "Edge";
|
2808
|
-
if (
|
2855
|
+
if (ln(e))
|
2809
2856
|
return "Firefox";
|
2810
2857
|
if (e.includes("silk/"))
|
2811
2858
|
return "Silk";
|
2812
|
-
if (
|
2859
|
+
if (fn(e))
|
2813
2860
|
return "Blackberry";
|
2814
|
-
if (
|
2861
|
+
if (pn(e))
|
2815
2862
|
return "Webos";
|
2816
|
-
if (
|
2863
|
+
if (at(e))
|
2817
2864
|
return "Safari";
|
2818
|
-
if ((e.includes("chrome/") ||
|
2865
|
+
if ((e.includes("chrome/") || dn(e)) && !e.includes("edge/"))
|
2819
2866
|
return "Chrome";
|
2820
|
-
if (
|
2867
|
+
if (hn(e))
|
2821
2868
|
return "Android";
|
2822
2869
|
{
|
2823
2870
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, r = n.match(t);
|
@@ -2826,42 +2873,42 @@ function Pt(n) {
|
|
2826
2873
|
}
|
2827
2874
|
return "Other";
|
2828
2875
|
}
|
2829
|
-
function
|
2876
|
+
function ln(n = R()) {
|
2830
2877
|
return /firefox\//i.test(n);
|
2831
2878
|
}
|
2832
|
-
function
|
2879
|
+
function at(n = R()) {
|
2833
2880
|
const e = n.toLowerCase();
|
2834
2881
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
2835
2882
|
}
|
2836
|
-
function
|
2883
|
+
function dn(n = R()) {
|
2837
2884
|
return /crios\//i.test(n);
|
2838
2885
|
}
|
2839
|
-
function
|
2886
|
+
function un(n = R()) {
|
2840
2887
|
return /iemobile/i.test(n);
|
2841
2888
|
}
|
2842
|
-
function
|
2889
|
+
function hn(n = R()) {
|
2843
2890
|
return /android/i.test(n);
|
2844
2891
|
}
|
2845
|
-
function
|
2892
|
+
function fn(n = R()) {
|
2846
2893
|
return /blackberry/i.test(n);
|
2847
2894
|
}
|
2848
|
-
function
|
2895
|
+
function pn(n = R()) {
|
2849
2896
|
return /webos/i.test(n);
|
2850
2897
|
}
|
2851
|
-
function
|
2898
|
+
function je(n = R()) {
|
2852
2899
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
2853
2900
|
}
|
2854
|
-
function
|
2901
|
+
function Ni(n = R()) {
|
2855
2902
|
var e;
|
2856
|
-
return
|
2903
|
+
return je(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
2857
2904
|
}
|
2858
|
-
function
|
2859
|
-
return
|
2905
|
+
function Di() {
|
2906
|
+
return qn() && document.documentMode === 10;
|
2860
2907
|
}
|
2861
|
-
function
|
2862
|
-
return
|
2908
|
+
function gn(n = R()) {
|
2909
|
+
return je(n) || hn(n) || pn(n) || fn(n) || /windows phone/i.test(n) || un(n);
|
2863
2910
|
}
|
2864
|
-
function
|
2911
|
+
function Li() {
|
2865
2912
|
try {
|
2866
2913
|
return !!(window && window !== window.top);
|
2867
2914
|
} catch {
|
@@ -2884,20 +2931,20 @@ function $i() {
|
|
2884
2931
|
* See the License for the specific language governing permissions and
|
2885
2932
|
* limitations under the License.
|
2886
2933
|
*/
|
2887
|
-
function
|
2934
|
+
function mn(n, e = []) {
|
2888
2935
|
let t;
|
2889
2936
|
switch (n) {
|
2890
2937
|
case "Browser":
|
2891
|
-
t =
|
2938
|
+
t = At(R());
|
2892
2939
|
break;
|
2893
2940
|
case "Worker":
|
2894
|
-
t = `${
|
2941
|
+
t = `${At(R())}-${n}`;
|
2895
2942
|
break;
|
2896
2943
|
default:
|
2897
2944
|
t = n;
|
2898
2945
|
}
|
2899
2946
|
const r = e.length ? e.join(",") : "FirebaseCore-web";
|
2900
|
-
return `${t}/JsCore/${
|
2947
|
+
return `${t}/JsCore/${ve}/${r}`;
|
2901
2948
|
}
|
2902
2949
|
/**
|
2903
2950
|
* @license
|
@@ -2915,7 +2962,7 @@ function vn(n, e = []) {
|
|
2915
2962
|
* See the License for the specific language governing permissions and
|
2916
2963
|
* limitations under the License.
|
2917
2964
|
*/
|
2918
|
-
class
|
2965
|
+
class $i {
|
2919
2966
|
constructor(e) {
|
2920
2967
|
this.auth = e, this.queue = [];
|
2921
2968
|
}
|
@@ -2970,7 +3017,7 @@ class Mi {
|
|
2970
3017
|
* See the License for the specific language governing permissions and
|
2971
3018
|
* limitations under the License.
|
2972
3019
|
*/
|
2973
|
-
async function
|
3020
|
+
async function Mi(n, e = {}) {
|
2974
3021
|
return K(n, "GET", "/v2/passwordPolicy", te(n, e));
|
2975
3022
|
}
|
2976
3023
|
/**
|
@@ -2989,12 +3036,12 @@ async function Ui(n, e = {}) {
|
|
2989
3036
|
* See the License for the specific language governing permissions and
|
2990
3037
|
* limitations under the License.
|
2991
3038
|
*/
|
2992
|
-
const
|
2993
|
-
class
|
3039
|
+
const Ui = 6;
|
3040
|
+
class ji {
|
2994
3041
|
constructor(e) {
|
2995
3042
|
var t, r, i, s;
|
2996
3043
|
const o = e.customStrengthOptions;
|
2997
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
3044
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Ui, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (i = (r = e.allowedNonAlphanumericCharacters) === null || r === void 0 ? void 0 : r.join("")) !== null && i !== void 0 ? i : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
2998
3045
|
}
|
2999
3046
|
validatePassword(e) {
|
3000
3047
|
var t, r, i, s, o, c;
|
@@ -3079,7 +3126,7 @@ class Bi {
|
|
3079
3126
|
*/
|
3080
3127
|
class Fi {
|
3081
3128
|
constructor(e, t, r, i) {
|
3082
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = r, this.config = i, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new
|
3129
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = r, this.config = i, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new St(this), this.idTokenSubscription = new St(this), this.beforeStateQueue = new $i(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 = nn, this._agentRecaptchaConfig = null, this._tenantRecaptchaConfigs = {}, this._projectPasswordPolicy = null, this._tenantPasswordPolicies = {}, this.lastNotifiedUid = void 0, this.languageCode = null, this.tenantId = null, this.settings = { appVerificationDisabledForTesting: !1 }, this.frameworks = [], this.name = e.name, this.clientVersion = i.sdkClientVersion;
|
3083
3130
|
}
|
3084
3131
|
_initializeWithPersistence(e, t) {
|
3085
3132
|
return t && (this._popupRedirectResolver = U(t)), this._initializationPromise = this.queue(async () => {
|
@@ -3159,13 +3206,13 @@ class Fi {
|
|
3159
3206
|
return this.directlySetCurrentUser(e);
|
3160
3207
|
}
|
3161
3208
|
useDeviceLanguage() {
|
3162
|
-
this.languageCode =
|
3209
|
+
this.languageCode = gi();
|
3163
3210
|
}
|
3164
3211
|
async _delete() {
|
3165
3212
|
this._deleted = !0;
|
3166
3213
|
}
|
3167
3214
|
async updateCurrentUser(e) {
|
3168
|
-
const t = e ?
|
3215
|
+
const t = e ? F(e) : null;
|
3169
3216
|
return t && _(
|
3170
3217
|
t.auth.config.apiKey === this.config.apiKey,
|
3171
3218
|
this,
|
@@ -3208,7 +3255,7 @@ class Fi {
|
|
3208
3255
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
3209
3256
|
}
|
3210
3257
|
async _updatePasswordPolicy() {
|
3211
|
-
const e = await
|
3258
|
+
const e = await Mi(this), t = new ji(e);
|
3212
3259
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
3213
3260
|
}
|
3214
3261
|
_getPersistence() {
|
@@ -3347,7 +3394,7 @@ class Fi {
|
|
3347
3394
|
), this.persistenceManager;
|
3348
3395
|
}
|
3349
3396
|
_logFramework(e) {
|
3350
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
3397
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = mn(this.config.clientPlatform, this._getFrameworks()));
|
3351
3398
|
}
|
3352
3399
|
_getFrameworks() {
|
3353
3400
|
return this.frameworks;
|
@@ -3377,15 +3424,15 @@ class Fi {
|
|
3377
3424
|
async _getAppCheckToken() {
|
3378
3425
|
var e;
|
3379
3426
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
3380
|
-
return t != null && t.error &&
|
3427
|
+
return t != null && t.error && ui(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
3381
3428
|
}
|
3382
3429
|
}
|
3383
3430
|
function ne(n) {
|
3384
|
-
return
|
3431
|
+
return F(n);
|
3385
3432
|
}
|
3386
|
-
class
|
3433
|
+
class St {
|
3387
3434
|
constructor(e) {
|
3388
|
-
this.auth = e, this.observer = null, this.addObserver =
|
3435
|
+
this.auth = e, this.observer = null, this.addObserver = Zn((t) => this.observer = t);
|
3389
3436
|
}
|
3390
3437
|
get next() {
|
3391
3438
|
return _(
|
@@ -3412,11 +3459,11 @@ class Ot {
|
|
3412
3459
|
* See the License for the specific language governing permissions and
|
3413
3460
|
* limitations under the License.
|
3414
3461
|
*/
|
3415
|
-
function
|
3462
|
+
function Bi() {
|
3416
3463
|
var n, e;
|
3417
3464
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
3418
3465
|
}
|
3419
|
-
function
|
3466
|
+
function yn(n) {
|
3420
3467
|
return new Promise((e, t) => {
|
3421
3468
|
const r = document.createElement("script");
|
3422
3469
|
r.setAttribute("src", n), r.onload = e, r.onerror = (i) => {
|
@@ -3425,13 +3472,13 @@ function bn(n) {
|
|
3425
3472
|
/* AuthErrorCode.INTERNAL_ERROR */
|
3426
3473
|
);
|
3427
3474
|
s.customData = i, t(s);
|
3428
|
-
}, r.type = "text/javascript", r.charset = "UTF-8",
|
3475
|
+
}, r.type = "text/javascript", r.charset = "UTF-8", Bi().appendChild(r);
|
3429
3476
|
});
|
3430
3477
|
}
|
3431
|
-
function
|
3478
|
+
function Hi(n) {
|
3432
3479
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
3433
3480
|
}
|
3434
|
-
const
|
3481
|
+
const Vi = "https://www.google.com/recaptcha/enterprise.js?render=", Wi = "recaptcha-enterprise", xi = "NO_RECAPTCHA";
|
3435
3482
|
class zi {
|
3436
3483
|
/**
|
3437
3484
|
*
|
@@ -3439,7 +3486,7 @@ class zi {
|
|
3439
3486
|
*
|
3440
3487
|
*/
|
3441
3488
|
constructor(e) {
|
3442
|
-
this.type =
|
3489
|
+
this.type = Wi, this.auth = ne(e);
|
3443
3490
|
}
|
3444
3491
|
/**
|
3445
3492
|
* Executes the verification process.
|
@@ -3455,7 +3502,7 @@ class zi {
|
|
3455
3502
|
return s._tenantRecaptchaConfigs[s.tenantId].siteKey;
|
3456
3503
|
}
|
3457
3504
|
return new Promise(async (o, c) => {
|
3458
|
-
|
3505
|
+
Ii(s, {
|
3459
3506
|
clientType: "CLIENT_TYPE_WEB",
|
3460
3507
|
version: "RECAPTCHA_ENTERPRISE"
|
3461
3508
|
/* RecaptchaVersion.ENTERPRISE */
|
@@ -3463,7 +3510,7 @@ class zi {
|
|
3463
3510
|
if (a.recaptchaKey === void 0)
|
3464
3511
|
c(new Error("recaptcha Enterprise site key undefined"));
|
3465
3512
|
else {
|
3466
|
-
const u = new
|
3513
|
+
const u = new vi(a);
|
3467
3514
|
return s.tenantId == null ? s._agentRecaptchaConfig = u : s._tenantRecaptchaConfigs[s.tenantId] = u, o(u.siteKey);
|
3468
3515
|
}
|
3469
3516
|
}).catch((a) => {
|
@@ -3473,24 +3520,24 @@ class zi {
|
|
3473
3520
|
}
|
3474
3521
|
function i(s, o, c) {
|
3475
3522
|
const a = window.grecaptcha;
|
3476
|
-
|
3523
|
+
wt(a) ? a.enterprise.ready(() => {
|
3477
3524
|
a.enterprise.execute(s, { action: e }).then((u) => {
|
3478
3525
|
o(u);
|
3479
3526
|
}).catch(() => {
|
3480
|
-
o(
|
3527
|
+
o(xi);
|
3481
3528
|
});
|
3482
3529
|
}) : c(Error("No reCAPTCHA enterprise script loaded."));
|
3483
3530
|
}
|
3484
3531
|
return new Promise((s, o) => {
|
3485
3532
|
r(this.auth).then((c) => {
|
3486
|
-
if (!t &&
|
3533
|
+
if (!t && wt(window.grecaptcha))
|
3487
3534
|
i(c, s, o);
|
3488
3535
|
else {
|
3489
3536
|
if (typeof window > "u") {
|
3490
3537
|
o(new Error("RecaptchaVerifier is only supported in browser"));
|
3491
3538
|
return;
|
3492
3539
|
}
|
3493
|
-
|
3540
|
+
yn(Vi + c).then(() => {
|
3494
3541
|
i(c, s, o);
|
3495
3542
|
}).catch((a) => {
|
3496
3543
|
o(a);
|
@@ -3502,7 +3549,7 @@ class zi {
|
|
3502
3549
|
});
|
3503
3550
|
}
|
3504
3551
|
}
|
3505
|
-
async function
|
3552
|
+
async function Ct(n, e, t, r = !1) {
|
3506
3553
|
const i = new zi(n);
|
3507
3554
|
let s;
|
3508
3555
|
try {
|
@@ -3519,6 +3566,36 @@ async function De(n, e, t, r = !1) {
|
|
3519
3566
|
/* RecaptchaVersion.ENTERPRISE */
|
3520
3567
|
}), o;
|
3521
3568
|
}
|
3569
|
+
async function _n(n, e, t, r) {
|
3570
|
+
var i;
|
3571
|
+
if (!((i = n._getRecaptchaConfig()) === null || i === void 0) && i.isProviderEnabled(
|
3572
|
+
"EMAIL_PASSWORD_PROVIDER"
|
3573
|
+
/* RecaptchaProvider.EMAIL_PASSWORD_PROVIDER */
|
3574
|
+
)) {
|
3575
|
+
const s = await Ct(
|
3576
|
+
n,
|
3577
|
+
e,
|
3578
|
+
t,
|
3579
|
+
t === "getOobCode"
|
3580
|
+
/* RecaptchaActionName.GET_OOB_CODE */
|
3581
|
+
);
|
3582
|
+
return r(n, s);
|
3583
|
+
} else
|
3584
|
+
return r(n, e).catch(async (s) => {
|
3585
|
+
if (s.code === "auth/missing-recaptcha-token") {
|
3586
|
+
console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);
|
3587
|
+
const o = await Ct(
|
3588
|
+
n,
|
3589
|
+
e,
|
3590
|
+
t,
|
3591
|
+
t === "getOobCode"
|
3592
|
+
/* RecaptchaActionName.GET_OOB_CODE */
|
3593
|
+
);
|
3594
|
+
return r(n, o);
|
3595
|
+
} else
|
3596
|
+
return Promise.reject(s);
|
3597
|
+
});
|
3598
|
+
}
|
3522
3599
|
/**
|
3523
3600
|
* @license
|
3524
3601
|
* Copyright 2020 Google LLC
|
@@ -3535,8 +3612,8 @@ async function De(n, e, t, r = !1) {
|
|
3535
3612
|
* See the License for the specific language governing permissions and
|
3536
3613
|
* limitations under the License.
|
3537
3614
|
*/
|
3538
|
-
function
|
3539
|
-
const t =
|
3615
|
+
function qi(n, e) {
|
3616
|
+
const t = Qt(n, "auth");
|
3540
3617
|
if (t.isInitialized()) {
|
3541
3618
|
const i = t.getImmediate(), s = t.getOptions();
|
3542
3619
|
if (Pe(s, e ?? {}))
|
@@ -3549,11 +3626,11 @@ function Ji(n, e) {
|
|
3549
3626
|
}
|
3550
3627
|
return t.initialize({ options: e });
|
3551
3628
|
}
|
3552
|
-
function
|
3629
|
+
function Ji(n, e) {
|
3553
3630
|
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(U);
|
3554
3631
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(r, e == null ? void 0 : e.popupRedirectResolver);
|
3555
3632
|
}
|
3556
|
-
function
|
3633
|
+
function Gi(n, e, t) {
|
3557
3634
|
const r = ne(n);
|
3558
3635
|
_(
|
3559
3636
|
r._canInitEmulator,
|
@@ -3566,38 +3643,38 @@ function Ki(n, e, t) {
|
|
3566
3643
|
"invalid-emulator-scheme"
|
3567
3644
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
3568
3645
|
);
|
3569
|
-
const i = !!(t != null && t.disableWarnings), s =
|
3646
|
+
const i = !!(t != null && t.disableWarnings), s = bn(e), { host: o, port: c } = Ki(e), a = c === null ? "" : `:${c}`;
|
3570
3647
|
r.config.emulator = { url: `${s}//${o}${a}/` }, r.settings.appVerificationDisabledForTesting = !0, r.emulatorConfig = Object.freeze({
|
3571
3648
|
host: o,
|
3572
3649
|
port: c,
|
3573
3650
|
protocol: s.replace(":", ""),
|
3574
3651
|
options: Object.freeze({ disableWarnings: i })
|
3575
|
-
}), i ||
|
3652
|
+
}), i || Yi();
|
3576
3653
|
}
|
3577
|
-
function
|
3654
|
+
function bn(n) {
|
3578
3655
|
const e = n.indexOf(":");
|
3579
3656
|
return e < 0 ? "" : n.substr(0, e + 1);
|
3580
3657
|
}
|
3581
|
-
function
|
3582
|
-
const e =
|
3658
|
+
function Ki(n) {
|
3659
|
+
const e = bn(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
3583
3660
|
if (!t)
|
3584
3661
|
return { host: "", port: null };
|
3585
3662
|
const r = t[2].split("@").pop() || "", i = /^(\[[^\]]+\])(:|$)/.exec(r);
|
3586
3663
|
if (i) {
|
3587
3664
|
const s = i[1];
|
3588
|
-
return { host: s, port:
|
3665
|
+
return { host: s, port: Rt(r.substr(s.length + 1)) };
|
3589
3666
|
} else {
|
3590
3667
|
const [s, o] = r.split(":");
|
3591
|
-
return { host: s, port:
|
3668
|
+
return { host: s, port: Rt(o) };
|
3592
3669
|
}
|
3593
3670
|
}
|
3594
|
-
function
|
3671
|
+
function Rt(n) {
|
3595
3672
|
if (!n)
|
3596
3673
|
return null;
|
3597
3674
|
const e = Number(n);
|
3598
3675
|
return isNaN(e) ? null : e;
|
3599
3676
|
}
|
3600
|
-
function
|
3677
|
+
function Yi() {
|
3601
3678
|
function n() {
|
3602
3679
|
const e = document.createElement("p"), t = e.style;
|
3603
3680
|
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);
|
@@ -3620,7 +3697,7 @@ function Qi() {
|
|
3620
3697
|
* See the License for the specific language governing permissions and
|
3621
3698
|
* limitations under the License.
|
3622
3699
|
*/
|
3623
|
-
class
|
3700
|
+
class ct {
|
3624
3701
|
/** @internal */
|
3625
3702
|
constructor(e, t) {
|
3626
3703
|
this.providerId = e, this.signInMethod = t;
|
@@ -3646,7 +3723,7 @@ class ht {
|
|
3646
3723
|
return M("not implemented");
|
3647
3724
|
}
|
3648
3725
|
}
|
3649
|
-
async function
|
3726
|
+
async function Qi(n, e) {
|
3650
3727
|
return K(n, "POST", "/v1/accounts:update", e);
|
3651
3728
|
}
|
3652
3729
|
/**
|
@@ -3665,13 +3742,13 @@ async function Xi(n, e) {
|
|
3665
3742
|
* See the License for the specific language governing permissions and
|
3666
3743
|
* limitations under the License.
|
3667
3744
|
*/
|
3668
|
-
async function
|
3669
|
-
return
|
3745
|
+
async function Xi(n, e) {
|
3746
|
+
return Ue(n, "POST", "/v1/accounts:signInWithPassword", te(n, e));
|
3670
3747
|
}
|
3671
3748
|
async function Zi(n, e) {
|
3672
3749
|
return K(n, "POST", "/v1/accounts:sendOobCode", te(n, e));
|
3673
3750
|
}
|
3674
|
-
async function
|
3751
|
+
async function es(n, e) {
|
3675
3752
|
return Zi(n, e);
|
3676
3753
|
}
|
3677
3754
|
/**
|
@@ -3690,11 +3767,11 @@ async function Ke(n, e) {
|
|
3690
3767
|
* See the License for the specific language governing permissions and
|
3691
3768
|
* limitations under the License.
|
3692
3769
|
*/
|
3693
|
-
async function es(n, e) {
|
3694
|
-
return je(n, "POST", "/v1/accounts:signInWithEmailLink", te(n, e));
|
3695
|
-
}
|
3696
3770
|
async function ts(n, e) {
|
3697
|
-
return
|
3771
|
+
return Ue(n, "POST", "/v1/accounts:signInWithEmailLink", te(n, e));
|
3772
|
+
}
|
3773
|
+
async function ns(n, e) {
|
3774
|
+
return Ue(n, "POST", "/v1/accounts:signInWithEmailLink", te(n, e));
|
3698
3775
|
}
|
3699
3776
|
/**
|
3700
3777
|
* @license
|
@@ -3712,7 +3789,7 @@ async function ts(n, e) {
|
|
3712
3789
|
* See the License for the specific language governing permissions and
|
3713
3790
|
* limitations under the License.
|
3714
3791
|
*/
|
3715
|
-
class ye extends
|
3792
|
+
class ye extends ct {
|
3716
3793
|
/** @internal */
|
3717
3794
|
constructor(e, t, r, i = null) {
|
3718
3795
|
super("password", r), this._email = e, this._password = t, this._tenantId = i;
|
@@ -3759,40 +3836,18 @@ class ye extends ht {
|
|
3759
3836
|
}
|
3760
3837
|
/** @internal */
|
3761
3838
|
async _getIdTokenResponse(e) {
|
3762
|
-
var t;
|
3763
3839
|
switch (this.signInMethod) {
|
3764
3840
|
case "password":
|
3765
|
-
const
|
3841
|
+
const t = {
|
3766
3842
|
returnSecureToken: !0,
|
3767
3843
|
email: this._email,
|
3768
3844
|
password: this._password,
|
3769
3845
|
clientType: "CLIENT_TYPE_WEB"
|
3770
3846
|
/* RecaptchaClientType.WEB */
|
3771
3847
|
};
|
3772
|
-
|
3773
|
-
const i = await De(
|
3774
|
-
e,
|
3775
|
-
r,
|
3776
|
-
"signInWithPassword"
|
3777
|
-
/* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */
|
3778
|
-
);
|
3779
|
-
return Ge(e, i);
|
3780
|
-
} else
|
3781
|
-
return Ge(e, r).catch(async (i) => {
|
3782
|
-
if (i.code === "auth/missing-recaptcha-token") {
|
3783
|
-
console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");
|
3784
|
-
const s = await De(
|
3785
|
-
e,
|
3786
|
-
r,
|
3787
|
-
"signInWithPassword"
|
3788
|
-
/* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */
|
3789
|
-
);
|
3790
|
-
return Ge(e, s);
|
3791
|
-
} else
|
3792
|
-
return Promise.reject(i);
|
3793
|
-
});
|
3848
|
+
return _n(e, t, "signInWithPassword", Xi);
|
3794
3849
|
case "emailLink":
|
3795
|
-
return
|
3850
|
+
return ts(e, {
|
3796
3851
|
email: this._email,
|
3797
3852
|
oobCode: this._password
|
3798
3853
|
});
|
@@ -3808,14 +3863,14 @@ class ye extends ht {
|
|
3808
3863
|
async _linkToIdToken(e, t) {
|
3809
3864
|
switch (this.signInMethod) {
|
3810
3865
|
case "password":
|
3811
|
-
return
|
3866
|
+
return Qi(e, {
|
3812
3867
|
idToken: t,
|
3813
3868
|
returnSecureToken: !0,
|
3814
3869
|
email: this._email,
|
3815
3870
|
password: this._password
|
3816
3871
|
});
|
3817
3872
|
case "emailLink":
|
3818
|
-
return
|
3873
|
+
return ns(e, {
|
3819
3874
|
idToken: t,
|
3820
3875
|
email: this._email,
|
3821
3876
|
oobCode: this._password
|
@@ -3850,7 +3905,7 @@ class ye extends ht {
|
|
3850
3905
|
* limitations under the License.
|
3851
3906
|
*/
|
3852
3907
|
async function oe(n, e) {
|
3853
|
-
return
|
3908
|
+
return Ue(n, "POST", "/v1/accounts:signInWithIdp", te(n, e));
|
3854
3909
|
}
|
3855
3910
|
/**
|
3856
3911
|
* @license
|
@@ -3868,8 +3923,8 @@ async function oe(n, e) {
|
|
3868
3923
|
* See the License for the specific language governing permissions and
|
3869
3924
|
* limitations under the License.
|
3870
3925
|
*/
|
3871
|
-
const
|
3872
|
-
class ee extends
|
3926
|
+
const rs = "http://localhost";
|
3927
|
+
class ee extends ct {
|
3873
3928
|
constructor() {
|
3874
3929
|
super(...arguments), this.pendingToken = null;
|
3875
3930
|
}
|
@@ -3903,7 +3958,7 @@ class ee extends ht {
|
|
3903
3958
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
3904
3959
|
*/
|
3905
3960
|
static fromJSON(e) {
|
3906
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s =
|
3961
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s = rt(t, ["providerId", "signInMethod"]);
|
3907
3962
|
if (!r || !i)
|
3908
3963
|
return null;
|
3909
3964
|
const o = new ee(r, i);
|
@@ -3926,14 +3981,14 @@ class ee extends ht {
|
|
3926
3981
|
}
|
3927
3982
|
buildRequest() {
|
3928
3983
|
const e = {
|
3929
|
-
requestUri:
|
3984
|
+
requestUri: rs,
|
3930
3985
|
returnSecureToken: !0
|
3931
3986
|
};
|
3932
3987
|
if (this.pendingToken)
|
3933
3988
|
e.pendingToken = this.pendingToken;
|
3934
3989
|
else {
|
3935
3990
|
const t = {};
|
3936
|
-
this.idToken && (t.id_token = this.idToken), this.accessToken && (t.access_token = this.accessToken), this.secret && (t.oauth_token_secret = this.secret), t.providerId = this.providerId, this.nonce && !this.pendingToken && (t.nonce = this.nonce), e.postBody =
|
3991
|
+
this.idToken && (t.id_token = this.idToken), this.accessToken && (t.access_token = this.accessToken), this.secret && (t.oauth_token_secret = this.secret), t.providerId = this.providerId, this.nonce && !this.pendingToken && (t.nonce = this.nonce), e.postBody = be(t);
|
3937
3992
|
}
|
3938
3993
|
return e;
|
3939
3994
|
}
|
@@ -3954,7 +4009,7 @@ class ee extends ht {
|
|
3954
4009
|
* See the License for the specific language governing permissions and
|
3955
4010
|
* limitations under the License.
|
3956
4011
|
*/
|
3957
|
-
function
|
4012
|
+
function is(n) {
|
3958
4013
|
switch (n) {
|
3959
4014
|
case "recoverEmail":
|
3960
4015
|
return "RECOVER_EMAIL";
|
@@ -3972,11 +4027,11 @@ function rs(n) {
|
|
3972
4027
|
return null;
|
3973
4028
|
}
|
3974
4029
|
}
|
3975
|
-
function
|
4030
|
+
function ss(n) {
|
3976
4031
|
const e = de(ue(n)).link, t = e ? de(ue(e)).deep_link_id : null, r = de(ue(n)).deep_link_id;
|
3977
4032
|
return (r ? de(ue(r)).link : null) || r || t || e || n;
|
3978
4033
|
}
|
3979
|
-
class
|
4034
|
+
class lt {
|
3980
4035
|
/**
|
3981
4036
|
* @param actionLink - The link from which to extract the URL.
|
3982
4037
|
* @returns The {@link ActionCodeURL} object, or null if the link is invalid.
|
@@ -3985,12 +4040,12 @@ class ft {
|
|
3985
4040
|
*/
|
3986
4041
|
constructor(e) {
|
3987
4042
|
var t, r, i, s, o, c;
|
3988
|
-
const a = de(ue(e)), u = (t = a.apiKey) !== null && t !== void 0 ? t : null, y = (r = a.oobCode) !== null && r !== void 0 ? r : null,
|
4043
|
+
const a = de(ue(e)), u = (t = a.apiKey) !== null && t !== void 0 ? t : null, y = (r = a.oobCode) !== null && r !== void 0 ? r : null, v = is((i = a.mode) !== null && i !== void 0 ? i : null);
|
3989
4044
|
_(
|
3990
|
-
u && y &&
|
4045
|
+
u && y && v,
|
3991
4046
|
"argument-error"
|
3992
4047
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
3993
|
-
), this.apiKey = u, this.operation =
|
4048
|
+
), this.apiKey = u, this.operation = v, this.code = y, this.continueUrl = (s = a.continueUrl) !== null && s !== void 0 ? s : null, this.languageCode = (o = a.languageCode) !== null && o !== void 0 ? o : null, this.tenantId = (c = a.tenantId) !== null && c !== void 0 ? c : null;
|
3994
4049
|
}
|
3995
4050
|
/**
|
3996
4051
|
* Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,
|
@@ -4002,9 +4057,9 @@ class ft {
|
|
4002
4057
|
* @public
|
4003
4058
|
*/
|
4004
4059
|
static parseLink(e) {
|
4005
|
-
const t =
|
4060
|
+
const t = ss(e);
|
4006
4061
|
try {
|
4007
|
-
return new
|
4062
|
+
return new lt(t);
|
4008
4063
|
} catch {
|
4009
4064
|
return null;
|
4010
4065
|
}
|
@@ -4074,7 +4129,7 @@ class le {
|
|
4074
4129
|
* @returns - The auth provider credential.
|
4075
4130
|
*/
|
4076
4131
|
static credentialWithLink(e, t) {
|
4077
|
-
const r =
|
4132
|
+
const r = lt.parseLink(t);
|
4078
4133
|
return _(
|
4079
4134
|
r,
|
4080
4135
|
"argument-error"
|
@@ -4101,7 +4156,7 @@ le.EMAIL_LINK_SIGN_IN_METHOD = "emailLink";
|
|
4101
4156
|
* See the License for the specific language governing permissions and
|
4102
4157
|
* limitations under the License.
|
4103
4158
|
*/
|
4104
|
-
class
|
4159
|
+
class vn {
|
4105
4160
|
/**
|
4106
4161
|
* Constructor for generic OAuth providers.
|
4107
4162
|
*
|
@@ -4154,7 +4209,7 @@ class wn {
|
|
4154
4209
|
* See the License for the specific language governing permissions and
|
4155
4210
|
* limitations under the License.
|
4156
4211
|
*/
|
4157
|
-
class we extends
|
4212
|
+
class we extends vn {
|
4158
4213
|
constructor() {
|
4159
4214
|
super(...arguments), this.scopes = [];
|
4160
4215
|
}
|
@@ -4400,7 +4455,7 @@ x.PROVIDER_ID = "github.com";
|
|
4400
4455
|
* See the License for the specific language governing permissions and
|
4401
4456
|
* limitations under the License.
|
4402
4457
|
*/
|
4403
|
-
class
|
4458
|
+
class z extends we {
|
4404
4459
|
constructor() {
|
4405
4460
|
super(
|
4406
4461
|
"twitter.com"
|
@@ -4415,8 +4470,8 @@ class q extends we {
|
|
4415
4470
|
*/
|
4416
4471
|
static credential(e, t) {
|
4417
4472
|
return ee._fromParams({
|
4418
|
-
providerId:
|
4419
|
-
signInMethod:
|
4473
|
+
providerId: z.PROVIDER_ID,
|
4474
|
+
signInMethod: z.TWITTER_SIGN_IN_METHOD,
|
4420
4475
|
oauthToken: e,
|
4421
4476
|
oauthTokenSecret: t
|
4422
4477
|
});
|
@@ -4427,7 +4482,7 @@ class q extends we {
|
|
4427
4482
|
* @param userCredential - The user credential.
|
4428
4483
|
*/
|
4429
4484
|
static credentialFromResult(e) {
|
4430
|
-
return
|
4485
|
+
return z.credentialFromTaggedObject(e);
|
4431
4486
|
}
|
4432
4487
|
/**
|
4433
4488
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
@@ -4436,7 +4491,7 @@ class q extends we {
|
|
4436
4491
|
* @param userCredential - The user credential.
|
4437
4492
|
*/
|
4438
4493
|
static credentialFromError(e) {
|
4439
|
-
return
|
4494
|
+
return z.credentialFromTaggedObject(e.customData || {});
|
4440
4495
|
}
|
4441
4496
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
4442
4497
|
if (!e)
|
@@ -4445,14 +4500,14 @@ class q extends we {
|
|
4445
4500
|
if (!t || !r)
|
4446
4501
|
return null;
|
4447
4502
|
try {
|
4448
|
-
return
|
4503
|
+
return z.credential(t, r);
|
4449
4504
|
} catch {
|
4450
4505
|
return null;
|
4451
4506
|
}
|
4452
4507
|
}
|
4453
4508
|
}
|
4454
|
-
|
4455
|
-
|
4509
|
+
z.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
4510
|
+
z.PROVIDER_ID = "twitter.com";
|
4456
4511
|
/**
|
4457
4512
|
* @license
|
4458
4513
|
* Copyright 2020 Google LLC
|
@@ -4474,7 +4529,7 @@ class ce {
|
|
4474
4529
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
4475
4530
|
}
|
4476
4531
|
static async _fromIdTokenResponse(e, t, r, i = !1) {
|
4477
|
-
const s = await X._fromIdTokenResponse(e, r, i), o =
|
4532
|
+
const s = await X._fromIdTokenResponse(e, r, i), o = Pt(r);
|
4478
4533
|
return new ce({
|
4479
4534
|
user: s,
|
4480
4535
|
providerId: o,
|
@@ -4488,7 +4543,7 @@ class ce {
|
|
4488
4543
|
/* reload */
|
4489
4544
|
!0
|
4490
4545
|
);
|
4491
|
-
const i =
|
4546
|
+
const i = Pt(r);
|
4492
4547
|
return new ce({
|
4493
4548
|
user: e,
|
4494
4549
|
providerId: i,
|
@@ -4497,7 +4552,7 @@ class ce {
|
|
4497
4552
|
});
|
4498
4553
|
}
|
4499
4554
|
}
|
4500
|
-
function
|
4555
|
+
function Pt(n) {
|
4501
4556
|
return n.providerId ? n.providerId : "phoneNumber" in n ? "phone" : null;
|
4502
4557
|
}
|
4503
4558
|
/**
|
@@ -4516,10 +4571,10 @@ function Nt(n) {
|
|
4516
4571
|
* See the License for the specific language governing permissions and
|
4517
4572
|
* limitations under the License.
|
4518
4573
|
*/
|
4519
|
-
class
|
4574
|
+
class De extends G {
|
4520
4575
|
constructor(e, t, r, i) {
|
4521
4576
|
var s;
|
4522
|
-
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this,
|
4577
|
+
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this, De.prototype), this.customData = {
|
4523
4578
|
appName: e.name,
|
4524
4579
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
4525
4580
|
_serverResponse: t.customData._serverResponse,
|
@@ -4527,15 +4582,15 @@ class Le extends G {
|
|
4527
4582
|
};
|
4528
4583
|
}
|
4529
4584
|
static _fromErrorAndOperation(e, t, r, i) {
|
4530
|
-
return new
|
4585
|
+
return new De(e, t, r, i);
|
4531
4586
|
}
|
4532
4587
|
}
|
4533
|
-
function
|
4588
|
+
function In(n, e, t, r) {
|
4534
4589
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
4535
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
4590
|
+
throw s.code === "auth/multi-factor-auth-required" ? De._fromErrorAndOperation(n, s, e, r) : s;
|
4536
4591
|
});
|
4537
4592
|
}
|
4538
|
-
async function
|
4593
|
+
async function os(n, e, t = !1) {
|
4539
4594
|
const r = await ge(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
4540
4595
|
return ce._forOperation(n, "link", r);
|
4541
4596
|
}
|
@@ -4555,17 +4610,17 @@ async function ss(n, e, t = !1) {
|
|
4555
4610
|
* See the License for the specific language governing permissions and
|
4556
4611
|
* limitations under the License.
|
4557
4612
|
*/
|
4558
|
-
async function
|
4613
|
+
async function as(n, e, t = !1) {
|
4559
4614
|
const { auth: r } = n, i = "reauthenticate";
|
4560
4615
|
try {
|
4561
|
-
const s = await ge(n,
|
4616
|
+
const s = await ge(n, In(r, i, e, n), t);
|
4562
4617
|
_(
|
4563
4618
|
s.idToken,
|
4564
4619
|
r,
|
4565
4620
|
"internal-error"
|
4566
4621
|
/* AuthErrorCode.INTERNAL_ERROR */
|
4567
4622
|
);
|
4568
|
-
const o =
|
4623
|
+
const o = ot(s.idToken);
|
4569
4624
|
_(
|
4570
4625
|
o,
|
4571
4626
|
r,
|
@@ -4603,12 +4658,12 @@ async function os(n, e, t = !1) {
|
|
4603
4658
|
* See the License for the specific language governing permissions and
|
4604
4659
|
* limitations under the License.
|
4605
4660
|
*/
|
4606
|
-
async function
|
4607
|
-
const r = "signIn", i = await
|
4661
|
+
async function wn(n, e, t = !1) {
|
4662
|
+
const r = "signIn", i = await In(n, r, e), s = await ce._fromIdTokenResponse(n, r, i);
|
4608
4663
|
return t || await n._updateCurrentUser(s.user), s;
|
4609
4664
|
}
|
4610
|
-
async function
|
4611
|
-
return
|
4665
|
+
async function cs(n, e) {
|
4666
|
+
return wn(ne(n), e);
|
4612
4667
|
}
|
4613
4668
|
/**
|
4614
4669
|
* @license
|
@@ -4626,7 +4681,7 @@ async function as(n, e) {
|
|
4626
4681
|
* See the License for the specific language governing permissions and
|
4627
4682
|
* limitations under the License.
|
4628
4683
|
*/
|
4629
|
-
function
|
4684
|
+
function ls(n, e, t) {
|
4630
4685
|
var r;
|
4631
4686
|
_(
|
4632
4687
|
((r = t.url) === null || r === void 0 ? void 0 : r.length) > 0,
|
@@ -4666,49 +4721,37 @@ function Ye(n, e, t) {
|
|
4666
4721
|
* See the License for the specific language governing permissions and
|
4667
4722
|
* limitations under the License.
|
4668
4723
|
*/
|
4669
|
-
async function
|
4724
|
+
async function ds(n) {
|
4670
4725
|
const e = ne(n);
|
4671
4726
|
e._getPasswordPolicyInternal() && await e._updatePasswordPolicy();
|
4672
4727
|
}
|
4673
|
-
async function
|
4674
|
-
|
4675
|
-
const i = ne(n), s = {
|
4728
|
+
async function us(n, e, t) {
|
4729
|
+
const r = ne(n), i = {
|
4676
4730
|
requestType: "PASSWORD_RESET",
|
4677
4731
|
email: e,
|
4678
4732
|
clientType: "CLIENT_TYPE_WEB"
|
4679
4733
|
/* RecaptchaClientType.WEB */
|
4680
4734
|
};
|
4681
|
-
|
4682
|
-
const o = await De(i, s, "getOobCode", !0);
|
4683
|
-
t && Ye(i, o, t), await Ke(i, o);
|
4684
|
-
} else
|
4685
|
-
t && Ye(i, s, t), await Ke(i, s).catch(async (o) => {
|
4686
|
-
if (o.code === "auth/missing-recaptcha-token") {
|
4687
|
-
console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");
|
4688
|
-
const c = await De(i, s, "getOobCode", !0);
|
4689
|
-
t && Ye(i, c, t), await Ke(i, c);
|
4690
|
-
} else
|
4691
|
-
return Promise.reject(o);
|
4692
|
-
});
|
4735
|
+
t && ls(r, i, t), await _n(r, i, "getOobCode", es);
|
4693
4736
|
}
|
4694
|
-
function
|
4695
|
-
return
|
4696
|
-
throw r.code === "auth/password-does-not-meet-requirements" &&
|
4737
|
+
function hs(n, e, t) {
|
4738
|
+
return cs(F(n), le.credential(e, t)).catch(async (r) => {
|
4739
|
+
throw r.code === "auth/password-does-not-meet-requirements" && ds(n), r;
|
4697
4740
|
});
|
4698
4741
|
}
|
4699
|
-
function
|
4700
|
-
return
|
4742
|
+
function fs(n, e, t, r) {
|
4743
|
+
return F(n).onIdTokenChanged(e, t, r);
|
4701
4744
|
}
|
4702
|
-
function
|
4703
|
-
return
|
4745
|
+
function ps(n, e, t) {
|
4746
|
+
return F(n).beforeAuthStateChanged(e, t);
|
4704
4747
|
}
|
4705
|
-
function
|
4706
|
-
return
|
4748
|
+
function gs(n, e, t, r) {
|
4749
|
+
return F(n).onAuthStateChanged(e, t, r);
|
4707
4750
|
}
|
4708
|
-
function
|
4709
|
-
return
|
4751
|
+
function ms(n) {
|
4752
|
+
return F(n).signOut();
|
4710
4753
|
}
|
4711
|
-
const
|
4754
|
+
const Le = "__sak";
|
4712
4755
|
/**
|
4713
4756
|
* @license
|
4714
4757
|
* Copyright 2019 Google LLC
|
@@ -4725,13 +4768,13 @@ const $e = "__sak";
|
|
4725
4768
|
* See the License for the specific language governing permissions and
|
4726
4769
|
* limitations under the License.
|
4727
4770
|
*/
|
4728
|
-
class
|
4771
|
+
class En {
|
4729
4772
|
constructor(e, t) {
|
4730
4773
|
this.storageRetriever = e, this.type = t;
|
4731
4774
|
}
|
4732
4775
|
_isAvailable() {
|
4733
4776
|
try {
|
4734
|
-
return this.storage ? (this.storage.setItem(
|
4777
|
+
return this.storage ? (this.storage.setItem(Le, "1"), this.storage.removeItem(Le), Promise.resolve(!0)) : Promise.resolve(!1);
|
4735
4778
|
} catch {
|
4736
4779
|
return Promise.resolve(!1);
|
4737
4780
|
}
|
@@ -4766,18 +4809,18 @@ class An {
|
|
4766
4809
|
* See the License for the specific language governing permissions and
|
4767
4810
|
* limitations under the License.
|
4768
4811
|
*/
|
4769
|
-
function
|
4812
|
+
function ys() {
|
4770
4813
|
const n = R();
|
4771
|
-
return
|
4814
|
+
return at(n) || je(n);
|
4772
4815
|
}
|
4773
|
-
const
|
4774
|
-
class
|
4816
|
+
const _s = 1e3, bs = 10;
|
4817
|
+
class Tn extends En {
|
4775
4818
|
constructor() {
|
4776
4819
|
super(
|
4777
4820
|
() => window.localStorage,
|
4778
4821
|
"LOCAL"
|
4779
4822
|
/* PersistenceType.LOCAL */
|
4780
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
4823
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = ys() && Li(), this.fallbackToPolling = gn(), this._shouldAllowMigration = !0;
|
4781
4824
|
}
|
4782
4825
|
forAllChangedKeys(e) {
|
4783
4826
|
for (const t of Object.keys(this.listeners)) {
|
@@ -4804,7 +4847,7 @@ class Sn extends An {
|
|
4804
4847
|
const o = this.storage.getItem(r);
|
4805
4848
|
!t && this.localCache[r] === o || this.notifyListeners(r, o);
|
4806
4849
|
}, s = this.storage.getItem(r);
|
4807
|
-
|
4850
|
+
Di() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(i, bs) : i();
|
4808
4851
|
}
|
4809
4852
|
notifyListeners(e, t) {
|
4810
4853
|
this.localCache[e] = t;
|
@@ -4826,7 +4869,7 @@ class Sn extends An {
|
|
4826
4869
|
!0
|
4827
4870
|
);
|
4828
4871
|
});
|
4829
|
-
},
|
4872
|
+
}, _s);
|
4830
4873
|
}
|
4831
4874
|
stopPolling() {
|
4832
4875
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
@@ -4855,8 +4898,8 @@ class Sn extends An {
|
|
4855
4898
|
await super._remove(e), delete this.localCache[e];
|
4856
4899
|
}
|
4857
4900
|
}
|
4858
|
-
|
4859
|
-
const
|
4901
|
+
Tn.type = "LOCAL";
|
4902
|
+
const vs = Tn;
|
4860
4903
|
/**
|
4861
4904
|
* @license
|
4862
4905
|
* Copyright 2020 Google LLC
|
@@ -4873,7 +4916,7 @@ const _s = Sn;
|
|
4873
4916
|
* See the License for the specific language governing permissions and
|
4874
4917
|
* limitations under the License.
|
4875
4918
|
*/
|
4876
|
-
class
|
4919
|
+
class An extends En {
|
4877
4920
|
constructor() {
|
4878
4921
|
super(
|
4879
4922
|
() => window.sessionStorage,
|
@@ -4886,8 +4929,8 @@ class Cn extends An {
|
|
4886
4929
|
_removeListener(e, t) {
|
4887
4930
|
}
|
4888
4931
|
}
|
4889
|
-
|
4890
|
-
const
|
4932
|
+
An.type = "SESSION";
|
4933
|
+
const Sn = An;
|
4891
4934
|
/**
|
4892
4935
|
* @license
|
4893
4936
|
* Copyright 2019 Google LLC
|
@@ -4904,7 +4947,7 @@ const Rn = Cn;
|
|
4904
4947
|
* See the License for the specific language governing permissions and
|
4905
4948
|
* limitations under the License.
|
4906
4949
|
*/
|
4907
|
-
function
|
4950
|
+
function Is(n) {
|
4908
4951
|
return Promise.all(n.map(async (e) => {
|
4909
4952
|
try {
|
4910
4953
|
return {
|
@@ -4974,7 +5017,7 @@ class Fe {
|
|
4974
5017
|
eventId: r,
|
4975
5018
|
eventType: i
|
4976
5019
|
});
|
4977
|
-
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await
|
5020
|
+
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await Is(c);
|
4978
5021
|
t.ports[0].postMessage({
|
4979
5022
|
status: "done",
|
4980
5023
|
eventId: r,
|
@@ -5020,7 +5063,7 @@ Fe.receivers = [];
|
|
5020
5063
|
* See the License for the specific language governing permissions and
|
5021
5064
|
* limitations under the License.
|
5022
5065
|
*/
|
5023
|
-
function
|
5066
|
+
function dt(n = "", e = 10) {
|
5024
5067
|
let t = "";
|
5025
5068
|
for (let r = 0; r < e; r++)
|
5026
5069
|
t += Math.floor(Math.random() * 10);
|
@@ -5042,7 +5085,7 @@ function pt(n = "", e = 10) {
|
|
5042
5085
|
* See the License for the specific language governing permissions and
|
5043
5086
|
* limitations under the License.
|
5044
5087
|
*/
|
5045
|
-
class
|
5088
|
+
class ws {
|
5046
5089
|
constructor(e) {
|
5047
5090
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
5048
5091
|
}
|
@@ -5076,7 +5119,7 @@ class bs {
|
|
5076
5119
|
);
|
5077
5120
|
let s, o;
|
5078
5121
|
return new Promise((c, a) => {
|
5079
|
-
const u =
|
5122
|
+
const u = dt("", 20);
|
5080
5123
|
i.port1.start();
|
5081
5124
|
const y = setTimeout(() => {
|
5082
5125
|
a(new Error(
|
@@ -5086,8 +5129,8 @@ class bs {
|
|
5086
5129
|
}, r);
|
5087
5130
|
o = {
|
5088
5131
|
messageChannel: i,
|
5089
|
-
onMessage(
|
5090
|
-
const A =
|
5132
|
+
onMessage(v) {
|
5133
|
+
const A = v;
|
5091
5134
|
if (A.data.eventId === u)
|
5092
5135
|
switch (A.data.status) {
|
5093
5136
|
case "ack":
|
@@ -5142,7 +5185,7 @@ class bs {
|
|
5142
5185
|
function $() {
|
5143
5186
|
return window;
|
5144
5187
|
}
|
5145
|
-
function
|
5188
|
+
function Es(n) {
|
5146
5189
|
$().location.href = n;
|
5147
5190
|
}
|
5148
5191
|
/**
|
@@ -5161,10 +5204,10 @@ function Is(n) {
|
|
5161
5204
|
* See the License for the specific language governing permissions and
|
5162
5205
|
* limitations under the License.
|
5163
5206
|
*/
|
5164
|
-
function
|
5207
|
+
function Cn() {
|
5165
5208
|
return typeof $().WorkerGlobalScope < "u" && typeof $().importScripts == "function";
|
5166
5209
|
}
|
5167
|
-
async function
|
5210
|
+
async function Ts() {
|
5168
5211
|
if (!(navigator != null && navigator.serviceWorker))
|
5169
5212
|
return null;
|
5170
5213
|
try {
|
@@ -5173,12 +5216,12 @@ async function ws() {
|
|
5173
5216
|
return null;
|
5174
5217
|
}
|
5175
5218
|
}
|
5176
|
-
function
|
5219
|
+
function As() {
|
5177
5220
|
var n;
|
5178
5221
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
5179
5222
|
}
|
5180
|
-
function
|
5181
|
-
return
|
5223
|
+
function Ss() {
|
5224
|
+
return Cn() ? self : null;
|
5182
5225
|
}
|
5183
5226
|
/**
|
5184
5227
|
* @license
|
@@ -5196,7 +5239,7 @@ function Ts() {
|
|
5196
5239
|
* See the License for the specific language governing permissions and
|
5197
5240
|
* limitations under the License.
|
5198
5241
|
*/
|
5199
|
-
const
|
5242
|
+
const Rn = "firebaseLocalStorageDb", Cs = 1, $e = "firebaseLocalStorage", Pn = "fbase_key";
|
5200
5243
|
class Ee {
|
5201
5244
|
constructor(e) {
|
5202
5245
|
this.request = e;
|
@@ -5211,55 +5254,55 @@ class Ee {
|
|
5211
5254
|
});
|
5212
5255
|
}
|
5213
5256
|
}
|
5214
|
-
function
|
5215
|
-
return n.transaction([
|
5257
|
+
function Be(n, e) {
|
5258
|
+
return n.transaction([$e], e ? "readwrite" : "readonly").objectStore($e);
|
5216
5259
|
}
|
5217
|
-
function
|
5218
|
-
const n = indexedDB.deleteDatabase(
|
5260
|
+
function Rs() {
|
5261
|
+
const n = indexedDB.deleteDatabase(Rn);
|
5219
5262
|
return new Ee(n).toPromise();
|
5220
5263
|
}
|
5221
|
-
function
|
5222
|
-
const n = indexedDB.open(
|
5264
|
+
function et() {
|
5265
|
+
const n = indexedDB.open(Rn, Cs);
|
5223
5266
|
return new Promise((e, t) => {
|
5224
5267
|
n.addEventListener("error", () => {
|
5225
5268
|
t(n.error);
|
5226
5269
|
}), n.addEventListener("upgradeneeded", () => {
|
5227
5270
|
const r = n.result;
|
5228
5271
|
try {
|
5229
|
-
r.createObjectStore(
|
5272
|
+
r.createObjectStore($e, { keyPath: Pn });
|
5230
5273
|
} catch (i) {
|
5231
5274
|
t(i);
|
5232
5275
|
}
|
5233
5276
|
}), n.addEventListener("success", async () => {
|
5234
5277
|
const r = n.result;
|
5235
|
-
r.objectStoreNames.contains(
|
5278
|
+
r.objectStoreNames.contains($e) ? e(r) : (r.close(), await Rs(), e(await et()));
|
5236
5279
|
});
|
5237
5280
|
});
|
5238
5281
|
}
|
5239
|
-
async function
|
5240
|
-
const r =
|
5241
|
-
[
|
5282
|
+
async function Ot(n, e, t) {
|
5283
|
+
const r = Be(n, !0).put({
|
5284
|
+
[Pn]: e,
|
5242
5285
|
value: t
|
5243
5286
|
});
|
5244
5287
|
return new Ee(r).toPromise();
|
5245
5288
|
}
|
5246
|
-
async function
|
5247
|
-
const t =
|
5289
|
+
async function Ps(n, e) {
|
5290
|
+
const t = Be(n, !1).get(e), r = await new Ee(t).toPromise();
|
5248
5291
|
return r === void 0 ? null : r.value;
|
5249
5292
|
}
|
5250
|
-
function
|
5251
|
-
const t =
|
5293
|
+
function kt(n, e) {
|
5294
|
+
const t = Be(n, !0).delete(e);
|
5252
5295
|
return new Ee(t).toPromise();
|
5253
5296
|
}
|
5254
|
-
const
|
5255
|
-
class
|
5297
|
+
const Os = 800, ks = 3;
|
5298
|
+
class On {
|
5256
5299
|
constructor() {
|
5257
5300
|
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(() => {
|
5258
5301
|
}, () => {
|
5259
5302
|
});
|
5260
5303
|
}
|
5261
5304
|
async _openDb() {
|
5262
|
-
return this.db ? this.db : (this.db = await
|
5305
|
+
return this.db ? this.db : (this.db = await et(), this.db);
|
5263
5306
|
}
|
5264
5307
|
async _withRetries(e) {
|
5265
5308
|
let t = 0;
|
@@ -5268,7 +5311,7 @@ class Nn {
|
|
5268
5311
|
const r = await this._openDb();
|
5269
5312
|
return await e(r);
|
5270
5313
|
} catch (r) {
|
5271
|
-
if (t++ >
|
5314
|
+
if (t++ > ks)
|
5272
5315
|
throw r;
|
5273
5316
|
this.db && (this.db.close(), this.db = void 0);
|
5274
5317
|
}
|
@@ -5278,13 +5321,13 @@ class Nn {
|
|
5278
5321
|
* postMessage interface to send these events to the worker ourselves.
|
5279
5322
|
*/
|
5280
5323
|
async initializeServiceWorkerMessaging() {
|
5281
|
-
return
|
5324
|
+
return Cn() ? this.initializeReceiver() : this.initializeSender();
|
5282
5325
|
}
|
5283
5326
|
/**
|
5284
5327
|
* As the worker we should listen to events from the main window.
|
5285
5328
|
*/
|
5286
5329
|
async initializeReceiver() {
|
5287
|
-
this.receiver = Fe._getInstance(
|
5330
|
+
this.receiver = Fe._getInstance(Ss()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
5288
5331
|
keyProcessed: (await this._poll()).includes(t.key)
|
5289
5332
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
5290
5333
|
"keyChanged"
|
@@ -5300,9 +5343,9 @@ class Nn {
|
|
5300
5343
|
*/
|
5301
5344
|
async initializeSender() {
|
5302
5345
|
var e, t;
|
5303
|
-
if (this.activeServiceWorker = await
|
5346
|
+
if (this.activeServiceWorker = await Ts(), !this.activeServiceWorker)
|
5304
5347
|
return;
|
5305
|
-
this.sender = new
|
5348
|
+
this.sender = new ws(this.activeServiceWorker);
|
5306
5349
|
const r = await this.sender._send(
|
5307
5350
|
"ping",
|
5308
5351
|
{},
|
@@ -5324,7 +5367,7 @@ class Nn {
|
|
5324
5367
|
* @param key - Storage key which changed.
|
5325
5368
|
*/
|
5326
5369
|
async notifyServiceWorker(e) {
|
5327
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
5370
|
+
if (!(!this.sender || !this.activeServiceWorker || As() !== this.activeServiceWorker))
|
5328
5371
|
try {
|
5329
5372
|
await this.sender._send(
|
5330
5373
|
"keyChanged",
|
@@ -5340,8 +5383,8 @@ class Nn {
|
|
5340
5383
|
try {
|
5341
5384
|
if (!indexedDB)
|
5342
5385
|
return !1;
|
5343
|
-
const e = await
|
5344
|
-
return await
|
5386
|
+
const e = await et();
|
5387
|
+
return await Ot(e, Le, "1"), await kt(e, Le), !0;
|
5345
5388
|
} catch {
|
5346
5389
|
}
|
5347
5390
|
return !1;
|
@@ -5355,18 +5398,18 @@ class Nn {
|
|
5355
5398
|
}
|
5356
5399
|
}
|
5357
5400
|
async _set(e, t) {
|
5358
|
-
return this._withPendingWrite(async () => (await this._withRetries((r) =>
|
5401
|
+
return this._withPendingWrite(async () => (await this._withRetries((r) => Ot(r, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
5359
5402
|
}
|
5360
5403
|
async _get(e) {
|
5361
|
-
const t = await this._withRetries((r) =>
|
5404
|
+
const t = await this._withRetries((r) => Ps(r, e));
|
5362
5405
|
return this.localCache[e] = t, t;
|
5363
5406
|
}
|
5364
5407
|
async _remove(e) {
|
5365
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
5408
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => kt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
5366
5409
|
}
|
5367
5410
|
async _poll() {
|
5368
5411
|
const e = await this._withRetries((i) => {
|
5369
|
-
const s =
|
5412
|
+
const s = Be(i, !1).getAll();
|
5370
5413
|
return new Ee(s).toPromise();
|
5371
5414
|
});
|
5372
5415
|
if (!e)
|
@@ -5388,7 +5431,7 @@ class Nn {
|
|
5388
5431
|
i(t);
|
5389
5432
|
}
|
5390
5433
|
startPolling() {
|
5391
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
5434
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Os);
|
5392
5435
|
}
|
5393
5436
|
stopPolling() {
|
5394
5437
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
@@ -5400,8 +5443,8 @@ class Nn {
|
|
5400
5443
|
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();
|
5401
5444
|
}
|
5402
5445
|
}
|
5403
|
-
|
5404
|
-
const
|
5446
|
+
On.type = "LOCAL";
|
5447
|
+
const Ns = On;
|
5405
5448
|
new Ie(3e4, 6e4);
|
5406
5449
|
/**
|
5407
5450
|
* @license
|
@@ -5419,7 +5462,7 @@ new Ie(3e4, 6e4);
|
|
5419
5462
|
* See the License for the specific language governing permissions and
|
5420
5463
|
* limitations under the License.
|
5421
5464
|
*/
|
5422
|
-
function
|
5465
|
+
function Ds(n, e) {
|
5423
5466
|
return e ? U(e) : (_(
|
5424
5467
|
n._popupRedirectResolver,
|
5425
5468
|
n,
|
@@ -5443,7 +5486,7 @@ function ks(n, e) {
|
|
5443
5486
|
* See the License for the specific language governing permissions and
|
5444
5487
|
* limitations under the License.
|
5445
5488
|
*/
|
5446
|
-
class
|
5489
|
+
class ut extends ct {
|
5447
5490
|
constructor(e) {
|
5448
5491
|
super(
|
5449
5492
|
"custom",
|
@@ -5473,26 +5516,26 @@ class gt extends ht {
|
|
5473
5516
|
return e && (t.idToken = e), t;
|
5474
5517
|
}
|
5475
5518
|
}
|
5476
|
-
function
|
5477
|
-
return
|
5519
|
+
function Ls(n) {
|
5520
|
+
return wn(n.auth, new ut(n), n.bypassAuthState);
|
5478
5521
|
}
|
5479
|
-
function
|
5522
|
+
function $s(n) {
|
5480
5523
|
const { auth: e, user: t } = n;
|
5481
5524
|
return _(
|
5482
5525
|
t,
|
5483
5526
|
e,
|
5484
5527
|
"internal-error"
|
5485
5528
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5486
|
-
),
|
5529
|
+
), as(t, new ut(n), n.bypassAuthState);
|
5487
5530
|
}
|
5488
|
-
async function
|
5531
|
+
async function Ms(n) {
|
5489
5532
|
const { auth: e, user: t } = n;
|
5490
5533
|
return _(
|
5491
5534
|
t,
|
5492
5535
|
e,
|
5493
5536
|
"internal-error"
|
5494
5537
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5495
|
-
),
|
5538
|
+
), os(t, new ut(n), n.bypassAuthState);
|
5496
5539
|
}
|
5497
5540
|
/**
|
5498
5541
|
* @license
|
@@ -5510,7 +5553,7 @@ async function Ls(n) {
|
|
5510
5553
|
* See the License for the specific language governing permissions and
|
5511
5554
|
* limitations under the License.
|
5512
5555
|
*/
|
5513
|
-
class
|
5556
|
+
class kn {
|
5514
5557
|
constructor(e, t, r, i, s = !1) {
|
5515
5558
|
this.auth = e, this.resolver = r, this.user = i, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
5516
5559
|
}
|
@@ -5552,13 +5595,13 @@ class Dn {
|
|
5552
5595
|
switch (e) {
|
5553
5596
|
case "signInViaPopup":
|
5554
5597
|
case "signInViaRedirect":
|
5555
|
-
return
|
5598
|
+
return Ls;
|
5556
5599
|
case "linkViaPopup":
|
5557
5600
|
case "linkViaRedirect":
|
5558
|
-
return
|
5601
|
+
return Ms;
|
5559
5602
|
case "reauthViaPopup":
|
5560
5603
|
case "reauthViaRedirect":
|
5561
|
-
return
|
5604
|
+
return $s;
|
5562
5605
|
default:
|
5563
5606
|
N(
|
5564
5607
|
this.auth,
|
@@ -5593,8 +5636,8 @@ class Dn {
|
|
5593
5636
|
* See the License for the specific language governing permissions and
|
5594
5637
|
* limitations under the License.
|
5595
5638
|
*/
|
5596
|
-
const
|
5597
|
-
class re extends
|
5639
|
+
const Us = new Ie(2e3, 1e4);
|
5640
|
+
class re extends kn {
|
5598
5641
|
constructor(e, t, r, i, s) {
|
5599
5642
|
super(e, t, i, s), this.provider = r, this.authWindow = null, this.pollId = null, re.currentPopupAction && re.currentPopupAction.cancel(), re.currentPopupAction = this;
|
5600
5643
|
}
|
@@ -5609,7 +5652,7 @@ class re extends Dn {
|
|
5609
5652
|
}
|
5610
5653
|
async onExecution() {
|
5611
5654
|
j(this.filter.length === 1, "Popup operations only handle one event");
|
5612
|
-
const e =
|
5655
|
+
const e = dt();
|
5613
5656
|
this.authWindow = await this.resolver._openPopup(
|
5614
5657
|
this.auth,
|
5615
5658
|
this.provider,
|
@@ -5657,7 +5700,7 @@ class re extends Dn {
|
|
5657
5700
|
);
|
5658
5701
|
return;
|
5659
5702
|
}
|
5660
|
-
this.pollId = window.setTimeout(e,
|
5703
|
+
this.pollId = window.setTimeout(e, Us.get());
|
5661
5704
|
};
|
5662
5705
|
e();
|
5663
5706
|
}
|
@@ -5679,8 +5722,8 @@ re.currentPopupAction = null;
|
|
5679
5722
|
* See the License for the specific language governing permissions and
|
5680
5723
|
* limitations under the License.
|
5681
5724
|
*/
|
5682
|
-
const
|
5683
|
-
class
|
5725
|
+
const js = "pendingRedirect", Ce = /* @__PURE__ */ new Map();
|
5726
|
+
class Fs extends kn {
|
5684
5727
|
constructor(e, t, r = !1) {
|
5685
5728
|
super(e, [
|
5686
5729
|
"signInViaRedirect",
|
@@ -5698,7 +5741,7 @@ class Us extends Dn {
|
|
5698
5741
|
let e = Ce.get(this.auth._key());
|
5699
5742
|
if (!e) {
|
5700
5743
|
try {
|
5701
|
-
const r = await
|
5744
|
+
const r = await Bs(this.resolver, this.auth) ? await super.execute() : null;
|
5702
5745
|
e = () => Promise.resolve(r);
|
5703
5746
|
} catch (t) {
|
5704
5747
|
e = () => Promise.reject(t);
|
@@ -5726,24 +5769,24 @@ class Us extends Dn {
|
|
5726
5769
|
cleanUp() {
|
5727
5770
|
}
|
5728
5771
|
}
|
5729
|
-
async function
|
5730
|
-
const t =
|
5772
|
+
async function Bs(n, e) {
|
5773
|
+
const t = Ws(e), r = Vs(n);
|
5731
5774
|
if (!await r._isAvailable())
|
5732
5775
|
return !1;
|
5733
5776
|
const i = await r._get(t) === "true";
|
5734
5777
|
return await r._remove(t), i;
|
5735
5778
|
}
|
5736
|
-
function
|
5779
|
+
function Hs(n, e) {
|
5737
5780
|
Ce.set(n._key(), e);
|
5738
5781
|
}
|
5739
|
-
function
|
5782
|
+
function Vs(n) {
|
5740
5783
|
return U(n._redirectPersistence);
|
5741
5784
|
}
|
5742
|
-
function
|
5743
|
-
return Se(
|
5785
|
+
function Ws(n) {
|
5786
|
+
return Se(js, n.config.apiKey, n.name);
|
5744
5787
|
}
|
5745
|
-
async function
|
5746
|
-
const r = ne(n), i =
|
5788
|
+
async function xs(n, e, t = !1) {
|
5789
|
+
const r = ne(n), i = Ds(r, e), o = await new Fs(r, i, t).execute();
|
5747
5790
|
return o && !t && (delete o.user._redirectEventId, await r._persistUserIfCurrent(o.user), await r._setRedirectUser(null, e)), o;
|
5748
5791
|
}
|
5749
5792
|
/**
|
@@ -5762,8 +5805,8 @@ async function Vs(n, e, t = !1) {
|
|
5762
5805
|
* See the License for the specific language governing permissions and
|
5763
5806
|
* limitations under the License.
|
5764
5807
|
*/
|
5765
|
-
const
|
5766
|
-
class
|
5808
|
+
const zs = 10 * 60 * 1e3;
|
5809
|
+
class qs {
|
5767
5810
|
constructor(e) {
|
5768
5811
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
5769
5812
|
}
|
@@ -5779,11 +5822,11 @@ class xs {
|
|
5779
5822
|
let t = !1;
|
5780
5823
|
return this.consumers.forEach((r) => {
|
5781
5824
|
this.isEventForConsumer(e, r) && (t = !0, this.sendToConsumer(e, r), this.saveEventToCache(e));
|
5782
|
-
}), this.hasHandledPotentialRedirect || !
|
5825
|
+
}), this.hasHandledPotentialRedirect || !Js(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
5783
5826
|
}
|
5784
5827
|
sendToConsumer(e, t) {
|
5785
5828
|
var r;
|
5786
|
-
if (e.error && !
|
5829
|
+
if (e.error && !Nn(e)) {
|
5787
5830
|
const i = ((r = e.error.code) === null || r === void 0 ? void 0 : r.split("auth/")[1]) || "internal-error";
|
5788
5831
|
t.onError(L(this.auth, i));
|
5789
5832
|
} else
|
@@ -5794,26 +5837,26 @@ class xs {
|
|
5794
5837
|
return t.filter.includes(e.type) && r;
|
5795
5838
|
}
|
5796
5839
|
hasEventBeenHandled(e) {
|
5797
|
-
return Date.now() - this.lastProcessedEventTime >=
|
5840
|
+
return Date.now() - this.lastProcessedEventTime >= zs && this.cachedEventUids.clear(), this.cachedEventUids.has(Nt(e));
|
5798
5841
|
}
|
5799
5842
|
saveEventToCache(e) {
|
5800
|
-
this.cachedEventUids.add(
|
5843
|
+
this.cachedEventUids.add(Nt(e)), this.lastProcessedEventTime = Date.now();
|
5801
5844
|
}
|
5802
5845
|
}
|
5803
|
-
function
|
5846
|
+
function Nt(n) {
|
5804
5847
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
5805
5848
|
}
|
5806
|
-
function
|
5849
|
+
function Nn({ type: n, error: e }) {
|
5807
5850
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
5808
5851
|
}
|
5809
|
-
function
|
5852
|
+
function Js(n) {
|
5810
5853
|
switch (n.type) {
|
5811
5854
|
case "signInViaRedirect":
|
5812
5855
|
case "linkViaRedirect":
|
5813
5856
|
case "reauthViaRedirect":
|
5814
5857
|
return !0;
|
5815
5858
|
case "unknown":
|
5816
|
-
return
|
5859
|
+
return Nn(n);
|
5817
5860
|
default:
|
5818
5861
|
return !1;
|
5819
5862
|
}
|
@@ -5834,7 +5877,7 @@ function qs(n) {
|
|
5834
5877
|
* See the License for the specific language governing permissions and
|
5835
5878
|
* limitations under the License.
|
5836
5879
|
*/
|
5837
|
-
async function
|
5880
|
+
async function Gs(n, e = {}) {
|
5838
5881
|
return K(n, "GET", "/v1/projects", e);
|
5839
5882
|
}
|
5840
5883
|
/**
|
@@ -5853,14 +5896,14 @@ async function zs(n, e = {}) {
|
|
5853
5896
|
* See the License for the specific language governing permissions and
|
5854
5897
|
* limitations under the License.
|
5855
5898
|
*/
|
5856
|
-
const
|
5857
|
-
async function
|
5899
|
+
const Ks = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Ys = /^https?/;
|
5900
|
+
async function Qs(n) {
|
5858
5901
|
if (n.config.emulator)
|
5859
5902
|
return;
|
5860
|
-
const { authorizedDomains: e } = await
|
5903
|
+
const { authorizedDomains: e } = await Gs(n);
|
5861
5904
|
for (const t of e)
|
5862
5905
|
try {
|
5863
|
-
if (
|
5906
|
+
if (Xs(t))
|
5864
5907
|
return;
|
5865
5908
|
} catch {
|
5866
5909
|
}
|
@@ -5870,15 +5913,15 @@ async function Ks(n) {
|
|
5870
5913
|
/* AuthErrorCode.INVALID_ORIGIN */
|
5871
5914
|
);
|
5872
5915
|
}
|
5873
|
-
function
|
5874
|
-
const e =
|
5916
|
+
function Xs(n) {
|
5917
|
+
const e = Ze(), { protocol: t, hostname: r } = new URL(e);
|
5875
5918
|
if (n.startsWith("chrome-extension://")) {
|
5876
5919
|
const o = new URL(n);
|
5877
5920
|
return o.hostname === "" && r === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === r;
|
5878
5921
|
}
|
5879
|
-
if (!
|
5922
|
+
if (!Ys.test(t))
|
5880
5923
|
return !1;
|
5881
|
-
if (
|
5924
|
+
if (Ks.test(n))
|
5882
5925
|
return r === n;
|
5883
5926
|
const i = n.replace(/\./g, "\\.");
|
5884
5927
|
return new RegExp("^(.+\\." + i + "|" + i + ")$", "i").test(r);
|
@@ -5899,8 +5942,8 @@ function Ys(n) {
|
|
5899
5942
|
* See the License for the specific language governing permissions and
|
5900
5943
|
* limitations under the License.
|
5901
5944
|
*/
|
5902
|
-
const
|
5903
|
-
function
|
5945
|
+
const Zs = new Ie(3e4, 6e4);
|
5946
|
+
function Dt() {
|
5904
5947
|
const n = $().___jsl;
|
5905
5948
|
if (n != null && n.H) {
|
5906
5949
|
for (const e of Object.keys(n.H))
|
@@ -5909,22 +5952,22 @@ function Mt() {
|
|
5909
5952
|
n.CP[t] = null;
|
5910
5953
|
}
|
5911
5954
|
}
|
5912
|
-
function
|
5955
|
+
function eo(n) {
|
5913
5956
|
return new Promise((e, t) => {
|
5914
5957
|
var r, i, s;
|
5915
5958
|
function o() {
|
5916
|
-
|
5959
|
+
Dt(), gapi.load("gapi.iframes", {
|
5917
5960
|
callback: () => {
|
5918
5961
|
e(gapi.iframes.getContext());
|
5919
5962
|
},
|
5920
5963
|
ontimeout: () => {
|
5921
|
-
|
5964
|
+
Dt(), t(L(
|
5922
5965
|
n,
|
5923
5966
|
"network-request-failed"
|
5924
5967
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
5925
5968
|
));
|
5926
5969
|
},
|
5927
|
-
timeout:
|
5970
|
+
timeout: Zs.get()
|
5928
5971
|
});
|
5929
5972
|
}
|
5930
5973
|
if (!((i = (r = $().gapi) === null || r === void 0 ? void 0 : r.iframes) === null || i === void 0) && i.Iframe)
|
@@ -5932,22 +5975,22 @@ function Xs(n) {
|
|
5932
5975
|
else if (!((s = $().gapi) === null || s === void 0) && s.load)
|
5933
5976
|
o();
|
5934
5977
|
else {
|
5935
|
-
const c =
|
5978
|
+
const c = Hi("iframefcb");
|
5936
5979
|
return $()[c] = () => {
|
5937
5980
|
gapi.load ? o() : t(L(
|
5938
5981
|
n,
|
5939
5982
|
"network-request-failed"
|
5940
5983
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
5941
5984
|
));
|
5942
|
-
},
|
5985
|
+
}, yn(`https://apis.google.com/js/api.js?onload=${c}`).catch((a) => t(a));
|
5943
5986
|
}
|
5944
5987
|
}).catch((e) => {
|
5945
5988
|
throw Re = null, e;
|
5946
5989
|
});
|
5947
5990
|
}
|
5948
5991
|
let Re = null;
|
5949
|
-
function
|
5950
|
-
return Re = Re ||
|
5992
|
+
function to(n) {
|
5993
|
+
return Re = Re || eo(n), Re;
|
5951
5994
|
}
|
5952
5995
|
/**
|
5953
5996
|
* @license
|
@@ -5965,7 +6008,7 @@ function Zs(n) {
|
|
5965
6008
|
* See the License for the specific language governing permissions and
|
5966
6009
|
* limitations under the License.
|
5967
6010
|
*/
|
5968
|
-
const
|
6011
|
+
const no = new Ie(5e3, 15e3), ro = "__/auth/iframe", io = "emulator/auth/iframe", so = {
|
5969
6012
|
style: {
|
5970
6013
|
position: "absolute",
|
5971
6014
|
top: "-100px",
|
@@ -5974,13 +6017,13 @@ const eo = new Ie(5e3, 15e3), to = "__/auth/iframe", no = "emulator/auth/iframe"
|
|
5974
6017
|
},
|
5975
6018
|
"aria-hidden": "true",
|
5976
6019
|
tabindex: "-1"
|
5977
|
-
},
|
6020
|
+
}, oo = /* @__PURE__ */ new Map([
|
5978
6021
|
["identitytoolkit.googleapis.com", "p"],
|
5979
6022
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
5980
6023
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
5981
6024
|
// test
|
5982
6025
|
]);
|
5983
|
-
function
|
6026
|
+
function ao(n) {
|
5984
6027
|
const e = n.config;
|
5985
6028
|
_(
|
5986
6029
|
e.authDomain,
|
@@ -5988,17 +6031,17 @@ function so(n) {
|
|
5988
6031
|
"auth-domain-config-required"
|
5989
6032
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
5990
6033
|
);
|
5991
|
-
const t = e.emulator ?
|
6034
|
+
const t = e.emulator ? st(e, io) : `https://${n.config.authDomain}/${ro}`, r = {
|
5992
6035
|
apiKey: e.apiKey,
|
5993
6036
|
appName: n.name,
|
5994
|
-
v:
|
5995
|
-
}, i =
|
6037
|
+
v: ve
|
6038
|
+
}, i = oo.get(n.config.apiHost);
|
5996
6039
|
i && (r.eid = i);
|
5997
6040
|
const s = n._getFrameworks();
|
5998
|
-
return s.length && (r.fw = s.join(",")), `${t}?${
|
6041
|
+
return s.length && (r.fw = s.join(",")), `${t}?${be(r).slice(1)}`;
|
5999
6042
|
}
|
6000
|
-
async function
|
6001
|
-
const e = await
|
6043
|
+
async function co(n) {
|
6044
|
+
const e = await to(n), t = $().gapi;
|
6002
6045
|
return _(
|
6003
6046
|
t,
|
6004
6047
|
n,
|
@@ -6006,9 +6049,9 @@ async function oo(n) {
|
|
6006
6049
|
/* AuthErrorCode.INTERNAL_ERROR */
|
6007
6050
|
), e.open({
|
6008
6051
|
where: document.body,
|
6009
|
-
url:
|
6052
|
+
url: ao(n),
|
6010
6053
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
6011
|
-
attributes:
|
6054
|
+
attributes: so,
|
6012
6055
|
dontclear: !0
|
6013
6056
|
}, (r) => new Promise(async (i, s) => {
|
6014
6057
|
await r.restyle({
|
@@ -6021,7 +6064,7 @@ async function oo(n) {
|
|
6021
6064
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
6022
6065
|
), c = $().setTimeout(() => {
|
6023
6066
|
s(o);
|
6024
|
-
},
|
6067
|
+
}, no.get());
|
6025
6068
|
function a() {
|
6026
6069
|
$().clearTimeout(c), i(r);
|
6027
6070
|
}
|
@@ -6046,13 +6089,13 @@ async function oo(n) {
|
|
6046
6089
|
* See the License for the specific language governing permissions and
|
6047
6090
|
* limitations under the License.
|
6048
6091
|
*/
|
6049
|
-
const
|
6092
|
+
const lo = {
|
6050
6093
|
location: "yes",
|
6051
6094
|
resizable: "yes",
|
6052
6095
|
statusbar: "yes",
|
6053
6096
|
toolbar: "no"
|
6054
|
-
},
|
6055
|
-
class
|
6097
|
+
}, uo = 500, ho = 600, fo = "_blank", po = "http://localhost";
|
6098
|
+
class Lt {
|
6056
6099
|
constructor(e) {
|
6057
6100
|
this.window = e, this.associatedEvent = null;
|
6058
6101
|
}
|
@@ -6064,33 +6107,33 @@ class Ut {
|
|
6064
6107
|
}
|
6065
6108
|
}
|
6066
6109
|
}
|
6067
|
-
function
|
6110
|
+
function go(n, e, t, r = uo, i = ho) {
|
6068
6111
|
const s = Math.max((window.screen.availHeight - i) / 2, 0).toString(), o = Math.max((window.screen.availWidth - r) / 2, 0).toString();
|
6069
6112
|
let c = "";
|
6070
|
-
const a = Object.assign(Object.assign({},
|
6113
|
+
const a = Object.assign(Object.assign({}, lo), {
|
6071
6114
|
width: r.toString(),
|
6072
6115
|
height: i.toString(),
|
6073
6116
|
top: s,
|
6074
6117
|
left: o
|
6075
6118
|
}), u = R().toLowerCase();
|
6076
|
-
t && (c =
|
6119
|
+
t && (c = dn(u) ? fo : t), ln(u) && (e = e || po, a.scrollbars = "yes");
|
6077
6120
|
const y = Object.entries(a).reduce((A, [P, k]) => `${A}${P}=${k},`, "");
|
6078
|
-
if (
|
6079
|
-
return
|
6080
|
-
const
|
6121
|
+
if (Ni(u) && c !== "_self")
|
6122
|
+
return mo(e || "", c), new Lt(null);
|
6123
|
+
const v = window.open(e || "", c, y);
|
6081
6124
|
_(
|
6082
|
-
|
6125
|
+
v,
|
6083
6126
|
n,
|
6084
6127
|
"popup-blocked"
|
6085
6128
|
/* AuthErrorCode.POPUP_BLOCKED */
|
6086
6129
|
);
|
6087
6130
|
try {
|
6088
|
-
|
6131
|
+
v.focus();
|
6089
6132
|
} catch {
|
6090
6133
|
}
|
6091
|
-
return new
|
6134
|
+
return new Lt(v);
|
6092
6135
|
}
|
6093
|
-
function
|
6136
|
+
function mo(n, e) {
|
6094
6137
|
const t = document.createElement("a");
|
6095
6138
|
t.href = n, t.target = e;
|
6096
6139
|
const r = document.createEvent("MouseEvent");
|
@@ -6112,8 +6155,8 @@ function po(n, e) {
|
|
6112
6155
|
* See the License for the specific language governing permissions and
|
6113
6156
|
* limitations under the License.
|
6114
6157
|
*/
|
6115
|
-
const
|
6116
|
-
async function
|
6158
|
+
const yo = "__/auth/handler", _o = "emulator/auth/handler", bo = encodeURIComponent("fac");
|
6159
|
+
async function $t(n, e, t, r, i, s) {
|
6117
6160
|
_(
|
6118
6161
|
n.config.authDomain,
|
6119
6162
|
n,
|
@@ -6130,27 +6173,27 @@ async function jt(n, e, t, r, i, s) {
|
|
6130
6173
|
appName: n.name,
|
6131
6174
|
authType: t,
|
6132
6175
|
redirectUrl: r,
|
6133
|
-
v:
|
6176
|
+
v: ve,
|
6134
6177
|
eventId: i
|
6135
6178
|
};
|
6136
|
-
if (e instanceof
|
6137
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
6138
|
-
for (const [y,
|
6139
|
-
o[y] =
|
6179
|
+
if (e instanceof vn) {
|
6180
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", Xn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
6181
|
+
for (const [y, v] of Object.entries(s || {}))
|
6182
|
+
o[y] = v;
|
6140
6183
|
}
|
6141
6184
|
if (e instanceof we) {
|
6142
|
-
const y = e.getScopes().filter((
|
6185
|
+
const y = e.getScopes().filter((v) => v !== "");
|
6143
6186
|
y.length > 0 && (o.scopes = y.join(","));
|
6144
6187
|
}
|
6145
6188
|
n.tenantId && (o.tid = n.tenantId);
|
6146
6189
|
const c = o;
|
6147
6190
|
for (const y of Object.keys(c))
|
6148
6191
|
c[y] === void 0 && delete c[y];
|
6149
|
-
const a = await n._getAppCheckToken(), u = a ? `#${
|
6150
|
-
return `${
|
6192
|
+
const a = await n._getAppCheckToken(), u = a ? `#${bo}=${encodeURIComponent(a)}` : "";
|
6193
|
+
return `${vo(n)}?${be(c).slice(1)}${u}`;
|
6151
6194
|
}
|
6152
|
-
function
|
6153
|
-
return n.emulator ?
|
6195
|
+
function vo({ config: n }) {
|
6196
|
+
return n.emulator ? st(n, _o) : `https://${n.authDomain}/${yo}`;
|
6154
6197
|
}
|
6155
6198
|
/**
|
6156
6199
|
* @license
|
@@ -6168,23 +6211,23 @@ function _o({ config: n }) {
|
|
6168
6211
|
* See the License for the specific language governing permissions and
|
6169
6212
|
* limitations under the License.
|
6170
6213
|
*/
|
6171
|
-
const
|
6172
|
-
class
|
6214
|
+
const Je = "webStorageSupport";
|
6215
|
+
class Io {
|
6173
6216
|
constructor() {
|
6174
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
6217
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Sn, this._completeRedirectFn = xs, this._overrideRedirectResult = Hs;
|
6175
6218
|
}
|
6176
6219
|
// Wrapping in async even though we don't await anywhere in order
|
6177
6220
|
// to make sure errors are raised as promise rejections
|
6178
6221
|
async _openPopup(e, t, r, i) {
|
6179
6222
|
var s;
|
6180
6223
|
j((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
6181
|
-
const o = await
|
6182
|
-
return
|
6224
|
+
const o = await $t(e, t, r, Ze(), i);
|
6225
|
+
return go(e, o, dt());
|
6183
6226
|
}
|
6184
6227
|
async _openRedirect(e, t, r, i) {
|
6185
6228
|
await this._originValidation(e);
|
6186
|
-
const s = await
|
6187
|
-
return
|
6229
|
+
const s = await $t(e, t, r, Ze(), i);
|
6230
|
+
return Es(s), new Promise(() => {
|
6188
6231
|
});
|
6189
6232
|
}
|
6190
6233
|
_initialize(e) {
|
@@ -6199,7 +6242,7 @@ class vo {
|
|
6199
6242
|
}), r;
|
6200
6243
|
}
|
6201
6244
|
async initAndGetManager(e) {
|
6202
|
-
const t = await
|
6245
|
+
const t = await co(e), r = new qs(e);
|
6203
6246
|
return t.register("authEvent", (i) => (_(
|
6204
6247
|
i == null ? void 0 : i.authEvent,
|
6205
6248
|
e,
|
@@ -6211,9 +6254,9 @@ class vo {
|
|
6211
6254
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: r }, this.iframes[e._key()] = t, r;
|
6212
6255
|
}
|
6213
6256
|
_isIframeWebStorageSupported(e, t) {
|
6214
|
-
this.iframes[e._key()].send(
|
6257
|
+
this.iframes[e._key()].send(Je, { type: Je }, (i) => {
|
6215
6258
|
var s;
|
6216
|
-
const o = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[
|
6259
|
+
const o = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[Je];
|
6217
6260
|
o !== void 0 && t(!!o), N(
|
6218
6261
|
e,
|
6219
6262
|
"internal-error"
|
@@ -6223,14 +6266,14 @@ class vo {
|
|
6223
6266
|
}
|
6224
6267
|
_originValidation(e) {
|
6225
6268
|
const t = e._key();
|
6226
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
6269
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Qs(e)), this.originValidationPromises[t];
|
6227
6270
|
}
|
6228
6271
|
get _shouldInitProactively() {
|
6229
|
-
return
|
6272
|
+
return gn() || at() || je();
|
6230
6273
|
}
|
6231
6274
|
}
|
6232
|
-
const
|
6233
|
-
var
|
6275
|
+
const wo = Io;
|
6276
|
+
var Mt = "@firebase/auth", Ut = "1.3.2";
|
6234
6277
|
/**
|
6235
6278
|
* @license
|
6236
6279
|
* Copyright 2020 Google LLC
|
@@ -6247,7 +6290,7 @@ var Bt = "@firebase/auth", Ft = "1.3.0";
|
|
6247
6290
|
* See the License for the specific language governing permissions and
|
6248
6291
|
* limitations under the License.
|
6249
6292
|
*/
|
6250
|
-
class
|
6293
|
+
class Eo {
|
6251
6294
|
constructor(e) {
|
6252
6295
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
6253
6296
|
}
|
@@ -6298,7 +6341,7 @@ class Io {
|
|
6298
6341
|
* See the License for the specific language governing permissions and
|
6299
6342
|
* limitations under the License.
|
6300
6343
|
*/
|
6301
|
-
function
|
6344
|
+
function To(n) {
|
6302
6345
|
switch (n) {
|
6303
6346
|
case "Node":
|
6304
6347
|
return "node";
|
@@ -6312,7 +6355,7 @@ function wo(n) {
|
|
6312
6355
|
return;
|
6313
6356
|
}
|
6314
6357
|
}
|
6315
|
-
function
|
6358
|
+
function Ao(n) {
|
6316
6359
|
fe(new ae(
|
6317
6360
|
"auth",
|
6318
6361
|
(e, { options: t }) => {
|
@@ -6325,9 +6368,9 @@ function Eo(n) {
|
|
6325
6368
|
apiHost: "identitytoolkit.googleapis.com",
|
6326
6369
|
tokenApiHost: "securetoken.googleapis.com",
|
6327
6370
|
apiScheme: "https",
|
6328
|
-
sdkClientVersion:
|
6371
|
+
sdkClientVersion: mn(n)
|
6329
6372
|
}, u = new Fi(r, i, s, a);
|
6330
|
-
return
|
6373
|
+
return Ji(u, t), u;
|
6331
6374
|
},
|
6332
6375
|
"PUBLIC"
|
6333
6376
|
/* ComponentType.PUBLIC */
|
@@ -6346,14 +6389,14 @@ function Eo(n) {
|
|
6346
6389
|
"auth"
|
6347
6390
|
/* _ComponentName.AUTH */
|
6348
6391
|
).getImmediate());
|
6349
|
-
return ((r) => new
|
6392
|
+
return ((r) => new Eo(r))(t);
|
6350
6393
|
},
|
6351
6394
|
"PRIVATE"
|
6352
6395
|
/* ComponentType.PRIVATE */
|
6353
6396
|
).setInstantiationMode(
|
6354
6397
|
"EXPLICIT"
|
6355
6398
|
/* InstantiationMode.EXPLICIT */
|
6356
|
-
)), ie(
|
6399
|
+
)), ie(Mt, Ut, To(n)), ie(Mt, Ut, "esm2017");
|
6357
6400
|
}
|
6358
6401
|
/**
|
6359
6402
|
* @license
|
@@ -6371,48 +6414,48 @@ function Eo(n) {
|
|
6371
6414
|
* See the License for the specific language governing permissions and
|
6372
6415
|
* limitations under the License.
|
6373
6416
|
*/
|
6374
|
-
const
|
6375
|
-
let
|
6376
|
-
const
|
6417
|
+
const So = 5 * 60, Co = Jt("authIdTokenMaxAge") || So;
|
6418
|
+
let jt = null;
|
6419
|
+
const Ro = (n) => async (e) => {
|
6377
6420
|
const t = e && await e.getIdTokenResult(), r = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
6378
|
-
if (r && r >
|
6421
|
+
if (r && r > Co)
|
6379
6422
|
return;
|
6380
6423
|
const i = t == null ? void 0 : t.token;
|
6381
|
-
|
6424
|
+
jt !== i && (jt = i, await fetch(n, {
|
6382
6425
|
method: i ? "POST" : "DELETE",
|
6383
6426
|
headers: i ? {
|
6384
6427
|
Authorization: `Bearer ${i}`
|
6385
6428
|
} : {}
|
6386
6429
|
}));
|
6387
6430
|
};
|
6388
|
-
function
|
6389
|
-
const e =
|
6431
|
+
function Po(n = Xr()) {
|
6432
|
+
const e = Qt(n, "auth");
|
6390
6433
|
if (e.isInitialized())
|
6391
6434
|
return e.getImmediate();
|
6392
|
-
const t =
|
6393
|
-
popupRedirectResolver:
|
6435
|
+
const t = qi(n, {
|
6436
|
+
popupRedirectResolver: wo,
|
6394
6437
|
persistence: [
|
6395
|
-
|
6396
|
-
|
6397
|
-
|
6438
|
+
Ns,
|
6439
|
+
vs,
|
6440
|
+
Sn
|
6398
6441
|
]
|
6399
|
-
}), r =
|
6442
|
+
}), r = Jt("authTokenSyncURL");
|
6400
6443
|
if (r) {
|
6401
|
-
const s =
|
6402
|
-
|
6444
|
+
const s = Ro(r);
|
6445
|
+
ps(t, s, () => s(t.currentUser)), fs(t, (o) => s(o));
|
6403
6446
|
}
|
6404
|
-
const i =
|
6405
|
-
return i &&
|
6447
|
+
const i = Hn("auth");
|
6448
|
+
return i && Gi(t, `http://${i}`), t;
|
6406
6449
|
}
|
6407
|
-
|
6450
|
+
Ao(
|
6408
6451
|
"Browser"
|
6409
6452
|
/* ClientPlatform.BROWSER */
|
6410
6453
|
);
|
6411
|
-
var
|
6412
|
-
function
|
6454
|
+
var Oo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
6455
|
+
function ko(n) {
|
6413
6456
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
6414
6457
|
}
|
6415
|
-
var
|
6458
|
+
var Dn = { exports: {} };
|
6416
6459
|
(function(n) {
|
6417
6460
|
(function(e) {
|
6418
6461
|
function t(l, m) {
|
@@ -6450,7 +6493,7 @@ var $n = { exports: {} };
|
|
6450
6493
|
d += String.fromCharCode(l[m >> 5] >>> m % 32 & 255);
|
6451
6494
|
return d;
|
6452
6495
|
}
|
6453
|
-
function
|
6496
|
+
function v(l) {
|
6454
6497
|
var m, d = [];
|
6455
6498
|
for (d[(l.length >> 2) - 1] = void 0, m = 0; m < d.length; m += 1)
|
6456
6499
|
d[m] = 0;
|
@@ -6460,13 +6503,13 @@ var $n = { exports: {} };
|
|
6460
6503
|
return d;
|
6461
6504
|
}
|
6462
6505
|
function A(l) {
|
6463
|
-
return y(u(
|
6506
|
+
return y(u(v(l), l.length * 8));
|
6464
6507
|
}
|
6465
6508
|
function P(l, m) {
|
6466
|
-
var d, w =
|
6509
|
+
var d, w = v(l), E = [], S = [], O;
|
6467
6510
|
for (E[15] = S[15] = void 0, w.length > 16 && (w = u(w, l.length * 8)), d = 0; d < 16; d += 1)
|
6468
6511
|
E[d] = w[d] ^ 909522486, S[d] = w[d] ^ 1549556828;
|
6469
|
-
return O = u(E.concat(
|
6512
|
+
return O = u(E.concat(v(m)), 512 + m.length * 8), y(u(S.concat(O), 512 + 128));
|
6470
6513
|
}
|
6471
6514
|
function k(l) {
|
6472
6515
|
var m = "0123456789abcdef", d = "", w, E;
|
@@ -6474,29 +6517,29 @@ var $n = { exports: {} };
|
|
6474
6517
|
w = l.charCodeAt(E), d += m.charAt(w >>> 4 & 15) + m.charAt(w & 15);
|
6475
6518
|
return d;
|
6476
6519
|
}
|
6477
|
-
function
|
6520
|
+
function b(l) {
|
6478
6521
|
return unescape(encodeURIComponent(l));
|
6479
6522
|
}
|
6480
6523
|
function I(l) {
|
6481
|
-
return A(
|
6524
|
+
return A(b(l));
|
6482
6525
|
}
|
6483
6526
|
function D(l) {
|
6484
6527
|
return k(I(l));
|
6485
6528
|
}
|
6486
6529
|
function C(l, m) {
|
6487
|
-
return P(
|
6530
|
+
return P(b(l), b(m));
|
6488
6531
|
}
|
6489
6532
|
function Y(l, m) {
|
6490
6533
|
return k(C(l, m));
|
6491
6534
|
}
|
6492
|
-
function
|
6535
|
+
function B(l, m, d) {
|
6493
6536
|
return m ? d ? C(m, l) : Y(m, l) : d ? I(l) : D(l);
|
6494
6537
|
}
|
6495
|
-
n.exports ? n.exports =
|
6496
|
-
})(
|
6497
|
-
})(
|
6498
|
-
var
|
6499
|
-
const
|
6538
|
+
n.exports ? n.exports = B : e.md5 = B;
|
6539
|
+
})(Oo);
|
6540
|
+
})(Dn);
|
6541
|
+
var No = Dn.exports;
|
6542
|
+
const Do = /* @__PURE__ */ ko(No), ht = (n, e) => async (t, r = {}) => {
|
6500
6543
|
const i = e ? await e.getIdToken() : null, s = await fetch(`${n}${t}`, {
|
6501
6544
|
mode: "cors",
|
6502
6545
|
...r,
|
@@ -6514,7 +6557,7 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
6514
6557
|
body: o
|
6515
6558
|
});
|
6516
6559
|
return o;
|
6517
|
-
},
|
6560
|
+
}, Lo = (n) => {
|
6518
6561
|
const e = n.properties || {}, t = n.inputProps || Object.keys(e), r = (i, s) => {
|
6519
6562
|
const o = e[i] || {};
|
6520
6563
|
if ([null, void 0].includes(s))
|
@@ -6551,13 +6594,13 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
6551
6594
|
),
|
6552
6595
|
validateAttr: r
|
6553
6596
|
};
|
6554
|
-
},
|
6597
|
+
}, $o = (n = {}) => Object.keys(n).length ? `?q=${JSON.stringify(n)}` : "", Mo = (n) => [...n].reduce(
|
6555
6598
|
(e, t) => t === t.toUpperCase() ? `${e}-${t.toLowerCase()}` : `${e}${t}`,
|
6556
6599
|
""
|
6557
|
-
),
|
6558
|
-
const e =
|
6559
|
-
return (t, r) => `/${e}${t ? `/${encodeURIComponent(t)}` : ""}${
|
6560
|
-
},
|
6600
|
+
), Uo = (n) => `${n[0].toLowerCase()}${n.slice(1)}`, jo = (n) => {
|
6601
|
+
const e = Mo(n);
|
6602
|
+
return (t, r) => `/${e}${t ? `/${encodeURIComponent(t)}` : ""}${$o(r)}`;
|
6603
|
+
}, Ft = (n, e) => {
|
6561
6604
|
const t = Array.isArray(e.inputProps);
|
6562
6605
|
return Object.keys(n).reduce(
|
6563
6606
|
(r, i) => {
|
@@ -6571,12 +6614,12 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
6571
6614
|
},
|
6572
6615
|
{}
|
6573
6616
|
);
|
6574
|
-
},
|
6617
|
+
}, Fo = ({ primaryKey: n, properties: e, ...t }) => ({
|
6575
6618
|
primaryKey: n || "id",
|
6576
6619
|
properties: Object.keys(e || {}).reduce(
|
6577
6620
|
(r, i) => {
|
6578
|
-
var
|
6579
|
-
const s = e[i] || {}, { type: o, isScalar: c, isRequired: a, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (
|
6621
|
+
var v, A;
|
6622
|
+
const s = e[i] || {}, { type: o, isScalar: c, isRequired: a, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (v = s.items) != null && v.$ref ? { type: s.items.$ref.split("/").pop(), isScalar: !1, isRequired: !1, isRef: !0 } : { type: (A = s.items) == null ? void 0 : A.type, isScalar: !1, isRequired: !1 } : { type: s.format === "date-time" ? "date" : s.type, isScalar: !0, isRequired: !0 } : Array.isArray(s.type) ? s.type.length === 2 ? { type: s.format === "date-time" ? "date" : s.type[0], isScalar: !0, isRequired: !1 } : { type: "json", isScalar: !0, isRequired: s.type.includes("null") } : s.$ref ? { type: s.$ref.split("/").pop(), isScalar: !0, isRequired: !0, isRef: !0 } : { type: s.anyOf[0].$ref.split("/").pop(), isScalar: !0, isRequired: !1, isRef: !0 }, y = s.inputType || (o === "integer" ? "number" : o);
|
6580
6623
|
return {
|
6581
6624
|
...r,
|
6582
6625
|
[i]: {
|
@@ -6592,54 +6635,54 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
6592
6635
|
{}
|
6593
6636
|
),
|
6594
6637
|
...t
|
6595
|
-
}),
|
6596
|
-
const s =
|
6638
|
+
}), Bo = (n, e, t, r = {}, i = {}) => {
|
6639
|
+
const s = Fo(r), { primaryKey: o, properties: c } = s, a = Lo(s), u = jo(t), y = (...b) => ht(n, e.authUser)(...b), v = ({ data: b, ...I }) => y(u(null, I), {
|
6597
6640
|
method: "POST",
|
6598
|
-
body:
|
6599
|
-
}), A = ({ data:
|
6641
|
+
body: Ft(b, s)
|
6642
|
+
}), A = ({ data: b, ...I }) => {
|
6600
6643
|
const { where: D, ...C } = I;
|
6601
6644
|
return y(u(D[o], C), {
|
6602
6645
|
method: "PUT",
|
6603
|
-
body:
|
6646
|
+
body: Ft(b, s)
|
6604
6647
|
});
|
6605
|
-
}, P = (
|
6606
|
-
if (!
|
6607
|
-
return
|
6608
|
-
const I = Object.keys(
|
6648
|
+
}, P = (b) => {
|
6649
|
+
if (!b)
|
6650
|
+
return b;
|
6651
|
+
const I = Object.keys(b).reduce(
|
6609
6652
|
(D, C) => {
|
6610
6653
|
var E;
|
6611
|
-
const Y = c[C] || {}, { type:
|
6654
|
+
const Y = c[C] || {}, { type: B, isScalar: l, isRef: m, format: d, items: w } = Y;
|
6612
6655
|
if (m) {
|
6613
|
-
const S =
|
6656
|
+
const S = Uo(B);
|
6614
6657
|
return l ? {
|
6615
6658
|
...D,
|
6616
|
-
[C]: i[S].parse(
|
6659
|
+
[C]: i[S].parse(b[C])
|
6617
6660
|
} : {
|
6618
6661
|
...D,
|
6619
|
-
[C]: typeof ((E = i[S]) == null ? void 0 : E.parse) == "function" ?
|
6662
|
+
[C]: typeof ((E = i[S]) == null ? void 0 : E.parse) == "function" ? b[C].map((O) => i[S].parse(O)) : b[C]
|
6620
6663
|
};
|
6621
6664
|
}
|
6622
6665
|
return {
|
6623
6666
|
...D,
|
6624
|
-
[C]:
|
6667
|
+
[C]: B === "date" && b[C] ? new Date(b[C]) : b[C]
|
6625
6668
|
};
|
6626
6669
|
},
|
6627
6670
|
{}
|
6628
6671
|
);
|
6629
6672
|
return typeof s.parse == "function" ? s.parse(I) : I;
|
6630
6673
|
}, k = Object.keys(c || {}).reduce(
|
6631
|
-
(
|
6632
|
-
all:
|
6633
|
-
oneToOne:
|
6634
|
-
requiredOneToOne:
|
6635
|
-
}) : c[I].isRef && c[I].isScalar ? Object.assign(
|
6636
|
-
all:
|
6637
|
-
oneToOne:
|
6638
|
-
optionalOneToOne:
|
6639
|
-
}) : c[I].isRef ? Object.assign(
|
6640
|
-
all:
|
6641
|
-
oneToMany:
|
6642
|
-
}) :
|
6674
|
+
(b, I) => c[I].isRef && c[I].isScalar && c[I].isRequired ? Object.assign(b, {
|
6675
|
+
all: b.all.concat(I),
|
6676
|
+
oneToOne: b.oneToOne.concat(I),
|
6677
|
+
requiredOneToOne: b.requiredOneToOne.concat(I)
|
6678
|
+
}) : c[I].isRef && c[I].isScalar ? Object.assign(b, {
|
6679
|
+
all: b.all.concat(I),
|
6680
|
+
oneToOne: b.oneToOne.concat(I),
|
6681
|
+
optionalOneToOne: b.optionalOneToOne.concat(I)
|
6682
|
+
}) : c[I].isRef ? Object.assign(b, {
|
6683
|
+
all: b.all.concat(I),
|
6684
|
+
oneToMany: b.oneToMany.concat(I)
|
6685
|
+
}) : b,
|
6643
6686
|
{
|
6644
6687
|
all: [],
|
6645
6688
|
oneToOne: [],
|
@@ -6658,19 +6701,19 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
6658
6701
|
parse: P,
|
6659
6702
|
validateAttr: a.validateAttr,
|
6660
6703
|
validate: a.validate,
|
6661
|
-
findMany: (
|
6662
|
-
findById: (
|
6663
|
-
create:
|
6704
|
+
findMany: (b) => y(u(null, b)).then((I) => I.map(P)),
|
6705
|
+
findById: (b, I) => y(u(b, I)).then(P),
|
6706
|
+
create: v,
|
6664
6707
|
update: A,
|
6665
|
-
upsert: (
|
6666
|
-
delete: (
|
6708
|
+
upsert: (b) => b.where[o] ? A({ where: b.where, data: b.update }) : v({ data: b.create }),
|
6709
|
+
delete: (b) => y(u(b), { method: "DELETE" }),
|
6667
6710
|
stats: () => y(u("_stats"))
|
6668
6711
|
};
|
6669
|
-
},
|
6712
|
+
}, Ho = (n, e, t) => Object.keys(t.properties).reduce(
|
6670
6713
|
(r, i) => {
|
6671
6714
|
const s = t.properties[i].$ref.split("/").pop();
|
6672
6715
|
return Object.assign(r, {
|
6673
|
-
[i]:
|
6716
|
+
[i]: Bo(
|
6674
6717
|
n,
|
6675
6718
|
e,
|
6676
6719
|
t.definitions[s].plural || `${i}s`,
|
@@ -6680,7 +6723,7 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
6680
6723
|
});
|
6681
6724
|
},
|
6682
6725
|
{}
|
6683
|
-
),
|
6726
|
+
), Vo = (n, e) => Object.keys(n.definitions).reduce(
|
6684
6727
|
(t, r) => ({
|
6685
6728
|
...t,
|
6686
6729
|
[r]: e[r] ? {
|
@@ -6699,7 +6742,7 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
6699
6742
|
} : n.definitions[r]
|
6700
6743
|
}),
|
6701
6744
|
{}
|
6702
|
-
),
|
6745
|
+
), Wo = "http://json-schema.org/draft-07/schema#", xo = {
|
6703
6746
|
Country: {
|
6704
6747
|
type: "object",
|
6705
6748
|
properties: {
|
@@ -8884,7 +8927,7 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
8884
8927
|
}
|
8885
8928
|
}
|
8886
8929
|
}
|
8887
|
-
},
|
8930
|
+
}, zo = "object", qo = {
|
8888
8931
|
country: {
|
8889
8932
|
$ref: "#/definitions/Country"
|
8890
8933
|
},
|
@@ -8990,12 +9033,12 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
8990
9033
|
jobCrawlerLocation: {
|
8991
9034
|
$ref: "#/definitions/JobCrawlerLocation"
|
8992
9035
|
}
|
8993
|
-
},
|
8994
|
-
$schema:
|
8995
|
-
definitions:
|
8996
|
-
type:
|
8997
|
-
properties:
|
8998
|
-
},
|
9036
|
+
}, Bt = {
|
9037
|
+
$schema: Wo,
|
9038
|
+
definitions: xo,
|
9039
|
+
type: zo,
|
9040
|
+
properties: qo
|
9041
|
+
}, Jo = 60 * 60 * 1e3, Ht = 24 * Jo, Go = {
|
8999
9042
|
Country: {
|
9000
9043
|
primaryKey: "code",
|
9001
9044
|
plural: "countries",
|
@@ -9043,7 +9086,7 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
9043
9086
|
}
|
9044
9087
|
},
|
9045
9088
|
parse: (n) => {
|
9046
|
-
const e = n.github ? `https://github.com/${n.github}.png?size=` : `https://www.gravatar.com/avatar/${
|
9089
|
+
const e = n.github ? `https://github.com/${n.github}.png?size=` : `https://www.gravatar.com/avatar/${Do(n.email)}?s=`;
|
9047
9090
|
return {
|
9048
9091
|
...n,
|
9049
9092
|
fullName: `${n.firstName || ""}${n.lastName ? ` ${n.lastName}` : ""}`,
|
@@ -9107,7 +9150,7 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
9107
9150
|
) < e ? t = "placement_ended" : n.placementStart < e && (t = "placement_started");
|
9108
9151
|
}
|
9109
9152
|
!t && n.end < e && (t = "ended"), !t && n.start < e && (t = "started");
|
9110
|
-
const r = n.admissionEnd ? +n.admissionEnd +
|
9153
|
+
const r = n.admissionEnd ? +n.admissionEnd + Ht : !1;
|
9111
9154
|
!t && r && r < e && (t = "admission_ended"), !t && n.admissionStart && n.admissionStart < e && (t = "admission_started"), !t && n.admissionStart && n.admissionEnd && (t = "planned"), t || (t = "draft");
|
9112
9155
|
const i = n.start > e && n.vacancies ? n.vacancies : ((s = n._count) == null ? void 0 : s.students) || ((o = n.students) == null ? void 0 : o.length) || 0;
|
9113
9156
|
return {
|
@@ -9243,7 +9286,7 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
9243
9286
|
return n;
|
9244
9287
|
const t = Date.now();
|
9245
9288
|
let r;
|
9246
|
-
return n.isReady ? r = "ready" : e && !n.bypassFilters ? r = "rejected" : n.createdAt < t - 90 *
|
9289
|
+
return n.isReady ? r = "ready" : e && !n.bypassFilters ? r = "rejected" : n.createdAt < t - 90 * Ht ? r = "expired" : ((o = n.cohort) == null ? void 0 : o.status) !== "admission_started" ? r = "admission_ended" : r = "active", {
|
9247
9290
|
...n,
|
9248
9291
|
status: r
|
9249
9292
|
};
|
@@ -9277,16 +9320,16 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
9277
9320
|
JobCrawlerQuery: {
|
9278
9321
|
plural: "jobCrawlerQueries"
|
9279
9322
|
}
|
9280
|
-
},
|
9281
|
-
...
|
9282
|
-
...
|
9283
|
-
definitions:
|
9323
|
+
}, Ko = (n, e) => ({
|
9324
|
+
...Ho(n, e, {
|
9325
|
+
...Bt,
|
9326
|
+
definitions: Vo(Bt, Go)
|
9284
9327
|
}),
|
9285
9328
|
gcpLog: {
|
9286
|
-
getEntries: async (t) => await
|
9329
|
+
getEntries: async (t) => await ht(n, e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)
|
9287
9330
|
}
|
9288
|
-
}),
|
9289
|
-
const t =
|
9331
|
+
}), Yo = (n, e) => {
|
9332
|
+
const t = ht(n, e.authUser);
|
9290
9333
|
return {
|
9291
9334
|
project: {
|
9292
9335
|
findMany: (r = {}) => t(`/projects?q=${JSON.stringify(r)}`),
|
@@ -9300,76 +9343,76 @@ const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
|
9300
9343
|
findMany: (r = {}) => t(`/learning-objectives?q=${JSON.stringify(r)}`)
|
9301
9344
|
}
|
9302
9345
|
};
|
9303
|
-
},
|
9346
|
+
}, Me = (n) => n > 9 ? `${n}` : `0${n}`, Qo = (n) => `${Me(n.getUTCDate())}/${Me(n.getUTCMonth() + 1)}/${n.getUTCFullYear()}`, Xo = (n) => `${Me(n.getUTCHours())}:${Me(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`, ta = (n) => `${Qo(n)} ${Xo(n)}`, Zo = {
|
9304
9347
|
es: "es-ES",
|
9305
9348
|
pt: "pt-BR"
|
9306
|
-
},
|
9349
|
+
}, na = (n, e = "es", t = !1) => new Intl.DateTimeFormat(Zo[e], {
|
9307
9350
|
...t && {
|
9308
9351
|
year: "numeric"
|
9309
9352
|
},
|
9310
9353
|
month: "long",
|
9311
9354
|
day: "numeric",
|
9312
9355
|
timeZone: "UTC"
|
9313
|
-
}).format(new Date(n)),
|
9356
|
+
}).format(new Date(n)), ra = (n, e) => {
|
9314
9357
|
let t = e.getFullYear() - n.getFullYear();
|
9315
9358
|
const r = e.getMonth() - n.getMonth();
|
9316
9359
|
return (r < 0 || r === 0 && e.getDate() < n.getDate()) && t--, t;
|
9317
|
-
},
|
9360
|
+
}, ea = (n, e, t) => new Intl.NumberFormat(
|
9318
9361
|
`${n}-${e}`,
|
9319
9362
|
{ currency: t }
|
9320
|
-
),
|
9363
|
+
), ia = (n, e, t, r) => ea(
|
9321
9364
|
e,
|
9322
9365
|
t,
|
9323
9366
|
r
|
9324
|
-
).format(n),
|
9367
|
+
).format(n), sa = (n) => parseInt(n.replace(/[,\.]/g, ""), 10), oa = (n) => {
|
9325
9368
|
try {
|
9326
9369
|
return JSON.parse(window.localStorage.getItem(n));
|
9327
9370
|
} catch {
|
9328
9371
|
return null;
|
9329
9372
|
}
|
9330
|
-
},
|
9373
|
+
}, aa = ({
|
9331
9374
|
firebaseApiKey: n = "AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",
|
9332
9375
|
firebaseProject: e = "laboratoria-la",
|
9333
9376
|
coreApiUrl: t = "https://us-central1-outpost-272720.cloudfunctions.net/core-api"
|
9334
9377
|
} = {}) => {
|
9335
|
-
const r =
|
9378
|
+
const r = Xt({
|
9336
9379
|
apiKey: n,
|
9337
9380
|
authDomain: `${e}.firebaseapp.com`,
|
9338
9381
|
databaseURL: `https://${e}.firebaseio.com`,
|
9339
9382
|
projectId: e
|
9340
|
-
}), i =
|
9383
|
+
}), i = Po(r), s = { authUser: void 0, user: void 0 }, o = Ko(t, s);
|
9341
9384
|
return {
|
9342
|
-
...
|
9385
|
+
...Yo(t, s),
|
9343
9386
|
...o,
|
9344
9387
|
auth: {
|
9345
|
-
onChange: (u) =>
|
9388
|
+
onChange: (u) => gs(i, (y) => {
|
9346
9389
|
if (!y)
|
9347
9390
|
return Object.assign(s, { authUser: null, user: null }), u(s);
|
9348
|
-
Object.assign(s, { authUser: y }), o.user.findById(y.uid).then((
|
9349
|
-
Object.assign(s, { user:
|
9350
|
-
}).catch((
|
9351
|
-
console.error(
|
9391
|
+
Object.assign(s, { authUser: y }), o.user.findById(y.uid).then((v) => {
|
9392
|
+
Object.assign(s, { user: v }), u(s);
|
9393
|
+
}).catch((v) => {
|
9394
|
+
console.error(v), Object.assign(s, { authUser: null, user: null }), u(s);
|
9352
9395
|
});
|
9353
9396
|
}),
|
9354
|
-
signIn: (u, y) =>
|
9397
|
+
signIn: (u, y) => hs(
|
9355
9398
|
i,
|
9356
9399
|
u,
|
9357
9400
|
y
|
9358
9401
|
),
|
9359
|
-
signOut: () =>
|
9360
|
-
sendPasswordResetEmail: (u) =>
|
9402
|
+
signOut: () => ms(i),
|
9403
|
+
sendPasswordResetEmail: (u) => us(i, u)
|
9361
9404
|
},
|
9362
9405
|
firebaseApp: r
|
9363
9406
|
};
|
9364
9407
|
};
|
9365
9408
|
export {
|
9366
|
-
|
9367
|
-
|
9368
|
-
|
9369
|
-
|
9370
|
-
|
9371
|
-
|
9372
|
-
|
9373
|
-
|
9374
|
-
|
9409
|
+
aa as createApp,
|
9410
|
+
ia as formatCurrency,
|
9411
|
+
Qo as formatDate,
|
9412
|
+
ta as formatDateTime,
|
9413
|
+
na as formatMonth,
|
9414
|
+
Xo as formatTime,
|
9415
|
+
ra as getAgeAt,
|
9416
|
+
oa as loadFromLocalStorage,
|
9417
|
+
sa as parseCurrency
|
9375
9418
|
};
|