@feedmepos/mf-payment 1.4.44 → 1.4.46
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-D-p05sjq.js → OnboardForm-CnKOFMMH.js} +2 -2
- package/dist/{OnboardForm-BHwzJNnl.js → OnboardForm-DqhRFi-H.js} +2 -2
- package/dist/{OnboardSubmission-DjwHpqdD.js → OnboardSubmission-DKxUJxCW.js} +2 -2
- package/dist/{OnboardSubmission-BUp1Q-al.js → OnboardSubmission-munHiPKU.js} +1 -1
- package/dist/{PayoutAccount-C6HJIzYS.js → PayoutAccount-C1ADGszh.js} +1 -1
- package/dist/{PayoutAccount-C6IwKGOz.js → PayoutAccount-DbLQjLVr.js} +3 -3
- package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-CxX3_Xyg.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-Bzj_sdSY.js} +24 -24
- package/dist/{Settlement-C_rIV3fu.js → Settlement-CWX5RKwL.js} +1 -1
- package/dist/{TransactionOld-CDxar7K3.js → TransactionOld-CCzonxUD.js} +1 -1
- package/dist/{app-DmIXP-hM.js → app-DE4U_54A.js} +799 -769
- package/dist/app.js +1 -1
- package/dist/{index-DAuJC2FO.js → index-sc6pzeZl.js} +1 -1
- package/dist/package.json +3 -2
- package/dist/{payout-account-eSXqQE97.js → payout-account-KcIc3kyX.js} +2 -2
- package/dist/{plugins-DK1OMbz2.js → plugins-DOA8YO_V.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createRouter as Ln, createWebHistory as Mn, useRouter as Un, useRoute as xn } from "vue-router";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import { routes as Fn, FmApp as Bn } from "@feedmepos/mf-financing";
|
|
3
|
+
import { computed as Lt, watch as q, defineComponent as Mt, ref as $n, resolveComponent as Ut, openBlock as xt, createBlock as Ft, h as Hn, onMounted as Vn, onBeforeMount as jn, unref as Wn } from "vue";
|
|
4
|
+
import { useCoreStore as We, useI18n as zn } from "@feedmepos/mf-common";
|
|
5
|
+
import { defineStore as Gn } from "pinia";
|
|
6
|
+
import { components as qn } from "@feedmepos/ui-library";
|
|
7
|
+
const Kn = {
|
|
7
8
|
components: {
|
|
8
9
|
select: "Select filter entity",
|
|
9
10
|
restaurant: "Restaurant",
|
|
@@ -178,9 +179,9 @@ const Gn = {
|
|
|
178
179
|
service2: "SoftPOS Card Payment"
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
|
-
},
|
|
182
|
-
payment:
|
|
183
|
-
},
|
|
182
|
+
}, Jn = {
|
|
183
|
+
payment: Kn
|
|
184
|
+
}, Yn = {
|
|
184
185
|
components: {
|
|
185
186
|
select: "选择筛选对象",
|
|
186
187
|
restaurant: "餐厅",
|
|
@@ -355,8 +356,8 @@ const Gn = {
|
|
|
355
356
|
service2: "SoftPOS银行卡支付"
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
|
-
},
|
|
359
|
-
payment:
|
|
359
|
+
}, Xn = {
|
|
360
|
+
payment: Yn
|
|
360
361
|
}, le = [
|
|
361
362
|
{
|
|
362
363
|
path: "/admin/restaurants",
|
|
@@ -383,7 +384,7 @@ const Gn = {
|
|
|
383
384
|
sidebarDisplay: "Payout Accounts",
|
|
384
385
|
section: "payment-gateway"
|
|
385
386
|
},
|
|
386
|
-
component: () => import("./PayoutAccount-
|
|
387
|
+
component: () => import("./PayoutAccount-C1ADGszh.js")
|
|
387
388
|
},
|
|
388
389
|
{
|
|
389
390
|
path: "/admin/payout-accounts/:accountId",
|
|
@@ -401,7 +402,7 @@ const Gn = {
|
|
|
401
402
|
sidebarDisplay: "Payment Onboarding",
|
|
402
403
|
section: "payment-gateway"
|
|
403
404
|
},
|
|
404
|
-
component: () => import("./OnboardSubmission-
|
|
405
|
+
component: () => import("./OnboardSubmission-munHiPKU.js")
|
|
405
406
|
},
|
|
406
407
|
{
|
|
407
408
|
path: "/admin/onboarding/:submissionId",
|
|
@@ -410,7 +411,7 @@ const Gn = {
|
|
|
410
411
|
meta: {
|
|
411
412
|
parent: "mf-payment-admin.onboard-submission"
|
|
412
413
|
},
|
|
413
|
-
component: () => import("./OnboardForm-
|
|
414
|
+
component: () => import("./OnboardForm-DqhRFi-H.js")
|
|
414
415
|
},
|
|
415
416
|
{
|
|
416
417
|
path: "/admin/terminal/pos",
|
|
@@ -508,7 +509,7 @@ const Gn = {
|
|
|
508
509
|
},
|
|
509
510
|
component: () => import("./SettlementTransactions-DYAlKO__.js")
|
|
510
511
|
}
|
|
511
|
-
],
|
|
512
|
+
], ue = [
|
|
512
513
|
{
|
|
513
514
|
path: "",
|
|
514
515
|
redirect: { name: "mf-payment-payout-account" }
|
|
@@ -516,7 +517,7 @@ const Gn = {
|
|
|
516
517
|
{
|
|
517
518
|
path: "/payout-account",
|
|
518
519
|
name: "mf-payment-payout-account",
|
|
519
|
-
component: () => import("./PayoutAccount-
|
|
520
|
+
component: () => import("./PayoutAccount-DbLQjLVr.js"),
|
|
520
521
|
meta: {
|
|
521
522
|
sidebarDisplay: "i18n:payment.routes.payout_account"
|
|
522
523
|
}
|
|
@@ -524,7 +525,7 @@ const Gn = {
|
|
|
524
525
|
{
|
|
525
526
|
path: "/onboard-submission",
|
|
526
527
|
name: "mf-payment-onboard-submission",
|
|
527
|
-
component: () => import("./OnboardSubmission-
|
|
528
|
+
component: () => import("./OnboardSubmission-DKxUJxCW.js"),
|
|
528
529
|
meta: {
|
|
529
530
|
sidebarDisplay: "i18n:payment.routes.onboard_submission",
|
|
530
531
|
region: { MY: !0 }
|
|
@@ -534,7 +535,7 @@ const Gn = {
|
|
|
534
535
|
path: "/onboard-submission/:type/:submission?",
|
|
535
536
|
name: "mf-payment-onboard-submission-form",
|
|
536
537
|
props: !0,
|
|
537
|
-
component: () => import("./OnboardForm-
|
|
538
|
+
component: () => import("./OnboardForm-CnKOFMMH.js"),
|
|
538
539
|
meta: {
|
|
539
540
|
parent: "mf-payment-onboard-submission"
|
|
540
541
|
}
|
|
@@ -542,7 +543,7 @@ const Gn = {
|
|
|
542
543
|
{
|
|
543
544
|
path: "/transaction-old",
|
|
544
545
|
name: "mf-payment-old-transaction",
|
|
545
|
-
component: () => import("./TransactionOld-
|
|
546
|
+
component: () => import("./TransactionOld-CCzonxUD.js"),
|
|
546
547
|
meta: {
|
|
547
548
|
sidebarDisplay: "i18n:payment.routes.transaction"
|
|
548
549
|
}
|
|
@@ -559,7 +560,7 @@ const Gn = {
|
|
|
559
560
|
{
|
|
560
561
|
path: "/settlement",
|
|
561
562
|
name: "mf-payment-settlement",
|
|
562
|
-
component: () => import("./Settlement-
|
|
563
|
+
component: () => import("./Settlement-CWX5RKwL.js"),
|
|
563
564
|
meta: {
|
|
564
565
|
sidebarDisplay: "i18n:payment.routes.settlement"
|
|
565
566
|
}
|
|
@@ -572,8 +573,17 @@ const Gn = {
|
|
|
572
573
|
meta: {
|
|
573
574
|
parent: "mf-payment-settlement"
|
|
574
575
|
}
|
|
575
|
-
}
|
|
576
|
-
|
|
576
|
+
},
|
|
577
|
+
...Fn.map((n) => ({
|
|
578
|
+
...n,
|
|
579
|
+
meta: {
|
|
580
|
+
...n.meta,
|
|
581
|
+
section: "financing"
|
|
582
|
+
},
|
|
583
|
+
path: `/financing${n.path}`,
|
|
584
|
+
component: Bn
|
|
585
|
+
}))
|
|
586
|
+
], Qn = Gn("mf-payment-iframe", () => {
|
|
577
587
|
const n = {
|
|
578
588
|
isIframe: !1
|
|
579
589
|
}, e = Lt(() => n);
|
|
@@ -625,7 +635,7 @@ const Bt = function(n) {
|
|
|
625
635
|
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);
|
|
626
636
|
}
|
|
627
637
|
return e;
|
|
628
|
-
},
|
|
638
|
+
}, Zn = function(n) {
|
|
629
639
|
const e = [];
|
|
630
640
|
let t = 0, r = 0;
|
|
631
641
|
for (; t < n.length; ) {
|
|
@@ -703,9 +713,9 @@ const Bt = function(n) {
|
|
|
703
713
|
this.init_();
|
|
704
714
|
const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
|
|
705
715
|
for (let i = 0; i < n.length; i += 3) {
|
|
706
|
-
const s = n[i], a = i + 1 < n.length, c = a ? n[i + 1] : 0, o = i + 2 < n.length,
|
|
707
|
-
let
|
|
708
|
-
o || (g = 64, a || (
|
|
716
|
+
const s = n[i], a = i + 1 < n.length, c = a ? n[i + 1] : 0, o = i + 2 < n.length, u = o ? n[i + 2] : 0, l = s >> 2, d = (s & 3) << 4 | c >> 4;
|
|
717
|
+
let f = (c & 15) << 2 | u >> 6, g = u & 63;
|
|
718
|
+
o || (g = 64, a || (f = 64)), r.push(t[l], t[d], t[f], t[g]);
|
|
709
719
|
}
|
|
710
720
|
return r.join("");
|
|
711
721
|
},
|
|
@@ -729,7 +739,7 @@ const Bt = function(n) {
|
|
|
729
739
|
* @return string representing the decoded value.
|
|
730
740
|
*/
|
|
731
741
|
decodeString(n, e) {
|
|
732
|
-
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) :
|
|
742
|
+
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) : Zn(this.decodeStringToByteArray(n, e));
|
|
733
743
|
},
|
|
734
744
|
/**
|
|
735
745
|
* Base64-decode a string.
|
|
@@ -752,17 +762,17 @@ const Bt = function(n) {
|
|
|
752
762
|
for (let i = 0; i < n.length; ) {
|
|
753
763
|
const s = t[n.charAt(i++)], c = i < n.length ? t[n.charAt(i)] : 0;
|
|
754
764
|
++i;
|
|
755
|
-
const
|
|
765
|
+
const u = i < n.length ? t[n.charAt(i)] : 64;
|
|
756
766
|
++i;
|
|
757
|
-
const
|
|
758
|
-
if (++i, s == null || c == null ||
|
|
759
|
-
throw new
|
|
760
|
-
const
|
|
761
|
-
if (r.push(
|
|
762
|
-
const g = c << 4 & 240 |
|
|
763
|
-
if (r.push(g),
|
|
764
|
-
const
|
|
765
|
-
r.push(
|
|
767
|
+
const d = i < n.length ? t[n.charAt(i)] : 64;
|
|
768
|
+
if (++i, s == null || c == null || u == null || d == null)
|
|
769
|
+
throw new er();
|
|
770
|
+
const f = s << 2 | c >> 4;
|
|
771
|
+
if (r.push(f), u !== 64) {
|
|
772
|
+
const g = c << 4 & 240 | u >> 2;
|
|
773
|
+
if (r.push(g), d !== 64) {
|
|
774
|
+
const v = u << 6 & 192 | d;
|
|
775
|
+
r.push(v);
|
|
766
776
|
}
|
|
767
777
|
}
|
|
768
778
|
}
|
|
@@ -781,16 +791,16 @@ const Bt = function(n) {
|
|
|
781
791
|
}
|
|
782
792
|
}
|
|
783
793
|
};
|
|
784
|
-
class
|
|
794
|
+
class er extends Error {
|
|
785
795
|
constructor() {
|
|
786
796
|
super(...arguments), this.name = "DecodeBase64StringError";
|
|
787
797
|
}
|
|
788
798
|
}
|
|
789
|
-
const
|
|
799
|
+
const tr = function(n) {
|
|
790
800
|
const e = Bt(n);
|
|
791
801
|
return $t.encodeByteArray(e, !0);
|
|
792
|
-
},
|
|
793
|
-
return
|
|
802
|
+
}, de = function(n) {
|
|
803
|
+
return tr(n).replace(/\./g, "");
|
|
794
804
|
}, Ht = function(n) {
|
|
795
805
|
try {
|
|
796
806
|
return $t.decodeString(n, !0);
|
|
@@ -815,7 +825,7 @@ const Zn = function(n) {
|
|
|
815
825
|
* See the License for the specific language governing permissions and
|
|
816
826
|
* limitations under the License.
|
|
817
827
|
*/
|
|
818
|
-
function
|
|
828
|
+
function nr() {
|
|
819
829
|
if (typeof self < "u")
|
|
820
830
|
return self;
|
|
821
831
|
if (typeof window < "u")
|
|
@@ -840,13 +850,13 @@ function er() {
|
|
|
840
850
|
* See the License for the specific language governing permissions and
|
|
841
851
|
* limitations under the License.
|
|
842
852
|
*/
|
|
843
|
-
const
|
|
853
|
+
const rr = () => nr().__FIREBASE_DEFAULTS__, ir = () => {
|
|
844
854
|
if (typeof process > "u" || typeof process.env > "u")
|
|
845
855
|
return;
|
|
846
856
|
const n = process.env.__FIREBASE_DEFAULTS__;
|
|
847
857
|
if (n)
|
|
848
858
|
return JSON.parse(n);
|
|
849
|
-
},
|
|
859
|
+
}, sr = () => {
|
|
850
860
|
if (typeof document > "u")
|
|
851
861
|
return;
|
|
852
862
|
let n;
|
|
@@ -859,7 +869,7 @@ const tr = () => er().__FIREBASE_DEFAULTS__, nr = () => {
|
|
|
859
869
|
return e && JSON.parse(e);
|
|
860
870
|
}, ze = () => {
|
|
861
871
|
try {
|
|
862
|
-
return
|
|
872
|
+
return rr() || ir() || sr();
|
|
863
873
|
} catch (n) {
|
|
864
874
|
console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);
|
|
865
875
|
return;
|
|
@@ -867,7 +877,7 @@ const tr = () => er().__FIREBASE_DEFAULTS__, nr = () => {
|
|
|
867
877
|
}, Vt = (n) => {
|
|
868
878
|
var e, t;
|
|
869
879
|
return (t = (e = ze()) === null || e === void 0 ? void 0 : e.emulatorHosts) === null || t === void 0 ? void 0 : t[n];
|
|
870
|
-
},
|
|
880
|
+
}, Fa = (n) => {
|
|
871
881
|
const e = Vt(n);
|
|
872
882
|
if (!e)
|
|
873
883
|
return;
|
|
@@ -899,7 +909,7 @@ const tr = () => er().__FIREBASE_DEFAULTS__, nr = () => {
|
|
|
899
909
|
* See the License for the specific language governing permissions and
|
|
900
910
|
* limitations under the License.
|
|
901
911
|
*/
|
|
902
|
-
class
|
|
912
|
+
class ar {
|
|
903
913
|
constructor() {
|
|
904
914
|
this.reject = () => {
|
|
905
915
|
}, this.resolve = () => {
|
|
@@ -935,7 +945,7 @@ class ir {
|
|
|
935
945
|
* See the License for the specific language governing permissions and
|
|
936
946
|
* limitations under the License.
|
|
937
947
|
*/
|
|
938
|
-
function
|
|
948
|
+
function Ba(n, e) {
|
|
939
949
|
if (n.uid)
|
|
940
950
|
throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');
|
|
941
951
|
const t = {
|
|
@@ -959,8 +969,8 @@ function Ua(n, e) {
|
|
|
959
969
|
}
|
|
960
970
|
}, n);
|
|
961
971
|
return [
|
|
962
|
-
|
|
963
|
-
|
|
972
|
+
de(JSON.stringify(t)),
|
|
973
|
+
de(JSON.stringify(a)),
|
|
964
974
|
""
|
|
965
975
|
].join(".");
|
|
966
976
|
}
|
|
@@ -983,33 +993,33 @@ function Ua(n, e) {
|
|
|
983
993
|
function m() {
|
|
984
994
|
return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
|
|
985
995
|
}
|
|
986
|
-
function
|
|
996
|
+
function or() {
|
|
987
997
|
return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
|
|
988
998
|
// just to deal with this case would probably be a bad idea.
|
|
989
999
|
!!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(m());
|
|
990
1000
|
}
|
|
991
|
-
function
|
|
1001
|
+
function cr() {
|
|
992
1002
|
return typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers";
|
|
993
1003
|
}
|
|
994
|
-
function
|
|
1004
|
+
function lr() {
|
|
995
1005
|
const n = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
|
|
996
1006
|
return typeof n == "object" && n.id !== void 0;
|
|
997
1007
|
}
|
|
998
|
-
function
|
|
1008
|
+
function ur() {
|
|
999
1009
|
return typeof navigator == "object" && navigator.product === "ReactNative";
|
|
1000
1010
|
}
|
|
1001
|
-
function
|
|
1011
|
+
function dr() {
|
|
1002
1012
|
const n = m();
|
|
1003
1013
|
return n.indexOf("MSIE ") >= 0 || n.indexOf("Trident/") >= 0;
|
|
1004
1014
|
}
|
|
1005
|
-
function
|
|
1015
|
+
function hr() {
|
|
1006
1016
|
try {
|
|
1007
1017
|
return typeof indexedDB == "object";
|
|
1008
1018
|
} catch {
|
|
1009
1019
|
return !1;
|
|
1010
1020
|
}
|
|
1011
1021
|
}
|
|
1012
|
-
function
|
|
1022
|
+
function fr() {
|
|
1013
1023
|
return new Promise((n, e) => {
|
|
1014
1024
|
try {
|
|
1015
1025
|
let t = !0;
|
|
@@ -1043,10 +1053,10 @@ function dr() {
|
|
|
1043
1053
|
* See the License for the specific language governing permissions and
|
|
1044
1054
|
* limitations under the License.
|
|
1045
1055
|
*/
|
|
1046
|
-
const
|
|
1047
|
-
class
|
|
1056
|
+
const pr = "FirebaseError";
|
|
1057
|
+
class M extends Error {
|
|
1048
1058
|
constructor(e, t, r) {
|
|
1049
|
-
super(t), this.code = e, this.customData = r, this.name =
|
|
1059
|
+
super(t), this.code = e, this.customData = r, this.name = pr, Object.setPrototypeOf(this, M.prototype), Error.captureStackTrace && Error.captureStackTrace(this, Q.prototype.create);
|
|
1050
1060
|
}
|
|
1051
1061
|
}
|
|
1052
1062
|
class Q {
|
|
@@ -1054,24 +1064,24 @@ class Q {
|
|
|
1054
1064
|
this.service = e, this.serviceName = t, this.errors = r;
|
|
1055
1065
|
}
|
|
1056
1066
|
create(e, ...t) {
|
|
1057
|
-
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], a = s ?
|
|
1058
|
-
return new
|
|
1067
|
+
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], a = s ? mr(s, r) : "Error", c = `${this.serviceName}: ${a} (${i}).`;
|
|
1068
|
+
return new M(i, c, r);
|
|
1059
1069
|
}
|
|
1060
1070
|
}
|
|
1061
|
-
function
|
|
1062
|
-
return n.replace(
|
|
1071
|
+
function mr(n, e) {
|
|
1072
|
+
return n.replace(gr, (t, r) => {
|
|
1063
1073
|
const i = e[r];
|
|
1064
1074
|
return i != null ? String(i) : `<${r}?>`;
|
|
1065
1075
|
});
|
|
1066
1076
|
}
|
|
1067
|
-
const
|
|
1068
|
-
function
|
|
1077
|
+
const gr = /\{\$([^}]+)}/g;
|
|
1078
|
+
function _r(n) {
|
|
1069
1079
|
for (const e in n)
|
|
1070
1080
|
if (Object.prototype.hasOwnProperty.call(n, e))
|
|
1071
1081
|
return !1;
|
|
1072
1082
|
return !0;
|
|
1073
1083
|
}
|
|
1074
|
-
function
|
|
1084
|
+
function he(n, e) {
|
|
1075
1085
|
if (n === e)
|
|
1076
1086
|
return !0;
|
|
1077
1087
|
const t = Object.keys(n), r = Object.keys(e);
|
|
@@ -1080,7 +1090,7 @@ function de(n, e) {
|
|
|
1080
1090
|
return !1;
|
|
1081
1091
|
const s = n[i], a = e[i];
|
|
1082
1092
|
if (ot(s) && ot(a)) {
|
|
1083
|
-
if (!
|
|
1093
|
+
if (!he(s, a))
|
|
1084
1094
|
return !1;
|
|
1085
1095
|
} else if (s !== a)
|
|
1086
1096
|
return !1;
|
|
@@ -1117,11 +1127,11 @@ function Z(n) {
|
|
|
1117
1127
|
}) : e.push(encodeURIComponent(t) + "=" + encodeURIComponent(r));
|
|
1118
1128
|
return e.length ? "&" + e.join("&") : "";
|
|
1119
1129
|
}
|
|
1120
|
-
function
|
|
1121
|
-
const t = new
|
|
1130
|
+
function yr(n, e) {
|
|
1131
|
+
const t = new vr(n, e);
|
|
1122
1132
|
return t.subscribe.bind(t);
|
|
1123
1133
|
}
|
|
1124
|
-
class
|
|
1134
|
+
class vr {
|
|
1125
1135
|
/**
|
|
1126
1136
|
* @param executor Function which can make calls to a single Observer
|
|
1127
1137
|
* as a proxy.
|
|
@@ -1159,7 +1169,7 @@ class _r {
|
|
|
1159
1169
|
let i;
|
|
1160
1170
|
if (e === void 0 && t === void 0 && r === void 0)
|
|
1161
1171
|
throw new Error("Missing Observer.");
|
|
1162
|
-
|
|
1172
|
+
br(e, [
|
|
1163
1173
|
"next",
|
|
1164
1174
|
"error",
|
|
1165
1175
|
"complete"
|
|
@@ -1167,7 +1177,7 @@ class _r {
|
|
|
1167
1177
|
next: e,
|
|
1168
1178
|
error: t,
|
|
1169
1179
|
complete: r
|
|
1170
|
-
}, i.next === void 0 && (i.next =
|
|
1180
|
+
}, i.next === void 0 && (i.next = Ae), i.error === void 0 && (i.error = Ae), i.complete === void 0 && (i.complete = Ae);
|
|
1171
1181
|
const s = this.unsubscribeOne.bind(this, this.observers.length);
|
|
1172
1182
|
return this.finalized && this.task.then(() => {
|
|
1173
1183
|
try {
|
|
@@ -1205,7 +1215,7 @@ class _r {
|
|
|
1205
1215
|
}));
|
|
1206
1216
|
}
|
|
1207
1217
|
}
|
|
1208
|
-
function
|
|
1218
|
+
function br(n, e) {
|
|
1209
1219
|
if (typeof n != "object" || n === null)
|
|
1210
1220
|
return !1;
|
|
1211
1221
|
for (const t of e)
|
|
@@ -1213,7 +1223,7 @@ function yr(n, e) {
|
|
|
1213
1223
|
return !0;
|
|
1214
1224
|
return !1;
|
|
1215
1225
|
}
|
|
1216
|
-
function
|
|
1226
|
+
function Ae() {
|
|
1217
1227
|
}
|
|
1218
1228
|
/**
|
|
1219
1229
|
* @license
|
|
@@ -1273,7 +1283,7 @@ class W {
|
|
|
1273
1283
|
* See the License for the specific language governing permissions and
|
|
1274
1284
|
* limitations under the License.
|
|
1275
1285
|
*/
|
|
1276
|
-
const
|
|
1286
|
+
const U = "[DEFAULT]";
|
|
1277
1287
|
/**
|
|
1278
1288
|
* @license
|
|
1279
1289
|
* Copyright 2019 Google LLC
|
|
@@ -1290,7 +1300,7 @@ const M = "[DEFAULT]";
|
|
|
1290
1300
|
* See the License for the specific language governing permissions and
|
|
1291
1301
|
* limitations under the License.
|
|
1292
1302
|
*/
|
|
1293
|
-
class
|
|
1303
|
+
class Ir {
|
|
1294
1304
|
constructor(e, t) {
|
|
1295
1305
|
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();
|
|
1296
1306
|
}
|
|
@@ -1301,7 +1311,7 @@ class vr {
|
|
|
1301
1311
|
get(e) {
|
|
1302
1312
|
const t = this.normalizeInstanceIdentifier(e);
|
|
1303
1313
|
if (!this.instancesDeferred.has(t)) {
|
|
1304
|
-
const r = new
|
|
1314
|
+
const r = new ar();
|
|
1305
1315
|
if (this.instancesDeferred.set(t, r), this.isInitialized(t) || this.shouldAutoInitialize())
|
|
1306
1316
|
try {
|
|
1307
1317
|
const i = this.getOrInitializeService({
|
|
@@ -1341,9 +1351,9 @@ class vr {
|
|
|
1341
1351
|
if (this.component)
|
|
1342
1352
|
throw Error(`Component for ${this.name} has already been provided`);
|
|
1343
1353
|
if (this.component = e, !!this.shouldAutoInitialize()) {
|
|
1344
|
-
if (
|
|
1354
|
+
if (Er(e))
|
|
1345
1355
|
try {
|
|
1346
|
-
this.getOrInitializeService({ instanceIdentifier:
|
|
1356
|
+
this.getOrInitializeService({ instanceIdentifier: U });
|
|
1347
1357
|
} catch {
|
|
1348
1358
|
}
|
|
1349
1359
|
for (const [t, r] of this.instancesDeferred.entries()) {
|
|
@@ -1358,7 +1368,7 @@ class vr {
|
|
|
1358
1368
|
}
|
|
1359
1369
|
}
|
|
1360
1370
|
}
|
|
1361
|
-
clearInstance(e =
|
|
1371
|
+
clearInstance(e = U) {
|
|
1362
1372
|
this.instancesDeferred.delete(e), this.instancesOptions.delete(e), this.instances.delete(e);
|
|
1363
1373
|
}
|
|
1364
1374
|
// app.delete() will call this method on every provider to delete the services
|
|
@@ -1373,10 +1383,10 @@ class vr {
|
|
|
1373
1383
|
isComponentSet() {
|
|
1374
1384
|
return this.component != null;
|
|
1375
1385
|
}
|
|
1376
|
-
isInitialized(e =
|
|
1386
|
+
isInitialized(e = U) {
|
|
1377
1387
|
return this.instances.has(e);
|
|
1378
1388
|
}
|
|
1379
|
-
getOptions(e =
|
|
1389
|
+
getOptions(e = U) {
|
|
1380
1390
|
return this.instancesOptions.get(e) || {};
|
|
1381
1391
|
}
|
|
1382
1392
|
initialize(e = {}) {
|
|
@@ -1428,7 +1438,7 @@ class vr {
|
|
|
1428
1438
|
getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
|
|
1429
1439
|
let r = this.instances.get(e);
|
|
1430
1440
|
if (!r && this.component && (r = this.component.instanceFactory(this.container, {
|
|
1431
|
-
instanceIdentifier:
|
|
1441
|
+
instanceIdentifier: wr(e),
|
|
1432
1442
|
options: t
|
|
1433
1443
|
}), this.instances.set(e, r), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(r, e), this.component.onInstanceCreated))
|
|
1434
1444
|
try {
|
|
@@ -1437,17 +1447,17 @@ class vr {
|
|
|
1437
1447
|
}
|
|
1438
1448
|
return r || null;
|
|
1439
1449
|
}
|
|
1440
|
-
normalizeInstanceIdentifier(e =
|
|
1441
|
-
return this.component ? this.component.multipleInstances ? e :
|
|
1450
|
+
normalizeInstanceIdentifier(e = U) {
|
|
1451
|
+
return this.component ? this.component.multipleInstances ? e : U : e;
|
|
1442
1452
|
}
|
|
1443
1453
|
shouldAutoInitialize() {
|
|
1444
1454
|
return !!this.component && this.component.instantiationMode !== "EXPLICIT";
|
|
1445
1455
|
}
|
|
1446
1456
|
}
|
|
1447
|
-
function
|
|
1448
|
-
return n ===
|
|
1457
|
+
function wr(n) {
|
|
1458
|
+
return n === U ? void 0 : n;
|
|
1449
1459
|
}
|
|
1450
|
-
function
|
|
1460
|
+
function Er(n) {
|
|
1451
1461
|
return n.instantiationMode === "EAGER";
|
|
1452
1462
|
}
|
|
1453
1463
|
/**
|
|
@@ -1466,7 +1476,7 @@ function Ir(n) {
|
|
|
1466
1476
|
* See the License for the specific language governing permissions and
|
|
1467
1477
|
* limitations under the License.
|
|
1468
1478
|
*/
|
|
1469
|
-
class
|
|
1479
|
+
class Tr {
|
|
1470
1480
|
constructor(e) {
|
|
1471
1481
|
this.name = e, this.providers = /* @__PURE__ */ new Map();
|
|
1472
1482
|
}
|
|
@@ -1498,7 +1508,7 @@ class wr {
|
|
|
1498
1508
|
getProvider(e) {
|
|
1499
1509
|
if (this.providers.has(e))
|
|
1500
1510
|
return this.providers.get(e);
|
|
1501
|
-
const t = new
|
|
1511
|
+
const t = new Ir(e, this);
|
|
1502
1512
|
return this.providers.set(e, t), t;
|
|
1503
1513
|
}
|
|
1504
1514
|
getProviders() {
|
|
@@ -1521,27 +1531,27 @@ class wr {
|
|
|
1521
1531
|
* See the License for the specific language governing permissions and
|
|
1522
1532
|
* limitations under the License.
|
|
1523
1533
|
*/
|
|
1524
|
-
var
|
|
1534
|
+
var p;
|
|
1525
1535
|
(function(n) {
|
|
1526
1536
|
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";
|
|
1527
|
-
})(
|
|
1528
|
-
const
|
|
1529
|
-
debug:
|
|
1530
|
-
verbose:
|
|
1531
|
-
info:
|
|
1532
|
-
warn:
|
|
1533
|
-
error:
|
|
1534
|
-
silent:
|
|
1535
|
-
},
|
|
1536
|
-
[
|
|
1537
|
-
[
|
|
1538
|
-
[
|
|
1539
|
-
[
|
|
1540
|
-
[
|
|
1541
|
-
},
|
|
1537
|
+
})(p || (p = {}));
|
|
1538
|
+
const Sr = {
|
|
1539
|
+
debug: p.DEBUG,
|
|
1540
|
+
verbose: p.VERBOSE,
|
|
1541
|
+
info: p.INFO,
|
|
1542
|
+
warn: p.WARN,
|
|
1543
|
+
error: p.ERROR,
|
|
1544
|
+
silent: p.SILENT
|
|
1545
|
+
}, kr = p.INFO, Ar = {
|
|
1546
|
+
[p.DEBUG]: "log",
|
|
1547
|
+
[p.VERBOSE]: "log",
|
|
1548
|
+
[p.INFO]: "info",
|
|
1549
|
+
[p.WARN]: "warn",
|
|
1550
|
+
[p.ERROR]: "error"
|
|
1551
|
+
}, Rr = (n, e, ...t) => {
|
|
1542
1552
|
if (e < n.logLevel)
|
|
1543
1553
|
return;
|
|
1544
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), i =
|
|
1554
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), i = Ar[e];
|
|
1545
1555
|
if (i)
|
|
1546
1556
|
console[i](`[${r}] ${n.name}:`, ...t);
|
|
1547
1557
|
else
|
|
@@ -1555,19 +1565,19 @@ class zt {
|
|
|
1555
1565
|
* @param name The name that the logs will be associated with
|
|
1556
1566
|
*/
|
|
1557
1567
|
constructor(e) {
|
|
1558
|
-
this.name = e, this._logLevel =
|
|
1568
|
+
this.name = e, this._logLevel = kr, this._logHandler = Rr, this._userLogHandler = null;
|
|
1559
1569
|
}
|
|
1560
1570
|
get logLevel() {
|
|
1561
1571
|
return this._logLevel;
|
|
1562
1572
|
}
|
|
1563
1573
|
set logLevel(e) {
|
|
1564
|
-
if (!(e in
|
|
1574
|
+
if (!(e in p))
|
|
1565
1575
|
throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);
|
|
1566
1576
|
this._logLevel = e;
|
|
1567
1577
|
}
|
|
1568
1578
|
// Workaround for setter/getter having to be the same type.
|
|
1569
1579
|
setLogLevel(e) {
|
|
1570
|
-
this._logLevel = typeof e == "string" ?
|
|
1580
|
+
this._logLevel = typeof e == "string" ? Sr[e] : e;
|
|
1571
1581
|
}
|
|
1572
1582
|
get logHandler() {
|
|
1573
1583
|
return this._logHandler;
|
|
@@ -1587,24 +1597,24 @@ class zt {
|
|
|
1587
1597
|
* The functions below are all based on the `console` interface
|
|
1588
1598
|
*/
|
|
1589
1599
|
debug(...e) {
|
|
1590
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1600
|
+
this._userLogHandler && this._userLogHandler(this, p.DEBUG, ...e), this._logHandler(this, p.DEBUG, ...e);
|
|
1591
1601
|
}
|
|
1592
1602
|
log(...e) {
|
|
1593
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1603
|
+
this._userLogHandler && this._userLogHandler(this, p.VERBOSE, ...e), this._logHandler(this, p.VERBOSE, ...e);
|
|
1594
1604
|
}
|
|
1595
1605
|
info(...e) {
|
|
1596
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1606
|
+
this._userLogHandler && this._userLogHandler(this, p.INFO, ...e), this._logHandler(this, p.INFO, ...e);
|
|
1597
1607
|
}
|
|
1598
1608
|
warn(...e) {
|
|
1599
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1609
|
+
this._userLogHandler && this._userLogHandler(this, p.WARN, ...e), this._logHandler(this, p.WARN, ...e);
|
|
1600
1610
|
}
|
|
1601
1611
|
error(...e) {
|
|
1602
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1612
|
+
this._userLogHandler && this._userLogHandler(this, p.ERROR, ...e), this._logHandler(this, p.ERROR, ...e);
|
|
1603
1613
|
}
|
|
1604
1614
|
}
|
|
1605
|
-
const
|
|
1615
|
+
const Cr = (n, e) => e.some((t) => n instanceof t);
|
|
1606
1616
|
let ct, lt;
|
|
1607
|
-
function
|
|
1617
|
+
function Pr() {
|
|
1608
1618
|
return ct || (ct = [
|
|
1609
1619
|
IDBDatabase,
|
|
1610
1620
|
IDBObjectStore,
|
|
@@ -1613,20 +1623,20 @@ function Rr() {
|
|
|
1613
1623
|
IDBTransaction
|
|
1614
1624
|
]);
|
|
1615
1625
|
}
|
|
1616
|
-
function
|
|
1626
|
+
function Or() {
|
|
1617
1627
|
return lt || (lt = [
|
|
1618
1628
|
IDBCursor.prototype.advance,
|
|
1619
1629
|
IDBCursor.prototype.continue,
|
|
1620
1630
|
IDBCursor.prototype.continuePrimaryKey
|
|
1621
1631
|
]);
|
|
1622
1632
|
}
|
|
1623
|
-
const Gt = /* @__PURE__ */ new WeakMap(),
|
|
1624
|
-
function
|
|
1633
|
+
const Gt = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap();
|
|
1634
|
+
function Dr(n) {
|
|
1625
1635
|
const e = new Promise((t, r) => {
|
|
1626
1636
|
const i = () => {
|
|
1627
1637
|
n.removeEventListener("success", s), n.removeEventListener("error", a);
|
|
1628
1638
|
}, s = () => {
|
|
1629
|
-
t(
|
|
1639
|
+
t(D(n.result)), i();
|
|
1630
1640
|
}, a = () => {
|
|
1631
1641
|
r(n.error), i();
|
|
1632
1642
|
};
|
|
@@ -1637,8 +1647,8 @@ function Pr(n) {
|
|
|
1637
1647
|
}).catch(() => {
|
|
1638
1648
|
}), Ge.set(e, n), e;
|
|
1639
1649
|
}
|
|
1640
|
-
function
|
|
1641
|
-
if (
|
|
1650
|
+
function Nr(n) {
|
|
1651
|
+
if (Ue.has(n))
|
|
1642
1652
|
return;
|
|
1643
1653
|
const e = new Promise((t, r) => {
|
|
1644
1654
|
const i = () => {
|
|
@@ -1650,19 +1660,19 @@ function Or(n) {
|
|
|
1650
1660
|
};
|
|
1651
1661
|
n.addEventListener("complete", s), n.addEventListener("error", a), n.addEventListener("abort", a);
|
|
1652
1662
|
});
|
|
1653
|
-
|
|
1663
|
+
Ue.set(n, e);
|
|
1654
1664
|
}
|
|
1655
|
-
let
|
|
1665
|
+
let xe = {
|
|
1656
1666
|
get(n, e, t) {
|
|
1657
1667
|
if (n instanceof IDBTransaction) {
|
|
1658
1668
|
if (e === "done")
|
|
1659
|
-
return
|
|
1669
|
+
return Ue.get(n);
|
|
1660
1670
|
if (e === "objectStoreNames")
|
|
1661
1671
|
return n.objectStoreNames || qt.get(n);
|
|
1662
1672
|
if (e === "store")
|
|
1663
1673
|
return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
|
|
1664
1674
|
}
|
|
1665
|
-
return
|
|
1675
|
+
return D(n[e]);
|
|
1666
1676
|
},
|
|
1667
1677
|
set(n, e, t) {
|
|
1668
1678
|
return n[e] = t, !0;
|
|
@@ -1671,68 +1681,68 @@ let Ue = {
|
|
|
1671
1681
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
|
1672
1682
|
}
|
|
1673
1683
|
};
|
|
1674
|
-
function
|
|
1675
|
-
|
|
1684
|
+
function Lr(n) {
|
|
1685
|
+
xe = n(xe);
|
|
1676
1686
|
}
|
|
1677
|
-
function
|
|
1687
|
+
function Mr(n) {
|
|
1678
1688
|
return n === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
|
|
1679
|
-
const r = n.call(
|
|
1680
|
-
return qt.set(r, e.sort ? e.sort() : [e]),
|
|
1681
|
-
} :
|
|
1682
|
-
return n.apply(
|
|
1689
|
+
const r = n.call(Ce(this), e, ...t);
|
|
1690
|
+
return qt.set(r, e.sort ? e.sort() : [e]), D(r);
|
|
1691
|
+
} : Or().includes(n) ? function(...e) {
|
|
1692
|
+
return n.apply(Ce(this), e), D(Gt.get(this));
|
|
1683
1693
|
} : function(...e) {
|
|
1684
|
-
return
|
|
1694
|
+
return D(n.apply(Ce(this), e));
|
|
1685
1695
|
};
|
|
1686
1696
|
}
|
|
1687
|
-
function
|
|
1688
|
-
return typeof n == "function" ?
|
|
1697
|
+
function Ur(n) {
|
|
1698
|
+
return typeof n == "function" ? Mr(n) : (n instanceof IDBTransaction && Nr(n), Cr(n, Pr()) ? new Proxy(n, xe) : n);
|
|
1689
1699
|
}
|
|
1690
|
-
function
|
|
1700
|
+
function D(n) {
|
|
1691
1701
|
if (n instanceof IDBRequest)
|
|
1692
|
-
return
|
|
1693
|
-
if (
|
|
1694
|
-
return
|
|
1695
|
-
const e =
|
|
1696
|
-
return e !== n && (
|
|
1697
|
-
}
|
|
1698
|
-
const
|
|
1699
|
-
function
|
|
1700
|
-
const a = indexedDB.open(n, e), c =
|
|
1702
|
+
return Dr(n);
|
|
1703
|
+
if (Re.has(n))
|
|
1704
|
+
return Re.get(n);
|
|
1705
|
+
const e = Ur(n);
|
|
1706
|
+
return e !== n && (Re.set(n, e), Ge.set(e, n)), e;
|
|
1707
|
+
}
|
|
1708
|
+
const Ce = (n) => Ge.get(n);
|
|
1709
|
+
function xr(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
|
1710
|
+
const a = indexedDB.open(n, e), c = D(a);
|
|
1701
1711
|
return r && a.addEventListener("upgradeneeded", (o) => {
|
|
1702
|
-
r(
|
|
1712
|
+
r(D(a.result), o.oldVersion, o.newVersion, D(a.transaction), o);
|
|
1703
1713
|
}), t && a.addEventListener("blocked", (o) => t(
|
|
1704
1714
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
1705
1715
|
o.oldVersion,
|
|
1706
1716
|
o.newVersion,
|
|
1707
1717
|
o
|
|
1708
1718
|
)), c.then((o) => {
|
|
1709
|
-
s && o.addEventListener("close", () => s()), i && o.addEventListener("versionchange", (
|
|
1719
|
+
s && o.addEventListener("close", () => s()), i && o.addEventListener("versionchange", (u) => i(u.oldVersion, u.newVersion, u));
|
|
1710
1720
|
}).catch(() => {
|
|
1711
1721
|
}), c;
|
|
1712
1722
|
}
|
|
1713
|
-
const
|
|
1723
|
+
const Fr = ["get", "getKey", "getAll", "getAllKeys", "count"], Br = ["put", "add", "delete", "clear"], Pe = /* @__PURE__ */ new Map();
|
|
1714
1724
|
function ut(n, e) {
|
|
1715
1725
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
|
1716
1726
|
return;
|
|
1717
|
-
if (
|
|
1718
|
-
return
|
|
1719
|
-
const t = e.replace(/FromIndex$/, ""), r = e !== t, i =
|
|
1727
|
+
if (Pe.get(e))
|
|
1728
|
+
return Pe.get(e);
|
|
1729
|
+
const t = e.replace(/FromIndex$/, ""), r = e !== t, i = Br.includes(t);
|
|
1720
1730
|
if (
|
|
1721
1731
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
|
1722
|
-
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i ||
|
|
1732
|
+
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i || Fr.includes(t))
|
|
1723
1733
|
)
|
|
1724
1734
|
return;
|
|
1725
1735
|
const s = async function(a, ...c) {
|
|
1726
1736
|
const o = this.transaction(a, i ? "readwrite" : "readonly");
|
|
1727
|
-
let
|
|
1728
|
-
return r && (
|
|
1729
|
-
|
|
1737
|
+
let u = o.store;
|
|
1738
|
+
return r && (u = u.index(c.shift())), (await Promise.all([
|
|
1739
|
+
u[t](...c),
|
|
1730
1740
|
i && o.done
|
|
1731
1741
|
]))[0];
|
|
1732
1742
|
};
|
|
1733
|
-
return
|
|
1743
|
+
return Pe.set(e, s), s;
|
|
1734
1744
|
}
|
|
1735
|
-
|
|
1745
|
+
Lr((n) => ({
|
|
1736
1746
|
...n,
|
|
1737
1747
|
get: (e, t, r) => ut(e, t) || n.get(e, t, r),
|
|
1738
1748
|
has: (e, t) => !!ut(e, t) || n.has(e, t)
|
|
@@ -1753,7 +1763,7 @@ Dr((n) => ({
|
|
|
1753
1763
|
* See the License for the specific language governing permissions and
|
|
1754
1764
|
* limitations under the License.
|
|
1755
1765
|
*/
|
|
1756
|
-
class
|
|
1766
|
+
class $r {
|
|
1757
1767
|
constructor(e) {
|
|
1758
1768
|
this.container = e;
|
|
1759
1769
|
}
|
|
@@ -1761,7 +1771,7 @@ class Fr {
|
|
|
1761
1771
|
// auth token refresh, and installations will send this string.
|
|
1762
1772
|
getPlatformInfoString() {
|
|
1763
1773
|
return this.container.getProviders().map((t) => {
|
|
1764
|
-
if (
|
|
1774
|
+
if (Hr(t)) {
|
|
1765
1775
|
const r = t.getImmediate();
|
|
1766
1776
|
return `${r.library}/${r.version}`;
|
|
1767
1777
|
} else
|
|
@@ -1769,11 +1779,11 @@ class Fr {
|
|
|
1769
1779
|
}).filter((t) => t).join(" ");
|
|
1770
1780
|
}
|
|
1771
1781
|
}
|
|
1772
|
-
function
|
|
1782
|
+
function Hr(n) {
|
|
1773
1783
|
const e = n.getComponent();
|
|
1774
1784
|
return (e == null ? void 0 : e.type) === "VERSION";
|
|
1775
1785
|
}
|
|
1776
|
-
const
|
|
1786
|
+
const Fe = "@firebase/app", dt = "0.10.13";
|
|
1777
1787
|
/**
|
|
1778
1788
|
* @license
|
|
1779
1789
|
* Copyright 2019 Google LLC
|
|
@@ -1790,7 +1800,7 @@ const xe = "@firebase/app", dt = "0.10.13";
|
|
|
1790
1800
|
* See the License for the specific language governing permissions and
|
|
1791
1801
|
* limitations under the License.
|
|
1792
1802
|
*/
|
|
1793
|
-
const
|
|
1803
|
+
const T = new zt("@firebase/app"), Vr = "@firebase/app-compat", jr = "@firebase/analytics-compat", Wr = "@firebase/analytics", zr = "@firebase/app-check-compat", Gr = "@firebase/app-check", qr = "@firebase/auth", Kr = "@firebase/auth-compat", Jr = "@firebase/database", Yr = "@firebase/data-connect", Xr = "@firebase/database-compat", Qr = "@firebase/functions", Zr = "@firebase/functions-compat", ei = "@firebase/installations", ti = "@firebase/installations-compat", ni = "@firebase/messaging", ri = "@firebase/messaging-compat", ii = "@firebase/performance", si = "@firebase/performance-compat", ai = "@firebase/remote-config", oi = "@firebase/remote-config-compat", ci = "@firebase/storage", li = "@firebase/storage-compat", ui = "@firebase/firestore", di = "@firebase/vertexai-preview", hi = "@firebase/firestore-compat", fi = "firebase", pi = "10.14.1";
|
|
1794
1804
|
/**
|
|
1795
1805
|
* @license
|
|
1796
1806
|
* Copyright 2019 Google LLC
|
|
@@ -1807,35 +1817,35 @@ const E = new zt("@firebase/app"), $r = "@firebase/app-compat", Hr = "@firebase/
|
|
|
1807
1817
|
* See the License for the specific language governing permissions and
|
|
1808
1818
|
* limitations under the License.
|
|
1809
1819
|
*/
|
|
1810
|
-
const
|
|
1811
|
-
[
|
|
1812
|
-
[
|
|
1813
|
-
[
|
|
1814
|
-
[
|
|
1815
|
-
[
|
|
1816
|
-
[
|
|
1817
|
-
[
|
|
1818
|
-
[
|
|
1819
|
-
[
|
|
1820
|
-
[
|
|
1821
|
-
[
|
|
1822
|
-
[
|
|
1823
|
-
[
|
|
1824
|
-
[
|
|
1825
|
-
[
|
|
1826
|
-
[
|
|
1827
|
-
[
|
|
1828
|
-
[
|
|
1829
|
-
[
|
|
1830
|
-
[
|
|
1831
|
-
[
|
|
1832
|
-
[
|
|
1833
|
-
[
|
|
1834
|
-
[
|
|
1835
|
-
[
|
|
1836
|
-
[
|
|
1820
|
+
const Be = "[DEFAULT]", mi = {
|
|
1821
|
+
[Fe]: "fire-core",
|
|
1822
|
+
[Vr]: "fire-core-compat",
|
|
1823
|
+
[Wr]: "fire-analytics",
|
|
1824
|
+
[jr]: "fire-analytics-compat",
|
|
1825
|
+
[Gr]: "fire-app-check",
|
|
1826
|
+
[zr]: "fire-app-check-compat",
|
|
1827
|
+
[qr]: "fire-auth",
|
|
1828
|
+
[Kr]: "fire-auth-compat",
|
|
1829
|
+
[Jr]: "fire-rtdb",
|
|
1830
|
+
[Yr]: "fire-data-connect",
|
|
1831
|
+
[Xr]: "fire-rtdb-compat",
|
|
1832
|
+
[Qr]: "fire-fn",
|
|
1833
|
+
[Zr]: "fire-fn-compat",
|
|
1834
|
+
[ei]: "fire-iid",
|
|
1835
|
+
[ti]: "fire-iid-compat",
|
|
1836
|
+
[ni]: "fire-fcm",
|
|
1837
|
+
[ri]: "fire-fcm-compat",
|
|
1838
|
+
[ii]: "fire-perf",
|
|
1839
|
+
[si]: "fire-perf-compat",
|
|
1840
|
+
[ai]: "fire-rc",
|
|
1841
|
+
[oi]: "fire-rc-compat",
|
|
1842
|
+
[ci]: "fire-gcs",
|
|
1843
|
+
[li]: "fire-gcs-compat",
|
|
1844
|
+
[ui]: "fire-fst",
|
|
1845
|
+
[hi]: "fire-fst-compat",
|
|
1846
|
+
[di]: "fire-vertex",
|
|
1837
1847
|
"fire-js": "fire-js",
|
|
1838
|
-
[
|
|
1848
|
+
[fi]: "fire-js-all"
|
|
1839
1849
|
};
|
|
1840
1850
|
/**
|
|
1841
1851
|
* @license
|
|
@@ -1853,22 +1863,22 @@ const Fe = "[DEFAULT]", fi = {
|
|
|
1853
1863
|
* See the License for the specific language governing permissions and
|
|
1854
1864
|
* limitations under the License.
|
|
1855
1865
|
*/
|
|
1856
|
-
const
|
|
1866
|
+
const fe = /* @__PURE__ */ new Map(), gi = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Map();
|
|
1857
1867
|
function ht(n, e) {
|
|
1858
1868
|
try {
|
|
1859
1869
|
n.container.addComponent(e);
|
|
1860
1870
|
} catch (t) {
|
|
1861
|
-
|
|
1871
|
+
T.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`, t);
|
|
1862
1872
|
}
|
|
1863
1873
|
}
|
|
1864
1874
|
function J(n) {
|
|
1865
1875
|
const e = n.name;
|
|
1866
|
-
if (
|
|
1867
|
-
return
|
|
1868
|
-
|
|
1869
|
-
for (const t of
|
|
1876
|
+
if ($e.has(e))
|
|
1877
|
+
return T.debug(`There were multiple attempts to register component ${e}.`), !1;
|
|
1878
|
+
$e.set(e, n);
|
|
1879
|
+
for (const t of fe.values())
|
|
1870
1880
|
ht(t, n);
|
|
1871
|
-
for (const t of
|
|
1881
|
+
for (const t of gi.values())
|
|
1872
1882
|
ht(t, n);
|
|
1873
1883
|
return !0;
|
|
1874
1884
|
}
|
|
@@ -1876,7 +1886,7 @@ function Kt(n, e) {
|
|
|
1876
1886
|
const t = n.container.getProvider("heartbeat").getImmediate({ optional: !0 });
|
|
1877
1887
|
return t && t.triggerHeartbeat(), n.container.getProvider(e);
|
|
1878
1888
|
}
|
|
1879
|
-
function
|
|
1889
|
+
function b(n) {
|
|
1880
1890
|
return n.settings !== void 0;
|
|
1881
1891
|
}
|
|
1882
1892
|
/**
|
|
@@ -1895,7 +1905,7 @@ function v(n) {
|
|
|
1895
1905
|
* See the License for the specific language governing permissions and
|
|
1896
1906
|
* limitations under the License.
|
|
1897
1907
|
*/
|
|
1898
|
-
const
|
|
1908
|
+
const _i = {
|
|
1899
1909
|
"no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
|
|
1900
1910
|
"bad-app-name": "Illegal App name: '{$appName}'",
|
|
1901
1911
|
"duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
|
|
@@ -1910,7 +1920,7 @@ const mi = {
|
|
|
1910
1920
|
"idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",
|
|
1911
1921
|
"finalization-registry-not-supported": "FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.",
|
|
1912
1922
|
"invalid-server-app-environment": "FirebaseServerApp is not for use in browser environments."
|
|
1913
|
-
},
|
|
1923
|
+
}, N = new Q("app", "Firebase", _i);
|
|
1914
1924
|
/**
|
|
1915
1925
|
* @license
|
|
1916
1926
|
* Copyright 2019 Google LLC
|
|
@@ -1927,7 +1937,7 @@ const mi = {
|
|
|
1927
1937
|
* See the License for the specific language governing permissions and
|
|
1928
1938
|
* limitations under the License.
|
|
1929
1939
|
*/
|
|
1930
|
-
class
|
|
1940
|
+
class yi {
|
|
1931
1941
|
constructor(e, t, r) {
|
|
1932
1942
|
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(
|
|
1933
1943
|
"app",
|
|
@@ -1966,7 +1976,7 @@ class gi {
|
|
|
1966
1976
|
*/
|
|
1967
1977
|
checkDestroyed() {
|
|
1968
1978
|
if (this.isDeleted)
|
|
1969
|
-
throw
|
|
1979
|
+
throw N.create("app-deleted", { appName: this._name });
|
|
1970
1980
|
}
|
|
1971
1981
|
}
|
|
1972
1982
|
/**
|
|
@@ -1985,50 +1995,50 @@ class gi {
|
|
|
1985
1995
|
* See the License for the specific language governing permissions and
|
|
1986
1996
|
* limitations under the License.
|
|
1987
1997
|
*/
|
|
1988
|
-
const ee =
|
|
1998
|
+
const ee = pi;
|
|
1989
1999
|
function Jt(n, e = {}) {
|
|
1990
2000
|
let t = n;
|
|
1991
2001
|
typeof e != "object" && (e = { name: e });
|
|
1992
|
-
const r = Object.assign({ name:
|
|
2002
|
+
const r = Object.assign({ name: Be, automaticDataCollectionEnabled: !1 }, e), i = r.name;
|
|
1993
2003
|
if (typeof i != "string" || !i)
|
|
1994
|
-
throw
|
|
2004
|
+
throw N.create("bad-app-name", {
|
|
1995
2005
|
appName: String(i)
|
|
1996
2006
|
});
|
|
1997
2007
|
if (t || (t = jt()), !t)
|
|
1998
|
-
throw
|
|
2008
|
+
throw N.create(
|
|
1999
2009
|
"no-options"
|
|
2000
2010
|
/* AppError.NO_OPTIONS */
|
|
2001
2011
|
);
|
|
2002
|
-
const s =
|
|
2012
|
+
const s = fe.get(i);
|
|
2003
2013
|
if (s) {
|
|
2004
|
-
if (
|
|
2014
|
+
if (he(t, s.options) && he(r, s.config))
|
|
2005
2015
|
return s;
|
|
2006
|
-
throw
|
|
2016
|
+
throw N.create("duplicate-app", { appName: i });
|
|
2007
2017
|
}
|
|
2008
|
-
const a = new
|
|
2009
|
-
for (const o of
|
|
2018
|
+
const a = new Tr(i);
|
|
2019
|
+
for (const o of $e.values())
|
|
2010
2020
|
a.addComponent(o);
|
|
2011
|
-
const c = new
|
|
2012
|
-
return
|
|
2021
|
+
const c = new yi(t, r, a);
|
|
2022
|
+
return fe.set(i, c), c;
|
|
2013
2023
|
}
|
|
2014
|
-
function
|
|
2015
|
-
const e =
|
|
2016
|
-
if (!e && n ===
|
|
2024
|
+
function vi(n = Be) {
|
|
2025
|
+
const e = fe.get(n);
|
|
2026
|
+
if (!e && n === Be && jt())
|
|
2017
2027
|
return Jt();
|
|
2018
2028
|
if (!e)
|
|
2019
|
-
throw
|
|
2029
|
+
throw N.create("no-app", { appName: n });
|
|
2020
2030
|
return e;
|
|
2021
2031
|
}
|
|
2022
2032
|
function $(n, e, t) {
|
|
2023
2033
|
var r;
|
|
2024
|
-
let i = (r =
|
|
2034
|
+
let i = (r = mi[n]) !== null && r !== void 0 ? r : n;
|
|
2025
2035
|
t && (i += `-${t}`);
|
|
2026
2036
|
const s = i.match(/\s|\//), a = e.match(/\s|\//);
|
|
2027
2037
|
if (s || a) {
|
|
2028
2038
|
const c = [
|
|
2029
2039
|
`Unable to register library "${i}" with version "${e}":`
|
|
2030
2040
|
];
|
|
2031
|
-
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 "/")`),
|
|
2041
|
+
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 "/")`), T.warn(c.join(" "));
|
|
2032
2042
|
return;
|
|
2033
2043
|
}
|
|
2034
2044
|
J(new W(
|
|
@@ -2054,10 +2064,10 @@ function $(n, e, t) {
|
|
|
2054
2064
|
* See the License for the specific language governing permissions and
|
|
2055
2065
|
* limitations under the License.
|
|
2056
2066
|
*/
|
|
2057
|
-
const
|
|
2058
|
-
let
|
|
2067
|
+
const bi = "firebase-heartbeat-database", Ii = 1, Y = "firebase-heartbeat-store";
|
|
2068
|
+
let Oe = null;
|
|
2059
2069
|
function Yt() {
|
|
2060
|
-
return
|
|
2070
|
+
return Oe || (Oe = xr(bi, Ii, {
|
|
2061
2071
|
upgrade: (n, e) => {
|
|
2062
2072
|
switch (e) {
|
|
2063
2073
|
case 0:
|
|
@@ -2069,23 +2079,23 @@ function Yt() {
|
|
|
2069
2079
|
}
|
|
2070
2080
|
}
|
|
2071
2081
|
}).catch((n) => {
|
|
2072
|
-
throw
|
|
2082
|
+
throw N.create("idb-open", {
|
|
2073
2083
|
originalErrorMessage: n.message
|
|
2074
2084
|
});
|
|
2075
|
-
})),
|
|
2085
|
+
})), Oe;
|
|
2076
2086
|
}
|
|
2077
|
-
async function
|
|
2087
|
+
async function wi(n) {
|
|
2078
2088
|
try {
|
|
2079
2089
|
const t = (await Yt()).transaction(Y), r = await t.objectStore(Y).get(Xt(n));
|
|
2080
2090
|
return await t.done, r;
|
|
2081
2091
|
} catch (e) {
|
|
2082
|
-
if (e instanceof
|
|
2083
|
-
|
|
2092
|
+
if (e instanceof M)
|
|
2093
|
+
T.warn(e.message);
|
|
2084
2094
|
else {
|
|
2085
|
-
const t =
|
|
2095
|
+
const t = N.create("idb-get", {
|
|
2086
2096
|
originalErrorMessage: e == null ? void 0 : e.message
|
|
2087
2097
|
});
|
|
2088
|
-
|
|
2098
|
+
T.warn(t.message);
|
|
2089
2099
|
}
|
|
2090
2100
|
}
|
|
2091
2101
|
}
|
|
@@ -2094,13 +2104,13 @@ async function ft(n, e) {
|
|
|
2094
2104
|
const r = (await Yt()).transaction(Y, "readwrite");
|
|
2095
2105
|
await r.objectStore(Y).put(e, Xt(n)), await r.done;
|
|
2096
2106
|
} catch (t) {
|
|
2097
|
-
if (t instanceof
|
|
2098
|
-
|
|
2107
|
+
if (t instanceof M)
|
|
2108
|
+
T.warn(t.message);
|
|
2099
2109
|
else {
|
|
2100
|
-
const r =
|
|
2110
|
+
const r = N.create("idb-set", {
|
|
2101
2111
|
originalErrorMessage: t == null ? void 0 : t.message
|
|
2102
2112
|
});
|
|
2103
|
-
|
|
2113
|
+
T.warn(r.message);
|
|
2104
2114
|
}
|
|
2105
2115
|
}
|
|
2106
2116
|
}
|
|
@@ -2123,12 +2133,12 @@ function Xt(n) {
|
|
|
2123
2133
|
* See the License for the specific language governing permissions and
|
|
2124
2134
|
* limitations under the License.
|
|
2125
2135
|
*/
|
|
2126
|
-
const
|
|
2127
|
-
class
|
|
2136
|
+
const Ei = 1024, Ti = 30 * 24 * 60 * 60 * 1e3;
|
|
2137
|
+
class Si {
|
|
2128
2138
|
constructor(e) {
|
|
2129
2139
|
this.container = e, this._heartbeatsCache = null;
|
|
2130
2140
|
const t = this.container.getProvider("app").getImmediate();
|
|
2131
|
-
this._storage = new
|
|
2141
|
+
this._storage = new Ai(t), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
|
|
2132
2142
|
}
|
|
2133
2143
|
/**
|
|
2134
2144
|
* Called to report a heartbeat. The function will generate
|
|
@@ -2143,10 +2153,10 @@ class Ei {
|
|
|
2143
2153
|
const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s = pt();
|
|
2144
2154
|
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) => {
|
|
2145
2155
|
const c = new Date(a.date).valueOf();
|
|
2146
|
-
return Date.now() - c <=
|
|
2156
|
+
return Date.now() - c <= Ti;
|
|
2147
2157
|
}), this._storage.overwrite(this._heartbeatsCache));
|
|
2148
2158
|
} catch (r) {
|
|
2149
|
-
|
|
2159
|
+
T.warn(r);
|
|
2150
2160
|
}
|
|
2151
2161
|
}
|
|
2152
2162
|
/**
|
|
@@ -2161,17 +2171,17 @@ class Ei {
|
|
|
2161
2171
|
try {
|
|
2162
2172
|
if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
|
|
2163
2173
|
return "";
|
|
2164
|
-
const t = pt(), { heartbeatsToSend: r, unsentEntries: i } =
|
|
2174
|
+
const t = pt(), { heartbeatsToSend: r, unsentEntries: i } = ki(this._heartbeatsCache.heartbeats), s = de(JSON.stringify({ version: 2, heartbeats: r }));
|
|
2165
2175
|
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;
|
|
2166
2176
|
} catch (t) {
|
|
2167
|
-
return
|
|
2177
|
+
return T.warn(t), "";
|
|
2168
2178
|
}
|
|
2169
2179
|
}
|
|
2170
2180
|
}
|
|
2171
2181
|
function pt() {
|
|
2172
2182
|
return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
|
2173
2183
|
}
|
|
2174
|
-
function
|
|
2184
|
+
function ki(n, e = Ei) {
|
|
2175
2185
|
const t = [];
|
|
2176
2186
|
let r = n.slice();
|
|
2177
2187
|
for (const i of n) {
|
|
@@ -2195,19 +2205,19 @@ function Ti(n, e = Ii) {
|
|
|
2195
2205
|
unsentEntries: r
|
|
2196
2206
|
};
|
|
2197
2207
|
}
|
|
2198
|
-
class
|
|
2208
|
+
class Ai {
|
|
2199
2209
|
constructor(e) {
|
|
2200
2210
|
this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
|
2201
2211
|
}
|
|
2202
2212
|
async runIndexedDBEnvironmentCheck() {
|
|
2203
|
-
return
|
|
2213
|
+
return hr() ? fr().then(() => !0).catch(() => !1) : !1;
|
|
2204
2214
|
}
|
|
2205
2215
|
/**
|
|
2206
2216
|
* Read all heartbeats.
|
|
2207
2217
|
*/
|
|
2208
2218
|
async read() {
|
|
2209
2219
|
if (await this._canUseIndexedDBPromise) {
|
|
2210
|
-
const t = await
|
|
2220
|
+
const t = await wi(this.app);
|
|
2211
2221
|
return t != null && t.heartbeats ? t : { heartbeats: [] };
|
|
2212
2222
|
} else
|
|
2213
2223
|
return { heartbeats: [] };
|
|
@@ -2241,7 +2251,7 @@ class Si {
|
|
|
2241
2251
|
}
|
|
2242
2252
|
}
|
|
2243
2253
|
function mt(n) {
|
|
2244
|
-
return
|
|
2254
|
+
return de(
|
|
2245
2255
|
// heartbeatsCache wrapper properties
|
|
2246
2256
|
JSON.stringify({ version: 2, heartbeats: n })
|
|
2247
2257
|
).length;
|
|
@@ -2262,21 +2272,21 @@ function mt(n) {
|
|
|
2262
2272
|
* See the License for the specific language governing permissions and
|
|
2263
2273
|
* limitations under the License.
|
|
2264
2274
|
*/
|
|
2265
|
-
function
|
|
2275
|
+
function Ri(n) {
|
|
2266
2276
|
J(new W(
|
|
2267
2277
|
"platform-logger",
|
|
2268
|
-
(e) => new
|
|
2278
|
+
(e) => new $r(e),
|
|
2269
2279
|
"PRIVATE"
|
|
2270
2280
|
/* ComponentType.PRIVATE */
|
|
2271
2281
|
)), J(new W(
|
|
2272
2282
|
"heartbeat",
|
|
2273
|
-
(e) => new
|
|
2283
|
+
(e) => new Si(e),
|
|
2274
2284
|
"PRIVATE"
|
|
2275
2285
|
/* ComponentType.PRIVATE */
|
|
2276
|
-
)), $(
|
|
2286
|
+
)), $(Fe, dt, n), $(Fe, dt, "esm2017"), $("fire-js", "");
|
|
2277
2287
|
}
|
|
2278
|
-
|
|
2279
|
-
var
|
|
2288
|
+
Ri("");
|
|
2289
|
+
var Ci = "firebase", Pi = "10.14.1";
|
|
2280
2290
|
/**
|
|
2281
2291
|
* @license
|
|
2282
2292
|
* Copyright 2020 Google LLC
|
|
@@ -2293,7 +2303,7 @@ var Ai = "firebase", Ri = "10.14.1";
|
|
|
2293
2303
|
* See the License for the specific language governing permissions and
|
|
2294
2304
|
* limitations under the License.
|
|
2295
2305
|
*/
|
|
2296
|
-
$(
|
|
2306
|
+
$(Ci, Pi, "app");
|
|
2297
2307
|
var gt = function() {
|
|
2298
2308
|
return gt = Object.assign || function(e) {
|
|
2299
2309
|
for (var t, r = 1, i = arguments.length; r < i; r++) {
|
|
@@ -2316,7 +2326,7 @@ function Qt() {
|
|
|
2316
2326
|
"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."
|
|
2317
2327
|
};
|
|
2318
2328
|
}
|
|
2319
|
-
const
|
|
2329
|
+
const Oi = Qt, Zt = new Q("auth", "Firebase", Qt());
|
|
2320
2330
|
/**
|
|
2321
2331
|
* @license
|
|
2322
2332
|
* Copyright 2020 Google LLC
|
|
@@ -2333,12 +2343,12 @@ const Ci = Qt, Zt = new Q("auth", "Firebase", Qt());
|
|
|
2333
2343
|
* See the License for the specific language governing permissions and
|
|
2334
2344
|
* limitations under the License.
|
|
2335
2345
|
*/
|
|
2336
|
-
const
|
|
2337
|
-
function
|
|
2338
|
-
|
|
2346
|
+
const pe = new zt("@firebase/auth");
|
|
2347
|
+
function Di(n, ...e) {
|
|
2348
|
+
pe.logLevel <= p.WARN && pe.warn(`Auth (${ee}): ${n}`, ...e);
|
|
2339
2349
|
}
|
|
2340
2350
|
function se(n, ...e) {
|
|
2341
|
-
|
|
2351
|
+
pe.logLevel <= p.ERROR && pe.error(`Auth (${ee}): ${n}`, ...e);
|
|
2342
2352
|
}
|
|
2343
2353
|
/**
|
|
2344
2354
|
* @license
|
|
@@ -2356,19 +2366,19 @@ function se(n, ...e) {
|
|
|
2356
2366
|
* See the License for the specific language governing permissions and
|
|
2357
2367
|
* limitations under the License.
|
|
2358
2368
|
*/
|
|
2359
|
-
function
|
|
2369
|
+
function S(n, ...e) {
|
|
2360
2370
|
throw Ke(n, ...e);
|
|
2361
2371
|
}
|
|
2362
2372
|
function _(n, ...e) {
|
|
2363
2373
|
return Ke(n, ...e);
|
|
2364
2374
|
}
|
|
2365
2375
|
function en(n, e, t) {
|
|
2366
|
-
const r = Object.assign(Object.assign({},
|
|
2376
|
+
const r = Object.assign(Object.assign({}, Oi()), { [e]: t });
|
|
2367
2377
|
return new Q("auth", "Firebase", r).create(e, {
|
|
2368
2378
|
appName: n.name
|
|
2369
2379
|
});
|
|
2370
2380
|
}
|
|
2371
|
-
function
|
|
2381
|
+
function L(n) {
|
|
2372
2382
|
return en(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
2373
2383
|
}
|
|
2374
2384
|
function Ke(n, ...e) {
|
|
@@ -2378,16 +2388,16 @@ function Ke(n, ...e) {
|
|
|
2378
2388
|
}
|
|
2379
2389
|
return Zt.create(n, ...e);
|
|
2380
2390
|
}
|
|
2381
|
-
function
|
|
2391
|
+
function h(n, e, ...t) {
|
|
2382
2392
|
if (!n)
|
|
2383
2393
|
throw Ke(e, ...t);
|
|
2384
2394
|
}
|
|
2385
|
-
function
|
|
2395
|
+
function I(n) {
|
|
2386
2396
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
2387
2397
|
throw se(e), new Error(e);
|
|
2388
2398
|
}
|
|
2389
|
-
function
|
|
2390
|
-
n ||
|
|
2399
|
+
function k(n, e) {
|
|
2400
|
+
n || I(e);
|
|
2391
2401
|
}
|
|
2392
2402
|
/**
|
|
2393
2403
|
* @license
|
|
@@ -2405,11 +2415,11 @@ function S(n, e) {
|
|
|
2405
2415
|
* See the License for the specific language governing permissions and
|
|
2406
2416
|
* limitations under the License.
|
|
2407
2417
|
*/
|
|
2408
|
-
function
|
|
2418
|
+
function He() {
|
|
2409
2419
|
var n;
|
|
2410
2420
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
2411
2421
|
}
|
|
2412
|
-
function
|
|
2422
|
+
function Ni() {
|
|
2413
2423
|
return _t() === "http:" || _t() === "https:";
|
|
2414
2424
|
}
|
|
2415
2425
|
function _t() {
|
|
@@ -2432,15 +2442,15 @@ function _t() {
|
|
|
2432
2442
|
* See the License for the specific language governing permissions and
|
|
2433
2443
|
* limitations under the License.
|
|
2434
2444
|
*/
|
|
2435
|
-
function
|
|
2445
|
+
function Li() {
|
|
2436
2446
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
2437
2447
|
// This is especially true for Cordova apps which have unreliable
|
|
2438
2448
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
2439
2449
|
// installed which overwrites the native navigator.onLine value and
|
|
2440
2450
|
// defines navigator.connection.
|
|
2441
|
-
(
|
|
2451
|
+
(Ni() || lr() || "connection" in navigator) ? navigator.onLine : !0;
|
|
2442
2452
|
}
|
|
2443
|
-
function
|
|
2453
|
+
function Mi() {
|
|
2444
2454
|
if (typeof navigator > "u")
|
|
2445
2455
|
return null;
|
|
2446
2456
|
const n = navigator;
|
|
@@ -2470,10 +2480,10 @@ function Ni() {
|
|
|
2470
2480
|
*/
|
|
2471
2481
|
class te {
|
|
2472
2482
|
constructor(e, t) {
|
|
2473
|
-
this.shortDelay = e, this.longDelay = t,
|
|
2483
|
+
this.shortDelay = e, this.longDelay = t, k(t > e, "Short delay should be less than long delay!"), this.isMobile = or() || ur();
|
|
2474
2484
|
}
|
|
2475
2485
|
get() {
|
|
2476
|
-
return
|
|
2486
|
+
return Li() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
2477
2487
|
}
|
|
2478
2488
|
}
|
|
2479
2489
|
/**
|
|
@@ -2493,7 +2503,7 @@ class te {
|
|
|
2493
2503
|
* limitations under the License.
|
|
2494
2504
|
*/
|
|
2495
2505
|
function Je(n, e) {
|
|
2496
|
-
|
|
2506
|
+
k(n.emulator, "Emulator should always be set here");
|
|
2497
2507
|
const { url: t } = n.emulator;
|
|
2498
2508
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
2499
2509
|
}
|
|
@@ -2526,7 +2536,7 @@ class tn {
|
|
|
2526
2536
|
return globalThis.fetch;
|
|
2527
2537
|
if (typeof fetch < "u")
|
|
2528
2538
|
return fetch;
|
|
2529
|
-
|
|
2539
|
+
I("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2530
2540
|
}
|
|
2531
2541
|
static headers() {
|
|
2532
2542
|
if (this.headersImpl)
|
|
@@ -2537,7 +2547,7 @@ class tn {
|
|
|
2537
2547
|
return globalThis.Headers;
|
|
2538
2548
|
if (typeof Headers < "u")
|
|
2539
2549
|
return Headers;
|
|
2540
|
-
|
|
2550
|
+
I("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2541
2551
|
}
|
|
2542
2552
|
static response() {
|
|
2543
2553
|
if (this.responseImpl)
|
|
@@ -2548,7 +2558,7 @@ class tn {
|
|
|
2548
2558
|
return globalThis.Response;
|
|
2549
2559
|
if (typeof Response < "u")
|
|
2550
2560
|
return Response;
|
|
2551
|
-
|
|
2561
|
+
I("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2552
2562
|
}
|
|
2553
2563
|
}
|
|
2554
2564
|
/**
|
|
@@ -2567,7 +2577,7 @@ class tn {
|
|
|
2567
2577
|
* See the License for the specific language governing permissions and
|
|
2568
2578
|
* limitations under the License.
|
|
2569
2579
|
*/
|
|
2570
|
-
const
|
|
2580
|
+
const Ui = {
|
|
2571
2581
|
// Custom token errors.
|
|
2572
2582
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
2573
2583
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -2658,8 +2668,8 @@ const Li = {
|
|
|
2658
2668
|
* See the License for the specific language governing permissions and
|
|
2659
2669
|
* limitations under the License.
|
|
2660
2670
|
*/
|
|
2661
|
-
const
|
|
2662
|
-
function
|
|
2671
|
+
const xi = new te(3e4, 6e4);
|
|
2672
|
+
function ve(n, e) {
|
|
2663
2673
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
2664
2674
|
}
|
|
2665
2675
|
async function G(n, e, t, r, i = {}) {
|
|
@@ -2676,18 +2686,18 @@ async function G(n, e, t, r, i = {}) {
|
|
|
2676
2686
|
"X-Firebase-Locale"
|
|
2677
2687
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
2678
2688
|
] = n.languageCode);
|
|
2679
|
-
const
|
|
2689
|
+
const u = Object.assign({
|
|
2680
2690
|
method: e,
|
|
2681
2691
|
headers: o
|
|
2682
2692
|
}, s);
|
|
2683
|
-
return
|
|
2693
|
+
return cr() || (u.referrerPolicy = "no-referrer"), tn.fetch()(sn(n, n.config.apiHost, t, c), u);
|
|
2684
2694
|
});
|
|
2685
2695
|
}
|
|
2686
2696
|
async function nn(n, e, t) {
|
|
2687
2697
|
n._canInitEmulator = !1;
|
|
2688
|
-
const r = Object.assign(Object.assign({},
|
|
2698
|
+
const r = Object.assign(Object.assign({}, Ui), e);
|
|
2689
2699
|
try {
|
|
2690
|
-
const i = new
|
|
2700
|
+
const i = new Fi(n), s = await Promise.race([
|
|
2691
2701
|
t(),
|
|
2692
2702
|
i.promise
|
|
2693
2703
|
]);
|
|
@@ -2698,27 +2708,27 @@ async function nn(n, e, t) {
|
|
|
2698
2708
|
if (s.ok && !("errorMessage" in a))
|
|
2699
2709
|
return a;
|
|
2700
2710
|
{
|
|
2701
|
-
const c = s.ok ? a.errorMessage : a.error.message, [o,
|
|
2711
|
+
const c = s.ok ? a.errorMessage : a.error.message, [o, u] = c.split(" : ");
|
|
2702
2712
|
if (o === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
2703
2713
|
throw ie(n, "credential-already-in-use", a);
|
|
2704
2714
|
if (o === "EMAIL_EXISTS")
|
|
2705
2715
|
throw ie(n, "email-already-in-use", a);
|
|
2706
2716
|
if (o === "USER_DISABLED")
|
|
2707
2717
|
throw ie(n, "user-disabled", a);
|
|
2708
|
-
const
|
|
2709
|
-
if (
|
|
2710
|
-
throw en(n,
|
|
2711
|
-
|
|
2718
|
+
const l = r[o] || o.toLowerCase().replace(/[_\s]+/g, "-");
|
|
2719
|
+
if (u)
|
|
2720
|
+
throw en(n, l, u);
|
|
2721
|
+
S(n, l);
|
|
2712
2722
|
}
|
|
2713
2723
|
} catch (i) {
|
|
2714
|
-
if (i instanceof
|
|
2724
|
+
if (i instanceof M)
|
|
2715
2725
|
throw i;
|
|
2716
|
-
|
|
2726
|
+
S(n, "network-request-failed", { message: String(i) });
|
|
2717
2727
|
}
|
|
2718
2728
|
}
|
|
2719
2729
|
async function rn(n, e, t, r, i = {}) {
|
|
2720
2730
|
const s = await G(n, e, t, r, i);
|
|
2721
|
-
return "mfaPendingCredential" in s &&
|
|
2731
|
+
return "mfaPendingCredential" in s && S(n, "multi-factor-auth-required", {
|
|
2722
2732
|
_serverResponse: s
|
|
2723
2733
|
}), s;
|
|
2724
2734
|
}
|
|
@@ -2726,14 +2736,14 @@ function sn(n, e, t, r) {
|
|
|
2726
2736
|
const i = `${e}${t}?${r}`;
|
|
2727
2737
|
return n.config.emulator ? Je(n.config, i) : `${n.config.apiScheme}://${i}`;
|
|
2728
2738
|
}
|
|
2729
|
-
class
|
|
2739
|
+
class Fi {
|
|
2730
2740
|
constructor(e) {
|
|
2731
2741
|
this.auth = e, this.timer = null, this.promise = new Promise((t, r) => {
|
|
2732
2742
|
this.timer = setTimeout(() => r(_(
|
|
2733
2743
|
this.auth,
|
|
2734
2744
|
"network-request-failed"
|
|
2735
2745
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
2736
|
-
)),
|
|
2746
|
+
)), xi.get());
|
|
2737
2747
|
});
|
|
2738
2748
|
}
|
|
2739
2749
|
clearNetworkTimeout() {
|
|
@@ -2764,7 +2774,7 @@ function ie(n, e, t) {
|
|
|
2764
2774
|
* See the License for the specific language governing permissions and
|
|
2765
2775
|
* limitations under the License.
|
|
2766
2776
|
*/
|
|
2767
|
-
async function
|
|
2777
|
+
async function Bi(n, e) {
|
|
2768
2778
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
2769
2779
|
}
|
|
2770
2780
|
async function an(n, e) {
|
|
@@ -2795,9 +2805,9 @@ function K(n) {
|
|
|
2795
2805
|
} catch {
|
|
2796
2806
|
}
|
|
2797
2807
|
}
|
|
2798
|
-
async function
|
|
2808
|
+
async function $i(n, e = !1) {
|
|
2799
2809
|
const t = z(n), r = await t.getIdToken(e), i = Ye(r);
|
|
2800
|
-
|
|
2810
|
+
h(
|
|
2801
2811
|
i && i.exp && i.auth_time && i.iat,
|
|
2802
2812
|
t.auth,
|
|
2803
2813
|
"internal-error"
|
|
@@ -2807,14 +2817,14 @@ async function Fi(n, e = !1) {
|
|
|
2807
2817
|
return {
|
|
2808
2818
|
claims: i,
|
|
2809
2819
|
token: r,
|
|
2810
|
-
authTime: K(
|
|
2811
|
-
issuedAtTime: K(
|
|
2812
|
-
expirationTime: K(
|
|
2820
|
+
authTime: K(De(i.auth_time)),
|
|
2821
|
+
issuedAtTime: K(De(i.iat)),
|
|
2822
|
+
expirationTime: K(De(i.exp)),
|
|
2813
2823
|
signInProvider: a || null,
|
|
2814
2824
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
2815
2825
|
};
|
|
2816
2826
|
}
|
|
2817
|
-
function
|
|
2827
|
+
function De(n) {
|
|
2818
2828
|
return Number(n) * 1e3;
|
|
2819
2829
|
}
|
|
2820
2830
|
function Ye(n) {
|
|
@@ -2830,15 +2840,15 @@ function Ye(n) {
|
|
|
2830
2840
|
}
|
|
2831
2841
|
function yt(n) {
|
|
2832
2842
|
const e = Ye(n);
|
|
2833
|
-
return
|
|
2843
|
+
return h(
|
|
2834
2844
|
e,
|
|
2835
2845
|
"internal-error"
|
|
2836
2846
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2837
|
-
),
|
|
2847
|
+
), h(
|
|
2838
2848
|
typeof e.exp < "u",
|
|
2839
2849
|
"internal-error"
|
|
2840
2850
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2841
|
-
),
|
|
2851
|
+
), h(
|
|
2842
2852
|
typeof e.iat < "u",
|
|
2843
2853
|
"internal-error"
|
|
2844
2854
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -2866,10 +2876,10 @@ async function X(n, e, t = !1) {
|
|
|
2866
2876
|
try {
|
|
2867
2877
|
return await e;
|
|
2868
2878
|
} catch (r) {
|
|
2869
|
-
throw r instanceof
|
|
2879
|
+
throw r instanceof M && Hi(r) && n.auth.currentUser === n && await n.auth.signOut(), r;
|
|
2870
2880
|
}
|
|
2871
2881
|
}
|
|
2872
|
-
function
|
|
2882
|
+
function Hi({ code: n }) {
|
|
2873
2883
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
2874
2884
|
}
|
|
2875
2885
|
/**
|
|
@@ -2888,7 +2898,7 @@ function Bi({ code: n }) {
|
|
|
2888
2898
|
* See the License for the specific language governing permissions and
|
|
2889
2899
|
* limitations under the License.
|
|
2890
2900
|
*/
|
|
2891
|
-
class
|
|
2901
|
+
class Vi {
|
|
2892
2902
|
constructor(e) {
|
|
2893
2903
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
2894
2904
|
}
|
|
@@ -2950,7 +2960,7 @@ class $i {
|
|
|
2950
2960
|
* See the License for the specific language governing permissions and
|
|
2951
2961
|
* limitations under the License.
|
|
2952
2962
|
*/
|
|
2953
|
-
class
|
|
2963
|
+
class Ve {
|
|
2954
2964
|
constructor(e, t) {
|
|
2955
2965
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
2956
2966
|
}
|
|
@@ -2983,10 +2993,10 @@ class He {
|
|
|
2983
2993
|
* See the License for the specific language governing permissions and
|
|
2984
2994
|
* limitations under the License.
|
|
2985
2995
|
*/
|
|
2986
|
-
async function
|
|
2996
|
+
async function me(n) {
|
|
2987
2997
|
var e;
|
|
2988
2998
|
const t = n.auth, r = await n.getIdToken(), i = await X(n, an(t, { idToken: r }));
|
|
2989
|
-
|
|
2999
|
+
h(
|
|
2990
3000
|
i == null ? void 0 : i.users.length,
|
|
2991
3001
|
t,
|
|
2992
3002
|
"internal-error"
|
|
@@ -2994,7 +3004,7 @@ async function pe(n) {
|
|
|
2994
3004
|
);
|
|
2995
3005
|
const s = i.users[0];
|
|
2996
3006
|
n._notifyReloadListener(s);
|
|
2997
|
-
const a = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? on(s.providerUserInfo) : [], c =
|
|
3007
|
+
const a = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? on(s.providerUserInfo) : [], c = Wi(n.providerData, a), o = n.isAnonymous, u = !(n.email && s.passwordHash) && !(c != null && c.length), l = o ? u : !1, d = {
|
|
2998
3008
|
uid: s.localId,
|
|
2999
3009
|
displayName: s.displayName || null,
|
|
3000
3010
|
photoURL: s.photoUrl || null,
|
|
@@ -3003,16 +3013,16 @@ async function pe(n) {
|
|
|
3003
3013
|
phoneNumber: s.phoneNumber || null,
|
|
3004
3014
|
tenantId: s.tenantId || null,
|
|
3005
3015
|
providerData: c,
|
|
3006
|
-
metadata: new
|
|
3007
|
-
isAnonymous:
|
|
3016
|
+
metadata: new Ve(s.createdAt, s.lastLoginAt),
|
|
3017
|
+
isAnonymous: l
|
|
3008
3018
|
};
|
|
3009
|
-
Object.assign(n,
|
|
3019
|
+
Object.assign(n, d);
|
|
3010
3020
|
}
|
|
3011
|
-
async function
|
|
3021
|
+
async function ji(n) {
|
|
3012
3022
|
const e = z(n);
|
|
3013
|
-
await
|
|
3023
|
+
await me(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
3014
3024
|
}
|
|
3015
|
-
function
|
|
3025
|
+
function Wi(n, e) {
|
|
3016
3026
|
return [...n.filter((r) => !e.some((i) => i.providerId === r.providerId)), ...e];
|
|
3017
3027
|
}
|
|
3018
3028
|
function on(n) {
|
|
@@ -3044,7 +3054,7 @@ function on(n) {
|
|
|
3044
3054
|
* See the License for the specific language governing permissions and
|
|
3045
3055
|
* limitations under the License.
|
|
3046
3056
|
*/
|
|
3047
|
-
async function
|
|
3057
|
+
async function zi(n, e) {
|
|
3048
3058
|
const t = await nn(n, {}, async () => {
|
|
3049
3059
|
const r = Z({
|
|
3050
3060
|
grant_type: "refresh_token",
|
|
@@ -3065,8 +3075,8 @@ async function ji(n, e) {
|
|
|
3065
3075
|
refreshToken: t.refresh_token
|
|
3066
3076
|
};
|
|
3067
3077
|
}
|
|
3068
|
-
async function
|
|
3069
|
-
return G(n, "POST", "/v2/accounts:revokeToken",
|
|
3078
|
+
async function Gi(n, e) {
|
|
3079
|
+
return G(n, "POST", "/v2/accounts:revokeToken", ve(n, e));
|
|
3070
3080
|
}
|
|
3071
3081
|
/**
|
|
3072
3082
|
* @license
|
|
@@ -3092,15 +3102,15 @@ class H {
|
|
|
3092
3102
|
return !this.expirationTime || Date.now() > this.expirationTime - 3e4;
|
|
3093
3103
|
}
|
|
3094
3104
|
updateFromServerResponse(e) {
|
|
3095
|
-
|
|
3105
|
+
h(
|
|
3096
3106
|
e.idToken,
|
|
3097
3107
|
"internal-error"
|
|
3098
3108
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3099
|
-
),
|
|
3109
|
+
), h(
|
|
3100
3110
|
typeof e.idToken < "u",
|
|
3101
3111
|
"internal-error"
|
|
3102
3112
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3103
|
-
),
|
|
3113
|
+
), h(
|
|
3104
3114
|
typeof e.refreshToken < "u",
|
|
3105
3115
|
"internal-error"
|
|
3106
3116
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3109,7 +3119,7 @@ class H {
|
|
|
3109
3119
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
|
3110
3120
|
}
|
|
3111
3121
|
updateFromIdToken(e) {
|
|
3112
|
-
|
|
3122
|
+
h(
|
|
3113
3123
|
e.length !== 0,
|
|
3114
3124
|
"internal-error"
|
|
3115
3125
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3118,7 +3128,7 @@ class H {
|
|
|
3118
3128
|
this.updateTokensAndExpiration(e, null, t);
|
|
3119
3129
|
}
|
|
3120
3130
|
async getToken(e, t = !1) {
|
|
3121
|
-
return !t && this.accessToken && !this.isExpired ? this.accessToken : (
|
|
3131
|
+
return !t && this.accessToken && !this.isExpired ? this.accessToken : (h(
|
|
3122
3132
|
this.refreshToken,
|
|
3123
3133
|
e,
|
|
3124
3134
|
"user-token-expired"
|
|
@@ -3129,7 +3139,7 @@ class H {
|
|
|
3129
3139
|
this.refreshToken = null;
|
|
3130
3140
|
}
|
|
3131
3141
|
async refresh(e, t) {
|
|
3132
|
-
const { accessToken: r, refreshToken: i, expiresIn: s } = await
|
|
3142
|
+
const { accessToken: r, refreshToken: i, expiresIn: s } = await zi(e, t);
|
|
3133
3143
|
this.updateTokensAndExpiration(r, i, Number(s));
|
|
3134
3144
|
}
|
|
3135
3145
|
updateTokensAndExpiration(e, t, r) {
|
|
@@ -3137,11 +3147,11 @@ class H {
|
|
|
3137
3147
|
}
|
|
3138
3148
|
static fromJSON(e, t) {
|
|
3139
3149
|
const { refreshToken: r, accessToken: i, expirationTime: s } = t, a = new H();
|
|
3140
|
-
return r && (
|
|
3150
|
+
return r && (h(typeof r == "string", "internal-error", {
|
|
3141
3151
|
appName: e
|
|
3142
|
-
}), a.refreshToken = r), i && (
|
|
3152
|
+
}), a.refreshToken = r), i && (h(typeof i == "string", "internal-error", {
|
|
3143
3153
|
appName: e
|
|
3144
|
-
}), a.accessToken = i), s && (
|
|
3154
|
+
}), a.accessToken = i), s && (h(typeof s == "number", "internal-error", {
|
|
3145
3155
|
appName: e
|
|
3146
3156
|
}), a.expirationTime = s), a;
|
|
3147
3157
|
}
|
|
@@ -3159,7 +3169,7 @@ class H {
|
|
|
3159
3169
|
return Object.assign(new H(), this.toJSON());
|
|
3160
3170
|
}
|
|
3161
3171
|
_performRefresh() {
|
|
3162
|
-
return
|
|
3172
|
+
return I("not implemented");
|
|
3163
3173
|
}
|
|
3164
3174
|
}
|
|
3165
3175
|
/**
|
|
@@ -3178,17 +3188,17 @@ class H {
|
|
|
3178
3188
|
* See the License for the specific language governing permissions and
|
|
3179
3189
|
* limitations under the License.
|
|
3180
3190
|
*/
|
|
3181
|
-
function
|
|
3182
|
-
|
|
3191
|
+
function A(n, e) {
|
|
3192
|
+
h(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
3183
3193
|
}
|
|
3184
|
-
class
|
|
3194
|
+
class w {
|
|
3185
3195
|
constructor(e) {
|
|
3186
3196
|
var { uid: t, auth: r, stsTokenManager: i } = e, s = qe(e, ["uid", "auth", "stsTokenManager"]);
|
|
3187
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
3197
|
+
this.providerId = "firebase", this.proactiveRefresh = new Vi(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);
|
|
3188
3198
|
}
|
|
3189
3199
|
async getIdToken(e) {
|
|
3190
3200
|
const t = await X(this, this.stsTokenManager.getToken(this.auth, e));
|
|
3191
|
-
return
|
|
3201
|
+
return h(
|
|
3192
3202
|
t,
|
|
3193
3203
|
this.auth,
|
|
3194
3204
|
"internal-error"
|
|
@@ -3196,13 +3206,13 @@ class I {
|
|
|
3196
3206
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
3197
3207
|
}
|
|
3198
3208
|
getIdTokenResult(e) {
|
|
3199
|
-
return
|
|
3209
|
+
return $i(this, e);
|
|
3200
3210
|
}
|
|
3201
3211
|
reload() {
|
|
3202
|
-
return
|
|
3212
|
+
return ji(this);
|
|
3203
3213
|
}
|
|
3204
3214
|
_assign(e) {
|
|
3205
|
-
this !== e && (
|
|
3215
|
+
this !== e && (h(
|
|
3206
3216
|
this.uid === e.uid,
|
|
3207
3217
|
this.auth,
|
|
3208
3218
|
"internal-error"
|
|
@@ -3210,11 +3220,11 @@ class I {
|
|
|
3210
3220
|
), 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));
|
|
3211
3221
|
}
|
|
3212
3222
|
_clone(e) {
|
|
3213
|
-
const t = new
|
|
3223
|
+
const t = new w(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
3214
3224
|
return t.metadata._copy(this.metadata), t;
|
|
3215
3225
|
}
|
|
3216
3226
|
_onReload(e) {
|
|
3217
|
-
|
|
3227
|
+
h(
|
|
3218
3228
|
!this.reloadListener,
|
|
3219
3229
|
this.auth,
|
|
3220
3230
|
"internal-error"
|
|
@@ -3232,13 +3242,13 @@ class I {
|
|
|
3232
3242
|
}
|
|
3233
3243
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
3234
3244
|
let r = !1;
|
|
3235
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), r = !0), t && await
|
|
3245
|
+
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);
|
|
3236
3246
|
}
|
|
3237
3247
|
async delete() {
|
|
3238
|
-
if (
|
|
3239
|
-
return Promise.reject(
|
|
3248
|
+
if (b(this.auth.app))
|
|
3249
|
+
return Promise.reject(L(this.auth));
|
|
3240
3250
|
const e = await this.getIdToken();
|
|
3241
|
-
return await X(this,
|
|
3251
|
+
return await X(this, Bi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
3242
3252
|
}
|
|
3243
3253
|
toJSON() {
|
|
3244
3254
|
return Object.assign(Object.assign({
|
|
@@ -3265,46 +3275,46 @@ class I {
|
|
|
3265
3275
|
return this.stsTokenManager.refreshToken || "";
|
|
3266
3276
|
}
|
|
3267
3277
|
static _fromJSON(e, t) {
|
|
3268
|
-
var r, i, s, a, c, o,
|
|
3269
|
-
const
|
|
3270
|
-
|
|
3271
|
-
|
|
3278
|
+
var r, i, s, a, c, o, u, l;
|
|
3279
|
+
const d = (r = t.displayName) !== null && r !== void 0 ? r : void 0, f = (i = t.email) !== null && i !== void 0 ? i : void 0, g = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, v = (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 = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, rt = (l = t.lastLoginAt) !== null && l !== void 0 ? l : void 0, { uid: Te, emailVerified: it, isAnonymous: st, providerData: Se, stsTokenManager: at } = t;
|
|
3280
|
+
h(
|
|
3281
|
+
Te && at,
|
|
3272
3282
|
e,
|
|
3273
3283
|
"internal-error"
|
|
3274
3284
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3275
3285
|
);
|
|
3276
3286
|
const Dn = H.fromJSON(this.name, at);
|
|
3277
|
-
|
|
3278
|
-
typeof
|
|
3287
|
+
h(
|
|
3288
|
+
typeof Te == "string",
|
|
3279
3289
|
e,
|
|
3280
3290
|
"internal-error"
|
|
3281
3291
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3282
|
-
),
|
|
3292
|
+
), A(d, e.name), A(f, e.name), h(
|
|
3283
3293
|
typeof it == "boolean",
|
|
3284
3294
|
e,
|
|
3285
3295
|
"internal-error"
|
|
3286
3296
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3287
|
-
),
|
|
3297
|
+
), h(
|
|
3288
3298
|
typeof st == "boolean",
|
|
3289
3299
|
e,
|
|
3290
3300
|
"internal-error"
|
|
3291
3301
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3292
|
-
),
|
|
3293
|
-
const
|
|
3294
|
-
uid:
|
|
3302
|
+
), A(g, e.name), A(v, e.name), A(tt, e.name), A(Ee, e.name), A(nt, e.name), A(rt, e.name);
|
|
3303
|
+
const ke = new w({
|
|
3304
|
+
uid: Te,
|
|
3295
3305
|
auth: e,
|
|
3296
|
-
email:
|
|
3306
|
+
email: f,
|
|
3297
3307
|
emailVerified: it,
|
|
3298
|
-
displayName:
|
|
3308
|
+
displayName: d,
|
|
3299
3309
|
isAnonymous: st,
|
|
3300
|
-
photoURL:
|
|
3310
|
+
photoURL: v,
|
|
3301
3311
|
phoneNumber: g,
|
|
3302
3312
|
tenantId: tt,
|
|
3303
3313
|
stsTokenManager: Dn,
|
|
3304
3314
|
createdAt: nt,
|
|
3305
3315
|
lastLoginAt: rt
|
|
3306
3316
|
});
|
|
3307
|
-
return
|
|
3317
|
+
return Se && Array.isArray(Se) && (ke.providerData = Se.map((Nn) => Object.assign({}, Nn))), Ee && (ke._redirectEventId = Ee), ke;
|
|
3308
3318
|
}
|
|
3309
3319
|
/**
|
|
3310
3320
|
* Initialize a User from an idToken server response
|
|
@@ -3314,13 +3324,13 @@ class I {
|
|
|
3314
3324
|
static async _fromIdTokenResponse(e, t, r = !1) {
|
|
3315
3325
|
const i = new H();
|
|
3316
3326
|
i.updateFromServerResponse(t);
|
|
3317
|
-
const s = new
|
|
3327
|
+
const s = new w({
|
|
3318
3328
|
uid: t.localId,
|
|
3319
3329
|
auth: e,
|
|
3320
3330
|
stsTokenManager: i,
|
|
3321
3331
|
isAnonymous: r
|
|
3322
3332
|
});
|
|
3323
|
-
return await
|
|
3333
|
+
return await me(s), s;
|
|
3324
3334
|
}
|
|
3325
3335
|
/**
|
|
3326
3336
|
* Initialize a User from an idToken server response
|
|
@@ -3329,19 +3339,19 @@ class I {
|
|
|
3329
3339
|
*/
|
|
3330
3340
|
static async _fromGetAccountInfoResponse(e, t, r) {
|
|
3331
3341
|
const i = t.users[0];
|
|
3332
|
-
|
|
3342
|
+
h(
|
|
3333
3343
|
i.localId !== void 0,
|
|
3334
3344
|
"internal-error"
|
|
3335
3345
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3336
3346
|
);
|
|
3337
3347
|
const s = i.providerUserInfo !== void 0 ? on(i.providerUserInfo) : [], a = !(i.email && i.passwordHash) && !(s != null && s.length), c = new H();
|
|
3338
3348
|
c.updateFromIdToken(r);
|
|
3339
|
-
const o = new
|
|
3349
|
+
const o = new w({
|
|
3340
3350
|
uid: i.localId,
|
|
3341
3351
|
auth: e,
|
|
3342
3352
|
stsTokenManager: c,
|
|
3343
3353
|
isAnonymous: a
|
|
3344
|
-
}),
|
|
3354
|
+
}), u = {
|
|
3345
3355
|
uid: i.localId,
|
|
3346
3356
|
displayName: i.displayName || null,
|
|
3347
3357
|
photoURL: i.photoUrl || null,
|
|
@@ -3350,10 +3360,10 @@ class I {
|
|
|
3350
3360
|
phoneNumber: i.phoneNumber || null,
|
|
3351
3361
|
tenantId: i.tenantId || null,
|
|
3352
3362
|
providerData: s,
|
|
3353
|
-
metadata: new
|
|
3363
|
+
metadata: new Ve(i.createdAt, i.lastLoginAt),
|
|
3354
3364
|
isAnonymous: !(i.email && i.passwordHash) && !(s != null && s.length)
|
|
3355
3365
|
};
|
|
3356
|
-
return Object.assign(o,
|
|
3366
|
+
return Object.assign(o, u), o;
|
|
3357
3367
|
}
|
|
3358
3368
|
}
|
|
3359
3369
|
/**
|
|
@@ -3373,10 +3383,10 @@ class I {
|
|
|
3373
3383
|
* limitations under the License.
|
|
3374
3384
|
*/
|
|
3375
3385
|
const vt = /* @__PURE__ */ new Map();
|
|
3376
|
-
function
|
|
3377
|
-
|
|
3386
|
+
function E(n) {
|
|
3387
|
+
k(n instanceof Function, "Expected a class definition");
|
|
3378
3388
|
let e = vt.get(n);
|
|
3379
|
-
return e ? (
|
|
3389
|
+
return e ? (k(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), vt.set(n, e), e);
|
|
3380
3390
|
}
|
|
3381
3391
|
/**
|
|
3382
3392
|
* @license
|
|
@@ -3448,7 +3458,7 @@ class V {
|
|
|
3448
3458
|
}
|
|
3449
3459
|
async getCurrentUser() {
|
|
3450
3460
|
const e = await this.persistence._get(this.fullUserKey);
|
|
3451
|
-
return e ?
|
|
3461
|
+
return e ? w._fromJSON(this.auth, e) : null;
|
|
3452
3462
|
}
|
|
3453
3463
|
removeCurrentUser() {
|
|
3454
3464
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -3468,29 +3478,29 @@ class V {
|
|
|
3468
3478
|
}
|
|
3469
3479
|
static async create(e, t, r = "authUser") {
|
|
3470
3480
|
if (!t.length)
|
|
3471
|
-
return new V(
|
|
3472
|
-
const i = (await Promise.all(t.map(async (
|
|
3473
|
-
if (await
|
|
3474
|
-
return
|
|
3475
|
-
}))).filter((
|
|
3476
|
-
let s = i[0] ||
|
|
3481
|
+
return new V(E(bt), e, r);
|
|
3482
|
+
const i = (await Promise.all(t.map(async (u) => {
|
|
3483
|
+
if (await u._isAvailable())
|
|
3484
|
+
return u;
|
|
3485
|
+
}))).filter((u) => u);
|
|
3486
|
+
let s = i[0] || E(bt);
|
|
3477
3487
|
const a = ae(r, e.config.apiKey, e.name);
|
|
3478
3488
|
let c = null;
|
|
3479
|
-
for (const
|
|
3489
|
+
for (const u of t)
|
|
3480
3490
|
try {
|
|
3481
|
-
const
|
|
3482
|
-
if (
|
|
3483
|
-
const
|
|
3484
|
-
|
|
3491
|
+
const l = await u._get(a);
|
|
3492
|
+
if (l) {
|
|
3493
|
+
const d = w._fromJSON(e, l);
|
|
3494
|
+
u !== s && (c = d), s = u;
|
|
3485
3495
|
break;
|
|
3486
3496
|
}
|
|
3487
3497
|
} catch {
|
|
3488
3498
|
}
|
|
3489
|
-
const o = i.filter((
|
|
3490
|
-
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 (
|
|
3491
|
-
if (
|
|
3499
|
+
const o = i.filter((u) => u._shouldAllowMigration);
|
|
3500
|
+
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 (u) => {
|
|
3501
|
+
if (u !== s)
|
|
3492
3502
|
try {
|
|
3493
|
-
await
|
|
3503
|
+
await u._remove(a);
|
|
3494
3504
|
} catch {
|
|
3495
3505
|
}
|
|
3496
3506
|
})), new V(s, e, r));
|
|
@@ -3568,12 +3578,12 @@ function mn(n = m()) {
|
|
|
3568
3578
|
function Xe(n = m()) {
|
|
3569
3579
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
3570
3580
|
}
|
|
3571
|
-
function
|
|
3581
|
+
function qi(n = m()) {
|
|
3572
3582
|
var e;
|
|
3573
3583
|
return Xe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
3574
3584
|
}
|
|
3575
|
-
function
|
|
3576
|
-
return
|
|
3585
|
+
function Ki() {
|
|
3586
|
+
return dr() && document.documentMode === 10;
|
|
3577
3587
|
}
|
|
3578
3588
|
function gn(n = m()) {
|
|
3579
3589
|
return Xe(n) || fn(n) || mn(n) || pn(n) || /windows phone/i.test(n) || hn(n);
|
|
@@ -3625,7 +3635,7 @@ function _n(n, e = []) {
|
|
|
3625
3635
|
* See the License for the specific language governing permissions and
|
|
3626
3636
|
* limitations under the License.
|
|
3627
3637
|
*/
|
|
3628
|
-
class
|
|
3638
|
+
class Ji {
|
|
3629
3639
|
constructor(e) {
|
|
3630
3640
|
this.auth = e, this.queue = [];
|
|
3631
3641
|
}
|
|
@@ -3680,8 +3690,8 @@ class qi {
|
|
|
3680
3690
|
* See the License for the specific language governing permissions and
|
|
3681
3691
|
* limitations under the License.
|
|
3682
3692
|
*/
|
|
3683
|
-
async function
|
|
3684
|
-
return G(n, "GET", "/v2/passwordPolicy",
|
|
3693
|
+
async function Yi(n, e = {}) {
|
|
3694
|
+
return G(n, "GET", "/v2/passwordPolicy", ve(n, e));
|
|
3685
3695
|
}
|
|
3686
3696
|
/**
|
|
3687
3697
|
* @license
|
|
@@ -3699,12 +3709,12 @@ async function Ki(n, e = {}) {
|
|
|
3699
3709
|
* See the License for the specific language governing permissions and
|
|
3700
3710
|
* limitations under the License.
|
|
3701
3711
|
*/
|
|
3702
|
-
const
|
|
3703
|
-
class
|
|
3712
|
+
const Xi = 6;
|
|
3713
|
+
class Qi {
|
|
3704
3714
|
constructor(e) {
|
|
3705
3715
|
var t, r, i, s;
|
|
3706
3716
|
const a = e.customStrengthOptions;
|
|
3707
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = a.minPasswordLength) !== null && t !== void 0 ? t :
|
|
3717
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = a.minPasswordLength) !== null && t !== void 0 ? t : Xi, 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;
|
|
3708
3718
|
}
|
|
3709
3719
|
validatePassword(e) {
|
|
3710
3720
|
var t, r, i, s, a, c;
|
|
@@ -3787,12 +3797,12 @@ class Yi {
|
|
|
3787
3797
|
* See the License for the specific language governing permissions and
|
|
3788
3798
|
* limitations under the License.
|
|
3789
3799
|
*/
|
|
3790
|
-
class
|
|
3800
|
+
class Zi {
|
|
3791
3801
|
constructor(e, t, r, i) {
|
|
3792
|
-
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
|
|
3802
|
+
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 Ji(this), this.redirectUser = null, this.isProactiveRefreshEnabled = !1, this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION = 1, this._canInitEmulator = !0, this._isInitialized = !1, this._deleted = !1, this._initializationPromise = null, this._popupRedirectResolver = null, this._errorFactory = Zt, this._agentRecaptchaConfig = null, this._tenantRecaptchaConfigs = {}, this._projectPasswordPolicy = null, this._tenantPasswordPolicies = {}, this.lastNotifiedUid = void 0, this.languageCode = null, this.tenantId = null, this.settings = { appVerificationDisabledForTesting: !1 }, this.frameworks = [], this.name = e.name, this.clientVersion = i.sdkClientVersion;
|
|
3793
3803
|
}
|
|
3794
3804
|
_initializeWithPersistence(e, t) {
|
|
3795
|
-
return t && (this._popupRedirectResolver =
|
|
3805
|
+
return t && (this._popupRedirectResolver = E(t)), this._initializationPromise = this.queue(async () => {
|
|
3796
3806
|
var r, i;
|
|
3797
3807
|
if (!this._deleted && (this.persistenceManager = await V.create(this, e), !this._deleted)) {
|
|
3798
3808
|
if (!((r = this._popupRedirectResolver) === null || r === void 0) && r._shouldInitProactively)
|
|
@@ -3825,7 +3835,7 @@ class Xi {
|
|
|
3825
3835
|
}
|
|
3826
3836
|
async initializeCurrentUserFromIdToken(e) {
|
|
3827
3837
|
try {
|
|
3828
|
-
const t = await an(this, { idToken: e }), r = await
|
|
3838
|
+
const t = await an(this, { idToken: e }), r = await w._fromGetAccountInfoResponse(this, t, e);
|
|
3829
3839
|
await this.directlySetCurrentUser(r);
|
|
3830
3840
|
} catch (t) {
|
|
3831
3841
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -3833,7 +3843,7 @@ class Xi {
|
|
|
3833
3843
|
}
|
|
3834
3844
|
async initializeCurrentUser(e) {
|
|
3835
3845
|
var t;
|
|
3836
|
-
if (
|
|
3846
|
+
if (b(this.app)) {
|
|
3837
3847
|
const a = this.app.settings.authIdToken;
|
|
3838
3848
|
return a ? new Promise((c) => {
|
|
3839
3849
|
setTimeout(() => this.initializeCurrentUserFromIdToken(a).then(c, c));
|
|
@@ -3857,7 +3867,7 @@ class Xi {
|
|
|
3857
3867
|
}
|
|
3858
3868
|
return i ? this.reloadAndSetCurrentUserOrClear(i) : this.directlySetCurrentUser(null);
|
|
3859
3869
|
}
|
|
3860
|
-
return
|
|
3870
|
+
return h(
|
|
3861
3871
|
this._popupRedirectResolver,
|
|
3862
3872
|
this,
|
|
3863
3873
|
"argument-error"
|
|
@@ -3875,7 +3885,7 @@ class Xi {
|
|
|
3875
3885
|
}
|
|
3876
3886
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
3877
3887
|
try {
|
|
3878
|
-
await
|
|
3888
|
+
await me(e);
|
|
3879
3889
|
} catch (t) {
|
|
3880
3890
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
3881
3891
|
return this.directlySetCurrentUser(null);
|
|
@@ -3883,16 +3893,16 @@ class Xi {
|
|
|
3883
3893
|
return this.directlySetCurrentUser(e);
|
|
3884
3894
|
}
|
|
3885
3895
|
useDeviceLanguage() {
|
|
3886
|
-
this.languageCode =
|
|
3896
|
+
this.languageCode = Mi();
|
|
3887
3897
|
}
|
|
3888
3898
|
async _delete() {
|
|
3889
3899
|
this._deleted = !0;
|
|
3890
3900
|
}
|
|
3891
3901
|
async updateCurrentUser(e) {
|
|
3892
|
-
if (
|
|
3893
|
-
return Promise.reject(
|
|
3902
|
+
if (b(this.app))
|
|
3903
|
+
return Promise.reject(L(this));
|
|
3894
3904
|
const t = e ? z(e) : null;
|
|
3895
|
-
return t &&
|
|
3905
|
+
return t && h(
|
|
3896
3906
|
t.auth.config.apiKey === this.config.apiKey,
|
|
3897
3907
|
this,
|
|
3898
3908
|
"invalid-user-token"
|
|
@@ -3901,7 +3911,7 @@ class Xi {
|
|
|
3901
3911
|
}
|
|
3902
3912
|
async _updateCurrentUser(e, t = !1) {
|
|
3903
3913
|
if (!this._deleted)
|
|
3904
|
-
return e &&
|
|
3914
|
+
return e && h(
|
|
3905
3915
|
this.tenantId === e.tenantId,
|
|
3906
3916
|
this,
|
|
3907
3917
|
"tenant-id-mismatch"
|
|
@@ -3911,15 +3921,15 @@ class Xi {
|
|
|
3911
3921
|
});
|
|
3912
3922
|
}
|
|
3913
3923
|
async signOut() {
|
|
3914
|
-
return
|
|
3924
|
+
return b(this.app) ? Promise.reject(L(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
3915
3925
|
null,
|
|
3916
3926
|
/* skipBeforeStateCallbacks */
|
|
3917
3927
|
!0
|
|
3918
3928
|
));
|
|
3919
3929
|
}
|
|
3920
3930
|
setPersistence(e) {
|
|
3921
|
-
return
|
|
3922
|
-
await this.assertedPersistence.setPersistence(
|
|
3931
|
+
return b(this.app) ? Promise.reject(L(this)) : this.queue(async () => {
|
|
3932
|
+
await this.assertedPersistence.setPersistence(E(e));
|
|
3923
3933
|
});
|
|
3924
3934
|
}
|
|
3925
3935
|
_getRecaptchaConfig() {
|
|
@@ -3934,7 +3944,7 @@ class Xi {
|
|
|
3934
3944
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
3935
3945
|
}
|
|
3936
3946
|
async _updatePasswordPolicy() {
|
|
3937
|
-
const e = await
|
|
3947
|
+
const e = await Yi(this), t = new Qi(e);
|
|
3938
3948
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
3939
3949
|
}
|
|
3940
3950
|
_getPersistence() {
|
|
@@ -3974,7 +3984,7 @@ class Xi {
|
|
|
3974
3984
|
token: e,
|
|
3975
3985
|
idToken: t
|
|
3976
3986
|
};
|
|
3977
|
-
this.tenantId != null && (r.tenantId = this.tenantId), await
|
|
3987
|
+
this.tenantId != null && (r.tenantId = this.tenantId), await Gi(this, r);
|
|
3978
3988
|
}
|
|
3979
3989
|
}
|
|
3980
3990
|
toJSON() {
|
|
@@ -3992,15 +4002,15 @@ class Xi {
|
|
|
3992
4002
|
}
|
|
3993
4003
|
async getOrInitRedirectPersistenceManager(e) {
|
|
3994
4004
|
if (!this.redirectPersistenceManager) {
|
|
3995
|
-
const t = e &&
|
|
3996
|
-
|
|
4005
|
+
const t = e && E(e) || this._popupRedirectResolver;
|
|
4006
|
+
h(
|
|
3997
4007
|
t,
|
|
3998
4008
|
this,
|
|
3999
4009
|
"argument-error"
|
|
4000
4010
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
4001
4011
|
), this.redirectPersistenceManager = await V.create(
|
|
4002
4012
|
this,
|
|
4003
|
-
[
|
|
4013
|
+
[E(t._redirectPersistence)],
|
|
4004
4014
|
"redirectUser"
|
|
4005
4015
|
/* KeyName.REDIRECT_USER */
|
|
4006
4016
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -4048,7 +4058,7 @@ class Xi {
|
|
|
4048
4058
|
const s = typeof t == "function" ? t : t.next.bind(t);
|
|
4049
4059
|
let a = !1;
|
|
4050
4060
|
const c = this._isInitialized ? Promise.resolve() : this._initializationPromise;
|
|
4051
|
-
if (
|
|
4061
|
+
if (h(
|
|
4052
4062
|
c,
|
|
4053
4063
|
this,
|
|
4054
4064
|
"internal-error"
|
|
@@ -4079,7 +4089,7 @@ class Xi {
|
|
|
4079
4089
|
return this.operations = this.operations.then(e, e), this.operations;
|
|
4080
4090
|
}
|
|
4081
4091
|
get assertedPersistence() {
|
|
4082
|
-
return
|
|
4092
|
+
return h(
|
|
4083
4093
|
this.persistenceManager,
|
|
4084
4094
|
this,
|
|
4085
4095
|
"internal-error"
|
|
@@ -4117,18 +4127,18 @@ class Xi {
|
|
|
4117
4127
|
async _getAppCheckToken() {
|
|
4118
4128
|
var e;
|
|
4119
4129
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
4120
|
-
return t != null && t.error &&
|
|
4130
|
+
return t != null && t.error && Di(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
4121
4131
|
}
|
|
4122
4132
|
}
|
|
4123
|
-
function
|
|
4133
|
+
function be(n) {
|
|
4124
4134
|
return z(n);
|
|
4125
4135
|
}
|
|
4126
4136
|
class wt {
|
|
4127
4137
|
constructor(e) {
|
|
4128
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
4138
|
+
this.auth = e, this.observer = null, this.addObserver = yr((t) => this.observer = t);
|
|
4129
4139
|
}
|
|
4130
4140
|
get next() {
|
|
4131
|
-
return
|
|
4141
|
+
return h(
|
|
4132
4142
|
this.observer,
|
|
4133
4143
|
this.auth,
|
|
4134
4144
|
"internal-error"
|
|
@@ -4160,16 +4170,16 @@ let Qe = {
|
|
|
4160
4170
|
recaptchaEnterpriseScript: "",
|
|
4161
4171
|
gapiScript: ""
|
|
4162
4172
|
};
|
|
4163
|
-
function
|
|
4173
|
+
function es(n) {
|
|
4164
4174
|
Qe = n;
|
|
4165
4175
|
}
|
|
4166
|
-
function
|
|
4176
|
+
function ts(n) {
|
|
4167
4177
|
return Qe.loadJS(n);
|
|
4168
4178
|
}
|
|
4169
|
-
function
|
|
4179
|
+
function ns() {
|
|
4170
4180
|
return Qe.gapiScript;
|
|
4171
4181
|
}
|
|
4172
|
-
function
|
|
4182
|
+
function rs(n) {
|
|
4173
4183
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
4174
4184
|
}
|
|
4175
4185
|
/**
|
|
@@ -4188,13 +4198,13 @@ function ts(n) {
|
|
|
4188
4198
|
* See the License for the specific language governing permissions and
|
|
4189
4199
|
* limitations under the License.
|
|
4190
4200
|
*/
|
|
4191
|
-
function
|
|
4201
|
+
function is(n, e) {
|
|
4192
4202
|
const t = Kt(n, "auth");
|
|
4193
4203
|
if (t.isInitialized()) {
|
|
4194
4204
|
const i = t.getImmediate(), s = t.getOptions();
|
|
4195
|
-
if (
|
|
4205
|
+
if (he(s, e ?? {}))
|
|
4196
4206
|
return i;
|
|
4197
|
-
|
|
4207
|
+
S(
|
|
4198
4208
|
i,
|
|
4199
4209
|
"already-initialized"
|
|
4200
4210
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -4202,36 +4212,36 @@ function ns(n, e) {
|
|
|
4202
4212
|
}
|
|
4203
4213
|
return t.initialize({ options: e });
|
|
4204
4214
|
}
|
|
4205
|
-
function
|
|
4206
|
-
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(
|
|
4215
|
+
function ss(n, e) {
|
|
4216
|
+
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(E);
|
|
4207
4217
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(r, e == null ? void 0 : e.popupRedirectResolver);
|
|
4208
4218
|
}
|
|
4209
|
-
function
|
|
4210
|
-
const r =
|
|
4211
|
-
|
|
4219
|
+
function as(n, e, t) {
|
|
4220
|
+
const r = be(n);
|
|
4221
|
+
h(
|
|
4212
4222
|
r._canInitEmulator,
|
|
4213
4223
|
r,
|
|
4214
4224
|
"emulator-config-failed"
|
|
4215
4225
|
/* AuthErrorCode.EMULATOR_CONFIG_FAILED */
|
|
4216
|
-
),
|
|
4226
|
+
), h(
|
|
4217
4227
|
/^https?:\/\//.test(e),
|
|
4218
4228
|
r,
|
|
4219
4229
|
"invalid-emulator-scheme"
|
|
4220
4230
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
4221
4231
|
);
|
|
4222
|
-
const i = !1, s = yn(e), { host: a, port: c } =
|
|
4232
|
+
const i = !1, s = yn(e), { host: a, port: c } = os(e), o = c === null ? "" : `:${c}`;
|
|
4223
4233
|
r.config.emulator = { url: `${s}//${a}${o}/` }, r.settings.appVerificationDisabledForTesting = !0, r.emulatorConfig = Object.freeze({
|
|
4224
4234
|
host: a,
|
|
4225
4235
|
port: c,
|
|
4226
4236
|
protocol: s.replace(":", ""),
|
|
4227
4237
|
options: Object.freeze({ disableWarnings: i })
|
|
4228
|
-
}),
|
|
4238
|
+
}), cs();
|
|
4229
4239
|
}
|
|
4230
4240
|
function yn(n) {
|
|
4231
4241
|
const e = n.indexOf(":");
|
|
4232
4242
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
4233
4243
|
}
|
|
4234
|
-
function
|
|
4244
|
+
function os(n) {
|
|
4235
4245
|
const e = yn(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
4236
4246
|
if (!t)
|
|
4237
4247
|
return { host: "", port: null };
|
|
@@ -4250,7 +4260,7 @@ function Et(n) {
|
|
|
4250
4260
|
const e = Number(n);
|
|
4251
4261
|
return isNaN(e) ? null : e;
|
|
4252
4262
|
}
|
|
4253
|
-
function
|
|
4263
|
+
function cs() {
|
|
4254
4264
|
function n() {
|
|
4255
4265
|
const e = document.createElement("p"), t = e.style;
|
|
4256
4266
|
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,19 +4294,19 @@ class vn {
|
|
|
4284
4294
|
* @returns a JSON-serializable representation of this object.
|
|
4285
4295
|
*/
|
|
4286
4296
|
toJSON() {
|
|
4287
|
-
return
|
|
4297
|
+
return I("not implemented");
|
|
4288
4298
|
}
|
|
4289
4299
|
/** @internal */
|
|
4290
4300
|
_getIdTokenResponse(e) {
|
|
4291
|
-
return
|
|
4301
|
+
return I("not implemented");
|
|
4292
4302
|
}
|
|
4293
4303
|
/** @internal */
|
|
4294
4304
|
_linkToIdToken(e, t) {
|
|
4295
|
-
return
|
|
4305
|
+
return I("not implemented");
|
|
4296
4306
|
}
|
|
4297
4307
|
/** @internal */
|
|
4298
4308
|
_getReauthenticationResolver(e) {
|
|
4299
|
-
return
|
|
4309
|
+
return I("not implemented");
|
|
4300
4310
|
}
|
|
4301
4311
|
}
|
|
4302
4312
|
/**
|
|
@@ -4316,7 +4326,7 @@ class vn {
|
|
|
4316
4326
|
* limitations under the License.
|
|
4317
4327
|
*/
|
|
4318
4328
|
async function j(n, e) {
|
|
4319
|
-
return rn(n, "POST", "/v1/accounts:signInWithIdp",
|
|
4329
|
+
return rn(n, "POST", "/v1/accounts:signInWithIdp", ve(n, e));
|
|
4320
4330
|
}
|
|
4321
4331
|
/**
|
|
4322
4332
|
* @license
|
|
@@ -4334,15 +4344,15 @@ async function j(n, e) {
|
|
|
4334
4344
|
* See the License for the specific language governing permissions and
|
|
4335
4345
|
* limitations under the License.
|
|
4336
4346
|
*/
|
|
4337
|
-
const
|
|
4338
|
-
class
|
|
4347
|
+
const ls = "http://localhost";
|
|
4348
|
+
class x extends vn {
|
|
4339
4349
|
constructor() {
|
|
4340
4350
|
super(...arguments), this.pendingToken = null;
|
|
4341
4351
|
}
|
|
4342
4352
|
/** @internal */
|
|
4343
4353
|
static _fromParams(e) {
|
|
4344
|
-
const t = new
|
|
4345
|
-
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) :
|
|
4354
|
+
const t = new x(e.providerId, e.signInMethod);
|
|
4355
|
+
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) : S(
|
|
4346
4356
|
"argument-error"
|
|
4347
4357
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
4348
4358
|
), t;
|
|
@@ -4372,7 +4382,7 @@ class U extends vn {
|
|
|
4372
4382
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s = qe(t, ["providerId", "signInMethod"]);
|
|
4373
4383
|
if (!r || !i)
|
|
4374
4384
|
return null;
|
|
4375
|
-
const a = new
|
|
4385
|
+
const a = new x(r, i);
|
|
4376
4386
|
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;
|
|
4377
4387
|
}
|
|
4378
4388
|
/** @internal */
|
|
@@ -4392,7 +4402,7 @@ class U extends vn {
|
|
|
4392
4402
|
}
|
|
4393
4403
|
buildRequest() {
|
|
4394
4404
|
const e = {
|
|
4395
|
-
requestUri:
|
|
4405
|
+
requestUri: ls,
|
|
4396
4406
|
returnSecureToken: !0
|
|
4397
4407
|
};
|
|
4398
4408
|
if (this.pendingToken)
|
|
@@ -4508,7 +4518,7 @@ class ne extends bn {
|
|
|
4508
4518
|
* See the License for the specific language governing permissions and
|
|
4509
4519
|
* limitations under the License.
|
|
4510
4520
|
*/
|
|
4511
|
-
class
|
|
4521
|
+
class R extends ne {
|
|
4512
4522
|
constructor() {
|
|
4513
4523
|
super(
|
|
4514
4524
|
"facebook.com"
|
|
@@ -4528,9 +4538,9 @@ class A extends ne {
|
|
|
4528
4538
|
* @param accessToken - Facebook access token.
|
|
4529
4539
|
*/
|
|
4530
4540
|
static credential(e) {
|
|
4531
|
-
return
|
|
4532
|
-
providerId:
|
|
4533
|
-
signInMethod:
|
|
4541
|
+
return x._fromParams({
|
|
4542
|
+
providerId: R.PROVIDER_ID,
|
|
4543
|
+
signInMethod: R.FACEBOOK_SIGN_IN_METHOD,
|
|
4534
4544
|
accessToken: e
|
|
4535
4545
|
});
|
|
4536
4546
|
}
|
|
@@ -4540,7 +4550,7 @@ class A extends ne {
|
|
|
4540
4550
|
* @param userCredential - The user credential.
|
|
4541
4551
|
*/
|
|
4542
4552
|
static credentialFromResult(e) {
|
|
4543
|
-
return
|
|
4553
|
+
return R.credentialFromTaggedObject(e);
|
|
4544
4554
|
}
|
|
4545
4555
|
/**
|
|
4546
4556
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4549,20 +4559,20 @@ class A extends ne {
|
|
|
4549
4559
|
* @param userCredential - The user credential.
|
|
4550
4560
|
*/
|
|
4551
4561
|
static credentialFromError(e) {
|
|
4552
|
-
return
|
|
4562
|
+
return R.credentialFromTaggedObject(e.customData || {});
|
|
4553
4563
|
}
|
|
4554
4564
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4555
4565
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
4556
4566
|
return null;
|
|
4557
4567
|
try {
|
|
4558
|
-
return
|
|
4568
|
+
return R.credential(e.oauthAccessToken);
|
|
4559
4569
|
} catch {
|
|
4560
4570
|
return null;
|
|
4561
4571
|
}
|
|
4562
4572
|
}
|
|
4563
4573
|
}
|
|
4564
|
-
|
|
4565
|
-
|
|
4574
|
+
R.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
4575
|
+
R.PROVIDER_ID = "facebook.com";
|
|
4566
4576
|
/**
|
|
4567
4577
|
* @license
|
|
4568
4578
|
* Copyright 2020 Google LLC
|
|
@@ -4579,7 +4589,7 @@ A.PROVIDER_ID = "facebook.com";
|
|
|
4579
4589
|
* See the License for the specific language governing permissions and
|
|
4580
4590
|
* limitations under the License.
|
|
4581
4591
|
*/
|
|
4582
|
-
class
|
|
4592
|
+
class C extends ne {
|
|
4583
4593
|
constructor() {
|
|
4584
4594
|
super(
|
|
4585
4595
|
"google.com"
|
|
@@ -4600,9 +4610,9 @@ class R extends ne {
|
|
|
4600
4610
|
* @param accessToken - Google access token.
|
|
4601
4611
|
*/
|
|
4602
4612
|
static credential(e, t) {
|
|
4603
|
-
return
|
|
4604
|
-
providerId:
|
|
4605
|
-
signInMethod:
|
|
4613
|
+
return x._fromParams({
|
|
4614
|
+
providerId: C.PROVIDER_ID,
|
|
4615
|
+
signInMethod: C.GOOGLE_SIGN_IN_METHOD,
|
|
4606
4616
|
idToken: e,
|
|
4607
4617
|
accessToken: t
|
|
4608
4618
|
});
|
|
@@ -4613,7 +4623,7 @@ class R extends ne {
|
|
|
4613
4623
|
* @param userCredential - The user credential.
|
|
4614
4624
|
*/
|
|
4615
4625
|
static credentialFromResult(e) {
|
|
4616
|
-
return
|
|
4626
|
+
return C.credentialFromTaggedObject(e);
|
|
4617
4627
|
}
|
|
4618
4628
|
/**
|
|
4619
4629
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4622,7 +4632,7 @@ class R extends ne {
|
|
|
4622
4632
|
* @param userCredential - The user credential.
|
|
4623
4633
|
*/
|
|
4624
4634
|
static credentialFromError(e) {
|
|
4625
|
-
return
|
|
4635
|
+
return C.credentialFromTaggedObject(e.customData || {});
|
|
4626
4636
|
}
|
|
4627
4637
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4628
4638
|
if (!e)
|
|
@@ -4631,14 +4641,14 @@ class R extends ne {
|
|
|
4631
4641
|
if (!t && !r)
|
|
4632
4642
|
return null;
|
|
4633
4643
|
try {
|
|
4634
|
-
return
|
|
4644
|
+
return C.credential(t, r);
|
|
4635
4645
|
} catch {
|
|
4636
4646
|
return null;
|
|
4637
4647
|
}
|
|
4638
4648
|
}
|
|
4639
4649
|
}
|
|
4640
|
-
|
|
4641
|
-
|
|
4650
|
+
C.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
4651
|
+
C.PROVIDER_ID = "google.com";
|
|
4642
4652
|
/**
|
|
4643
4653
|
* @license
|
|
4644
4654
|
* Copyright 2020 Google LLC
|
|
@@ -4655,7 +4665,7 @@ R.PROVIDER_ID = "google.com";
|
|
|
4655
4665
|
* See the License for the specific language governing permissions and
|
|
4656
4666
|
* limitations under the License.
|
|
4657
4667
|
*/
|
|
4658
|
-
class
|
|
4668
|
+
class P extends ne {
|
|
4659
4669
|
constructor() {
|
|
4660
4670
|
super(
|
|
4661
4671
|
"github.com"
|
|
@@ -4668,9 +4678,9 @@ class C extends ne {
|
|
|
4668
4678
|
* @param accessToken - GitHub access token.
|
|
4669
4679
|
*/
|
|
4670
4680
|
static credential(e) {
|
|
4671
|
-
return
|
|
4672
|
-
providerId:
|
|
4673
|
-
signInMethod:
|
|
4681
|
+
return x._fromParams({
|
|
4682
|
+
providerId: P.PROVIDER_ID,
|
|
4683
|
+
signInMethod: P.GITHUB_SIGN_IN_METHOD,
|
|
4674
4684
|
accessToken: e
|
|
4675
4685
|
});
|
|
4676
4686
|
}
|
|
@@ -4680,7 +4690,7 @@ class C extends ne {
|
|
|
4680
4690
|
* @param userCredential - The user credential.
|
|
4681
4691
|
*/
|
|
4682
4692
|
static credentialFromResult(e) {
|
|
4683
|
-
return
|
|
4693
|
+
return P.credentialFromTaggedObject(e);
|
|
4684
4694
|
}
|
|
4685
4695
|
/**
|
|
4686
4696
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4689,20 +4699,20 @@ class C extends ne {
|
|
|
4689
4699
|
* @param userCredential - The user credential.
|
|
4690
4700
|
*/
|
|
4691
4701
|
static credentialFromError(e) {
|
|
4692
|
-
return
|
|
4702
|
+
return P.credentialFromTaggedObject(e.customData || {});
|
|
4693
4703
|
}
|
|
4694
4704
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4695
4705
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
4696
4706
|
return null;
|
|
4697
4707
|
try {
|
|
4698
|
-
return
|
|
4708
|
+
return P.credential(e.oauthAccessToken);
|
|
4699
4709
|
} catch {
|
|
4700
4710
|
return null;
|
|
4701
4711
|
}
|
|
4702
4712
|
}
|
|
4703
4713
|
}
|
|
4704
|
-
|
|
4705
|
-
|
|
4714
|
+
P.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
4715
|
+
P.PROVIDER_ID = "github.com";
|
|
4706
4716
|
/**
|
|
4707
4717
|
* @license
|
|
4708
4718
|
* Copyright 2020 Google LLC
|
|
@@ -4719,7 +4729,7 @@ C.PROVIDER_ID = "github.com";
|
|
|
4719
4729
|
* See the License for the specific language governing permissions and
|
|
4720
4730
|
* limitations under the License.
|
|
4721
4731
|
*/
|
|
4722
|
-
class
|
|
4732
|
+
class O extends ne {
|
|
4723
4733
|
constructor() {
|
|
4724
4734
|
super(
|
|
4725
4735
|
"twitter.com"
|
|
@@ -4733,9 +4743,9 @@ class P extends ne {
|
|
|
4733
4743
|
* @param secret - Twitter secret.
|
|
4734
4744
|
*/
|
|
4735
4745
|
static credential(e, t) {
|
|
4736
|
-
return
|
|
4737
|
-
providerId:
|
|
4738
|
-
signInMethod:
|
|
4746
|
+
return x._fromParams({
|
|
4747
|
+
providerId: O.PROVIDER_ID,
|
|
4748
|
+
signInMethod: O.TWITTER_SIGN_IN_METHOD,
|
|
4739
4749
|
oauthToken: e,
|
|
4740
4750
|
oauthTokenSecret: t
|
|
4741
4751
|
});
|
|
@@ -4746,7 +4756,7 @@ class P extends ne {
|
|
|
4746
4756
|
* @param userCredential - The user credential.
|
|
4747
4757
|
*/
|
|
4748
4758
|
static credentialFromResult(e) {
|
|
4749
|
-
return
|
|
4759
|
+
return O.credentialFromTaggedObject(e);
|
|
4750
4760
|
}
|
|
4751
4761
|
/**
|
|
4752
4762
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4755,7 +4765,7 @@ class P extends ne {
|
|
|
4755
4765
|
* @param userCredential - The user credential.
|
|
4756
4766
|
*/
|
|
4757
4767
|
static credentialFromError(e) {
|
|
4758
|
-
return
|
|
4768
|
+
return O.credentialFromTaggedObject(e.customData || {});
|
|
4759
4769
|
}
|
|
4760
4770
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4761
4771
|
if (!e)
|
|
@@ -4764,14 +4774,14 @@ class P extends ne {
|
|
|
4764
4774
|
if (!t || !r)
|
|
4765
4775
|
return null;
|
|
4766
4776
|
try {
|
|
4767
|
-
return
|
|
4777
|
+
return O.credential(t, r);
|
|
4768
4778
|
} catch {
|
|
4769
4779
|
return null;
|
|
4770
4780
|
}
|
|
4771
4781
|
}
|
|
4772
4782
|
}
|
|
4773
|
-
|
|
4774
|
-
|
|
4783
|
+
O.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
4784
|
+
O.PROVIDER_ID = "twitter.com";
|
|
4775
4785
|
/**
|
|
4776
4786
|
* @license
|
|
4777
4787
|
* Copyright 2020 Google LLC
|
|
@@ -4788,13 +4798,13 @@ P.PROVIDER_ID = "twitter.com";
|
|
|
4788
4798
|
* See the License for the specific language governing permissions and
|
|
4789
4799
|
* limitations under the License.
|
|
4790
4800
|
*/
|
|
4791
|
-
class
|
|
4801
|
+
class F {
|
|
4792
4802
|
constructor(e) {
|
|
4793
4803
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
4794
4804
|
}
|
|
4795
4805
|
static async _fromIdTokenResponse(e, t, r, i = !1) {
|
|
4796
|
-
const s = await
|
|
4797
|
-
return new
|
|
4806
|
+
const s = await w._fromIdTokenResponse(e, r, i), a = Tt(r);
|
|
4807
|
+
return new F({
|
|
4798
4808
|
user: s,
|
|
4799
4809
|
providerId: a,
|
|
4800
4810
|
_tokenResponse: r,
|
|
@@ -4808,7 +4818,7 @@ class x {
|
|
|
4808
4818
|
!0
|
|
4809
4819
|
);
|
|
4810
4820
|
const i = Tt(r);
|
|
4811
|
-
return new
|
|
4821
|
+
return new F({
|
|
4812
4822
|
user: e,
|
|
4813
4823
|
providerId: i,
|
|
4814
4824
|
_tokenResponse: r,
|
|
@@ -4835,10 +4845,10 @@ function Tt(n) {
|
|
|
4835
4845
|
* See the License for the specific language governing permissions and
|
|
4836
4846
|
* limitations under the License.
|
|
4837
4847
|
*/
|
|
4838
|
-
class
|
|
4848
|
+
class ge extends M {
|
|
4839
4849
|
constructor(e, t, r, i) {
|
|
4840
4850
|
var s;
|
|
4841
|
-
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this,
|
|
4851
|
+
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this, ge.prototype), this.customData = {
|
|
4842
4852
|
appName: e.name,
|
|
4843
4853
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
4844
4854
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -4846,17 +4856,17 @@ class me extends L {
|
|
|
4846
4856
|
};
|
|
4847
4857
|
}
|
|
4848
4858
|
static _fromErrorAndOperation(e, t, r, i) {
|
|
4849
|
-
return new
|
|
4859
|
+
return new ge(e, t, r, i);
|
|
4850
4860
|
}
|
|
4851
4861
|
}
|
|
4852
4862
|
function In(n, e, t, r) {
|
|
4853
4863
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
4854
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
4864
|
+
throw s.code === "auth/multi-factor-auth-required" ? ge._fromErrorAndOperation(n, s, e, r) : s;
|
|
4855
4865
|
});
|
|
4856
4866
|
}
|
|
4857
|
-
async function
|
|
4867
|
+
async function us(n, e, t = !1) {
|
|
4858
4868
|
const r = await X(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
4859
|
-
return
|
|
4869
|
+
return F._forOperation(n, "link", r);
|
|
4860
4870
|
}
|
|
4861
4871
|
/**
|
|
4862
4872
|
* @license
|
|
@@ -4874,35 +4884,35 @@ async function cs(n, e, t = !1) {
|
|
|
4874
4884
|
* See the License for the specific language governing permissions and
|
|
4875
4885
|
* limitations under the License.
|
|
4876
4886
|
*/
|
|
4877
|
-
async function
|
|
4887
|
+
async function ds(n, e, t = !1) {
|
|
4878
4888
|
const { auth: r } = n;
|
|
4879
|
-
if (
|
|
4880
|
-
return Promise.reject(
|
|
4889
|
+
if (b(r.app))
|
|
4890
|
+
return Promise.reject(L(r));
|
|
4881
4891
|
const i = "reauthenticate";
|
|
4882
4892
|
try {
|
|
4883
4893
|
const s = await X(n, In(r, i, e, n), t);
|
|
4884
|
-
|
|
4894
|
+
h(
|
|
4885
4895
|
s.idToken,
|
|
4886
4896
|
r,
|
|
4887
4897
|
"internal-error"
|
|
4888
4898
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4889
4899
|
);
|
|
4890
4900
|
const a = Ye(s.idToken);
|
|
4891
|
-
|
|
4901
|
+
h(
|
|
4892
4902
|
a,
|
|
4893
4903
|
r,
|
|
4894
4904
|
"internal-error"
|
|
4895
4905
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4896
4906
|
);
|
|
4897
4907
|
const { sub: c } = a;
|
|
4898
|
-
return
|
|
4908
|
+
return h(
|
|
4899
4909
|
n.uid === c,
|
|
4900
4910
|
r,
|
|
4901
4911
|
"user-mismatch"
|
|
4902
4912
|
/* AuthErrorCode.USER_MISMATCH */
|
|
4903
|
-
),
|
|
4913
|
+
), F._forOperation(n, i, s);
|
|
4904
4914
|
} catch (s) {
|
|
4905
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
4915
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && S(
|
|
4906
4916
|
r,
|
|
4907
4917
|
"user-mismatch"
|
|
4908
4918
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -4925,10 +4935,10 @@ async function ls(n, e, t = !1) {
|
|
|
4925
4935
|
* See the License for the specific language governing permissions and
|
|
4926
4936
|
* limitations under the License.
|
|
4927
4937
|
*/
|
|
4928
|
-
async function
|
|
4929
|
-
if (
|
|
4930
|
-
return Promise.reject(
|
|
4931
|
-
const r = "signIn", i = await In(n, r, e), s = await
|
|
4938
|
+
async function hs(n, e, t = !1) {
|
|
4939
|
+
if (b(n.app))
|
|
4940
|
+
return Promise.reject(L(n));
|
|
4941
|
+
const r = "signIn", i = await In(n, r, e), s = await F._fromIdTokenResponse(n, r, i);
|
|
4932
4942
|
return t || await n._updateCurrentUser(s.user), s;
|
|
4933
4943
|
}
|
|
4934
4944
|
/**
|
|
@@ -4947,8 +4957,8 @@ async function us(n, e, t = !1) {
|
|
|
4947
4957
|
* See the License for the specific language governing permissions and
|
|
4948
4958
|
* limitations under the License.
|
|
4949
4959
|
*/
|
|
4950
|
-
async function
|
|
4951
|
-
return rn(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
4960
|
+
async function fs(n, e) {
|
|
4961
|
+
return rn(n, "POST", "/v1/accounts:signInWithCustomToken", ve(n, e));
|
|
4952
4962
|
}
|
|
4953
4963
|
/**
|
|
4954
4964
|
* @license
|
|
@@ -4966,22 +4976,22 @@ async function ds(n, e) {
|
|
|
4966
4976
|
* See the License for the specific language governing permissions and
|
|
4967
4977
|
* limitations under the License.
|
|
4968
4978
|
*/
|
|
4969
|
-
async function
|
|
4970
|
-
if (
|
|
4971
|
-
return Promise.reject(
|
|
4972
|
-
const t =
|
|
4979
|
+
async function ps(n, e) {
|
|
4980
|
+
if (b(n.app))
|
|
4981
|
+
return Promise.reject(L(n));
|
|
4982
|
+
const t = be(n), r = await fs(t, {
|
|
4973
4983
|
token: e,
|
|
4974
4984
|
returnSecureToken: !0
|
|
4975
|
-
}), i = await
|
|
4985
|
+
}), i = await F._fromIdTokenResponse(t, "signIn", r);
|
|
4976
4986
|
return await t._updateCurrentUser(i.user), i;
|
|
4977
4987
|
}
|
|
4978
|
-
function
|
|
4988
|
+
function ms(n, e, t, r) {
|
|
4979
4989
|
return z(n).onIdTokenChanged(e, t, r);
|
|
4980
4990
|
}
|
|
4981
|
-
function
|
|
4991
|
+
function gs(n, e, t) {
|
|
4982
4992
|
return z(n).beforeAuthStateChanged(e, t);
|
|
4983
4993
|
}
|
|
4984
|
-
const
|
|
4994
|
+
const _e = "__sak";
|
|
4985
4995
|
/**
|
|
4986
4996
|
* @license
|
|
4987
4997
|
* Copyright 2019 Google LLC
|
|
@@ -5004,7 +5014,7 @@ class wn {
|
|
|
5004
5014
|
}
|
|
5005
5015
|
_isAvailable() {
|
|
5006
5016
|
try {
|
|
5007
|
-
return this.storage ? (this.storage.setItem(
|
|
5017
|
+
return this.storage ? (this.storage.setItem(_e, "1"), this.storage.removeItem(_e), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
5008
5018
|
} catch {
|
|
5009
5019
|
return Promise.resolve(!1);
|
|
5010
5020
|
}
|
|
@@ -5039,7 +5049,7 @@ class wn {
|
|
|
5039
5049
|
* See the License for the specific language governing permissions and
|
|
5040
5050
|
* limitations under the License.
|
|
5041
5051
|
*/
|
|
5042
|
-
const
|
|
5052
|
+
const _s = 1e3, ys = 10;
|
|
5043
5053
|
class En extends wn {
|
|
5044
5054
|
constructor() {
|
|
5045
5055
|
super(
|
|
@@ -5067,7 +5077,7 @@ class En extends wn {
|
|
|
5067
5077
|
const a = this.storage.getItem(r);
|
|
5068
5078
|
!t && this.localCache[r] === a || this.notifyListeners(r, a);
|
|
5069
5079
|
}, s = this.storage.getItem(r);
|
|
5070
|
-
|
|
5080
|
+
Ki() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(i, ys) : i();
|
|
5071
5081
|
}
|
|
5072
5082
|
notifyListeners(e, t) {
|
|
5073
5083
|
this.localCache[e] = t;
|
|
@@ -5089,7 +5099,7 @@ class En extends wn {
|
|
|
5089
5099
|
!0
|
|
5090
5100
|
);
|
|
5091
5101
|
});
|
|
5092
|
-
},
|
|
5102
|
+
}, _s);
|
|
5093
5103
|
}
|
|
5094
5104
|
stopPolling() {
|
|
5095
5105
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -5119,7 +5129,7 @@ class En extends wn {
|
|
|
5119
5129
|
}
|
|
5120
5130
|
}
|
|
5121
5131
|
En.type = "LOCAL";
|
|
5122
|
-
const
|
|
5132
|
+
const vs = En;
|
|
5123
5133
|
/**
|
|
5124
5134
|
* @license
|
|
5125
5135
|
* Copyright 2020 Google LLC
|
|
@@ -5167,7 +5177,7 @@ const Sn = Tn;
|
|
|
5167
5177
|
* See the License for the specific language governing permissions and
|
|
5168
5178
|
* limitations under the License.
|
|
5169
5179
|
*/
|
|
5170
|
-
function
|
|
5180
|
+
function bs(n) {
|
|
5171
5181
|
return Promise.all(n.map(async (e) => {
|
|
5172
5182
|
try {
|
|
5173
5183
|
return {
|
|
@@ -5198,7 +5208,7 @@ function ys(n) {
|
|
|
5198
5208
|
* See the License for the specific language governing permissions and
|
|
5199
5209
|
* limitations under the License.
|
|
5200
5210
|
*/
|
|
5201
|
-
class
|
|
5211
|
+
class Ie {
|
|
5202
5212
|
constructor(e) {
|
|
5203
5213
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
5204
5214
|
}
|
|
@@ -5212,7 +5222,7 @@ class be {
|
|
|
5212
5222
|
const t = this.receivers.find((i) => i.isListeningto(e));
|
|
5213
5223
|
if (t)
|
|
5214
5224
|
return t;
|
|
5215
|
-
const r = new
|
|
5225
|
+
const r = new Ie(e);
|
|
5216
5226
|
return this.receivers.push(r), r;
|
|
5217
5227
|
}
|
|
5218
5228
|
isListeningto(e) {
|
|
@@ -5237,7 +5247,7 @@ class be {
|
|
|
5237
5247
|
eventId: r,
|
|
5238
5248
|
eventType: i
|
|
5239
5249
|
});
|
|
5240
|
-
const c = Array.from(a).map(async (
|
|
5250
|
+
const c = Array.from(a).map(async (u) => u(t.origin, s)), o = await bs(c);
|
|
5241
5251
|
t.ports[0].postMessage({
|
|
5242
5252
|
status: "done",
|
|
5243
5253
|
eventId: r,
|
|
@@ -5266,7 +5276,7 @@ class be {
|
|
|
5266
5276
|
this.handlersMap[e] && t && this.handlersMap[e].delete(t), (!t || this.handlersMap[e].size === 0) && delete this.handlersMap[e], Object.keys(this.handlersMap).length === 0 && this.eventTarget.removeEventListener("message", this.boundEventHandler);
|
|
5267
5277
|
}
|
|
5268
5278
|
}
|
|
5269
|
-
|
|
5279
|
+
Ie.receivers = [];
|
|
5270
5280
|
/**
|
|
5271
5281
|
* @license
|
|
5272
5282
|
* Copyright 2020 Google LLC
|
|
@@ -5305,7 +5315,7 @@ function Ze(n = "", e = 10) {
|
|
|
5305
5315
|
* See the License for the specific language governing permissions and
|
|
5306
5316
|
* limitations under the License.
|
|
5307
5317
|
*/
|
|
5308
|
-
class
|
|
5318
|
+
class Is {
|
|
5309
5319
|
constructor(e) {
|
|
5310
5320
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
5311
5321
|
}
|
|
@@ -5339,9 +5349,9 @@ class vs {
|
|
|
5339
5349
|
);
|
|
5340
5350
|
let s, a;
|
|
5341
5351
|
return new Promise((c, o) => {
|
|
5342
|
-
const
|
|
5352
|
+
const u = Ze("", 20);
|
|
5343
5353
|
i.port1.start();
|
|
5344
|
-
const
|
|
5354
|
+
const l = setTimeout(() => {
|
|
5345
5355
|
o(new Error(
|
|
5346
5356
|
"unsupported_event"
|
|
5347
5357
|
/* _MessageError.UNSUPPORTED_EVENT */
|
|
@@ -5349,12 +5359,12 @@ class vs {
|
|
|
5349
5359
|
}, r);
|
|
5350
5360
|
a = {
|
|
5351
5361
|
messageChannel: i,
|
|
5352
|
-
onMessage(
|
|
5353
|
-
const
|
|
5354
|
-
if (
|
|
5355
|
-
switch (
|
|
5362
|
+
onMessage(d) {
|
|
5363
|
+
const f = d;
|
|
5364
|
+
if (f.data.eventId === u)
|
|
5365
|
+
switch (f.data.status) {
|
|
5356
5366
|
case "ack":
|
|
5357
|
-
clearTimeout(
|
|
5367
|
+
clearTimeout(l), s = setTimeout(
|
|
5358
5368
|
() => {
|
|
5359
5369
|
o(new Error(
|
|
5360
5370
|
"timeout"
|
|
@@ -5366,10 +5376,10 @@ class vs {
|
|
|
5366
5376
|
);
|
|
5367
5377
|
break;
|
|
5368
5378
|
case "done":
|
|
5369
|
-
clearTimeout(s), c(
|
|
5379
|
+
clearTimeout(s), c(f.data.response);
|
|
5370
5380
|
break;
|
|
5371
5381
|
default:
|
|
5372
|
-
clearTimeout(
|
|
5382
|
+
clearTimeout(l), clearTimeout(s), o(new Error(
|
|
5373
5383
|
"invalid_response"
|
|
5374
5384
|
/* _MessageError.INVALID_RESPONSE */
|
|
5375
5385
|
));
|
|
@@ -5378,7 +5388,7 @@ class vs {
|
|
|
5378
5388
|
}
|
|
5379
5389
|
}, this.handlers.add(a), i.port1.addEventListener("message", a.onMessage), this.target.postMessage({
|
|
5380
5390
|
eventType: e,
|
|
5381
|
-
eventId:
|
|
5391
|
+
eventId: u,
|
|
5382
5392
|
data: t
|
|
5383
5393
|
}, [i.port2]);
|
|
5384
5394
|
}).finally(() => {
|
|
@@ -5405,7 +5415,7 @@ class vs {
|
|
|
5405
5415
|
function y() {
|
|
5406
5416
|
return window;
|
|
5407
5417
|
}
|
|
5408
|
-
function
|
|
5418
|
+
function ws(n) {
|
|
5409
5419
|
y().location.href = n;
|
|
5410
5420
|
}
|
|
5411
5421
|
/**
|
|
@@ -5427,7 +5437,7 @@ function bs(n) {
|
|
|
5427
5437
|
function kn() {
|
|
5428
5438
|
return typeof y().WorkerGlobalScope < "u" && typeof y().importScripts == "function";
|
|
5429
5439
|
}
|
|
5430
|
-
async function
|
|
5440
|
+
async function Es() {
|
|
5431
5441
|
if (!(navigator != null && navigator.serviceWorker))
|
|
5432
5442
|
return null;
|
|
5433
5443
|
try {
|
|
@@ -5436,11 +5446,11 @@ async function Is() {
|
|
|
5436
5446
|
return null;
|
|
5437
5447
|
}
|
|
5438
5448
|
}
|
|
5439
|
-
function
|
|
5449
|
+
function Ts() {
|
|
5440
5450
|
var n;
|
|
5441
5451
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
5442
5452
|
}
|
|
5443
|
-
function
|
|
5453
|
+
function Ss() {
|
|
5444
5454
|
return kn() ? self : null;
|
|
5445
5455
|
}
|
|
5446
5456
|
/**
|
|
@@ -5459,7 +5469,7 @@ function Es() {
|
|
|
5459
5469
|
* See the License for the specific language governing permissions and
|
|
5460
5470
|
* limitations under the License.
|
|
5461
5471
|
*/
|
|
5462
|
-
const An = "firebaseLocalStorageDb",
|
|
5472
|
+
const An = "firebaseLocalStorageDb", ks = 1, ye = "firebaseLocalStorage", Rn = "fbase_key";
|
|
5463
5473
|
class re {
|
|
5464
5474
|
constructor(e) {
|
|
5465
5475
|
this.request = e;
|
|
@@ -5474,47 +5484,47 @@ class re {
|
|
|
5474
5484
|
});
|
|
5475
5485
|
}
|
|
5476
5486
|
}
|
|
5477
|
-
function
|
|
5478
|
-
return n.transaction([
|
|
5487
|
+
function we(n, e) {
|
|
5488
|
+
return n.transaction([ye], e ? "readwrite" : "readonly").objectStore(ye);
|
|
5479
5489
|
}
|
|
5480
|
-
function
|
|
5490
|
+
function As() {
|
|
5481
5491
|
const n = indexedDB.deleteDatabase(An);
|
|
5482
5492
|
return new re(n).toPromise();
|
|
5483
5493
|
}
|
|
5484
|
-
function
|
|
5485
|
-
const n = indexedDB.open(An,
|
|
5494
|
+
function je() {
|
|
5495
|
+
const n = indexedDB.open(An, ks);
|
|
5486
5496
|
return new Promise((e, t) => {
|
|
5487
5497
|
n.addEventListener("error", () => {
|
|
5488
5498
|
t(n.error);
|
|
5489
5499
|
}), n.addEventListener("upgradeneeded", () => {
|
|
5490
5500
|
const r = n.result;
|
|
5491
5501
|
try {
|
|
5492
|
-
r.createObjectStore(
|
|
5502
|
+
r.createObjectStore(ye, { keyPath: Rn });
|
|
5493
5503
|
} catch (i) {
|
|
5494
5504
|
t(i);
|
|
5495
5505
|
}
|
|
5496
5506
|
}), n.addEventListener("success", async () => {
|
|
5497
5507
|
const r = n.result;
|
|
5498
|
-
r.objectStoreNames.contains(
|
|
5508
|
+
r.objectStoreNames.contains(ye) ? e(r) : (r.close(), await As(), e(await je()));
|
|
5499
5509
|
});
|
|
5500
5510
|
});
|
|
5501
5511
|
}
|
|
5502
5512
|
async function St(n, e, t) {
|
|
5503
|
-
const r =
|
|
5513
|
+
const r = we(n, !0).put({
|
|
5504
5514
|
[Rn]: e,
|
|
5505
5515
|
value: t
|
|
5506
5516
|
});
|
|
5507
5517
|
return new re(r).toPromise();
|
|
5508
5518
|
}
|
|
5509
|
-
async function
|
|
5510
|
-
const t =
|
|
5519
|
+
async function Rs(n, e) {
|
|
5520
|
+
const t = we(n, !1).get(e), r = await new re(t).toPromise();
|
|
5511
5521
|
return r === void 0 ? null : r.value;
|
|
5512
5522
|
}
|
|
5513
5523
|
function kt(n, e) {
|
|
5514
|
-
const t =
|
|
5524
|
+
const t = we(n, !0).delete(e);
|
|
5515
5525
|
return new re(t).toPromise();
|
|
5516
5526
|
}
|
|
5517
|
-
const
|
|
5527
|
+
const Cs = 800, Ps = 3;
|
|
5518
5528
|
class Cn {
|
|
5519
5529
|
constructor() {
|
|
5520
5530
|
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(() => {
|
|
@@ -5522,7 +5532,7 @@ class Cn {
|
|
|
5522
5532
|
});
|
|
5523
5533
|
}
|
|
5524
5534
|
async _openDb() {
|
|
5525
|
-
return this.db ? this.db : (this.db = await
|
|
5535
|
+
return this.db ? this.db : (this.db = await je(), this.db);
|
|
5526
5536
|
}
|
|
5527
5537
|
async _withRetries(e) {
|
|
5528
5538
|
let t = 0;
|
|
@@ -5531,7 +5541,7 @@ class Cn {
|
|
|
5531
5541
|
const r = await this._openDb();
|
|
5532
5542
|
return await e(r);
|
|
5533
5543
|
} catch (r) {
|
|
5534
|
-
if (t++ >
|
|
5544
|
+
if (t++ > Ps)
|
|
5535
5545
|
throw r;
|
|
5536
5546
|
this.db && (this.db.close(), this.db = void 0);
|
|
5537
5547
|
}
|
|
@@ -5547,7 +5557,7 @@ class Cn {
|
|
|
5547
5557
|
* As the worker we should listen to events from the main window.
|
|
5548
5558
|
*/
|
|
5549
5559
|
async initializeReceiver() {
|
|
5550
|
-
this.receiver =
|
|
5560
|
+
this.receiver = Ie._getInstance(Ss()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
5551
5561
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
5552
5562
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
5553
5563
|
"keyChanged"
|
|
@@ -5563,9 +5573,9 @@ class Cn {
|
|
|
5563
5573
|
*/
|
|
5564
5574
|
async initializeSender() {
|
|
5565
5575
|
var e, t;
|
|
5566
|
-
if (this.activeServiceWorker = await
|
|
5576
|
+
if (this.activeServiceWorker = await Es(), !this.activeServiceWorker)
|
|
5567
5577
|
return;
|
|
5568
|
-
this.sender = new
|
|
5578
|
+
this.sender = new Is(this.activeServiceWorker);
|
|
5569
5579
|
const r = await this.sender._send(
|
|
5570
5580
|
"ping",
|
|
5571
5581
|
{},
|
|
@@ -5587,7 +5597,7 @@ class Cn {
|
|
|
5587
5597
|
* @param key - Storage key which changed.
|
|
5588
5598
|
*/
|
|
5589
5599
|
async notifyServiceWorker(e) {
|
|
5590
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
5600
|
+
if (!(!this.sender || !this.activeServiceWorker || Ts() !== this.activeServiceWorker))
|
|
5591
5601
|
try {
|
|
5592
5602
|
await this.sender._send(
|
|
5593
5603
|
"keyChanged",
|
|
@@ -5603,8 +5613,8 @@ class Cn {
|
|
|
5603
5613
|
try {
|
|
5604
5614
|
if (!indexedDB)
|
|
5605
5615
|
return !1;
|
|
5606
|
-
const e = await
|
|
5607
|
-
return await St(e,
|
|
5616
|
+
const e = await je();
|
|
5617
|
+
return await St(e, _e, "1"), await kt(e, _e), !0;
|
|
5608
5618
|
} catch {
|
|
5609
5619
|
}
|
|
5610
5620
|
return !1;
|
|
@@ -5621,7 +5631,7 @@ class Cn {
|
|
|
5621
5631
|
return this._withPendingWrite(async () => (await this._withRetries((r) => St(r, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
5622
5632
|
}
|
|
5623
5633
|
async _get(e) {
|
|
5624
|
-
const t = await this._withRetries((r) =>
|
|
5634
|
+
const t = await this._withRetries((r) => Rs(r, e));
|
|
5625
5635
|
return this.localCache[e] = t, t;
|
|
5626
5636
|
}
|
|
5627
5637
|
async _remove(e) {
|
|
@@ -5629,7 +5639,7 @@ class Cn {
|
|
|
5629
5639
|
}
|
|
5630
5640
|
async _poll() {
|
|
5631
5641
|
const e = await this._withRetries((i) => {
|
|
5632
|
-
const s =
|
|
5642
|
+
const s = we(i, !1).getAll();
|
|
5633
5643
|
return new re(s).toPromise();
|
|
5634
5644
|
});
|
|
5635
5645
|
if (!e)
|
|
@@ -5652,7 +5662,7 @@ class Cn {
|
|
|
5652
5662
|
i(t);
|
|
5653
5663
|
}
|
|
5654
5664
|
startPolling() {
|
|
5655
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
5665
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Cs);
|
|
5656
5666
|
}
|
|
5657
5667
|
stopPolling() {
|
|
5658
5668
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -5665,7 +5675,7 @@ class Cn {
|
|
|
5665
5675
|
}
|
|
5666
5676
|
}
|
|
5667
5677
|
Cn.type = "LOCAL";
|
|
5668
|
-
const
|
|
5678
|
+
const Os = Cn;
|
|
5669
5679
|
new te(3e4, 6e4);
|
|
5670
5680
|
/**
|
|
5671
5681
|
* @license
|
|
@@ -5683,8 +5693,8 @@ new te(3e4, 6e4);
|
|
|
5683
5693
|
* See the License for the specific language governing permissions and
|
|
5684
5694
|
* limitations under the License.
|
|
5685
5695
|
*/
|
|
5686
|
-
function
|
|
5687
|
-
return e ?
|
|
5696
|
+
function Ds(n, e) {
|
|
5697
|
+
return e ? E(e) : (h(
|
|
5688
5698
|
n._popupRedirectResolver,
|
|
5689
5699
|
n,
|
|
5690
5700
|
"argument-error"
|
|
@@ -5737,26 +5747,26 @@ class et extends vn {
|
|
|
5737
5747
|
return e && (t.idToken = e), t;
|
|
5738
5748
|
}
|
|
5739
5749
|
}
|
|
5740
|
-
function
|
|
5741
|
-
return
|
|
5750
|
+
function Ns(n) {
|
|
5751
|
+
return hs(n.auth, new et(n), n.bypassAuthState);
|
|
5742
5752
|
}
|
|
5743
|
-
function
|
|
5753
|
+
function Ls(n) {
|
|
5744
5754
|
const { auth: e, user: t } = n;
|
|
5745
|
-
return
|
|
5755
|
+
return h(
|
|
5746
5756
|
t,
|
|
5747
5757
|
e,
|
|
5748
5758
|
"internal-error"
|
|
5749
5759
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
5750
|
-
),
|
|
5760
|
+
), ds(t, new et(n), n.bypassAuthState);
|
|
5751
5761
|
}
|
|
5752
|
-
async function
|
|
5762
|
+
async function Ms(n) {
|
|
5753
5763
|
const { auth: e, user: t } = n;
|
|
5754
|
-
return
|
|
5764
|
+
return h(
|
|
5755
5765
|
t,
|
|
5756
5766
|
e,
|
|
5757
5767
|
"internal-error"
|
|
5758
5768
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
5759
|
-
),
|
|
5769
|
+
), us(t, new et(n), n.bypassAuthState);
|
|
5760
5770
|
}
|
|
5761
5771
|
/**
|
|
5762
5772
|
* @license
|
|
@@ -5805,8 +5815,8 @@ class Pn {
|
|
|
5805
5815
|
};
|
|
5806
5816
|
try {
|
|
5807
5817
|
this.resolve(await this.getIdpTask(c)(o));
|
|
5808
|
-
} catch (
|
|
5809
|
-
this.reject(
|
|
5818
|
+
} catch (u) {
|
|
5819
|
+
this.reject(u);
|
|
5810
5820
|
}
|
|
5811
5821
|
}
|
|
5812
5822
|
onError(e) {
|
|
@@ -5816,15 +5826,15 @@ class Pn {
|
|
|
5816
5826
|
switch (e) {
|
|
5817
5827
|
case "signInViaPopup":
|
|
5818
5828
|
case "signInViaRedirect":
|
|
5819
|
-
return
|
|
5829
|
+
return Ns;
|
|
5820
5830
|
case "linkViaPopup":
|
|
5821
5831
|
case "linkViaRedirect":
|
|
5822
|
-
return
|
|
5832
|
+
return Ms;
|
|
5823
5833
|
case "reauthViaPopup":
|
|
5824
5834
|
case "reauthViaRedirect":
|
|
5825
|
-
return
|
|
5835
|
+
return Ls;
|
|
5826
5836
|
default:
|
|
5827
|
-
|
|
5837
|
+
S(
|
|
5828
5838
|
this.auth,
|
|
5829
5839
|
"internal-error"
|
|
5830
5840
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -5832,10 +5842,10 @@ class Pn {
|
|
|
5832
5842
|
}
|
|
5833
5843
|
}
|
|
5834
5844
|
resolve(e) {
|
|
5835
|
-
|
|
5845
|
+
k(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
5836
5846
|
}
|
|
5837
5847
|
reject(e) {
|
|
5838
|
-
|
|
5848
|
+
k(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
5839
5849
|
}
|
|
5840
5850
|
unregisterAndCleanUp() {
|
|
5841
5851
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -5857,14 +5867,14 @@ class Pn {
|
|
|
5857
5867
|
* See the License for the specific language governing permissions and
|
|
5858
5868
|
* limitations under the License.
|
|
5859
5869
|
*/
|
|
5860
|
-
const
|
|
5870
|
+
const Us = new te(2e3, 1e4);
|
|
5861
5871
|
class B extends Pn {
|
|
5862
5872
|
constructor(e, t, r, i, s) {
|
|
5863
5873
|
super(e, t, i, s), this.provider = r, this.authWindow = null, this.pollId = null, B.currentPopupAction && B.currentPopupAction.cancel(), B.currentPopupAction = this;
|
|
5864
5874
|
}
|
|
5865
5875
|
async executeNotNull() {
|
|
5866
5876
|
const e = await this.execute();
|
|
5867
|
-
return
|
|
5877
|
+
return h(
|
|
5868
5878
|
e,
|
|
5869
5879
|
this.auth,
|
|
5870
5880
|
"internal-error"
|
|
@@ -5872,7 +5882,7 @@ class B extends Pn {
|
|
|
5872
5882
|
), e;
|
|
5873
5883
|
}
|
|
5874
5884
|
async onExecution() {
|
|
5875
|
-
|
|
5885
|
+
k(this.filter.length === 1, "Popup operations only handle one event");
|
|
5876
5886
|
const e = Ze();
|
|
5877
5887
|
this.authWindow = await this.resolver._openPopup(
|
|
5878
5888
|
this.auth,
|
|
@@ -5921,7 +5931,7 @@ class B extends Pn {
|
|
|
5921
5931
|
);
|
|
5922
5932
|
return;
|
|
5923
5933
|
}
|
|
5924
|
-
this.pollId = window.setTimeout(e,
|
|
5934
|
+
this.pollId = window.setTimeout(e, Us.get());
|
|
5925
5935
|
};
|
|
5926
5936
|
e();
|
|
5927
5937
|
}
|
|
@@ -5943,8 +5953,8 @@ B.currentPopupAction = null;
|
|
|
5943
5953
|
* See the License for the specific language governing permissions and
|
|
5944
5954
|
* limitations under the License.
|
|
5945
5955
|
*/
|
|
5946
|
-
const
|
|
5947
|
-
class
|
|
5956
|
+
const xs = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
5957
|
+
class Fs extends Pn {
|
|
5948
5958
|
constructor(e, t, r = !1) {
|
|
5949
5959
|
super(e, [
|
|
5950
5960
|
"signInViaRedirect",
|
|
@@ -5962,7 +5972,7 @@ class Us extends Pn {
|
|
|
5962
5972
|
let e = oe.get(this.auth._key());
|
|
5963
5973
|
if (!e) {
|
|
5964
5974
|
try {
|
|
5965
|
-
const r = await
|
|
5975
|
+
const r = await Bs(this.resolver, this.auth) ? await super.execute() : null;
|
|
5966
5976
|
e = () => Promise.resolve(r);
|
|
5967
5977
|
} catch (t) {
|
|
5968
5978
|
e = () => Promise.reject(t);
|
|
@@ -5990,26 +6000,26 @@ class Us extends Pn {
|
|
|
5990
6000
|
cleanUp() {
|
|
5991
6001
|
}
|
|
5992
6002
|
}
|
|
5993
|
-
async function
|
|
5994
|
-
const t =
|
|
6003
|
+
async function Bs(n, e) {
|
|
6004
|
+
const t = Vs(e), r = Hs(n);
|
|
5995
6005
|
if (!await r._isAvailable())
|
|
5996
6006
|
return !1;
|
|
5997
6007
|
const i = await r._get(t) === "true";
|
|
5998
6008
|
return await r._remove(t), i;
|
|
5999
6009
|
}
|
|
6000
|
-
function
|
|
6010
|
+
function $s(n, e) {
|
|
6001
6011
|
oe.set(n._key(), e);
|
|
6002
6012
|
}
|
|
6003
|
-
function
|
|
6004
|
-
return
|
|
6013
|
+
function Hs(n) {
|
|
6014
|
+
return E(n._redirectPersistence);
|
|
6005
6015
|
}
|
|
6006
|
-
function
|
|
6007
|
-
return ae(
|
|
6016
|
+
function Vs(n) {
|
|
6017
|
+
return ae(xs, n.config.apiKey, n.name);
|
|
6008
6018
|
}
|
|
6009
|
-
async function
|
|
6010
|
-
if (
|
|
6011
|
-
return Promise.reject(
|
|
6012
|
-
const r =
|
|
6019
|
+
async function js(n, e, t = !1) {
|
|
6020
|
+
if (b(n.app))
|
|
6021
|
+
return Promise.reject(L(n));
|
|
6022
|
+
const r = be(n), i = Ds(r, e), a = await new Fs(r, i, t).execute();
|
|
6013
6023
|
return a && !t && (delete a.user._redirectEventId, await r._persistUserIfCurrent(a.user), await r._setRedirectUser(null, e)), a;
|
|
6014
6024
|
}
|
|
6015
6025
|
/**
|
|
@@ -6028,8 +6038,8 @@ async function Hs(n, e, t = !1) {
|
|
|
6028
6038
|
* See the License for the specific language governing permissions and
|
|
6029
6039
|
* limitations under the License.
|
|
6030
6040
|
*/
|
|
6031
|
-
const
|
|
6032
|
-
class
|
|
6041
|
+
const Ws = 10 * 60 * 1e3;
|
|
6042
|
+
class zs {
|
|
6033
6043
|
constructor(e) {
|
|
6034
6044
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
6035
6045
|
}
|
|
@@ -6045,7 +6055,7 @@ class js {
|
|
|
6045
6055
|
let t = !1;
|
|
6046
6056
|
return this.consumers.forEach((r) => {
|
|
6047
6057
|
this.isEventForConsumer(e, r) && (t = !0, this.sendToConsumer(e, r), this.saveEventToCache(e));
|
|
6048
|
-
}), this.hasHandledPotentialRedirect || !
|
|
6058
|
+
}), this.hasHandledPotentialRedirect || !Gs(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
6049
6059
|
}
|
|
6050
6060
|
sendToConsumer(e, t) {
|
|
6051
6061
|
var r;
|
|
@@ -6060,7 +6070,7 @@ class js {
|
|
|
6060
6070
|
return t.filter.includes(e.type) && r;
|
|
6061
6071
|
}
|
|
6062
6072
|
hasEventBeenHandled(e) {
|
|
6063
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
6073
|
+
return Date.now() - this.lastProcessedEventTime >= Ws && this.cachedEventUids.clear(), this.cachedEventUids.has(At(e));
|
|
6064
6074
|
}
|
|
6065
6075
|
saveEventToCache(e) {
|
|
6066
6076
|
this.cachedEventUids.add(At(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -6072,7 +6082,7 @@ function At(n) {
|
|
|
6072
6082
|
function On({ type: n, error: e }) {
|
|
6073
6083
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
6074
6084
|
}
|
|
6075
|
-
function
|
|
6085
|
+
function Gs(n) {
|
|
6076
6086
|
switch (n.type) {
|
|
6077
6087
|
case "signInViaRedirect":
|
|
6078
6088
|
case "linkViaRedirect":
|
|
@@ -6100,7 +6110,7 @@ function Ws(n) {
|
|
|
6100
6110
|
* See the License for the specific language governing permissions and
|
|
6101
6111
|
* limitations under the License.
|
|
6102
6112
|
*/
|
|
6103
|
-
async function
|
|
6113
|
+
async function qs(n, e = {}) {
|
|
6104
6114
|
return G(n, "GET", "/v1/projects", e);
|
|
6105
6115
|
}
|
|
6106
6116
|
/**
|
|
@@ -6119,32 +6129,32 @@ async function zs(n, e = {}) {
|
|
|
6119
6129
|
* See the License for the specific language governing permissions and
|
|
6120
6130
|
* limitations under the License.
|
|
6121
6131
|
*/
|
|
6122
|
-
const
|
|
6123
|
-
async function
|
|
6132
|
+
const Ks = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Js = /^https?/;
|
|
6133
|
+
async function Ys(n) {
|
|
6124
6134
|
if (n.config.emulator)
|
|
6125
6135
|
return;
|
|
6126
|
-
const { authorizedDomains: e } = await
|
|
6136
|
+
const { authorizedDomains: e } = await qs(n);
|
|
6127
6137
|
for (const t of e)
|
|
6128
6138
|
try {
|
|
6129
|
-
if (
|
|
6139
|
+
if (Xs(t))
|
|
6130
6140
|
return;
|
|
6131
6141
|
} catch {
|
|
6132
6142
|
}
|
|
6133
|
-
|
|
6143
|
+
S(
|
|
6134
6144
|
n,
|
|
6135
6145
|
"unauthorized-domain"
|
|
6136
6146
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
6137
6147
|
);
|
|
6138
6148
|
}
|
|
6139
|
-
function
|
|
6140
|
-
const e =
|
|
6149
|
+
function Xs(n) {
|
|
6150
|
+
const e = He(), { protocol: t, hostname: r } = new URL(e);
|
|
6141
6151
|
if (n.startsWith("chrome-extension://")) {
|
|
6142
6152
|
const a = new URL(n);
|
|
6143
6153
|
return a.hostname === "" && r === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && a.hostname === r;
|
|
6144
6154
|
}
|
|
6145
|
-
if (!
|
|
6155
|
+
if (!Js.test(t))
|
|
6146
6156
|
return !1;
|
|
6147
|
-
if (
|
|
6157
|
+
if (Ks.test(n))
|
|
6148
6158
|
return r === n;
|
|
6149
6159
|
const i = n.replace(/\./g, "\\.");
|
|
6150
6160
|
return new RegExp("^(.+\\." + i + "|" + i + ")$", "i").test(r);
|
|
@@ -6165,7 +6175,7 @@ function Js(n) {
|
|
|
6165
6175
|
* See the License for the specific language governing permissions and
|
|
6166
6176
|
* limitations under the License.
|
|
6167
6177
|
*/
|
|
6168
|
-
const
|
|
6178
|
+
const Qs = new te(3e4, 6e4);
|
|
6169
6179
|
function Rt() {
|
|
6170
6180
|
const n = y().___jsl;
|
|
6171
6181
|
if (n != null && n.H) {
|
|
@@ -6175,7 +6185,7 @@ function Rt() {
|
|
|
6175
6185
|
n.CP[t] = null;
|
|
6176
6186
|
}
|
|
6177
6187
|
}
|
|
6178
|
-
function
|
|
6188
|
+
function Zs(n) {
|
|
6179
6189
|
return new Promise((e, t) => {
|
|
6180
6190
|
var r, i, s;
|
|
6181
6191
|
function a() {
|
|
@@ -6190,7 +6200,7 @@ function Xs(n) {
|
|
|
6190
6200
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6191
6201
|
));
|
|
6192
6202
|
},
|
|
6193
|
-
timeout:
|
|
6203
|
+
timeout: Qs.get()
|
|
6194
6204
|
});
|
|
6195
6205
|
}
|
|
6196
6206
|
if (!((i = (r = y().gapi) === null || r === void 0 ? void 0 : r.iframes) === null || i === void 0) && i.Iframe)
|
|
@@ -6198,22 +6208,22 @@ function Xs(n) {
|
|
|
6198
6208
|
else if (!((s = y().gapi) === null || s === void 0) && s.load)
|
|
6199
6209
|
a();
|
|
6200
6210
|
else {
|
|
6201
|
-
const c =
|
|
6211
|
+
const c = rs("iframefcb");
|
|
6202
6212
|
return y()[c] = () => {
|
|
6203
6213
|
gapi.load ? a() : t(_(
|
|
6204
6214
|
n,
|
|
6205
6215
|
"network-request-failed"
|
|
6206
6216
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6207
6217
|
));
|
|
6208
|
-
},
|
|
6218
|
+
}, ts(`${ns()}?onload=${c}`).catch((o) => t(o));
|
|
6209
6219
|
}
|
|
6210
6220
|
}).catch((e) => {
|
|
6211
6221
|
throw ce = null, e;
|
|
6212
6222
|
});
|
|
6213
6223
|
}
|
|
6214
6224
|
let ce = null;
|
|
6215
|
-
function
|
|
6216
|
-
return ce = ce ||
|
|
6225
|
+
function ea(n) {
|
|
6226
|
+
return ce = ce || Zs(n), ce;
|
|
6217
6227
|
}
|
|
6218
6228
|
/**
|
|
6219
6229
|
* @license
|
|
@@ -6231,7 +6241,7 @@ function Qs(n) {
|
|
|
6231
6241
|
* See the License for the specific language governing permissions and
|
|
6232
6242
|
* limitations under the License.
|
|
6233
6243
|
*/
|
|
6234
|
-
const
|
|
6244
|
+
const ta = new te(5e3, 15e3), na = "__/auth/iframe", ra = "emulator/auth/iframe", ia = {
|
|
6235
6245
|
style: {
|
|
6236
6246
|
position: "absolute",
|
|
6237
6247
|
top: "-100px",
|
|
@@ -6240,41 +6250,41 @@ const Zs = new te(5e3, 15e3), ea = "__/auth/iframe", ta = "emulator/auth/iframe"
|
|
|
6240
6250
|
},
|
|
6241
6251
|
"aria-hidden": "true",
|
|
6242
6252
|
tabindex: "-1"
|
|
6243
|
-
},
|
|
6253
|
+
}, sa = /* @__PURE__ */ new Map([
|
|
6244
6254
|
["identitytoolkit.googleapis.com", "p"],
|
|
6245
6255
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
6246
6256
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
6247
6257
|
// test
|
|
6248
6258
|
]);
|
|
6249
|
-
function
|
|
6259
|
+
function aa(n) {
|
|
6250
6260
|
const e = n.config;
|
|
6251
|
-
|
|
6261
|
+
h(
|
|
6252
6262
|
e.authDomain,
|
|
6253
6263
|
n,
|
|
6254
6264
|
"auth-domain-config-required"
|
|
6255
6265
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
6256
6266
|
);
|
|
6257
|
-
const t = e.emulator ? Je(e,
|
|
6267
|
+
const t = e.emulator ? Je(e, ra) : `https://${n.config.authDomain}/${na}`, r = {
|
|
6258
6268
|
apiKey: e.apiKey,
|
|
6259
6269
|
appName: n.name,
|
|
6260
6270
|
v: ee
|
|
6261
|
-
}, i =
|
|
6271
|
+
}, i = sa.get(n.config.apiHost);
|
|
6262
6272
|
i && (r.eid = i);
|
|
6263
6273
|
const s = n._getFrameworks();
|
|
6264
6274
|
return s.length && (r.fw = s.join(",")), `${t}?${Z(r).slice(1)}`;
|
|
6265
6275
|
}
|
|
6266
|
-
async function
|
|
6267
|
-
const e = await
|
|
6268
|
-
return
|
|
6276
|
+
async function oa(n) {
|
|
6277
|
+
const e = await ea(n), t = y().gapi;
|
|
6278
|
+
return h(
|
|
6269
6279
|
t,
|
|
6270
6280
|
n,
|
|
6271
6281
|
"internal-error"
|
|
6272
6282
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
6273
6283
|
), e.open({
|
|
6274
6284
|
where: document.body,
|
|
6275
|
-
url:
|
|
6285
|
+
url: aa(n),
|
|
6276
6286
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
6277
|
-
attributes:
|
|
6287
|
+
attributes: ia,
|
|
6278
6288
|
dontclear: !0
|
|
6279
6289
|
}, (r) => new Promise(async (i, s) => {
|
|
6280
6290
|
await r.restyle({
|
|
@@ -6287,7 +6297,7 @@ async function sa(n) {
|
|
|
6287
6297
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6288
6298
|
), c = y().setTimeout(() => {
|
|
6289
6299
|
s(a);
|
|
6290
|
-
},
|
|
6300
|
+
}, ta.get());
|
|
6291
6301
|
function o() {
|
|
6292
6302
|
y().clearTimeout(c), i(r);
|
|
6293
6303
|
}
|
|
@@ -6312,12 +6322,12 @@ async function sa(n) {
|
|
|
6312
6322
|
* See the License for the specific language governing permissions and
|
|
6313
6323
|
* limitations under the License.
|
|
6314
6324
|
*/
|
|
6315
|
-
const
|
|
6325
|
+
const ca = {
|
|
6316
6326
|
location: "yes",
|
|
6317
6327
|
resizable: "yes",
|
|
6318
6328
|
statusbar: "yes",
|
|
6319
6329
|
toolbar: "no"
|
|
6320
|
-
},
|
|
6330
|
+
}, la = 500, ua = 600, da = "_blank", ha = "http://localhost";
|
|
6321
6331
|
class Ct {
|
|
6322
6332
|
constructor(e) {
|
|
6323
6333
|
this.window = e, this.associatedEvent = null;
|
|
@@ -6330,33 +6340,33 @@ class Ct {
|
|
|
6330
6340
|
}
|
|
6331
6341
|
}
|
|
6332
6342
|
}
|
|
6333
|
-
function
|
|
6343
|
+
function fa(n, e, t, r = la, i = ua) {
|
|
6334
6344
|
const s = Math.max((window.screen.availHeight - i) / 2, 0).toString(), a = Math.max((window.screen.availWidth - r) / 2, 0).toString();
|
|
6335
6345
|
let c = "";
|
|
6336
|
-
const o = Object.assign(Object.assign({},
|
|
6346
|
+
const o = Object.assign(Object.assign({}, ca), {
|
|
6337
6347
|
width: r.toString(),
|
|
6338
6348
|
height: i.toString(),
|
|
6339
6349
|
top: s,
|
|
6340
6350
|
left: a
|
|
6341
|
-
}),
|
|
6342
|
-
t && (c = dn(
|
|
6343
|
-
const
|
|
6344
|
-
if (
|
|
6345
|
-
return
|
|
6346
|
-
const
|
|
6347
|
-
|
|
6348
|
-
|
|
6351
|
+
}), u = m().toLowerCase();
|
|
6352
|
+
t && (c = dn(u) ? da : t), ln(u) && (e = e || ha, o.scrollbars = "yes");
|
|
6353
|
+
const l = Object.entries(o).reduce((f, [g, v]) => `${f}${g}=${v},`, "");
|
|
6354
|
+
if (qi(u) && c !== "_self")
|
|
6355
|
+
return pa(e || "", c), new Ct(null);
|
|
6356
|
+
const d = window.open(e || "", c, l);
|
|
6357
|
+
h(
|
|
6358
|
+
d,
|
|
6349
6359
|
n,
|
|
6350
6360
|
"popup-blocked"
|
|
6351
6361
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
6352
6362
|
);
|
|
6353
6363
|
try {
|
|
6354
|
-
|
|
6364
|
+
d.focus();
|
|
6355
6365
|
} catch {
|
|
6356
6366
|
}
|
|
6357
|
-
return new Ct(
|
|
6367
|
+
return new Ct(d);
|
|
6358
6368
|
}
|
|
6359
|
-
function
|
|
6369
|
+
function pa(n, e) {
|
|
6360
6370
|
const t = document.createElement("a");
|
|
6361
6371
|
t.href = n, t.target = e;
|
|
6362
6372
|
const r = document.createEvent("MouseEvent");
|
|
@@ -6378,14 +6388,14 @@ function ha(n, e) {
|
|
|
6378
6388
|
* See the License for the specific language governing permissions and
|
|
6379
6389
|
* limitations under the License.
|
|
6380
6390
|
*/
|
|
6381
|
-
const
|
|
6391
|
+
const ma = "__/auth/handler", ga = "emulator/auth/handler", _a = encodeURIComponent("fac");
|
|
6382
6392
|
async function Pt(n, e, t, r, i, s) {
|
|
6383
|
-
|
|
6393
|
+
h(
|
|
6384
6394
|
n.config.authDomain,
|
|
6385
6395
|
n,
|
|
6386
6396
|
"auth-domain-config-required"
|
|
6387
6397
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
6388
|
-
),
|
|
6398
|
+
), h(
|
|
6389
6399
|
n.config.apiKey,
|
|
6390
6400
|
n,
|
|
6391
6401
|
"invalid-api-key"
|
|
@@ -6400,23 +6410,23 @@ async function Pt(n, e, t, r, i, s) {
|
|
|
6400
6410
|
eventId: i
|
|
6401
6411
|
};
|
|
6402
6412
|
if (e instanceof bn) {
|
|
6403
|
-
e.setDefaultLanguage(n.languageCode), a.providerId = e.providerId || "",
|
|
6404
|
-
for (const [
|
|
6405
|
-
a[
|
|
6413
|
+
e.setDefaultLanguage(n.languageCode), a.providerId = e.providerId || "", _r(e.getCustomParameters()) || (a.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
6414
|
+
for (const [l, d] of Object.entries({}))
|
|
6415
|
+
a[l] = d;
|
|
6406
6416
|
}
|
|
6407
6417
|
if (e instanceof ne) {
|
|
6408
|
-
const
|
|
6409
|
-
|
|
6418
|
+
const l = e.getScopes().filter((d) => d !== "");
|
|
6419
|
+
l.length > 0 && (a.scopes = l.join(","));
|
|
6410
6420
|
}
|
|
6411
6421
|
n.tenantId && (a.tid = n.tenantId);
|
|
6412
6422
|
const c = a;
|
|
6413
|
-
for (const
|
|
6414
|
-
c[
|
|
6415
|
-
const o = await n._getAppCheckToken(),
|
|
6416
|
-
return `${
|
|
6423
|
+
for (const l of Object.keys(c))
|
|
6424
|
+
c[l] === void 0 && delete c[l];
|
|
6425
|
+
const o = await n._getAppCheckToken(), u = o ? `#${_a}=${encodeURIComponent(o)}` : "";
|
|
6426
|
+
return `${ya(n)}?${Z(c).slice(1)}${u}`;
|
|
6417
6427
|
}
|
|
6418
|
-
function
|
|
6419
|
-
return n.emulator ? Je(n,
|
|
6428
|
+
function ya({ config: n }) {
|
|
6429
|
+
return n.emulator ? Je(n, ga) : `https://${n.authDomain}/${ma}`;
|
|
6420
6430
|
}
|
|
6421
6431
|
/**
|
|
6422
6432
|
* @license
|
|
@@ -6434,30 +6444,30 @@ function ga({ config: n }) {
|
|
|
6434
6444
|
* See the License for the specific language governing permissions and
|
|
6435
6445
|
* limitations under the License.
|
|
6436
6446
|
*/
|
|
6437
|
-
const
|
|
6438
|
-
class
|
|
6447
|
+
const Ne = "webStorageSupport";
|
|
6448
|
+
class va {
|
|
6439
6449
|
constructor() {
|
|
6440
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Sn, this._completeRedirectFn =
|
|
6450
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Sn, this._completeRedirectFn = js, this._overrideRedirectResult = $s;
|
|
6441
6451
|
}
|
|
6442
6452
|
// Wrapping in async even though we don't await anywhere in order
|
|
6443
6453
|
// to make sure errors are raised as promise rejections
|
|
6444
6454
|
async _openPopup(e, t, r, i) {
|
|
6445
6455
|
var s;
|
|
6446
|
-
|
|
6447
|
-
const a = await Pt(e, t, r,
|
|
6448
|
-
return
|
|
6456
|
+
k((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
6457
|
+
const a = await Pt(e, t, r, He(), i);
|
|
6458
|
+
return fa(e, a, Ze());
|
|
6449
6459
|
}
|
|
6450
6460
|
async _openRedirect(e, t, r, i) {
|
|
6451
6461
|
await this._originValidation(e);
|
|
6452
|
-
const s = await Pt(e, t, r,
|
|
6453
|
-
return
|
|
6462
|
+
const s = await Pt(e, t, r, He(), i);
|
|
6463
|
+
return ws(s), new Promise(() => {
|
|
6454
6464
|
});
|
|
6455
6465
|
}
|
|
6456
6466
|
_initialize(e) {
|
|
6457
6467
|
const t = e._key();
|
|
6458
6468
|
if (this.eventManagers[t]) {
|
|
6459
6469
|
const { manager: i, promise: s } = this.eventManagers[t];
|
|
6460
|
-
return i ? Promise.resolve(i) : (
|
|
6470
|
+
return i ? Promise.resolve(i) : (k(s, "If manager is not set, promise should be"), s);
|
|
6461
6471
|
}
|
|
6462
6472
|
const r = this.initAndGetManager(e);
|
|
6463
6473
|
return this.eventManagers[t] = { promise: r }, r.catch(() => {
|
|
@@ -6465,8 +6475,8 @@ class _a {
|
|
|
6465
6475
|
}), r;
|
|
6466
6476
|
}
|
|
6467
6477
|
async initAndGetManager(e) {
|
|
6468
|
-
const t = await
|
|
6469
|
-
return t.register("authEvent", (i) => (
|
|
6478
|
+
const t = await oa(e), r = new zs(e);
|
|
6479
|
+
return t.register("authEvent", (i) => (h(
|
|
6470
6480
|
i == null ? void 0 : i.authEvent,
|
|
6471
6481
|
e,
|
|
6472
6482
|
"invalid-auth-event"
|
|
@@ -6477,10 +6487,10 @@ class _a {
|
|
|
6477
6487
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: r }, this.iframes[e._key()] = t, r;
|
|
6478
6488
|
}
|
|
6479
6489
|
_isIframeWebStorageSupported(e, t) {
|
|
6480
|
-
this.iframes[e._key()].send(
|
|
6490
|
+
this.iframes[e._key()].send(Ne, { type: Ne }, (i) => {
|
|
6481
6491
|
var s;
|
|
6482
|
-
const a = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[
|
|
6483
|
-
a !== void 0 && t(!!a),
|
|
6492
|
+
const a = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
6493
|
+
a !== void 0 && t(!!a), S(
|
|
6484
6494
|
e,
|
|
6485
6495
|
"internal-error"
|
|
6486
6496
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -6489,13 +6499,13 @@ class _a {
|
|
|
6489
6499
|
}
|
|
6490
6500
|
_originValidation(e) {
|
|
6491
6501
|
const t = e._key();
|
|
6492
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
6502
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Ys(e)), this.originValidationPromises[t];
|
|
6493
6503
|
}
|
|
6494
6504
|
get _shouldInitProactively() {
|
|
6495
6505
|
return gn() || un() || Xe();
|
|
6496
6506
|
}
|
|
6497
6507
|
}
|
|
6498
|
-
const
|
|
6508
|
+
const ba = va;
|
|
6499
6509
|
var Ot = "@firebase/auth", Dt = "1.7.9";
|
|
6500
6510
|
/**
|
|
6501
6511
|
* @license
|
|
@@ -6513,7 +6523,7 @@ var Ot = "@firebase/auth", Dt = "1.7.9";
|
|
|
6513
6523
|
* See the License for the specific language governing permissions and
|
|
6514
6524
|
* limitations under the License.
|
|
6515
6525
|
*/
|
|
6516
|
-
class
|
|
6526
|
+
class Ia {
|
|
6517
6527
|
constructor(e) {
|
|
6518
6528
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
6519
6529
|
}
|
|
@@ -6538,7 +6548,7 @@ class va {
|
|
|
6538
6548
|
t && (this.internalListeners.delete(e), t(), this.updateProactiveRefresh());
|
|
6539
6549
|
}
|
|
6540
6550
|
assertAuthConfigured() {
|
|
6541
|
-
|
|
6551
|
+
h(
|
|
6542
6552
|
this.auth._initializationPromise,
|
|
6543
6553
|
"dependent-sdk-initialized-before-auth"
|
|
6544
6554
|
/* AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH */
|
|
@@ -6564,7 +6574,7 @@ class va {
|
|
|
6564
6574
|
* See the License for the specific language governing permissions and
|
|
6565
6575
|
* limitations under the License.
|
|
6566
6576
|
*/
|
|
6567
|
-
function
|
|
6577
|
+
function wa(n) {
|
|
6568
6578
|
switch (n) {
|
|
6569
6579
|
case "Node":
|
|
6570
6580
|
return "node";
|
|
@@ -6580,12 +6590,12 @@ function ba(n) {
|
|
|
6580
6590
|
return;
|
|
6581
6591
|
}
|
|
6582
6592
|
}
|
|
6583
|
-
function
|
|
6593
|
+
function Ea(n) {
|
|
6584
6594
|
J(new W(
|
|
6585
6595
|
"auth",
|
|
6586
6596
|
(e, { options: t }) => {
|
|
6587
6597
|
const r = e.getProvider("app").getImmediate(), i = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: a, authDomain: c } = r.options;
|
|
6588
|
-
|
|
6598
|
+
h(a && !a.includes(":"), "invalid-api-key", { appName: r.name });
|
|
6589
6599
|
const o = {
|
|
6590
6600
|
apiKey: a,
|
|
6591
6601
|
authDomain: c,
|
|
@@ -6594,8 +6604,8 @@ function Ia(n) {
|
|
|
6594
6604
|
tokenApiHost: "securetoken.googleapis.com",
|
|
6595
6605
|
apiScheme: "https",
|
|
6596
6606
|
sdkClientVersion: _n(n)
|
|
6597
|
-
},
|
|
6598
|
-
return
|
|
6607
|
+
}, u = new Zi(r, i, s, o);
|
|
6608
|
+
return ss(u, t), u;
|
|
6599
6609
|
},
|
|
6600
6610
|
"PUBLIC"
|
|
6601
6611
|
/* ComponentType.PUBLIC */
|
|
@@ -6610,18 +6620,18 @@ function Ia(n) {
|
|
|
6610
6620
|
})), J(new W(
|
|
6611
6621
|
"auth-internal",
|
|
6612
6622
|
(e) => {
|
|
6613
|
-
const t =
|
|
6623
|
+
const t = be(e.getProvider(
|
|
6614
6624
|
"auth"
|
|
6615
6625
|
/* _ComponentName.AUTH */
|
|
6616
6626
|
).getImmediate());
|
|
6617
|
-
return ((r) => new
|
|
6627
|
+
return ((r) => new Ia(r))(t);
|
|
6618
6628
|
},
|
|
6619
6629
|
"PRIVATE"
|
|
6620
6630
|
/* ComponentType.PRIVATE */
|
|
6621
6631
|
).setInstantiationMode(
|
|
6622
6632
|
"EXPLICIT"
|
|
6623
6633
|
/* InstantiationMode.EXPLICIT */
|
|
6624
|
-
)), $(Ot, Dt,
|
|
6634
|
+
)), $(Ot, Dt, wa(n)), $(Ot, Dt, "esm2017");
|
|
6625
6635
|
}
|
|
6626
6636
|
/**
|
|
6627
6637
|
* @license
|
|
@@ -6639,11 +6649,11 @@ function Ia(n) {
|
|
|
6639
6649
|
* See the License for the specific language governing permissions and
|
|
6640
6650
|
* limitations under the License.
|
|
6641
6651
|
*/
|
|
6642
|
-
const
|
|
6652
|
+
const Ta = 5 * 60, Sa = Wt("authIdTokenMaxAge") || Ta;
|
|
6643
6653
|
let Nt = null;
|
|
6644
|
-
const
|
|
6654
|
+
const ka = (n) => async (e) => {
|
|
6645
6655
|
const t = e && await e.getIdTokenResult(), r = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
6646
|
-
if (r && r >
|
|
6656
|
+
if (r && r > Sa)
|
|
6647
6657
|
return;
|
|
6648
6658
|
const i = t == null ? void 0 : t.token;
|
|
6649
6659
|
Nt !== i && (Nt = i, await fetch(n, {
|
|
@@ -6653,33 +6663,33 @@ const Ta = (n) => async (e) => {
|
|
|
6653
6663
|
} : {}
|
|
6654
6664
|
}));
|
|
6655
6665
|
};
|
|
6656
|
-
function
|
|
6666
|
+
function Aa(n = vi()) {
|
|
6657
6667
|
const e = Kt(n, "auth");
|
|
6658
6668
|
if (e.isInitialized())
|
|
6659
6669
|
return e.getImmediate();
|
|
6660
|
-
const t =
|
|
6661
|
-
popupRedirectResolver:
|
|
6670
|
+
const t = is(n, {
|
|
6671
|
+
popupRedirectResolver: ba,
|
|
6662
6672
|
persistence: [
|
|
6663
|
-
|
|
6664
|
-
|
|
6673
|
+
Os,
|
|
6674
|
+
vs,
|
|
6665
6675
|
Sn
|
|
6666
6676
|
]
|
|
6667
6677
|
}), r = Wt("authTokenSyncURL");
|
|
6668
6678
|
if (r && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
6669
6679
|
const s = new URL(r, location.origin);
|
|
6670
6680
|
if (location.origin === s.origin) {
|
|
6671
|
-
const a =
|
|
6672
|
-
|
|
6681
|
+
const a = ka(s.toString());
|
|
6682
|
+
gs(t, a, () => a(t.currentUser)), ms(t, (c) => a(c));
|
|
6673
6683
|
}
|
|
6674
6684
|
}
|
|
6675
6685
|
const i = Vt("auth");
|
|
6676
|
-
return i &&
|
|
6686
|
+
return i && as(t, `http://${i}`), t;
|
|
6677
6687
|
}
|
|
6678
|
-
function
|
|
6688
|
+
function Ra() {
|
|
6679
6689
|
var n, e;
|
|
6680
6690
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
6681
6691
|
}
|
|
6682
|
-
|
|
6692
|
+
es({
|
|
6683
6693
|
loadJS(n) {
|
|
6684
6694
|
return new Promise((e, t) => {
|
|
6685
6695
|
const r = document.createElement("script");
|
|
@@ -6689,21 +6699,21 @@ Qi({
|
|
|
6689
6699
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
6690
6700
|
);
|
|
6691
6701
|
s.customData = i, t(s);
|
|
6692
|
-
}, r.type = "text/javascript", r.charset = "UTF-8",
|
|
6702
|
+
}, r.type = "text/javascript", r.charset = "UTF-8", Ra().appendChild(r);
|
|
6693
6703
|
});
|
|
6694
6704
|
},
|
|
6695
6705
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
6696
6706
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
6697
6707
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
6698
6708
|
});
|
|
6699
|
-
|
|
6709
|
+
Ea(
|
|
6700
6710
|
"Browser"
|
|
6701
6711
|
/* ClientPlatform.BROWSER */
|
|
6702
6712
|
);
|
|
6703
|
-
const
|
|
6713
|
+
const Ca = Ln({
|
|
6704
6714
|
history: Mn(),
|
|
6705
6715
|
routes: [
|
|
6706
|
-
...
|
|
6716
|
+
...ue,
|
|
6707
6717
|
...le,
|
|
6708
6718
|
{
|
|
6709
6719
|
path: "/forbidden",
|
|
@@ -6712,91 +6722,111 @@ const Aa = Ln({
|
|
|
6712
6722
|
}
|
|
6713
6723
|
]
|
|
6714
6724
|
});
|
|
6715
|
-
let
|
|
6716
|
-
|
|
6725
|
+
let Le, Me;
|
|
6726
|
+
Ca.beforeEach(async (n) => {
|
|
6717
6727
|
const {
|
|
6718
6728
|
sessionUser: e,
|
|
6719
6729
|
currentRestaurant: t,
|
|
6720
6730
|
currentBusiness: r,
|
|
6721
6731
|
readRestaurants: i,
|
|
6722
6732
|
changeRestaurant: s
|
|
6723
|
-
} =
|
|
6733
|
+
} = We();
|
|
6724
6734
|
if (n.name.startsWith("mf-payment-admin")) {
|
|
6725
6735
|
if (!e.value) {
|
|
6726
|
-
|
|
6727
|
-
const o = q(e, (
|
|
6728
|
-
var
|
|
6729
|
-
|
|
6730
|
-
(((
|
|
6736
|
+
Le || (Le = new Promise((c) => {
|
|
6737
|
+
const o = q(e, (u) => {
|
|
6738
|
+
var l, d;
|
|
6739
|
+
u && (o(), c(
|
|
6740
|
+
(((l = e.value) == null ? void 0 : l.role.isStaff) || ((d = e.value) == null ? void 0 : d.role.isAdmin)) ?? !1
|
|
6731
6741
|
));
|
|
6732
6742
|
});
|
|
6733
6743
|
}));
|
|
6734
|
-
const a = await
|
|
6744
|
+
const a = await Le;
|
|
6735
6745
|
return a || { name: "mf-payment-forbidden" };
|
|
6736
6746
|
}
|
|
6737
6747
|
return !0;
|
|
6738
6748
|
}
|
|
6739
|
-
return !r.value || !t.value ? (
|
|
6749
|
+
return !r.value || !t.value ? (Me || (Me = Promise.all([
|
|
6740
6750
|
new Promise(async (a) => {
|
|
6741
6751
|
const c = q(r, (o) => {
|
|
6742
6752
|
o && (c(), a(!0));
|
|
6743
6753
|
});
|
|
6744
6754
|
}),
|
|
6745
6755
|
new Promise(async (a) => {
|
|
6746
|
-
const c = q(t, (
|
|
6747
|
-
|
|
6756
|
+
const c = q(t, (u) => {
|
|
6757
|
+
u && (c(), a(!0));
|
|
6748
6758
|
}), o = await i();
|
|
6749
6759
|
await s(o == null ? void 0 : o.at(0));
|
|
6750
6760
|
})
|
|
6751
|
-
]).then((a) => !0)),
|
|
6761
|
+
]).then((a) => !0)), Me) : !0;
|
|
6752
6762
|
});
|
|
6753
|
-
const
|
|
6763
|
+
const Pa = /* @__PURE__ */ Mt({
|
|
6754
6764
|
__name: "AppSidebar",
|
|
6755
6765
|
setup(n) {
|
|
6756
|
-
const e =
|
|
6766
|
+
const e = We(), t = Un(), { t: r } = zn(), i = $n(t.currentRoute.value.name);
|
|
6757
6767
|
q(t.currentRoute, () => {
|
|
6758
6768
|
let l = t.currentRoute.value.name;
|
|
6759
6769
|
t.currentRoute.value.meta.parent && (l = t.currentRoute.value.meta.parent), i.value = l;
|
|
6760
6770
|
});
|
|
6761
|
-
const s =
|
|
6762
|
-
var
|
|
6763
|
-
if (!((
|
|
6771
|
+
const s = ue.map((l) => {
|
|
6772
|
+
var g, v;
|
|
6773
|
+
if (!((g = l.meta) != null && g.sidebarDisplay) || l.meta.region && !((v = l.meta.region) != null && v[e.currentCountry.value]) || l.meta.section)
|
|
6764
6774
|
return;
|
|
6765
|
-
const
|
|
6766
|
-
label:
|
|
6775
|
+
const d = l.meta.sidebarDisplay, f = {
|
|
6776
|
+
label: d.startsWith("i18n:") ? r(d.replaceAll("i18n:", "")) : d,
|
|
6767
6777
|
value: l.name,
|
|
6768
6778
|
action: () => {
|
|
6769
6779
|
if (t.currentRoute.value.name !== l.name)
|
|
6770
6780
|
return t.push({ name: l.name });
|
|
6771
6781
|
}
|
|
6772
6782
|
};
|
|
6773
|
-
return l.meta.sidebarNew && (
|
|
6783
|
+
return l.meta.sidebarNew && (f.badge = () => Hn(qn.FmPill, { label: "New" })), f;
|
|
6774
6784
|
}).filter((l) => !!l), a = le.map((l) => {
|
|
6775
|
-
var
|
|
6776
|
-
if ((
|
|
6785
|
+
var d;
|
|
6786
|
+
if ((d = l.meta) != null && d.sidebarDisplay && !l.meta.section)
|
|
6777
6787
|
return {
|
|
6778
|
-
label: l.meta.sidebarDisplay,
|
|
6788
|
+
label: l.meta.sidebarDisplay.startsWith("i18n:") ? r(l.meta.sidebarDisplay.replaceAll("i18n:", "")) : l.meta.sidebarDisplay,
|
|
6779
6789
|
value: l.name,
|
|
6780
6790
|
action: () => {
|
|
6781
6791
|
if (t.currentRoute.value.name !== l.name)
|
|
6782
6792
|
return t.push({ name: l.name });
|
|
6783
6793
|
}
|
|
6784
6794
|
};
|
|
6785
|
-
}).filter((l) => !!l), c = (l) =>
|
|
6786
|
-
var
|
|
6787
|
-
if ((
|
|
6795
|
+
}).filter((l) => !!l), c = (l) => ue.map((d) => {
|
|
6796
|
+
var f;
|
|
6797
|
+
if ((f = d.meta) != null && f.sidebarDisplay && d.meta.section === l)
|
|
6788
6798
|
return {
|
|
6789
|
-
label:
|
|
6790
|
-
value:
|
|
6799
|
+
label: d.meta.sidebarDisplay.startsWith("i18n:") ? r(d.meta.sidebarDisplay.replaceAll("i18n:", "")) : d.meta.sidebarDisplay,
|
|
6800
|
+
value: d.name,
|
|
6791
6801
|
action: () => {
|
|
6792
|
-
if (t.currentRoute.value.name !==
|
|
6793
|
-
return t.push({ name:
|
|
6802
|
+
if (t.currentRoute.value.name !== d.name)
|
|
6803
|
+
return t.push({ name: d.name });
|
|
6794
6804
|
}
|
|
6795
6805
|
};
|
|
6796
|
-
}).filter((
|
|
6797
|
-
var
|
|
6806
|
+
}).filter((d) => !!d), o = (l) => le.map((d) => {
|
|
6807
|
+
var f;
|
|
6808
|
+
if ((f = d.meta) != null && f.sidebarDisplay && d.meta.section === l)
|
|
6809
|
+
return {
|
|
6810
|
+
label: d.meta.sidebarDisplay,
|
|
6811
|
+
value: d.name,
|
|
6812
|
+
action: () => {
|
|
6813
|
+
if (t.currentRoute.value.name !== d.name)
|
|
6814
|
+
return t.push({ name: d.name });
|
|
6815
|
+
}
|
|
6816
|
+
};
|
|
6817
|
+
}).filter((d) => !!d), u = Lt(() => {
|
|
6818
|
+
var d, f;
|
|
6798
6819
|
const l = [...s];
|
|
6799
|
-
return
|
|
6820
|
+
return l.push({
|
|
6821
|
+
label: "",
|
|
6822
|
+
value: "divider",
|
|
6823
|
+
disabled: !0
|
|
6824
|
+
}), l.push({
|
|
6825
|
+
label: r("financing.title"),
|
|
6826
|
+
icon: "credit_score",
|
|
6827
|
+
value: "divider",
|
|
6828
|
+
disabled: !0
|
|
6829
|
+
}), l.push(...c("financing")), ((d = e.sessionUser.value) != null && d.role.isStaff || (f = e.sessionUser.value) != null && f.role.isAdmin) && (l.push({
|
|
6800
6830
|
label: "",
|
|
6801
6831
|
value: "divider",
|
|
6802
6832
|
disabled: !0
|
|
@@ -6805,7 +6835,7 @@ const Ra = /* @__PURE__ */ Mt({
|
|
|
6805
6835
|
icon: "desktop_windows",
|
|
6806
6836
|
value: "divider",
|
|
6807
6837
|
disabled: !0
|
|
6808
|
-
}), l.push(...
|
|
6838
|
+
}), l.push(...o("device")), l.push({
|
|
6809
6839
|
label: "",
|
|
6810
6840
|
value: "divider",
|
|
6811
6841
|
disabled: !0
|
|
@@ -6814,7 +6844,7 @@ const Ra = /* @__PURE__ */ Mt({
|
|
|
6814
6844
|
icon: "account_balance",
|
|
6815
6845
|
value: "divider",
|
|
6816
6846
|
disabled: !0
|
|
6817
|
-
}), l.push(...
|
|
6847
|
+
}), l.push(...o("payment-gateway")), l.push({
|
|
6818
6848
|
label: "",
|
|
6819
6849
|
value: "divider",
|
|
6820
6850
|
disabled: !0
|
|
@@ -6825,56 +6855,56 @@ const Ra = /* @__PURE__ */ Mt({
|
|
|
6825
6855
|
disabled: !0
|
|
6826
6856
|
}), l.push(...a)), l;
|
|
6827
6857
|
});
|
|
6828
|
-
return (l,
|
|
6829
|
-
const
|
|
6830
|
-
return xt(), Ft(
|
|
6858
|
+
return (l, d) => {
|
|
6859
|
+
const f = Ut("FmCollapsibleTabs");
|
|
6860
|
+
return xt(), Ft(f, {
|
|
6831
6861
|
modelValue: i.value,
|
|
6832
|
-
"onUpdate:modelValue":
|
|
6833
|
-
items:
|
|
6862
|
+
"onUpdate:modelValue": d[0] || (d[0] = (g) => i.value = g),
|
|
6863
|
+
items: u.value,
|
|
6834
6864
|
class: "py-16 px-8 w-[240px]"
|
|
6835
6865
|
}, null, 8, ["modelValue", "items"]);
|
|
6836
6866
|
};
|
|
6837
6867
|
}
|
|
6838
6868
|
});
|
|
6839
|
-
var
|
|
6840
|
-
const
|
|
6869
|
+
var Oa = { 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" };
|
|
6870
|
+
const $a = /* @__PURE__ */ Mt({
|
|
6841
6871
|
__name: "App",
|
|
6842
6872
|
setup(n) {
|
|
6843
|
-
const { state: e } =
|
|
6873
|
+
const { state: e } = Qn(), t = We(), r = xn(), i = Jt(Oa.firebase);
|
|
6844
6874
|
async function s() {
|
|
6845
6875
|
const a = t.sessionUser.value;
|
|
6846
6876
|
if (!a || !a.token) return;
|
|
6847
|
-
const c = await a.getCustomToken(), o =
|
|
6848
|
-
await
|
|
6877
|
+
const c = await a.getCustomToken(), o = Aa(i);
|
|
6878
|
+
await ps(o, c);
|
|
6849
6879
|
}
|
|
6850
|
-
return s(), q(t.sessionUser, s),
|
|
6880
|
+
return s(), q(t.sessionUser, s), Vn(() => {
|
|
6851
6881
|
e.isIframe && parent.postMessage({ event: "ready" }, "*");
|
|
6852
|
-
}),
|
|
6853
|
-
t.registerSidebarComponent(
|
|
6882
|
+
}), jn(() => {
|
|
6883
|
+
t.registerSidebarComponent(Pa);
|
|
6854
6884
|
}), (a, c) => {
|
|
6855
6885
|
const o = Ut("RouterView");
|
|
6856
6886
|
return xt(), Ft(o, {
|
|
6857
|
-
key:
|
|
6887
|
+
key: Wn(r).path
|
|
6858
6888
|
});
|
|
6859
6889
|
};
|
|
6860
6890
|
}
|
|
6861
|
-
}),
|
|
6862
|
-
"en-US":
|
|
6863
|
-
"zh-CN":
|
|
6864
|
-
},
|
|
6891
|
+
}), Ha = {
|
|
6892
|
+
"en-US": Jn,
|
|
6893
|
+
"zh-CN": Xn
|
|
6894
|
+
}, Va = [...le, ...ue];
|
|
6865
6895
|
export {
|
|
6866
6896
|
W as C,
|
|
6867
|
-
|
|
6897
|
+
M as F,
|
|
6868
6898
|
ee as S,
|
|
6869
6899
|
gt as _,
|
|
6870
6900
|
J as a,
|
|
6871
6901
|
Kt as b,
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6902
|
+
Fa as c,
|
|
6903
|
+
vi as d,
|
|
6904
|
+
Ba as e,
|
|
6905
|
+
Va as f,
|
|
6876
6906
|
z as g,
|
|
6877
|
-
|
|
6878
|
-
|
|
6907
|
+
$a as h,
|
|
6908
|
+
Ha as i,
|
|
6879
6909
|
$ as r
|
|
6880
6910
|
};
|