@feedmepos/mf-connect 0.1.37-prod → 0.1.38-beta.1
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/Analytic-O-qZWrFp.js +761 -0
- package/dist/{App-Bpo0XZSs.js → App-BWZ2EE71.js} +364 -352
- package/dist/AuditLogs-DlmcFEta.js +1887 -0
- package/dist/{Bin-ohZ2CZZR.js → Bin-C-Ha-4yF.js} +8 -8
- package/dist/{Broadcast-D5x0_-zC.js → Broadcast-Bo3QS8lS.js} +40 -40
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYb38NXA.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-4vUMzH-l.js} +18 -18
- package/dist/{Card-BM-Lrm5y.js → Card-Bs1TDE0e.js} +159 -159
- package/dist/{Collections-Cr4aoJer.js → Collections-Dy5RN7Js.js} +103 -91
- package/dist/{Credit-DzDVFv4H.js → Credit-Bqc4dw1s.js} +74 -74
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bs8o9n1V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D6AmN3o3.js} +490 -488
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js → EffectSheet.vue_vue_type_style_index_0_lang-BzwADnKp.js} +91 -89
- package/dist/{Experience-CjaDdbvZ.js → Experience-C2e2T7B-.js} +41 -41
- package/dist/{FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js → FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js} +2 -6
- package/dist/{Game-BuiTygow.js → Game-C86eEhcx.js} +31 -31
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
- package/dist/{Index-CQGzUU-w.js → Index-BRGweFco.js} +10 -10
- package/dist/Marketing-CnnrnXbS.js +20073 -0
- package/dist/{Member-B4S0UNGq.js → Member-B3o0Zhcw.js} +76 -76
- package/dist/MemberList-BpE1IjED.js +1606 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-DzG1fY0c.js → MemberTransactions-C4hao-d9.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-hZUWLTWj.js → MessageInput.vue_vue_type_script_setup_true_lang-D9zfmqLs.js} +36 -36
- package/dist/{Mission-BtypT2uF.js → Mission-BURXfzjd.js} +21 -21
- package/dist/{Overview-Be7bUtRO.js → Overview-D_hrrM4O.js} +335 -335
- package/dist/{Point-Bw4lnLqp.js → Point-CJXkJY5Q.js} +41 -41
- package/dist/Promotion-CunJrh42.js +289 -0
- package/dist/{Queue-CpPEVgn8.js → Queue-v5Itg9J4.js} +52 -52
- package/dist/{Record-DQq4P69i.js → Record-DJe4tg9R.js} +9 -9
- package/dist/{Reward-DJH0eM8u.js → Reward-Y9aHpny5.js} +173 -173
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-_kw_PR0h.js → RewardGroup.vue_vue_type_script_setup_true_lang-1KAjCblO.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CRGep1RK.js → RuleGroup.vue_vue_type_script_setup_true_lang-Cr99ikbK.js} +635 -548
- package/dist/Segment-DVT8uDn8.js +882 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dx6Ew9Z_.js → SelectItems.vue_vue_type_script_setup_true_lang-BhJ-oVMb.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B60_8Toi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-b5bjfBvc.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCaJ3xKT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DoKAgSLE.js} +3 -3
- package/dist/{Setting-GRIUo7vg.js → Setting-BU5778gG.js} +432 -432
- package/dist/{Store-H0UDQpln.js → Store-IWg0POAU.js} +211 -211
- package/dist/StoreRewards-CIjHcVoh.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cx05-OPF.js +1029 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BcOvr526.js} +1 -1
- package/dist/{Tier-CJufQcIz.js → Tier-iN30KD7g.js} +106 -106
- package/dist/{Title-BBMgGUld.js → Title-Duh_Srek.js} +133 -131
- package/dist/{Transaction-DsucPnfp.js → Transaction-DLBA7Svl.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CwOcZEQX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DLD5d43d.js} +6 -6
- package/dist/{Voucher-BPvxKO_w.js → Voucher-cTvlMN0Y.js} +153 -123
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DkjojUvD.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js → ZodTextField.vue_vue_type_script_setup_true_lang-C5S-bi5J.js} +1 -1
- package/dist/{app-Bo0JpadQ.js → app-A3oEKLq5.js} +1 -1
- package/dist/{app-D3MT1deX.js → app-De-yQ1CJ.js} +164 -125
- package/dist/app.js +4 -3
- package/dist/business-B2JBpm4y.js +79 -0
- package/dist/{campaign-Z3l7BoMg.js → campaign-Bhur0NJx.js} +9 -9
- package/dist/{campaign-j1c3ou7l.js → campaign-vkzui6F2.js} +5 -3
- package/dist/{campaign.enum-CVXPc5Pd.js → campaign.enum-DCYkKGhd.js} +1 -1
- package/dist/{campaign.fn-rsRhHYZP.js → campaign.fn--affTEi5.js} +75 -75
- package/dist/{collectible.enum-CDSikBAy.js → collectible.enum-CLBCnfev.js} +1 -1
- package/dist/{collection.fn-Bz38mGMa.js → collection.fn-bA8q0KYy.js} +2 -2
- package/dist/{dto-D648NN4s.js → dto-RCcWeYE0.js} +4 -4
- package/dist/{effect-DbMAmVSR.js → effect-D7qRfPe_.js} +1 -1
- package/dist/{email-addresses-KOVDrRiK.js → email-addresses-a8PqViID.js} +1 -1
- package/dist/{export-cTZf8Avd.js → export-BneqNRn4.js} +3 -3
- package/dist/{helper-BYyfcLqw.js → helper-DfvvxOyO.js} +1 -1
- package/dist/{index-E-0tTd0_.js → index-2LpkG8Ye.js} +1 -1
- package/dist/{index-BMl2KZts.js → index-4kMeSNTr.js} +11447 -10969
- package/dist/{index-BrKXRxe_.js → index-B0T9GDIZ.js} +1 -1
- package/dist/{index-B3p0hmIV.js → index-BWTvsoH0.js} +1 -1
- package/dist/index-CMBPIb8x.js +32260 -0
- package/dist/{index-DPBHiqsJ.js → index-CTKMdxSm.js} +1 -1
- package/dist/index-CVAWGMus.js +56 -0
- package/dist/index-CbsJ6vMJ.js +31 -0
- package/dist/{index-BTb8I_eB.js → index-CrFUhsZO.js} +1 -1
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-CvoShC5J.js → index-CtDqXnOp.js} +535 -460
- package/dist/{index-BIaCtk8e.js → index-D0GnMoag.js} +181 -79
- package/dist/{index-nF9iYTlh.js → index-DMrIQqFt.js} +1 -1
- package/dist/{index-B4MqsaBz.js → index-DeXvASjP.js} +3 -3
- package/dist/{index-CTPMbFf5.js → index-y-7yUm2e.js} +10 -9
- package/dist/{index.esm2017-DFYwde30.js → index.esm2017-JtyypweZ.js} +127 -127
- package/dist/{loading-vUArhX_O.js → loading-a-FqrwqI.js} +1 -1
- package/dist/{membership-BHKv29yt.js → membership-CGVtil5J.js} +3 -3
- package/dist/{money-Bl3_QRkE.js → money-CTc1l_Cq.js} +1 -1
- package/dist/{number-hh_S9w7k.js → number-W3R-0nYP.js} +1 -1
- package/dist/objectid-BU0Y8iAN.js +145 -0
- package/dist/{plugins-CVes2wzE.js → plugins-D2sSgTSl.js} +2 -2
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/{reward-ANZOdWzf.js → reward-atP8vnNn.js} +1 -1
- package/dist/{rule-builder-BSN777PN.js → rule-builder-BB29ZJ_C.js} +17 -17
- package/dist/{rule-BvFk5bQg.js → rule-eA5IvnjB.js} +3 -3
- package/dist/style.css +1 -1
- package/dist/{template-Dh9lDLs_.js → template-DhBeDaAm.js} +64 -64
- package/dist/{trigger-C7THbt7R.js → trigger-Bq_pZj1J.js} +7 -7
- package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
- package/dist/{user-DtNR9JY2.js → user-B-bhVFIG.js} +1 -1
- package/dist/{vue-i18n-BWyHnm4m.js → vue-i18n-D-h8VDSx.js} +310 -310
- package/dist/{xlsx-7u9SB0oa.js → xlsx-DsByAcZl.js} +226 -226
- package/package.json +5 -3
- package/dist/Analytic-CavR2bzs.js +0 -427
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
- package/dist/Marketing-BSspYuhg.js +0 -319
- package/dist/MemberList-CfnUJ3mh.js +0 -1606
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/Promotion-Bg6x0rAh.js +0 -255
- package/dist/Segment-BLB4VWNJ.js +0 -882
- package/dist/StoreRewards--TNIFaCo.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfB8tA5l.js +0 -995
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bg-9YqLP.js +0 -419
- package/dist/business-DMALI7ZO.js +0 -78
- package/dist/index-BsCGyJMY.js +0 -29566
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DFKmjCG1.js +0 -44
- package/dist/index-Dbd4WA4r.js +0 -61
- package/dist/objectid-CEyMlMge.js +0 -145
|
@@ -1,122 +1,127 @@
|
|
|
1
|
-
import { defineComponent as lt, ref as
|
|
1
|
+
import { defineComponent as lt, ref as ne, h as B, watch as ut, resolveComponent as Yt, openBlock as ie, createBlock as dt, unref as P, computed as Ve, onMounted as Xt, createElementBlock as $e, Fragment as Qt, createCommentVNode as He, createVNode as Zt, createElementVNode as en, nextTick as tn } from "vue";
|
|
2
2
|
import { useRouter as nn, useRoute as ht, RouterView as rn } from "vue-router";
|
|
3
3
|
import { useCoreStore as We, FeedMeAuth as sn } from "@feedmepos/mf-common";
|
|
4
4
|
import { u as on } from "./app-wDQR6dpb.js";
|
|
5
|
-
import { u as an } from "./business-
|
|
6
|
-
import "./index-
|
|
5
|
+
import { u as an } from "./business-B2JBpm4y.js";
|
|
6
|
+
import "./index-CrFUhsZO.js";
|
|
7
7
|
import { components as q, useSnackbar as cn, useDialog as ln } from "@feedmepos/ui-library";
|
|
8
|
-
import { u as un } from "./vue-i18n-
|
|
9
|
-
import { R as
|
|
8
|
+
import { u as un } from "./vue-i18n-D-h8VDSx.js";
|
|
9
|
+
import { R as h } from "./app-De-yQ1CJ.js";
|
|
10
10
|
import { J as dn } from "./JsonViewer-v8_C7l5N.js";
|
|
11
|
-
import { r as ye, L as hn, g as ft, i as fn, a as pn, _ as je, C as
|
|
11
|
+
import { r as ye, L as hn, g as ft, i as fn, a as pn, _ as je, C as Ge, b as mn, S as J, c as w, d as j, E as Se, e as gn, f as pt, h as _n, j as vn, k as mt, l as g, m as In, F as Re, n as Tn, q as Y, o as wn, p as yn, s as En, t as kn, u as bn } from "./index.esm2017-JtyypweZ.js";
|
|
12
12
|
import { _ as Pe } from "./tslib.es6-BCqqvLQ_.js";
|
|
13
|
-
import { S as
|
|
14
|
-
|
|
13
|
+
import { S as Be, c as Sn } from "./index-4kMeSNTr.js";
|
|
14
|
+
import { Y as Rn } from "./remy-vue-client-Cpppk9h-.js";
|
|
15
|
+
const Pn = /* @__PURE__ */ lt({
|
|
15
16
|
__name: "NavigationTab",
|
|
16
17
|
setup(n) {
|
|
17
|
-
const { t: e } = un(), t =
|
|
18
|
+
const { t: e } = un(), t = ne(), i = [
|
|
18
19
|
{
|
|
19
20
|
label: e("connect.navigation.analytic"),
|
|
20
|
-
value:
|
|
21
|
+
value: h["$connect-ANALYTIC"]
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
24
|
label: e("connect.navigation.campaign"),
|
|
24
|
-
value:
|
|
25
|
+
value: h["$connect-CAMPAIGN"],
|
|
25
26
|
children: [
|
|
26
27
|
{
|
|
27
28
|
label: e("connect.navigation.promotion"),
|
|
28
|
-
value:
|
|
29
|
+
value: h["$connect-CAMPAIGN_PROMOTION"]
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
label: e("connect.navigation.voucher"),
|
|
32
|
-
value:
|
|
33
|
+
value: h["$connect-CAMPAIGN_VOUCHER"]
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
36
|
label: e("connect.navigation.broadcast"),
|
|
36
|
-
value:
|
|
37
|
+
value: h["$connect-CAMPAIGN_BROADCAST"]
|
|
37
38
|
}
|
|
38
39
|
]
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
label: e("connect.navigation.program"),
|
|
42
|
-
value:
|
|
43
|
+
value: h["$connect-PROGRAM"],
|
|
43
44
|
children: [
|
|
44
45
|
{
|
|
45
46
|
label: e("connect.navigation.tier"),
|
|
46
|
-
value:
|
|
47
|
+
value: h["$connect-PROGRAM_TIER"]
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
label: e("connect.navigation.title"),
|
|
50
|
-
value:
|
|
51
|
+
value: h["$connect-PROGRAM_TITLE"]
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
label: e("connect.navigation.experience"),
|
|
54
|
-
value:
|
|
55
|
+
value: h["$connect-PROGRAM_EXPERIENCE"]
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
label: e("connect.navigation.point"),
|
|
58
|
-
value:
|
|
59
|
-
badge: () =>
|
|
59
|
+
value: h["$connect-PROGRAM_POINT"],
|
|
60
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
label: e("connect.navigation.credit"),
|
|
63
|
-
value:
|
|
64
|
+
value: h["$connect-PROGRAM_CREDIT"]
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
67
|
label: e("connect.navigation.game"),
|
|
67
|
-
value:
|
|
68
|
-
badge: () =>
|
|
68
|
+
value: h["$connect-PROGRAM_GAME"],
|
|
69
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
72
|
label: "Mission",
|
|
72
|
-
value:
|
|
73
|
+
value: h["$connect-PROGRAM_MISSION"]
|
|
73
74
|
}
|
|
74
75
|
]
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
label: e("connect.navigation.loyalty"),
|
|
78
|
-
value:
|
|
79
|
+
value: h["$connect-LOYALTY"],
|
|
79
80
|
children: [
|
|
80
81
|
{
|
|
81
82
|
label: e("connect.navigation.member"),
|
|
82
|
-
value:
|
|
83
|
+
value: h["$connect-LOYALTY_MEMBER_LIST"]
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
label: e("connect.navigation.segments"),
|
|
86
|
-
value:
|
|
87
|
-
badge: () =>
|
|
87
|
+
value: h["$connect-LOYALTY_SEGMENT"],
|
|
88
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
label: e("connect.navigation.card"),
|
|
91
|
-
value:
|
|
92
|
-
badge: () =>
|
|
92
|
+
value: h["$connect-LOYALTY_CARD"],
|
|
93
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
93
94
|
}
|
|
94
95
|
]
|
|
95
96
|
},
|
|
96
97
|
{
|
|
97
98
|
label: e("connect.navigation.referral"),
|
|
98
|
-
value:
|
|
99
|
-
badge: () =>
|
|
99
|
+
value: h["$connect-REFERRAL"],
|
|
100
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
103
|
label: e("connect.navigation.store"),
|
|
103
|
-
value:
|
|
104
|
+
value: h["$connect-STORE"]
|
|
104
105
|
},
|
|
105
106
|
{
|
|
106
107
|
label: e("connect.navigation.transaction"),
|
|
107
|
-
value:
|
|
108
|
+
value: h["$connect-TRANSACTION"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: "Marketing material",
|
|
112
|
+
value: h["$connect-MARKETING"]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: e("connect.navigation.auditLogs"),
|
|
116
|
+
value: h["$connect-AUDIT_LOGS"]
|
|
108
117
|
},
|
|
109
|
-
// {
|
|
110
|
-
// label: 'Marketing material',
|
|
111
|
-
// value: ROUTE_NAME['$connect-MARKETING'],
|
|
112
|
-
// },
|
|
113
118
|
{
|
|
114
119
|
label: e("connect.navigation.setting"),
|
|
115
|
-
value:
|
|
120
|
+
value: h["$connect-SETTING"]
|
|
116
121
|
},
|
|
117
122
|
{
|
|
118
123
|
label: e("connect.navigation.bin"),
|
|
119
|
-
value:
|
|
124
|
+
value: h["$connect-BIN"]
|
|
120
125
|
}
|
|
121
126
|
], r = nn(), s = ht(), o = i.reduce((a, l) => [...(l.children ?? []).map((d) => d.value), ...a, l.value], []);
|
|
122
127
|
ut(
|
|
@@ -131,18 +136,18 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
131
136
|
await r.push({ name: a });
|
|
132
137
|
}
|
|
133
138
|
return (a, l) => {
|
|
134
|
-
var
|
|
139
|
+
var f;
|
|
135
140
|
const d = Yt("FmCollapsibleTabs");
|
|
136
|
-
return
|
|
141
|
+
return ie(), dt(d, {
|
|
137
142
|
class: "border-fm-color-neutral-gray-100 border-r py-16 px-4",
|
|
138
|
-
"model-value": (
|
|
143
|
+
"model-value": (f = P(t)) == null ? void 0 : f.toString(),
|
|
139
144
|
items: i,
|
|
140
145
|
"onUpdate:modelValue": c
|
|
141
146
|
}, null, 8, ["model-value"]);
|
|
142
147
|
};
|
|
143
148
|
}
|
|
144
149
|
});
|
|
145
|
-
var
|
|
150
|
+
var An = "firebase", Cn = "10.12.4";
|
|
146
151
|
/**
|
|
147
152
|
* @license
|
|
148
153
|
* Copyright 2020 Google LLC
|
|
@@ -159,13 +164,13 @@ var Pn = "firebase", An = "10.12.4";
|
|
|
159
164
|
* See the License for the specific language governing permissions and
|
|
160
165
|
* limitations under the License.
|
|
161
166
|
*/
|
|
162
|
-
ye(
|
|
167
|
+
ye(An, Cn, "app");
|
|
163
168
|
function gt() {
|
|
164
169
|
return {
|
|
165
170
|
"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."
|
|
166
171
|
};
|
|
167
172
|
}
|
|
168
|
-
const
|
|
173
|
+
const On = gt, _t = new Se("auth", "Firebase", gt());
|
|
169
174
|
/**
|
|
170
175
|
* @license
|
|
171
176
|
* Copyright 2020 Google LLC
|
|
@@ -182,12 +187,12 @@ const Cn = gt, _t = new Se("auth", "Firebase", gt());
|
|
|
182
187
|
* See the License for the specific language governing permissions and
|
|
183
188
|
* limitations under the License.
|
|
184
189
|
*/
|
|
185
|
-
const
|
|
186
|
-
function
|
|
187
|
-
|
|
190
|
+
const ce = new hn("@firebase/auth");
|
|
191
|
+
function Nn(n, ...e) {
|
|
192
|
+
ce.logLevel <= mt.WARN && ce.warn(`Auth (${J}): ${n}`, ...e);
|
|
188
193
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
194
|
+
function re(n, ...e) {
|
|
195
|
+
ce.logLevel <= mt.ERROR && ce.error(`Auth (${J}): ${n}`, ...e);
|
|
191
196
|
}
|
|
192
197
|
/**
|
|
193
198
|
* @license
|
|
@@ -212,7 +217,7 @@ function I(n, ...e) {
|
|
|
212
217
|
return Ae(n, ...e);
|
|
213
218
|
}
|
|
214
219
|
function vt(n, e, t) {
|
|
215
|
-
const i = Object.assign(Object.assign({},
|
|
220
|
+
const i = Object.assign(Object.assign({}, On()), { [e]: t });
|
|
216
221
|
return new Se("auth", "Firebase", i).create(e, {
|
|
217
222
|
appName: n.name
|
|
218
223
|
});
|
|
@@ -233,7 +238,7 @@ function u(n, e, ...t) {
|
|
|
233
238
|
}
|
|
234
239
|
function y(n) {
|
|
235
240
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
236
|
-
throw
|
|
241
|
+
throw re(e), new Error(e);
|
|
237
242
|
}
|
|
238
243
|
function S(n, e) {
|
|
239
244
|
n || y(e);
|
|
@@ -258,7 +263,7 @@ function Ee() {
|
|
|
258
263
|
var n;
|
|
259
264
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
260
265
|
}
|
|
261
|
-
function
|
|
266
|
+
function Ln() {
|
|
262
267
|
return qe() === "http:" || qe() === "https:";
|
|
263
268
|
}
|
|
264
269
|
function qe() {
|
|
@@ -281,15 +286,15 @@ function qe() {
|
|
|
281
286
|
* See the License for the specific language governing permissions and
|
|
282
287
|
* limitations under the License.
|
|
283
288
|
*/
|
|
284
|
-
function
|
|
289
|
+
function Mn() {
|
|
285
290
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
286
291
|
// This is especially true for Cordova apps which have unreliable
|
|
287
292
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
288
293
|
// installed which overwrites the native navigator.onLine value and
|
|
289
294
|
// defines navigator.connection.
|
|
290
|
-
(
|
|
295
|
+
(Ln() || mn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
291
296
|
}
|
|
292
|
-
function
|
|
297
|
+
function Un() {
|
|
293
298
|
if (typeof navigator > "u")
|
|
294
299
|
return null;
|
|
295
300
|
const n = navigator;
|
|
@@ -322,7 +327,7 @@ class X {
|
|
|
322
327
|
this.shortDelay = e, this.longDelay = t, S(t > e, "Short delay should be less than long delay!"), this.isMobile = fn() || pn();
|
|
323
328
|
}
|
|
324
329
|
get() {
|
|
325
|
-
return
|
|
330
|
+
return Mn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
326
331
|
}
|
|
327
332
|
}
|
|
328
333
|
/**
|
|
@@ -416,7 +421,7 @@ class It {
|
|
|
416
421
|
* See the License for the specific language governing permissions and
|
|
417
422
|
* limitations under the License.
|
|
418
423
|
*/
|
|
419
|
-
const
|
|
424
|
+
const Dn = {
|
|
420
425
|
// Custom token errors.
|
|
421
426
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
422
427
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -507,11 +512,11 @@ const Un = {
|
|
|
507
512
|
* See the License for the specific language governing permissions and
|
|
508
513
|
* limitations under the License.
|
|
509
514
|
*/
|
|
510
|
-
const
|
|
511
|
-
function
|
|
515
|
+
const Fn = new X(3e4, 6e4);
|
|
516
|
+
function fe(n, e) {
|
|
512
517
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
513
518
|
}
|
|
514
|
-
async function
|
|
519
|
+
async function G(n, e, t, i, r = {}) {
|
|
515
520
|
return Tt(n, r, async () => {
|
|
516
521
|
let s = {}, o = {};
|
|
517
522
|
i && (e === "GET" ? o = i : s = {
|
|
@@ -533,26 +538,26 @@ async function B(n, e, t, i, r = {}) {
|
|
|
533
538
|
}
|
|
534
539
|
async function Tt(n, e, t) {
|
|
535
540
|
n._canInitEmulator = !1;
|
|
536
|
-
const i = Object.assign(Object.assign({},
|
|
541
|
+
const i = Object.assign(Object.assign({}, Dn), e);
|
|
537
542
|
try {
|
|
538
|
-
const r = new
|
|
543
|
+
const r = new xn(n), s = await Promise.race([
|
|
539
544
|
t(),
|
|
540
545
|
r.promise
|
|
541
546
|
]);
|
|
542
547
|
r.clearNetworkTimeout();
|
|
543
548
|
const o = await s.json();
|
|
544
549
|
if ("needConfirmation" in o)
|
|
545
|
-
throw
|
|
550
|
+
throw te(n, "account-exists-with-different-credential", o);
|
|
546
551
|
if (s.ok && !("errorMessage" in o))
|
|
547
552
|
return o;
|
|
548
553
|
{
|
|
549
554
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
550
555
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
551
|
-
throw
|
|
556
|
+
throw te(n, "credential-already-in-use", o);
|
|
552
557
|
if (a === "EMAIL_EXISTS")
|
|
553
|
-
throw
|
|
558
|
+
throw te(n, "email-already-in-use", o);
|
|
554
559
|
if (a === "USER_DISABLED")
|
|
555
|
-
throw
|
|
560
|
+
throw te(n, "user-disabled", o);
|
|
556
561
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
557
562
|
if (l)
|
|
558
563
|
throw vt(n, d, l);
|
|
@@ -565,7 +570,7 @@ async function Tt(n, e, t) {
|
|
|
565
570
|
}
|
|
566
571
|
}
|
|
567
572
|
async function wt(n, e, t, i, r = {}) {
|
|
568
|
-
const s = await
|
|
573
|
+
const s = await G(n, e, t, i, r);
|
|
569
574
|
return "mfaPendingCredential" in s && b(n, "multi-factor-auth-required", {
|
|
570
575
|
_serverResponse: s
|
|
571
576
|
}), s;
|
|
@@ -574,21 +579,21 @@ function yt(n, e, t, i) {
|
|
|
574
579
|
const r = `${e}${t}?${i}`;
|
|
575
580
|
return n.config.emulator ? Ce(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
576
581
|
}
|
|
577
|
-
class
|
|
582
|
+
class xn {
|
|
578
583
|
constructor(e) {
|
|
579
584
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
580
585
|
this.timer = setTimeout(() => i(I(
|
|
581
586
|
this.auth,
|
|
582
587
|
"network-request-failed"
|
|
583
588
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
584
|
-
)),
|
|
589
|
+
)), Fn.get());
|
|
585
590
|
});
|
|
586
591
|
}
|
|
587
592
|
clearNetworkTimeout() {
|
|
588
593
|
clearTimeout(this.timer);
|
|
589
594
|
}
|
|
590
595
|
}
|
|
591
|
-
function
|
|
596
|
+
function te(n, e, t) {
|
|
592
597
|
const i = {
|
|
593
598
|
appName: n.name
|
|
594
599
|
};
|
|
@@ -612,11 +617,11 @@ function ee(n, e, t) {
|
|
|
612
617
|
* See the License for the specific language governing permissions and
|
|
613
618
|
* limitations under the License.
|
|
614
619
|
*/
|
|
615
|
-
async function
|
|
616
|
-
return
|
|
620
|
+
async function Vn(n, e) {
|
|
621
|
+
return G(n, "POST", "/v1/accounts:delete", e);
|
|
617
622
|
}
|
|
618
623
|
async function Et(n, e) {
|
|
619
|
-
return
|
|
624
|
+
return G(n, "POST", "/v1/accounts:lookup", e);
|
|
620
625
|
}
|
|
621
626
|
/**
|
|
622
627
|
* @license
|
|
@@ -643,7 +648,7 @@ function z(n) {
|
|
|
643
648
|
} catch {
|
|
644
649
|
}
|
|
645
650
|
}
|
|
646
|
-
async function
|
|
651
|
+
async function $n(n, e = !1) {
|
|
647
652
|
const t = j(n), i = await t.getIdToken(e), r = Oe(i);
|
|
648
653
|
u(
|
|
649
654
|
r && r.exp && r.auth_time && r.iat,
|
|
@@ -668,12 +673,12 @@ function Te(n) {
|
|
|
668
673
|
function Oe(n) {
|
|
669
674
|
const [e, t, i] = n.split(".");
|
|
670
675
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
671
|
-
return
|
|
676
|
+
return re("JWT malformed, contained fewer than 3 sections"), null;
|
|
672
677
|
try {
|
|
673
678
|
const r = Tn(t);
|
|
674
|
-
return r ? JSON.parse(r) : (
|
|
679
|
+
return r ? JSON.parse(r) : (re("Failed to decode base64 JWT payload"), null);
|
|
675
680
|
} catch (r) {
|
|
676
|
-
return
|
|
681
|
+
return re("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
677
682
|
}
|
|
678
683
|
}
|
|
679
684
|
function ze(n) {
|
|
@@ -714,10 +719,10 @@ async function K(n, e, t = !1) {
|
|
|
714
719
|
try {
|
|
715
720
|
return await e;
|
|
716
721
|
} catch (i) {
|
|
717
|
-
throw i instanceof Re &&
|
|
722
|
+
throw i instanceof Re && Hn(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
718
723
|
}
|
|
719
724
|
}
|
|
720
|
-
function
|
|
725
|
+
function Hn({ code: n }) {
|
|
721
726
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
722
727
|
}
|
|
723
728
|
/**
|
|
@@ -736,7 +741,7 @@ function $n({ code: n }) {
|
|
|
736
741
|
* See the License for the specific language governing permissions and
|
|
737
742
|
* limitations under the License.
|
|
738
743
|
*/
|
|
739
|
-
class
|
|
744
|
+
class Wn {
|
|
740
745
|
constructor(e) {
|
|
741
746
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
742
747
|
}
|
|
@@ -831,7 +836,7 @@ class ke {
|
|
|
831
836
|
* See the License for the specific language governing permissions and
|
|
832
837
|
* limitations under the License.
|
|
833
838
|
*/
|
|
834
|
-
async function
|
|
839
|
+
async function le(n) {
|
|
835
840
|
var e;
|
|
836
841
|
const t = n.auth, i = await n.getIdToken(), r = await K(n, Et(t, { idToken: i }));
|
|
837
842
|
u(
|
|
@@ -842,7 +847,7 @@ async function ce(n) {
|
|
|
842
847
|
);
|
|
843
848
|
const s = r.users[0];
|
|
844
849
|
n._notifyReloadListener(s);
|
|
845
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c =
|
|
850
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c = Gn(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, f = {
|
|
846
851
|
uid: s.localId,
|
|
847
852
|
displayName: s.displayName || null,
|
|
848
853
|
photoURL: s.photoUrl || null,
|
|
@@ -854,13 +859,13 @@ async function ce(n) {
|
|
|
854
859
|
metadata: new ke(s.createdAt, s.lastLoginAt),
|
|
855
860
|
isAnonymous: d
|
|
856
861
|
};
|
|
857
|
-
Object.assign(n,
|
|
862
|
+
Object.assign(n, f);
|
|
858
863
|
}
|
|
859
|
-
async function
|
|
864
|
+
async function jn(n) {
|
|
860
865
|
const e = j(n);
|
|
861
|
-
await
|
|
866
|
+
await le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
862
867
|
}
|
|
863
|
-
function
|
|
868
|
+
function Gn(n, e) {
|
|
864
869
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
865
870
|
}
|
|
866
871
|
function kt(n) {
|
|
@@ -913,8 +918,8 @@ async function Bn(n, e) {
|
|
|
913
918
|
refreshToken: t.refresh_token
|
|
914
919
|
};
|
|
915
920
|
}
|
|
916
|
-
async function
|
|
917
|
-
return
|
|
921
|
+
async function qn(n, e) {
|
|
922
|
+
return G(n, "POST", "/v2/accounts:revokeToken", fe(n, e));
|
|
918
923
|
}
|
|
919
924
|
/**
|
|
920
925
|
* @license
|
|
@@ -1032,7 +1037,7 @@ function R(n, e) {
|
|
|
1032
1037
|
class E {
|
|
1033
1038
|
constructor(e) {
|
|
1034
1039
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = Pe(e, ["uid", "auth", "stsTokenManager"]);
|
|
1035
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1040
|
+
this.providerId = "firebase", this.proactiveRefresh = new Wn(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = i, this.stsTokenManager = r, this.accessToken = r.accessToken, this.displayName = s.displayName || null, this.email = s.email || null, this.emailVerified = s.emailVerified || !1, this.phoneNumber = s.phoneNumber || null, this.photoURL = s.photoURL || null, this.isAnonymous = s.isAnonymous || !1, this.tenantId = s.tenantId || null, this.providerData = s.providerData ? [...s.providerData] : [], this.metadata = new ke(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1036
1041
|
}
|
|
1037
1042
|
async getIdToken(e) {
|
|
1038
1043
|
const t = await K(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -1044,10 +1049,10 @@ class E {
|
|
|
1044
1049
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1045
1050
|
}
|
|
1046
1051
|
getIdTokenResult(e) {
|
|
1047
|
-
return
|
|
1052
|
+
return $n(this, e);
|
|
1048
1053
|
}
|
|
1049
1054
|
reload() {
|
|
1050
|
-
return
|
|
1055
|
+
return jn(this);
|
|
1051
1056
|
}
|
|
1052
1057
|
_assign(e) {
|
|
1053
1058
|
this !== e && (u(
|
|
@@ -1080,13 +1085,13 @@ class E {
|
|
|
1080
1085
|
}
|
|
1081
1086
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1082
1087
|
let i = !1;
|
|
1083
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1088
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await le(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1084
1089
|
}
|
|
1085
1090
|
async delete() {
|
|
1086
1091
|
if (w(this.auth.app))
|
|
1087
1092
|
return Promise.reject(L(this.auth));
|
|
1088
1093
|
const e = await this.getIdToken();
|
|
1089
|
-
return await K(this,
|
|
1094
|
+
return await K(this, Vn(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1090
1095
|
}
|
|
1091
1096
|
toJSON() {
|
|
1092
1097
|
return Object.assign(Object.assign({
|
|
@@ -1114,20 +1119,20 @@ class E {
|
|
|
1114
1119
|
}
|
|
1115
1120
|
static _fromJSON(e, t) {
|
|
1116
1121
|
var i, r, s, o, c, a, l, d;
|
|
1117
|
-
const
|
|
1122
|
+
const f = (i = t.displayName) !== null && i !== void 0 ? i : void 0, _ = (r = t.email) !== null && r !== void 0 ? r : void 0, x = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, M = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, ee = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, p = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, m = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, v = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: U, emailVerified: De, isAnonymous: Fe, providerData: ve, stsTokenManager: xe } = t;
|
|
1118
1123
|
u(
|
|
1119
|
-
|
|
1124
|
+
U && xe,
|
|
1120
1125
|
e,
|
|
1121
1126
|
"internal-error"
|
|
1122
1127
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1123
1128
|
);
|
|
1124
1129
|
const Kt = $.fromJSON(this.name, xe);
|
|
1125
1130
|
u(
|
|
1126
|
-
typeof
|
|
1131
|
+
typeof U == "string",
|
|
1127
1132
|
e,
|
|
1128
1133
|
"internal-error"
|
|
1129
1134
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1130
|
-
), R(
|
|
1135
|
+
), R(f, e.name), R(_, e.name), u(
|
|
1131
1136
|
typeof De == "boolean",
|
|
1132
1137
|
e,
|
|
1133
1138
|
"internal-error"
|
|
@@ -1137,22 +1142,22 @@ class E {
|
|
|
1137
1142
|
e,
|
|
1138
1143
|
"internal-error"
|
|
1139
1144
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1140
|
-
), R(
|
|
1145
|
+
), R(x, e.name), R(M, e.name), R(ee, e.name), R(p, e.name), R(m, e.name), R(v, e.name);
|
|
1141
1146
|
const Ie = new E({
|
|
1142
|
-
uid:
|
|
1147
|
+
uid: U,
|
|
1143
1148
|
auth: e,
|
|
1144
1149
|
email: _,
|
|
1145
1150
|
emailVerified: De,
|
|
1146
|
-
displayName:
|
|
1151
|
+
displayName: f,
|
|
1147
1152
|
isAnonymous: Fe,
|
|
1148
1153
|
photoURL: M,
|
|
1149
|
-
phoneNumber:
|
|
1150
|
-
tenantId:
|
|
1154
|
+
phoneNumber: x,
|
|
1155
|
+
tenantId: ee,
|
|
1151
1156
|
stsTokenManager: Kt,
|
|
1152
|
-
createdAt:
|
|
1153
|
-
lastLoginAt:
|
|
1157
|
+
createdAt: m,
|
|
1158
|
+
lastLoginAt: v
|
|
1154
1159
|
});
|
|
1155
|
-
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))),
|
|
1160
|
+
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))), p && (Ie._redirectEventId = p), Ie;
|
|
1156
1161
|
}
|
|
1157
1162
|
/**
|
|
1158
1163
|
* Initialize a User from an idToken server response
|
|
@@ -1168,7 +1173,7 @@ class E {
|
|
|
1168
1173
|
stsTokenManager: r,
|
|
1169
1174
|
isAnonymous: i
|
|
1170
1175
|
});
|
|
1171
|
-
return await
|
|
1176
|
+
return await le(s), s;
|
|
1172
1177
|
}
|
|
1173
1178
|
/**
|
|
1174
1179
|
* Initialize a User from an idToken server response
|
|
@@ -1282,14 +1287,14 @@ const Je = bt;
|
|
|
1282
1287
|
* See the License for the specific language governing permissions and
|
|
1283
1288
|
* limitations under the License.
|
|
1284
1289
|
*/
|
|
1285
|
-
function
|
|
1290
|
+
function se(n, e, t) {
|
|
1286
1291
|
return `firebase:${n}:${e}:${t}`;
|
|
1287
1292
|
}
|
|
1288
1293
|
class H {
|
|
1289
1294
|
constructor(e, t, i) {
|
|
1290
1295
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1291
1296
|
const { config: r, name: s } = this.auth;
|
|
1292
|
-
this.fullUserKey =
|
|
1297
|
+
this.fullUserKey = se(this.userKey, r.apiKey, s), this.fullPersistenceKey = se("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1293
1298
|
}
|
|
1294
1299
|
setCurrentUser(e) {
|
|
1295
1300
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
@@ -1322,14 +1327,14 @@ class H {
|
|
|
1322
1327
|
return l;
|
|
1323
1328
|
}))).filter((l) => l);
|
|
1324
1329
|
let s = r[0] || k(Je);
|
|
1325
|
-
const o =
|
|
1330
|
+
const o = se(i, e.config.apiKey, e.name);
|
|
1326
1331
|
let c = null;
|
|
1327
1332
|
for (const l of t)
|
|
1328
1333
|
try {
|
|
1329
1334
|
const d = await l._get(o);
|
|
1330
1335
|
if (d) {
|
|
1331
|
-
const
|
|
1332
|
-
l !== s && (c =
|
|
1336
|
+
const f = E._fromJSON(e, d);
|
|
1337
|
+
l !== s && (c = f), s = l;
|
|
1333
1338
|
break;
|
|
1334
1339
|
}
|
|
1335
1340
|
} catch {
|
|
@@ -1413,20 +1418,20 @@ function Ct(n = g()) {
|
|
|
1413
1418
|
function Ot(n = g()) {
|
|
1414
1419
|
return /webos/i.test(n);
|
|
1415
1420
|
}
|
|
1416
|
-
function
|
|
1421
|
+
function pe(n = g()) {
|
|
1417
1422
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1418
1423
|
}
|
|
1419
|
-
function
|
|
1424
|
+
function zn(n = g()) {
|
|
1420
1425
|
var e;
|
|
1421
|
-
return
|
|
1426
|
+
return pe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1422
1427
|
}
|
|
1423
|
-
function
|
|
1428
|
+
function Kn() {
|
|
1424
1429
|
return wn() && document.documentMode === 10;
|
|
1425
1430
|
}
|
|
1426
1431
|
function Nt(n = g()) {
|
|
1427
|
-
return
|
|
1432
|
+
return pe(n) || At(n) || Ot(n) || Ct(n) || /windows phone/i.test(n) || Pt(n);
|
|
1428
1433
|
}
|
|
1429
|
-
function
|
|
1434
|
+
function Jn() {
|
|
1430
1435
|
try {
|
|
1431
1436
|
return !!(window && window !== window.top);
|
|
1432
1437
|
} catch {
|
|
@@ -1480,7 +1485,7 @@ function Lt(n, e = []) {
|
|
|
1480
1485
|
* See the License for the specific language governing permissions and
|
|
1481
1486
|
* limitations under the License.
|
|
1482
1487
|
*/
|
|
1483
|
-
class
|
|
1488
|
+
class Yn {
|
|
1484
1489
|
constructor(e) {
|
|
1485
1490
|
this.auth = e, this.queue = [];
|
|
1486
1491
|
}
|
|
@@ -1535,8 +1540,8 @@ class Jn {
|
|
|
1535
1540
|
* See the License for the specific language governing permissions and
|
|
1536
1541
|
* limitations under the License.
|
|
1537
1542
|
*/
|
|
1538
|
-
async function
|
|
1539
|
-
return
|
|
1543
|
+
async function Xn(n, e = {}) {
|
|
1544
|
+
return G(n, "GET", "/v2/passwordPolicy", fe(n, e));
|
|
1540
1545
|
}
|
|
1541
1546
|
/**
|
|
1542
1547
|
* @license
|
|
@@ -1554,12 +1559,12 @@ async function Yn(n, e = {}) {
|
|
|
1554
1559
|
* See the License for the specific language governing permissions and
|
|
1555
1560
|
* limitations under the License.
|
|
1556
1561
|
*/
|
|
1557
|
-
const
|
|
1558
|
-
class
|
|
1562
|
+
const Qn = 6;
|
|
1563
|
+
class Zn {
|
|
1559
1564
|
constructor(e) {
|
|
1560
1565
|
var t, i, r, s;
|
|
1561
1566
|
const o = e.customStrengthOptions;
|
|
1562
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1567
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Qn, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (r = (i = e.allowedNonAlphanumericCharacters) === null || i === void 0 ? void 0 : i.join("")) !== null && r !== void 0 ? r : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
|
1563
1568
|
}
|
|
1564
1569
|
validatePassword(e) {
|
|
1565
1570
|
var t, i, r, s, o, c;
|
|
@@ -1642,9 +1647,9 @@ class Qn {
|
|
|
1642
1647
|
* See the License for the specific language governing permissions and
|
|
1643
1648
|
* limitations under the License.
|
|
1644
1649
|
*/
|
|
1645
|
-
class
|
|
1650
|
+
class ei {
|
|
1646
1651
|
constructor(e, t, i, r) {
|
|
1647
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new Xe(this), this.idTokenSubscription = new Xe(this), this.beforeStateQueue = new
|
|
1652
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new Xe(this), this.idTokenSubscription = new Xe(this), this.beforeStateQueue = new Yn(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 = _t, this._agentRecaptchaConfig = null, this._tenantRecaptchaConfigs = {}, this._projectPasswordPolicy = null, this._tenantPasswordPolicies = {}, this.lastNotifiedUid = void 0, this.languageCode = null, this.tenantId = null, this.settings = { appVerificationDisabledForTesting: !1 }, this.frameworks = [], this.name = e.name, this.clientVersion = r.sdkClientVersion;
|
|
1648
1653
|
}
|
|
1649
1654
|
_initializeWithPersistence(e, t) {
|
|
1650
1655
|
return t && (this._popupRedirectResolver = k(t)), this._initializationPromise = this.queue(async () => {
|
|
@@ -1730,7 +1735,7 @@ class Zn {
|
|
|
1730
1735
|
}
|
|
1731
1736
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1732
1737
|
try {
|
|
1733
|
-
await
|
|
1738
|
+
await le(e);
|
|
1734
1739
|
} catch (t) {
|
|
1735
1740
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1736
1741
|
return this.directlySetCurrentUser(null);
|
|
@@ -1738,7 +1743,7 @@ class Zn {
|
|
|
1738
1743
|
return this.directlySetCurrentUser(e);
|
|
1739
1744
|
}
|
|
1740
1745
|
useDeviceLanguage() {
|
|
1741
|
-
this.languageCode =
|
|
1746
|
+
this.languageCode = Un();
|
|
1742
1747
|
}
|
|
1743
1748
|
async _delete() {
|
|
1744
1749
|
this._deleted = !0;
|
|
@@ -1789,7 +1794,7 @@ class Zn {
|
|
|
1789
1794
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1790
1795
|
}
|
|
1791
1796
|
async _updatePasswordPolicy() {
|
|
1792
|
-
const e = await
|
|
1797
|
+
const e = await Xn(this), t = new Zn(e);
|
|
1793
1798
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1794
1799
|
}
|
|
1795
1800
|
_getPersistence() {
|
|
@@ -1829,7 +1834,7 @@ class Zn {
|
|
|
1829
1834
|
token: e,
|
|
1830
1835
|
idToken: t
|
|
1831
1836
|
};
|
|
1832
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1837
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await qn(this, i);
|
|
1833
1838
|
}
|
|
1834
1839
|
}
|
|
1835
1840
|
toJSON() {
|
|
@@ -1972,10 +1977,10 @@ class Zn {
|
|
|
1972
1977
|
async _getAppCheckToken() {
|
|
1973
1978
|
var e;
|
|
1974
1979
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1975
|
-
return t != null && t.error &&
|
|
1980
|
+
return t != null && t.error && Nn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1976
1981
|
}
|
|
1977
1982
|
}
|
|
1978
|
-
function
|
|
1983
|
+
function me(n) {
|
|
1979
1984
|
return j(n);
|
|
1980
1985
|
}
|
|
1981
1986
|
class Xe {
|
|
@@ -2015,16 +2020,16 @@ let Le = {
|
|
|
2015
2020
|
recaptchaEnterpriseScript: "",
|
|
2016
2021
|
gapiScript: ""
|
|
2017
2022
|
};
|
|
2018
|
-
function
|
|
2023
|
+
function ti(n) {
|
|
2019
2024
|
Le = n;
|
|
2020
2025
|
}
|
|
2021
|
-
function
|
|
2026
|
+
function ni(n) {
|
|
2022
2027
|
return Le.loadJS(n);
|
|
2023
2028
|
}
|
|
2024
|
-
function
|
|
2029
|
+
function ii() {
|
|
2025
2030
|
return Le.gapiScript;
|
|
2026
2031
|
}
|
|
2027
|
-
function
|
|
2032
|
+
function ri(n) {
|
|
2028
2033
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2029
2034
|
}
|
|
2030
2035
|
/**
|
|
@@ -2043,7 +2048,7 @@ function ii(n) {
|
|
|
2043
2048
|
* See the License for the specific language governing permissions and
|
|
2044
2049
|
* limitations under the License.
|
|
2045
2050
|
*/
|
|
2046
|
-
function
|
|
2051
|
+
function si(n, e) {
|
|
2047
2052
|
const t = pt(n, "auth");
|
|
2048
2053
|
if (t.isInitialized()) {
|
|
2049
2054
|
const r = t.getImmediate(), s = t.getOptions();
|
|
@@ -2057,12 +2062,12 @@ function ri(n, e) {
|
|
|
2057
2062
|
}
|
|
2058
2063
|
return t.initialize({ options: e });
|
|
2059
2064
|
}
|
|
2060
|
-
function
|
|
2065
|
+
function oi(n, e) {
|
|
2061
2066
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(k);
|
|
2062
2067
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2063
2068
|
}
|
|
2064
|
-
function
|
|
2065
|
-
const i =
|
|
2069
|
+
function ai(n, e, t) {
|
|
2070
|
+
const i = me(n);
|
|
2066
2071
|
u(
|
|
2067
2072
|
i._canInitEmulator,
|
|
2068
2073
|
i,
|
|
@@ -2074,19 +2079,19 @@ function oi(n, e, t) {
|
|
|
2074
2079
|
"invalid-emulator-scheme"
|
|
2075
2080
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2076
2081
|
);
|
|
2077
|
-
const r = !1, s = Mt(e), { host: o, port: c } =
|
|
2082
|
+
const r = !1, s = Mt(e), { host: o, port: c } = ci(e), a = c === null ? "" : `:${c}`;
|
|
2078
2083
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2079
2084
|
host: o,
|
|
2080
2085
|
port: c,
|
|
2081
2086
|
protocol: s.replace(":", ""),
|
|
2082
2087
|
options: Object.freeze({ disableWarnings: r })
|
|
2083
|
-
}),
|
|
2088
|
+
}), li();
|
|
2084
2089
|
}
|
|
2085
2090
|
function Mt(n) {
|
|
2086
2091
|
const e = n.indexOf(":");
|
|
2087
2092
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2088
2093
|
}
|
|
2089
|
-
function
|
|
2094
|
+
function ci(n) {
|
|
2090
2095
|
const e = Mt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2091
2096
|
if (!t)
|
|
2092
2097
|
return { host: "", port: null };
|
|
@@ -2105,7 +2110,7 @@ function Qe(n) {
|
|
|
2105
2110
|
const e = Number(n);
|
|
2106
2111
|
return isNaN(e) ? null : e;
|
|
2107
2112
|
}
|
|
2108
|
-
function
|
|
2113
|
+
function li() {
|
|
2109
2114
|
function n() {
|
|
2110
2115
|
const e = document.createElement("p"), t = e.style;
|
|
2111
2116
|
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);
|
|
@@ -2171,7 +2176,7 @@ class Ut {
|
|
|
2171
2176
|
* limitations under the License.
|
|
2172
2177
|
*/
|
|
2173
2178
|
async function W(n, e) {
|
|
2174
|
-
return wt(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2179
|
+
return wt(n, "POST", "/v1/accounts:signInWithIdp", fe(n, e));
|
|
2175
2180
|
}
|
|
2176
2181
|
/**
|
|
2177
2182
|
* @license
|
|
@@ -2189,14 +2194,14 @@ async function W(n, e) {
|
|
|
2189
2194
|
* See the License for the specific language governing permissions and
|
|
2190
2195
|
* limitations under the License.
|
|
2191
2196
|
*/
|
|
2192
|
-
const
|
|
2193
|
-
class
|
|
2197
|
+
const ui = "http://localhost";
|
|
2198
|
+
class D extends Ut {
|
|
2194
2199
|
constructor() {
|
|
2195
2200
|
super(...arguments), this.pendingToken = null;
|
|
2196
2201
|
}
|
|
2197
2202
|
/** @internal */
|
|
2198
2203
|
static _fromParams(e) {
|
|
2199
|
-
const t = new
|
|
2204
|
+
const t = new D(e.providerId, e.signInMethod);
|
|
2200
2205
|
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) : b(
|
|
2201
2206
|
"argument-error"
|
|
2202
2207
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
@@ -2227,7 +2232,7 @@ class U extends Ut {
|
|
|
2227
2232
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = Pe(t, ["providerId", "signInMethod"]);
|
|
2228
2233
|
if (!i || !r)
|
|
2229
2234
|
return null;
|
|
2230
|
-
const o = new
|
|
2235
|
+
const o = new D(i, r);
|
|
2231
2236
|
return o.idToken = s.idToken || void 0, o.accessToken = s.accessToken || void 0, o.secret = s.secret, o.nonce = s.nonce, o.pendingToken = s.pendingToken || null, o;
|
|
2232
2237
|
}
|
|
2233
2238
|
/** @internal */
|
|
@@ -2247,7 +2252,7 @@ class U extends Ut {
|
|
|
2247
2252
|
}
|
|
2248
2253
|
buildRequest() {
|
|
2249
2254
|
const e = {
|
|
2250
|
-
requestUri:
|
|
2255
|
+
requestUri: ui,
|
|
2251
2256
|
returnSecureToken: !0
|
|
2252
2257
|
};
|
|
2253
2258
|
if (this.pendingToken)
|
|
@@ -2383,7 +2388,7 @@ class A extends Q {
|
|
|
2383
2388
|
* @param accessToken - Facebook access token.
|
|
2384
2389
|
*/
|
|
2385
2390
|
static credential(e) {
|
|
2386
|
-
return
|
|
2391
|
+
return D._fromParams({
|
|
2387
2392
|
providerId: A.PROVIDER_ID,
|
|
2388
2393
|
signInMethod: A.FACEBOOK_SIGN_IN_METHOD,
|
|
2389
2394
|
accessToken: e
|
|
@@ -2455,7 +2460,7 @@ class C extends Q {
|
|
|
2455
2460
|
* @param accessToken - Google access token.
|
|
2456
2461
|
*/
|
|
2457
2462
|
static credential(e, t) {
|
|
2458
|
-
return
|
|
2463
|
+
return D._fromParams({
|
|
2459
2464
|
providerId: C.PROVIDER_ID,
|
|
2460
2465
|
signInMethod: C.GOOGLE_SIGN_IN_METHOD,
|
|
2461
2466
|
idToken: e,
|
|
@@ -2523,7 +2528,7 @@ class O extends Q {
|
|
|
2523
2528
|
* @param accessToken - Github access token.
|
|
2524
2529
|
*/
|
|
2525
2530
|
static credential(e) {
|
|
2526
|
-
return
|
|
2531
|
+
return D._fromParams({
|
|
2527
2532
|
providerId: O.PROVIDER_ID,
|
|
2528
2533
|
signInMethod: O.GITHUB_SIGN_IN_METHOD,
|
|
2529
2534
|
accessToken: e
|
|
@@ -2588,7 +2593,7 @@ class N extends Q {
|
|
|
2588
2593
|
* @param secret - Twitter secret.
|
|
2589
2594
|
*/
|
|
2590
2595
|
static credential(e, t) {
|
|
2591
|
-
return
|
|
2596
|
+
return D._fromParams({
|
|
2592
2597
|
providerId: N.PROVIDER_ID,
|
|
2593
2598
|
signInMethod: N.TWITTER_SIGN_IN_METHOD,
|
|
2594
2599
|
oauthToken: e,
|
|
@@ -2643,13 +2648,13 @@ N.PROVIDER_ID = "twitter.com";
|
|
|
2643
2648
|
* See the License for the specific language governing permissions and
|
|
2644
2649
|
* limitations under the License.
|
|
2645
2650
|
*/
|
|
2646
|
-
class
|
|
2651
|
+
class F {
|
|
2647
2652
|
constructor(e) {
|
|
2648
2653
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2649
2654
|
}
|
|
2650
2655
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2651
2656
|
const s = await E._fromIdTokenResponse(e, i, r), o = Ze(i);
|
|
2652
|
-
return new
|
|
2657
|
+
return new F({
|
|
2653
2658
|
user: s,
|
|
2654
2659
|
providerId: o,
|
|
2655
2660
|
_tokenResponse: i,
|
|
@@ -2663,7 +2668,7 @@ class D {
|
|
|
2663
2668
|
!0
|
|
2664
2669
|
);
|
|
2665
2670
|
const r = Ze(i);
|
|
2666
|
-
return new
|
|
2671
|
+
return new F({
|
|
2667
2672
|
user: e,
|
|
2668
2673
|
providerId: r,
|
|
2669
2674
|
_tokenResponse: i,
|
|
@@ -2690,10 +2695,10 @@ function Ze(n) {
|
|
|
2690
2695
|
* See the License for the specific language governing permissions and
|
|
2691
2696
|
* limitations under the License.
|
|
2692
2697
|
*/
|
|
2693
|
-
class
|
|
2698
|
+
class ue extends Re {
|
|
2694
2699
|
constructor(e, t, i, r) {
|
|
2695
2700
|
var s;
|
|
2696
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2701
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ue.prototype), this.customData = {
|
|
2697
2702
|
appName: e.name,
|
|
2698
2703
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2699
2704
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2701,17 +2706,17 @@ class le extends Re {
|
|
|
2701
2706
|
};
|
|
2702
2707
|
}
|
|
2703
2708
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2704
|
-
return new
|
|
2709
|
+
return new ue(e, t, i, r);
|
|
2705
2710
|
}
|
|
2706
2711
|
}
|
|
2707
2712
|
function Ft(n, e, t, i) {
|
|
2708
2713
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2709
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2714
|
+
throw s.code === "auth/multi-factor-auth-required" ? ue._fromErrorAndOperation(n, s, e, i) : s;
|
|
2710
2715
|
});
|
|
2711
2716
|
}
|
|
2712
|
-
async function
|
|
2717
|
+
async function di(n, e, t = !1) {
|
|
2713
2718
|
const i = await K(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2714
|
-
return
|
|
2719
|
+
return F._forOperation(n, "link", i);
|
|
2715
2720
|
}
|
|
2716
2721
|
/**
|
|
2717
2722
|
* @license
|
|
@@ -2729,7 +2734,7 @@ async function ui(n, e, t = !1) {
|
|
|
2729
2734
|
* See the License for the specific language governing permissions and
|
|
2730
2735
|
* limitations under the License.
|
|
2731
2736
|
*/
|
|
2732
|
-
async function
|
|
2737
|
+
async function hi(n, e, t = !1) {
|
|
2733
2738
|
const { auth: i } = n;
|
|
2734
2739
|
if (w(i.app))
|
|
2735
2740
|
return Promise.reject(L(i));
|
|
@@ -2755,7 +2760,7 @@ async function di(n, e, t = !1) {
|
|
|
2755
2760
|
i,
|
|
2756
2761
|
"user-mismatch"
|
|
2757
2762
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2758
|
-
),
|
|
2763
|
+
), F._forOperation(n, r, s);
|
|
2759
2764
|
} catch (s) {
|
|
2760
2765
|
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && b(
|
|
2761
2766
|
i,
|
|
@@ -2780,10 +2785,10 @@ async function di(n, e, t = !1) {
|
|
|
2780
2785
|
* See the License for the specific language governing permissions and
|
|
2781
2786
|
* limitations under the License.
|
|
2782
2787
|
*/
|
|
2783
|
-
async function
|
|
2788
|
+
async function fi(n, e, t = !1) {
|
|
2784
2789
|
if (w(n.app))
|
|
2785
2790
|
return Promise.reject(L(n));
|
|
2786
|
-
const i = "signIn", r = await Ft(n, i, e), s = await
|
|
2791
|
+
const i = "signIn", r = await Ft(n, i, e), s = await F._fromIdTokenResponse(n, i, r);
|
|
2787
2792
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2788
2793
|
}
|
|
2789
2794
|
/**
|
|
@@ -2802,8 +2807,8 @@ async function hi(n, e, t = !1) {
|
|
|
2802
2807
|
* See the License for the specific language governing permissions and
|
|
2803
2808
|
* limitations under the License.
|
|
2804
2809
|
*/
|
|
2805
|
-
async function
|
|
2806
|
-
return wt(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2810
|
+
async function pi(n, e) {
|
|
2811
|
+
return wt(n, "POST", "/v1/accounts:signInWithCustomToken", fe(n, e));
|
|
2807
2812
|
}
|
|
2808
2813
|
/**
|
|
2809
2814
|
* @license
|
|
@@ -2821,22 +2826,22 @@ async function fi(n, e) {
|
|
|
2821
2826
|
* See the License for the specific language governing permissions and
|
|
2822
2827
|
* limitations under the License.
|
|
2823
2828
|
*/
|
|
2824
|
-
async function
|
|
2829
|
+
async function mi(n, e) {
|
|
2825
2830
|
if (w(n.app))
|
|
2826
2831
|
return Promise.reject(L(n));
|
|
2827
|
-
const t =
|
|
2832
|
+
const t = me(n), i = await pi(t, {
|
|
2828
2833
|
token: e,
|
|
2829
2834
|
returnSecureToken: !0
|
|
2830
|
-
}), r = await
|
|
2835
|
+
}), r = await F._fromIdTokenResponse(t, "signIn", i);
|
|
2831
2836
|
return await t._updateCurrentUser(r.user), r;
|
|
2832
2837
|
}
|
|
2833
|
-
function
|
|
2838
|
+
function gi(n, e, t, i) {
|
|
2834
2839
|
return j(n).onIdTokenChanged(e, t, i);
|
|
2835
2840
|
}
|
|
2836
|
-
function
|
|
2841
|
+
function _i(n, e, t) {
|
|
2837
2842
|
return j(n).beforeAuthStateChanged(e, t);
|
|
2838
2843
|
}
|
|
2839
|
-
const
|
|
2844
|
+
const de = "__sak";
|
|
2840
2845
|
/**
|
|
2841
2846
|
* @license
|
|
2842
2847
|
* Copyright 2019 Google LLC
|
|
@@ -2859,7 +2864,7 @@ class xt {
|
|
|
2859
2864
|
}
|
|
2860
2865
|
_isAvailable() {
|
|
2861
2866
|
try {
|
|
2862
|
-
return this.storage ? (this.storage.setItem(
|
|
2867
|
+
return this.storage ? (this.storage.setItem(de, "1"), this.storage.removeItem(de), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2863
2868
|
} catch {
|
|
2864
2869
|
return Promise.resolve(!1);
|
|
2865
2870
|
}
|
|
@@ -2894,18 +2899,18 @@ class xt {
|
|
|
2894
2899
|
* See the License for the specific language governing permissions and
|
|
2895
2900
|
* limitations under the License.
|
|
2896
2901
|
*/
|
|
2897
|
-
function
|
|
2902
|
+
function vi() {
|
|
2898
2903
|
const n = g();
|
|
2899
|
-
return Ne(n) ||
|
|
2904
|
+
return Ne(n) || pe(n);
|
|
2900
2905
|
}
|
|
2901
|
-
const
|
|
2906
|
+
const Ii = 1e3, Ti = 10;
|
|
2902
2907
|
class Vt extends xt {
|
|
2903
2908
|
constructor() {
|
|
2904
2909
|
super(
|
|
2905
2910
|
() => window.localStorage,
|
|
2906
2911
|
"LOCAL"
|
|
2907
2912
|
/* PersistenceType.LOCAL */
|
|
2908
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
2913
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = vi() && Jn(), this.fallbackToPolling = Nt(), this._shouldAllowMigration = !0;
|
|
2909
2914
|
}
|
|
2910
2915
|
forAllChangedKeys(e) {
|
|
2911
2916
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2932,7 +2937,7 @@ class Vt extends xt {
|
|
|
2932
2937
|
const o = this.storage.getItem(i);
|
|
2933
2938
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2934
2939
|
}, s = this.storage.getItem(i);
|
|
2935
|
-
|
|
2940
|
+
Kn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ti) : r();
|
|
2936
2941
|
}
|
|
2937
2942
|
notifyListeners(e, t) {
|
|
2938
2943
|
this.localCache[e] = t;
|
|
@@ -2954,7 +2959,7 @@ class Vt extends xt {
|
|
|
2954
2959
|
!0
|
|
2955
2960
|
);
|
|
2956
2961
|
});
|
|
2957
|
-
},
|
|
2962
|
+
}, Ii);
|
|
2958
2963
|
}
|
|
2959
2964
|
stopPolling() {
|
|
2960
2965
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2984,7 +2989,7 @@ class Vt extends xt {
|
|
|
2984
2989
|
}
|
|
2985
2990
|
}
|
|
2986
2991
|
Vt.type = "LOCAL";
|
|
2987
|
-
const
|
|
2992
|
+
const wi = Vt;
|
|
2988
2993
|
/**
|
|
2989
2994
|
* @license
|
|
2990
2995
|
* Copyright 2020 Google LLC
|
|
@@ -3032,7 +3037,7 @@ const Ht = $t;
|
|
|
3032
3037
|
* See the License for the specific language governing permissions and
|
|
3033
3038
|
* limitations under the License.
|
|
3034
3039
|
*/
|
|
3035
|
-
function
|
|
3040
|
+
function yi(n) {
|
|
3036
3041
|
return Promise.all(n.map(async (e) => {
|
|
3037
3042
|
try {
|
|
3038
3043
|
return {
|
|
@@ -3063,7 +3068,7 @@ function wi(n) {
|
|
|
3063
3068
|
* See the License for the specific language governing permissions and
|
|
3064
3069
|
* limitations under the License.
|
|
3065
3070
|
*/
|
|
3066
|
-
class
|
|
3071
|
+
class ge {
|
|
3067
3072
|
constructor(e) {
|
|
3068
3073
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3069
3074
|
}
|
|
@@ -3077,7 +3082,7 @@ class me {
|
|
|
3077
3082
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3078
3083
|
if (t)
|
|
3079
3084
|
return t;
|
|
3080
|
-
const i = new
|
|
3085
|
+
const i = new ge(e);
|
|
3081
3086
|
return this.receivers.push(i), i;
|
|
3082
3087
|
}
|
|
3083
3088
|
isListeningto(e) {
|
|
@@ -3102,7 +3107,7 @@ class me {
|
|
|
3102
3107
|
eventId: i,
|
|
3103
3108
|
eventType: r
|
|
3104
3109
|
});
|
|
3105
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3110
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await yi(c);
|
|
3106
3111
|
t.ports[0].postMessage({
|
|
3107
3112
|
status: "done",
|
|
3108
3113
|
eventId: i,
|
|
@@ -3131,7 +3136,7 @@ class me {
|
|
|
3131
3136
|
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);
|
|
3132
3137
|
}
|
|
3133
3138
|
}
|
|
3134
|
-
|
|
3139
|
+
ge.receivers = [];
|
|
3135
3140
|
/**
|
|
3136
3141
|
* @license
|
|
3137
3142
|
* Copyright 2020 Google LLC
|
|
@@ -3170,7 +3175,7 @@ function Me(n = "", e = 10) {
|
|
|
3170
3175
|
* See the License for the specific language governing permissions and
|
|
3171
3176
|
* limitations under the License.
|
|
3172
3177
|
*/
|
|
3173
|
-
class
|
|
3178
|
+
class Ei {
|
|
3174
3179
|
constructor(e) {
|
|
3175
3180
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3176
3181
|
}
|
|
@@ -3214,8 +3219,8 @@ class yi {
|
|
|
3214
3219
|
}, i);
|
|
3215
3220
|
o = {
|
|
3216
3221
|
messageChannel: r,
|
|
3217
|
-
onMessage(
|
|
3218
|
-
const _ =
|
|
3222
|
+
onMessage(f) {
|
|
3223
|
+
const _ = f;
|
|
3219
3224
|
if (_.data.eventId === l)
|
|
3220
3225
|
switch (_.data.status) {
|
|
3221
3226
|
case "ack":
|
|
@@ -3270,7 +3275,7 @@ class yi {
|
|
|
3270
3275
|
function T() {
|
|
3271
3276
|
return window;
|
|
3272
3277
|
}
|
|
3273
|
-
function
|
|
3278
|
+
function ki(n) {
|
|
3274
3279
|
T().location.href = n;
|
|
3275
3280
|
}
|
|
3276
3281
|
/**
|
|
@@ -3292,7 +3297,7 @@ function Ei(n) {
|
|
|
3292
3297
|
function Wt() {
|
|
3293
3298
|
return typeof T().WorkerGlobalScope < "u" && typeof T().importScripts == "function";
|
|
3294
3299
|
}
|
|
3295
|
-
async function
|
|
3300
|
+
async function bi() {
|
|
3296
3301
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3297
3302
|
return null;
|
|
3298
3303
|
try {
|
|
@@ -3301,11 +3306,11 @@ async function ki() {
|
|
|
3301
3306
|
return null;
|
|
3302
3307
|
}
|
|
3303
3308
|
}
|
|
3304
|
-
function
|
|
3309
|
+
function Si() {
|
|
3305
3310
|
var n;
|
|
3306
3311
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3307
3312
|
}
|
|
3308
|
-
function
|
|
3313
|
+
function Ri() {
|
|
3309
3314
|
return Wt() ? self : null;
|
|
3310
3315
|
}
|
|
3311
3316
|
/**
|
|
@@ -3324,7 +3329,7 @@ function Si() {
|
|
|
3324
3329
|
* See the License for the specific language governing permissions and
|
|
3325
3330
|
* limitations under the License.
|
|
3326
3331
|
*/
|
|
3327
|
-
const jt = "firebaseLocalStorageDb",
|
|
3332
|
+
const jt = "firebaseLocalStorageDb", Pi = 1, he = "firebaseLocalStorage", Gt = "fbase_key";
|
|
3328
3333
|
class Z {
|
|
3329
3334
|
constructor(e) {
|
|
3330
3335
|
this.request = e;
|
|
@@ -3339,48 +3344,48 @@ class Z {
|
|
|
3339
3344
|
});
|
|
3340
3345
|
}
|
|
3341
3346
|
}
|
|
3342
|
-
function
|
|
3343
|
-
return n.transaction([
|
|
3347
|
+
function _e(n, e) {
|
|
3348
|
+
return n.transaction([he], e ? "readwrite" : "readonly").objectStore(he);
|
|
3344
3349
|
}
|
|
3345
|
-
function
|
|
3350
|
+
function Ai() {
|
|
3346
3351
|
const n = indexedDB.deleteDatabase(jt);
|
|
3347
3352
|
return new Z(n).toPromise();
|
|
3348
3353
|
}
|
|
3349
3354
|
function be() {
|
|
3350
|
-
const n = indexedDB.open(jt,
|
|
3355
|
+
const n = indexedDB.open(jt, Pi);
|
|
3351
3356
|
return new Promise((e, t) => {
|
|
3352
3357
|
n.addEventListener("error", () => {
|
|
3353
3358
|
t(n.error);
|
|
3354
3359
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3355
3360
|
const i = n.result;
|
|
3356
3361
|
try {
|
|
3357
|
-
i.createObjectStore(
|
|
3362
|
+
i.createObjectStore(he, { keyPath: Gt });
|
|
3358
3363
|
} catch (r) {
|
|
3359
3364
|
t(r);
|
|
3360
3365
|
}
|
|
3361
3366
|
}), n.addEventListener("success", async () => {
|
|
3362
3367
|
const i = n.result;
|
|
3363
|
-
i.objectStoreNames.contains(
|
|
3368
|
+
i.objectStoreNames.contains(he) ? e(i) : (i.close(), await Ai(), e(await be()));
|
|
3364
3369
|
});
|
|
3365
3370
|
});
|
|
3366
3371
|
}
|
|
3367
3372
|
async function et(n, e, t) {
|
|
3368
|
-
const i =
|
|
3369
|
-
[
|
|
3373
|
+
const i = _e(n, !0).put({
|
|
3374
|
+
[Gt]: e,
|
|
3370
3375
|
value: t
|
|
3371
3376
|
});
|
|
3372
3377
|
return new Z(i).toPromise();
|
|
3373
3378
|
}
|
|
3374
|
-
async function
|
|
3375
|
-
const t =
|
|
3379
|
+
async function Ci(n, e) {
|
|
3380
|
+
const t = _e(n, !1).get(e), i = await new Z(t).toPromise();
|
|
3376
3381
|
return i === void 0 ? null : i.value;
|
|
3377
3382
|
}
|
|
3378
3383
|
function tt(n, e) {
|
|
3379
|
-
const t =
|
|
3384
|
+
const t = _e(n, !0).delete(e);
|
|
3380
3385
|
return new Z(t).toPromise();
|
|
3381
3386
|
}
|
|
3382
|
-
const
|
|
3383
|
-
class
|
|
3387
|
+
const Oi = 800, Ni = 3;
|
|
3388
|
+
class Bt {
|
|
3384
3389
|
constructor() {
|
|
3385
3390
|
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(() => {
|
|
3386
3391
|
}, () => {
|
|
@@ -3396,7 +3401,7 @@ class Gt {
|
|
|
3396
3401
|
const i = await this._openDb();
|
|
3397
3402
|
return await e(i);
|
|
3398
3403
|
} catch (i) {
|
|
3399
|
-
if (t++ >
|
|
3404
|
+
if (t++ > Ni)
|
|
3400
3405
|
throw i;
|
|
3401
3406
|
this.db && (this.db.close(), this.db = void 0);
|
|
3402
3407
|
}
|
|
@@ -3412,7 +3417,7 @@ class Gt {
|
|
|
3412
3417
|
* As the worker we should listen to events from the main window.
|
|
3413
3418
|
*/
|
|
3414
3419
|
async initializeReceiver() {
|
|
3415
|
-
this.receiver =
|
|
3420
|
+
this.receiver = ge._getInstance(Ri()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3416
3421
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3417
3422
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3418
3423
|
"keyChanged"
|
|
@@ -3428,9 +3433,9 @@ class Gt {
|
|
|
3428
3433
|
*/
|
|
3429
3434
|
async initializeSender() {
|
|
3430
3435
|
var e, t;
|
|
3431
|
-
if (this.activeServiceWorker = await
|
|
3436
|
+
if (this.activeServiceWorker = await bi(), !this.activeServiceWorker)
|
|
3432
3437
|
return;
|
|
3433
|
-
this.sender = new
|
|
3438
|
+
this.sender = new Ei(this.activeServiceWorker);
|
|
3434
3439
|
const i = await this.sender._send(
|
|
3435
3440
|
"ping",
|
|
3436
3441
|
{},
|
|
@@ -3452,7 +3457,7 @@ class Gt {
|
|
|
3452
3457
|
* @param key - Storage key which changed.
|
|
3453
3458
|
*/
|
|
3454
3459
|
async notifyServiceWorker(e) {
|
|
3455
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3460
|
+
if (!(!this.sender || !this.activeServiceWorker || Si() !== this.activeServiceWorker))
|
|
3456
3461
|
try {
|
|
3457
3462
|
await this.sender._send(
|
|
3458
3463
|
"keyChanged",
|
|
@@ -3469,7 +3474,7 @@ class Gt {
|
|
|
3469
3474
|
if (!indexedDB)
|
|
3470
3475
|
return !1;
|
|
3471
3476
|
const e = await be();
|
|
3472
|
-
return await et(e,
|
|
3477
|
+
return await et(e, de, "1"), await tt(e, de), !0;
|
|
3473
3478
|
} catch {
|
|
3474
3479
|
}
|
|
3475
3480
|
return !1;
|
|
@@ -3486,7 +3491,7 @@ class Gt {
|
|
|
3486
3491
|
return this._withPendingWrite(async () => (await this._withRetries((i) => et(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3487
3492
|
}
|
|
3488
3493
|
async _get(e) {
|
|
3489
|
-
const t = await this._withRetries((i) =>
|
|
3494
|
+
const t = await this._withRetries((i) => Ci(i, e));
|
|
3490
3495
|
return this.localCache[e] = t, t;
|
|
3491
3496
|
}
|
|
3492
3497
|
async _remove(e) {
|
|
@@ -3494,7 +3499,7 @@ class Gt {
|
|
|
3494
3499
|
}
|
|
3495
3500
|
async _poll() {
|
|
3496
3501
|
const e = await this._withRetries((r) => {
|
|
3497
|
-
const s =
|
|
3502
|
+
const s = _e(r, !1).getAll();
|
|
3498
3503
|
return new Z(s).toPromise();
|
|
3499
3504
|
});
|
|
3500
3505
|
if (!e)
|
|
@@ -3517,7 +3522,7 @@ class Gt {
|
|
|
3517
3522
|
r(t);
|
|
3518
3523
|
}
|
|
3519
3524
|
startPolling() {
|
|
3520
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3525
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Oi);
|
|
3521
3526
|
}
|
|
3522
3527
|
stopPolling() {
|
|
3523
3528
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3529,8 +3534,8 @@ class Gt {
|
|
|
3529
3534
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
|
3530
3535
|
}
|
|
3531
3536
|
}
|
|
3532
|
-
|
|
3533
|
-
const
|
|
3537
|
+
Bt.type = "LOCAL";
|
|
3538
|
+
const Li = Bt;
|
|
3534
3539
|
new X(3e4, 6e4);
|
|
3535
3540
|
/**
|
|
3536
3541
|
* @license
|
|
@@ -3548,7 +3553,7 @@ new X(3e4, 6e4);
|
|
|
3548
3553
|
* See the License for the specific language governing permissions and
|
|
3549
3554
|
* limitations under the License.
|
|
3550
3555
|
*/
|
|
3551
|
-
function
|
|
3556
|
+
function Mi(n, e) {
|
|
3552
3557
|
return e ? k(e) : (u(
|
|
3553
3558
|
n._popupRedirectResolver,
|
|
3554
3559
|
n,
|
|
@@ -3602,26 +3607,26 @@ class Ue extends Ut {
|
|
|
3602
3607
|
return e && (t.idToken = e), t;
|
|
3603
3608
|
}
|
|
3604
3609
|
}
|
|
3605
|
-
function Mi(n) {
|
|
3606
|
-
return hi(n.auth, new Ue(n), n.bypassAuthState);
|
|
3607
|
-
}
|
|
3608
3610
|
function Ui(n) {
|
|
3611
|
+
return fi(n.auth, new Ue(n), n.bypassAuthState);
|
|
3612
|
+
}
|
|
3613
|
+
function Di(n) {
|
|
3609
3614
|
const { auth: e, user: t } = n;
|
|
3610
3615
|
return u(
|
|
3611
3616
|
t,
|
|
3612
3617
|
e,
|
|
3613
3618
|
"internal-error"
|
|
3614
3619
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3615
|
-
),
|
|
3620
|
+
), hi(t, new Ue(n), n.bypassAuthState);
|
|
3616
3621
|
}
|
|
3617
|
-
async function
|
|
3622
|
+
async function Fi(n) {
|
|
3618
3623
|
const { auth: e, user: t } = n;
|
|
3619
3624
|
return u(
|
|
3620
3625
|
t,
|
|
3621
3626
|
e,
|
|
3622
3627
|
"internal-error"
|
|
3623
3628
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3624
|
-
),
|
|
3629
|
+
), di(t, new Ue(n), n.bypassAuthState);
|
|
3625
3630
|
}
|
|
3626
3631
|
/**
|
|
3627
3632
|
* @license
|
|
@@ -3681,13 +3686,13 @@ class qt {
|
|
|
3681
3686
|
switch (e) {
|
|
3682
3687
|
case "signInViaPopup":
|
|
3683
3688
|
case "signInViaRedirect":
|
|
3684
|
-
return
|
|
3689
|
+
return Ui;
|
|
3685
3690
|
case "linkViaPopup":
|
|
3686
3691
|
case "linkViaRedirect":
|
|
3687
|
-
return
|
|
3692
|
+
return Fi;
|
|
3688
3693
|
case "reauthViaPopup":
|
|
3689
3694
|
case "reauthViaRedirect":
|
|
3690
|
-
return
|
|
3695
|
+
return Di;
|
|
3691
3696
|
default:
|
|
3692
3697
|
b(
|
|
3693
3698
|
this.auth,
|
|
@@ -3722,7 +3727,7 @@ class qt {
|
|
|
3722
3727
|
* See the License for the specific language governing permissions and
|
|
3723
3728
|
* limitations under the License.
|
|
3724
3729
|
*/
|
|
3725
|
-
const
|
|
3730
|
+
const xi = new X(2e3, 1e4);
|
|
3726
3731
|
class V extends qt {
|
|
3727
3732
|
constructor(e, t, i, r, s) {
|
|
3728
3733
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, V.currentPopupAction && V.currentPopupAction.cancel(), V.currentPopupAction = this;
|
|
@@ -3786,7 +3791,7 @@ class V extends qt {
|
|
|
3786
3791
|
);
|
|
3787
3792
|
return;
|
|
3788
3793
|
}
|
|
3789
|
-
this.pollId = window.setTimeout(e,
|
|
3794
|
+
this.pollId = window.setTimeout(e, xi.get());
|
|
3790
3795
|
};
|
|
3791
3796
|
e();
|
|
3792
3797
|
}
|
|
@@ -3808,8 +3813,8 @@ V.currentPopupAction = null;
|
|
|
3808
3813
|
* See the License for the specific language governing permissions and
|
|
3809
3814
|
* limitations under the License.
|
|
3810
3815
|
*/
|
|
3811
|
-
const
|
|
3812
|
-
class
|
|
3816
|
+
const Vi = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
3817
|
+
class $i extends qt {
|
|
3813
3818
|
constructor(e, t, i = !1) {
|
|
3814
3819
|
super(e, [
|
|
3815
3820
|
"signInViaRedirect",
|
|
@@ -3824,17 +3829,17 @@ class Vi extends qt {
|
|
|
3824
3829
|
* just return it.
|
|
3825
3830
|
*/
|
|
3826
3831
|
async execute() {
|
|
3827
|
-
let e =
|
|
3832
|
+
let e = oe.get(this.auth._key());
|
|
3828
3833
|
if (!e) {
|
|
3829
3834
|
try {
|
|
3830
|
-
const i = await
|
|
3835
|
+
const i = await Hi(this.resolver, this.auth) ? await super.execute() : null;
|
|
3831
3836
|
e = () => Promise.resolve(i);
|
|
3832
3837
|
} catch (t) {
|
|
3833
3838
|
e = () => Promise.reject(t);
|
|
3834
3839
|
}
|
|
3835
|
-
|
|
3840
|
+
oe.set(this.auth._key(), e);
|
|
3836
3841
|
}
|
|
3837
|
-
return this.bypassAuthState ||
|
|
3842
|
+
return this.bypassAuthState || oe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3838
3843
|
}
|
|
3839
3844
|
async onAuthEvent(e) {
|
|
3840
3845
|
if (e.type === "signInViaRedirect")
|
|
@@ -3855,26 +3860,26 @@ class Vi extends qt {
|
|
|
3855
3860
|
cleanUp() {
|
|
3856
3861
|
}
|
|
3857
3862
|
}
|
|
3858
|
-
async function
|
|
3859
|
-
const t =
|
|
3863
|
+
async function Hi(n, e) {
|
|
3864
|
+
const t = Gi(e), i = ji(n);
|
|
3860
3865
|
if (!await i._isAvailable())
|
|
3861
3866
|
return !1;
|
|
3862
3867
|
const r = await i._get(t) === "true";
|
|
3863
3868
|
return await i._remove(t), r;
|
|
3864
3869
|
}
|
|
3865
|
-
function
|
|
3866
|
-
|
|
3870
|
+
function Wi(n, e) {
|
|
3871
|
+
oe.set(n._key(), e);
|
|
3867
3872
|
}
|
|
3868
|
-
function
|
|
3873
|
+
function ji(n) {
|
|
3869
3874
|
return k(n._redirectPersistence);
|
|
3870
3875
|
}
|
|
3871
|
-
function
|
|
3872
|
-
return
|
|
3876
|
+
function Gi(n) {
|
|
3877
|
+
return se(Vi, n.config.apiKey, n.name);
|
|
3873
3878
|
}
|
|
3874
3879
|
async function Bi(n, e, t = !1) {
|
|
3875
3880
|
if (w(n.app))
|
|
3876
3881
|
return Promise.reject(L(n));
|
|
3877
|
-
const i =
|
|
3882
|
+
const i = me(n), r = Mi(i, e), o = await new $i(i, r, t).execute();
|
|
3878
3883
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3879
3884
|
}
|
|
3880
3885
|
/**
|
|
@@ -3893,8 +3898,8 @@ async function Bi(n, e, t = !1) {
|
|
|
3893
3898
|
* See the License for the specific language governing permissions and
|
|
3894
3899
|
* limitations under the License.
|
|
3895
3900
|
*/
|
|
3896
|
-
const
|
|
3897
|
-
class
|
|
3901
|
+
const qi = 10 * 60 * 1e3;
|
|
3902
|
+
class zi {
|
|
3898
3903
|
constructor(e) {
|
|
3899
3904
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3900
3905
|
}
|
|
@@ -3910,7 +3915,7 @@ class qi {
|
|
|
3910
3915
|
let t = !1;
|
|
3911
3916
|
return this.consumers.forEach((i) => {
|
|
3912
3917
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3913
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3918
|
+
}), this.hasHandledPotentialRedirect || !Ki(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3914
3919
|
}
|
|
3915
3920
|
sendToConsumer(e, t) {
|
|
3916
3921
|
var i;
|
|
@@ -3925,7 +3930,7 @@ class qi {
|
|
|
3925
3930
|
return t.filter.includes(e.type) && i;
|
|
3926
3931
|
}
|
|
3927
3932
|
hasEventBeenHandled(e) {
|
|
3928
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3933
|
+
return Date.now() - this.lastProcessedEventTime >= qi && this.cachedEventUids.clear(), this.cachedEventUids.has(nt(e));
|
|
3929
3934
|
}
|
|
3930
3935
|
saveEventToCache(e) {
|
|
3931
3936
|
this.cachedEventUids.add(nt(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -3937,7 +3942,7 @@ function nt(n) {
|
|
|
3937
3942
|
function zt({ type: n, error: e }) {
|
|
3938
3943
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3939
3944
|
}
|
|
3940
|
-
function
|
|
3945
|
+
function Ki(n) {
|
|
3941
3946
|
switch (n.type) {
|
|
3942
3947
|
case "signInViaRedirect":
|
|
3943
3948
|
case "linkViaRedirect":
|
|
@@ -3965,8 +3970,8 @@ function zi(n) {
|
|
|
3965
3970
|
* See the License for the specific language governing permissions and
|
|
3966
3971
|
* limitations under the License.
|
|
3967
3972
|
*/
|
|
3968
|
-
async function
|
|
3969
|
-
return
|
|
3973
|
+
async function Ji(n, e = {}) {
|
|
3974
|
+
return G(n, "GET", "/v1/projects", e);
|
|
3970
3975
|
}
|
|
3971
3976
|
/**
|
|
3972
3977
|
* @license
|
|
@@ -3984,14 +3989,14 @@ async function Ki(n, e = {}) {
|
|
|
3984
3989
|
* See the License for the specific language governing permissions and
|
|
3985
3990
|
* limitations under the License.
|
|
3986
3991
|
*/
|
|
3987
|
-
const
|
|
3988
|
-
async function
|
|
3992
|
+
const Yi = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Xi = /^https?/;
|
|
3993
|
+
async function Qi(n) {
|
|
3989
3994
|
if (n.config.emulator)
|
|
3990
3995
|
return;
|
|
3991
|
-
const { authorizedDomains: e } = await
|
|
3996
|
+
const { authorizedDomains: e } = await Ji(n);
|
|
3992
3997
|
for (const t of e)
|
|
3993
3998
|
try {
|
|
3994
|
-
if (
|
|
3999
|
+
if (Zi(t))
|
|
3995
4000
|
return;
|
|
3996
4001
|
} catch {
|
|
3997
4002
|
}
|
|
@@ -4001,15 +4006,15 @@ async function Xi(n) {
|
|
|
4001
4006
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4002
4007
|
);
|
|
4003
4008
|
}
|
|
4004
|
-
function
|
|
4009
|
+
function Zi(n) {
|
|
4005
4010
|
const e = Ee(), { protocol: t, hostname: i } = new URL(e);
|
|
4006
4011
|
if (n.startsWith("chrome-extension://")) {
|
|
4007
4012
|
const o = new URL(n);
|
|
4008
4013
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4009
4014
|
}
|
|
4010
|
-
if (!
|
|
4015
|
+
if (!Xi.test(t))
|
|
4011
4016
|
return !1;
|
|
4012
|
-
if (
|
|
4017
|
+
if (Yi.test(n))
|
|
4013
4018
|
return i === n;
|
|
4014
4019
|
const r = n.replace(/\./g, "\\.");
|
|
4015
4020
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4030,7 +4035,7 @@ function Qi(n) {
|
|
|
4030
4035
|
* See the License for the specific language governing permissions and
|
|
4031
4036
|
* limitations under the License.
|
|
4032
4037
|
*/
|
|
4033
|
-
const
|
|
4038
|
+
const er = new X(3e4, 6e4);
|
|
4034
4039
|
function it() {
|
|
4035
4040
|
const n = T().___jsl;
|
|
4036
4041
|
if (n != null && n.H) {
|
|
@@ -4040,7 +4045,7 @@ function it() {
|
|
|
4040
4045
|
n.CP[t] = null;
|
|
4041
4046
|
}
|
|
4042
4047
|
}
|
|
4043
|
-
function
|
|
4048
|
+
function tr(n) {
|
|
4044
4049
|
return new Promise((e, t) => {
|
|
4045
4050
|
var i, r, s;
|
|
4046
4051
|
function o() {
|
|
@@ -4055,7 +4060,7 @@ function er(n) {
|
|
|
4055
4060
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4056
4061
|
));
|
|
4057
4062
|
},
|
|
4058
|
-
timeout:
|
|
4063
|
+
timeout: er.get()
|
|
4059
4064
|
});
|
|
4060
4065
|
}
|
|
4061
4066
|
if (!((r = (i = T().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
@@ -4063,22 +4068,22 @@ function er(n) {
|
|
|
4063
4068
|
else if (!((s = T().gapi) === null || s === void 0) && s.load)
|
|
4064
4069
|
o();
|
|
4065
4070
|
else {
|
|
4066
|
-
const c =
|
|
4071
|
+
const c = ri("iframefcb");
|
|
4067
4072
|
return T()[c] = () => {
|
|
4068
4073
|
gapi.load ? o() : t(I(
|
|
4069
4074
|
n,
|
|
4070
4075
|
"network-request-failed"
|
|
4071
4076
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4072
4077
|
));
|
|
4073
|
-
},
|
|
4078
|
+
}, ni(`${ii()}?onload=${c}`).catch((a) => t(a));
|
|
4074
4079
|
}
|
|
4075
4080
|
}).catch((e) => {
|
|
4076
|
-
throw
|
|
4081
|
+
throw ae = null, e;
|
|
4077
4082
|
});
|
|
4078
4083
|
}
|
|
4079
|
-
let
|
|
4080
|
-
function
|
|
4081
|
-
return
|
|
4084
|
+
let ae = null;
|
|
4085
|
+
function nr(n) {
|
|
4086
|
+
return ae = ae || tr(n), ae;
|
|
4082
4087
|
}
|
|
4083
4088
|
/**
|
|
4084
4089
|
* @license
|
|
@@ -4096,7 +4101,7 @@ function tr(n) {
|
|
|
4096
4101
|
* See the License for the specific language governing permissions and
|
|
4097
4102
|
* limitations under the License.
|
|
4098
4103
|
*/
|
|
4099
|
-
const
|
|
4104
|
+
const ir = new X(5e3, 15e3), rr = "__/auth/iframe", sr = "emulator/auth/iframe", or = {
|
|
4100
4105
|
style: {
|
|
4101
4106
|
position: "absolute",
|
|
4102
4107
|
top: "-100px",
|
|
@@ -4105,13 +4110,13 @@ const nr = new X(5e3, 15e3), ir = "__/auth/iframe", rr = "emulator/auth/iframe",
|
|
|
4105
4110
|
},
|
|
4106
4111
|
"aria-hidden": "true",
|
|
4107
4112
|
tabindex: "-1"
|
|
4108
|
-
},
|
|
4113
|
+
}, ar = /* @__PURE__ */ new Map([
|
|
4109
4114
|
["identitytoolkit.googleapis.com", "p"],
|
|
4110
4115
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4111
4116
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4112
4117
|
// test
|
|
4113
4118
|
]);
|
|
4114
|
-
function
|
|
4119
|
+
function cr(n) {
|
|
4115
4120
|
const e = n.config;
|
|
4116
4121
|
u(
|
|
4117
4122
|
e.authDomain,
|
|
@@ -4119,17 +4124,17 @@ function ar(n) {
|
|
|
4119
4124
|
"auth-domain-config-required"
|
|
4120
4125
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4121
4126
|
);
|
|
4122
|
-
const t = e.emulator ? Ce(e,
|
|
4127
|
+
const t = e.emulator ? Ce(e, sr) : `https://${n.config.authDomain}/${rr}`, i = {
|
|
4123
4128
|
apiKey: e.apiKey,
|
|
4124
4129
|
appName: n.name,
|
|
4125
4130
|
v: J
|
|
4126
|
-
}, r =
|
|
4131
|
+
}, r = ar.get(n.config.apiHost);
|
|
4127
4132
|
r && (i.eid = r);
|
|
4128
4133
|
const s = n._getFrameworks();
|
|
4129
4134
|
return s.length && (i.fw = s.join(",")), `${t}?${Y(i).slice(1)}`;
|
|
4130
4135
|
}
|
|
4131
|
-
async function
|
|
4132
|
-
const e = await
|
|
4136
|
+
async function lr(n) {
|
|
4137
|
+
const e = await nr(n), t = T().gapi;
|
|
4133
4138
|
return u(
|
|
4134
4139
|
t,
|
|
4135
4140
|
n,
|
|
@@ -4137,9 +4142,9 @@ async function cr(n) {
|
|
|
4137
4142
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4138
4143
|
), e.open({
|
|
4139
4144
|
where: document.body,
|
|
4140
|
-
url:
|
|
4145
|
+
url: cr(n),
|
|
4141
4146
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4142
|
-
attributes:
|
|
4147
|
+
attributes: or,
|
|
4143
4148
|
dontclear: !0
|
|
4144
4149
|
}, (i) => new Promise(async (r, s) => {
|
|
4145
4150
|
await i.restyle({
|
|
@@ -4152,7 +4157,7 @@ async function cr(n) {
|
|
|
4152
4157
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4153
4158
|
), c = T().setTimeout(() => {
|
|
4154
4159
|
s(o);
|
|
4155
|
-
},
|
|
4160
|
+
}, ir.get());
|
|
4156
4161
|
function a() {
|
|
4157
4162
|
T().clearTimeout(c), r(i);
|
|
4158
4163
|
}
|
|
@@ -4177,12 +4182,12 @@ async function cr(n) {
|
|
|
4177
4182
|
* See the License for the specific language governing permissions and
|
|
4178
4183
|
* limitations under the License.
|
|
4179
4184
|
*/
|
|
4180
|
-
const
|
|
4185
|
+
const ur = {
|
|
4181
4186
|
location: "yes",
|
|
4182
4187
|
resizable: "yes",
|
|
4183
4188
|
statusbar: "yes",
|
|
4184
4189
|
toolbar: "no"
|
|
4185
|
-
},
|
|
4190
|
+
}, dr = 500, hr = 600, fr = "_blank", pr = "http://localhost";
|
|
4186
4191
|
class rt {
|
|
4187
4192
|
constructor(e) {
|
|
4188
4193
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4195,33 +4200,33 @@ class rt {
|
|
|
4195
4200
|
}
|
|
4196
4201
|
}
|
|
4197
4202
|
}
|
|
4198
|
-
function
|
|
4203
|
+
function mr(n, e, t, i = dr, r = hr) {
|
|
4199
4204
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4200
4205
|
let c = "";
|
|
4201
|
-
const a = Object.assign(Object.assign({},
|
|
4206
|
+
const a = Object.assign(Object.assign({}, ur), {
|
|
4202
4207
|
width: i.toString(),
|
|
4203
4208
|
height: r.toString(),
|
|
4204
4209
|
top: s,
|
|
4205
4210
|
left: o
|
|
4206
4211
|
}), l = g().toLowerCase();
|
|
4207
|
-
t && (c = Rt(l) ?
|
|
4208
|
-
const d = Object.entries(a).reduce((_, [
|
|
4209
|
-
if (
|
|
4210
|
-
return
|
|
4211
|
-
const
|
|
4212
|
+
t && (c = Rt(l) ? fr : t), St(l) && (e = e || pr, a.scrollbars = "yes");
|
|
4213
|
+
const d = Object.entries(a).reduce((_, [x, M]) => `${_}${x}=${M},`, "");
|
|
4214
|
+
if (zn(l) && c !== "_self")
|
|
4215
|
+
return gr(e || "", c), new rt(null);
|
|
4216
|
+
const f = window.open(e || "", c, d);
|
|
4212
4217
|
u(
|
|
4213
|
-
|
|
4218
|
+
f,
|
|
4214
4219
|
n,
|
|
4215
4220
|
"popup-blocked"
|
|
4216
4221
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
4217
4222
|
);
|
|
4218
4223
|
try {
|
|
4219
|
-
|
|
4224
|
+
f.focus();
|
|
4220
4225
|
} catch {
|
|
4221
4226
|
}
|
|
4222
|
-
return new rt(
|
|
4227
|
+
return new rt(f);
|
|
4223
4228
|
}
|
|
4224
|
-
function
|
|
4229
|
+
function gr(n, e) {
|
|
4225
4230
|
const t = document.createElement("a");
|
|
4226
4231
|
t.href = n, t.target = e;
|
|
4227
4232
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4243,7 +4248,7 @@ function mr(n, e) {
|
|
|
4243
4248
|
* See the License for the specific language governing permissions and
|
|
4244
4249
|
* limitations under the License.
|
|
4245
4250
|
*/
|
|
4246
|
-
const
|
|
4251
|
+
const _r = "__/auth/handler", vr = "emulator/auth/handler", Ir = encodeURIComponent("fac");
|
|
4247
4252
|
async function st(n, e, t, i, r, s) {
|
|
4248
4253
|
u(
|
|
4249
4254
|
n.config.authDomain,
|
|
@@ -4266,22 +4271,22 @@ async function st(n, e, t, i, r, s) {
|
|
|
4266
4271
|
};
|
|
4267
4272
|
if (e instanceof Dt) {
|
|
4268
4273
|
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", yn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4269
|
-
for (const [d,
|
|
4270
|
-
o[d] =
|
|
4274
|
+
for (const [d, f] of Object.entries({}))
|
|
4275
|
+
o[d] = f;
|
|
4271
4276
|
}
|
|
4272
4277
|
if (e instanceof Q) {
|
|
4273
|
-
const d = e.getScopes().filter((
|
|
4278
|
+
const d = e.getScopes().filter((f) => f !== "");
|
|
4274
4279
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4275
4280
|
}
|
|
4276
4281
|
n.tenantId && (o.tid = n.tenantId);
|
|
4277
4282
|
const c = o;
|
|
4278
4283
|
for (const d of Object.keys(c))
|
|
4279
4284
|
c[d] === void 0 && delete c[d];
|
|
4280
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4281
|
-
return `${
|
|
4285
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Ir}=${encodeURIComponent(a)}` : "";
|
|
4286
|
+
return `${Tr(n)}?${Y(c).slice(1)}${l}`;
|
|
4282
4287
|
}
|
|
4283
|
-
function
|
|
4284
|
-
return n.emulator ? Ce(n,
|
|
4288
|
+
function Tr({ config: n }) {
|
|
4289
|
+
return n.emulator ? Ce(n, vr) : `https://${n.authDomain}/${_r}`;
|
|
4285
4290
|
}
|
|
4286
4291
|
/**
|
|
4287
4292
|
* @license
|
|
@@ -4300,9 +4305,9 @@ function Ir({ config: n }) {
|
|
|
4300
4305
|
* limitations under the License.
|
|
4301
4306
|
*/
|
|
4302
4307
|
const we = "webStorageSupport";
|
|
4303
|
-
class
|
|
4308
|
+
class wr {
|
|
4304
4309
|
constructor() {
|
|
4305
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Ht, this._completeRedirectFn = Bi, this._overrideRedirectResult =
|
|
4310
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Ht, this._completeRedirectFn = Bi, this._overrideRedirectResult = Wi;
|
|
4306
4311
|
}
|
|
4307
4312
|
// Wrapping in async even though we don't await anywhere in order
|
|
4308
4313
|
// to make sure errors are raised as promise rejections
|
|
@@ -4310,12 +4315,12 @@ class Tr {
|
|
|
4310
4315
|
var s;
|
|
4311
4316
|
S((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4312
4317
|
const o = await st(e, t, i, Ee(), r);
|
|
4313
|
-
return
|
|
4318
|
+
return mr(e, o, Me());
|
|
4314
4319
|
}
|
|
4315
4320
|
async _openRedirect(e, t, i, r) {
|
|
4316
4321
|
await this._originValidation(e);
|
|
4317
4322
|
const s = await st(e, t, i, Ee(), r);
|
|
4318
|
-
return
|
|
4323
|
+
return ki(s), new Promise(() => {
|
|
4319
4324
|
});
|
|
4320
4325
|
}
|
|
4321
4326
|
_initialize(e) {
|
|
@@ -4330,7 +4335,7 @@ class Tr {
|
|
|
4330
4335
|
}), i;
|
|
4331
4336
|
}
|
|
4332
4337
|
async initAndGetManager(e) {
|
|
4333
|
-
const t = await
|
|
4338
|
+
const t = await lr(e), i = new zi(e);
|
|
4334
4339
|
return t.register("authEvent", (r) => (u(
|
|
4335
4340
|
r == null ? void 0 : r.authEvent,
|
|
4336
4341
|
e,
|
|
@@ -4354,13 +4359,13 @@ class Tr {
|
|
|
4354
4359
|
}
|
|
4355
4360
|
_originValidation(e) {
|
|
4356
4361
|
const t = e._key();
|
|
4357
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4362
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Qi(e)), this.originValidationPromises[t];
|
|
4358
4363
|
}
|
|
4359
4364
|
get _shouldInitProactively() {
|
|
4360
|
-
return Nt() || Ne() ||
|
|
4365
|
+
return Nt() || Ne() || pe();
|
|
4361
4366
|
}
|
|
4362
4367
|
}
|
|
4363
|
-
const
|
|
4368
|
+
const yr = wr;
|
|
4364
4369
|
var ot = "@firebase/auth", at = "1.7.5";
|
|
4365
4370
|
/**
|
|
4366
4371
|
* @license
|
|
@@ -4378,7 +4383,7 @@ var ot = "@firebase/auth", at = "1.7.5";
|
|
|
4378
4383
|
* See the License for the specific language governing permissions and
|
|
4379
4384
|
* limitations under the License.
|
|
4380
4385
|
*/
|
|
4381
|
-
class
|
|
4386
|
+
class Er {
|
|
4382
4387
|
constructor(e) {
|
|
4383
4388
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4384
4389
|
}
|
|
@@ -4429,7 +4434,7 @@ class yr {
|
|
|
4429
4434
|
* See the License for the specific language governing permissions and
|
|
4430
4435
|
* limitations under the License.
|
|
4431
4436
|
*/
|
|
4432
|
-
function
|
|
4437
|
+
function kr(n) {
|
|
4433
4438
|
switch (n) {
|
|
4434
4439
|
case "Node":
|
|
4435
4440
|
return "node";
|
|
@@ -4445,8 +4450,8 @@ function Er(n) {
|
|
|
4445
4450
|
return;
|
|
4446
4451
|
}
|
|
4447
4452
|
}
|
|
4448
|
-
function
|
|
4449
|
-
je(new
|
|
4453
|
+
function br(n) {
|
|
4454
|
+
je(new Ge(
|
|
4450
4455
|
"auth",
|
|
4451
4456
|
(e, { options: t }) => {
|
|
4452
4457
|
const i = e.getProvider("app").getImmediate(), r = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: c } = i.options;
|
|
@@ -4459,8 +4464,8 @@ function kr(n) {
|
|
|
4459
4464
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4460
4465
|
apiScheme: "https",
|
|
4461
4466
|
sdkClientVersion: Lt(n)
|
|
4462
|
-
}, l = new
|
|
4463
|
-
return
|
|
4467
|
+
}, l = new ei(i, r, s, a);
|
|
4468
|
+
return oi(l, t), l;
|
|
4464
4469
|
},
|
|
4465
4470
|
"PUBLIC"
|
|
4466
4471
|
/* ComponentType.PUBLIC */
|
|
@@ -4472,21 +4477,21 @@ function kr(n) {
|
|
|
4472
4477
|
"auth-internal"
|
|
4473
4478
|
/* _ComponentName.AUTH_INTERNAL */
|
|
4474
4479
|
).initialize();
|
|
4475
|
-
})), je(new
|
|
4480
|
+
})), je(new Ge(
|
|
4476
4481
|
"auth-internal",
|
|
4477
4482
|
(e) => {
|
|
4478
|
-
const t =
|
|
4483
|
+
const t = me(e.getProvider(
|
|
4479
4484
|
"auth"
|
|
4480
4485
|
/* _ComponentName.AUTH */
|
|
4481
4486
|
).getImmediate());
|
|
4482
|
-
return ((i) => new
|
|
4487
|
+
return ((i) => new Er(i))(t);
|
|
4483
4488
|
},
|
|
4484
4489
|
"PRIVATE"
|
|
4485
4490
|
/* ComponentType.PRIVATE */
|
|
4486
4491
|
).setInstantiationMode(
|
|
4487
4492
|
"EXPLICIT"
|
|
4488
4493
|
/* InstantiationMode.EXPLICIT */
|
|
4489
|
-
)), ye(ot, at,
|
|
4494
|
+
)), ye(ot, at, kr(n)), ye(ot, at, "esm2017");
|
|
4490
4495
|
}
|
|
4491
4496
|
/**
|
|
4492
4497
|
* @license
|
|
@@ -4504,11 +4509,11 @@ function kr(n) {
|
|
|
4504
4509
|
* See the License for the specific language governing permissions and
|
|
4505
4510
|
* limitations under the License.
|
|
4506
4511
|
*/
|
|
4507
|
-
const
|
|
4512
|
+
const Sr = 5 * 60, Rr = ft("authIdTokenMaxAge") || Sr;
|
|
4508
4513
|
let ct = null;
|
|
4509
|
-
const
|
|
4514
|
+
const Pr = (n) => async (e) => {
|
|
4510
4515
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4511
|
-
if (i && i >
|
|
4516
|
+
if (i && i > Rr)
|
|
4512
4517
|
return;
|
|
4513
4518
|
const r = t == null ? void 0 : t.token;
|
|
4514
4519
|
ct !== r && (ct = r, await fetch(n, {
|
|
@@ -4518,33 +4523,33 @@ const Rr = (n) => async (e) => {
|
|
|
4518
4523
|
} : {}
|
|
4519
4524
|
}));
|
|
4520
4525
|
};
|
|
4521
|
-
function
|
|
4526
|
+
function Ar(n = vn()) {
|
|
4522
4527
|
const e = pt(n, "auth");
|
|
4523
4528
|
if (e.isInitialized())
|
|
4524
4529
|
return e.getImmediate();
|
|
4525
|
-
const t =
|
|
4526
|
-
popupRedirectResolver:
|
|
4530
|
+
const t = si(n, {
|
|
4531
|
+
popupRedirectResolver: yr,
|
|
4527
4532
|
persistence: [
|
|
4528
|
-
|
|
4529
|
-
|
|
4533
|
+
Li,
|
|
4534
|
+
wi,
|
|
4530
4535
|
Ht
|
|
4531
4536
|
]
|
|
4532
4537
|
}), i = ft("authTokenSyncURL");
|
|
4533
4538
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4534
4539
|
const s = new URL(i, location.origin);
|
|
4535
4540
|
if (location.origin === s.origin) {
|
|
4536
|
-
const o =
|
|
4537
|
-
|
|
4541
|
+
const o = Pr(s.toString());
|
|
4542
|
+
_i(t, o, () => o(t.currentUser)), gi(t, (c) => o(c));
|
|
4538
4543
|
}
|
|
4539
4544
|
}
|
|
4540
4545
|
const r = _n("auth");
|
|
4541
|
-
return r &&
|
|
4546
|
+
return r && ai(t, `http://${r}`), t;
|
|
4542
4547
|
}
|
|
4543
|
-
function
|
|
4548
|
+
function Cr() {
|
|
4544
4549
|
var n, e;
|
|
4545
4550
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4546
4551
|
}
|
|
4547
|
-
|
|
4552
|
+
ti({
|
|
4548
4553
|
loadJS(n) {
|
|
4549
4554
|
return new Promise((e, t) => {
|
|
4550
4555
|
const i = document.createElement("script");
|
|
@@ -4554,53 +4559,60 @@ ei({
|
|
|
4554
4559
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4555
4560
|
);
|
|
4556
4561
|
s.customData = r, t(s);
|
|
4557
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4562
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", Cr().appendChild(i);
|
|
4558
4563
|
});
|
|
4559
4564
|
},
|
|
4560
4565
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4561
4566
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4562
4567
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4563
4568
|
});
|
|
4564
|
-
|
|
4569
|
+
br(
|
|
4565
4570
|
"Browser"
|
|
4566
4571
|
/* ClientPlatform.BROWSER */
|
|
4567
4572
|
);
|
|
4568
|
-
var
|
|
4569
|
-
const
|
|
4573
|
+
var Or = { 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", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" }, Nr = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" }, Lr = { mode: "development", appMode: "mf" };
|
|
4574
|
+
const Mr = {
|
|
4570
4575
|
key: 1,
|
|
4571
4576
|
class: "h-full w-full"
|
|
4572
|
-
},
|
|
4577
|
+
}, Ur = ["src"], Yr = /* @__PURE__ */ lt({
|
|
4573
4578
|
__name: "App",
|
|
4574
4579
|
setup(n) {
|
|
4575
|
-
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c =
|
|
4576
|
-
const p = e.currentCountry.value || "MY", m =
|
|
4577
|
-
return `${
|
|
4580
|
+
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c = ne(o.query.showHeader !== "false"), a = ne(!1), { currentBusiness: l } = We(), d = ne(!1), f = Ve(() => i.version), _ = Ve(() => {
|
|
4581
|
+
const p = e.currentCountry.value || "MY", m = Be.getIdToken(), v = l.value._id;
|
|
4582
|
+
return `${Nr.marketingV1Portal}/b/${v}/marketing/overview?showHeader=false&country=${p}&token=${m}`;
|
|
4578
4583
|
});
|
|
4579
|
-
async function
|
|
4584
|
+
async function x() {
|
|
4580
4585
|
if (En().length) {
|
|
4581
4586
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4582
4587
|
return;
|
|
4583
4588
|
}
|
|
4584
|
-
const p = kn(
|
|
4585
|
-
await
|
|
4589
|
+
const p = kn(Or.firebase), m = await sn.getCustomToken(), v = Ar();
|
|
4590
|
+
await mi(v, m), bn(p), console.log("initFirebase", p);
|
|
4586
4591
|
}
|
|
4587
4592
|
const M = async () => {
|
|
4588
|
-
d.value = !1, await tn(), console.log("forceRerender"),
|
|
4593
|
+
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value && f.value === "v2" ? e.registerSidebarComponent(Pn) : e.hideSidebarToggle(!0), await x(), a.value = !0, d.value = !0;
|
|
4589
4594
|
};
|
|
4595
|
+
async function ee() {
|
|
4596
|
+
var p;
|
|
4597
|
+
console.log("initRemyClient.."), await Rn.init({
|
|
4598
|
+
token: ((p = e.sessionUser.value) == null ? void 0 : p.token) || "",
|
|
4599
|
+
dev: Lr.mode === "development"
|
|
4600
|
+
});
|
|
4601
|
+
}
|
|
4590
4602
|
return Xt(() => {
|
|
4591
4603
|
if (Sn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4592
|
-
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0],
|
|
4593
|
-
p == null || p.classList.add("!hidden"), m == null || m.classList.add("!pt-0"), v == null || v.classList.add("!pt-0"),
|
|
4604
|
+
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0], U = document.getElementsByTagName("main")[0];
|
|
4605
|
+
p == null || p.classList.add("!hidden"), m == null || m.classList.add("!pt-0"), v == null || v.classList.add("!pt-0"), U == null || U.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4594
4606
|
}
|
|
4595
|
-
l.value != null && (console.log("App mounted, forceRerender"), M());
|
|
4607
|
+
l.value != null && (console.log("App mounted, forceRerender"), M()), ee();
|
|
4596
4608
|
}), ut(
|
|
4597
4609
|
() => e.currentBusiness.value,
|
|
4598
4610
|
async (p, m) => {
|
|
4599
4611
|
console.log("Current business changed"), p != null && p._id != m._id && (console.log("forceRerender when business changes", p, m), M());
|
|
4600
4612
|
}
|
|
4601
|
-
), (p, m) => (
|
|
4602
|
-
P(d) && P(
|
|
4603
|
-
P(d) && P(
|
|
4613
|
+
), (p, m) => (ie(), $e(Qt, null, [
|
|
4614
|
+
P(d) && P(f) === "v2" ? (ie(), dt(P(rn), { key: 0 })) : He("", !0),
|
|
4615
|
+
P(d) && P(f) !== "v2" ? (ie(), $e("div", Mr, [
|
|
4604
4616
|
Zt(dn, {
|
|
4605
4617
|
json: { url: P(_) }
|
|
4606
4618
|
}, null, 8, ["json"]),
|
|
@@ -4610,11 +4622,11 @@ const Nr = {
|
|
|
4610
4622
|
height: "100%",
|
|
4611
4623
|
width: "100%",
|
|
4612
4624
|
src: P(_)
|
|
4613
|
-
}, null, 8,
|
|
4625
|
+
}, null, 8, Ur)
|
|
4614
4626
|
])) : He("", !0)
|
|
4615
4627
|
], 64));
|
|
4616
4628
|
}
|
|
4617
4629
|
});
|
|
4618
4630
|
export {
|
|
4619
|
-
|
|
4631
|
+
Yr as default
|
|
4620
4632
|
};
|