@feedmepos/mf-connect 0.1.110-prod → 0.1.111-prod
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/{App-BIuwkgjE.js → App-D3pYl3WL.js} +494 -475
- package/dist/{Bin-B6PDvhj7.js → Bin-DOZqpbYH.js} +8 -8
- package/dist/{Broadcast-BsUYu9Kq.js → Broadcast-DZ4SP99P.js} +82 -79
- package/dist/{CampaignAnalytic-D0_Kh2Sv.js → CampaignAnalytic-cFKvCgxX.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-bfMr_7XS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B0eVEubS.js} +7 -6
- package/dist/{Card-D5sknDf_.js → Card-B5ni027Q.js} +21 -20
- package/dist/{Collections-B0umkbKL.js → Collections-9QK5hbLo.js} +9 -9
- package/dist/{Credit-DMrHYtmf.js → Credit-8Ouy4O9a.js} +11 -11
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-IuEHozwd.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C06_qwVx.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYxswo-Z.js} +33 -32
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CHCLAOYT.js → EffectSheet.vue_vue_type_style_index_0_lang-Dv0q3B8m.js} +6 -6
- package/dist/{Experience-3xvTI41j.js → Experience-DMh4hR1S.js} +86 -83
- package/dist/{FileSaver.min-CEjHOYSg.js → FileSaver.min-Bx9mdUgJ.js} +1 -1
- package/dist/{Game-Drkfnm94.js → Game-CL0TZvg1.js} +12 -12
- package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-Bz5kIfoM.js +424 -0
- package/dist/Goals-Dz5Vp-lj.js +247 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BYIIaPD9.js → ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js} +1 -1
- package/dist/{Index-BNfZ-mAu.js → Index-kH8aAegB.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CqJLimu2.js → LocationPicker.vue_vue_type_script_setup_true_lang-CFrgC3Ka.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BnMjqLMU.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DPIFLdBc.js} +1 -1
- package/dist/{LoyaltyDashboard-BmRdWFCw.js → LoyaltyDashboard-BBxEoWol.js} +1216 -1170
- package/dist/{MainLayout-m4H59w6_.js → MainLayout-2BLwDyHQ.js} +3 -3
- package/dist/{Marketing-BqdCdc76.js → Marketing-C4OnSV-c.js} +4 -4
- package/dist/{MarketingMaterialEdit-UjCEMJ7c.js → MarketingMaterialEdit-DFhpsI2-.js} +6 -6
- package/dist/{Member-BbpQizye.js → Member-CT9WwxP0.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BbL7cw4g.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-C7yznkUn.js} +25 -24
- package/dist/{MemberImportHistory-FYMyd_uX.js → MemberImportHistory-B__BFID7.js} +7 -7
- package/dist/{MemberList-CFtv0HI5.js → MemberList-DgLI4wty.js} +14 -14
- package/dist/{MemberTransactions-BYpugGs7.js → MemberTransactions-UFx_DZYe.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CDzQ0rnK.js → MessageInput.vue_vue_type_script_setup_true_lang-BFjZA8Y6.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BlhwugZQ.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Df9bxbUl.js} +1 -1
- package/dist/{Mission-BMhY1kl1.js → Mission-CawzGzDu.js} +83 -80
- package/dist/{Overview-BmZelkd_.js → Overview-CAtTlEVa.js} +4 -4
- package/dist/{Overview-E0KL28Fc.js → Overview-D19oSo24.js} +21 -20
- package/dist/{Point-BX5p9ZVF.js → Point-BPAGmKAj.js} +119 -110
- package/dist/{Promotion-D662WYaR.js → Promotion-B0Uf9vjL.js} +89 -86
- package/dist/{Queue-CI5rumWZ.js → Queue-CJEAFss_.js} +13 -12
- package/dist/{Record-DRZVEW0I.js → Record-s6hSQG2P.js} +9 -9
- package/dist/{Review-yMVGBErp.js → Review-DhNCbAOm.js} +2 -2
- package/dist/{ReviewFacebookCallback-Docv-Uil.js → ReviewFacebookCallback-DeZqcpJo.js} +5 -5
- package/dist/{ReviewGoogleCallback-3xVh_G7M.js → ReviewGoogleCallback-D8ENWii2.js} +5 -5
- package/dist/{Reward-lzBLyu0x.js → Reward-BT00QsXL.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bs32tPvC.js → RewardGroup.vue_vue_type_script_setup_true_lang-DaZDGhbm.js} +14 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-fNwFSHL1.js → RuleGroup.vue_vue_type_script_setup_true_lang-BvxbKSkB.js} +16 -15
- package/dist/{Segment-BRPf66q8.js → Segment-BuGhX9zg.js} +27 -26
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DQmbCewC.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DB718_4P.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-fHX_ftax.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkgXxy0C.js} +4 -4
- package/dist/{Setting-D5k2jymY.js → Setting-BOWPp05N.js} +14 -14
- package/dist/{SettingAdvertisements-1Oc29mzb.js → SettingAdvertisements-aqFErKAr.js} +12 -12
- package/dist/{Settings-B3OCofxq.js → Settings-DekXvE-R.js} +5 -5
- package/dist/{Store-B8WVn8ZA.js → Store-DpVlMuau.js} +24 -23
- package/dist/{StoreRewards-C7_RKZ00.js → StoreRewards-D2pTL2oA.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CmqgxDJ6.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CNDv6eiZ.js} +26 -25
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BW-HTNMr.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C-C3RSeW.js} +2 -2
- package/dist/{Tier-8pGUR8GA.js → Tier-OyE8oH2r.js} +333 -330
- package/dist/{Title-DnYVX2k8.js → Title-DAl7CKL_.js} +24 -23
- package/dist/{Transaction-YJkVkePM.js → Transaction-mvKzTgLx.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-ATWU025y.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C0yHxQVr.js} +6 -6
- package/dist/Voucher-D2QGWSxs.js +837 -0
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-C1dCFS2S.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Bt2YB745.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CbUdt4GK.js → ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js} +2 -2
- package/dist/{app-DoUnw6pe.js → app-QxosLNkH.js} +1133 -824
- package/dist/app.js +1 -1
- package/dist/{business-B-PlsFIY.js → business-CbqG6NXr.js} +1 -1
- package/dist/{campaign-GkMET7FI.js → campaign-Co4Lq-Wz.js} +8 -8
- package/dist/{campaign-yUUxyk0R.js → campaign-Rj7oDBnN.js} +2 -2
- package/dist/{campaign.enum-DbPiwqfi.js → campaign.enum-B7vdNYKd.js} +1 -1
- package/dist/{campaign.fn-CF5mOcSE.js → campaign.fn-DolD3lYJ.js} +3 -3
- package/dist/{collectible.enum-CbOzGIud.js → collectible.enum-BsQseg7-.js} +1 -1
- package/dist/{collection.fn-BByCTXVz.js → collection.fn-EbUIyB1X.js} +2 -2
- package/dist/{effect-jriAOaEq.js → effect-B_91OlcX.js} +1 -1
- package/dist/{email-addresses-DH4xgace.js → email-addresses-DXnYZG-e.js} +2 -2
- package/dist/{export-CN3lbc2j.js → export-D0hWZSfH.js} +3 -3
- package/dist/{helper-CQjM35T_.js → helper-_uhiXya1.js} +1 -1
- package/dist/{index-CptAtzHf.js → index-BBihP1s2.js} +2 -2
- package/dist/index-BWgc2-Qz.js +171 -0
- package/dist/{index-De9f7Fwe.js → index-BZ2b0Pk6.js} +5 -5
- package/dist/{index-BLOFQAMK.js → index-CDm0BWa3.js} +1 -1
- package/dist/{index-iZDBfoRk.js → index-CWUmrVo_.js} +2 -2
- package/dist/{index-Dr68iOIO.js → index-C_1iqF1Q.js} +1 -1
- package/dist/{index-Duqxyi9L.js → index-Cp7oHMm3.js} +1109 -32
- package/dist/{index-BHYKmUkc.js → index-CzYxnDWP.js} +2 -2
- package/dist/{index-v3DTwO9s.js → index-Df4l6y-S.js} +6 -6
- package/dist/{index-MtVkfI7s.js → index-DlGnYR5y.js} +3 -3
- package/dist/{index-BlKeV6aM.js → index-DlQJZNwD.js} +1 -1
- package/dist/{index-CCBpqK6M.js → index-DuhRCI0L.js} +1 -1
- package/dist/{index-D1vRPik1.js → index-DzBzClHP.js} +1 -1
- package/dist/{index-DszI88g9.js → index-aCuOvuEC.js} +1 -1
- package/dist/{index-BPTCREXM.js → index-tbo0pMIu.js} +1 -1
- package/dist/{index-DKZEN-aI.js → index-uuNGb1nv.js} +3 -3
- package/dist/{index-DEmV6_BZ.js → index-xuFTeVrb.js} +9 -8
- package/dist/{index.esm2017-DvOnDQUA.js → index.esm2017-B72iWwk_.js} +1 -1
- package/dist/{loading-DO3WUS3q.js → loading-rIhCiB_S.js} +1 -1
- package/dist/{lodash-6izwukKR.js → lodash-B6fOjfjd.js} +1 -1
- package/dist/{member-import-hKbS-7lM.js → member-import-CbHn7zss.js} +1 -1
- package/dist/{membership-buZOqdNV.js → membership-DkJN7jyQ.js} +3 -3
- package/dist/{money-WR6-v2Bl.js → money-ChbDx6Nq.js} +1 -1
- package/dist/{number-CjEejmUn.js → number-9TEd27Ku.js} +1 -1
- package/dist/{objectid-BvtNS241.js → objectid-CGol1NeA.js} +13 -13
- package/dist/onboarding-BN3MKVRs.js +131 -0
- package/dist/onboardingSetup-D9xhdgS3.js +17 -0
- package/dist/{plugins-BLcKp-ww.js → plugins-CCibSJZa.js} +3 -3
- package/dist/{reward-DCNR2-_F.js → reward-DjasF-NL.js} +1 -1
- package/dist/{rule-BsdMlDuH.js → rule-DqeChj0e.js} +3 -3
- package/dist/{rule-builder-C2z6Ki1X.js → rule-builder-DT854ycI.js} +1 -1
- package/dist/{template-DuuTNfO4.js → template-BeCVA0-N.js} +7 -7
- package/dist/{timezone-nMBfnPp_.js → timezone-D0nC1LDx.js} +1 -1
- package/dist/{transaction.fn-CYC2Uh5Y.js → transaction.fn-BkF4Ad2z.js} +2 -2
- package/dist/{trigger-CtlvsU7_.js → trigger-CxpXoQJO.js} +5 -5
- package/dist/{useMarketingMaterialActions-Dec-VZh7.js → useMarketingMaterialActions-p0-fyMkm.js} +3 -3
- package/dist/{usePagination-DvJ9IfI_.js → usePagination-CrC-1v4L.js} +1 -1
- package/dist/{user-CYOAXuDw.js → user-CrylHgF1.js} +1 -1
- package/dist/{vue-i18n-Cy0bIZpQ.js → vue-i18n-BjtkXdmG.js} +158 -158
- package/dist/{xlsx-Ct_b6gSU.js → xlsx-CJNYF7-l.js} +166 -166
- package/dist/{zod-DZR76_dr.js → zod-Dzn9S95S.js} +1 -1
- package/package.json +1 -1
- package/dist/Voucher-BcCzreI3.js +0 -443
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as yt, useRoute as wt, RouterView as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as Tt } from "./vue-i18n-
|
|
9
|
-
import { m as
|
|
10
|
-
import { C as Xe } from "./timezone-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { defineComponent as xe, ref as ee, h as H, Comment as cn, computed as ne, watch as pe, resolveComponent as Z, openBlock as j, createElementBlock as me, createVNode as S, unref as g, createElementVNode as v, toDisplayString as R, createBlock as Oe, withCtx as Q, Fragment as It, renderList as ln, onMounted as un, createCommentVNode as Pe, nextTick as dn } from "vue";
|
|
2
|
+
import { useRouter as yt, useRoute as wt, RouterView as hn } from "vue-router";
|
|
3
|
+
import { useCoreStore as ge, FeedMeAuth as fn } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as pn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as mn } from "./business-CbqG6NXr.js";
|
|
6
|
+
import "./index-CDm0BWa3.js";
|
|
7
|
+
import { components as G, useSnackbar as gn, useDialog as _n } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Tt } from "./vue-i18n-BjtkXdmG.js";
|
|
9
|
+
import { m as vn } from "./index-DzBzClHP.js";
|
|
10
|
+
import { C as Xe } from "./timezone-D0nC1LDx.js";
|
|
11
|
+
import { u as In } from "./onboarding-BN3MKVRs.js";
|
|
12
|
+
import { R as f, A as yn, a as Qe } from "./app-QxosLNkH.js";
|
|
13
|
+
import { J as wn } from "./JsonViewer-v8_C7l5N.js";
|
|
14
|
+
import { r as Le, L as Tn, g as kt, i as kn, a as bn, _ as Ze, C as et, b as En, S as re, c as A, d as Y, E as Fe, e as Sn, f as bt, h as Rn, j as An, k as Et, l as w, m as Pn, F as Ve, n as Cn, q as se, o as Nn, p as On, s as Ln, t as Mn, u as Un } from "./index.esm2017-B72iWwk_.js";
|
|
14
15
|
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
15
|
-
import { S as tt, c as
|
|
16
|
-
const
|
|
16
|
+
import { S as tt, c as Dn } from "./index-CWUmrVo_.js";
|
|
17
|
+
const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Vn = /* @__PURE__ */ xe({
|
|
17
18
|
__name: "NavigationTab",
|
|
18
19
|
setup(n) {
|
|
19
|
-
const { t: e } = Tt(),
|
|
20
|
+
const { t: e, locale: t } = Tt(), i = In(), r = ee(), s = [
|
|
20
21
|
{
|
|
21
22
|
label: e("connect.navigation.analytic"),
|
|
22
23
|
value: f["$connect-ANALYTIC"]
|
|
@@ -58,7 +59,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
58
59
|
{
|
|
59
60
|
label: e("connect.navigation.point"),
|
|
60
61
|
value: f["$connect-PROGRAM_POINT"],
|
|
61
|
-
badge: () =>
|
|
62
|
+
badge: () => H(G.FmPill, { variant: "premium" })
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
65
|
label: e("connect.navigation.credit"),
|
|
@@ -67,7 +68,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
67
68
|
{
|
|
68
69
|
label: e("connect.navigation.game"),
|
|
69
70
|
value: f["$connect-PROGRAM_GAME"],
|
|
70
|
-
badge: () =>
|
|
71
|
+
badge: () => H(G.FmPill, { variant: "premium" })
|
|
71
72
|
},
|
|
72
73
|
{
|
|
73
74
|
label: "Mission",
|
|
@@ -86,19 +87,19 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
86
87
|
{
|
|
87
88
|
label: e("connect.navigation.segments"),
|
|
88
89
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
89
|
-
badge: () =>
|
|
90
|
+
badge: () => H(G.FmPill, { variant: "premium" })
|
|
90
91
|
},
|
|
91
92
|
{
|
|
92
93
|
label: e("connect.navigation.card"),
|
|
93
94
|
value: f["$connect-LOYALTY_CARD"],
|
|
94
|
-
badge: () =>
|
|
95
|
+
badge: () => H(G.FmPill, { variant: "premium" })
|
|
95
96
|
}
|
|
96
97
|
]
|
|
97
98
|
},
|
|
98
99
|
{
|
|
99
100
|
label: e("connect.navigation.referral"),
|
|
100
101
|
value: f["$connect-REFERRAL"],
|
|
101
|
-
badge: () =>
|
|
102
|
+
badge: () => H(G.FmPill, { variant: "premium" })
|
|
102
103
|
},
|
|
103
104
|
{
|
|
104
105
|
label: e("connect.navigation.store"),
|
|
@@ -116,6 +117,15 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
116
117
|
label: e("connect.navigation.review"),
|
|
117
118
|
value: f["$connect-REVIEW"]
|
|
118
119
|
},
|
|
120
|
+
{
|
|
121
|
+
label: e("connect.navigation.goals"),
|
|
122
|
+
value: f["$connect-GOALS"],
|
|
123
|
+
badge: () => i.goalsRemaining > 0 ? H(G.FmBadge, {
|
|
124
|
+
variant: "numeric",
|
|
125
|
+
inline: !0,
|
|
126
|
+
value: i.goalsRemaining
|
|
127
|
+
}) : H(cn)
|
|
128
|
+
},
|
|
119
129
|
{
|
|
120
130
|
label: e("connect.navigation.setting"),
|
|
121
131
|
value: f["$connect-SETTING"]
|
|
@@ -124,170 +134,179 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
124
134
|
label: e("connect.navigation.bin"),
|
|
125
135
|
value: f["$connect-BIN"]
|
|
126
136
|
}
|
|
127
|
-
],
|
|
128
|
-
const
|
|
129
|
-
return console.log(`[MF] Timezone set to: ${Xe[
|
|
137
|
+
], o = yt(), c = wt(), a = s.reduce((h, y) => [...(y.children ?? []).map((_) => _.value), ...h, y.value], []), l = ge(), d = ne(() => {
|
|
138
|
+
const h = l.currentCountry.value || "MY";
|
|
139
|
+
return console.log(`[MF] Timezone set to: ${Xe[h]}`), Xe[h];
|
|
130
140
|
});
|
|
131
|
-
|
|
132
|
-
() =>
|
|
133
|
-
(
|
|
134
|
-
const
|
|
135
|
-
|
|
141
|
+
pe(
|
|
142
|
+
() => c,
|
|
143
|
+
(h) => {
|
|
144
|
+
const y = h.matched.map((_) => _.name).reverse();
|
|
145
|
+
r.value = y.find((_) => a.includes(_));
|
|
146
|
+
},
|
|
147
|
+
{ immediate: !0 }
|
|
148
|
+
), pe(
|
|
149
|
+
[() => {
|
|
150
|
+
var h;
|
|
151
|
+
return (h = l.currentBusiness.value) == null ? void 0 : h._id;
|
|
152
|
+
}, () => c.name, t],
|
|
153
|
+
([h]) => {
|
|
154
|
+
h && i.read(t.value, h);
|
|
136
155
|
},
|
|
137
156
|
{ immediate: !0 }
|
|
138
157
|
);
|
|
139
|
-
async function
|
|
140
|
-
await
|
|
158
|
+
async function p(h) {
|
|
159
|
+
await o.push({ name: h });
|
|
141
160
|
}
|
|
142
|
-
return (
|
|
143
|
-
var
|
|
144
|
-
const
|
|
145
|
-
return
|
|
146
|
-
S(
|
|
161
|
+
return (h, y) => {
|
|
162
|
+
var m;
|
|
163
|
+
const _ = Z("FmCollapsibleTabs");
|
|
164
|
+
return j(), me("div", xn, [
|
|
165
|
+
S(_, {
|
|
147
166
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
148
|
-
"model-value": (
|
|
149
|
-
items:
|
|
150
|
-
"onUpdate:modelValue":
|
|
167
|
+
"model-value": (m = g(r)) == null ? void 0 : m.toString(),
|
|
168
|
+
items: s,
|
|
169
|
+
"onUpdate:modelValue": p
|
|
151
170
|
}, null, 8, ["model-value"]),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
171
|
+
v("div", Fn, [
|
|
172
|
+
v("div", null, "Timezone: " + R(g(d).split("/")[1].replace("_", " ")), 1),
|
|
173
|
+
v("div", null, "(UTC" + R(g(vn).tz(g(d)).format("Z")) + ")", 1)
|
|
155
174
|
])
|
|
156
175
|
]);
|
|
157
176
|
};
|
|
158
177
|
}
|
|
159
178
|
}), St = "feedme_connect_marketing_promo_hidden";
|
|
160
|
-
function
|
|
179
|
+
function $n() {
|
|
161
180
|
try {
|
|
162
181
|
return localStorage.getItem(St) !== null;
|
|
163
182
|
} catch {
|
|
164
183
|
return !1;
|
|
165
184
|
}
|
|
166
185
|
}
|
|
167
|
-
function
|
|
186
|
+
function Hn() {
|
|
168
187
|
try {
|
|
169
188
|
localStorage.setItem(St, (/* @__PURE__ */ new Date()).toISOString());
|
|
170
189
|
} catch {
|
|
171
190
|
}
|
|
172
191
|
}
|
|
173
|
-
const
|
|
192
|
+
const jn = { class: "flex flex-col gap-12" }, Wn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, Bn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Gn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, zn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, qn = { class: "flex flex-col gap-24 pb-8" }, Kn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, Jn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Yn = { class: "fm-typo-en-body-lg-600" }, Xn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Qn = { class: "shrink-0" }, Zn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ei = { class: "flex w-full flex-col gap-12 px-[16px]" }, ti = { class: "flex flex-wrap items-center gap-12" }, ni = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ii = /* @__PURE__ */ xe({
|
|
174
193
|
__name: "AiMarketingPromoDialog",
|
|
175
194
|
setup(n) {
|
|
176
195
|
let e = !1;
|
|
177
|
-
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } =
|
|
196
|
+
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } = ge(), o = ee(!1), c = [
|
|
178
197
|
{ key: "completeContent", icon: "layers" },
|
|
179
198
|
{ key: "realContext", icon: "storefront" },
|
|
180
199
|
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
181
200
|
], a = ne(() => {
|
|
182
|
-
var
|
|
183
|
-
const
|
|
184
|
-
return
|
|
201
|
+
var _;
|
|
202
|
+
const y = ((_ = r.value) == null ? void 0 : _.permissions) ?? [];
|
|
203
|
+
return yn(
|
|
185
204
|
[
|
|
186
205
|
{
|
|
187
206
|
action: Qe.Action.manage,
|
|
188
207
|
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
189
208
|
}
|
|
190
209
|
],
|
|
191
|
-
|
|
210
|
+
y
|
|
192
211
|
).granted;
|
|
193
212
|
}), l = ne(
|
|
194
213
|
() => s.value === "MY" && a.value
|
|
195
214
|
);
|
|
196
215
|
let d = !1;
|
|
197
|
-
|
|
216
|
+
pe(
|
|
198
217
|
l,
|
|
199
|
-
(
|
|
200
|
-
d || !
|
|
218
|
+
(y) => {
|
|
219
|
+
d || !y || (d = !0, !($n() || e) && (e = !0, o.value = !0));
|
|
201
220
|
},
|
|
202
221
|
{ immediate: !0 }
|
|
203
222
|
);
|
|
204
|
-
async function
|
|
223
|
+
async function p() {
|
|
205
224
|
o.value = !1, await i.push({ name: f["$connect-MARKETING"] });
|
|
206
225
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
226
|
+
function h() {
|
|
227
|
+
Hn(), o.value = !1;
|
|
209
228
|
}
|
|
210
|
-
return (
|
|
211
|
-
const
|
|
212
|
-
return
|
|
229
|
+
return (y, _) => {
|
|
230
|
+
const m = Z("FmIcon"), I = Z("FmCard"), T = Z("FmButton"), M = Z("FmDialog");
|
|
231
|
+
return j(), Oe(M, {
|
|
213
232
|
modelValue: o.value,
|
|
214
|
-
"onUpdate:modelValue":
|
|
233
|
+
"onUpdate:modelValue": _[0] || (_[0] = (k) => o.value = k),
|
|
215
234
|
"min-width": "min(500px, calc(100% - 48px))",
|
|
216
235
|
"max-width": "min(860px, calc(100% - 48px))",
|
|
217
236
|
"max-height": "90vh",
|
|
218
237
|
"dismiss-away": ""
|
|
219
238
|
}, {
|
|
220
|
-
"dialog-header":
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
S(
|
|
239
|
+
"dialog-header": Q(() => [
|
|
240
|
+
v("div", jn, [
|
|
241
|
+
v("div", Wn, [
|
|
242
|
+
S(m, {
|
|
224
243
|
name: "auto_awesome",
|
|
225
244
|
size: "sm",
|
|
226
245
|
color: "primary"
|
|
227
246
|
}),
|
|
228
|
-
|
|
247
|
+
v("span", Bn, R(g(t)("connect.marketing.whatsNew.badge")), 1)
|
|
229
248
|
]),
|
|
230
|
-
|
|
231
|
-
|
|
249
|
+
v("h1", Gn, R(g(t)("connect.marketing.whatsNew.title")), 1),
|
|
250
|
+
v("p", zn, R(g(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
232
251
|
])
|
|
233
252
|
]),
|
|
234
|
-
"dialog-footer":
|
|
235
|
-
|
|
236
|
-
|
|
253
|
+
"dialog-footer": Q(() => [
|
|
254
|
+
v("div", ei, [
|
|
255
|
+
v("div", ti, [
|
|
237
256
|
S(T, {
|
|
238
257
|
variant: "primary",
|
|
239
258
|
size: "lg",
|
|
240
|
-
label:
|
|
259
|
+
label: g(t)("connect.marketing.whatsNew.cta"),
|
|
241
260
|
"append-icon": "arrow_forward",
|
|
242
|
-
onClick:
|
|
261
|
+
onClick: p
|
|
243
262
|
}, null, 8, ["label"]),
|
|
244
263
|
S(T, {
|
|
245
264
|
variant: "tertiary",
|
|
246
265
|
size: "lg",
|
|
247
|
-
label:
|
|
248
|
-
onClick:
|
|
266
|
+
label: g(t)("connect.marketing.whatsNew.dismiss"),
|
|
267
|
+
onClick: h
|
|
249
268
|
}, null, 8, ["label"])
|
|
250
269
|
]),
|
|
251
|
-
|
|
270
|
+
v("div", ni, R(g(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
252
271
|
])
|
|
253
272
|
]),
|
|
254
|
-
default:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
(
|
|
273
|
+
default: Q(() => [
|
|
274
|
+
v("div", qn, [
|
|
275
|
+
v("div", Kn, [
|
|
276
|
+
(j(), me(It, null, ln(c, (k) => S(I, {
|
|
258
277
|
key: k.key,
|
|
259
278
|
variant: "outlined",
|
|
260
279
|
class: "!h-full flex flex-col gap-8 p-16"
|
|
261
280
|
}, {
|
|
262
|
-
default:
|
|
263
|
-
|
|
264
|
-
S(
|
|
281
|
+
default: Q(() => [
|
|
282
|
+
v("div", Jn, [
|
|
283
|
+
S(m, {
|
|
265
284
|
name: k.icon,
|
|
266
285
|
size: "md",
|
|
267
286
|
color: "primary"
|
|
268
287
|
}, null, 8, ["name"])
|
|
269
288
|
]),
|
|
270
|
-
|
|
271
|
-
|
|
289
|
+
v("div", Yn, R(g(t)(`connect.marketing.whatsNew.benefits.${k.key}.title`)), 1),
|
|
290
|
+
v("div", Xn, R(g(t)(
|
|
272
291
|
`connect.marketing.whatsNew.benefits.${k.key}.description`
|
|
273
292
|
)), 1)
|
|
274
293
|
]),
|
|
275
294
|
_: 2
|
|
276
295
|
}, 1024)), 64))
|
|
277
296
|
]),
|
|
278
|
-
S(
|
|
297
|
+
S(I, {
|
|
279
298
|
variant: "outlined",
|
|
280
299
|
class: "flex items-start gap-12 p-16"
|
|
281
300
|
}, {
|
|
282
|
-
default:
|
|
283
|
-
|
|
284
|
-
S(
|
|
301
|
+
default: Q(() => [
|
|
302
|
+
v("div", Qn, [
|
|
303
|
+
S(m, {
|
|
285
304
|
name: "lightbulb",
|
|
286
305
|
size: "md",
|
|
287
306
|
color: "primary"
|
|
288
307
|
})
|
|
289
308
|
]),
|
|
290
|
-
|
|
309
|
+
v("p", Zn, R(g(t)("connect.marketing.whatsNew.callout")), 1)
|
|
291
310
|
]),
|
|
292
311
|
_: 1
|
|
293
312
|
})
|
|
@@ -298,7 +317,7 @@ const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xx
|
|
|
298
317
|
};
|
|
299
318
|
}
|
|
300
319
|
});
|
|
301
|
-
var
|
|
320
|
+
var ri = "firebase", si = "10.12.4";
|
|
302
321
|
/**
|
|
303
322
|
* @license
|
|
304
323
|
* Copyright 2020 Google LLC
|
|
@@ -315,13 +334,13 @@ var ni = "firebase", ii = "10.12.4";
|
|
|
315
334
|
* See the License for the specific language governing permissions and
|
|
316
335
|
* limitations under the License.
|
|
317
336
|
*/
|
|
318
|
-
|
|
337
|
+
Le(ri, si, "app");
|
|
319
338
|
function Rt() {
|
|
320
339
|
return {
|
|
321
340
|
"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."
|
|
322
341
|
};
|
|
323
342
|
}
|
|
324
|
-
const
|
|
343
|
+
const oi = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
325
344
|
/**
|
|
326
345
|
* @license
|
|
327
346
|
* Copyright 2020 Google LLC
|
|
@@ -338,12 +357,12 @@ const ri = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
|
338
357
|
* See the License for the specific language governing permissions and
|
|
339
358
|
* limitations under the License.
|
|
340
359
|
*/
|
|
341
|
-
const
|
|
342
|
-
function
|
|
343
|
-
|
|
360
|
+
const _e = new Tn("@firebase/auth");
|
|
361
|
+
function ai(n, ...e) {
|
|
362
|
+
_e.logLevel <= Et.WARN && _e.warn(`Auth (${re}): ${n}`, ...e);
|
|
344
363
|
}
|
|
345
364
|
function ue(n, ...e) {
|
|
346
|
-
|
|
365
|
+
_e.logLevel <= Et.ERROR && _e.error(`Auth (${re}): ${n}`, ...e);
|
|
347
366
|
}
|
|
348
367
|
/**
|
|
349
368
|
* @license
|
|
@@ -364,11 +383,11 @@ function ue(n, ...e) {
|
|
|
364
383
|
function O(n, ...e) {
|
|
365
384
|
throw He(n, ...e);
|
|
366
385
|
}
|
|
367
|
-
function
|
|
386
|
+
function b(n, ...e) {
|
|
368
387
|
return He(n, ...e);
|
|
369
388
|
}
|
|
370
389
|
function Pt(n, e, t) {
|
|
371
|
-
const i = Object.assign(Object.assign({},
|
|
390
|
+
const i = Object.assign(Object.assign({}, oi()), { [e]: t });
|
|
372
391
|
return new Fe("auth", "Firebase", i).create(e, {
|
|
373
392
|
appName: n.name
|
|
374
393
|
});
|
|
@@ -410,11 +429,11 @@ function L(n, e) {
|
|
|
410
429
|
* See the License for the specific language governing permissions and
|
|
411
430
|
* limitations under the License.
|
|
412
431
|
*/
|
|
413
|
-
function
|
|
432
|
+
function Me() {
|
|
414
433
|
var n;
|
|
415
434
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
416
435
|
}
|
|
417
|
-
function
|
|
436
|
+
function ci() {
|
|
418
437
|
return nt() === "http:" || nt() === "https:";
|
|
419
438
|
}
|
|
420
439
|
function nt() {
|
|
@@ -437,15 +456,15 @@ function nt() {
|
|
|
437
456
|
* See the License for the specific language governing permissions and
|
|
438
457
|
* limitations under the License.
|
|
439
458
|
*/
|
|
440
|
-
function
|
|
459
|
+
function li() {
|
|
441
460
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
442
461
|
// This is especially true for Cordova apps which have unreliable
|
|
443
462
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
444
463
|
// installed which overwrites the native navigator.onLine value and
|
|
445
464
|
// defines navigator.connection.
|
|
446
|
-
(
|
|
465
|
+
(ci() || En() || "connection" in navigator) ? navigator.onLine : !0;
|
|
447
466
|
}
|
|
448
|
-
function
|
|
467
|
+
function ui() {
|
|
449
468
|
if (typeof navigator > "u")
|
|
450
469
|
return null;
|
|
451
470
|
const n = navigator;
|
|
@@ -475,10 +494,10 @@ function ci() {
|
|
|
475
494
|
*/
|
|
476
495
|
class oe {
|
|
477
496
|
constructor(e, t) {
|
|
478
|
-
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
|
497
|
+
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile = kn() || bn();
|
|
479
498
|
}
|
|
480
499
|
get() {
|
|
481
|
-
return
|
|
500
|
+
return li() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
482
501
|
}
|
|
483
502
|
}
|
|
484
503
|
/**
|
|
@@ -572,7 +591,7 @@ class Ct {
|
|
|
572
591
|
* See the License for the specific language governing permissions and
|
|
573
592
|
* limitations under the License.
|
|
574
593
|
*/
|
|
575
|
-
const
|
|
594
|
+
const di = {
|
|
576
595
|
// Custom token errors.
|
|
577
596
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
578
597
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -663,11 +682,11 @@ const li = {
|
|
|
663
682
|
* See the License for the specific language governing permissions and
|
|
664
683
|
* limitations under the License.
|
|
665
684
|
*/
|
|
666
|
-
const
|
|
667
|
-
function
|
|
685
|
+
const hi = new oe(3e4, 6e4);
|
|
686
|
+
function Te(n, e) {
|
|
668
687
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
669
688
|
}
|
|
670
|
-
async function
|
|
689
|
+
async function X(n, e, t, i, r = {}) {
|
|
671
690
|
return Nt(n, r, async () => {
|
|
672
691
|
let s = {}, o = {};
|
|
673
692
|
i && (e === "GET" ? o = i : s = {
|
|
@@ -689,9 +708,9 @@ async function J(n, e, t, i, r = {}) {
|
|
|
689
708
|
}
|
|
690
709
|
async function Nt(n, e, t) {
|
|
691
710
|
n._canInitEmulator = !1;
|
|
692
|
-
const i = Object.assign(Object.assign({},
|
|
711
|
+
const i = Object.assign(Object.assign({}, di), e);
|
|
693
712
|
try {
|
|
694
|
-
const r = new
|
|
713
|
+
const r = new fi(n), s = await Promise.race([
|
|
695
714
|
t(),
|
|
696
715
|
r.promise
|
|
697
716
|
]);
|
|
@@ -721,7 +740,7 @@ async function Nt(n, e, t) {
|
|
|
721
740
|
}
|
|
722
741
|
}
|
|
723
742
|
async function Ot(n, e, t, i, r = {}) {
|
|
724
|
-
const s = await
|
|
743
|
+
const s = await X(n, e, t, i, r);
|
|
725
744
|
return "mfaPendingCredential" in s && O(n, "multi-factor-auth-required", {
|
|
726
745
|
_serverResponse: s
|
|
727
746
|
}), s;
|
|
@@ -730,14 +749,14 @@ function Lt(n, e, t, i) {
|
|
|
730
749
|
const r = `${e}${t}?${i}`;
|
|
731
750
|
return n.config.emulator ? je(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
732
751
|
}
|
|
733
|
-
class
|
|
752
|
+
class fi {
|
|
734
753
|
constructor(e) {
|
|
735
754
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
736
|
-
this.timer = setTimeout(() => i(
|
|
755
|
+
this.timer = setTimeout(() => i(b(
|
|
737
756
|
this.auth,
|
|
738
757
|
"network-request-failed"
|
|
739
758
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
740
|
-
)),
|
|
759
|
+
)), hi.get());
|
|
741
760
|
});
|
|
742
761
|
}
|
|
743
762
|
clearNetworkTimeout() {
|
|
@@ -749,7 +768,7 @@ function le(n, e, t) {
|
|
|
749
768
|
appName: n.name
|
|
750
769
|
};
|
|
751
770
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
752
|
-
const r =
|
|
771
|
+
const r = b(n, e, i);
|
|
753
772
|
return r.customData._tokenResponse = t, r;
|
|
754
773
|
}
|
|
755
774
|
/**
|
|
@@ -768,11 +787,11 @@ function le(n, e, t) {
|
|
|
768
787
|
* See the License for the specific language governing permissions and
|
|
769
788
|
* limitations under the License.
|
|
770
789
|
*/
|
|
771
|
-
async function
|
|
772
|
-
return
|
|
790
|
+
async function pi(n, e) {
|
|
791
|
+
return X(n, "POST", "/v1/accounts:delete", e);
|
|
773
792
|
}
|
|
774
793
|
async function Mt(n, e) {
|
|
775
|
-
return
|
|
794
|
+
return X(n, "POST", "/v1/accounts:lookup", e);
|
|
776
795
|
}
|
|
777
796
|
/**
|
|
778
797
|
* @license
|
|
@@ -799,8 +818,8 @@ function te(n) {
|
|
|
799
818
|
} catch {
|
|
800
819
|
}
|
|
801
820
|
}
|
|
802
|
-
async function
|
|
803
|
-
const t =
|
|
821
|
+
async function mi(n, e = !1) {
|
|
822
|
+
const t = Y(n), i = await t.getIdToken(e), r = We(i);
|
|
804
823
|
u(
|
|
805
824
|
r && r.exp && r.auth_time && r.iat,
|
|
806
825
|
t.auth,
|
|
@@ -811,14 +830,14 @@ async function fi(n, e = !1) {
|
|
|
811
830
|
return {
|
|
812
831
|
claims: r,
|
|
813
832
|
token: i,
|
|
814
|
-
authTime: te(
|
|
815
|
-
issuedAtTime: te(
|
|
816
|
-
expirationTime: te(
|
|
833
|
+
authTime: te(Ce(r.auth_time)),
|
|
834
|
+
issuedAtTime: te(Ce(r.iat)),
|
|
835
|
+
expirationTime: te(Ce(r.exp)),
|
|
817
836
|
signInProvider: o || null,
|
|
818
837
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
819
838
|
};
|
|
820
839
|
}
|
|
821
|
-
function
|
|
840
|
+
function Ce(n) {
|
|
822
841
|
return Number(n) * 1e3;
|
|
823
842
|
}
|
|
824
843
|
function We(n) {
|
|
@@ -826,7 +845,7 @@ function We(n) {
|
|
|
826
845
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
827
846
|
return ue("JWT malformed, contained fewer than 3 sections"), null;
|
|
828
847
|
try {
|
|
829
|
-
const r =
|
|
848
|
+
const r = Cn(t);
|
|
830
849
|
return r ? JSON.parse(r) : (ue("Failed to decode base64 JWT payload"), null);
|
|
831
850
|
} catch (r) {
|
|
832
851
|
return ue("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
@@ -870,10 +889,10 @@ async function ie(n, e, t = !1) {
|
|
|
870
889
|
try {
|
|
871
890
|
return await e;
|
|
872
891
|
} catch (i) {
|
|
873
|
-
throw i instanceof Ve &&
|
|
892
|
+
throw i instanceof Ve && gi(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
874
893
|
}
|
|
875
894
|
}
|
|
876
|
-
function
|
|
895
|
+
function gi({ code: n }) {
|
|
877
896
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
878
897
|
}
|
|
879
898
|
/**
|
|
@@ -892,7 +911,7 @@ function pi({ code: n }) {
|
|
|
892
911
|
* See the License for the specific language governing permissions and
|
|
893
912
|
* limitations under the License.
|
|
894
913
|
*/
|
|
895
|
-
class
|
|
914
|
+
class _i {
|
|
896
915
|
constructor(e) {
|
|
897
916
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
898
917
|
}
|
|
@@ -954,7 +973,7 @@ class mi {
|
|
|
954
973
|
* See the License for the specific language governing permissions and
|
|
955
974
|
* limitations under the License.
|
|
956
975
|
*/
|
|
957
|
-
class
|
|
976
|
+
class Ue {
|
|
958
977
|
constructor(e, t) {
|
|
959
978
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
960
979
|
}
|
|
@@ -987,7 +1006,7 @@ class Me {
|
|
|
987
1006
|
* See the License for the specific language governing permissions and
|
|
988
1007
|
* limitations under the License.
|
|
989
1008
|
*/
|
|
990
|
-
async function
|
|
1009
|
+
async function ve(n) {
|
|
991
1010
|
var e;
|
|
992
1011
|
const t = n.auth, i = await n.getIdToken(), r = await ie(n, Mt(t, { idToken: i }));
|
|
993
1012
|
u(
|
|
@@ -998,7 +1017,7 @@ async function _e(n) {
|
|
|
998
1017
|
);
|
|
999
1018
|
const s = r.users[0];
|
|
1000
1019
|
n._notifyReloadListener(s);
|
|
1001
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c =
|
|
1020
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c = Ii(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, p = {
|
|
1002
1021
|
uid: s.localId,
|
|
1003
1022
|
displayName: s.displayName || null,
|
|
1004
1023
|
photoURL: s.photoUrl || null,
|
|
@@ -1007,16 +1026,16 @@ async function _e(n) {
|
|
|
1007
1026
|
phoneNumber: s.phoneNumber || null,
|
|
1008
1027
|
tenantId: s.tenantId || null,
|
|
1009
1028
|
providerData: c,
|
|
1010
|
-
metadata: new
|
|
1029
|
+
metadata: new Ue(s.createdAt, s.lastLoginAt),
|
|
1011
1030
|
isAnonymous: d
|
|
1012
1031
|
};
|
|
1013
|
-
Object.assign(n,
|
|
1032
|
+
Object.assign(n, p);
|
|
1014
1033
|
}
|
|
1015
|
-
async function
|
|
1016
|
-
const e =
|
|
1017
|
-
await
|
|
1034
|
+
async function vi(n) {
|
|
1035
|
+
const e = Y(n);
|
|
1036
|
+
await ve(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
1018
1037
|
}
|
|
1019
|
-
function
|
|
1038
|
+
function Ii(n, e) {
|
|
1020
1039
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
1021
1040
|
}
|
|
1022
1041
|
function Ut(n) {
|
|
@@ -1048,7 +1067,7 @@ function Ut(n) {
|
|
|
1048
1067
|
* See the License for the specific language governing permissions and
|
|
1049
1068
|
* limitations under the License.
|
|
1050
1069
|
*/
|
|
1051
|
-
async function
|
|
1070
|
+
async function yi(n, e) {
|
|
1052
1071
|
const t = await Nt(n, {}, async () => {
|
|
1053
1072
|
const i = se({
|
|
1054
1073
|
grant_type: "refresh_token",
|
|
@@ -1069,8 +1088,8 @@ async function vi(n, e) {
|
|
|
1069
1088
|
refreshToken: t.refresh_token
|
|
1070
1089
|
};
|
|
1071
1090
|
}
|
|
1072
|
-
async function
|
|
1073
|
-
return
|
|
1091
|
+
async function wi(n, e) {
|
|
1092
|
+
return X(n, "POST", "/v2/accounts:revokeToken", Te(n, e));
|
|
1074
1093
|
}
|
|
1075
1094
|
/**
|
|
1076
1095
|
* @license
|
|
@@ -1088,7 +1107,7 @@ async function Ii(n, e) {
|
|
|
1088
1107
|
* See the License for the specific language governing permissions and
|
|
1089
1108
|
* limitations under the License.
|
|
1090
1109
|
*/
|
|
1091
|
-
class
|
|
1110
|
+
class q {
|
|
1092
1111
|
constructor() {
|
|
1093
1112
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
1094
1113
|
}
|
|
@@ -1133,14 +1152,14 @@ class G {
|
|
|
1133
1152
|
this.refreshToken = null;
|
|
1134
1153
|
}
|
|
1135
1154
|
async refresh(e, t) {
|
|
1136
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1155
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await yi(e, t);
|
|
1137
1156
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1138
1157
|
}
|
|
1139
1158
|
updateTokensAndExpiration(e, t, i) {
|
|
1140
1159
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1141
1160
|
}
|
|
1142
1161
|
static fromJSON(e, t) {
|
|
1143
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1162
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new q();
|
|
1144
1163
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1145
1164
|
appName: e
|
|
1146
1165
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1160,7 +1179,7 @@ class G {
|
|
|
1160
1179
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1161
1180
|
}
|
|
1162
1181
|
_clone() {
|
|
1163
|
-
return Object.assign(new
|
|
1182
|
+
return Object.assign(new q(), this.toJSON());
|
|
1164
1183
|
}
|
|
1165
1184
|
_performRefresh() {
|
|
1166
1185
|
return P("not implemented");
|
|
@@ -1188,7 +1207,7 @@ function U(n, e) {
|
|
|
1188
1207
|
class C {
|
|
1189
1208
|
constructor(e) {
|
|
1190
1209
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1191
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1210
|
+
this.providerId = "firebase", this.proactiveRefresh = new _i(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 Ue(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1192
1211
|
}
|
|
1193
1212
|
async getIdToken(e) {
|
|
1194
1213
|
const t = await ie(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -1200,10 +1219,10 @@ class C {
|
|
|
1200
1219
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1201
1220
|
}
|
|
1202
1221
|
getIdTokenResult(e) {
|
|
1203
|
-
return
|
|
1222
|
+
return mi(this, e);
|
|
1204
1223
|
}
|
|
1205
1224
|
reload() {
|
|
1206
|
-
return
|
|
1225
|
+
return vi(this);
|
|
1207
1226
|
}
|
|
1208
1227
|
_assign(e) {
|
|
1209
1228
|
this !== e && (u(
|
|
@@ -1236,13 +1255,13 @@ class C {
|
|
|
1236
1255
|
}
|
|
1237
1256
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1238
1257
|
let i = !1;
|
|
1239
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1258
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await ve(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1240
1259
|
}
|
|
1241
1260
|
async delete() {
|
|
1242
1261
|
if (A(this.auth.app))
|
|
1243
1262
|
return Promise.reject($(this.auth));
|
|
1244
1263
|
const e = await this.getIdToken();
|
|
1245
|
-
return await ie(this,
|
|
1264
|
+
return await ie(this, pi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1246
1265
|
}
|
|
1247
1266
|
toJSON() {
|
|
1248
1267
|
return Object.assign(Object.assign({
|
|
@@ -1270,20 +1289,20 @@ class C {
|
|
|
1270
1289
|
}
|
|
1271
1290
|
static _fromJSON(e, t) {
|
|
1272
1291
|
var i, r, s, o, c, a, l, d;
|
|
1273
|
-
const
|
|
1292
|
+
const p = (i = t.displayName) !== null && i !== void 0 ? i : void 0, h = (r = t.email) !== null && r !== void 0 ? r : void 0, y = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, _ = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, m = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, T = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, M = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: k, emailVerified: Ke, isAnonymous: Je, providerData: Re, stsTokenManager: Ye } = t;
|
|
1274
1293
|
u(
|
|
1275
1294
|
k && Ye,
|
|
1276
1295
|
e,
|
|
1277
1296
|
"internal-error"
|
|
1278
1297
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1279
1298
|
);
|
|
1280
|
-
const on =
|
|
1299
|
+
const on = q.fromJSON(this.name, Ye);
|
|
1281
1300
|
u(
|
|
1282
1301
|
typeof k == "string",
|
|
1283
1302
|
e,
|
|
1284
1303
|
"internal-error"
|
|
1285
1304
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1286
|
-
), U(
|
|
1305
|
+
), U(p, e.name), U(h, e.name), u(
|
|
1287
1306
|
typeof Ke == "boolean",
|
|
1288
1307
|
e,
|
|
1289
1308
|
"internal-error"
|
|
@@ -1293,22 +1312,22 @@ class C {
|
|
|
1293
1312
|
e,
|
|
1294
1313
|
"internal-error"
|
|
1295
1314
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1296
|
-
), U(
|
|
1297
|
-
const
|
|
1315
|
+
), U(y, e.name), U(_, e.name), U(m, e.name), U(I, e.name), U(T, e.name), U(M, e.name);
|
|
1316
|
+
const Ae = new C({
|
|
1298
1317
|
uid: k,
|
|
1299
1318
|
auth: e,
|
|
1300
|
-
email:
|
|
1319
|
+
email: h,
|
|
1301
1320
|
emailVerified: Ke,
|
|
1302
|
-
displayName:
|
|
1321
|
+
displayName: p,
|
|
1303
1322
|
isAnonymous: Je,
|
|
1304
|
-
photoURL:
|
|
1305
|
-
phoneNumber:
|
|
1306
|
-
tenantId:
|
|
1323
|
+
photoURL: _,
|
|
1324
|
+
phoneNumber: y,
|
|
1325
|
+
tenantId: m,
|
|
1307
1326
|
stsTokenManager: on,
|
|
1308
1327
|
createdAt: T,
|
|
1309
1328
|
lastLoginAt: M
|
|
1310
1329
|
});
|
|
1311
|
-
return
|
|
1330
|
+
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((an) => Object.assign({}, an))), I && (Ae._redirectEventId = I), Ae;
|
|
1312
1331
|
}
|
|
1313
1332
|
/**
|
|
1314
1333
|
* Initialize a User from an idToken server response
|
|
@@ -1316,7 +1335,7 @@ class C {
|
|
|
1316
1335
|
* @param idTokenResponse
|
|
1317
1336
|
*/
|
|
1318
1337
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1319
|
-
const r = new
|
|
1338
|
+
const r = new q();
|
|
1320
1339
|
r.updateFromServerResponse(t);
|
|
1321
1340
|
const s = new C({
|
|
1322
1341
|
uid: t.localId,
|
|
@@ -1324,7 +1343,7 @@ class C {
|
|
|
1324
1343
|
stsTokenManager: r,
|
|
1325
1344
|
isAnonymous: i
|
|
1326
1345
|
});
|
|
1327
|
-
return await
|
|
1346
|
+
return await ve(s), s;
|
|
1328
1347
|
}
|
|
1329
1348
|
/**
|
|
1330
1349
|
* Initialize a User from an idToken server response
|
|
@@ -1338,7 +1357,7 @@ class C {
|
|
|
1338
1357
|
"internal-error"
|
|
1339
1358
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1340
1359
|
);
|
|
1341
|
-
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new
|
|
1360
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new q();
|
|
1342
1361
|
c.updateFromIdToken(i);
|
|
1343
1362
|
const a = new C({
|
|
1344
1363
|
uid: r.localId,
|
|
@@ -1354,7 +1373,7 @@ class C {
|
|
|
1354
1373
|
phoneNumber: r.phoneNumber || null,
|
|
1355
1374
|
tenantId: r.tenantId || null,
|
|
1356
1375
|
providerData: s,
|
|
1357
|
-
metadata: new
|
|
1376
|
+
metadata: new Ue(r.createdAt, r.lastLoginAt),
|
|
1358
1377
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1359
1378
|
};
|
|
1360
1379
|
return Object.assign(a, l), a;
|
|
@@ -1441,7 +1460,7 @@ const st = Dt;
|
|
|
1441
1460
|
function de(n, e, t) {
|
|
1442
1461
|
return `firebase:${n}:${e}:${t}`;
|
|
1443
1462
|
}
|
|
1444
|
-
class
|
|
1463
|
+
class K {
|
|
1445
1464
|
constructor(e, t, i) {
|
|
1446
1465
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1447
1466
|
const { config: r, name: s } = this.auth;
|
|
@@ -1472,7 +1491,7 @@ class z {
|
|
|
1472
1491
|
}
|
|
1473
1492
|
static async create(e, t, i = "authUser") {
|
|
1474
1493
|
if (!t.length)
|
|
1475
|
-
return new
|
|
1494
|
+
return new K(N(st), e, i);
|
|
1476
1495
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1477
1496
|
if (await l._isAvailable())
|
|
1478
1497
|
return l;
|
|
@@ -1484,20 +1503,20 @@ class z {
|
|
|
1484
1503
|
try {
|
|
1485
1504
|
const d = await l._get(o);
|
|
1486
1505
|
if (d) {
|
|
1487
|
-
const
|
|
1488
|
-
l !== s && (c =
|
|
1506
|
+
const p = C._fromJSON(e, d);
|
|
1507
|
+
l !== s && (c = p), s = l;
|
|
1489
1508
|
break;
|
|
1490
1509
|
}
|
|
1491
1510
|
} catch {
|
|
1492
1511
|
}
|
|
1493
1512
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1494
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1513
|
+
return !s._shouldAllowMigration || !a.length ? new K(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1495
1514
|
if (l !== s)
|
|
1496
1515
|
try {
|
|
1497
1516
|
await l._remove(o);
|
|
1498
1517
|
} catch {
|
|
1499
1518
|
}
|
|
1500
|
-
})), new
|
|
1519
|
+
})), new K(s, e, i));
|
|
1501
1520
|
}
|
|
1502
1521
|
}
|
|
1503
1522
|
/**
|
|
@@ -1547,42 +1566,42 @@ function ot(n) {
|
|
|
1547
1566
|
}
|
|
1548
1567
|
return "Other";
|
|
1549
1568
|
}
|
|
1550
|
-
function xt(n =
|
|
1569
|
+
function xt(n = w()) {
|
|
1551
1570
|
return /firefox\//i.test(n);
|
|
1552
1571
|
}
|
|
1553
|
-
function Be(n =
|
|
1572
|
+
function Be(n = w()) {
|
|
1554
1573
|
const e = n.toLowerCase();
|
|
1555
1574
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1556
1575
|
}
|
|
1557
|
-
function Ft(n =
|
|
1576
|
+
function Ft(n = w()) {
|
|
1558
1577
|
return /crios\//i.test(n);
|
|
1559
1578
|
}
|
|
1560
|
-
function Vt(n =
|
|
1579
|
+
function Vt(n = w()) {
|
|
1561
1580
|
return /iemobile/i.test(n);
|
|
1562
1581
|
}
|
|
1563
|
-
function $t(n =
|
|
1582
|
+
function $t(n = w()) {
|
|
1564
1583
|
return /android/i.test(n);
|
|
1565
1584
|
}
|
|
1566
|
-
function Ht(n =
|
|
1585
|
+
function Ht(n = w()) {
|
|
1567
1586
|
return /blackberry/i.test(n);
|
|
1568
1587
|
}
|
|
1569
|
-
function jt(n =
|
|
1588
|
+
function jt(n = w()) {
|
|
1570
1589
|
return /webos/i.test(n);
|
|
1571
1590
|
}
|
|
1572
|
-
function
|
|
1591
|
+
function ke(n = w()) {
|
|
1573
1592
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1574
1593
|
}
|
|
1575
|
-
function
|
|
1594
|
+
function Ti(n = w()) {
|
|
1576
1595
|
var e;
|
|
1577
|
-
return
|
|
1596
|
+
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1578
1597
|
}
|
|
1579
|
-
function
|
|
1580
|
-
return
|
|
1598
|
+
function ki() {
|
|
1599
|
+
return Nn() && document.documentMode === 10;
|
|
1581
1600
|
}
|
|
1582
|
-
function Wt(n =
|
|
1583
|
-
return
|
|
1601
|
+
function Wt(n = w()) {
|
|
1602
|
+
return ke(n) || $t(n) || jt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1584
1603
|
}
|
|
1585
|
-
function
|
|
1604
|
+
function bi() {
|
|
1586
1605
|
try {
|
|
1587
1606
|
return !!(window && window !== window.top);
|
|
1588
1607
|
} catch {
|
|
@@ -1609,10 +1628,10 @@ function Bt(n, e = []) {
|
|
|
1609
1628
|
let t;
|
|
1610
1629
|
switch (n) {
|
|
1611
1630
|
case "Browser":
|
|
1612
|
-
t = ot(
|
|
1631
|
+
t = ot(w());
|
|
1613
1632
|
break;
|
|
1614
1633
|
case "Worker":
|
|
1615
|
-
t = `${ot(
|
|
1634
|
+
t = `${ot(w())}-${n}`;
|
|
1616
1635
|
break;
|
|
1617
1636
|
default:
|
|
1618
1637
|
t = n;
|
|
@@ -1636,7 +1655,7 @@ function Bt(n, e = []) {
|
|
|
1636
1655
|
* See the License for the specific language governing permissions and
|
|
1637
1656
|
* limitations under the License.
|
|
1638
1657
|
*/
|
|
1639
|
-
class
|
|
1658
|
+
class Ei {
|
|
1640
1659
|
constructor(e) {
|
|
1641
1660
|
this.auth = e, this.queue = [];
|
|
1642
1661
|
}
|
|
@@ -1691,8 +1710,8 @@ class ki {
|
|
|
1691
1710
|
* See the License for the specific language governing permissions and
|
|
1692
1711
|
* limitations under the License.
|
|
1693
1712
|
*/
|
|
1694
|
-
async function
|
|
1695
|
-
return
|
|
1713
|
+
async function Si(n, e = {}) {
|
|
1714
|
+
return X(n, "GET", "/v2/passwordPolicy", Te(n, e));
|
|
1696
1715
|
}
|
|
1697
1716
|
/**
|
|
1698
1717
|
* @license
|
|
@@ -1710,12 +1729,12 @@ async function Ei(n, e = {}) {
|
|
|
1710
1729
|
* See the License for the specific language governing permissions and
|
|
1711
1730
|
* limitations under the License.
|
|
1712
1731
|
*/
|
|
1713
|
-
const
|
|
1714
|
-
class
|
|
1732
|
+
const Ri = 6;
|
|
1733
|
+
class Ai {
|
|
1715
1734
|
constructor(e) {
|
|
1716
1735
|
var t, i, r, s;
|
|
1717
1736
|
const o = e.customStrengthOptions;
|
|
1718
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1737
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Ri, 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;
|
|
1719
1738
|
}
|
|
1720
1739
|
validatePassword(e) {
|
|
1721
1740
|
var t, i, r, s, o, c;
|
|
@@ -1798,14 +1817,14 @@ class Si {
|
|
|
1798
1817
|
* See the License for the specific language governing permissions and
|
|
1799
1818
|
* limitations under the License.
|
|
1800
1819
|
*/
|
|
1801
|
-
class
|
|
1820
|
+
class Pi {
|
|
1802
1821
|
constructor(e, t, i, r) {
|
|
1803
|
-
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 at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new
|
|
1822
|
+
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 at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new Ei(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 = At, 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;
|
|
1804
1823
|
}
|
|
1805
1824
|
_initializeWithPersistence(e, t) {
|
|
1806
1825
|
return t && (this._popupRedirectResolver = N(t)), this._initializationPromise = this.queue(async () => {
|
|
1807
1826
|
var i, r;
|
|
1808
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1827
|
+
if (!this._deleted && (this.persistenceManager = await K.create(this, e), !this._deleted)) {
|
|
1809
1828
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1810
1829
|
try {
|
|
1811
1830
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1886,7 +1905,7 @@ class Ri {
|
|
|
1886
1905
|
}
|
|
1887
1906
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1888
1907
|
try {
|
|
1889
|
-
await
|
|
1908
|
+
await ve(e);
|
|
1890
1909
|
} catch (t) {
|
|
1891
1910
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1892
1911
|
return this.directlySetCurrentUser(null);
|
|
@@ -1894,7 +1913,7 @@ class Ri {
|
|
|
1894
1913
|
return this.directlySetCurrentUser(e);
|
|
1895
1914
|
}
|
|
1896
1915
|
useDeviceLanguage() {
|
|
1897
|
-
this.languageCode =
|
|
1916
|
+
this.languageCode = ui();
|
|
1898
1917
|
}
|
|
1899
1918
|
async _delete() {
|
|
1900
1919
|
this._deleted = !0;
|
|
@@ -1902,7 +1921,7 @@ class Ri {
|
|
|
1902
1921
|
async updateCurrentUser(e) {
|
|
1903
1922
|
if (A(this.app))
|
|
1904
1923
|
return Promise.reject($(this));
|
|
1905
|
-
const t = e ?
|
|
1924
|
+
const t = e ? Y(e) : null;
|
|
1906
1925
|
return t && u(
|
|
1907
1926
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1908
1927
|
this,
|
|
@@ -1945,7 +1964,7 @@ class Ri {
|
|
|
1945
1964
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1946
1965
|
}
|
|
1947
1966
|
async _updatePasswordPolicy() {
|
|
1948
|
-
const e = await
|
|
1967
|
+
const e = await Si(this), t = new Ai(e);
|
|
1949
1968
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1950
1969
|
}
|
|
1951
1970
|
_getPersistence() {
|
|
@@ -1985,7 +2004,7 @@ class Ri {
|
|
|
1985
2004
|
token: e,
|
|
1986
2005
|
idToken: t
|
|
1987
2006
|
};
|
|
1988
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
2007
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await wi(this, i);
|
|
1989
2008
|
}
|
|
1990
2009
|
}
|
|
1991
2010
|
toJSON() {
|
|
@@ -2009,7 +2028,7 @@ class Ri {
|
|
|
2009
2028
|
this,
|
|
2010
2029
|
"argument-error"
|
|
2011
2030
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2012
|
-
), this.redirectPersistenceManager = await
|
|
2031
|
+
), this.redirectPersistenceManager = await K.create(
|
|
2013
2032
|
this,
|
|
2014
2033
|
[N(t._redirectPersistence)],
|
|
2015
2034
|
"redirectUser"
|
|
@@ -2128,15 +2147,15 @@ class Ri {
|
|
|
2128
2147
|
async _getAppCheckToken() {
|
|
2129
2148
|
var e;
|
|
2130
2149
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
2131
|
-
return t != null && t.error &&
|
|
2150
|
+
return t != null && t.error && ai(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
2132
2151
|
}
|
|
2133
2152
|
}
|
|
2134
|
-
function
|
|
2135
|
-
return
|
|
2153
|
+
function be(n) {
|
|
2154
|
+
return Y(n);
|
|
2136
2155
|
}
|
|
2137
2156
|
class at {
|
|
2138
2157
|
constructor(e) {
|
|
2139
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2158
|
+
this.auth = e, this.observer = null, this.addObserver = Sn((t) => this.observer = t);
|
|
2140
2159
|
}
|
|
2141
2160
|
get next() {
|
|
2142
2161
|
return u(
|
|
@@ -2171,16 +2190,16 @@ let Ge = {
|
|
|
2171
2190
|
recaptchaEnterpriseScript: "",
|
|
2172
2191
|
gapiScript: ""
|
|
2173
2192
|
};
|
|
2174
|
-
function
|
|
2193
|
+
function Ci(n) {
|
|
2175
2194
|
Ge = n;
|
|
2176
2195
|
}
|
|
2177
|
-
function
|
|
2196
|
+
function Ni(n) {
|
|
2178
2197
|
return Ge.loadJS(n);
|
|
2179
2198
|
}
|
|
2180
|
-
function
|
|
2199
|
+
function Oi() {
|
|
2181
2200
|
return Ge.gapiScript;
|
|
2182
2201
|
}
|
|
2183
|
-
function
|
|
2202
|
+
function Li(n) {
|
|
2184
2203
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2185
2204
|
}
|
|
2186
2205
|
/**
|
|
@@ -2199,11 +2218,11 @@ function Ni(n) {
|
|
|
2199
2218
|
* See the License for the specific language governing permissions and
|
|
2200
2219
|
* limitations under the License.
|
|
2201
2220
|
*/
|
|
2202
|
-
function
|
|
2203
|
-
const t =
|
|
2221
|
+
function Mi(n, e) {
|
|
2222
|
+
const t = bt(n, "auth");
|
|
2204
2223
|
if (t.isInitialized()) {
|
|
2205
2224
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2206
|
-
if (
|
|
2225
|
+
if (Pn(s, e ?? {}))
|
|
2207
2226
|
return r;
|
|
2208
2227
|
O(
|
|
2209
2228
|
r,
|
|
@@ -2213,12 +2232,12 @@ function Oi(n, e) {
|
|
|
2213
2232
|
}
|
|
2214
2233
|
return t.initialize({ options: e });
|
|
2215
2234
|
}
|
|
2216
|
-
function
|
|
2235
|
+
function Ui(n, e) {
|
|
2217
2236
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(N);
|
|
2218
2237
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2219
2238
|
}
|
|
2220
|
-
function
|
|
2221
|
-
const i =
|
|
2239
|
+
function Di(n, e, t) {
|
|
2240
|
+
const i = be(n);
|
|
2222
2241
|
u(
|
|
2223
2242
|
i._canInitEmulator,
|
|
2224
2243
|
i,
|
|
@@ -2230,19 +2249,19 @@ function Mi(n, e, t) {
|
|
|
2230
2249
|
"invalid-emulator-scheme"
|
|
2231
2250
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2232
2251
|
);
|
|
2233
|
-
const r = !1, s = Gt(e), { host: o, port: c } =
|
|
2252
|
+
const r = !1, s = Gt(e), { host: o, port: c } = xi(e), a = c === null ? "" : `:${c}`;
|
|
2234
2253
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2235
2254
|
host: o,
|
|
2236
2255
|
port: c,
|
|
2237
2256
|
protocol: s.replace(":", ""),
|
|
2238
2257
|
options: Object.freeze({ disableWarnings: r })
|
|
2239
|
-
}),
|
|
2258
|
+
}), Fi();
|
|
2240
2259
|
}
|
|
2241
2260
|
function Gt(n) {
|
|
2242
2261
|
const e = n.indexOf(":");
|
|
2243
2262
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2244
2263
|
}
|
|
2245
|
-
function
|
|
2264
|
+
function xi(n) {
|
|
2246
2265
|
const e = Gt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2247
2266
|
if (!t)
|
|
2248
2267
|
return { host: "", port: null };
|
|
@@ -2261,7 +2280,7 @@ function ct(n) {
|
|
|
2261
2280
|
const e = Number(n);
|
|
2262
2281
|
return isNaN(e) ? null : e;
|
|
2263
2282
|
}
|
|
2264
|
-
function
|
|
2283
|
+
function Fi() {
|
|
2265
2284
|
function n() {
|
|
2266
2285
|
const e = document.createElement("p"), t = e.style;
|
|
2267
2286
|
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);
|
|
@@ -2326,8 +2345,8 @@ class zt {
|
|
|
2326
2345
|
* See the License for the specific language governing permissions and
|
|
2327
2346
|
* limitations under the License.
|
|
2328
2347
|
*/
|
|
2329
|
-
async function
|
|
2330
|
-
return Ot(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2348
|
+
async function J(n, e) {
|
|
2349
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", Te(n, e));
|
|
2331
2350
|
}
|
|
2332
2351
|
/**
|
|
2333
2352
|
* @license
|
|
@@ -2345,14 +2364,14 @@ async function q(n, e) {
|
|
|
2345
2364
|
* See the License for the specific language governing permissions and
|
|
2346
2365
|
* limitations under the License.
|
|
2347
2366
|
*/
|
|
2348
|
-
const
|
|
2349
|
-
class
|
|
2367
|
+
const Vi = "http://localhost";
|
|
2368
|
+
class W extends zt {
|
|
2350
2369
|
constructor() {
|
|
2351
2370
|
super(...arguments), this.pendingToken = null;
|
|
2352
2371
|
}
|
|
2353
2372
|
/** @internal */
|
|
2354
2373
|
static _fromParams(e) {
|
|
2355
|
-
const t = new
|
|
2374
|
+
const t = new W(e.providerId, e.signInMethod);
|
|
2356
2375
|
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) : O(
|
|
2357
2376
|
"argument-error"
|
|
2358
2377
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
@@ -2383,27 +2402,27 @@ class j extends zt {
|
|
|
2383
2402
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2384
2403
|
if (!i || !r)
|
|
2385
2404
|
return null;
|
|
2386
|
-
const o = new
|
|
2405
|
+
const o = new W(i, r);
|
|
2387
2406
|
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;
|
|
2388
2407
|
}
|
|
2389
2408
|
/** @internal */
|
|
2390
2409
|
_getIdTokenResponse(e) {
|
|
2391
2410
|
const t = this.buildRequest();
|
|
2392
|
-
return
|
|
2411
|
+
return J(e, t);
|
|
2393
2412
|
}
|
|
2394
2413
|
/** @internal */
|
|
2395
2414
|
_linkToIdToken(e, t) {
|
|
2396
2415
|
const i = this.buildRequest();
|
|
2397
|
-
return i.idToken = t,
|
|
2416
|
+
return i.idToken = t, J(e, i);
|
|
2398
2417
|
}
|
|
2399
2418
|
/** @internal */
|
|
2400
2419
|
_getReauthenticationResolver(e) {
|
|
2401
2420
|
const t = this.buildRequest();
|
|
2402
|
-
return t.autoCreate = !1,
|
|
2421
|
+
return t.autoCreate = !1, J(e, t);
|
|
2403
2422
|
}
|
|
2404
2423
|
buildRequest() {
|
|
2405
2424
|
const e = {
|
|
2406
|
-
requestUri:
|
|
2425
|
+
requestUri: Vi,
|
|
2407
2426
|
returnSecureToken: !0
|
|
2408
2427
|
};
|
|
2409
2428
|
if (this.pendingToken)
|
|
@@ -2539,7 +2558,7 @@ class D extends ae {
|
|
|
2539
2558
|
* @param accessToken - Facebook access token.
|
|
2540
2559
|
*/
|
|
2541
2560
|
static credential(e) {
|
|
2542
|
-
return
|
|
2561
|
+
return W._fromParams({
|
|
2543
2562
|
providerId: D.PROVIDER_ID,
|
|
2544
2563
|
signInMethod: D.FACEBOOK_SIGN_IN_METHOD,
|
|
2545
2564
|
accessToken: e
|
|
@@ -2611,7 +2630,7 @@ class x extends ae {
|
|
|
2611
2630
|
* @param accessToken - Google access token.
|
|
2612
2631
|
*/
|
|
2613
2632
|
static credential(e, t) {
|
|
2614
|
-
return
|
|
2633
|
+
return W._fromParams({
|
|
2615
2634
|
providerId: x.PROVIDER_ID,
|
|
2616
2635
|
signInMethod: x.GOOGLE_SIGN_IN_METHOD,
|
|
2617
2636
|
idToken: e,
|
|
@@ -2679,7 +2698,7 @@ class F extends ae {
|
|
|
2679
2698
|
* @param accessToken - Github access token.
|
|
2680
2699
|
*/
|
|
2681
2700
|
static credential(e) {
|
|
2682
|
-
return
|
|
2701
|
+
return W._fromParams({
|
|
2683
2702
|
providerId: F.PROVIDER_ID,
|
|
2684
2703
|
signInMethod: F.GITHUB_SIGN_IN_METHOD,
|
|
2685
2704
|
accessToken: e
|
|
@@ -2744,7 +2763,7 @@ class V extends ae {
|
|
|
2744
2763
|
* @param secret - Twitter secret.
|
|
2745
2764
|
*/
|
|
2746
2765
|
static credential(e, t) {
|
|
2747
|
-
return
|
|
2766
|
+
return W._fromParams({
|
|
2748
2767
|
providerId: V.PROVIDER_ID,
|
|
2749
2768
|
signInMethod: V.TWITTER_SIGN_IN_METHOD,
|
|
2750
2769
|
oauthToken: e,
|
|
@@ -2799,13 +2818,13 @@ V.PROVIDER_ID = "twitter.com";
|
|
|
2799
2818
|
* See the License for the specific language governing permissions and
|
|
2800
2819
|
* limitations under the License.
|
|
2801
2820
|
*/
|
|
2802
|
-
class
|
|
2821
|
+
class B {
|
|
2803
2822
|
constructor(e) {
|
|
2804
2823
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2805
2824
|
}
|
|
2806
2825
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2807
2826
|
const s = await C._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2808
|
-
return new
|
|
2827
|
+
return new B({
|
|
2809
2828
|
user: s,
|
|
2810
2829
|
providerId: o,
|
|
2811
2830
|
_tokenResponse: i,
|
|
@@ -2819,7 +2838,7 @@ class W {
|
|
|
2819
2838
|
!0
|
|
2820
2839
|
);
|
|
2821
2840
|
const r = lt(i);
|
|
2822
|
-
return new
|
|
2841
|
+
return new B({
|
|
2823
2842
|
user: e,
|
|
2824
2843
|
providerId: r,
|
|
2825
2844
|
_tokenResponse: i,
|
|
@@ -2846,10 +2865,10 @@ function lt(n) {
|
|
|
2846
2865
|
* See the License for the specific language governing permissions and
|
|
2847
2866
|
* limitations under the License.
|
|
2848
2867
|
*/
|
|
2849
|
-
class
|
|
2868
|
+
class Ie extends Ve {
|
|
2850
2869
|
constructor(e, t, i, r) {
|
|
2851
2870
|
var s;
|
|
2852
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2871
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, Ie.prototype), this.customData = {
|
|
2853
2872
|
appName: e.name,
|
|
2854
2873
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2855
2874
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2857,17 +2876,17 @@ class ve extends Ve {
|
|
|
2857
2876
|
};
|
|
2858
2877
|
}
|
|
2859
2878
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2860
|
-
return new
|
|
2879
|
+
return new Ie(e, t, i, r);
|
|
2861
2880
|
}
|
|
2862
2881
|
}
|
|
2863
2882
|
function Kt(n, e, t, i) {
|
|
2864
2883
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2865
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2884
|
+
throw s.code === "auth/multi-factor-auth-required" ? Ie._fromErrorAndOperation(n, s, e, i) : s;
|
|
2866
2885
|
});
|
|
2867
2886
|
}
|
|
2868
|
-
async function
|
|
2887
|
+
async function $i(n, e, t = !1) {
|
|
2869
2888
|
const i = await ie(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2870
|
-
return
|
|
2889
|
+
return B._forOperation(n, "link", i);
|
|
2871
2890
|
}
|
|
2872
2891
|
/**
|
|
2873
2892
|
* @license
|
|
@@ -2885,7 +2904,7 @@ async function Fi(n, e, t = !1) {
|
|
|
2885
2904
|
* See the License for the specific language governing permissions and
|
|
2886
2905
|
* limitations under the License.
|
|
2887
2906
|
*/
|
|
2888
|
-
async function
|
|
2907
|
+
async function Hi(n, e, t = !1) {
|
|
2889
2908
|
const { auth: i } = n;
|
|
2890
2909
|
if (A(i.app))
|
|
2891
2910
|
return Promise.reject($(i));
|
|
@@ -2911,7 +2930,7 @@ async function Vi(n, e, t = !1) {
|
|
|
2911
2930
|
i,
|
|
2912
2931
|
"user-mismatch"
|
|
2913
2932
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2914
|
-
),
|
|
2933
|
+
), B._forOperation(n, r, s);
|
|
2915
2934
|
} catch (s) {
|
|
2916
2935
|
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && O(
|
|
2917
2936
|
i,
|
|
@@ -2936,10 +2955,10 @@ async function Vi(n, e, t = !1) {
|
|
|
2936
2955
|
* See the License for the specific language governing permissions and
|
|
2937
2956
|
* limitations under the License.
|
|
2938
2957
|
*/
|
|
2939
|
-
async function
|
|
2958
|
+
async function ji(n, e, t = !1) {
|
|
2940
2959
|
if (A(n.app))
|
|
2941
2960
|
return Promise.reject($(n));
|
|
2942
|
-
const i = "signIn", r = await Kt(n, i, e), s = await
|
|
2961
|
+
const i = "signIn", r = await Kt(n, i, e), s = await B._fromIdTokenResponse(n, i, r);
|
|
2943
2962
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2944
2963
|
}
|
|
2945
2964
|
/**
|
|
@@ -2958,8 +2977,8 @@ async function $i(n, e, t = !1) {
|
|
|
2958
2977
|
* See the License for the specific language governing permissions and
|
|
2959
2978
|
* limitations under the License.
|
|
2960
2979
|
*/
|
|
2961
|
-
async function
|
|
2962
|
-
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2980
|
+
async function Wi(n, e) {
|
|
2981
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", Te(n, e));
|
|
2963
2982
|
}
|
|
2964
2983
|
/**
|
|
2965
2984
|
* @license
|
|
@@ -2977,22 +2996,22 @@ async function Hi(n, e) {
|
|
|
2977
2996
|
* See the License for the specific language governing permissions and
|
|
2978
2997
|
* limitations under the License.
|
|
2979
2998
|
*/
|
|
2980
|
-
async function
|
|
2999
|
+
async function Bi(n, e) {
|
|
2981
3000
|
if (A(n.app))
|
|
2982
3001
|
return Promise.reject($(n));
|
|
2983
|
-
const t =
|
|
3002
|
+
const t = be(n), i = await Wi(t, {
|
|
2984
3003
|
token: e,
|
|
2985
3004
|
returnSecureToken: !0
|
|
2986
|
-
}), r = await
|
|
3005
|
+
}), r = await B._fromIdTokenResponse(t, "signIn", i);
|
|
2987
3006
|
return await t._updateCurrentUser(r.user), r;
|
|
2988
3007
|
}
|
|
2989
|
-
function
|
|
2990
|
-
return
|
|
3008
|
+
function Gi(n, e, t, i) {
|
|
3009
|
+
return Y(n).onIdTokenChanged(e, t, i);
|
|
2991
3010
|
}
|
|
2992
|
-
function
|
|
2993
|
-
return
|
|
3011
|
+
function zi(n, e, t) {
|
|
3012
|
+
return Y(n).beforeAuthStateChanged(e, t);
|
|
2994
3013
|
}
|
|
2995
|
-
const
|
|
3014
|
+
const ye = "__sak";
|
|
2996
3015
|
/**
|
|
2997
3016
|
* @license
|
|
2998
3017
|
* Copyright 2019 Google LLC
|
|
@@ -3015,7 +3034,7 @@ class Jt {
|
|
|
3015
3034
|
}
|
|
3016
3035
|
_isAvailable() {
|
|
3017
3036
|
try {
|
|
3018
|
-
return this.storage ? (this.storage.setItem(
|
|
3037
|
+
return this.storage ? (this.storage.setItem(ye, "1"), this.storage.removeItem(ye), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
3019
3038
|
} catch {
|
|
3020
3039
|
return Promise.resolve(!1);
|
|
3021
3040
|
}
|
|
@@ -3050,18 +3069,18 @@ class Jt {
|
|
|
3050
3069
|
* See the License for the specific language governing permissions and
|
|
3051
3070
|
* limitations under the License.
|
|
3052
3071
|
*/
|
|
3053
|
-
function
|
|
3054
|
-
const n =
|
|
3055
|
-
return Be(n) ||
|
|
3072
|
+
function qi() {
|
|
3073
|
+
const n = w();
|
|
3074
|
+
return Be(n) || ke(n);
|
|
3056
3075
|
}
|
|
3057
|
-
const
|
|
3076
|
+
const Ki = 1e3, Ji = 10;
|
|
3058
3077
|
class Yt extends Jt {
|
|
3059
3078
|
constructor() {
|
|
3060
3079
|
super(
|
|
3061
3080
|
() => window.localStorage,
|
|
3062
3081
|
"LOCAL"
|
|
3063
3082
|
/* PersistenceType.LOCAL */
|
|
3064
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3083
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = qi() && bi(), this.fallbackToPolling = Wt(), this._shouldAllowMigration = !0;
|
|
3065
3084
|
}
|
|
3066
3085
|
forAllChangedKeys(e) {
|
|
3067
3086
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -3088,7 +3107,7 @@ class Yt extends Jt {
|
|
|
3088
3107
|
const o = this.storage.getItem(i);
|
|
3089
3108
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
3090
3109
|
}, s = this.storage.getItem(i);
|
|
3091
|
-
|
|
3110
|
+
ki() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ji) : r();
|
|
3092
3111
|
}
|
|
3093
3112
|
notifyListeners(e, t) {
|
|
3094
3113
|
this.localCache[e] = t;
|
|
@@ -3110,7 +3129,7 @@ class Yt extends Jt {
|
|
|
3110
3129
|
!0
|
|
3111
3130
|
);
|
|
3112
3131
|
});
|
|
3113
|
-
},
|
|
3132
|
+
}, Ki);
|
|
3114
3133
|
}
|
|
3115
3134
|
stopPolling() {
|
|
3116
3135
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3140,7 +3159,7 @@ class Yt extends Jt {
|
|
|
3140
3159
|
}
|
|
3141
3160
|
}
|
|
3142
3161
|
Yt.type = "LOCAL";
|
|
3143
|
-
const
|
|
3162
|
+
const Yi = Yt;
|
|
3144
3163
|
/**
|
|
3145
3164
|
* @license
|
|
3146
3165
|
* Copyright 2020 Google LLC
|
|
@@ -3188,7 +3207,7 @@ const Qt = Xt;
|
|
|
3188
3207
|
* See the License for the specific language governing permissions and
|
|
3189
3208
|
* limitations under the License.
|
|
3190
3209
|
*/
|
|
3191
|
-
function
|
|
3210
|
+
function Xi(n) {
|
|
3192
3211
|
return Promise.all(n.map(async (e) => {
|
|
3193
3212
|
try {
|
|
3194
3213
|
return {
|
|
@@ -3258,7 +3277,7 @@ class Ee {
|
|
|
3258
3277
|
eventId: i,
|
|
3259
3278
|
eventType: r
|
|
3260
3279
|
});
|
|
3261
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3280
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Xi(c);
|
|
3262
3281
|
t.ports[0].postMessage({
|
|
3263
3282
|
status: "done",
|
|
3264
3283
|
eventId: i,
|
|
@@ -3326,7 +3345,7 @@ function ze(n = "", e = 10) {
|
|
|
3326
3345
|
* See the License for the specific language governing permissions and
|
|
3327
3346
|
* limitations under the License.
|
|
3328
3347
|
*/
|
|
3329
|
-
class
|
|
3348
|
+
class Qi {
|
|
3330
3349
|
constructor(e) {
|
|
3331
3350
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3332
3351
|
}
|
|
@@ -3370,10 +3389,10 @@ class Yi {
|
|
|
3370
3389
|
}, i);
|
|
3371
3390
|
o = {
|
|
3372
3391
|
messageChannel: r,
|
|
3373
|
-
onMessage(
|
|
3374
|
-
const
|
|
3375
|
-
if (
|
|
3376
|
-
switch (
|
|
3392
|
+
onMessage(p) {
|
|
3393
|
+
const h = p;
|
|
3394
|
+
if (h.data.eventId === l)
|
|
3395
|
+
switch (h.data.status) {
|
|
3377
3396
|
case "ack":
|
|
3378
3397
|
clearTimeout(d), s = setTimeout(
|
|
3379
3398
|
() => {
|
|
@@ -3387,7 +3406,7 @@ class Yi {
|
|
|
3387
3406
|
);
|
|
3388
3407
|
break;
|
|
3389
3408
|
case "done":
|
|
3390
|
-
clearTimeout(s), c(
|
|
3409
|
+
clearTimeout(s), c(h.data.response);
|
|
3391
3410
|
break;
|
|
3392
3411
|
default:
|
|
3393
3412
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3423,11 +3442,11 @@ class Yi {
|
|
|
3423
3442
|
* See the License for the specific language governing permissions and
|
|
3424
3443
|
* limitations under the License.
|
|
3425
3444
|
*/
|
|
3426
|
-
function
|
|
3445
|
+
function E() {
|
|
3427
3446
|
return window;
|
|
3428
3447
|
}
|
|
3429
|
-
function
|
|
3430
|
-
|
|
3448
|
+
function Zi(n) {
|
|
3449
|
+
E().location.href = n;
|
|
3431
3450
|
}
|
|
3432
3451
|
/**
|
|
3433
3452
|
* @license
|
|
@@ -3446,9 +3465,9 @@ function Xi(n) {
|
|
|
3446
3465
|
* limitations under the License.
|
|
3447
3466
|
*/
|
|
3448
3467
|
function Zt() {
|
|
3449
|
-
return typeof
|
|
3468
|
+
return typeof E().WorkerGlobalScope < "u" && typeof E().importScripts == "function";
|
|
3450
3469
|
}
|
|
3451
|
-
async function
|
|
3470
|
+
async function er() {
|
|
3452
3471
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3453
3472
|
return null;
|
|
3454
3473
|
try {
|
|
@@ -3457,11 +3476,11 @@ async function Qi() {
|
|
|
3457
3476
|
return null;
|
|
3458
3477
|
}
|
|
3459
3478
|
}
|
|
3460
|
-
function
|
|
3479
|
+
function tr() {
|
|
3461
3480
|
var n;
|
|
3462
3481
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3463
3482
|
}
|
|
3464
|
-
function
|
|
3483
|
+
function nr() {
|
|
3465
3484
|
return Zt() ? self : null;
|
|
3466
3485
|
}
|
|
3467
3486
|
/**
|
|
@@ -3480,7 +3499,7 @@ function er() {
|
|
|
3480
3499
|
* See the License for the specific language governing permissions and
|
|
3481
3500
|
* limitations under the License.
|
|
3482
3501
|
*/
|
|
3483
|
-
const en = "firebaseLocalStorageDb",
|
|
3502
|
+
const en = "firebaseLocalStorageDb", ir = 1, we = "firebaseLocalStorage", tn = "fbase_key";
|
|
3484
3503
|
class ce {
|
|
3485
3504
|
constructor(e) {
|
|
3486
3505
|
this.request = e;
|
|
@@ -3495,47 +3514,47 @@ class ce {
|
|
|
3495
3514
|
});
|
|
3496
3515
|
}
|
|
3497
3516
|
}
|
|
3498
|
-
function
|
|
3499
|
-
return n.transaction([
|
|
3517
|
+
function Se(n, e) {
|
|
3518
|
+
return n.transaction([we], e ? "readwrite" : "readonly").objectStore(we);
|
|
3500
3519
|
}
|
|
3501
|
-
function
|
|
3520
|
+
function rr() {
|
|
3502
3521
|
const n = indexedDB.deleteDatabase(en);
|
|
3503
3522
|
return new ce(n).toPromise();
|
|
3504
3523
|
}
|
|
3505
|
-
function
|
|
3506
|
-
const n = indexedDB.open(en,
|
|
3524
|
+
function De() {
|
|
3525
|
+
const n = indexedDB.open(en, ir);
|
|
3507
3526
|
return new Promise((e, t) => {
|
|
3508
3527
|
n.addEventListener("error", () => {
|
|
3509
3528
|
t(n.error);
|
|
3510
3529
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3511
3530
|
const i = n.result;
|
|
3512
3531
|
try {
|
|
3513
|
-
i.createObjectStore(
|
|
3532
|
+
i.createObjectStore(we, { keyPath: tn });
|
|
3514
3533
|
} catch (r) {
|
|
3515
3534
|
t(r);
|
|
3516
3535
|
}
|
|
3517
3536
|
}), n.addEventListener("success", async () => {
|
|
3518
3537
|
const i = n.result;
|
|
3519
|
-
i.objectStoreNames.contains(
|
|
3538
|
+
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await rr(), e(await De()));
|
|
3520
3539
|
});
|
|
3521
3540
|
});
|
|
3522
3541
|
}
|
|
3523
3542
|
async function ut(n, e, t) {
|
|
3524
|
-
const i =
|
|
3543
|
+
const i = Se(n, !0).put({
|
|
3525
3544
|
[tn]: e,
|
|
3526
3545
|
value: t
|
|
3527
3546
|
});
|
|
3528
3547
|
return new ce(i).toPromise();
|
|
3529
3548
|
}
|
|
3530
|
-
async function
|
|
3531
|
-
const t =
|
|
3549
|
+
async function sr(n, e) {
|
|
3550
|
+
const t = Se(n, !1).get(e), i = await new ce(t).toPromise();
|
|
3532
3551
|
return i === void 0 ? null : i.value;
|
|
3533
3552
|
}
|
|
3534
3553
|
function dt(n, e) {
|
|
3535
|
-
const t =
|
|
3554
|
+
const t = Se(n, !0).delete(e);
|
|
3536
3555
|
return new ce(t).toPromise();
|
|
3537
3556
|
}
|
|
3538
|
-
const
|
|
3557
|
+
const or = 800, ar = 3;
|
|
3539
3558
|
class nn {
|
|
3540
3559
|
constructor() {
|
|
3541
3560
|
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(() => {
|
|
@@ -3543,7 +3562,7 @@ class nn {
|
|
|
3543
3562
|
});
|
|
3544
3563
|
}
|
|
3545
3564
|
async _openDb() {
|
|
3546
|
-
return this.db ? this.db : (this.db = await
|
|
3565
|
+
return this.db ? this.db : (this.db = await De(), this.db);
|
|
3547
3566
|
}
|
|
3548
3567
|
async _withRetries(e) {
|
|
3549
3568
|
let t = 0;
|
|
@@ -3552,7 +3571,7 @@ class nn {
|
|
|
3552
3571
|
const i = await this._openDb();
|
|
3553
3572
|
return await e(i);
|
|
3554
3573
|
} catch (i) {
|
|
3555
|
-
if (t++ >
|
|
3574
|
+
if (t++ > ar)
|
|
3556
3575
|
throw i;
|
|
3557
3576
|
this.db && (this.db.close(), this.db = void 0);
|
|
3558
3577
|
}
|
|
@@ -3568,7 +3587,7 @@ class nn {
|
|
|
3568
3587
|
* As the worker we should listen to events from the main window.
|
|
3569
3588
|
*/
|
|
3570
3589
|
async initializeReceiver() {
|
|
3571
|
-
this.receiver = Ee._getInstance(
|
|
3590
|
+
this.receiver = Ee._getInstance(nr()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3572
3591
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3573
3592
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3574
3593
|
"keyChanged"
|
|
@@ -3584,9 +3603,9 @@ class nn {
|
|
|
3584
3603
|
*/
|
|
3585
3604
|
async initializeSender() {
|
|
3586
3605
|
var e, t;
|
|
3587
|
-
if (this.activeServiceWorker = await
|
|
3606
|
+
if (this.activeServiceWorker = await er(), !this.activeServiceWorker)
|
|
3588
3607
|
return;
|
|
3589
|
-
this.sender = new
|
|
3608
|
+
this.sender = new Qi(this.activeServiceWorker);
|
|
3590
3609
|
const i = await this.sender._send(
|
|
3591
3610
|
"ping",
|
|
3592
3611
|
{},
|
|
@@ -3608,7 +3627,7 @@ class nn {
|
|
|
3608
3627
|
* @param key - Storage key which changed.
|
|
3609
3628
|
*/
|
|
3610
3629
|
async notifyServiceWorker(e) {
|
|
3611
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3630
|
+
if (!(!this.sender || !this.activeServiceWorker || tr() !== this.activeServiceWorker))
|
|
3612
3631
|
try {
|
|
3613
3632
|
await this.sender._send(
|
|
3614
3633
|
"keyChanged",
|
|
@@ -3624,8 +3643,8 @@ class nn {
|
|
|
3624
3643
|
try {
|
|
3625
3644
|
if (!indexedDB)
|
|
3626
3645
|
return !1;
|
|
3627
|
-
const e = await
|
|
3628
|
-
return await ut(e,
|
|
3646
|
+
const e = await De();
|
|
3647
|
+
return await ut(e, ye, "1"), await dt(e, ye), !0;
|
|
3629
3648
|
} catch {
|
|
3630
3649
|
}
|
|
3631
3650
|
return !1;
|
|
@@ -3642,7 +3661,7 @@ class nn {
|
|
|
3642
3661
|
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3643
3662
|
}
|
|
3644
3663
|
async _get(e) {
|
|
3645
|
-
const t = await this._withRetries((i) =>
|
|
3664
|
+
const t = await this._withRetries((i) => sr(i, e));
|
|
3646
3665
|
return this.localCache[e] = t, t;
|
|
3647
3666
|
}
|
|
3648
3667
|
async _remove(e) {
|
|
@@ -3650,7 +3669,7 @@ class nn {
|
|
|
3650
3669
|
}
|
|
3651
3670
|
async _poll() {
|
|
3652
3671
|
const e = await this._withRetries((r) => {
|
|
3653
|
-
const s =
|
|
3672
|
+
const s = Se(r, !1).getAll();
|
|
3654
3673
|
return new ce(s).toPromise();
|
|
3655
3674
|
});
|
|
3656
3675
|
if (!e)
|
|
@@ -3673,7 +3692,7 @@ class nn {
|
|
|
3673
3692
|
r(t);
|
|
3674
3693
|
}
|
|
3675
3694
|
startPolling() {
|
|
3676
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3695
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), or);
|
|
3677
3696
|
}
|
|
3678
3697
|
stopPolling() {
|
|
3679
3698
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3686,7 +3705,7 @@ class nn {
|
|
|
3686
3705
|
}
|
|
3687
3706
|
}
|
|
3688
3707
|
nn.type = "LOCAL";
|
|
3689
|
-
const
|
|
3708
|
+
const cr = nn;
|
|
3690
3709
|
new oe(3e4, 6e4);
|
|
3691
3710
|
/**
|
|
3692
3711
|
* @license
|
|
@@ -3704,7 +3723,7 @@ new oe(3e4, 6e4);
|
|
|
3704
3723
|
* See the License for the specific language governing permissions and
|
|
3705
3724
|
* limitations under the License.
|
|
3706
3725
|
*/
|
|
3707
|
-
function
|
|
3726
|
+
function lr(n, e) {
|
|
3708
3727
|
return e ? N(e) : (u(
|
|
3709
3728
|
n._popupRedirectResolver,
|
|
3710
3729
|
n,
|
|
@@ -3737,13 +3756,13 @@ class qe extends zt {
|
|
|
3737
3756
|
), this.params = e;
|
|
3738
3757
|
}
|
|
3739
3758
|
_getIdTokenResponse(e) {
|
|
3740
|
-
return
|
|
3759
|
+
return J(e, this._buildIdpRequest());
|
|
3741
3760
|
}
|
|
3742
3761
|
_linkToIdToken(e, t) {
|
|
3743
|
-
return
|
|
3762
|
+
return J(e, this._buildIdpRequest(t));
|
|
3744
3763
|
}
|
|
3745
3764
|
_getReauthenticationResolver(e) {
|
|
3746
|
-
return
|
|
3765
|
+
return J(e, this._buildIdpRequest());
|
|
3747
3766
|
}
|
|
3748
3767
|
_buildIdpRequest(e) {
|
|
3749
3768
|
const t = {
|
|
@@ -3758,26 +3777,26 @@ class qe extends zt {
|
|
|
3758
3777
|
return e && (t.idToken = e), t;
|
|
3759
3778
|
}
|
|
3760
3779
|
}
|
|
3761
|
-
function
|
|
3762
|
-
return
|
|
3780
|
+
function ur(n) {
|
|
3781
|
+
return ji(n.auth, new qe(n), n.bypassAuthState);
|
|
3763
3782
|
}
|
|
3764
|
-
function
|
|
3783
|
+
function dr(n) {
|
|
3765
3784
|
const { auth: e, user: t } = n;
|
|
3766
3785
|
return u(
|
|
3767
3786
|
t,
|
|
3768
3787
|
e,
|
|
3769
3788
|
"internal-error"
|
|
3770
3789
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3771
|
-
),
|
|
3790
|
+
), Hi(t, new qe(n), n.bypassAuthState);
|
|
3772
3791
|
}
|
|
3773
|
-
async function
|
|
3792
|
+
async function hr(n) {
|
|
3774
3793
|
const { auth: e, user: t } = n;
|
|
3775
3794
|
return u(
|
|
3776
3795
|
t,
|
|
3777
3796
|
e,
|
|
3778
3797
|
"internal-error"
|
|
3779
3798
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3780
|
-
),
|
|
3799
|
+
), $i(t, new qe(n), n.bypassAuthState);
|
|
3781
3800
|
}
|
|
3782
3801
|
/**
|
|
3783
3802
|
* @license
|
|
@@ -3837,13 +3856,13 @@ class rn {
|
|
|
3837
3856
|
switch (e) {
|
|
3838
3857
|
case "signInViaPopup":
|
|
3839
3858
|
case "signInViaRedirect":
|
|
3840
|
-
return
|
|
3859
|
+
return ur;
|
|
3841
3860
|
case "linkViaPopup":
|
|
3842
3861
|
case "linkViaRedirect":
|
|
3843
|
-
return
|
|
3862
|
+
return hr;
|
|
3844
3863
|
case "reauthViaPopup":
|
|
3845
3864
|
case "reauthViaRedirect":
|
|
3846
|
-
return
|
|
3865
|
+
return dr;
|
|
3847
3866
|
default:
|
|
3848
3867
|
O(
|
|
3849
3868
|
this.auth,
|
|
@@ -3878,10 +3897,10 @@ class rn {
|
|
|
3878
3897
|
* See the License for the specific language governing permissions and
|
|
3879
3898
|
* limitations under the License.
|
|
3880
3899
|
*/
|
|
3881
|
-
const
|
|
3882
|
-
class
|
|
3900
|
+
const fr = new oe(2e3, 1e4);
|
|
3901
|
+
class z extends rn {
|
|
3883
3902
|
constructor(e, t, i, r, s) {
|
|
3884
|
-
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null,
|
|
3903
|
+
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, z.currentPopupAction && z.currentPopupAction.cancel(), z.currentPopupAction = this;
|
|
3885
3904
|
}
|
|
3886
3905
|
async executeNotNull() {
|
|
3887
3906
|
const e = await this.execute();
|
|
@@ -3904,7 +3923,7 @@ class B extends rn {
|
|
|
3904
3923
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3905
3924
|
this.reject(t);
|
|
3906
3925
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3907
|
-
t || this.reject(
|
|
3926
|
+
t || this.reject(b(
|
|
3908
3927
|
this.auth,
|
|
3909
3928
|
"web-storage-unsupported"
|
|
3910
3929
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3916,14 +3935,14 @@ class B extends rn {
|
|
|
3916
3935
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3917
3936
|
}
|
|
3918
3937
|
cancel() {
|
|
3919
|
-
this.reject(
|
|
3938
|
+
this.reject(b(
|
|
3920
3939
|
this.auth,
|
|
3921
3940
|
"cancelled-popup-request"
|
|
3922
3941
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
3923
3942
|
));
|
|
3924
3943
|
}
|
|
3925
3944
|
cleanUp() {
|
|
3926
|
-
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null,
|
|
3945
|
+
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null, z.currentPopupAction = null;
|
|
3927
3946
|
}
|
|
3928
3947
|
pollUserCancellation() {
|
|
3929
3948
|
const e = () => {
|
|
@@ -3931,7 +3950,7 @@ class B extends rn {
|
|
|
3931
3950
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3932
3951
|
this.pollId = window.setTimeout(
|
|
3933
3952
|
() => {
|
|
3934
|
-
this.pollId = null, this.reject(
|
|
3953
|
+
this.pollId = null, this.reject(b(
|
|
3935
3954
|
this.auth,
|
|
3936
3955
|
"popup-closed-by-user"
|
|
3937
3956
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3942,12 +3961,12 @@ class B extends rn {
|
|
|
3942
3961
|
);
|
|
3943
3962
|
return;
|
|
3944
3963
|
}
|
|
3945
|
-
this.pollId = window.setTimeout(e,
|
|
3964
|
+
this.pollId = window.setTimeout(e, fr.get());
|
|
3946
3965
|
};
|
|
3947
3966
|
e();
|
|
3948
3967
|
}
|
|
3949
3968
|
}
|
|
3950
|
-
|
|
3969
|
+
z.currentPopupAction = null;
|
|
3951
3970
|
/**
|
|
3952
3971
|
* @license
|
|
3953
3972
|
* Copyright 2020 Google LLC
|
|
@@ -3964,8 +3983,8 @@ B.currentPopupAction = null;
|
|
|
3964
3983
|
* See the License for the specific language governing permissions and
|
|
3965
3984
|
* limitations under the License.
|
|
3966
3985
|
*/
|
|
3967
|
-
const
|
|
3968
|
-
class
|
|
3986
|
+
const pr = "pendingRedirect", he = /* @__PURE__ */ new Map();
|
|
3987
|
+
class mr extends rn {
|
|
3969
3988
|
constructor(e, t, i = !1) {
|
|
3970
3989
|
super(e, [
|
|
3971
3990
|
"signInViaRedirect",
|
|
@@ -3983,7 +4002,7 @@ class fr extends rn {
|
|
|
3983
4002
|
let e = he.get(this.auth._key());
|
|
3984
4003
|
if (!e) {
|
|
3985
4004
|
try {
|
|
3986
|
-
const i = await
|
|
4005
|
+
const i = await gr(this.resolver, this.auth) ? await super.execute() : null;
|
|
3987
4006
|
e = () => Promise.resolve(i);
|
|
3988
4007
|
} catch (t) {
|
|
3989
4008
|
e = () => Promise.reject(t);
|
|
@@ -4011,26 +4030,26 @@ class fr extends rn {
|
|
|
4011
4030
|
cleanUp() {
|
|
4012
4031
|
}
|
|
4013
4032
|
}
|
|
4014
|
-
async function
|
|
4015
|
-
const t =
|
|
4033
|
+
async function gr(n, e) {
|
|
4034
|
+
const t = Ir(e), i = vr(n);
|
|
4016
4035
|
if (!await i._isAvailable())
|
|
4017
4036
|
return !1;
|
|
4018
4037
|
const r = await i._get(t) === "true";
|
|
4019
4038
|
return await i._remove(t), r;
|
|
4020
4039
|
}
|
|
4021
|
-
function
|
|
4040
|
+
function _r(n, e) {
|
|
4022
4041
|
he.set(n._key(), e);
|
|
4023
4042
|
}
|
|
4024
|
-
function
|
|
4043
|
+
function vr(n) {
|
|
4025
4044
|
return N(n._redirectPersistence);
|
|
4026
4045
|
}
|
|
4027
|
-
function
|
|
4028
|
-
return de(
|
|
4046
|
+
function Ir(n) {
|
|
4047
|
+
return de(pr, n.config.apiKey, n.name);
|
|
4029
4048
|
}
|
|
4030
|
-
async function
|
|
4049
|
+
async function yr(n, e, t = !1) {
|
|
4031
4050
|
if (A(n.app))
|
|
4032
4051
|
return Promise.reject($(n));
|
|
4033
|
-
const i =
|
|
4052
|
+
const i = be(n), r = lr(i, e), o = await new mr(i, r, t).execute();
|
|
4034
4053
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
4035
4054
|
}
|
|
4036
4055
|
/**
|
|
@@ -4049,8 +4068,8 @@ async function vr(n, e, t = !1) {
|
|
|
4049
4068
|
* See the License for the specific language governing permissions and
|
|
4050
4069
|
* limitations under the License.
|
|
4051
4070
|
*/
|
|
4052
|
-
const
|
|
4053
|
-
class
|
|
4071
|
+
const wr = 10 * 60 * 1e3;
|
|
4072
|
+
class Tr {
|
|
4054
4073
|
constructor(e) {
|
|
4055
4074
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
4056
4075
|
}
|
|
@@ -4066,13 +4085,13 @@ class yr {
|
|
|
4066
4085
|
let t = !1;
|
|
4067
4086
|
return this.consumers.forEach((i) => {
|
|
4068
4087
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
4069
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4088
|
+
}), this.hasHandledPotentialRedirect || !kr(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
4070
4089
|
}
|
|
4071
4090
|
sendToConsumer(e, t) {
|
|
4072
4091
|
var i;
|
|
4073
4092
|
if (e.error && !sn(e)) {
|
|
4074
4093
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
4075
|
-
t.onError(
|
|
4094
|
+
t.onError(b(this.auth, r));
|
|
4076
4095
|
} else
|
|
4077
4096
|
t.onAuthEvent(e);
|
|
4078
4097
|
}
|
|
@@ -4081,7 +4100,7 @@ class yr {
|
|
|
4081
4100
|
return t.filter.includes(e.type) && i;
|
|
4082
4101
|
}
|
|
4083
4102
|
hasEventBeenHandled(e) {
|
|
4084
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4103
|
+
return Date.now() - this.lastProcessedEventTime >= wr && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
4085
4104
|
}
|
|
4086
4105
|
saveEventToCache(e) {
|
|
4087
4106
|
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -4093,7 +4112,7 @@ function ht(n) {
|
|
|
4093
4112
|
function sn({ type: n, error: e }) {
|
|
4094
4113
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
4095
4114
|
}
|
|
4096
|
-
function
|
|
4115
|
+
function kr(n) {
|
|
4097
4116
|
switch (n.type) {
|
|
4098
4117
|
case "signInViaRedirect":
|
|
4099
4118
|
case "linkViaRedirect":
|
|
@@ -4121,8 +4140,8 @@ function wr(n) {
|
|
|
4121
4140
|
* See the License for the specific language governing permissions and
|
|
4122
4141
|
* limitations under the License.
|
|
4123
4142
|
*/
|
|
4124
|
-
async function
|
|
4125
|
-
return
|
|
4143
|
+
async function br(n, e = {}) {
|
|
4144
|
+
return X(n, "GET", "/v1/projects", e);
|
|
4126
4145
|
}
|
|
4127
4146
|
/**
|
|
4128
4147
|
* @license
|
|
@@ -4140,14 +4159,14 @@ async function Tr(n, e = {}) {
|
|
|
4140
4159
|
* See the License for the specific language governing permissions and
|
|
4141
4160
|
* limitations under the License.
|
|
4142
4161
|
*/
|
|
4143
|
-
const
|
|
4144
|
-
async function
|
|
4162
|
+
const Er = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Sr = /^https?/;
|
|
4163
|
+
async function Rr(n) {
|
|
4145
4164
|
if (n.config.emulator)
|
|
4146
4165
|
return;
|
|
4147
|
-
const { authorizedDomains: e } = await
|
|
4166
|
+
const { authorizedDomains: e } = await br(n);
|
|
4148
4167
|
for (const t of e)
|
|
4149
4168
|
try {
|
|
4150
|
-
if (
|
|
4169
|
+
if (Ar(t))
|
|
4151
4170
|
return;
|
|
4152
4171
|
} catch {
|
|
4153
4172
|
}
|
|
@@ -4157,15 +4176,15 @@ async function br(n) {
|
|
|
4157
4176
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4158
4177
|
);
|
|
4159
4178
|
}
|
|
4160
|
-
function
|
|
4161
|
-
const e =
|
|
4179
|
+
function Ar(n) {
|
|
4180
|
+
const e = Me(), { protocol: t, hostname: i } = new URL(e);
|
|
4162
4181
|
if (n.startsWith("chrome-extension://")) {
|
|
4163
4182
|
const o = new URL(n);
|
|
4164
4183
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4165
4184
|
}
|
|
4166
|
-
if (!
|
|
4185
|
+
if (!Sr.test(t))
|
|
4167
4186
|
return !1;
|
|
4168
|
-
if (
|
|
4187
|
+
if (Er.test(n))
|
|
4169
4188
|
return i === n;
|
|
4170
4189
|
const r = n.replace(/\./g, "\\.");
|
|
4171
4190
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4186,9 +4205,9 @@ function Sr(n) {
|
|
|
4186
4205
|
* See the License for the specific language governing permissions and
|
|
4187
4206
|
* limitations under the License.
|
|
4188
4207
|
*/
|
|
4189
|
-
const
|
|
4208
|
+
const Pr = new oe(3e4, 6e4);
|
|
4190
4209
|
function ft() {
|
|
4191
|
-
const n =
|
|
4210
|
+
const n = E().___jsl;
|
|
4192
4211
|
if (n != null && n.H) {
|
|
4193
4212
|
for (const e of Object.keys(n.H))
|
|
4194
4213
|
if (n.H[e].r = n.H[e].r || [], n.H[e].L = n.H[e].L || [], n.H[e].r = [...n.H[e].L], n.CP)
|
|
@@ -4196,7 +4215,7 @@ function ft() {
|
|
|
4196
4215
|
n.CP[t] = null;
|
|
4197
4216
|
}
|
|
4198
4217
|
}
|
|
4199
|
-
function
|
|
4218
|
+
function Cr(n) {
|
|
4200
4219
|
return new Promise((e, t) => {
|
|
4201
4220
|
var i, r, s;
|
|
4202
4221
|
function o() {
|
|
@@ -4205,36 +4224,36 @@ function Ar(n) {
|
|
|
4205
4224
|
e(gapi.iframes.getContext());
|
|
4206
4225
|
},
|
|
4207
4226
|
ontimeout: () => {
|
|
4208
|
-
ft(), t(
|
|
4227
|
+
ft(), t(b(
|
|
4209
4228
|
n,
|
|
4210
4229
|
"network-request-failed"
|
|
4211
4230
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4212
4231
|
));
|
|
4213
4232
|
},
|
|
4214
|
-
timeout:
|
|
4233
|
+
timeout: Pr.get()
|
|
4215
4234
|
});
|
|
4216
4235
|
}
|
|
4217
|
-
if (!((r = (i =
|
|
4236
|
+
if (!((r = (i = E().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4218
4237
|
e(gapi.iframes.getContext());
|
|
4219
|
-
else if (!((s =
|
|
4238
|
+
else if (!((s = E().gapi) === null || s === void 0) && s.load)
|
|
4220
4239
|
o();
|
|
4221
4240
|
else {
|
|
4222
|
-
const c =
|
|
4223
|
-
return
|
|
4224
|
-
gapi.load ? o() : t(
|
|
4241
|
+
const c = Li("iframefcb");
|
|
4242
|
+
return E()[c] = () => {
|
|
4243
|
+
gapi.load ? o() : t(b(
|
|
4225
4244
|
n,
|
|
4226
4245
|
"network-request-failed"
|
|
4227
4246
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4228
4247
|
));
|
|
4229
|
-
},
|
|
4248
|
+
}, Ni(`${Oi()}?onload=${c}`).catch((a) => t(a));
|
|
4230
4249
|
}
|
|
4231
4250
|
}).catch((e) => {
|
|
4232
4251
|
throw fe = null, e;
|
|
4233
4252
|
});
|
|
4234
4253
|
}
|
|
4235
4254
|
let fe = null;
|
|
4236
|
-
function
|
|
4237
|
-
return fe = fe ||
|
|
4255
|
+
function Nr(n) {
|
|
4256
|
+
return fe = fe || Cr(n), fe;
|
|
4238
4257
|
}
|
|
4239
4258
|
/**
|
|
4240
4259
|
* @license
|
|
@@ -4252,7 +4271,7 @@ function Pr(n) {
|
|
|
4252
4271
|
* See the License for the specific language governing permissions and
|
|
4253
4272
|
* limitations under the License.
|
|
4254
4273
|
*/
|
|
4255
|
-
const
|
|
4274
|
+
const Or = new oe(5e3, 15e3), Lr = "__/auth/iframe", Mr = "emulator/auth/iframe", Ur = {
|
|
4256
4275
|
style: {
|
|
4257
4276
|
position: "absolute",
|
|
4258
4277
|
top: "-100px",
|
|
@@ -4261,13 +4280,13 @@ const Cr = new oe(5e3, 15e3), Nr = "__/auth/iframe", Or = "emulator/auth/iframe"
|
|
|
4261
4280
|
},
|
|
4262
4281
|
"aria-hidden": "true",
|
|
4263
4282
|
tabindex: "-1"
|
|
4264
|
-
},
|
|
4283
|
+
}, Dr = /* @__PURE__ */ new Map([
|
|
4265
4284
|
["identitytoolkit.googleapis.com", "p"],
|
|
4266
4285
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4267
4286
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4268
4287
|
// test
|
|
4269
4288
|
]);
|
|
4270
|
-
function
|
|
4289
|
+
function xr(n) {
|
|
4271
4290
|
const e = n.config;
|
|
4272
4291
|
u(
|
|
4273
4292
|
e.authDomain,
|
|
@@ -4275,17 +4294,17 @@ function Ur(n) {
|
|
|
4275
4294
|
"auth-domain-config-required"
|
|
4276
4295
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4277
4296
|
);
|
|
4278
|
-
const t = e.emulator ? je(e,
|
|
4297
|
+
const t = e.emulator ? je(e, Mr) : `https://${n.config.authDomain}/${Lr}`, i = {
|
|
4279
4298
|
apiKey: e.apiKey,
|
|
4280
4299
|
appName: n.name,
|
|
4281
4300
|
v: re
|
|
4282
|
-
}, r =
|
|
4301
|
+
}, r = Dr.get(n.config.apiHost);
|
|
4283
4302
|
r && (i.eid = r);
|
|
4284
4303
|
const s = n._getFrameworks();
|
|
4285
4304
|
return s.length && (i.fw = s.join(",")), `${t}?${se(i).slice(1)}`;
|
|
4286
4305
|
}
|
|
4287
|
-
async function
|
|
4288
|
-
const e = await
|
|
4306
|
+
async function Fr(n) {
|
|
4307
|
+
const e = await Nr(n), t = E().gapi;
|
|
4289
4308
|
return u(
|
|
4290
4309
|
t,
|
|
4291
4310
|
n,
|
|
@@ -4293,24 +4312,24 @@ async function Dr(n) {
|
|
|
4293
4312
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4294
4313
|
), e.open({
|
|
4295
4314
|
where: document.body,
|
|
4296
|
-
url:
|
|
4315
|
+
url: xr(n),
|
|
4297
4316
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4298
|
-
attributes:
|
|
4317
|
+
attributes: Ur,
|
|
4299
4318
|
dontclear: !0
|
|
4300
4319
|
}, (i) => new Promise(async (r, s) => {
|
|
4301
4320
|
await i.restyle({
|
|
4302
4321
|
// Prevent iframe from closing on mouse out.
|
|
4303
4322
|
setHideOnLeave: !1
|
|
4304
4323
|
});
|
|
4305
|
-
const o =
|
|
4324
|
+
const o = b(
|
|
4306
4325
|
n,
|
|
4307
4326
|
"network-request-failed"
|
|
4308
4327
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4309
|
-
), c =
|
|
4328
|
+
), c = E().setTimeout(() => {
|
|
4310
4329
|
s(o);
|
|
4311
|
-
},
|
|
4330
|
+
}, Or.get());
|
|
4312
4331
|
function a() {
|
|
4313
|
-
|
|
4332
|
+
E().clearTimeout(c), r(i);
|
|
4314
4333
|
}
|
|
4315
4334
|
i.ping(a).then(a, () => {
|
|
4316
4335
|
s(o);
|
|
@@ -4333,12 +4352,12 @@ async function Dr(n) {
|
|
|
4333
4352
|
* See the License for the specific language governing permissions and
|
|
4334
4353
|
* limitations under the License.
|
|
4335
4354
|
*/
|
|
4336
|
-
const
|
|
4355
|
+
const Vr = {
|
|
4337
4356
|
location: "yes",
|
|
4338
4357
|
resizable: "yes",
|
|
4339
4358
|
statusbar: "yes",
|
|
4340
4359
|
toolbar: "no"
|
|
4341
|
-
},
|
|
4360
|
+
}, $r = 500, Hr = 600, jr = "_blank", Wr = "http://localhost";
|
|
4342
4361
|
class pt {
|
|
4343
4362
|
constructor(e) {
|
|
4344
4363
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4351,33 +4370,33 @@ class pt {
|
|
|
4351
4370
|
}
|
|
4352
4371
|
}
|
|
4353
4372
|
}
|
|
4354
|
-
function
|
|
4373
|
+
function Br(n, e, t, i = $r, r = Hr) {
|
|
4355
4374
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4356
4375
|
let c = "";
|
|
4357
|
-
const a = Object.assign(Object.assign({},
|
|
4376
|
+
const a = Object.assign(Object.assign({}, Vr), {
|
|
4358
4377
|
width: i.toString(),
|
|
4359
4378
|
height: r.toString(),
|
|
4360
4379
|
top: s,
|
|
4361
4380
|
left: o
|
|
4362
|
-
}), l =
|
|
4363
|
-
t && (c = Ft(l) ?
|
|
4364
|
-
const d = Object.entries(a).reduce((
|
|
4365
|
-
if (
|
|
4366
|
-
return
|
|
4367
|
-
const
|
|
4381
|
+
}), l = w().toLowerCase();
|
|
4382
|
+
t && (c = Ft(l) ? jr : t), xt(l) && (e = e || Wr, a.scrollbars = "yes");
|
|
4383
|
+
const d = Object.entries(a).reduce((h, [y, _]) => `${h}${y}=${_},`, "");
|
|
4384
|
+
if (Ti(l) && c !== "_self")
|
|
4385
|
+
return Gr(e || "", c), new pt(null);
|
|
4386
|
+
const p = window.open(e || "", c, d);
|
|
4368
4387
|
u(
|
|
4369
|
-
|
|
4388
|
+
p,
|
|
4370
4389
|
n,
|
|
4371
4390
|
"popup-blocked"
|
|
4372
4391
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
4373
4392
|
);
|
|
4374
4393
|
try {
|
|
4375
|
-
|
|
4394
|
+
p.focus();
|
|
4376
4395
|
} catch {
|
|
4377
4396
|
}
|
|
4378
|
-
return new pt(
|
|
4397
|
+
return new pt(p);
|
|
4379
4398
|
}
|
|
4380
|
-
function
|
|
4399
|
+
function Gr(n, e) {
|
|
4381
4400
|
const t = document.createElement("a");
|
|
4382
4401
|
t.href = n, t.target = e;
|
|
4383
4402
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4399,7 +4418,7 @@ function Wr(n, e) {
|
|
|
4399
4418
|
* See the License for the specific language governing permissions and
|
|
4400
4419
|
* limitations under the License.
|
|
4401
4420
|
*/
|
|
4402
|
-
const
|
|
4421
|
+
const zr = "__/auth/handler", qr = "emulator/auth/handler", Kr = encodeURIComponent("fac");
|
|
4403
4422
|
async function mt(n, e, t, i, r, s) {
|
|
4404
4423
|
u(
|
|
4405
4424
|
n.config.authDomain,
|
|
@@ -4421,23 +4440,23 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4421
4440
|
eventId: r
|
|
4422
4441
|
};
|
|
4423
4442
|
if (e instanceof qt) {
|
|
4424
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4425
|
-
for (const [d,
|
|
4426
|
-
o[d] =
|
|
4443
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", On(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4444
|
+
for (const [d, p] of Object.entries({}))
|
|
4445
|
+
o[d] = p;
|
|
4427
4446
|
}
|
|
4428
4447
|
if (e instanceof ae) {
|
|
4429
|
-
const d = e.getScopes().filter((
|
|
4448
|
+
const d = e.getScopes().filter((p) => p !== "");
|
|
4430
4449
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4431
4450
|
}
|
|
4432
4451
|
n.tenantId && (o.tid = n.tenantId);
|
|
4433
4452
|
const c = o;
|
|
4434
4453
|
for (const d of Object.keys(c))
|
|
4435
4454
|
c[d] === void 0 && delete c[d];
|
|
4436
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4437
|
-
return `${
|
|
4455
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Kr}=${encodeURIComponent(a)}` : "";
|
|
4456
|
+
return `${Jr(n)}?${se(c).slice(1)}${l}`;
|
|
4438
4457
|
}
|
|
4439
|
-
function
|
|
4440
|
-
return n.emulator ? je(n,
|
|
4458
|
+
function Jr({ config: n }) {
|
|
4459
|
+
return n.emulator ? je(n, qr) : `https://${n.authDomain}/${zr}`;
|
|
4441
4460
|
}
|
|
4442
4461
|
/**
|
|
4443
4462
|
* @license
|
|
@@ -4455,23 +4474,23 @@ function qr({ config: n }) {
|
|
|
4455
4474
|
* See the License for the specific language governing permissions and
|
|
4456
4475
|
* limitations under the License.
|
|
4457
4476
|
*/
|
|
4458
|
-
const
|
|
4459
|
-
class
|
|
4477
|
+
const Ne = "webStorageSupport";
|
|
4478
|
+
class Yr {
|
|
4460
4479
|
constructor() {
|
|
4461
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn =
|
|
4480
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn = yr, this._overrideRedirectResult = _r;
|
|
4462
4481
|
}
|
|
4463
4482
|
// Wrapping in async even though we don't await anywhere in order
|
|
4464
4483
|
// to make sure errors are raised as promise rejections
|
|
4465
4484
|
async _openPopup(e, t, i, r) {
|
|
4466
4485
|
var s;
|
|
4467
4486
|
L((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4468
|
-
const o = await mt(e, t, i,
|
|
4469
|
-
return
|
|
4487
|
+
const o = await mt(e, t, i, Me(), r);
|
|
4488
|
+
return Br(e, o, ze());
|
|
4470
4489
|
}
|
|
4471
4490
|
async _openRedirect(e, t, i, r) {
|
|
4472
4491
|
await this._originValidation(e);
|
|
4473
|
-
const s = await mt(e, t, i,
|
|
4474
|
-
return
|
|
4492
|
+
const s = await mt(e, t, i, Me(), r);
|
|
4493
|
+
return Zi(s), new Promise(() => {
|
|
4475
4494
|
});
|
|
4476
4495
|
}
|
|
4477
4496
|
_initialize(e) {
|
|
@@ -4486,7 +4505,7 @@ class Kr {
|
|
|
4486
4505
|
}), i;
|
|
4487
4506
|
}
|
|
4488
4507
|
async initAndGetManager(e) {
|
|
4489
|
-
const t = await
|
|
4508
|
+
const t = await Fr(e), i = new Tr(e);
|
|
4490
4509
|
return t.register("authEvent", (r) => (u(
|
|
4491
4510
|
r == null ? void 0 : r.authEvent,
|
|
4492
4511
|
e,
|
|
@@ -4498,9 +4517,9 @@ class Kr {
|
|
|
4498
4517
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: i }, this.iframes[e._key()] = t, i;
|
|
4499
4518
|
}
|
|
4500
4519
|
_isIframeWebStorageSupported(e, t) {
|
|
4501
|
-
this.iframes[e._key()].send(
|
|
4520
|
+
this.iframes[e._key()].send(Ne, { type: Ne }, (r) => {
|
|
4502
4521
|
var s;
|
|
4503
|
-
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[
|
|
4522
|
+
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
4504
4523
|
o !== void 0 && t(!!o), O(
|
|
4505
4524
|
e,
|
|
4506
4525
|
"internal-error"
|
|
@@ -4510,13 +4529,13 @@ class Kr {
|
|
|
4510
4529
|
}
|
|
4511
4530
|
_originValidation(e) {
|
|
4512
4531
|
const t = e._key();
|
|
4513
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4532
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Rr(e)), this.originValidationPromises[t];
|
|
4514
4533
|
}
|
|
4515
4534
|
get _shouldInitProactively() {
|
|
4516
|
-
return Wt() || Be() ||
|
|
4535
|
+
return Wt() || Be() || ke();
|
|
4517
4536
|
}
|
|
4518
4537
|
}
|
|
4519
|
-
const
|
|
4538
|
+
const Xr = Yr;
|
|
4520
4539
|
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4521
4540
|
/**
|
|
4522
4541
|
* @license
|
|
@@ -4534,7 +4553,7 @@ var gt = "@firebase/auth", _t = "1.7.5";
|
|
|
4534
4553
|
* See the License for the specific language governing permissions and
|
|
4535
4554
|
* limitations under the License.
|
|
4536
4555
|
*/
|
|
4537
|
-
class
|
|
4556
|
+
class Qr {
|
|
4538
4557
|
constructor(e) {
|
|
4539
4558
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4540
4559
|
}
|
|
@@ -4585,7 +4604,7 @@ class Yr {
|
|
|
4585
4604
|
* See the License for the specific language governing permissions and
|
|
4586
4605
|
* limitations under the License.
|
|
4587
4606
|
*/
|
|
4588
|
-
function
|
|
4607
|
+
function Zr(n) {
|
|
4589
4608
|
switch (n) {
|
|
4590
4609
|
case "Node":
|
|
4591
4610
|
return "node";
|
|
@@ -4601,7 +4620,7 @@ function Xr(n) {
|
|
|
4601
4620
|
return;
|
|
4602
4621
|
}
|
|
4603
4622
|
}
|
|
4604
|
-
function
|
|
4623
|
+
function es(n) {
|
|
4605
4624
|
Ze(new et(
|
|
4606
4625
|
"auth",
|
|
4607
4626
|
(e, { options: t }) => {
|
|
@@ -4615,8 +4634,8 @@ function Qr(n) {
|
|
|
4615
4634
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4616
4635
|
apiScheme: "https",
|
|
4617
4636
|
sdkClientVersion: Bt(n)
|
|
4618
|
-
}, l = new
|
|
4619
|
-
return
|
|
4637
|
+
}, l = new Pi(i, r, s, a);
|
|
4638
|
+
return Ui(l, t), l;
|
|
4620
4639
|
},
|
|
4621
4640
|
"PUBLIC"
|
|
4622
4641
|
/* ComponentType.PUBLIC */
|
|
@@ -4631,18 +4650,18 @@ function Qr(n) {
|
|
|
4631
4650
|
})), Ze(new et(
|
|
4632
4651
|
"auth-internal",
|
|
4633
4652
|
(e) => {
|
|
4634
|
-
const t =
|
|
4653
|
+
const t = be(e.getProvider(
|
|
4635
4654
|
"auth"
|
|
4636
4655
|
/* _ComponentName.AUTH */
|
|
4637
4656
|
).getImmediate());
|
|
4638
|
-
return ((i) => new
|
|
4657
|
+
return ((i) => new Qr(i))(t);
|
|
4639
4658
|
},
|
|
4640
4659
|
"PRIVATE"
|
|
4641
4660
|
/* ComponentType.PRIVATE */
|
|
4642
4661
|
).setInstantiationMode(
|
|
4643
4662
|
"EXPLICIT"
|
|
4644
4663
|
/* InstantiationMode.EXPLICIT */
|
|
4645
|
-
)),
|
|
4664
|
+
)), Le(gt, _t, Zr(n)), Le(gt, _t, "esm2017");
|
|
4646
4665
|
}
|
|
4647
4666
|
/**
|
|
4648
4667
|
* @license
|
|
@@ -4660,11 +4679,11 @@ function Qr(n) {
|
|
|
4660
4679
|
* See the License for the specific language governing permissions and
|
|
4661
4680
|
* limitations under the License.
|
|
4662
4681
|
*/
|
|
4663
|
-
const
|
|
4682
|
+
const ts = 5 * 60, ns = kt("authIdTokenMaxAge") || ts;
|
|
4664
4683
|
let vt = null;
|
|
4665
|
-
const
|
|
4684
|
+
const is = (n) => async (e) => {
|
|
4666
4685
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4667
|
-
if (i && i >
|
|
4686
|
+
if (i && i > ns)
|
|
4668
4687
|
return;
|
|
4669
4688
|
const r = t == null ? void 0 : t.token;
|
|
4670
4689
|
vt !== r && (vt = r, await fetch(n, {
|
|
@@ -4674,104 +4693,104 @@ const ts = (n) => async (e) => {
|
|
|
4674
4693
|
} : {}
|
|
4675
4694
|
}));
|
|
4676
4695
|
};
|
|
4677
|
-
function
|
|
4678
|
-
const e =
|
|
4696
|
+
function rs(n = An()) {
|
|
4697
|
+
const e = bt(n, "auth");
|
|
4679
4698
|
if (e.isInitialized())
|
|
4680
4699
|
return e.getImmediate();
|
|
4681
|
-
const t =
|
|
4682
|
-
popupRedirectResolver:
|
|
4700
|
+
const t = Mi(n, {
|
|
4701
|
+
popupRedirectResolver: Xr,
|
|
4683
4702
|
persistence: [
|
|
4684
|
-
|
|
4685
|
-
|
|
4703
|
+
cr,
|
|
4704
|
+
Yi,
|
|
4686
4705
|
Qt
|
|
4687
4706
|
]
|
|
4688
4707
|
}), i = kt("authTokenSyncURL");
|
|
4689
4708
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4690
4709
|
const s = new URL(i, location.origin);
|
|
4691
4710
|
if (location.origin === s.origin) {
|
|
4692
|
-
const o =
|
|
4693
|
-
|
|
4711
|
+
const o = is(s.toString());
|
|
4712
|
+
zi(t, o, () => o(t.currentUser)), Gi(t, (c) => o(c));
|
|
4694
4713
|
}
|
|
4695
4714
|
}
|
|
4696
|
-
const r =
|
|
4697
|
-
return r &&
|
|
4715
|
+
const r = Rn("auth");
|
|
4716
|
+
return r && Di(t, `http://${r}`), t;
|
|
4698
4717
|
}
|
|
4699
|
-
function
|
|
4718
|
+
function ss() {
|
|
4700
4719
|
var n, e;
|
|
4701
4720
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4702
4721
|
}
|
|
4703
|
-
|
|
4722
|
+
Ci({
|
|
4704
4723
|
loadJS(n) {
|
|
4705
4724
|
return new Promise((e, t) => {
|
|
4706
4725
|
const i = document.createElement("script");
|
|
4707
4726
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4708
|
-
const s =
|
|
4727
|
+
const s = b(
|
|
4709
4728
|
"internal-error"
|
|
4710
4729
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4711
4730
|
);
|
|
4712
4731
|
s.customData = r, t(s);
|
|
4713
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4732
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", ss().appendChild(i);
|
|
4714
4733
|
});
|
|
4715
4734
|
},
|
|
4716
4735
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4717
4736
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4718
4737
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4719
4738
|
});
|
|
4720
|
-
|
|
4739
|
+
es(
|
|
4721
4740
|
"Browser"
|
|
4722
4741
|
/* ClientPlatform.BROWSER */
|
|
4723
4742
|
);
|
|
4724
|
-
var
|
|
4725
|
-
const
|
|
4743
|
+
var os = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" }, as = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc", voucherAppUrl: "https://voucher.feedme.cc/" };
|
|
4744
|
+
const cs = {
|
|
4726
4745
|
key: 2,
|
|
4727
4746
|
class: "h-full w-full"
|
|
4728
|
-
},
|
|
4747
|
+
}, ls = ["src"], Ss = /* @__PURE__ */ xe({
|
|
4729
4748
|
__name: "App",
|
|
4730
4749
|
setup(n) {
|
|
4731
|
-
const e =
|
|
4732
|
-
const
|
|
4733
|
-
return `${
|
|
4750
|
+
const e = ge(), t = pn(), i = mn(), r = gn(), s = _n(), o = wt(), c = ee(o.query.showHeader !== "false"), a = ee(!1), { currentBusiness: l } = ge(), d = ee(!1), p = ne(() => i.version), h = ne(() => {
|
|
4751
|
+
const m = e.currentCountry.value || "MY", I = tt.getIdToken(), T = l.value._id;
|
|
4752
|
+
return `${as.marketingV1Portal}/b/${T}/marketing/overview?showHeader=false&country=${m}&token=${I}`;
|
|
4734
4753
|
});
|
|
4735
|
-
async function
|
|
4736
|
-
if (
|
|
4754
|
+
async function y() {
|
|
4755
|
+
if (Ln().length) {
|
|
4737
4756
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4738
4757
|
return;
|
|
4739
4758
|
}
|
|
4740
|
-
const
|
|
4741
|
-
await
|
|
4759
|
+
const m = Mn(os.firebase), I = await fn.getCustomToken(), T = rs();
|
|
4760
|
+
await Bi(T, I), Un(m), console.log("initFirebase", m);
|
|
4742
4761
|
}
|
|
4743
|
-
const
|
|
4744
|
-
d.value = !1, await
|
|
4762
|
+
const _ = async () => {
|
|
4763
|
+
d.value = !1, await dn(), console.log("forceRerender"), tt.setBusinessId(l.value._id), await i.readPremium(), !a.value && p.value === "v2" ? e.registerSidebarComponent(Vn) : e.hideSidebarToggle(!0), await y(), a.value = !0, d.value = !0;
|
|
4745
4764
|
};
|
|
4746
|
-
return
|
|
4747
|
-
if (
|
|
4748
|
-
const
|
|
4749
|
-
|
|
4765
|
+
return un(() => {
|
|
4766
|
+
if (Dn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4767
|
+
const m = document.getElementsByClassName("app-header")[0], I = document.getElementsByClassName("app-sidebar")[0], T = document.getElementsByClassName("app-container")[0], M = document.getElementsByTagName("main")[0];
|
|
4768
|
+
m == null || m.classList.add("!hidden"), I == null || I.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), M == null || M.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4750
4769
|
}
|
|
4751
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4752
|
-
}),
|
|
4770
|
+
l.value != null && (console.log("App mounted, forceRerender"), _());
|
|
4771
|
+
}), pe(
|
|
4753
4772
|
() => e.currentBusiness.value,
|
|
4754
|
-
async (
|
|
4755
|
-
console.log("Current business changed"),
|
|
4773
|
+
async (m, I) => {
|
|
4774
|
+
console.log("Current business changed"), m != null && m._id != I._id && (console.log("forceRerender when business changes", m, I), _());
|
|
4756
4775
|
}
|
|
4757
|
-
), (
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
S(
|
|
4762
|
-
json: { url:
|
|
4776
|
+
), (m, I) => (j(), me(It, null, [
|
|
4777
|
+
g(d) && g(p) === "v2" ? (j(), Oe(g(hn), { key: 0 })) : Pe("", !0),
|
|
4778
|
+
g(d) && g(p) === "v2" && g(c) ? (j(), Oe(ii, { key: 1 })) : Pe("", !0),
|
|
4779
|
+
g(d) && g(p) !== "v2" ? (j(), me("div", cs, [
|
|
4780
|
+
S(wn, {
|
|
4781
|
+
json: { url: g(h) }
|
|
4763
4782
|
}, null, 8, ["json"]),
|
|
4764
|
-
|
|
4783
|
+
v("iframe", {
|
|
4765
4784
|
allow: "clipboard-read; clipboard-write",
|
|
4766
4785
|
frameBorder: "0",
|
|
4767
4786
|
height: "100%",
|
|
4768
4787
|
width: "100%",
|
|
4769
|
-
src:
|
|
4770
|
-
}, null, 8,
|
|
4771
|
-
])) :
|
|
4788
|
+
src: g(h)
|
|
4789
|
+
}, null, 8, ls)
|
|
4790
|
+
])) : Pe("", !0)
|
|
4772
4791
|
], 64));
|
|
4773
4792
|
}
|
|
4774
4793
|
});
|
|
4775
4794
|
export {
|
|
4776
|
-
|
|
4795
|
+
Ss as default
|
|
4777
4796
|
};
|