@feedmepos/mf-connect 0.1.98-beta.72 → 0.1.98-beta.74
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-DpYceiwG.js → App-COUNgNnC.js} +493 -474
- package/dist/{AuditLogs-CG98b2qE.js → AuditLogs-CY45tdqr.js} +14 -13
- package/dist/{Bin-vdipv2fF.js → Bin-COrX2Oq4.js} +8 -8
- package/dist/{Broadcast-ChwVqheE.js → Broadcast-BQxJ8Edf.js} +89 -86
- package/dist/{CampaignAnalytic-4PHO849x.js → CampaignAnalytic-CSYrBckT.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DmnN4pjm.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DQUQxU1_.js} +7 -6
- package/dist/{Card-B6ol3PQw.js → Card-62iX4uef.js} +24 -23
- package/dist/{Collections-DodNIUr1.js → Collections-BxexBaGi.js} +8 -8
- package/dist/{Credit-CJQyAZYw.js → Credit-B5fLK5ot.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang--FqHJ7Ez.js → DateRangeChip.vue_vue_type_script_setup_true_lang-C738fOnK.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CA31QP-A.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CloubCwR.js} +547 -497
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DkKhdp7G.js → EffectSheet.vue_vue_type_style_index_0_lang-tFwP9_hm.js} +6 -6
- package/dist/{Experience-iLAKddx_.js → Experience-BReFp_Dz.js} +87 -84
- package/dist/{FileSaver.min-w_ExQ0py.js → FileSaver.min-o09GwL8H.js} +1 -1
- package/dist/{Game-DWdUbsAg.js → Game-DTDVEBrO.js} +13 -13
- package/dist/{GiftCardSetup-DnQ5vwxu.js → GiftCardSetup-CP7Pdqcb.js} +10 -10
- package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-DzV35QnL.js +417 -0
- package/dist/Goals-BNspliQP.js +244 -0
- package/dist/{Grab-CFLRHs5w.js → Grab-C3xNIYzE.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-uQJvjvTe.js → ImageInput.vue_vue_type_script_setup_true_lang-BidKqIgw.js} +1 -1
- package/dist/{Index-CUy4z2tS.js → Index-CRlr03xg.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-hKJ41Fe_.js → LocationPicker.vue_vue_type_script_setup_true_lang-_YyfSHpE.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BDmtqTVC.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CMfRL6Ef.js} +1 -1
- package/dist/{LoyaltyDashboard-C5o7KriA.js → LoyaltyDashboard-BQpKd2JC.js} +1213 -1170
- package/dist/{MainLayout-Dt0ywph3.js → MainLayout-BIVZ2S6v.js} +3 -3
- package/dist/{Marketing-BHwxzBZ0.js → Marketing-8SvgFvTs.js} +4 -4
- package/dist/{MarketingMaterialEdit-B6k4ceGx.js → MarketingMaterialEdit-DXaM4RKu.js} +6 -6
- package/dist/{Member-DcPZfTj6.js → Member-DucF8ody.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CiiBrlHY.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CMQ1b_BI.js} +26 -25
- package/dist/{MemberImportHistory-DmPMuu1g.js → MemberImportHistory-BB-pNBDA.js} +7 -7
- package/dist/{MemberList-f9JejfNW.js → MemberList-CazaLinm.js} +14 -14
- package/dist/{MemberTransactions-D1YSXeX-.js → MemberTransactions-0PaBQaYk.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-freeE-DP.js → MessageInput.vue_vue_type_script_setup_true_lang-Dv2rIoW2.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-m7ytg0ok.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DWn3ajhn.js} +1 -1
- package/dist/{Mission-BaaEl5BV.js → Mission-DxH1u9Ps.js} +84 -81
- package/dist/{Overview-CviY55Gs.js → Overview-BcDJv-LJ.js} +4 -4
- package/dist/{Overview-fx-0E3b8.js → Overview-vepmOail.js} +22 -21
- package/dist/{Point-BfqtflbC.js → Point-LgZ_UrwI.js} +108 -99
- package/dist/{Promotion-Be2ogRYt.js → Promotion-CC6Drl2T.js} +96 -93
- package/dist/{Queue-CLSUL-Cx.js → Queue-CeYuqidN.js} +14 -13
- package/dist/{Record-CpTMQT7B.js → Record-B17ZYsb5.js} +9 -9
- package/dist/{Review-DzSDx7dY.js → Review-D6yhv3J7.js} +2 -2
- package/dist/{ReviewFacebookCallback-CvbPJADM.js → ReviewFacebookCallback-BAB4epr8.js} +5 -5
- package/dist/{ReviewGoogleCallback-DJlqMbh3.js → ReviewGoogleCallback-CZccpOLv.js} +5 -5
- package/dist/{Reward-DJOmd6Z5.js → Reward-PdgtYMnB.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DY9fYxwc.js → RewardGroup.vue_vue_type_script_setup_true_lang-CiVHQa5M.js} +25 -24
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BgYK4hpo.js → RuleGroup.vue_vue_type_script_setup_true_lang-_rUcf5lG.js} +16 -15
- package/dist/{Segment-G6xmeEaq.js → Segment-DVK6xqb9.js} +27 -26
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3O0biLZ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CiR-d0s-.js} +16 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CWP5sGT7.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkPnwcE1.js} +4 -4
- package/dist/{Setting-CKp441AW.js → Setting-D9x8t85J.js} +14 -14
- package/dist/{SettingAdvertisements-C4Uf-DgK.js → SettingAdvertisements-VUfOdSPw.js} +12 -12
- package/dist/{Settings-CTvMVwp6.js → Settings-B_cbux1z.js} +5 -5
- package/dist/{Store-Bzei6Xev.js → Store-BmMCgHeP.js} +28 -27
- package/dist/{StoreRewards-DMQNIpF5.js → StoreRewards-D_TSVQMf.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-mm1jbcvo.js → StoreTransactions.vue_vue_type_script_setup_true_lang-qMRV_p8H.js} +29 -28
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BspBXIO2.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DKOE5bcU.js} +2 -2
- package/dist/{Tier-BN32RwYr.js → Tier-BNQ_RmZV.js} +914 -922
- package/dist/{Title-BIhgfRUI.js → Title-DHicIYnB.js} +24 -23
- package/dist/{Transaction-CPjA7IN9.js → Transaction-B57Begy_.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DSutMvfk.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cw852iqb.js} +6 -6
- package/dist/Voucher-DIZfWgdX.js +837 -0
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B-IwtPvx.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BhYXVG4z.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Ce9xPwqA.js → ZodTextField.vue_vue_type_script_setup_true_lang-RnvpoPAb.js} +2 -2
- package/dist/{app-DAtx6aZ4.js → app-D59Y5Pmz.js} +1698 -1374
- package/dist/app.js +1 -1
- package/dist/{base.export-BtRC4aWM.js → base.export-Bp2NvmoR.js} +2 -2
- package/dist/{business-BZUIs8Ub.js → business-CZnoeYYk.js} +1 -1
- package/dist/{campaign-B6I6PuY4.js → campaign-C0od4X1k.js} +2 -2
- package/dist/{campaign-DKjBjV2k.js → campaign-CXR35buF.js} +103 -101
- package/dist/{campaign.enum-BQy3e845.js → campaign.enum-DlrjqgBa.js} +1 -1
- package/dist/{campaign.fn--qVJ3jeH.js → campaign.fn-bEy0au5e.js} +39 -39
- package/dist/{collectible.enum-vcvRFGl0.js → collectible.enum-Czi69PBO.js} +1 -1
- package/dist/{collection.fn-C3bMPBkC.js → collection.fn-DzPeFXPq.js} +2 -2
- package/dist/{currency--R6VPInw.js → currency-DktN5oXx.js} +1 -1
- package/dist/{duplicateCampaign-aIsX9cCi.js → duplicateCampaign-Dc_9ZYk5.js} +2 -2
- package/dist/{effect-CbjmtRph.js → effect-KY41iVGx.js} +1 -1
- package/dist/{email-addresses-DZKMnoKf.js → email-addresses-CRGGbqZn.js} +2 -2
- package/dist/{helper-BGqw2-RO.js → helper-BT8y_Hpb.js} +1 -1
- package/dist/{index-DcA0B-Y5.js → index-0awpDQm_.js} +1109 -32
- package/dist/{index-C22GPEM-.js → index-11j23Lx1.js} +1 -1
- package/dist/{index-CVvSd60O.js → index-377HHaUi.js} +1 -1
- package/dist/{index-CXL5WAH0.js → index-B30DDvin.js} +3 -3
- package/dist/{index-CVYbfRGO.js → index-BE8jnf9X.js} +1 -1
- package/dist/{index-FnsjvtSo.js → index-BWR1QjWQ.js} +5 -5
- package/dist/{index-v8Zv-2ko.js → index-BZnzbUL3.js} +10 -9
- package/dist/{index-Bb4TieR_.js → index-BhJpa8K-.js} +3 -3
- package/dist/{index-kkhrPH6s.js → index-BzKHBymK.js} +2 -2
- package/dist/{index-D-P90w8K.js → index-CMJp7VdE.js} +1 -1
- package/dist/{index-7TKoSEJ2.js → index-CTPFlKiY.js} +1124 -1124
- package/dist/{index-D_o9LsHU.js → index-CTe-H50U.js} +3 -3
- package/dist/{index-LnCoUCnx.js → index-CYgzVl3H.js} +3 -3
- package/dist/index-ClNPGM0y.js +166 -0
- package/dist/{index-LlFZ5kxi.js → index-D-V84VLW.js} +131 -119
- package/dist/{index-BbpqZrkB.js → index-D2FgYlbx.js} +1 -1
- package/dist/{index-ClP7Xy6Q.js → index-DiicsY5E.js} +1 -1
- package/dist/{index-BWlfW4Kr.js → index-E4B5H1FX.js} +2 -2
- package/dist/{index-B9DM5Vuv.js → index-G8qEVB7S.js} +2 -2
- package/dist/{index.esm2017-DO7bbE7J.js → index.esm2017-DKzsf5EJ.js} +1 -1
- package/dist/{loading-CzWOx4tE.js → loading-AuVL4WdD.js} +1 -1
- package/dist/{lodash-B_gr6Ayu.js → lodash-Bm8ZbAXg.js} +1 -1
- package/dist/{member-import-BxCrd9tq.js → member-import-Kq5CMrPF.js} +1 -1
- package/dist/{membership-ILB4aB4h.js → membership-8f9xLURB.js} +3 -3
- package/dist/{money-CpIK1N_r.js → money-JRN61MHj.js} +1 -1
- package/dist/{number-leVwmDCm.js → number-Dd6DRScj.js} +1 -1
- package/dist/{objectid-8hKuNcMN.js → objectid-_tuwJN_b.js} +2 -2
- package/dist/onboarding-DOPR1c3u.js +129 -0
- package/dist/onboardingSetup-DOR-OW92.js +17 -0
- package/dist/{plugins-DLIgnFIF.js → plugins-DPFr2tq7.js} +3 -3
- package/dist/{reward-DqT0zF01.js → reward-B-yDjlsA.js} +1 -1
- package/dist/{rule-DBtMGLxD.js → rule-DRN4bolS.js} +19 -18
- package/dist/{template-CYKGCWY4.js → template-7UtS_hVI.js} +6 -6
- package/dist/{timezone-Brs5nrTL.js → timezone-BmZfPTab.js} +1 -1
- package/dist/{transaction.fn-0ZZcVp-j.js → transaction.fn-C9WOWjoC.js} +2 -2
- package/dist/{trigger-LhNre1L9.js → trigger-BDKxlupM.js} +5 -5
- package/dist/{useMarketingMaterialActions-DbDRMmhM.js → useMarketingMaterialActions-DJ7__20D.js} +3 -3
- package/dist/{usePagination-DmZX0V64.js → usePagination-Czb6ZvSX.js} +1 -1
- package/dist/{user-CBPsvnx9.js → user-C-y46MEn.js} +1 -1
- package/dist/{vue-i18n-BPeSHE3c.js → vue-i18n-l6QdWh8z.js} +339 -339
- package/dist/{xlsx-Cm3vGmLN.js → xlsx-Dbm5Y1eY.js} +1 -1
- package/dist/{zod-GTEcy37q.js → zod-DciqV0cq.js} +1 -1
- package/package.json +1 -1
- package/dist/Voucher-CGJtn9bC.js +0 -444
|
@@ -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-CZnoeYYk.js";
|
|
6
|
+
import "./index-D2FgYlbx.js";
|
|
7
|
+
import { components as B, useSnackbar as gn, useDialog as _n } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Tt } from "./vue-i18n-l6QdWh8z.js";
|
|
9
|
+
import { m as vn } from "./index-BE8jnf9X.js";
|
|
10
|
+
import { C as Xe } from "./timezone-BmZfPTab.js";
|
|
11
|
+
import { u as In } from "./onboarding-DOPR1c3u.js";
|
|
12
|
+
import { R as f, A as yn, a as Qe } from "./app-D59Y5Pmz.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-DKzsf5EJ.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-G8qEVB7S.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"]
|
|
@@ -62,7 +63,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
62
63
|
{
|
|
63
64
|
label: e("connect.navigation.point"),
|
|
64
65
|
value: f["$connect-PROGRAM_POINT"],
|
|
65
|
-
badge: () =>
|
|
66
|
+
badge: () => H(B.FmPill, { variant: "premium" })
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
label: e("connect.navigation.credit"),
|
|
@@ -71,7 +72,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
71
72
|
{
|
|
72
73
|
label: e("connect.navigation.game"),
|
|
73
74
|
value: f["$connect-PROGRAM_GAME"],
|
|
74
|
-
badge: () =>
|
|
75
|
+
badge: () => H(B.FmPill, { variant: "premium" })
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
label: "Mission",
|
|
@@ -90,19 +91,19 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
90
91
|
{
|
|
91
92
|
label: e("connect.navigation.segments"),
|
|
92
93
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
93
|
-
badge: () =>
|
|
94
|
+
badge: () => H(B.FmPill, { variant: "premium" })
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
label: e("connect.navigation.card"),
|
|
97
98
|
value: f["$connect-LOYALTY_CARD"],
|
|
98
|
-
badge: () =>
|
|
99
|
+
badge: () => H(B.FmPill, { variant: "premium" })
|
|
99
100
|
}
|
|
100
101
|
]
|
|
101
102
|
},
|
|
102
103
|
{
|
|
103
104
|
label: e("connect.navigation.referral"),
|
|
104
105
|
value: f["$connect-REFERRAL"],
|
|
105
|
-
badge: () =>
|
|
106
|
+
badge: () => H(B.FmPill, { variant: "premium" })
|
|
106
107
|
},
|
|
107
108
|
{
|
|
108
109
|
label: e("connect.navigation.store"),
|
|
@@ -124,6 +125,15 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
124
125
|
label: e("connect.navigation.review"),
|
|
125
126
|
value: f["$connect-REVIEW"]
|
|
126
127
|
},
|
|
128
|
+
{
|
|
129
|
+
label: e("connect.navigation.goals"),
|
|
130
|
+
value: f["$connect-GOALS"],
|
|
131
|
+
badge: () => i.goalsRemaining > 0 ? H(B.FmBadge, {
|
|
132
|
+
variant: "numeric",
|
|
133
|
+
inline: !0,
|
|
134
|
+
value: i.goalsRemaining
|
|
135
|
+
}) : H(cn)
|
|
136
|
+
},
|
|
127
137
|
{
|
|
128
138
|
label: e("connect.navigation.setting"),
|
|
129
139
|
value: f["$connect-SETTING"]
|
|
@@ -132,154 +142,163 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
132
142
|
label: e("connect.navigation.bin"),
|
|
133
143
|
value: f["$connect-BIN"]
|
|
134
144
|
}
|
|
135
|
-
],
|
|
136
|
-
const
|
|
137
|
-
return console.log(`[MF] Timezone set to: ${Xe[
|
|
145
|
+
], o = yt(), c = wt(), a = s.reduce((h, y) => [...(y.children ?? []).map((_) => _.value), ...h, y.value], []), l = ge(), d = ne(() => {
|
|
146
|
+
const h = l.currentCountry.value || "MY";
|
|
147
|
+
return console.log(`[MF] Timezone set to: ${Xe[h]}`), Xe[h];
|
|
138
148
|
});
|
|
139
|
-
|
|
149
|
+
pe(
|
|
140
150
|
// Watch `route.matched`, not `route`: `useRoute()` returns a reactive object
|
|
141
151
|
// whose identity never changes, so watching it directly fired once via
|
|
142
152
|
// `immediate` and the highlight then stayed on whatever page loaded first.
|
|
143
|
-
() =>
|
|
144
|
-
(
|
|
145
|
-
const
|
|
146
|
-
|
|
153
|
+
() => c.matched,
|
|
154
|
+
(h) => {
|
|
155
|
+
const _ = h.map((p) => p.name).reverse().find((p) => a.includes(p));
|
|
156
|
+
_ && (r.value = _);
|
|
157
|
+
},
|
|
158
|
+
{ immediate: !0 }
|
|
159
|
+
), pe(
|
|
160
|
+
[() => {
|
|
161
|
+
var h;
|
|
162
|
+
return (h = l.currentBusiness.value) == null ? void 0 : h._id;
|
|
163
|
+
}, () => c.name, t],
|
|
164
|
+
([h]) => {
|
|
165
|
+
h && i.read(t.value, h);
|
|
147
166
|
},
|
|
148
167
|
{ immediate: !0 }
|
|
149
168
|
);
|
|
150
|
-
async function
|
|
151
|
-
await
|
|
169
|
+
async function m(h) {
|
|
170
|
+
await o.push({ name: h });
|
|
152
171
|
}
|
|
153
|
-
return (
|
|
154
|
-
var
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
S(
|
|
172
|
+
return (h, y) => {
|
|
173
|
+
var p;
|
|
174
|
+
const _ = Z("FmCollapsibleTabs");
|
|
175
|
+
return j(), me("div", xn, [
|
|
176
|
+
S(_, {
|
|
158
177
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
159
|
-
"model-value": (
|
|
160
|
-
items:
|
|
161
|
-
"onUpdate:modelValue":
|
|
178
|
+
"model-value": (p = g(r)) == null ? void 0 : p.toString(),
|
|
179
|
+
items: s,
|
|
180
|
+
"onUpdate:modelValue": m
|
|
162
181
|
}, null, 8, ["model-value"]),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
182
|
+
v("div", Fn, [
|
|
183
|
+
v("div", null, "Timezone: " + R(g(d).split("/")[1].replace("_", " ")), 1),
|
|
184
|
+
v("div", null, "(UTC" + R(g(vn).tz(g(d)).format("Z")) + ")", 1)
|
|
166
185
|
])
|
|
167
186
|
]);
|
|
168
187
|
};
|
|
169
188
|
}
|
|
170
189
|
}), St = "feedme_connect_marketing_promo_hidden";
|
|
171
|
-
function
|
|
190
|
+
function $n() {
|
|
172
191
|
try {
|
|
173
192
|
return localStorage.getItem(St) !== null;
|
|
174
193
|
} catch {
|
|
175
194
|
return !1;
|
|
176
195
|
}
|
|
177
196
|
}
|
|
178
|
-
function
|
|
197
|
+
function Hn() {
|
|
179
198
|
try {
|
|
180
199
|
localStorage.setItem(St, (/* @__PURE__ */ new Date()).toISOString());
|
|
181
200
|
} catch {
|
|
182
201
|
}
|
|
183
202
|
}
|
|
184
|
-
const
|
|
203
|
+
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" }, Gn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Bn = { 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({
|
|
185
204
|
__name: "AiMarketingPromoDialog",
|
|
186
205
|
setup(n) {
|
|
187
206
|
let e = !1;
|
|
188
|
-
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } =
|
|
207
|
+
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } = ge(), o = ee(!1), c = [
|
|
189
208
|
{ key: "completeContent", icon: "layers" },
|
|
190
209
|
{ key: "realContext", icon: "storefront" },
|
|
191
210
|
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
192
211
|
], a = ne(() => {
|
|
193
|
-
var
|
|
194
|
-
const
|
|
195
|
-
return
|
|
212
|
+
var _;
|
|
213
|
+
const y = ((_ = r.value) == null ? void 0 : _.permissions) ?? [];
|
|
214
|
+
return yn(
|
|
196
215
|
[
|
|
197
216
|
{
|
|
198
217
|
action: Qe.Action.manage,
|
|
199
218
|
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
200
219
|
}
|
|
201
220
|
],
|
|
202
|
-
|
|
221
|
+
y
|
|
203
222
|
).granted;
|
|
204
223
|
}), l = ne(
|
|
205
224
|
() => s.value === "MY" && a.value
|
|
206
225
|
);
|
|
207
226
|
let d = !1;
|
|
208
|
-
|
|
227
|
+
pe(
|
|
209
228
|
l,
|
|
210
|
-
(
|
|
211
|
-
d || !
|
|
229
|
+
(y) => {
|
|
230
|
+
d || !y || (d = !0, !($n() || e) && (e = !0, o.value = !0));
|
|
212
231
|
},
|
|
213
232
|
{ immediate: !0 }
|
|
214
233
|
);
|
|
215
|
-
async function
|
|
234
|
+
async function m() {
|
|
216
235
|
o.value = !1, await i.push({ name: f["$connect-MARKETING"] });
|
|
217
236
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
237
|
+
function h() {
|
|
238
|
+
Hn(), o.value = !1;
|
|
220
239
|
}
|
|
221
|
-
return (
|
|
222
|
-
const
|
|
223
|
-
return
|
|
240
|
+
return (y, _) => {
|
|
241
|
+
const p = Z("FmIcon"), I = Z("FmCard"), T = Z("FmButton"), M = Z("FmDialog");
|
|
242
|
+
return j(), Oe(M, {
|
|
224
243
|
modelValue: o.value,
|
|
225
|
-
"onUpdate:modelValue":
|
|
244
|
+
"onUpdate:modelValue": _[0] || (_[0] = (k) => o.value = k),
|
|
226
245
|
"min-width": "min(500px, calc(100% - 48px))",
|
|
227
246
|
"max-width": "min(860px, calc(100% - 48px))",
|
|
228
247
|
"max-height": "90vh",
|
|
229
248
|
"dismiss-away": ""
|
|
230
249
|
}, {
|
|
231
|
-
"dialog-header":
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
S(
|
|
250
|
+
"dialog-header": Q(() => [
|
|
251
|
+
v("div", jn, [
|
|
252
|
+
v("div", Wn, [
|
|
253
|
+
S(p, {
|
|
235
254
|
name: "auto_awesome",
|
|
236
255
|
size: "sm",
|
|
237
256
|
color: "primary"
|
|
238
257
|
}),
|
|
239
|
-
|
|
258
|
+
v("span", Gn, R(g(t)("connect.marketing.whatsNew.badge")), 1)
|
|
240
259
|
]),
|
|
241
|
-
|
|
242
|
-
|
|
260
|
+
v("h1", Bn, R(g(t)("connect.marketing.whatsNew.title")), 1),
|
|
261
|
+
v("p", zn, R(g(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
243
262
|
])
|
|
244
263
|
]),
|
|
245
|
-
"dialog-footer":
|
|
246
|
-
|
|
247
|
-
|
|
264
|
+
"dialog-footer": Q(() => [
|
|
265
|
+
v("div", ei, [
|
|
266
|
+
v("div", ti, [
|
|
248
267
|
S(T, {
|
|
249
268
|
variant: "primary",
|
|
250
269
|
size: "lg",
|
|
251
|
-
label:
|
|
270
|
+
label: g(t)("connect.marketing.whatsNew.cta"),
|
|
252
271
|
"append-icon": "arrow_forward",
|
|
253
|
-
onClick:
|
|
272
|
+
onClick: m
|
|
254
273
|
}, null, 8, ["label"]),
|
|
255
274
|
S(T, {
|
|
256
275
|
variant: "tertiary",
|
|
257
276
|
size: "lg",
|
|
258
|
-
label:
|
|
259
|
-
onClick:
|
|
277
|
+
label: g(t)("connect.marketing.whatsNew.dismiss"),
|
|
278
|
+
onClick: h
|
|
260
279
|
}, null, 8, ["label"])
|
|
261
280
|
]),
|
|
262
|
-
|
|
281
|
+
v("div", ni, R(g(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
263
282
|
])
|
|
264
283
|
]),
|
|
265
|
-
default:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
(
|
|
284
|
+
default: Q(() => [
|
|
285
|
+
v("div", qn, [
|
|
286
|
+
v("div", Kn, [
|
|
287
|
+
(j(), me(It, null, ln(c, (k) => S(I, {
|
|
269
288
|
key: k.key,
|
|
270
289
|
variant: "outlined",
|
|
271
290
|
class: "!h-full flex flex-col gap-8 p-16"
|
|
272
291
|
}, {
|
|
273
|
-
default:
|
|
274
|
-
|
|
275
|
-
S(
|
|
292
|
+
default: Q(() => [
|
|
293
|
+
v("div", Jn, [
|
|
294
|
+
S(p, {
|
|
276
295
|
name: k.icon,
|
|
277
296
|
size: "md",
|
|
278
297
|
color: "primary"
|
|
279
298
|
}, null, 8, ["name"])
|
|
280
299
|
]),
|
|
281
|
-
|
|
282
|
-
|
|
300
|
+
v("div", Yn, R(g(t)(`connect.marketing.whatsNew.benefits.${k.key}.title`)), 1),
|
|
301
|
+
v("div", Xn, R(g(t)(
|
|
283
302
|
`connect.marketing.whatsNew.benefits.${k.key}.description`
|
|
284
303
|
)), 1)
|
|
285
304
|
]),
|
|
@@ -290,15 +309,15 @@ const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xx
|
|
|
290
309
|
variant: "outlined",
|
|
291
310
|
class: "flex items-start gap-12 p-16"
|
|
292
311
|
}, {
|
|
293
|
-
default:
|
|
294
|
-
|
|
295
|
-
S(
|
|
312
|
+
default: Q(() => [
|
|
313
|
+
v("div", Qn, [
|
|
314
|
+
S(p, {
|
|
296
315
|
name: "lightbulb",
|
|
297
316
|
size: "md",
|
|
298
317
|
color: "primary"
|
|
299
318
|
})
|
|
300
319
|
]),
|
|
301
|
-
|
|
320
|
+
v("p", Zn, R(g(t)("connect.marketing.whatsNew.callout")), 1)
|
|
302
321
|
]),
|
|
303
322
|
_: 1
|
|
304
323
|
})
|
|
@@ -309,7 +328,7 @@ const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xx
|
|
|
309
328
|
};
|
|
310
329
|
}
|
|
311
330
|
});
|
|
312
|
-
var
|
|
331
|
+
var ri = "firebase", si = "10.12.4";
|
|
313
332
|
/**
|
|
314
333
|
* @license
|
|
315
334
|
* Copyright 2020 Google LLC
|
|
@@ -326,13 +345,13 @@ var ni = "firebase", ii = "10.12.4";
|
|
|
326
345
|
* See the License for the specific language governing permissions and
|
|
327
346
|
* limitations under the License.
|
|
328
347
|
*/
|
|
329
|
-
|
|
348
|
+
Le(ri, si, "app");
|
|
330
349
|
function Rt() {
|
|
331
350
|
return {
|
|
332
351
|
"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."
|
|
333
352
|
};
|
|
334
353
|
}
|
|
335
|
-
const
|
|
354
|
+
const oi = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
336
355
|
/**
|
|
337
356
|
* @license
|
|
338
357
|
* Copyright 2020 Google LLC
|
|
@@ -349,12 +368,12 @@ const ri = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
|
349
368
|
* See the License for the specific language governing permissions and
|
|
350
369
|
* limitations under the License.
|
|
351
370
|
*/
|
|
352
|
-
const
|
|
353
|
-
function
|
|
354
|
-
|
|
371
|
+
const _e = new Tn("@firebase/auth");
|
|
372
|
+
function ai(n, ...e) {
|
|
373
|
+
_e.logLevel <= Et.WARN && _e.warn(`Auth (${re}): ${n}`, ...e);
|
|
355
374
|
}
|
|
356
375
|
function ue(n, ...e) {
|
|
357
|
-
|
|
376
|
+
_e.logLevel <= Et.ERROR && _e.error(`Auth (${re}): ${n}`, ...e);
|
|
358
377
|
}
|
|
359
378
|
/**
|
|
360
379
|
* @license
|
|
@@ -375,11 +394,11 @@ function ue(n, ...e) {
|
|
|
375
394
|
function O(n, ...e) {
|
|
376
395
|
throw He(n, ...e);
|
|
377
396
|
}
|
|
378
|
-
function
|
|
397
|
+
function b(n, ...e) {
|
|
379
398
|
return He(n, ...e);
|
|
380
399
|
}
|
|
381
400
|
function Pt(n, e, t) {
|
|
382
|
-
const i = Object.assign(Object.assign({},
|
|
401
|
+
const i = Object.assign(Object.assign({}, oi()), { [e]: t });
|
|
383
402
|
return new Fe("auth", "Firebase", i).create(e, {
|
|
384
403
|
appName: n.name
|
|
385
404
|
});
|
|
@@ -421,11 +440,11 @@ function L(n, e) {
|
|
|
421
440
|
* See the License for the specific language governing permissions and
|
|
422
441
|
* limitations under the License.
|
|
423
442
|
*/
|
|
424
|
-
function
|
|
443
|
+
function Me() {
|
|
425
444
|
var n;
|
|
426
445
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
427
446
|
}
|
|
428
|
-
function
|
|
447
|
+
function ci() {
|
|
429
448
|
return nt() === "http:" || nt() === "https:";
|
|
430
449
|
}
|
|
431
450
|
function nt() {
|
|
@@ -448,15 +467,15 @@ function nt() {
|
|
|
448
467
|
* See the License for the specific language governing permissions and
|
|
449
468
|
* limitations under the License.
|
|
450
469
|
*/
|
|
451
|
-
function
|
|
470
|
+
function li() {
|
|
452
471
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
453
472
|
// This is especially true for Cordova apps which have unreliable
|
|
454
473
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
455
474
|
// installed which overwrites the native navigator.onLine value and
|
|
456
475
|
// defines navigator.connection.
|
|
457
|
-
(
|
|
476
|
+
(ci() || En() || "connection" in navigator) ? navigator.onLine : !0;
|
|
458
477
|
}
|
|
459
|
-
function
|
|
478
|
+
function ui() {
|
|
460
479
|
if (typeof navigator > "u")
|
|
461
480
|
return null;
|
|
462
481
|
const n = navigator;
|
|
@@ -486,10 +505,10 @@ function ci() {
|
|
|
486
505
|
*/
|
|
487
506
|
class oe {
|
|
488
507
|
constructor(e, t) {
|
|
489
|
-
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
|
508
|
+
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile = kn() || bn();
|
|
490
509
|
}
|
|
491
510
|
get() {
|
|
492
|
-
return
|
|
511
|
+
return li() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
493
512
|
}
|
|
494
513
|
}
|
|
495
514
|
/**
|
|
@@ -583,7 +602,7 @@ class Ct {
|
|
|
583
602
|
* See the License for the specific language governing permissions and
|
|
584
603
|
* limitations under the License.
|
|
585
604
|
*/
|
|
586
|
-
const
|
|
605
|
+
const di = {
|
|
587
606
|
// Custom token errors.
|
|
588
607
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
589
608
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -674,11 +693,11 @@ const li = {
|
|
|
674
693
|
* See the License for the specific language governing permissions and
|
|
675
694
|
* limitations under the License.
|
|
676
695
|
*/
|
|
677
|
-
const
|
|
678
|
-
function
|
|
696
|
+
const hi = new oe(3e4, 6e4);
|
|
697
|
+
function Te(n, e) {
|
|
679
698
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
680
699
|
}
|
|
681
|
-
async function
|
|
700
|
+
async function X(n, e, t, i, r = {}) {
|
|
682
701
|
return Nt(n, r, async () => {
|
|
683
702
|
let s = {}, o = {};
|
|
684
703
|
i && (e === "GET" ? o = i : s = {
|
|
@@ -700,9 +719,9 @@ async function J(n, e, t, i, r = {}) {
|
|
|
700
719
|
}
|
|
701
720
|
async function Nt(n, e, t) {
|
|
702
721
|
n._canInitEmulator = !1;
|
|
703
|
-
const i = Object.assign(Object.assign({},
|
|
722
|
+
const i = Object.assign(Object.assign({}, di), e);
|
|
704
723
|
try {
|
|
705
|
-
const r = new
|
|
724
|
+
const r = new fi(n), s = await Promise.race([
|
|
706
725
|
t(),
|
|
707
726
|
r.promise
|
|
708
727
|
]);
|
|
@@ -732,7 +751,7 @@ async function Nt(n, e, t) {
|
|
|
732
751
|
}
|
|
733
752
|
}
|
|
734
753
|
async function Ot(n, e, t, i, r = {}) {
|
|
735
|
-
const s = await
|
|
754
|
+
const s = await X(n, e, t, i, r);
|
|
736
755
|
return "mfaPendingCredential" in s && O(n, "multi-factor-auth-required", {
|
|
737
756
|
_serverResponse: s
|
|
738
757
|
}), s;
|
|
@@ -741,14 +760,14 @@ function Lt(n, e, t, i) {
|
|
|
741
760
|
const r = `${e}${t}?${i}`;
|
|
742
761
|
return n.config.emulator ? je(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
743
762
|
}
|
|
744
|
-
class
|
|
763
|
+
class fi {
|
|
745
764
|
constructor(e) {
|
|
746
765
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
747
|
-
this.timer = setTimeout(() => i(
|
|
766
|
+
this.timer = setTimeout(() => i(b(
|
|
748
767
|
this.auth,
|
|
749
768
|
"network-request-failed"
|
|
750
769
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
751
|
-
)),
|
|
770
|
+
)), hi.get());
|
|
752
771
|
});
|
|
753
772
|
}
|
|
754
773
|
clearNetworkTimeout() {
|
|
@@ -760,7 +779,7 @@ function le(n, e, t) {
|
|
|
760
779
|
appName: n.name
|
|
761
780
|
};
|
|
762
781
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
763
|
-
const r =
|
|
782
|
+
const r = b(n, e, i);
|
|
764
783
|
return r.customData._tokenResponse = t, r;
|
|
765
784
|
}
|
|
766
785
|
/**
|
|
@@ -779,11 +798,11 @@ function le(n, e, t) {
|
|
|
779
798
|
* See the License for the specific language governing permissions and
|
|
780
799
|
* limitations under the License.
|
|
781
800
|
*/
|
|
782
|
-
async function
|
|
783
|
-
return
|
|
801
|
+
async function pi(n, e) {
|
|
802
|
+
return X(n, "POST", "/v1/accounts:delete", e);
|
|
784
803
|
}
|
|
785
804
|
async function Mt(n, e) {
|
|
786
|
-
return
|
|
805
|
+
return X(n, "POST", "/v1/accounts:lookup", e);
|
|
787
806
|
}
|
|
788
807
|
/**
|
|
789
808
|
* @license
|
|
@@ -810,8 +829,8 @@ function te(n) {
|
|
|
810
829
|
} catch {
|
|
811
830
|
}
|
|
812
831
|
}
|
|
813
|
-
async function
|
|
814
|
-
const t =
|
|
832
|
+
async function mi(n, e = !1) {
|
|
833
|
+
const t = Y(n), i = await t.getIdToken(e), r = We(i);
|
|
815
834
|
u(
|
|
816
835
|
r && r.exp && r.auth_time && r.iat,
|
|
817
836
|
t.auth,
|
|
@@ -822,14 +841,14 @@ async function fi(n, e = !1) {
|
|
|
822
841
|
return {
|
|
823
842
|
claims: r,
|
|
824
843
|
token: i,
|
|
825
|
-
authTime: te(
|
|
826
|
-
issuedAtTime: te(
|
|
827
|
-
expirationTime: te(
|
|
844
|
+
authTime: te(Ce(r.auth_time)),
|
|
845
|
+
issuedAtTime: te(Ce(r.iat)),
|
|
846
|
+
expirationTime: te(Ce(r.exp)),
|
|
828
847
|
signInProvider: o || null,
|
|
829
848
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
830
849
|
};
|
|
831
850
|
}
|
|
832
|
-
function
|
|
851
|
+
function Ce(n) {
|
|
833
852
|
return Number(n) * 1e3;
|
|
834
853
|
}
|
|
835
854
|
function We(n) {
|
|
@@ -837,7 +856,7 @@ function We(n) {
|
|
|
837
856
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
838
857
|
return ue("JWT malformed, contained fewer than 3 sections"), null;
|
|
839
858
|
try {
|
|
840
|
-
const r =
|
|
859
|
+
const r = Cn(t);
|
|
841
860
|
return r ? JSON.parse(r) : (ue("Failed to decode base64 JWT payload"), null);
|
|
842
861
|
} catch (r) {
|
|
843
862
|
return ue("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
@@ -881,10 +900,10 @@ async function ie(n, e, t = !1) {
|
|
|
881
900
|
try {
|
|
882
901
|
return await e;
|
|
883
902
|
} catch (i) {
|
|
884
|
-
throw i instanceof Ve &&
|
|
903
|
+
throw i instanceof Ve && gi(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
885
904
|
}
|
|
886
905
|
}
|
|
887
|
-
function
|
|
906
|
+
function gi({ code: n }) {
|
|
888
907
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
889
908
|
}
|
|
890
909
|
/**
|
|
@@ -903,7 +922,7 @@ function pi({ code: n }) {
|
|
|
903
922
|
* See the License for the specific language governing permissions and
|
|
904
923
|
* limitations under the License.
|
|
905
924
|
*/
|
|
906
|
-
class
|
|
925
|
+
class _i {
|
|
907
926
|
constructor(e) {
|
|
908
927
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
909
928
|
}
|
|
@@ -965,7 +984,7 @@ class mi {
|
|
|
965
984
|
* See the License for the specific language governing permissions and
|
|
966
985
|
* limitations under the License.
|
|
967
986
|
*/
|
|
968
|
-
class
|
|
987
|
+
class Ue {
|
|
969
988
|
constructor(e, t) {
|
|
970
989
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
971
990
|
}
|
|
@@ -998,7 +1017,7 @@ class Me {
|
|
|
998
1017
|
* See the License for the specific language governing permissions and
|
|
999
1018
|
* limitations under the License.
|
|
1000
1019
|
*/
|
|
1001
|
-
async function
|
|
1020
|
+
async function ve(n) {
|
|
1002
1021
|
var e;
|
|
1003
1022
|
const t = n.auth, i = await n.getIdToken(), r = await ie(n, Mt(t, { idToken: i }));
|
|
1004
1023
|
u(
|
|
@@ -1009,7 +1028,7 @@ async function _e(n) {
|
|
|
1009
1028
|
);
|
|
1010
1029
|
const s = r.users[0];
|
|
1011
1030
|
n._notifyReloadListener(s);
|
|
1012
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c =
|
|
1031
|
+
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, m = {
|
|
1013
1032
|
uid: s.localId,
|
|
1014
1033
|
displayName: s.displayName || null,
|
|
1015
1034
|
photoURL: s.photoUrl || null,
|
|
@@ -1018,16 +1037,16 @@ async function _e(n) {
|
|
|
1018
1037
|
phoneNumber: s.phoneNumber || null,
|
|
1019
1038
|
tenantId: s.tenantId || null,
|
|
1020
1039
|
providerData: c,
|
|
1021
|
-
metadata: new
|
|
1040
|
+
metadata: new Ue(s.createdAt, s.lastLoginAt),
|
|
1022
1041
|
isAnonymous: d
|
|
1023
1042
|
};
|
|
1024
|
-
Object.assign(n,
|
|
1043
|
+
Object.assign(n, m);
|
|
1025
1044
|
}
|
|
1026
|
-
async function
|
|
1027
|
-
const e =
|
|
1028
|
-
await
|
|
1045
|
+
async function vi(n) {
|
|
1046
|
+
const e = Y(n);
|
|
1047
|
+
await ve(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
1029
1048
|
}
|
|
1030
|
-
function
|
|
1049
|
+
function Ii(n, e) {
|
|
1031
1050
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
1032
1051
|
}
|
|
1033
1052
|
function Ut(n) {
|
|
@@ -1059,7 +1078,7 @@ function Ut(n) {
|
|
|
1059
1078
|
* See the License for the specific language governing permissions and
|
|
1060
1079
|
* limitations under the License.
|
|
1061
1080
|
*/
|
|
1062
|
-
async function
|
|
1081
|
+
async function yi(n, e) {
|
|
1063
1082
|
const t = await Nt(n, {}, async () => {
|
|
1064
1083
|
const i = se({
|
|
1065
1084
|
grant_type: "refresh_token",
|
|
@@ -1080,8 +1099,8 @@ async function vi(n, e) {
|
|
|
1080
1099
|
refreshToken: t.refresh_token
|
|
1081
1100
|
};
|
|
1082
1101
|
}
|
|
1083
|
-
async function
|
|
1084
|
-
return
|
|
1102
|
+
async function wi(n, e) {
|
|
1103
|
+
return X(n, "POST", "/v2/accounts:revokeToken", Te(n, e));
|
|
1085
1104
|
}
|
|
1086
1105
|
/**
|
|
1087
1106
|
* @license
|
|
@@ -1099,7 +1118,7 @@ async function Ii(n, e) {
|
|
|
1099
1118
|
* See the License for the specific language governing permissions and
|
|
1100
1119
|
* limitations under the License.
|
|
1101
1120
|
*/
|
|
1102
|
-
class
|
|
1121
|
+
class q {
|
|
1103
1122
|
constructor() {
|
|
1104
1123
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
1105
1124
|
}
|
|
@@ -1144,14 +1163,14 @@ class B {
|
|
|
1144
1163
|
this.refreshToken = null;
|
|
1145
1164
|
}
|
|
1146
1165
|
async refresh(e, t) {
|
|
1147
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1166
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await yi(e, t);
|
|
1148
1167
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1149
1168
|
}
|
|
1150
1169
|
updateTokensAndExpiration(e, t, i) {
|
|
1151
1170
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1152
1171
|
}
|
|
1153
1172
|
static fromJSON(e, t) {
|
|
1154
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1173
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new q();
|
|
1155
1174
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1156
1175
|
appName: e
|
|
1157
1176
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1171,7 +1190,7 @@ class B {
|
|
|
1171
1190
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1172
1191
|
}
|
|
1173
1192
|
_clone() {
|
|
1174
|
-
return Object.assign(new
|
|
1193
|
+
return Object.assign(new q(), this.toJSON());
|
|
1175
1194
|
}
|
|
1176
1195
|
_performRefresh() {
|
|
1177
1196
|
return P("not implemented");
|
|
@@ -1199,7 +1218,7 @@ function U(n, e) {
|
|
|
1199
1218
|
class C {
|
|
1200
1219
|
constructor(e) {
|
|
1201
1220
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1202
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1221
|
+
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);
|
|
1203
1222
|
}
|
|
1204
1223
|
async getIdToken(e) {
|
|
1205
1224
|
const t = await ie(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -1211,10 +1230,10 @@ class C {
|
|
|
1211
1230
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1212
1231
|
}
|
|
1213
1232
|
getIdTokenResult(e) {
|
|
1214
|
-
return
|
|
1233
|
+
return mi(this, e);
|
|
1215
1234
|
}
|
|
1216
1235
|
reload() {
|
|
1217
|
-
return
|
|
1236
|
+
return vi(this);
|
|
1218
1237
|
}
|
|
1219
1238
|
_assign(e) {
|
|
1220
1239
|
this !== e && (u(
|
|
@@ -1247,13 +1266,13 @@ class C {
|
|
|
1247
1266
|
}
|
|
1248
1267
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1249
1268
|
let i = !1;
|
|
1250
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1269
|
+
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);
|
|
1251
1270
|
}
|
|
1252
1271
|
async delete() {
|
|
1253
1272
|
if (A(this.auth.app))
|
|
1254
1273
|
return Promise.reject($(this.auth));
|
|
1255
1274
|
const e = await this.getIdToken();
|
|
1256
|
-
return await ie(this,
|
|
1275
|
+
return await ie(this, pi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1257
1276
|
}
|
|
1258
1277
|
toJSON() {
|
|
1259
1278
|
return Object.assign(Object.assign({
|
|
@@ -1281,20 +1300,20 @@ class C {
|
|
|
1281
1300
|
}
|
|
1282
1301
|
static _fromJSON(e, t) {
|
|
1283
1302
|
var i, r, s, o, c, a, l, d;
|
|
1284
|
-
const
|
|
1303
|
+
const m = (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, p = (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;
|
|
1285
1304
|
u(
|
|
1286
1305
|
k && Ye,
|
|
1287
1306
|
e,
|
|
1288
1307
|
"internal-error"
|
|
1289
1308
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1290
1309
|
);
|
|
1291
|
-
const on =
|
|
1310
|
+
const on = q.fromJSON(this.name, Ye);
|
|
1292
1311
|
u(
|
|
1293
1312
|
typeof k == "string",
|
|
1294
1313
|
e,
|
|
1295
1314
|
"internal-error"
|
|
1296
1315
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1297
|
-
), U(
|
|
1316
|
+
), U(m, e.name), U(h, e.name), u(
|
|
1298
1317
|
typeof Ke == "boolean",
|
|
1299
1318
|
e,
|
|
1300
1319
|
"internal-error"
|
|
@@ -1304,22 +1323,22 @@ class C {
|
|
|
1304
1323
|
e,
|
|
1305
1324
|
"internal-error"
|
|
1306
1325
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1307
|
-
), U(
|
|
1308
|
-
const
|
|
1326
|
+
), U(y, e.name), U(_, e.name), U(p, e.name), U(I, e.name), U(T, e.name), U(M, e.name);
|
|
1327
|
+
const Ae = new C({
|
|
1309
1328
|
uid: k,
|
|
1310
1329
|
auth: e,
|
|
1311
|
-
email:
|
|
1330
|
+
email: h,
|
|
1312
1331
|
emailVerified: Ke,
|
|
1313
|
-
displayName:
|
|
1332
|
+
displayName: m,
|
|
1314
1333
|
isAnonymous: Je,
|
|
1315
|
-
photoURL:
|
|
1316
|
-
phoneNumber:
|
|
1317
|
-
tenantId:
|
|
1334
|
+
photoURL: _,
|
|
1335
|
+
phoneNumber: y,
|
|
1336
|
+
tenantId: p,
|
|
1318
1337
|
stsTokenManager: on,
|
|
1319
1338
|
createdAt: T,
|
|
1320
1339
|
lastLoginAt: M
|
|
1321
1340
|
});
|
|
1322
|
-
return
|
|
1341
|
+
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((an) => Object.assign({}, an))), I && (Ae._redirectEventId = I), Ae;
|
|
1323
1342
|
}
|
|
1324
1343
|
/**
|
|
1325
1344
|
* Initialize a User from an idToken server response
|
|
@@ -1327,7 +1346,7 @@ class C {
|
|
|
1327
1346
|
* @param idTokenResponse
|
|
1328
1347
|
*/
|
|
1329
1348
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1330
|
-
const r = new
|
|
1349
|
+
const r = new q();
|
|
1331
1350
|
r.updateFromServerResponse(t);
|
|
1332
1351
|
const s = new C({
|
|
1333
1352
|
uid: t.localId,
|
|
@@ -1335,7 +1354,7 @@ class C {
|
|
|
1335
1354
|
stsTokenManager: r,
|
|
1336
1355
|
isAnonymous: i
|
|
1337
1356
|
});
|
|
1338
|
-
return await
|
|
1357
|
+
return await ve(s), s;
|
|
1339
1358
|
}
|
|
1340
1359
|
/**
|
|
1341
1360
|
* Initialize a User from an idToken server response
|
|
@@ -1349,7 +1368,7 @@ class C {
|
|
|
1349
1368
|
"internal-error"
|
|
1350
1369
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1351
1370
|
);
|
|
1352
|
-
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new
|
|
1371
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new q();
|
|
1353
1372
|
c.updateFromIdToken(i);
|
|
1354
1373
|
const a = new C({
|
|
1355
1374
|
uid: r.localId,
|
|
@@ -1365,7 +1384,7 @@ class C {
|
|
|
1365
1384
|
phoneNumber: r.phoneNumber || null,
|
|
1366
1385
|
tenantId: r.tenantId || null,
|
|
1367
1386
|
providerData: s,
|
|
1368
|
-
metadata: new
|
|
1387
|
+
metadata: new Ue(r.createdAt, r.lastLoginAt),
|
|
1369
1388
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1370
1389
|
};
|
|
1371
1390
|
return Object.assign(a, l), a;
|
|
@@ -1452,7 +1471,7 @@ const st = Dt;
|
|
|
1452
1471
|
function de(n, e, t) {
|
|
1453
1472
|
return `firebase:${n}:${e}:${t}`;
|
|
1454
1473
|
}
|
|
1455
|
-
class
|
|
1474
|
+
class K {
|
|
1456
1475
|
constructor(e, t, i) {
|
|
1457
1476
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1458
1477
|
const { config: r, name: s } = this.auth;
|
|
@@ -1483,7 +1502,7 @@ class z {
|
|
|
1483
1502
|
}
|
|
1484
1503
|
static async create(e, t, i = "authUser") {
|
|
1485
1504
|
if (!t.length)
|
|
1486
|
-
return new
|
|
1505
|
+
return new K(N(st), e, i);
|
|
1487
1506
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1488
1507
|
if (await l._isAvailable())
|
|
1489
1508
|
return l;
|
|
@@ -1495,20 +1514,20 @@ class z {
|
|
|
1495
1514
|
try {
|
|
1496
1515
|
const d = await l._get(o);
|
|
1497
1516
|
if (d) {
|
|
1498
|
-
const
|
|
1499
|
-
l !== s && (c =
|
|
1517
|
+
const m = C._fromJSON(e, d);
|
|
1518
|
+
l !== s && (c = m), s = l;
|
|
1500
1519
|
break;
|
|
1501
1520
|
}
|
|
1502
1521
|
} catch {
|
|
1503
1522
|
}
|
|
1504
1523
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1505
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1524
|
+
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) => {
|
|
1506
1525
|
if (l !== s)
|
|
1507
1526
|
try {
|
|
1508
1527
|
await l._remove(o);
|
|
1509
1528
|
} catch {
|
|
1510
1529
|
}
|
|
1511
|
-
})), new
|
|
1530
|
+
})), new K(s, e, i));
|
|
1512
1531
|
}
|
|
1513
1532
|
}
|
|
1514
1533
|
/**
|
|
@@ -1558,42 +1577,42 @@ function ot(n) {
|
|
|
1558
1577
|
}
|
|
1559
1578
|
return "Other";
|
|
1560
1579
|
}
|
|
1561
|
-
function xt(n =
|
|
1580
|
+
function xt(n = w()) {
|
|
1562
1581
|
return /firefox\//i.test(n);
|
|
1563
1582
|
}
|
|
1564
|
-
function Ge(n =
|
|
1583
|
+
function Ge(n = w()) {
|
|
1565
1584
|
const e = n.toLowerCase();
|
|
1566
1585
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1567
1586
|
}
|
|
1568
|
-
function Ft(n =
|
|
1587
|
+
function Ft(n = w()) {
|
|
1569
1588
|
return /crios\//i.test(n);
|
|
1570
1589
|
}
|
|
1571
|
-
function Vt(n =
|
|
1590
|
+
function Vt(n = w()) {
|
|
1572
1591
|
return /iemobile/i.test(n);
|
|
1573
1592
|
}
|
|
1574
|
-
function $t(n =
|
|
1593
|
+
function $t(n = w()) {
|
|
1575
1594
|
return /android/i.test(n);
|
|
1576
1595
|
}
|
|
1577
|
-
function Ht(n =
|
|
1596
|
+
function Ht(n = w()) {
|
|
1578
1597
|
return /blackberry/i.test(n);
|
|
1579
1598
|
}
|
|
1580
|
-
function jt(n =
|
|
1599
|
+
function jt(n = w()) {
|
|
1581
1600
|
return /webos/i.test(n);
|
|
1582
1601
|
}
|
|
1583
|
-
function
|
|
1602
|
+
function ke(n = w()) {
|
|
1584
1603
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1585
1604
|
}
|
|
1586
|
-
function
|
|
1605
|
+
function Ti(n = w()) {
|
|
1587
1606
|
var e;
|
|
1588
|
-
return
|
|
1607
|
+
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1589
1608
|
}
|
|
1590
|
-
function
|
|
1591
|
-
return
|
|
1609
|
+
function ki() {
|
|
1610
|
+
return Nn() && document.documentMode === 10;
|
|
1592
1611
|
}
|
|
1593
|
-
function Wt(n =
|
|
1594
|
-
return
|
|
1612
|
+
function Wt(n = w()) {
|
|
1613
|
+
return ke(n) || $t(n) || jt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1595
1614
|
}
|
|
1596
|
-
function
|
|
1615
|
+
function bi() {
|
|
1597
1616
|
try {
|
|
1598
1617
|
return !!(window && window !== window.top);
|
|
1599
1618
|
} catch {
|
|
@@ -1620,10 +1639,10 @@ function Gt(n, e = []) {
|
|
|
1620
1639
|
let t;
|
|
1621
1640
|
switch (n) {
|
|
1622
1641
|
case "Browser":
|
|
1623
|
-
t = ot(
|
|
1642
|
+
t = ot(w());
|
|
1624
1643
|
break;
|
|
1625
1644
|
case "Worker":
|
|
1626
|
-
t = `${ot(
|
|
1645
|
+
t = `${ot(w())}-${n}`;
|
|
1627
1646
|
break;
|
|
1628
1647
|
default:
|
|
1629
1648
|
t = n;
|
|
@@ -1647,7 +1666,7 @@ function Gt(n, e = []) {
|
|
|
1647
1666
|
* See the License for the specific language governing permissions and
|
|
1648
1667
|
* limitations under the License.
|
|
1649
1668
|
*/
|
|
1650
|
-
class
|
|
1669
|
+
class Ei {
|
|
1651
1670
|
constructor(e) {
|
|
1652
1671
|
this.auth = e, this.queue = [];
|
|
1653
1672
|
}
|
|
@@ -1702,8 +1721,8 @@ class ki {
|
|
|
1702
1721
|
* See the License for the specific language governing permissions and
|
|
1703
1722
|
* limitations under the License.
|
|
1704
1723
|
*/
|
|
1705
|
-
async function
|
|
1706
|
-
return
|
|
1724
|
+
async function Si(n, e = {}) {
|
|
1725
|
+
return X(n, "GET", "/v2/passwordPolicy", Te(n, e));
|
|
1707
1726
|
}
|
|
1708
1727
|
/**
|
|
1709
1728
|
* @license
|
|
@@ -1721,12 +1740,12 @@ async function Ei(n, e = {}) {
|
|
|
1721
1740
|
* See the License for the specific language governing permissions and
|
|
1722
1741
|
* limitations under the License.
|
|
1723
1742
|
*/
|
|
1724
|
-
const
|
|
1725
|
-
class
|
|
1743
|
+
const Ri = 6;
|
|
1744
|
+
class Ai {
|
|
1726
1745
|
constructor(e) {
|
|
1727
1746
|
var t, i, r, s;
|
|
1728
1747
|
const o = e.customStrengthOptions;
|
|
1729
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1748
|
+
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;
|
|
1730
1749
|
}
|
|
1731
1750
|
validatePassword(e) {
|
|
1732
1751
|
var t, i, r, s, o, c;
|
|
@@ -1809,14 +1828,14 @@ class Si {
|
|
|
1809
1828
|
* See the License for the specific language governing permissions and
|
|
1810
1829
|
* limitations under the License.
|
|
1811
1830
|
*/
|
|
1812
|
-
class
|
|
1831
|
+
class Pi {
|
|
1813
1832
|
constructor(e, t, i, r) {
|
|
1814
|
-
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
|
|
1833
|
+
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;
|
|
1815
1834
|
}
|
|
1816
1835
|
_initializeWithPersistence(e, t) {
|
|
1817
1836
|
return t && (this._popupRedirectResolver = N(t)), this._initializationPromise = this.queue(async () => {
|
|
1818
1837
|
var i, r;
|
|
1819
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1838
|
+
if (!this._deleted && (this.persistenceManager = await K.create(this, e), !this._deleted)) {
|
|
1820
1839
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1821
1840
|
try {
|
|
1822
1841
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1897,7 +1916,7 @@ class Ri {
|
|
|
1897
1916
|
}
|
|
1898
1917
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1899
1918
|
try {
|
|
1900
|
-
await
|
|
1919
|
+
await ve(e);
|
|
1901
1920
|
} catch (t) {
|
|
1902
1921
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1903
1922
|
return this.directlySetCurrentUser(null);
|
|
@@ -1905,7 +1924,7 @@ class Ri {
|
|
|
1905
1924
|
return this.directlySetCurrentUser(e);
|
|
1906
1925
|
}
|
|
1907
1926
|
useDeviceLanguage() {
|
|
1908
|
-
this.languageCode =
|
|
1927
|
+
this.languageCode = ui();
|
|
1909
1928
|
}
|
|
1910
1929
|
async _delete() {
|
|
1911
1930
|
this._deleted = !0;
|
|
@@ -1913,7 +1932,7 @@ class Ri {
|
|
|
1913
1932
|
async updateCurrentUser(e) {
|
|
1914
1933
|
if (A(this.app))
|
|
1915
1934
|
return Promise.reject($(this));
|
|
1916
|
-
const t = e ?
|
|
1935
|
+
const t = e ? Y(e) : null;
|
|
1917
1936
|
return t && u(
|
|
1918
1937
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1919
1938
|
this,
|
|
@@ -1956,7 +1975,7 @@ class Ri {
|
|
|
1956
1975
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1957
1976
|
}
|
|
1958
1977
|
async _updatePasswordPolicy() {
|
|
1959
|
-
const e = await
|
|
1978
|
+
const e = await Si(this), t = new Ai(e);
|
|
1960
1979
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1961
1980
|
}
|
|
1962
1981
|
_getPersistence() {
|
|
@@ -1996,7 +2015,7 @@ class Ri {
|
|
|
1996
2015
|
token: e,
|
|
1997
2016
|
idToken: t
|
|
1998
2017
|
};
|
|
1999
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
2018
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await wi(this, i);
|
|
2000
2019
|
}
|
|
2001
2020
|
}
|
|
2002
2021
|
toJSON() {
|
|
@@ -2020,7 +2039,7 @@ class Ri {
|
|
|
2020
2039
|
this,
|
|
2021
2040
|
"argument-error"
|
|
2022
2041
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2023
|
-
), this.redirectPersistenceManager = await
|
|
2042
|
+
), this.redirectPersistenceManager = await K.create(
|
|
2024
2043
|
this,
|
|
2025
2044
|
[N(t._redirectPersistence)],
|
|
2026
2045
|
"redirectUser"
|
|
@@ -2139,15 +2158,15 @@ class Ri {
|
|
|
2139
2158
|
async _getAppCheckToken() {
|
|
2140
2159
|
var e;
|
|
2141
2160
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
2142
|
-
return t != null && t.error &&
|
|
2161
|
+
return t != null && t.error && ai(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
2143
2162
|
}
|
|
2144
2163
|
}
|
|
2145
|
-
function
|
|
2146
|
-
return
|
|
2164
|
+
function be(n) {
|
|
2165
|
+
return Y(n);
|
|
2147
2166
|
}
|
|
2148
2167
|
class at {
|
|
2149
2168
|
constructor(e) {
|
|
2150
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2169
|
+
this.auth = e, this.observer = null, this.addObserver = Sn((t) => this.observer = t);
|
|
2151
2170
|
}
|
|
2152
2171
|
get next() {
|
|
2153
2172
|
return u(
|
|
@@ -2182,16 +2201,16 @@ let Be = {
|
|
|
2182
2201
|
recaptchaEnterpriseScript: "",
|
|
2183
2202
|
gapiScript: ""
|
|
2184
2203
|
};
|
|
2185
|
-
function
|
|
2204
|
+
function Ci(n) {
|
|
2186
2205
|
Be = n;
|
|
2187
2206
|
}
|
|
2188
|
-
function
|
|
2207
|
+
function Ni(n) {
|
|
2189
2208
|
return Be.loadJS(n);
|
|
2190
2209
|
}
|
|
2191
|
-
function
|
|
2210
|
+
function Oi() {
|
|
2192
2211
|
return Be.gapiScript;
|
|
2193
2212
|
}
|
|
2194
|
-
function
|
|
2213
|
+
function Li(n) {
|
|
2195
2214
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2196
2215
|
}
|
|
2197
2216
|
/**
|
|
@@ -2210,11 +2229,11 @@ function Ni(n) {
|
|
|
2210
2229
|
* See the License for the specific language governing permissions and
|
|
2211
2230
|
* limitations under the License.
|
|
2212
2231
|
*/
|
|
2213
|
-
function
|
|
2214
|
-
const t =
|
|
2232
|
+
function Mi(n, e) {
|
|
2233
|
+
const t = bt(n, "auth");
|
|
2215
2234
|
if (t.isInitialized()) {
|
|
2216
2235
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2217
|
-
if (
|
|
2236
|
+
if (Pn(s, e ?? {}))
|
|
2218
2237
|
return r;
|
|
2219
2238
|
O(
|
|
2220
2239
|
r,
|
|
@@ -2224,12 +2243,12 @@ function Oi(n, e) {
|
|
|
2224
2243
|
}
|
|
2225
2244
|
return t.initialize({ options: e });
|
|
2226
2245
|
}
|
|
2227
|
-
function
|
|
2246
|
+
function Ui(n, e) {
|
|
2228
2247
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(N);
|
|
2229
2248
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2230
2249
|
}
|
|
2231
|
-
function
|
|
2232
|
-
const i =
|
|
2250
|
+
function Di(n, e, t) {
|
|
2251
|
+
const i = be(n);
|
|
2233
2252
|
u(
|
|
2234
2253
|
i._canInitEmulator,
|
|
2235
2254
|
i,
|
|
@@ -2241,19 +2260,19 @@ function Mi(n, e, t) {
|
|
|
2241
2260
|
"invalid-emulator-scheme"
|
|
2242
2261
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2243
2262
|
);
|
|
2244
|
-
const r = !1, s = Bt(e), { host: o, port: c } =
|
|
2263
|
+
const r = !1, s = Bt(e), { host: o, port: c } = xi(e), a = c === null ? "" : `:${c}`;
|
|
2245
2264
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2246
2265
|
host: o,
|
|
2247
2266
|
port: c,
|
|
2248
2267
|
protocol: s.replace(":", ""),
|
|
2249
2268
|
options: Object.freeze({ disableWarnings: r })
|
|
2250
|
-
}),
|
|
2269
|
+
}), Fi();
|
|
2251
2270
|
}
|
|
2252
2271
|
function Bt(n) {
|
|
2253
2272
|
const e = n.indexOf(":");
|
|
2254
2273
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2255
2274
|
}
|
|
2256
|
-
function
|
|
2275
|
+
function xi(n) {
|
|
2257
2276
|
const e = Bt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2258
2277
|
if (!t)
|
|
2259
2278
|
return { host: "", port: null };
|
|
@@ -2272,7 +2291,7 @@ function ct(n) {
|
|
|
2272
2291
|
const e = Number(n);
|
|
2273
2292
|
return isNaN(e) ? null : e;
|
|
2274
2293
|
}
|
|
2275
|
-
function
|
|
2294
|
+
function Fi() {
|
|
2276
2295
|
function n() {
|
|
2277
2296
|
const e = document.createElement("p"), t = e.style;
|
|
2278
2297
|
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);
|
|
@@ -2337,8 +2356,8 @@ class zt {
|
|
|
2337
2356
|
* See the License for the specific language governing permissions and
|
|
2338
2357
|
* limitations under the License.
|
|
2339
2358
|
*/
|
|
2340
|
-
async function
|
|
2341
|
-
return Ot(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2359
|
+
async function J(n, e) {
|
|
2360
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", Te(n, e));
|
|
2342
2361
|
}
|
|
2343
2362
|
/**
|
|
2344
2363
|
* @license
|
|
@@ -2356,14 +2375,14 @@ async function q(n, e) {
|
|
|
2356
2375
|
* See the License for the specific language governing permissions and
|
|
2357
2376
|
* limitations under the License.
|
|
2358
2377
|
*/
|
|
2359
|
-
const
|
|
2360
|
-
class
|
|
2378
|
+
const Vi = "http://localhost";
|
|
2379
|
+
class W extends zt {
|
|
2361
2380
|
constructor() {
|
|
2362
2381
|
super(...arguments), this.pendingToken = null;
|
|
2363
2382
|
}
|
|
2364
2383
|
/** @internal */
|
|
2365
2384
|
static _fromParams(e) {
|
|
2366
|
-
const t = new
|
|
2385
|
+
const t = new W(e.providerId, e.signInMethod);
|
|
2367
2386
|
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(
|
|
2368
2387
|
"argument-error"
|
|
2369
2388
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
@@ -2394,27 +2413,27 @@ class j extends zt {
|
|
|
2394
2413
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2395
2414
|
if (!i || !r)
|
|
2396
2415
|
return null;
|
|
2397
|
-
const o = new
|
|
2416
|
+
const o = new W(i, r);
|
|
2398
2417
|
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;
|
|
2399
2418
|
}
|
|
2400
2419
|
/** @internal */
|
|
2401
2420
|
_getIdTokenResponse(e) {
|
|
2402
2421
|
const t = this.buildRequest();
|
|
2403
|
-
return
|
|
2422
|
+
return J(e, t);
|
|
2404
2423
|
}
|
|
2405
2424
|
/** @internal */
|
|
2406
2425
|
_linkToIdToken(e, t) {
|
|
2407
2426
|
const i = this.buildRequest();
|
|
2408
|
-
return i.idToken = t,
|
|
2427
|
+
return i.idToken = t, J(e, i);
|
|
2409
2428
|
}
|
|
2410
2429
|
/** @internal */
|
|
2411
2430
|
_getReauthenticationResolver(e) {
|
|
2412
2431
|
const t = this.buildRequest();
|
|
2413
|
-
return t.autoCreate = !1,
|
|
2432
|
+
return t.autoCreate = !1, J(e, t);
|
|
2414
2433
|
}
|
|
2415
2434
|
buildRequest() {
|
|
2416
2435
|
const e = {
|
|
2417
|
-
requestUri:
|
|
2436
|
+
requestUri: Vi,
|
|
2418
2437
|
returnSecureToken: !0
|
|
2419
2438
|
};
|
|
2420
2439
|
if (this.pendingToken)
|
|
@@ -2550,7 +2569,7 @@ class D extends ae {
|
|
|
2550
2569
|
* @param accessToken - Facebook access token.
|
|
2551
2570
|
*/
|
|
2552
2571
|
static credential(e) {
|
|
2553
|
-
return
|
|
2572
|
+
return W._fromParams({
|
|
2554
2573
|
providerId: D.PROVIDER_ID,
|
|
2555
2574
|
signInMethod: D.FACEBOOK_SIGN_IN_METHOD,
|
|
2556
2575
|
accessToken: e
|
|
@@ -2622,7 +2641,7 @@ class x extends ae {
|
|
|
2622
2641
|
* @param accessToken - Google access token.
|
|
2623
2642
|
*/
|
|
2624
2643
|
static credential(e, t) {
|
|
2625
|
-
return
|
|
2644
|
+
return W._fromParams({
|
|
2626
2645
|
providerId: x.PROVIDER_ID,
|
|
2627
2646
|
signInMethod: x.GOOGLE_SIGN_IN_METHOD,
|
|
2628
2647
|
idToken: e,
|
|
@@ -2690,7 +2709,7 @@ class F extends ae {
|
|
|
2690
2709
|
* @param accessToken - Github access token.
|
|
2691
2710
|
*/
|
|
2692
2711
|
static credential(e) {
|
|
2693
|
-
return
|
|
2712
|
+
return W._fromParams({
|
|
2694
2713
|
providerId: F.PROVIDER_ID,
|
|
2695
2714
|
signInMethod: F.GITHUB_SIGN_IN_METHOD,
|
|
2696
2715
|
accessToken: e
|
|
@@ -2755,7 +2774,7 @@ class V extends ae {
|
|
|
2755
2774
|
* @param secret - Twitter secret.
|
|
2756
2775
|
*/
|
|
2757
2776
|
static credential(e, t) {
|
|
2758
|
-
return
|
|
2777
|
+
return W._fromParams({
|
|
2759
2778
|
providerId: V.PROVIDER_ID,
|
|
2760
2779
|
signInMethod: V.TWITTER_SIGN_IN_METHOD,
|
|
2761
2780
|
oauthToken: e,
|
|
@@ -2810,13 +2829,13 @@ V.PROVIDER_ID = "twitter.com";
|
|
|
2810
2829
|
* See the License for the specific language governing permissions and
|
|
2811
2830
|
* limitations under the License.
|
|
2812
2831
|
*/
|
|
2813
|
-
class
|
|
2832
|
+
class G {
|
|
2814
2833
|
constructor(e) {
|
|
2815
2834
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2816
2835
|
}
|
|
2817
2836
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2818
2837
|
const s = await C._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2819
|
-
return new
|
|
2838
|
+
return new G({
|
|
2820
2839
|
user: s,
|
|
2821
2840
|
providerId: o,
|
|
2822
2841
|
_tokenResponse: i,
|
|
@@ -2830,7 +2849,7 @@ class W {
|
|
|
2830
2849
|
!0
|
|
2831
2850
|
);
|
|
2832
2851
|
const r = lt(i);
|
|
2833
|
-
return new
|
|
2852
|
+
return new G({
|
|
2834
2853
|
user: e,
|
|
2835
2854
|
providerId: r,
|
|
2836
2855
|
_tokenResponse: i,
|
|
@@ -2857,10 +2876,10 @@ function lt(n) {
|
|
|
2857
2876
|
* See the License for the specific language governing permissions and
|
|
2858
2877
|
* limitations under the License.
|
|
2859
2878
|
*/
|
|
2860
|
-
class
|
|
2879
|
+
class Ie extends Ve {
|
|
2861
2880
|
constructor(e, t, i, r) {
|
|
2862
2881
|
var s;
|
|
2863
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2882
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, Ie.prototype), this.customData = {
|
|
2864
2883
|
appName: e.name,
|
|
2865
2884
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2866
2885
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2868,17 +2887,17 @@ class ve extends Ve {
|
|
|
2868
2887
|
};
|
|
2869
2888
|
}
|
|
2870
2889
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2871
|
-
return new
|
|
2890
|
+
return new Ie(e, t, i, r);
|
|
2872
2891
|
}
|
|
2873
2892
|
}
|
|
2874
2893
|
function Kt(n, e, t, i) {
|
|
2875
2894
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2876
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2895
|
+
throw s.code === "auth/multi-factor-auth-required" ? Ie._fromErrorAndOperation(n, s, e, i) : s;
|
|
2877
2896
|
});
|
|
2878
2897
|
}
|
|
2879
|
-
async function
|
|
2898
|
+
async function $i(n, e, t = !1) {
|
|
2880
2899
|
const i = await ie(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2881
|
-
return
|
|
2900
|
+
return G._forOperation(n, "link", i);
|
|
2882
2901
|
}
|
|
2883
2902
|
/**
|
|
2884
2903
|
* @license
|
|
@@ -2896,7 +2915,7 @@ async function Fi(n, e, t = !1) {
|
|
|
2896
2915
|
* See the License for the specific language governing permissions and
|
|
2897
2916
|
* limitations under the License.
|
|
2898
2917
|
*/
|
|
2899
|
-
async function
|
|
2918
|
+
async function Hi(n, e, t = !1) {
|
|
2900
2919
|
const { auth: i } = n;
|
|
2901
2920
|
if (A(i.app))
|
|
2902
2921
|
return Promise.reject($(i));
|
|
@@ -2922,7 +2941,7 @@ async function Vi(n, e, t = !1) {
|
|
|
2922
2941
|
i,
|
|
2923
2942
|
"user-mismatch"
|
|
2924
2943
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2925
|
-
),
|
|
2944
|
+
), G._forOperation(n, r, s);
|
|
2926
2945
|
} catch (s) {
|
|
2927
2946
|
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && O(
|
|
2928
2947
|
i,
|
|
@@ -2947,10 +2966,10 @@ async function Vi(n, e, t = !1) {
|
|
|
2947
2966
|
* See the License for the specific language governing permissions and
|
|
2948
2967
|
* limitations under the License.
|
|
2949
2968
|
*/
|
|
2950
|
-
async function
|
|
2969
|
+
async function ji(n, e, t = !1) {
|
|
2951
2970
|
if (A(n.app))
|
|
2952
2971
|
return Promise.reject($(n));
|
|
2953
|
-
const i = "signIn", r = await Kt(n, i, e), s = await
|
|
2972
|
+
const i = "signIn", r = await Kt(n, i, e), s = await G._fromIdTokenResponse(n, i, r);
|
|
2954
2973
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2955
2974
|
}
|
|
2956
2975
|
/**
|
|
@@ -2969,8 +2988,8 @@ async function $i(n, e, t = !1) {
|
|
|
2969
2988
|
* See the License for the specific language governing permissions and
|
|
2970
2989
|
* limitations under the License.
|
|
2971
2990
|
*/
|
|
2972
|
-
async function
|
|
2973
|
-
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2991
|
+
async function Wi(n, e) {
|
|
2992
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", Te(n, e));
|
|
2974
2993
|
}
|
|
2975
2994
|
/**
|
|
2976
2995
|
* @license
|
|
@@ -2988,22 +3007,22 @@ async function Hi(n, e) {
|
|
|
2988
3007
|
* See the License for the specific language governing permissions and
|
|
2989
3008
|
* limitations under the License.
|
|
2990
3009
|
*/
|
|
2991
|
-
async function
|
|
3010
|
+
async function Gi(n, e) {
|
|
2992
3011
|
if (A(n.app))
|
|
2993
3012
|
return Promise.reject($(n));
|
|
2994
|
-
const t =
|
|
3013
|
+
const t = be(n), i = await Wi(t, {
|
|
2995
3014
|
token: e,
|
|
2996
3015
|
returnSecureToken: !0
|
|
2997
|
-
}), r = await
|
|
3016
|
+
}), r = await G._fromIdTokenResponse(t, "signIn", i);
|
|
2998
3017
|
return await t._updateCurrentUser(r.user), r;
|
|
2999
3018
|
}
|
|
3000
|
-
function
|
|
3001
|
-
return
|
|
3019
|
+
function Bi(n, e, t, i) {
|
|
3020
|
+
return Y(n).onIdTokenChanged(e, t, i);
|
|
3002
3021
|
}
|
|
3003
|
-
function
|
|
3004
|
-
return
|
|
3022
|
+
function zi(n, e, t) {
|
|
3023
|
+
return Y(n).beforeAuthStateChanged(e, t);
|
|
3005
3024
|
}
|
|
3006
|
-
const
|
|
3025
|
+
const ye = "__sak";
|
|
3007
3026
|
/**
|
|
3008
3027
|
* @license
|
|
3009
3028
|
* Copyright 2019 Google LLC
|
|
@@ -3026,7 +3045,7 @@ class Jt {
|
|
|
3026
3045
|
}
|
|
3027
3046
|
_isAvailable() {
|
|
3028
3047
|
try {
|
|
3029
|
-
return this.storage ? (this.storage.setItem(
|
|
3048
|
+
return this.storage ? (this.storage.setItem(ye, "1"), this.storage.removeItem(ye), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
3030
3049
|
} catch {
|
|
3031
3050
|
return Promise.resolve(!1);
|
|
3032
3051
|
}
|
|
@@ -3061,18 +3080,18 @@ class Jt {
|
|
|
3061
3080
|
* See the License for the specific language governing permissions and
|
|
3062
3081
|
* limitations under the License.
|
|
3063
3082
|
*/
|
|
3064
|
-
function
|
|
3065
|
-
const n =
|
|
3066
|
-
return Ge(n) ||
|
|
3083
|
+
function qi() {
|
|
3084
|
+
const n = w();
|
|
3085
|
+
return Ge(n) || ke(n);
|
|
3067
3086
|
}
|
|
3068
|
-
const
|
|
3087
|
+
const Ki = 1e3, Ji = 10;
|
|
3069
3088
|
class Yt extends Jt {
|
|
3070
3089
|
constructor() {
|
|
3071
3090
|
super(
|
|
3072
3091
|
() => window.localStorage,
|
|
3073
3092
|
"LOCAL"
|
|
3074
3093
|
/* PersistenceType.LOCAL */
|
|
3075
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3094
|
+
), 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;
|
|
3076
3095
|
}
|
|
3077
3096
|
forAllChangedKeys(e) {
|
|
3078
3097
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -3099,7 +3118,7 @@ class Yt extends Jt {
|
|
|
3099
3118
|
const o = this.storage.getItem(i);
|
|
3100
3119
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
3101
3120
|
}, s = this.storage.getItem(i);
|
|
3102
|
-
|
|
3121
|
+
ki() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ji) : r();
|
|
3103
3122
|
}
|
|
3104
3123
|
notifyListeners(e, t) {
|
|
3105
3124
|
this.localCache[e] = t;
|
|
@@ -3121,7 +3140,7 @@ class Yt extends Jt {
|
|
|
3121
3140
|
!0
|
|
3122
3141
|
);
|
|
3123
3142
|
});
|
|
3124
|
-
},
|
|
3143
|
+
}, Ki);
|
|
3125
3144
|
}
|
|
3126
3145
|
stopPolling() {
|
|
3127
3146
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3151,7 +3170,7 @@ class Yt extends Jt {
|
|
|
3151
3170
|
}
|
|
3152
3171
|
}
|
|
3153
3172
|
Yt.type = "LOCAL";
|
|
3154
|
-
const
|
|
3173
|
+
const Yi = Yt;
|
|
3155
3174
|
/**
|
|
3156
3175
|
* @license
|
|
3157
3176
|
* Copyright 2020 Google LLC
|
|
@@ -3199,7 +3218,7 @@ const Qt = Xt;
|
|
|
3199
3218
|
* See the License for the specific language governing permissions and
|
|
3200
3219
|
* limitations under the License.
|
|
3201
3220
|
*/
|
|
3202
|
-
function
|
|
3221
|
+
function Xi(n) {
|
|
3203
3222
|
return Promise.all(n.map(async (e) => {
|
|
3204
3223
|
try {
|
|
3205
3224
|
return {
|
|
@@ -3269,7 +3288,7 @@ class Ee {
|
|
|
3269
3288
|
eventId: i,
|
|
3270
3289
|
eventType: r
|
|
3271
3290
|
});
|
|
3272
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3291
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Xi(c);
|
|
3273
3292
|
t.ports[0].postMessage({
|
|
3274
3293
|
status: "done",
|
|
3275
3294
|
eventId: i,
|
|
@@ -3337,7 +3356,7 @@ function ze(n = "", e = 10) {
|
|
|
3337
3356
|
* See the License for the specific language governing permissions and
|
|
3338
3357
|
* limitations under the License.
|
|
3339
3358
|
*/
|
|
3340
|
-
class
|
|
3359
|
+
class Qi {
|
|
3341
3360
|
constructor(e) {
|
|
3342
3361
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3343
3362
|
}
|
|
@@ -3381,10 +3400,10 @@ class Yi {
|
|
|
3381
3400
|
}, i);
|
|
3382
3401
|
o = {
|
|
3383
3402
|
messageChannel: r,
|
|
3384
|
-
onMessage(
|
|
3385
|
-
const
|
|
3386
|
-
if (
|
|
3387
|
-
switch (
|
|
3403
|
+
onMessage(m) {
|
|
3404
|
+
const h = m;
|
|
3405
|
+
if (h.data.eventId === l)
|
|
3406
|
+
switch (h.data.status) {
|
|
3388
3407
|
case "ack":
|
|
3389
3408
|
clearTimeout(d), s = setTimeout(
|
|
3390
3409
|
() => {
|
|
@@ -3398,7 +3417,7 @@ class Yi {
|
|
|
3398
3417
|
);
|
|
3399
3418
|
break;
|
|
3400
3419
|
case "done":
|
|
3401
|
-
clearTimeout(s), c(
|
|
3420
|
+
clearTimeout(s), c(h.data.response);
|
|
3402
3421
|
break;
|
|
3403
3422
|
default:
|
|
3404
3423
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3434,11 +3453,11 @@ class Yi {
|
|
|
3434
3453
|
* See the License for the specific language governing permissions and
|
|
3435
3454
|
* limitations under the License.
|
|
3436
3455
|
*/
|
|
3437
|
-
function
|
|
3456
|
+
function E() {
|
|
3438
3457
|
return window;
|
|
3439
3458
|
}
|
|
3440
|
-
function
|
|
3441
|
-
|
|
3459
|
+
function Zi(n) {
|
|
3460
|
+
E().location.href = n;
|
|
3442
3461
|
}
|
|
3443
3462
|
/**
|
|
3444
3463
|
* @license
|
|
@@ -3457,9 +3476,9 @@ function Xi(n) {
|
|
|
3457
3476
|
* limitations under the License.
|
|
3458
3477
|
*/
|
|
3459
3478
|
function Zt() {
|
|
3460
|
-
return typeof
|
|
3479
|
+
return typeof E().WorkerGlobalScope < "u" && typeof E().importScripts == "function";
|
|
3461
3480
|
}
|
|
3462
|
-
async function
|
|
3481
|
+
async function er() {
|
|
3463
3482
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3464
3483
|
return null;
|
|
3465
3484
|
try {
|
|
@@ -3468,11 +3487,11 @@ async function Qi() {
|
|
|
3468
3487
|
return null;
|
|
3469
3488
|
}
|
|
3470
3489
|
}
|
|
3471
|
-
function
|
|
3490
|
+
function tr() {
|
|
3472
3491
|
var n;
|
|
3473
3492
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3474
3493
|
}
|
|
3475
|
-
function
|
|
3494
|
+
function nr() {
|
|
3476
3495
|
return Zt() ? self : null;
|
|
3477
3496
|
}
|
|
3478
3497
|
/**
|
|
@@ -3491,7 +3510,7 @@ function er() {
|
|
|
3491
3510
|
* See the License for the specific language governing permissions and
|
|
3492
3511
|
* limitations under the License.
|
|
3493
3512
|
*/
|
|
3494
|
-
const en = "firebaseLocalStorageDb",
|
|
3513
|
+
const en = "firebaseLocalStorageDb", ir = 1, we = "firebaseLocalStorage", tn = "fbase_key";
|
|
3495
3514
|
class ce {
|
|
3496
3515
|
constructor(e) {
|
|
3497
3516
|
this.request = e;
|
|
@@ -3506,47 +3525,47 @@ class ce {
|
|
|
3506
3525
|
});
|
|
3507
3526
|
}
|
|
3508
3527
|
}
|
|
3509
|
-
function
|
|
3510
|
-
return n.transaction([
|
|
3528
|
+
function Se(n, e) {
|
|
3529
|
+
return n.transaction([we], e ? "readwrite" : "readonly").objectStore(we);
|
|
3511
3530
|
}
|
|
3512
|
-
function
|
|
3531
|
+
function rr() {
|
|
3513
3532
|
const n = indexedDB.deleteDatabase(en);
|
|
3514
3533
|
return new ce(n).toPromise();
|
|
3515
3534
|
}
|
|
3516
|
-
function
|
|
3517
|
-
const n = indexedDB.open(en,
|
|
3535
|
+
function De() {
|
|
3536
|
+
const n = indexedDB.open(en, ir);
|
|
3518
3537
|
return new Promise((e, t) => {
|
|
3519
3538
|
n.addEventListener("error", () => {
|
|
3520
3539
|
t(n.error);
|
|
3521
3540
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3522
3541
|
const i = n.result;
|
|
3523
3542
|
try {
|
|
3524
|
-
i.createObjectStore(
|
|
3543
|
+
i.createObjectStore(we, { keyPath: tn });
|
|
3525
3544
|
} catch (r) {
|
|
3526
3545
|
t(r);
|
|
3527
3546
|
}
|
|
3528
3547
|
}), n.addEventListener("success", async () => {
|
|
3529
3548
|
const i = n.result;
|
|
3530
|
-
i.objectStoreNames.contains(
|
|
3549
|
+
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await rr(), e(await De()));
|
|
3531
3550
|
});
|
|
3532
3551
|
});
|
|
3533
3552
|
}
|
|
3534
3553
|
async function ut(n, e, t) {
|
|
3535
|
-
const i =
|
|
3554
|
+
const i = Se(n, !0).put({
|
|
3536
3555
|
[tn]: e,
|
|
3537
3556
|
value: t
|
|
3538
3557
|
});
|
|
3539
3558
|
return new ce(i).toPromise();
|
|
3540
3559
|
}
|
|
3541
|
-
async function
|
|
3542
|
-
const t =
|
|
3560
|
+
async function sr(n, e) {
|
|
3561
|
+
const t = Se(n, !1).get(e), i = await new ce(t).toPromise();
|
|
3543
3562
|
return i === void 0 ? null : i.value;
|
|
3544
3563
|
}
|
|
3545
3564
|
function dt(n, e) {
|
|
3546
|
-
const t =
|
|
3565
|
+
const t = Se(n, !0).delete(e);
|
|
3547
3566
|
return new ce(t).toPromise();
|
|
3548
3567
|
}
|
|
3549
|
-
const
|
|
3568
|
+
const or = 800, ar = 3;
|
|
3550
3569
|
class nn {
|
|
3551
3570
|
constructor() {
|
|
3552
3571
|
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(() => {
|
|
@@ -3554,7 +3573,7 @@ class nn {
|
|
|
3554
3573
|
});
|
|
3555
3574
|
}
|
|
3556
3575
|
async _openDb() {
|
|
3557
|
-
return this.db ? this.db : (this.db = await
|
|
3576
|
+
return this.db ? this.db : (this.db = await De(), this.db);
|
|
3558
3577
|
}
|
|
3559
3578
|
async _withRetries(e) {
|
|
3560
3579
|
let t = 0;
|
|
@@ -3563,7 +3582,7 @@ class nn {
|
|
|
3563
3582
|
const i = await this._openDb();
|
|
3564
3583
|
return await e(i);
|
|
3565
3584
|
} catch (i) {
|
|
3566
|
-
if (t++ >
|
|
3585
|
+
if (t++ > ar)
|
|
3567
3586
|
throw i;
|
|
3568
3587
|
this.db && (this.db.close(), this.db = void 0);
|
|
3569
3588
|
}
|
|
@@ -3579,7 +3598,7 @@ class nn {
|
|
|
3579
3598
|
* As the worker we should listen to events from the main window.
|
|
3580
3599
|
*/
|
|
3581
3600
|
async initializeReceiver() {
|
|
3582
|
-
this.receiver = Ee._getInstance(
|
|
3601
|
+
this.receiver = Ee._getInstance(nr()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3583
3602
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3584
3603
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3585
3604
|
"keyChanged"
|
|
@@ -3595,9 +3614,9 @@ class nn {
|
|
|
3595
3614
|
*/
|
|
3596
3615
|
async initializeSender() {
|
|
3597
3616
|
var e, t;
|
|
3598
|
-
if (this.activeServiceWorker = await
|
|
3617
|
+
if (this.activeServiceWorker = await er(), !this.activeServiceWorker)
|
|
3599
3618
|
return;
|
|
3600
|
-
this.sender = new
|
|
3619
|
+
this.sender = new Qi(this.activeServiceWorker);
|
|
3601
3620
|
const i = await this.sender._send(
|
|
3602
3621
|
"ping",
|
|
3603
3622
|
{},
|
|
@@ -3619,7 +3638,7 @@ class nn {
|
|
|
3619
3638
|
* @param key - Storage key which changed.
|
|
3620
3639
|
*/
|
|
3621
3640
|
async notifyServiceWorker(e) {
|
|
3622
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3641
|
+
if (!(!this.sender || !this.activeServiceWorker || tr() !== this.activeServiceWorker))
|
|
3623
3642
|
try {
|
|
3624
3643
|
await this.sender._send(
|
|
3625
3644
|
"keyChanged",
|
|
@@ -3635,8 +3654,8 @@ class nn {
|
|
|
3635
3654
|
try {
|
|
3636
3655
|
if (!indexedDB)
|
|
3637
3656
|
return !1;
|
|
3638
|
-
const e = await
|
|
3639
|
-
return await ut(e,
|
|
3657
|
+
const e = await De();
|
|
3658
|
+
return await ut(e, ye, "1"), await dt(e, ye), !0;
|
|
3640
3659
|
} catch {
|
|
3641
3660
|
}
|
|
3642
3661
|
return !1;
|
|
@@ -3653,7 +3672,7 @@ class nn {
|
|
|
3653
3672
|
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3654
3673
|
}
|
|
3655
3674
|
async _get(e) {
|
|
3656
|
-
const t = await this._withRetries((i) =>
|
|
3675
|
+
const t = await this._withRetries((i) => sr(i, e));
|
|
3657
3676
|
return this.localCache[e] = t, t;
|
|
3658
3677
|
}
|
|
3659
3678
|
async _remove(e) {
|
|
@@ -3661,7 +3680,7 @@ class nn {
|
|
|
3661
3680
|
}
|
|
3662
3681
|
async _poll() {
|
|
3663
3682
|
const e = await this._withRetries((r) => {
|
|
3664
|
-
const s =
|
|
3683
|
+
const s = Se(r, !1).getAll();
|
|
3665
3684
|
return new ce(s).toPromise();
|
|
3666
3685
|
});
|
|
3667
3686
|
if (!e)
|
|
@@ -3684,7 +3703,7 @@ class nn {
|
|
|
3684
3703
|
r(t);
|
|
3685
3704
|
}
|
|
3686
3705
|
startPolling() {
|
|
3687
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3706
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), or);
|
|
3688
3707
|
}
|
|
3689
3708
|
stopPolling() {
|
|
3690
3709
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3697,7 +3716,7 @@ class nn {
|
|
|
3697
3716
|
}
|
|
3698
3717
|
}
|
|
3699
3718
|
nn.type = "LOCAL";
|
|
3700
|
-
const
|
|
3719
|
+
const cr = nn;
|
|
3701
3720
|
new oe(3e4, 6e4);
|
|
3702
3721
|
/**
|
|
3703
3722
|
* @license
|
|
@@ -3715,7 +3734,7 @@ new oe(3e4, 6e4);
|
|
|
3715
3734
|
* See the License for the specific language governing permissions and
|
|
3716
3735
|
* limitations under the License.
|
|
3717
3736
|
*/
|
|
3718
|
-
function
|
|
3737
|
+
function lr(n, e) {
|
|
3719
3738
|
return e ? N(e) : (u(
|
|
3720
3739
|
n._popupRedirectResolver,
|
|
3721
3740
|
n,
|
|
@@ -3748,13 +3767,13 @@ class qe extends zt {
|
|
|
3748
3767
|
), this.params = e;
|
|
3749
3768
|
}
|
|
3750
3769
|
_getIdTokenResponse(e) {
|
|
3751
|
-
return
|
|
3770
|
+
return J(e, this._buildIdpRequest());
|
|
3752
3771
|
}
|
|
3753
3772
|
_linkToIdToken(e, t) {
|
|
3754
|
-
return
|
|
3773
|
+
return J(e, this._buildIdpRequest(t));
|
|
3755
3774
|
}
|
|
3756
3775
|
_getReauthenticationResolver(e) {
|
|
3757
|
-
return
|
|
3776
|
+
return J(e, this._buildIdpRequest());
|
|
3758
3777
|
}
|
|
3759
3778
|
_buildIdpRequest(e) {
|
|
3760
3779
|
const t = {
|
|
@@ -3769,26 +3788,26 @@ class qe extends zt {
|
|
|
3769
3788
|
return e && (t.idToken = e), t;
|
|
3770
3789
|
}
|
|
3771
3790
|
}
|
|
3772
|
-
function
|
|
3773
|
-
return
|
|
3791
|
+
function ur(n) {
|
|
3792
|
+
return ji(n.auth, new qe(n), n.bypassAuthState);
|
|
3774
3793
|
}
|
|
3775
|
-
function
|
|
3794
|
+
function dr(n) {
|
|
3776
3795
|
const { auth: e, user: t } = n;
|
|
3777
3796
|
return u(
|
|
3778
3797
|
t,
|
|
3779
3798
|
e,
|
|
3780
3799
|
"internal-error"
|
|
3781
3800
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3782
|
-
),
|
|
3801
|
+
), Hi(t, new qe(n), n.bypassAuthState);
|
|
3783
3802
|
}
|
|
3784
|
-
async function
|
|
3803
|
+
async function hr(n) {
|
|
3785
3804
|
const { auth: e, user: t } = n;
|
|
3786
3805
|
return u(
|
|
3787
3806
|
t,
|
|
3788
3807
|
e,
|
|
3789
3808
|
"internal-error"
|
|
3790
3809
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3791
|
-
),
|
|
3810
|
+
), $i(t, new qe(n), n.bypassAuthState);
|
|
3792
3811
|
}
|
|
3793
3812
|
/**
|
|
3794
3813
|
* @license
|
|
@@ -3848,13 +3867,13 @@ class rn {
|
|
|
3848
3867
|
switch (e) {
|
|
3849
3868
|
case "signInViaPopup":
|
|
3850
3869
|
case "signInViaRedirect":
|
|
3851
|
-
return
|
|
3870
|
+
return ur;
|
|
3852
3871
|
case "linkViaPopup":
|
|
3853
3872
|
case "linkViaRedirect":
|
|
3854
|
-
return
|
|
3873
|
+
return hr;
|
|
3855
3874
|
case "reauthViaPopup":
|
|
3856
3875
|
case "reauthViaRedirect":
|
|
3857
|
-
return
|
|
3876
|
+
return dr;
|
|
3858
3877
|
default:
|
|
3859
3878
|
O(
|
|
3860
3879
|
this.auth,
|
|
@@ -3889,10 +3908,10 @@ class rn {
|
|
|
3889
3908
|
* See the License for the specific language governing permissions and
|
|
3890
3909
|
* limitations under the License.
|
|
3891
3910
|
*/
|
|
3892
|
-
const
|
|
3893
|
-
class
|
|
3911
|
+
const fr = new oe(2e3, 1e4);
|
|
3912
|
+
class z extends rn {
|
|
3894
3913
|
constructor(e, t, i, r, s) {
|
|
3895
|
-
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null,
|
|
3914
|
+
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, z.currentPopupAction && z.currentPopupAction.cancel(), z.currentPopupAction = this;
|
|
3896
3915
|
}
|
|
3897
3916
|
async executeNotNull() {
|
|
3898
3917
|
const e = await this.execute();
|
|
@@ -3915,7 +3934,7 @@ class G extends rn {
|
|
|
3915
3934
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3916
3935
|
this.reject(t);
|
|
3917
3936
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3918
|
-
t || this.reject(
|
|
3937
|
+
t || this.reject(b(
|
|
3919
3938
|
this.auth,
|
|
3920
3939
|
"web-storage-unsupported"
|
|
3921
3940
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3927,14 +3946,14 @@ class G extends rn {
|
|
|
3927
3946
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3928
3947
|
}
|
|
3929
3948
|
cancel() {
|
|
3930
|
-
this.reject(
|
|
3949
|
+
this.reject(b(
|
|
3931
3950
|
this.auth,
|
|
3932
3951
|
"cancelled-popup-request"
|
|
3933
3952
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
3934
3953
|
));
|
|
3935
3954
|
}
|
|
3936
3955
|
cleanUp() {
|
|
3937
|
-
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null,
|
|
3956
|
+
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null, z.currentPopupAction = null;
|
|
3938
3957
|
}
|
|
3939
3958
|
pollUserCancellation() {
|
|
3940
3959
|
const e = () => {
|
|
@@ -3942,7 +3961,7 @@ class G extends rn {
|
|
|
3942
3961
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3943
3962
|
this.pollId = window.setTimeout(
|
|
3944
3963
|
() => {
|
|
3945
|
-
this.pollId = null, this.reject(
|
|
3964
|
+
this.pollId = null, this.reject(b(
|
|
3946
3965
|
this.auth,
|
|
3947
3966
|
"popup-closed-by-user"
|
|
3948
3967
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3953,12 +3972,12 @@ class G extends rn {
|
|
|
3953
3972
|
);
|
|
3954
3973
|
return;
|
|
3955
3974
|
}
|
|
3956
|
-
this.pollId = window.setTimeout(e,
|
|
3975
|
+
this.pollId = window.setTimeout(e, fr.get());
|
|
3957
3976
|
};
|
|
3958
3977
|
e();
|
|
3959
3978
|
}
|
|
3960
3979
|
}
|
|
3961
|
-
|
|
3980
|
+
z.currentPopupAction = null;
|
|
3962
3981
|
/**
|
|
3963
3982
|
* @license
|
|
3964
3983
|
* Copyright 2020 Google LLC
|
|
@@ -3975,8 +3994,8 @@ G.currentPopupAction = null;
|
|
|
3975
3994
|
* See the License for the specific language governing permissions and
|
|
3976
3995
|
* limitations under the License.
|
|
3977
3996
|
*/
|
|
3978
|
-
const
|
|
3979
|
-
class
|
|
3997
|
+
const pr = "pendingRedirect", he = /* @__PURE__ */ new Map();
|
|
3998
|
+
class mr extends rn {
|
|
3980
3999
|
constructor(e, t, i = !1) {
|
|
3981
4000
|
super(e, [
|
|
3982
4001
|
"signInViaRedirect",
|
|
@@ -3994,7 +4013,7 @@ class fr extends rn {
|
|
|
3994
4013
|
let e = he.get(this.auth._key());
|
|
3995
4014
|
if (!e) {
|
|
3996
4015
|
try {
|
|
3997
|
-
const i = await
|
|
4016
|
+
const i = await gr(this.resolver, this.auth) ? await super.execute() : null;
|
|
3998
4017
|
e = () => Promise.resolve(i);
|
|
3999
4018
|
} catch (t) {
|
|
4000
4019
|
e = () => Promise.reject(t);
|
|
@@ -4022,26 +4041,26 @@ class fr extends rn {
|
|
|
4022
4041
|
cleanUp() {
|
|
4023
4042
|
}
|
|
4024
4043
|
}
|
|
4025
|
-
async function
|
|
4026
|
-
const t =
|
|
4044
|
+
async function gr(n, e) {
|
|
4045
|
+
const t = Ir(e), i = vr(n);
|
|
4027
4046
|
if (!await i._isAvailable())
|
|
4028
4047
|
return !1;
|
|
4029
4048
|
const r = await i._get(t) === "true";
|
|
4030
4049
|
return await i._remove(t), r;
|
|
4031
4050
|
}
|
|
4032
|
-
function
|
|
4051
|
+
function _r(n, e) {
|
|
4033
4052
|
he.set(n._key(), e);
|
|
4034
4053
|
}
|
|
4035
|
-
function
|
|
4054
|
+
function vr(n) {
|
|
4036
4055
|
return N(n._redirectPersistence);
|
|
4037
4056
|
}
|
|
4038
|
-
function
|
|
4039
|
-
return de(
|
|
4057
|
+
function Ir(n) {
|
|
4058
|
+
return de(pr, n.config.apiKey, n.name);
|
|
4040
4059
|
}
|
|
4041
|
-
async function
|
|
4060
|
+
async function yr(n, e, t = !1) {
|
|
4042
4061
|
if (A(n.app))
|
|
4043
4062
|
return Promise.reject($(n));
|
|
4044
|
-
const i =
|
|
4063
|
+
const i = be(n), r = lr(i, e), o = await new mr(i, r, t).execute();
|
|
4045
4064
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
4046
4065
|
}
|
|
4047
4066
|
/**
|
|
@@ -4060,8 +4079,8 @@ async function vr(n, e, t = !1) {
|
|
|
4060
4079
|
* See the License for the specific language governing permissions and
|
|
4061
4080
|
* limitations under the License.
|
|
4062
4081
|
*/
|
|
4063
|
-
const
|
|
4064
|
-
class
|
|
4082
|
+
const wr = 10 * 60 * 1e3;
|
|
4083
|
+
class Tr {
|
|
4065
4084
|
constructor(e) {
|
|
4066
4085
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
4067
4086
|
}
|
|
@@ -4077,13 +4096,13 @@ class yr {
|
|
|
4077
4096
|
let t = !1;
|
|
4078
4097
|
return this.consumers.forEach((i) => {
|
|
4079
4098
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
4080
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4099
|
+
}), this.hasHandledPotentialRedirect || !kr(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
4081
4100
|
}
|
|
4082
4101
|
sendToConsumer(e, t) {
|
|
4083
4102
|
var i;
|
|
4084
4103
|
if (e.error && !sn(e)) {
|
|
4085
4104
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
4086
|
-
t.onError(
|
|
4105
|
+
t.onError(b(this.auth, r));
|
|
4087
4106
|
} else
|
|
4088
4107
|
t.onAuthEvent(e);
|
|
4089
4108
|
}
|
|
@@ -4092,7 +4111,7 @@ class yr {
|
|
|
4092
4111
|
return t.filter.includes(e.type) && i;
|
|
4093
4112
|
}
|
|
4094
4113
|
hasEventBeenHandled(e) {
|
|
4095
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4114
|
+
return Date.now() - this.lastProcessedEventTime >= wr && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
4096
4115
|
}
|
|
4097
4116
|
saveEventToCache(e) {
|
|
4098
4117
|
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -4104,7 +4123,7 @@ function ht(n) {
|
|
|
4104
4123
|
function sn({ type: n, error: e }) {
|
|
4105
4124
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
4106
4125
|
}
|
|
4107
|
-
function
|
|
4126
|
+
function kr(n) {
|
|
4108
4127
|
switch (n.type) {
|
|
4109
4128
|
case "signInViaRedirect":
|
|
4110
4129
|
case "linkViaRedirect":
|
|
@@ -4132,8 +4151,8 @@ function wr(n) {
|
|
|
4132
4151
|
* See the License for the specific language governing permissions and
|
|
4133
4152
|
* limitations under the License.
|
|
4134
4153
|
*/
|
|
4135
|
-
async function
|
|
4136
|
-
return
|
|
4154
|
+
async function br(n, e = {}) {
|
|
4155
|
+
return X(n, "GET", "/v1/projects", e);
|
|
4137
4156
|
}
|
|
4138
4157
|
/**
|
|
4139
4158
|
* @license
|
|
@@ -4151,14 +4170,14 @@ async function Tr(n, e = {}) {
|
|
|
4151
4170
|
* See the License for the specific language governing permissions and
|
|
4152
4171
|
* limitations under the License.
|
|
4153
4172
|
*/
|
|
4154
|
-
const
|
|
4155
|
-
async function
|
|
4173
|
+
const Er = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Sr = /^https?/;
|
|
4174
|
+
async function Rr(n) {
|
|
4156
4175
|
if (n.config.emulator)
|
|
4157
4176
|
return;
|
|
4158
|
-
const { authorizedDomains: e } = await
|
|
4177
|
+
const { authorizedDomains: e } = await br(n);
|
|
4159
4178
|
for (const t of e)
|
|
4160
4179
|
try {
|
|
4161
|
-
if (
|
|
4180
|
+
if (Ar(t))
|
|
4162
4181
|
return;
|
|
4163
4182
|
} catch {
|
|
4164
4183
|
}
|
|
@@ -4168,15 +4187,15 @@ async function br(n) {
|
|
|
4168
4187
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4169
4188
|
);
|
|
4170
4189
|
}
|
|
4171
|
-
function
|
|
4172
|
-
const e =
|
|
4190
|
+
function Ar(n) {
|
|
4191
|
+
const e = Me(), { protocol: t, hostname: i } = new URL(e);
|
|
4173
4192
|
if (n.startsWith("chrome-extension://")) {
|
|
4174
4193
|
const o = new URL(n);
|
|
4175
4194
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4176
4195
|
}
|
|
4177
|
-
if (!
|
|
4196
|
+
if (!Sr.test(t))
|
|
4178
4197
|
return !1;
|
|
4179
|
-
if (
|
|
4198
|
+
if (Er.test(n))
|
|
4180
4199
|
return i === n;
|
|
4181
4200
|
const r = n.replace(/\./g, "\\.");
|
|
4182
4201
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4197,9 +4216,9 @@ function Sr(n) {
|
|
|
4197
4216
|
* See the License for the specific language governing permissions and
|
|
4198
4217
|
* limitations under the License.
|
|
4199
4218
|
*/
|
|
4200
|
-
const
|
|
4219
|
+
const Pr = new oe(3e4, 6e4);
|
|
4201
4220
|
function ft() {
|
|
4202
|
-
const n =
|
|
4221
|
+
const n = E().___jsl;
|
|
4203
4222
|
if (n != null && n.H) {
|
|
4204
4223
|
for (const e of Object.keys(n.H))
|
|
4205
4224
|
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)
|
|
@@ -4207,7 +4226,7 @@ function ft() {
|
|
|
4207
4226
|
n.CP[t] = null;
|
|
4208
4227
|
}
|
|
4209
4228
|
}
|
|
4210
|
-
function
|
|
4229
|
+
function Cr(n) {
|
|
4211
4230
|
return new Promise((e, t) => {
|
|
4212
4231
|
var i, r, s;
|
|
4213
4232
|
function o() {
|
|
@@ -4216,36 +4235,36 @@ function Ar(n) {
|
|
|
4216
4235
|
e(gapi.iframes.getContext());
|
|
4217
4236
|
},
|
|
4218
4237
|
ontimeout: () => {
|
|
4219
|
-
ft(), t(
|
|
4238
|
+
ft(), t(b(
|
|
4220
4239
|
n,
|
|
4221
4240
|
"network-request-failed"
|
|
4222
4241
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4223
4242
|
));
|
|
4224
4243
|
},
|
|
4225
|
-
timeout:
|
|
4244
|
+
timeout: Pr.get()
|
|
4226
4245
|
});
|
|
4227
4246
|
}
|
|
4228
|
-
if (!((r = (i =
|
|
4247
|
+
if (!((r = (i = E().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4229
4248
|
e(gapi.iframes.getContext());
|
|
4230
|
-
else if (!((s =
|
|
4249
|
+
else if (!((s = E().gapi) === null || s === void 0) && s.load)
|
|
4231
4250
|
o();
|
|
4232
4251
|
else {
|
|
4233
|
-
const c =
|
|
4234
|
-
return
|
|
4235
|
-
gapi.load ? o() : t(
|
|
4252
|
+
const c = Li("iframefcb");
|
|
4253
|
+
return E()[c] = () => {
|
|
4254
|
+
gapi.load ? o() : t(b(
|
|
4236
4255
|
n,
|
|
4237
4256
|
"network-request-failed"
|
|
4238
4257
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4239
4258
|
));
|
|
4240
|
-
},
|
|
4259
|
+
}, Ni(`${Oi()}?onload=${c}`).catch((a) => t(a));
|
|
4241
4260
|
}
|
|
4242
4261
|
}).catch((e) => {
|
|
4243
4262
|
throw fe = null, e;
|
|
4244
4263
|
});
|
|
4245
4264
|
}
|
|
4246
4265
|
let fe = null;
|
|
4247
|
-
function
|
|
4248
|
-
return fe = fe ||
|
|
4266
|
+
function Nr(n) {
|
|
4267
|
+
return fe = fe || Cr(n), fe;
|
|
4249
4268
|
}
|
|
4250
4269
|
/**
|
|
4251
4270
|
* @license
|
|
@@ -4263,7 +4282,7 @@ function Pr(n) {
|
|
|
4263
4282
|
* See the License for the specific language governing permissions and
|
|
4264
4283
|
* limitations under the License.
|
|
4265
4284
|
*/
|
|
4266
|
-
const
|
|
4285
|
+
const Or = new oe(5e3, 15e3), Lr = "__/auth/iframe", Mr = "emulator/auth/iframe", Ur = {
|
|
4267
4286
|
style: {
|
|
4268
4287
|
position: "absolute",
|
|
4269
4288
|
top: "-100px",
|
|
@@ -4272,13 +4291,13 @@ const Cr = new oe(5e3, 15e3), Nr = "__/auth/iframe", Or = "emulator/auth/iframe"
|
|
|
4272
4291
|
},
|
|
4273
4292
|
"aria-hidden": "true",
|
|
4274
4293
|
tabindex: "-1"
|
|
4275
|
-
},
|
|
4294
|
+
}, Dr = /* @__PURE__ */ new Map([
|
|
4276
4295
|
["identitytoolkit.googleapis.com", "p"],
|
|
4277
4296
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4278
4297
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4279
4298
|
// test
|
|
4280
4299
|
]);
|
|
4281
|
-
function
|
|
4300
|
+
function xr(n) {
|
|
4282
4301
|
const e = n.config;
|
|
4283
4302
|
u(
|
|
4284
4303
|
e.authDomain,
|
|
@@ -4286,17 +4305,17 @@ function Ur(n) {
|
|
|
4286
4305
|
"auth-domain-config-required"
|
|
4287
4306
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4288
4307
|
);
|
|
4289
|
-
const t = e.emulator ? je(e,
|
|
4308
|
+
const t = e.emulator ? je(e, Mr) : `https://${n.config.authDomain}/${Lr}`, i = {
|
|
4290
4309
|
apiKey: e.apiKey,
|
|
4291
4310
|
appName: n.name,
|
|
4292
4311
|
v: re
|
|
4293
|
-
}, r =
|
|
4312
|
+
}, r = Dr.get(n.config.apiHost);
|
|
4294
4313
|
r && (i.eid = r);
|
|
4295
4314
|
const s = n._getFrameworks();
|
|
4296
4315
|
return s.length && (i.fw = s.join(",")), `${t}?${se(i).slice(1)}`;
|
|
4297
4316
|
}
|
|
4298
|
-
async function
|
|
4299
|
-
const e = await
|
|
4317
|
+
async function Fr(n) {
|
|
4318
|
+
const e = await Nr(n), t = E().gapi;
|
|
4300
4319
|
return u(
|
|
4301
4320
|
t,
|
|
4302
4321
|
n,
|
|
@@ -4304,24 +4323,24 @@ async function Dr(n) {
|
|
|
4304
4323
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4305
4324
|
), e.open({
|
|
4306
4325
|
where: document.body,
|
|
4307
|
-
url:
|
|
4326
|
+
url: xr(n),
|
|
4308
4327
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4309
|
-
attributes:
|
|
4328
|
+
attributes: Ur,
|
|
4310
4329
|
dontclear: !0
|
|
4311
4330
|
}, (i) => new Promise(async (r, s) => {
|
|
4312
4331
|
await i.restyle({
|
|
4313
4332
|
// Prevent iframe from closing on mouse out.
|
|
4314
4333
|
setHideOnLeave: !1
|
|
4315
4334
|
});
|
|
4316
|
-
const o =
|
|
4335
|
+
const o = b(
|
|
4317
4336
|
n,
|
|
4318
4337
|
"network-request-failed"
|
|
4319
4338
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4320
|
-
), c =
|
|
4339
|
+
), c = E().setTimeout(() => {
|
|
4321
4340
|
s(o);
|
|
4322
|
-
},
|
|
4341
|
+
}, Or.get());
|
|
4323
4342
|
function a() {
|
|
4324
|
-
|
|
4343
|
+
E().clearTimeout(c), r(i);
|
|
4325
4344
|
}
|
|
4326
4345
|
i.ping(a).then(a, () => {
|
|
4327
4346
|
s(o);
|
|
@@ -4344,12 +4363,12 @@ async function Dr(n) {
|
|
|
4344
4363
|
* See the License for the specific language governing permissions and
|
|
4345
4364
|
* limitations under the License.
|
|
4346
4365
|
*/
|
|
4347
|
-
const
|
|
4366
|
+
const Vr = {
|
|
4348
4367
|
location: "yes",
|
|
4349
4368
|
resizable: "yes",
|
|
4350
4369
|
statusbar: "yes",
|
|
4351
4370
|
toolbar: "no"
|
|
4352
|
-
},
|
|
4371
|
+
}, $r = 500, Hr = 600, jr = "_blank", Wr = "http://localhost";
|
|
4353
4372
|
class pt {
|
|
4354
4373
|
constructor(e) {
|
|
4355
4374
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4362,33 +4381,33 @@ class pt {
|
|
|
4362
4381
|
}
|
|
4363
4382
|
}
|
|
4364
4383
|
}
|
|
4365
|
-
function
|
|
4384
|
+
function Gr(n, e, t, i = $r, r = Hr) {
|
|
4366
4385
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4367
4386
|
let c = "";
|
|
4368
|
-
const a = Object.assign(Object.assign({},
|
|
4387
|
+
const a = Object.assign(Object.assign({}, Vr), {
|
|
4369
4388
|
width: i.toString(),
|
|
4370
4389
|
height: r.toString(),
|
|
4371
4390
|
top: s,
|
|
4372
4391
|
left: o
|
|
4373
|
-
}), l =
|
|
4374
|
-
t && (c = Ft(l) ?
|
|
4375
|
-
const d = Object.entries(a).reduce((
|
|
4376
|
-
if (
|
|
4377
|
-
return
|
|
4378
|
-
const
|
|
4392
|
+
}), l = w().toLowerCase();
|
|
4393
|
+
t && (c = Ft(l) ? jr : t), xt(l) && (e = e || Wr, a.scrollbars = "yes");
|
|
4394
|
+
const d = Object.entries(a).reduce((h, [y, _]) => `${h}${y}=${_},`, "");
|
|
4395
|
+
if (Ti(l) && c !== "_self")
|
|
4396
|
+
return Br(e || "", c), new pt(null);
|
|
4397
|
+
const m = window.open(e || "", c, d);
|
|
4379
4398
|
u(
|
|
4380
|
-
|
|
4399
|
+
m,
|
|
4381
4400
|
n,
|
|
4382
4401
|
"popup-blocked"
|
|
4383
4402
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
4384
4403
|
);
|
|
4385
4404
|
try {
|
|
4386
|
-
|
|
4405
|
+
m.focus();
|
|
4387
4406
|
} catch {
|
|
4388
4407
|
}
|
|
4389
|
-
return new pt(
|
|
4408
|
+
return new pt(m);
|
|
4390
4409
|
}
|
|
4391
|
-
function
|
|
4410
|
+
function Br(n, e) {
|
|
4392
4411
|
const t = document.createElement("a");
|
|
4393
4412
|
t.href = n, t.target = e;
|
|
4394
4413
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4410,7 +4429,7 @@ function Wr(n, e) {
|
|
|
4410
4429
|
* See the License for the specific language governing permissions and
|
|
4411
4430
|
* limitations under the License.
|
|
4412
4431
|
*/
|
|
4413
|
-
const
|
|
4432
|
+
const zr = "__/auth/handler", qr = "emulator/auth/handler", Kr = encodeURIComponent("fac");
|
|
4414
4433
|
async function mt(n, e, t, i, r, s) {
|
|
4415
4434
|
u(
|
|
4416
4435
|
n.config.authDomain,
|
|
@@ -4432,23 +4451,23 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4432
4451
|
eventId: r
|
|
4433
4452
|
};
|
|
4434
4453
|
if (e instanceof qt) {
|
|
4435
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4436
|
-
for (const [d,
|
|
4437
|
-
o[d] =
|
|
4454
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", On(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4455
|
+
for (const [d, m] of Object.entries({}))
|
|
4456
|
+
o[d] = m;
|
|
4438
4457
|
}
|
|
4439
4458
|
if (e instanceof ae) {
|
|
4440
|
-
const d = e.getScopes().filter((
|
|
4459
|
+
const d = e.getScopes().filter((m) => m !== "");
|
|
4441
4460
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4442
4461
|
}
|
|
4443
4462
|
n.tenantId && (o.tid = n.tenantId);
|
|
4444
4463
|
const c = o;
|
|
4445
4464
|
for (const d of Object.keys(c))
|
|
4446
4465
|
c[d] === void 0 && delete c[d];
|
|
4447
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4448
|
-
return `${
|
|
4466
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Kr}=${encodeURIComponent(a)}` : "";
|
|
4467
|
+
return `${Jr(n)}?${se(c).slice(1)}${l}`;
|
|
4449
4468
|
}
|
|
4450
|
-
function
|
|
4451
|
-
return n.emulator ? je(n,
|
|
4469
|
+
function Jr({ config: n }) {
|
|
4470
|
+
return n.emulator ? je(n, qr) : `https://${n.authDomain}/${zr}`;
|
|
4452
4471
|
}
|
|
4453
4472
|
/**
|
|
4454
4473
|
* @license
|
|
@@ -4466,23 +4485,23 @@ function qr({ config: n }) {
|
|
|
4466
4485
|
* See the License for the specific language governing permissions and
|
|
4467
4486
|
* limitations under the License.
|
|
4468
4487
|
*/
|
|
4469
|
-
const
|
|
4470
|
-
class
|
|
4488
|
+
const Ne = "webStorageSupport";
|
|
4489
|
+
class Yr {
|
|
4471
4490
|
constructor() {
|
|
4472
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn =
|
|
4491
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn = yr, this._overrideRedirectResult = _r;
|
|
4473
4492
|
}
|
|
4474
4493
|
// Wrapping in async even though we don't await anywhere in order
|
|
4475
4494
|
// to make sure errors are raised as promise rejections
|
|
4476
4495
|
async _openPopup(e, t, i, r) {
|
|
4477
4496
|
var s;
|
|
4478
4497
|
L((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4479
|
-
const o = await mt(e, t, i,
|
|
4480
|
-
return
|
|
4498
|
+
const o = await mt(e, t, i, Me(), r);
|
|
4499
|
+
return Gr(e, o, ze());
|
|
4481
4500
|
}
|
|
4482
4501
|
async _openRedirect(e, t, i, r) {
|
|
4483
4502
|
await this._originValidation(e);
|
|
4484
|
-
const s = await mt(e, t, i,
|
|
4485
|
-
return
|
|
4503
|
+
const s = await mt(e, t, i, Me(), r);
|
|
4504
|
+
return Zi(s), new Promise(() => {
|
|
4486
4505
|
});
|
|
4487
4506
|
}
|
|
4488
4507
|
_initialize(e) {
|
|
@@ -4497,7 +4516,7 @@ class Kr {
|
|
|
4497
4516
|
}), i;
|
|
4498
4517
|
}
|
|
4499
4518
|
async initAndGetManager(e) {
|
|
4500
|
-
const t = await
|
|
4519
|
+
const t = await Fr(e), i = new Tr(e);
|
|
4501
4520
|
return t.register("authEvent", (r) => (u(
|
|
4502
4521
|
r == null ? void 0 : r.authEvent,
|
|
4503
4522
|
e,
|
|
@@ -4509,9 +4528,9 @@ class Kr {
|
|
|
4509
4528
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: i }, this.iframes[e._key()] = t, i;
|
|
4510
4529
|
}
|
|
4511
4530
|
_isIframeWebStorageSupported(e, t) {
|
|
4512
|
-
this.iframes[e._key()].send(
|
|
4531
|
+
this.iframes[e._key()].send(Ne, { type: Ne }, (r) => {
|
|
4513
4532
|
var s;
|
|
4514
|
-
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[
|
|
4533
|
+
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
4515
4534
|
o !== void 0 && t(!!o), O(
|
|
4516
4535
|
e,
|
|
4517
4536
|
"internal-error"
|
|
@@ -4521,13 +4540,13 @@ class Kr {
|
|
|
4521
4540
|
}
|
|
4522
4541
|
_originValidation(e) {
|
|
4523
4542
|
const t = e._key();
|
|
4524
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4543
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Rr(e)), this.originValidationPromises[t];
|
|
4525
4544
|
}
|
|
4526
4545
|
get _shouldInitProactively() {
|
|
4527
|
-
return Wt() || Ge() ||
|
|
4546
|
+
return Wt() || Ge() || ke();
|
|
4528
4547
|
}
|
|
4529
4548
|
}
|
|
4530
|
-
const
|
|
4549
|
+
const Xr = Yr;
|
|
4531
4550
|
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4532
4551
|
/**
|
|
4533
4552
|
* @license
|
|
@@ -4545,7 +4564,7 @@ var gt = "@firebase/auth", _t = "1.7.5";
|
|
|
4545
4564
|
* See the License for the specific language governing permissions and
|
|
4546
4565
|
* limitations under the License.
|
|
4547
4566
|
*/
|
|
4548
|
-
class
|
|
4567
|
+
class Qr {
|
|
4549
4568
|
constructor(e) {
|
|
4550
4569
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4551
4570
|
}
|
|
@@ -4596,7 +4615,7 @@ class Yr {
|
|
|
4596
4615
|
* See the License for the specific language governing permissions and
|
|
4597
4616
|
* limitations under the License.
|
|
4598
4617
|
*/
|
|
4599
|
-
function
|
|
4618
|
+
function Zr(n) {
|
|
4600
4619
|
switch (n) {
|
|
4601
4620
|
case "Node":
|
|
4602
4621
|
return "node";
|
|
@@ -4612,7 +4631,7 @@ function Xr(n) {
|
|
|
4612
4631
|
return;
|
|
4613
4632
|
}
|
|
4614
4633
|
}
|
|
4615
|
-
function
|
|
4634
|
+
function es(n) {
|
|
4616
4635
|
Ze(new et(
|
|
4617
4636
|
"auth",
|
|
4618
4637
|
(e, { options: t }) => {
|
|
@@ -4626,8 +4645,8 @@ function Qr(n) {
|
|
|
4626
4645
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4627
4646
|
apiScheme: "https",
|
|
4628
4647
|
sdkClientVersion: Gt(n)
|
|
4629
|
-
}, l = new
|
|
4630
|
-
return
|
|
4648
|
+
}, l = new Pi(i, r, s, a);
|
|
4649
|
+
return Ui(l, t), l;
|
|
4631
4650
|
},
|
|
4632
4651
|
"PUBLIC"
|
|
4633
4652
|
/* ComponentType.PUBLIC */
|
|
@@ -4642,18 +4661,18 @@ function Qr(n) {
|
|
|
4642
4661
|
})), Ze(new et(
|
|
4643
4662
|
"auth-internal",
|
|
4644
4663
|
(e) => {
|
|
4645
|
-
const t =
|
|
4664
|
+
const t = be(e.getProvider(
|
|
4646
4665
|
"auth"
|
|
4647
4666
|
/* _ComponentName.AUTH */
|
|
4648
4667
|
).getImmediate());
|
|
4649
|
-
return ((i) => new
|
|
4668
|
+
return ((i) => new Qr(i))(t);
|
|
4650
4669
|
},
|
|
4651
4670
|
"PRIVATE"
|
|
4652
4671
|
/* ComponentType.PRIVATE */
|
|
4653
4672
|
).setInstantiationMode(
|
|
4654
4673
|
"EXPLICIT"
|
|
4655
4674
|
/* InstantiationMode.EXPLICIT */
|
|
4656
|
-
)),
|
|
4675
|
+
)), Le(gt, _t, Zr(n)), Le(gt, _t, "esm2017");
|
|
4657
4676
|
}
|
|
4658
4677
|
/**
|
|
4659
4678
|
* @license
|
|
@@ -4671,11 +4690,11 @@ function Qr(n) {
|
|
|
4671
4690
|
* See the License for the specific language governing permissions and
|
|
4672
4691
|
* limitations under the License.
|
|
4673
4692
|
*/
|
|
4674
|
-
const
|
|
4693
|
+
const ts = 5 * 60, ns = kt("authIdTokenMaxAge") || ts;
|
|
4675
4694
|
let vt = null;
|
|
4676
|
-
const
|
|
4695
|
+
const is = (n) => async (e) => {
|
|
4677
4696
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4678
|
-
if (i && i >
|
|
4697
|
+
if (i && i > ns)
|
|
4679
4698
|
return;
|
|
4680
4699
|
const r = t == null ? void 0 : t.token;
|
|
4681
4700
|
vt !== r && (vt = r, await fetch(n, {
|
|
@@ -4685,104 +4704,104 @@ const ts = (n) => async (e) => {
|
|
|
4685
4704
|
} : {}
|
|
4686
4705
|
}));
|
|
4687
4706
|
};
|
|
4688
|
-
function
|
|
4689
|
-
const e =
|
|
4707
|
+
function rs(n = An()) {
|
|
4708
|
+
const e = bt(n, "auth");
|
|
4690
4709
|
if (e.isInitialized())
|
|
4691
4710
|
return e.getImmediate();
|
|
4692
|
-
const t =
|
|
4693
|
-
popupRedirectResolver:
|
|
4711
|
+
const t = Mi(n, {
|
|
4712
|
+
popupRedirectResolver: Xr,
|
|
4694
4713
|
persistence: [
|
|
4695
|
-
|
|
4696
|
-
|
|
4714
|
+
cr,
|
|
4715
|
+
Yi,
|
|
4697
4716
|
Qt
|
|
4698
4717
|
]
|
|
4699
4718
|
}), i = kt("authTokenSyncURL");
|
|
4700
4719
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4701
4720
|
const s = new URL(i, location.origin);
|
|
4702
4721
|
if (location.origin === s.origin) {
|
|
4703
|
-
const o =
|
|
4704
|
-
|
|
4722
|
+
const o = is(s.toString());
|
|
4723
|
+
zi(t, o, () => o(t.currentUser)), Bi(t, (c) => o(c));
|
|
4705
4724
|
}
|
|
4706
4725
|
}
|
|
4707
|
-
const r =
|
|
4708
|
-
return r &&
|
|
4726
|
+
const r = Rn("auth");
|
|
4727
|
+
return r && Di(t, `http://${r}`), t;
|
|
4709
4728
|
}
|
|
4710
|
-
function
|
|
4729
|
+
function ss() {
|
|
4711
4730
|
var n, e;
|
|
4712
4731
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4713
4732
|
}
|
|
4714
|
-
|
|
4733
|
+
Ci({
|
|
4715
4734
|
loadJS(n) {
|
|
4716
4735
|
return new Promise((e, t) => {
|
|
4717
4736
|
const i = document.createElement("script");
|
|
4718
4737
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4719
|
-
const s =
|
|
4738
|
+
const s = b(
|
|
4720
4739
|
"internal-error"
|
|
4721
4740
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4722
4741
|
);
|
|
4723
4742
|
s.customData = r, t(s);
|
|
4724
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4743
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", ss().appendChild(i);
|
|
4725
4744
|
});
|
|
4726
4745
|
},
|
|
4727
4746
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4728
4747
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4729
4748
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4730
4749
|
});
|
|
4731
|
-
|
|
4750
|
+
es(
|
|
4732
4751
|
"Browser"
|
|
4733
4752
|
/* ClientPlatform.BROWSER */
|
|
4734
4753
|
);
|
|
4735
|
-
var
|
|
4736
|
-
const
|
|
4754
|
+
var os = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" }, as = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
4755
|
+
const cs = {
|
|
4737
4756
|
key: 2,
|
|
4738
4757
|
class: "h-full w-full"
|
|
4739
|
-
},
|
|
4758
|
+
}, ls = ["src"], Ss = /* @__PURE__ */ xe({
|
|
4740
4759
|
__name: "App",
|
|
4741
4760
|
setup(n) {
|
|
4742
|
-
const e =
|
|
4743
|
-
const
|
|
4744
|
-
return `${
|
|
4761
|
+
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), m = ne(() => i.version), h = ne(() => {
|
|
4762
|
+
const p = e.currentCountry.value || "MY", I = tt.getIdToken(), T = l.value._id;
|
|
4763
|
+
return `${as.marketingV1Portal}/b/${T}/marketing/overview?showHeader=false&country=${p}&token=${I}`;
|
|
4745
4764
|
});
|
|
4746
|
-
async function
|
|
4747
|
-
if (
|
|
4765
|
+
async function y() {
|
|
4766
|
+
if (Ln().length) {
|
|
4748
4767
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4749
4768
|
return;
|
|
4750
4769
|
}
|
|
4751
|
-
const
|
|
4752
|
-
await
|
|
4770
|
+
const p = Mn(os.firebase), I = await fn.getCustomToken(), T = rs();
|
|
4771
|
+
await Gi(T, I), Un(p), console.log("initFirebase", p);
|
|
4753
4772
|
}
|
|
4754
|
-
const
|
|
4755
|
-
d.value = !1, await
|
|
4773
|
+
const _ = async () => {
|
|
4774
|
+
d.value = !1, await dn(), console.log("forceRerender"), tt.setBusinessId(l.value._id), await i.readPremium(), !a.value && m.value === "v2" ? e.registerSidebarComponent(Vn) : e.hideSidebarToggle(!0), await y(), a.value = !0, d.value = !0;
|
|
4756
4775
|
};
|
|
4757
|
-
return
|
|
4758
|
-
if (
|
|
4759
|
-
const
|
|
4760
|
-
|
|
4776
|
+
return un(() => {
|
|
4777
|
+
if (Dn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4778
|
+
const p = document.getElementsByClassName("app-header")[0], I = document.getElementsByClassName("app-sidebar")[0], T = document.getElementsByClassName("app-container")[0], M = document.getElementsByTagName("main")[0];
|
|
4779
|
+
p == null || p.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);
|
|
4761
4780
|
}
|
|
4762
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4763
|
-
}),
|
|
4781
|
+
l.value != null && (console.log("App mounted, forceRerender"), _());
|
|
4782
|
+
}), pe(
|
|
4764
4783
|
() => e.currentBusiness.value,
|
|
4765
|
-
async (
|
|
4766
|
-
console.log("Current business changed"),
|
|
4784
|
+
async (p, I) => {
|
|
4785
|
+
console.log("Current business changed"), p != null && p._id != I._id && (console.log("forceRerender when business changes", p, I), _());
|
|
4767
4786
|
}
|
|
4768
|
-
), (
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
S(
|
|
4773
|
-
json: { url:
|
|
4787
|
+
), (p, I) => (j(), me(It, null, [
|
|
4788
|
+
g(d) && g(m) === "v2" ? (j(), Oe(g(hn), { key: 0 })) : Pe("", !0),
|
|
4789
|
+
g(d) && g(m) === "v2" && g(c) ? (j(), Oe(ii, { key: 1 })) : Pe("", !0),
|
|
4790
|
+
g(d) && g(m) !== "v2" ? (j(), me("div", cs, [
|
|
4791
|
+
S(wn, {
|
|
4792
|
+
json: { url: g(h) }
|
|
4774
4793
|
}, null, 8, ["json"]),
|
|
4775
|
-
|
|
4794
|
+
v("iframe", {
|
|
4776
4795
|
allow: "clipboard-read; clipboard-write",
|
|
4777
4796
|
frameBorder: "0",
|
|
4778
4797
|
height: "100%",
|
|
4779
4798
|
width: "100%",
|
|
4780
|
-
src:
|
|
4781
|
-
}, null, 8,
|
|
4782
|
-
])) :
|
|
4799
|
+
src: g(h)
|
|
4800
|
+
}, null, 8, ls)
|
|
4801
|
+
])) : Pe("", !0)
|
|
4783
4802
|
], 64));
|
|
4784
4803
|
}
|
|
4785
4804
|
});
|
|
4786
4805
|
export {
|
|
4787
|
-
|
|
4806
|
+
Ss as default
|
|
4788
4807
|
};
|