@feedmepos/mf-connect 0.1.98-beta.73 → 0.1.98-beta.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-C4XD_vWL.js → App-BU-KKX-n.js} +550 -526
- package/dist/{AuditLogs-DpevHGsA.js → AuditLogs-CmLqBgj6.js} +15 -13
- package/dist/{Bin-FRrYZ8pV.js → Bin-Zbera_MK.js} +8 -8
- package/dist/{Broadcast-CoefxWt-.js → Broadcast-CYgMTWI5.js} +89 -86
- package/dist/{CampaignAnalytic-CdZjzsLr.js → CampaignAnalytic-UNTkez3N.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DQOLEDzY.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CfaXdAeW.js} +8 -6
- package/dist/{Card-BABL96V6.js → Card-CdoDOGUZ.js} +25 -23
- package/dist/{Collections-D6XuhBO1.js → Collections-CdeMQQCd.js} +8 -8
- package/dist/{Credit-D2WTeN8Z.js → Credit-BAP0k14-.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B0KkvFWi.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CBn5qXw2.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-G2oU70Ef.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bk9ZmCSP.js} +38 -35
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C4RByg0k.js → EffectSheet.vue_vue_type_style_index_0_lang-OUHg9s8b.js} +6 -6
- package/dist/{Experience-CUqmspwT.js → Experience-Dq4FXfGp.js} +87 -84
- package/dist/{FileSaver.min-DX17A8Gj.js → FileSaver.min-CCrEHqr_.js} +1 -1
- package/dist/{Game-D8IvyDdA.js → Game-BjgPoHzZ.js} +13 -13
- package/dist/{GiftCardSetup-BOSKBH8c.js → GiftCardSetup-CLKjBRXP.js} +10 -10
- package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-zCMcelvk.js +417 -0
- package/dist/Goals-B_DvaaRc.js +244 -0
- package/dist/{Grab-CnBGt_H2.js → Grab-C9QKHF9-.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BI00YCKv.js → ImageInput.vue_vue_type_script_setup_true_lang-CYoMZ7Rd.js} +1 -1
- package/dist/{Index-BovDOTbf.js → Index-DjyD4Ukt.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-D8auavm7.js → LocationPicker.vue_vue_type_script_setup_true_lang-D32lT_JS.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BM99IoIG.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C8pCFjzw.js} +1 -1
- package/dist/{LoyaltyDashboard-DiCQnQ76.js → LoyaltyDashboard-gEfgYtBH.js} +1213 -1170
- package/dist/{MainLayout-Cg37dK-P.js → MainLayout-BZd3nvw4.js} +3 -3
- package/dist/{Marketing-DRCT9dBo.js → Marketing-vXzXx-ht.js} +4 -4
- package/dist/{MarketingMaterialEdit-DcE0A8_A.js → MarketingMaterialEdit-CodE48Pa.js} +6 -6
- package/dist/{Member-C8T1-ywK.js → Member-DmjIle-d.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CTl8LtJ9.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BkOC-rzc.js} +27 -25
- package/dist/{MemberImportHistory-CYCxxxN7.js → MemberImportHistory-Ds92Kmv3.js} +7 -7
- package/dist/{MemberList-Ddlnm4JX.js → MemberList-DRAygZjh.js} +14 -14
- package/dist/{MemberTransactions-DwyZTeZb.js → MemberTransactions-COQKjSaO.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BWCxGlQO.js → MessageInput.vue_vue_type_script_setup_true_lang-C1N1Q9KC.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-LdVeH7gh.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-hUZ6DRV3.js} +1 -1
- package/dist/{Mission-CW0y8Bzw.js → Mission-DVEvVeg9.js} +84 -81
- package/dist/{Overview-i2XPL7Pu.js → Overview-Lb2EDuKr.js} +4 -4
- package/dist/{Overview-CO4T3l6l.js → Overview-dKPDCTby.js} +23 -21
- package/dist/{Point-CNWdfqQZ.js → Point-HERJxwkG.js} +108 -99
- package/dist/{Promotion-DAemCP79.js → Promotion-C1O48NJ4.js} +96 -93
- package/dist/{Queue-DI50gMny.js → Queue-CIlcqlHV.js} +15 -13
- package/dist/{Record-DX3WHXku.js → Record-CbAQRpe2.js} +9 -9
- package/dist/{Review-DzSNG4Le.js → Review-C_aPrryB.js} +2 -2
- package/dist/{ReviewFacebookCallback-CrdRUN3t.js → ReviewFacebookCallback-zLjyKeV8.js} +5 -5
- package/dist/{ReviewGoogleCallback-Da28WNzU.js → ReviewGoogleCallback-DzJFf6UO.js} +5 -5
- package/dist/{Reward-DUQAE99I.js → Reward-kLTp1_Ph.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BGAOPkwD.js → RewardGroup.vue_vue_type_script_setup_true_lang-dzsAihqZ.js} +26 -24
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B9Dbe9no.js → RuleGroup.vue_vue_type_script_setup_true_lang-BQDwwF1P.js} +17 -15
- package/dist/{Segment-BgVf2-G2.js → Segment-Blo6pvlP.js} +35 -32
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDLXF5HM.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DI2f-icN.js} +31 -29
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-9UiH43em.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRYqib7b.js} +4 -4
- package/dist/Setting-BqfHAaJ4.js +573 -0
- package/dist/{SettingAdvertisements-C40QcuSn.js → SettingAdvertisements-BBWGPfr6.js} +12 -12
- package/dist/{Settings-DT9bypKs.js → Settings-xIvDU54B.js} +5 -5
- package/dist/{Store-DQyOUfEJ.js → Store-B4LKdCMI.js} +30 -27
- package/dist/{StoreRewards-Dr_c0PbO.js → StoreRewards-DioYcpoB.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bh5h8Lc_.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D8Aomf51.js} +45 -43
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-LquvtnTy.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-zau-k4F2.js} +2 -2
- package/dist/{Tier-DmqfEWcB.js → Tier-Byj8iaqs.js} +915 -922
- package/dist/{Title-Dx6pcJfP.js → Title-B47H9-3j.js} +25 -23
- package/dist/{Transaction-CD6agt6m.js → Transaction-Dv5d9njL.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CNjBtitb.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BuitfoqE.js} +6 -6
- package/dist/Voucher-Cxz8pkd-.js +837 -0
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bv--fzY0.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CyF6pfdh.js} +12 -12
- package/dist/WhatsappBot-DEt2cwdQ.js +577 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bq_7U0NO.js → ZodTextField.vue_vue_type_script_setup_true_lang-CoxyeE0y.js} +2 -2
- package/dist/{app-CmqX1V1B.js → app-Cy05FPyq.js} +1471 -918
- package/dist/app.js +1 -1
- package/dist/{base.export-guVE-B2c.js → base.export-CtX7g_L1.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-DXmGtwPm.js → business-DwhrC6ZF.js} +1 -1
- package/dist/{campaign-CVXbgs-y.js → campaign-BPm7kwff.js} +2 -2
- package/dist/{campaign-D9Jufumh.js → campaign-RHNw7ITA.js} +9 -9
- package/dist/{campaign.enum-CXhYMbkx.js → campaign.enum-Dx-Zo68Q.js} +1 -1
- package/dist/{campaign.fn-DoJPn6yl.js → campaign.fn-Bg4cy9as.js} +77 -77
- package/dist/{collectible.enum-Tk6LIMMm.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-DCVNYQau.js → collection.fn-TRu13bwb.js} +2 -2
- package/dist/{currency-BYhkCI6F.js → currency-B8eK9hdV.js} +1 -1
- package/dist/{duplicateCampaign-BOVBZHFs.js → duplicateCampaign-CGXCaVuj.js} +2 -2
- package/dist/{effect-e6wYWgc8.js → effect-OZ5p9rDk.js} +1 -1
- package/dist/{email-addresses-Dcd_vAeM.js → email-addresses-BZjfvPMn.js} +2 -2
- package/dist/{helper-DluoQ6zi.js → helper-WVL8SABi.js} +1 -1
- package/dist/{index-DB51l5yi.js → index-BGpXgY7W.js} +1 -1
- package/dist/{index-ChYMoLaB.js → index-BY_JWg4s.js} +1 -1
- package/dist/{index-qkkPuNFM.js → index-BrnzIo_o.js} +168 -155
- package/dist/{index-C9JY8Ru6.js → index-BzKV72Cd.js} +2 -2
- package/dist/index-C7RUAv0i.js +167 -0
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-BFzBAm6P.js → index-CcYZyfxy.js} +1 -1
- package/dist/{index-DIP_uzZm.js → index-CdUgMl41.js} +18 -17
- package/dist/{index-DoiGG41P.js → index-CicyjdaK.js} +8 -7
- package/dist/index-Cp2qabkb.js +28 -0
- package/dist/{index-DKrJlWH3.js → index-D5hnwmRx.js} +4 -4
- package/dist/{index-CiJQlOu7.js → index-D755ywwR.js} +11 -9
- package/dist/{index-CDdNExzM.js → index-DQO1iioy.js} +1 -1
- package/dist/{index-C-oypk0K.js → index-DcO-Tg44.js} +8027 -10766
- package/dist/{index-SQItAw7w.js → index-Df6TpLRF.js} +3 -3
- package/dist/{index-CBRWvjup.js → index-DzNxG_QU.js} +1202 -79
- package/dist/{index-2QCDTrA9.js → index-J5zd25r3.js} +2 -2
- package/dist/{index-BpAhyOgv.js → index-KakYLwk1.js} +1 -1
- package/dist/{index-BAs9N7bi.js → index-MRXHlUhf.js} +20 -19
- package/dist/{index-SS72WJs_.js → index-U0xt4ckb.js} +1 -1
- package/dist/{index-kPcRcSFx.js → index-co2uO7IC.js} +2 -2
- package/dist/{index.esm2017-BLVWhb4f.js → index.esm2017-xVDCuu7s.js} +37 -37
- package/dist/{loading-ClX4Z1ZH.js → loading-BiPCW0qK.js} +1 -1
- package/dist/{lodash-Cxh2BWuW.js → lodash-P_PMkPFg.js} +1 -1
- package/dist/{member-import-DKfSDn0D.js → member-import-Dc0ZuxZn.js} +6 -5
- package/dist/{membership-BBAosVNQ.js → membership-GQhLFMct.js} +3 -3
- package/dist/{money-CWzvdiFT.js → money-kIVXcKX4.js} +1 -1
- package/dist/{number-Cp7TGBzd.js → number-D15D84XS.js} +1 -1
- package/dist/{objectid-CXWfUmP_.js → objectid-DbtWoaPC.js} +12 -12
- package/dist/onboarding-B9rm_U_k.js +129 -0
- package/dist/onboardingSetup-DFET-PDE.js +17 -0
- package/dist/{plugins-BKD6oEHa.js → plugins-DrEJvnRW.js} +3 -3
- package/dist/{reward-CrjStT4w.js → reward-C8T99546.js} +1 -1
- package/dist/{rule-CBZRptRM.js → rule-BB_Uo0iG.js} +20 -18
- package/dist/{template-D4qWK9tk.js → template-B7oaySuH.js} +6 -6
- package/dist/{timezone-t0WxSk3e.js → timezone-DN2mMeK6.js} +1 -1
- package/dist/{transaction.fn-DZp6Drqf.js → transaction.fn-BHBTwOI9.js} +2 -2
- package/dist/{trigger-DN5yeimJ.js → trigger-D5xsNhoR.js} +5 -5
- package/dist/{useMarketingMaterialActions-ChkZyyRO.js → useMarketingMaterialActions-CKtANGYF.js} +3 -3
- package/dist/{usePagination-Vda9U5Dh.js → usePagination-Cxv7buJt.js} +1 -1
- package/dist/{user-jEjTV3E6.js → user-CXp-0Sc-.js} +1 -1
- package/dist/{vue-i18n-Bg_RJ_GV.js → vue-i18n-DU1J-6Fe.js} +455 -455
- package/dist/{xlsx-unW4U5Tx.js → xlsx-CaGnvtHp.js} +224 -224
- package/dist/{zod-DIsCEUuE.js → zod-DPK1tAj-.js} +1 -1
- package/package.json +1 -1
- package/dist/Setting-3jW6EbKA.js +0 -2047
- package/dist/Voucher-P4dyOeUd.js +0 -444
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as yt, useRoute as wt, RouterView as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as Tt } from "./vue-i18n-
|
|
9
|
-
import { m as
|
|
10
|
-
import { C as Xe } from "./timezone-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { defineComponent as xe, ref as ee, h as U, Comment as cn, computed as ne, watch as pe, resolveComponent as Z, openBlock as W, createElementBlock as me, createVNode as S, unref as g, createElementVNode as v, toDisplayString as R, createBlock as Oe, withCtx as Q, Fragment as It, renderList as ln, onMounted as un, createCommentVNode as Pe, nextTick as dn } from "vue";
|
|
2
|
+
import { useRouter as yt, useRoute as wt, RouterView as hn } from "vue-router";
|
|
3
|
+
import { useCoreStore as ge, FeedMeAuth as fn } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as pn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as mn } from "./business-DwhrC6ZF.js";
|
|
6
|
+
import "./index-U0xt4ckb.js";
|
|
7
|
+
import { components as j, useSnackbar as gn, useDialog as _n } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Tt } from "./vue-i18n-DU1J-6Fe.js";
|
|
9
|
+
import { m as vn } from "./index-BY_JWg4s.js";
|
|
10
|
+
import { C as Xe } from "./timezone-DN2mMeK6.js";
|
|
11
|
+
import { u as In } from "./onboarding-B9rm_U_k.js";
|
|
12
|
+
import { R as f, A as yn, a as Qe } from "./app-Cy05FPyq.js";
|
|
13
|
+
import { J as wn } from "./JsonViewer-v8_C7l5N.js";
|
|
14
|
+
import { r as Le, L as Tn, g as kt, i as kn, a as bn, _ as Ze, C as et, b as En, S as re, c as A, d as Y, E as Fe, e as Sn, f as bt, h as Rn, j as An, k as Et, l as w, m as Pn, F as Ve, n as Cn, q as se, o as Nn, p as On, s as Ln, t as Mn, u as Un } from "./index.esm2017-xVDCuu7s.js";
|
|
14
15
|
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
15
|
-
import { S as tt, c as
|
|
16
|
-
const
|
|
16
|
+
import { S as tt, c as Dn } from "./index-BzKV72Cd.js";
|
|
17
|
+
const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Vn = /* @__PURE__ */ xe({
|
|
17
18
|
__name: "NavigationTab",
|
|
18
19
|
setup(n) {
|
|
19
|
-
const { t: e } = Tt(),
|
|
20
|
+
const { t: e, locale: t } = Tt(), i = In(), r = ee(), s = [
|
|
20
21
|
{
|
|
21
22
|
label: e("connect.navigation.analytic"),
|
|
22
23
|
value: f["$connect-ANALYTIC"]
|
|
@@ -62,7 +63,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
62
63
|
{
|
|
63
64
|
label: e("connect.navigation.point"),
|
|
64
65
|
value: f["$connect-PROGRAM_POINT"],
|
|
65
|
-
badge: () =>
|
|
66
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
label: e("connect.navigation.credit"),
|
|
@@ -71,7 +72,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
71
72
|
{
|
|
72
73
|
label: e("connect.navigation.game"),
|
|
73
74
|
value: f["$connect-PROGRAM_GAME"],
|
|
74
|
-
badge: () =>
|
|
75
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
label: "Mission",
|
|
@@ -90,19 +91,24 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
90
91
|
{
|
|
91
92
|
label: e("connect.navigation.segments"),
|
|
92
93
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
93
|
-
badge: () =>
|
|
94
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
label: e("connect.navigation.card"),
|
|
97
98
|
value: f["$connect-LOYALTY_CARD"],
|
|
98
|
-
badge: () =>
|
|
99
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
99
100
|
}
|
|
100
101
|
]
|
|
101
102
|
},
|
|
103
|
+
{
|
|
104
|
+
label: e("connect.navigation.whatsappBot"),
|
|
105
|
+
value: f["$connect-WHATSAPP_BOT"],
|
|
106
|
+
badge: () => U(j.FmPill, { variant: "beta" })
|
|
107
|
+
},
|
|
102
108
|
{
|
|
103
109
|
label: e("connect.navigation.referral"),
|
|
104
110
|
value: f["$connect-REFERRAL"],
|
|
105
|
-
badge: () =>
|
|
111
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
106
112
|
},
|
|
107
113
|
{
|
|
108
114
|
label: e("connect.navigation.store"),
|
|
@@ -124,6 +130,15 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
124
130
|
label: e("connect.navigation.review"),
|
|
125
131
|
value: f["$connect-REVIEW"]
|
|
126
132
|
},
|
|
133
|
+
{
|
|
134
|
+
label: e("connect.navigation.goals"),
|
|
135
|
+
value: f["$connect-GOALS"],
|
|
136
|
+
badge: () => i.goalsRemaining > 0 ? U(j.FmBadge, {
|
|
137
|
+
variant: "numeric",
|
|
138
|
+
inline: !0,
|
|
139
|
+
value: i.goalsRemaining
|
|
140
|
+
}) : U(cn)
|
|
141
|
+
},
|
|
127
142
|
{
|
|
128
143
|
label: e("connect.navigation.setting"),
|
|
129
144
|
value: f["$connect-SETTING"]
|
|
@@ -132,154 +147,163 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
132
147
|
label: e("connect.navigation.bin"),
|
|
133
148
|
value: f["$connect-BIN"]
|
|
134
149
|
}
|
|
135
|
-
],
|
|
136
|
-
const
|
|
137
|
-
return console.log(`[MF] Timezone set to: ${Xe[
|
|
150
|
+
], o = yt(), c = wt(), a = s.reduce((h, y) => [...(y.children ?? []).map((_) => _.value), ...h, y.value], []), l = ge(), d = ne(() => {
|
|
151
|
+
const h = l.currentCountry.value || "MY";
|
|
152
|
+
return console.log(`[MF] Timezone set to: ${Xe[h]}`), Xe[h];
|
|
138
153
|
});
|
|
139
|
-
|
|
154
|
+
pe(
|
|
140
155
|
// Watch `route.matched`, not `route`: `useRoute()` returns a reactive object
|
|
141
156
|
// whose identity never changes, so watching it directly fired once via
|
|
142
157
|
// `immediate` and the highlight then stayed on whatever page loaded first.
|
|
143
|
-
() =>
|
|
144
|
-
(
|
|
145
|
-
const
|
|
146
|
-
|
|
158
|
+
() => c.matched,
|
|
159
|
+
(h) => {
|
|
160
|
+
const _ = h.map((p) => p.name).reverse().find((p) => a.includes(p));
|
|
161
|
+
_ && (r.value = _);
|
|
162
|
+
},
|
|
163
|
+
{ immediate: !0 }
|
|
164
|
+
), pe(
|
|
165
|
+
[() => {
|
|
166
|
+
var h;
|
|
167
|
+
return (h = l.currentBusiness.value) == null ? void 0 : h._id;
|
|
168
|
+
}, () => c.name, t],
|
|
169
|
+
([h]) => {
|
|
170
|
+
h && i.read(t.value, h);
|
|
147
171
|
},
|
|
148
172
|
{ immediate: !0 }
|
|
149
173
|
);
|
|
150
|
-
async function
|
|
151
|
-
await
|
|
174
|
+
async function m(h) {
|
|
175
|
+
await o.push({ name: h });
|
|
152
176
|
}
|
|
153
|
-
return (
|
|
154
|
-
var
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
S(
|
|
177
|
+
return (h, y) => {
|
|
178
|
+
var p;
|
|
179
|
+
const _ = Z("FmCollapsibleTabs");
|
|
180
|
+
return W(), me("div", xn, [
|
|
181
|
+
S(_, {
|
|
158
182
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
159
|
-
"model-value": (
|
|
160
|
-
items:
|
|
161
|
-
"onUpdate:modelValue":
|
|
183
|
+
"model-value": (p = g(r)) == null ? void 0 : p.toString(),
|
|
184
|
+
items: s,
|
|
185
|
+
"onUpdate:modelValue": m
|
|
162
186
|
}, null, 8, ["model-value"]),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
187
|
+
v("div", Fn, [
|
|
188
|
+
v("div", null, "Timezone: " + R(g(d).split("/")[1].replace("_", " ")), 1),
|
|
189
|
+
v("div", null, "(UTC" + R(g(vn).tz(g(d)).format("Z")) + ")", 1)
|
|
166
190
|
])
|
|
167
191
|
]);
|
|
168
192
|
};
|
|
169
193
|
}
|
|
170
194
|
}), St = "feedme_connect_marketing_promo_hidden";
|
|
171
|
-
function
|
|
195
|
+
function $n() {
|
|
172
196
|
try {
|
|
173
197
|
return localStorage.getItem(St) !== null;
|
|
174
198
|
} catch {
|
|
175
199
|
return !1;
|
|
176
200
|
}
|
|
177
201
|
}
|
|
178
|
-
function
|
|
202
|
+
function Hn() {
|
|
179
203
|
try {
|
|
180
204
|
localStorage.setItem(St, (/* @__PURE__ */ new Date()).toISOString());
|
|
181
205
|
} catch {
|
|
182
206
|
}
|
|
183
207
|
}
|
|
184
|
-
const
|
|
208
|
+
const jn = { class: "flex flex-col gap-12" }, Wn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, Bn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Gn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, zn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, qn = { class: "flex flex-col gap-24 pb-8" }, Kn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, Jn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Yn = { class: "fm-typo-en-body-lg-600" }, Xn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Qn = { class: "shrink-0" }, Zn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ei = { class: "flex w-full flex-col gap-12 px-[16px]" }, ti = { class: "flex flex-wrap items-center gap-12" }, ni = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ii = /* @__PURE__ */ xe({
|
|
185
209
|
__name: "AiMarketingPromoDialog",
|
|
186
210
|
setup(n) {
|
|
187
211
|
let e = !1;
|
|
188
|
-
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } =
|
|
212
|
+
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } = ge(), o = ee(!1), c = [
|
|
189
213
|
{ key: "completeContent", icon: "layers" },
|
|
190
214
|
{ key: "realContext", icon: "storefront" },
|
|
191
215
|
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
192
216
|
], a = ne(() => {
|
|
193
|
-
var
|
|
194
|
-
const
|
|
195
|
-
return
|
|
217
|
+
var _;
|
|
218
|
+
const y = ((_ = r.value) == null ? void 0 : _.permissions) ?? [];
|
|
219
|
+
return yn(
|
|
196
220
|
[
|
|
197
221
|
{
|
|
198
222
|
action: Qe.Action.manage,
|
|
199
223
|
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
200
224
|
}
|
|
201
225
|
],
|
|
202
|
-
|
|
226
|
+
y
|
|
203
227
|
).granted;
|
|
204
228
|
}), l = ne(
|
|
205
229
|
() => s.value === "MY" && a.value
|
|
206
230
|
);
|
|
207
231
|
let d = !1;
|
|
208
|
-
|
|
232
|
+
pe(
|
|
209
233
|
l,
|
|
210
|
-
(
|
|
211
|
-
d || !
|
|
234
|
+
(y) => {
|
|
235
|
+
d || !y || (d = !0, !($n() || e) && (e = !0, o.value = !0));
|
|
212
236
|
},
|
|
213
237
|
{ immediate: !0 }
|
|
214
238
|
);
|
|
215
|
-
async function
|
|
239
|
+
async function m() {
|
|
216
240
|
o.value = !1, await i.push({ name: f["$connect-MARKETING"] });
|
|
217
241
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
242
|
+
function h() {
|
|
243
|
+
Hn(), o.value = !1;
|
|
220
244
|
}
|
|
221
|
-
return (
|
|
222
|
-
const
|
|
223
|
-
return
|
|
245
|
+
return (y, _) => {
|
|
246
|
+
const p = Z("FmIcon"), I = Z("FmCard"), T = Z("FmButton"), M = Z("FmDialog");
|
|
247
|
+
return W(), Oe(M, {
|
|
224
248
|
modelValue: o.value,
|
|
225
|
-
"onUpdate:modelValue":
|
|
249
|
+
"onUpdate:modelValue": _[0] || (_[0] = (k) => o.value = k),
|
|
226
250
|
"min-width": "min(500px, calc(100% - 48px))",
|
|
227
251
|
"max-width": "min(860px, calc(100% - 48px))",
|
|
228
252
|
"max-height": "90vh",
|
|
229
253
|
"dismiss-away": ""
|
|
230
254
|
}, {
|
|
231
|
-
"dialog-header":
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
S(
|
|
255
|
+
"dialog-header": Q(() => [
|
|
256
|
+
v("div", jn, [
|
|
257
|
+
v("div", Wn, [
|
|
258
|
+
S(p, {
|
|
235
259
|
name: "auto_awesome",
|
|
236
260
|
size: "sm",
|
|
237
261
|
color: "primary"
|
|
238
262
|
}),
|
|
239
|
-
|
|
263
|
+
v("span", Bn, R(g(t)("connect.marketing.whatsNew.badge")), 1)
|
|
240
264
|
]),
|
|
241
|
-
|
|
242
|
-
|
|
265
|
+
v("h1", Gn, R(g(t)("connect.marketing.whatsNew.title")), 1),
|
|
266
|
+
v("p", zn, R(g(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
243
267
|
])
|
|
244
268
|
]),
|
|
245
|
-
"dialog-footer":
|
|
246
|
-
|
|
247
|
-
|
|
269
|
+
"dialog-footer": Q(() => [
|
|
270
|
+
v("div", ei, [
|
|
271
|
+
v("div", ti, [
|
|
248
272
|
S(T, {
|
|
249
273
|
variant: "primary",
|
|
250
274
|
size: "lg",
|
|
251
|
-
label:
|
|
275
|
+
label: g(t)("connect.marketing.whatsNew.cta"),
|
|
252
276
|
"append-icon": "arrow_forward",
|
|
253
|
-
onClick:
|
|
277
|
+
onClick: m
|
|
254
278
|
}, null, 8, ["label"]),
|
|
255
279
|
S(T, {
|
|
256
280
|
variant: "tertiary",
|
|
257
281
|
size: "lg",
|
|
258
|
-
label:
|
|
259
|
-
onClick:
|
|
282
|
+
label: g(t)("connect.marketing.whatsNew.dismiss"),
|
|
283
|
+
onClick: h
|
|
260
284
|
}, null, 8, ["label"])
|
|
261
285
|
]),
|
|
262
|
-
|
|
286
|
+
v("div", ni, R(g(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
263
287
|
])
|
|
264
288
|
]),
|
|
265
|
-
default:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
(
|
|
289
|
+
default: Q(() => [
|
|
290
|
+
v("div", qn, [
|
|
291
|
+
v("div", Kn, [
|
|
292
|
+
(W(), me(It, null, ln(c, (k) => S(I, {
|
|
269
293
|
key: k.key,
|
|
270
294
|
variant: "outlined",
|
|
271
295
|
class: "!h-full flex flex-col gap-8 p-16"
|
|
272
296
|
}, {
|
|
273
|
-
default:
|
|
274
|
-
|
|
275
|
-
S(
|
|
297
|
+
default: Q(() => [
|
|
298
|
+
v("div", Jn, [
|
|
299
|
+
S(p, {
|
|
276
300
|
name: k.icon,
|
|
277
301
|
size: "md",
|
|
278
302
|
color: "primary"
|
|
279
303
|
}, null, 8, ["name"])
|
|
280
304
|
]),
|
|
281
|
-
|
|
282
|
-
|
|
305
|
+
v("div", Yn, R(g(t)(`connect.marketing.whatsNew.benefits.${k.key}.title`)), 1),
|
|
306
|
+
v("div", Xn, R(g(t)(
|
|
283
307
|
`connect.marketing.whatsNew.benefits.${k.key}.description`
|
|
284
308
|
)), 1)
|
|
285
309
|
]),
|
|
@@ -290,15 +314,15 @@ const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xx
|
|
|
290
314
|
variant: "outlined",
|
|
291
315
|
class: "flex items-start gap-12 p-16"
|
|
292
316
|
}, {
|
|
293
|
-
default:
|
|
294
|
-
|
|
295
|
-
S(
|
|
317
|
+
default: Q(() => [
|
|
318
|
+
v("div", Qn, [
|
|
319
|
+
S(p, {
|
|
296
320
|
name: "lightbulb",
|
|
297
321
|
size: "md",
|
|
298
322
|
color: "primary"
|
|
299
323
|
})
|
|
300
324
|
]),
|
|
301
|
-
|
|
325
|
+
v("p", Zn, R(g(t)("connect.marketing.whatsNew.callout")), 1)
|
|
302
326
|
]),
|
|
303
327
|
_: 1
|
|
304
328
|
})
|
|
@@ -309,7 +333,7 @@ const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xx
|
|
|
309
333
|
};
|
|
310
334
|
}
|
|
311
335
|
});
|
|
312
|
-
var
|
|
336
|
+
var ri = "firebase", si = "10.12.4";
|
|
313
337
|
/**
|
|
314
338
|
* @license
|
|
315
339
|
* Copyright 2020 Google LLC
|
|
@@ -326,13 +350,13 @@ var ni = "firebase", ii = "10.12.4";
|
|
|
326
350
|
* See the License for the specific language governing permissions and
|
|
327
351
|
* limitations under the License.
|
|
328
352
|
*/
|
|
329
|
-
|
|
353
|
+
Le(ri, si, "app");
|
|
330
354
|
function Rt() {
|
|
331
355
|
return {
|
|
332
356
|
"dependent-sdk-initialized-before-auth": "Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."
|
|
333
357
|
};
|
|
334
358
|
}
|
|
335
|
-
const
|
|
359
|
+
const oi = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
336
360
|
/**
|
|
337
361
|
* @license
|
|
338
362
|
* Copyright 2020 Google LLC
|
|
@@ -349,12 +373,12 @@ const ri = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
|
349
373
|
* See the License for the specific language governing permissions and
|
|
350
374
|
* limitations under the License.
|
|
351
375
|
*/
|
|
352
|
-
const
|
|
353
|
-
function
|
|
354
|
-
|
|
376
|
+
const _e = new Tn("@firebase/auth");
|
|
377
|
+
function ai(n, ...e) {
|
|
378
|
+
_e.logLevel <= Et.WARN && _e.warn(`Auth (${re}): ${n}`, ...e);
|
|
355
379
|
}
|
|
356
380
|
function ue(n, ...e) {
|
|
357
|
-
|
|
381
|
+
_e.logLevel <= Et.ERROR && _e.error(`Auth (${re}): ${n}`, ...e);
|
|
358
382
|
}
|
|
359
383
|
/**
|
|
360
384
|
* @license
|
|
@@ -375,16 +399,16 @@ function ue(n, ...e) {
|
|
|
375
399
|
function O(n, ...e) {
|
|
376
400
|
throw He(n, ...e);
|
|
377
401
|
}
|
|
378
|
-
function
|
|
402
|
+
function b(n, ...e) {
|
|
379
403
|
return He(n, ...e);
|
|
380
404
|
}
|
|
381
405
|
function Pt(n, e, t) {
|
|
382
|
-
const i = Object.assign(Object.assign({},
|
|
406
|
+
const i = Object.assign(Object.assign({}, oi()), { [e]: t });
|
|
383
407
|
return new Fe("auth", "Firebase", i).create(e, {
|
|
384
408
|
appName: n.name
|
|
385
409
|
});
|
|
386
410
|
}
|
|
387
|
-
function
|
|
411
|
+
function H(n) {
|
|
388
412
|
return Pt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
389
413
|
}
|
|
390
414
|
function He(n, ...e) {
|
|
@@ -421,11 +445,11 @@ function L(n, e) {
|
|
|
421
445
|
* See the License for the specific language governing permissions and
|
|
422
446
|
* limitations under the License.
|
|
423
447
|
*/
|
|
424
|
-
function
|
|
448
|
+
function Me() {
|
|
425
449
|
var n;
|
|
426
450
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
427
451
|
}
|
|
428
|
-
function
|
|
452
|
+
function ci() {
|
|
429
453
|
return nt() === "http:" || nt() === "https:";
|
|
430
454
|
}
|
|
431
455
|
function nt() {
|
|
@@ -448,15 +472,15 @@ function nt() {
|
|
|
448
472
|
* See the License for the specific language governing permissions and
|
|
449
473
|
* limitations under the License.
|
|
450
474
|
*/
|
|
451
|
-
function
|
|
475
|
+
function li() {
|
|
452
476
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
453
477
|
// This is especially true for Cordova apps which have unreliable
|
|
454
478
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
455
479
|
// installed which overwrites the native navigator.onLine value and
|
|
456
480
|
// defines navigator.connection.
|
|
457
|
-
(
|
|
481
|
+
(ci() || En() || "connection" in navigator) ? navigator.onLine : !0;
|
|
458
482
|
}
|
|
459
|
-
function
|
|
483
|
+
function ui() {
|
|
460
484
|
if (typeof navigator > "u")
|
|
461
485
|
return null;
|
|
462
486
|
const n = navigator;
|
|
@@ -486,10 +510,10 @@ function ci() {
|
|
|
486
510
|
*/
|
|
487
511
|
class oe {
|
|
488
512
|
constructor(e, t) {
|
|
489
|
-
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
|
513
|
+
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile = kn() || bn();
|
|
490
514
|
}
|
|
491
515
|
get() {
|
|
492
|
-
return
|
|
516
|
+
return li() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
493
517
|
}
|
|
494
518
|
}
|
|
495
519
|
/**
|
|
@@ -583,7 +607,7 @@ class Ct {
|
|
|
583
607
|
* See the License for the specific language governing permissions and
|
|
584
608
|
* limitations under the License.
|
|
585
609
|
*/
|
|
586
|
-
const
|
|
610
|
+
const di = {
|
|
587
611
|
// Custom token errors.
|
|
588
612
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
589
613
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -674,11 +698,11 @@ const li = {
|
|
|
674
698
|
* See the License for the specific language governing permissions and
|
|
675
699
|
* limitations under the License.
|
|
676
700
|
*/
|
|
677
|
-
const
|
|
678
|
-
function
|
|
701
|
+
const hi = new oe(3e4, 6e4);
|
|
702
|
+
function Te(n, e) {
|
|
679
703
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
680
704
|
}
|
|
681
|
-
async function
|
|
705
|
+
async function X(n, e, t, i, r = {}) {
|
|
682
706
|
return Nt(n, r, async () => {
|
|
683
707
|
let s = {}, o = {};
|
|
684
708
|
i && (e === "GET" ? o = i : s = {
|
|
@@ -700,9 +724,9 @@ async function J(n, e, t, i, r = {}) {
|
|
|
700
724
|
}
|
|
701
725
|
async function Nt(n, e, t) {
|
|
702
726
|
n._canInitEmulator = !1;
|
|
703
|
-
const i = Object.assign(Object.assign({},
|
|
727
|
+
const i = Object.assign(Object.assign({}, di), e);
|
|
704
728
|
try {
|
|
705
|
-
const r = new
|
|
729
|
+
const r = new fi(n), s = await Promise.race([
|
|
706
730
|
t(),
|
|
707
731
|
r.promise
|
|
708
732
|
]);
|
|
@@ -732,7 +756,7 @@ async function Nt(n, e, t) {
|
|
|
732
756
|
}
|
|
733
757
|
}
|
|
734
758
|
async function Ot(n, e, t, i, r = {}) {
|
|
735
|
-
const s = await
|
|
759
|
+
const s = await X(n, e, t, i, r);
|
|
736
760
|
return "mfaPendingCredential" in s && O(n, "multi-factor-auth-required", {
|
|
737
761
|
_serverResponse: s
|
|
738
762
|
}), s;
|
|
@@ -741,14 +765,14 @@ function Lt(n, e, t, i) {
|
|
|
741
765
|
const r = `${e}${t}?${i}`;
|
|
742
766
|
return n.config.emulator ? je(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
743
767
|
}
|
|
744
|
-
class
|
|
768
|
+
class fi {
|
|
745
769
|
constructor(e) {
|
|
746
770
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
747
|
-
this.timer = setTimeout(() => i(
|
|
771
|
+
this.timer = setTimeout(() => i(b(
|
|
748
772
|
this.auth,
|
|
749
773
|
"network-request-failed"
|
|
750
774
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
751
|
-
)),
|
|
775
|
+
)), hi.get());
|
|
752
776
|
});
|
|
753
777
|
}
|
|
754
778
|
clearNetworkTimeout() {
|
|
@@ -760,7 +784,7 @@ function le(n, e, t) {
|
|
|
760
784
|
appName: n.name
|
|
761
785
|
};
|
|
762
786
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
763
|
-
const r =
|
|
787
|
+
const r = b(n, e, i);
|
|
764
788
|
return r.customData._tokenResponse = t, r;
|
|
765
789
|
}
|
|
766
790
|
/**
|
|
@@ -779,11 +803,11 @@ function le(n, e, t) {
|
|
|
779
803
|
* See the License for the specific language governing permissions and
|
|
780
804
|
* limitations under the License.
|
|
781
805
|
*/
|
|
782
|
-
async function
|
|
783
|
-
return
|
|
806
|
+
async function pi(n, e) {
|
|
807
|
+
return X(n, "POST", "/v1/accounts:delete", e);
|
|
784
808
|
}
|
|
785
809
|
async function Mt(n, e) {
|
|
786
|
-
return
|
|
810
|
+
return X(n, "POST", "/v1/accounts:lookup", e);
|
|
787
811
|
}
|
|
788
812
|
/**
|
|
789
813
|
* @license
|
|
@@ -810,8 +834,8 @@ function te(n) {
|
|
|
810
834
|
} catch {
|
|
811
835
|
}
|
|
812
836
|
}
|
|
813
|
-
async function
|
|
814
|
-
const t =
|
|
837
|
+
async function mi(n, e = !1) {
|
|
838
|
+
const t = Y(n), i = await t.getIdToken(e), r = We(i);
|
|
815
839
|
u(
|
|
816
840
|
r && r.exp && r.auth_time && r.iat,
|
|
817
841
|
t.auth,
|
|
@@ -822,14 +846,14 @@ async function fi(n, e = !1) {
|
|
|
822
846
|
return {
|
|
823
847
|
claims: r,
|
|
824
848
|
token: i,
|
|
825
|
-
authTime: te(
|
|
826
|
-
issuedAtTime: te(
|
|
827
|
-
expirationTime: te(
|
|
849
|
+
authTime: te(Ce(r.auth_time)),
|
|
850
|
+
issuedAtTime: te(Ce(r.iat)),
|
|
851
|
+
expirationTime: te(Ce(r.exp)),
|
|
828
852
|
signInProvider: o || null,
|
|
829
853
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
830
854
|
};
|
|
831
855
|
}
|
|
832
|
-
function
|
|
856
|
+
function Ce(n) {
|
|
833
857
|
return Number(n) * 1e3;
|
|
834
858
|
}
|
|
835
859
|
function We(n) {
|
|
@@ -837,7 +861,7 @@ function We(n) {
|
|
|
837
861
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
838
862
|
return ue("JWT malformed, contained fewer than 3 sections"), null;
|
|
839
863
|
try {
|
|
840
|
-
const r =
|
|
864
|
+
const r = Cn(t);
|
|
841
865
|
return r ? JSON.parse(r) : (ue("Failed to decode base64 JWT payload"), null);
|
|
842
866
|
} catch (r) {
|
|
843
867
|
return ue("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
@@ -881,10 +905,10 @@ async function ie(n, e, t = !1) {
|
|
|
881
905
|
try {
|
|
882
906
|
return await e;
|
|
883
907
|
} catch (i) {
|
|
884
|
-
throw i instanceof Ve &&
|
|
908
|
+
throw i instanceof Ve && gi(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
885
909
|
}
|
|
886
910
|
}
|
|
887
|
-
function
|
|
911
|
+
function gi({ code: n }) {
|
|
888
912
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
889
913
|
}
|
|
890
914
|
/**
|
|
@@ -903,7 +927,7 @@ function pi({ code: n }) {
|
|
|
903
927
|
* See the License for the specific language governing permissions and
|
|
904
928
|
* limitations under the License.
|
|
905
929
|
*/
|
|
906
|
-
class
|
|
930
|
+
class _i {
|
|
907
931
|
constructor(e) {
|
|
908
932
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
909
933
|
}
|
|
@@ -965,7 +989,7 @@ class mi {
|
|
|
965
989
|
* See the License for the specific language governing permissions and
|
|
966
990
|
* limitations under the License.
|
|
967
991
|
*/
|
|
968
|
-
class
|
|
992
|
+
class Ue {
|
|
969
993
|
constructor(e, t) {
|
|
970
994
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
971
995
|
}
|
|
@@ -998,7 +1022,7 @@ class Me {
|
|
|
998
1022
|
* See the License for the specific language governing permissions and
|
|
999
1023
|
* limitations under the License.
|
|
1000
1024
|
*/
|
|
1001
|
-
async function
|
|
1025
|
+
async function ve(n) {
|
|
1002
1026
|
var e;
|
|
1003
1027
|
const t = n.auth, i = await n.getIdToken(), r = await ie(n, Mt(t, { idToken: i }));
|
|
1004
1028
|
u(
|
|
@@ -1009,7 +1033,7 @@ async function _e(n) {
|
|
|
1009
1033
|
);
|
|
1010
1034
|
const s = r.users[0];
|
|
1011
1035
|
n._notifyReloadListener(s);
|
|
1012
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c =
|
|
1036
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c = Ii(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, m = {
|
|
1013
1037
|
uid: s.localId,
|
|
1014
1038
|
displayName: s.displayName || null,
|
|
1015
1039
|
photoURL: s.photoUrl || null,
|
|
@@ -1018,16 +1042,16 @@ async function _e(n) {
|
|
|
1018
1042
|
phoneNumber: s.phoneNumber || null,
|
|
1019
1043
|
tenantId: s.tenantId || null,
|
|
1020
1044
|
providerData: c,
|
|
1021
|
-
metadata: new
|
|
1045
|
+
metadata: new Ue(s.createdAt, s.lastLoginAt),
|
|
1022
1046
|
isAnonymous: d
|
|
1023
1047
|
};
|
|
1024
|
-
Object.assign(n,
|
|
1048
|
+
Object.assign(n, m);
|
|
1025
1049
|
}
|
|
1026
|
-
async function
|
|
1027
|
-
const e =
|
|
1028
|
-
await
|
|
1050
|
+
async function vi(n) {
|
|
1051
|
+
const e = Y(n);
|
|
1052
|
+
await ve(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
1029
1053
|
}
|
|
1030
|
-
function
|
|
1054
|
+
function Ii(n, e) {
|
|
1031
1055
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
1032
1056
|
}
|
|
1033
1057
|
function Ut(n) {
|
|
@@ -1059,7 +1083,7 @@ function Ut(n) {
|
|
|
1059
1083
|
* See the License for the specific language governing permissions and
|
|
1060
1084
|
* limitations under the License.
|
|
1061
1085
|
*/
|
|
1062
|
-
async function
|
|
1086
|
+
async function yi(n, e) {
|
|
1063
1087
|
const t = await Nt(n, {}, async () => {
|
|
1064
1088
|
const i = se({
|
|
1065
1089
|
grant_type: "refresh_token",
|
|
@@ -1080,8 +1104,8 @@ async function vi(n, e) {
|
|
|
1080
1104
|
refreshToken: t.refresh_token
|
|
1081
1105
|
};
|
|
1082
1106
|
}
|
|
1083
|
-
async function
|
|
1084
|
-
return
|
|
1107
|
+
async function wi(n, e) {
|
|
1108
|
+
return X(n, "POST", "/v2/accounts:revokeToken", Te(n, e));
|
|
1085
1109
|
}
|
|
1086
1110
|
/**
|
|
1087
1111
|
* @license
|
|
@@ -1099,7 +1123,7 @@ async function Ii(n, e) {
|
|
|
1099
1123
|
* See the License for the specific language governing permissions and
|
|
1100
1124
|
* limitations under the License.
|
|
1101
1125
|
*/
|
|
1102
|
-
class
|
|
1126
|
+
class q {
|
|
1103
1127
|
constructor() {
|
|
1104
1128
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
1105
1129
|
}
|
|
@@ -1144,14 +1168,14 @@ class B {
|
|
|
1144
1168
|
this.refreshToken = null;
|
|
1145
1169
|
}
|
|
1146
1170
|
async refresh(e, t) {
|
|
1147
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1171
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await yi(e, t);
|
|
1148
1172
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1149
1173
|
}
|
|
1150
1174
|
updateTokensAndExpiration(e, t, i) {
|
|
1151
1175
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1152
1176
|
}
|
|
1153
1177
|
static fromJSON(e, t) {
|
|
1154
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1178
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new q();
|
|
1155
1179
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1156
1180
|
appName: e
|
|
1157
1181
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1171,7 +1195,7 @@ class B {
|
|
|
1171
1195
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1172
1196
|
}
|
|
1173
1197
|
_clone() {
|
|
1174
|
-
return Object.assign(new
|
|
1198
|
+
return Object.assign(new q(), this.toJSON());
|
|
1175
1199
|
}
|
|
1176
1200
|
_performRefresh() {
|
|
1177
1201
|
return P("not implemented");
|
|
@@ -1193,13 +1217,13 @@ class B {
|
|
|
1193
1217
|
* See the License for the specific language governing permissions and
|
|
1194
1218
|
* limitations under the License.
|
|
1195
1219
|
*/
|
|
1196
|
-
function
|
|
1220
|
+
function D(n, e) {
|
|
1197
1221
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1198
1222
|
}
|
|
1199
1223
|
class C {
|
|
1200
1224
|
constructor(e) {
|
|
1201
1225
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1202
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1226
|
+
this.providerId = "firebase", this.proactiveRefresh = new _i(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = i, this.stsTokenManager = r, this.accessToken = r.accessToken, this.displayName = s.displayName || null, this.email = s.email || null, this.emailVerified = s.emailVerified || !1, this.phoneNumber = s.phoneNumber || null, this.photoURL = s.photoURL || null, this.isAnonymous = s.isAnonymous || !1, this.tenantId = s.tenantId || null, this.providerData = s.providerData ? [...s.providerData] : [], this.metadata = new Ue(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1203
1227
|
}
|
|
1204
1228
|
async getIdToken(e) {
|
|
1205
1229
|
const t = await ie(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -1211,10 +1235,10 @@ class C {
|
|
|
1211
1235
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1212
1236
|
}
|
|
1213
1237
|
getIdTokenResult(e) {
|
|
1214
|
-
return
|
|
1238
|
+
return mi(this, e);
|
|
1215
1239
|
}
|
|
1216
1240
|
reload() {
|
|
1217
|
-
return
|
|
1241
|
+
return vi(this);
|
|
1218
1242
|
}
|
|
1219
1243
|
_assign(e) {
|
|
1220
1244
|
this !== e && (u(
|
|
@@ -1247,13 +1271,13 @@ class C {
|
|
|
1247
1271
|
}
|
|
1248
1272
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1249
1273
|
let i = !1;
|
|
1250
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1274
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await ve(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1251
1275
|
}
|
|
1252
1276
|
async delete() {
|
|
1253
1277
|
if (A(this.auth.app))
|
|
1254
|
-
return Promise.reject(
|
|
1278
|
+
return Promise.reject(H(this.auth));
|
|
1255
1279
|
const e = await this.getIdToken();
|
|
1256
|
-
return await ie(this,
|
|
1280
|
+
return await ie(this, pi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1257
1281
|
}
|
|
1258
1282
|
toJSON() {
|
|
1259
1283
|
return Object.assign(Object.assign({
|
|
@@ -1281,20 +1305,20 @@ class C {
|
|
|
1281
1305
|
}
|
|
1282
1306
|
static _fromJSON(e, t) {
|
|
1283
1307
|
var i, r, s, o, c, a, l, d;
|
|
1284
|
-
const
|
|
1308
|
+
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0, h = (r = t.email) !== null && r !== void 0 ? r : void 0, y = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, _ = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, p = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, T = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, M = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: k, emailVerified: Ke, isAnonymous: Je, providerData: Re, stsTokenManager: Ye } = t;
|
|
1285
1309
|
u(
|
|
1286
1310
|
k && Ye,
|
|
1287
1311
|
e,
|
|
1288
1312
|
"internal-error"
|
|
1289
1313
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1290
1314
|
);
|
|
1291
|
-
const on =
|
|
1315
|
+
const on = q.fromJSON(this.name, Ye);
|
|
1292
1316
|
u(
|
|
1293
1317
|
typeof k == "string",
|
|
1294
1318
|
e,
|
|
1295
1319
|
"internal-error"
|
|
1296
1320
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1297
|
-
),
|
|
1321
|
+
), D(m, e.name), D(h, e.name), u(
|
|
1298
1322
|
typeof Ke == "boolean",
|
|
1299
1323
|
e,
|
|
1300
1324
|
"internal-error"
|
|
@@ -1304,22 +1328,22 @@ class C {
|
|
|
1304
1328
|
e,
|
|
1305
1329
|
"internal-error"
|
|
1306
1330
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1307
|
-
),
|
|
1308
|
-
const
|
|
1331
|
+
), D(y, e.name), D(_, e.name), D(p, e.name), D(I, e.name), D(T, e.name), D(M, e.name);
|
|
1332
|
+
const Ae = new C({
|
|
1309
1333
|
uid: k,
|
|
1310
1334
|
auth: e,
|
|
1311
|
-
email:
|
|
1335
|
+
email: h,
|
|
1312
1336
|
emailVerified: Ke,
|
|
1313
|
-
displayName:
|
|
1337
|
+
displayName: m,
|
|
1314
1338
|
isAnonymous: Je,
|
|
1315
|
-
photoURL:
|
|
1316
|
-
phoneNumber:
|
|
1317
|
-
tenantId:
|
|
1339
|
+
photoURL: _,
|
|
1340
|
+
phoneNumber: y,
|
|
1341
|
+
tenantId: p,
|
|
1318
1342
|
stsTokenManager: on,
|
|
1319
1343
|
createdAt: T,
|
|
1320
1344
|
lastLoginAt: M
|
|
1321
1345
|
});
|
|
1322
|
-
return
|
|
1346
|
+
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((an) => Object.assign({}, an))), I && (Ae._redirectEventId = I), Ae;
|
|
1323
1347
|
}
|
|
1324
1348
|
/**
|
|
1325
1349
|
* Initialize a User from an idToken server response
|
|
@@ -1327,7 +1351,7 @@ class C {
|
|
|
1327
1351
|
* @param idTokenResponse
|
|
1328
1352
|
*/
|
|
1329
1353
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1330
|
-
const r = new
|
|
1354
|
+
const r = new q();
|
|
1331
1355
|
r.updateFromServerResponse(t);
|
|
1332
1356
|
const s = new C({
|
|
1333
1357
|
uid: t.localId,
|
|
@@ -1335,7 +1359,7 @@ class C {
|
|
|
1335
1359
|
stsTokenManager: r,
|
|
1336
1360
|
isAnonymous: i
|
|
1337
1361
|
});
|
|
1338
|
-
return await
|
|
1362
|
+
return await ve(s), s;
|
|
1339
1363
|
}
|
|
1340
1364
|
/**
|
|
1341
1365
|
* Initialize a User from an idToken server response
|
|
@@ -1349,7 +1373,7 @@ class C {
|
|
|
1349
1373
|
"internal-error"
|
|
1350
1374
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1351
1375
|
);
|
|
1352
|
-
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new
|
|
1376
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new q();
|
|
1353
1377
|
c.updateFromIdToken(i);
|
|
1354
1378
|
const a = new C({
|
|
1355
1379
|
uid: r.localId,
|
|
@@ -1365,7 +1389,7 @@ class C {
|
|
|
1365
1389
|
phoneNumber: r.phoneNumber || null,
|
|
1366
1390
|
tenantId: r.tenantId || null,
|
|
1367
1391
|
providerData: s,
|
|
1368
|
-
metadata: new
|
|
1392
|
+
metadata: new Ue(r.createdAt, r.lastLoginAt),
|
|
1369
1393
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1370
1394
|
};
|
|
1371
1395
|
return Object.assign(a, l), a;
|
|
@@ -1452,7 +1476,7 @@ const st = Dt;
|
|
|
1452
1476
|
function de(n, e, t) {
|
|
1453
1477
|
return `firebase:${n}:${e}:${t}`;
|
|
1454
1478
|
}
|
|
1455
|
-
class
|
|
1479
|
+
class K {
|
|
1456
1480
|
constructor(e, t, i) {
|
|
1457
1481
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1458
1482
|
const { config: r, name: s } = this.auth;
|
|
@@ -1483,7 +1507,7 @@ class z {
|
|
|
1483
1507
|
}
|
|
1484
1508
|
static async create(e, t, i = "authUser") {
|
|
1485
1509
|
if (!t.length)
|
|
1486
|
-
return new
|
|
1510
|
+
return new K(N(st), e, i);
|
|
1487
1511
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1488
1512
|
if (await l._isAvailable())
|
|
1489
1513
|
return l;
|
|
@@ -1495,20 +1519,20 @@ class z {
|
|
|
1495
1519
|
try {
|
|
1496
1520
|
const d = await l._get(o);
|
|
1497
1521
|
if (d) {
|
|
1498
|
-
const
|
|
1499
|
-
l !== s && (c =
|
|
1522
|
+
const m = C._fromJSON(e, d);
|
|
1523
|
+
l !== s && (c = m), s = l;
|
|
1500
1524
|
break;
|
|
1501
1525
|
}
|
|
1502
1526
|
} catch {
|
|
1503
1527
|
}
|
|
1504
1528
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1505
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1529
|
+
return !s._shouldAllowMigration || !a.length ? new K(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1506
1530
|
if (l !== s)
|
|
1507
1531
|
try {
|
|
1508
1532
|
await l._remove(o);
|
|
1509
1533
|
} catch {
|
|
1510
1534
|
}
|
|
1511
|
-
})), new
|
|
1535
|
+
})), new K(s, e, i));
|
|
1512
1536
|
}
|
|
1513
1537
|
}
|
|
1514
1538
|
/**
|
|
@@ -1545,7 +1569,7 @@ function ot(n) {
|
|
|
1545
1569
|
return "Blackberry";
|
|
1546
1570
|
if (jt(e))
|
|
1547
1571
|
return "Webos";
|
|
1548
|
-
if (
|
|
1572
|
+
if (Be(e))
|
|
1549
1573
|
return "Safari";
|
|
1550
1574
|
if ((e.includes("chrome/") || Ft(e)) && !e.includes("edge/"))
|
|
1551
1575
|
return "Chrome";
|
|
@@ -1558,42 +1582,42 @@ function ot(n) {
|
|
|
1558
1582
|
}
|
|
1559
1583
|
return "Other";
|
|
1560
1584
|
}
|
|
1561
|
-
function xt(n =
|
|
1585
|
+
function xt(n = w()) {
|
|
1562
1586
|
return /firefox\//i.test(n);
|
|
1563
1587
|
}
|
|
1564
|
-
function
|
|
1588
|
+
function Be(n = w()) {
|
|
1565
1589
|
const e = n.toLowerCase();
|
|
1566
1590
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1567
1591
|
}
|
|
1568
|
-
function Ft(n =
|
|
1592
|
+
function Ft(n = w()) {
|
|
1569
1593
|
return /crios\//i.test(n);
|
|
1570
1594
|
}
|
|
1571
|
-
function Vt(n =
|
|
1595
|
+
function Vt(n = w()) {
|
|
1572
1596
|
return /iemobile/i.test(n);
|
|
1573
1597
|
}
|
|
1574
|
-
function $t(n =
|
|
1598
|
+
function $t(n = w()) {
|
|
1575
1599
|
return /android/i.test(n);
|
|
1576
1600
|
}
|
|
1577
|
-
function Ht(n =
|
|
1601
|
+
function Ht(n = w()) {
|
|
1578
1602
|
return /blackberry/i.test(n);
|
|
1579
1603
|
}
|
|
1580
|
-
function jt(n =
|
|
1604
|
+
function jt(n = w()) {
|
|
1581
1605
|
return /webos/i.test(n);
|
|
1582
1606
|
}
|
|
1583
|
-
function
|
|
1607
|
+
function ke(n = w()) {
|
|
1584
1608
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1585
1609
|
}
|
|
1586
|
-
function
|
|
1610
|
+
function Ti(n = w()) {
|
|
1587
1611
|
var e;
|
|
1588
|
-
return
|
|
1612
|
+
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1589
1613
|
}
|
|
1590
|
-
function
|
|
1591
|
-
return
|
|
1614
|
+
function ki() {
|
|
1615
|
+
return Nn() && document.documentMode === 10;
|
|
1592
1616
|
}
|
|
1593
|
-
function Wt(n =
|
|
1594
|
-
return
|
|
1617
|
+
function Wt(n = w()) {
|
|
1618
|
+
return ke(n) || $t(n) || jt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1595
1619
|
}
|
|
1596
|
-
function
|
|
1620
|
+
function bi() {
|
|
1597
1621
|
try {
|
|
1598
1622
|
return !!(window && window !== window.top);
|
|
1599
1623
|
} catch {
|
|
@@ -1616,14 +1640,14 @@ function Ti() {
|
|
|
1616
1640
|
* See the License for the specific language governing permissions and
|
|
1617
1641
|
* limitations under the License.
|
|
1618
1642
|
*/
|
|
1619
|
-
function
|
|
1643
|
+
function Bt(n, e = []) {
|
|
1620
1644
|
let t;
|
|
1621
1645
|
switch (n) {
|
|
1622
1646
|
case "Browser":
|
|
1623
|
-
t = ot(
|
|
1647
|
+
t = ot(w());
|
|
1624
1648
|
break;
|
|
1625
1649
|
case "Worker":
|
|
1626
|
-
t = `${ot(
|
|
1650
|
+
t = `${ot(w())}-${n}`;
|
|
1627
1651
|
break;
|
|
1628
1652
|
default:
|
|
1629
1653
|
t = n;
|
|
@@ -1647,7 +1671,7 @@ function Gt(n, e = []) {
|
|
|
1647
1671
|
* See the License for the specific language governing permissions and
|
|
1648
1672
|
* limitations under the License.
|
|
1649
1673
|
*/
|
|
1650
|
-
class
|
|
1674
|
+
class Ei {
|
|
1651
1675
|
constructor(e) {
|
|
1652
1676
|
this.auth = e, this.queue = [];
|
|
1653
1677
|
}
|
|
@@ -1702,8 +1726,8 @@ class ki {
|
|
|
1702
1726
|
* See the License for the specific language governing permissions and
|
|
1703
1727
|
* limitations under the License.
|
|
1704
1728
|
*/
|
|
1705
|
-
async function
|
|
1706
|
-
return
|
|
1729
|
+
async function Si(n, e = {}) {
|
|
1730
|
+
return X(n, "GET", "/v2/passwordPolicy", Te(n, e));
|
|
1707
1731
|
}
|
|
1708
1732
|
/**
|
|
1709
1733
|
* @license
|
|
@@ -1721,12 +1745,12 @@ async function Ei(n, e = {}) {
|
|
|
1721
1745
|
* See the License for the specific language governing permissions and
|
|
1722
1746
|
* limitations under the License.
|
|
1723
1747
|
*/
|
|
1724
|
-
const
|
|
1725
|
-
class
|
|
1748
|
+
const Ri = 6;
|
|
1749
|
+
class Ai {
|
|
1726
1750
|
constructor(e) {
|
|
1727
1751
|
var t, i, r, s;
|
|
1728
1752
|
const o = e.customStrengthOptions;
|
|
1729
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1753
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Ri, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (r = (i = e.allowedNonAlphanumericCharacters) === null || i === void 0 ? void 0 : i.join("")) !== null && r !== void 0 ? r : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
|
1730
1754
|
}
|
|
1731
1755
|
validatePassword(e) {
|
|
1732
1756
|
var t, i, r, s, o, c;
|
|
@@ -1809,14 +1833,14 @@ class Si {
|
|
|
1809
1833
|
* See the License for the specific language governing permissions and
|
|
1810
1834
|
* limitations under the License.
|
|
1811
1835
|
*/
|
|
1812
|
-
class
|
|
1836
|
+
class Pi {
|
|
1813
1837
|
constructor(e, t, i, r) {
|
|
1814
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new
|
|
1838
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new Ei(this), this.redirectUser = null, this.isProactiveRefreshEnabled = !1, this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION = 1, this._canInitEmulator = !0, this._isInitialized = !1, this._deleted = !1, this._initializationPromise = null, this._popupRedirectResolver = null, this._errorFactory = At, this._agentRecaptchaConfig = null, this._tenantRecaptchaConfigs = {}, this._projectPasswordPolicy = null, this._tenantPasswordPolicies = {}, this.lastNotifiedUid = void 0, this.languageCode = null, this.tenantId = null, this.settings = { appVerificationDisabledForTesting: !1 }, this.frameworks = [], this.name = e.name, this.clientVersion = r.sdkClientVersion;
|
|
1815
1839
|
}
|
|
1816
1840
|
_initializeWithPersistence(e, t) {
|
|
1817
1841
|
return t && (this._popupRedirectResolver = N(t)), this._initializationPromise = this.queue(async () => {
|
|
1818
1842
|
var i, r;
|
|
1819
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1843
|
+
if (!this._deleted && (this.persistenceManager = await K.create(this, e), !this._deleted)) {
|
|
1820
1844
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1821
1845
|
try {
|
|
1822
1846
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1897,7 +1921,7 @@ class Ri {
|
|
|
1897
1921
|
}
|
|
1898
1922
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1899
1923
|
try {
|
|
1900
|
-
await
|
|
1924
|
+
await ve(e);
|
|
1901
1925
|
} catch (t) {
|
|
1902
1926
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1903
1927
|
return this.directlySetCurrentUser(null);
|
|
@@ -1905,15 +1929,15 @@ class Ri {
|
|
|
1905
1929
|
return this.directlySetCurrentUser(e);
|
|
1906
1930
|
}
|
|
1907
1931
|
useDeviceLanguage() {
|
|
1908
|
-
this.languageCode =
|
|
1932
|
+
this.languageCode = ui();
|
|
1909
1933
|
}
|
|
1910
1934
|
async _delete() {
|
|
1911
1935
|
this._deleted = !0;
|
|
1912
1936
|
}
|
|
1913
1937
|
async updateCurrentUser(e) {
|
|
1914
1938
|
if (A(this.app))
|
|
1915
|
-
return Promise.reject(
|
|
1916
|
-
const t = e ?
|
|
1939
|
+
return Promise.reject(H(this));
|
|
1940
|
+
const t = e ? Y(e) : null;
|
|
1917
1941
|
return t && u(
|
|
1918
1942
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1919
1943
|
this,
|
|
@@ -1933,14 +1957,14 @@ class Ri {
|
|
|
1933
1957
|
});
|
|
1934
1958
|
}
|
|
1935
1959
|
async signOut() {
|
|
1936
|
-
return A(this.app) ? Promise.reject(
|
|
1960
|
+
return A(this.app) ? Promise.reject(H(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1937
1961
|
null,
|
|
1938
1962
|
/* skipBeforeStateCallbacks */
|
|
1939
1963
|
!0
|
|
1940
1964
|
));
|
|
1941
1965
|
}
|
|
1942
1966
|
setPersistence(e) {
|
|
1943
|
-
return A(this.app) ? Promise.reject(
|
|
1967
|
+
return A(this.app) ? Promise.reject(H(this)) : this.queue(async () => {
|
|
1944
1968
|
await this.assertedPersistence.setPersistence(N(e));
|
|
1945
1969
|
});
|
|
1946
1970
|
}
|
|
@@ -1956,7 +1980,7 @@ class Ri {
|
|
|
1956
1980
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1957
1981
|
}
|
|
1958
1982
|
async _updatePasswordPolicy() {
|
|
1959
|
-
const e = await
|
|
1983
|
+
const e = await Si(this), t = new Ai(e);
|
|
1960
1984
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1961
1985
|
}
|
|
1962
1986
|
_getPersistence() {
|
|
@@ -1996,7 +2020,7 @@ class Ri {
|
|
|
1996
2020
|
token: e,
|
|
1997
2021
|
idToken: t
|
|
1998
2022
|
};
|
|
1999
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
2023
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await wi(this, i);
|
|
2000
2024
|
}
|
|
2001
2025
|
}
|
|
2002
2026
|
toJSON() {
|
|
@@ -2020,7 +2044,7 @@ class Ri {
|
|
|
2020
2044
|
this,
|
|
2021
2045
|
"argument-error"
|
|
2022
2046
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2023
|
-
), this.redirectPersistenceManager = await
|
|
2047
|
+
), this.redirectPersistenceManager = await K.create(
|
|
2024
2048
|
this,
|
|
2025
2049
|
[N(t._redirectPersistence)],
|
|
2026
2050
|
"redirectUser"
|
|
@@ -2109,7 +2133,7 @@ class Ri {
|
|
|
2109
2133
|
), this.persistenceManager;
|
|
2110
2134
|
}
|
|
2111
2135
|
_logFramework(e) {
|
|
2112
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
2136
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Bt(this.config.clientPlatform, this._getFrameworks()));
|
|
2113
2137
|
}
|
|
2114
2138
|
_getFrameworks() {
|
|
2115
2139
|
return this.frameworks;
|
|
@@ -2139,15 +2163,15 @@ class Ri {
|
|
|
2139
2163
|
async _getAppCheckToken() {
|
|
2140
2164
|
var e;
|
|
2141
2165
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
2142
|
-
return t != null && t.error &&
|
|
2166
|
+
return t != null && t.error && ai(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
2143
2167
|
}
|
|
2144
2168
|
}
|
|
2145
|
-
function
|
|
2146
|
-
return
|
|
2169
|
+
function be(n) {
|
|
2170
|
+
return Y(n);
|
|
2147
2171
|
}
|
|
2148
2172
|
class at {
|
|
2149
2173
|
constructor(e) {
|
|
2150
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2174
|
+
this.auth = e, this.observer = null, this.addObserver = Sn((t) => this.observer = t);
|
|
2151
2175
|
}
|
|
2152
2176
|
get next() {
|
|
2153
2177
|
return u(
|
|
@@ -2174,7 +2198,7 @@ class at {
|
|
|
2174
2198
|
* See the License for the specific language governing permissions and
|
|
2175
2199
|
* limitations under the License.
|
|
2176
2200
|
*/
|
|
2177
|
-
let
|
|
2201
|
+
let Ge = {
|
|
2178
2202
|
async loadJS() {
|
|
2179
2203
|
throw new Error("Unable to load external scripts");
|
|
2180
2204
|
},
|
|
@@ -2182,16 +2206,16 @@ let Be = {
|
|
|
2182
2206
|
recaptchaEnterpriseScript: "",
|
|
2183
2207
|
gapiScript: ""
|
|
2184
2208
|
};
|
|
2185
|
-
function
|
|
2186
|
-
|
|
2209
|
+
function Ci(n) {
|
|
2210
|
+
Ge = n;
|
|
2187
2211
|
}
|
|
2188
|
-
function
|
|
2189
|
-
return
|
|
2212
|
+
function Ni(n) {
|
|
2213
|
+
return Ge.loadJS(n);
|
|
2190
2214
|
}
|
|
2191
|
-
function
|
|
2192
|
-
return
|
|
2215
|
+
function Oi() {
|
|
2216
|
+
return Ge.gapiScript;
|
|
2193
2217
|
}
|
|
2194
|
-
function
|
|
2218
|
+
function Li(n) {
|
|
2195
2219
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2196
2220
|
}
|
|
2197
2221
|
/**
|
|
@@ -2210,11 +2234,11 @@ function Ni(n) {
|
|
|
2210
2234
|
* See the License for the specific language governing permissions and
|
|
2211
2235
|
* limitations under the License.
|
|
2212
2236
|
*/
|
|
2213
|
-
function
|
|
2214
|
-
const t =
|
|
2237
|
+
function Mi(n, e) {
|
|
2238
|
+
const t = bt(n, "auth");
|
|
2215
2239
|
if (t.isInitialized()) {
|
|
2216
2240
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2217
|
-
if (
|
|
2241
|
+
if (Pn(s, e ?? {}))
|
|
2218
2242
|
return r;
|
|
2219
2243
|
O(
|
|
2220
2244
|
r,
|
|
@@ -2224,12 +2248,12 @@ function Oi(n, e) {
|
|
|
2224
2248
|
}
|
|
2225
2249
|
return t.initialize({ options: e });
|
|
2226
2250
|
}
|
|
2227
|
-
function
|
|
2251
|
+
function Ui(n, e) {
|
|
2228
2252
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(N);
|
|
2229
2253
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2230
2254
|
}
|
|
2231
|
-
function
|
|
2232
|
-
const i =
|
|
2255
|
+
function Di(n, e, t) {
|
|
2256
|
+
const i = be(n);
|
|
2233
2257
|
u(
|
|
2234
2258
|
i._canInitEmulator,
|
|
2235
2259
|
i,
|
|
@@ -2241,20 +2265,20 @@ function Mi(n, e, t) {
|
|
|
2241
2265
|
"invalid-emulator-scheme"
|
|
2242
2266
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2243
2267
|
);
|
|
2244
|
-
const r = !1, s =
|
|
2268
|
+
const r = !1, s = Gt(e), { host: o, port: c } = xi(e), a = c === null ? "" : `:${c}`;
|
|
2245
2269
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2246
2270
|
host: o,
|
|
2247
2271
|
port: c,
|
|
2248
2272
|
protocol: s.replace(":", ""),
|
|
2249
2273
|
options: Object.freeze({ disableWarnings: r })
|
|
2250
|
-
}),
|
|
2274
|
+
}), Fi();
|
|
2251
2275
|
}
|
|
2252
|
-
function
|
|
2276
|
+
function Gt(n) {
|
|
2253
2277
|
const e = n.indexOf(":");
|
|
2254
2278
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2255
2279
|
}
|
|
2256
|
-
function
|
|
2257
|
-
const e =
|
|
2280
|
+
function xi(n) {
|
|
2281
|
+
const e = Gt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2258
2282
|
if (!t)
|
|
2259
2283
|
return { host: "", port: null };
|
|
2260
2284
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
@@ -2272,7 +2296,7 @@ function ct(n) {
|
|
|
2272
2296
|
const e = Number(n);
|
|
2273
2297
|
return isNaN(e) ? null : e;
|
|
2274
2298
|
}
|
|
2275
|
-
function
|
|
2299
|
+
function Fi() {
|
|
2276
2300
|
function n() {
|
|
2277
2301
|
const e = document.createElement("p"), t = e.style;
|
|
2278
2302
|
e.innerText = "Running in emulator mode. Do not use with production credentials.", t.position = "fixed", t.width = "100%", t.backgroundColor = "#ffffff", t.border = ".1em solid #000000", t.color = "#b50000", t.bottom = "0px", t.left = "0px", t.margin = "0px", t.zIndex = "10000", t.textAlign = "center", e.classList.add("firebase-emulator-warning"), document.body.appendChild(e);
|
|
@@ -2337,8 +2361,8 @@ class zt {
|
|
|
2337
2361
|
* See the License for the specific language governing permissions and
|
|
2338
2362
|
* limitations under the License.
|
|
2339
2363
|
*/
|
|
2340
|
-
async function
|
|
2341
|
-
return Ot(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2364
|
+
async function J(n, e) {
|
|
2365
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", Te(n, e));
|
|
2342
2366
|
}
|
|
2343
2367
|
/**
|
|
2344
2368
|
* @license
|
|
@@ -2356,14 +2380,14 @@ async function q(n, e) {
|
|
|
2356
2380
|
* See the License for the specific language governing permissions and
|
|
2357
2381
|
* limitations under the License.
|
|
2358
2382
|
*/
|
|
2359
|
-
const
|
|
2360
|
-
class
|
|
2383
|
+
const Vi = "http://localhost";
|
|
2384
|
+
class B extends zt {
|
|
2361
2385
|
constructor() {
|
|
2362
2386
|
super(...arguments), this.pendingToken = null;
|
|
2363
2387
|
}
|
|
2364
2388
|
/** @internal */
|
|
2365
2389
|
static _fromParams(e) {
|
|
2366
|
-
const t = new
|
|
2390
|
+
const t = new B(e.providerId, e.signInMethod);
|
|
2367
2391
|
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) : O(
|
|
2368
2392
|
"argument-error"
|
|
2369
2393
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
@@ -2394,27 +2418,27 @@ class j extends zt {
|
|
|
2394
2418
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2395
2419
|
if (!i || !r)
|
|
2396
2420
|
return null;
|
|
2397
|
-
const o = new
|
|
2421
|
+
const o = new B(i, r);
|
|
2398
2422
|
return o.idToken = s.idToken || void 0, o.accessToken = s.accessToken || void 0, o.secret = s.secret, o.nonce = s.nonce, o.pendingToken = s.pendingToken || null, o;
|
|
2399
2423
|
}
|
|
2400
2424
|
/** @internal */
|
|
2401
2425
|
_getIdTokenResponse(e) {
|
|
2402
2426
|
const t = this.buildRequest();
|
|
2403
|
-
return
|
|
2427
|
+
return J(e, t);
|
|
2404
2428
|
}
|
|
2405
2429
|
/** @internal */
|
|
2406
2430
|
_linkToIdToken(e, t) {
|
|
2407
2431
|
const i = this.buildRequest();
|
|
2408
|
-
return i.idToken = t,
|
|
2432
|
+
return i.idToken = t, J(e, i);
|
|
2409
2433
|
}
|
|
2410
2434
|
/** @internal */
|
|
2411
2435
|
_getReauthenticationResolver(e) {
|
|
2412
2436
|
const t = this.buildRequest();
|
|
2413
|
-
return t.autoCreate = !1,
|
|
2437
|
+
return t.autoCreate = !1, J(e, t);
|
|
2414
2438
|
}
|
|
2415
2439
|
buildRequest() {
|
|
2416
2440
|
const e = {
|
|
2417
|
-
requestUri:
|
|
2441
|
+
requestUri: Vi,
|
|
2418
2442
|
returnSecureToken: !0
|
|
2419
2443
|
};
|
|
2420
2444
|
if (this.pendingToken)
|
|
@@ -2530,7 +2554,7 @@ class ae extends qt {
|
|
|
2530
2554
|
* See the License for the specific language governing permissions and
|
|
2531
2555
|
* limitations under the License.
|
|
2532
2556
|
*/
|
|
2533
|
-
class
|
|
2557
|
+
class x extends ae {
|
|
2534
2558
|
constructor() {
|
|
2535
2559
|
super(
|
|
2536
2560
|
"facebook.com"
|
|
@@ -2550,9 +2574,9 @@ class D extends ae {
|
|
|
2550
2574
|
* @param accessToken - Facebook access token.
|
|
2551
2575
|
*/
|
|
2552
2576
|
static credential(e) {
|
|
2553
|
-
return
|
|
2554
|
-
providerId:
|
|
2555
|
-
signInMethod:
|
|
2577
|
+
return B._fromParams({
|
|
2578
|
+
providerId: x.PROVIDER_ID,
|
|
2579
|
+
signInMethod: x.FACEBOOK_SIGN_IN_METHOD,
|
|
2556
2580
|
accessToken: e
|
|
2557
2581
|
});
|
|
2558
2582
|
}
|
|
@@ -2562,7 +2586,7 @@ class D extends ae {
|
|
|
2562
2586
|
* @param userCredential - The user credential.
|
|
2563
2587
|
*/
|
|
2564
2588
|
static credentialFromResult(e) {
|
|
2565
|
-
return
|
|
2589
|
+
return x.credentialFromTaggedObject(e);
|
|
2566
2590
|
}
|
|
2567
2591
|
/**
|
|
2568
2592
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2571,20 +2595,20 @@ class D extends ae {
|
|
|
2571
2595
|
* @param userCredential - The user credential.
|
|
2572
2596
|
*/
|
|
2573
2597
|
static credentialFromError(e) {
|
|
2574
|
-
return
|
|
2598
|
+
return x.credentialFromTaggedObject(e.customData || {});
|
|
2575
2599
|
}
|
|
2576
2600
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2577
2601
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2578
2602
|
return null;
|
|
2579
2603
|
try {
|
|
2580
|
-
return
|
|
2604
|
+
return x.credential(e.oauthAccessToken);
|
|
2581
2605
|
} catch {
|
|
2582
2606
|
return null;
|
|
2583
2607
|
}
|
|
2584
2608
|
}
|
|
2585
2609
|
}
|
|
2586
|
-
|
|
2587
|
-
|
|
2610
|
+
x.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
2611
|
+
x.PROVIDER_ID = "facebook.com";
|
|
2588
2612
|
/**
|
|
2589
2613
|
* @license
|
|
2590
2614
|
* Copyright 2020 Google LLC
|
|
@@ -2601,7 +2625,7 @@ D.PROVIDER_ID = "facebook.com";
|
|
|
2601
2625
|
* See the License for the specific language governing permissions and
|
|
2602
2626
|
* limitations under the License.
|
|
2603
2627
|
*/
|
|
2604
|
-
class
|
|
2628
|
+
class F extends ae {
|
|
2605
2629
|
constructor() {
|
|
2606
2630
|
super(
|
|
2607
2631
|
"google.com"
|
|
@@ -2622,9 +2646,9 @@ class x extends ae {
|
|
|
2622
2646
|
* @param accessToken - Google access token.
|
|
2623
2647
|
*/
|
|
2624
2648
|
static credential(e, t) {
|
|
2625
|
-
return
|
|
2626
|
-
providerId:
|
|
2627
|
-
signInMethod:
|
|
2649
|
+
return B._fromParams({
|
|
2650
|
+
providerId: F.PROVIDER_ID,
|
|
2651
|
+
signInMethod: F.GOOGLE_SIGN_IN_METHOD,
|
|
2628
2652
|
idToken: e,
|
|
2629
2653
|
accessToken: t
|
|
2630
2654
|
});
|
|
@@ -2635,7 +2659,7 @@ class x extends ae {
|
|
|
2635
2659
|
* @param userCredential - The user credential.
|
|
2636
2660
|
*/
|
|
2637
2661
|
static credentialFromResult(e) {
|
|
2638
|
-
return
|
|
2662
|
+
return F.credentialFromTaggedObject(e);
|
|
2639
2663
|
}
|
|
2640
2664
|
/**
|
|
2641
2665
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2644,7 +2668,7 @@ class x extends ae {
|
|
|
2644
2668
|
* @param userCredential - The user credential.
|
|
2645
2669
|
*/
|
|
2646
2670
|
static credentialFromError(e) {
|
|
2647
|
-
return
|
|
2671
|
+
return F.credentialFromTaggedObject(e.customData || {});
|
|
2648
2672
|
}
|
|
2649
2673
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2650
2674
|
if (!e)
|
|
@@ -2653,14 +2677,14 @@ class x extends ae {
|
|
|
2653
2677
|
if (!t && !i)
|
|
2654
2678
|
return null;
|
|
2655
2679
|
try {
|
|
2656
|
-
return
|
|
2680
|
+
return F.credential(t, i);
|
|
2657
2681
|
} catch {
|
|
2658
2682
|
return null;
|
|
2659
2683
|
}
|
|
2660
2684
|
}
|
|
2661
2685
|
}
|
|
2662
|
-
|
|
2663
|
-
|
|
2686
|
+
F.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2687
|
+
F.PROVIDER_ID = "google.com";
|
|
2664
2688
|
/**
|
|
2665
2689
|
* @license
|
|
2666
2690
|
* Copyright 2020 Google LLC
|
|
@@ -2677,7 +2701,7 @@ x.PROVIDER_ID = "google.com";
|
|
|
2677
2701
|
* See the License for the specific language governing permissions and
|
|
2678
2702
|
* limitations under the License.
|
|
2679
2703
|
*/
|
|
2680
|
-
class
|
|
2704
|
+
class V extends ae {
|
|
2681
2705
|
constructor() {
|
|
2682
2706
|
super(
|
|
2683
2707
|
"github.com"
|
|
@@ -2690,9 +2714,9 @@ class F extends ae {
|
|
|
2690
2714
|
* @param accessToken - Github access token.
|
|
2691
2715
|
*/
|
|
2692
2716
|
static credential(e) {
|
|
2693
|
-
return
|
|
2694
|
-
providerId:
|
|
2695
|
-
signInMethod:
|
|
2717
|
+
return B._fromParams({
|
|
2718
|
+
providerId: V.PROVIDER_ID,
|
|
2719
|
+
signInMethod: V.GITHUB_SIGN_IN_METHOD,
|
|
2696
2720
|
accessToken: e
|
|
2697
2721
|
});
|
|
2698
2722
|
}
|
|
@@ -2702,7 +2726,7 @@ class F extends ae {
|
|
|
2702
2726
|
* @param userCredential - The user credential.
|
|
2703
2727
|
*/
|
|
2704
2728
|
static credentialFromResult(e) {
|
|
2705
|
-
return
|
|
2729
|
+
return V.credentialFromTaggedObject(e);
|
|
2706
2730
|
}
|
|
2707
2731
|
/**
|
|
2708
2732
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2711,20 +2735,20 @@ class F extends ae {
|
|
|
2711
2735
|
* @param userCredential - The user credential.
|
|
2712
2736
|
*/
|
|
2713
2737
|
static credentialFromError(e) {
|
|
2714
|
-
return
|
|
2738
|
+
return V.credentialFromTaggedObject(e.customData || {});
|
|
2715
2739
|
}
|
|
2716
2740
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2717
2741
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2718
2742
|
return null;
|
|
2719
2743
|
try {
|
|
2720
|
-
return
|
|
2744
|
+
return V.credential(e.oauthAccessToken);
|
|
2721
2745
|
} catch {
|
|
2722
2746
|
return null;
|
|
2723
2747
|
}
|
|
2724
2748
|
}
|
|
2725
2749
|
}
|
|
2726
|
-
|
|
2727
|
-
|
|
2750
|
+
V.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2751
|
+
V.PROVIDER_ID = "github.com";
|
|
2728
2752
|
/**
|
|
2729
2753
|
* @license
|
|
2730
2754
|
* Copyright 2020 Google LLC
|
|
@@ -2741,7 +2765,7 @@ F.PROVIDER_ID = "github.com";
|
|
|
2741
2765
|
* See the License for the specific language governing permissions and
|
|
2742
2766
|
* limitations under the License.
|
|
2743
2767
|
*/
|
|
2744
|
-
class
|
|
2768
|
+
class $ extends ae {
|
|
2745
2769
|
constructor() {
|
|
2746
2770
|
super(
|
|
2747
2771
|
"twitter.com"
|
|
@@ -2755,9 +2779,9 @@ class V extends ae {
|
|
|
2755
2779
|
* @param secret - Twitter secret.
|
|
2756
2780
|
*/
|
|
2757
2781
|
static credential(e, t) {
|
|
2758
|
-
return
|
|
2759
|
-
providerId:
|
|
2760
|
-
signInMethod:
|
|
2782
|
+
return B._fromParams({
|
|
2783
|
+
providerId: $.PROVIDER_ID,
|
|
2784
|
+
signInMethod: $.TWITTER_SIGN_IN_METHOD,
|
|
2761
2785
|
oauthToken: e,
|
|
2762
2786
|
oauthTokenSecret: t
|
|
2763
2787
|
});
|
|
@@ -2768,7 +2792,7 @@ class V extends ae {
|
|
|
2768
2792
|
* @param userCredential - The user credential.
|
|
2769
2793
|
*/
|
|
2770
2794
|
static credentialFromResult(e) {
|
|
2771
|
-
return
|
|
2795
|
+
return $.credentialFromTaggedObject(e);
|
|
2772
2796
|
}
|
|
2773
2797
|
/**
|
|
2774
2798
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2777,7 +2801,7 @@ class V extends ae {
|
|
|
2777
2801
|
* @param userCredential - The user credential.
|
|
2778
2802
|
*/
|
|
2779
2803
|
static credentialFromError(e) {
|
|
2780
|
-
return
|
|
2804
|
+
return $.credentialFromTaggedObject(e.customData || {});
|
|
2781
2805
|
}
|
|
2782
2806
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2783
2807
|
if (!e)
|
|
@@ -2786,14 +2810,14 @@ class V extends ae {
|
|
|
2786
2810
|
if (!t || !i)
|
|
2787
2811
|
return null;
|
|
2788
2812
|
try {
|
|
2789
|
-
return
|
|
2813
|
+
return $.credential(t, i);
|
|
2790
2814
|
} catch {
|
|
2791
2815
|
return null;
|
|
2792
2816
|
}
|
|
2793
2817
|
}
|
|
2794
2818
|
}
|
|
2795
|
-
|
|
2796
|
-
|
|
2819
|
+
$.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
2820
|
+
$.PROVIDER_ID = "twitter.com";
|
|
2797
2821
|
/**
|
|
2798
2822
|
* @license
|
|
2799
2823
|
* Copyright 2020 Google LLC
|
|
@@ -2810,13 +2834,13 @@ V.PROVIDER_ID = "twitter.com";
|
|
|
2810
2834
|
* See the License for the specific language governing permissions and
|
|
2811
2835
|
* limitations under the License.
|
|
2812
2836
|
*/
|
|
2813
|
-
class
|
|
2837
|
+
class G {
|
|
2814
2838
|
constructor(e) {
|
|
2815
2839
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2816
2840
|
}
|
|
2817
2841
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2818
2842
|
const s = await C._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2819
|
-
return new
|
|
2843
|
+
return new G({
|
|
2820
2844
|
user: s,
|
|
2821
2845
|
providerId: o,
|
|
2822
2846
|
_tokenResponse: i,
|
|
@@ -2830,7 +2854,7 @@ class W {
|
|
|
2830
2854
|
!0
|
|
2831
2855
|
);
|
|
2832
2856
|
const r = lt(i);
|
|
2833
|
-
return new
|
|
2857
|
+
return new G({
|
|
2834
2858
|
user: e,
|
|
2835
2859
|
providerId: r,
|
|
2836
2860
|
_tokenResponse: i,
|
|
@@ -2857,10 +2881,10 @@ function lt(n) {
|
|
|
2857
2881
|
* See the License for the specific language governing permissions and
|
|
2858
2882
|
* limitations under the License.
|
|
2859
2883
|
*/
|
|
2860
|
-
class
|
|
2884
|
+
class Ie extends Ve {
|
|
2861
2885
|
constructor(e, t, i, r) {
|
|
2862
2886
|
var s;
|
|
2863
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2887
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, Ie.prototype), this.customData = {
|
|
2864
2888
|
appName: e.name,
|
|
2865
2889
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2866
2890
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2868,17 +2892,17 @@ class ve extends Ve {
|
|
|
2868
2892
|
};
|
|
2869
2893
|
}
|
|
2870
2894
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2871
|
-
return new
|
|
2895
|
+
return new Ie(e, t, i, r);
|
|
2872
2896
|
}
|
|
2873
2897
|
}
|
|
2874
2898
|
function Kt(n, e, t, i) {
|
|
2875
2899
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2876
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2900
|
+
throw s.code === "auth/multi-factor-auth-required" ? Ie._fromErrorAndOperation(n, s, e, i) : s;
|
|
2877
2901
|
});
|
|
2878
2902
|
}
|
|
2879
|
-
async function
|
|
2903
|
+
async function $i(n, e, t = !1) {
|
|
2880
2904
|
const i = await ie(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2881
|
-
return
|
|
2905
|
+
return G._forOperation(n, "link", i);
|
|
2882
2906
|
}
|
|
2883
2907
|
/**
|
|
2884
2908
|
* @license
|
|
@@ -2896,10 +2920,10 @@ async function Fi(n, e, t = !1) {
|
|
|
2896
2920
|
* See the License for the specific language governing permissions and
|
|
2897
2921
|
* limitations under the License.
|
|
2898
2922
|
*/
|
|
2899
|
-
async function
|
|
2923
|
+
async function Hi(n, e, t = !1) {
|
|
2900
2924
|
const { auth: i } = n;
|
|
2901
2925
|
if (A(i.app))
|
|
2902
|
-
return Promise.reject(
|
|
2926
|
+
return Promise.reject(H(i));
|
|
2903
2927
|
const r = "reauthenticate";
|
|
2904
2928
|
try {
|
|
2905
2929
|
const s = await ie(n, Kt(i, r, e, n), t);
|
|
@@ -2922,7 +2946,7 @@ async function Vi(n, e, t = !1) {
|
|
|
2922
2946
|
i,
|
|
2923
2947
|
"user-mismatch"
|
|
2924
2948
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2925
|
-
),
|
|
2949
|
+
), G._forOperation(n, r, s);
|
|
2926
2950
|
} catch (s) {
|
|
2927
2951
|
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && O(
|
|
2928
2952
|
i,
|
|
@@ -2947,10 +2971,10 @@ async function Vi(n, e, t = !1) {
|
|
|
2947
2971
|
* See the License for the specific language governing permissions and
|
|
2948
2972
|
* limitations under the License.
|
|
2949
2973
|
*/
|
|
2950
|
-
async function
|
|
2974
|
+
async function ji(n, e, t = !1) {
|
|
2951
2975
|
if (A(n.app))
|
|
2952
|
-
return Promise.reject(
|
|
2953
|
-
const i = "signIn", r = await Kt(n, i, e), s = await
|
|
2976
|
+
return Promise.reject(H(n));
|
|
2977
|
+
const i = "signIn", r = await Kt(n, i, e), s = await G._fromIdTokenResponse(n, i, r);
|
|
2954
2978
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2955
2979
|
}
|
|
2956
2980
|
/**
|
|
@@ -2969,8 +2993,8 @@ async function $i(n, e, t = !1) {
|
|
|
2969
2993
|
* See the License for the specific language governing permissions and
|
|
2970
2994
|
* limitations under the License.
|
|
2971
2995
|
*/
|
|
2972
|
-
async function
|
|
2973
|
-
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2996
|
+
async function Wi(n, e) {
|
|
2997
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", Te(n, e));
|
|
2974
2998
|
}
|
|
2975
2999
|
/**
|
|
2976
3000
|
* @license
|
|
@@ -2988,22 +3012,22 @@ async function Hi(n, e) {
|
|
|
2988
3012
|
* See the License for the specific language governing permissions and
|
|
2989
3013
|
* limitations under the License.
|
|
2990
3014
|
*/
|
|
2991
|
-
async function
|
|
3015
|
+
async function Bi(n, e) {
|
|
2992
3016
|
if (A(n.app))
|
|
2993
|
-
return Promise.reject(
|
|
2994
|
-
const t =
|
|
3017
|
+
return Promise.reject(H(n));
|
|
3018
|
+
const t = be(n), i = await Wi(t, {
|
|
2995
3019
|
token: e,
|
|
2996
3020
|
returnSecureToken: !0
|
|
2997
|
-
}), r = await
|
|
3021
|
+
}), r = await G._fromIdTokenResponse(t, "signIn", i);
|
|
2998
3022
|
return await t._updateCurrentUser(r.user), r;
|
|
2999
3023
|
}
|
|
3000
|
-
function
|
|
3001
|
-
return
|
|
3024
|
+
function Gi(n, e, t, i) {
|
|
3025
|
+
return Y(n).onIdTokenChanged(e, t, i);
|
|
3002
3026
|
}
|
|
3003
|
-
function
|
|
3004
|
-
return
|
|
3027
|
+
function zi(n, e, t) {
|
|
3028
|
+
return Y(n).beforeAuthStateChanged(e, t);
|
|
3005
3029
|
}
|
|
3006
|
-
const
|
|
3030
|
+
const ye = "__sak";
|
|
3007
3031
|
/**
|
|
3008
3032
|
* @license
|
|
3009
3033
|
* Copyright 2019 Google LLC
|
|
@@ -3026,7 +3050,7 @@ class Jt {
|
|
|
3026
3050
|
}
|
|
3027
3051
|
_isAvailable() {
|
|
3028
3052
|
try {
|
|
3029
|
-
return this.storage ? (this.storage.setItem(
|
|
3053
|
+
return this.storage ? (this.storage.setItem(ye, "1"), this.storage.removeItem(ye), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
3030
3054
|
} catch {
|
|
3031
3055
|
return Promise.resolve(!1);
|
|
3032
3056
|
}
|
|
@@ -3061,18 +3085,18 @@ class Jt {
|
|
|
3061
3085
|
* See the License for the specific language governing permissions and
|
|
3062
3086
|
* limitations under the License.
|
|
3063
3087
|
*/
|
|
3064
|
-
function
|
|
3065
|
-
const n =
|
|
3066
|
-
return
|
|
3088
|
+
function qi() {
|
|
3089
|
+
const n = w();
|
|
3090
|
+
return Be(n) || ke(n);
|
|
3067
3091
|
}
|
|
3068
|
-
const
|
|
3092
|
+
const Ki = 1e3, Ji = 10;
|
|
3069
3093
|
class Yt extends Jt {
|
|
3070
3094
|
constructor() {
|
|
3071
3095
|
super(
|
|
3072
3096
|
() => window.localStorage,
|
|
3073
3097
|
"LOCAL"
|
|
3074
3098
|
/* PersistenceType.LOCAL */
|
|
3075
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3099
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = qi() && bi(), this.fallbackToPolling = Wt(), this._shouldAllowMigration = !0;
|
|
3076
3100
|
}
|
|
3077
3101
|
forAllChangedKeys(e) {
|
|
3078
3102
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -3099,7 +3123,7 @@ class Yt extends Jt {
|
|
|
3099
3123
|
const o = this.storage.getItem(i);
|
|
3100
3124
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
3101
3125
|
}, s = this.storage.getItem(i);
|
|
3102
|
-
|
|
3126
|
+
ki() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ji) : r();
|
|
3103
3127
|
}
|
|
3104
3128
|
notifyListeners(e, t) {
|
|
3105
3129
|
this.localCache[e] = t;
|
|
@@ -3121,7 +3145,7 @@ class Yt extends Jt {
|
|
|
3121
3145
|
!0
|
|
3122
3146
|
);
|
|
3123
3147
|
});
|
|
3124
|
-
},
|
|
3148
|
+
}, Ki);
|
|
3125
3149
|
}
|
|
3126
3150
|
stopPolling() {
|
|
3127
3151
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3151,7 +3175,7 @@ class Yt extends Jt {
|
|
|
3151
3175
|
}
|
|
3152
3176
|
}
|
|
3153
3177
|
Yt.type = "LOCAL";
|
|
3154
|
-
const
|
|
3178
|
+
const Yi = Yt;
|
|
3155
3179
|
/**
|
|
3156
3180
|
* @license
|
|
3157
3181
|
* Copyright 2020 Google LLC
|
|
@@ -3199,7 +3223,7 @@ const Qt = Xt;
|
|
|
3199
3223
|
* See the License for the specific language governing permissions and
|
|
3200
3224
|
* limitations under the License.
|
|
3201
3225
|
*/
|
|
3202
|
-
function
|
|
3226
|
+
function Xi(n) {
|
|
3203
3227
|
return Promise.all(n.map(async (e) => {
|
|
3204
3228
|
try {
|
|
3205
3229
|
return {
|
|
@@ -3269,7 +3293,7 @@ class Ee {
|
|
|
3269
3293
|
eventId: i,
|
|
3270
3294
|
eventType: r
|
|
3271
3295
|
});
|
|
3272
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3296
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Xi(c);
|
|
3273
3297
|
t.ports[0].postMessage({
|
|
3274
3298
|
status: "done",
|
|
3275
3299
|
eventId: i,
|
|
@@ -3337,7 +3361,7 @@ function ze(n = "", e = 10) {
|
|
|
3337
3361
|
* See the License for the specific language governing permissions and
|
|
3338
3362
|
* limitations under the License.
|
|
3339
3363
|
*/
|
|
3340
|
-
class
|
|
3364
|
+
class Qi {
|
|
3341
3365
|
constructor(e) {
|
|
3342
3366
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3343
3367
|
}
|
|
@@ -3381,10 +3405,10 @@ class Yi {
|
|
|
3381
3405
|
}, i);
|
|
3382
3406
|
o = {
|
|
3383
3407
|
messageChannel: r,
|
|
3384
|
-
onMessage(
|
|
3385
|
-
const
|
|
3386
|
-
if (
|
|
3387
|
-
switch (
|
|
3408
|
+
onMessage(m) {
|
|
3409
|
+
const h = m;
|
|
3410
|
+
if (h.data.eventId === l)
|
|
3411
|
+
switch (h.data.status) {
|
|
3388
3412
|
case "ack":
|
|
3389
3413
|
clearTimeout(d), s = setTimeout(
|
|
3390
3414
|
() => {
|
|
@@ -3398,7 +3422,7 @@ class Yi {
|
|
|
3398
3422
|
);
|
|
3399
3423
|
break;
|
|
3400
3424
|
case "done":
|
|
3401
|
-
clearTimeout(s), c(
|
|
3425
|
+
clearTimeout(s), c(h.data.response);
|
|
3402
3426
|
break;
|
|
3403
3427
|
default:
|
|
3404
3428
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3434,11 +3458,11 @@ class Yi {
|
|
|
3434
3458
|
* See the License for the specific language governing permissions and
|
|
3435
3459
|
* limitations under the License.
|
|
3436
3460
|
*/
|
|
3437
|
-
function
|
|
3461
|
+
function E() {
|
|
3438
3462
|
return window;
|
|
3439
3463
|
}
|
|
3440
|
-
function
|
|
3441
|
-
|
|
3464
|
+
function Zi(n) {
|
|
3465
|
+
E().location.href = n;
|
|
3442
3466
|
}
|
|
3443
3467
|
/**
|
|
3444
3468
|
* @license
|
|
@@ -3457,9 +3481,9 @@ function Xi(n) {
|
|
|
3457
3481
|
* limitations under the License.
|
|
3458
3482
|
*/
|
|
3459
3483
|
function Zt() {
|
|
3460
|
-
return typeof
|
|
3484
|
+
return typeof E().WorkerGlobalScope < "u" && typeof E().importScripts == "function";
|
|
3461
3485
|
}
|
|
3462
|
-
async function
|
|
3486
|
+
async function er() {
|
|
3463
3487
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3464
3488
|
return null;
|
|
3465
3489
|
try {
|
|
@@ -3468,11 +3492,11 @@ async function Qi() {
|
|
|
3468
3492
|
return null;
|
|
3469
3493
|
}
|
|
3470
3494
|
}
|
|
3471
|
-
function
|
|
3495
|
+
function tr() {
|
|
3472
3496
|
var n;
|
|
3473
3497
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3474
3498
|
}
|
|
3475
|
-
function
|
|
3499
|
+
function nr() {
|
|
3476
3500
|
return Zt() ? self : null;
|
|
3477
3501
|
}
|
|
3478
3502
|
/**
|
|
@@ -3491,7 +3515,7 @@ function er() {
|
|
|
3491
3515
|
* See the License for the specific language governing permissions and
|
|
3492
3516
|
* limitations under the License.
|
|
3493
3517
|
*/
|
|
3494
|
-
const en = "firebaseLocalStorageDb",
|
|
3518
|
+
const en = "firebaseLocalStorageDb", ir = 1, we = "firebaseLocalStorage", tn = "fbase_key";
|
|
3495
3519
|
class ce {
|
|
3496
3520
|
constructor(e) {
|
|
3497
3521
|
this.request = e;
|
|
@@ -3506,47 +3530,47 @@ class ce {
|
|
|
3506
3530
|
});
|
|
3507
3531
|
}
|
|
3508
3532
|
}
|
|
3509
|
-
function
|
|
3510
|
-
return n.transaction([
|
|
3533
|
+
function Se(n, e) {
|
|
3534
|
+
return n.transaction([we], e ? "readwrite" : "readonly").objectStore(we);
|
|
3511
3535
|
}
|
|
3512
|
-
function
|
|
3536
|
+
function rr() {
|
|
3513
3537
|
const n = indexedDB.deleteDatabase(en);
|
|
3514
3538
|
return new ce(n).toPromise();
|
|
3515
3539
|
}
|
|
3516
|
-
function
|
|
3517
|
-
const n = indexedDB.open(en,
|
|
3540
|
+
function De() {
|
|
3541
|
+
const n = indexedDB.open(en, ir);
|
|
3518
3542
|
return new Promise((e, t) => {
|
|
3519
3543
|
n.addEventListener("error", () => {
|
|
3520
3544
|
t(n.error);
|
|
3521
3545
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3522
3546
|
const i = n.result;
|
|
3523
3547
|
try {
|
|
3524
|
-
i.createObjectStore(
|
|
3548
|
+
i.createObjectStore(we, { keyPath: tn });
|
|
3525
3549
|
} catch (r) {
|
|
3526
3550
|
t(r);
|
|
3527
3551
|
}
|
|
3528
3552
|
}), n.addEventListener("success", async () => {
|
|
3529
3553
|
const i = n.result;
|
|
3530
|
-
i.objectStoreNames.contains(
|
|
3554
|
+
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await rr(), e(await De()));
|
|
3531
3555
|
});
|
|
3532
3556
|
});
|
|
3533
3557
|
}
|
|
3534
3558
|
async function ut(n, e, t) {
|
|
3535
|
-
const i =
|
|
3559
|
+
const i = Se(n, !0).put({
|
|
3536
3560
|
[tn]: e,
|
|
3537
3561
|
value: t
|
|
3538
3562
|
});
|
|
3539
3563
|
return new ce(i).toPromise();
|
|
3540
3564
|
}
|
|
3541
|
-
async function
|
|
3542
|
-
const t =
|
|
3565
|
+
async function sr(n, e) {
|
|
3566
|
+
const t = Se(n, !1).get(e), i = await new ce(t).toPromise();
|
|
3543
3567
|
return i === void 0 ? null : i.value;
|
|
3544
3568
|
}
|
|
3545
3569
|
function dt(n, e) {
|
|
3546
|
-
const t =
|
|
3570
|
+
const t = Se(n, !0).delete(e);
|
|
3547
3571
|
return new ce(t).toPromise();
|
|
3548
3572
|
}
|
|
3549
|
-
const
|
|
3573
|
+
const or = 800, ar = 3;
|
|
3550
3574
|
class nn {
|
|
3551
3575
|
constructor() {
|
|
3552
3576
|
this.type = "LOCAL", this._shouldAllowMigration = !0, this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.pendingWrites = 0, this.receiver = null, this.sender = null, this.serviceWorkerReceiverAvailable = !1, this.activeServiceWorker = null, this._workerInitializationPromise = this.initializeServiceWorkerMessaging().then(() => {
|
|
@@ -3554,7 +3578,7 @@ class nn {
|
|
|
3554
3578
|
});
|
|
3555
3579
|
}
|
|
3556
3580
|
async _openDb() {
|
|
3557
|
-
return this.db ? this.db : (this.db = await
|
|
3581
|
+
return this.db ? this.db : (this.db = await De(), this.db);
|
|
3558
3582
|
}
|
|
3559
3583
|
async _withRetries(e) {
|
|
3560
3584
|
let t = 0;
|
|
@@ -3563,7 +3587,7 @@ class nn {
|
|
|
3563
3587
|
const i = await this._openDb();
|
|
3564
3588
|
return await e(i);
|
|
3565
3589
|
} catch (i) {
|
|
3566
|
-
if (t++ >
|
|
3590
|
+
if (t++ > ar)
|
|
3567
3591
|
throw i;
|
|
3568
3592
|
this.db && (this.db.close(), this.db = void 0);
|
|
3569
3593
|
}
|
|
@@ -3579,7 +3603,7 @@ class nn {
|
|
|
3579
3603
|
* As the worker we should listen to events from the main window.
|
|
3580
3604
|
*/
|
|
3581
3605
|
async initializeReceiver() {
|
|
3582
|
-
this.receiver = Ee._getInstance(
|
|
3606
|
+
this.receiver = Ee._getInstance(nr()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3583
3607
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3584
3608
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3585
3609
|
"keyChanged"
|
|
@@ -3595,9 +3619,9 @@ class nn {
|
|
|
3595
3619
|
*/
|
|
3596
3620
|
async initializeSender() {
|
|
3597
3621
|
var e, t;
|
|
3598
|
-
if (this.activeServiceWorker = await
|
|
3622
|
+
if (this.activeServiceWorker = await er(), !this.activeServiceWorker)
|
|
3599
3623
|
return;
|
|
3600
|
-
this.sender = new
|
|
3624
|
+
this.sender = new Qi(this.activeServiceWorker);
|
|
3601
3625
|
const i = await this.sender._send(
|
|
3602
3626
|
"ping",
|
|
3603
3627
|
{},
|
|
@@ -3619,7 +3643,7 @@ class nn {
|
|
|
3619
3643
|
* @param key - Storage key which changed.
|
|
3620
3644
|
*/
|
|
3621
3645
|
async notifyServiceWorker(e) {
|
|
3622
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3646
|
+
if (!(!this.sender || !this.activeServiceWorker || tr() !== this.activeServiceWorker))
|
|
3623
3647
|
try {
|
|
3624
3648
|
await this.sender._send(
|
|
3625
3649
|
"keyChanged",
|
|
@@ -3635,8 +3659,8 @@ class nn {
|
|
|
3635
3659
|
try {
|
|
3636
3660
|
if (!indexedDB)
|
|
3637
3661
|
return !1;
|
|
3638
|
-
const e = await
|
|
3639
|
-
return await ut(e,
|
|
3662
|
+
const e = await De();
|
|
3663
|
+
return await ut(e, ye, "1"), await dt(e, ye), !0;
|
|
3640
3664
|
} catch {
|
|
3641
3665
|
}
|
|
3642
3666
|
return !1;
|
|
@@ -3653,7 +3677,7 @@ class nn {
|
|
|
3653
3677
|
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3654
3678
|
}
|
|
3655
3679
|
async _get(e) {
|
|
3656
|
-
const t = await this._withRetries((i) =>
|
|
3680
|
+
const t = await this._withRetries((i) => sr(i, e));
|
|
3657
3681
|
return this.localCache[e] = t, t;
|
|
3658
3682
|
}
|
|
3659
3683
|
async _remove(e) {
|
|
@@ -3661,7 +3685,7 @@ class nn {
|
|
|
3661
3685
|
}
|
|
3662
3686
|
async _poll() {
|
|
3663
3687
|
const e = await this._withRetries((r) => {
|
|
3664
|
-
const s =
|
|
3688
|
+
const s = Se(r, !1).getAll();
|
|
3665
3689
|
return new ce(s).toPromise();
|
|
3666
3690
|
});
|
|
3667
3691
|
if (!e)
|
|
@@ -3684,7 +3708,7 @@ class nn {
|
|
|
3684
3708
|
r(t);
|
|
3685
3709
|
}
|
|
3686
3710
|
startPolling() {
|
|
3687
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3711
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), or);
|
|
3688
3712
|
}
|
|
3689
3713
|
stopPolling() {
|
|
3690
3714
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3697,7 +3721,7 @@ class nn {
|
|
|
3697
3721
|
}
|
|
3698
3722
|
}
|
|
3699
3723
|
nn.type = "LOCAL";
|
|
3700
|
-
const
|
|
3724
|
+
const cr = nn;
|
|
3701
3725
|
new oe(3e4, 6e4);
|
|
3702
3726
|
/**
|
|
3703
3727
|
* @license
|
|
@@ -3715,7 +3739,7 @@ new oe(3e4, 6e4);
|
|
|
3715
3739
|
* See the License for the specific language governing permissions and
|
|
3716
3740
|
* limitations under the License.
|
|
3717
3741
|
*/
|
|
3718
|
-
function
|
|
3742
|
+
function lr(n, e) {
|
|
3719
3743
|
return e ? N(e) : (u(
|
|
3720
3744
|
n._popupRedirectResolver,
|
|
3721
3745
|
n,
|
|
@@ -3748,13 +3772,13 @@ class qe extends zt {
|
|
|
3748
3772
|
), this.params = e;
|
|
3749
3773
|
}
|
|
3750
3774
|
_getIdTokenResponse(e) {
|
|
3751
|
-
return
|
|
3775
|
+
return J(e, this._buildIdpRequest());
|
|
3752
3776
|
}
|
|
3753
3777
|
_linkToIdToken(e, t) {
|
|
3754
|
-
return
|
|
3778
|
+
return J(e, this._buildIdpRequest(t));
|
|
3755
3779
|
}
|
|
3756
3780
|
_getReauthenticationResolver(e) {
|
|
3757
|
-
return
|
|
3781
|
+
return J(e, this._buildIdpRequest());
|
|
3758
3782
|
}
|
|
3759
3783
|
_buildIdpRequest(e) {
|
|
3760
3784
|
const t = {
|
|
@@ -3769,26 +3793,26 @@ class qe extends zt {
|
|
|
3769
3793
|
return e && (t.idToken = e), t;
|
|
3770
3794
|
}
|
|
3771
3795
|
}
|
|
3772
|
-
function
|
|
3773
|
-
return
|
|
3796
|
+
function ur(n) {
|
|
3797
|
+
return ji(n.auth, new qe(n), n.bypassAuthState);
|
|
3774
3798
|
}
|
|
3775
|
-
function
|
|
3799
|
+
function dr(n) {
|
|
3776
3800
|
const { auth: e, user: t } = n;
|
|
3777
3801
|
return u(
|
|
3778
3802
|
t,
|
|
3779
3803
|
e,
|
|
3780
3804
|
"internal-error"
|
|
3781
3805
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3782
|
-
),
|
|
3806
|
+
), Hi(t, new qe(n), n.bypassAuthState);
|
|
3783
3807
|
}
|
|
3784
|
-
async function
|
|
3808
|
+
async function hr(n) {
|
|
3785
3809
|
const { auth: e, user: t } = n;
|
|
3786
3810
|
return u(
|
|
3787
3811
|
t,
|
|
3788
3812
|
e,
|
|
3789
3813
|
"internal-error"
|
|
3790
3814
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3791
|
-
),
|
|
3815
|
+
), $i(t, new qe(n), n.bypassAuthState);
|
|
3792
3816
|
}
|
|
3793
3817
|
/**
|
|
3794
3818
|
* @license
|
|
@@ -3848,13 +3872,13 @@ class rn {
|
|
|
3848
3872
|
switch (e) {
|
|
3849
3873
|
case "signInViaPopup":
|
|
3850
3874
|
case "signInViaRedirect":
|
|
3851
|
-
return
|
|
3875
|
+
return ur;
|
|
3852
3876
|
case "linkViaPopup":
|
|
3853
3877
|
case "linkViaRedirect":
|
|
3854
|
-
return
|
|
3878
|
+
return hr;
|
|
3855
3879
|
case "reauthViaPopup":
|
|
3856
3880
|
case "reauthViaRedirect":
|
|
3857
|
-
return
|
|
3881
|
+
return dr;
|
|
3858
3882
|
default:
|
|
3859
3883
|
O(
|
|
3860
3884
|
this.auth,
|
|
@@ -3889,10 +3913,10 @@ class rn {
|
|
|
3889
3913
|
* See the License for the specific language governing permissions and
|
|
3890
3914
|
* limitations under the License.
|
|
3891
3915
|
*/
|
|
3892
|
-
const
|
|
3893
|
-
class
|
|
3916
|
+
const fr = new oe(2e3, 1e4);
|
|
3917
|
+
class z extends rn {
|
|
3894
3918
|
constructor(e, t, i, r, s) {
|
|
3895
|
-
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null,
|
|
3919
|
+
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, z.currentPopupAction && z.currentPopupAction.cancel(), z.currentPopupAction = this;
|
|
3896
3920
|
}
|
|
3897
3921
|
async executeNotNull() {
|
|
3898
3922
|
const e = await this.execute();
|
|
@@ -3915,7 +3939,7 @@ class G extends rn {
|
|
|
3915
3939
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3916
3940
|
this.reject(t);
|
|
3917
3941
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3918
|
-
t || this.reject(
|
|
3942
|
+
t || this.reject(b(
|
|
3919
3943
|
this.auth,
|
|
3920
3944
|
"web-storage-unsupported"
|
|
3921
3945
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3927,14 +3951,14 @@ class G extends rn {
|
|
|
3927
3951
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3928
3952
|
}
|
|
3929
3953
|
cancel() {
|
|
3930
|
-
this.reject(
|
|
3954
|
+
this.reject(b(
|
|
3931
3955
|
this.auth,
|
|
3932
3956
|
"cancelled-popup-request"
|
|
3933
3957
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
3934
3958
|
));
|
|
3935
3959
|
}
|
|
3936
3960
|
cleanUp() {
|
|
3937
|
-
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null,
|
|
3961
|
+
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null, z.currentPopupAction = null;
|
|
3938
3962
|
}
|
|
3939
3963
|
pollUserCancellation() {
|
|
3940
3964
|
const e = () => {
|
|
@@ -3942,7 +3966,7 @@ class G extends rn {
|
|
|
3942
3966
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3943
3967
|
this.pollId = window.setTimeout(
|
|
3944
3968
|
() => {
|
|
3945
|
-
this.pollId = null, this.reject(
|
|
3969
|
+
this.pollId = null, this.reject(b(
|
|
3946
3970
|
this.auth,
|
|
3947
3971
|
"popup-closed-by-user"
|
|
3948
3972
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3953,12 +3977,12 @@ class G extends rn {
|
|
|
3953
3977
|
);
|
|
3954
3978
|
return;
|
|
3955
3979
|
}
|
|
3956
|
-
this.pollId = window.setTimeout(e,
|
|
3980
|
+
this.pollId = window.setTimeout(e, fr.get());
|
|
3957
3981
|
};
|
|
3958
3982
|
e();
|
|
3959
3983
|
}
|
|
3960
3984
|
}
|
|
3961
|
-
|
|
3985
|
+
z.currentPopupAction = null;
|
|
3962
3986
|
/**
|
|
3963
3987
|
* @license
|
|
3964
3988
|
* Copyright 2020 Google LLC
|
|
@@ -3975,8 +3999,8 @@ G.currentPopupAction = null;
|
|
|
3975
3999
|
* See the License for the specific language governing permissions and
|
|
3976
4000
|
* limitations under the License.
|
|
3977
4001
|
*/
|
|
3978
|
-
const
|
|
3979
|
-
class
|
|
4002
|
+
const pr = "pendingRedirect", he = /* @__PURE__ */ new Map();
|
|
4003
|
+
class mr extends rn {
|
|
3980
4004
|
constructor(e, t, i = !1) {
|
|
3981
4005
|
super(e, [
|
|
3982
4006
|
"signInViaRedirect",
|
|
@@ -3994,7 +4018,7 @@ class fr extends rn {
|
|
|
3994
4018
|
let e = he.get(this.auth._key());
|
|
3995
4019
|
if (!e) {
|
|
3996
4020
|
try {
|
|
3997
|
-
const i = await
|
|
4021
|
+
const i = await gr(this.resolver, this.auth) ? await super.execute() : null;
|
|
3998
4022
|
e = () => Promise.resolve(i);
|
|
3999
4023
|
} catch (t) {
|
|
4000
4024
|
e = () => Promise.reject(t);
|
|
@@ -4022,26 +4046,26 @@ class fr extends rn {
|
|
|
4022
4046
|
cleanUp() {
|
|
4023
4047
|
}
|
|
4024
4048
|
}
|
|
4025
|
-
async function
|
|
4026
|
-
const t =
|
|
4049
|
+
async function gr(n, e) {
|
|
4050
|
+
const t = Ir(e), i = vr(n);
|
|
4027
4051
|
if (!await i._isAvailable())
|
|
4028
4052
|
return !1;
|
|
4029
4053
|
const r = await i._get(t) === "true";
|
|
4030
4054
|
return await i._remove(t), r;
|
|
4031
4055
|
}
|
|
4032
|
-
function
|
|
4056
|
+
function _r(n, e) {
|
|
4033
4057
|
he.set(n._key(), e);
|
|
4034
4058
|
}
|
|
4035
|
-
function
|
|
4059
|
+
function vr(n) {
|
|
4036
4060
|
return N(n._redirectPersistence);
|
|
4037
4061
|
}
|
|
4038
|
-
function
|
|
4039
|
-
return de(
|
|
4062
|
+
function Ir(n) {
|
|
4063
|
+
return de(pr, n.config.apiKey, n.name);
|
|
4040
4064
|
}
|
|
4041
|
-
async function
|
|
4065
|
+
async function yr(n, e, t = !1) {
|
|
4042
4066
|
if (A(n.app))
|
|
4043
|
-
return Promise.reject(
|
|
4044
|
-
const i =
|
|
4067
|
+
return Promise.reject(H(n));
|
|
4068
|
+
const i = be(n), r = lr(i, e), o = await new mr(i, r, t).execute();
|
|
4045
4069
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
4046
4070
|
}
|
|
4047
4071
|
/**
|
|
@@ -4060,8 +4084,8 @@ async function vr(n, e, t = !1) {
|
|
|
4060
4084
|
* See the License for the specific language governing permissions and
|
|
4061
4085
|
* limitations under the License.
|
|
4062
4086
|
*/
|
|
4063
|
-
const
|
|
4064
|
-
class
|
|
4087
|
+
const wr = 10 * 60 * 1e3;
|
|
4088
|
+
class Tr {
|
|
4065
4089
|
constructor(e) {
|
|
4066
4090
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
4067
4091
|
}
|
|
@@ -4077,13 +4101,13 @@ class yr {
|
|
|
4077
4101
|
let t = !1;
|
|
4078
4102
|
return this.consumers.forEach((i) => {
|
|
4079
4103
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
4080
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4104
|
+
}), this.hasHandledPotentialRedirect || !kr(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
4081
4105
|
}
|
|
4082
4106
|
sendToConsumer(e, t) {
|
|
4083
4107
|
var i;
|
|
4084
4108
|
if (e.error && !sn(e)) {
|
|
4085
4109
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
4086
|
-
t.onError(
|
|
4110
|
+
t.onError(b(this.auth, r));
|
|
4087
4111
|
} else
|
|
4088
4112
|
t.onAuthEvent(e);
|
|
4089
4113
|
}
|
|
@@ -4092,7 +4116,7 @@ class yr {
|
|
|
4092
4116
|
return t.filter.includes(e.type) && i;
|
|
4093
4117
|
}
|
|
4094
4118
|
hasEventBeenHandled(e) {
|
|
4095
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4119
|
+
return Date.now() - this.lastProcessedEventTime >= wr && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
4096
4120
|
}
|
|
4097
4121
|
saveEventToCache(e) {
|
|
4098
4122
|
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -4104,7 +4128,7 @@ function ht(n) {
|
|
|
4104
4128
|
function sn({ type: n, error: e }) {
|
|
4105
4129
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
4106
4130
|
}
|
|
4107
|
-
function
|
|
4131
|
+
function kr(n) {
|
|
4108
4132
|
switch (n.type) {
|
|
4109
4133
|
case "signInViaRedirect":
|
|
4110
4134
|
case "linkViaRedirect":
|
|
@@ -4132,8 +4156,8 @@ function wr(n) {
|
|
|
4132
4156
|
* See the License for the specific language governing permissions and
|
|
4133
4157
|
* limitations under the License.
|
|
4134
4158
|
*/
|
|
4135
|
-
async function
|
|
4136
|
-
return
|
|
4159
|
+
async function br(n, e = {}) {
|
|
4160
|
+
return X(n, "GET", "/v1/projects", e);
|
|
4137
4161
|
}
|
|
4138
4162
|
/**
|
|
4139
4163
|
* @license
|
|
@@ -4151,14 +4175,14 @@ async function Tr(n, e = {}) {
|
|
|
4151
4175
|
* See the License for the specific language governing permissions and
|
|
4152
4176
|
* limitations under the License.
|
|
4153
4177
|
*/
|
|
4154
|
-
const
|
|
4155
|
-
async function
|
|
4178
|
+
const Er = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Sr = /^https?/;
|
|
4179
|
+
async function Rr(n) {
|
|
4156
4180
|
if (n.config.emulator)
|
|
4157
4181
|
return;
|
|
4158
|
-
const { authorizedDomains: e } = await
|
|
4182
|
+
const { authorizedDomains: e } = await br(n);
|
|
4159
4183
|
for (const t of e)
|
|
4160
4184
|
try {
|
|
4161
|
-
if (
|
|
4185
|
+
if (Ar(t))
|
|
4162
4186
|
return;
|
|
4163
4187
|
} catch {
|
|
4164
4188
|
}
|
|
@@ -4168,15 +4192,15 @@ async function br(n) {
|
|
|
4168
4192
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4169
4193
|
);
|
|
4170
4194
|
}
|
|
4171
|
-
function
|
|
4172
|
-
const e =
|
|
4195
|
+
function Ar(n) {
|
|
4196
|
+
const e = Me(), { protocol: t, hostname: i } = new URL(e);
|
|
4173
4197
|
if (n.startsWith("chrome-extension://")) {
|
|
4174
4198
|
const o = new URL(n);
|
|
4175
4199
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4176
4200
|
}
|
|
4177
|
-
if (!
|
|
4201
|
+
if (!Sr.test(t))
|
|
4178
4202
|
return !1;
|
|
4179
|
-
if (
|
|
4203
|
+
if (Er.test(n))
|
|
4180
4204
|
return i === n;
|
|
4181
4205
|
const r = n.replace(/\./g, "\\.");
|
|
4182
4206
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4197,9 +4221,9 @@ function Sr(n) {
|
|
|
4197
4221
|
* See the License for the specific language governing permissions and
|
|
4198
4222
|
* limitations under the License.
|
|
4199
4223
|
*/
|
|
4200
|
-
const
|
|
4224
|
+
const Pr = new oe(3e4, 6e4);
|
|
4201
4225
|
function ft() {
|
|
4202
|
-
const n =
|
|
4226
|
+
const n = E().___jsl;
|
|
4203
4227
|
if (n != null && n.H) {
|
|
4204
4228
|
for (const e of Object.keys(n.H))
|
|
4205
4229
|
if (n.H[e].r = n.H[e].r || [], n.H[e].L = n.H[e].L || [], n.H[e].r = [...n.H[e].L], n.CP)
|
|
@@ -4207,7 +4231,7 @@ function ft() {
|
|
|
4207
4231
|
n.CP[t] = null;
|
|
4208
4232
|
}
|
|
4209
4233
|
}
|
|
4210
|
-
function
|
|
4234
|
+
function Cr(n) {
|
|
4211
4235
|
return new Promise((e, t) => {
|
|
4212
4236
|
var i, r, s;
|
|
4213
4237
|
function o() {
|
|
@@ -4216,36 +4240,36 @@ function Ar(n) {
|
|
|
4216
4240
|
e(gapi.iframes.getContext());
|
|
4217
4241
|
},
|
|
4218
4242
|
ontimeout: () => {
|
|
4219
|
-
ft(), t(
|
|
4243
|
+
ft(), t(b(
|
|
4220
4244
|
n,
|
|
4221
4245
|
"network-request-failed"
|
|
4222
4246
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4223
4247
|
));
|
|
4224
4248
|
},
|
|
4225
|
-
timeout:
|
|
4249
|
+
timeout: Pr.get()
|
|
4226
4250
|
});
|
|
4227
4251
|
}
|
|
4228
|
-
if (!((r = (i =
|
|
4252
|
+
if (!((r = (i = E().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4229
4253
|
e(gapi.iframes.getContext());
|
|
4230
|
-
else if (!((s =
|
|
4254
|
+
else if (!((s = E().gapi) === null || s === void 0) && s.load)
|
|
4231
4255
|
o();
|
|
4232
4256
|
else {
|
|
4233
|
-
const c =
|
|
4234
|
-
return
|
|
4235
|
-
gapi.load ? o() : t(
|
|
4257
|
+
const c = Li("iframefcb");
|
|
4258
|
+
return E()[c] = () => {
|
|
4259
|
+
gapi.load ? o() : t(b(
|
|
4236
4260
|
n,
|
|
4237
4261
|
"network-request-failed"
|
|
4238
4262
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4239
4263
|
));
|
|
4240
|
-
},
|
|
4264
|
+
}, Ni(`${Oi()}?onload=${c}`).catch((a) => t(a));
|
|
4241
4265
|
}
|
|
4242
4266
|
}).catch((e) => {
|
|
4243
4267
|
throw fe = null, e;
|
|
4244
4268
|
});
|
|
4245
4269
|
}
|
|
4246
4270
|
let fe = null;
|
|
4247
|
-
function
|
|
4248
|
-
return fe = fe ||
|
|
4271
|
+
function Nr(n) {
|
|
4272
|
+
return fe = fe || Cr(n), fe;
|
|
4249
4273
|
}
|
|
4250
4274
|
/**
|
|
4251
4275
|
* @license
|
|
@@ -4263,7 +4287,7 @@ function Pr(n) {
|
|
|
4263
4287
|
* See the License for the specific language governing permissions and
|
|
4264
4288
|
* limitations under the License.
|
|
4265
4289
|
*/
|
|
4266
|
-
const
|
|
4290
|
+
const Or = new oe(5e3, 15e3), Lr = "__/auth/iframe", Mr = "emulator/auth/iframe", Ur = {
|
|
4267
4291
|
style: {
|
|
4268
4292
|
position: "absolute",
|
|
4269
4293
|
top: "-100px",
|
|
@@ -4272,13 +4296,13 @@ const Cr = new oe(5e3, 15e3), Nr = "__/auth/iframe", Or = "emulator/auth/iframe"
|
|
|
4272
4296
|
},
|
|
4273
4297
|
"aria-hidden": "true",
|
|
4274
4298
|
tabindex: "-1"
|
|
4275
|
-
},
|
|
4299
|
+
}, Dr = /* @__PURE__ */ new Map([
|
|
4276
4300
|
["identitytoolkit.googleapis.com", "p"],
|
|
4277
4301
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4278
4302
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4279
4303
|
// test
|
|
4280
4304
|
]);
|
|
4281
|
-
function
|
|
4305
|
+
function xr(n) {
|
|
4282
4306
|
const e = n.config;
|
|
4283
4307
|
u(
|
|
4284
4308
|
e.authDomain,
|
|
@@ -4286,17 +4310,17 @@ function Ur(n) {
|
|
|
4286
4310
|
"auth-domain-config-required"
|
|
4287
4311
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4288
4312
|
);
|
|
4289
|
-
const t = e.emulator ? je(e,
|
|
4313
|
+
const t = e.emulator ? je(e, Mr) : `https://${n.config.authDomain}/${Lr}`, i = {
|
|
4290
4314
|
apiKey: e.apiKey,
|
|
4291
4315
|
appName: n.name,
|
|
4292
4316
|
v: re
|
|
4293
|
-
}, r =
|
|
4317
|
+
}, r = Dr.get(n.config.apiHost);
|
|
4294
4318
|
r && (i.eid = r);
|
|
4295
4319
|
const s = n._getFrameworks();
|
|
4296
4320
|
return s.length && (i.fw = s.join(",")), `${t}?${se(i).slice(1)}`;
|
|
4297
4321
|
}
|
|
4298
|
-
async function
|
|
4299
|
-
const e = await
|
|
4322
|
+
async function Fr(n) {
|
|
4323
|
+
const e = await Nr(n), t = E().gapi;
|
|
4300
4324
|
return u(
|
|
4301
4325
|
t,
|
|
4302
4326
|
n,
|
|
@@ -4304,24 +4328,24 @@ async function Dr(n) {
|
|
|
4304
4328
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4305
4329
|
), e.open({
|
|
4306
4330
|
where: document.body,
|
|
4307
|
-
url:
|
|
4331
|
+
url: xr(n),
|
|
4308
4332
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4309
|
-
attributes:
|
|
4333
|
+
attributes: Ur,
|
|
4310
4334
|
dontclear: !0
|
|
4311
4335
|
}, (i) => new Promise(async (r, s) => {
|
|
4312
4336
|
await i.restyle({
|
|
4313
4337
|
// Prevent iframe from closing on mouse out.
|
|
4314
4338
|
setHideOnLeave: !1
|
|
4315
4339
|
});
|
|
4316
|
-
const o =
|
|
4340
|
+
const o = b(
|
|
4317
4341
|
n,
|
|
4318
4342
|
"network-request-failed"
|
|
4319
4343
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4320
|
-
), c =
|
|
4344
|
+
), c = E().setTimeout(() => {
|
|
4321
4345
|
s(o);
|
|
4322
|
-
},
|
|
4346
|
+
}, Or.get());
|
|
4323
4347
|
function a() {
|
|
4324
|
-
|
|
4348
|
+
E().clearTimeout(c), r(i);
|
|
4325
4349
|
}
|
|
4326
4350
|
i.ping(a).then(a, () => {
|
|
4327
4351
|
s(o);
|
|
@@ -4344,12 +4368,12 @@ async function Dr(n) {
|
|
|
4344
4368
|
* See the License for the specific language governing permissions and
|
|
4345
4369
|
* limitations under the License.
|
|
4346
4370
|
*/
|
|
4347
|
-
const
|
|
4371
|
+
const Vr = {
|
|
4348
4372
|
location: "yes",
|
|
4349
4373
|
resizable: "yes",
|
|
4350
4374
|
statusbar: "yes",
|
|
4351
4375
|
toolbar: "no"
|
|
4352
|
-
},
|
|
4376
|
+
}, $r = 500, Hr = 600, jr = "_blank", Wr = "http://localhost";
|
|
4353
4377
|
class pt {
|
|
4354
4378
|
constructor(e) {
|
|
4355
4379
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4362,33 +4386,33 @@ class pt {
|
|
|
4362
4386
|
}
|
|
4363
4387
|
}
|
|
4364
4388
|
}
|
|
4365
|
-
function
|
|
4389
|
+
function Br(n, e, t, i = $r, r = Hr) {
|
|
4366
4390
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4367
4391
|
let c = "";
|
|
4368
|
-
const a = Object.assign(Object.assign({},
|
|
4392
|
+
const a = Object.assign(Object.assign({}, Vr), {
|
|
4369
4393
|
width: i.toString(),
|
|
4370
4394
|
height: r.toString(),
|
|
4371
4395
|
top: s,
|
|
4372
4396
|
left: o
|
|
4373
|
-
}), l =
|
|
4374
|
-
t && (c = Ft(l) ?
|
|
4375
|
-
const d = Object.entries(a).reduce((
|
|
4376
|
-
if (
|
|
4377
|
-
return
|
|
4378
|
-
const
|
|
4397
|
+
}), l = w().toLowerCase();
|
|
4398
|
+
t && (c = Ft(l) ? jr : t), xt(l) && (e = e || Wr, a.scrollbars = "yes");
|
|
4399
|
+
const d = Object.entries(a).reduce((h, [y, _]) => `${h}${y}=${_},`, "");
|
|
4400
|
+
if (Ti(l) && c !== "_self")
|
|
4401
|
+
return Gr(e || "", c), new pt(null);
|
|
4402
|
+
const m = window.open(e || "", c, d);
|
|
4379
4403
|
u(
|
|
4380
|
-
|
|
4404
|
+
m,
|
|
4381
4405
|
n,
|
|
4382
4406
|
"popup-blocked"
|
|
4383
4407
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
4384
4408
|
);
|
|
4385
4409
|
try {
|
|
4386
|
-
|
|
4410
|
+
m.focus();
|
|
4387
4411
|
} catch {
|
|
4388
4412
|
}
|
|
4389
|
-
return new pt(
|
|
4413
|
+
return new pt(m);
|
|
4390
4414
|
}
|
|
4391
|
-
function
|
|
4415
|
+
function Gr(n, e) {
|
|
4392
4416
|
const t = document.createElement("a");
|
|
4393
4417
|
t.href = n, t.target = e;
|
|
4394
4418
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4410,7 +4434,7 @@ function Wr(n, e) {
|
|
|
4410
4434
|
* See the License for the specific language governing permissions and
|
|
4411
4435
|
* limitations under the License.
|
|
4412
4436
|
*/
|
|
4413
|
-
const
|
|
4437
|
+
const zr = "__/auth/handler", qr = "emulator/auth/handler", Kr = encodeURIComponent("fac");
|
|
4414
4438
|
async function mt(n, e, t, i, r, s) {
|
|
4415
4439
|
u(
|
|
4416
4440
|
n.config.authDomain,
|
|
@@ -4432,23 +4456,23 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4432
4456
|
eventId: r
|
|
4433
4457
|
};
|
|
4434
4458
|
if (e instanceof qt) {
|
|
4435
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4436
|
-
for (const [d,
|
|
4437
|
-
o[d] =
|
|
4459
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", On(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4460
|
+
for (const [d, m] of Object.entries({}))
|
|
4461
|
+
o[d] = m;
|
|
4438
4462
|
}
|
|
4439
4463
|
if (e instanceof ae) {
|
|
4440
|
-
const d = e.getScopes().filter((
|
|
4464
|
+
const d = e.getScopes().filter((m) => m !== "");
|
|
4441
4465
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4442
4466
|
}
|
|
4443
4467
|
n.tenantId && (o.tid = n.tenantId);
|
|
4444
4468
|
const c = o;
|
|
4445
4469
|
for (const d of Object.keys(c))
|
|
4446
4470
|
c[d] === void 0 && delete c[d];
|
|
4447
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4448
|
-
return `${
|
|
4471
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Kr}=${encodeURIComponent(a)}` : "";
|
|
4472
|
+
return `${Jr(n)}?${se(c).slice(1)}${l}`;
|
|
4449
4473
|
}
|
|
4450
|
-
function
|
|
4451
|
-
return n.emulator ? je(n,
|
|
4474
|
+
function Jr({ config: n }) {
|
|
4475
|
+
return n.emulator ? je(n, qr) : `https://${n.authDomain}/${zr}`;
|
|
4452
4476
|
}
|
|
4453
4477
|
/**
|
|
4454
4478
|
* @license
|
|
@@ -4466,23 +4490,23 @@ function qr({ config: n }) {
|
|
|
4466
4490
|
* See the License for the specific language governing permissions and
|
|
4467
4491
|
* limitations under the License.
|
|
4468
4492
|
*/
|
|
4469
|
-
const
|
|
4470
|
-
class
|
|
4493
|
+
const Ne = "webStorageSupport";
|
|
4494
|
+
class Yr {
|
|
4471
4495
|
constructor() {
|
|
4472
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn =
|
|
4496
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn = yr, this._overrideRedirectResult = _r;
|
|
4473
4497
|
}
|
|
4474
4498
|
// Wrapping in async even though we don't await anywhere in order
|
|
4475
4499
|
// to make sure errors are raised as promise rejections
|
|
4476
4500
|
async _openPopup(e, t, i, r) {
|
|
4477
4501
|
var s;
|
|
4478
4502
|
L((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4479
|
-
const o = await mt(e, t, i,
|
|
4480
|
-
return
|
|
4503
|
+
const o = await mt(e, t, i, Me(), r);
|
|
4504
|
+
return Br(e, o, ze());
|
|
4481
4505
|
}
|
|
4482
4506
|
async _openRedirect(e, t, i, r) {
|
|
4483
4507
|
await this._originValidation(e);
|
|
4484
|
-
const s = await mt(e, t, i,
|
|
4485
|
-
return
|
|
4508
|
+
const s = await mt(e, t, i, Me(), r);
|
|
4509
|
+
return Zi(s), new Promise(() => {
|
|
4486
4510
|
});
|
|
4487
4511
|
}
|
|
4488
4512
|
_initialize(e) {
|
|
@@ -4497,7 +4521,7 @@ class Kr {
|
|
|
4497
4521
|
}), i;
|
|
4498
4522
|
}
|
|
4499
4523
|
async initAndGetManager(e) {
|
|
4500
|
-
const t = await
|
|
4524
|
+
const t = await Fr(e), i = new Tr(e);
|
|
4501
4525
|
return t.register("authEvent", (r) => (u(
|
|
4502
4526
|
r == null ? void 0 : r.authEvent,
|
|
4503
4527
|
e,
|
|
@@ -4509,9 +4533,9 @@ class Kr {
|
|
|
4509
4533
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: i }, this.iframes[e._key()] = t, i;
|
|
4510
4534
|
}
|
|
4511
4535
|
_isIframeWebStorageSupported(e, t) {
|
|
4512
|
-
this.iframes[e._key()].send(
|
|
4536
|
+
this.iframes[e._key()].send(Ne, { type: Ne }, (r) => {
|
|
4513
4537
|
var s;
|
|
4514
|
-
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[
|
|
4538
|
+
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
4515
4539
|
o !== void 0 && t(!!o), O(
|
|
4516
4540
|
e,
|
|
4517
4541
|
"internal-error"
|
|
@@ -4521,13 +4545,13 @@ class Kr {
|
|
|
4521
4545
|
}
|
|
4522
4546
|
_originValidation(e) {
|
|
4523
4547
|
const t = e._key();
|
|
4524
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4548
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Rr(e)), this.originValidationPromises[t];
|
|
4525
4549
|
}
|
|
4526
4550
|
get _shouldInitProactively() {
|
|
4527
|
-
return Wt() ||
|
|
4551
|
+
return Wt() || Be() || ke();
|
|
4528
4552
|
}
|
|
4529
4553
|
}
|
|
4530
|
-
const
|
|
4554
|
+
const Xr = Yr;
|
|
4531
4555
|
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4532
4556
|
/**
|
|
4533
4557
|
* @license
|
|
@@ -4545,7 +4569,7 @@ var gt = "@firebase/auth", _t = "1.7.5";
|
|
|
4545
4569
|
* See the License for the specific language governing permissions and
|
|
4546
4570
|
* limitations under the License.
|
|
4547
4571
|
*/
|
|
4548
|
-
class
|
|
4572
|
+
class Qr {
|
|
4549
4573
|
constructor(e) {
|
|
4550
4574
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4551
4575
|
}
|
|
@@ -4596,7 +4620,7 @@ class Yr {
|
|
|
4596
4620
|
* See the License for the specific language governing permissions and
|
|
4597
4621
|
* limitations under the License.
|
|
4598
4622
|
*/
|
|
4599
|
-
function
|
|
4623
|
+
function Zr(n) {
|
|
4600
4624
|
switch (n) {
|
|
4601
4625
|
case "Node":
|
|
4602
4626
|
return "node";
|
|
@@ -4612,7 +4636,7 @@ function Xr(n) {
|
|
|
4612
4636
|
return;
|
|
4613
4637
|
}
|
|
4614
4638
|
}
|
|
4615
|
-
function
|
|
4639
|
+
function es(n) {
|
|
4616
4640
|
Ze(new et(
|
|
4617
4641
|
"auth",
|
|
4618
4642
|
(e, { options: t }) => {
|
|
@@ -4625,9 +4649,9 @@ function Qr(n) {
|
|
|
4625
4649
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4626
4650
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4627
4651
|
apiScheme: "https",
|
|
4628
|
-
sdkClientVersion:
|
|
4629
|
-
}, l = new
|
|
4630
|
-
return
|
|
4652
|
+
sdkClientVersion: Bt(n)
|
|
4653
|
+
}, l = new Pi(i, r, s, a);
|
|
4654
|
+
return Ui(l, t), l;
|
|
4631
4655
|
},
|
|
4632
4656
|
"PUBLIC"
|
|
4633
4657
|
/* ComponentType.PUBLIC */
|
|
@@ -4642,18 +4666,18 @@ function Qr(n) {
|
|
|
4642
4666
|
})), Ze(new et(
|
|
4643
4667
|
"auth-internal",
|
|
4644
4668
|
(e) => {
|
|
4645
|
-
const t =
|
|
4669
|
+
const t = be(e.getProvider(
|
|
4646
4670
|
"auth"
|
|
4647
4671
|
/* _ComponentName.AUTH */
|
|
4648
4672
|
).getImmediate());
|
|
4649
|
-
return ((i) => new
|
|
4673
|
+
return ((i) => new Qr(i))(t);
|
|
4650
4674
|
},
|
|
4651
4675
|
"PRIVATE"
|
|
4652
4676
|
/* ComponentType.PRIVATE */
|
|
4653
4677
|
).setInstantiationMode(
|
|
4654
4678
|
"EXPLICIT"
|
|
4655
4679
|
/* InstantiationMode.EXPLICIT */
|
|
4656
|
-
)),
|
|
4680
|
+
)), Le(gt, _t, Zr(n)), Le(gt, _t, "esm2017");
|
|
4657
4681
|
}
|
|
4658
4682
|
/**
|
|
4659
4683
|
* @license
|
|
@@ -4671,11 +4695,11 @@ function Qr(n) {
|
|
|
4671
4695
|
* See the License for the specific language governing permissions and
|
|
4672
4696
|
* limitations under the License.
|
|
4673
4697
|
*/
|
|
4674
|
-
const
|
|
4698
|
+
const ts = 5 * 60, ns = kt("authIdTokenMaxAge") || ts;
|
|
4675
4699
|
let vt = null;
|
|
4676
|
-
const
|
|
4700
|
+
const is = (n) => async (e) => {
|
|
4677
4701
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4678
|
-
if (i && i >
|
|
4702
|
+
if (i && i > ns)
|
|
4679
4703
|
return;
|
|
4680
4704
|
const r = t == null ? void 0 : t.token;
|
|
4681
4705
|
vt !== r && (vt = r, await fetch(n, {
|
|
@@ -4685,104 +4709,104 @@ const ts = (n) => async (e) => {
|
|
|
4685
4709
|
} : {}
|
|
4686
4710
|
}));
|
|
4687
4711
|
};
|
|
4688
|
-
function
|
|
4689
|
-
const e =
|
|
4712
|
+
function rs(n = An()) {
|
|
4713
|
+
const e = bt(n, "auth");
|
|
4690
4714
|
if (e.isInitialized())
|
|
4691
4715
|
return e.getImmediate();
|
|
4692
|
-
const t =
|
|
4693
|
-
popupRedirectResolver:
|
|
4716
|
+
const t = Mi(n, {
|
|
4717
|
+
popupRedirectResolver: Xr,
|
|
4694
4718
|
persistence: [
|
|
4695
|
-
|
|
4696
|
-
|
|
4719
|
+
cr,
|
|
4720
|
+
Yi,
|
|
4697
4721
|
Qt
|
|
4698
4722
|
]
|
|
4699
4723
|
}), i = kt("authTokenSyncURL");
|
|
4700
4724
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4701
4725
|
const s = new URL(i, location.origin);
|
|
4702
4726
|
if (location.origin === s.origin) {
|
|
4703
|
-
const o =
|
|
4704
|
-
|
|
4727
|
+
const o = is(s.toString());
|
|
4728
|
+
zi(t, o, () => o(t.currentUser)), Gi(t, (c) => o(c));
|
|
4705
4729
|
}
|
|
4706
4730
|
}
|
|
4707
|
-
const r =
|
|
4708
|
-
return r &&
|
|
4731
|
+
const r = Rn("auth");
|
|
4732
|
+
return r && Di(t, `http://${r}`), t;
|
|
4709
4733
|
}
|
|
4710
|
-
function
|
|
4734
|
+
function ss() {
|
|
4711
4735
|
var n, e;
|
|
4712
4736
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4713
4737
|
}
|
|
4714
|
-
|
|
4738
|
+
Ci({
|
|
4715
4739
|
loadJS(n) {
|
|
4716
4740
|
return new Promise((e, t) => {
|
|
4717
4741
|
const i = document.createElement("script");
|
|
4718
4742
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4719
|
-
const s =
|
|
4743
|
+
const s = b(
|
|
4720
4744
|
"internal-error"
|
|
4721
4745
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4722
4746
|
);
|
|
4723
4747
|
s.customData = r, t(s);
|
|
4724
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4748
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", ss().appendChild(i);
|
|
4725
4749
|
});
|
|
4726
4750
|
},
|
|
4727
4751
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4728
4752
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4729
4753
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4730
4754
|
});
|
|
4731
|
-
|
|
4755
|
+
es(
|
|
4732
4756
|
"Browser"
|
|
4733
4757
|
/* ClientPlatform.BROWSER */
|
|
4734
4758
|
);
|
|
4735
|
-
var
|
|
4736
|
-
const
|
|
4759
|
+
var os = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" }, as = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
4760
|
+
const cs = {
|
|
4737
4761
|
key: 2,
|
|
4738
4762
|
class: "h-full w-full"
|
|
4739
|
-
},
|
|
4763
|
+
}, ls = ["src"], Ss = /* @__PURE__ */ xe({
|
|
4740
4764
|
__name: "App",
|
|
4741
4765
|
setup(n) {
|
|
4742
|
-
const e =
|
|
4743
|
-
const
|
|
4744
|
-
return `${
|
|
4766
|
+
const e = ge(), t = pn(), i = mn(), r = gn(), s = _n(), o = wt(), c = ee(o.query.showHeader !== "false"), a = ee(!1), { currentBusiness: l } = ge(), d = ee(!1), m = ne(() => i.version), h = ne(() => {
|
|
4767
|
+
const p = e.currentCountry.value || "MY", I = tt.getIdToken(), T = l.value._id;
|
|
4768
|
+
return `${as.marketingV1Portal}/b/${T}/marketing/overview?showHeader=false&country=${p}&token=${I}`;
|
|
4745
4769
|
});
|
|
4746
|
-
async function
|
|
4747
|
-
if (
|
|
4770
|
+
async function y() {
|
|
4771
|
+
if (Ln().length) {
|
|
4748
4772
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4749
4773
|
return;
|
|
4750
4774
|
}
|
|
4751
|
-
const
|
|
4752
|
-
await
|
|
4775
|
+
const p = Mn(os.firebase), I = await fn.getCustomToken(), T = rs();
|
|
4776
|
+
await Bi(T, I), Un(p), console.log("initFirebase", p);
|
|
4753
4777
|
}
|
|
4754
|
-
const
|
|
4755
|
-
d.value = !1, await
|
|
4778
|
+
const _ = async () => {
|
|
4779
|
+
d.value = !1, await dn(), console.log("forceRerender"), tt.setBusinessId(l.value._id), await i.readPremium(), !a.value && m.value === "v2" ? e.registerSidebarComponent(Vn) : e.hideSidebarToggle(!0), await y(), a.value = !0, d.value = !0;
|
|
4756
4780
|
};
|
|
4757
|
-
return
|
|
4758
|
-
if (
|
|
4759
|
-
const
|
|
4760
|
-
|
|
4781
|
+
return un(() => {
|
|
4782
|
+
if (Dn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4783
|
+
const p = document.getElementsByClassName("app-header")[0], I = document.getElementsByClassName("app-sidebar")[0], T = document.getElementsByClassName("app-container")[0], M = document.getElementsByTagName("main")[0];
|
|
4784
|
+
p == null || p.classList.add("!hidden"), I == null || I.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), M == null || M.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4761
4785
|
}
|
|
4762
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4763
|
-
}),
|
|
4786
|
+
l.value != null && (console.log("App mounted, forceRerender"), _());
|
|
4787
|
+
}), pe(
|
|
4764
4788
|
() => e.currentBusiness.value,
|
|
4765
|
-
async (
|
|
4766
|
-
console.log("Current business changed"),
|
|
4789
|
+
async (p, I) => {
|
|
4790
|
+
console.log("Current business changed"), p != null && p._id != I._id && (console.log("forceRerender when business changes", p, I), _());
|
|
4767
4791
|
}
|
|
4768
|
-
), (
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
S(
|
|
4773
|
-
json: { url:
|
|
4792
|
+
), (p, I) => (W(), me(It, null, [
|
|
4793
|
+
g(d) && g(m) === "v2" ? (W(), Oe(g(hn), { key: 0 })) : Pe("", !0),
|
|
4794
|
+
g(d) && g(m) === "v2" && g(c) ? (W(), Oe(ii, { key: 1 })) : Pe("", !0),
|
|
4795
|
+
g(d) && g(m) !== "v2" ? (W(), me("div", cs, [
|
|
4796
|
+
S(wn, {
|
|
4797
|
+
json: { url: g(h) }
|
|
4774
4798
|
}, null, 8, ["json"]),
|
|
4775
|
-
|
|
4799
|
+
v("iframe", {
|
|
4776
4800
|
allow: "clipboard-read; clipboard-write",
|
|
4777
4801
|
frameBorder: "0",
|
|
4778
4802
|
height: "100%",
|
|
4779
4803
|
width: "100%",
|
|
4780
|
-
src:
|
|
4781
|
-
}, null, 8,
|
|
4782
|
-
])) :
|
|
4804
|
+
src: g(h)
|
|
4805
|
+
}, null, 8, ls)
|
|
4806
|
+
])) : Pe("", !0)
|
|
4783
4807
|
], 64));
|
|
4784
4808
|
}
|
|
4785
4809
|
});
|
|
4786
4810
|
export {
|
|
4787
|
-
|
|
4811
|
+
Ss as default
|
|
4788
4812
|
};
|