@feedmepos/mf-connect 0.1.116-dev → 0.1.117-dev
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/README.md +42 -44
- package/dist/{App-DWDgsBqW.js → App-BpcsgH7K.js} +380 -397
- package/dist/{AuditLogs-BqEtvKFs.js → AuditLogs-BNnUiVnD.js} +12 -12
- package/dist/{Bin-Cz6fmewG.js → Bin-Cm0wjQeR.js} +8 -8
- package/dist/{Broadcast-CQ0pfKpx.js → Broadcast-BoJaHqnO.js} +12 -12
- package/dist/{CampaignAnalytic-CiRCB3kh.js → CampaignAnalytic-Eg4xZW0B.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bp7UeQWJ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BXylK6Ze.js} +8 -8
- package/dist/{Card-Kw2PFL2m.js → Card-BfkMcFaG.js} +22 -22
- package/dist/{Collections-D8Vx_EEH.js → Collections-RXmxQbII.js} +8 -8
- package/dist/{Credit-B1jsQ5zg.js → Credit-CsRPM1jv.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B6Fpf8zy.js → DateRangeChip.vue_vue_type_script_setup_true_lang-D2tvK7pw.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BW1RntIP.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BgPeHurN.js} +35 -35
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Cdpr9Ku4.js → EffectSheet.vue_vue_type_style_index_0_lang-CUx8UIIq.js} +6 -6
- package/dist/{Experience-B0JIA3sL.js → Experience-BC8Pj-v9.js} +13 -13
- package/dist/{FileSaver.min-M-9kTN8q.js → FileSaver.min-DzmoQFA0.js} +1 -1
- package/dist/{Game-CNJyqnK3.js → Game-DJXNHFBs.js} +13 -13
- package/dist/{GiftCardSetup-DSQIC7fD.js → GiftCardSetup-_0n8lU-t.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-ABiLOF1j.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-C-AiJdui.js} +7 -7
- package/dist/{Goals-DBPzGIRK.js → Goals-DSZwKpds.js} +4 -4
- package/dist/{Grab-CGWinKBS.js → Grab-DDc7e-AC.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B2edB52s.js → ImageInput.vue_vue_type_script_setup_true_lang-BZb-H4fM.js} +1 -1
- package/dist/{Index-CiWyZXnK.js → Index-Cbi0bquE.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DnP03_b7.js → LocationPicker.vue_vue_type_script_setup_true_lang-GLhMtvzi.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DM17LaNE.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bt9CO_QR.js} +1 -1
- package/dist/{LoyaltyDashboard-C4ZlK9Hv.js → LoyaltyDashboard-fK90c27A.js} +15 -15
- package/dist/{MainLayout-D22Q2_jN.js → MainLayout-Bf-l9yL4.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-CJncINki.js → MainLayout.vue_vue_type_script_setup_true_lang-COR6YYYI.js} +3 -3
- package/dist/{Marketing-CmVnvEN6.js → Marketing-B7cZGsO-.js} +4 -4
- package/dist/{MarketingMaterialEdit-CQ55zG-W.js → MarketingMaterialEdit-5IcV2ct6.js} +6 -6
- package/dist/{Member-B-l5P9jk.js → Member-BGTrRVdq.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C_ZjHH4I.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DJr2hV2W.js} +23 -23
- package/dist/{MemberImportHistory-BJcu-ahG.js → MemberImportHistory--FxkTJmu.js} +7 -7
- package/dist/{MemberList-DVsWNWIc.js → MemberList-EjY5dgwt.js} +14 -14
- package/dist/{MemberTransactions-C2VPySEO.js → MemberTransactions-Oia7LIFK.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BXqrn9tg.js → MessageInput.vue_vue_type_script_setup_true_lang-CLOQZCYy.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BouFp66T.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Ev3bB8cg.js} +1 -1
- package/dist/{Mission-DWO-IF0f.js → Mission-BFHYb4aT.js} +14 -14
- package/dist/{Overview-DPcWm2S0.js → Overview-BVNyQxFL.js} +20 -20
- package/dist/{Overview-Dbp4Sv-H.js → Overview-d5U37aot.js} +4 -4
- package/dist/{Point-PnWrzVOY.js → Point-CXkqH02Z.js} +14 -14
- package/dist/{Promotion-Bwpi60dN.js → Promotion-DdxNvlOO.js} +14 -14
- package/dist/{Queue-BvEcKyVJ.js → Queue-C96oNKyP.js} +12 -12
- package/dist/{Record-DzNvU2fM.js → Record-Bj2e2Y4i.js} +9 -9
- package/dist/{Review-HDYwnMd6.js → Review-CJK5S1oI.js} +2 -2
- package/dist/{ReviewFacebookCallback-rAlgcTQ_.js → ReviewFacebookCallback-ChG7TRy5.js} +5 -5
- package/dist/{ReviewGoogleCallback-6V9JNKsl.js → ReviewGoogleCallback-Dmk4VyGA.js} +5 -5
- package/dist/{Reward-DI6IyG-d.js → Reward-Dh2YI0Xb.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DFAIPMe7.js → RewardGroup.vue_vue_type_script_setup_true_lang-U47m3AAn.js} +13 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CDoba0oG.js → RuleGroup.vue_vue_type_script_setup_true_lang-2L6ZGMW7.js} +14 -14
- package/dist/{Segment-DrV6pQyx.js → Segment-FYvtCkqH.js} +25 -25
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CXHt_ZeT.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPZZz2e0.js} +14 -14
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-XRXkLy6j.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8wBgLlS.js} +4 -4
- package/dist/{Setting-aLQCUCP9.js → Setting-CUAWjCqa.js} +14 -14
- package/dist/{SettingAdvertisements-BtqKt4Ca.js → SettingAdvertisements-COIQwUD6.js} +12 -12
- package/dist/{Settings-BkYtKb4l.js → Settings-D2gFPvmW.js} +5 -5
- package/dist/{Store-HZs9GG03.js → Store-BAXwiyvx.js} +26 -26
- package/dist/{StoreRewards-BSTXL4FR.js → StoreRewards-2mUavtUg.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D9nykzc3.js → StoreTransactions.vue_vue_type_script_setup_true_lang-5g3yIL1a.js} +24 -24
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DBnHk6jn.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DHi4rdT1.js} +2 -2
- package/dist/{Tier-Ka0rbjC_.js → Tier-BmAOzRHL.js} +26 -26
- package/dist/{Title-7jvrf34J.js → Title-DMxiUg30.js} +22 -22
- package/dist/{Transaction-D-M3udf5.js → Transaction-CF6hXEpN.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CrlpuElX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BON_t0dL.js} +6 -6
- package/dist/{Voucher-BZCLPyDk.js → Voucher-DrtITxq-.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-C_MOMFkX.js → VoucherEditor.vue_vue_type_script_setup_true_lang-1DZOzJKx.js} +12 -12
- package/dist/{WhatsappAccount-BG0dIroG.js → WhatsappAccount-Bb0Y7ikk.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Co05OXon.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CPlyzkp4.js} +1 -1
- package/dist/{WhatsappBot-O5h5UKXz.js → WhatsappBot-DNvvaPey.js} +6 -6
- package/dist/{WhatsappBotLogs-BOPTuu6o.js → WhatsappBotLogs-C8M-1pvv.js} +6 -6
- package/dist/{WhatsappBotSettings-BSiIvpGO.js → WhatsappBotSettings-D6egqUyU.js} +4 -4
- package/dist/WhatsappLayout-DeQTPuF6.js +21 -0
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DJdi7dV6.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DI0pcHcE.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Do4GTTKx.js → ZodTextField.vue_vue_type_script_setup_true_lang-CKZscSjU.js} +2 -2
- package/dist/{app-CEe3kSZM.js → app-BjdLqYQq.js} +69 -69
- package/dist/app.js +1 -1
- package/dist/{base.export-BjSdr85q.js → base.export-B68z5BF6.js} +2 -2
- package/dist/{business-CJjiItSo.js → business-D9fgkHxb.js} +1 -1
- package/dist/{campaign-D4MWLs1D.js → campaign-Dw_ujovr.js} +8 -8
- package/dist/{campaign-DEXq52fE.js → campaign-eMaPX8r6.js} +2 -2
- package/dist/{campaign.fn-DiadKjES.js → campaign.fn-DFjGNvmN.js} +20 -20
- package/dist/{collection.fn-CfqIdnSS.js → collection.fn-CCOWtB-c.js} +2 -2
- package/dist/{currency-CPB6E_s-.js → currency-CTLKReFC.js} +1 -1
- package/dist/{duplicateCampaign-BzWvsZwc.js → duplicateCampaign-BcpBfUGL.js} +2 -2
- package/dist/{effect-DFodA5mh.js → effect-CTI1ZH57.js} +1 -1
- package/dist/{email-addresses-C0CwgNs_.js → email-addresses-B74e3bnB.js} +2 -2
- package/dist/{feature-flag-Bap2oi_S.js → feature-flag-DVdEaChJ.js} +156 -140
- package/dist/{helper-DKKsSb2o.js → helper-as9K-piK.js} +1 -1
- package/dist/{index-CJGb1iJi.js → index-3LjKJhQa.js} +1 -1
- package/dist/{index-DDmpyI6z.js → index-8mBfDn3M.js} +7 -7
- package/dist/{index-CFZMwKR6.js → index-B0h0iYWP.js} +2 -2
- package/dist/{index-BS6725ZB.js → index-BEKMTiFb.js} +3 -3
- package/dist/{index-CXqPYmyv.js → index-BW7FoVEA.js} +1 -1
- package/dist/{index-BWsGYTzB.js → index-B_wRpO02.js} +2 -2
- package/dist/{index-CEFEuMOF.js → index-Ba719MYq.js} +1 -1
- package/dist/{index-DxmlvoHV.js → index-BbVbqe4Y.js} +2 -2
- package/dist/{index-C_4eW8Sr.js → index-BhTrG89b.js} +4 -4
- package/dist/{index-D5veZ8LP.js → index-C5V6u2Qd.js} +2 -2
- package/dist/{index-DRnUcSVN.js → index-CHU3UePP.js} +1 -1
- package/dist/{index-CfqmNZUH.js → index-CQxkDpX0.js} +4 -4
- package/dist/{index-RUdMURTx.js → index-CWLOcQ6j.js} +8 -8
- package/dist/{index-CtwPthW5.js → index-Ckz6u3ac.js} +2 -2
- package/dist/{index-BJCirs9i.js → index-Czg-2Ni0.js} +3 -3
- package/dist/{index-qAQiQd-s.js → index-DKI8401o.js} +2 -2
- package/dist/{index-4LQanFJi.js → index-DcZiikOH.js} +2 -2
- package/dist/{index-BdGo-qgB.js → index-QHqcSN2q.js} +1 -1
- package/dist/{index-DFV2ydYE.js → index-TAoQpeLQ.js} +1 -1
- package/dist/{index-C1C21iKU.js → index-wsCCqwdr.js} +1 -1
- package/dist/{index.esm2017-i1myv90H.js → index.esm2017-DL6rTGDW.js} +1 -1
- package/dist/{loading-BAFiJnEb.js → loading-x6IScY4K.js} +1 -1
- package/dist/{lodash-De2KDgqX.js → lodash-nwnDizYo.js} +1 -1
- package/dist/{member-import-BP4RZGbA.js → member-import-C-b01Tyd.js} +1 -1
- package/dist/{membership-CQWw-rTa.js → membership-DfarOMtO.js} +2 -2
- package/dist/{money-rwjWYzdi.js → money-CFn-jR4W.js} +1 -1
- package/dist/{number-DwSvkBpS.js → number-CSlyDL2x.js} +1 -1
- package/dist/objectid-zcT6ESET.js +145 -0
- package/dist/{onboarding-u7cpl6k3.js → onboarding-DyaFaaF2.js} +3 -3
- package/dist/{onboardingSetup-DoxDlcVN.js → onboardingSetup-DQt91O9f.js} +2 -2
- package/dist/{plugins-CKaeoHSK.js → plugins-DEHr0UOe.js} +3 -3
- package/dist/{reward-BasbGRWt.js → reward-Du_Pv-4p.js} +1 -1
- package/dist/{rule-IN41b-qE.js → rule-DfqmQTVK.js} +9 -9
- package/dist/{template-3Nu_MAMG.js → template-CcbNF4PF.js} +6 -6
- package/dist/{timezone-C68y8HiI.js → timezone-_4tabIaK.js} +1 -1
- package/dist/{transaction.fn-Ckxm2gof.js → transaction.fn-C46PHwCV.js} +2 -2
- package/dist/{trigger-xA8j3s9B.js → trigger-Dipr6btC.js} +5 -5
- package/dist/{useMarketingMaterialActions-ClYoBaFw.js → useMarketingMaterialActions-BAw2ZjeF.js} +4 -4
- package/dist/{usePagination-CIRxyVr8.js → usePagination-D6RZ18zS.js} +1 -1
- package/dist/{user-PTTQTMyQ.js → user-BCexQj3Q.js} +1 -1
- package/dist/{vue-i18n-DYnrLWFT.js → vue-i18n-DXvyTCZf.js} +109 -109
- package/dist/{xlsx-l0AsOrP1.js → xlsx-BTxt_Jg6.js} +166 -166
- package/dist/{zod-Bm1pKYLC.js → zod-T4wMYjWT.js} +1 -1
- package/package.json +1 -1
- package/dist/WhatsappLayout-DLVIfkzJ.js +0 -21
- package/dist/feature-flag--GbS6Qn_.js +0 -50
- package/dist/objectid-DtEPzPd_.js +0 -145
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { defineComponent as xe, ref as
|
|
2
|
-
import { useRouter as yt, useRoute as wt, RouterView as
|
|
3
|
-
import { useCoreStore as ge, FeedMeAuth as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import
|
|
8
|
-
import "./index-CEFEuMOF.js";
|
|
1
|
+
import { defineComponent as xe, ref as te, h as U, Comment as cn, computed as Y, watch as ie, resolveComponent as ee, openBlock as j, createElementBlock as me, createVNode as S, unref as _, createElementVNode as I, toDisplayString as R, createBlock as Oe, withCtx as Z, 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-D9fgkHxb.js";
|
|
6
|
+
import { F as gn, u as _n, l as vn } from "./feature-flag-DVdEaChJ.js";
|
|
7
|
+
import "./index-Ba719MYq.js";
|
|
9
8
|
import { components as W, useSnackbar as In, useDialog as yn } from "@feedmepos/ui-library";
|
|
10
|
-
import { u as
|
|
11
|
-
import { m as wn } from "./index-
|
|
12
|
-
import { C as Xe } from "./timezone-
|
|
13
|
-
import { u as Tn } from "./onboarding-
|
|
14
|
-
import { R as p, A as kn, a as Qe } from "./app-
|
|
9
|
+
import { u as Tt } from "./vue-i18n-DXvyTCZf.js";
|
|
10
|
+
import { m as wn } from "./index-TAoQpeLQ.js";
|
|
11
|
+
import { C as Xe } from "./timezone-_4tabIaK.js";
|
|
12
|
+
import { u as Tn } from "./onboarding-DyaFaaF2.js";
|
|
13
|
+
import { R as p, A as kn, a as Qe } from "./app-BjdLqYQq.js";
|
|
15
14
|
import { J as bn } from "./JsonViewer-v8_C7l5N.js";
|
|
16
|
-
import { r as Le, L as En, g as
|
|
15
|
+
import { r as Le, L as En, g as kt, i as Sn, a as Rn, _ as Ze, C as et, b as An, S as se, c as A, d as X, E as Fe, e as Pn, f as bt, h as Cn, j as Nn, k as Et, l as w, m as On, F as Ve, n as Ln, q as oe, o as Mn, p as Un, s as Dn, t as xn, u as Fn } from "./index.esm2017-DL6rTGDW.js";
|
|
17
16
|
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
18
|
-
import { S as tt, c as Vn } from "./index-
|
|
17
|
+
import { S as tt, c as Vn } from "./index-DKI8401o.js";
|
|
19
18
|
const $n = { class: "flex flex-col h-full justify-between py-16" }, Hn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Wn = /* @__PURE__ */ xe({
|
|
20
19
|
__name: "NavigationTab",
|
|
21
20
|
setup(n) {
|
|
22
|
-
const { t: e, locale: t } =
|
|
21
|
+
const { t: e, locale: t } = Tt(), i = Tn(), r = _n(), s = te(), o = [
|
|
23
22
|
{
|
|
24
23
|
label: e("connect.navigation.analytic"),
|
|
25
24
|
value: p["$connect-ANALYTIC"]
|
|
@@ -139,7 +138,7 @@ const $n = { class: "flex flex-col h-full justify-between py-16" }, Hn = { class
|
|
|
139
138
|
variant: "numeric",
|
|
140
139
|
inline: !0,
|
|
141
140
|
value: i.goalsRemaining
|
|
142
|
-
}) : U(
|
|
141
|
+
}) : U(cn)
|
|
143
142
|
},
|
|
144
143
|
{
|
|
145
144
|
label: e("connect.navigation.setting"),
|
|
@@ -149,79 +148,79 @@ const $n = { class: "flex flex-col h-full justify-between py-16" }, Hn = { class
|
|
|
149
148
|
label: e("connect.navigation.bin"),
|
|
150
149
|
value: p["$connect-BIN"]
|
|
151
150
|
}
|
|
152
|
-
], c =
|
|
151
|
+
], c = Y(
|
|
153
152
|
() => o.filter(
|
|
154
|
-
(
|
|
153
|
+
(h) => h.value !== p["$connect-WHATSAPP"] || r(gn.whatsappBot) === "on"
|
|
155
154
|
)
|
|
156
|
-
), a = yt(), l = wt(),
|
|
157
|
-
const
|
|
158
|
-
return console.log(`[MF] Timezone set to: ${Xe[
|
|
155
|
+
), a = yt(), l = wt(), d = o.reduce((h, f) => [...(f.children ?? []).map((g) => g.value), ...h, f.value], []), m = ge(), y = Y(() => {
|
|
156
|
+
const h = m.currentCountry.value || "MY";
|
|
157
|
+
return console.log(`[MF] Timezone set to: ${Xe[h]}`), Xe[h];
|
|
159
158
|
});
|
|
160
|
-
|
|
159
|
+
ie(
|
|
161
160
|
// Watch `route.matched`, not `route`: `useRoute()` returns a reactive object
|
|
162
161
|
// whose identity never changes, so watching it directly fired once via
|
|
163
162
|
// `immediate` and the highlight then stayed on whatever page loaded first.
|
|
164
163
|
() => l.matched,
|
|
165
|
-
(
|
|
166
|
-
const
|
|
167
|
-
|
|
164
|
+
(h) => {
|
|
165
|
+
const g = h.map((v) => v.name).reverse().find((v) => d.includes(v));
|
|
166
|
+
g && (s.value = g);
|
|
168
167
|
},
|
|
169
168
|
{ immediate: !0 }
|
|
170
|
-
),
|
|
169
|
+
), ie(
|
|
171
170
|
[() => {
|
|
172
|
-
var
|
|
173
|
-
return (
|
|
171
|
+
var h;
|
|
172
|
+
return (h = m.currentBusiness.value) == null ? void 0 : h._id;
|
|
174
173
|
}, () => l.name, t],
|
|
175
|
-
([
|
|
176
|
-
|
|
174
|
+
([h]) => {
|
|
175
|
+
h && i.read(t.value, h);
|
|
177
176
|
},
|
|
178
177
|
{ immediate: !0 }
|
|
179
178
|
);
|
|
180
|
-
async function
|
|
181
|
-
await a.push({ name:
|
|
179
|
+
async function T(h) {
|
|
180
|
+
await a.push({ name: h });
|
|
182
181
|
}
|
|
183
|
-
return (
|
|
184
|
-
var
|
|
185
|
-
const
|
|
182
|
+
return (h, f) => {
|
|
183
|
+
var v;
|
|
184
|
+
const g = ee("FmCollapsibleTabs");
|
|
186
185
|
return j(), me("div", $n, [
|
|
187
|
-
|
|
186
|
+
S(g, {
|
|
188
187
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
189
|
-
"model-value": (
|
|
188
|
+
"model-value": (v = _(s)) == null ? void 0 : v.toString(),
|
|
190
189
|
items: _(c),
|
|
191
|
-
"onUpdate:modelValue":
|
|
190
|
+
"onUpdate:modelValue": T
|
|
192
191
|
}, null, 8, ["model-value", "items"]),
|
|
193
192
|
I("div", Hn, [
|
|
194
|
-
I("div", null, "Timezone: " +
|
|
195
|
-
I("div", null, "(UTC" +
|
|
193
|
+
I("div", null, "Timezone: " + R(_(y).split("/")[1].replace("_", " ")), 1),
|
|
194
|
+
I("div", null, "(UTC" + R(_(wn).tz(_(y)).format("Z")) + ")", 1)
|
|
196
195
|
])
|
|
197
196
|
]);
|
|
198
197
|
};
|
|
199
198
|
}
|
|
200
|
-
}),
|
|
199
|
+
}), St = "feedme_connect_marketing_promo_hidden";
|
|
201
200
|
function jn() {
|
|
202
201
|
try {
|
|
203
|
-
return localStorage.getItem(
|
|
202
|
+
return localStorage.getItem(St) !== null;
|
|
204
203
|
} catch {
|
|
205
204
|
return !1;
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
|
-
function
|
|
207
|
+
function Gn() {
|
|
209
208
|
try {
|
|
210
|
-
localStorage.setItem(
|
|
209
|
+
localStorage.setItem(St, (/* @__PURE__ */ new Date()).toISOString());
|
|
211
210
|
} catch {
|
|
212
211
|
}
|
|
213
212
|
}
|
|
214
|
-
const
|
|
213
|
+
const Bn = { class: "flex flex-col gap-12" }, zn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, qn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Kn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, Jn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, Yn = { class: "flex flex-col gap-24 pb-8" }, Xn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, Qn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Zn = { class: "fm-typo-en-body-lg-600" }, ei = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ti = { class: "shrink-0" }, ni = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ii = { class: "flex w-full flex-col gap-12 px-[16px]" }, ri = { class: "flex flex-wrap items-center gap-12" }, si = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, oi = /* @__PURE__ */ xe({
|
|
215
214
|
__name: "AiMarketingPromoDialog",
|
|
216
215
|
setup(n) {
|
|
217
216
|
let e = !1;
|
|
218
|
-
const { t } =
|
|
217
|
+
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } = ge(), o = te(!1), c = [
|
|
219
218
|
{ key: "completeContent", icon: "layers" },
|
|
220
219
|
{ key: "realContext", icon: "storefront" },
|
|
221
220
|
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
222
|
-
], a =
|
|
223
|
-
var
|
|
224
|
-
const
|
|
221
|
+
], a = Y(() => {
|
|
222
|
+
var h;
|
|
223
|
+
const T = ((h = r.value) == null ? void 0 : h.permissions) ?? [];
|
|
225
224
|
return kn(
|
|
226
225
|
[
|
|
227
226
|
{
|
|
@@ -229,106 +228,106 @@ const Gn = { class: "flex flex-col gap-12" }, zn = { class: "fm-corner-radius-xx
|
|
|
229
228
|
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
230
229
|
}
|
|
231
230
|
],
|
|
232
|
-
|
|
231
|
+
T
|
|
233
232
|
).granted;
|
|
234
|
-
}), l =
|
|
233
|
+
}), l = Y(
|
|
235
234
|
() => s.value === "MY" && a.value
|
|
236
235
|
);
|
|
237
|
-
let
|
|
238
|
-
|
|
236
|
+
let d = !1;
|
|
237
|
+
ie(
|
|
239
238
|
l,
|
|
240
|
-
(
|
|
241
|
-
|
|
239
|
+
(T) => {
|
|
240
|
+
d || !T || (d = !0, !(jn() || e) && (e = !0, o.value = !0));
|
|
242
241
|
},
|
|
243
242
|
{ immediate: !0 }
|
|
244
243
|
);
|
|
245
244
|
async function m() {
|
|
246
245
|
o.value = !1, await i.push({ name: p["$connect-MARKETING"] });
|
|
247
246
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
247
|
+
function y() {
|
|
248
|
+
Gn(), o.value = !1;
|
|
250
249
|
}
|
|
251
|
-
return (
|
|
252
|
-
const
|
|
253
|
-
return j(), Oe(
|
|
250
|
+
return (T, h) => {
|
|
251
|
+
const f = ee("FmIcon"), g = ee("FmCard"), v = ee("FmButton"), M = ee("FmDialog");
|
|
252
|
+
return j(), Oe(M, {
|
|
254
253
|
modelValue: o.value,
|
|
255
|
-
"onUpdate:modelValue":
|
|
254
|
+
"onUpdate:modelValue": h[0] || (h[0] = (k) => o.value = k),
|
|
256
255
|
"min-width": "min(500px, calc(100% - 48px))",
|
|
257
256
|
"max-width": "min(860px, calc(100% - 48px))",
|
|
258
257
|
"max-height": "90vh",
|
|
259
258
|
"dismiss-away": ""
|
|
260
259
|
}, {
|
|
261
|
-
"dialog-header":
|
|
262
|
-
I("div",
|
|
260
|
+
"dialog-header": Z(() => [
|
|
261
|
+
I("div", Bn, [
|
|
263
262
|
I("div", zn, [
|
|
264
|
-
|
|
263
|
+
S(f, {
|
|
265
264
|
name: "auto_awesome",
|
|
266
265
|
size: "sm",
|
|
267
266
|
color: "primary"
|
|
268
267
|
}),
|
|
269
|
-
I("span", qn,
|
|
268
|
+
I("span", qn, R(_(t)("connect.marketing.whatsNew.badge")), 1)
|
|
270
269
|
]),
|
|
271
|
-
I("h1", Kn,
|
|
272
|
-
I("p", Jn,
|
|
270
|
+
I("h1", Kn, R(_(t)("connect.marketing.whatsNew.title")), 1),
|
|
271
|
+
I("p", Jn, R(_(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
273
272
|
])
|
|
274
273
|
]),
|
|
275
|
-
"dialog-footer":
|
|
274
|
+
"dialog-footer": Z(() => [
|
|
276
275
|
I("div", ii, [
|
|
277
276
|
I("div", ri, [
|
|
278
|
-
|
|
277
|
+
S(v, {
|
|
279
278
|
variant: "primary",
|
|
280
279
|
size: "lg",
|
|
281
280
|
label: _(t)("connect.marketing.whatsNew.cta"),
|
|
282
281
|
"append-icon": "arrow_forward",
|
|
283
282
|
onClick: m
|
|
284
283
|
}, null, 8, ["label"]),
|
|
285
|
-
|
|
284
|
+
S(v, {
|
|
286
285
|
variant: "tertiary",
|
|
287
286
|
size: "lg",
|
|
288
287
|
label: _(t)("connect.marketing.whatsNew.dismiss"),
|
|
289
|
-
onClick:
|
|
288
|
+
onClick: y
|
|
290
289
|
}, null, 8, ["label"])
|
|
291
290
|
]),
|
|
292
|
-
I("div", si,
|
|
291
|
+
I("div", si, R(_(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
293
292
|
])
|
|
294
293
|
]),
|
|
295
|
-
default:
|
|
294
|
+
default: Z(() => [
|
|
296
295
|
I("div", Yn, [
|
|
297
296
|
I("div", Xn, [
|
|
298
|
-
(j(), me(It, null,
|
|
299
|
-
key:
|
|
297
|
+
(j(), me(It, null, ln(c, (k) => S(g, {
|
|
298
|
+
key: k.key,
|
|
300
299
|
variant: "outlined",
|
|
301
300
|
class: "!h-full flex flex-col gap-8 p-16"
|
|
302
301
|
}, {
|
|
303
|
-
default:
|
|
302
|
+
default: Z(() => [
|
|
304
303
|
I("div", Qn, [
|
|
305
|
-
|
|
306
|
-
name:
|
|
304
|
+
S(f, {
|
|
305
|
+
name: k.icon,
|
|
307
306
|
size: "md",
|
|
308
307
|
color: "primary"
|
|
309
308
|
}, null, 8, ["name"])
|
|
310
309
|
]),
|
|
311
|
-
I("div", Zn,
|
|
312
|
-
I("div", ei,
|
|
313
|
-
`connect.marketing.whatsNew.benefits.${
|
|
310
|
+
I("div", Zn, R(_(t)(`connect.marketing.whatsNew.benefits.${k.key}.title`)), 1),
|
|
311
|
+
I("div", ei, R(_(t)(
|
|
312
|
+
`connect.marketing.whatsNew.benefits.${k.key}.description`
|
|
314
313
|
)), 1)
|
|
315
314
|
]),
|
|
316
315
|
_: 2
|
|
317
316
|
}, 1024)), 64))
|
|
318
317
|
]),
|
|
319
|
-
|
|
318
|
+
S(g, {
|
|
320
319
|
variant: "outlined",
|
|
321
320
|
class: "flex items-start gap-12 p-16"
|
|
322
321
|
}, {
|
|
323
|
-
default:
|
|
322
|
+
default: Z(() => [
|
|
324
323
|
I("div", ti, [
|
|
325
|
-
|
|
324
|
+
S(f, {
|
|
326
325
|
name: "lightbulb",
|
|
327
326
|
size: "md",
|
|
328
327
|
color: "primary"
|
|
329
328
|
})
|
|
330
329
|
]),
|
|
331
|
-
I("p", ni,
|
|
330
|
+
I("p", ni, R(_(t)("connect.marketing.whatsNew.callout")), 1)
|
|
332
331
|
]),
|
|
333
332
|
_: 1
|
|
334
333
|
})
|
|
@@ -357,12 +356,12 @@ var ai = "firebase", ci = "10.12.4";
|
|
|
357
356
|
* limitations under the License.
|
|
358
357
|
*/
|
|
359
358
|
Le(ai, ci, "app");
|
|
360
|
-
function
|
|
359
|
+
function Rt() {
|
|
361
360
|
return {
|
|
362
361
|
"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."
|
|
363
362
|
};
|
|
364
363
|
}
|
|
365
|
-
const li =
|
|
364
|
+
const li = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
366
365
|
/**
|
|
367
366
|
* @license
|
|
368
367
|
* Copyright 2020 Google LLC
|
|
@@ -381,10 +380,10 @@ const li = At, Pt = new Fe("auth", "Firebase", At());
|
|
|
381
380
|
*/
|
|
382
381
|
const _e = new En("@firebase/auth");
|
|
383
382
|
function ui(n, ...e) {
|
|
384
|
-
_e.logLevel <=
|
|
383
|
+
_e.logLevel <= Et.WARN && _e.warn(`Auth (${se}): ${n}`, ...e);
|
|
385
384
|
}
|
|
386
385
|
function de(n, ...e) {
|
|
387
|
-
_e.logLevel <=
|
|
386
|
+
_e.logLevel <= Et.ERROR && _e.error(`Auth (${se}): ${n}`, ...e);
|
|
388
387
|
}
|
|
389
388
|
/**
|
|
390
389
|
* @license
|
|
@@ -402,38 +401,38 @@ function de(n, ...e) {
|
|
|
402
401
|
* See the License for the specific language governing permissions and
|
|
403
402
|
* limitations under the License.
|
|
404
403
|
*/
|
|
405
|
-
function
|
|
404
|
+
function O(n, ...e) {
|
|
406
405
|
throw He(n, ...e);
|
|
407
406
|
}
|
|
408
|
-
function
|
|
407
|
+
function b(n, ...e) {
|
|
409
408
|
return He(n, ...e);
|
|
410
409
|
}
|
|
411
|
-
function
|
|
410
|
+
function Pt(n, e, t) {
|
|
412
411
|
const i = Object.assign(Object.assign({}, li()), { [e]: t });
|
|
413
412
|
return new Fe("auth", "Firebase", i).create(e, {
|
|
414
413
|
appName: n.name
|
|
415
414
|
});
|
|
416
415
|
}
|
|
417
416
|
function H(n) {
|
|
418
|
-
return
|
|
417
|
+
return Pt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
419
418
|
}
|
|
420
419
|
function He(n, ...e) {
|
|
421
420
|
if (typeof n != "string") {
|
|
422
421
|
const t = e[0], i = [...e.slice(1)];
|
|
423
422
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
424
423
|
}
|
|
425
|
-
return
|
|
424
|
+
return At.create(n, ...e);
|
|
426
425
|
}
|
|
427
426
|
function u(n, e, ...t) {
|
|
428
427
|
if (!n)
|
|
429
428
|
throw He(e, ...t);
|
|
430
429
|
}
|
|
431
|
-
function
|
|
430
|
+
function P(n) {
|
|
432
431
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
433
432
|
throw de(e), new Error(e);
|
|
434
433
|
}
|
|
435
|
-
function
|
|
436
|
-
n ||
|
|
434
|
+
function L(n, e) {
|
|
435
|
+
n || P(e);
|
|
437
436
|
}
|
|
438
437
|
/**
|
|
439
438
|
* @license
|
|
@@ -516,7 +515,7 @@ function fi() {
|
|
|
516
515
|
*/
|
|
517
516
|
class ae {
|
|
518
517
|
constructor(e, t) {
|
|
519
|
-
this.shortDelay = e, this.longDelay = t,
|
|
518
|
+
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile = Sn() || Rn();
|
|
520
519
|
}
|
|
521
520
|
get() {
|
|
522
521
|
return hi() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
@@ -539,7 +538,7 @@ class ae {
|
|
|
539
538
|
* limitations under the License.
|
|
540
539
|
*/
|
|
541
540
|
function We(n, e) {
|
|
542
|
-
|
|
541
|
+
L(n.emulator, "Emulator should always be set here");
|
|
543
542
|
const { url: t } = n.emulator;
|
|
544
543
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
545
544
|
}
|
|
@@ -559,7 +558,7 @@ function We(n, e) {
|
|
|
559
558
|
* See the License for the specific language governing permissions and
|
|
560
559
|
* limitations under the License.
|
|
561
560
|
*/
|
|
562
|
-
class
|
|
561
|
+
class Ct {
|
|
563
562
|
static initialize(e, t, i) {
|
|
564
563
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
565
564
|
}
|
|
@@ -572,7 +571,7 @@ class Nt {
|
|
|
572
571
|
return globalThis.fetch;
|
|
573
572
|
if (typeof fetch < "u")
|
|
574
573
|
return fetch;
|
|
575
|
-
|
|
574
|
+
P("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
576
575
|
}
|
|
577
576
|
static headers() {
|
|
578
577
|
if (this.headersImpl)
|
|
@@ -583,7 +582,7 @@ class Nt {
|
|
|
583
582
|
return globalThis.Headers;
|
|
584
583
|
if (typeof Headers < "u")
|
|
585
584
|
return Headers;
|
|
586
|
-
|
|
585
|
+
P("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
587
586
|
}
|
|
588
587
|
static response() {
|
|
589
588
|
if (this.responseImpl)
|
|
@@ -594,7 +593,7 @@ class Nt {
|
|
|
594
593
|
return globalThis.Response;
|
|
595
594
|
if (typeof Response < "u")
|
|
596
595
|
return Response;
|
|
597
|
-
|
|
596
|
+
P("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
598
597
|
}
|
|
599
598
|
}
|
|
600
599
|
/**
|
|
@@ -708,8 +707,8 @@ const mi = new ae(3e4, 6e4);
|
|
|
708
707
|
function Te(n, e) {
|
|
709
708
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
710
709
|
}
|
|
711
|
-
async function
|
|
712
|
-
return
|
|
710
|
+
async function Q(n, e, t, i, r = {}) {
|
|
711
|
+
return Nt(n, r, async () => {
|
|
713
712
|
let s = {}, o = {};
|
|
714
713
|
i && (e === "GET" ? o = i : s = {
|
|
715
714
|
body: JSON.stringify(i)
|
|
@@ -721,14 +720,14 @@ async function Z(n, e, t, i, r = {}) {
|
|
|
721
720
|
] = "application/json", n.languageCode && (a[
|
|
722
721
|
"X-Firebase-Locale"
|
|
723
722
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
724
|
-
] = n.languageCode),
|
|
723
|
+
] = n.languageCode), Ct.fetch()(Lt(n, n.config.apiHost, t, c), Object.assign({
|
|
725
724
|
method: e,
|
|
726
725
|
headers: a,
|
|
727
726
|
referrerPolicy: "no-referrer"
|
|
728
727
|
}, s));
|
|
729
728
|
});
|
|
730
729
|
}
|
|
731
|
-
async function
|
|
730
|
+
async function Nt(n, e, t) {
|
|
732
731
|
n._canInitEmulator = !1;
|
|
733
732
|
const i = Object.assign(Object.assign({}, pi), e);
|
|
734
733
|
try {
|
|
@@ -750,31 +749,31 @@ async function Ot(n, e, t) {
|
|
|
750
749
|
throw ue(n, "email-already-in-use", o);
|
|
751
750
|
if (a === "USER_DISABLED")
|
|
752
751
|
throw ue(n, "user-disabled", o);
|
|
753
|
-
const
|
|
752
|
+
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
754
753
|
if (l)
|
|
755
|
-
throw
|
|
756
|
-
|
|
754
|
+
throw Pt(n, d, l);
|
|
755
|
+
O(n, d);
|
|
757
756
|
}
|
|
758
757
|
} catch (r) {
|
|
759
758
|
if (r instanceof Ve)
|
|
760
759
|
throw r;
|
|
761
|
-
|
|
760
|
+
O(n, "network-request-failed", { message: String(r) });
|
|
762
761
|
}
|
|
763
762
|
}
|
|
764
|
-
async function
|
|
765
|
-
const s = await
|
|
766
|
-
return "mfaPendingCredential" in s &&
|
|
763
|
+
async function Ot(n, e, t, i, r = {}) {
|
|
764
|
+
const s = await Q(n, e, t, i, r);
|
|
765
|
+
return "mfaPendingCredential" in s && O(n, "multi-factor-auth-required", {
|
|
767
766
|
_serverResponse: s
|
|
768
767
|
}), s;
|
|
769
768
|
}
|
|
770
|
-
function
|
|
769
|
+
function Lt(n, e, t, i) {
|
|
771
770
|
const r = `${e}${t}?${i}`;
|
|
772
771
|
return n.config.emulator ? We(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
773
772
|
}
|
|
774
773
|
class gi {
|
|
775
774
|
constructor(e) {
|
|
776
775
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
777
|
-
this.timer = setTimeout(() => i(
|
|
776
|
+
this.timer = setTimeout(() => i(b(
|
|
778
777
|
this.auth,
|
|
779
778
|
"network-request-failed"
|
|
780
779
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
@@ -790,7 +789,7 @@ function ue(n, e, t) {
|
|
|
790
789
|
appName: n.name
|
|
791
790
|
};
|
|
792
791
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
793
|
-
const r =
|
|
792
|
+
const r = b(n, e, i);
|
|
794
793
|
return r.customData._tokenResponse = t, r;
|
|
795
794
|
}
|
|
796
795
|
/**
|
|
@@ -810,10 +809,10 @@ function ue(n, e, t) {
|
|
|
810
809
|
* limitations under the License.
|
|
811
810
|
*/
|
|
812
811
|
async function _i(n, e) {
|
|
813
|
-
return
|
|
812
|
+
return Q(n, "POST", "/v1/accounts:delete", e);
|
|
814
813
|
}
|
|
815
|
-
async function
|
|
816
|
-
return
|
|
814
|
+
async function Mt(n, e) {
|
|
815
|
+
return Q(n, "POST", "/v1/accounts:lookup", e);
|
|
817
816
|
}
|
|
818
817
|
/**
|
|
819
818
|
* @license
|
|
@@ -831,7 +830,7 @@ async function Ut(n, e) {
|
|
|
831
830
|
* See the License for the specific language governing permissions and
|
|
832
831
|
* limitations under the License.
|
|
833
832
|
*/
|
|
834
|
-
function
|
|
833
|
+
function ne(n) {
|
|
835
834
|
if (n)
|
|
836
835
|
try {
|
|
837
836
|
const e = new Date(Number(n));
|
|
@@ -841,7 +840,7 @@ function ie(n) {
|
|
|
841
840
|
}
|
|
842
841
|
}
|
|
843
842
|
async function vi(n, e = !1) {
|
|
844
|
-
const t =
|
|
843
|
+
const t = X(n), i = await t.getIdToken(e), r = je(i);
|
|
845
844
|
u(
|
|
846
845
|
r && r.exp && r.auth_time && r.iat,
|
|
847
846
|
t.auth,
|
|
@@ -852,9 +851,9 @@ async function vi(n, e = !1) {
|
|
|
852
851
|
return {
|
|
853
852
|
claims: r,
|
|
854
853
|
token: i,
|
|
855
|
-
authTime:
|
|
856
|
-
issuedAtTime:
|
|
857
|
-
expirationTime:
|
|
854
|
+
authTime: ne(Ce(r.auth_time)),
|
|
855
|
+
issuedAtTime: ne(Ce(r.iat)),
|
|
856
|
+
expirationTime: ne(Ce(r.exp)),
|
|
858
857
|
signInProvider: o || null,
|
|
859
858
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
860
859
|
};
|
|
@@ -1000,7 +999,7 @@ class Ue {
|
|
|
1000
999
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
1001
1000
|
}
|
|
1002
1001
|
_initializeTime() {
|
|
1003
|
-
this.lastSignInTime =
|
|
1002
|
+
this.lastSignInTime = ne(this.lastLoginAt), this.creationTime = ne(this.createdAt);
|
|
1004
1003
|
}
|
|
1005
1004
|
_copy(e) {
|
|
1006
1005
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -1030,7 +1029,7 @@ class Ue {
|
|
|
1030
1029
|
*/
|
|
1031
1030
|
async function ve(n) {
|
|
1032
1031
|
var e;
|
|
1033
|
-
const t = n.auth, i = await n.getIdToken(), r = await re(n,
|
|
1032
|
+
const t = n.auth, i = await n.getIdToken(), r = await re(n, Mt(t, { idToken: i }));
|
|
1034
1033
|
u(
|
|
1035
1034
|
r == null ? void 0 : r.users.length,
|
|
1036
1035
|
t,
|
|
@@ -1039,7 +1038,7 @@ async function ve(n) {
|
|
|
1039
1038
|
);
|
|
1040
1039
|
const s = r.users[0];
|
|
1041
1040
|
n._notifyReloadListener(s);
|
|
1042
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
1041
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c = Ti(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, m = {
|
|
1043
1042
|
uid: s.localId,
|
|
1044
1043
|
displayName: s.displayName || null,
|
|
1045
1044
|
photoURL: s.photoUrl || null,
|
|
@@ -1049,18 +1048,18 @@ async function ve(n) {
|
|
|
1049
1048
|
tenantId: s.tenantId || null,
|
|
1050
1049
|
providerData: c,
|
|
1051
1050
|
metadata: new Ue(s.createdAt, s.lastLoginAt),
|
|
1052
|
-
isAnonymous:
|
|
1051
|
+
isAnonymous: d
|
|
1053
1052
|
};
|
|
1054
1053
|
Object.assign(n, m);
|
|
1055
1054
|
}
|
|
1056
1055
|
async function wi(n) {
|
|
1057
|
-
const e =
|
|
1056
|
+
const e = X(n);
|
|
1058
1057
|
await ve(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
1059
1058
|
}
|
|
1060
1059
|
function Ti(n, e) {
|
|
1061
1060
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
1062
1061
|
}
|
|
1063
|
-
function
|
|
1062
|
+
function Ut(n) {
|
|
1064
1063
|
return n.map((e) => {
|
|
1065
1064
|
var { providerId: t } = e, i = $e(e, ["providerId"]);
|
|
1066
1065
|
return {
|
|
@@ -1090,15 +1089,15 @@ function Dt(n) {
|
|
|
1090
1089
|
* limitations under the License.
|
|
1091
1090
|
*/
|
|
1092
1091
|
async function ki(n, e) {
|
|
1093
|
-
const t = await
|
|
1092
|
+
const t = await Nt(n, {}, async () => {
|
|
1094
1093
|
const i = oe({
|
|
1095
1094
|
grant_type: "refresh_token",
|
|
1096
1095
|
refresh_token: e
|
|
1097
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
1096
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = Lt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
1098
1097
|
return c[
|
|
1099
1098
|
"Content-Type"
|
|
1100
1099
|
/* HttpHeader.CONTENT_TYPE */
|
|
1101
|
-
] = "application/x-www-form-urlencoded",
|
|
1100
|
+
] = "application/x-www-form-urlencoded", Ct.fetch()(o, {
|
|
1102
1101
|
method: "POST",
|
|
1103
1102
|
headers: c,
|
|
1104
1103
|
body: i
|
|
@@ -1111,7 +1110,7 @@ async function ki(n, e) {
|
|
|
1111
1110
|
};
|
|
1112
1111
|
}
|
|
1113
1112
|
async function bi(n, e) {
|
|
1114
|
-
return
|
|
1113
|
+
return Q(n, "POST", "/v2/accounts:revokeToken", Te(n, e));
|
|
1115
1114
|
}
|
|
1116
1115
|
/**
|
|
1117
1116
|
* @license
|
|
@@ -1129,7 +1128,7 @@ async function bi(n, e) {
|
|
|
1129
1128
|
* See the License for the specific language governing permissions and
|
|
1130
1129
|
* limitations under the License.
|
|
1131
1130
|
*/
|
|
1132
|
-
class
|
|
1131
|
+
class q {
|
|
1133
1132
|
constructor() {
|
|
1134
1133
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
1135
1134
|
}
|
|
@@ -1181,7 +1180,7 @@ class K {
|
|
|
1181
1180
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1182
1181
|
}
|
|
1183
1182
|
static fromJSON(e, t) {
|
|
1184
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1183
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new q();
|
|
1185
1184
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1186
1185
|
appName: e
|
|
1187
1186
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1201,10 +1200,10 @@ class K {
|
|
|
1201
1200
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1202
1201
|
}
|
|
1203
1202
|
_clone() {
|
|
1204
|
-
return Object.assign(new
|
|
1203
|
+
return Object.assign(new q(), this.toJSON());
|
|
1205
1204
|
}
|
|
1206
1205
|
_performRefresh() {
|
|
1207
|
-
return
|
|
1206
|
+
return P("not implemented");
|
|
1208
1207
|
}
|
|
1209
1208
|
}
|
|
1210
1209
|
/**
|
|
@@ -1226,7 +1225,7 @@ class K {
|
|
|
1226
1225
|
function D(n, e) {
|
|
1227
1226
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1228
1227
|
}
|
|
1229
|
-
class
|
|
1228
|
+
class C {
|
|
1230
1229
|
constructor(e) {
|
|
1231
1230
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1232
1231
|
this.providerId = "firebase", this.proactiveRefresh = new yi(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);
|
|
@@ -1255,7 +1254,7 @@ class N {
|
|
|
1255
1254
|
), this.displayName = e.displayName, this.photoURL = e.photoURL, this.email = e.email, this.emailVerified = e.emailVerified, this.phoneNumber = e.phoneNumber, this.isAnonymous = e.isAnonymous, this.tenantId = e.tenantId, this.providerData = e.providerData.map((t) => Object.assign({}, t)), this.metadata._copy(e.metadata), this.stsTokenManager._assign(e.stsTokenManager));
|
|
1256
1255
|
}
|
|
1257
1256
|
_clone(e) {
|
|
1258
|
-
const t = new
|
|
1257
|
+
const t = new C(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1259
1258
|
return t.metadata._copy(this.metadata), t;
|
|
1260
1259
|
}
|
|
1261
1260
|
_onReload(e) {
|
|
@@ -1280,7 +1279,7 @@ class N {
|
|
|
1280
1279
|
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);
|
|
1281
1280
|
}
|
|
1282
1281
|
async delete() {
|
|
1283
|
-
if (
|
|
1282
|
+
if (A(this.auth.app))
|
|
1284
1283
|
return Promise.reject(H(this.auth));
|
|
1285
1284
|
const e = await this.getIdToken();
|
|
1286
1285
|
return await re(this, _i(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
@@ -1310,21 +1309,21 @@ class N {
|
|
|
1310
1309
|
return this.stsTokenManager.refreshToken || "";
|
|
1311
1310
|
}
|
|
1312
1311
|
static _fromJSON(e, t) {
|
|
1313
|
-
var i, r, s, o, c, a, l,
|
|
1314
|
-
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0,
|
|
1312
|
+
var i, r, s, o, c, a, l, d;
|
|
1313
|
+
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0, y = (r = t.email) !== null && r !== void 0 ? r : void 0, T = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, h = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, f = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, g = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, v = (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;
|
|
1315
1314
|
u(
|
|
1316
|
-
|
|
1315
|
+
k && Ye,
|
|
1317
1316
|
e,
|
|
1318
1317
|
"internal-error"
|
|
1319
1318
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1320
1319
|
);
|
|
1321
|
-
const
|
|
1320
|
+
const on = q.fromJSON(this.name, Ye);
|
|
1322
1321
|
u(
|
|
1323
|
-
typeof
|
|
1322
|
+
typeof k == "string",
|
|
1324
1323
|
e,
|
|
1325
1324
|
"internal-error"
|
|
1326
1325
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1327
|
-
), D(m, e.name), D(
|
|
1326
|
+
), D(m, e.name), D(y, e.name), u(
|
|
1328
1327
|
typeof Ke == "boolean",
|
|
1329
1328
|
e,
|
|
1330
1329
|
"internal-error"
|
|
@@ -1334,22 +1333,22 @@ class N {
|
|
|
1334
1333
|
e,
|
|
1335
1334
|
"internal-error"
|
|
1336
1335
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1337
|
-
), D(
|
|
1338
|
-
const Ae = new
|
|
1339
|
-
uid:
|
|
1336
|
+
), D(T, e.name), D(h, e.name), D(f, e.name), D(g, e.name), D(v, e.name), D(M, e.name);
|
|
1337
|
+
const Ae = new C({
|
|
1338
|
+
uid: k,
|
|
1340
1339
|
auth: e,
|
|
1341
|
-
email:
|
|
1340
|
+
email: y,
|
|
1342
1341
|
emailVerified: Ke,
|
|
1343
1342
|
displayName: m,
|
|
1344
1343
|
isAnonymous: Je,
|
|
1345
|
-
photoURL:
|
|
1346
|
-
phoneNumber:
|
|
1347
|
-
tenantId:
|
|
1348
|
-
stsTokenManager:
|
|
1349
|
-
createdAt:
|
|
1350
|
-
lastLoginAt:
|
|
1344
|
+
photoURL: h,
|
|
1345
|
+
phoneNumber: T,
|
|
1346
|
+
tenantId: f,
|
|
1347
|
+
stsTokenManager: on,
|
|
1348
|
+
createdAt: v,
|
|
1349
|
+
lastLoginAt: M
|
|
1351
1350
|
});
|
|
1352
|
-
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((
|
|
1351
|
+
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((an) => Object.assign({}, an))), g && (Ae._redirectEventId = g), Ae;
|
|
1353
1352
|
}
|
|
1354
1353
|
/**
|
|
1355
1354
|
* Initialize a User from an idToken server response
|
|
@@ -1357,9 +1356,9 @@ class N {
|
|
|
1357
1356
|
* @param idTokenResponse
|
|
1358
1357
|
*/
|
|
1359
1358
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1360
|
-
const r = new
|
|
1359
|
+
const r = new q();
|
|
1361
1360
|
r.updateFromServerResponse(t);
|
|
1362
|
-
const s = new
|
|
1361
|
+
const s = new C({
|
|
1363
1362
|
uid: t.localId,
|
|
1364
1363
|
auth: e,
|
|
1365
1364
|
stsTokenManager: r,
|
|
@@ -1379,9 +1378,9 @@ class N {
|
|
|
1379
1378
|
"internal-error"
|
|
1380
1379
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1381
1380
|
);
|
|
1382
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1381
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new q();
|
|
1383
1382
|
c.updateFromIdToken(i);
|
|
1384
|
-
const a = new
|
|
1383
|
+
const a = new C({
|
|
1385
1384
|
uid: r.localId,
|
|
1386
1385
|
auth: e,
|
|
1387
1386
|
stsTokenManager: c,
|
|
@@ -1418,10 +1417,10 @@ class N {
|
|
|
1418
1417
|
* limitations under the License.
|
|
1419
1418
|
*/
|
|
1420
1419
|
const rt = /* @__PURE__ */ new Map();
|
|
1421
|
-
function
|
|
1422
|
-
|
|
1420
|
+
function N(n) {
|
|
1421
|
+
L(n instanceof Function, "Expected a class definition");
|
|
1423
1422
|
let e = rt.get(n);
|
|
1424
|
-
return e ? (
|
|
1423
|
+
return e ? (L(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), rt.set(n, e), e);
|
|
1425
1424
|
}
|
|
1426
1425
|
/**
|
|
1427
1426
|
* @license
|
|
@@ -1439,7 +1438,7 @@ function O(n) {
|
|
|
1439
1438
|
* See the License for the specific language governing permissions and
|
|
1440
1439
|
* limitations under the License.
|
|
1441
1440
|
*/
|
|
1442
|
-
class
|
|
1441
|
+
class Dt {
|
|
1443
1442
|
constructor() {
|
|
1444
1443
|
this.type = "NONE", this.storage = {};
|
|
1445
1444
|
}
|
|
@@ -1461,8 +1460,8 @@ class xt {
|
|
|
1461
1460
|
_removeListener(e, t) {
|
|
1462
1461
|
}
|
|
1463
1462
|
}
|
|
1464
|
-
|
|
1465
|
-
const st =
|
|
1463
|
+
Dt.type = "NONE";
|
|
1464
|
+
const st = Dt;
|
|
1466
1465
|
/**
|
|
1467
1466
|
* @license
|
|
1468
1467
|
* Copyright 2019 Google LLC
|
|
@@ -1482,7 +1481,7 @@ const st = xt;
|
|
|
1482
1481
|
function he(n, e, t) {
|
|
1483
1482
|
return `firebase:${n}:${e}:${t}`;
|
|
1484
1483
|
}
|
|
1485
|
-
class
|
|
1484
|
+
class K {
|
|
1486
1485
|
constructor(e, t, i) {
|
|
1487
1486
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1488
1487
|
const { config: r, name: s } = this.auth;
|
|
@@ -1493,7 +1492,7 @@ class J {
|
|
|
1493
1492
|
}
|
|
1494
1493
|
async getCurrentUser() {
|
|
1495
1494
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1496
|
-
return e ?
|
|
1495
|
+
return e ? C._fromJSON(this.auth, e) : null;
|
|
1497
1496
|
}
|
|
1498
1497
|
removeCurrentUser() {
|
|
1499
1498
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1513,32 +1512,32 @@ class J {
|
|
|
1513
1512
|
}
|
|
1514
1513
|
static async create(e, t, i = "authUser") {
|
|
1515
1514
|
if (!t.length)
|
|
1516
|
-
return new
|
|
1515
|
+
return new K(N(st), e, i);
|
|
1517
1516
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1518
1517
|
if (await l._isAvailable())
|
|
1519
1518
|
return l;
|
|
1520
1519
|
}))).filter((l) => l);
|
|
1521
|
-
let s = r[0] ||
|
|
1520
|
+
let s = r[0] || N(st);
|
|
1522
1521
|
const o = he(i, e.config.apiKey, e.name);
|
|
1523
1522
|
let c = null;
|
|
1524
1523
|
for (const l of t)
|
|
1525
1524
|
try {
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1528
|
-
const m =
|
|
1525
|
+
const d = await l._get(o);
|
|
1526
|
+
if (d) {
|
|
1527
|
+
const m = C._fromJSON(e, d);
|
|
1529
1528
|
l !== s && (c = m), s = l;
|
|
1530
1529
|
break;
|
|
1531
1530
|
}
|
|
1532
1531
|
} catch {
|
|
1533
1532
|
}
|
|
1534
1533
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1535
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1534
|
+
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) => {
|
|
1536
1535
|
if (l !== s)
|
|
1537
1536
|
try {
|
|
1538
1537
|
await l._remove(o);
|
|
1539
1538
|
} catch {
|
|
1540
1539
|
}
|
|
1541
|
-
})), new
|
|
1540
|
+
})), new K(s, e, i));
|
|
1542
1541
|
}
|
|
1543
1542
|
}
|
|
1544
1543
|
/**
|
|
@@ -1561,25 +1560,25 @@ function ot(n) {
|
|
|
1561
1560
|
const e = n.toLowerCase();
|
|
1562
1561
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1563
1562
|
return "Opera";
|
|
1564
|
-
if (
|
|
1563
|
+
if (Vt(e))
|
|
1565
1564
|
return "IEMobile";
|
|
1566
1565
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1567
1566
|
return "IE";
|
|
1568
1567
|
if (e.includes("edge/"))
|
|
1569
1568
|
return "Edge";
|
|
1570
|
-
if (
|
|
1569
|
+
if (xt(e))
|
|
1571
1570
|
return "Firefox";
|
|
1572
1571
|
if (e.includes("silk/"))
|
|
1573
1572
|
return "Silk";
|
|
1574
|
-
if (
|
|
1573
|
+
if (Ht(e))
|
|
1575
1574
|
return "Blackberry";
|
|
1576
|
-
if (
|
|
1575
|
+
if (Wt(e))
|
|
1577
1576
|
return "Webos";
|
|
1578
|
-
if (
|
|
1577
|
+
if (Ge(e))
|
|
1579
1578
|
return "Safari";
|
|
1580
|
-
if ((e.includes("chrome/") ||
|
|
1579
|
+
if ((e.includes("chrome/") || Ft(e)) && !e.includes("edge/"))
|
|
1581
1580
|
return "Chrome";
|
|
1582
|
-
if (
|
|
1581
|
+
if ($t(e))
|
|
1583
1582
|
return "Android";
|
|
1584
1583
|
{
|
|
1585
1584
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1588,40 +1587,40 @@ function ot(n) {
|
|
|
1588
1587
|
}
|
|
1589
1588
|
return "Other";
|
|
1590
1589
|
}
|
|
1591
|
-
function
|
|
1590
|
+
function xt(n = w()) {
|
|
1592
1591
|
return /firefox\//i.test(n);
|
|
1593
1592
|
}
|
|
1594
|
-
function
|
|
1593
|
+
function Ge(n = w()) {
|
|
1595
1594
|
const e = n.toLowerCase();
|
|
1596
1595
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1597
1596
|
}
|
|
1598
|
-
function
|
|
1597
|
+
function Ft(n = w()) {
|
|
1599
1598
|
return /crios\//i.test(n);
|
|
1600
1599
|
}
|
|
1601
|
-
function
|
|
1600
|
+
function Vt(n = w()) {
|
|
1602
1601
|
return /iemobile/i.test(n);
|
|
1603
1602
|
}
|
|
1604
|
-
function
|
|
1603
|
+
function $t(n = w()) {
|
|
1605
1604
|
return /android/i.test(n);
|
|
1606
1605
|
}
|
|
1607
|
-
function
|
|
1606
|
+
function Ht(n = w()) {
|
|
1608
1607
|
return /blackberry/i.test(n);
|
|
1609
1608
|
}
|
|
1610
|
-
function
|
|
1609
|
+
function Wt(n = w()) {
|
|
1611
1610
|
return /webos/i.test(n);
|
|
1612
1611
|
}
|
|
1613
|
-
function ke(n =
|
|
1612
|
+
function ke(n = w()) {
|
|
1614
1613
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1615
1614
|
}
|
|
1616
|
-
function Ei(n =
|
|
1615
|
+
function Ei(n = w()) {
|
|
1617
1616
|
var e;
|
|
1618
1617
|
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1619
1618
|
}
|
|
1620
1619
|
function Si() {
|
|
1621
1620
|
return Mn() && document.documentMode === 10;
|
|
1622
1621
|
}
|
|
1623
|
-
function
|
|
1624
|
-
return ke(n) ||
|
|
1622
|
+
function jt(n = w()) {
|
|
1623
|
+
return ke(n) || $t(n) || Wt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1625
1624
|
}
|
|
1626
1625
|
function Ri() {
|
|
1627
1626
|
try {
|
|
@@ -1650,10 +1649,10 @@ function Gt(n, e = []) {
|
|
|
1650
1649
|
let t;
|
|
1651
1650
|
switch (n) {
|
|
1652
1651
|
case "Browser":
|
|
1653
|
-
t = ot(
|
|
1652
|
+
t = ot(w());
|
|
1654
1653
|
break;
|
|
1655
1654
|
case "Worker":
|
|
1656
|
-
t = `${ot(
|
|
1655
|
+
t = `${ot(w())}-${n}`;
|
|
1657
1656
|
break;
|
|
1658
1657
|
default:
|
|
1659
1658
|
t = n;
|
|
@@ -1733,7 +1732,7 @@ class Ai {
|
|
|
1733
1732
|
* limitations under the License.
|
|
1734
1733
|
*/
|
|
1735
1734
|
async function Pi(n, e = {}) {
|
|
1736
|
-
return
|
|
1735
|
+
return Q(n, "GET", "/v2/passwordPolicy", Te(n, e));
|
|
1737
1736
|
}
|
|
1738
1737
|
/**
|
|
1739
1738
|
* @license
|
|
@@ -1841,12 +1840,12 @@ class Ni {
|
|
|
1841
1840
|
*/
|
|
1842
1841
|
class Oi {
|
|
1843
1842
|
constructor(e, t, i, r) {
|
|
1844
|
-
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 Ai(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 =
|
|
1843
|
+
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 Ai(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;
|
|
1845
1844
|
}
|
|
1846
1845
|
_initializeWithPersistence(e, t) {
|
|
1847
|
-
return t && (this._popupRedirectResolver =
|
|
1846
|
+
return t && (this._popupRedirectResolver = N(t)), this._initializationPromise = this.queue(async () => {
|
|
1848
1847
|
var i, r;
|
|
1849
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1848
|
+
if (!this._deleted && (this.persistenceManager = await K.create(this, e), !this._deleted)) {
|
|
1850
1849
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1851
1850
|
try {
|
|
1852
1851
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1877,7 +1876,7 @@ class Oi {
|
|
|
1877
1876
|
}
|
|
1878
1877
|
async initializeCurrentUserFromIdToken(e) {
|
|
1879
1878
|
try {
|
|
1880
|
-
const t = await
|
|
1879
|
+
const t = await Mt(this, { idToken: e }), i = await C._fromGetAccountInfoResponse(this, t, e);
|
|
1881
1880
|
await this.directlySetCurrentUser(i);
|
|
1882
1881
|
} catch (t) {
|
|
1883
1882
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1885,7 +1884,7 @@ class Oi {
|
|
|
1885
1884
|
}
|
|
1886
1885
|
async initializeCurrentUser(e) {
|
|
1887
1886
|
var t;
|
|
1888
|
-
if (
|
|
1887
|
+
if (A(this.app)) {
|
|
1889
1888
|
const o = this.app.settings.authIdToken;
|
|
1890
1889
|
return o ? new Promise((c) => {
|
|
1891
1890
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1941,9 +1940,9 @@ class Oi {
|
|
|
1941
1940
|
this._deleted = !0;
|
|
1942
1941
|
}
|
|
1943
1942
|
async updateCurrentUser(e) {
|
|
1944
|
-
if (
|
|
1943
|
+
if (A(this.app))
|
|
1945
1944
|
return Promise.reject(H(this));
|
|
1946
|
-
const t = e ?
|
|
1945
|
+
const t = e ? X(e) : null;
|
|
1947
1946
|
return t && u(
|
|
1948
1947
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1949
1948
|
this,
|
|
@@ -1963,15 +1962,15 @@ class Oi {
|
|
|
1963
1962
|
});
|
|
1964
1963
|
}
|
|
1965
1964
|
async signOut() {
|
|
1966
|
-
return
|
|
1965
|
+
return A(this.app) ? Promise.reject(H(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1967
1966
|
null,
|
|
1968
1967
|
/* skipBeforeStateCallbacks */
|
|
1969
1968
|
!0
|
|
1970
1969
|
));
|
|
1971
1970
|
}
|
|
1972
1971
|
setPersistence(e) {
|
|
1973
|
-
return
|
|
1974
|
-
await this.assertedPersistence.setPersistence(
|
|
1972
|
+
return A(this.app) ? Promise.reject(H(this)) : this.queue(async () => {
|
|
1973
|
+
await this.assertedPersistence.setPersistence(N(e));
|
|
1975
1974
|
});
|
|
1976
1975
|
}
|
|
1977
1976
|
_getRecaptchaConfig() {
|
|
@@ -2044,15 +2043,15 @@ class Oi {
|
|
|
2044
2043
|
}
|
|
2045
2044
|
async getOrInitRedirectPersistenceManager(e) {
|
|
2046
2045
|
if (!this.redirectPersistenceManager) {
|
|
2047
|
-
const t = e &&
|
|
2046
|
+
const t = e && N(e) || this._popupRedirectResolver;
|
|
2048
2047
|
u(
|
|
2049
2048
|
t,
|
|
2050
2049
|
this,
|
|
2051
2050
|
"argument-error"
|
|
2052
2051
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2053
|
-
), this.redirectPersistenceManager = await
|
|
2052
|
+
), this.redirectPersistenceManager = await K.create(
|
|
2054
2053
|
this,
|
|
2055
|
-
[
|
|
2054
|
+
[N(t._redirectPersistence)],
|
|
2056
2055
|
"redirectUser"
|
|
2057
2056
|
/* KeyName.REDIRECT_USER */
|
|
2058
2057
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -2173,7 +2172,7 @@ class Oi {
|
|
|
2173
2172
|
}
|
|
2174
2173
|
}
|
|
2175
2174
|
function be(n) {
|
|
2176
|
-
return
|
|
2175
|
+
return X(n);
|
|
2177
2176
|
}
|
|
2178
2177
|
class at {
|
|
2179
2178
|
constructor(e) {
|
|
@@ -2204,7 +2203,7 @@ class at {
|
|
|
2204
2203
|
* See the License for the specific language governing permissions and
|
|
2205
2204
|
* limitations under the License.
|
|
2206
2205
|
*/
|
|
2207
|
-
let
|
|
2206
|
+
let Be = {
|
|
2208
2207
|
async loadJS() {
|
|
2209
2208
|
throw new Error("Unable to load external scripts");
|
|
2210
2209
|
},
|
|
@@ -2213,13 +2212,13 @@ let Ge = {
|
|
|
2213
2212
|
gapiScript: ""
|
|
2214
2213
|
};
|
|
2215
2214
|
function Li(n) {
|
|
2216
|
-
|
|
2215
|
+
Be = n;
|
|
2217
2216
|
}
|
|
2218
2217
|
function Mi(n) {
|
|
2219
|
-
return
|
|
2218
|
+
return Be.loadJS(n);
|
|
2220
2219
|
}
|
|
2221
2220
|
function Ui() {
|
|
2222
|
-
return
|
|
2221
|
+
return Be.gapiScript;
|
|
2223
2222
|
}
|
|
2224
2223
|
function Di(n) {
|
|
2225
2224
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
@@ -2241,12 +2240,12 @@ function Di(n) {
|
|
|
2241
2240
|
* limitations under the License.
|
|
2242
2241
|
*/
|
|
2243
2242
|
function xi(n, e) {
|
|
2244
|
-
const t =
|
|
2243
|
+
const t = bt(n, "auth");
|
|
2245
2244
|
if (t.isInitialized()) {
|
|
2246
2245
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2247
2246
|
if (On(s, e ?? {}))
|
|
2248
2247
|
return r;
|
|
2249
|
-
|
|
2248
|
+
O(
|
|
2250
2249
|
r,
|
|
2251
2250
|
"already-initialized"
|
|
2252
2251
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2255,7 +2254,7 @@ function xi(n, e) {
|
|
|
2255
2254
|
return t.initialize({ options: e });
|
|
2256
2255
|
}
|
|
2257
2256
|
function Fi(n, e) {
|
|
2258
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2257
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(N);
|
|
2259
2258
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2260
2259
|
}
|
|
2261
2260
|
function Vi(n, e, t) {
|
|
@@ -2271,7 +2270,7 @@ function Vi(n, e, t) {
|
|
|
2271
2270
|
"invalid-emulator-scheme"
|
|
2272
2271
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2273
2272
|
);
|
|
2274
|
-
const r = !1, s =
|
|
2273
|
+
const r = !1, s = Bt(e), { host: o, port: c } = $i(e), a = c === null ? "" : `:${c}`;
|
|
2275
2274
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2276
2275
|
host: o,
|
|
2277
2276
|
port: c,
|
|
@@ -2279,12 +2278,12 @@ function Vi(n, e, t) {
|
|
|
2279
2278
|
options: Object.freeze({ disableWarnings: r })
|
|
2280
2279
|
}), Hi();
|
|
2281
2280
|
}
|
|
2282
|
-
function
|
|
2281
|
+
function Bt(n) {
|
|
2283
2282
|
const e = n.indexOf(":");
|
|
2284
2283
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2285
2284
|
}
|
|
2286
2285
|
function $i(n) {
|
|
2287
|
-
const e =
|
|
2286
|
+
const e = Bt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2288
2287
|
if (!t)
|
|
2289
2288
|
return { host: "", port: null };
|
|
2290
2289
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
@@ -2325,7 +2324,7 @@ function Hi() {
|
|
|
2325
2324
|
* See the License for the specific language governing permissions and
|
|
2326
2325
|
* limitations under the License.
|
|
2327
2326
|
*/
|
|
2328
|
-
class
|
|
2327
|
+
class zt {
|
|
2329
2328
|
/** @internal */
|
|
2330
2329
|
constructor(e, t) {
|
|
2331
2330
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2336,19 +2335,19 @@ class qt {
|
|
|
2336
2335
|
* @returns a JSON-serializable representation of this object.
|
|
2337
2336
|
*/
|
|
2338
2337
|
toJSON() {
|
|
2339
|
-
return
|
|
2338
|
+
return P("not implemented");
|
|
2340
2339
|
}
|
|
2341
2340
|
/** @internal */
|
|
2342
2341
|
_getIdTokenResponse(e) {
|
|
2343
|
-
return
|
|
2342
|
+
return P("not implemented");
|
|
2344
2343
|
}
|
|
2345
2344
|
/** @internal */
|
|
2346
2345
|
_linkToIdToken(e, t) {
|
|
2347
|
-
return
|
|
2346
|
+
return P("not implemented");
|
|
2348
2347
|
}
|
|
2349
2348
|
/** @internal */
|
|
2350
2349
|
_getReauthenticationResolver(e) {
|
|
2351
|
-
return
|
|
2350
|
+
return P("not implemented");
|
|
2352
2351
|
}
|
|
2353
2352
|
}
|
|
2354
2353
|
/**
|
|
@@ -2367,8 +2366,8 @@ class qt {
|
|
|
2367
2366
|
* See the License for the specific language governing permissions and
|
|
2368
2367
|
* limitations under the License.
|
|
2369
2368
|
*/
|
|
2370
|
-
async function
|
|
2371
|
-
return
|
|
2369
|
+
async function J(n, e) {
|
|
2370
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", Te(n, e));
|
|
2372
2371
|
}
|
|
2373
2372
|
/**
|
|
2374
2373
|
* @license
|
|
@@ -2387,14 +2386,14 @@ async function Y(n, e) {
|
|
|
2387
2386
|
* limitations under the License.
|
|
2388
2387
|
*/
|
|
2389
2388
|
const Wi = "http://localhost";
|
|
2390
|
-
class
|
|
2389
|
+
class G extends zt {
|
|
2391
2390
|
constructor() {
|
|
2392
2391
|
super(...arguments), this.pendingToken = null;
|
|
2393
2392
|
}
|
|
2394
2393
|
/** @internal */
|
|
2395
2394
|
static _fromParams(e) {
|
|
2396
|
-
const t = new
|
|
2397
|
-
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) :
|
|
2395
|
+
const t = new G(e.providerId, e.signInMethod);
|
|
2396
|
+
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(
|
|
2398
2397
|
"argument-error"
|
|
2399
2398
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2400
2399
|
), t;
|
|
@@ -2424,23 +2423,23 @@ class B extends qt {
|
|
|
2424
2423
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2425
2424
|
if (!i || !r)
|
|
2426
2425
|
return null;
|
|
2427
|
-
const o = new
|
|
2426
|
+
const o = new G(i, r);
|
|
2428
2427
|
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;
|
|
2429
2428
|
}
|
|
2430
2429
|
/** @internal */
|
|
2431
2430
|
_getIdTokenResponse(e) {
|
|
2432
2431
|
const t = this.buildRequest();
|
|
2433
|
-
return
|
|
2432
|
+
return J(e, t);
|
|
2434
2433
|
}
|
|
2435
2434
|
/** @internal */
|
|
2436
2435
|
_linkToIdToken(e, t) {
|
|
2437
2436
|
const i = this.buildRequest();
|
|
2438
|
-
return i.idToken = t,
|
|
2437
|
+
return i.idToken = t, J(e, i);
|
|
2439
2438
|
}
|
|
2440
2439
|
/** @internal */
|
|
2441
2440
|
_getReauthenticationResolver(e) {
|
|
2442
2441
|
const t = this.buildRequest();
|
|
2443
|
-
return t.autoCreate = !1,
|
|
2442
|
+
return t.autoCreate = !1, J(e, t);
|
|
2444
2443
|
}
|
|
2445
2444
|
buildRequest() {
|
|
2446
2445
|
const e = {
|
|
@@ -2472,7 +2471,7 @@ class B extends qt {
|
|
|
2472
2471
|
* See the License for the specific language governing permissions and
|
|
2473
2472
|
* limitations under the License.
|
|
2474
2473
|
*/
|
|
2475
|
-
class
|
|
2474
|
+
class qt {
|
|
2476
2475
|
/**
|
|
2477
2476
|
* Constructor for generic OAuth providers.
|
|
2478
2477
|
*
|
|
@@ -2525,7 +2524,7 @@ class Kt {
|
|
|
2525
2524
|
* See the License for the specific language governing permissions and
|
|
2526
2525
|
* limitations under the License.
|
|
2527
2526
|
*/
|
|
2528
|
-
class ce extends
|
|
2527
|
+
class ce extends qt {
|
|
2529
2528
|
constructor() {
|
|
2530
2529
|
super(...arguments), this.scopes = [];
|
|
2531
2530
|
}
|
|
@@ -2580,7 +2579,7 @@ class x extends ce {
|
|
|
2580
2579
|
* @param accessToken - Facebook access token.
|
|
2581
2580
|
*/
|
|
2582
2581
|
static credential(e) {
|
|
2583
|
-
return
|
|
2582
|
+
return G._fromParams({
|
|
2584
2583
|
providerId: x.PROVIDER_ID,
|
|
2585
2584
|
signInMethod: x.FACEBOOK_SIGN_IN_METHOD,
|
|
2586
2585
|
accessToken: e
|
|
@@ -2652,7 +2651,7 @@ class F extends ce {
|
|
|
2652
2651
|
* @param accessToken - Google access token.
|
|
2653
2652
|
*/
|
|
2654
2653
|
static credential(e, t) {
|
|
2655
|
-
return
|
|
2654
|
+
return G._fromParams({
|
|
2656
2655
|
providerId: F.PROVIDER_ID,
|
|
2657
2656
|
signInMethod: F.GOOGLE_SIGN_IN_METHOD,
|
|
2658
2657
|
idToken: e,
|
|
@@ -2720,7 +2719,7 @@ class V extends ce {
|
|
|
2720
2719
|
* @param accessToken - Github access token.
|
|
2721
2720
|
*/
|
|
2722
2721
|
static credential(e) {
|
|
2723
|
-
return
|
|
2722
|
+
return G._fromParams({
|
|
2724
2723
|
providerId: V.PROVIDER_ID,
|
|
2725
2724
|
signInMethod: V.GITHUB_SIGN_IN_METHOD,
|
|
2726
2725
|
accessToken: e
|
|
@@ -2785,7 +2784,7 @@ class $ extends ce {
|
|
|
2785
2784
|
* @param secret - Twitter secret.
|
|
2786
2785
|
*/
|
|
2787
2786
|
static credential(e, t) {
|
|
2788
|
-
return
|
|
2787
|
+
return G._fromParams({
|
|
2789
2788
|
providerId: $.PROVIDER_ID,
|
|
2790
2789
|
signInMethod: $.TWITTER_SIGN_IN_METHOD,
|
|
2791
2790
|
oauthToken: e,
|
|
@@ -2840,13 +2839,13 @@ $.PROVIDER_ID = "twitter.com";
|
|
|
2840
2839
|
* See the License for the specific language governing permissions and
|
|
2841
2840
|
* limitations under the License.
|
|
2842
2841
|
*/
|
|
2843
|
-
class
|
|
2842
|
+
class B {
|
|
2844
2843
|
constructor(e) {
|
|
2845
2844
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2846
2845
|
}
|
|
2847
2846
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2848
|
-
const s = await
|
|
2849
|
-
return new
|
|
2847
|
+
const s = await C._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2848
|
+
return new B({
|
|
2850
2849
|
user: s,
|
|
2851
2850
|
providerId: o,
|
|
2852
2851
|
_tokenResponse: i,
|
|
@@ -2860,7 +2859,7 @@ class G {
|
|
|
2860
2859
|
!0
|
|
2861
2860
|
);
|
|
2862
2861
|
const r = lt(i);
|
|
2863
|
-
return new
|
|
2862
|
+
return new B({
|
|
2864
2863
|
user: e,
|
|
2865
2864
|
providerId: r,
|
|
2866
2865
|
_tokenResponse: i,
|
|
@@ -2901,14 +2900,14 @@ class Ie extends Ve {
|
|
|
2901
2900
|
return new Ie(e, t, i, r);
|
|
2902
2901
|
}
|
|
2903
2902
|
}
|
|
2904
|
-
function
|
|
2903
|
+
function Kt(n, e, t, i) {
|
|
2905
2904
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2906
2905
|
throw s.code === "auth/multi-factor-auth-required" ? Ie._fromErrorAndOperation(n, s, e, i) : s;
|
|
2907
2906
|
});
|
|
2908
2907
|
}
|
|
2909
2908
|
async function ji(n, e, t = !1) {
|
|
2910
2909
|
const i = await re(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2911
|
-
return
|
|
2910
|
+
return B._forOperation(n, "link", i);
|
|
2912
2911
|
}
|
|
2913
2912
|
/**
|
|
2914
2913
|
* @license
|
|
@@ -2926,13 +2925,13 @@ async function ji(n, e, t = !1) {
|
|
|
2926
2925
|
* See the License for the specific language governing permissions and
|
|
2927
2926
|
* limitations under the License.
|
|
2928
2927
|
*/
|
|
2929
|
-
async function
|
|
2928
|
+
async function Gi(n, e, t = !1) {
|
|
2930
2929
|
const { auth: i } = n;
|
|
2931
|
-
if (
|
|
2930
|
+
if (A(i.app))
|
|
2932
2931
|
return Promise.reject(H(i));
|
|
2933
2932
|
const r = "reauthenticate";
|
|
2934
2933
|
try {
|
|
2935
|
-
const s = await re(n,
|
|
2934
|
+
const s = await re(n, Kt(i, r, e, n), t);
|
|
2936
2935
|
u(
|
|
2937
2936
|
s.idToken,
|
|
2938
2937
|
i,
|
|
@@ -2952,9 +2951,9 @@ async function Bi(n, e, t = !1) {
|
|
|
2952
2951
|
i,
|
|
2953
2952
|
"user-mismatch"
|
|
2954
2953
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2955
|
-
),
|
|
2954
|
+
), B._forOperation(n, r, s);
|
|
2956
2955
|
} catch (s) {
|
|
2957
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2956
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && O(
|
|
2958
2957
|
i,
|
|
2959
2958
|
"user-mismatch"
|
|
2960
2959
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2977,10 +2976,10 @@ async function Bi(n, e, t = !1) {
|
|
|
2977
2976
|
* See the License for the specific language governing permissions and
|
|
2978
2977
|
* limitations under the License.
|
|
2979
2978
|
*/
|
|
2980
|
-
async function
|
|
2981
|
-
if (
|
|
2979
|
+
async function Bi(n, e, t = !1) {
|
|
2980
|
+
if (A(n.app))
|
|
2982
2981
|
return Promise.reject(H(n));
|
|
2983
|
-
const i = "signIn", r = await
|
|
2982
|
+
const i = "signIn", r = await Kt(n, i, e), s = await B._fromIdTokenResponse(n, i, r);
|
|
2984
2983
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2985
2984
|
}
|
|
2986
2985
|
/**
|
|
@@ -3000,7 +2999,7 @@ async function Gi(n, e, t = !1) {
|
|
|
3000
2999
|
* limitations under the License.
|
|
3001
3000
|
*/
|
|
3002
3001
|
async function zi(n, e) {
|
|
3003
|
-
return
|
|
3002
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", Te(n, e));
|
|
3004
3003
|
}
|
|
3005
3004
|
/**
|
|
3006
3005
|
* @license
|
|
@@ -3019,19 +3018,19 @@ async function zi(n, e) {
|
|
|
3019
3018
|
* limitations under the License.
|
|
3020
3019
|
*/
|
|
3021
3020
|
async function qi(n, e) {
|
|
3022
|
-
if (
|
|
3021
|
+
if (A(n.app))
|
|
3023
3022
|
return Promise.reject(H(n));
|
|
3024
3023
|
const t = be(n), i = await zi(t, {
|
|
3025
3024
|
token: e,
|
|
3026
3025
|
returnSecureToken: !0
|
|
3027
|
-
}), r = await
|
|
3026
|
+
}), r = await B._fromIdTokenResponse(t, "signIn", i);
|
|
3028
3027
|
return await t._updateCurrentUser(r.user), r;
|
|
3029
3028
|
}
|
|
3030
3029
|
function Ki(n, e, t, i) {
|
|
3031
|
-
return
|
|
3030
|
+
return X(n).onIdTokenChanged(e, t, i);
|
|
3032
3031
|
}
|
|
3033
3032
|
function Ji(n, e, t) {
|
|
3034
|
-
return
|
|
3033
|
+
return X(n).beforeAuthStateChanged(e, t);
|
|
3035
3034
|
}
|
|
3036
3035
|
const ye = "__sak";
|
|
3037
3036
|
/**
|
|
@@ -3050,7 +3049,7 @@ const ye = "__sak";
|
|
|
3050
3049
|
* See the License for the specific language governing permissions and
|
|
3051
3050
|
* limitations under the License.
|
|
3052
3051
|
*/
|
|
3053
|
-
class
|
|
3052
|
+
class Jt {
|
|
3054
3053
|
constructor(e, t) {
|
|
3055
3054
|
this.storageRetriever = e, this.type = t;
|
|
3056
3055
|
}
|
|
@@ -3092,17 +3091,17 @@ class Yt {
|
|
|
3092
3091
|
* limitations under the License.
|
|
3093
3092
|
*/
|
|
3094
3093
|
function Yi() {
|
|
3095
|
-
const n =
|
|
3096
|
-
return
|
|
3094
|
+
const n = w();
|
|
3095
|
+
return Ge(n) || ke(n);
|
|
3097
3096
|
}
|
|
3098
3097
|
const Xi = 1e3, Qi = 10;
|
|
3099
|
-
class
|
|
3098
|
+
class Yt extends Jt {
|
|
3100
3099
|
constructor() {
|
|
3101
3100
|
super(
|
|
3102
3101
|
() => window.localStorage,
|
|
3103
3102
|
"LOCAL"
|
|
3104
3103
|
/* PersistenceType.LOCAL */
|
|
3105
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = Yi() && Ri(), this.fallbackToPolling =
|
|
3104
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = Yi() && Ri(), this.fallbackToPolling = jt(), this._shouldAllowMigration = !0;
|
|
3106
3105
|
}
|
|
3107
3106
|
forAllChangedKeys(e) {
|
|
3108
3107
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -3180,8 +3179,8 @@ class Xt extends Yt {
|
|
|
3180
3179
|
await super._remove(e), delete this.localCache[e];
|
|
3181
3180
|
}
|
|
3182
3181
|
}
|
|
3183
|
-
|
|
3184
|
-
const Zi =
|
|
3182
|
+
Yt.type = "LOCAL";
|
|
3183
|
+
const Zi = Yt;
|
|
3185
3184
|
/**
|
|
3186
3185
|
* @license
|
|
3187
3186
|
* Copyright 2020 Google LLC
|
|
@@ -3198,7 +3197,7 @@ const Zi = Xt;
|
|
|
3198
3197
|
* See the License for the specific language governing permissions and
|
|
3199
3198
|
* limitations under the License.
|
|
3200
3199
|
*/
|
|
3201
|
-
class
|
|
3200
|
+
class Xt extends Jt {
|
|
3202
3201
|
constructor() {
|
|
3203
3202
|
super(
|
|
3204
3203
|
() => window.sessionStorage,
|
|
@@ -3211,8 +3210,8 @@ class Qt extends Yt {
|
|
|
3211
3210
|
_removeListener(e, t) {
|
|
3212
3211
|
}
|
|
3213
3212
|
}
|
|
3214
|
-
|
|
3215
|
-
const
|
|
3213
|
+
Xt.type = "SESSION";
|
|
3214
|
+
const Qt = Xt;
|
|
3216
3215
|
/**
|
|
3217
3216
|
* @license
|
|
3218
3217
|
* Copyright 2019 Google LLC
|
|
@@ -3403,7 +3402,7 @@ class tr {
|
|
|
3403
3402
|
return new Promise((c, a) => {
|
|
3404
3403
|
const l = ze("", 20);
|
|
3405
3404
|
r.port1.start();
|
|
3406
|
-
const
|
|
3405
|
+
const d = setTimeout(() => {
|
|
3407
3406
|
a(new Error(
|
|
3408
3407
|
"unsupported_event"
|
|
3409
3408
|
/* _MessageError.UNSUPPORTED_EVENT */
|
|
@@ -3412,11 +3411,11 @@ class tr {
|
|
|
3412
3411
|
o = {
|
|
3413
3412
|
messageChannel: r,
|
|
3414
3413
|
onMessage(m) {
|
|
3415
|
-
const
|
|
3416
|
-
if (
|
|
3417
|
-
switch (
|
|
3414
|
+
const y = m;
|
|
3415
|
+
if (y.data.eventId === l)
|
|
3416
|
+
switch (y.data.status) {
|
|
3418
3417
|
case "ack":
|
|
3419
|
-
clearTimeout(
|
|
3418
|
+
clearTimeout(d), s = setTimeout(
|
|
3420
3419
|
() => {
|
|
3421
3420
|
a(new Error(
|
|
3422
3421
|
"timeout"
|
|
@@ -3428,10 +3427,10 @@ class tr {
|
|
|
3428
3427
|
);
|
|
3429
3428
|
break;
|
|
3430
3429
|
case "done":
|
|
3431
|
-
clearTimeout(s), c(
|
|
3430
|
+
clearTimeout(s), c(y.data.response);
|
|
3432
3431
|
break;
|
|
3433
3432
|
default:
|
|
3434
|
-
clearTimeout(
|
|
3433
|
+
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
3435
3434
|
"invalid_response"
|
|
3436
3435
|
/* _MessageError.INVALID_RESPONSE */
|
|
3437
3436
|
));
|
|
@@ -3464,11 +3463,11 @@ class tr {
|
|
|
3464
3463
|
* See the License for the specific language governing permissions and
|
|
3465
3464
|
* limitations under the License.
|
|
3466
3465
|
*/
|
|
3467
|
-
function
|
|
3466
|
+
function E() {
|
|
3468
3467
|
return window;
|
|
3469
3468
|
}
|
|
3470
3469
|
function nr(n) {
|
|
3471
|
-
|
|
3470
|
+
E().location.href = n;
|
|
3472
3471
|
}
|
|
3473
3472
|
/**
|
|
3474
3473
|
* @license
|
|
@@ -3486,8 +3485,8 @@ function nr(n) {
|
|
|
3486
3485
|
* See the License for the specific language governing permissions and
|
|
3487
3486
|
* limitations under the License.
|
|
3488
3487
|
*/
|
|
3489
|
-
function
|
|
3490
|
-
return typeof
|
|
3488
|
+
function Zt() {
|
|
3489
|
+
return typeof E().WorkerGlobalScope < "u" && typeof E().importScripts == "function";
|
|
3491
3490
|
}
|
|
3492
3491
|
async function ir() {
|
|
3493
3492
|
if (!(navigator != null && navigator.serviceWorker))
|
|
@@ -3503,7 +3502,7 @@ function rr() {
|
|
|
3503
3502
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3504
3503
|
}
|
|
3505
3504
|
function sr() {
|
|
3506
|
-
return
|
|
3505
|
+
return Zt() ? self : null;
|
|
3507
3506
|
}
|
|
3508
3507
|
/**
|
|
3509
3508
|
* @license
|
|
@@ -3521,7 +3520,7 @@ function sr() {
|
|
|
3521
3520
|
* See the License for the specific language governing permissions and
|
|
3522
3521
|
* limitations under the License.
|
|
3523
3522
|
*/
|
|
3524
|
-
const
|
|
3523
|
+
const en = "firebaseLocalStorageDb", or = 1, we = "firebaseLocalStorage", tn = "fbase_key";
|
|
3525
3524
|
class le {
|
|
3526
3525
|
constructor(e) {
|
|
3527
3526
|
this.request = e;
|
|
@@ -3540,18 +3539,18 @@ function Se(n, e) {
|
|
|
3540
3539
|
return n.transaction([we], e ? "readwrite" : "readonly").objectStore(we);
|
|
3541
3540
|
}
|
|
3542
3541
|
function ar() {
|
|
3543
|
-
const n = indexedDB.deleteDatabase(
|
|
3542
|
+
const n = indexedDB.deleteDatabase(en);
|
|
3544
3543
|
return new le(n).toPromise();
|
|
3545
3544
|
}
|
|
3546
3545
|
function De() {
|
|
3547
|
-
const n = indexedDB.open(
|
|
3546
|
+
const n = indexedDB.open(en, or);
|
|
3548
3547
|
return new Promise((e, t) => {
|
|
3549
3548
|
n.addEventListener("error", () => {
|
|
3550
3549
|
t(n.error);
|
|
3551
3550
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3552
3551
|
const i = n.result;
|
|
3553
3552
|
try {
|
|
3554
|
-
i.createObjectStore(we, { keyPath:
|
|
3553
|
+
i.createObjectStore(we, { keyPath: tn });
|
|
3555
3554
|
} catch (r) {
|
|
3556
3555
|
t(r);
|
|
3557
3556
|
}
|
|
@@ -3563,7 +3562,7 @@ function De() {
|
|
|
3563
3562
|
}
|
|
3564
3563
|
async function ut(n, e, t) {
|
|
3565
3564
|
const i = Se(n, !0).put({
|
|
3566
|
-
[
|
|
3565
|
+
[tn]: e,
|
|
3567
3566
|
value: t
|
|
3568
3567
|
});
|
|
3569
3568
|
return new le(i).toPromise();
|
|
@@ -3577,7 +3576,7 @@ function dt(n, e) {
|
|
|
3577
3576
|
return new le(t).toPromise();
|
|
3578
3577
|
}
|
|
3579
3578
|
const lr = 800, ur = 3;
|
|
3580
|
-
class
|
|
3579
|
+
class nn {
|
|
3581
3580
|
constructor() {
|
|
3582
3581
|
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(() => {
|
|
3583
3582
|
}, () => {
|
|
@@ -3603,7 +3602,7 @@ class rn {
|
|
|
3603
3602
|
* postMessage interface to send these events to the worker ourselves.
|
|
3604
3603
|
*/
|
|
3605
3604
|
async initializeServiceWorkerMessaging() {
|
|
3606
|
-
return
|
|
3605
|
+
return Zt() ? this.initializeReceiver() : this.initializeSender();
|
|
3607
3606
|
}
|
|
3608
3607
|
/**
|
|
3609
3608
|
* As the worker we should listen to events from the main window.
|
|
@@ -3726,8 +3725,8 @@ class rn {
|
|
|
3726
3725
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
|
3727
3726
|
}
|
|
3728
3727
|
}
|
|
3729
|
-
|
|
3730
|
-
const dr =
|
|
3728
|
+
nn.type = "LOCAL";
|
|
3729
|
+
const dr = nn;
|
|
3731
3730
|
new ae(3e4, 6e4);
|
|
3732
3731
|
/**
|
|
3733
3732
|
* @license
|
|
@@ -3746,7 +3745,7 @@ new ae(3e4, 6e4);
|
|
|
3746
3745
|
* limitations under the License.
|
|
3747
3746
|
*/
|
|
3748
3747
|
function hr(n, e) {
|
|
3749
|
-
return e ?
|
|
3748
|
+
return e ? N(e) : (u(
|
|
3750
3749
|
n._popupRedirectResolver,
|
|
3751
3750
|
n,
|
|
3752
3751
|
"argument-error"
|
|
@@ -3769,7 +3768,7 @@ function hr(n, e) {
|
|
|
3769
3768
|
* See the License for the specific language governing permissions and
|
|
3770
3769
|
* limitations under the License.
|
|
3771
3770
|
*/
|
|
3772
|
-
class qe extends
|
|
3771
|
+
class qe extends zt {
|
|
3773
3772
|
constructor(e) {
|
|
3774
3773
|
super(
|
|
3775
3774
|
"custom",
|
|
@@ -3778,13 +3777,13 @@ class qe extends qt {
|
|
|
3778
3777
|
), this.params = e;
|
|
3779
3778
|
}
|
|
3780
3779
|
_getIdTokenResponse(e) {
|
|
3781
|
-
return
|
|
3780
|
+
return J(e, this._buildIdpRequest());
|
|
3782
3781
|
}
|
|
3783
3782
|
_linkToIdToken(e, t) {
|
|
3784
|
-
return
|
|
3783
|
+
return J(e, this._buildIdpRequest(t));
|
|
3785
3784
|
}
|
|
3786
3785
|
_getReauthenticationResolver(e) {
|
|
3787
|
-
return
|
|
3786
|
+
return J(e, this._buildIdpRequest());
|
|
3788
3787
|
}
|
|
3789
3788
|
_buildIdpRequest(e) {
|
|
3790
3789
|
const t = {
|
|
@@ -3800,7 +3799,7 @@ class qe extends qt {
|
|
|
3800
3799
|
}
|
|
3801
3800
|
}
|
|
3802
3801
|
function fr(n) {
|
|
3803
|
-
return
|
|
3802
|
+
return Bi(n.auth, new qe(n), n.bypassAuthState);
|
|
3804
3803
|
}
|
|
3805
3804
|
function pr(n) {
|
|
3806
3805
|
const { auth: e, user: t } = n;
|
|
@@ -3809,7 +3808,7 @@ function pr(n) {
|
|
|
3809
3808
|
e,
|
|
3810
3809
|
"internal-error"
|
|
3811
3810
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3812
|
-
),
|
|
3811
|
+
), Gi(t, new qe(n), n.bypassAuthState);
|
|
3813
3812
|
}
|
|
3814
3813
|
async function mr(n) {
|
|
3815
3814
|
const { auth: e, user: t } = n;
|
|
@@ -3836,7 +3835,7 @@ async function mr(n) {
|
|
|
3836
3835
|
* See the License for the specific language governing permissions and
|
|
3837
3836
|
* limitations under the License.
|
|
3838
3837
|
*/
|
|
3839
|
-
class
|
|
3838
|
+
class rn {
|
|
3840
3839
|
constructor(e, t, i, r, s = !1) {
|
|
3841
3840
|
this.auth = e, this.resolver = i, this.user = r, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
|
3842
3841
|
}
|
|
@@ -3886,7 +3885,7 @@ class sn {
|
|
|
3886
3885
|
case "reauthViaRedirect":
|
|
3887
3886
|
return pr;
|
|
3888
3887
|
default:
|
|
3889
|
-
|
|
3888
|
+
O(
|
|
3890
3889
|
this.auth,
|
|
3891
3890
|
"internal-error"
|
|
3892
3891
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3894,10 +3893,10 @@ class sn {
|
|
|
3894
3893
|
}
|
|
3895
3894
|
}
|
|
3896
3895
|
resolve(e) {
|
|
3897
|
-
|
|
3896
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3898
3897
|
}
|
|
3899
3898
|
reject(e) {
|
|
3900
|
-
|
|
3899
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3901
3900
|
}
|
|
3902
3901
|
unregisterAndCleanUp() {
|
|
3903
3902
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3920,7 +3919,7 @@ class sn {
|
|
|
3920
3919
|
* limitations under the License.
|
|
3921
3920
|
*/
|
|
3922
3921
|
const gr = new ae(2e3, 1e4);
|
|
3923
|
-
class z extends
|
|
3922
|
+
class z extends rn {
|
|
3924
3923
|
constructor(e, t, i, r, s) {
|
|
3925
3924
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, z.currentPopupAction && z.currentPopupAction.cancel(), z.currentPopupAction = this;
|
|
3926
3925
|
}
|
|
@@ -3934,7 +3933,7 @@ class z extends sn {
|
|
|
3934
3933
|
), e;
|
|
3935
3934
|
}
|
|
3936
3935
|
async onExecution() {
|
|
3937
|
-
|
|
3936
|
+
L(this.filter.length === 1, "Popup operations only handle one event");
|
|
3938
3937
|
const e = ze();
|
|
3939
3938
|
this.authWindow = await this.resolver._openPopup(
|
|
3940
3939
|
this.auth,
|
|
@@ -3945,7 +3944,7 @@ class z extends sn {
|
|
|
3945
3944
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3946
3945
|
this.reject(t);
|
|
3947
3946
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3948
|
-
t || this.reject(
|
|
3947
|
+
t || this.reject(b(
|
|
3949
3948
|
this.auth,
|
|
3950
3949
|
"web-storage-unsupported"
|
|
3951
3950
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3957,7 +3956,7 @@ class z extends sn {
|
|
|
3957
3956
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3958
3957
|
}
|
|
3959
3958
|
cancel() {
|
|
3960
|
-
this.reject(
|
|
3959
|
+
this.reject(b(
|
|
3961
3960
|
this.auth,
|
|
3962
3961
|
"cancelled-popup-request"
|
|
3963
3962
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
@@ -3972,7 +3971,7 @@ class z extends sn {
|
|
|
3972
3971
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3973
3972
|
this.pollId = window.setTimeout(
|
|
3974
3973
|
() => {
|
|
3975
|
-
this.pollId = null, this.reject(
|
|
3974
|
+
this.pollId = null, this.reject(b(
|
|
3976
3975
|
this.auth,
|
|
3977
3976
|
"popup-closed-by-user"
|
|
3978
3977
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -4006,7 +4005,7 @@ z.currentPopupAction = null;
|
|
|
4006
4005
|
* limitations under the License.
|
|
4007
4006
|
*/
|
|
4008
4007
|
const _r = "pendingRedirect", fe = /* @__PURE__ */ new Map();
|
|
4009
|
-
class vr extends
|
|
4008
|
+
class vr extends rn {
|
|
4010
4009
|
constructor(e, t, i = !1) {
|
|
4011
4010
|
super(e, [
|
|
4012
4011
|
"signInViaRedirect",
|
|
@@ -4063,13 +4062,13 @@ function yr(n, e) {
|
|
|
4063
4062
|
fe.set(n._key(), e);
|
|
4064
4063
|
}
|
|
4065
4064
|
function wr(n) {
|
|
4066
|
-
return
|
|
4065
|
+
return N(n._redirectPersistence);
|
|
4067
4066
|
}
|
|
4068
4067
|
function Tr(n) {
|
|
4069
4068
|
return he(_r, n.config.apiKey, n.name);
|
|
4070
4069
|
}
|
|
4071
4070
|
async function kr(n, e, t = !1) {
|
|
4072
|
-
if (
|
|
4071
|
+
if (A(n.app))
|
|
4073
4072
|
return Promise.reject(H(n));
|
|
4074
4073
|
const i = be(n), r = hr(i, e), o = await new vr(i, r, t).execute();
|
|
4075
4074
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
@@ -4111,9 +4110,9 @@ class Er {
|
|
|
4111
4110
|
}
|
|
4112
4111
|
sendToConsumer(e, t) {
|
|
4113
4112
|
var i;
|
|
4114
|
-
if (e.error && !
|
|
4113
|
+
if (e.error && !sn(e)) {
|
|
4115
4114
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
4116
|
-
t.onError(
|
|
4115
|
+
t.onError(b(this.auth, r));
|
|
4117
4116
|
} else
|
|
4118
4117
|
t.onAuthEvent(e);
|
|
4119
4118
|
}
|
|
@@ -4131,7 +4130,7 @@ class Er {
|
|
|
4131
4130
|
function ht(n) {
|
|
4132
4131
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
4133
4132
|
}
|
|
4134
|
-
function
|
|
4133
|
+
function sn({ type: n, error: e }) {
|
|
4135
4134
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
4136
4135
|
}
|
|
4137
4136
|
function Sr(n) {
|
|
@@ -4141,7 +4140,7 @@ function Sr(n) {
|
|
|
4141
4140
|
case "reauthViaRedirect":
|
|
4142
4141
|
return !0;
|
|
4143
4142
|
case "unknown":
|
|
4144
|
-
return
|
|
4143
|
+
return sn(n);
|
|
4145
4144
|
default:
|
|
4146
4145
|
return !1;
|
|
4147
4146
|
}
|
|
@@ -4163,7 +4162,7 @@ function Sr(n) {
|
|
|
4163
4162
|
* limitations under the License.
|
|
4164
4163
|
*/
|
|
4165
4164
|
async function Rr(n, e = {}) {
|
|
4166
|
-
return
|
|
4165
|
+
return Q(n, "GET", "/v1/projects", e);
|
|
4167
4166
|
}
|
|
4168
4167
|
/**
|
|
4169
4168
|
* @license
|
|
@@ -4192,7 +4191,7 @@ async function Cr(n) {
|
|
|
4192
4191
|
return;
|
|
4193
4192
|
} catch {
|
|
4194
4193
|
}
|
|
4195
|
-
|
|
4194
|
+
O(
|
|
4196
4195
|
n,
|
|
4197
4196
|
"unauthorized-domain"
|
|
4198
4197
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
@@ -4229,7 +4228,7 @@ function Nr(n) {
|
|
|
4229
4228
|
*/
|
|
4230
4229
|
const Or = new ae(3e4, 6e4);
|
|
4231
4230
|
function ft() {
|
|
4232
|
-
const n =
|
|
4231
|
+
const n = E().___jsl;
|
|
4233
4232
|
if (n != null && n.H) {
|
|
4234
4233
|
for (const e of Object.keys(n.H))
|
|
4235
4234
|
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)
|
|
@@ -4246,7 +4245,7 @@ function Lr(n) {
|
|
|
4246
4245
|
e(gapi.iframes.getContext());
|
|
4247
4246
|
},
|
|
4248
4247
|
ontimeout: () => {
|
|
4249
|
-
ft(), t(
|
|
4248
|
+
ft(), t(b(
|
|
4250
4249
|
n,
|
|
4251
4250
|
"network-request-failed"
|
|
4252
4251
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
@@ -4255,14 +4254,14 @@ function Lr(n) {
|
|
|
4255
4254
|
timeout: Or.get()
|
|
4256
4255
|
});
|
|
4257
4256
|
}
|
|
4258
|
-
if (!((r = (i =
|
|
4257
|
+
if (!((r = (i = E().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4259
4258
|
e(gapi.iframes.getContext());
|
|
4260
|
-
else if (!((s =
|
|
4259
|
+
else if (!((s = E().gapi) === null || s === void 0) && s.load)
|
|
4261
4260
|
o();
|
|
4262
4261
|
else {
|
|
4263
4262
|
const c = Di("iframefcb");
|
|
4264
|
-
return
|
|
4265
|
-
gapi.load ? o() : t(
|
|
4263
|
+
return E()[c] = () => {
|
|
4264
|
+
gapi.load ? o() : t(b(
|
|
4266
4265
|
n,
|
|
4267
4266
|
"network-request-failed"
|
|
4268
4267
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
@@ -4326,7 +4325,7 @@ function $r(n) {
|
|
|
4326
4325
|
return s.length && (i.fw = s.join(",")), `${t}?${oe(i).slice(1)}`;
|
|
4327
4326
|
}
|
|
4328
4327
|
async function Hr(n) {
|
|
4329
|
-
const e = await Mr(n), t =
|
|
4328
|
+
const e = await Mr(n), t = E().gapi;
|
|
4330
4329
|
return u(
|
|
4331
4330
|
t,
|
|
4332
4331
|
n,
|
|
@@ -4343,15 +4342,15 @@ async function Hr(n) {
|
|
|
4343
4342
|
// Prevent iframe from closing on mouse out.
|
|
4344
4343
|
setHideOnLeave: !1
|
|
4345
4344
|
});
|
|
4346
|
-
const o =
|
|
4345
|
+
const o = b(
|
|
4347
4346
|
n,
|
|
4348
4347
|
"network-request-failed"
|
|
4349
4348
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4350
|
-
), c =
|
|
4349
|
+
), c = E().setTimeout(() => {
|
|
4351
4350
|
s(o);
|
|
4352
4351
|
}, Ur.get());
|
|
4353
4352
|
function a() {
|
|
4354
|
-
|
|
4353
|
+
E().clearTimeout(c), r(i);
|
|
4355
4354
|
}
|
|
4356
4355
|
i.ping(a).then(a, () => {
|
|
4357
4356
|
s(o);
|
|
@@ -4379,7 +4378,7 @@ const Wr = {
|
|
|
4379
4378
|
resizable: "yes",
|
|
4380
4379
|
statusbar: "yes",
|
|
4381
4380
|
toolbar: "no"
|
|
4382
|
-
}, jr = 500,
|
|
4381
|
+
}, jr = 500, Gr = 600, Br = "_blank", zr = "http://localhost";
|
|
4383
4382
|
class pt {
|
|
4384
4383
|
constructor(e) {
|
|
4385
4384
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4392,7 +4391,7 @@ class pt {
|
|
|
4392
4391
|
}
|
|
4393
4392
|
}
|
|
4394
4393
|
}
|
|
4395
|
-
function qr(n, e, t, i = jr, r =
|
|
4394
|
+
function qr(n, e, t, i = jr, r = Gr) {
|
|
4396
4395
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4397
4396
|
let c = "";
|
|
4398
4397
|
const a = Object.assign(Object.assign({}, Wr), {
|
|
@@ -4400,12 +4399,12 @@ function qr(n, e, t, i = jr, r = Br) {
|
|
|
4400
4399
|
height: r.toString(),
|
|
4401
4400
|
top: s,
|
|
4402
4401
|
left: o
|
|
4403
|
-
}), l =
|
|
4404
|
-
t && (c =
|
|
4405
|
-
const
|
|
4402
|
+
}), l = w().toLowerCase();
|
|
4403
|
+
t && (c = Ft(l) ? Br : t), xt(l) && (e = e || zr, a.scrollbars = "yes");
|
|
4404
|
+
const d = Object.entries(a).reduce((y, [T, h]) => `${y}${T}=${h},`, "");
|
|
4406
4405
|
if (Ei(l) && c !== "_self")
|
|
4407
4406
|
return Kr(e || "", c), new pt(null);
|
|
4408
|
-
const m = window.open(e || "", c,
|
|
4407
|
+
const m = window.open(e || "", c, d);
|
|
4409
4408
|
u(
|
|
4410
4409
|
m,
|
|
4411
4410
|
n,
|
|
@@ -4461,19 +4460,19 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4461
4460
|
v: se,
|
|
4462
4461
|
eventId: r
|
|
4463
4462
|
};
|
|
4464
|
-
if (e instanceof
|
|
4463
|
+
if (e instanceof qt) {
|
|
4465
4464
|
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", Un(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4466
|
-
for (const [
|
|
4467
|
-
o[
|
|
4465
|
+
for (const [d, m] of Object.entries({}))
|
|
4466
|
+
o[d] = m;
|
|
4468
4467
|
}
|
|
4469
4468
|
if (e instanceof ce) {
|
|
4470
|
-
const
|
|
4471
|
-
|
|
4469
|
+
const d = e.getScopes().filter((m) => m !== "");
|
|
4470
|
+
d.length > 0 && (o.scopes = d.join(","));
|
|
4472
4471
|
}
|
|
4473
4472
|
n.tenantId && (o.tid = n.tenantId);
|
|
4474
4473
|
const c = o;
|
|
4475
|
-
for (const
|
|
4476
|
-
c[
|
|
4474
|
+
for (const d of Object.keys(c))
|
|
4475
|
+
c[d] === void 0 && delete c[d];
|
|
4477
4476
|
const a = await n._getAppCheckToken(), l = a ? `#${Xr}=${encodeURIComponent(a)}` : "";
|
|
4478
4477
|
return `${Qr(n)}?${oe(c).slice(1)}${l}`;
|
|
4479
4478
|
}
|
|
@@ -4499,13 +4498,13 @@ function Qr({ config: n }) {
|
|
|
4499
4498
|
const Ne = "webStorageSupport";
|
|
4500
4499
|
class Zr {
|
|
4501
4500
|
constructor() {
|
|
4502
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4501
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn = kr, this._overrideRedirectResult = yr;
|
|
4503
4502
|
}
|
|
4504
4503
|
// Wrapping in async even though we don't await anywhere in order
|
|
4505
4504
|
// to make sure errors are raised as promise rejections
|
|
4506
4505
|
async _openPopup(e, t, i, r) {
|
|
4507
4506
|
var s;
|
|
4508
|
-
|
|
4507
|
+
L((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4509
4508
|
const o = await mt(e, t, i, Me(), r);
|
|
4510
4509
|
return qr(e, o, ze());
|
|
4511
4510
|
}
|
|
@@ -4519,7 +4518,7 @@ class Zr {
|
|
|
4519
4518
|
const t = e._key();
|
|
4520
4519
|
if (this.eventManagers[t]) {
|
|
4521
4520
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4522
|
-
return r ? Promise.resolve(r) : (
|
|
4521
|
+
return r ? Promise.resolve(r) : (L(s, "If manager is not set, promise should be"), s);
|
|
4523
4522
|
}
|
|
4524
4523
|
const i = this.initAndGetManager(e);
|
|
4525
4524
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4542,7 +4541,7 @@ class Zr {
|
|
|
4542
4541
|
this.iframes[e._key()].send(Ne, { type: Ne }, (r) => {
|
|
4543
4542
|
var s;
|
|
4544
4543
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
4545
|
-
o !== void 0 && t(!!o),
|
|
4544
|
+
o !== void 0 && t(!!o), O(
|
|
4546
4545
|
e,
|
|
4547
4546
|
"internal-error"
|
|
4548
4547
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4554,7 +4553,7 @@ class Zr {
|
|
|
4554
4553
|
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Cr(e)), this.originValidationPromises[t];
|
|
4555
4554
|
}
|
|
4556
4555
|
get _shouldInitProactively() {
|
|
4557
|
-
return
|
|
4556
|
+
return jt() || Ge() || ke();
|
|
4558
4557
|
}
|
|
4559
4558
|
}
|
|
4560
4559
|
const es = Zr;
|
|
@@ -4701,7 +4700,7 @@ function is(n) {
|
|
|
4701
4700
|
* See the License for the specific language governing permissions and
|
|
4702
4701
|
* limitations under the License.
|
|
4703
4702
|
*/
|
|
4704
|
-
const rs = 5 * 60, ss =
|
|
4703
|
+
const rs = 5 * 60, ss = kt("authIdTokenMaxAge") || rs;
|
|
4705
4704
|
let vt = null;
|
|
4706
4705
|
const os = (n) => async (e) => {
|
|
4707
4706
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
@@ -4716,7 +4715,7 @@ const os = (n) => async (e) => {
|
|
|
4716
4715
|
}));
|
|
4717
4716
|
};
|
|
4718
4717
|
function as(n = Nn()) {
|
|
4719
|
-
const e =
|
|
4718
|
+
const e = bt(n, "auth");
|
|
4720
4719
|
if (e.isInitialized())
|
|
4721
4720
|
return e.getImmediate();
|
|
4722
4721
|
const t = xi(n, {
|
|
@@ -4724,9 +4723,9 @@ function as(n = Nn()) {
|
|
|
4724
4723
|
persistence: [
|
|
4725
4724
|
dr,
|
|
4726
4725
|
Zi,
|
|
4727
|
-
|
|
4726
|
+
Qt
|
|
4728
4727
|
]
|
|
4729
|
-
}), i =
|
|
4728
|
+
}), i = kt("authTokenSyncURL");
|
|
4730
4729
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4731
4730
|
const s = new URL(i, location.origin);
|
|
4732
4731
|
if (location.origin === s.origin) {
|
|
@@ -4746,7 +4745,7 @@ Li({
|
|
|
4746
4745
|
return new Promise((e, t) => {
|
|
4747
4746
|
const i = document.createElement("script");
|
|
4748
4747
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4749
|
-
const s =
|
|
4748
|
+
const s = b(
|
|
4750
4749
|
"internal-error"
|
|
4751
4750
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4752
4751
|
);
|
|
@@ -4766,67 +4765,51 @@ var ls = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDo
|
|
|
4766
4765
|
const ds = {
|
|
4767
4766
|
key: 2,
|
|
4768
4767
|
class: "h-full w-full"
|
|
4769
|
-
}, hs = ["src"],
|
|
4768
|
+
}, hs = ["src"], Cs = /* @__PURE__ */ xe({
|
|
4770
4769
|
__name: "App",
|
|
4771
4770
|
setup(n) {
|
|
4772
|
-
const e = ge(), t =
|
|
4773
|
-
|
|
4774
|
-
[
|
|
4775
|
-
() => {
|
|
4776
|
-
var d;
|
|
4777
|
-
return (d = h.value) == null ? void 0 : d._id;
|
|
4778
|
-
},
|
|
4779
|
-
() => e.currentCountry.value,
|
|
4780
|
-
() => {
|
|
4781
|
-
var d;
|
|
4782
|
-
return (d = e.sessionUser.value) == null ? void 0 : d.id;
|
|
4783
|
-
}
|
|
4784
|
-
],
|
|
4785
|
-
([d]) => {
|
|
4786
|
-
r.reset(), d && r.read(d);
|
|
4787
|
-
},
|
|
4788
|
-
{ immediate: !0, flush: "sync" }
|
|
4789
|
-
), dn(() => r.reset()), q(
|
|
4771
|
+
const e = ge(), t = pn(), i = mn(), r = In(), s = yn(), o = wt(), c = te(o.query.showHeader !== "false"), a = te(!1), { currentBusiness: l } = ge();
|
|
4772
|
+
ie(
|
|
4790
4773
|
() => {
|
|
4791
|
-
var
|
|
4792
|
-
return (
|
|
4774
|
+
var f;
|
|
4775
|
+
return (f = l.value) == null ? void 0 : f._id;
|
|
4793
4776
|
},
|
|
4794
|
-
(
|
|
4795
|
-
|
|
4777
|
+
(f) => {
|
|
4778
|
+
f && vn(f);
|
|
4796
4779
|
},
|
|
4797
4780
|
{ immediate: !0 }
|
|
4798
4781
|
);
|
|
4799
|
-
const
|
|
4800
|
-
const
|
|
4801
|
-
return `${us.marketingV1Portal}/b/${
|
|
4782
|
+
const d = te(!1), m = Y(() => i.version), y = Y(() => {
|
|
4783
|
+
const f = e.currentCountry.value || "MY", g = tt.getIdToken(), v = l.value._id;
|
|
4784
|
+
return `${us.marketingV1Portal}/b/${v}/marketing/overview?showHeader=false&country=${f}&token=${g}`;
|
|
4802
4785
|
});
|
|
4803
|
-
async function
|
|
4786
|
+
async function T() {
|
|
4804
4787
|
if (Dn().length) {
|
|
4805
4788
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4806
4789
|
return;
|
|
4807
4790
|
}
|
|
4808
|
-
const
|
|
4809
|
-
await qi(
|
|
4791
|
+
const f = xn(ls.firebase), g = await fn.getCustomToken(), v = as();
|
|
4792
|
+
await qi(v, g), Fn(f), console.log("initFirebase", f);
|
|
4810
4793
|
}
|
|
4811
|
-
const
|
|
4812
|
-
|
|
4794
|
+
const h = async () => {
|
|
4795
|
+
d.value = !1, await dn(), console.log("forceRerender"), tt.setBusinessId(l.value._id), await i.readPremium(), !a.value && m.value === "v2" ? e.registerSidebarComponent(Wn) : e.hideSidebarToggle(!0), await T(), a.value = !0, d.value = !0;
|
|
4813
4796
|
};
|
|
4814
|
-
return
|
|
4815
|
-
if (Vn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(
|
|
4816
|
-
const
|
|
4817
|
-
|
|
4797
|
+
return un(() => {
|
|
4798
|
+
if (Vn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4799
|
+
const f = document.getElementsByClassName("app-header")[0], g = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0], M = document.getElementsByTagName("main")[0];
|
|
4800
|
+
f == null || f.classList.add("!hidden"), g == null || g.classList.add("!pt-0"), v == null || v.classList.add("!pt-0"), M == null || M.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4818
4801
|
}
|
|
4819
|
-
|
|
4820
|
-
}),
|
|
4802
|
+
l.value != null && (console.log("App mounted, forceRerender"), h());
|
|
4803
|
+
}), ie(
|
|
4821
4804
|
() => e.currentBusiness.value,
|
|
4822
|
-
async (
|
|
4823
|
-
console.log("Current business changed"),
|
|
4805
|
+
async (f, g) => {
|
|
4806
|
+
console.log("Current business changed"), f != null && f._id != g._id && (console.log("forceRerender when business changes", f, g), h());
|
|
4824
4807
|
}
|
|
4825
|
-
), (
|
|
4826
|
-
_(
|
|
4827
|
-
_(
|
|
4828
|
-
_(
|
|
4829
|
-
|
|
4808
|
+
), (f, g) => (j(), me(It, null, [
|
|
4809
|
+
_(d) && _(m) === "v2" ? (j(), Oe(_(hn), { key: 0 })) : Pe("", !0),
|
|
4810
|
+
_(d) && _(m) === "v2" && _(c) ? (j(), Oe(oi, { key: 1 })) : Pe("", !0),
|
|
4811
|
+
_(d) && _(m) !== "v2" ? (j(), me("div", ds, [
|
|
4812
|
+
S(bn, {
|
|
4830
4813
|
json: { url: _(y) }
|
|
4831
4814
|
}, null, 8, ["json"]),
|
|
4832
4815
|
I("iframe", {
|
|
@@ -4841,5 +4824,5 @@ const ds = {
|
|
|
4841
4824
|
}
|
|
4842
4825
|
});
|
|
4843
4826
|
export {
|
|
4844
|
-
|
|
4827
|
+
Cs as default
|
|
4845
4828
|
};
|