@feedmepos/mf-payment 1.4.45 → 1.4.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OnboardForm-Hg1J1NNW.js → OnboardForm-Bk5eHmN0.js} +2 -2
- package/dist/{OnboardForm-Dg-Te6WA.js → OnboardForm-DURv3s6I.js} +2 -2
- package/dist/{OnboardSubmission-D63wk5mc.js → OnboardSubmission-BOiXSkVB.js} +1 -1
- package/dist/{OnboardSubmission-MghAocun.js → OnboardSubmission-Bjf_EOKq.js} +1 -1
- package/dist/{PayoutAccount-DNrMzfE3.js → PayoutAccount-Ban4QG9e.js} +3 -3
- package/dist/{PayoutAccount-CzwUi6sF.js → PayoutAccount-D-oQ4vID.js} +1 -1
- package/dist/{app-DawA1Qw3.js → app-COvZzQVV.js} +830 -817
- package/dist/app.d.ts +1 -358
- package/dist/app.js +4 -3
- package/dist/{index-BtqPYPV8.js → index-DR0voetw.js} +1 -1
- package/dist/package.json +2 -2
- package/dist/{payout-account-n8CrfMda.js → payout-account-DQZ0J8Ds.js} +2 -2
- package/dist/{plugins--j00wPbu.js → plugins-DuKITasE.js} +1 -1
- package/dist/router/index.d.ts +1 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { computed as
|
|
4
|
-
import { useCoreStore as We, useI18n as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { components as
|
|
7
|
-
const
|
|
1
|
+
import { FmApp as Mn, routes as Lt, i18nMessages as Un } from "@feedmepos/mf-financing";
|
|
2
|
+
import { createRouter as xn, createWebHistory as Fn, useRouter as Bn, useRoute as $n } from "vue-router";
|
|
3
|
+
import { computed as Mt, watch as q, defineComponent as Ut, ref as Hn, resolveComponent as xt, openBlock as Ft, createBlock as Bt, h as Vn, onMounted as jn, onBeforeMount as Wn, unref as zn } from "vue";
|
|
4
|
+
import { useCoreStore as We, useI18n as Gn } from "@feedmepos/mf-common";
|
|
5
|
+
import { defineStore as qn } from "pinia";
|
|
6
|
+
import { components as Kn } from "@feedmepos/ui-library";
|
|
7
|
+
const Jn = {
|
|
8
8
|
components: {
|
|
9
9
|
select: "Select filter entity",
|
|
10
10
|
restaurant: "Restaurant",
|
|
@@ -179,9 +179,9 @@ const Kn = {
|
|
|
179
179
|
service2: "SoftPOS Card Payment"
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
}, Jn = {
|
|
183
|
-
payment: Kn
|
|
184
182
|
}, Yn = {
|
|
183
|
+
payment: Jn
|
|
184
|
+
}, Xn = {
|
|
185
185
|
components: {
|
|
186
186
|
select: "选择筛选对象",
|
|
187
187
|
restaurant: "餐厅",
|
|
@@ -356,9 +356,9 @@ const Kn = {
|
|
|
356
356
|
service2: "SoftPOS银行卡支付"
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
},
|
|
360
|
-
payment:
|
|
361
|
-
},
|
|
359
|
+
}, Qn = {
|
|
360
|
+
payment: Xn
|
|
361
|
+
}, K = [
|
|
362
362
|
{
|
|
363
363
|
path: "/admin/restaurants",
|
|
364
364
|
name: "mf-payment-admin.restaurant",
|
|
@@ -384,7 +384,7 @@ const Kn = {
|
|
|
384
384
|
sidebarDisplay: "Payout Accounts",
|
|
385
385
|
section: "payment-gateway"
|
|
386
386
|
},
|
|
387
|
-
component: () => import("./PayoutAccount-
|
|
387
|
+
component: () => import("./PayoutAccount-D-oQ4vID.js")
|
|
388
388
|
},
|
|
389
389
|
{
|
|
390
390
|
path: "/admin/payout-accounts/:accountId",
|
|
@@ -402,7 +402,7 @@ const Kn = {
|
|
|
402
402
|
sidebarDisplay: "Payment Onboarding",
|
|
403
403
|
section: "payment-gateway"
|
|
404
404
|
},
|
|
405
|
-
component: () => import("./OnboardSubmission-
|
|
405
|
+
component: () => import("./OnboardSubmission-Bjf_EOKq.js")
|
|
406
406
|
},
|
|
407
407
|
{
|
|
408
408
|
path: "/admin/onboarding/:submissionId",
|
|
@@ -411,7 +411,7 @@ const Kn = {
|
|
|
411
411
|
meta: {
|
|
412
412
|
parent: "mf-payment-admin.onboard-submission"
|
|
413
413
|
},
|
|
414
|
-
component: () => import("./OnboardForm-
|
|
414
|
+
component: () => import("./OnboardForm-DURv3s6I.js")
|
|
415
415
|
},
|
|
416
416
|
{
|
|
417
417
|
path: "/admin/terminal/pos",
|
|
@@ -517,7 +517,7 @@ const Kn = {
|
|
|
517
517
|
{
|
|
518
518
|
path: "/payout-account",
|
|
519
519
|
name: "mf-payment-payout-account",
|
|
520
|
-
component: () => import("./PayoutAccount-
|
|
520
|
+
component: () => import("./PayoutAccount-Ban4QG9e.js"),
|
|
521
521
|
meta: {
|
|
522
522
|
sidebarDisplay: "i18n:payment.routes.payout_account"
|
|
523
523
|
}
|
|
@@ -525,7 +525,7 @@ const Kn = {
|
|
|
525
525
|
{
|
|
526
526
|
path: "/onboard-submission",
|
|
527
527
|
name: "mf-payment-onboard-submission",
|
|
528
|
-
component: () => import("./OnboardSubmission-
|
|
528
|
+
component: () => import("./OnboardSubmission-BOiXSkVB.js"),
|
|
529
529
|
meta: {
|
|
530
530
|
sidebarDisplay: "i18n:payment.routes.onboard_submission",
|
|
531
531
|
region: { MY: !0 }
|
|
@@ -535,7 +535,7 @@ const Kn = {
|
|
|
535
535
|
path: "/onboard-submission/:type/:submission?",
|
|
536
536
|
name: "mf-payment-onboard-submission-form",
|
|
537
537
|
props: !0,
|
|
538
|
-
component: () => import("./OnboardForm-
|
|
538
|
+
component: () => import("./OnboardForm-Bk5eHmN0.js"),
|
|
539
539
|
meta: {
|
|
540
540
|
parent: "mf-payment-onboard-submission"
|
|
541
541
|
}
|
|
@@ -574,20 +574,28 @@ const Kn = {
|
|
|
574
574
|
parent: "mf-payment-settlement"
|
|
575
575
|
}
|
|
576
576
|
},
|
|
577
|
-
|
|
578
|
-
|
|
577
|
+
{
|
|
578
|
+
path: "/financing",
|
|
579
|
+
name: "mf-payment-financing",
|
|
580
|
+
component: Mn,
|
|
579
581
|
meta: {
|
|
580
|
-
|
|
581
|
-
section: "financing"
|
|
582
|
+
useChildrenRoutes: !0
|
|
582
583
|
},
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
584
|
+
children: Lt.map((n) => ({
|
|
585
|
+
...n,
|
|
586
|
+
meta: {
|
|
587
|
+
...n.meta,
|
|
588
|
+
section: "financing"
|
|
589
|
+
},
|
|
590
|
+
path: `/financing${n.path}`
|
|
591
|
+
}))
|
|
592
|
+
}
|
|
593
|
+
];
|
|
594
|
+
console.log(Lt);
|
|
595
|
+
const Zn = qn("mf-payment-iframe", () => {
|
|
588
596
|
const n = {
|
|
589
597
|
isIframe: !1
|
|
590
|
-
}, e =
|
|
598
|
+
}, e = Mt(() => n);
|
|
591
599
|
function t(r) {
|
|
592
600
|
n.isIframe = r;
|
|
593
601
|
}
|
|
@@ -628,7 +636,7 @@ const Kn = {
|
|
|
628
636
|
* See the License for the specific language governing permissions and
|
|
629
637
|
* limitations under the License.
|
|
630
638
|
*/
|
|
631
|
-
const
|
|
639
|
+
const $t = function(n) {
|
|
632
640
|
const e = [];
|
|
633
641
|
let t = 0;
|
|
634
642
|
for (let r = 0; r < n.length; r++) {
|
|
@@ -636,7 +644,7 @@ const Bt = function(n) {
|
|
|
636
644
|
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);
|
|
637
645
|
}
|
|
638
646
|
return e;
|
|
639
|
-
},
|
|
647
|
+
}, er = function(n) {
|
|
640
648
|
const e = [];
|
|
641
649
|
let t = 0, r = 0;
|
|
642
650
|
for (; t < n.length; ) {
|
|
@@ -655,7 +663,7 @@ const Bt = function(n) {
|
|
|
655
663
|
}
|
|
656
664
|
}
|
|
657
665
|
return e.join("");
|
|
658
|
-
},
|
|
666
|
+
}, Ht = {
|
|
659
667
|
/**
|
|
660
668
|
* Maps bytes to characters.
|
|
661
669
|
*/
|
|
@@ -714,9 +722,9 @@ const Bt = function(n) {
|
|
|
714
722
|
this.init_();
|
|
715
723
|
const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
|
|
716
724
|
for (let i = 0; i < n.length; i += 3) {
|
|
717
|
-
const s = n[i], a = i + 1 < n.length, c = a ? n[i + 1] : 0, o = i + 2 < n.length,
|
|
718
|
-
let
|
|
719
|
-
o || (
|
|
725
|
+
const s = n[i], a = i + 1 < n.length, c = a ? n[i + 1] : 0, o = i + 2 < n.length, l = o ? n[i + 2] : 0, u = s >> 2, d = (s & 3) << 4 | c >> 4;
|
|
726
|
+
let p = (c & 15) << 2 | l >> 6, m = l & 63;
|
|
727
|
+
o || (m = 64, a || (p = 64)), r.push(t[u], t[d], t[p], t[m]);
|
|
720
728
|
}
|
|
721
729
|
return r.join("");
|
|
722
730
|
},
|
|
@@ -729,7 +737,7 @@ const Bt = function(n) {
|
|
|
729
737
|
* @return The base64 encoded string.
|
|
730
738
|
*/
|
|
731
739
|
encodeString(n, e) {
|
|
732
|
-
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray(
|
|
740
|
+
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray($t(n), e);
|
|
733
741
|
},
|
|
734
742
|
/**
|
|
735
743
|
* Base64-decode a string.
|
|
@@ -740,7 +748,7 @@ const Bt = function(n) {
|
|
|
740
748
|
* @return string representing the decoded value.
|
|
741
749
|
*/
|
|
742
750
|
decodeString(n, e) {
|
|
743
|
-
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) :
|
|
751
|
+
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) : er(this.decodeStringToByteArray(n, e));
|
|
744
752
|
},
|
|
745
753
|
/**
|
|
746
754
|
* Base64-decode a string.
|
|
@@ -763,17 +771,17 @@ const Bt = function(n) {
|
|
|
763
771
|
for (let i = 0; i < n.length; ) {
|
|
764
772
|
const s = t[n.charAt(i++)], c = i < n.length ? t[n.charAt(i)] : 0;
|
|
765
773
|
++i;
|
|
766
|
-
const
|
|
774
|
+
const l = i < n.length ? t[n.charAt(i)] : 64;
|
|
767
775
|
++i;
|
|
768
776
|
const d = i < n.length ? t[n.charAt(i)] : 64;
|
|
769
|
-
if (++i, s == null || c == null ||
|
|
770
|
-
throw new
|
|
771
|
-
const
|
|
772
|
-
if (r.push(
|
|
773
|
-
const
|
|
774
|
-
if (r.push(
|
|
775
|
-
const
|
|
776
|
-
r.push(
|
|
777
|
+
if (++i, s == null || c == null || l == null || d == null)
|
|
778
|
+
throw new tr();
|
|
779
|
+
const p = s << 2 | c >> 4;
|
|
780
|
+
if (r.push(p), l !== 64) {
|
|
781
|
+
const m = c << 4 & 240 | l >> 2;
|
|
782
|
+
if (r.push(m), d !== 64) {
|
|
783
|
+
const F = l << 6 & 192 | d;
|
|
784
|
+
r.push(F);
|
|
777
785
|
}
|
|
778
786
|
}
|
|
779
787
|
}
|
|
@@ -792,19 +800,19 @@ const Bt = function(n) {
|
|
|
792
800
|
}
|
|
793
801
|
}
|
|
794
802
|
};
|
|
795
|
-
class
|
|
803
|
+
class tr extends Error {
|
|
796
804
|
constructor() {
|
|
797
805
|
super(...arguments), this.name = "DecodeBase64StringError";
|
|
798
806
|
}
|
|
799
807
|
}
|
|
800
|
-
const
|
|
801
|
-
const e =
|
|
802
|
-
return
|
|
808
|
+
const nr = function(n) {
|
|
809
|
+
const e = $t(n);
|
|
810
|
+
return Ht.encodeByteArray(e, !0);
|
|
803
811
|
}, de = function(n) {
|
|
804
|
-
return
|
|
805
|
-
},
|
|
812
|
+
return nr(n).replace(/\./g, "");
|
|
813
|
+
}, Vt = function(n) {
|
|
806
814
|
try {
|
|
807
|
-
return
|
|
815
|
+
return Ht.decodeString(n, !0);
|
|
808
816
|
} catch (e) {
|
|
809
817
|
console.error("base64Decode failed: ", e);
|
|
810
818
|
}
|
|
@@ -826,7 +834,7 @@ const tr = function(n) {
|
|
|
826
834
|
* See the License for the specific language governing permissions and
|
|
827
835
|
* limitations under the License.
|
|
828
836
|
*/
|
|
829
|
-
function
|
|
837
|
+
function rr() {
|
|
830
838
|
if (typeof self < "u")
|
|
831
839
|
return self;
|
|
832
840
|
if (typeof window < "u")
|
|
@@ -851,13 +859,13 @@ function nr() {
|
|
|
851
859
|
* See the License for the specific language governing permissions and
|
|
852
860
|
* limitations under the License.
|
|
853
861
|
*/
|
|
854
|
-
const
|
|
862
|
+
const ir = () => rr().__FIREBASE_DEFAULTS__, sr = () => {
|
|
855
863
|
if (typeof process > "u" || typeof process.env > "u")
|
|
856
864
|
return;
|
|
857
865
|
const n = process.env.__FIREBASE_DEFAULTS__;
|
|
858
866
|
if (n)
|
|
859
867
|
return JSON.parse(n);
|
|
860
|
-
},
|
|
868
|
+
}, ar = () => {
|
|
861
869
|
if (typeof document > "u")
|
|
862
870
|
return;
|
|
863
871
|
let n;
|
|
@@ -866,20 +874,20 @@ const rr = () => nr().__FIREBASE_DEFAULTS__, ir = () => {
|
|
|
866
874
|
} catch {
|
|
867
875
|
return;
|
|
868
876
|
}
|
|
869
|
-
const e = n &&
|
|
877
|
+
const e = n && Vt(n[1]);
|
|
870
878
|
return e && JSON.parse(e);
|
|
871
879
|
}, ze = () => {
|
|
872
880
|
try {
|
|
873
|
-
return
|
|
881
|
+
return ir() || sr() || ar();
|
|
874
882
|
} catch (n) {
|
|
875
883
|
console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);
|
|
876
884
|
return;
|
|
877
885
|
}
|
|
878
|
-
},
|
|
886
|
+
}, jt = (n) => {
|
|
879
887
|
var e, t;
|
|
880
888
|
return (t = (e = ze()) === null || e === void 0 ? void 0 : e.emulatorHosts) === null || t === void 0 ? void 0 : t[n];
|
|
881
|
-
},
|
|
882
|
-
const e =
|
|
889
|
+
}, Ba = (n) => {
|
|
890
|
+
const e = jt(n);
|
|
883
891
|
if (!e)
|
|
884
892
|
return;
|
|
885
893
|
const t = e.lastIndexOf(":");
|
|
@@ -887,10 +895,10 @@ const rr = () => nr().__FIREBASE_DEFAULTS__, ir = () => {
|
|
|
887
895
|
throw new Error(`Invalid host ${e} with no separate hostname and port!`);
|
|
888
896
|
const r = parseInt(e.substring(t + 1), 10);
|
|
889
897
|
return e[0] === "[" ? [e.substring(1, t - 1), r] : [e.substring(0, t), r];
|
|
890
|
-
},
|
|
898
|
+
}, Wt = () => {
|
|
891
899
|
var n;
|
|
892
900
|
return (n = ze()) === null || n === void 0 ? void 0 : n.config;
|
|
893
|
-
},
|
|
901
|
+
}, zt = (n) => {
|
|
894
902
|
var e;
|
|
895
903
|
return (e = ze()) === null || e === void 0 ? void 0 : e[`_${n}`];
|
|
896
904
|
};
|
|
@@ -910,7 +918,7 @@ const rr = () => nr().__FIREBASE_DEFAULTS__, ir = () => {
|
|
|
910
918
|
* See the License for the specific language governing permissions and
|
|
911
919
|
* limitations under the License.
|
|
912
920
|
*/
|
|
913
|
-
class
|
|
921
|
+
class or {
|
|
914
922
|
constructor() {
|
|
915
923
|
this.reject = () => {
|
|
916
924
|
}, this.resolve = () => {
|
|
@@ -946,7 +954,7 @@ class ar {
|
|
|
946
954
|
* See the License for the specific language governing permissions and
|
|
947
955
|
* limitations under the License.
|
|
948
956
|
*/
|
|
949
|
-
function
|
|
957
|
+
function $a(n, e) {
|
|
950
958
|
if (n.uid)
|
|
951
959
|
throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');
|
|
952
960
|
const t = {
|
|
@@ -991,36 +999,36 @@ function Ba(n, e) {
|
|
|
991
999
|
* See the License for the specific language governing permissions and
|
|
992
1000
|
* limitations under the License.
|
|
993
1001
|
*/
|
|
994
|
-
function
|
|
1002
|
+
function g() {
|
|
995
1003
|
return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
|
|
996
1004
|
}
|
|
997
|
-
function
|
|
1005
|
+
function cr() {
|
|
998
1006
|
return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
|
|
999
1007
|
// just to deal with this case would probably be a bad idea.
|
|
1000
|
-
!!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(
|
|
1008
|
+
!!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(g());
|
|
1001
1009
|
}
|
|
1002
|
-
function
|
|
1010
|
+
function lr() {
|
|
1003
1011
|
return typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers";
|
|
1004
1012
|
}
|
|
1005
|
-
function
|
|
1013
|
+
function ur() {
|
|
1006
1014
|
const n = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
|
|
1007
1015
|
return typeof n == "object" && n.id !== void 0;
|
|
1008
1016
|
}
|
|
1009
|
-
function
|
|
1017
|
+
function dr() {
|
|
1010
1018
|
return typeof navigator == "object" && navigator.product === "ReactNative";
|
|
1011
1019
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const n =
|
|
1020
|
+
function hr() {
|
|
1021
|
+
const n = g();
|
|
1014
1022
|
return n.indexOf("MSIE ") >= 0 || n.indexOf("Trident/") >= 0;
|
|
1015
1023
|
}
|
|
1016
|
-
function
|
|
1024
|
+
function fr() {
|
|
1017
1025
|
try {
|
|
1018
1026
|
return typeof indexedDB == "object";
|
|
1019
1027
|
} catch {
|
|
1020
1028
|
return !1;
|
|
1021
1029
|
}
|
|
1022
1030
|
}
|
|
1023
|
-
function
|
|
1031
|
+
function pr() {
|
|
1024
1032
|
return new Promise((n, e) => {
|
|
1025
1033
|
try {
|
|
1026
1034
|
let t = !0;
|
|
@@ -1054,29 +1062,29 @@ function fr() {
|
|
|
1054
1062
|
* See the License for the specific language governing permissions and
|
|
1055
1063
|
* limitations under the License.
|
|
1056
1064
|
*/
|
|
1057
|
-
const
|
|
1058
|
-
class
|
|
1065
|
+
const mr = "FirebaseError";
|
|
1066
|
+
class L extends Error {
|
|
1059
1067
|
constructor(e, t, r) {
|
|
1060
|
-
super(t), this.code = e, this.customData = r, this.name =
|
|
1068
|
+
super(t), this.code = e, this.customData = r, this.name = mr, Object.setPrototypeOf(this, L.prototype), Error.captureStackTrace && Error.captureStackTrace(this, Z.prototype.create);
|
|
1061
1069
|
}
|
|
1062
1070
|
}
|
|
1063
|
-
class
|
|
1071
|
+
class Z {
|
|
1064
1072
|
constructor(e, t, r) {
|
|
1065
1073
|
this.service = e, this.serviceName = t, this.errors = r;
|
|
1066
1074
|
}
|
|
1067
1075
|
create(e, ...t) {
|
|
1068
|
-
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], a = s ?
|
|
1069
|
-
return new
|
|
1076
|
+
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], a = s ? gr(s, r) : "Error", c = `${this.serviceName}: ${a} (${i}).`;
|
|
1077
|
+
return new L(i, c, r);
|
|
1070
1078
|
}
|
|
1071
1079
|
}
|
|
1072
|
-
function
|
|
1073
|
-
return n.replace(
|
|
1080
|
+
function gr(n, e) {
|
|
1081
|
+
return n.replace(_r, (t, r) => {
|
|
1074
1082
|
const i = e[r];
|
|
1075
1083
|
return i != null ? String(i) : `<${r}?>`;
|
|
1076
1084
|
});
|
|
1077
1085
|
}
|
|
1078
|
-
const
|
|
1079
|
-
function
|
|
1086
|
+
const _r = /\{\$([^}]+)}/g;
|
|
1087
|
+
function yr(n) {
|
|
1080
1088
|
for (const e in n)
|
|
1081
1089
|
if (Object.prototype.hasOwnProperty.call(n, e))
|
|
1082
1090
|
return !1;
|
|
@@ -1120,7 +1128,7 @@ function ot(n) {
|
|
|
1120
1128
|
* See the License for the specific language governing permissions and
|
|
1121
1129
|
* limitations under the License.
|
|
1122
1130
|
*/
|
|
1123
|
-
function
|
|
1131
|
+
function ee(n) {
|
|
1124
1132
|
const e = [];
|
|
1125
1133
|
for (const [t, r] of Object.entries(n))
|
|
1126
1134
|
Array.isArray(r) ? r.forEach((i) => {
|
|
@@ -1128,11 +1136,11 @@ function Z(n) {
|
|
|
1128
1136
|
}) : e.push(encodeURIComponent(t) + "=" + encodeURIComponent(r));
|
|
1129
1137
|
return e.length ? "&" + e.join("&") : "";
|
|
1130
1138
|
}
|
|
1131
|
-
function
|
|
1132
|
-
const t = new
|
|
1139
|
+
function vr(n, e) {
|
|
1140
|
+
const t = new br(n, e);
|
|
1133
1141
|
return t.subscribe.bind(t);
|
|
1134
1142
|
}
|
|
1135
|
-
class
|
|
1143
|
+
class br {
|
|
1136
1144
|
/**
|
|
1137
1145
|
* @param executor Function which can make calls to a single Observer
|
|
1138
1146
|
* as a proxy.
|
|
@@ -1170,7 +1178,7 @@ class vr {
|
|
|
1170
1178
|
let i;
|
|
1171
1179
|
if (e === void 0 && t === void 0 && r === void 0)
|
|
1172
1180
|
throw new Error("Missing Observer.");
|
|
1173
|
-
|
|
1181
|
+
Ir(e, [
|
|
1174
1182
|
"next",
|
|
1175
1183
|
"error",
|
|
1176
1184
|
"complete"
|
|
@@ -1216,7 +1224,7 @@ class vr {
|
|
|
1216
1224
|
}));
|
|
1217
1225
|
}
|
|
1218
1226
|
}
|
|
1219
|
-
function
|
|
1227
|
+
function Ir(n, e) {
|
|
1220
1228
|
if (typeof n != "object" || n === null)
|
|
1221
1229
|
return !1;
|
|
1222
1230
|
for (const t of e)
|
|
@@ -1284,7 +1292,7 @@ class W {
|
|
|
1284
1292
|
* See the License for the specific language governing permissions and
|
|
1285
1293
|
* limitations under the License.
|
|
1286
1294
|
*/
|
|
1287
|
-
const
|
|
1295
|
+
const M = "[DEFAULT]";
|
|
1288
1296
|
/**
|
|
1289
1297
|
* @license
|
|
1290
1298
|
* Copyright 2019 Google LLC
|
|
@@ -1301,7 +1309,7 @@ const U = "[DEFAULT]";
|
|
|
1301
1309
|
* See the License for the specific language governing permissions and
|
|
1302
1310
|
* limitations under the License.
|
|
1303
1311
|
*/
|
|
1304
|
-
class
|
|
1312
|
+
class wr {
|
|
1305
1313
|
constructor(e, t) {
|
|
1306
1314
|
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();
|
|
1307
1315
|
}
|
|
@@ -1312,7 +1320,7 @@ class Ir {
|
|
|
1312
1320
|
get(e) {
|
|
1313
1321
|
const t = this.normalizeInstanceIdentifier(e);
|
|
1314
1322
|
if (!this.instancesDeferred.has(t)) {
|
|
1315
|
-
const r = new
|
|
1323
|
+
const r = new or();
|
|
1316
1324
|
if (this.instancesDeferred.set(t, r), this.isInitialized(t) || this.shouldAutoInitialize())
|
|
1317
1325
|
try {
|
|
1318
1326
|
const i = this.getOrInitializeService({
|
|
@@ -1352,9 +1360,9 @@ class Ir {
|
|
|
1352
1360
|
if (this.component)
|
|
1353
1361
|
throw Error(`Component for ${this.name} has already been provided`);
|
|
1354
1362
|
if (this.component = e, !!this.shouldAutoInitialize()) {
|
|
1355
|
-
if (
|
|
1363
|
+
if (Tr(e))
|
|
1356
1364
|
try {
|
|
1357
|
-
this.getOrInitializeService({ instanceIdentifier:
|
|
1365
|
+
this.getOrInitializeService({ instanceIdentifier: M });
|
|
1358
1366
|
} catch {
|
|
1359
1367
|
}
|
|
1360
1368
|
for (const [t, r] of this.instancesDeferred.entries()) {
|
|
@@ -1369,7 +1377,7 @@ class Ir {
|
|
|
1369
1377
|
}
|
|
1370
1378
|
}
|
|
1371
1379
|
}
|
|
1372
|
-
clearInstance(e =
|
|
1380
|
+
clearInstance(e = M) {
|
|
1373
1381
|
this.instancesDeferred.delete(e), this.instancesOptions.delete(e), this.instances.delete(e);
|
|
1374
1382
|
}
|
|
1375
1383
|
// app.delete() will call this method on every provider to delete the services
|
|
@@ -1384,10 +1392,10 @@ class Ir {
|
|
|
1384
1392
|
isComponentSet() {
|
|
1385
1393
|
return this.component != null;
|
|
1386
1394
|
}
|
|
1387
|
-
isInitialized(e =
|
|
1395
|
+
isInitialized(e = M) {
|
|
1388
1396
|
return this.instances.has(e);
|
|
1389
1397
|
}
|
|
1390
|
-
getOptions(e =
|
|
1398
|
+
getOptions(e = M) {
|
|
1391
1399
|
return this.instancesOptions.get(e) || {};
|
|
1392
1400
|
}
|
|
1393
1401
|
initialize(e = {}) {
|
|
@@ -1439,7 +1447,7 @@ class Ir {
|
|
|
1439
1447
|
getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
|
|
1440
1448
|
let r = this.instances.get(e);
|
|
1441
1449
|
if (!r && this.component && (r = this.component.instanceFactory(this.container, {
|
|
1442
|
-
instanceIdentifier:
|
|
1450
|
+
instanceIdentifier: Er(e),
|
|
1443
1451
|
options: t
|
|
1444
1452
|
}), this.instances.set(e, r), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(r, e), this.component.onInstanceCreated))
|
|
1445
1453
|
try {
|
|
@@ -1448,17 +1456,17 @@ class Ir {
|
|
|
1448
1456
|
}
|
|
1449
1457
|
return r || null;
|
|
1450
1458
|
}
|
|
1451
|
-
normalizeInstanceIdentifier(e =
|
|
1452
|
-
return this.component ? this.component.multipleInstances ? e :
|
|
1459
|
+
normalizeInstanceIdentifier(e = M) {
|
|
1460
|
+
return this.component ? this.component.multipleInstances ? e : M : e;
|
|
1453
1461
|
}
|
|
1454
1462
|
shouldAutoInitialize() {
|
|
1455
1463
|
return !!this.component && this.component.instantiationMode !== "EXPLICIT";
|
|
1456
1464
|
}
|
|
1457
1465
|
}
|
|
1458
|
-
function wr(n) {
|
|
1459
|
-
return n === U ? void 0 : n;
|
|
1460
|
-
}
|
|
1461
1466
|
function Er(n) {
|
|
1467
|
+
return n === M ? void 0 : n;
|
|
1468
|
+
}
|
|
1469
|
+
function Tr(n) {
|
|
1462
1470
|
return n.instantiationMode === "EAGER";
|
|
1463
1471
|
}
|
|
1464
1472
|
/**
|
|
@@ -1477,7 +1485,7 @@ function Er(n) {
|
|
|
1477
1485
|
* See the License for the specific language governing permissions and
|
|
1478
1486
|
* limitations under the License.
|
|
1479
1487
|
*/
|
|
1480
|
-
class
|
|
1488
|
+
class Sr {
|
|
1481
1489
|
constructor(e) {
|
|
1482
1490
|
this.name = e, this.providers = /* @__PURE__ */ new Map();
|
|
1483
1491
|
}
|
|
@@ -1509,7 +1517,7 @@ class Tr {
|
|
|
1509
1517
|
getProvider(e) {
|
|
1510
1518
|
if (this.providers.has(e))
|
|
1511
1519
|
return this.providers.get(e);
|
|
1512
|
-
const t = new
|
|
1520
|
+
const t = new wr(e, this);
|
|
1513
1521
|
return this.providers.set(e, t), t;
|
|
1514
1522
|
}
|
|
1515
1523
|
getProviders() {
|
|
@@ -1532,33 +1540,33 @@ class Tr {
|
|
|
1532
1540
|
* See the License for the specific language governing permissions and
|
|
1533
1541
|
* limitations under the License.
|
|
1534
1542
|
*/
|
|
1535
|
-
var
|
|
1543
|
+
var f;
|
|
1536
1544
|
(function(n) {
|
|
1537
1545
|
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";
|
|
1538
|
-
})(
|
|
1539
|
-
const
|
|
1540
|
-
debug:
|
|
1541
|
-
verbose:
|
|
1542
|
-
info:
|
|
1543
|
-
warn:
|
|
1544
|
-
error:
|
|
1545
|
-
silent:
|
|
1546
|
-
},
|
|
1547
|
-
[
|
|
1548
|
-
[
|
|
1549
|
-
[
|
|
1550
|
-
[
|
|
1551
|
-
[
|
|
1552
|
-
},
|
|
1546
|
+
})(f || (f = {}));
|
|
1547
|
+
const kr = {
|
|
1548
|
+
debug: f.DEBUG,
|
|
1549
|
+
verbose: f.VERBOSE,
|
|
1550
|
+
info: f.INFO,
|
|
1551
|
+
warn: f.WARN,
|
|
1552
|
+
error: f.ERROR,
|
|
1553
|
+
silent: f.SILENT
|
|
1554
|
+
}, Ar = f.INFO, Rr = {
|
|
1555
|
+
[f.DEBUG]: "log",
|
|
1556
|
+
[f.VERBOSE]: "log",
|
|
1557
|
+
[f.INFO]: "info",
|
|
1558
|
+
[f.WARN]: "warn",
|
|
1559
|
+
[f.ERROR]: "error"
|
|
1560
|
+
}, Cr = (n, e, ...t) => {
|
|
1553
1561
|
if (e < n.logLevel)
|
|
1554
1562
|
return;
|
|
1555
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), i =
|
|
1563
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), i = Rr[e];
|
|
1556
1564
|
if (i)
|
|
1557
1565
|
console[i](`[${r}] ${n.name}:`, ...t);
|
|
1558
1566
|
else
|
|
1559
1567
|
throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);
|
|
1560
1568
|
};
|
|
1561
|
-
class
|
|
1569
|
+
class Gt {
|
|
1562
1570
|
/**
|
|
1563
1571
|
* Gives you an instance of a Logger to capture messages according to
|
|
1564
1572
|
* Firebase's logging scheme.
|
|
@@ -1566,19 +1574,19 @@ class zt {
|
|
|
1566
1574
|
* @param name The name that the logs will be associated with
|
|
1567
1575
|
*/
|
|
1568
1576
|
constructor(e) {
|
|
1569
|
-
this.name = e, this._logLevel =
|
|
1577
|
+
this.name = e, this._logLevel = Ar, this._logHandler = Cr, this._userLogHandler = null;
|
|
1570
1578
|
}
|
|
1571
1579
|
get logLevel() {
|
|
1572
1580
|
return this._logLevel;
|
|
1573
1581
|
}
|
|
1574
1582
|
set logLevel(e) {
|
|
1575
|
-
if (!(e in
|
|
1583
|
+
if (!(e in f))
|
|
1576
1584
|
throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);
|
|
1577
1585
|
this._logLevel = e;
|
|
1578
1586
|
}
|
|
1579
1587
|
// Workaround for setter/getter having to be the same type.
|
|
1580
1588
|
setLogLevel(e) {
|
|
1581
|
-
this._logLevel = typeof e == "string" ?
|
|
1589
|
+
this._logLevel = typeof e == "string" ? kr[e] : e;
|
|
1582
1590
|
}
|
|
1583
1591
|
get logHandler() {
|
|
1584
1592
|
return this._logHandler;
|
|
@@ -1598,24 +1606,24 @@ class zt {
|
|
|
1598
1606
|
* The functions below are all based on the `console` interface
|
|
1599
1607
|
*/
|
|
1600
1608
|
debug(...e) {
|
|
1601
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1609
|
+
this._userLogHandler && this._userLogHandler(this, f.DEBUG, ...e), this._logHandler(this, f.DEBUG, ...e);
|
|
1602
1610
|
}
|
|
1603
1611
|
log(...e) {
|
|
1604
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1612
|
+
this._userLogHandler && this._userLogHandler(this, f.VERBOSE, ...e), this._logHandler(this, f.VERBOSE, ...e);
|
|
1605
1613
|
}
|
|
1606
1614
|
info(...e) {
|
|
1607
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1615
|
+
this._userLogHandler && this._userLogHandler(this, f.INFO, ...e), this._logHandler(this, f.INFO, ...e);
|
|
1608
1616
|
}
|
|
1609
1617
|
warn(...e) {
|
|
1610
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1618
|
+
this._userLogHandler && this._userLogHandler(this, f.WARN, ...e), this._logHandler(this, f.WARN, ...e);
|
|
1611
1619
|
}
|
|
1612
1620
|
error(...e) {
|
|
1613
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1621
|
+
this._userLogHandler && this._userLogHandler(this, f.ERROR, ...e), this._logHandler(this, f.ERROR, ...e);
|
|
1614
1622
|
}
|
|
1615
1623
|
}
|
|
1616
|
-
const
|
|
1624
|
+
const Pr = (n, e) => e.some((t) => n instanceof t);
|
|
1617
1625
|
let ct, lt;
|
|
1618
|
-
function
|
|
1626
|
+
function Or() {
|
|
1619
1627
|
return ct || (ct = [
|
|
1620
1628
|
IDBDatabase,
|
|
1621
1629
|
IDBObjectStore,
|
|
@@ -1624,31 +1632,31 @@ function Pr() {
|
|
|
1624
1632
|
IDBTransaction
|
|
1625
1633
|
]);
|
|
1626
1634
|
}
|
|
1627
|
-
function
|
|
1635
|
+
function Dr() {
|
|
1628
1636
|
return lt || (lt = [
|
|
1629
1637
|
IDBCursor.prototype.advance,
|
|
1630
1638
|
IDBCursor.prototype.continue,
|
|
1631
1639
|
IDBCursor.prototype.continuePrimaryKey
|
|
1632
1640
|
]);
|
|
1633
1641
|
}
|
|
1634
|
-
const
|
|
1635
|
-
function
|
|
1642
|
+
const qt = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap();
|
|
1643
|
+
function Nr(n) {
|
|
1636
1644
|
const e = new Promise((t, r) => {
|
|
1637
1645
|
const i = () => {
|
|
1638
1646
|
n.removeEventListener("success", s), n.removeEventListener("error", a);
|
|
1639
1647
|
}, s = () => {
|
|
1640
|
-
t(
|
|
1648
|
+
t(O(n.result)), i();
|
|
1641
1649
|
}, a = () => {
|
|
1642
1650
|
r(n.error), i();
|
|
1643
1651
|
};
|
|
1644
1652
|
n.addEventListener("success", s), n.addEventListener("error", a);
|
|
1645
1653
|
});
|
|
1646
1654
|
return e.then((t) => {
|
|
1647
|
-
t instanceof IDBCursor &&
|
|
1655
|
+
t instanceof IDBCursor && qt.set(t, n);
|
|
1648
1656
|
}).catch(() => {
|
|
1649
1657
|
}), Ge.set(e, n), e;
|
|
1650
1658
|
}
|
|
1651
|
-
function
|
|
1659
|
+
function Lr(n) {
|
|
1652
1660
|
if (Ue.has(n))
|
|
1653
1661
|
return;
|
|
1654
1662
|
const e = new Promise((t, r) => {
|
|
@@ -1669,11 +1677,11 @@ let xe = {
|
|
|
1669
1677
|
if (e === "done")
|
|
1670
1678
|
return Ue.get(n);
|
|
1671
1679
|
if (e === "objectStoreNames")
|
|
1672
|
-
return n.objectStoreNames ||
|
|
1680
|
+
return n.objectStoreNames || Kt.get(n);
|
|
1673
1681
|
if (e === "store")
|
|
1674
1682
|
return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
|
|
1675
1683
|
}
|
|
1676
|
-
return
|
|
1684
|
+
return O(n[e]);
|
|
1677
1685
|
},
|
|
1678
1686
|
set(n, e, t) {
|
|
1679
1687
|
return n[e] = t, !0;
|
|
@@ -1682,68 +1690,68 @@ let xe = {
|
|
|
1682
1690
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
|
1683
1691
|
}
|
|
1684
1692
|
};
|
|
1685
|
-
function
|
|
1693
|
+
function Mr(n) {
|
|
1686
1694
|
xe = n(xe);
|
|
1687
1695
|
}
|
|
1688
|
-
function
|
|
1696
|
+
function Ur(n) {
|
|
1689
1697
|
return n === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
|
|
1690
1698
|
const r = n.call(Ce(this), e, ...t);
|
|
1691
|
-
return
|
|
1692
|
-
} :
|
|
1693
|
-
return n.apply(Ce(this), e),
|
|
1699
|
+
return Kt.set(r, e.sort ? e.sort() : [e]), O(r);
|
|
1700
|
+
} : Dr().includes(n) ? function(...e) {
|
|
1701
|
+
return n.apply(Ce(this), e), O(qt.get(this));
|
|
1694
1702
|
} : function(...e) {
|
|
1695
|
-
return
|
|
1703
|
+
return O(n.apply(Ce(this), e));
|
|
1696
1704
|
};
|
|
1697
1705
|
}
|
|
1698
|
-
function
|
|
1699
|
-
return typeof n == "function" ?
|
|
1706
|
+
function xr(n) {
|
|
1707
|
+
return typeof n == "function" ? Ur(n) : (n instanceof IDBTransaction && Lr(n), Pr(n, Or()) ? new Proxy(n, xe) : n);
|
|
1700
1708
|
}
|
|
1701
|
-
function
|
|
1709
|
+
function O(n) {
|
|
1702
1710
|
if (n instanceof IDBRequest)
|
|
1703
|
-
return
|
|
1711
|
+
return Nr(n);
|
|
1704
1712
|
if (Re.has(n))
|
|
1705
1713
|
return Re.get(n);
|
|
1706
|
-
const e =
|
|
1714
|
+
const e = xr(n);
|
|
1707
1715
|
return e !== n && (Re.set(n, e), Ge.set(e, n)), e;
|
|
1708
1716
|
}
|
|
1709
1717
|
const Ce = (n) => Ge.get(n);
|
|
1710
|
-
function
|
|
1711
|
-
const a = indexedDB.open(n, e), c =
|
|
1718
|
+
function Fr(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
|
1719
|
+
const a = indexedDB.open(n, e), c = O(a);
|
|
1712
1720
|
return r && a.addEventListener("upgradeneeded", (o) => {
|
|
1713
|
-
r(
|
|
1721
|
+
r(O(a.result), o.oldVersion, o.newVersion, O(a.transaction), o);
|
|
1714
1722
|
}), t && a.addEventListener("blocked", (o) => t(
|
|
1715
1723
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
1716
1724
|
o.oldVersion,
|
|
1717
1725
|
o.newVersion,
|
|
1718
1726
|
o
|
|
1719
1727
|
)), c.then((o) => {
|
|
1720
|
-
s && o.addEventListener("close", () => s()), i && o.addEventListener("versionchange", (
|
|
1728
|
+
s && o.addEventListener("close", () => s()), i && o.addEventListener("versionchange", (l) => i(l.oldVersion, l.newVersion, l));
|
|
1721
1729
|
}).catch(() => {
|
|
1722
1730
|
}), c;
|
|
1723
1731
|
}
|
|
1724
|
-
const
|
|
1732
|
+
const Br = ["get", "getKey", "getAll", "getAllKeys", "count"], $r = ["put", "add", "delete", "clear"], Pe = /* @__PURE__ */ new Map();
|
|
1725
1733
|
function ut(n, e) {
|
|
1726
1734
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
|
1727
1735
|
return;
|
|
1728
1736
|
if (Pe.get(e))
|
|
1729
1737
|
return Pe.get(e);
|
|
1730
|
-
const t = e.replace(/FromIndex$/, ""), r = e !== t, i =
|
|
1738
|
+
const t = e.replace(/FromIndex$/, ""), r = e !== t, i = $r.includes(t);
|
|
1731
1739
|
if (
|
|
1732
1740
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
|
1733
|
-
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i ||
|
|
1741
|
+
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i || Br.includes(t))
|
|
1734
1742
|
)
|
|
1735
1743
|
return;
|
|
1736
1744
|
const s = async function(a, ...c) {
|
|
1737
1745
|
const o = this.transaction(a, i ? "readwrite" : "readonly");
|
|
1738
|
-
let
|
|
1739
|
-
return r && (
|
|
1740
|
-
|
|
1746
|
+
let l = o.store;
|
|
1747
|
+
return r && (l = l.index(c.shift())), (await Promise.all([
|
|
1748
|
+
l[t](...c),
|
|
1741
1749
|
i && o.done
|
|
1742
1750
|
]))[0];
|
|
1743
1751
|
};
|
|
1744
1752
|
return Pe.set(e, s), s;
|
|
1745
1753
|
}
|
|
1746
|
-
|
|
1754
|
+
Mr((n) => ({
|
|
1747
1755
|
...n,
|
|
1748
1756
|
get: (e, t, r) => ut(e, t) || n.get(e, t, r),
|
|
1749
1757
|
has: (e, t) => !!ut(e, t) || n.has(e, t)
|
|
@@ -1764,7 +1772,7 @@ Lr((n) => ({
|
|
|
1764
1772
|
* See the License for the specific language governing permissions and
|
|
1765
1773
|
* limitations under the License.
|
|
1766
1774
|
*/
|
|
1767
|
-
class
|
|
1775
|
+
class Hr {
|
|
1768
1776
|
constructor(e) {
|
|
1769
1777
|
this.container = e;
|
|
1770
1778
|
}
|
|
@@ -1772,7 +1780,7 @@ class $r {
|
|
|
1772
1780
|
// auth token refresh, and installations will send this string.
|
|
1773
1781
|
getPlatformInfoString() {
|
|
1774
1782
|
return this.container.getProviders().map((t) => {
|
|
1775
|
-
if (
|
|
1783
|
+
if (Vr(t)) {
|
|
1776
1784
|
const r = t.getImmediate();
|
|
1777
1785
|
return `${r.library}/${r.version}`;
|
|
1778
1786
|
} else
|
|
@@ -1780,7 +1788,7 @@ class $r {
|
|
|
1780
1788
|
}).filter((t) => t).join(" ");
|
|
1781
1789
|
}
|
|
1782
1790
|
}
|
|
1783
|
-
function
|
|
1791
|
+
function Vr(n) {
|
|
1784
1792
|
const e = n.getComponent();
|
|
1785
1793
|
return (e == null ? void 0 : e.type) === "VERSION";
|
|
1786
1794
|
}
|
|
@@ -1801,7 +1809,7 @@ const Fe = "@firebase/app", dt = "0.10.13";
|
|
|
1801
1809
|
* See the License for the specific language governing permissions and
|
|
1802
1810
|
* limitations under the License.
|
|
1803
1811
|
*/
|
|
1804
|
-
const
|
|
1812
|
+
const E = new Gt("@firebase/app"), jr = "@firebase/app-compat", Wr = "@firebase/analytics-compat", zr = "@firebase/analytics", Gr = "@firebase/app-check-compat", qr = "@firebase/app-check", Kr = "@firebase/auth", Jr = "@firebase/auth-compat", Yr = "@firebase/database", Xr = "@firebase/data-connect", Qr = "@firebase/database-compat", Zr = "@firebase/functions", ei = "@firebase/functions-compat", ti = "@firebase/installations", ni = "@firebase/installations-compat", ri = "@firebase/messaging", ii = "@firebase/messaging-compat", si = "@firebase/performance", ai = "@firebase/performance-compat", oi = "@firebase/remote-config", ci = "@firebase/remote-config-compat", li = "@firebase/storage", ui = "@firebase/storage-compat", di = "@firebase/firestore", hi = "@firebase/vertexai-preview", fi = "@firebase/firestore-compat", pi = "firebase", mi = "10.14.1";
|
|
1805
1813
|
/**
|
|
1806
1814
|
* @license
|
|
1807
1815
|
* Copyright 2019 Google LLC
|
|
@@ -1818,35 +1826,35 @@ const T = new zt("@firebase/app"), Vr = "@firebase/app-compat", jr = "@firebase/
|
|
|
1818
1826
|
* See the License for the specific language governing permissions and
|
|
1819
1827
|
* limitations under the License.
|
|
1820
1828
|
*/
|
|
1821
|
-
const Be = "[DEFAULT]",
|
|
1829
|
+
const Be = "[DEFAULT]", gi = {
|
|
1822
1830
|
[Fe]: "fire-core",
|
|
1823
|
-
[
|
|
1824
|
-
[
|
|
1825
|
-
[
|
|
1826
|
-
[
|
|
1827
|
-
[
|
|
1828
|
-
[
|
|
1829
|
-
[
|
|
1830
|
-
[
|
|
1831
|
-
[
|
|
1832
|
-
[
|
|
1833
|
-
[
|
|
1834
|
-
[
|
|
1835
|
-
[
|
|
1836
|
-
[
|
|
1837
|
-
[
|
|
1838
|
-
[
|
|
1839
|
-
[
|
|
1840
|
-
[
|
|
1841
|
-
[
|
|
1842
|
-
[
|
|
1843
|
-
[
|
|
1844
|
-
[
|
|
1845
|
-
[
|
|
1846
|
-
[
|
|
1847
|
-
[
|
|
1831
|
+
[jr]: "fire-core-compat",
|
|
1832
|
+
[zr]: "fire-analytics",
|
|
1833
|
+
[Wr]: "fire-analytics-compat",
|
|
1834
|
+
[qr]: "fire-app-check",
|
|
1835
|
+
[Gr]: "fire-app-check-compat",
|
|
1836
|
+
[Kr]: "fire-auth",
|
|
1837
|
+
[Jr]: "fire-auth-compat",
|
|
1838
|
+
[Yr]: "fire-rtdb",
|
|
1839
|
+
[Xr]: "fire-data-connect",
|
|
1840
|
+
[Qr]: "fire-rtdb-compat",
|
|
1841
|
+
[Zr]: "fire-fn",
|
|
1842
|
+
[ei]: "fire-fn-compat",
|
|
1843
|
+
[ti]: "fire-iid",
|
|
1844
|
+
[ni]: "fire-iid-compat",
|
|
1845
|
+
[ri]: "fire-fcm",
|
|
1846
|
+
[ii]: "fire-fcm-compat",
|
|
1847
|
+
[si]: "fire-perf",
|
|
1848
|
+
[ai]: "fire-perf-compat",
|
|
1849
|
+
[oi]: "fire-rc",
|
|
1850
|
+
[ci]: "fire-rc-compat",
|
|
1851
|
+
[li]: "fire-gcs",
|
|
1852
|
+
[ui]: "fire-gcs-compat",
|
|
1853
|
+
[di]: "fire-fst",
|
|
1854
|
+
[fi]: "fire-fst-compat",
|
|
1855
|
+
[hi]: "fire-vertex",
|
|
1848
1856
|
"fire-js": "fire-js",
|
|
1849
|
-
[
|
|
1857
|
+
[pi]: "fire-js-all"
|
|
1850
1858
|
};
|
|
1851
1859
|
/**
|
|
1852
1860
|
* @license
|
|
@@ -1864,30 +1872,30 @@ const Be = "[DEFAULT]", mi = {
|
|
|
1864
1872
|
* See the License for the specific language governing permissions and
|
|
1865
1873
|
* limitations under the License.
|
|
1866
1874
|
*/
|
|
1867
|
-
const fe = /* @__PURE__ */ new Map(),
|
|
1875
|
+
const fe = /* @__PURE__ */ new Map(), _i = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Map();
|
|
1868
1876
|
function ht(n, e) {
|
|
1869
1877
|
try {
|
|
1870
1878
|
n.container.addComponent(e);
|
|
1871
1879
|
} catch (t) {
|
|
1872
|
-
|
|
1880
|
+
E.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`, t);
|
|
1873
1881
|
}
|
|
1874
1882
|
}
|
|
1875
|
-
function
|
|
1883
|
+
function Y(n) {
|
|
1876
1884
|
const e = n.name;
|
|
1877
1885
|
if ($e.has(e))
|
|
1878
|
-
return
|
|
1886
|
+
return E.debug(`There were multiple attempts to register component ${e}.`), !1;
|
|
1879
1887
|
$e.set(e, n);
|
|
1880
1888
|
for (const t of fe.values())
|
|
1881
1889
|
ht(t, n);
|
|
1882
|
-
for (const t of
|
|
1890
|
+
for (const t of _i.values())
|
|
1883
1891
|
ht(t, n);
|
|
1884
1892
|
return !0;
|
|
1885
1893
|
}
|
|
1886
|
-
function
|
|
1894
|
+
function Jt(n, e) {
|
|
1887
1895
|
const t = n.container.getProvider("heartbeat").getImmediate({ optional: !0 });
|
|
1888
1896
|
return t && t.triggerHeartbeat(), n.container.getProvider(e);
|
|
1889
1897
|
}
|
|
1890
|
-
function
|
|
1898
|
+
function v(n) {
|
|
1891
1899
|
return n.settings !== void 0;
|
|
1892
1900
|
}
|
|
1893
1901
|
/**
|
|
@@ -1906,7 +1914,7 @@ function b(n) {
|
|
|
1906
1914
|
* See the License for the specific language governing permissions and
|
|
1907
1915
|
* limitations under the License.
|
|
1908
1916
|
*/
|
|
1909
|
-
const
|
|
1917
|
+
const yi = {
|
|
1910
1918
|
"no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
|
|
1911
1919
|
"bad-app-name": "Illegal App name: '{$appName}'",
|
|
1912
1920
|
"duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
|
|
@@ -1921,7 +1929,7 @@ const _i = {
|
|
|
1921
1929
|
"idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",
|
|
1922
1930
|
"finalization-registry-not-supported": "FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.",
|
|
1923
1931
|
"invalid-server-app-environment": "FirebaseServerApp is not for use in browser environments."
|
|
1924
|
-
},
|
|
1932
|
+
}, D = new Z("app", "Firebase", yi);
|
|
1925
1933
|
/**
|
|
1926
1934
|
* @license
|
|
1927
1935
|
* Copyright 2019 Google LLC
|
|
@@ -1938,7 +1946,7 @@ const _i = {
|
|
|
1938
1946
|
* See the License for the specific language governing permissions and
|
|
1939
1947
|
* limitations under the License.
|
|
1940
1948
|
*/
|
|
1941
|
-
class
|
|
1949
|
+
class vi {
|
|
1942
1950
|
constructor(e, t, r) {
|
|
1943
1951
|
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 W(
|
|
1944
1952
|
"app",
|
|
@@ -1977,7 +1985,7 @@ class yi {
|
|
|
1977
1985
|
*/
|
|
1978
1986
|
checkDestroyed() {
|
|
1979
1987
|
if (this.isDeleted)
|
|
1980
|
-
throw
|
|
1988
|
+
throw D.create("app-deleted", { appName: this._name });
|
|
1981
1989
|
}
|
|
1982
1990
|
}
|
|
1983
1991
|
/**
|
|
@@ -1996,17 +2004,17 @@ class yi {
|
|
|
1996
2004
|
* See the License for the specific language governing permissions and
|
|
1997
2005
|
* limitations under the License.
|
|
1998
2006
|
*/
|
|
1999
|
-
const
|
|
2000
|
-
function
|
|
2007
|
+
const te = mi;
|
|
2008
|
+
function Yt(n, e = {}) {
|
|
2001
2009
|
let t = n;
|
|
2002
2010
|
typeof e != "object" && (e = { name: e });
|
|
2003
2011
|
const r = Object.assign({ name: Be, automaticDataCollectionEnabled: !1 }, e), i = r.name;
|
|
2004
2012
|
if (typeof i != "string" || !i)
|
|
2005
|
-
throw
|
|
2013
|
+
throw D.create("bad-app-name", {
|
|
2006
2014
|
appName: String(i)
|
|
2007
2015
|
});
|
|
2008
|
-
if (t || (t =
|
|
2009
|
-
throw
|
|
2016
|
+
if (t || (t = Wt()), !t)
|
|
2017
|
+
throw D.create(
|
|
2010
2018
|
"no-options"
|
|
2011
2019
|
/* AppError.NO_OPTIONS */
|
|
2012
2020
|
);
|
|
@@ -2014,35 +2022,35 @@ function Jt(n, e = {}) {
|
|
|
2014
2022
|
if (s) {
|
|
2015
2023
|
if (he(t, s.options) && he(r, s.config))
|
|
2016
2024
|
return s;
|
|
2017
|
-
throw
|
|
2025
|
+
throw D.create("duplicate-app", { appName: i });
|
|
2018
2026
|
}
|
|
2019
|
-
const a = new
|
|
2027
|
+
const a = new Sr(i);
|
|
2020
2028
|
for (const o of $e.values())
|
|
2021
2029
|
a.addComponent(o);
|
|
2022
|
-
const c = new
|
|
2030
|
+
const c = new vi(t, r, a);
|
|
2023
2031
|
return fe.set(i, c), c;
|
|
2024
2032
|
}
|
|
2025
|
-
function
|
|
2033
|
+
function bi(n = Be) {
|
|
2026
2034
|
const e = fe.get(n);
|
|
2027
|
-
if (!e && n === Be &&
|
|
2028
|
-
return
|
|
2035
|
+
if (!e && n === Be && Wt())
|
|
2036
|
+
return Yt();
|
|
2029
2037
|
if (!e)
|
|
2030
|
-
throw
|
|
2038
|
+
throw D.create("no-app", { appName: n });
|
|
2031
2039
|
return e;
|
|
2032
2040
|
}
|
|
2033
2041
|
function $(n, e, t) {
|
|
2034
2042
|
var r;
|
|
2035
|
-
let i = (r =
|
|
2043
|
+
let i = (r = gi[n]) !== null && r !== void 0 ? r : n;
|
|
2036
2044
|
t && (i += `-${t}`);
|
|
2037
2045
|
const s = i.match(/\s|\//), a = e.match(/\s|\//);
|
|
2038
2046
|
if (s || a) {
|
|
2039
2047
|
const c = [
|
|
2040
2048
|
`Unable to register library "${i}" with version "${e}":`
|
|
2041
2049
|
];
|
|
2042
|
-
s && c.push(`library name "${i}" contains illegal characters (whitespace or "/")`), s && a && c.push("and"), a && c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),
|
|
2050
|
+
s && c.push(`library name "${i}" contains illegal characters (whitespace or "/")`), s && a && c.push("and"), a && c.push(`version name "${e}" contains illegal characters (whitespace or "/")`), E.warn(c.join(" "));
|
|
2043
2051
|
return;
|
|
2044
2052
|
}
|
|
2045
|
-
|
|
2053
|
+
Y(new W(
|
|
2046
2054
|
`${i}-version`,
|
|
2047
2055
|
() => ({ library: i, version: e }),
|
|
2048
2056
|
"VERSION"
|
|
@@ -2065,57 +2073,57 @@ function $(n, e, t) {
|
|
|
2065
2073
|
* See the License for the specific language governing permissions and
|
|
2066
2074
|
* limitations under the License.
|
|
2067
2075
|
*/
|
|
2068
|
-
const
|
|
2076
|
+
const Ii = "firebase-heartbeat-database", wi = 1, X = "firebase-heartbeat-store";
|
|
2069
2077
|
let Oe = null;
|
|
2070
|
-
function
|
|
2071
|
-
return Oe || (Oe =
|
|
2078
|
+
function Xt() {
|
|
2079
|
+
return Oe || (Oe = Fr(Ii, wi, {
|
|
2072
2080
|
upgrade: (n, e) => {
|
|
2073
2081
|
switch (e) {
|
|
2074
2082
|
case 0:
|
|
2075
2083
|
try {
|
|
2076
|
-
n.createObjectStore(
|
|
2084
|
+
n.createObjectStore(X);
|
|
2077
2085
|
} catch (t) {
|
|
2078
2086
|
console.warn(t);
|
|
2079
2087
|
}
|
|
2080
2088
|
}
|
|
2081
2089
|
}
|
|
2082
2090
|
}).catch((n) => {
|
|
2083
|
-
throw
|
|
2091
|
+
throw D.create("idb-open", {
|
|
2084
2092
|
originalErrorMessage: n.message
|
|
2085
2093
|
});
|
|
2086
2094
|
})), Oe;
|
|
2087
2095
|
}
|
|
2088
|
-
async function
|
|
2096
|
+
async function Ei(n) {
|
|
2089
2097
|
try {
|
|
2090
|
-
const t = (await
|
|
2098
|
+
const t = (await Xt()).transaction(X), r = await t.objectStore(X).get(Qt(n));
|
|
2091
2099
|
return await t.done, r;
|
|
2092
2100
|
} catch (e) {
|
|
2093
|
-
if (e instanceof
|
|
2094
|
-
|
|
2101
|
+
if (e instanceof L)
|
|
2102
|
+
E.warn(e.message);
|
|
2095
2103
|
else {
|
|
2096
|
-
const t =
|
|
2104
|
+
const t = D.create("idb-get", {
|
|
2097
2105
|
originalErrorMessage: e == null ? void 0 : e.message
|
|
2098
2106
|
});
|
|
2099
|
-
|
|
2107
|
+
E.warn(t.message);
|
|
2100
2108
|
}
|
|
2101
2109
|
}
|
|
2102
2110
|
}
|
|
2103
2111
|
async function ft(n, e) {
|
|
2104
2112
|
try {
|
|
2105
|
-
const r = (await
|
|
2106
|
-
await r.objectStore(
|
|
2113
|
+
const r = (await Xt()).transaction(X, "readwrite");
|
|
2114
|
+
await r.objectStore(X).put(e, Qt(n)), await r.done;
|
|
2107
2115
|
} catch (t) {
|
|
2108
|
-
if (t instanceof
|
|
2109
|
-
|
|
2116
|
+
if (t instanceof L)
|
|
2117
|
+
E.warn(t.message);
|
|
2110
2118
|
else {
|
|
2111
|
-
const r =
|
|
2119
|
+
const r = D.create("idb-set", {
|
|
2112
2120
|
originalErrorMessage: t == null ? void 0 : t.message
|
|
2113
2121
|
});
|
|
2114
|
-
|
|
2122
|
+
E.warn(r.message);
|
|
2115
2123
|
}
|
|
2116
2124
|
}
|
|
2117
2125
|
}
|
|
2118
|
-
function
|
|
2126
|
+
function Qt(n) {
|
|
2119
2127
|
return `${n.name}!${n.options.appId}`;
|
|
2120
2128
|
}
|
|
2121
2129
|
/**
|
|
@@ -2134,12 +2142,12 @@ function Xt(n) {
|
|
|
2134
2142
|
* See the License for the specific language governing permissions and
|
|
2135
2143
|
* limitations under the License.
|
|
2136
2144
|
*/
|
|
2137
|
-
const
|
|
2138
|
-
class
|
|
2145
|
+
const Ti = 1024, Si = 30 * 24 * 60 * 60 * 1e3;
|
|
2146
|
+
class ki {
|
|
2139
2147
|
constructor(e) {
|
|
2140
2148
|
this.container = e, this._heartbeatsCache = null;
|
|
2141
2149
|
const t = this.container.getProvider("app").getImmediate();
|
|
2142
|
-
this._storage = new
|
|
2150
|
+
this._storage = new Ri(t), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
|
|
2143
2151
|
}
|
|
2144
2152
|
/**
|
|
2145
2153
|
* Called to report a heartbeat. The function will generate
|
|
@@ -2154,10 +2162,10 @@ class Si {
|
|
|
2154
2162
|
const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s = pt();
|
|
2155
2163
|
return ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null && (this._heartbeatsCache = await this._heartbeatsCachePromise, ((t = this._heartbeatsCache) === null || t === void 0 ? void 0 : t.heartbeats) == null) || this._heartbeatsCache.lastSentHeartbeatDate === s || this._heartbeatsCache.heartbeats.some((a) => a.date === s) ? void 0 : (this._heartbeatsCache.heartbeats.push({ date: s, agent: i }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((a) => {
|
|
2156
2164
|
const c = new Date(a.date).valueOf();
|
|
2157
|
-
return Date.now() - c <=
|
|
2165
|
+
return Date.now() - c <= Si;
|
|
2158
2166
|
}), this._storage.overwrite(this._heartbeatsCache));
|
|
2159
2167
|
} catch (r) {
|
|
2160
|
-
|
|
2168
|
+
E.warn(r);
|
|
2161
2169
|
}
|
|
2162
2170
|
}
|
|
2163
2171
|
/**
|
|
@@ -2172,17 +2180,17 @@ class Si {
|
|
|
2172
2180
|
try {
|
|
2173
2181
|
if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
|
|
2174
2182
|
return "";
|
|
2175
|
-
const t = pt(), { heartbeatsToSend: r, unsentEntries: i } =
|
|
2183
|
+
const t = pt(), { heartbeatsToSend: r, unsentEntries: i } = Ai(this._heartbeatsCache.heartbeats), s = de(JSON.stringify({ version: 2, heartbeats: r }));
|
|
2176
2184
|
return this._heartbeatsCache.lastSentHeartbeatDate = t, i.length > 0 ? (this._heartbeatsCache.heartbeats = i, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), s;
|
|
2177
2185
|
} catch (t) {
|
|
2178
|
-
return
|
|
2186
|
+
return E.warn(t), "";
|
|
2179
2187
|
}
|
|
2180
2188
|
}
|
|
2181
2189
|
}
|
|
2182
2190
|
function pt() {
|
|
2183
2191
|
return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
|
2184
2192
|
}
|
|
2185
|
-
function
|
|
2193
|
+
function Ai(n, e = Ti) {
|
|
2186
2194
|
const t = [];
|
|
2187
2195
|
let r = n.slice();
|
|
2188
2196
|
for (const i of n) {
|
|
@@ -2206,19 +2214,19 @@ function ki(n, e = Ei) {
|
|
|
2206
2214
|
unsentEntries: r
|
|
2207
2215
|
};
|
|
2208
2216
|
}
|
|
2209
|
-
class
|
|
2217
|
+
class Ri {
|
|
2210
2218
|
constructor(e) {
|
|
2211
2219
|
this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
|
2212
2220
|
}
|
|
2213
2221
|
async runIndexedDBEnvironmentCheck() {
|
|
2214
|
-
return
|
|
2222
|
+
return fr() ? pr().then(() => !0).catch(() => !1) : !1;
|
|
2215
2223
|
}
|
|
2216
2224
|
/**
|
|
2217
2225
|
* Read all heartbeats.
|
|
2218
2226
|
*/
|
|
2219
2227
|
async read() {
|
|
2220
2228
|
if (await this._canUseIndexedDBPromise) {
|
|
2221
|
-
const t = await
|
|
2229
|
+
const t = await Ei(this.app);
|
|
2222
2230
|
return t != null && t.heartbeats ? t : { heartbeats: [] };
|
|
2223
2231
|
} else
|
|
2224
2232
|
return { heartbeats: [] };
|
|
@@ -2273,21 +2281,21 @@ function mt(n) {
|
|
|
2273
2281
|
* See the License for the specific language governing permissions and
|
|
2274
2282
|
* limitations under the License.
|
|
2275
2283
|
*/
|
|
2276
|
-
function
|
|
2277
|
-
|
|
2284
|
+
function Ci(n) {
|
|
2285
|
+
Y(new W(
|
|
2278
2286
|
"platform-logger",
|
|
2279
|
-
(e) => new
|
|
2287
|
+
(e) => new Hr(e),
|
|
2280
2288
|
"PRIVATE"
|
|
2281
2289
|
/* ComponentType.PRIVATE */
|
|
2282
|
-
)),
|
|
2290
|
+
)), Y(new W(
|
|
2283
2291
|
"heartbeat",
|
|
2284
|
-
(e) => new
|
|
2292
|
+
(e) => new ki(e),
|
|
2285
2293
|
"PRIVATE"
|
|
2286
2294
|
/* ComponentType.PRIVATE */
|
|
2287
2295
|
)), $(Fe, dt, n), $(Fe, dt, "esm2017"), $("fire-js", "");
|
|
2288
2296
|
}
|
|
2289
|
-
|
|
2290
|
-
var
|
|
2297
|
+
Ci("");
|
|
2298
|
+
var Pi = "firebase", Oi = "10.14.1";
|
|
2291
2299
|
/**
|
|
2292
2300
|
* @license
|
|
2293
2301
|
* Copyright 2020 Google LLC
|
|
@@ -2304,7 +2312,7 @@ var Ci = "firebase", Pi = "10.14.1";
|
|
|
2304
2312
|
* See the License for the specific language governing permissions and
|
|
2305
2313
|
* limitations under the License.
|
|
2306
2314
|
*/
|
|
2307
|
-
$(
|
|
2315
|
+
$(Pi, Oi, "app");
|
|
2308
2316
|
var gt = function() {
|
|
2309
2317
|
return gt = Object.assign || function(e) {
|
|
2310
2318
|
for (var t, r = 1, i = arguments.length; r < i; r++) {
|
|
@@ -2322,12 +2330,12 @@ function qe(n, e) {
|
|
|
2322
2330
|
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[i]) && (t[r[i]] = n[r[i]]);
|
|
2323
2331
|
return t;
|
|
2324
2332
|
}
|
|
2325
|
-
function
|
|
2333
|
+
function Zt() {
|
|
2326
2334
|
return {
|
|
2327
2335
|
"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."
|
|
2328
2336
|
};
|
|
2329
2337
|
}
|
|
2330
|
-
const
|
|
2338
|
+
const Di = Zt, en = new Z("auth", "Firebase", Zt());
|
|
2331
2339
|
/**
|
|
2332
2340
|
* @license
|
|
2333
2341
|
* Copyright 2020 Google LLC
|
|
@@ -2344,12 +2352,12 @@ const Oi = Qt, Zt = new Q("auth", "Firebase", Qt());
|
|
|
2344
2352
|
* See the License for the specific language governing permissions and
|
|
2345
2353
|
* limitations under the License.
|
|
2346
2354
|
*/
|
|
2347
|
-
const pe = new
|
|
2348
|
-
function
|
|
2349
|
-
pe.logLevel <=
|
|
2355
|
+
const pe = new Gt("@firebase/auth");
|
|
2356
|
+
function Ni(n, ...e) {
|
|
2357
|
+
pe.logLevel <= f.WARN && pe.warn(`Auth (${te}): ${n}`, ...e);
|
|
2350
2358
|
}
|
|
2351
|
-
function
|
|
2352
|
-
pe.logLevel <=
|
|
2359
|
+
function ae(n, ...e) {
|
|
2360
|
+
pe.logLevel <= f.ERROR && pe.error(`Auth (${te}): ${n}`, ...e);
|
|
2353
2361
|
}
|
|
2354
2362
|
/**
|
|
2355
2363
|
* @license
|
|
@@ -2367,38 +2375,38 @@ function se(n, ...e) {
|
|
|
2367
2375
|
* See the License for the specific language governing permissions and
|
|
2368
2376
|
* limitations under the License.
|
|
2369
2377
|
*/
|
|
2370
|
-
function
|
|
2378
|
+
function T(n, ...e) {
|
|
2371
2379
|
throw Ke(n, ...e);
|
|
2372
2380
|
}
|
|
2373
2381
|
function _(n, ...e) {
|
|
2374
2382
|
return Ke(n, ...e);
|
|
2375
2383
|
}
|
|
2376
|
-
function
|
|
2377
|
-
const r = Object.assign(Object.assign({},
|
|
2378
|
-
return new
|
|
2384
|
+
function tn(n, e, t) {
|
|
2385
|
+
const r = Object.assign(Object.assign({}, Di()), { [e]: t });
|
|
2386
|
+
return new Z("auth", "Firebase", r).create(e, {
|
|
2379
2387
|
appName: n.name
|
|
2380
2388
|
});
|
|
2381
2389
|
}
|
|
2382
|
-
function
|
|
2383
|
-
return
|
|
2390
|
+
function N(n) {
|
|
2391
|
+
return tn(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
2384
2392
|
}
|
|
2385
2393
|
function Ke(n, ...e) {
|
|
2386
2394
|
if (typeof n != "string") {
|
|
2387
2395
|
const t = e[0], r = [...e.slice(1)];
|
|
2388
2396
|
return r[0] && (r[0].appName = n.name), n._errorFactory.create(t, ...r);
|
|
2389
2397
|
}
|
|
2390
|
-
return
|
|
2398
|
+
return en.create(n, ...e);
|
|
2391
2399
|
}
|
|
2392
2400
|
function h(n, e, ...t) {
|
|
2393
2401
|
if (!n)
|
|
2394
2402
|
throw Ke(e, ...t);
|
|
2395
2403
|
}
|
|
2396
|
-
function
|
|
2404
|
+
function b(n) {
|
|
2397
2405
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
2398
|
-
throw
|
|
2406
|
+
throw ae(e), new Error(e);
|
|
2399
2407
|
}
|
|
2400
|
-
function
|
|
2401
|
-
n ||
|
|
2408
|
+
function S(n, e) {
|
|
2409
|
+
n || b(e);
|
|
2402
2410
|
}
|
|
2403
2411
|
/**
|
|
2404
2412
|
* @license
|
|
@@ -2420,7 +2428,7 @@ function He() {
|
|
|
2420
2428
|
var n;
|
|
2421
2429
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
2422
2430
|
}
|
|
2423
|
-
function
|
|
2431
|
+
function Li() {
|
|
2424
2432
|
return _t() === "http:" || _t() === "https:";
|
|
2425
2433
|
}
|
|
2426
2434
|
function _t() {
|
|
@@ -2443,15 +2451,15 @@ function _t() {
|
|
|
2443
2451
|
* See the License for the specific language governing permissions and
|
|
2444
2452
|
* limitations under the License.
|
|
2445
2453
|
*/
|
|
2446
|
-
function
|
|
2454
|
+
function Mi() {
|
|
2447
2455
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
2448
2456
|
// This is especially true for Cordova apps which have unreliable
|
|
2449
2457
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
2450
2458
|
// installed which overwrites the native navigator.onLine value and
|
|
2451
2459
|
// defines navigator.connection.
|
|
2452
|
-
(
|
|
2460
|
+
(Li() || ur() || "connection" in navigator) ? navigator.onLine : !0;
|
|
2453
2461
|
}
|
|
2454
|
-
function
|
|
2462
|
+
function Ui() {
|
|
2455
2463
|
if (typeof navigator > "u")
|
|
2456
2464
|
return null;
|
|
2457
2465
|
const n = navigator;
|
|
@@ -2479,12 +2487,12 @@ function Mi() {
|
|
|
2479
2487
|
* See the License for the specific language governing permissions and
|
|
2480
2488
|
* limitations under the License.
|
|
2481
2489
|
*/
|
|
2482
|
-
class
|
|
2490
|
+
class ne {
|
|
2483
2491
|
constructor(e, t) {
|
|
2484
|
-
this.shortDelay = e, this.longDelay = t,
|
|
2492
|
+
this.shortDelay = e, this.longDelay = t, S(t > e, "Short delay should be less than long delay!"), this.isMobile = cr() || dr();
|
|
2485
2493
|
}
|
|
2486
2494
|
get() {
|
|
2487
|
-
return
|
|
2495
|
+
return Mi() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
2488
2496
|
}
|
|
2489
2497
|
}
|
|
2490
2498
|
/**
|
|
@@ -2504,7 +2512,7 @@ class te {
|
|
|
2504
2512
|
* limitations under the License.
|
|
2505
2513
|
*/
|
|
2506
2514
|
function Je(n, e) {
|
|
2507
|
-
|
|
2515
|
+
S(n.emulator, "Emulator should always be set here");
|
|
2508
2516
|
const { url: t } = n.emulator;
|
|
2509
2517
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
2510
2518
|
}
|
|
@@ -2524,7 +2532,7 @@ function Je(n, e) {
|
|
|
2524
2532
|
* See the License for the specific language governing permissions and
|
|
2525
2533
|
* limitations under the License.
|
|
2526
2534
|
*/
|
|
2527
|
-
class
|
|
2535
|
+
class nn {
|
|
2528
2536
|
static initialize(e, t, r) {
|
|
2529
2537
|
this.fetchImpl = e, t && (this.headersImpl = t), r && (this.responseImpl = r);
|
|
2530
2538
|
}
|
|
@@ -2537,7 +2545,7 @@ class tn {
|
|
|
2537
2545
|
return globalThis.fetch;
|
|
2538
2546
|
if (typeof fetch < "u")
|
|
2539
2547
|
return fetch;
|
|
2540
|
-
|
|
2548
|
+
b("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2541
2549
|
}
|
|
2542
2550
|
static headers() {
|
|
2543
2551
|
if (this.headersImpl)
|
|
@@ -2548,7 +2556,7 @@ class tn {
|
|
|
2548
2556
|
return globalThis.Headers;
|
|
2549
2557
|
if (typeof Headers < "u")
|
|
2550
2558
|
return Headers;
|
|
2551
|
-
|
|
2559
|
+
b("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2552
2560
|
}
|
|
2553
2561
|
static response() {
|
|
2554
2562
|
if (this.responseImpl)
|
|
@@ -2559,7 +2567,7 @@ class tn {
|
|
|
2559
2567
|
return globalThis.Response;
|
|
2560
2568
|
if (typeof Response < "u")
|
|
2561
2569
|
return Response;
|
|
2562
|
-
|
|
2570
|
+
b("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2563
2571
|
}
|
|
2564
2572
|
}
|
|
2565
2573
|
/**
|
|
@@ -2578,7 +2586,7 @@ class tn {
|
|
|
2578
2586
|
* See the License for the specific language governing permissions and
|
|
2579
2587
|
* limitations under the License.
|
|
2580
2588
|
*/
|
|
2581
|
-
const
|
|
2589
|
+
const xi = {
|
|
2582
2590
|
// Custom token errors.
|
|
2583
2591
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
2584
2592
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -2669,17 +2677,17 @@ const Ui = {
|
|
|
2669
2677
|
* See the License for the specific language governing permissions and
|
|
2670
2678
|
* limitations under the License.
|
|
2671
2679
|
*/
|
|
2672
|
-
const
|
|
2680
|
+
const Fi = new ne(3e4, 6e4);
|
|
2673
2681
|
function ve(n, e) {
|
|
2674
2682
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
2675
2683
|
}
|
|
2676
2684
|
async function G(n, e, t, r, i = {}) {
|
|
2677
|
-
return
|
|
2685
|
+
return rn(n, i, async () => {
|
|
2678
2686
|
let s = {}, a = {};
|
|
2679
2687
|
r && (e === "GET" ? a = r : s = {
|
|
2680
2688
|
body: JSON.stringify(r)
|
|
2681
2689
|
});
|
|
2682
|
-
const c =
|
|
2690
|
+
const c = ee(Object.assign({ key: n.config.apiKey }, a)).slice(1), o = await n._getAdditionalHeaders();
|
|
2683
2691
|
o[
|
|
2684
2692
|
"Content-Type"
|
|
2685
2693
|
/* HttpHeader.CONTENT_TYPE */
|
|
@@ -2687,71 +2695,71 @@ async function G(n, e, t, r, i = {}) {
|
|
|
2687
2695
|
"X-Firebase-Locale"
|
|
2688
2696
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
2689
2697
|
] = n.languageCode);
|
|
2690
|
-
const
|
|
2698
|
+
const l = Object.assign({
|
|
2691
2699
|
method: e,
|
|
2692
2700
|
headers: o
|
|
2693
2701
|
}, s);
|
|
2694
|
-
return
|
|
2702
|
+
return lr() || (l.referrerPolicy = "no-referrer"), nn.fetch()(an(n, n.config.apiHost, t, c), l);
|
|
2695
2703
|
});
|
|
2696
2704
|
}
|
|
2697
|
-
async function
|
|
2705
|
+
async function rn(n, e, t) {
|
|
2698
2706
|
n._canInitEmulator = !1;
|
|
2699
|
-
const r = Object.assign(Object.assign({},
|
|
2707
|
+
const r = Object.assign(Object.assign({}, xi), e);
|
|
2700
2708
|
try {
|
|
2701
|
-
const i = new
|
|
2709
|
+
const i = new Bi(n), s = await Promise.race([
|
|
2702
2710
|
t(),
|
|
2703
2711
|
i.promise
|
|
2704
2712
|
]);
|
|
2705
2713
|
i.clearNetworkTimeout();
|
|
2706
2714
|
const a = await s.json();
|
|
2707
2715
|
if ("needConfirmation" in a)
|
|
2708
|
-
throw
|
|
2716
|
+
throw se(n, "account-exists-with-different-credential", a);
|
|
2709
2717
|
if (s.ok && !("errorMessage" in a))
|
|
2710
2718
|
return a;
|
|
2711
2719
|
{
|
|
2712
|
-
const c = s.ok ? a.errorMessage : a.error.message, [o,
|
|
2720
|
+
const c = s.ok ? a.errorMessage : a.error.message, [o, l] = c.split(" : ");
|
|
2713
2721
|
if (o === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
2714
|
-
throw
|
|
2722
|
+
throw se(n, "credential-already-in-use", a);
|
|
2715
2723
|
if (o === "EMAIL_EXISTS")
|
|
2716
|
-
throw
|
|
2724
|
+
throw se(n, "email-already-in-use", a);
|
|
2717
2725
|
if (o === "USER_DISABLED")
|
|
2718
|
-
throw
|
|
2719
|
-
const
|
|
2720
|
-
if (
|
|
2721
|
-
throw
|
|
2722
|
-
|
|
2726
|
+
throw se(n, "user-disabled", a);
|
|
2727
|
+
const u = r[o] || o.toLowerCase().replace(/[_\s]+/g, "-");
|
|
2728
|
+
if (l)
|
|
2729
|
+
throw tn(n, u, l);
|
|
2730
|
+
T(n, u);
|
|
2723
2731
|
}
|
|
2724
2732
|
} catch (i) {
|
|
2725
|
-
if (i instanceof
|
|
2733
|
+
if (i instanceof L)
|
|
2726
2734
|
throw i;
|
|
2727
|
-
|
|
2735
|
+
T(n, "network-request-failed", { message: String(i) });
|
|
2728
2736
|
}
|
|
2729
2737
|
}
|
|
2730
|
-
async function
|
|
2738
|
+
async function sn(n, e, t, r, i = {}) {
|
|
2731
2739
|
const s = await G(n, e, t, r, i);
|
|
2732
|
-
return "mfaPendingCredential" in s &&
|
|
2740
|
+
return "mfaPendingCredential" in s && T(n, "multi-factor-auth-required", {
|
|
2733
2741
|
_serverResponse: s
|
|
2734
2742
|
}), s;
|
|
2735
2743
|
}
|
|
2736
|
-
function
|
|
2744
|
+
function an(n, e, t, r) {
|
|
2737
2745
|
const i = `${e}${t}?${r}`;
|
|
2738
2746
|
return n.config.emulator ? Je(n.config, i) : `${n.config.apiScheme}://${i}`;
|
|
2739
2747
|
}
|
|
2740
|
-
class
|
|
2748
|
+
class Bi {
|
|
2741
2749
|
constructor(e) {
|
|
2742
2750
|
this.auth = e, this.timer = null, this.promise = new Promise((t, r) => {
|
|
2743
2751
|
this.timer = setTimeout(() => r(_(
|
|
2744
2752
|
this.auth,
|
|
2745
2753
|
"network-request-failed"
|
|
2746
2754
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
2747
|
-
)),
|
|
2755
|
+
)), Fi.get());
|
|
2748
2756
|
});
|
|
2749
2757
|
}
|
|
2750
2758
|
clearNetworkTimeout() {
|
|
2751
2759
|
clearTimeout(this.timer);
|
|
2752
2760
|
}
|
|
2753
2761
|
}
|
|
2754
|
-
function
|
|
2762
|
+
function se(n, e, t) {
|
|
2755
2763
|
const r = {
|
|
2756
2764
|
appName: n.name
|
|
2757
2765
|
};
|
|
@@ -2775,10 +2783,10 @@ function ie(n, e, t) {
|
|
|
2775
2783
|
* See the License for the specific language governing permissions and
|
|
2776
2784
|
* limitations under the License.
|
|
2777
2785
|
*/
|
|
2778
|
-
async function
|
|
2786
|
+
async function $i(n, e) {
|
|
2779
2787
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
2780
2788
|
}
|
|
2781
|
-
async function
|
|
2789
|
+
async function on(n, e) {
|
|
2782
2790
|
return G(n, "POST", "/v1/accounts:lookup", e);
|
|
2783
2791
|
}
|
|
2784
2792
|
/**
|
|
@@ -2797,7 +2805,7 @@ async function an(n, e) {
|
|
|
2797
2805
|
* See the License for the specific language governing permissions and
|
|
2798
2806
|
* limitations under the License.
|
|
2799
2807
|
*/
|
|
2800
|
-
function
|
|
2808
|
+
function J(n) {
|
|
2801
2809
|
if (n)
|
|
2802
2810
|
try {
|
|
2803
2811
|
const e = new Date(Number(n));
|
|
@@ -2806,7 +2814,7 @@ function K(n) {
|
|
|
2806
2814
|
} catch {
|
|
2807
2815
|
}
|
|
2808
2816
|
}
|
|
2809
|
-
async function
|
|
2817
|
+
async function Hi(n, e = !1) {
|
|
2810
2818
|
const t = z(n), r = await t.getIdToken(e), i = Ye(r);
|
|
2811
2819
|
h(
|
|
2812
2820
|
i && i.exp && i.auth_time && i.iat,
|
|
@@ -2818,9 +2826,9 @@ async function $i(n, e = !1) {
|
|
|
2818
2826
|
return {
|
|
2819
2827
|
claims: i,
|
|
2820
2828
|
token: r,
|
|
2821
|
-
authTime:
|
|
2822
|
-
issuedAtTime:
|
|
2823
|
-
expirationTime:
|
|
2829
|
+
authTime: J(De(i.auth_time)),
|
|
2830
|
+
issuedAtTime: J(De(i.iat)),
|
|
2831
|
+
expirationTime: J(De(i.exp)),
|
|
2824
2832
|
signInProvider: a || null,
|
|
2825
2833
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
2826
2834
|
};
|
|
@@ -2831,12 +2839,12 @@ function De(n) {
|
|
|
2831
2839
|
function Ye(n) {
|
|
2832
2840
|
const [e, t, r] = n.split(".");
|
|
2833
2841
|
if (e === void 0 || t === void 0 || r === void 0)
|
|
2834
|
-
return
|
|
2842
|
+
return ae("JWT malformed, contained fewer than 3 sections"), null;
|
|
2835
2843
|
try {
|
|
2836
|
-
const i =
|
|
2837
|
-
return i ? JSON.parse(i) : (
|
|
2844
|
+
const i = Vt(t);
|
|
2845
|
+
return i ? JSON.parse(i) : (ae("Failed to decode base64 JWT payload"), null);
|
|
2838
2846
|
} catch (i) {
|
|
2839
|
-
return
|
|
2847
|
+
return ae("Caught error parsing JWT payload as JSON", i == null ? void 0 : i.toString()), null;
|
|
2840
2848
|
}
|
|
2841
2849
|
}
|
|
2842
2850
|
function yt(n) {
|
|
@@ -2871,16 +2879,16 @@ function yt(n) {
|
|
|
2871
2879
|
* See the License for the specific language governing permissions and
|
|
2872
2880
|
* limitations under the License.
|
|
2873
2881
|
*/
|
|
2874
|
-
async function
|
|
2882
|
+
async function Q(n, e, t = !1) {
|
|
2875
2883
|
if (t)
|
|
2876
2884
|
return e;
|
|
2877
2885
|
try {
|
|
2878
2886
|
return await e;
|
|
2879
2887
|
} catch (r) {
|
|
2880
|
-
throw r instanceof
|
|
2888
|
+
throw r instanceof L && Vi(r) && n.auth.currentUser === n && await n.auth.signOut(), r;
|
|
2881
2889
|
}
|
|
2882
2890
|
}
|
|
2883
|
-
function
|
|
2891
|
+
function Vi({ code: n }) {
|
|
2884
2892
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
2885
2893
|
}
|
|
2886
2894
|
/**
|
|
@@ -2899,7 +2907,7 @@ function Hi({ code: n }) {
|
|
|
2899
2907
|
* See the License for the specific language governing permissions and
|
|
2900
2908
|
* limitations under the License.
|
|
2901
2909
|
*/
|
|
2902
|
-
class
|
|
2910
|
+
class ji {
|
|
2903
2911
|
constructor(e) {
|
|
2904
2912
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
2905
2913
|
}
|
|
@@ -2966,7 +2974,7 @@ class Ve {
|
|
|
2966
2974
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
2967
2975
|
}
|
|
2968
2976
|
_initializeTime() {
|
|
2969
|
-
this.lastSignInTime =
|
|
2977
|
+
this.lastSignInTime = J(this.lastLoginAt), this.creationTime = J(this.createdAt);
|
|
2970
2978
|
}
|
|
2971
2979
|
_copy(e) {
|
|
2972
2980
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -2996,7 +3004,7 @@ class Ve {
|
|
|
2996
3004
|
*/
|
|
2997
3005
|
async function me(n) {
|
|
2998
3006
|
var e;
|
|
2999
|
-
const t = n.auth, r = await n.getIdToken(), i = await
|
|
3007
|
+
const t = n.auth, r = await n.getIdToken(), i = await Q(n, on(t, { idToken: r }));
|
|
3000
3008
|
h(
|
|
3001
3009
|
i == null ? void 0 : i.users.length,
|
|
3002
3010
|
t,
|
|
@@ -3005,7 +3013,7 @@ async function me(n) {
|
|
|
3005
3013
|
);
|
|
3006
3014
|
const s = i.users[0];
|
|
3007
3015
|
n._notifyReloadListener(s);
|
|
3008
|
-
const a = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
3016
|
+
const a = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? cn(s.providerUserInfo) : [], c = zi(n.providerData, a), o = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), u = o ? l : !1, d = {
|
|
3009
3017
|
uid: s.localId,
|
|
3010
3018
|
displayName: s.displayName || null,
|
|
3011
3019
|
photoURL: s.photoUrl || null,
|
|
@@ -3015,18 +3023,18 @@ async function me(n) {
|
|
|
3015
3023
|
tenantId: s.tenantId || null,
|
|
3016
3024
|
providerData: c,
|
|
3017
3025
|
metadata: new Ve(s.createdAt, s.lastLoginAt),
|
|
3018
|
-
isAnonymous:
|
|
3026
|
+
isAnonymous: u
|
|
3019
3027
|
};
|
|
3020
3028
|
Object.assign(n, d);
|
|
3021
3029
|
}
|
|
3022
|
-
async function
|
|
3030
|
+
async function Wi(n) {
|
|
3023
3031
|
const e = z(n);
|
|
3024
3032
|
await me(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
3025
3033
|
}
|
|
3026
|
-
function
|
|
3034
|
+
function zi(n, e) {
|
|
3027
3035
|
return [...n.filter((r) => !e.some((i) => i.providerId === r.providerId)), ...e];
|
|
3028
3036
|
}
|
|
3029
|
-
function
|
|
3037
|
+
function cn(n) {
|
|
3030
3038
|
return n.map((e) => {
|
|
3031
3039
|
var { providerId: t } = e, r = qe(e, ["providerId"]);
|
|
3032
3040
|
return {
|
|
@@ -3055,16 +3063,16 @@ function on(n) {
|
|
|
3055
3063
|
* See the License for the specific language governing permissions and
|
|
3056
3064
|
* limitations under the License.
|
|
3057
3065
|
*/
|
|
3058
|
-
async function
|
|
3059
|
-
const t = await
|
|
3060
|
-
const r =
|
|
3066
|
+
async function Gi(n, e) {
|
|
3067
|
+
const t = await rn(n, {}, async () => {
|
|
3068
|
+
const r = ee({
|
|
3061
3069
|
grant_type: "refresh_token",
|
|
3062
3070
|
refresh_token: e
|
|
3063
|
-
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, a =
|
|
3071
|
+
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, a = an(n, i, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
3064
3072
|
return c[
|
|
3065
3073
|
"Content-Type"
|
|
3066
3074
|
/* HttpHeader.CONTENT_TYPE */
|
|
3067
|
-
] = "application/x-www-form-urlencoded",
|
|
3075
|
+
] = "application/x-www-form-urlencoded", nn.fetch()(a, {
|
|
3068
3076
|
method: "POST",
|
|
3069
3077
|
headers: c,
|
|
3070
3078
|
body: r
|
|
@@ -3076,7 +3084,7 @@ async function zi(n, e) {
|
|
|
3076
3084
|
refreshToken: t.refresh_token
|
|
3077
3085
|
};
|
|
3078
3086
|
}
|
|
3079
|
-
async function
|
|
3087
|
+
async function qi(n, e) {
|
|
3080
3088
|
return G(n, "POST", "/v2/accounts:revokeToken", ve(n, e));
|
|
3081
3089
|
}
|
|
3082
3090
|
/**
|
|
@@ -3140,7 +3148,7 @@ class H {
|
|
|
3140
3148
|
this.refreshToken = null;
|
|
3141
3149
|
}
|
|
3142
3150
|
async refresh(e, t) {
|
|
3143
|
-
const { accessToken: r, refreshToken: i, expiresIn: s } = await
|
|
3151
|
+
const { accessToken: r, refreshToken: i, expiresIn: s } = await Gi(e, t);
|
|
3144
3152
|
this.updateTokensAndExpiration(r, i, Number(s));
|
|
3145
3153
|
}
|
|
3146
3154
|
updateTokensAndExpiration(e, t, r) {
|
|
@@ -3170,7 +3178,7 @@ class H {
|
|
|
3170
3178
|
return Object.assign(new H(), this.toJSON());
|
|
3171
3179
|
}
|
|
3172
3180
|
_performRefresh() {
|
|
3173
|
-
return
|
|
3181
|
+
return b("not implemented");
|
|
3174
3182
|
}
|
|
3175
3183
|
}
|
|
3176
3184
|
/**
|
|
@@ -3189,16 +3197,16 @@ class H {
|
|
|
3189
3197
|
* See the License for the specific language governing permissions and
|
|
3190
3198
|
* limitations under the License.
|
|
3191
3199
|
*/
|
|
3192
|
-
function
|
|
3200
|
+
function k(n, e) {
|
|
3193
3201
|
h(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
3194
3202
|
}
|
|
3195
|
-
class
|
|
3203
|
+
class I {
|
|
3196
3204
|
constructor(e) {
|
|
3197
3205
|
var { uid: t, auth: r, stsTokenManager: i } = e, s = qe(e, ["uid", "auth", "stsTokenManager"]);
|
|
3198
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
3206
|
+
this.providerId = "firebase", this.proactiveRefresh = new ji(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 Ve(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
3199
3207
|
}
|
|
3200
3208
|
async getIdToken(e) {
|
|
3201
|
-
const t = await
|
|
3209
|
+
const t = await Q(this, this.stsTokenManager.getToken(this.auth, e));
|
|
3202
3210
|
return h(
|
|
3203
3211
|
t,
|
|
3204
3212
|
this.auth,
|
|
@@ -3207,10 +3215,10 @@ class w {
|
|
|
3207
3215
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
3208
3216
|
}
|
|
3209
3217
|
getIdTokenResult(e) {
|
|
3210
|
-
return
|
|
3218
|
+
return Hi(this, e);
|
|
3211
3219
|
}
|
|
3212
3220
|
reload() {
|
|
3213
|
-
return
|
|
3221
|
+
return Wi(this);
|
|
3214
3222
|
}
|
|
3215
3223
|
_assign(e) {
|
|
3216
3224
|
this !== e && (h(
|
|
@@ -3221,7 +3229,7 @@ class w {
|
|
|
3221
3229
|
), this.displayName = e.displayName, this.photoURL = e.photoURL, this.email = e.email, this.emailVerified = e.emailVerified, this.phoneNumber = e.phoneNumber, this.isAnonymous = e.isAnonymous, this.tenantId = e.tenantId, this.providerData = e.providerData.map((t) => Object.assign({}, t)), this.metadata._copy(e.metadata), this.stsTokenManager._assign(e.stsTokenManager));
|
|
3222
3230
|
}
|
|
3223
3231
|
_clone(e) {
|
|
3224
|
-
const t = new
|
|
3232
|
+
const t = new I(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
3225
3233
|
return t.metadata._copy(this.metadata), t;
|
|
3226
3234
|
}
|
|
3227
3235
|
_onReload(e) {
|
|
@@ -3246,10 +3254,10 @@ class w {
|
|
|
3246
3254
|
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), r = !0), t && await me(this), await this.auth._persistUserIfCurrent(this), r && this.auth._notifyListenersIfCurrent(this);
|
|
3247
3255
|
}
|
|
3248
3256
|
async delete() {
|
|
3249
|
-
if (
|
|
3250
|
-
return Promise.reject(
|
|
3257
|
+
if (v(this.auth.app))
|
|
3258
|
+
return Promise.reject(N(this.auth));
|
|
3251
3259
|
const e = await this.getIdToken();
|
|
3252
|
-
return await
|
|
3260
|
+
return await Q(this, $i(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
3253
3261
|
}
|
|
3254
3262
|
toJSON() {
|
|
3255
3263
|
return Object.assign(Object.assign({
|
|
@@ -3276,21 +3284,21 @@ class w {
|
|
|
3276
3284
|
return this.stsTokenManager.refreshToken || "";
|
|
3277
3285
|
}
|
|
3278
3286
|
static _fromJSON(e, t) {
|
|
3279
|
-
var r, i, s, a, c, o,
|
|
3280
|
-
const d = (r = t.displayName) !== null && r !== void 0 ? r : void 0,
|
|
3287
|
+
var r, i, s, a, c, o, l, u;
|
|
3288
|
+
const d = (r = t.displayName) !== null && r !== void 0 ? r : void 0, p = (i = t.email) !== null && i !== void 0 ? i : void 0, m = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, F = (a = t.photoURL) !== null && a !== void 0 ? a : void 0, tt = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, Ee = (o = t._redirectEventId) !== null && o !== void 0 ? o : void 0, nt = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, rt = (u = t.lastLoginAt) !== null && u !== void 0 ? u : void 0, { uid: Te, emailVerified: it, isAnonymous: st, providerData: Se, stsTokenManager: at } = t;
|
|
3281
3289
|
h(
|
|
3282
3290
|
Te && at,
|
|
3283
3291
|
e,
|
|
3284
3292
|
"internal-error"
|
|
3285
3293
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3286
3294
|
);
|
|
3287
|
-
const
|
|
3295
|
+
const Nn = H.fromJSON(this.name, at);
|
|
3288
3296
|
h(
|
|
3289
3297
|
typeof Te == "string",
|
|
3290
3298
|
e,
|
|
3291
3299
|
"internal-error"
|
|
3292
3300
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3293
|
-
),
|
|
3301
|
+
), k(d, e.name), k(p, e.name), h(
|
|
3294
3302
|
typeof it == "boolean",
|
|
3295
3303
|
e,
|
|
3296
3304
|
"internal-error"
|
|
@@ -3300,22 +3308,22 @@ class w {
|
|
|
3300
3308
|
e,
|
|
3301
3309
|
"internal-error"
|
|
3302
3310
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3303
|
-
),
|
|
3304
|
-
const ke = new
|
|
3311
|
+
), k(m, e.name), k(F, e.name), k(tt, e.name), k(Ee, e.name), k(nt, e.name), k(rt, e.name);
|
|
3312
|
+
const ke = new I({
|
|
3305
3313
|
uid: Te,
|
|
3306
3314
|
auth: e,
|
|
3307
|
-
email:
|
|
3315
|
+
email: p,
|
|
3308
3316
|
emailVerified: it,
|
|
3309
3317
|
displayName: d,
|
|
3310
3318
|
isAnonymous: st,
|
|
3311
|
-
photoURL:
|
|
3312
|
-
phoneNumber:
|
|
3319
|
+
photoURL: F,
|
|
3320
|
+
phoneNumber: m,
|
|
3313
3321
|
tenantId: tt,
|
|
3314
|
-
stsTokenManager:
|
|
3322
|
+
stsTokenManager: Nn,
|
|
3315
3323
|
createdAt: nt,
|
|
3316
3324
|
lastLoginAt: rt
|
|
3317
3325
|
});
|
|
3318
|
-
return Se && Array.isArray(Se) && (ke.providerData = Se.map((
|
|
3326
|
+
return Se && Array.isArray(Se) && (ke.providerData = Se.map((Ln) => Object.assign({}, Ln))), Ee && (ke._redirectEventId = Ee), ke;
|
|
3319
3327
|
}
|
|
3320
3328
|
/**
|
|
3321
3329
|
* Initialize a User from an idToken server response
|
|
@@ -3325,7 +3333,7 @@ class w {
|
|
|
3325
3333
|
static async _fromIdTokenResponse(e, t, r = !1) {
|
|
3326
3334
|
const i = new H();
|
|
3327
3335
|
i.updateFromServerResponse(t);
|
|
3328
|
-
const s = new
|
|
3336
|
+
const s = new I({
|
|
3329
3337
|
uid: t.localId,
|
|
3330
3338
|
auth: e,
|
|
3331
3339
|
stsTokenManager: i,
|
|
@@ -3345,14 +3353,14 @@ class w {
|
|
|
3345
3353
|
"internal-error"
|
|
3346
3354
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3347
3355
|
);
|
|
3348
|
-
const s = i.providerUserInfo !== void 0 ?
|
|
3356
|
+
const s = i.providerUserInfo !== void 0 ? cn(i.providerUserInfo) : [], a = !(i.email && i.passwordHash) && !(s != null && s.length), c = new H();
|
|
3349
3357
|
c.updateFromIdToken(r);
|
|
3350
|
-
const o = new
|
|
3358
|
+
const o = new I({
|
|
3351
3359
|
uid: i.localId,
|
|
3352
3360
|
auth: e,
|
|
3353
3361
|
stsTokenManager: c,
|
|
3354
3362
|
isAnonymous: a
|
|
3355
|
-
}),
|
|
3363
|
+
}), l = {
|
|
3356
3364
|
uid: i.localId,
|
|
3357
3365
|
displayName: i.displayName || null,
|
|
3358
3366
|
photoURL: i.photoUrl || null,
|
|
@@ -3364,7 +3372,7 @@ class w {
|
|
|
3364
3372
|
metadata: new Ve(i.createdAt, i.lastLoginAt),
|
|
3365
3373
|
isAnonymous: !(i.email && i.passwordHash) && !(s != null && s.length)
|
|
3366
3374
|
};
|
|
3367
|
-
return Object.assign(o,
|
|
3375
|
+
return Object.assign(o, l), o;
|
|
3368
3376
|
}
|
|
3369
3377
|
}
|
|
3370
3378
|
/**
|
|
@@ -3384,10 +3392,10 @@ class w {
|
|
|
3384
3392
|
* limitations under the License.
|
|
3385
3393
|
*/
|
|
3386
3394
|
const vt = /* @__PURE__ */ new Map();
|
|
3387
|
-
function
|
|
3388
|
-
|
|
3395
|
+
function w(n) {
|
|
3396
|
+
S(n instanceof Function, "Expected a class definition");
|
|
3389
3397
|
let e = vt.get(n);
|
|
3390
|
-
return e ? (
|
|
3398
|
+
return e ? (S(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), vt.set(n, e), e);
|
|
3391
3399
|
}
|
|
3392
3400
|
/**
|
|
3393
3401
|
* @license
|
|
@@ -3405,7 +3413,7 @@ function E(n) {
|
|
|
3405
3413
|
* See the License for the specific language governing permissions and
|
|
3406
3414
|
* limitations under the License.
|
|
3407
3415
|
*/
|
|
3408
|
-
class
|
|
3416
|
+
class ln {
|
|
3409
3417
|
constructor() {
|
|
3410
3418
|
this.type = "NONE", this.storage = {};
|
|
3411
3419
|
}
|
|
@@ -3427,8 +3435,8 @@ class cn {
|
|
|
3427
3435
|
_removeListener(e, t) {
|
|
3428
3436
|
}
|
|
3429
3437
|
}
|
|
3430
|
-
|
|
3431
|
-
const bt =
|
|
3438
|
+
ln.type = "NONE";
|
|
3439
|
+
const bt = ln;
|
|
3432
3440
|
/**
|
|
3433
3441
|
* @license
|
|
3434
3442
|
* Copyright 2019 Google LLC
|
|
@@ -3445,21 +3453,21 @@ const bt = cn;
|
|
|
3445
3453
|
* See the License for the specific language governing permissions and
|
|
3446
3454
|
* limitations under the License.
|
|
3447
3455
|
*/
|
|
3448
|
-
function
|
|
3456
|
+
function oe(n, e, t) {
|
|
3449
3457
|
return `firebase:${n}:${e}:${t}`;
|
|
3450
3458
|
}
|
|
3451
3459
|
class V {
|
|
3452
3460
|
constructor(e, t, r) {
|
|
3453
3461
|
this.persistence = e, this.auth = t, this.userKey = r;
|
|
3454
3462
|
const { config: i, name: s } = this.auth;
|
|
3455
|
-
this.fullUserKey =
|
|
3463
|
+
this.fullUserKey = oe(this.userKey, i.apiKey, s), this.fullPersistenceKey = oe("persistence", i.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
3456
3464
|
}
|
|
3457
3465
|
setCurrentUser(e) {
|
|
3458
3466
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
3459
3467
|
}
|
|
3460
3468
|
async getCurrentUser() {
|
|
3461
3469
|
const e = await this.persistence._get(this.fullUserKey);
|
|
3462
|
-
return e ?
|
|
3470
|
+
return e ? I._fromJSON(this.auth, e) : null;
|
|
3463
3471
|
}
|
|
3464
3472
|
removeCurrentUser() {
|
|
3465
3473
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -3479,29 +3487,29 @@ class V {
|
|
|
3479
3487
|
}
|
|
3480
3488
|
static async create(e, t, r = "authUser") {
|
|
3481
3489
|
if (!t.length)
|
|
3482
|
-
return new V(
|
|
3483
|
-
const i = (await Promise.all(t.map(async (
|
|
3484
|
-
if (await
|
|
3485
|
-
return
|
|
3486
|
-
}))).filter((
|
|
3487
|
-
let s = i[0] ||
|
|
3488
|
-
const a =
|
|
3490
|
+
return new V(w(bt), e, r);
|
|
3491
|
+
const i = (await Promise.all(t.map(async (l) => {
|
|
3492
|
+
if (await l._isAvailable())
|
|
3493
|
+
return l;
|
|
3494
|
+
}))).filter((l) => l);
|
|
3495
|
+
let s = i[0] || w(bt);
|
|
3496
|
+
const a = oe(r, e.config.apiKey, e.name);
|
|
3489
3497
|
let c = null;
|
|
3490
|
-
for (const
|
|
3498
|
+
for (const l of t)
|
|
3491
3499
|
try {
|
|
3492
|
-
const
|
|
3493
|
-
if (
|
|
3494
|
-
const d =
|
|
3495
|
-
|
|
3500
|
+
const u = await l._get(a);
|
|
3501
|
+
if (u) {
|
|
3502
|
+
const d = I._fromJSON(e, u);
|
|
3503
|
+
l !== s && (c = d), s = l;
|
|
3496
3504
|
break;
|
|
3497
3505
|
}
|
|
3498
3506
|
} catch {
|
|
3499
3507
|
}
|
|
3500
|
-
const o = i.filter((
|
|
3501
|
-
return !s._shouldAllowMigration || !o.length ? new V(s, e, r) : (s = o[0], c && await s._set(a, c.toJSON()), await Promise.all(t.map(async (
|
|
3502
|
-
if (
|
|
3508
|
+
const o = i.filter((l) => l._shouldAllowMigration);
|
|
3509
|
+
return !s._shouldAllowMigration || !o.length ? new V(s, e, r) : (s = o[0], c && await s._set(a, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
3510
|
+
if (l !== s)
|
|
3503
3511
|
try {
|
|
3504
|
-
await
|
|
3512
|
+
await l._remove(a);
|
|
3505
3513
|
} catch {
|
|
3506
3514
|
}
|
|
3507
3515
|
})), new V(s, e, r));
|
|
@@ -3527,25 +3535,25 @@ function It(n) {
|
|
|
3527
3535
|
const e = n.toLowerCase();
|
|
3528
3536
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
3529
3537
|
return "Opera";
|
|
3530
|
-
if (
|
|
3538
|
+
if (fn(e))
|
|
3531
3539
|
return "IEMobile";
|
|
3532
3540
|
if (e.includes("msie") || e.includes("trident/"))
|
|
3533
3541
|
return "IE";
|
|
3534
3542
|
if (e.includes("edge/"))
|
|
3535
3543
|
return "Edge";
|
|
3536
|
-
if (
|
|
3544
|
+
if (un(e))
|
|
3537
3545
|
return "Firefox";
|
|
3538
3546
|
if (e.includes("silk/"))
|
|
3539
3547
|
return "Silk";
|
|
3540
|
-
if (pn(e))
|
|
3541
|
-
return "Blackberry";
|
|
3542
3548
|
if (mn(e))
|
|
3549
|
+
return "Blackberry";
|
|
3550
|
+
if (gn(e))
|
|
3543
3551
|
return "Webos";
|
|
3544
|
-
if (
|
|
3552
|
+
if (dn(e))
|
|
3545
3553
|
return "Safari";
|
|
3546
|
-
if ((e.includes("chrome/") ||
|
|
3554
|
+
if ((e.includes("chrome/") || hn(e)) && !e.includes("edge/"))
|
|
3547
3555
|
return "Chrome";
|
|
3548
|
-
if (
|
|
3556
|
+
if (pn(e))
|
|
3549
3557
|
return "Android";
|
|
3550
3558
|
{
|
|
3551
3559
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, r = n.match(t);
|
|
@@ -3554,40 +3562,40 @@ function It(n) {
|
|
|
3554
3562
|
}
|
|
3555
3563
|
return "Other";
|
|
3556
3564
|
}
|
|
3557
|
-
function
|
|
3565
|
+
function un(n = g()) {
|
|
3558
3566
|
return /firefox\//i.test(n);
|
|
3559
3567
|
}
|
|
3560
|
-
function
|
|
3568
|
+
function dn(n = g()) {
|
|
3561
3569
|
const e = n.toLowerCase();
|
|
3562
3570
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
3563
3571
|
}
|
|
3564
|
-
function
|
|
3572
|
+
function hn(n = g()) {
|
|
3565
3573
|
return /crios\//i.test(n);
|
|
3566
3574
|
}
|
|
3567
|
-
function
|
|
3575
|
+
function fn(n = g()) {
|
|
3568
3576
|
return /iemobile/i.test(n);
|
|
3569
3577
|
}
|
|
3570
|
-
function
|
|
3578
|
+
function pn(n = g()) {
|
|
3571
3579
|
return /android/i.test(n);
|
|
3572
3580
|
}
|
|
3573
|
-
function
|
|
3581
|
+
function mn(n = g()) {
|
|
3574
3582
|
return /blackberry/i.test(n);
|
|
3575
3583
|
}
|
|
3576
|
-
function
|
|
3584
|
+
function gn(n = g()) {
|
|
3577
3585
|
return /webos/i.test(n);
|
|
3578
3586
|
}
|
|
3579
|
-
function Xe(n =
|
|
3587
|
+
function Xe(n = g()) {
|
|
3580
3588
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
3581
3589
|
}
|
|
3582
|
-
function
|
|
3590
|
+
function Ki(n = g()) {
|
|
3583
3591
|
var e;
|
|
3584
3592
|
return Xe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
3585
3593
|
}
|
|
3586
|
-
function
|
|
3587
|
-
return
|
|
3594
|
+
function Ji() {
|
|
3595
|
+
return hr() && document.documentMode === 10;
|
|
3588
3596
|
}
|
|
3589
|
-
function
|
|
3590
|
-
return Xe(n) ||
|
|
3597
|
+
function _n(n = g()) {
|
|
3598
|
+
return Xe(n) || pn(n) || gn(n) || mn(n) || /windows phone/i.test(n) || fn(n);
|
|
3591
3599
|
}
|
|
3592
3600
|
/**
|
|
3593
3601
|
* @license
|
|
@@ -3605,20 +3613,20 @@ function gn(n = m()) {
|
|
|
3605
3613
|
* See the License for the specific language governing permissions and
|
|
3606
3614
|
* limitations under the License.
|
|
3607
3615
|
*/
|
|
3608
|
-
function
|
|
3616
|
+
function yn(n, e = []) {
|
|
3609
3617
|
let t;
|
|
3610
3618
|
switch (n) {
|
|
3611
3619
|
case "Browser":
|
|
3612
|
-
t = It(
|
|
3620
|
+
t = It(g());
|
|
3613
3621
|
break;
|
|
3614
3622
|
case "Worker":
|
|
3615
|
-
t = `${It(
|
|
3623
|
+
t = `${It(g())}-${n}`;
|
|
3616
3624
|
break;
|
|
3617
3625
|
default:
|
|
3618
3626
|
t = n;
|
|
3619
3627
|
}
|
|
3620
3628
|
const r = e.length ? e.join(",") : "FirebaseCore-web";
|
|
3621
|
-
return `${t}/JsCore/${
|
|
3629
|
+
return `${t}/JsCore/${te}/${r}`;
|
|
3622
3630
|
}
|
|
3623
3631
|
/**
|
|
3624
3632
|
* @license
|
|
@@ -3636,7 +3644,7 @@ function _n(n, e = []) {
|
|
|
3636
3644
|
* See the License for the specific language governing permissions and
|
|
3637
3645
|
* limitations under the License.
|
|
3638
3646
|
*/
|
|
3639
|
-
class
|
|
3647
|
+
class Yi {
|
|
3640
3648
|
constructor(e) {
|
|
3641
3649
|
this.auth = e, this.queue = [];
|
|
3642
3650
|
}
|
|
@@ -3691,7 +3699,7 @@ class Ji {
|
|
|
3691
3699
|
* See the License for the specific language governing permissions and
|
|
3692
3700
|
* limitations under the License.
|
|
3693
3701
|
*/
|
|
3694
|
-
async function
|
|
3702
|
+
async function Xi(n, e = {}) {
|
|
3695
3703
|
return G(n, "GET", "/v2/passwordPolicy", ve(n, e));
|
|
3696
3704
|
}
|
|
3697
3705
|
/**
|
|
@@ -3710,12 +3718,12 @@ async function Yi(n, e = {}) {
|
|
|
3710
3718
|
* See the License for the specific language governing permissions and
|
|
3711
3719
|
* limitations under the License.
|
|
3712
3720
|
*/
|
|
3713
|
-
const
|
|
3714
|
-
class
|
|
3721
|
+
const Qi = 6;
|
|
3722
|
+
class Zi {
|
|
3715
3723
|
constructor(e) {
|
|
3716
3724
|
var t, r, i, s;
|
|
3717
3725
|
const a = e.customStrengthOptions;
|
|
3718
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = a.minPasswordLength) !== null && t !== void 0 ? t :
|
|
3726
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = a.minPasswordLength) !== null && t !== void 0 ? t : Qi, a.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = a.maxPasswordLength), a.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = a.containsLowercaseCharacter), a.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = a.containsUppercaseCharacter), a.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = a.containsNumericCharacter), a.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = a.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (i = (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;
|
|
3719
3727
|
}
|
|
3720
3728
|
validatePassword(e) {
|
|
3721
3729
|
var t, r, i, s, a, c;
|
|
@@ -3798,12 +3806,12 @@ class Qi {
|
|
|
3798
3806
|
* See the License for the specific language governing permissions and
|
|
3799
3807
|
* limitations under the License.
|
|
3800
3808
|
*/
|
|
3801
|
-
class
|
|
3809
|
+
class es {
|
|
3802
3810
|
constructor(e, t, r, i) {
|
|
3803
|
-
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 wt(this), this.idTokenSubscription = new wt(this), this.beforeStateQueue = new
|
|
3811
|
+
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 wt(this), this.idTokenSubscription = new wt(this), this.beforeStateQueue = new Yi(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 = en, 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;
|
|
3804
3812
|
}
|
|
3805
3813
|
_initializeWithPersistence(e, t) {
|
|
3806
|
-
return t && (this._popupRedirectResolver =
|
|
3814
|
+
return t && (this._popupRedirectResolver = w(t)), this._initializationPromise = this.queue(async () => {
|
|
3807
3815
|
var r, i;
|
|
3808
3816
|
if (!this._deleted && (this.persistenceManager = await V.create(this, e), !this._deleted)) {
|
|
3809
3817
|
if (!((r = this._popupRedirectResolver) === null || r === void 0) && r._shouldInitProactively)
|
|
@@ -3836,7 +3844,7 @@ class Zi {
|
|
|
3836
3844
|
}
|
|
3837
3845
|
async initializeCurrentUserFromIdToken(e) {
|
|
3838
3846
|
try {
|
|
3839
|
-
const t = await
|
|
3847
|
+
const t = await on(this, { idToken: e }), r = await I._fromGetAccountInfoResponse(this, t, e);
|
|
3840
3848
|
await this.directlySetCurrentUser(r);
|
|
3841
3849
|
} catch (t) {
|
|
3842
3850
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -3844,7 +3852,7 @@ class Zi {
|
|
|
3844
3852
|
}
|
|
3845
3853
|
async initializeCurrentUser(e) {
|
|
3846
3854
|
var t;
|
|
3847
|
-
if (
|
|
3855
|
+
if (v(this.app)) {
|
|
3848
3856
|
const a = this.app.settings.authIdToken;
|
|
3849
3857
|
return a ? new Promise((c) => {
|
|
3850
3858
|
setTimeout(() => this.initializeCurrentUserFromIdToken(a).then(c, c));
|
|
@@ -3894,14 +3902,14 @@ class Zi {
|
|
|
3894
3902
|
return this.directlySetCurrentUser(e);
|
|
3895
3903
|
}
|
|
3896
3904
|
useDeviceLanguage() {
|
|
3897
|
-
this.languageCode =
|
|
3905
|
+
this.languageCode = Ui();
|
|
3898
3906
|
}
|
|
3899
3907
|
async _delete() {
|
|
3900
3908
|
this._deleted = !0;
|
|
3901
3909
|
}
|
|
3902
3910
|
async updateCurrentUser(e) {
|
|
3903
|
-
if (
|
|
3904
|
-
return Promise.reject(
|
|
3911
|
+
if (v(this.app))
|
|
3912
|
+
return Promise.reject(N(this));
|
|
3905
3913
|
const t = e ? z(e) : null;
|
|
3906
3914
|
return t && h(
|
|
3907
3915
|
t.auth.config.apiKey === this.config.apiKey,
|
|
@@ -3922,15 +3930,15 @@ class Zi {
|
|
|
3922
3930
|
});
|
|
3923
3931
|
}
|
|
3924
3932
|
async signOut() {
|
|
3925
|
-
return
|
|
3933
|
+
return v(this.app) ? Promise.reject(N(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
3926
3934
|
null,
|
|
3927
3935
|
/* skipBeforeStateCallbacks */
|
|
3928
3936
|
!0
|
|
3929
3937
|
));
|
|
3930
3938
|
}
|
|
3931
3939
|
setPersistence(e) {
|
|
3932
|
-
return
|
|
3933
|
-
await this.assertedPersistence.setPersistence(
|
|
3940
|
+
return v(this.app) ? Promise.reject(N(this)) : this.queue(async () => {
|
|
3941
|
+
await this.assertedPersistence.setPersistence(w(e));
|
|
3934
3942
|
});
|
|
3935
3943
|
}
|
|
3936
3944
|
_getRecaptchaConfig() {
|
|
@@ -3945,14 +3953,14 @@ class Zi {
|
|
|
3945
3953
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
3946
3954
|
}
|
|
3947
3955
|
async _updatePasswordPolicy() {
|
|
3948
|
-
const e = await
|
|
3956
|
+
const e = await Xi(this), t = new Zi(e);
|
|
3949
3957
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
3950
3958
|
}
|
|
3951
3959
|
_getPersistence() {
|
|
3952
3960
|
return this.assertedPersistence.persistence.type;
|
|
3953
3961
|
}
|
|
3954
3962
|
_updateErrorMap(e) {
|
|
3955
|
-
this._errorFactory = new
|
|
3963
|
+
this._errorFactory = new Z("auth", "Firebase", e());
|
|
3956
3964
|
}
|
|
3957
3965
|
onAuthStateChanged(e, t, r) {
|
|
3958
3966
|
return this.registerStateListener(this.authStateSubscription, e, t, r);
|
|
@@ -3985,7 +3993,7 @@ class Zi {
|
|
|
3985
3993
|
token: e,
|
|
3986
3994
|
idToken: t
|
|
3987
3995
|
};
|
|
3988
|
-
this.tenantId != null && (r.tenantId = this.tenantId), await
|
|
3996
|
+
this.tenantId != null && (r.tenantId = this.tenantId), await qi(this, r);
|
|
3989
3997
|
}
|
|
3990
3998
|
}
|
|
3991
3999
|
toJSON() {
|
|
@@ -4003,7 +4011,7 @@ class Zi {
|
|
|
4003
4011
|
}
|
|
4004
4012
|
async getOrInitRedirectPersistenceManager(e) {
|
|
4005
4013
|
if (!this.redirectPersistenceManager) {
|
|
4006
|
-
const t = e &&
|
|
4014
|
+
const t = e && w(e) || this._popupRedirectResolver;
|
|
4007
4015
|
h(
|
|
4008
4016
|
t,
|
|
4009
4017
|
this,
|
|
@@ -4011,7 +4019,7 @@ class Zi {
|
|
|
4011
4019
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
4012
4020
|
), this.redirectPersistenceManager = await V.create(
|
|
4013
4021
|
this,
|
|
4014
|
-
[
|
|
4022
|
+
[w(t._redirectPersistence)],
|
|
4015
4023
|
"redirectUser"
|
|
4016
4024
|
/* KeyName.REDIRECT_USER */
|
|
4017
4025
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -4098,7 +4106,7 @@ class Zi {
|
|
|
4098
4106
|
), this.persistenceManager;
|
|
4099
4107
|
}
|
|
4100
4108
|
_logFramework(e) {
|
|
4101
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
4109
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = yn(this.config.clientPlatform, this._getFrameworks()));
|
|
4102
4110
|
}
|
|
4103
4111
|
_getFrameworks() {
|
|
4104
4112
|
return this.frameworks;
|
|
@@ -4128,7 +4136,7 @@ class Zi {
|
|
|
4128
4136
|
async _getAppCheckToken() {
|
|
4129
4137
|
var e;
|
|
4130
4138
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
4131
|
-
return t != null && t.error &&
|
|
4139
|
+
return t != null && t.error && Ni(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
4132
4140
|
}
|
|
4133
4141
|
}
|
|
4134
4142
|
function be(n) {
|
|
@@ -4136,7 +4144,7 @@ function be(n) {
|
|
|
4136
4144
|
}
|
|
4137
4145
|
class wt {
|
|
4138
4146
|
constructor(e) {
|
|
4139
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
4147
|
+
this.auth = e, this.observer = null, this.addObserver = vr((t) => this.observer = t);
|
|
4140
4148
|
}
|
|
4141
4149
|
get next() {
|
|
4142
4150
|
return h(
|
|
@@ -4171,16 +4179,16 @@ let Qe = {
|
|
|
4171
4179
|
recaptchaEnterpriseScript: "",
|
|
4172
4180
|
gapiScript: ""
|
|
4173
4181
|
};
|
|
4174
|
-
function
|
|
4182
|
+
function ts(n) {
|
|
4175
4183
|
Qe = n;
|
|
4176
4184
|
}
|
|
4177
|
-
function
|
|
4185
|
+
function ns(n) {
|
|
4178
4186
|
return Qe.loadJS(n);
|
|
4179
4187
|
}
|
|
4180
|
-
function
|
|
4188
|
+
function rs() {
|
|
4181
4189
|
return Qe.gapiScript;
|
|
4182
4190
|
}
|
|
4183
|
-
function
|
|
4191
|
+
function is(n) {
|
|
4184
4192
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
4185
4193
|
}
|
|
4186
4194
|
/**
|
|
@@ -4199,13 +4207,13 @@ function rs(n) {
|
|
|
4199
4207
|
* See the License for the specific language governing permissions and
|
|
4200
4208
|
* limitations under the License.
|
|
4201
4209
|
*/
|
|
4202
|
-
function
|
|
4203
|
-
const t =
|
|
4210
|
+
function ss(n, e) {
|
|
4211
|
+
const t = Jt(n, "auth");
|
|
4204
4212
|
if (t.isInitialized()) {
|
|
4205
4213
|
const i = t.getImmediate(), s = t.getOptions();
|
|
4206
4214
|
if (he(s, e ?? {}))
|
|
4207
4215
|
return i;
|
|
4208
|
-
|
|
4216
|
+
T(
|
|
4209
4217
|
i,
|
|
4210
4218
|
"already-initialized"
|
|
4211
4219
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -4213,11 +4221,11 @@ function is(n, e) {
|
|
|
4213
4221
|
}
|
|
4214
4222
|
return t.initialize({ options: e });
|
|
4215
4223
|
}
|
|
4216
|
-
function
|
|
4217
|
-
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(
|
|
4224
|
+
function as(n, e) {
|
|
4225
|
+
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(w);
|
|
4218
4226
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(r, e == null ? void 0 : e.popupRedirectResolver);
|
|
4219
4227
|
}
|
|
4220
|
-
function
|
|
4228
|
+
function os(n, e, t) {
|
|
4221
4229
|
const r = be(n);
|
|
4222
4230
|
h(
|
|
4223
4231
|
r._canInitEmulator,
|
|
@@ -4230,20 +4238,20 @@ function as(n, e, t) {
|
|
|
4230
4238
|
"invalid-emulator-scheme"
|
|
4231
4239
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
4232
4240
|
);
|
|
4233
|
-
const i = !1, s =
|
|
4241
|
+
const i = !1, s = vn(e), { host: a, port: c } = cs(e), o = c === null ? "" : `:${c}`;
|
|
4234
4242
|
r.config.emulator = { url: `${s}//${a}${o}/` }, r.settings.appVerificationDisabledForTesting = !0, r.emulatorConfig = Object.freeze({
|
|
4235
4243
|
host: a,
|
|
4236
4244
|
port: c,
|
|
4237
4245
|
protocol: s.replace(":", ""),
|
|
4238
4246
|
options: Object.freeze({ disableWarnings: i })
|
|
4239
|
-
}),
|
|
4247
|
+
}), ls();
|
|
4240
4248
|
}
|
|
4241
|
-
function
|
|
4249
|
+
function vn(n) {
|
|
4242
4250
|
const e = n.indexOf(":");
|
|
4243
4251
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
4244
4252
|
}
|
|
4245
|
-
function
|
|
4246
|
-
const e =
|
|
4253
|
+
function cs(n) {
|
|
4254
|
+
const e = vn(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
4247
4255
|
if (!t)
|
|
4248
4256
|
return { host: "", port: null };
|
|
4249
4257
|
const r = t[2].split("@").pop() || "", i = /^(\[[^\]]+\])(:|$)/.exec(r);
|
|
@@ -4261,7 +4269,7 @@ function Et(n) {
|
|
|
4261
4269
|
const e = Number(n);
|
|
4262
4270
|
return isNaN(e) ? null : e;
|
|
4263
4271
|
}
|
|
4264
|
-
function
|
|
4272
|
+
function ls() {
|
|
4265
4273
|
function n() {
|
|
4266
4274
|
const e = document.createElement("p"), t = e.style;
|
|
4267
4275
|
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);
|
|
@@ -4284,7 +4292,7 @@ function cs() {
|
|
|
4284
4292
|
* See the License for the specific language governing permissions and
|
|
4285
4293
|
* limitations under the License.
|
|
4286
4294
|
*/
|
|
4287
|
-
class
|
|
4295
|
+
class bn {
|
|
4288
4296
|
/** @internal */
|
|
4289
4297
|
constructor(e, t) {
|
|
4290
4298
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -4295,19 +4303,19 @@ class vn {
|
|
|
4295
4303
|
* @returns a JSON-serializable representation of this object.
|
|
4296
4304
|
*/
|
|
4297
4305
|
toJSON() {
|
|
4298
|
-
return
|
|
4306
|
+
return b("not implemented");
|
|
4299
4307
|
}
|
|
4300
4308
|
/** @internal */
|
|
4301
4309
|
_getIdTokenResponse(e) {
|
|
4302
|
-
return
|
|
4310
|
+
return b("not implemented");
|
|
4303
4311
|
}
|
|
4304
4312
|
/** @internal */
|
|
4305
4313
|
_linkToIdToken(e, t) {
|
|
4306
|
-
return
|
|
4314
|
+
return b("not implemented");
|
|
4307
4315
|
}
|
|
4308
4316
|
/** @internal */
|
|
4309
4317
|
_getReauthenticationResolver(e) {
|
|
4310
|
-
return
|
|
4318
|
+
return b("not implemented");
|
|
4311
4319
|
}
|
|
4312
4320
|
}
|
|
4313
4321
|
/**
|
|
@@ -4327,7 +4335,7 @@ class vn {
|
|
|
4327
4335
|
* limitations under the License.
|
|
4328
4336
|
*/
|
|
4329
4337
|
async function j(n, e) {
|
|
4330
|
-
return
|
|
4338
|
+
return sn(n, "POST", "/v1/accounts:signInWithIdp", ve(n, e));
|
|
4331
4339
|
}
|
|
4332
4340
|
/**
|
|
4333
4341
|
* @license
|
|
@@ -4345,15 +4353,15 @@ async function j(n, e) {
|
|
|
4345
4353
|
* See the License for the specific language governing permissions and
|
|
4346
4354
|
* limitations under the License.
|
|
4347
4355
|
*/
|
|
4348
|
-
const
|
|
4349
|
-
class
|
|
4356
|
+
const us = "http://localhost";
|
|
4357
|
+
class U extends bn {
|
|
4350
4358
|
constructor() {
|
|
4351
4359
|
super(...arguments), this.pendingToken = null;
|
|
4352
4360
|
}
|
|
4353
4361
|
/** @internal */
|
|
4354
4362
|
static _fromParams(e) {
|
|
4355
|
-
const t = new
|
|
4356
|
-
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) :
|
|
4363
|
+
const t = new U(e.providerId, e.signInMethod);
|
|
4364
|
+
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) : T(
|
|
4357
4365
|
"argument-error"
|
|
4358
4366
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
4359
4367
|
), t;
|
|
@@ -4383,7 +4391,7 @@ class x extends vn {
|
|
|
4383
4391
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s = qe(t, ["providerId", "signInMethod"]);
|
|
4384
4392
|
if (!r || !i)
|
|
4385
4393
|
return null;
|
|
4386
|
-
const a = new
|
|
4394
|
+
const a = new U(r, i);
|
|
4387
4395
|
return a.idToken = s.idToken || void 0, a.accessToken = s.accessToken || void 0, a.secret = s.secret, a.nonce = s.nonce, a.pendingToken = s.pendingToken || null, a;
|
|
4388
4396
|
}
|
|
4389
4397
|
/** @internal */
|
|
@@ -4403,14 +4411,14 @@ class x extends vn {
|
|
|
4403
4411
|
}
|
|
4404
4412
|
buildRequest() {
|
|
4405
4413
|
const e = {
|
|
4406
|
-
requestUri:
|
|
4414
|
+
requestUri: us,
|
|
4407
4415
|
returnSecureToken: !0
|
|
4408
4416
|
};
|
|
4409
4417
|
if (this.pendingToken)
|
|
4410
4418
|
e.pendingToken = this.pendingToken;
|
|
4411
4419
|
else {
|
|
4412
4420
|
const t = {};
|
|
4413
|
-
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 =
|
|
4421
|
+
this.idToken && (t.id_token = this.idToken), this.accessToken && (t.access_token = this.accessToken), this.secret && (t.oauth_token_secret = this.secret), t.providerId = this.providerId, this.nonce && !this.pendingToken && (t.nonce = this.nonce), e.postBody = ee(t);
|
|
4414
4422
|
}
|
|
4415
4423
|
return e;
|
|
4416
4424
|
}
|
|
@@ -4431,7 +4439,7 @@ class x extends vn {
|
|
|
4431
4439
|
* See the License for the specific language governing permissions and
|
|
4432
4440
|
* limitations under the License.
|
|
4433
4441
|
*/
|
|
4434
|
-
class
|
|
4442
|
+
class In {
|
|
4435
4443
|
/**
|
|
4436
4444
|
* Constructor for generic OAuth providers.
|
|
4437
4445
|
*
|
|
@@ -4484,7 +4492,7 @@ class bn {
|
|
|
4484
4492
|
* See the License for the specific language governing permissions and
|
|
4485
4493
|
* limitations under the License.
|
|
4486
4494
|
*/
|
|
4487
|
-
class
|
|
4495
|
+
class re extends In {
|
|
4488
4496
|
constructor() {
|
|
4489
4497
|
super(...arguments), this.scopes = [];
|
|
4490
4498
|
}
|
|
@@ -4519,7 +4527,7 @@ class ne extends bn {
|
|
|
4519
4527
|
* See the License for the specific language governing permissions and
|
|
4520
4528
|
* limitations under the License.
|
|
4521
4529
|
*/
|
|
4522
|
-
class
|
|
4530
|
+
class A extends re {
|
|
4523
4531
|
constructor() {
|
|
4524
4532
|
super(
|
|
4525
4533
|
"facebook.com"
|
|
@@ -4539,9 +4547,9 @@ class R extends ne {
|
|
|
4539
4547
|
* @param accessToken - Facebook access token.
|
|
4540
4548
|
*/
|
|
4541
4549
|
static credential(e) {
|
|
4542
|
-
return
|
|
4543
|
-
providerId:
|
|
4544
|
-
signInMethod:
|
|
4550
|
+
return U._fromParams({
|
|
4551
|
+
providerId: A.PROVIDER_ID,
|
|
4552
|
+
signInMethod: A.FACEBOOK_SIGN_IN_METHOD,
|
|
4545
4553
|
accessToken: e
|
|
4546
4554
|
});
|
|
4547
4555
|
}
|
|
@@ -4551,7 +4559,7 @@ class R extends ne {
|
|
|
4551
4559
|
* @param userCredential - The user credential.
|
|
4552
4560
|
*/
|
|
4553
4561
|
static credentialFromResult(e) {
|
|
4554
|
-
return
|
|
4562
|
+
return A.credentialFromTaggedObject(e);
|
|
4555
4563
|
}
|
|
4556
4564
|
/**
|
|
4557
4565
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4560,20 +4568,20 @@ class R extends ne {
|
|
|
4560
4568
|
* @param userCredential - The user credential.
|
|
4561
4569
|
*/
|
|
4562
4570
|
static credentialFromError(e) {
|
|
4563
|
-
return
|
|
4571
|
+
return A.credentialFromTaggedObject(e.customData || {});
|
|
4564
4572
|
}
|
|
4565
4573
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4566
4574
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
4567
4575
|
return null;
|
|
4568
4576
|
try {
|
|
4569
|
-
return
|
|
4577
|
+
return A.credential(e.oauthAccessToken);
|
|
4570
4578
|
} catch {
|
|
4571
4579
|
return null;
|
|
4572
4580
|
}
|
|
4573
4581
|
}
|
|
4574
4582
|
}
|
|
4575
|
-
|
|
4576
|
-
|
|
4583
|
+
A.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
4584
|
+
A.PROVIDER_ID = "facebook.com";
|
|
4577
4585
|
/**
|
|
4578
4586
|
* @license
|
|
4579
4587
|
* Copyright 2020 Google LLC
|
|
@@ -4590,7 +4598,7 @@ R.PROVIDER_ID = "facebook.com";
|
|
|
4590
4598
|
* See the License for the specific language governing permissions and
|
|
4591
4599
|
* limitations under the License.
|
|
4592
4600
|
*/
|
|
4593
|
-
class
|
|
4601
|
+
class R extends re {
|
|
4594
4602
|
constructor() {
|
|
4595
4603
|
super(
|
|
4596
4604
|
"google.com"
|
|
@@ -4611,9 +4619,9 @@ class C extends ne {
|
|
|
4611
4619
|
* @param accessToken - Google access token.
|
|
4612
4620
|
*/
|
|
4613
4621
|
static credential(e, t) {
|
|
4614
|
-
return
|
|
4615
|
-
providerId:
|
|
4616
|
-
signInMethod:
|
|
4622
|
+
return U._fromParams({
|
|
4623
|
+
providerId: R.PROVIDER_ID,
|
|
4624
|
+
signInMethod: R.GOOGLE_SIGN_IN_METHOD,
|
|
4617
4625
|
idToken: e,
|
|
4618
4626
|
accessToken: t
|
|
4619
4627
|
});
|
|
@@ -4624,7 +4632,7 @@ class C extends ne {
|
|
|
4624
4632
|
* @param userCredential - The user credential.
|
|
4625
4633
|
*/
|
|
4626
4634
|
static credentialFromResult(e) {
|
|
4627
|
-
return
|
|
4635
|
+
return R.credentialFromTaggedObject(e);
|
|
4628
4636
|
}
|
|
4629
4637
|
/**
|
|
4630
4638
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4633,7 +4641,7 @@ class C extends ne {
|
|
|
4633
4641
|
* @param userCredential - The user credential.
|
|
4634
4642
|
*/
|
|
4635
4643
|
static credentialFromError(e) {
|
|
4636
|
-
return
|
|
4644
|
+
return R.credentialFromTaggedObject(e.customData || {});
|
|
4637
4645
|
}
|
|
4638
4646
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4639
4647
|
if (!e)
|
|
@@ -4642,14 +4650,14 @@ class C extends ne {
|
|
|
4642
4650
|
if (!t && !r)
|
|
4643
4651
|
return null;
|
|
4644
4652
|
try {
|
|
4645
|
-
return
|
|
4653
|
+
return R.credential(t, r);
|
|
4646
4654
|
} catch {
|
|
4647
4655
|
return null;
|
|
4648
4656
|
}
|
|
4649
4657
|
}
|
|
4650
4658
|
}
|
|
4651
|
-
|
|
4652
|
-
|
|
4659
|
+
R.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
4660
|
+
R.PROVIDER_ID = "google.com";
|
|
4653
4661
|
/**
|
|
4654
4662
|
* @license
|
|
4655
4663
|
* Copyright 2020 Google LLC
|
|
@@ -4666,7 +4674,7 @@ C.PROVIDER_ID = "google.com";
|
|
|
4666
4674
|
* See the License for the specific language governing permissions and
|
|
4667
4675
|
* limitations under the License.
|
|
4668
4676
|
*/
|
|
4669
|
-
class
|
|
4677
|
+
class C extends re {
|
|
4670
4678
|
constructor() {
|
|
4671
4679
|
super(
|
|
4672
4680
|
"github.com"
|
|
@@ -4679,9 +4687,9 @@ class P extends ne {
|
|
|
4679
4687
|
* @param accessToken - GitHub access token.
|
|
4680
4688
|
*/
|
|
4681
4689
|
static credential(e) {
|
|
4682
|
-
return
|
|
4683
|
-
providerId:
|
|
4684
|
-
signInMethod:
|
|
4690
|
+
return U._fromParams({
|
|
4691
|
+
providerId: C.PROVIDER_ID,
|
|
4692
|
+
signInMethod: C.GITHUB_SIGN_IN_METHOD,
|
|
4685
4693
|
accessToken: e
|
|
4686
4694
|
});
|
|
4687
4695
|
}
|
|
@@ -4691,7 +4699,7 @@ class P extends ne {
|
|
|
4691
4699
|
* @param userCredential - The user credential.
|
|
4692
4700
|
*/
|
|
4693
4701
|
static credentialFromResult(e) {
|
|
4694
|
-
return
|
|
4702
|
+
return C.credentialFromTaggedObject(e);
|
|
4695
4703
|
}
|
|
4696
4704
|
/**
|
|
4697
4705
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4700,20 +4708,20 @@ class P extends ne {
|
|
|
4700
4708
|
* @param userCredential - The user credential.
|
|
4701
4709
|
*/
|
|
4702
4710
|
static credentialFromError(e) {
|
|
4703
|
-
return
|
|
4711
|
+
return C.credentialFromTaggedObject(e.customData || {});
|
|
4704
4712
|
}
|
|
4705
4713
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4706
4714
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
4707
4715
|
return null;
|
|
4708
4716
|
try {
|
|
4709
|
-
return
|
|
4717
|
+
return C.credential(e.oauthAccessToken);
|
|
4710
4718
|
} catch {
|
|
4711
4719
|
return null;
|
|
4712
4720
|
}
|
|
4713
4721
|
}
|
|
4714
4722
|
}
|
|
4715
|
-
|
|
4716
|
-
|
|
4723
|
+
C.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
4724
|
+
C.PROVIDER_ID = "github.com";
|
|
4717
4725
|
/**
|
|
4718
4726
|
* @license
|
|
4719
4727
|
* Copyright 2020 Google LLC
|
|
@@ -4730,7 +4738,7 @@ P.PROVIDER_ID = "github.com";
|
|
|
4730
4738
|
* See the License for the specific language governing permissions and
|
|
4731
4739
|
* limitations under the License.
|
|
4732
4740
|
*/
|
|
4733
|
-
class
|
|
4741
|
+
class P extends re {
|
|
4734
4742
|
constructor() {
|
|
4735
4743
|
super(
|
|
4736
4744
|
"twitter.com"
|
|
@@ -4744,9 +4752,9 @@ class O extends ne {
|
|
|
4744
4752
|
* @param secret - Twitter secret.
|
|
4745
4753
|
*/
|
|
4746
4754
|
static credential(e, t) {
|
|
4747
|
-
return
|
|
4748
|
-
providerId:
|
|
4749
|
-
signInMethod:
|
|
4755
|
+
return U._fromParams({
|
|
4756
|
+
providerId: P.PROVIDER_ID,
|
|
4757
|
+
signInMethod: P.TWITTER_SIGN_IN_METHOD,
|
|
4750
4758
|
oauthToken: e,
|
|
4751
4759
|
oauthTokenSecret: t
|
|
4752
4760
|
});
|
|
@@ -4757,7 +4765,7 @@ class O extends ne {
|
|
|
4757
4765
|
* @param userCredential - The user credential.
|
|
4758
4766
|
*/
|
|
4759
4767
|
static credentialFromResult(e) {
|
|
4760
|
-
return
|
|
4768
|
+
return P.credentialFromTaggedObject(e);
|
|
4761
4769
|
}
|
|
4762
4770
|
/**
|
|
4763
4771
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4766,7 +4774,7 @@ class O extends ne {
|
|
|
4766
4774
|
* @param userCredential - The user credential.
|
|
4767
4775
|
*/
|
|
4768
4776
|
static credentialFromError(e) {
|
|
4769
|
-
return
|
|
4777
|
+
return P.credentialFromTaggedObject(e.customData || {});
|
|
4770
4778
|
}
|
|
4771
4779
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4772
4780
|
if (!e)
|
|
@@ -4775,14 +4783,14 @@ class O extends ne {
|
|
|
4775
4783
|
if (!t || !r)
|
|
4776
4784
|
return null;
|
|
4777
4785
|
try {
|
|
4778
|
-
return
|
|
4786
|
+
return P.credential(t, r);
|
|
4779
4787
|
} catch {
|
|
4780
4788
|
return null;
|
|
4781
4789
|
}
|
|
4782
4790
|
}
|
|
4783
4791
|
}
|
|
4784
|
-
|
|
4785
|
-
|
|
4792
|
+
P.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
4793
|
+
P.PROVIDER_ID = "twitter.com";
|
|
4786
4794
|
/**
|
|
4787
4795
|
* @license
|
|
4788
4796
|
* Copyright 2020 Google LLC
|
|
@@ -4799,13 +4807,13 @@ O.PROVIDER_ID = "twitter.com";
|
|
|
4799
4807
|
* See the License for the specific language governing permissions and
|
|
4800
4808
|
* limitations under the License.
|
|
4801
4809
|
*/
|
|
4802
|
-
class
|
|
4810
|
+
class x {
|
|
4803
4811
|
constructor(e) {
|
|
4804
4812
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
4805
4813
|
}
|
|
4806
4814
|
static async _fromIdTokenResponse(e, t, r, i = !1) {
|
|
4807
|
-
const s = await
|
|
4808
|
-
return new
|
|
4815
|
+
const s = await I._fromIdTokenResponse(e, r, i), a = Tt(r);
|
|
4816
|
+
return new x({
|
|
4809
4817
|
user: s,
|
|
4810
4818
|
providerId: a,
|
|
4811
4819
|
_tokenResponse: r,
|
|
@@ -4819,7 +4827,7 @@ class F {
|
|
|
4819
4827
|
!0
|
|
4820
4828
|
);
|
|
4821
4829
|
const i = Tt(r);
|
|
4822
|
-
return new
|
|
4830
|
+
return new x({
|
|
4823
4831
|
user: e,
|
|
4824
4832
|
providerId: i,
|
|
4825
4833
|
_tokenResponse: r,
|
|
@@ -4846,7 +4854,7 @@ function Tt(n) {
|
|
|
4846
4854
|
* See the License for the specific language governing permissions and
|
|
4847
4855
|
* limitations under the License.
|
|
4848
4856
|
*/
|
|
4849
|
-
class ge extends
|
|
4857
|
+
class ge extends L {
|
|
4850
4858
|
constructor(e, t, r, i) {
|
|
4851
4859
|
var s;
|
|
4852
4860
|
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this, ge.prototype), this.customData = {
|
|
@@ -4860,14 +4868,14 @@ class ge extends M {
|
|
|
4860
4868
|
return new ge(e, t, r, i);
|
|
4861
4869
|
}
|
|
4862
4870
|
}
|
|
4863
|
-
function
|
|
4871
|
+
function wn(n, e, t, r) {
|
|
4864
4872
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
4865
4873
|
throw s.code === "auth/multi-factor-auth-required" ? ge._fromErrorAndOperation(n, s, e, r) : s;
|
|
4866
4874
|
});
|
|
4867
4875
|
}
|
|
4868
|
-
async function
|
|
4869
|
-
const r = await
|
|
4870
|
-
return
|
|
4876
|
+
async function ds(n, e, t = !1) {
|
|
4877
|
+
const r = await Q(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
4878
|
+
return x._forOperation(n, "link", r);
|
|
4871
4879
|
}
|
|
4872
4880
|
/**
|
|
4873
4881
|
* @license
|
|
@@ -4885,13 +4893,13 @@ async function us(n, e, t = !1) {
|
|
|
4885
4893
|
* See the License for the specific language governing permissions and
|
|
4886
4894
|
* limitations under the License.
|
|
4887
4895
|
*/
|
|
4888
|
-
async function
|
|
4896
|
+
async function hs(n, e, t = !1) {
|
|
4889
4897
|
const { auth: r } = n;
|
|
4890
|
-
if (
|
|
4891
|
-
return Promise.reject(
|
|
4898
|
+
if (v(r.app))
|
|
4899
|
+
return Promise.reject(N(r));
|
|
4892
4900
|
const i = "reauthenticate";
|
|
4893
4901
|
try {
|
|
4894
|
-
const s = await
|
|
4902
|
+
const s = await Q(n, wn(r, i, e, n), t);
|
|
4895
4903
|
h(
|
|
4896
4904
|
s.idToken,
|
|
4897
4905
|
r,
|
|
@@ -4911,9 +4919,9 @@ async function ds(n, e, t = !1) {
|
|
|
4911
4919
|
r,
|
|
4912
4920
|
"user-mismatch"
|
|
4913
4921
|
/* AuthErrorCode.USER_MISMATCH */
|
|
4914
|
-
),
|
|
4922
|
+
), x._forOperation(n, i, s);
|
|
4915
4923
|
} catch (s) {
|
|
4916
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
4924
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && T(
|
|
4917
4925
|
r,
|
|
4918
4926
|
"user-mismatch"
|
|
4919
4927
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -4936,10 +4944,10 @@ async function ds(n, e, t = !1) {
|
|
|
4936
4944
|
* See the License for the specific language governing permissions and
|
|
4937
4945
|
* limitations under the License.
|
|
4938
4946
|
*/
|
|
4939
|
-
async function
|
|
4940
|
-
if (
|
|
4941
|
-
return Promise.reject(
|
|
4942
|
-
const r = "signIn", i = await
|
|
4947
|
+
async function fs(n, e, t = !1) {
|
|
4948
|
+
if (v(n.app))
|
|
4949
|
+
return Promise.reject(N(n));
|
|
4950
|
+
const r = "signIn", i = await wn(n, r, e), s = await x._fromIdTokenResponse(n, r, i);
|
|
4943
4951
|
return t || await n._updateCurrentUser(s.user), s;
|
|
4944
4952
|
}
|
|
4945
4953
|
/**
|
|
@@ -4958,8 +4966,8 @@ async function hs(n, e, t = !1) {
|
|
|
4958
4966
|
* See the License for the specific language governing permissions and
|
|
4959
4967
|
* limitations under the License.
|
|
4960
4968
|
*/
|
|
4961
|
-
async function
|
|
4962
|
-
return
|
|
4969
|
+
async function ps(n, e) {
|
|
4970
|
+
return sn(n, "POST", "/v1/accounts:signInWithCustomToken", ve(n, e));
|
|
4963
4971
|
}
|
|
4964
4972
|
/**
|
|
4965
4973
|
* @license
|
|
@@ -4977,19 +4985,19 @@ async function fs(n, e) {
|
|
|
4977
4985
|
* See the License for the specific language governing permissions and
|
|
4978
4986
|
* limitations under the License.
|
|
4979
4987
|
*/
|
|
4980
|
-
async function
|
|
4981
|
-
if (
|
|
4982
|
-
return Promise.reject(
|
|
4983
|
-
const t = be(n), r = await
|
|
4988
|
+
async function ms(n, e) {
|
|
4989
|
+
if (v(n.app))
|
|
4990
|
+
return Promise.reject(N(n));
|
|
4991
|
+
const t = be(n), r = await ps(t, {
|
|
4984
4992
|
token: e,
|
|
4985
4993
|
returnSecureToken: !0
|
|
4986
|
-
}), i = await
|
|
4994
|
+
}), i = await x._fromIdTokenResponse(t, "signIn", r);
|
|
4987
4995
|
return await t._updateCurrentUser(i.user), i;
|
|
4988
4996
|
}
|
|
4989
|
-
function
|
|
4997
|
+
function gs(n, e, t, r) {
|
|
4990
4998
|
return z(n).onIdTokenChanged(e, t, r);
|
|
4991
4999
|
}
|
|
4992
|
-
function
|
|
5000
|
+
function _s(n, e, t) {
|
|
4993
5001
|
return z(n).beforeAuthStateChanged(e, t);
|
|
4994
5002
|
}
|
|
4995
5003
|
const _e = "__sak";
|
|
@@ -5009,7 +5017,7 @@ const _e = "__sak";
|
|
|
5009
5017
|
* See the License for the specific language governing permissions and
|
|
5010
5018
|
* limitations under the License.
|
|
5011
5019
|
*/
|
|
5012
|
-
class
|
|
5020
|
+
class En {
|
|
5013
5021
|
constructor(e, t) {
|
|
5014
5022
|
this.storageRetriever = e, this.type = t;
|
|
5015
5023
|
}
|
|
@@ -5050,14 +5058,14 @@ class wn {
|
|
|
5050
5058
|
* See the License for the specific language governing permissions and
|
|
5051
5059
|
* limitations under the License.
|
|
5052
5060
|
*/
|
|
5053
|
-
const
|
|
5054
|
-
class
|
|
5061
|
+
const ys = 1e3, vs = 10;
|
|
5062
|
+
class Tn extends En {
|
|
5055
5063
|
constructor() {
|
|
5056
5064
|
super(
|
|
5057
5065
|
() => window.localStorage,
|
|
5058
5066
|
"LOCAL"
|
|
5059
5067
|
/* PersistenceType.LOCAL */
|
|
5060
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.fallbackToPolling =
|
|
5068
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.fallbackToPolling = _n(), this._shouldAllowMigration = !0;
|
|
5061
5069
|
}
|
|
5062
5070
|
forAllChangedKeys(e) {
|
|
5063
5071
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -5078,7 +5086,7 @@ class En extends wn {
|
|
|
5078
5086
|
const a = this.storage.getItem(r);
|
|
5079
5087
|
!t && this.localCache[r] === a || this.notifyListeners(r, a);
|
|
5080
5088
|
}, s = this.storage.getItem(r);
|
|
5081
|
-
|
|
5089
|
+
Ji() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(i, vs) : i();
|
|
5082
5090
|
}
|
|
5083
5091
|
notifyListeners(e, t) {
|
|
5084
5092
|
this.localCache[e] = t;
|
|
@@ -5100,7 +5108,7 @@ class En extends wn {
|
|
|
5100
5108
|
!0
|
|
5101
5109
|
);
|
|
5102
5110
|
});
|
|
5103
|
-
},
|
|
5111
|
+
}, ys);
|
|
5104
5112
|
}
|
|
5105
5113
|
stopPolling() {
|
|
5106
5114
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -5129,8 +5137,8 @@ class En extends wn {
|
|
|
5129
5137
|
await super._remove(e), delete this.localCache[e];
|
|
5130
5138
|
}
|
|
5131
5139
|
}
|
|
5132
|
-
|
|
5133
|
-
const
|
|
5140
|
+
Tn.type = "LOCAL";
|
|
5141
|
+
const bs = Tn;
|
|
5134
5142
|
/**
|
|
5135
5143
|
* @license
|
|
5136
5144
|
* Copyright 2020 Google LLC
|
|
@@ -5147,7 +5155,7 @@ const vs = En;
|
|
|
5147
5155
|
* See the License for the specific language governing permissions and
|
|
5148
5156
|
* limitations under the License.
|
|
5149
5157
|
*/
|
|
5150
|
-
class
|
|
5158
|
+
class Sn extends En {
|
|
5151
5159
|
constructor() {
|
|
5152
5160
|
super(
|
|
5153
5161
|
() => window.sessionStorage,
|
|
@@ -5160,8 +5168,8 @@ class Tn extends wn {
|
|
|
5160
5168
|
_removeListener(e, t) {
|
|
5161
5169
|
}
|
|
5162
5170
|
}
|
|
5163
|
-
|
|
5164
|
-
const
|
|
5171
|
+
Sn.type = "SESSION";
|
|
5172
|
+
const kn = Sn;
|
|
5165
5173
|
/**
|
|
5166
5174
|
* @license
|
|
5167
5175
|
* Copyright 2019 Google LLC
|
|
@@ -5178,7 +5186,7 @@ const Sn = Tn;
|
|
|
5178
5186
|
* See the License for the specific language governing permissions and
|
|
5179
5187
|
* limitations under the License.
|
|
5180
5188
|
*/
|
|
5181
|
-
function
|
|
5189
|
+
function Is(n) {
|
|
5182
5190
|
return Promise.all(n.map(async (e) => {
|
|
5183
5191
|
try {
|
|
5184
5192
|
return {
|
|
@@ -5248,7 +5256,7 @@ class Ie {
|
|
|
5248
5256
|
eventId: r,
|
|
5249
5257
|
eventType: i
|
|
5250
5258
|
});
|
|
5251
|
-
const c = Array.from(a).map(async (
|
|
5259
|
+
const c = Array.from(a).map(async (l) => l(t.origin, s)), o = await Is(c);
|
|
5252
5260
|
t.ports[0].postMessage({
|
|
5253
5261
|
status: "done",
|
|
5254
5262
|
eventId: r,
|
|
@@ -5316,7 +5324,7 @@ function Ze(n = "", e = 10) {
|
|
|
5316
5324
|
* See the License for the specific language governing permissions and
|
|
5317
5325
|
* limitations under the License.
|
|
5318
5326
|
*/
|
|
5319
|
-
class
|
|
5327
|
+
class ws {
|
|
5320
5328
|
constructor(e) {
|
|
5321
5329
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
5322
5330
|
}
|
|
@@ -5350,9 +5358,9 @@ class Is {
|
|
|
5350
5358
|
);
|
|
5351
5359
|
let s, a;
|
|
5352
5360
|
return new Promise((c, o) => {
|
|
5353
|
-
const
|
|
5361
|
+
const l = Ze("", 20);
|
|
5354
5362
|
i.port1.start();
|
|
5355
|
-
const
|
|
5363
|
+
const u = setTimeout(() => {
|
|
5356
5364
|
o(new Error(
|
|
5357
5365
|
"unsupported_event"
|
|
5358
5366
|
/* _MessageError.UNSUPPORTED_EVENT */
|
|
@@ -5361,11 +5369,11 @@ class Is {
|
|
|
5361
5369
|
a = {
|
|
5362
5370
|
messageChannel: i,
|
|
5363
5371
|
onMessage(d) {
|
|
5364
|
-
const
|
|
5365
|
-
if (
|
|
5366
|
-
switch (
|
|
5372
|
+
const p = d;
|
|
5373
|
+
if (p.data.eventId === l)
|
|
5374
|
+
switch (p.data.status) {
|
|
5367
5375
|
case "ack":
|
|
5368
|
-
clearTimeout(
|
|
5376
|
+
clearTimeout(u), s = setTimeout(
|
|
5369
5377
|
() => {
|
|
5370
5378
|
o(new Error(
|
|
5371
5379
|
"timeout"
|
|
@@ -5377,10 +5385,10 @@ class Is {
|
|
|
5377
5385
|
);
|
|
5378
5386
|
break;
|
|
5379
5387
|
case "done":
|
|
5380
|
-
clearTimeout(s), c(
|
|
5388
|
+
clearTimeout(s), c(p.data.response);
|
|
5381
5389
|
break;
|
|
5382
5390
|
default:
|
|
5383
|
-
clearTimeout(
|
|
5391
|
+
clearTimeout(u), clearTimeout(s), o(new Error(
|
|
5384
5392
|
"invalid_response"
|
|
5385
5393
|
/* _MessageError.INVALID_RESPONSE */
|
|
5386
5394
|
));
|
|
@@ -5389,7 +5397,7 @@ class Is {
|
|
|
5389
5397
|
}
|
|
5390
5398
|
}, this.handlers.add(a), i.port1.addEventListener("message", a.onMessage), this.target.postMessage({
|
|
5391
5399
|
eventType: e,
|
|
5392
|
-
eventId:
|
|
5400
|
+
eventId: l,
|
|
5393
5401
|
data: t
|
|
5394
5402
|
}, [i.port2]);
|
|
5395
5403
|
}).finally(() => {
|
|
@@ -5416,7 +5424,7 @@ class Is {
|
|
|
5416
5424
|
function y() {
|
|
5417
5425
|
return window;
|
|
5418
5426
|
}
|
|
5419
|
-
function
|
|
5427
|
+
function Es(n) {
|
|
5420
5428
|
y().location.href = n;
|
|
5421
5429
|
}
|
|
5422
5430
|
/**
|
|
@@ -5435,10 +5443,10 @@ function ws(n) {
|
|
|
5435
5443
|
* See the License for the specific language governing permissions and
|
|
5436
5444
|
* limitations under the License.
|
|
5437
5445
|
*/
|
|
5438
|
-
function
|
|
5446
|
+
function An() {
|
|
5439
5447
|
return typeof y().WorkerGlobalScope < "u" && typeof y().importScripts == "function";
|
|
5440
5448
|
}
|
|
5441
|
-
async function
|
|
5449
|
+
async function Ts() {
|
|
5442
5450
|
if (!(navigator != null && navigator.serviceWorker))
|
|
5443
5451
|
return null;
|
|
5444
5452
|
try {
|
|
@@ -5447,12 +5455,12 @@ async function Es() {
|
|
|
5447
5455
|
return null;
|
|
5448
5456
|
}
|
|
5449
5457
|
}
|
|
5450
|
-
function
|
|
5458
|
+
function Ss() {
|
|
5451
5459
|
var n;
|
|
5452
5460
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
5453
5461
|
}
|
|
5454
|
-
function
|
|
5455
|
-
return
|
|
5462
|
+
function ks() {
|
|
5463
|
+
return An() ? self : null;
|
|
5456
5464
|
}
|
|
5457
5465
|
/**
|
|
5458
5466
|
* @license
|
|
@@ -5470,8 +5478,8 @@ function Ss() {
|
|
|
5470
5478
|
* See the License for the specific language governing permissions and
|
|
5471
5479
|
* limitations under the License.
|
|
5472
5480
|
*/
|
|
5473
|
-
const
|
|
5474
|
-
class
|
|
5481
|
+
const Rn = "firebaseLocalStorageDb", As = 1, ye = "firebaseLocalStorage", Cn = "fbase_key";
|
|
5482
|
+
class ie {
|
|
5475
5483
|
constructor(e) {
|
|
5476
5484
|
this.request = e;
|
|
5477
5485
|
}
|
|
@@ -5488,45 +5496,45 @@ class re {
|
|
|
5488
5496
|
function we(n, e) {
|
|
5489
5497
|
return n.transaction([ye], e ? "readwrite" : "readonly").objectStore(ye);
|
|
5490
5498
|
}
|
|
5491
|
-
function
|
|
5492
|
-
const n = indexedDB.deleteDatabase(
|
|
5493
|
-
return new
|
|
5499
|
+
function Rs() {
|
|
5500
|
+
const n = indexedDB.deleteDatabase(Rn);
|
|
5501
|
+
return new ie(n).toPromise();
|
|
5494
5502
|
}
|
|
5495
5503
|
function je() {
|
|
5496
|
-
const n = indexedDB.open(
|
|
5504
|
+
const n = indexedDB.open(Rn, As);
|
|
5497
5505
|
return new Promise((e, t) => {
|
|
5498
5506
|
n.addEventListener("error", () => {
|
|
5499
5507
|
t(n.error);
|
|
5500
5508
|
}), n.addEventListener("upgradeneeded", () => {
|
|
5501
5509
|
const r = n.result;
|
|
5502
5510
|
try {
|
|
5503
|
-
r.createObjectStore(ye, { keyPath:
|
|
5511
|
+
r.createObjectStore(ye, { keyPath: Cn });
|
|
5504
5512
|
} catch (i) {
|
|
5505
5513
|
t(i);
|
|
5506
5514
|
}
|
|
5507
5515
|
}), n.addEventListener("success", async () => {
|
|
5508
5516
|
const r = n.result;
|
|
5509
|
-
r.objectStoreNames.contains(ye) ? e(r) : (r.close(), await
|
|
5517
|
+
r.objectStoreNames.contains(ye) ? e(r) : (r.close(), await Rs(), e(await je()));
|
|
5510
5518
|
});
|
|
5511
5519
|
});
|
|
5512
5520
|
}
|
|
5513
5521
|
async function St(n, e, t) {
|
|
5514
5522
|
const r = we(n, !0).put({
|
|
5515
|
-
[
|
|
5523
|
+
[Cn]: e,
|
|
5516
5524
|
value: t
|
|
5517
5525
|
});
|
|
5518
|
-
return new
|
|
5526
|
+
return new ie(r).toPromise();
|
|
5519
5527
|
}
|
|
5520
|
-
async function
|
|
5521
|
-
const t = we(n, !1).get(e), r = await new
|
|
5528
|
+
async function Cs(n, e) {
|
|
5529
|
+
const t = we(n, !1).get(e), r = await new ie(t).toPromise();
|
|
5522
5530
|
return r === void 0 ? null : r.value;
|
|
5523
5531
|
}
|
|
5524
5532
|
function kt(n, e) {
|
|
5525
5533
|
const t = we(n, !0).delete(e);
|
|
5526
|
-
return new
|
|
5534
|
+
return new ie(t).toPromise();
|
|
5527
5535
|
}
|
|
5528
|
-
const
|
|
5529
|
-
class
|
|
5536
|
+
const Ps = 800, Os = 3;
|
|
5537
|
+
class Pn {
|
|
5530
5538
|
constructor() {
|
|
5531
5539
|
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(() => {
|
|
5532
5540
|
}, () => {
|
|
@@ -5542,7 +5550,7 @@ class Cn {
|
|
|
5542
5550
|
const r = await this._openDb();
|
|
5543
5551
|
return await e(r);
|
|
5544
5552
|
} catch (r) {
|
|
5545
|
-
if (t++ >
|
|
5553
|
+
if (t++ > Os)
|
|
5546
5554
|
throw r;
|
|
5547
5555
|
this.db && (this.db.close(), this.db = void 0);
|
|
5548
5556
|
}
|
|
@@ -5552,13 +5560,13 @@ class Cn {
|
|
|
5552
5560
|
* postMessage interface to send these events to the worker ourselves.
|
|
5553
5561
|
*/
|
|
5554
5562
|
async initializeServiceWorkerMessaging() {
|
|
5555
|
-
return
|
|
5563
|
+
return An() ? this.initializeReceiver() : this.initializeSender();
|
|
5556
5564
|
}
|
|
5557
5565
|
/**
|
|
5558
5566
|
* As the worker we should listen to events from the main window.
|
|
5559
5567
|
*/
|
|
5560
5568
|
async initializeReceiver() {
|
|
5561
|
-
this.receiver = Ie._getInstance(
|
|
5569
|
+
this.receiver = Ie._getInstance(ks()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
5562
5570
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
5563
5571
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
5564
5572
|
"keyChanged"
|
|
@@ -5574,9 +5582,9 @@ class Cn {
|
|
|
5574
5582
|
*/
|
|
5575
5583
|
async initializeSender() {
|
|
5576
5584
|
var e, t;
|
|
5577
|
-
if (this.activeServiceWorker = await
|
|
5585
|
+
if (this.activeServiceWorker = await Ts(), !this.activeServiceWorker)
|
|
5578
5586
|
return;
|
|
5579
|
-
this.sender = new
|
|
5587
|
+
this.sender = new ws(this.activeServiceWorker);
|
|
5580
5588
|
const r = await this.sender._send(
|
|
5581
5589
|
"ping",
|
|
5582
5590
|
{},
|
|
@@ -5598,7 +5606,7 @@ class Cn {
|
|
|
5598
5606
|
* @param key - Storage key which changed.
|
|
5599
5607
|
*/
|
|
5600
5608
|
async notifyServiceWorker(e) {
|
|
5601
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
5609
|
+
if (!(!this.sender || !this.activeServiceWorker || Ss() !== this.activeServiceWorker))
|
|
5602
5610
|
try {
|
|
5603
5611
|
await this.sender._send(
|
|
5604
5612
|
"keyChanged",
|
|
@@ -5632,7 +5640,7 @@ class Cn {
|
|
|
5632
5640
|
return this._withPendingWrite(async () => (await this._withRetries((r) => St(r, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
5633
5641
|
}
|
|
5634
5642
|
async _get(e) {
|
|
5635
|
-
const t = await this._withRetries((r) =>
|
|
5643
|
+
const t = await this._withRetries((r) => Cs(r, e));
|
|
5636
5644
|
return this.localCache[e] = t, t;
|
|
5637
5645
|
}
|
|
5638
5646
|
async _remove(e) {
|
|
@@ -5641,7 +5649,7 @@ class Cn {
|
|
|
5641
5649
|
async _poll() {
|
|
5642
5650
|
const e = await this._withRetries((i) => {
|
|
5643
5651
|
const s = we(i, !1).getAll();
|
|
5644
|
-
return new
|
|
5652
|
+
return new ie(s).toPromise();
|
|
5645
5653
|
});
|
|
5646
5654
|
if (!e)
|
|
5647
5655
|
return [];
|
|
@@ -5663,7 +5671,7 @@ class Cn {
|
|
|
5663
5671
|
i(t);
|
|
5664
5672
|
}
|
|
5665
5673
|
startPolling() {
|
|
5666
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
5674
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Ps);
|
|
5667
5675
|
}
|
|
5668
5676
|
stopPolling() {
|
|
5669
5677
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -5675,9 +5683,9 @@ class Cn {
|
|
|
5675
5683
|
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();
|
|
5676
5684
|
}
|
|
5677
5685
|
}
|
|
5678
|
-
|
|
5679
|
-
const
|
|
5680
|
-
new
|
|
5686
|
+
Pn.type = "LOCAL";
|
|
5687
|
+
const Ds = Pn;
|
|
5688
|
+
new ne(3e4, 6e4);
|
|
5681
5689
|
/**
|
|
5682
5690
|
* @license
|
|
5683
5691
|
* Copyright 2021 Google LLC
|
|
@@ -5694,8 +5702,8 @@ new te(3e4, 6e4);
|
|
|
5694
5702
|
* See the License for the specific language governing permissions and
|
|
5695
5703
|
* limitations under the License.
|
|
5696
5704
|
*/
|
|
5697
|
-
function
|
|
5698
|
-
return e ?
|
|
5705
|
+
function Ns(n, e) {
|
|
5706
|
+
return e ? w(e) : (h(
|
|
5699
5707
|
n._popupRedirectResolver,
|
|
5700
5708
|
n,
|
|
5701
5709
|
"argument-error"
|
|
@@ -5718,7 +5726,7 @@ function Ds(n, e) {
|
|
|
5718
5726
|
* See the License for the specific language governing permissions and
|
|
5719
5727
|
* limitations under the License.
|
|
5720
5728
|
*/
|
|
5721
|
-
class et extends
|
|
5729
|
+
class et extends bn {
|
|
5722
5730
|
constructor(e) {
|
|
5723
5731
|
super(
|
|
5724
5732
|
"custom",
|
|
@@ -5748,26 +5756,26 @@ class et extends vn {
|
|
|
5748
5756
|
return e && (t.idToken = e), t;
|
|
5749
5757
|
}
|
|
5750
5758
|
}
|
|
5751
|
-
function Ns(n) {
|
|
5752
|
-
return hs(n.auth, new et(n), n.bypassAuthState);
|
|
5753
|
-
}
|
|
5754
5759
|
function Ls(n) {
|
|
5760
|
+
return fs(n.auth, new et(n), n.bypassAuthState);
|
|
5761
|
+
}
|
|
5762
|
+
function Ms(n) {
|
|
5755
5763
|
const { auth: e, user: t } = n;
|
|
5756
5764
|
return h(
|
|
5757
5765
|
t,
|
|
5758
5766
|
e,
|
|
5759
5767
|
"internal-error"
|
|
5760
5768
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
5761
|
-
),
|
|
5769
|
+
), hs(t, new et(n), n.bypassAuthState);
|
|
5762
5770
|
}
|
|
5763
|
-
async function
|
|
5771
|
+
async function Us(n) {
|
|
5764
5772
|
const { auth: e, user: t } = n;
|
|
5765
5773
|
return h(
|
|
5766
5774
|
t,
|
|
5767
5775
|
e,
|
|
5768
5776
|
"internal-error"
|
|
5769
5777
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
5770
|
-
),
|
|
5778
|
+
), ds(t, new et(n), n.bypassAuthState);
|
|
5771
5779
|
}
|
|
5772
5780
|
/**
|
|
5773
5781
|
* @license
|
|
@@ -5785,7 +5793,7 @@ async function Ms(n) {
|
|
|
5785
5793
|
* See the License for the specific language governing permissions and
|
|
5786
5794
|
* limitations under the License.
|
|
5787
5795
|
*/
|
|
5788
|
-
class
|
|
5796
|
+
class On {
|
|
5789
5797
|
constructor(e, t, r, i, s = !1) {
|
|
5790
5798
|
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];
|
|
5791
5799
|
}
|
|
@@ -5816,8 +5824,8 @@ class Pn {
|
|
|
5816
5824
|
};
|
|
5817
5825
|
try {
|
|
5818
5826
|
this.resolve(await this.getIdpTask(c)(o));
|
|
5819
|
-
} catch (
|
|
5820
|
-
this.reject(
|
|
5827
|
+
} catch (l) {
|
|
5828
|
+
this.reject(l);
|
|
5821
5829
|
}
|
|
5822
5830
|
}
|
|
5823
5831
|
onError(e) {
|
|
@@ -5827,15 +5835,15 @@ class Pn {
|
|
|
5827
5835
|
switch (e) {
|
|
5828
5836
|
case "signInViaPopup":
|
|
5829
5837
|
case "signInViaRedirect":
|
|
5830
|
-
return
|
|
5838
|
+
return Ls;
|
|
5831
5839
|
case "linkViaPopup":
|
|
5832
5840
|
case "linkViaRedirect":
|
|
5833
|
-
return
|
|
5841
|
+
return Us;
|
|
5834
5842
|
case "reauthViaPopup":
|
|
5835
5843
|
case "reauthViaRedirect":
|
|
5836
|
-
return
|
|
5844
|
+
return Ms;
|
|
5837
5845
|
default:
|
|
5838
|
-
|
|
5846
|
+
T(
|
|
5839
5847
|
this.auth,
|
|
5840
5848
|
"internal-error"
|
|
5841
5849
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -5843,10 +5851,10 @@ class Pn {
|
|
|
5843
5851
|
}
|
|
5844
5852
|
}
|
|
5845
5853
|
resolve(e) {
|
|
5846
|
-
|
|
5854
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
5847
5855
|
}
|
|
5848
5856
|
reject(e) {
|
|
5849
|
-
|
|
5857
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
5850
5858
|
}
|
|
5851
5859
|
unregisterAndCleanUp() {
|
|
5852
5860
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -5868,8 +5876,8 @@ class Pn {
|
|
|
5868
5876
|
* See the License for the specific language governing permissions and
|
|
5869
5877
|
* limitations under the License.
|
|
5870
5878
|
*/
|
|
5871
|
-
const
|
|
5872
|
-
class B extends
|
|
5879
|
+
const xs = new ne(2e3, 1e4);
|
|
5880
|
+
class B extends On {
|
|
5873
5881
|
constructor(e, t, r, i, s) {
|
|
5874
5882
|
super(e, t, i, s), this.provider = r, this.authWindow = null, this.pollId = null, B.currentPopupAction && B.currentPopupAction.cancel(), B.currentPopupAction = this;
|
|
5875
5883
|
}
|
|
@@ -5883,7 +5891,7 @@ class B extends Pn {
|
|
|
5883
5891
|
), e;
|
|
5884
5892
|
}
|
|
5885
5893
|
async onExecution() {
|
|
5886
|
-
|
|
5894
|
+
S(this.filter.length === 1, "Popup operations only handle one event");
|
|
5887
5895
|
const e = Ze();
|
|
5888
5896
|
this.authWindow = await this.resolver._openPopup(
|
|
5889
5897
|
this.auth,
|
|
@@ -5932,7 +5940,7 @@ class B extends Pn {
|
|
|
5932
5940
|
);
|
|
5933
5941
|
return;
|
|
5934
5942
|
}
|
|
5935
|
-
this.pollId = window.setTimeout(e,
|
|
5943
|
+
this.pollId = window.setTimeout(e, xs.get());
|
|
5936
5944
|
};
|
|
5937
5945
|
e();
|
|
5938
5946
|
}
|
|
@@ -5954,8 +5962,8 @@ B.currentPopupAction = null;
|
|
|
5954
5962
|
* See the License for the specific language governing permissions and
|
|
5955
5963
|
* limitations under the License.
|
|
5956
5964
|
*/
|
|
5957
|
-
const
|
|
5958
|
-
class
|
|
5965
|
+
const Fs = "pendingRedirect", ce = /* @__PURE__ */ new Map();
|
|
5966
|
+
class Bs extends On {
|
|
5959
5967
|
constructor(e, t, r = !1) {
|
|
5960
5968
|
super(e, [
|
|
5961
5969
|
"signInViaRedirect",
|
|
@@ -5970,17 +5978,17 @@ class Fs extends Pn {
|
|
|
5970
5978
|
* just return it.
|
|
5971
5979
|
*/
|
|
5972
5980
|
async execute() {
|
|
5973
|
-
let e =
|
|
5981
|
+
let e = ce.get(this.auth._key());
|
|
5974
5982
|
if (!e) {
|
|
5975
5983
|
try {
|
|
5976
|
-
const r = await
|
|
5984
|
+
const r = await $s(this.resolver, this.auth) ? await super.execute() : null;
|
|
5977
5985
|
e = () => Promise.resolve(r);
|
|
5978
5986
|
} catch (t) {
|
|
5979
5987
|
e = () => Promise.reject(t);
|
|
5980
5988
|
}
|
|
5981
|
-
|
|
5989
|
+
ce.set(this.auth._key(), e);
|
|
5982
5990
|
}
|
|
5983
|
-
return this.bypassAuthState ||
|
|
5991
|
+
return this.bypassAuthState || ce.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
5984
5992
|
}
|
|
5985
5993
|
async onAuthEvent(e) {
|
|
5986
5994
|
if (e.type === "signInViaRedirect")
|
|
@@ -6001,26 +6009,26 @@ class Fs extends Pn {
|
|
|
6001
6009
|
cleanUp() {
|
|
6002
6010
|
}
|
|
6003
6011
|
}
|
|
6004
|
-
async function
|
|
6005
|
-
const t =
|
|
6012
|
+
async function $s(n, e) {
|
|
6013
|
+
const t = js(e), r = Vs(n);
|
|
6006
6014
|
if (!await r._isAvailable())
|
|
6007
6015
|
return !1;
|
|
6008
6016
|
const i = await r._get(t) === "true";
|
|
6009
6017
|
return await r._remove(t), i;
|
|
6010
6018
|
}
|
|
6011
|
-
function
|
|
6012
|
-
|
|
6013
|
-
}
|
|
6014
|
-
function Hs(n) {
|
|
6015
|
-
return E(n._redirectPersistence);
|
|
6019
|
+
function Hs(n, e) {
|
|
6020
|
+
ce.set(n._key(), e);
|
|
6016
6021
|
}
|
|
6017
6022
|
function Vs(n) {
|
|
6018
|
-
return
|
|
6023
|
+
return w(n._redirectPersistence);
|
|
6019
6024
|
}
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6025
|
+
function js(n) {
|
|
6026
|
+
return oe(Fs, n.config.apiKey, n.name);
|
|
6027
|
+
}
|
|
6028
|
+
async function Ws(n, e, t = !1) {
|
|
6029
|
+
if (v(n.app))
|
|
6030
|
+
return Promise.reject(N(n));
|
|
6031
|
+
const r = be(n), i = Ns(r, e), a = await new Bs(r, i, t).execute();
|
|
6024
6032
|
return a && !t && (delete a.user._redirectEventId, await r._persistUserIfCurrent(a.user), await r._setRedirectUser(null, e)), a;
|
|
6025
6033
|
}
|
|
6026
6034
|
/**
|
|
@@ -6039,8 +6047,8 @@ async function js(n, e, t = !1) {
|
|
|
6039
6047
|
* See the License for the specific language governing permissions and
|
|
6040
6048
|
* limitations under the License.
|
|
6041
6049
|
*/
|
|
6042
|
-
const
|
|
6043
|
-
class
|
|
6050
|
+
const zs = 10 * 60 * 1e3;
|
|
6051
|
+
class Gs {
|
|
6044
6052
|
constructor(e) {
|
|
6045
6053
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
6046
6054
|
}
|
|
@@ -6056,11 +6064,11 @@ class zs {
|
|
|
6056
6064
|
let t = !1;
|
|
6057
6065
|
return this.consumers.forEach((r) => {
|
|
6058
6066
|
this.isEventForConsumer(e, r) && (t = !0, this.sendToConsumer(e, r), this.saveEventToCache(e));
|
|
6059
|
-
}), this.hasHandledPotentialRedirect || !
|
|
6067
|
+
}), this.hasHandledPotentialRedirect || !qs(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
6060
6068
|
}
|
|
6061
6069
|
sendToConsumer(e, t) {
|
|
6062
6070
|
var r;
|
|
6063
|
-
if (e.error && !
|
|
6071
|
+
if (e.error && !Dn(e)) {
|
|
6064
6072
|
const i = ((r = e.error.code) === null || r === void 0 ? void 0 : r.split("auth/")[1]) || "internal-error";
|
|
6065
6073
|
t.onError(_(this.auth, i));
|
|
6066
6074
|
} else
|
|
@@ -6071,7 +6079,7 @@ class zs {
|
|
|
6071
6079
|
return t.filter.includes(e.type) && r;
|
|
6072
6080
|
}
|
|
6073
6081
|
hasEventBeenHandled(e) {
|
|
6074
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
6082
|
+
return Date.now() - this.lastProcessedEventTime >= zs && this.cachedEventUids.clear(), this.cachedEventUids.has(At(e));
|
|
6075
6083
|
}
|
|
6076
6084
|
saveEventToCache(e) {
|
|
6077
6085
|
this.cachedEventUids.add(At(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -6080,17 +6088,17 @@ class zs {
|
|
|
6080
6088
|
function At(n) {
|
|
6081
6089
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
6082
6090
|
}
|
|
6083
|
-
function
|
|
6091
|
+
function Dn({ type: n, error: e }) {
|
|
6084
6092
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
6085
6093
|
}
|
|
6086
|
-
function
|
|
6094
|
+
function qs(n) {
|
|
6087
6095
|
switch (n.type) {
|
|
6088
6096
|
case "signInViaRedirect":
|
|
6089
6097
|
case "linkViaRedirect":
|
|
6090
6098
|
case "reauthViaRedirect":
|
|
6091
6099
|
return !0;
|
|
6092
6100
|
case "unknown":
|
|
6093
|
-
return
|
|
6101
|
+
return Dn(n);
|
|
6094
6102
|
default:
|
|
6095
6103
|
return !1;
|
|
6096
6104
|
}
|
|
@@ -6111,7 +6119,7 @@ function Gs(n) {
|
|
|
6111
6119
|
* See the License for the specific language governing permissions and
|
|
6112
6120
|
* limitations under the License.
|
|
6113
6121
|
*/
|
|
6114
|
-
async function
|
|
6122
|
+
async function Ks(n, e = {}) {
|
|
6115
6123
|
return G(n, "GET", "/v1/projects", e);
|
|
6116
6124
|
}
|
|
6117
6125
|
/**
|
|
@@ -6130,32 +6138,32 @@ async function qs(n, e = {}) {
|
|
|
6130
6138
|
* See the License for the specific language governing permissions and
|
|
6131
6139
|
* limitations under the License.
|
|
6132
6140
|
*/
|
|
6133
|
-
const
|
|
6134
|
-
async function
|
|
6141
|
+
const Js = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Ys = /^https?/;
|
|
6142
|
+
async function Xs(n) {
|
|
6135
6143
|
if (n.config.emulator)
|
|
6136
6144
|
return;
|
|
6137
|
-
const { authorizedDomains: e } = await
|
|
6145
|
+
const { authorizedDomains: e } = await Ks(n);
|
|
6138
6146
|
for (const t of e)
|
|
6139
6147
|
try {
|
|
6140
|
-
if (
|
|
6148
|
+
if (Qs(t))
|
|
6141
6149
|
return;
|
|
6142
6150
|
} catch {
|
|
6143
6151
|
}
|
|
6144
|
-
|
|
6152
|
+
T(
|
|
6145
6153
|
n,
|
|
6146
6154
|
"unauthorized-domain"
|
|
6147
6155
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
6148
6156
|
);
|
|
6149
6157
|
}
|
|
6150
|
-
function
|
|
6158
|
+
function Qs(n) {
|
|
6151
6159
|
const e = He(), { protocol: t, hostname: r } = new URL(e);
|
|
6152
6160
|
if (n.startsWith("chrome-extension://")) {
|
|
6153
6161
|
const a = new URL(n);
|
|
6154
6162
|
return a.hostname === "" && r === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && a.hostname === r;
|
|
6155
6163
|
}
|
|
6156
|
-
if (!
|
|
6164
|
+
if (!Ys.test(t))
|
|
6157
6165
|
return !1;
|
|
6158
|
-
if (
|
|
6166
|
+
if (Js.test(n))
|
|
6159
6167
|
return r === n;
|
|
6160
6168
|
const i = n.replace(/\./g, "\\.");
|
|
6161
6169
|
return new RegExp("^(.+\\." + i + "|" + i + ")$", "i").test(r);
|
|
@@ -6176,7 +6184,7 @@ function Xs(n) {
|
|
|
6176
6184
|
* See the License for the specific language governing permissions and
|
|
6177
6185
|
* limitations under the License.
|
|
6178
6186
|
*/
|
|
6179
|
-
const
|
|
6187
|
+
const Zs = new ne(3e4, 6e4);
|
|
6180
6188
|
function Rt() {
|
|
6181
6189
|
const n = y().___jsl;
|
|
6182
6190
|
if (n != null && n.H) {
|
|
@@ -6186,7 +6194,7 @@ function Rt() {
|
|
|
6186
6194
|
n.CP[t] = null;
|
|
6187
6195
|
}
|
|
6188
6196
|
}
|
|
6189
|
-
function
|
|
6197
|
+
function ea(n) {
|
|
6190
6198
|
return new Promise((e, t) => {
|
|
6191
6199
|
var r, i, s;
|
|
6192
6200
|
function a() {
|
|
@@ -6201,7 +6209,7 @@ function Zs(n) {
|
|
|
6201
6209
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6202
6210
|
));
|
|
6203
6211
|
},
|
|
6204
|
-
timeout:
|
|
6212
|
+
timeout: Zs.get()
|
|
6205
6213
|
});
|
|
6206
6214
|
}
|
|
6207
6215
|
if (!((i = (r = y().gapi) === null || r === void 0 ? void 0 : r.iframes) === null || i === void 0) && i.Iframe)
|
|
@@ -6209,22 +6217,22 @@ function Zs(n) {
|
|
|
6209
6217
|
else if (!((s = y().gapi) === null || s === void 0) && s.load)
|
|
6210
6218
|
a();
|
|
6211
6219
|
else {
|
|
6212
|
-
const c =
|
|
6220
|
+
const c = is("iframefcb");
|
|
6213
6221
|
return y()[c] = () => {
|
|
6214
6222
|
gapi.load ? a() : t(_(
|
|
6215
6223
|
n,
|
|
6216
6224
|
"network-request-failed"
|
|
6217
6225
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6218
6226
|
));
|
|
6219
|
-
},
|
|
6227
|
+
}, ns(`${rs()}?onload=${c}`).catch((o) => t(o));
|
|
6220
6228
|
}
|
|
6221
6229
|
}).catch((e) => {
|
|
6222
|
-
throw
|
|
6230
|
+
throw le = null, e;
|
|
6223
6231
|
});
|
|
6224
6232
|
}
|
|
6225
|
-
let
|
|
6226
|
-
function
|
|
6227
|
-
return
|
|
6233
|
+
let le = null;
|
|
6234
|
+
function ta(n) {
|
|
6235
|
+
return le = le || ea(n), le;
|
|
6228
6236
|
}
|
|
6229
6237
|
/**
|
|
6230
6238
|
* @license
|
|
@@ -6242,7 +6250,7 @@ function ea(n) {
|
|
|
6242
6250
|
* See the License for the specific language governing permissions and
|
|
6243
6251
|
* limitations under the License.
|
|
6244
6252
|
*/
|
|
6245
|
-
const
|
|
6253
|
+
const na = new ne(5e3, 15e3), ra = "__/auth/iframe", ia = "emulator/auth/iframe", sa = {
|
|
6246
6254
|
style: {
|
|
6247
6255
|
position: "absolute",
|
|
6248
6256
|
top: "-100px",
|
|
@@ -6251,13 +6259,13 @@ const ta = new te(5e3, 15e3), na = "__/auth/iframe", ra = "emulator/auth/iframe"
|
|
|
6251
6259
|
},
|
|
6252
6260
|
"aria-hidden": "true",
|
|
6253
6261
|
tabindex: "-1"
|
|
6254
|
-
},
|
|
6262
|
+
}, aa = /* @__PURE__ */ new Map([
|
|
6255
6263
|
["identitytoolkit.googleapis.com", "p"],
|
|
6256
6264
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
6257
6265
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
6258
6266
|
// test
|
|
6259
6267
|
]);
|
|
6260
|
-
function
|
|
6268
|
+
function oa(n) {
|
|
6261
6269
|
const e = n.config;
|
|
6262
6270
|
h(
|
|
6263
6271
|
e.authDomain,
|
|
@@ -6265,17 +6273,17 @@ function aa(n) {
|
|
|
6265
6273
|
"auth-domain-config-required"
|
|
6266
6274
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
6267
6275
|
);
|
|
6268
|
-
const t = e.emulator ? Je(e,
|
|
6276
|
+
const t = e.emulator ? Je(e, ia) : `https://${n.config.authDomain}/${ra}`, r = {
|
|
6269
6277
|
apiKey: e.apiKey,
|
|
6270
6278
|
appName: n.name,
|
|
6271
|
-
v:
|
|
6272
|
-
}, i =
|
|
6279
|
+
v: te
|
|
6280
|
+
}, i = aa.get(n.config.apiHost);
|
|
6273
6281
|
i && (r.eid = i);
|
|
6274
6282
|
const s = n._getFrameworks();
|
|
6275
|
-
return s.length && (r.fw = s.join(",")), `${t}?${
|
|
6283
|
+
return s.length && (r.fw = s.join(",")), `${t}?${ee(r).slice(1)}`;
|
|
6276
6284
|
}
|
|
6277
|
-
async function
|
|
6278
|
-
const e = await
|
|
6285
|
+
async function ca(n) {
|
|
6286
|
+
const e = await ta(n), t = y().gapi;
|
|
6279
6287
|
return h(
|
|
6280
6288
|
t,
|
|
6281
6289
|
n,
|
|
@@ -6283,9 +6291,9 @@ async function oa(n) {
|
|
|
6283
6291
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
6284
6292
|
), e.open({
|
|
6285
6293
|
where: document.body,
|
|
6286
|
-
url:
|
|
6294
|
+
url: oa(n),
|
|
6287
6295
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
6288
|
-
attributes:
|
|
6296
|
+
attributes: sa,
|
|
6289
6297
|
dontclear: !0
|
|
6290
6298
|
}, (r) => new Promise(async (i, s) => {
|
|
6291
6299
|
await r.restyle({
|
|
@@ -6298,7 +6306,7 @@ async function oa(n) {
|
|
|
6298
6306
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6299
6307
|
), c = y().setTimeout(() => {
|
|
6300
6308
|
s(a);
|
|
6301
|
-
},
|
|
6309
|
+
}, na.get());
|
|
6302
6310
|
function o() {
|
|
6303
6311
|
y().clearTimeout(c), i(r);
|
|
6304
6312
|
}
|
|
@@ -6323,12 +6331,12 @@ async function oa(n) {
|
|
|
6323
6331
|
* See the License for the specific language governing permissions and
|
|
6324
6332
|
* limitations under the License.
|
|
6325
6333
|
*/
|
|
6326
|
-
const
|
|
6334
|
+
const la = {
|
|
6327
6335
|
location: "yes",
|
|
6328
6336
|
resizable: "yes",
|
|
6329
6337
|
statusbar: "yes",
|
|
6330
6338
|
toolbar: "no"
|
|
6331
|
-
},
|
|
6339
|
+
}, ua = 500, da = 600, ha = "_blank", fa = "http://localhost";
|
|
6332
6340
|
class Ct {
|
|
6333
6341
|
constructor(e) {
|
|
6334
6342
|
this.window = e, this.associatedEvent = null;
|
|
@@ -6341,20 +6349,20 @@ class Ct {
|
|
|
6341
6349
|
}
|
|
6342
6350
|
}
|
|
6343
6351
|
}
|
|
6344
|
-
function
|
|
6352
|
+
function pa(n, e, t, r = ua, i = da) {
|
|
6345
6353
|
const s = Math.max((window.screen.availHeight - i) / 2, 0).toString(), a = Math.max((window.screen.availWidth - r) / 2, 0).toString();
|
|
6346
6354
|
let c = "";
|
|
6347
|
-
const o = Object.assign(Object.assign({},
|
|
6355
|
+
const o = Object.assign(Object.assign({}, la), {
|
|
6348
6356
|
width: r.toString(),
|
|
6349
6357
|
height: i.toString(),
|
|
6350
6358
|
top: s,
|
|
6351
6359
|
left: a
|
|
6352
|
-
}),
|
|
6353
|
-
t && (c =
|
|
6354
|
-
const
|
|
6355
|
-
if (
|
|
6356
|
-
return
|
|
6357
|
-
const d = window.open(e || "", c,
|
|
6360
|
+
}), l = g().toLowerCase();
|
|
6361
|
+
t && (c = hn(l) ? ha : t), un(l) && (e = e || fa, o.scrollbars = "yes");
|
|
6362
|
+
const u = Object.entries(o).reduce((p, [m, F]) => `${p}${m}=${F},`, "");
|
|
6363
|
+
if (Ki(l) && c !== "_self")
|
|
6364
|
+
return ma(e || "", c), new Ct(null);
|
|
6365
|
+
const d = window.open(e || "", c, u);
|
|
6358
6366
|
h(
|
|
6359
6367
|
d,
|
|
6360
6368
|
n,
|
|
@@ -6367,7 +6375,7 @@ function fa(n, e, t, r = la, i = ua) {
|
|
|
6367
6375
|
}
|
|
6368
6376
|
return new Ct(d);
|
|
6369
6377
|
}
|
|
6370
|
-
function
|
|
6378
|
+
function ma(n, e) {
|
|
6371
6379
|
const t = document.createElement("a");
|
|
6372
6380
|
t.href = n, t.target = e;
|
|
6373
6381
|
const r = document.createEvent("MouseEvent");
|
|
@@ -6389,7 +6397,7 @@ function pa(n, e) {
|
|
|
6389
6397
|
* See the License for the specific language governing permissions and
|
|
6390
6398
|
* limitations under the License.
|
|
6391
6399
|
*/
|
|
6392
|
-
const
|
|
6400
|
+
const ga = "__/auth/handler", _a = "emulator/auth/handler", ya = encodeURIComponent("fac");
|
|
6393
6401
|
async function Pt(n, e, t, r, i, s) {
|
|
6394
6402
|
h(
|
|
6395
6403
|
n.config.authDomain,
|
|
@@ -6407,27 +6415,27 @@ async function Pt(n, e, t, r, i, s) {
|
|
|
6407
6415
|
appName: n.name,
|
|
6408
6416
|
authType: t,
|
|
6409
6417
|
redirectUrl: r,
|
|
6410
|
-
v:
|
|
6418
|
+
v: te,
|
|
6411
6419
|
eventId: i
|
|
6412
6420
|
};
|
|
6413
|
-
if (e instanceof
|
|
6414
|
-
e.setDefaultLanguage(n.languageCode), a.providerId = e.providerId || "",
|
|
6415
|
-
for (const [
|
|
6416
|
-
a[
|
|
6421
|
+
if (e instanceof In) {
|
|
6422
|
+
e.setDefaultLanguage(n.languageCode), a.providerId = e.providerId || "", yr(e.getCustomParameters()) || (a.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
6423
|
+
for (const [u, d] of Object.entries({}))
|
|
6424
|
+
a[u] = d;
|
|
6417
6425
|
}
|
|
6418
|
-
if (e instanceof
|
|
6419
|
-
const
|
|
6420
|
-
|
|
6426
|
+
if (e instanceof re) {
|
|
6427
|
+
const u = e.getScopes().filter((d) => d !== "");
|
|
6428
|
+
u.length > 0 && (a.scopes = u.join(","));
|
|
6421
6429
|
}
|
|
6422
6430
|
n.tenantId && (a.tid = n.tenantId);
|
|
6423
6431
|
const c = a;
|
|
6424
|
-
for (const
|
|
6425
|
-
c[
|
|
6426
|
-
const o = await n._getAppCheckToken(),
|
|
6427
|
-
return `${
|
|
6432
|
+
for (const u of Object.keys(c))
|
|
6433
|
+
c[u] === void 0 && delete c[u];
|
|
6434
|
+
const o = await n._getAppCheckToken(), l = o ? `#${ya}=${encodeURIComponent(o)}` : "";
|
|
6435
|
+
return `${va(n)}?${ee(c).slice(1)}${l}`;
|
|
6428
6436
|
}
|
|
6429
|
-
function
|
|
6430
|
-
return n.emulator ? Je(n,
|
|
6437
|
+
function va({ config: n }) {
|
|
6438
|
+
return n.emulator ? Je(n, _a) : `https://${n.authDomain}/${ga}`;
|
|
6431
6439
|
}
|
|
6432
6440
|
/**
|
|
6433
6441
|
* @license
|
|
@@ -6446,29 +6454,29 @@ function ya({ config: n }) {
|
|
|
6446
6454
|
* limitations under the License.
|
|
6447
6455
|
*/
|
|
6448
6456
|
const Ne = "webStorageSupport";
|
|
6449
|
-
class
|
|
6457
|
+
class ba {
|
|
6450
6458
|
constructor() {
|
|
6451
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
6459
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = kn, this._completeRedirectFn = Ws, this._overrideRedirectResult = Hs;
|
|
6452
6460
|
}
|
|
6453
6461
|
// Wrapping in async even though we don't await anywhere in order
|
|
6454
6462
|
// to make sure errors are raised as promise rejections
|
|
6455
6463
|
async _openPopup(e, t, r, i) {
|
|
6456
6464
|
var s;
|
|
6457
|
-
|
|
6465
|
+
S((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
6458
6466
|
const a = await Pt(e, t, r, He(), i);
|
|
6459
|
-
return
|
|
6467
|
+
return pa(e, a, Ze());
|
|
6460
6468
|
}
|
|
6461
6469
|
async _openRedirect(e, t, r, i) {
|
|
6462
6470
|
await this._originValidation(e);
|
|
6463
6471
|
const s = await Pt(e, t, r, He(), i);
|
|
6464
|
-
return
|
|
6472
|
+
return Es(s), new Promise(() => {
|
|
6465
6473
|
});
|
|
6466
6474
|
}
|
|
6467
6475
|
_initialize(e) {
|
|
6468
6476
|
const t = e._key();
|
|
6469
6477
|
if (this.eventManagers[t]) {
|
|
6470
6478
|
const { manager: i, promise: s } = this.eventManagers[t];
|
|
6471
|
-
return i ? Promise.resolve(i) : (
|
|
6479
|
+
return i ? Promise.resolve(i) : (S(s, "If manager is not set, promise should be"), s);
|
|
6472
6480
|
}
|
|
6473
6481
|
const r = this.initAndGetManager(e);
|
|
6474
6482
|
return this.eventManagers[t] = { promise: r }, r.catch(() => {
|
|
@@ -6476,7 +6484,7 @@ class va {
|
|
|
6476
6484
|
}), r;
|
|
6477
6485
|
}
|
|
6478
6486
|
async initAndGetManager(e) {
|
|
6479
|
-
const t = await
|
|
6487
|
+
const t = await ca(e), r = new Gs(e);
|
|
6480
6488
|
return t.register("authEvent", (i) => (h(
|
|
6481
6489
|
i == null ? void 0 : i.authEvent,
|
|
6482
6490
|
e,
|
|
@@ -6491,7 +6499,7 @@ class va {
|
|
|
6491
6499
|
this.iframes[e._key()].send(Ne, { type: Ne }, (i) => {
|
|
6492
6500
|
var s;
|
|
6493
6501
|
const a = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
6494
|
-
a !== void 0 && t(!!a),
|
|
6502
|
+
a !== void 0 && t(!!a), T(
|
|
6495
6503
|
e,
|
|
6496
6504
|
"internal-error"
|
|
6497
6505
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -6500,13 +6508,13 @@ class va {
|
|
|
6500
6508
|
}
|
|
6501
6509
|
_originValidation(e) {
|
|
6502
6510
|
const t = e._key();
|
|
6503
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
6511
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Xs(e)), this.originValidationPromises[t];
|
|
6504
6512
|
}
|
|
6505
6513
|
get _shouldInitProactively() {
|
|
6506
|
-
return
|
|
6514
|
+
return _n() || dn() || Xe();
|
|
6507
6515
|
}
|
|
6508
6516
|
}
|
|
6509
|
-
const
|
|
6517
|
+
const Ia = ba;
|
|
6510
6518
|
var Ot = "@firebase/auth", Dt = "1.7.9";
|
|
6511
6519
|
/**
|
|
6512
6520
|
* @license
|
|
@@ -6524,7 +6532,7 @@ var Ot = "@firebase/auth", Dt = "1.7.9";
|
|
|
6524
6532
|
* See the License for the specific language governing permissions and
|
|
6525
6533
|
* limitations under the License.
|
|
6526
6534
|
*/
|
|
6527
|
-
class
|
|
6535
|
+
class wa {
|
|
6528
6536
|
constructor(e) {
|
|
6529
6537
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
6530
6538
|
}
|
|
@@ -6575,7 +6583,7 @@ class Ia {
|
|
|
6575
6583
|
* See the License for the specific language governing permissions and
|
|
6576
6584
|
* limitations under the License.
|
|
6577
6585
|
*/
|
|
6578
|
-
function
|
|
6586
|
+
function Ea(n) {
|
|
6579
6587
|
switch (n) {
|
|
6580
6588
|
case "Node":
|
|
6581
6589
|
return "node";
|
|
@@ -6591,8 +6599,8 @@ function wa(n) {
|
|
|
6591
6599
|
return;
|
|
6592
6600
|
}
|
|
6593
6601
|
}
|
|
6594
|
-
function
|
|
6595
|
-
|
|
6602
|
+
function Ta(n) {
|
|
6603
|
+
Y(new W(
|
|
6596
6604
|
"auth",
|
|
6597
6605
|
(e, { options: t }) => {
|
|
6598
6606
|
const r = e.getProvider("app").getImmediate(), i = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: a, authDomain: c } = r.options;
|
|
@@ -6604,9 +6612,9 @@ function Ea(n) {
|
|
|
6604
6612
|
apiHost: "identitytoolkit.googleapis.com",
|
|
6605
6613
|
tokenApiHost: "securetoken.googleapis.com",
|
|
6606
6614
|
apiScheme: "https",
|
|
6607
|
-
sdkClientVersion:
|
|
6608
|
-
},
|
|
6609
|
-
return
|
|
6615
|
+
sdkClientVersion: yn(n)
|
|
6616
|
+
}, l = new es(r, i, s, o);
|
|
6617
|
+
return as(l, t), l;
|
|
6610
6618
|
},
|
|
6611
6619
|
"PUBLIC"
|
|
6612
6620
|
/* ComponentType.PUBLIC */
|
|
@@ -6618,21 +6626,21 @@ function Ea(n) {
|
|
|
6618
6626
|
"auth-internal"
|
|
6619
6627
|
/* _ComponentName.AUTH_INTERNAL */
|
|
6620
6628
|
).initialize();
|
|
6621
|
-
})),
|
|
6629
|
+
})), Y(new W(
|
|
6622
6630
|
"auth-internal",
|
|
6623
6631
|
(e) => {
|
|
6624
6632
|
const t = be(e.getProvider(
|
|
6625
6633
|
"auth"
|
|
6626
6634
|
/* _ComponentName.AUTH */
|
|
6627
6635
|
).getImmediate());
|
|
6628
|
-
return ((r) => new
|
|
6636
|
+
return ((r) => new wa(r))(t);
|
|
6629
6637
|
},
|
|
6630
6638
|
"PRIVATE"
|
|
6631
6639
|
/* ComponentType.PRIVATE */
|
|
6632
6640
|
).setInstantiationMode(
|
|
6633
6641
|
"EXPLICIT"
|
|
6634
6642
|
/* InstantiationMode.EXPLICIT */
|
|
6635
|
-
)), $(Ot, Dt,
|
|
6643
|
+
)), $(Ot, Dt, Ea(n)), $(Ot, Dt, "esm2017");
|
|
6636
6644
|
}
|
|
6637
6645
|
/**
|
|
6638
6646
|
* @license
|
|
@@ -6650,11 +6658,11 @@ function Ea(n) {
|
|
|
6650
6658
|
* See the License for the specific language governing permissions and
|
|
6651
6659
|
* limitations under the License.
|
|
6652
6660
|
*/
|
|
6653
|
-
const
|
|
6661
|
+
const Sa = 5 * 60, ka = zt("authIdTokenMaxAge") || Sa;
|
|
6654
6662
|
let Nt = null;
|
|
6655
|
-
const
|
|
6663
|
+
const Aa = (n) => async (e) => {
|
|
6656
6664
|
const t = e && await e.getIdTokenResult(), r = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
6657
|
-
if (r && r >
|
|
6665
|
+
if (r && r > ka)
|
|
6658
6666
|
return;
|
|
6659
6667
|
const i = t == null ? void 0 : t.token;
|
|
6660
6668
|
Nt !== i && (Nt = i, await fetch(n, {
|
|
@@ -6664,33 +6672,33 @@ const ka = (n) => async (e) => {
|
|
|
6664
6672
|
} : {}
|
|
6665
6673
|
}));
|
|
6666
6674
|
};
|
|
6667
|
-
function
|
|
6668
|
-
const e =
|
|
6675
|
+
function Ra(n = bi()) {
|
|
6676
|
+
const e = Jt(n, "auth");
|
|
6669
6677
|
if (e.isInitialized())
|
|
6670
6678
|
return e.getImmediate();
|
|
6671
|
-
const t =
|
|
6672
|
-
popupRedirectResolver:
|
|
6679
|
+
const t = ss(n, {
|
|
6680
|
+
popupRedirectResolver: Ia,
|
|
6673
6681
|
persistence: [
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6682
|
+
Ds,
|
|
6683
|
+
bs,
|
|
6684
|
+
kn
|
|
6677
6685
|
]
|
|
6678
|
-
}), r =
|
|
6686
|
+
}), r = zt("authTokenSyncURL");
|
|
6679
6687
|
if (r && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
6680
6688
|
const s = new URL(r, location.origin);
|
|
6681
6689
|
if (location.origin === s.origin) {
|
|
6682
|
-
const a =
|
|
6683
|
-
|
|
6690
|
+
const a = Aa(s.toString());
|
|
6691
|
+
_s(t, a, () => a(t.currentUser)), gs(t, (c) => a(c));
|
|
6684
6692
|
}
|
|
6685
6693
|
}
|
|
6686
|
-
const i =
|
|
6687
|
-
return i &&
|
|
6694
|
+
const i = jt("auth");
|
|
6695
|
+
return i && os(t, `http://${i}`), t;
|
|
6688
6696
|
}
|
|
6689
|
-
function
|
|
6697
|
+
function Ca() {
|
|
6690
6698
|
var n, e;
|
|
6691
6699
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
6692
6700
|
}
|
|
6693
|
-
|
|
6701
|
+
ts({
|
|
6694
6702
|
loadJS(n) {
|
|
6695
6703
|
return new Promise((e, t) => {
|
|
6696
6704
|
const r = document.createElement("script");
|
|
@@ -6700,22 +6708,22 @@ es({
|
|
|
6700
6708
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
6701
6709
|
);
|
|
6702
6710
|
s.customData = i, t(s);
|
|
6703
|
-
}, r.type = "text/javascript", r.charset = "UTF-8",
|
|
6711
|
+
}, r.type = "text/javascript", r.charset = "UTF-8", Ca().appendChild(r);
|
|
6704
6712
|
});
|
|
6705
6713
|
},
|
|
6706
6714
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
6707
6715
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
6708
6716
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
6709
6717
|
});
|
|
6710
|
-
|
|
6718
|
+
Ta(
|
|
6711
6719
|
"Browser"
|
|
6712
6720
|
/* ClientPlatform.BROWSER */
|
|
6713
6721
|
);
|
|
6714
|
-
const
|
|
6715
|
-
history:
|
|
6722
|
+
const Pa = xn({
|
|
6723
|
+
history: Fn(),
|
|
6716
6724
|
routes: [
|
|
6717
6725
|
...ue,
|
|
6718
|
-
...
|
|
6726
|
+
...K,
|
|
6719
6727
|
{
|
|
6720
6728
|
path: "/forbidden",
|
|
6721
6729
|
name: "mf-payment-forbidden",
|
|
@@ -6724,7 +6732,7 @@ const Ca = Ln({
|
|
|
6724
6732
|
]
|
|
6725
6733
|
});
|
|
6726
6734
|
let Le, Me;
|
|
6727
|
-
|
|
6735
|
+
Pa.beforeEach(async (n) => {
|
|
6728
6736
|
const {
|
|
6729
6737
|
sessionUser: e,
|
|
6730
6738
|
currentRestaurant: t,
|
|
@@ -6732,13 +6740,13 @@ Ca.beforeEach(async (n) => {
|
|
|
6732
6740
|
readRestaurants: i,
|
|
6733
6741
|
changeRestaurant: s
|
|
6734
6742
|
} = We();
|
|
6735
|
-
if (n.name.startsWith("mf-payment-admin")) {
|
|
6743
|
+
if (n.name && n.name.startsWith("mf-payment-admin")) {
|
|
6736
6744
|
if (!e.value) {
|
|
6737
6745
|
Le || (Le = new Promise((c) => {
|
|
6738
|
-
const o = q(e, (
|
|
6739
|
-
var
|
|
6740
|
-
|
|
6741
|
-
(((
|
|
6746
|
+
const o = q(e, (l) => {
|
|
6747
|
+
var u, d;
|
|
6748
|
+
l && (o(), c(
|
|
6749
|
+
(((u = e.value) == null ? void 0 : u.role.isStaff) || ((d = e.value) == null ? void 0 : d.role.isAdmin)) ?? !1
|
|
6742
6750
|
));
|
|
6743
6751
|
});
|
|
6744
6752
|
}));
|
|
@@ -6754,37 +6762,53 @@ Ca.beforeEach(async (n) => {
|
|
|
6754
6762
|
});
|
|
6755
6763
|
}),
|
|
6756
6764
|
new Promise(async (a) => {
|
|
6757
|
-
const c = q(t, (
|
|
6758
|
-
|
|
6765
|
+
const c = q(t, (l) => {
|
|
6766
|
+
l && (c(), a(!0));
|
|
6759
6767
|
}), o = await i();
|
|
6760
6768
|
await s(o == null ? void 0 : o.at(0));
|
|
6761
6769
|
})
|
|
6762
6770
|
]).then((a) => !0)), Me) : !0;
|
|
6763
6771
|
});
|
|
6764
|
-
const
|
|
6772
|
+
const Oa = /* @__PURE__ */ Ut({
|
|
6765
6773
|
__name: "AppSidebar",
|
|
6766
6774
|
setup(n) {
|
|
6767
|
-
const e = We(), t =
|
|
6775
|
+
const e = We(), t = Bn(), { t: r } = Gn(), i = Hn(t.currentRoute.value.name);
|
|
6768
6776
|
q(t.currentRoute, () => {
|
|
6769
6777
|
let l = t.currentRoute.value.name;
|
|
6770
6778
|
t.currentRoute.value.meta.parent && (l = t.currentRoute.value.meta.parent), i.value = l;
|
|
6771
6779
|
});
|
|
6772
6780
|
const s = ue.map((l) => {
|
|
6773
|
-
var
|
|
6774
|
-
if (!((
|
|
6781
|
+
var p, m;
|
|
6782
|
+
if (!((p = l.meta) != null && p.sidebarDisplay) || l.meta.region && !((m = l.meta.region) != null && m[e.currentCountry.value]) || l.meta.section)
|
|
6775
6783
|
return;
|
|
6776
|
-
const
|
|
6777
|
-
label:
|
|
6784
|
+
const u = l.meta.sidebarDisplay, d = {
|
|
6785
|
+
label: u.startsWith("i18n:") ? r(u.replaceAll("i18n:", "")) : u,
|
|
6778
6786
|
value: l.name,
|
|
6779
6787
|
action: () => {
|
|
6780
6788
|
if (t.currentRoute.value.name !== l.name)
|
|
6781
6789
|
return t.push({ name: l.name });
|
|
6782
6790
|
}
|
|
6783
6791
|
};
|
|
6784
|
-
return l.meta.sidebarNew && (
|
|
6785
|
-
}).filter((l) => !!l)
|
|
6786
|
-
|
|
6787
|
-
|
|
6792
|
+
return l.meta.sidebarNew && (d.badge = () => Vn(Kn.FmPill, { label: "New" })), d;
|
|
6793
|
+
}).filter((l) => !!l);
|
|
6794
|
+
function a(l, u) {
|
|
6795
|
+
return l.map((d) => {
|
|
6796
|
+
var p, m;
|
|
6797
|
+
return (p = d.meta) != null && p.useChildrenRoutes ? a(d.children || [], u) : (m = d.meta) != null && m.sidebarDisplay ? d.meta.section !== u ? [] : [
|
|
6798
|
+
{
|
|
6799
|
+
label: d.meta.sidebarDisplay.startsWith("i18n:") ? r(d.meta.sidebarDisplay.replaceAll("i18n:", "")) : d.meta.sidebarDisplay,
|
|
6800
|
+
value: d.name,
|
|
6801
|
+
action: () => {
|
|
6802
|
+
if (t.currentRoute.value.name !== d.name)
|
|
6803
|
+
return t.push({ name: d.name });
|
|
6804
|
+
}
|
|
6805
|
+
}
|
|
6806
|
+
] : [];
|
|
6807
|
+
}).flat().filter((d) => !!d);
|
|
6808
|
+
}
|
|
6809
|
+
const c = K.map((l) => {
|
|
6810
|
+
var u;
|
|
6811
|
+
if ((u = l.meta) != null && u.sidebarDisplay && !l.meta.section)
|
|
6788
6812
|
return {
|
|
6789
6813
|
label: l.meta.sidebarDisplay.startsWith("i18n:") ? r(l.meta.sidebarDisplay.replaceAll("i18n:", "")) : l.meta.sidebarDisplay,
|
|
6790
6814
|
value: l.name,
|
|
@@ -6793,30 +6817,8 @@ const Pa = /* @__PURE__ */ Mt({
|
|
|
6793
6817
|
return t.push({ name: l.name });
|
|
6794
6818
|
}
|
|
6795
6819
|
};
|
|
6796
|
-
}).filter((l) => !!l),
|
|
6797
|
-
var
|
|
6798
|
-
if ((f = d.meta) != null && f.sidebarDisplay && d.meta.section === l)
|
|
6799
|
-
return {
|
|
6800
|
-
label: d.meta.sidebarDisplay.startsWith("i18n:") ? r(d.meta.sidebarDisplay.replaceAll("i18n:", "")) : d.meta.sidebarDisplay,
|
|
6801
|
-
value: d.name,
|
|
6802
|
-
action: () => {
|
|
6803
|
-
if (t.currentRoute.value.name !== d.name)
|
|
6804
|
-
return t.push({ name: d.name });
|
|
6805
|
-
}
|
|
6806
|
-
};
|
|
6807
|
-
}).filter((d) => !!d), o = (l) => le.map((d) => {
|
|
6808
|
-
var f;
|
|
6809
|
-
if ((f = d.meta) != null && f.sidebarDisplay && d.meta.section === l)
|
|
6810
|
-
return {
|
|
6811
|
-
label: d.meta.sidebarDisplay,
|
|
6812
|
-
value: d.name,
|
|
6813
|
-
action: () => {
|
|
6814
|
-
if (t.currentRoute.value.name !== d.name)
|
|
6815
|
-
return t.push({ name: d.name });
|
|
6816
|
-
}
|
|
6817
|
-
};
|
|
6818
|
-
}).filter((d) => !!d), u = Lt(() => {
|
|
6819
|
-
var d, f;
|
|
6820
|
+
}).filter((l) => !!l), o = Mt(() => {
|
|
6821
|
+
var u, d;
|
|
6820
6822
|
const l = [...s];
|
|
6821
6823
|
return l.push({
|
|
6822
6824
|
label: "",
|
|
@@ -6827,7 +6829,7 @@ const Pa = /* @__PURE__ */ Mt({
|
|
|
6827
6829
|
icon: "credit_score",
|
|
6828
6830
|
value: "divider",
|
|
6829
6831
|
disabled: !0
|
|
6830
|
-
}), l.push(...
|
|
6832
|
+
}), l.push(...a(ue, "financing")), ((u = e.sessionUser.value) != null && u.role.isStaff || (d = e.sessionUser.value) != null && d.role.isAdmin) && (l.push({
|
|
6831
6833
|
label: "",
|
|
6832
6834
|
value: "divider",
|
|
6833
6835
|
disabled: !0
|
|
@@ -6836,7 +6838,7 @@ const Pa = /* @__PURE__ */ Mt({
|
|
|
6836
6838
|
icon: "desktop_windows",
|
|
6837
6839
|
value: "divider",
|
|
6838
6840
|
disabled: !0
|
|
6839
|
-
}), l.push(...
|
|
6841
|
+
}), l.push(...a(K, "device")), l.push({
|
|
6840
6842
|
label: "",
|
|
6841
6843
|
value: "divider",
|
|
6842
6844
|
disabled: !0
|
|
@@ -6845,7 +6847,7 @@ const Pa = /* @__PURE__ */ Mt({
|
|
|
6845
6847
|
icon: "account_balance",
|
|
6846
6848
|
value: "divider",
|
|
6847
6849
|
disabled: !0
|
|
6848
|
-
}), l.push(...
|
|
6850
|
+
}), l.push(...a(K, "payment-gateway")), l.push({
|
|
6849
6851
|
label: "",
|
|
6850
6852
|
value: "divider",
|
|
6851
6853
|
disabled: !0
|
|
@@ -6854,58 +6856,69 @@ const Pa = /* @__PURE__ */ Mt({
|
|
|
6854
6856
|
icon: "admin_panel_settings",
|
|
6855
6857
|
value: "divider",
|
|
6856
6858
|
disabled: !0
|
|
6857
|
-
}), l.push(...
|
|
6859
|
+
}), l.push(...c)), l;
|
|
6858
6860
|
});
|
|
6859
|
-
return (l,
|
|
6860
|
-
const
|
|
6861
|
-
return
|
|
6861
|
+
return (l, u) => {
|
|
6862
|
+
const d = xt("FmCollapsibleTabs");
|
|
6863
|
+
return Ft(), Bt(d, {
|
|
6862
6864
|
modelValue: i.value,
|
|
6863
|
-
"onUpdate:modelValue":
|
|
6864
|
-
items:
|
|
6865
|
+
"onUpdate:modelValue": u[0] || (u[0] = (p) => i.value = p),
|
|
6866
|
+
items: o.value,
|
|
6865
6867
|
class: "py-16 px-8 w-[240px]"
|
|
6866
6868
|
}, null, 8, ["modelValue", "items"]);
|
|
6867
6869
|
};
|
|
6868
6870
|
}
|
|
6869
6871
|
});
|
|
6870
|
-
var
|
|
6871
|
-
const
|
|
6872
|
+
var Da = { authClientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com" };
|
|
6873
|
+
const Ha = /* @__PURE__ */ Ut({
|
|
6872
6874
|
__name: "App",
|
|
6873
6875
|
setup(n) {
|
|
6874
|
-
const { state: e } =
|
|
6876
|
+
const { state: e } = Zn(), t = We(), r = $n(), i = Yt(Da.firebase);
|
|
6875
6877
|
async function s() {
|
|
6876
6878
|
const a = t.sessionUser.value;
|
|
6877
6879
|
if (!a || !a.token) return;
|
|
6878
|
-
const c = await a.getCustomToken(), o =
|
|
6879
|
-
await
|
|
6880
|
+
const c = await a.getCustomToken(), o = Ra(i);
|
|
6881
|
+
await ms(o, c);
|
|
6880
6882
|
}
|
|
6881
|
-
return s(), q(t.sessionUser, s),
|
|
6883
|
+
return s(), q(t.sessionUser, s), jn(() => {
|
|
6882
6884
|
e.isIframe && parent.postMessage({ event: "ready" }, "*");
|
|
6883
|
-
}),
|
|
6884
|
-
t.registerSidebarComponent(
|
|
6885
|
+
}), Wn(() => {
|
|
6886
|
+
t.registerSidebarComponent(Oa);
|
|
6885
6887
|
}), (a, c) => {
|
|
6886
|
-
const o =
|
|
6887
|
-
return
|
|
6888
|
-
key:
|
|
6888
|
+
const o = xt("RouterView");
|
|
6889
|
+
return Ft(), Bt(o, {
|
|
6890
|
+
key: zn(r).path
|
|
6889
6891
|
});
|
|
6890
6892
|
};
|
|
6891
6893
|
}
|
|
6892
|
-
}),
|
|
6893
|
-
"en-US":
|
|
6894
|
-
|
|
6895
|
-
|
|
6894
|
+
}), Va = () => {
|
|
6895
|
+
const n = [{ "en-US": Yn, "zh-CN": Qn }, Un], e = new Set(
|
|
6896
|
+
n.flatMap((t) => Object.keys(t))
|
|
6897
|
+
);
|
|
6898
|
+
return Array.from(e).reduce(
|
|
6899
|
+
(t, r) => {
|
|
6900
|
+
const i = r;
|
|
6901
|
+
return t[r] = n.reduce((s, a) => ({
|
|
6902
|
+
...s,
|
|
6903
|
+
...a[i] || {}
|
|
6904
|
+
}), {}), t;
|
|
6905
|
+
},
|
|
6906
|
+
{}
|
|
6907
|
+
);
|
|
6908
|
+
}, ja = [...K, ...ue];
|
|
6896
6909
|
export {
|
|
6897
6910
|
W as C,
|
|
6898
|
-
|
|
6899
|
-
|
|
6911
|
+
L as F,
|
|
6912
|
+
te as S,
|
|
6900
6913
|
gt as _,
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6914
|
+
Y as a,
|
|
6915
|
+
Jt as b,
|
|
6916
|
+
Ba as c,
|
|
6917
|
+
bi as d,
|
|
6918
|
+
$a as e,
|
|
6919
|
+
ja as f,
|
|
6907
6920
|
z as g,
|
|
6908
|
-
|
|
6909
|
-
|
|
6921
|
+
Ha as h,
|
|
6922
|
+
Va as i,
|
|
6910
6923
|
$ as r
|
|
6911
6924
|
};
|