@feedmepos/mf-connect 0.1.98-beta.10 → 0.1.98-beta.11
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-CuoqxGQ_.js → App-DKClefqk.js} +794 -654
- package/dist/{AuditLogs-3VOqNuiy.js → AuditLogs-BeSkYL6M.js} +9 -9
- package/dist/{Bin-DJAVHuWd.js → Bin-DqZYwOrb.js} +8 -8
- package/dist/{Broadcast-u9MAxxwk.js → Broadcast-D8AD4KkO.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-h5E8WsFD.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-vqHrjU8C.js} +5 -5
- package/dist/{Card-DxH_641i.js → Card-DvhrSAk4.js} +18 -18
- package/dist/{Collections-C9La6TzV.js → Collections-D2w-IYlv.js} +7 -7
- package/dist/{Credit-DmRE1f4J.js → Credit-C6WDUg72.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DpOkDd5R.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CQJ6pNxV.js} +30 -30
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CS34jatD.js → EffectSheet.vue_vue_type_style_index_0_lang-CgoTE9a7.js} +6 -6
- package/dist/{Experience-C0FyDsmi.js → Experience-CzB0noGs.js} +9 -9
- package/dist/{FileSaver.min-Be-90ifa.js → FileSaver.min-ChS9YTfX.js} +1 -1
- package/dist/{Game-DYi-DQBb.js → Game-C4NPtOis.js} +10 -10
- package/dist/{Grab-BpIj6ILT.js → Grab-DRQkvRE-.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-yfl42RYQ.js → ImageInput.vue_vue_type_script_setup_true_lang-DD_fi0Z5.js} +1 -1
- package/dist/{Index-BUTAUbSs.js → Index-bOOUuYVP.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Xt8jbqnN.js → LocationPicker.vue_vue_type_script_setup_true_lang-uPK3w6VD.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Cofvjj26.js → LottieAnimation.vue_vue_type_script_setup_true_lang-B9JJ2xSz.js} +1 -1
- package/dist/{LoyaltyDashboard-D-uRlQr4.js → LoyaltyDashboard-bD6MlAbo.js} +4 -4
- package/dist/{MainLayout-Bix1-Ejy.js → MainLayout-1DjfB3tH.js} +1 -1
- package/dist/{Marketing-BK84KRoM.js → Marketing-CEagZu_d.js} +4 -4
- package/dist/{MarketingMaterialEdit-Njw8eFdM.js → MarketingMaterialEdit-pNm733VI.js} +6 -6
- package/dist/{Member-BglFXn-U.js → Member-Du0xk_f0.js} +11 -11
- package/dist/{MemberList-BUaDqh-4.js → MemberList-2BImw45d.js} +25 -25
- package/dist/{MemberTransactions-cdNWr7OQ.js → MemberTransactions-Ce9ccBGW.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-By18HGU7.js → MessageInput.vue_vue_type_script_setup_true_lang-CY7V8qMz.js} +9 -9
- package/dist/{Mission-DkacZ5on.js → Mission-C0S2U1yY.js} +10 -10
- package/dist/{Overview-D6QiG05G.js → Overview-B0-bTPEk.js} +18 -18
- package/dist/{Point-B7Dnvqds.js → Point-Blc4sA0k.js} +9 -9
- package/dist/{Promotion-OSAQAs7v.js → Promotion-8nM93Gci.js} +10 -10
- package/dist/{Queue-VLWvCP3n.js → Queue-Def03xU8.js} +10 -10
- package/dist/{Record-DcvHadqJ.js → Record-Bop_7cP_.js} +9 -9
- package/dist/{Review-B5P5fBoG.js → Review-CFdfmjkW.js} +4 -4
- package/dist/{ReviewFacebookCallback-DK423k4B.js → ReviewFacebookCallback-KUQE5QOQ.js} +4 -4
- package/dist/{ReviewGoogleCallback-BkWwQXpL.js → ReviewGoogleCallback-CZdfbE37.js} +4 -4
- package/dist/{Reward-B5UnJceg.js → Reward-DKkjbPWO.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CFN_ag0M.js → RewardGroup.vue_vue_type_script_setup_true_lang-BglByPmS.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CaZ-rcMt.js → RuleGroup.vue_vue_type_script_setup_true_lang-DHLeyxp_.js} +13 -13
- package/dist/{Segment-BuZW_Z-L.js → Segment-DPBzExUz.js} +23 -23
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-d3q61-tE.js → SelectItems.vue_vue_type_script_setup_true_lang-Di-Xv-Fk.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-D9jf_1QH.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DsSarYWA.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CHo3hDkD.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-MjnVm1zx.js} +4 -4
- package/dist/{Setting-CKvCYEZ1.js → Setting-BH61xoUN.js} +14 -14
- package/dist/{SettingAdvertisements-DMDLvJuR.js → SettingAdvertisements-LfzmkWhb.js} +12 -12
- package/dist/{Store-YCCrdeiS.js → Store-DiNTwuRj.js} +21 -21
- package/dist/{StoreRewards-DrUeDPKk.js → StoreRewards-3bylfB08.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DxQ-kH_8.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DR2M_zjD.js} +21 -21
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BzcC6nYi.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-gIqflCTb.js} +2 -2
- package/dist/{Tier-cX6lgE5V.js → Tier-Dyy84802.js} +22 -22
- package/dist/{Title-BO7yS6FQ.js → Title-DQdRI9k0.js} +19 -19
- package/dist/{Transaction-dwbikp5f.js → Transaction-BxNk0O0-.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C8QHAIeV.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BqrFEBBM.js} +6 -6
- package/dist/{Voucher-D5RtI53O.js → Voucher-D-qCe-wS.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Dw5trcej.js → VoucherEditor.vue_vue_type_script_setup_true_lang-B3sadrpZ.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Db1Yid5T.js → ZodTextField.vue_vue_type_script_setup_true_lang--TG7NPaw.js} +2 -2
- package/dist/{app-veCyMzJU.js → app-CYjBbA_4.js} +347 -230
- package/dist/app.js +1 -1
- package/dist/{business-BvtZwaVt.js → business-B2SfzRDs.js} +1 -1
- package/dist/{campaign-CyVE2I7v.js → campaign-CpQjVRLb.js} +10 -10
- package/dist/{campaign-BbaSbea1.js → campaign-DsZVOlpO.js} +1 -1
- package/dist/{campaign.enum-B4old-6y.js → campaign.enum-CUrE4_NH.js} +1 -1
- package/dist/{campaign.fn-DuG421Su.js → campaign.fn-WPHSaV98.js} +37 -37
- package/dist/{collectible.enum-C4_aVSzr.js → collectible.enum-BBE8WrYO.js} +1 -1
- package/dist/{duplicateCampaign-BsXuQigf.js → duplicateCampaign-BUGw2sf1.js} +2 -2
- package/dist/{effect-CCpybKfz.js → effect-D4ONfQoQ.js} +1 -1
- package/dist/{email-addresses-DDX4Mi6S.js → email-addresses-BuZiD6UO.js} +2 -2
- package/dist/{export-BkbeKb2b.js → export-Css_Pqj-.js} +3 -3
- package/dist/{helper-DAxddTyP.js → helper-CZfQKkv5.js} +1 -1
- package/dist/{index-B87M_APu.js → index-3T8aqJmS.js} +5 -5
- package/dist/{index-ClwNTy-6.js → index-87QXVsV-.js} +3 -3
- package/dist/{index-BkdCXelA.js → index-B5FUen0h.js} +1 -1
- package/dist/{index-BI2mt6Pz.js → index-BCzQpGUZ.js} +3 -3
- package/dist/{index-mGQbobml.js → index-BJPEIJ9Q.js} +6 -6
- package/dist/{index-CKWDVDJG.js → index-BfGNdgTX.js} +2 -2
- package/dist/{index-C8dM9zHa.js → index-Bkc0ov6S.js} +1 -1
- package/dist/{index-CoX84Njy.js → index-D-M_i6Mn.js} +1 -1
- package/dist/{index-CYwrTv3T.js → index-DK2Ciib6.js} +2 -2
- package/dist/{index-EAtgJDuz.js → index-DjHvO9Tb.js} +3 -3
- package/dist/{index-CeUevans.js → index-DrJOutcM.js} +1 -1
- package/dist/{index-CO9CGqzQ.js → index-DsJwHWYF.js} +1 -1
- package/dist/{index-NyBcZeNK.js → index-MJK4pjIp.js} +4 -4
- package/dist/{index-M7aip9Cz.js → index-wl8_bJLh.js} +1 -1
- package/dist/{index.esm2017-CJ1DBw4k.js → index.esm2017-CM-jNysx.js} +1 -1
- package/dist/{loading-Bpwlx9Qf.js → loading-CXYKpSBl.js} +1 -1
- package/dist/{lodash-DuvaOX4r.js → lodash-DKWJqSEk.js} +1 -1
- package/dist/{membership-BpmZ1RRg.js → membership-BDi5RNlV.js} +3 -3
- package/dist/{money-BIv7vBs6.js → money-CGM2GRnp.js} +1 -1
- package/dist/{number-BBWkXSgJ.js → number-DGznpJcf.js} +1 -1
- package/dist/{objectid-CTrVbFLZ.js → objectid-dfqc-m2y.js} +9 -9
- package/dist/{plugins-BgZow8Qr.js → plugins-BphKx8yz.js} +3 -3
- package/dist/{reward-mI3VO63r.js → reward-BxfsoKsP.js} +1 -1
- package/dist/{rule-DHb2dJky.js → rule-Bdwoo4oE.js} +3 -3
- package/dist/{template-CFQFUU6d.js → template-BcbeqGkQ.js} +6 -6
- package/dist/{trigger-B5HKpszv.js → trigger-DhYSpO0F.js} +5 -5
- package/dist/{useMarketingMaterialActions-DeZG3azC.js → useMarketingMaterialActions-DpD2R5LH.js} +3 -3
- package/dist/{usePagination-C19TYQjJ.js → usePagination-9T8RlODO.js} +1 -1
- package/dist/{user-CR2Dbom0.js → user-DUZG4AEt.js} +1 -1
- package/dist/{vue-i18n-tHTzSWDK.js → vue-i18n-B36YK77u.js} +246 -246
- package/dist/{xlsx-BLlEAp7n.js → xlsx-7bg82jL7.js} +584 -584
- package/dist/{zod-ZxC0hnix.js → zod-BoDvtk8b.js} +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as
|
|
9
|
-
import { C as
|
|
10
|
-
import { R as f } from "./app-
|
|
11
|
-
import { J as
|
|
12
|
-
import { r as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { S as
|
|
15
|
-
const
|
|
1
|
+
import { defineComponent as De, ref as Z, h as J, computed as he, watch as xe, resolveComponent as Q, openBlock as V, createElementBlock as fe, createVNode as b, unref as m, createElementVNode as _, toDisplayString as S, createBlock as Ne, withCtx as Y, Fragment as It, renderList as cn, onMounted as ln, createCommentVNode as Ae, nextTick as un } from "vue";
|
|
2
|
+
import { useRouter as yt, useRoute as wt, RouterView as dn } from "vue-router";
|
|
3
|
+
import { useCoreStore as pe, FeedMeAuth as hn } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as fn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as pn } from "./business-B2SfzRDs.js";
|
|
6
|
+
import "./index-DrJOutcM.js";
|
|
7
|
+
import { components as X, useSnackbar as mn, useDialog as gn } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Tt } from "./vue-i18n-B36YK77u.js";
|
|
9
|
+
import { C as Xe, m as _n } from "./index-DK2Ciib6.js";
|
|
10
|
+
import { R as f, A as vn, a as Qe } from "./app-CYjBbA_4.js";
|
|
11
|
+
import { J as In } from "./JsonViewer-v8_C7l5N.js";
|
|
12
|
+
import { r as Oe, L as yn, g as kt, i as wn, a as Tn, _ as Ze, C as et, b as kn, S as ne, c as R, d as q, E as Fe, e as En, f as Et, h as bn, j as Sn, k as bt, l as y, m as Rn, F as Ve, n as An, q as ie, o as Pn, p as Cn, s as Nn, t as On, u as Ln } from "./index.esm2017-CM-jNysx.js";
|
|
13
|
+
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
14
|
+
import { S as tt, c as Mn } from "./index-BfGNdgTX.js";
|
|
15
|
+
const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, xn = /* @__PURE__ */ De({
|
|
16
16
|
__name: "NavigationTab",
|
|
17
17
|
setup(n) {
|
|
18
|
-
const { t: e } =
|
|
18
|
+
const { t: e } = Tt(), t = Z(), i = [
|
|
19
19
|
{
|
|
20
20
|
label: e("connect.navigation.analytic"),
|
|
21
21
|
value: f["$connect-ANALYTIC"]
|
|
@@ -61,7 +61,7 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
61
61
|
{
|
|
62
62
|
label: e("connect.navigation.point"),
|
|
63
63
|
value: f["$connect-PROGRAM_POINT"],
|
|
64
|
-
badge: () =>
|
|
64
|
+
badge: () => J(X.FmPill, { variant: "premium" })
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
label: e("connect.navigation.credit"),
|
|
@@ -70,7 +70,7 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
70
70
|
{
|
|
71
71
|
label: e("connect.navigation.game"),
|
|
72
72
|
value: f["$connect-PROGRAM_GAME"],
|
|
73
|
-
badge: () =>
|
|
73
|
+
badge: () => J(X.FmPill, { variant: "premium" })
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
label: "Mission",
|
|
@@ -89,19 +89,19 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
89
89
|
{
|
|
90
90
|
label: e("connect.navigation.segments"),
|
|
91
91
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
92
|
-
badge: () =>
|
|
92
|
+
badge: () => J(X.FmPill, { variant: "premium" })
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
label: e("connect.navigation.card"),
|
|
96
96
|
value: f["$connect-LOYALTY_CARD"],
|
|
97
|
-
badge: () =>
|
|
97
|
+
badge: () => J(X.FmPill, { variant: "premium" })
|
|
98
98
|
}
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
label: e("connect.navigation.referral"),
|
|
103
103
|
value: f["$connect-REFERRAL"],
|
|
104
|
-
badge: () =>
|
|
104
|
+
badge: () => J(X.FmPill, { variant: "premium" })
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
label: e("connect.navigation.store"),
|
|
@@ -131,11 +131,11 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
131
131
|
label: e("connect.navigation.bin"),
|
|
132
132
|
value: f["$connect-BIN"]
|
|
133
133
|
}
|
|
134
|
-
], r =
|
|
134
|
+
], r = yt(), s = wt(), o = i.reduce((d, h) => [...(h.children ?? []).map((p) => p.value), ...d, h.value], []), c = pe(), a = he(() => {
|
|
135
135
|
const d = c.currentCountry.value || "MY";
|
|
136
|
-
return console.log(`[MF] Timezone set to: ${
|
|
136
|
+
return console.log(`[MF] Timezone set to: ${Xe[d]}`), Xe[d];
|
|
137
137
|
});
|
|
138
|
-
|
|
138
|
+
xe(
|
|
139
139
|
() => s,
|
|
140
140
|
(d) => {
|
|
141
141
|
const h = d.matched.map((p) => p.name).reverse();
|
|
@@ -148,23 +148,162 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
148
148
|
}
|
|
149
149
|
return (d, h) => {
|
|
150
150
|
var w;
|
|
151
|
-
const p =
|
|
152
|
-
return
|
|
153
|
-
|
|
151
|
+
const p = Q("FmCollapsibleTabs");
|
|
152
|
+
return V(), fe("div", Un, [
|
|
153
|
+
b(p, {
|
|
154
154
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
155
|
-
"model-value": (w =
|
|
155
|
+
"model-value": (w = m(t)) == null ? void 0 : w.toString(),
|
|
156
156
|
items: i,
|
|
157
157
|
"onUpdate:modelValue": l
|
|
158
158
|
}, null, 8, ["model-value"]),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
_("div", Dn, [
|
|
160
|
+
_("div", null, "Timezone: " + S(m(a).split("/")[1].replace("_", " ")), 1),
|
|
161
|
+
_("div", null, "(UTC" + S(m(_n).tz(m(a)).format("Z")) + ")", 1)
|
|
162
162
|
])
|
|
163
163
|
]);
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
+
}), St = "feedme_connect_marketing_promo_hidden";
|
|
167
|
+
function Fn() {
|
|
168
|
+
try {
|
|
169
|
+
return localStorage.getItem(St) !== null;
|
|
170
|
+
} catch {
|
|
171
|
+
return !1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function Vn() {
|
|
175
|
+
try {
|
|
176
|
+
localStorage.setItem(St, (/* @__PURE__ */ new Date()).toISOString());
|
|
177
|
+
} catch {
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, jn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Wn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, Gn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, Bn = { class: "flex flex-col gap-24 pb-8" }, zn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, qn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Kn = { class: "fm-typo-en-body-lg-600" }, Jn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Yn = { class: "shrink-0" }, Xn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qn = { class: "flex w-full flex-col gap-12 px-[16px]" }, Zn = { class: "flex flex-wrap items-center gap-12" }, ei = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ti = /* @__PURE__ */ De({
|
|
181
|
+
__name: "AiMarketingPromoDialog",
|
|
182
|
+
setup(n) {
|
|
183
|
+
let e = !1;
|
|
184
|
+
const { t } = Tt(), i = yt(), { sessionUser: r } = pe(), s = Z(!1), o = [
|
|
185
|
+
{ key: "completeContent", icon: "layers" },
|
|
186
|
+
{ key: "realContext", icon: "storefront" },
|
|
187
|
+
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
188
|
+
], c = he(() => {
|
|
189
|
+
var p;
|
|
190
|
+
const h = ((p = r.value) == null ? void 0 : p.permissions) ?? [];
|
|
191
|
+
return vn(
|
|
192
|
+
[
|
|
193
|
+
{
|
|
194
|
+
action: Qe.Action.manage,
|
|
195
|
+
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
h
|
|
199
|
+
).granted;
|
|
200
|
+
});
|
|
201
|
+
let a = !1;
|
|
202
|
+
xe(
|
|
203
|
+
c,
|
|
204
|
+
(h) => {
|
|
205
|
+
a || !h || (a = !0, !(Fn() || e) && (e = !0, s.value = !0));
|
|
206
|
+
},
|
|
207
|
+
{ immediate: !0 }
|
|
208
|
+
);
|
|
209
|
+
async function l() {
|
|
210
|
+
s.value = !1, await i.push({ name: f["$connect-MARKETING"] });
|
|
211
|
+
}
|
|
212
|
+
function d() {
|
|
213
|
+
Vn(), s.value = !1;
|
|
214
|
+
}
|
|
215
|
+
return (h, p) => {
|
|
216
|
+
const w = Q("FmIcon"), T = Q("FmCard"), g = Q("FmButton"), v = Q("FmDialog");
|
|
217
|
+
return V(), Ne(v, {
|
|
218
|
+
modelValue: s.value,
|
|
219
|
+
"onUpdate:modelValue": p[0] || (p[0] = (I) => s.value = I),
|
|
220
|
+
"min-width": "min(500px, calc(100% - 48px))",
|
|
221
|
+
"max-width": "min(860px, calc(100% - 48px))",
|
|
222
|
+
"max-height": "90vh",
|
|
223
|
+
"dismiss-away": ""
|
|
224
|
+
}, {
|
|
225
|
+
"dialog-header": Y(() => [
|
|
226
|
+
_("div", $n, [
|
|
227
|
+
_("div", Hn, [
|
|
228
|
+
b(w, {
|
|
229
|
+
name: "auto_awesome",
|
|
230
|
+
size: "sm",
|
|
231
|
+
color: "primary"
|
|
232
|
+
}),
|
|
233
|
+
_("span", jn, S(m(t)("connect.marketing.whatsNew.badge")), 1)
|
|
234
|
+
]),
|
|
235
|
+
_("h1", Wn, S(m(t)("connect.marketing.whatsNew.title")), 1),
|
|
236
|
+
_("p", Gn, S(m(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
237
|
+
])
|
|
238
|
+
]),
|
|
239
|
+
"dialog-footer": Y(() => [
|
|
240
|
+
_("div", Qn, [
|
|
241
|
+
_("div", Zn, [
|
|
242
|
+
b(g, {
|
|
243
|
+
variant: "primary",
|
|
244
|
+
size: "lg",
|
|
245
|
+
label: m(t)("connect.marketing.whatsNew.cta"),
|
|
246
|
+
"append-icon": "arrow_forward",
|
|
247
|
+
onClick: l
|
|
248
|
+
}, null, 8, ["label"]),
|
|
249
|
+
b(g, {
|
|
250
|
+
variant: "tertiary",
|
|
251
|
+
size: "lg",
|
|
252
|
+
label: m(t)("connect.marketing.whatsNew.dismiss"),
|
|
253
|
+
onClick: d
|
|
254
|
+
}, null, 8, ["label"])
|
|
255
|
+
]),
|
|
256
|
+
_("div", ei, S(m(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
257
|
+
])
|
|
258
|
+
]),
|
|
259
|
+
default: Y(() => [
|
|
260
|
+
_("div", Bn, [
|
|
261
|
+
_("div", zn, [
|
|
262
|
+
(V(), fe(It, null, cn(o, (I) => b(T, {
|
|
263
|
+
key: I.key,
|
|
264
|
+
variant: "outlined",
|
|
265
|
+
class: "!h-full flex flex-col gap-8 p-16"
|
|
266
|
+
}, {
|
|
267
|
+
default: Y(() => [
|
|
268
|
+
_("div", qn, [
|
|
269
|
+
b(w, {
|
|
270
|
+
name: I.icon,
|
|
271
|
+
size: "md",
|
|
272
|
+
color: "primary"
|
|
273
|
+
}, null, 8, ["name"])
|
|
274
|
+
]),
|
|
275
|
+
_("div", Kn, S(m(t)(`connect.marketing.whatsNew.benefits.${I.key}.title`)), 1),
|
|
276
|
+
_("div", Jn, S(m(t)(
|
|
277
|
+
`connect.marketing.whatsNew.benefits.${I.key}.description`
|
|
278
|
+
)), 1)
|
|
279
|
+
]),
|
|
280
|
+
_: 2
|
|
281
|
+
}, 1024)), 64))
|
|
282
|
+
]),
|
|
283
|
+
b(T, {
|
|
284
|
+
variant: "outlined",
|
|
285
|
+
class: "flex items-start gap-12 p-16"
|
|
286
|
+
}, {
|
|
287
|
+
default: Y(() => [
|
|
288
|
+
_("div", Yn, [
|
|
289
|
+
b(w, {
|
|
290
|
+
name: "lightbulb",
|
|
291
|
+
size: "md",
|
|
292
|
+
color: "primary"
|
|
293
|
+
})
|
|
294
|
+
]),
|
|
295
|
+
_("p", Xn, S(m(t)("connect.marketing.whatsNew.callout")), 1)
|
|
296
|
+
]),
|
|
297
|
+
_: 1
|
|
298
|
+
})
|
|
299
|
+
])
|
|
300
|
+
]),
|
|
301
|
+
_: 1
|
|
302
|
+
}, 8, ["modelValue"]);
|
|
303
|
+
};
|
|
304
|
+
}
|
|
166
305
|
});
|
|
167
|
-
var
|
|
306
|
+
var ni = "firebase", ii = "10.12.4";
|
|
168
307
|
/**
|
|
169
308
|
* @license
|
|
170
309
|
* Copyright 2020 Google LLC
|
|
@@ -181,13 +320,13 @@ var Ln = "firebase", Mn = "10.12.4";
|
|
|
181
320
|
* See the License for the specific language governing permissions and
|
|
182
321
|
* limitations under the License.
|
|
183
322
|
*/
|
|
184
|
-
|
|
185
|
-
function
|
|
323
|
+
Oe(ni, ii, "app");
|
|
324
|
+
function Rt() {
|
|
186
325
|
return {
|
|
187
326
|
"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."
|
|
188
327
|
};
|
|
189
328
|
}
|
|
190
|
-
const
|
|
329
|
+
const ri = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
191
330
|
/**
|
|
192
331
|
* @license
|
|
193
332
|
* Copyright 2020 Google LLC
|
|
@@ -204,12 +343,12 @@ const Un = It, Tt = new Ce("auth", "Firebase", It());
|
|
|
204
343
|
* See the License for the specific language governing permissions and
|
|
205
344
|
* limitations under the License.
|
|
206
345
|
*/
|
|
207
|
-
const
|
|
208
|
-
function
|
|
209
|
-
|
|
346
|
+
const me = new yn("@firebase/auth");
|
|
347
|
+
function si(n, ...e) {
|
|
348
|
+
me.logLevel <= bt.WARN && me.warn(`Auth (${ne}): ${n}`, ...e);
|
|
210
349
|
}
|
|
211
|
-
function
|
|
212
|
-
|
|
350
|
+
function ce(n, ...e) {
|
|
351
|
+
me.logLevel <= bt.ERROR && me.error(`Auth (${ne}): ${n}`, ...e);
|
|
213
352
|
}
|
|
214
353
|
/**
|
|
215
354
|
* @license
|
|
@@ -227,38 +366,38 @@ function re(n, ...e) {
|
|
|
227
366
|
* See the License for the specific language governing permissions and
|
|
228
367
|
* limitations under the License.
|
|
229
368
|
*/
|
|
230
|
-
function
|
|
231
|
-
throw
|
|
369
|
+
function N(n, ...e) {
|
|
370
|
+
throw He(n, ...e);
|
|
232
371
|
}
|
|
233
|
-
function
|
|
234
|
-
return
|
|
372
|
+
function k(n, ...e) {
|
|
373
|
+
return He(n, ...e);
|
|
235
374
|
}
|
|
236
|
-
function
|
|
237
|
-
const i = Object.assign(Object.assign({},
|
|
238
|
-
return new
|
|
375
|
+
function Pt(n, e, t) {
|
|
376
|
+
const i = Object.assign(Object.assign({}, ri()), { [e]: t });
|
|
377
|
+
return new Fe("auth", "Firebase", i).create(e, {
|
|
239
378
|
appName: n.name
|
|
240
379
|
});
|
|
241
380
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
381
|
+
function F(n) {
|
|
382
|
+
return Pt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
244
383
|
}
|
|
245
|
-
function
|
|
384
|
+
function He(n, ...e) {
|
|
246
385
|
if (typeof n != "string") {
|
|
247
386
|
const t = e[0], i = [...e.slice(1)];
|
|
248
387
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
249
388
|
}
|
|
250
|
-
return
|
|
389
|
+
return At.create(n, ...e);
|
|
251
390
|
}
|
|
252
391
|
function u(n, e, ...t) {
|
|
253
392
|
if (!n)
|
|
254
|
-
throw
|
|
393
|
+
throw He(e, ...t);
|
|
255
394
|
}
|
|
256
|
-
function
|
|
395
|
+
function A(n) {
|
|
257
396
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
258
|
-
throw
|
|
397
|
+
throw ce(e), new Error(e);
|
|
259
398
|
}
|
|
260
|
-
function
|
|
261
|
-
n ||
|
|
399
|
+
function O(n, e) {
|
|
400
|
+
n || A(e);
|
|
262
401
|
}
|
|
263
402
|
/**
|
|
264
403
|
* @license
|
|
@@ -276,14 +415,14 @@ function A(n, e) {
|
|
|
276
415
|
* See the License for the specific language governing permissions and
|
|
277
416
|
* limitations under the License.
|
|
278
417
|
*/
|
|
279
|
-
function
|
|
418
|
+
function Le() {
|
|
280
419
|
var n;
|
|
281
420
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
282
421
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
422
|
+
function oi() {
|
|
423
|
+
return nt() === "http:" || nt() === "https:";
|
|
285
424
|
}
|
|
286
|
-
function
|
|
425
|
+
function nt() {
|
|
287
426
|
var n;
|
|
288
427
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
|
289
428
|
}
|
|
@@ -303,15 +442,15 @@ function Je() {
|
|
|
303
442
|
* See the License for the specific language governing permissions and
|
|
304
443
|
* limitations under the License.
|
|
305
444
|
*/
|
|
306
|
-
function
|
|
445
|
+
function ai() {
|
|
307
446
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
308
447
|
// This is especially true for Cordova apps which have unreliable
|
|
309
448
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
310
449
|
// installed which overwrites the native navigator.onLine value and
|
|
311
450
|
// defines navigator.connection.
|
|
312
|
-
(
|
|
451
|
+
(oi() || kn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
313
452
|
}
|
|
314
|
-
function
|
|
453
|
+
function ci() {
|
|
315
454
|
if (typeof navigator > "u")
|
|
316
455
|
return null;
|
|
317
456
|
const n = navigator;
|
|
@@ -339,12 +478,12 @@ function Vn() {
|
|
|
339
478
|
* See the License for the specific language governing permissions and
|
|
340
479
|
* limitations under the License.
|
|
341
480
|
*/
|
|
342
|
-
class
|
|
481
|
+
class re {
|
|
343
482
|
constructor(e, t) {
|
|
344
|
-
this.shortDelay = e, this.longDelay = t,
|
|
483
|
+
this.shortDelay = e, this.longDelay = t, O(t > e, "Short delay should be less than long delay!"), this.isMobile = wn() || Tn();
|
|
345
484
|
}
|
|
346
485
|
get() {
|
|
347
|
-
return
|
|
486
|
+
return ai() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
348
487
|
}
|
|
349
488
|
}
|
|
350
489
|
/**
|
|
@@ -363,8 +502,8 @@ class X {
|
|
|
363
502
|
* See the License for the specific language governing permissions and
|
|
364
503
|
* limitations under the License.
|
|
365
504
|
*/
|
|
366
|
-
function
|
|
367
|
-
|
|
505
|
+
function je(n, e) {
|
|
506
|
+
O(n.emulator, "Emulator should always be set here");
|
|
368
507
|
const { url: t } = n.emulator;
|
|
369
508
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
370
509
|
}
|
|
@@ -384,7 +523,7 @@ function Me(n, e) {
|
|
|
384
523
|
* See the License for the specific language governing permissions and
|
|
385
524
|
* limitations under the License.
|
|
386
525
|
*/
|
|
387
|
-
class
|
|
526
|
+
class Ct {
|
|
388
527
|
static initialize(e, t, i) {
|
|
389
528
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
390
529
|
}
|
|
@@ -397,7 +536,7 @@ class wt {
|
|
|
397
536
|
return globalThis.fetch;
|
|
398
537
|
if (typeof fetch < "u")
|
|
399
538
|
return fetch;
|
|
400
|
-
|
|
539
|
+
A("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
401
540
|
}
|
|
402
541
|
static headers() {
|
|
403
542
|
if (this.headersImpl)
|
|
@@ -408,7 +547,7 @@ class wt {
|
|
|
408
547
|
return globalThis.Headers;
|
|
409
548
|
if (typeof Headers < "u")
|
|
410
549
|
return Headers;
|
|
411
|
-
|
|
550
|
+
A("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
412
551
|
}
|
|
413
552
|
static response() {
|
|
414
553
|
if (this.responseImpl)
|
|
@@ -419,7 +558,7 @@ class wt {
|
|
|
419
558
|
return globalThis.Response;
|
|
420
559
|
if (typeof Response < "u")
|
|
421
560
|
return Response;
|
|
422
|
-
|
|
561
|
+
A("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
423
562
|
}
|
|
424
563
|
}
|
|
425
564
|
/**
|
|
@@ -438,7 +577,7 @@ class wt {
|
|
|
438
577
|
* See the License for the specific language governing permissions and
|
|
439
578
|
* limitations under the License.
|
|
440
579
|
*/
|
|
441
|
-
const
|
|
580
|
+
const li = {
|
|
442
581
|
// Custom token errors.
|
|
443
582
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
444
583
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -529,93 +668,93 @@ const $n = {
|
|
|
529
668
|
* See the License for the specific language governing permissions and
|
|
530
669
|
* limitations under the License.
|
|
531
670
|
*/
|
|
532
|
-
const
|
|
533
|
-
function
|
|
671
|
+
const ui = new re(3e4, 6e4);
|
|
672
|
+
function ye(n, e) {
|
|
534
673
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
535
674
|
}
|
|
536
|
-
async function
|
|
537
|
-
return
|
|
675
|
+
async function K(n, e, t, i, r = {}) {
|
|
676
|
+
return Nt(n, r, async () => {
|
|
538
677
|
let s = {}, o = {};
|
|
539
678
|
i && (e === "GET" ? o = i : s = {
|
|
540
679
|
body: JSON.stringify(i)
|
|
541
680
|
});
|
|
542
|
-
const c =
|
|
681
|
+
const c = ie(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
543
682
|
return a[
|
|
544
683
|
"Content-Type"
|
|
545
684
|
/* HttpHeader.CONTENT_TYPE */
|
|
546
685
|
] = "application/json", n.languageCode && (a[
|
|
547
686
|
"X-Firebase-Locale"
|
|
548
687
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
549
|
-
] = n.languageCode),
|
|
688
|
+
] = n.languageCode), Ct.fetch()(Lt(n, n.config.apiHost, t, c), Object.assign({
|
|
550
689
|
method: e,
|
|
551
690
|
headers: a,
|
|
552
691
|
referrerPolicy: "no-referrer"
|
|
553
692
|
}, s));
|
|
554
693
|
});
|
|
555
694
|
}
|
|
556
|
-
async function
|
|
695
|
+
async function Nt(n, e, t) {
|
|
557
696
|
n._canInitEmulator = !1;
|
|
558
|
-
const i = Object.assign(Object.assign({},
|
|
697
|
+
const i = Object.assign(Object.assign({}, li), e);
|
|
559
698
|
try {
|
|
560
|
-
const r = new
|
|
699
|
+
const r = new di(n), s = await Promise.race([
|
|
561
700
|
t(),
|
|
562
701
|
r.promise
|
|
563
702
|
]);
|
|
564
703
|
r.clearNetworkTimeout();
|
|
565
704
|
const o = await s.json();
|
|
566
705
|
if ("needConfirmation" in o)
|
|
567
|
-
throw
|
|
706
|
+
throw ae(n, "account-exists-with-different-credential", o);
|
|
568
707
|
if (s.ok && !("errorMessage" in o))
|
|
569
708
|
return o;
|
|
570
709
|
{
|
|
571
710
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
572
711
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
573
|
-
throw
|
|
712
|
+
throw ae(n, "credential-already-in-use", o);
|
|
574
713
|
if (a === "EMAIL_EXISTS")
|
|
575
|
-
throw
|
|
714
|
+
throw ae(n, "email-already-in-use", o);
|
|
576
715
|
if (a === "USER_DISABLED")
|
|
577
|
-
throw
|
|
716
|
+
throw ae(n, "user-disabled", o);
|
|
578
717
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
579
718
|
if (l)
|
|
580
|
-
throw
|
|
581
|
-
|
|
719
|
+
throw Pt(n, d, l);
|
|
720
|
+
N(n, d);
|
|
582
721
|
}
|
|
583
722
|
} catch (r) {
|
|
584
|
-
if (r instanceof
|
|
723
|
+
if (r instanceof Ve)
|
|
585
724
|
throw r;
|
|
586
|
-
|
|
725
|
+
N(n, "network-request-failed", { message: String(r) });
|
|
587
726
|
}
|
|
588
727
|
}
|
|
589
|
-
async function
|
|
590
|
-
const s = await
|
|
591
|
-
return "mfaPendingCredential" in s &&
|
|
728
|
+
async function Ot(n, e, t, i, r = {}) {
|
|
729
|
+
const s = await K(n, e, t, i, r);
|
|
730
|
+
return "mfaPendingCredential" in s && N(n, "multi-factor-auth-required", {
|
|
592
731
|
_serverResponse: s
|
|
593
732
|
}), s;
|
|
594
733
|
}
|
|
595
|
-
function
|
|
734
|
+
function Lt(n, e, t, i) {
|
|
596
735
|
const r = `${e}${t}?${i}`;
|
|
597
|
-
return n.config.emulator ?
|
|
736
|
+
return n.config.emulator ? je(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
598
737
|
}
|
|
599
|
-
class
|
|
738
|
+
class di {
|
|
600
739
|
constructor(e) {
|
|
601
740
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
602
|
-
this.timer = setTimeout(() => i(
|
|
741
|
+
this.timer = setTimeout(() => i(k(
|
|
603
742
|
this.auth,
|
|
604
743
|
"network-request-failed"
|
|
605
744
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
606
|
-
)),
|
|
745
|
+
)), ui.get());
|
|
607
746
|
});
|
|
608
747
|
}
|
|
609
748
|
clearNetworkTimeout() {
|
|
610
749
|
clearTimeout(this.timer);
|
|
611
750
|
}
|
|
612
751
|
}
|
|
613
|
-
function
|
|
752
|
+
function ae(n, e, t) {
|
|
614
753
|
const i = {
|
|
615
754
|
appName: n.name
|
|
616
755
|
};
|
|
617
756
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
618
|
-
const r =
|
|
757
|
+
const r = k(n, e, i);
|
|
619
758
|
return r.customData._tokenResponse = t, r;
|
|
620
759
|
}
|
|
621
760
|
/**
|
|
@@ -634,11 +773,11 @@ function ee(n, e, t) {
|
|
|
634
773
|
* See the License for the specific language governing permissions and
|
|
635
774
|
* limitations under the License.
|
|
636
775
|
*/
|
|
637
|
-
async function
|
|
638
|
-
return
|
|
776
|
+
async function hi(n, e) {
|
|
777
|
+
return K(n, "POST", "/v1/accounts:delete", e);
|
|
639
778
|
}
|
|
640
|
-
async function
|
|
641
|
-
return
|
|
779
|
+
async function Mt(n, e) {
|
|
780
|
+
return K(n, "POST", "/v1/accounts:lookup", e);
|
|
642
781
|
}
|
|
643
782
|
/**
|
|
644
783
|
* @license
|
|
@@ -656,7 +795,7 @@ async function St(n, e) {
|
|
|
656
795
|
* See the License for the specific language governing permissions and
|
|
657
796
|
* limitations under the License.
|
|
658
797
|
*/
|
|
659
|
-
function
|
|
798
|
+
function ee(n) {
|
|
660
799
|
if (n)
|
|
661
800
|
try {
|
|
662
801
|
const e = new Date(Number(n));
|
|
@@ -665,8 +804,8 @@ function q(n) {
|
|
|
665
804
|
} catch {
|
|
666
805
|
}
|
|
667
806
|
}
|
|
668
|
-
async function
|
|
669
|
-
const t =
|
|
807
|
+
async function fi(n, e = !1) {
|
|
808
|
+
const t = q(n), i = await t.getIdToken(e), r = We(i);
|
|
670
809
|
u(
|
|
671
810
|
r && r.exp && r.auth_time && r.iat,
|
|
672
811
|
t.auth,
|
|
@@ -677,29 +816,29 @@ async function Gn(n, e = !1) {
|
|
|
677
816
|
return {
|
|
678
817
|
claims: r,
|
|
679
818
|
token: i,
|
|
680
|
-
authTime:
|
|
681
|
-
issuedAtTime:
|
|
682
|
-
expirationTime:
|
|
819
|
+
authTime: ee(Pe(r.auth_time)),
|
|
820
|
+
issuedAtTime: ee(Pe(r.iat)),
|
|
821
|
+
expirationTime: ee(Pe(r.exp)),
|
|
683
822
|
signInProvider: o || null,
|
|
684
823
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
685
824
|
};
|
|
686
825
|
}
|
|
687
|
-
function
|
|
826
|
+
function Pe(n) {
|
|
688
827
|
return Number(n) * 1e3;
|
|
689
828
|
}
|
|
690
|
-
function
|
|
829
|
+
function We(n) {
|
|
691
830
|
const [e, t, i] = n.split(".");
|
|
692
831
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
693
|
-
return
|
|
832
|
+
return ce("JWT malformed, contained fewer than 3 sections"), null;
|
|
694
833
|
try {
|
|
695
|
-
const r =
|
|
696
|
-
return r ? JSON.parse(r) : (
|
|
834
|
+
const r = An(t);
|
|
835
|
+
return r ? JSON.parse(r) : (ce("Failed to decode base64 JWT payload"), null);
|
|
697
836
|
} catch (r) {
|
|
698
|
-
return
|
|
837
|
+
return ce("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
699
838
|
}
|
|
700
839
|
}
|
|
701
|
-
function
|
|
702
|
-
const e =
|
|
840
|
+
function it(n) {
|
|
841
|
+
const e = We(n);
|
|
703
842
|
return u(
|
|
704
843
|
e,
|
|
705
844
|
"internal-error"
|
|
@@ -730,16 +869,16 @@ function Ye(n) {
|
|
|
730
869
|
* See the License for the specific language governing permissions and
|
|
731
870
|
* limitations under the License.
|
|
732
871
|
*/
|
|
733
|
-
async function
|
|
872
|
+
async function te(n, e, t = !1) {
|
|
734
873
|
if (t)
|
|
735
874
|
return e;
|
|
736
875
|
try {
|
|
737
876
|
return await e;
|
|
738
877
|
} catch (i) {
|
|
739
|
-
throw i instanceof
|
|
878
|
+
throw i instanceof Ve && pi(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
740
879
|
}
|
|
741
880
|
}
|
|
742
|
-
function
|
|
881
|
+
function pi({ code: n }) {
|
|
743
882
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
744
883
|
}
|
|
745
884
|
/**
|
|
@@ -758,7 +897,7 @@ function Bn({ code: n }) {
|
|
|
758
897
|
* See the License for the specific language governing permissions and
|
|
759
898
|
* limitations under the License.
|
|
760
899
|
*/
|
|
761
|
-
class
|
|
900
|
+
class mi {
|
|
762
901
|
constructor(e) {
|
|
763
902
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
764
903
|
}
|
|
@@ -820,12 +959,12 @@ class zn {
|
|
|
820
959
|
* See the License for the specific language governing permissions and
|
|
821
960
|
* limitations under the License.
|
|
822
961
|
*/
|
|
823
|
-
class
|
|
962
|
+
class Me {
|
|
824
963
|
constructor(e, t) {
|
|
825
964
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
826
965
|
}
|
|
827
966
|
_initializeTime() {
|
|
828
|
-
this.lastSignInTime =
|
|
967
|
+
this.lastSignInTime = ee(this.lastLoginAt), this.creationTime = ee(this.createdAt);
|
|
829
968
|
}
|
|
830
969
|
_copy(e) {
|
|
831
970
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -853,9 +992,9 @@ class Ae {
|
|
|
853
992
|
* See the License for the specific language governing permissions and
|
|
854
993
|
* limitations under the License.
|
|
855
994
|
*/
|
|
856
|
-
async function
|
|
995
|
+
async function ge(n) {
|
|
857
996
|
var e;
|
|
858
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
997
|
+
const t = n.auth, i = await n.getIdToken(), r = await te(n, Mt(t, { idToken: i }));
|
|
859
998
|
u(
|
|
860
999
|
r == null ? void 0 : r.users.length,
|
|
861
1000
|
t,
|
|
@@ -864,7 +1003,7 @@ async function le(n) {
|
|
|
864
1003
|
);
|
|
865
1004
|
const s = r.users[0];
|
|
866
1005
|
n._notifyReloadListener(s);
|
|
867
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
1006
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c = _i(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, h = {
|
|
868
1007
|
uid: s.localId,
|
|
869
1008
|
displayName: s.displayName || null,
|
|
870
1009
|
photoURL: s.photoUrl || null,
|
|
@@ -873,21 +1012,21 @@ async function le(n) {
|
|
|
873
1012
|
phoneNumber: s.phoneNumber || null,
|
|
874
1013
|
tenantId: s.tenantId || null,
|
|
875
1014
|
providerData: c,
|
|
876
|
-
metadata: new
|
|
1015
|
+
metadata: new Me(s.createdAt, s.lastLoginAt),
|
|
877
1016
|
isAnonymous: d
|
|
878
1017
|
};
|
|
879
1018
|
Object.assign(n, h);
|
|
880
1019
|
}
|
|
881
|
-
async function
|
|
882
|
-
const e =
|
|
883
|
-
await
|
|
1020
|
+
async function gi(n) {
|
|
1021
|
+
const e = q(n);
|
|
1022
|
+
await ge(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
884
1023
|
}
|
|
885
|
-
function
|
|
1024
|
+
function _i(n, e) {
|
|
886
1025
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
887
1026
|
}
|
|
888
|
-
function
|
|
1027
|
+
function Ut(n) {
|
|
889
1028
|
return n.map((e) => {
|
|
890
|
-
var { providerId: t } = e, i =
|
|
1029
|
+
var { providerId: t } = e, i = $e(e, ["providerId"]);
|
|
891
1030
|
return {
|
|
892
1031
|
providerId: t,
|
|
893
1032
|
uid: i.rawId || "",
|
|
@@ -914,16 +1053,16 @@ function Rt(n) {
|
|
|
914
1053
|
* See the License for the specific language governing permissions and
|
|
915
1054
|
* limitations under the License.
|
|
916
1055
|
*/
|
|
917
|
-
async function
|
|
918
|
-
const t = await
|
|
919
|
-
const i =
|
|
1056
|
+
async function vi(n, e) {
|
|
1057
|
+
const t = await Nt(n, {}, async () => {
|
|
1058
|
+
const i = ie({
|
|
920
1059
|
grant_type: "refresh_token",
|
|
921
1060
|
refresh_token: e
|
|
922
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
1061
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = Lt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
923
1062
|
return c[
|
|
924
1063
|
"Content-Type"
|
|
925
1064
|
/* HttpHeader.CONTENT_TYPE */
|
|
926
|
-
] = "application/x-www-form-urlencoded",
|
|
1065
|
+
] = "application/x-www-form-urlencoded", Ct.fetch()(o, {
|
|
927
1066
|
method: "POST",
|
|
928
1067
|
headers: c,
|
|
929
1068
|
body: i
|
|
@@ -935,8 +1074,8 @@ async function Jn(n, e) {
|
|
|
935
1074
|
refreshToken: t.refresh_token
|
|
936
1075
|
};
|
|
937
1076
|
}
|
|
938
|
-
async function
|
|
939
|
-
return
|
|
1077
|
+
async function Ii(n, e) {
|
|
1078
|
+
return K(n, "POST", "/v2/accounts:revokeToken", ye(n, e));
|
|
940
1079
|
}
|
|
941
1080
|
/**
|
|
942
1081
|
* @license
|
|
@@ -954,7 +1093,7 @@ async function Yn(n, e) {
|
|
|
954
1093
|
* See the License for the specific language governing permissions and
|
|
955
1094
|
* limitations under the License.
|
|
956
1095
|
*/
|
|
957
|
-
class
|
|
1096
|
+
class G {
|
|
958
1097
|
constructor() {
|
|
959
1098
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
960
1099
|
}
|
|
@@ -975,7 +1114,7 @@ class $ {
|
|
|
975
1114
|
"internal-error"
|
|
976
1115
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
977
1116
|
);
|
|
978
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
|
1117
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : it(e.idToken);
|
|
979
1118
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
|
980
1119
|
}
|
|
981
1120
|
updateFromIdToken(e) {
|
|
@@ -984,7 +1123,7 @@ class $ {
|
|
|
984
1123
|
"internal-error"
|
|
985
1124
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
986
1125
|
);
|
|
987
|
-
const t =
|
|
1126
|
+
const t = it(e);
|
|
988
1127
|
this.updateTokensAndExpiration(e, null, t);
|
|
989
1128
|
}
|
|
990
1129
|
async getToken(e, t = !1) {
|
|
@@ -999,14 +1138,14 @@ class $ {
|
|
|
999
1138
|
this.refreshToken = null;
|
|
1000
1139
|
}
|
|
1001
1140
|
async refresh(e, t) {
|
|
1002
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1141
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await vi(e, t);
|
|
1003
1142
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1004
1143
|
}
|
|
1005
1144
|
updateTokensAndExpiration(e, t, i) {
|
|
1006
1145
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1007
1146
|
}
|
|
1008
1147
|
static fromJSON(e, t) {
|
|
1009
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1148
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new G();
|
|
1010
1149
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1011
1150
|
appName: e
|
|
1012
1151
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1026,10 +1165,10 @@ class $ {
|
|
|
1026
1165
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1027
1166
|
}
|
|
1028
1167
|
_clone() {
|
|
1029
|
-
return Object.assign(new
|
|
1168
|
+
return Object.assign(new G(), this.toJSON());
|
|
1030
1169
|
}
|
|
1031
1170
|
_performRefresh() {
|
|
1032
|
-
return
|
|
1171
|
+
return A("not implemented");
|
|
1033
1172
|
}
|
|
1034
1173
|
}
|
|
1035
1174
|
/**
|
|
@@ -1048,16 +1187,16 @@ class $ {
|
|
|
1048
1187
|
* See the License for the specific language governing permissions and
|
|
1049
1188
|
* limitations under the License.
|
|
1050
1189
|
*/
|
|
1051
|
-
function
|
|
1190
|
+
function L(n, e) {
|
|
1052
1191
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1053
1192
|
}
|
|
1054
|
-
class
|
|
1193
|
+
class P {
|
|
1055
1194
|
constructor(e) {
|
|
1056
|
-
var { uid: t, auth: i, stsTokenManager: r } = e, s =
|
|
1057
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1195
|
+
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1196
|
+
this.providerId = "firebase", this.proactiveRefresh = new mi(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 Me(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1058
1197
|
}
|
|
1059
1198
|
async getIdToken(e) {
|
|
1060
|
-
const t = await
|
|
1199
|
+
const t = await te(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1061
1200
|
return u(
|
|
1062
1201
|
t,
|
|
1063
1202
|
this.auth,
|
|
@@ -1066,10 +1205,10 @@ class b {
|
|
|
1066
1205
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1067
1206
|
}
|
|
1068
1207
|
getIdTokenResult(e) {
|
|
1069
|
-
return
|
|
1208
|
+
return fi(this, e);
|
|
1070
1209
|
}
|
|
1071
1210
|
reload() {
|
|
1072
|
-
return
|
|
1211
|
+
return gi(this);
|
|
1073
1212
|
}
|
|
1074
1213
|
_assign(e) {
|
|
1075
1214
|
this !== e && (u(
|
|
@@ -1080,7 +1219,7 @@ class b {
|
|
|
1080
1219
|
), this.displayName = e.displayName, this.photoURL = e.photoURL, this.email = e.email, this.emailVerified = e.emailVerified, this.phoneNumber = e.phoneNumber, this.isAnonymous = e.isAnonymous, this.tenantId = e.tenantId, this.providerData = e.providerData.map((t) => Object.assign({}, t)), this.metadata._copy(e.metadata), this.stsTokenManager._assign(e.stsTokenManager));
|
|
1081
1220
|
}
|
|
1082
1221
|
_clone(e) {
|
|
1083
|
-
const t = new
|
|
1222
|
+
const t = new P(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1084
1223
|
return t.metadata._copy(this.metadata), t;
|
|
1085
1224
|
}
|
|
1086
1225
|
_onReload(e) {
|
|
@@ -1102,13 +1241,13 @@ class b {
|
|
|
1102
1241
|
}
|
|
1103
1242
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1104
1243
|
let i = !1;
|
|
1105
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1244
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await ge(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1106
1245
|
}
|
|
1107
1246
|
async delete() {
|
|
1108
|
-
if (
|
|
1109
|
-
return Promise.reject(
|
|
1247
|
+
if (R(this.auth.app))
|
|
1248
|
+
return Promise.reject(F(this.auth));
|
|
1110
1249
|
const e = await this.getIdToken();
|
|
1111
|
-
return await
|
|
1250
|
+
return await te(this, hi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1112
1251
|
}
|
|
1113
1252
|
toJSON() {
|
|
1114
1253
|
return Object.assign(Object.assign({
|
|
@@ -1136,45 +1275,45 @@ class b {
|
|
|
1136
1275
|
}
|
|
1137
1276
|
static _fromJSON(e, t) {
|
|
1138
1277
|
var i, r, s, o, c, a, l, d;
|
|
1139
|
-
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, p = (r = t.email) !== null && r !== void 0 ? r : void 0, w = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0,
|
|
1278
|
+
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, p = (r = t.email) !== null && r !== void 0 ? r : void 0, w = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, T = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, g = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, v = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, I = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, j = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: be, emailVerified: Ke, isAnonymous: Je, providerData: Se, stsTokenManager: Ye } = t;
|
|
1140
1279
|
u(
|
|
1141
|
-
|
|
1280
|
+
be && Ye,
|
|
1142
1281
|
e,
|
|
1143
1282
|
"internal-error"
|
|
1144
1283
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1145
1284
|
);
|
|
1146
|
-
const
|
|
1285
|
+
const on = G.fromJSON(this.name, Ye);
|
|
1147
1286
|
u(
|
|
1148
|
-
typeof
|
|
1287
|
+
typeof be == "string",
|
|
1149
1288
|
e,
|
|
1150
1289
|
"internal-error"
|
|
1151
1290
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1152
|
-
),
|
|
1153
|
-
typeof
|
|
1291
|
+
), L(h, e.name), L(p, e.name), u(
|
|
1292
|
+
typeof Ke == "boolean",
|
|
1154
1293
|
e,
|
|
1155
1294
|
"internal-error"
|
|
1156
1295
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1157
1296
|
), u(
|
|
1158
|
-
typeof
|
|
1297
|
+
typeof Je == "boolean",
|
|
1159
1298
|
e,
|
|
1160
1299
|
"internal-error"
|
|
1161
1300
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1162
|
-
),
|
|
1163
|
-
const
|
|
1164
|
-
uid:
|
|
1301
|
+
), L(w, e.name), L(T, e.name), L(g, e.name), L(v, e.name), L(I, e.name), L(j, e.name);
|
|
1302
|
+
const Re = new P({
|
|
1303
|
+
uid: be,
|
|
1165
1304
|
auth: e,
|
|
1166
1305
|
email: p,
|
|
1167
|
-
emailVerified:
|
|
1306
|
+
emailVerified: Ke,
|
|
1168
1307
|
displayName: h,
|
|
1169
|
-
isAnonymous:
|
|
1170
|
-
photoURL:
|
|
1308
|
+
isAnonymous: Je,
|
|
1309
|
+
photoURL: T,
|
|
1171
1310
|
phoneNumber: w,
|
|
1172
|
-
tenantId:
|
|
1173
|
-
stsTokenManager:
|
|
1311
|
+
tenantId: g,
|
|
1312
|
+
stsTokenManager: on,
|
|
1174
1313
|
createdAt: I,
|
|
1175
|
-
lastLoginAt:
|
|
1314
|
+
lastLoginAt: j
|
|
1176
1315
|
});
|
|
1177
|
-
return
|
|
1316
|
+
return Se && Array.isArray(Se) && (Re.providerData = Se.map((an) => Object.assign({}, an))), v && (Re._redirectEventId = v), Re;
|
|
1178
1317
|
}
|
|
1179
1318
|
/**
|
|
1180
1319
|
* Initialize a User from an idToken server response
|
|
@@ -1182,15 +1321,15 @@ class b {
|
|
|
1182
1321
|
* @param idTokenResponse
|
|
1183
1322
|
*/
|
|
1184
1323
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1185
|
-
const r = new
|
|
1324
|
+
const r = new G();
|
|
1186
1325
|
r.updateFromServerResponse(t);
|
|
1187
|
-
const s = new
|
|
1326
|
+
const s = new P({
|
|
1188
1327
|
uid: t.localId,
|
|
1189
1328
|
auth: e,
|
|
1190
1329
|
stsTokenManager: r,
|
|
1191
1330
|
isAnonymous: i
|
|
1192
1331
|
});
|
|
1193
|
-
return await
|
|
1332
|
+
return await ge(s), s;
|
|
1194
1333
|
}
|
|
1195
1334
|
/**
|
|
1196
1335
|
* Initialize a User from an idToken server response
|
|
@@ -1204,9 +1343,9 @@ class b {
|
|
|
1204
1343
|
"internal-error"
|
|
1205
1344
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1206
1345
|
);
|
|
1207
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1346
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new G();
|
|
1208
1347
|
c.updateFromIdToken(i);
|
|
1209
|
-
const a = new
|
|
1348
|
+
const a = new P({
|
|
1210
1349
|
uid: r.localId,
|
|
1211
1350
|
auth: e,
|
|
1212
1351
|
stsTokenManager: c,
|
|
@@ -1220,7 +1359,7 @@ class b {
|
|
|
1220
1359
|
phoneNumber: r.phoneNumber || null,
|
|
1221
1360
|
tenantId: r.tenantId || null,
|
|
1222
1361
|
providerData: s,
|
|
1223
|
-
metadata: new
|
|
1362
|
+
metadata: new Me(r.createdAt, r.lastLoginAt),
|
|
1224
1363
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1225
1364
|
};
|
|
1226
1365
|
return Object.assign(a, l), a;
|
|
@@ -1242,11 +1381,11 @@ class b {
|
|
|
1242
1381
|
* See the License for the specific language governing permissions and
|
|
1243
1382
|
* limitations under the License.
|
|
1244
1383
|
*/
|
|
1245
|
-
const
|
|
1246
|
-
function
|
|
1247
|
-
|
|
1248
|
-
let e =
|
|
1249
|
-
return e ? (
|
|
1384
|
+
const rt = /* @__PURE__ */ new Map();
|
|
1385
|
+
function C(n) {
|
|
1386
|
+
O(n instanceof Function, "Expected a class definition");
|
|
1387
|
+
let e = rt.get(n);
|
|
1388
|
+
return e ? (O(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), rt.set(n, e), e);
|
|
1250
1389
|
}
|
|
1251
1390
|
/**
|
|
1252
1391
|
* @license
|
|
@@ -1264,7 +1403,7 @@ function S(n) {
|
|
|
1264
1403
|
* See the License for the specific language governing permissions and
|
|
1265
1404
|
* limitations under the License.
|
|
1266
1405
|
*/
|
|
1267
|
-
class
|
|
1406
|
+
class Dt {
|
|
1268
1407
|
constructor() {
|
|
1269
1408
|
this.type = "NONE", this.storage = {};
|
|
1270
1409
|
}
|
|
@@ -1286,8 +1425,8 @@ class At {
|
|
|
1286
1425
|
_removeListener(e, t) {
|
|
1287
1426
|
}
|
|
1288
1427
|
}
|
|
1289
|
-
|
|
1290
|
-
const
|
|
1428
|
+
Dt.type = "NONE";
|
|
1429
|
+
const st = Dt;
|
|
1291
1430
|
/**
|
|
1292
1431
|
* @license
|
|
1293
1432
|
* Copyright 2019 Google LLC
|
|
@@ -1304,21 +1443,21 @@ const Qe = At;
|
|
|
1304
1443
|
* See the License for the specific language governing permissions and
|
|
1305
1444
|
* limitations under the License.
|
|
1306
1445
|
*/
|
|
1307
|
-
function
|
|
1446
|
+
function le(n, e, t) {
|
|
1308
1447
|
return `firebase:${n}:${e}:${t}`;
|
|
1309
1448
|
}
|
|
1310
|
-
class
|
|
1449
|
+
class B {
|
|
1311
1450
|
constructor(e, t, i) {
|
|
1312
1451
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1313
1452
|
const { config: r, name: s } = this.auth;
|
|
1314
|
-
this.fullUserKey =
|
|
1453
|
+
this.fullUserKey = le(this.userKey, r.apiKey, s), this.fullPersistenceKey = le("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1315
1454
|
}
|
|
1316
1455
|
setCurrentUser(e) {
|
|
1317
1456
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
1318
1457
|
}
|
|
1319
1458
|
async getCurrentUser() {
|
|
1320
1459
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1321
|
-
return e ?
|
|
1460
|
+
return e ? P._fromJSON(this.auth, e) : null;
|
|
1322
1461
|
}
|
|
1323
1462
|
removeCurrentUser() {
|
|
1324
1463
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1338,32 +1477,32 @@ class H {
|
|
|
1338
1477
|
}
|
|
1339
1478
|
static async create(e, t, i = "authUser") {
|
|
1340
1479
|
if (!t.length)
|
|
1341
|
-
return new
|
|
1480
|
+
return new B(C(st), e, i);
|
|
1342
1481
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1343
1482
|
if (await l._isAvailable())
|
|
1344
1483
|
return l;
|
|
1345
1484
|
}))).filter((l) => l);
|
|
1346
|
-
let s = r[0] ||
|
|
1347
|
-
const o =
|
|
1485
|
+
let s = r[0] || C(st);
|
|
1486
|
+
const o = le(i, e.config.apiKey, e.name);
|
|
1348
1487
|
let c = null;
|
|
1349
1488
|
for (const l of t)
|
|
1350
1489
|
try {
|
|
1351
1490
|
const d = await l._get(o);
|
|
1352
1491
|
if (d) {
|
|
1353
|
-
const h =
|
|
1492
|
+
const h = P._fromJSON(e, d);
|
|
1354
1493
|
l !== s && (c = h), s = l;
|
|
1355
1494
|
break;
|
|
1356
1495
|
}
|
|
1357
1496
|
} catch {
|
|
1358
1497
|
}
|
|
1359
1498
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1360
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1499
|
+
return !s._shouldAllowMigration || !a.length ? new B(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1361
1500
|
if (l !== s)
|
|
1362
1501
|
try {
|
|
1363
1502
|
await l._remove(o);
|
|
1364
1503
|
} catch {
|
|
1365
1504
|
}
|
|
1366
|
-
})), new
|
|
1505
|
+
})), new B(s, e, i));
|
|
1367
1506
|
}
|
|
1368
1507
|
}
|
|
1369
1508
|
/**
|
|
@@ -1382,29 +1521,29 @@ class H {
|
|
|
1382
1521
|
* See the License for the specific language governing permissions and
|
|
1383
1522
|
* limitations under the License.
|
|
1384
1523
|
*/
|
|
1385
|
-
function
|
|
1524
|
+
function ot(n) {
|
|
1386
1525
|
const e = n.toLowerCase();
|
|
1387
1526
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1388
1527
|
return "Opera";
|
|
1389
|
-
if (
|
|
1528
|
+
if (Vt(e))
|
|
1390
1529
|
return "IEMobile";
|
|
1391
1530
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1392
1531
|
return "IE";
|
|
1393
1532
|
if (e.includes("edge/"))
|
|
1394
1533
|
return "Edge";
|
|
1395
|
-
if (
|
|
1534
|
+
if (xt(e))
|
|
1396
1535
|
return "Firefox";
|
|
1397
1536
|
if (e.includes("silk/"))
|
|
1398
1537
|
return "Silk";
|
|
1399
|
-
if (
|
|
1538
|
+
if (Ht(e))
|
|
1400
1539
|
return "Blackberry";
|
|
1401
|
-
if (
|
|
1540
|
+
if (jt(e))
|
|
1402
1541
|
return "Webos";
|
|
1403
|
-
if (
|
|
1542
|
+
if (Ge(e))
|
|
1404
1543
|
return "Safari";
|
|
1405
|
-
if ((e.includes("chrome/") ||
|
|
1544
|
+
if ((e.includes("chrome/") || Ft(e)) && !e.includes("edge/"))
|
|
1406
1545
|
return "Chrome";
|
|
1407
|
-
if (
|
|
1546
|
+
if ($t(e))
|
|
1408
1547
|
return "Android";
|
|
1409
1548
|
{
|
|
1410
1549
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1413,42 +1552,42 @@ function Ze(n) {
|
|
|
1413
1552
|
}
|
|
1414
1553
|
return "Other";
|
|
1415
1554
|
}
|
|
1416
|
-
function
|
|
1555
|
+
function xt(n = y()) {
|
|
1417
1556
|
return /firefox\//i.test(n);
|
|
1418
1557
|
}
|
|
1419
|
-
function
|
|
1558
|
+
function Ge(n = y()) {
|
|
1420
1559
|
const e = n.toLowerCase();
|
|
1421
1560
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1422
1561
|
}
|
|
1423
|
-
function
|
|
1562
|
+
function Ft(n = y()) {
|
|
1424
1563
|
return /crios\//i.test(n);
|
|
1425
1564
|
}
|
|
1426
|
-
function
|
|
1565
|
+
function Vt(n = y()) {
|
|
1427
1566
|
return /iemobile/i.test(n);
|
|
1428
1567
|
}
|
|
1429
|
-
function
|
|
1568
|
+
function $t(n = y()) {
|
|
1430
1569
|
return /android/i.test(n);
|
|
1431
1570
|
}
|
|
1432
|
-
function
|
|
1571
|
+
function Ht(n = y()) {
|
|
1433
1572
|
return /blackberry/i.test(n);
|
|
1434
1573
|
}
|
|
1435
|
-
function
|
|
1574
|
+
function jt(n = y()) {
|
|
1436
1575
|
return /webos/i.test(n);
|
|
1437
1576
|
}
|
|
1438
|
-
function
|
|
1577
|
+
function we(n = y()) {
|
|
1439
1578
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1440
1579
|
}
|
|
1441
|
-
function
|
|
1580
|
+
function yi(n = y()) {
|
|
1442
1581
|
var e;
|
|
1443
|
-
return
|
|
1582
|
+
return we(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1444
1583
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return
|
|
1584
|
+
function wi() {
|
|
1585
|
+
return Pn() && document.documentMode === 10;
|
|
1447
1586
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1587
|
+
function Wt(n = y()) {
|
|
1588
|
+
return we(n) || $t(n) || jt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1450
1589
|
}
|
|
1451
|
-
function
|
|
1590
|
+
function Ti() {
|
|
1452
1591
|
try {
|
|
1453
1592
|
return !!(window && window !== window.top);
|
|
1454
1593
|
} catch {
|
|
@@ -1471,20 +1610,20 @@ function Zn() {
|
|
|
1471
1610
|
* See the License for the specific language governing permissions and
|
|
1472
1611
|
* limitations under the License.
|
|
1473
1612
|
*/
|
|
1474
|
-
function
|
|
1613
|
+
function Gt(n, e = []) {
|
|
1475
1614
|
let t;
|
|
1476
1615
|
switch (n) {
|
|
1477
1616
|
case "Browser":
|
|
1478
|
-
t =
|
|
1617
|
+
t = ot(y());
|
|
1479
1618
|
break;
|
|
1480
1619
|
case "Worker":
|
|
1481
|
-
t = `${
|
|
1620
|
+
t = `${ot(y())}-${n}`;
|
|
1482
1621
|
break;
|
|
1483
1622
|
default:
|
|
1484
1623
|
t = n;
|
|
1485
1624
|
}
|
|
1486
1625
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1487
|
-
return `${t}/JsCore/${
|
|
1626
|
+
return `${t}/JsCore/${ne}/${i}`;
|
|
1488
1627
|
}
|
|
1489
1628
|
/**
|
|
1490
1629
|
* @license
|
|
@@ -1502,7 +1641,7 @@ function Dt(n, e = []) {
|
|
|
1502
1641
|
* See the License for the specific language governing permissions and
|
|
1503
1642
|
* limitations under the License.
|
|
1504
1643
|
*/
|
|
1505
|
-
class
|
|
1644
|
+
class ki {
|
|
1506
1645
|
constructor(e) {
|
|
1507
1646
|
this.auth = e, this.queue = [];
|
|
1508
1647
|
}
|
|
@@ -1557,8 +1696,8 @@ class ei {
|
|
|
1557
1696
|
* See the License for the specific language governing permissions and
|
|
1558
1697
|
* limitations under the License.
|
|
1559
1698
|
*/
|
|
1560
|
-
async function
|
|
1561
|
-
return
|
|
1699
|
+
async function Ei(n, e = {}) {
|
|
1700
|
+
return K(n, "GET", "/v2/passwordPolicy", ye(n, e));
|
|
1562
1701
|
}
|
|
1563
1702
|
/**
|
|
1564
1703
|
* @license
|
|
@@ -1576,12 +1715,12 @@ async function ti(n, e = {}) {
|
|
|
1576
1715
|
* See the License for the specific language governing permissions and
|
|
1577
1716
|
* limitations under the License.
|
|
1578
1717
|
*/
|
|
1579
|
-
const
|
|
1580
|
-
class
|
|
1718
|
+
const bi = 6;
|
|
1719
|
+
class Si {
|
|
1581
1720
|
constructor(e) {
|
|
1582
1721
|
var t, i, r, s;
|
|
1583
1722
|
const o = e.customStrengthOptions;
|
|
1584
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1723
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : bi, 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;
|
|
1585
1724
|
}
|
|
1586
1725
|
validatePassword(e) {
|
|
1587
1726
|
var t, i, r, s, o, c;
|
|
@@ -1664,14 +1803,14 @@ class ii {
|
|
|
1664
1803
|
* See the License for the specific language governing permissions and
|
|
1665
1804
|
* limitations under the License.
|
|
1666
1805
|
*/
|
|
1667
|
-
class
|
|
1806
|
+
class Ri {
|
|
1668
1807
|
constructor(e, t, i, r) {
|
|
1669
|
-
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
|
|
1808
|
+
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 ki(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;
|
|
1670
1809
|
}
|
|
1671
1810
|
_initializeWithPersistence(e, t) {
|
|
1672
|
-
return t && (this._popupRedirectResolver =
|
|
1811
|
+
return t && (this._popupRedirectResolver = C(t)), this._initializationPromise = this.queue(async () => {
|
|
1673
1812
|
var i, r;
|
|
1674
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1813
|
+
if (!this._deleted && (this.persistenceManager = await B.create(this, e), !this._deleted)) {
|
|
1675
1814
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1676
1815
|
try {
|
|
1677
1816
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1702,7 +1841,7 @@ class ri {
|
|
|
1702
1841
|
}
|
|
1703
1842
|
async initializeCurrentUserFromIdToken(e) {
|
|
1704
1843
|
try {
|
|
1705
|
-
const t = await
|
|
1844
|
+
const t = await Mt(this, { idToken: e }), i = await P._fromGetAccountInfoResponse(this, t, e);
|
|
1706
1845
|
await this.directlySetCurrentUser(i);
|
|
1707
1846
|
} catch (t) {
|
|
1708
1847
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1710,7 +1849,7 @@ class ri {
|
|
|
1710
1849
|
}
|
|
1711
1850
|
async initializeCurrentUser(e) {
|
|
1712
1851
|
var t;
|
|
1713
|
-
if (
|
|
1852
|
+
if (R(this.app)) {
|
|
1714
1853
|
const o = this.app.settings.authIdToken;
|
|
1715
1854
|
return o ? new Promise((c) => {
|
|
1716
1855
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1752,7 +1891,7 @@ class ri {
|
|
|
1752
1891
|
}
|
|
1753
1892
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1754
1893
|
try {
|
|
1755
|
-
await
|
|
1894
|
+
await ge(e);
|
|
1756
1895
|
} catch (t) {
|
|
1757
1896
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1758
1897
|
return this.directlySetCurrentUser(null);
|
|
@@ -1760,15 +1899,15 @@ class ri {
|
|
|
1760
1899
|
return this.directlySetCurrentUser(e);
|
|
1761
1900
|
}
|
|
1762
1901
|
useDeviceLanguage() {
|
|
1763
|
-
this.languageCode =
|
|
1902
|
+
this.languageCode = ci();
|
|
1764
1903
|
}
|
|
1765
1904
|
async _delete() {
|
|
1766
1905
|
this._deleted = !0;
|
|
1767
1906
|
}
|
|
1768
1907
|
async updateCurrentUser(e) {
|
|
1769
|
-
if (
|
|
1770
|
-
return Promise.reject(
|
|
1771
|
-
const t = e ?
|
|
1908
|
+
if (R(this.app))
|
|
1909
|
+
return Promise.reject(F(this));
|
|
1910
|
+
const t = e ? q(e) : null;
|
|
1772
1911
|
return t && u(
|
|
1773
1912
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1774
1913
|
this,
|
|
@@ -1788,15 +1927,15 @@ class ri {
|
|
|
1788
1927
|
});
|
|
1789
1928
|
}
|
|
1790
1929
|
async signOut() {
|
|
1791
|
-
return
|
|
1930
|
+
return R(this.app) ? Promise.reject(F(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1792
1931
|
null,
|
|
1793
1932
|
/* skipBeforeStateCallbacks */
|
|
1794
1933
|
!0
|
|
1795
1934
|
));
|
|
1796
1935
|
}
|
|
1797
1936
|
setPersistence(e) {
|
|
1798
|
-
return
|
|
1799
|
-
await this.assertedPersistence.setPersistence(
|
|
1937
|
+
return R(this.app) ? Promise.reject(F(this)) : this.queue(async () => {
|
|
1938
|
+
await this.assertedPersistence.setPersistence(C(e));
|
|
1800
1939
|
});
|
|
1801
1940
|
}
|
|
1802
1941
|
_getRecaptchaConfig() {
|
|
@@ -1811,14 +1950,14 @@ class ri {
|
|
|
1811
1950
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1812
1951
|
}
|
|
1813
1952
|
async _updatePasswordPolicy() {
|
|
1814
|
-
const e = await
|
|
1953
|
+
const e = await Ei(this), t = new Si(e);
|
|
1815
1954
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1816
1955
|
}
|
|
1817
1956
|
_getPersistence() {
|
|
1818
1957
|
return this.assertedPersistence.persistence.type;
|
|
1819
1958
|
}
|
|
1820
1959
|
_updateErrorMap(e) {
|
|
1821
|
-
this._errorFactory = new
|
|
1960
|
+
this._errorFactory = new Fe("auth", "Firebase", e());
|
|
1822
1961
|
}
|
|
1823
1962
|
onAuthStateChanged(e, t, i) {
|
|
1824
1963
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1851,7 +1990,7 @@ class ri {
|
|
|
1851
1990
|
token: e,
|
|
1852
1991
|
idToken: t
|
|
1853
1992
|
};
|
|
1854
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1993
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await Ii(this, i);
|
|
1855
1994
|
}
|
|
1856
1995
|
}
|
|
1857
1996
|
toJSON() {
|
|
@@ -1869,15 +2008,15 @@ class ri {
|
|
|
1869
2008
|
}
|
|
1870
2009
|
async getOrInitRedirectPersistenceManager(e) {
|
|
1871
2010
|
if (!this.redirectPersistenceManager) {
|
|
1872
|
-
const t = e &&
|
|
2011
|
+
const t = e && C(e) || this._popupRedirectResolver;
|
|
1873
2012
|
u(
|
|
1874
2013
|
t,
|
|
1875
2014
|
this,
|
|
1876
2015
|
"argument-error"
|
|
1877
2016
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
1878
|
-
), this.redirectPersistenceManager = await
|
|
2017
|
+
), this.redirectPersistenceManager = await B.create(
|
|
1879
2018
|
this,
|
|
1880
|
-
[
|
|
2019
|
+
[C(t._redirectPersistence)],
|
|
1881
2020
|
"redirectUser"
|
|
1882
2021
|
/* KeyName.REDIRECT_USER */
|
|
1883
2022
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -1964,7 +2103,7 @@ class ri {
|
|
|
1964
2103
|
), this.persistenceManager;
|
|
1965
2104
|
}
|
|
1966
2105
|
_logFramework(e) {
|
|
1967
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
2106
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Gt(this.config.clientPlatform, this._getFrameworks()));
|
|
1968
2107
|
}
|
|
1969
2108
|
_getFrameworks() {
|
|
1970
2109
|
return this.frameworks;
|
|
@@ -1994,15 +2133,15 @@ class ri {
|
|
|
1994
2133
|
async _getAppCheckToken() {
|
|
1995
2134
|
var e;
|
|
1996
2135
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1997
|
-
return t != null && t.error &&
|
|
2136
|
+
return t != null && t.error && si(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1998
2137
|
}
|
|
1999
2138
|
}
|
|
2000
|
-
function
|
|
2001
|
-
return
|
|
2139
|
+
function Te(n) {
|
|
2140
|
+
return q(n);
|
|
2002
2141
|
}
|
|
2003
|
-
class
|
|
2142
|
+
class at {
|
|
2004
2143
|
constructor(e) {
|
|
2005
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2144
|
+
this.auth = e, this.observer = null, this.addObserver = En((t) => this.observer = t);
|
|
2006
2145
|
}
|
|
2007
2146
|
get next() {
|
|
2008
2147
|
return u(
|
|
@@ -2029,7 +2168,7 @@ class et {
|
|
|
2029
2168
|
* See the License for the specific language governing permissions and
|
|
2030
2169
|
* limitations under the License.
|
|
2031
2170
|
*/
|
|
2032
|
-
let
|
|
2171
|
+
let Be = {
|
|
2033
2172
|
async loadJS() {
|
|
2034
2173
|
throw new Error("Unable to load external scripts");
|
|
2035
2174
|
},
|
|
@@ -2037,16 +2176,16 @@ let Fe = {
|
|
|
2037
2176
|
recaptchaEnterpriseScript: "",
|
|
2038
2177
|
gapiScript: ""
|
|
2039
2178
|
};
|
|
2040
|
-
function
|
|
2041
|
-
|
|
2179
|
+
function Ai(n) {
|
|
2180
|
+
Be = n;
|
|
2042
2181
|
}
|
|
2043
|
-
function
|
|
2044
|
-
return
|
|
2182
|
+
function Pi(n) {
|
|
2183
|
+
return Be.loadJS(n);
|
|
2045
2184
|
}
|
|
2046
|
-
function
|
|
2047
|
-
return
|
|
2185
|
+
function Ci() {
|
|
2186
|
+
return Be.gapiScript;
|
|
2048
2187
|
}
|
|
2049
|
-
function
|
|
2188
|
+
function Ni(n) {
|
|
2050
2189
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2051
2190
|
}
|
|
2052
2191
|
/**
|
|
@@ -2065,13 +2204,13 @@ function ci(n) {
|
|
|
2065
2204
|
* See the License for the specific language governing permissions and
|
|
2066
2205
|
* limitations under the License.
|
|
2067
2206
|
*/
|
|
2068
|
-
function
|
|
2069
|
-
const t =
|
|
2207
|
+
function Oi(n, e) {
|
|
2208
|
+
const t = Et(n, "auth");
|
|
2070
2209
|
if (t.isInitialized()) {
|
|
2071
2210
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2072
|
-
if (
|
|
2211
|
+
if (Rn(s, e ?? {}))
|
|
2073
2212
|
return r;
|
|
2074
|
-
|
|
2213
|
+
N(
|
|
2075
2214
|
r,
|
|
2076
2215
|
"already-initialized"
|
|
2077
2216
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2079,12 +2218,12 @@ function li(n, e) {
|
|
|
2079
2218
|
}
|
|
2080
2219
|
return t.initialize({ options: e });
|
|
2081
2220
|
}
|
|
2082
|
-
function
|
|
2083
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2221
|
+
function Li(n, e) {
|
|
2222
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(C);
|
|
2084
2223
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2085
2224
|
}
|
|
2086
|
-
function
|
|
2087
|
-
const i =
|
|
2225
|
+
function Mi(n, e, t) {
|
|
2226
|
+
const i = Te(n);
|
|
2088
2227
|
u(
|
|
2089
2228
|
i._canInitEmulator,
|
|
2090
2229
|
i,
|
|
@@ -2096,38 +2235,38 @@ function di(n, e, t) {
|
|
|
2096
2235
|
"invalid-emulator-scheme"
|
|
2097
2236
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2098
2237
|
);
|
|
2099
|
-
const r = !1, s =
|
|
2238
|
+
const r = !1, s = Bt(e), { host: o, port: c } = Ui(e), a = c === null ? "" : `:${c}`;
|
|
2100
2239
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2101
2240
|
host: o,
|
|
2102
2241
|
port: c,
|
|
2103
2242
|
protocol: s.replace(":", ""),
|
|
2104
2243
|
options: Object.freeze({ disableWarnings: r })
|
|
2105
|
-
}),
|
|
2244
|
+
}), Di();
|
|
2106
2245
|
}
|
|
2107
|
-
function
|
|
2246
|
+
function Bt(n) {
|
|
2108
2247
|
const e = n.indexOf(":");
|
|
2109
2248
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2110
2249
|
}
|
|
2111
|
-
function
|
|
2112
|
-
const e =
|
|
2250
|
+
function Ui(n) {
|
|
2251
|
+
const e = Bt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2113
2252
|
if (!t)
|
|
2114
2253
|
return { host: "", port: null };
|
|
2115
2254
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
2116
2255
|
if (r) {
|
|
2117
2256
|
const s = r[1];
|
|
2118
|
-
return { host: s, port:
|
|
2257
|
+
return { host: s, port: ct(i.substr(s.length + 1)) };
|
|
2119
2258
|
} else {
|
|
2120
2259
|
const [s, o] = i.split(":");
|
|
2121
|
-
return { host: s, port:
|
|
2260
|
+
return { host: s, port: ct(o) };
|
|
2122
2261
|
}
|
|
2123
2262
|
}
|
|
2124
|
-
function
|
|
2263
|
+
function ct(n) {
|
|
2125
2264
|
if (!n)
|
|
2126
2265
|
return null;
|
|
2127
2266
|
const e = Number(n);
|
|
2128
2267
|
return isNaN(e) ? null : e;
|
|
2129
2268
|
}
|
|
2130
|
-
function
|
|
2269
|
+
function Di() {
|
|
2131
2270
|
function n() {
|
|
2132
2271
|
const e = document.createElement("p"), t = e.style;
|
|
2133
2272
|
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);
|
|
@@ -2150,7 +2289,7 @@ function fi() {
|
|
|
2150
2289
|
* See the License for the specific language governing permissions and
|
|
2151
2290
|
* limitations under the License.
|
|
2152
2291
|
*/
|
|
2153
|
-
class
|
|
2292
|
+
class zt {
|
|
2154
2293
|
/** @internal */
|
|
2155
2294
|
constructor(e, t) {
|
|
2156
2295
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2161,19 +2300,19 @@ class xt {
|
|
|
2161
2300
|
* @returns a JSON-serializable representation of this object.
|
|
2162
2301
|
*/
|
|
2163
2302
|
toJSON() {
|
|
2164
|
-
return
|
|
2303
|
+
return A("not implemented");
|
|
2165
2304
|
}
|
|
2166
2305
|
/** @internal */
|
|
2167
2306
|
_getIdTokenResponse(e) {
|
|
2168
|
-
return
|
|
2307
|
+
return A("not implemented");
|
|
2169
2308
|
}
|
|
2170
2309
|
/** @internal */
|
|
2171
2310
|
_linkToIdToken(e, t) {
|
|
2172
|
-
return
|
|
2311
|
+
return A("not implemented");
|
|
2173
2312
|
}
|
|
2174
2313
|
/** @internal */
|
|
2175
2314
|
_getReauthenticationResolver(e) {
|
|
2176
|
-
return
|
|
2315
|
+
return A("not implemented");
|
|
2177
2316
|
}
|
|
2178
2317
|
}
|
|
2179
2318
|
/**
|
|
@@ -2192,8 +2331,8 @@ class xt {
|
|
|
2192
2331
|
* See the License for the specific language governing permissions and
|
|
2193
2332
|
* limitations under the License.
|
|
2194
2333
|
*/
|
|
2195
|
-
async function
|
|
2196
|
-
return
|
|
2334
|
+
async function z(n, e) {
|
|
2335
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", ye(n, e));
|
|
2197
2336
|
}
|
|
2198
2337
|
/**
|
|
2199
2338
|
* @license
|
|
@@ -2211,15 +2350,15 @@ async function W(n, e) {
|
|
|
2211
2350
|
* See the License for the specific language governing permissions and
|
|
2212
2351
|
* limitations under the License.
|
|
2213
2352
|
*/
|
|
2214
|
-
const
|
|
2215
|
-
class
|
|
2353
|
+
const xi = "http://localhost";
|
|
2354
|
+
class $ extends zt {
|
|
2216
2355
|
constructor() {
|
|
2217
2356
|
super(...arguments), this.pendingToken = null;
|
|
2218
2357
|
}
|
|
2219
2358
|
/** @internal */
|
|
2220
2359
|
static _fromParams(e) {
|
|
2221
|
-
const t = new
|
|
2222
|
-
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) :
|
|
2360
|
+
const t = new $(e.providerId, e.signInMethod);
|
|
2361
|
+
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) : N(
|
|
2223
2362
|
"argument-error"
|
|
2224
2363
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2225
2364
|
), t;
|
|
@@ -2246,37 +2385,37 @@ class D extends xt {
|
|
|
2246
2385
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
|
2247
2386
|
*/
|
|
2248
2387
|
static fromJSON(e) {
|
|
2249
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s =
|
|
2388
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2250
2389
|
if (!i || !r)
|
|
2251
2390
|
return null;
|
|
2252
|
-
const o = new
|
|
2391
|
+
const o = new $(i, r);
|
|
2253
2392
|
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;
|
|
2254
2393
|
}
|
|
2255
2394
|
/** @internal */
|
|
2256
2395
|
_getIdTokenResponse(e) {
|
|
2257
2396
|
const t = this.buildRequest();
|
|
2258
|
-
return
|
|
2397
|
+
return z(e, t);
|
|
2259
2398
|
}
|
|
2260
2399
|
/** @internal */
|
|
2261
2400
|
_linkToIdToken(e, t) {
|
|
2262
2401
|
const i = this.buildRequest();
|
|
2263
|
-
return i.idToken = t,
|
|
2402
|
+
return i.idToken = t, z(e, i);
|
|
2264
2403
|
}
|
|
2265
2404
|
/** @internal */
|
|
2266
2405
|
_getReauthenticationResolver(e) {
|
|
2267
2406
|
const t = this.buildRequest();
|
|
2268
|
-
return t.autoCreate = !1,
|
|
2407
|
+
return t.autoCreate = !1, z(e, t);
|
|
2269
2408
|
}
|
|
2270
2409
|
buildRequest() {
|
|
2271
2410
|
const e = {
|
|
2272
|
-
requestUri:
|
|
2411
|
+
requestUri: xi,
|
|
2273
2412
|
returnSecureToken: !0
|
|
2274
2413
|
};
|
|
2275
2414
|
if (this.pendingToken)
|
|
2276
2415
|
e.pendingToken = this.pendingToken;
|
|
2277
2416
|
else {
|
|
2278
2417
|
const t = {};
|
|
2279
|
-
this.idToken && (t.id_token = this.idToken), this.accessToken && (t.access_token = this.accessToken), this.secret && (t.oauth_token_secret = this.secret), t.providerId = this.providerId, this.nonce && !this.pendingToken && (t.nonce = this.nonce), e.postBody =
|
|
2418
|
+
this.idToken && (t.id_token = this.idToken), this.accessToken && (t.access_token = this.accessToken), this.secret && (t.oauth_token_secret = this.secret), t.providerId = this.providerId, this.nonce && !this.pendingToken && (t.nonce = this.nonce), e.postBody = ie(t);
|
|
2280
2419
|
}
|
|
2281
2420
|
return e;
|
|
2282
2421
|
}
|
|
@@ -2297,7 +2436,7 @@ class D extends xt {
|
|
|
2297
2436
|
* See the License for the specific language governing permissions and
|
|
2298
2437
|
* limitations under the License.
|
|
2299
2438
|
*/
|
|
2300
|
-
class
|
|
2439
|
+
class qt {
|
|
2301
2440
|
/**
|
|
2302
2441
|
* Constructor for generic OAuth providers.
|
|
2303
2442
|
*
|
|
@@ -2350,7 +2489,7 @@ class Vt {
|
|
|
2350
2489
|
* See the License for the specific language governing permissions and
|
|
2351
2490
|
* limitations under the License.
|
|
2352
2491
|
*/
|
|
2353
|
-
class
|
|
2492
|
+
class se extends qt {
|
|
2354
2493
|
constructor() {
|
|
2355
2494
|
super(...arguments), this.scopes = [];
|
|
2356
2495
|
}
|
|
@@ -2385,7 +2524,7 @@ class Q extends Vt {
|
|
|
2385
2524
|
* See the License for the specific language governing permissions and
|
|
2386
2525
|
* limitations under the License.
|
|
2387
2526
|
*/
|
|
2388
|
-
class
|
|
2527
|
+
class M extends se {
|
|
2389
2528
|
constructor() {
|
|
2390
2529
|
super(
|
|
2391
2530
|
"facebook.com"
|
|
@@ -2405,9 +2544,9 @@ class C extends Q {
|
|
|
2405
2544
|
* @param accessToken - Facebook access token.
|
|
2406
2545
|
*/
|
|
2407
2546
|
static credential(e) {
|
|
2408
|
-
return
|
|
2409
|
-
providerId:
|
|
2410
|
-
signInMethod:
|
|
2547
|
+
return $._fromParams({
|
|
2548
|
+
providerId: M.PROVIDER_ID,
|
|
2549
|
+
signInMethod: M.FACEBOOK_SIGN_IN_METHOD,
|
|
2411
2550
|
accessToken: e
|
|
2412
2551
|
});
|
|
2413
2552
|
}
|
|
@@ -2417,7 +2556,7 @@ class C extends Q {
|
|
|
2417
2556
|
* @param userCredential - The user credential.
|
|
2418
2557
|
*/
|
|
2419
2558
|
static credentialFromResult(e) {
|
|
2420
|
-
return
|
|
2559
|
+
return M.credentialFromTaggedObject(e);
|
|
2421
2560
|
}
|
|
2422
2561
|
/**
|
|
2423
2562
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2426,20 +2565,20 @@ class C extends Q {
|
|
|
2426
2565
|
* @param userCredential - The user credential.
|
|
2427
2566
|
*/
|
|
2428
2567
|
static credentialFromError(e) {
|
|
2429
|
-
return
|
|
2568
|
+
return M.credentialFromTaggedObject(e.customData || {});
|
|
2430
2569
|
}
|
|
2431
2570
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2432
2571
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2433
2572
|
return null;
|
|
2434
2573
|
try {
|
|
2435
|
-
return
|
|
2574
|
+
return M.credential(e.oauthAccessToken);
|
|
2436
2575
|
} catch {
|
|
2437
2576
|
return null;
|
|
2438
2577
|
}
|
|
2439
2578
|
}
|
|
2440
2579
|
}
|
|
2441
|
-
|
|
2442
|
-
|
|
2580
|
+
M.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
2581
|
+
M.PROVIDER_ID = "facebook.com";
|
|
2443
2582
|
/**
|
|
2444
2583
|
* @license
|
|
2445
2584
|
* Copyright 2020 Google LLC
|
|
@@ -2456,7 +2595,7 @@ C.PROVIDER_ID = "facebook.com";
|
|
|
2456
2595
|
* See the License for the specific language governing permissions and
|
|
2457
2596
|
* limitations under the License.
|
|
2458
2597
|
*/
|
|
2459
|
-
class
|
|
2598
|
+
class U extends se {
|
|
2460
2599
|
constructor() {
|
|
2461
2600
|
super(
|
|
2462
2601
|
"google.com"
|
|
@@ -2477,9 +2616,9 @@ class O extends Q {
|
|
|
2477
2616
|
* @param accessToken - Google access token.
|
|
2478
2617
|
*/
|
|
2479
2618
|
static credential(e, t) {
|
|
2480
|
-
return
|
|
2481
|
-
providerId:
|
|
2482
|
-
signInMethod:
|
|
2619
|
+
return $._fromParams({
|
|
2620
|
+
providerId: U.PROVIDER_ID,
|
|
2621
|
+
signInMethod: U.GOOGLE_SIGN_IN_METHOD,
|
|
2483
2622
|
idToken: e,
|
|
2484
2623
|
accessToken: t
|
|
2485
2624
|
});
|
|
@@ -2490,7 +2629,7 @@ class O extends Q {
|
|
|
2490
2629
|
* @param userCredential - The user credential.
|
|
2491
2630
|
*/
|
|
2492
2631
|
static credentialFromResult(e) {
|
|
2493
|
-
return
|
|
2632
|
+
return U.credentialFromTaggedObject(e);
|
|
2494
2633
|
}
|
|
2495
2634
|
/**
|
|
2496
2635
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2499,7 +2638,7 @@ class O extends Q {
|
|
|
2499
2638
|
* @param userCredential - The user credential.
|
|
2500
2639
|
*/
|
|
2501
2640
|
static credentialFromError(e) {
|
|
2502
|
-
return
|
|
2641
|
+
return U.credentialFromTaggedObject(e.customData || {});
|
|
2503
2642
|
}
|
|
2504
2643
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2505
2644
|
if (!e)
|
|
@@ -2508,14 +2647,14 @@ class O extends Q {
|
|
|
2508
2647
|
if (!t && !i)
|
|
2509
2648
|
return null;
|
|
2510
2649
|
try {
|
|
2511
|
-
return
|
|
2650
|
+
return U.credential(t, i);
|
|
2512
2651
|
} catch {
|
|
2513
2652
|
return null;
|
|
2514
2653
|
}
|
|
2515
2654
|
}
|
|
2516
2655
|
}
|
|
2517
|
-
|
|
2518
|
-
|
|
2656
|
+
U.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2657
|
+
U.PROVIDER_ID = "google.com";
|
|
2519
2658
|
/**
|
|
2520
2659
|
* @license
|
|
2521
2660
|
* Copyright 2020 Google LLC
|
|
@@ -2532,7 +2671,7 @@ O.PROVIDER_ID = "google.com";
|
|
|
2532
2671
|
* See the License for the specific language governing permissions and
|
|
2533
2672
|
* limitations under the License.
|
|
2534
2673
|
*/
|
|
2535
|
-
class
|
|
2674
|
+
class D extends se {
|
|
2536
2675
|
constructor() {
|
|
2537
2676
|
super(
|
|
2538
2677
|
"github.com"
|
|
@@ -2545,9 +2684,9 @@ class N extends Q {
|
|
|
2545
2684
|
* @param accessToken - Github access token.
|
|
2546
2685
|
*/
|
|
2547
2686
|
static credential(e) {
|
|
2548
|
-
return
|
|
2549
|
-
providerId:
|
|
2550
|
-
signInMethod:
|
|
2687
|
+
return $._fromParams({
|
|
2688
|
+
providerId: D.PROVIDER_ID,
|
|
2689
|
+
signInMethod: D.GITHUB_SIGN_IN_METHOD,
|
|
2551
2690
|
accessToken: e
|
|
2552
2691
|
});
|
|
2553
2692
|
}
|
|
@@ -2557,7 +2696,7 @@ class N extends Q {
|
|
|
2557
2696
|
* @param userCredential - The user credential.
|
|
2558
2697
|
*/
|
|
2559
2698
|
static credentialFromResult(e) {
|
|
2560
|
-
return
|
|
2699
|
+
return D.credentialFromTaggedObject(e);
|
|
2561
2700
|
}
|
|
2562
2701
|
/**
|
|
2563
2702
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2566,20 +2705,20 @@ class N extends Q {
|
|
|
2566
2705
|
* @param userCredential - The user credential.
|
|
2567
2706
|
*/
|
|
2568
2707
|
static credentialFromError(e) {
|
|
2569
|
-
return
|
|
2708
|
+
return D.credentialFromTaggedObject(e.customData || {});
|
|
2570
2709
|
}
|
|
2571
2710
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2572
2711
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2573
2712
|
return null;
|
|
2574
2713
|
try {
|
|
2575
|
-
return
|
|
2714
|
+
return D.credential(e.oauthAccessToken);
|
|
2576
2715
|
} catch {
|
|
2577
2716
|
return null;
|
|
2578
2717
|
}
|
|
2579
2718
|
}
|
|
2580
2719
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2720
|
+
D.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2721
|
+
D.PROVIDER_ID = "github.com";
|
|
2583
2722
|
/**
|
|
2584
2723
|
* @license
|
|
2585
2724
|
* Copyright 2020 Google LLC
|
|
@@ -2596,7 +2735,7 @@ N.PROVIDER_ID = "github.com";
|
|
|
2596
2735
|
* See the License for the specific language governing permissions and
|
|
2597
2736
|
* limitations under the License.
|
|
2598
2737
|
*/
|
|
2599
|
-
class
|
|
2738
|
+
class x extends se {
|
|
2600
2739
|
constructor() {
|
|
2601
2740
|
super(
|
|
2602
2741
|
"twitter.com"
|
|
@@ -2610,9 +2749,9 @@ class L extends Q {
|
|
|
2610
2749
|
* @param secret - Twitter secret.
|
|
2611
2750
|
*/
|
|
2612
2751
|
static credential(e, t) {
|
|
2613
|
-
return
|
|
2614
|
-
providerId:
|
|
2615
|
-
signInMethod:
|
|
2752
|
+
return $._fromParams({
|
|
2753
|
+
providerId: x.PROVIDER_ID,
|
|
2754
|
+
signInMethod: x.TWITTER_SIGN_IN_METHOD,
|
|
2616
2755
|
oauthToken: e,
|
|
2617
2756
|
oauthTokenSecret: t
|
|
2618
2757
|
});
|
|
@@ -2623,7 +2762,7 @@ class L extends Q {
|
|
|
2623
2762
|
* @param userCredential - The user credential.
|
|
2624
2763
|
*/
|
|
2625
2764
|
static credentialFromResult(e) {
|
|
2626
|
-
return
|
|
2765
|
+
return x.credentialFromTaggedObject(e);
|
|
2627
2766
|
}
|
|
2628
2767
|
/**
|
|
2629
2768
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2632,7 +2771,7 @@ class L extends Q {
|
|
|
2632
2771
|
* @param userCredential - The user credential.
|
|
2633
2772
|
*/
|
|
2634
2773
|
static credentialFromError(e) {
|
|
2635
|
-
return
|
|
2774
|
+
return x.credentialFromTaggedObject(e.customData || {});
|
|
2636
2775
|
}
|
|
2637
2776
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2638
2777
|
if (!e)
|
|
@@ -2641,14 +2780,14 @@ class L extends Q {
|
|
|
2641
2780
|
if (!t || !i)
|
|
2642
2781
|
return null;
|
|
2643
2782
|
try {
|
|
2644
|
-
return
|
|
2783
|
+
return x.credential(t, i);
|
|
2645
2784
|
} catch {
|
|
2646
2785
|
return null;
|
|
2647
2786
|
}
|
|
2648
2787
|
}
|
|
2649
2788
|
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2789
|
+
x.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
2790
|
+
x.PROVIDER_ID = "twitter.com";
|
|
2652
2791
|
/**
|
|
2653
2792
|
* @license
|
|
2654
2793
|
* Copyright 2020 Google LLC
|
|
@@ -2665,13 +2804,13 @@ L.PROVIDER_ID = "twitter.com";
|
|
|
2665
2804
|
* See the License for the specific language governing permissions and
|
|
2666
2805
|
* limitations under the License.
|
|
2667
2806
|
*/
|
|
2668
|
-
class
|
|
2807
|
+
class H {
|
|
2669
2808
|
constructor(e) {
|
|
2670
2809
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2671
2810
|
}
|
|
2672
2811
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2673
|
-
const s = await
|
|
2674
|
-
return new
|
|
2812
|
+
const s = await P._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2813
|
+
return new H({
|
|
2675
2814
|
user: s,
|
|
2676
2815
|
providerId: o,
|
|
2677
2816
|
_tokenResponse: i,
|
|
@@ -2684,8 +2823,8 @@ class F {
|
|
|
2684
2823
|
/* reload */
|
|
2685
2824
|
!0
|
|
2686
2825
|
);
|
|
2687
|
-
const r =
|
|
2688
|
-
return new
|
|
2826
|
+
const r = lt(i);
|
|
2827
|
+
return new H({
|
|
2689
2828
|
user: e,
|
|
2690
2829
|
providerId: r,
|
|
2691
2830
|
_tokenResponse: i,
|
|
@@ -2693,7 +2832,7 @@ class F {
|
|
|
2693
2832
|
});
|
|
2694
2833
|
}
|
|
2695
2834
|
}
|
|
2696
|
-
function
|
|
2835
|
+
function lt(n) {
|
|
2697
2836
|
return n.providerId ? n.providerId : "phoneNumber" in n ? "phone" : null;
|
|
2698
2837
|
}
|
|
2699
2838
|
/**
|
|
@@ -2712,10 +2851,10 @@ function nt(n) {
|
|
|
2712
2851
|
* See the License for the specific language governing permissions and
|
|
2713
2852
|
* limitations under the License.
|
|
2714
2853
|
*/
|
|
2715
|
-
class
|
|
2854
|
+
class _e extends Ve {
|
|
2716
2855
|
constructor(e, t, i, r) {
|
|
2717
2856
|
var s;
|
|
2718
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2857
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, _e.prototype), this.customData = {
|
|
2719
2858
|
appName: e.name,
|
|
2720
2859
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2721
2860
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2723,17 +2862,17 @@ class ue extends Oe {
|
|
|
2723
2862
|
};
|
|
2724
2863
|
}
|
|
2725
2864
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2726
|
-
return new
|
|
2865
|
+
return new _e(e, t, i, r);
|
|
2727
2866
|
}
|
|
2728
2867
|
}
|
|
2729
|
-
function
|
|
2868
|
+
function Kt(n, e, t, i) {
|
|
2730
2869
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2731
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2870
|
+
throw s.code === "auth/multi-factor-auth-required" ? _e._fromErrorAndOperation(n, s, e, i) : s;
|
|
2732
2871
|
});
|
|
2733
2872
|
}
|
|
2734
|
-
async function
|
|
2735
|
-
const i = await
|
|
2736
|
-
return
|
|
2873
|
+
async function Fi(n, e, t = !1) {
|
|
2874
|
+
const i = await te(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2875
|
+
return H._forOperation(n, "link", i);
|
|
2737
2876
|
}
|
|
2738
2877
|
/**
|
|
2739
2878
|
* @license
|
|
@@ -2751,20 +2890,20 @@ async function mi(n, e, t = !1) {
|
|
|
2751
2890
|
* See the License for the specific language governing permissions and
|
|
2752
2891
|
* limitations under the License.
|
|
2753
2892
|
*/
|
|
2754
|
-
async function
|
|
2893
|
+
async function Vi(n, e, t = !1) {
|
|
2755
2894
|
const { auth: i } = n;
|
|
2756
|
-
if (
|
|
2757
|
-
return Promise.reject(
|
|
2895
|
+
if (R(i.app))
|
|
2896
|
+
return Promise.reject(F(i));
|
|
2758
2897
|
const r = "reauthenticate";
|
|
2759
2898
|
try {
|
|
2760
|
-
const s = await
|
|
2899
|
+
const s = await te(n, Kt(i, r, e, n), t);
|
|
2761
2900
|
u(
|
|
2762
2901
|
s.idToken,
|
|
2763
2902
|
i,
|
|
2764
2903
|
"internal-error"
|
|
2765
2904
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2766
2905
|
);
|
|
2767
|
-
const o =
|
|
2906
|
+
const o = We(s.idToken);
|
|
2768
2907
|
u(
|
|
2769
2908
|
o,
|
|
2770
2909
|
i,
|
|
@@ -2777,9 +2916,9 @@ async function gi(n, e, t = !1) {
|
|
|
2777
2916
|
i,
|
|
2778
2917
|
"user-mismatch"
|
|
2779
2918
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2780
|
-
),
|
|
2919
|
+
), H._forOperation(n, r, s);
|
|
2781
2920
|
} catch (s) {
|
|
2782
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2921
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && N(
|
|
2783
2922
|
i,
|
|
2784
2923
|
"user-mismatch"
|
|
2785
2924
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2802,10 +2941,10 @@ async function gi(n, e, t = !1) {
|
|
|
2802
2941
|
* See the License for the specific language governing permissions and
|
|
2803
2942
|
* limitations under the License.
|
|
2804
2943
|
*/
|
|
2805
|
-
async function
|
|
2806
|
-
if (
|
|
2807
|
-
return Promise.reject(
|
|
2808
|
-
const i = "signIn", r = await
|
|
2944
|
+
async function $i(n, e, t = !1) {
|
|
2945
|
+
if (R(n.app))
|
|
2946
|
+
return Promise.reject(F(n));
|
|
2947
|
+
const i = "signIn", r = await Kt(n, i, e), s = await H._fromIdTokenResponse(n, i, r);
|
|
2809
2948
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2810
2949
|
}
|
|
2811
2950
|
/**
|
|
@@ -2824,8 +2963,8 @@ async function _i(n, e, t = !1) {
|
|
|
2824
2963
|
* See the License for the specific language governing permissions and
|
|
2825
2964
|
* limitations under the License.
|
|
2826
2965
|
*/
|
|
2827
|
-
async function
|
|
2828
|
-
return
|
|
2966
|
+
async function Hi(n, e) {
|
|
2967
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", ye(n, e));
|
|
2829
2968
|
}
|
|
2830
2969
|
/**
|
|
2831
2970
|
* @license
|
|
@@ -2843,22 +2982,22 @@ async function vi(n, e) {
|
|
|
2843
2982
|
* See the License for the specific language governing permissions and
|
|
2844
2983
|
* limitations under the License.
|
|
2845
2984
|
*/
|
|
2846
|
-
async function
|
|
2847
|
-
if (
|
|
2848
|
-
return Promise.reject(
|
|
2849
|
-
const t =
|
|
2985
|
+
async function ji(n, e) {
|
|
2986
|
+
if (R(n.app))
|
|
2987
|
+
return Promise.reject(F(n));
|
|
2988
|
+
const t = Te(n), i = await Hi(t, {
|
|
2850
2989
|
token: e,
|
|
2851
2990
|
returnSecureToken: !0
|
|
2852
|
-
}), r = await
|
|
2991
|
+
}), r = await H._fromIdTokenResponse(t, "signIn", i);
|
|
2853
2992
|
return await t._updateCurrentUser(r.user), r;
|
|
2854
2993
|
}
|
|
2855
|
-
function
|
|
2856
|
-
return
|
|
2994
|
+
function Wi(n, e, t, i) {
|
|
2995
|
+
return q(n).onIdTokenChanged(e, t, i);
|
|
2857
2996
|
}
|
|
2858
|
-
function
|
|
2859
|
-
return
|
|
2997
|
+
function Gi(n, e, t) {
|
|
2998
|
+
return q(n).beforeAuthStateChanged(e, t);
|
|
2860
2999
|
}
|
|
2861
|
-
const
|
|
3000
|
+
const ve = "__sak";
|
|
2862
3001
|
/**
|
|
2863
3002
|
* @license
|
|
2864
3003
|
* Copyright 2019 Google LLC
|
|
@@ -2875,13 +3014,13 @@ const de = "__sak";
|
|
|
2875
3014
|
* See the License for the specific language governing permissions and
|
|
2876
3015
|
* limitations under the License.
|
|
2877
3016
|
*/
|
|
2878
|
-
class
|
|
3017
|
+
class Jt {
|
|
2879
3018
|
constructor(e, t) {
|
|
2880
3019
|
this.storageRetriever = e, this.type = t;
|
|
2881
3020
|
}
|
|
2882
3021
|
_isAvailable() {
|
|
2883
3022
|
try {
|
|
2884
|
-
return this.storage ? (this.storage.setItem(
|
|
3023
|
+
return this.storage ? (this.storage.setItem(ve, "1"), this.storage.removeItem(ve), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2885
3024
|
} catch {
|
|
2886
3025
|
return Promise.resolve(!1);
|
|
2887
3026
|
}
|
|
@@ -2916,18 +3055,18 @@ class Ht {
|
|
|
2916
3055
|
* See the License for the specific language governing permissions and
|
|
2917
3056
|
* limitations under the License.
|
|
2918
3057
|
*/
|
|
2919
|
-
function
|
|
2920
|
-
const n =
|
|
2921
|
-
return
|
|
3058
|
+
function Bi() {
|
|
3059
|
+
const n = y();
|
|
3060
|
+
return Ge(n) || we(n);
|
|
2922
3061
|
}
|
|
2923
|
-
const
|
|
2924
|
-
class
|
|
3062
|
+
const zi = 1e3, qi = 10;
|
|
3063
|
+
class Yt extends Jt {
|
|
2925
3064
|
constructor() {
|
|
2926
3065
|
super(
|
|
2927
3066
|
() => window.localStorage,
|
|
2928
3067
|
"LOCAL"
|
|
2929
3068
|
/* PersistenceType.LOCAL */
|
|
2930
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3069
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = Bi() && Ti(), this.fallbackToPolling = Wt(), this._shouldAllowMigration = !0;
|
|
2931
3070
|
}
|
|
2932
3071
|
forAllChangedKeys(e) {
|
|
2933
3072
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2954,7 +3093,7 @@ class Wt extends Ht {
|
|
|
2954
3093
|
const o = this.storage.getItem(i);
|
|
2955
3094
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2956
3095
|
}, s = this.storage.getItem(i);
|
|
2957
|
-
|
|
3096
|
+
wi() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, qi) : r();
|
|
2958
3097
|
}
|
|
2959
3098
|
notifyListeners(e, t) {
|
|
2960
3099
|
this.localCache[e] = t;
|
|
@@ -2976,7 +3115,7 @@ class Wt extends Ht {
|
|
|
2976
3115
|
!0
|
|
2977
3116
|
);
|
|
2978
3117
|
});
|
|
2979
|
-
},
|
|
3118
|
+
}, zi);
|
|
2980
3119
|
}
|
|
2981
3120
|
stopPolling() {
|
|
2982
3121
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3005,8 +3144,8 @@ class Wt extends Ht {
|
|
|
3005
3144
|
await super._remove(e), delete this.localCache[e];
|
|
3006
3145
|
}
|
|
3007
3146
|
}
|
|
3008
|
-
|
|
3009
|
-
const
|
|
3147
|
+
Yt.type = "LOCAL";
|
|
3148
|
+
const Ki = Yt;
|
|
3010
3149
|
/**
|
|
3011
3150
|
* @license
|
|
3012
3151
|
* Copyright 2020 Google LLC
|
|
@@ -3023,7 +3162,7 @@ const bi = Wt;
|
|
|
3023
3162
|
* See the License for the specific language governing permissions and
|
|
3024
3163
|
* limitations under the License.
|
|
3025
3164
|
*/
|
|
3026
|
-
class
|
|
3165
|
+
class Xt extends Jt {
|
|
3027
3166
|
constructor() {
|
|
3028
3167
|
super(
|
|
3029
3168
|
() => window.sessionStorage,
|
|
@@ -3036,8 +3175,8 @@ class jt extends Ht {
|
|
|
3036
3175
|
_removeListener(e, t) {
|
|
3037
3176
|
}
|
|
3038
3177
|
}
|
|
3039
|
-
|
|
3040
|
-
const
|
|
3178
|
+
Xt.type = "SESSION";
|
|
3179
|
+
const Qt = Xt;
|
|
3041
3180
|
/**
|
|
3042
3181
|
* @license
|
|
3043
3182
|
* Copyright 2019 Google LLC
|
|
@@ -3054,7 +3193,7 @@ const Gt = jt;
|
|
|
3054
3193
|
* See the License for the specific language governing permissions and
|
|
3055
3194
|
* limitations under the License.
|
|
3056
3195
|
*/
|
|
3057
|
-
function
|
|
3196
|
+
function Ji(n) {
|
|
3058
3197
|
return Promise.all(n.map(async (e) => {
|
|
3059
3198
|
try {
|
|
3060
3199
|
return {
|
|
@@ -3085,7 +3224,7 @@ function Si(n) {
|
|
|
3085
3224
|
* See the License for the specific language governing permissions and
|
|
3086
3225
|
* limitations under the License.
|
|
3087
3226
|
*/
|
|
3088
|
-
class
|
|
3227
|
+
class ke {
|
|
3089
3228
|
constructor(e) {
|
|
3090
3229
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3091
3230
|
}
|
|
@@ -3099,7 +3238,7 @@ class ge {
|
|
|
3099
3238
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3100
3239
|
if (t)
|
|
3101
3240
|
return t;
|
|
3102
|
-
const i = new
|
|
3241
|
+
const i = new ke(e);
|
|
3103
3242
|
return this.receivers.push(i), i;
|
|
3104
3243
|
}
|
|
3105
3244
|
isListeningto(e) {
|
|
@@ -3124,7 +3263,7 @@ class ge {
|
|
|
3124
3263
|
eventId: i,
|
|
3125
3264
|
eventType: r
|
|
3126
3265
|
});
|
|
3127
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3266
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Ji(c);
|
|
3128
3267
|
t.ports[0].postMessage({
|
|
3129
3268
|
status: "done",
|
|
3130
3269
|
eventId: i,
|
|
@@ -3153,7 +3292,7 @@ class ge {
|
|
|
3153
3292
|
this.handlersMap[e] && t && this.handlersMap[e].delete(t), (!t || this.handlersMap[e].size === 0) && delete this.handlersMap[e], Object.keys(this.handlersMap).length === 0 && this.eventTarget.removeEventListener("message", this.boundEventHandler);
|
|
3154
3293
|
}
|
|
3155
3294
|
}
|
|
3156
|
-
|
|
3295
|
+
ke.receivers = [];
|
|
3157
3296
|
/**
|
|
3158
3297
|
* @license
|
|
3159
3298
|
* Copyright 2020 Google LLC
|
|
@@ -3170,7 +3309,7 @@ ge.receivers = [];
|
|
|
3170
3309
|
* See the License for the specific language governing permissions and
|
|
3171
3310
|
* limitations under the License.
|
|
3172
3311
|
*/
|
|
3173
|
-
function
|
|
3312
|
+
function ze(n = "", e = 10) {
|
|
3174
3313
|
let t = "";
|
|
3175
3314
|
for (let i = 0; i < e; i++)
|
|
3176
3315
|
t += Math.floor(Math.random() * 10);
|
|
@@ -3192,7 +3331,7 @@ function xe(n = "", e = 10) {
|
|
|
3192
3331
|
* See the License for the specific language governing permissions and
|
|
3193
3332
|
* limitations under the License.
|
|
3194
3333
|
*/
|
|
3195
|
-
class
|
|
3334
|
+
class Yi {
|
|
3196
3335
|
constructor(e) {
|
|
3197
3336
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3198
3337
|
}
|
|
@@ -3226,7 +3365,7 @@ class Ri {
|
|
|
3226
3365
|
);
|
|
3227
3366
|
let s, o;
|
|
3228
3367
|
return new Promise((c, a) => {
|
|
3229
|
-
const l =
|
|
3368
|
+
const l = ze("", 20);
|
|
3230
3369
|
r.port1.start();
|
|
3231
3370
|
const d = setTimeout(() => {
|
|
3232
3371
|
a(new Error(
|
|
@@ -3289,11 +3428,11 @@ class Ri {
|
|
|
3289
3428
|
* See the License for the specific language governing permissions and
|
|
3290
3429
|
* limitations under the License.
|
|
3291
3430
|
*/
|
|
3292
|
-
function
|
|
3431
|
+
function E() {
|
|
3293
3432
|
return window;
|
|
3294
3433
|
}
|
|
3295
|
-
function
|
|
3296
|
-
|
|
3434
|
+
function Xi(n) {
|
|
3435
|
+
E().location.href = n;
|
|
3297
3436
|
}
|
|
3298
3437
|
/**
|
|
3299
3438
|
* @license
|
|
@@ -3311,10 +3450,10 @@ function Ai(n) {
|
|
|
3311
3450
|
* See the License for the specific language governing permissions and
|
|
3312
3451
|
* limitations under the License.
|
|
3313
3452
|
*/
|
|
3314
|
-
function
|
|
3315
|
-
return typeof
|
|
3453
|
+
function Zt() {
|
|
3454
|
+
return typeof E().WorkerGlobalScope < "u" && typeof E().importScripts == "function";
|
|
3316
3455
|
}
|
|
3317
|
-
async function
|
|
3456
|
+
async function Qi() {
|
|
3318
3457
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3319
3458
|
return null;
|
|
3320
3459
|
try {
|
|
@@ -3323,12 +3462,12 @@ async function Pi() {
|
|
|
3323
3462
|
return null;
|
|
3324
3463
|
}
|
|
3325
3464
|
}
|
|
3326
|
-
function
|
|
3465
|
+
function Zi() {
|
|
3327
3466
|
var n;
|
|
3328
3467
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3329
3468
|
}
|
|
3330
|
-
function
|
|
3331
|
-
return
|
|
3469
|
+
function er() {
|
|
3470
|
+
return Zt() ? self : null;
|
|
3332
3471
|
}
|
|
3333
3472
|
/**
|
|
3334
3473
|
* @license
|
|
@@ -3346,8 +3485,8 @@ function Oi() {
|
|
|
3346
3485
|
* See the License for the specific language governing permissions and
|
|
3347
3486
|
* limitations under the License.
|
|
3348
3487
|
*/
|
|
3349
|
-
const
|
|
3350
|
-
class
|
|
3488
|
+
const en = "firebaseLocalStorageDb", tr = 1, Ie = "firebaseLocalStorage", tn = "fbase_key";
|
|
3489
|
+
class oe {
|
|
3351
3490
|
constructor(e) {
|
|
3352
3491
|
this.request = e;
|
|
3353
3492
|
}
|
|
@@ -3361,55 +3500,55 @@ class Z {
|
|
|
3361
3500
|
});
|
|
3362
3501
|
}
|
|
3363
3502
|
}
|
|
3364
|
-
function
|
|
3365
|
-
return n.transaction([
|
|
3503
|
+
function Ee(n, e) {
|
|
3504
|
+
return n.transaction([Ie], e ? "readwrite" : "readonly").objectStore(Ie);
|
|
3366
3505
|
}
|
|
3367
|
-
function
|
|
3368
|
-
const n = indexedDB.deleteDatabase(
|
|
3369
|
-
return new
|
|
3506
|
+
function nr() {
|
|
3507
|
+
const n = indexedDB.deleteDatabase(en);
|
|
3508
|
+
return new oe(n).toPromise();
|
|
3370
3509
|
}
|
|
3371
|
-
function
|
|
3372
|
-
const n = indexedDB.open(
|
|
3510
|
+
function Ue() {
|
|
3511
|
+
const n = indexedDB.open(en, tr);
|
|
3373
3512
|
return new Promise((e, t) => {
|
|
3374
3513
|
n.addEventListener("error", () => {
|
|
3375
3514
|
t(n.error);
|
|
3376
3515
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3377
3516
|
const i = n.result;
|
|
3378
3517
|
try {
|
|
3379
|
-
i.createObjectStore(
|
|
3518
|
+
i.createObjectStore(Ie, { keyPath: tn });
|
|
3380
3519
|
} catch (r) {
|
|
3381
3520
|
t(r);
|
|
3382
3521
|
}
|
|
3383
3522
|
}), n.addEventListener("success", async () => {
|
|
3384
3523
|
const i = n.result;
|
|
3385
|
-
i.objectStoreNames.contains(
|
|
3524
|
+
i.objectStoreNames.contains(Ie) ? e(i) : (i.close(), await nr(), e(await Ue()));
|
|
3386
3525
|
});
|
|
3387
3526
|
});
|
|
3388
3527
|
}
|
|
3389
|
-
async function
|
|
3390
|
-
const i =
|
|
3391
|
-
[
|
|
3528
|
+
async function ut(n, e, t) {
|
|
3529
|
+
const i = Ee(n, !0).put({
|
|
3530
|
+
[tn]: e,
|
|
3392
3531
|
value: t
|
|
3393
3532
|
});
|
|
3394
|
-
return new
|
|
3533
|
+
return new oe(i).toPromise();
|
|
3395
3534
|
}
|
|
3396
|
-
async function
|
|
3397
|
-
const t =
|
|
3535
|
+
async function ir(n, e) {
|
|
3536
|
+
const t = Ee(n, !1).get(e), i = await new oe(t).toPromise();
|
|
3398
3537
|
return i === void 0 ? null : i.value;
|
|
3399
3538
|
}
|
|
3400
|
-
function
|
|
3401
|
-
const t =
|
|
3402
|
-
return new
|
|
3539
|
+
function dt(n, e) {
|
|
3540
|
+
const t = Ee(n, !0).delete(e);
|
|
3541
|
+
return new oe(t).toPromise();
|
|
3403
3542
|
}
|
|
3404
|
-
const
|
|
3405
|
-
class
|
|
3543
|
+
const rr = 800, sr = 3;
|
|
3544
|
+
class nn {
|
|
3406
3545
|
constructor() {
|
|
3407
3546
|
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(() => {
|
|
3408
3547
|
}, () => {
|
|
3409
3548
|
});
|
|
3410
3549
|
}
|
|
3411
3550
|
async _openDb() {
|
|
3412
|
-
return this.db ? this.db : (this.db = await
|
|
3551
|
+
return this.db ? this.db : (this.db = await Ue(), this.db);
|
|
3413
3552
|
}
|
|
3414
3553
|
async _withRetries(e) {
|
|
3415
3554
|
let t = 0;
|
|
@@ -3418,7 +3557,7 @@ class Kt {
|
|
|
3418
3557
|
const i = await this._openDb();
|
|
3419
3558
|
return await e(i);
|
|
3420
3559
|
} catch (i) {
|
|
3421
|
-
if (t++ >
|
|
3560
|
+
if (t++ > sr)
|
|
3422
3561
|
throw i;
|
|
3423
3562
|
this.db && (this.db.close(), this.db = void 0);
|
|
3424
3563
|
}
|
|
@@ -3428,13 +3567,13 @@ class Kt {
|
|
|
3428
3567
|
* postMessage interface to send these events to the worker ourselves.
|
|
3429
3568
|
*/
|
|
3430
3569
|
async initializeServiceWorkerMessaging() {
|
|
3431
|
-
return
|
|
3570
|
+
return Zt() ? this.initializeReceiver() : this.initializeSender();
|
|
3432
3571
|
}
|
|
3433
3572
|
/**
|
|
3434
3573
|
* As the worker we should listen to events from the main window.
|
|
3435
3574
|
*/
|
|
3436
3575
|
async initializeReceiver() {
|
|
3437
|
-
this.receiver =
|
|
3576
|
+
this.receiver = ke._getInstance(er()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3438
3577
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3439
3578
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3440
3579
|
"keyChanged"
|
|
@@ -3450,9 +3589,9 @@ class Kt {
|
|
|
3450
3589
|
*/
|
|
3451
3590
|
async initializeSender() {
|
|
3452
3591
|
var e, t;
|
|
3453
|
-
if (this.activeServiceWorker = await
|
|
3592
|
+
if (this.activeServiceWorker = await Qi(), !this.activeServiceWorker)
|
|
3454
3593
|
return;
|
|
3455
|
-
this.sender = new
|
|
3594
|
+
this.sender = new Yi(this.activeServiceWorker);
|
|
3456
3595
|
const i = await this.sender._send(
|
|
3457
3596
|
"ping",
|
|
3458
3597
|
{},
|
|
@@ -3474,7 +3613,7 @@ class Kt {
|
|
|
3474
3613
|
* @param key - Storage key which changed.
|
|
3475
3614
|
*/
|
|
3476
3615
|
async notifyServiceWorker(e) {
|
|
3477
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3616
|
+
if (!(!this.sender || !this.activeServiceWorker || Zi() !== this.activeServiceWorker))
|
|
3478
3617
|
try {
|
|
3479
3618
|
await this.sender._send(
|
|
3480
3619
|
"keyChanged",
|
|
@@ -3490,8 +3629,8 @@ class Kt {
|
|
|
3490
3629
|
try {
|
|
3491
3630
|
if (!indexedDB)
|
|
3492
3631
|
return !1;
|
|
3493
|
-
const e = await
|
|
3494
|
-
return await
|
|
3632
|
+
const e = await Ue();
|
|
3633
|
+
return await ut(e, ve, "1"), await dt(e, ve), !0;
|
|
3495
3634
|
} catch {
|
|
3496
3635
|
}
|
|
3497
3636
|
return !1;
|
|
@@ -3505,19 +3644,19 @@ class Kt {
|
|
|
3505
3644
|
}
|
|
3506
3645
|
}
|
|
3507
3646
|
async _set(e, t) {
|
|
3508
|
-
return this._withPendingWrite(async () => (await this._withRetries((i) =>
|
|
3647
|
+
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3509
3648
|
}
|
|
3510
3649
|
async _get(e) {
|
|
3511
|
-
const t = await this._withRetries((i) =>
|
|
3650
|
+
const t = await this._withRetries((i) => ir(i, e));
|
|
3512
3651
|
return this.localCache[e] = t, t;
|
|
3513
3652
|
}
|
|
3514
3653
|
async _remove(e) {
|
|
3515
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
|
3654
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => dt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
|
3516
3655
|
}
|
|
3517
3656
|
async _poll() {
|
|
3518
3657
|
const e = await this._withRetries((r) => {
|
|
3519
|
-
const s =
|
|
3520
|
-
return new
|
|
3658
|
+
const s = Ee(r, !1).getAll();
|
|
3659
|
+
return new oe(s).toPromise();
|
|
3521
3660
|
});
|
|
3522
3661
|
if (!e)
|
|
3523
3662
|
return [];
|
|
@@ -3539,7 +3678,7 @@ class Kt {
|
|
|
3539
3678
|
r(t);
|
|
3540
3679
|
}
|
|
3541
3680
|
startPolling() {
|
|
3542
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3681
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), rr);
|
|
3543
3682
|
}
|
|
3544
3683
|
stopPolling() {
|
|
3545
3684
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3551,9 +3690,9 @@ class Kt {
|
|
|
3551
3690
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
|
3552
3691
|
}
|
|
3553
3692
|
}
|
|
3554
|
-
|
|
3555
|
-
const
|
|
3556
|
-
new
|
|
3693
|
+
nn.type = "LOCAL";
|
|
3694
|
+
const or = nn;
|
|
3695
|
+
new re(3e4, 6e4);
|
|
3557
3696
|
/**
|
|
3558
3697
|
* @license
|
|
3559
3698
|
* Copyright 2021 Google LLC
|
|
@@ -3570,8 +3709,8 @@ new X(3e4, 6e4);
|
|
|
3570
3709
|
* See the License for the specific language governing permissions and
|
|
3571
3710
|
* limitations under the License.
|
|
3572
3711
|
*/
|
|
3573
|
-
function
|
|
3574
|
-
return e ?
|
|
3712
|
+
function ar(n, e) {
|
|
3713
|
+
return e ? C(e) : (u(
|
|
3575
3714
|
n._popupRedirectResolver,
|
|
3576
3715
|
n,
|
|
3577
3716
|
"argument-error"
|
|
@@ -3594,7 +3733,7 @@ function xi(n, e) {
|
|
|
3594
3733
|
* See the License for the specific language governing permissions and
|
|
3595
3734
|
* limitations under the License.
|
|
3596
3735
|
*/
|
|
3597
|
-
class
|
|
3736
|
+
class qe extends zt {
|
|
3598
3737
|
constructor(e) {
|
|
3599
3738
|
super(
|
|
3600
3739
|
"custom",
|
|
@@ -3603,13 +3742,13 @@ class Ve extends xt {
|
|
|
3603
3742
|
), this.params = e;
|
|
3604
3743
|
}
|
|
3605
3744
|
_getIdTokenResponse(e) {
|
|
3606
|
-
return
|
|
3745
|
+
return z(e, this._buildIdpRequest());
|
|
3607
3746
|
}
|
|
3608
3747
|
_linkToIdToken(e, t) {
|
|
3609
|
-
return
|
|
3748
|
+
return z(e, this._buildIdpRequest(t));
|
|
3610
3749
|
}
|
|
3611
3750
|
_getReauthenticationResolver(e) {
|
|
3612
|
-
return
|
|
3751
|
+
return z(e, this._buildIdpRequest());
|
|
3613
3752
|
}
|
|
3614
3753
|
_buildIdpRequest(e) {
|
|
3615
3754
|
const t = {
|
|
@@ -3624,26 +3763,26 @@ class Ve extends xt {
|
|
|
3624
3763
|
return e && (t.idToken = e), t;
|
|
3625
3764
|
}
|
|
3626
3765
|
}
|
|
3627
|
-
function
|
|
3628
|
-
return
|
|
3766
|
+
function cr(n) {
|
|
3767
|
+
return $i(n.auth, new qe(n), n.bypassAuthState);
|
|
3629
3768
|
}
|
|
3630
|
-
function
|
|
3769
|
+
function lr(n) {
|
|
3631
3770
|
const { auth: e, user: t } = n;
|
|
3632
3771
|
return u(
|
|
3633
3772
|
t,
|
|
3634
3773
|
e,
|
|
3635
3774
|
"internal-error"
|
|
3636
3775
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3637
|
-
),
|
|
3776
|
+
), Vi(t, new qe(n), n.bypassAuthState);
|
|
3638
3777
|
}
|
|
3639
|
-
async function
|
|
3778
|
+
async function ur(n) {
|
|
3640
3779
|
const { auth: e, user: t } = n;
|
|
3641
3780
|
return u(
|
|
3642
3781
|
t,
|
|
3643
3782
|
e,
|
|
3644
3783
|
"internal-error"
|
|
3645
3784
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3646
|
-
),
|
|
3785
|
+
), Fi(t, new qe(n), n.bypassAuthState);
|
|
3647
3786
|
}
|
|
3648
3787
|
/**
|
|
3649
3788
|
* @license
|
|
@@ -3661,7 +3800,7 @@ async function Hi(n) {
|
|
|
3661
3800
|
* See the License for the specific language governing permissions and
|
|
3662
3801
|
* limitations under the License.
|
|
3663
3802
|
*/
|
|
3664
|
-
class
|
|
3803
|
+
class rn {
|
|
3665
3804
|
constructor(e, t, i, r, s = !1) {
|
|
3666
3805
|
this.auth = e, this.resolver = i, this.user = r, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
|
3667
3806
|
}
|
|
@@ -3703,15 +3842,15 @@ class Jt {
|
|
|
3703
3842
|
switch (e) {
|
|
3704
3843
|
case "signInViaPopup":
|
|
3705
3844
|
case "signInViaRedirect":
|
|
3706
|
-
return
|
|
3845
|
+
return cr;
|
|
3707
3846
|
case "linkViaPopup":
|
|
3708
3847
|
case "linkViaRedirect":
|
|
3709
|
-
return
|
|
3848
|
+
return ur;
|
|
3710
3849
|
case "reauthViaPopup":
|
|
3711
3850
|
case "reauthViaRedirect":
|
|
3712
|
-
return
|
|
3851
|
+
return lr;
|
|
3713
3852
|
default:
|
|
3714
|
-
|
|
3853
|
+
N(
|
|
3715
3854
|
this.auth,
|
|
3716
3855
|
"internal-error"
|
|
3717
3856
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3719,10 +3858,10 @@ class Jt {
|
|
|
3719
3858
|
}
|
|
3720
3859
|
}
|
|
3721
3860
|
resolve(e) {
|
|
3722
|
-
|
|
3861
|
+
O(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3723
3862
|
}
|
|
3724
3863
|
reject(e) {
|
|
3725
|
-
|
|
3864
|
+
O(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3726
3865
|
}
|
|
3727
3866
|
unregisterAndCleanUp() {
|
|
3728
3867
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3744,10 +3883,10 @@ class Jt {
|
|
|
3744
3883
|
* See the License for the specific language governing permissions and
|
|
3745
3884
|
* limitations under the License.
|
|
3746
3885
|
*/
|
|
3747
|
-
const
|
|
3748
|
-
class
|
|
3886
|
+
const dr = new re(2e3, 1e4);
|
|
3887
|
+
class W extends rn {
|
|
3749
3888
|
constructor(e, t, i, r, s) {
|
|
3750
|
-
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null,
|
|
3889
|
+
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, W.currentPopupAction && W.currentPopupAction.cancel(), W.currentPopupAction = this;
|
|
3751
3890
|
}
|
|
3752
3891
|
async executeNotNull() {
|
|
3753
3892
|
const e = await this.execute();
|
|
@@ -3759,8 +3898,8 @@ class V extends Jt {
|
|
|
3759
3898
|
), e;
|
|
3760
3899
|
}
|
|
3761
3900
|
async onExecution() {
|
|
3762
|
-
|
|
3763
|
-
const e =
|
|
3901
|
+
O(this.filter.length === 1, "Popup operations only handle one event");
|
|
3902
|
+
const e = ze();
|
|
3764
3903
|
this.authWindow = await this.resolver._openPopup(
|
|
3765
3904
|
this.auth,
|
|
3766
3905
|
this.provider,
|
|
@@ -3770,7 +3909,7 @@ class V extends Jt {
|
|
|
3770
3909
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3771
3910
|
this.reject(t);
|
|
3772
3911
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3773
|
-
t || this.reject(
|
|
3912
|
+
t || this.reject(k(
|
|
3774
3913
|
this.auth,
|
|
3775
3914
|
"web-storage-unsupported"
|
|
3776
3915
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3782,14 +3921,14 @@ class V extends Jt {
|
|
|
3782
3921
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3783
3922
|
}
|
|
3784
3923
|
cancel() {
|
|
3785
|
-
this.reject(
|
|
3924
|
+
this.reject(k(
|
|
3786
3925
|
this.auth,
|
|
3787
3926
|
"cancelled-popup-request"
|
|
3788
3927
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
3789
3928
|
));
|
|
3790
3929
|
}
|
|
3791
3930
|
cleanUp() {
|
|
3792
|
-
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null,
|
|
3931
|
+
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null, W.currentPopupAction = null;
|
|
3793
3932
|
}
|
|
3794
3933
|
pollUserCancellation() {
|
|
3795
3934
|
const e = () => {
|
|
@@ -3797,7 +3936,7 @@ class V extends Jt {
|
|
|
3797
3936
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3798
3937
|
this.pollId = window.setTimeout(
|
|
3799
3938
|
() => {
|
|
3800
|
-
this.pollId = null, this.reject(
|
|
3939
|
+
this.pollId = null, this.reject(k(
|
|
3801
3940
|
this.auth,
|
|
3802
3941
|
"popup-closed-by-user"
|
|
3803
3942
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3808,12 +3947,12 @@ class V extends Jt {
|
|
|
3808
3947
|
);
|
|
3809
3948
|
return;
|
|
3810
3949
|
}
|
|
3811
|
-
this.pollId = window.setTimeout(e,
|
|
3950
|
+
this.pollId = window.setTimeout(e, dr.get());
|
|
3812
3951
|
};
|
|
3813
3952
|
e();
|
|
3814
3953
|
}
|
|
3815
3954
|
}
|
|
3816
|
-
|
|
3955
|
+
W.currentPopupAction = null;
|
|
3817
3956
|
/**
|
|
3818
3957
|
* @license
|
|
3819
3958
|
* Copyright 2020 Google LLC
|
|
@@ -3830,8 +3969,8 @@ V.currentPopupAction = null;
|
|
|
3830
3969
|
* See the License for the specific language governing permissions and
|
|
3831
3970
|
* limitations under the License.
|
|
3832
3971
|
*/
|
|
3833
|
-
const
|
|
3834
|
-
class
|
|
3972
|
+
const hr = "pendingRedirect", ue = /* @__PURE__ */ new Map();
|
|
3973
|
+
class fr extends rn {
|
|
3835
3974
|
constructor(e, t, i = !1) {
|
|
3836
3975
|
super(e, [
|
|
3837
3976
|
"signInViaRedirect",
|
|
@@ -3846,17 +3985,17 @@ class Gi extends Jt {
|
|
|
3846
3985
|
* just return it.
|
|
3847
3986
|
*/
|
|
3848
3987
|
async execute() {
|
|
3849
|
-
let e =
|
|
3988
|
+
let e = ue.get(this.auth._key());
|
|
3850
3989
|
if (!e) {
|
|
3851
3990
|
try {
|
|
3852
|
-
const i = await
|
|
3991
|
+
const i = await pr(this.resolver, this.auth) ? await super.execute() : null;
|
|
3853
3992
|
e = () => Promise.resolve(i);
|
|
3854
3993
|
} catch (t) {
|
|
3855
3994
|
e = () => Promise.reject(t);
|
|
3856
3995
|
}
|
|
3857
|
-
|
|
3996
|
+
ue.set(this.auth._key(), e);
|
|
3858
3997
|
}
|
|
3859
|
-
return this.bypassAuthState ||
|
|
3998
|
+
return this.bypassAuthState || ue.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3860
3999
|
}
|
|
3861
4000
|
async onAuthEvent(e) {
|
|
3862
4001
|
if (e.type === "signInViaRedirect")
|
|
@@ -3877,26 +4016,26 @@ class Gi extends Jt {
|
|
|
3877
4016
|
cleanUp() {
|
|
3878
4017
|
}
|
|
3879
4018
|
}
|
|
3880
|
-
async function
|
|
3881
|
-
const t =
|
|
4019
|
+
async function pr(n, e) {
|
|
4020
|
+
const t = _r(e), i = gr(n);
|
|
3882
4021
|
if (!await i._isAvailable())
|
|
3883
4022
|
return !1;
|
|
3884
4023
|
const r = await i._get(t) === "true";
|
|
3885
4024
|
return await i._remove(t), r;
|
|
3886
4025
|
}
|
|
3887
|
-
function
|
|
3888
|
-
|
|
4026
|
+
function mr(n, e) {
|
|
4027
|
+
ue.set(n._key(), e);
|
|
3889
4028
|
}
|
|
3890
|
-
function
|
|
3891
|
-
return
|
|
4029
|
+
function gr(n) {
|
|
4030
|
+
return C(n._redirectPersistence);
|
|
3892
4031
|
}
|
|
3893
|
-
function
|
|
3894
|
-
return
|
|
4032
|
+
function _r(n) {
|
|
4033
|
+
return le(hr, n.config.apiKey, n.name);
|
|
3895
4034
|
}
|
|
3896
|
-
async function
|
|
3897
|
-
if (
|
|
3898
|
-
return Promise.reject(
|
|
3899
|
-
const i =
|
|
4035
|
+
async function vr(n, e, t = !1) {
|
|
4036
|
+
if (R(n.app))
|
|
4037
|
+
return Promise.reject(F(n));
|
|
4038
|
+
const i = Te(n), r = ar(i, e), o = await new fr(i, r, t).execute();
|
|
3900
4039
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3901
4040
|
}
|
|
3902
4041
|
/**
|
|
@@ -3915,8 +4054,8 @@ async function Ji(n, e, t = !1) {
|
|
|
3915
4054
|
* See the License for the specific language governing permissions and
|
|
3916
4055
|
* limitations under the License.
|
|
3917
4056
|
*/
|
|
3918
|
-
const
|
|
3919
|
-
class
|
|
4057
|
+
const Ir = 10 * 60 * 1e3;
|
|
4058
|
+
class yr {
|
|
3920
4059
|
constructor(e) {
|
|
3921
4060
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3922
4061
|
}
|
|
@@ -3932,13 +4071,13 @@ class Xi {
|
|
|
3932
4071
|
let t = !1;
|
|
3933
4072
|
return this.consumers.forEach((i) => {
|
|
3934
4073
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3935
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4074
|
+
}), this.hasHandledPotentialRedirect || !wr(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3936
4075
|
}
|
|
3937
4076
|
sendToConsumer(e, t) {
|
|
3938
4077
|
var i;
|
|
3939
|
-
if (e.error && !
|
|
4078
|
+
if (e.error && !sn(e)) {
|
|
3940
4079
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
3941
|
-
t.onError(
|
|
4080
|
+
t.onError(k(this.auth, r));
|
|
3942
4081
|
} else
|
|
3943
4082
|
t.onAuthEvent(e);
|
|
3944
4083
|
}
|
|
@@ -3947,26 +4086,26 @@ class Xi {
|
|
|
3947
4086
|
return t.filter.includes(e.type) && i;
|
|
3948
4087
|
}
|
|
3949
4088
|
hasEventBeenHandled(e) {
|
|
3950
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4089
|
+
return Date.now() - this.lastProcessedEventTime >= Ir && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
3951
4090
|
}
|
|
3952
4091
|
saveEventToCache(e) {
|
|
3953
|
-
this.cachedEventUids.add(
|
|
4092
|
+
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
3954
4093
|
}
|
|
3955
4094
|
}
|
|
3956
|
-
function
|
|
4095
|
+
function ht(n) {
|
|
3957
4096
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
3958
4097
|
}
|
|
3959
|
-
function
|
|
4098
|
+
function sn({ type: n, error: e }) {
|
|
3960
4099
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3961
4100
|
}
|
|
3962
|
-
function
|
|
4101
|
+
function wr(n) {
|
|
3963
4102
|
switch (n.type) {
|
|
3964
4103
|
case "signInViaRedirect":
|
|
3965
4104
|
case "linkViaRedirect":
|
|
3966
4105
|
case "reauthViaRedirect":
|
|
3967
4106
|
return !0;
|
|
3968
4107
|
case "unknown":
|
|
3969
|
-
return
|
|
4108
|
+
return sn(n);
|
|
3970
4109
|
default:
|
|
3971
4110
|
return !1;
|
|
3972
4111
|
}
|
|
@@ -3987,8 +4126,8 @@ function Qi(n) {
|
|
|
3987
4126
|
* See the License for the specific language governing permissions and
|
|
3988
4127
|
* limitations under the License.
|
|
3989
4128
|
*/
|
|
3990
|
-
async function
|
|
3991
|
-
return
|
|
4129
|
+
async function Tr(n, e = {}) {
|
|
4130
|
+
return K(n, "GET", "/v1/projects", e);
|
|
3992
4131
|
}
|
|
3993
4132
|
/**
|
|
3994
4133
|
* @license
|
|
@@ -4006,32 +4145,32 @@ async function Zi(n, e = {}) {
|
|
|
4006
4145
|
* See the License for the specific language governing permissions and
|
|
4007
4146
|
* limitations under the License.
|
|
4008
4147
|
*/
|
|
4009
|
-
const
|
|
4010
|
-
async function
|
|
4148
|
+
const kr = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Er = /^https?/;
|
|
4149
|
+
async function br(n) {
|
|
4011
4150
|
if (n.config.emulator)
|
|
4012
4151
|
return;
|
|
4013
|
-
const { authorizedDomains: e } = await
|
|
4152
|
+
const { authorizedDomains: e } = await Tr(n);
|
|
4014
4153
|
for (const t of e)
|
|
4015
4154
|
try {
|
|
4016
|
-
if (
|
|
4155
|
+
if (Sr(t))
|
|
4017
4156
|
return;
|
|
4018
4157
|
} catch {
|
|
4019
4158
|
}
|
|
4020
|
-
|
|
4159
|
+
N(
|
|
4021
4160
|
n,
|
|
4022
4161
|
"unauthorized-domain"
|
|
4023
4162
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4024
4163
|
);
|
|
4025
4164
|
}
|
|
4026
|
-
function
|
|
4027
|
-
const e =
|
|
4165
|
+
function Sr(n) {
|
|
4166
|
+
const e = Le(), { protocol: t, hostname: i } = new URL(e);
|
|
4028
4167
|
if (n.startsWith("chrome-extension://")) {
|
|
4029
4168
|
const o = new URL(n);
|
|
4030
4169
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4031
4170
|
}
|
|
4032
|
-
if (!
|
|
4171
|
+
if (!Er.test(t))
|
|
4033
4172
|
return !1;
|
|
4034
|
-
if (
|
|
4173
|
+
if (kr.test(n))
|
|
4035
4174
|
return i === n;
|
|
4036
4175
|
const r = n.replace(/\./g, "\\.");
|
|
4037
4176
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4052,9 +4191,9 @@ function ir(n) {
|
|
|
4052
4191
|
* See the License for the specific language governing permissions and
|
|
4053
4192
|
* limitations under the License.
|
|
4054
4193
|
*/
|
|
4055
|
-
const
|
|
4056
|
-
function
|
|
4057
|
-
const n =
|
|
4194
|
+
const Rr = new re(3e4, 6e4);
|
|
4195
|
+
function ft() {
|
|
4196
|
+
const n = E().___jsl;
|
|
4058
4197
|
if (n != null && n.H) {
|
|
4059
4198
|
for (const e of Object.keys(n.H))
|
|
4060
4199
|
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)
|
|
@@ -4062,45 +4201,45 @@ function ot() {
|
|
|
4062
4201
|
n.CP[t] = null;
|
|
4063
4202
|
}
|
|
4064
4203
|
}
|
|
4065
|
-
function
|
|
4204
|
+
function Ar(n) {
|
|
4066
4205
|
return new Promise((e, t) => {
|
|
4067
4206
|
var i, r, s;
|
|
4068
4207
|
function o() {
|
|
4069
|
-
|
|
4208
|
+
ft(), gapi.load("gapi.iframes", {
|
|
4070
4209
|
callback: () => {
|
|
4071
4210
|
e(gapi.iframes.getContext());
|
|
4072
4211
|
},
|
|
4073
4212
|
ontimeout: () => {
|
|
4074
|
-
|
|
4213
|
+
ft(), t(k(
|
|
4075
4214
|
n,
|
|
4076
4215
|
"network-request-failed"
|
|
4077
4216
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4078
4217
|
));
|
|
4079
4218
|
},
|
|
4080
|
-
timeout:
|
|
4219
|
+
timeout: Rr.get()
|
|
4081
4220
|
});
|
|
4082
4221
|
}
|
|
4083
|
-
if (!((r = (i =
|
|
4222
|
+
if (!((r = (i = E().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4084
4223
|
e(gapi.iframes.getContext());
|
|
4085
|
-
else if (!((s =
|
|
4224
|
+
else if (!((s = E().gapi) === null || s === void 0) && s.load)
|
|
4086
4225
|
o();
|
|
4087
4226
|
else {
|
|
4088
|
-
const c =
|
|
4089
|
-
return
|
|
4090
|
-
gapi.load ? o() : t(
|
|
4227
|
+
const c = Ni("iframefcb");
|
|
4228
|
+
return E()[c] = () => {
|
|
4229
|
+
gapi.load ? o() : t(k(
|
|
4091
4230
|
n,
|
|
4092
4231
|
"network-request-failed"
|
|
4093
4232
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4094
4233
|
));
|
|
4095
|
-
},
|
|
4234
|
+
}, Pi(`${Ci()}?onload=${c}`).catch((a) => t(a));
|
|
4096
4235
|
}
|
|
4097
4236
|
}).catch((e) => {
|
|
4098
|
-
throw
|
|
4237
|
+
throw de = null, e;
|
|
4099
4238
|
});
|
|
4100
4239
|
}
|
|
4101
|
-
let
|
|
4102
|
-
function
|
|
4103
|
-
return
|
|
4240
|
+
let de = null;
|
|
4241
|
+
function Pr(n) {
|
|
4242
|
+
return de = de || Ar(n), de;
|
|
4104
4243
|
}
|
|
4105
4244
|
/**
|
|
4106
4245
|
* @license
|
|
@@ -4118,7 +4257,7 @@ function or(n) {
|
|
|
4118
4257
|
* See the License for the specific language governing permissions and
|
|
4119
4258
|
* limitations under the License.
|
|
4120
4259
|
*/
|
|
4121
|
-
const
|
|
4260
|
+
const Cr = new re(5e3, 15e3), Nr = "__/auth/iframe", Or = "emulator/auth/iframe", Lr = {
|
|
4122
4261
|
style: {
|
|
4123
4262
|
position: "absolute",
|
|
4124
4263
|
top: "-100px",
|
|
@@ -4127,13 +4266,13 @@ const ar = new X(5e3, 15e3), cr = "__/auth/iframe", lr = "emulator/auth/iframe",
|
|
|
4127
4266
|
},
|
|
4128
4267
|
"aria-hidden": "true",
|
|
4129
4268
|
tabindex: "-1"
|
|
4130
|
-
},
|
|
4269
|
+
}, Mr = /* @__PURE__ */ new Map([
|
|
4131
4270
|
["identitytoolkit.googleapis.com", "p"],
|
|
4132
4271
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4133
4272
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4134
4273
|
// test
|
|
4135
4274
|
]);
|
|
4136
|
-
function
|
|
4275
|
+
function Ur(n) {
|
|
4137
4276
|
const e = n.config;
|
|
4138
4277
|
u(
|
|
4139
4278
|
e.authDomain,
|
|
@@ -4141,17 +4280,17 @@ function hr(n) {
|
|
|
4141
4280
|
"auth-domain-config-required"
|
|
4142
4281
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4143
4282
|
);
|
|
4144
|
-
const t = e.emulator ?
|
|
4283
|
+
const t = e.emulator ? je(e, Or) : `https://${n.config.authDomain}/${Nr}`, i = {
|
|
4145
4284
|
apiKey: e.apiKey,
|
|
4146
4285
|
appName: n.name,
|
|
4147
|
-
v:
|
|
4148
|
-
}, r =
|
|
4286
|
+
v: ne
|
|
4287
|
+
}, r = Mr.get(n.config.apiHost);
|
|
4149
4288
|
r && (i.eid = r);
|
|
4150
4289
|
const s = n._getFrameworks();
|
|
4151
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4290
|
+
return s.length && (i.fw = s.join(",")), `${t}?${ie(i).slice(1)}`;
|
|
4152
4291
|
}
|
|
4153
|
-
async function
|
|
4154
|
-
const e = await
|
|
4292
|
+
async function Dr(n) {
|
|
4293
|
+
const e = await Pr(n), t = E().gapi;
|
|
4155
4294
|
return u(
|
|
4156
4295
|
t,
|
|
4157
4296
|
n,
|
|
@@ -4159,24 +4298,24 @@ async function fr(n) {
|
|
|
4159
4298
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4160
4299
|
), e.open({
|
|
4161
4300
|
where: document.body,
|
|
4162
|
-
url:
|
|
4301
|
+
url: Ur(n),
|
|
4163
4302
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4164
|
-
attributes:
|
|
4303
|
+
attributes: Lr,
|
|
4165
4304
|
dontclear: !0
|
|
4166
4305
|
}, (i) => new Promise(async (r, s) => {
|
|
4167
4306
|
await i.restyle({
|
|
4168
4307
|
// Prevent iframe from closing on mouse out.
|
|
4169
4308
|
setHideOnLeave: !1
|
|
4170
4309
|
});
|
|
4171
|
-
const o =
|
|
4310
|
+
const o = k(
|
|
4172
4311
|
n,
|
|
4173
4312
|
"network-request-failed"
|
|
4174
4313
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4175
|
-
), c =
|
|
4314
|
+
), c = E().setTimeout(() => {
|
|
4176
4315
|
s(o);
|
|
4177
|
-
},
|
|
4316
|
+
}, Cr.get());
|
|
4178
4317
|
function a() {
|
|
4179
|
-
|
|
4318
|
+
E().clearTimeout(c), r(i);
|
|
4180
4319
|
}
|
|
4181
4320
|
i.ping(a).then(a, () => {
|
|
4182
4321
|
s(o);
|
|
@@ -4199,13 +4338,13 @@ async function fr(n) {
|
|
|
4199
4338
|
* See the License for the specific language governing permissions and
|
|
4200
4339
|
* limitations under the License.
|
|
4201
4340
|
*/
|
|
4202
|
-
const
|
|
4341
|
+
const xr = {
|
|
4203
4342
|
location: "yes",
|
|
4204
4343
|
resizable: "yes",
|
|
4205
4344
|
statusbar: "yes",
|
|
4206
4345
|
toolbar: "no"
|
|
4207
|
-
},
|
|
4208
|
-
class
|
|
4346
|
+
}, Fr = 500, Vr = 600, $r = "_blank", Hr = "http://localhost";
|
|
4347
|
+
class pt {
|
|
4209
4348
|
constructor(e) {
|
|
4210
4349
|
this.window = e, this.associatedEvent = null;
|
|
4211
4350
|
}
|
|
@@ -4217,19 +4356,19 @@ class at {
|
|
|
4217
4356
|
}
|
|
4218
4357
|
}
|
|
4219
4358
|
}
|
|
4220
|
-
function
|
|
4359
|
+
function jr(n, e, t, i = Fr, r = Vr) {
|
|
4221
4360
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4222
4361
|
let c = "";
|
|
4223
|
-
const a = Object.assign(Object.assign({},
|
|
4362
|
+
const a = Object.assign(Object.assign({}, xr), {
|
|
4224
4363
|
width: i.toString(),
|
|
4225
4364
|
height: r.toString(),
|
|
4226
4365
|
top: s,
|
|
4227
4366
|
left: o
|
|
4228
|
-
}), l =
|
|
4229
|
-
t && (c =
|
|
4230
|
-
const d = Object.entries(a).reduce((p, [w,
|
|
4231
|
-
if (
|
|
4232
|
-
return
|
|
4367
|
+
}), l = y().toLowerCase();
|
|
4368
|
+
t && (c = Ft(l) ? $r : t), xt(l) && (e = e || Hr, a.scrollbars = "yes");
|
|
4369
|
+
const d = Object.entries(a).reduce((p, [w, T]) => `${p}${w}=${T},`, "");
|
|
4370
|
+
if (yi(l) && c !== "_self")
|
|
4371
|
+
return Wr(e || "", c), new pt(null);
|
|
4233
4372
|
const h = window.open(e || "", c, d);
|
|
4234
4373
|
u(
|
|
4235
4374
|
h,
|
|
@@ -4241,9 +4380,9 @@ function Ir(n, e, t, i = mr, r = gr) {
|
|
|
4241
4380
|
h.focus();
|
|
4242
4381
|
} catch {
|
|
4243
4382
|
}
|
|
4244
|
-
return new
|
|
4383
|
+
return new pt(h);
|
|
4245
4384
|
}
|
|
4246
|
-
function
|
|
4385
|
+
function Wr(n, e) {
|
|
4247
4386
|
const t = document.createElement("a");
|
|
4248
4387
|
t.href = n, t.target = e;
|
|
4249
4388
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4265,8 +4404,8 @@ function Tr(n, e) {
|
|
|
4265
4404
|
* See the License for the specific language governing permissions and
|
|
4266
4405
|
* limitations under the License.
|
|
4267
4406
|
*/
|
|
4268
|
-
const
|
|
4269
|
-
async function
|
|
4407
|
+
const Gr = "__/auth/handler", Br = "emulator/auth/handler", zr = encodeURIComponent("fac");
|
|
4408
|
+
async function mt(n, e, t, i, r, s) {
|
|
4270
4409
|
u(
|
|
4271
4410
|
n.config.authDomain,
|
|
4272
4411
|
n,
|
|
@@ -4283,15 +4422,15 @@ async function ct(n, e, t, i, r, s) {
|
|
|
4283
4422
|
appName: n.name,
|
|
4284
4423
|
authType: t,
|
|
4285
4424
|
redirectUrl: i,
|
|
4286
|
-
v:
|
|
4425
|
+
v: ne,
|
|
4287
4426
|
eventId: r
|
|
4288
4427
|
};
|
|
4289
|
-
if (e instanceof
|
|
4290
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4428
|
+
if (e instanceof qt) {
|
|
4429
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", Cn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4291
4430
|
for (const [d, h] of Object.entries({}))
|
|
4292
4431
|
o[d] = h;
|
|
4293
4432
|
}
|
|
4294
|
-
if (e instanceof
|
|
4433
|
+
if (e instanceof se) {
|
|
4295
4434
|
const d = e.getScopes().filter((h) => h !== "");
|
|
4296
4435
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4297
4436
|
}
|
|
@@ -4299,11 +4438,11 @@ async function ct(n, e, t, i, r, s) {
|
|
|
4299
4438
|
const c = o;
|
|
4300
4439
|
for (const d of Object.keys(c))
|
|
4301
4440
|
c[d] === void 0 && delete c[d];
|
|
4302
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4303
|
-
return `${
|
|
4441
|
+
const a = await n._getAppCheckToken(), l = a ? `#${zr}=${encodeURIComponent(a)}` : "";
|
|
4442
|
+
return `${qr(n)}?${ie(c).slice(1)}${l}`;
|
|
4304
4443
|
}
|
|
4305
|
-
function
|
|
4306
|
-
return n.emulator ?
|
|
4444
|
+
function qr({ config: n }) {
|
|
4445
|
+
return n.emulator ? je(n, Br) : `https://${n.authDomain}/${Gr}`;
|
|
4307
4446
|
}
|
|
4308
4447
|
/**
|
|
4309
4448
|
* @license
|
|
@@ -4321,30 +4460,30 @@ function kr({ config: n }) {
|
|
|
4321
4460
|
* See the License for the specific language governing permissions and
|
|
4322
4461
|
* limitations under the License.
|
|
4323
4462
|
*/
|
|
4324
|
-
const
|
|
4325
|
-
class
|
|
4463
|
+
const Ce = "webStorageSupport";
|
|
4464
|
+
class Kr {
|
|
4326
4465
|
constructor() {
|
|
4327
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4466
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn = vr, this._overrideRedirectResult = mr;
|
|
4328
4467
|
}
|
|
4329
4468
|
// Wrapping in async even though we don't await anywhere in order
|
|
4330
4469
|
// to make sure errors are raised as promise rejections
|
|
4331
4470
|
async _openPopup(e, t, i, r) {
|
|
4332
4471
|
var s;
|
|
4333
|
-
|
|
4334
|
-
const o = await
|
|
4335
|
-
return
|
|
4472
|
+
O((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4473
|
+
const o = await mt(e, t, i, Le(), r);
|
|
4474
|
+
return jr(e, o, ze());
|
|
4336
4475
|
}
|
|
4337
4476
|
async _openRedirect(e, t, i, r) {
|
|
4338
4477
|
await this._originValidation(e);
|
|
4339
|
-
const s = await
|
|
4340
|
-
return
|
|
4478
|
+
const s = await mt(e, t, i, Le(), r);
|
|
4479
|
+
return Xi(s), new Promise(() => {
|
|
4341
4480
|
});
|
|
4342
4481
|
}
|
|
4343
4482
|
_initialize(e) {
|
|
4344
4483
|
const t = e._key();
|
|
4345
4484
|
if (this.eventManagers[t]) {
|
|
4346
4485
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4347
|
-
return r ? Promise.resolve(r) : (
|
|
4486
|
+
return r ? Promise.resolve(r) : (O(s, "If manager is not set, promise should be"), s);
|
|
4348
4487
|
}
|
|
4349
4488
|
const i = this.initAndGetManager(e);
|
|
4350
4489
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4352,7 +4491,7 @@ class br {
|
|
|
4352
4491
|
}), i;
|
|
4353
4492
|
}
|
|
4354
4493
|
async initAndGetManager(e) {
|
|
4355
|
-
const t = await
|
|
4494
|
+
const t = await Dr(e), i = new yr(e);
|
|
4356
4495
|
return t.register("authEvent", (r) => (u(
|
|
4357
4496
|
r == null ? void 0 : r.authEvent,
|
|
4358
4497
|
e,
|
|
@@ -4364,10 +4503,10 @@ class br {
|
|
|
4364
4503
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: i }, this.iframes[e._key()] = t, i;
|
|
4365
4504
|
}
|
|
4366
4505
|
_isIframeWebStorageSupported(e, t) {
|
|
4367
|
-
this.iframes[e._key()].send(
|
|
4506
|
+
this.iframes[e._key()].send(Ce, { type: Ce }, (r) => {
|
|
4368
4507
|
var s;
|
|
4369
|
-
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[
|
|
4370
|
-
o !== void 0 && t(!!o),
|
|
4508
|
+
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ce];
|
|
4509
|
+
o !== void 0 && t(!!o), N(
|
|
4371
4510
|
e,
|
|
4372
4511
|
"internal-error"
|
|
4373
4512
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4376,14 +4515,14 @@ class br {
|
|
|
4376
4515
|
}
|
|
4377
4516
|
_originValidation(e) {
|
|
4378
4517
|
const t = e._key();
|
|
4379
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4518
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = br(e)), this.originValidationPromises[t];
|
|
4380
4519
|
}
|
|
4381
4520
|
get _shouldInitProactively() {
|
|
4382
|
-
return
|
|
4521
|
+
return Wt() || Ge() || we();
|
|
4383
4522
|
}
|
|
4384
4523
|
}
|
|
4385
|
-
const
|
|
4386
|
-
var
|
|
4524
|
+
const Jr = Kr;
|
|
4525
|
+
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4387
4526
|
/**
|
|
4388
4527
|
* @license
|
|
4389
4528
|
* Copyright 2020 Google LLC
|
|
@@ -4400,7 +4539,7 @@ var lt = "@firebase/auth", ut = "1.7.5";
|
|
|
4400
4539
|
* See the License for the specific language governing permissions and
|
|
4401
4540
|
* limitations under the License.
|
|
4402
4541
|
*/
|
|
4403
|
-
class
|
|
4542
|
+
class Yr {
|
|
4404
4543
|
constructor(e) {
|
|
4405
4544
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4406
4545
|
}
|
|
@@ -4451,7 +4590,7 @@ class Rr {
|
|
|
4451
4590
|
* See the License for the specific language governing permissions and
|
|
4452
4591
|
* limitations under the License.
|
|
4453
4592
|
*/
|
|
4454
|
-
function
|
|
4593
|
+
function Xr(n) {
|
|
4455
4594
|
switch (n) {
|
|
4456
4595
|
case "Node":
|
|
4457
4596
|
return "node";
|
|
@@ -4467,8 +4606,8 @@ function Ar(n) {
|
|
|
4467
4606
|
return;
|
|
4468
4607
|
}
|
|
4469
4608
|
}
|
|
4470
|
-
function
|
|
4471
|
-
|
|
4609
|
+
function Qr(n) {
|
|
4610
|
+
Ze(new et(
|
|
4472
4611
|
"auth",
|
|
4473
4612
|
(e, { options: t }) => {
|
|
4474
4613
|
const i = e.getProvider("app").getImmediate(), r = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: c } = i.options;
|
|
@@ -4480,9 +4619,9 @@ function Pr(n) {
|
|
|
4480
4619
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4481
4620
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4482
4621
|
apiScheme: "https",
|
|
4483
|
-
sdkClientVersion:
|
|
4484
|
-
}, l = new
|
|
4485
|
-
return
|
|
4622
|
+
sdkClientVersion: Gt(n)
|
|
4623
|
+
}, l = new Ri(i, r, s, a);
|
|
4624
|
+
return Li(l, t), l;
|
|
4486
4625
|
},
|
|
4487
4626
|
"PUBLIC"
|
|
4488
4627
|
/* ComponentType.PUBLIC */
|
|
@@ -4494,21 +4633,21 @@ function Pr(n) {
|
|
|
4494
4633
|
"auth-internal"
|
|
4495
4634
|
/* _ComponentName.AUTH_INTERNAL */
|
|
4496
4635
|
).initialize();
|
|
4497
|
-
})),
|
|
4636
|
+
})), Ze(new et(
|
|
4498
4637
|
"auth-internal",
|
|
4499
4638
|
(e) => {
|
|
4500
|
-
const t =
|
|
4639
|
+
const t = Te(e.getProvider(
|
|
4501
4640
|
"auth"
|
|
4502
4641
|
/* _ComponentName.AUTH */
|
|
4503
4642
|
).getImmediate());
|
|
4504
|
-
return ((i) => new
|
|
4643
|
+
return ((i) => new Yr(i))(t);
|
|
4505
4644
|
},
|
|
4506
4645
|
"PRIVATE"
|
|
4507
4646
|
/* ComponentType.PRIVATE */
|
|
4508
4647
|
).setInstantiationMode(
|
|
4509
4648
|
"EXPLICIT"
|
|
4510
4649
|
/* InstantiationMode.EXPLICIT */
|
|
4511
|
-
)),
|
|
4650
|
+
)), Oe(gt, _t, Xr(n)), Oe(gt, _t, "esm2017");
|
|
4512
4651
|
}
|
|
4513
4652
|
/**
|
|
4514
4653
|
* @license
|
|
@@ -4526,117 +4665,118 @@ function Pr(n) {
|
|
|
4526
4665
|
* See the License for the specific language governing permissions and
|
|
4527
4666
|
* limitations under the License.
|
|
4528
4667
|
*/
|
|
4529
|
-
const
|
|
4530
|
-
let
|
|
4531
|
-
const
|
|
4668
|
+
const Zr = 5 * 60, es = kt("authIdTokenMaxAge") || Zr;
|
|
4669
|
+
let vt = null;
|
|
4670
|
+
const ts = (n) => async (e) => {
|
|
4532
4671
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4533
|
-
if (i && i >
|
|
4672
|
+
if (i && i > es)
|
|
4534
4673
|
return;
|
|
4535
4674
|
const r = t == null ? void 0 : t.token;
|
|
4536
|
-
|
|
4675
|
+
vt !== r && (vt = r, await fetch(n, {
|
|
4537
4676
|
method: r ? "POST" : "DELETE",
|
|
4538
4677
|
headers: r ? {
|
|
4539
4678
|
Authorization: `Bearer ${r}`
|
|
4540
4679
|
} : {}
|
|
4541
4680
|
}));
|
|
4542
4681
|
};
|
|
4543
|
-
function
|
|
4544
|
-
const e =
|
|
4682
|
+
function ns(n = Sn()) {
|
|
4683
|
+
const e = Et(n, "auth");
|
|
4545
4684
|
if (e.isInitialized())
|
|
4546
4685
|
return e.getImmediate();
|
|
4547
|
-
const t =
|
|
4548
|
-
popupRedirectResolver:
|
|
4686
|
+
const t = Oi(n, {
|
|
4687
|
+
popupRedirectResolver: Jr,
|
|
4549
4688
|
persistence: [
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4689
|
+
or,
|
|
4690
|
+
Ki,
|
|
4691
|
+
Qt
|
|
4553
4692
|
]
|
|
4554
|
-
}), i =
|
|
4693
|
+
}), i = kt("authTokenSyncURL");
|
|
4555
4694
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4556
4695
|
const s = new URL(i, location.origin);
|
|
4557
4696
|
if (location.origin === s.origin) {
|
|
4558
|
-
const o =
|
|
4559
|
-
|
|
4697
|
+
const o = ts(s.toString());
|
|
4698
|
+
Gi(t, o, () => o(t.currentUser)), Wi(t, (c) => o(c));
|
|
4560
4699
|
}
|
|
4561
4700
|
}
|
|
4562
|
-
const r =
|
|
4563
|
-
return r &&
|
|
4701
|
+
const r = bn("auth");
|
|
4702
|
+
return r && Mi(t, `http://${r}`), t;
|
|
4564
4703
|
}
|
|
4565
|
-
function
|
|
4704
|
+
function is() {
|
|
4566
4705
|
var n, e;
|
|
4567
4706
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4568
4707
|
}
|
|
4569
|
-
|
|
4708
|
+
Ai({
|
|
4570
4709
|
loadJS(n) {
|
|
4571
4710
|
return new Promise((e, t) => {
|
|
4572
4711
|
const i = document.createElement("script");
|
|
4573
4712
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4574
|
-
const s =
|
|
4713
|
+
const s = k(
|
|
4575
4714
|
"internal-error"
|
|
4576
4715
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4577
4716
|
);
|
|
4578
4717
|
s.customData = r, t(s);
|
|
4579
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4718
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", is().appendChild(i);
|
|
4580
4719
|
});
|
|
4581
4720
|
},
|
|
4582
4721
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4583
4722
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4584
4723
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4585
4724
|
});
|
|
4586
|
-
|
|
4725
|
+
Qr(
|
|
4587
4726
|
"Browser"
|
|
4588
4727
|
/* ClientPlatform.BROWSER */
|
|
4589
4728
|
);
|
|
4590
|
-
var
|
|
4591
|
-
const
|
|
4592
|
-
key:
|
|
4729
|
+
var rs = { 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" }, ss = { 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/" };
|
|
4730
|
+
const os = {
|
|
4731
|
+
key: 2,
|
|
4593
4732
|
class: "h-full w-full"
|
|
4594
|
-
},
|
|
4733
|
+
}, as = ["src"], Ts = /* @__PURE__ */ De({
|
|
4595
4734
|
__name: "App",
|
|
4596
4735
|
setup(n) {
|
|
4597
|
-
const e =
|
|
4598
|
-
const
|
|
4599
|
-
return `${
|
|
4736
|
+
const e = pe(), t = fn(), i = pn(), r = mn(), s = gn(), o = wt(), c = Z(o.query.showHeader !== "false"), a = Z(!1), { currentBusiness: l } = pe(), d = Z(!1), h = he(() => i.version), p = he(() => {
|
|
4737
|
+
const g = e.currentCountry.value || "MY", v = tt.getIdToken(), I = l.value._id;
|
|
4738
|
+
return `${ss.marketingV1Portal}/b/${I}/marketing/overview?showHeader=false&country=${g}&token=${v}`;
|
|
4600
4739
|
});
|
|
4601
4740
|
async function w() {
|
|
4602
|
-
if (
|
|
4741
|
+
if (Nn().length) {
|
|
4603
4742
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4604
4743
|
return;
|
|
4605
4744
|
}
|
|
4606
|
-
const
|
|
4607
|
-
await
|
|
4745
|
+
const g = On(rs.firebase), v = await hn.getCustomToken(), I = ns();
|
|
4746
|
+
await ji(I, v), Ln(g), console.log("initFirebase", g);
|
|
4608
4747
|
}
|
|
4609
|
-
const
|
|
4610
|
-
d.value = !1, await
|
|
4748
|
+
const T = async () => {
|
|
4749
|
+
d.value = !1, await un(), console.log("forceRerender"), tt.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(xn) : e.hideSidebarToggle(!0), await w(), a.value = !0, d.value = !0;
|
|
4611
4750
|
};
|
|
4612
|
-
return
|
|
4613
|
-
if (
|
|
4614
|
-
const
|
|
4615
|
-
|
|
4751
|
+
return ln(() => {
|
|
4752
|
+
if (Mn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4753
|
+
const g = document.getElementsByClassName("app-header")[0], v = document.getElementsByClassName("app-sidebar")[0], I = document.getElementsByClassName("app-container")[0], j = document.getElementsByTagName("main")[0];
|
|
4754
|
+
g == null || g.classList.add("!hidden"), v == null || v.classList.add("!pt-0"), I == null || I.classList.add("!pt-0"), j == null || j.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4616
4755
|
}
|
|
4617
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4618
|
-
}),
|
|
4756
|
+
l.value != null && (console.log("App mounted, forceRerender"), T());
|
|
4757
|
+
}), xe(
|
|
4619
4758
|
() => e.currentBusiness.value,
|
|
4620
|
-
async (
|
|
4621
|
-
console.log("Current business changed"),
|
|
4759
|
+
async (g, v) => {
|
|
4760
|
+
console.log("Current business changed"), g != null && g._id != v._id && (console.log("forceRerender when business changes", g, v), T());
|
|
4622
4761
|
}
|
|
4623
|
-
), (
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4762
|
+
), (g, v) => (V(), fe(It, null, [
|
|
4763
|
+
m(d) && m(h) === "v2" ? (V(), Ne(m(dn), { key: 0 })) : Ae("", !0),
|
|
4764
|
+
m(d) && m(h) === "v2" && m(c) ? (V(), Ne(ti, { key: 1 })) : Ae("", !0),
|
|
4765
|
+
m(d) && m(h) !== "v2" ? (V(), fe("div", os, [
|
|
4766
|
+
b(In, {
|
|
4767
|
+
json: { url: m(p) }
|
|
4628
4768
|
}, null, 8, ["json"]),
|
|
4629
|
-
|
|
4769
|
+
_("iframe", {
|
|
4630
4770
|
allow: "clipboard-read; clipboard-write",
|
|
4631
4771
|
frameBorder: "0",
|
|
4632
4772
|
height: "100%",
|
|
4633
4773
|
width: "100%",
|
|
4634
|
-
src:
|
|
4635
|
-
}, null, 8,
|
|
4636
|
-
])) :
|
|
4774
|
+
src: m(p)
|
|
4775
|
+
}, null, 8, as)
|
|
4776
|
+
])) : Ae("", !0)
|
|
4637
4777
|
], 64));
|
|
4638
4778
|
}
|
|
4639
4779
|
});
|
|
4640
4780
|
export {
|
|
4641
|
-
|
|
4781
|
+
Ts as default
|
|
4642
4782
|
};
|