@feedmepos/mf-connect 0.1.98-beta.8 → 0.1.98-beta.81
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-DsB2o1oB.js → App-CKdnfhUE.js} +853 -683
- package/dist/{AuditLogs-BcfgiYnJ.js → AuditLogs-vN-szmrB.js} +16 -13
- package/dist/{Bin-DMr7K8Kj.js → Bin-FIyWozvZ.js} +8 -8
- package/dist/Broadcast-CV_euppF.js +306 -0
- package/dist/CampaignAnalytic-Dlovlsh3.js +1830 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CwGoEBsW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Fd_0aPzZ.js} +8 -5
- package/dist/Card-ZgfOZ7sV.js +1086 -0
- package/dist/{Collections-B0uGC2FE.js → Collections-DZmHKbZn.js} +14 -13
- package/dist/Credit-DGsbEvMw.js +286 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-Cj89MnB0.js +53 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C77dXZo-.js +4432 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DJLxGk7W.js → EffectSheet.vue_vue_type_style_index_0_lang-CcIiEV2Z.js} +36 -36
- package/dist/Experience-DlJycdKe.js +288 -0
- package/dist/{FileSaver.min-BlA0oZEC.js → FileSaver.min-DVGF0TBc.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
- package/dist/Game-q2X_SSup.js +356 -0
- package/dist/GiftCardSetup-BLDm3RfC.js +736 -0
- package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-CBC5AGR-.js +424 -0
- package/dist/Goals-CD8vdUPQ.js +247 -0
- package/dist/{Grab-DmmwrGzk.js → Grab-KDYktOCn.js} +33 -32
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DNtLW0yQ.js → ImageInput.vue_vue_type_script_setup_true_lang-DUi1YY1x.js} +1 -1
- package/dist/{Index-m7l4insz.js → Index-BT4esMkG.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B9sJ-M20.js → LocationPicker.vue_vue_type_script_setup_true_lang-BRCrx3DA.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Dsg2sWjF.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D3G4alTX.js} +1 -1
- package/dist/LoyaltyDashboard-CzmwuzTw.js +2911 -0
- package/dist/MainLayout-CVYfxfuS.js +143 -0
- package/dist/{Marketing-C9pSIdBU.js → Marketing-sDWWcaL5.js} +7 -6
- package/dist/{MarketingMaterialEdit-BEF2T9LR.js → MarketingMaterialEdit-DHmI38Lo.js} +15 -14
- package/dist/Member-sdcMiTmr.js +654 -0
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DqchRq6h.js +1281 -0
- package/dist/MemberImportHistory-Df_5SiGn.js +187 -0
- package/dist/MemberList-BGoClGZE.js +334 -0
- package/dist/{MemberTransactions-CAut1TQb.js → MemberTransactions-qR38yGk5.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-1AuHixPC.js → MessageInput.vue_vue_type_script_setup_true_lang-D4yY57Vo.js} +5928 -5644
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Co9oeOFx.js +40 -0
- package/dist/Mission-DSyqYeI6.js +363 -0
- package/dist/{Overview-DOJj4XvO.js → Overview-BDM8Lxfv.js} +23 -20
- package/dist/Overview-sLhLv5Oa.js +1316 -0
- package/dist/Point-DO5Z5sOL.js +297 -0
- package/dist/Promotion-BXm1Dxlv.js +426 -0
- package/dist/{Queue-55G2gtP5.js → Queue-C4kEj_Bp.js} +16 -13
- package/dist/{Record-DNPI02c6.js → Record-iKUy-nn3.js} +9 -9
- package/dist/Review-D-3-BRON.js +45 -0
- package/dist/ReviewFacebookCallback-SLzE3D7c.js +238 -0
- package/dist/ReviewGoogleCallback-DntrtfGB.js +213 -0
- package/dist/{Reward-CnP8R2pS.js → Reward-CNQS6F2m.js} +28 -28
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BN71h9IK.js → RewardGroup.vue_vue_type_script_setup_true_lang-D0ZNJilO.js} +26 -23
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CtB9Ls5-.js → RuleGroup.vue_vue_type_script_setup_true_lang-BgvaMOAJ.js} +198 -186
- package/dist/{Segment-CxiQnnyj.js → Segment-Bi58A7cw.js} +278 -276
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B1vj5f7T.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CxC6ZLZT.js} +45 -42
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-cWx0G3nM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CToVAWKO.js} +4 -4
- package/dist/Setting-CixcOp_l.js +574 -0
- package/dist/{SettingAdvertisements-Vt7w1WN3.js → SettingAdvertisements-DkPNDfxz.js} +12 -12
- package/dist/Settings-bD_DkKI0.js +230 -0
- package/dist/Store-BvnsumDX.js +2615 -0
- package/dist/{StoreRewards-DILeipMG.js → StoreRewards-CKPnV_j3.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-k46T2rql.js +1319 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C7lVeybl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-IknvTIMG.js} +2 -2
- package/dist/{Tier-BAZ1xuKL.js → Tier-CiKGy-Do.js} +2576 -757
- package/dist/{Title-CcNAt47f.js → Title-CNFamvkQ.js} +41 -37
- package/dist/Transaction-C8SnyFML.js +45 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hUjQVZ_U.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DQrTH7cz.js} +26 -26
- package/dist/Voucher-9Q-GHuvD.js +837 -0
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CTQDxc5l.js → VoucherEditor.vue_vue_type_script_setup_true_lang-B-6mF0RH.js} +118 -124
- package/dist/WhatsappAccount-DRKJVs0I.js +325 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DGOPGiGH.js +96 -0
- package/dist/WhatsappBot-muUmTIyY.js +441 -0
- package/dist/WhatsappBotSettings-DUjKwiv6.js +136 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DuRKA4cj.js → ZodTextField.vue_vue_type_script_setup_true_lang-7tSuZ_C3.js} +2 -2
- package/dist/{app-Z-UKRG5V.js → app-CQnX8TXq.js} +50951 -42514
- package/dist/app.js +1 -1
- package/dist/base.export-CwCY41wr.js +75 -0
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-C7EF6cKC.js → business-DGYo03yh.js} +5 -5
- package/dist/campaign-BFhMhQWk.js +400 -0
- package/dist/campaign-BmVMseCM.js +100 -0
- package/dist/{campaign.enum-BNN2gLFY.js → campaign.enum-Dx-Zo68Q.js} +1 -1
- package/dist/campaign.fn-DHdhR9C8.js +776 -0
- package/dist/{collectible.enum-DO9HdJGH.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/collection.fn-CYrQd8Th.js +26 -0
- package/dist/currency-B7wFZjCM.js +7 -0
- package/dist/{duplicateCampaign-2ODeDw3a.js → duplicateCampaign-C62eVSKZ.js} +11 -11
- package/dist/{effect-BcB8IlTI.js → effect-XVC0SyM1.js} +1 -1
- package/dist/{email-addresses-BcTeU4Sh.js → email-addresses-DUWzbknH.js} +209 -201
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-BSgrCJRv.js → helper-Bw_KFook.js} +1 -1
- package/dist/index-B88wz0DA.js +53 -0
- package/dist/{index-iMPtFp54.js → index-BHPcqvxB.js} +10 -9
- package/dist/{index-HXiYGO4_.js → index-BL01AAGF.js} +6343 -7693
- package/dist/index-BpcakDLo.js +32438 -0
- package/dist/{index-VlFWaBrg.js → index-Bu0rl1Jm.js} +1 -1
- package/dist/{index-BpI-BI4H.js → index-C0WVYJgp.js} +4 -4
- package/dist/index-C5a9ZaAM.js +151 -0
- package/dist/{index-CsoBDon4.js → index-CRX2b_-n.js} +1590 -1523
- package/dist/{index-CIBPhxlC.js → index-CSaO5mCs.js} +105 -123
- package/dist/{index-hlyg-wxV.js → index-CX2tKi6X.js} +1 -1
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-BoYEqLif.js → index-CmJ4UtbH.js} +1517 -263
- package/dist/index-CoaZuwwm.js +172 -0
- package/dist/{index-Bf6jNZit.js → index-CsZ7_Qzf.js} +24 -9
- package/dist/index-D5D85re4.js +902 -0
- package/dist/index-D89ye2yV.js +74 -0
- package/dist/index-DHRVhERM.js +14550 -0
- package/dist/index-DKabvlsg.js +69 -0
- package/dist/{index-CoHWpylO.js → index-DlFjUct2.js} +2140 -2557
- package/dist/index-XCHxkJPE.js +137 -0
- package/dist/index-o2Ga_qaX.js +39 -0
- package/dist/index-z0K48rtR.js +54 -0
- package/dist/{index.esm2017-CM7OnEyP.js → index.esm2017-cOXL--fX.js} +164 -164
- package/dist/{loading-CSXr0Yqz.js → loading-BlfJuA-h.js} +1 -1
- package/dist/{lodash-Bh7XKI-R.js → lodash-CFkpI5Sp.js} +1 -1
- package/dist/member-import-B4ihDPgR.js +188 -0
- package/dist/membership-CyNEU3ld.js +274 -0
- package/dist/{money-BZIST_m9.js → money-B0QV3AtE.js} +1 -1
- package/dist/{number-DXLR2w95.js → number-DJ7EhoTu.js} +1 -1
- package/dist/objectid-DZ8o9_J4.js +145 -0
- package/dist/onboarding-BhMbuIRK.js +131 -0
- package/dist/onboardingSetup-BZMYTun6.js +17 -0
- package/dist/{plugins-4FlbwoES.js → plugins-C7hEP98r.js} +13 -12
- package/dist/remy-Qz_pNsUS.js +13 -0
- package/dist/{reward-DUbl79bZ.js → reward-D4975Y4s.js} +1 -1
- package/dist/{rule-BQUoZ4l_.js → rule-BfSrqM9Z.js} +337 -275
- package/dist/style.css +1 -1
- package/dist/{template-BoiSG7G7.js → template-CTCYJKDu.js} +6 -6
- package/dist/timezone-hBjTK85u.js +20 -0
- package/dist/transaction.fn-1iGyAGZA.js +71 -0
- package/dist/{trigger-D5g5m6tT.js → trigger-CdJikvw9.js} +17 -17
- package/dist/useMarketingMaterialActions-R1rDbIr8.js +96 -0
- package/dist/{usePagination-DHePBBoR.js → usePagination-CqSRHo9z.js} +1 -1
- package/dist/{user-C_ToSo-g.js → user-C8i4TfQt.js} +1 -1
- package/dist/vue-i18n-CiJ_kNkt.js +2365 -0
- package/dist/{xlsx-h4G1C-xj.js → xlsx-DGiPalb9.js} +440 -440
- package/dist/{zod-CgigfJar.js → zod-CKl6yP5K.js} +1 -1
- package/package.json +10 -6
- package/dist/Broadcast-C9akM-TB.js +0 -266
- package/dist/Card-DRkIYs0M.js +0 -910
- package/dist/Credit-V5YA_hGx.js +0 -260
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CYQMXARx.js +0 -3377
- package/dist/Experience-WTWy5yY6.js +0 -259
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-BwOfTCW5.js +0 -330
- package/dist/LoyaltyDashboard-CJdhYiea.js +0 -1082
- package/dist/MainLayout-Du5kZOtA.js +0 -41
- package/dist/Member-DUV_vbPI.js +0 -280
- package/dist/MemberList-Ye4nOk-i.js +0 -1601
- package/dist/Mission-BBmCGpt8.js +0 -334
- package/dist/Point-Bzg6hi6o.js +0 -262
- package/dist/Promotion-BMXIp_ef.js +0 -397
- package/dist/Review-CYNPPxYU.js +0 -1141
- package/dist/ReviewFacebookCallback-0SUkKAaC.js +0 -243
- package/dist/ReviewGoogleCallback-BZEzx68n.js +0 -208
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C4vohf6c.js +0 -181
- package/dist/Setting-jHAjccod.js +0 -2047
- package/dist/Store-Cu-hKmVa.js +0 -1996
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CGz6CTWA.js +0 -1130
- package/dist/Transaction-D7DO3dKQ.js +0 -39
- package/dist/Voucher-Cq-n1CaC.js +0 -421
- package/dist/campaign--MjoY1Mn.js +0 -219
- package/dist/campaign-DHBuP4UA.js +0 -277
- package/dist/campaign.fn-Bd34dVnx.js +0 -776
- package/dist/export-CjB7qxZ9.js +0 -97
- package/dist/index-BIAjmMga.js +0 -85
- package/dist/index-Bm0QPucw.js +0 -67
- package/dist/index-Bv4MBLQ5.js +0 -52
- package/dist/index-hbyCVNa7.js +0 -30289
- package/dist/membership-CfredTm3.js +0 -255
- package/dist/objectid-Dg4ZodlT.js +0 -145
- package/dist/useMarketingMaterialActions-B-Jlw2Z9.js +0 -107
- package/dist/vue-i18n-BcYh6_51.js +0 -2365
|
@@ -1,21 +1,23 @@
|
|
|
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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { S as
|
|
15
|
-
|
|
1
|
+
import { defineComponent as xe, ref as ee, h as U, Comment as cn, computed as ne, watch as pe, resolveComponent as Z, openBlock as W, createElementBlock as me, createVNode as S, unref as g, createElementVNode as v, toDisplayString as R, createBlock as Oe, withCtx as Q, Fragment as It, renderList as ln, onMounted as un, createCommentVNode as Pe, nextTick as dn } from "vue";
|
|
2
|
+
import { useRouter as yt, useRoute as wt, RouterView as hn } from "vue-router";
|
|
3
|
+
import { useCoreStore as ge, FeedMeAuth as fn } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as pn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as mn } from "./business-DGYo03yh.js";
|
|
6
|
+
import "./index-CX2tKi6X.js";
|
|
7
|
+
import { components as j, useSnackbar as gn, useDialog as _n } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Tt } from "./vue-i18n-CiJ_kNkt.js";
|
|
9
|
+
import { m as vn } from "./index-CSaO5mCs.js";
|
|
10
|
+
import { C as Xe } from "./timezone-hBjTK85u.js";
|
|
11
|
+
import { u as In } from "./onboarding-BhMbuIRK.js";
|
|
12
|
+
import { R as f, A as yn, a as Qe } from "./app-CQnX8TXq.js";
|
|
13
|
+
import { J as wn } from "./JsonViewer-v8_C7l5N.js";
|
|
14
|
+
import { r as Le, L as Tn, g as kt, i as kn, a as bn, _ as Ze, C as et, b as En, S as re, c as A, d as Y, E as Fe, e as Sn, f as bt, h as Rn, j as An, k as Et, l as w, m as Pn, F as Ve, n as Cn, q as se, o as Nn, p as On, s as Ln, t as Mn, u as Un } from "./index.esm2017-cOXL--fX.js";
|
|
15
|
+
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
16
|
+
import { S as tt, c as Dn } from "./index-BpcakDLo.js";
|
|
17
|
+
const xn = { class: "flex flex-col h-full justify-between py-16" }, Fn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Vn = /* @__PURE__ */ xe({
|
|
16
18
|
__name: "NavigationTab",
|
|
17
19
|
setup(n) {
|
|
18
|
-
const { t: e } =
|
|
20
|
+
const { t: e, locale: t } = Tt(), i = In(), r = ee(), s = [
|
|
19
21
|
{
|
|
20
22
|
label: e("connect.navigation.analytic"),
|
|
21
23
|
value: f["$connect-ANALYTIC"]
|
|
@@ -61,7 +63,7 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
61
63
|
{
|
|
62
64
|
label: e("connect.navigation.point"),
|
|
63
65
|
value: f["$connect-PROGRAM_POINT"],
|
|
64
|
-
badge: () =>
|
|
66
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
label: e("connect.navigation.credit"),
|
|
@@ -70,7 +72,7 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
70
72
|
{
|
|
71
73
|
label: e("connect.navigation.game"),
|
|
72
74
|
value: f["$connect-PROGRAM_GAME"],
|
|
73
|
-
badge: () =>
|
|
75
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
74
76
|
},
|
|
75
77
|
{
|
|
76
78
|
label: "Mission",
|
|
@@ -89,19 +91,24 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
89
91
|
{
|
|
90
92
|
label: e("connect.navigation.segments"),
|
|
91
93
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
92
|
-
badge: () =>
|
|
94
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
97
|
label: e("connect.navigation.card"),
|
|
96
98
|
value: f["$connect-LOYALTY_CARD"],
|
|
97
|
-
badge: () =>
|
|
99
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
98
100
|
}
|
|
99
101
|
]
|
|
100
102
|
},
|
|
103
|
+
{
|
|
104
|
+
label: e("connect.navigation.whatsappBot"),
|
|
105
|
+
value: f["$connect-WHATSAPP"],
|
|
106
|
+
badge: () => U(j.FmPill, { variant: "beta" })
|
|
107
|
+
},
|
|
101
108
|
{
|
|
102
109
|
label: e("connect.navigation.referral"),
|
|
103
110
|
value: f["$connect-REFERRAL"],
|
|
104
|
-
badge: () =>
|
|
111
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
105
112
|
},
|
|
106
113
|
{
|
|
107
114
|
label: e("connect.navigation.store"),
|
|
@@ -123,6 +130,15 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
123
130
|
label: e("connect.navigation.review"),
|
|
124
131
|
value: f["$connect-REVIEW"]
|
|
125
132
|
},
|
|
133
|
+
{
|
|
134
|
+
label: e("connect.navigation.goals"),
|
|
135
|
+
value: f["$connect-GOALS"],
|
|
136
|
+
badge: () => i.goalsRemaining > 0 ? U(j.FmBadge, {
|
|
137
|
+
variant: "numeric",
|
|
138
|
+
inline: !0,
|
|
139
|
+
value: i.goalsRemaining
|
|
140
|
+
}) : U(cn)
|
|
141
|
+
},
|
|
126
142
|
{
|
|
127
143
|
label: e("connect.navigation.setting"),
|
|
128
144
|
value: f["$connect-SETTING"]
|
|
@@ -131,40 +147,193 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
131
147
|
label: e("connect.navigation.bin"),
|
|
132
148
|
value: f["$connect-BIN"]
|
|
133
149
|
}
|
|
134
|
-
],
|
|
135
|
-
const
|
|
136
|
-
return console.log(`[MF] Timezone set to: ${
|
|
150
|
+
], o = yt(), c = wt(), a = s.reduce((h, y) => [...(y.children ?? []).map((_) => _.value), ...h, y.value], []), l = ge(), d = ne(() => {
|
|
151
|
+
const h = l.currentCountry.value || "MY";
|
|
152
|
+
return console.log(`[MF] Timezone set to: ${Xe[h]}`), Xe[h];
|
|
137
153
|
});
|
|
138
|
-
|
|
139
|
-
()
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
154
|
+
pe(
|
|
155
|
+
// Watch `route.matched`, not `route`: `useRoute()` returns a reactive object
|
|
156
|
+
// whose identity never changes, so watching it directly fired once via
|
|
157
|
+
// `immediate` and the highlight then stayed on whatever page loaded first.
|
|
158
|
+
() => c.matched,
|
|
159
|
+
(h) => {
|
|
160
|
+
const _ = h.map((p) => p.name).reverse().find((p) => a.includes(p));
|
|
161
|
+
_ && (r.value = _);
|
|
162
|
+
},
|
|
163
|
+
{ immediate: !0 }
|
|
164
|
+
), pe(
|
|
165
|
+
[() => {
|
|
166
|
+
var h;
|
|
167
|
+
return (h = l.currentBusiness.value) == null ? void 0 : h._id;
|
|
168
|
+
}, () => c.name, t],
|
|
169
|
+
([h]) => {
|
|
170
|
+
h && i.read(t.value, h);
|
|
143
171
|
},
|
|
144
172
|
{ immediate: !0 }
|
|
145
173
|
);
|
|
146
|
-
async function
|
|
147
|
-
await
|
|
174
|
+
async function m(h) {
|
|
175
|
+
await o.push({ name: h });
|
|
148
176
|
}
|
|
149
|
-
return (
|
|
150
|
-
var
|
|
151
|
-
const
|
|
152
|
-
return
|
|
153
|
-
|
|
177
|
+
return (h, y) => {
|
|
178
|
+
var p;
|
|
179
|
+
const _ = Z("FmCollapsibleTabs");
|
|
180
|
+
return W(), me("div", xn, [
|
|
181
|
+
S(_, {
|
|
154
182
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
155
|
-
"model-value": (
|
|
156
|
-
items:
|
|
157
|
-
"onUpdate:modelValue":
|
|
183
|
+
"model-value": (p = g(r)) == null ? void 0 : p.toString(),
|
|
184
|
+
items: s,
|
|
185
|
+
"onUpdate:modelValue": m
|
|
158
186
|
}, null, 8, ["model-value"]),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
187
|
+
v("div", Fn, [
|
|
188
|
+
v("div", null, "Timezone: " + R(g(d).split("/")[1].replace("_", " ")), 1),
|
|
189
|
+
v("div", null, "(UTC" + R(g(vn).tz(g(d)).format("Z")) + ")", 1)
|
|
162
190
|
])
|
|
163
191
|
]);
|
|
164
192
|
};
|
|
165
193
|
}
|
|
194
|
+
}), St = "feedme_connect_marketing_promo_hidden";
|
|
195
|
+
function $n() {
|
|
196
|
+
try {
|
|
197
|
+
return localStorage.getItem(St) !== null;
|
|
198
|
+
} catch {
|
|
199
|
+
return !1;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function Hn() {
|
|
203
|
+
try {
|
|
204
|
+
localStorage.setItem(St, (/* @__PURE__ */ new Date()).toISOString());
|
|
205
|
+
} catch {
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const jn = { class: "flex flex-col gap-12" }, Wn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, Gn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Bn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, zn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, qn = { class: "flex flex-col gap-24 pb-8" }, Kn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, Jn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Yn = { class: "fm-typo-en-body-lg-600" }, Xn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Qn = { class: "shrink-0" }, Zn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ei = { class: "flex w-full flex-col gap-12 px-[16px]" }, ti = { class: "flex flex-wrap items-center gap-12" }, ni = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ii = /* @__PURE__ */ xe({
|
|
209
|
+
__name: "AiMarketingPromoDialog",
|
|
210
|
+
setup(n) {
|
|
211
|
+
let e = !1;
|
|
212
|
+
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } = ge(), o = ee(!1), c = [
|
|
213
|
+
{ key: "completeContent", icon: "layers" },
|
|
214
|
+
{ key: "realContext", icon: "storefront" },
|
|
215
|
+
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
216
|
+
], a = ne(() => {
|
|
217
|
+
var _;
|
|
218
|
+
const y = ((_ = r.value) == null ? void 0 : _.permissions) ?? [];
|
|
219
|
+
return yn(
|
|
220
|
+
[
|
|
221
|
+
{
|
|
222
|
+
action: Qe.Action.manage,
|
|
223
|
+
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
y
|
|
227
|
+
).granted;
|
|
228
|
+
}), l = ne(
|
|
229
|
+
() => s.value === "MY" && a.value
|
|
230
|
+
);
|
|
231
|
+
let d = !1;
|
|
232
|
+
pe(
|
|
233
|
+
l,
|
|
234
|
+
(y) => {
|
|
235
|
+
d || !y || (d = !0, !($n() || e) && (e = !0, o.value = !0));
|
|
236
|
+
},
|
|
237
|
+
{ immediate: !0 }
|
|
238
|
+
);
|
|
239
|
+
async function m() {
|
|
240
|
+
o.value = !1, await i.push({ name: f["$connect-MARKETING"] });
|
|
241
|
+
}
|
|
242
|
+
function h() {
|
|
243
|
+
Hn(), o.value = !1;
|
|
244
|
+
}
|
|
245
|
+
return (y, _) => {
|
|
246
|
+
const p = Z("FmIcon"), I = Z("FmCard"), T = Z("FmButton"), M = Z("FmDialog");
|
|
247
|
+
return W(), Oe(M, {
|
|
248
|
+
modelValue: o.value,
|
|
249
|
+
"onUpdate:modelValue": _[0] || (_[0] = (k) => o.value = k),
|
|
250
|
+
"min-width": "min(500px, calc(100% - 48px))",
|
|
251
|
+
"max-width": "min(860px, calc(100% - 48px))",
|
|
252
|
+
"max-height": "90vh",
|
|
253
|
+
"dismiss-away": ""
|
|
254
|
+
}, {
|
|
255
|
+
"dialog-header": Q(() => [
|
|
256
|
+
v("div", jn, [
|
|
257
|
+
v("div", Wn, [
|
|
258
|
+
S(p, {
|
|
259
|
+
name: "auto_awesome",
|
|
260
|
+
size: "sm",
|
|
261
|
+
color: "primary"
|
|
262
|
+
}),
|
|
263
|
+
v("span", Gn, R(g(t)("connect.marketing.whatsNew.badge")), 1)
|
|
264
|
+
]),
|
|
265
|
+
v("h1", Bn, R(g(t)("connect.marketing.whatsNew.title")), 1),
|
|
266
|
+
v("p", zn, R(g(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
267
|
+
])
|
|
268
|
+
]),
|
|
269
|
+
"dialog-footer": Q(() => [
|
|
270
|
+
v("div", ei, [
|
|
271
|
+
v("div", ti, [
|
|
272
|
+
S(T, {
|
|
273
|
+
variant: "primary",
|
|
274
|
+
size: "lg",
|
|
275
|
+
label: g(t)("connect.marketing.whatsNew.cta"),
|
|
276
|
+
"append-icon": "arrow_forward",
|
|
277
|
+
onClick: m
|
|
278
|
+
}, null, 8, ["label"]),
|
|
279
|
+
S(T, {
|
|
280
|
+
variant: "tertiary",
|
|
281
|
+
size: "lg",
|
|
282
|
+
label: g(t)("connect.marketing.whatsNew.dismiss"),
|
|
283
|
+
onClick: h
|
|
284
|
+
}, null, 8, ["label"])
|
|
285
|
+
]),
|
|
286
|
+
v("div", ni, R(g(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
287
|
+
])
|
|
288
|
+
]),
|
|
289
|
+
default: Q(() => [
|
|
290
|
+
v("div", qn, [
|
|
291
|
+
v("div", Kn, [
|
|
292
|
+
(W(), me(It, null, ln(c, (k) => S(I, {
|
|
293
|
+
key: k.key,
|
|
294
|
+
variant: "outlined",
|
|
295
|
+
class: "!h-full flex flex-col gap-8 p-16"
|
|
296
|
+
}, {
|
|
297
|
+
default: Q(() => [
|
|
298
|
+
v("div", Jn, [
|
|
299
|
+
S(p, {
|
|
300
|
+
name: k.icon,
|
|
301
|
+
size: "md",
|
|
302
|
+
color: "primary"
|
|
303
|
+
}, null, 8, ["name"])
|
|
304
|
+
]),
|
|
305
|
+
v("div", Yn, R(g(t)(`connect.marketing.whatsNew.benefits.${k.key}.title`)), 1),
|
|
306
|
+
v("div", Xn, R(g(t)(
|
|
307
|
+
`connect.marketing.whatsNew.benefits.${k.key}.description`
|
|
308
|
+
)), 1)
|
|
309
|
+
]),
|
|
310
|
+
_: 2
|
|
311
|
+
}, 1024)), 64))
|
|
312
|
+
]),
|
|
313
|
+
S(I, {
|
|
314
|
+
variant: "outlined",
|
|
315
|
+
class: "flex items-start gap-12 p-16"
|
|
316
|
+
}, {
|
|
317
|
+
default: Q(() => [
|
|
318
|
+
v("div", Qn, [
|
|
319
|
+
S(p, {
|
|
320
|
+
name: "lightbulb",
|
|
321
|
+
size: "md",
|
|
322
|
+
color: "primary"
|
|
323
|
+
})
|
|
324
|
+
]),
|
|
325
|
+
v("p", Zn, R(g(t)("connect.marketing.whatsNew.callout")), 1)
|
|
326
|
+
]),
|
|
327
|
+
_: 1
|
|
328
|
+
})
|
|
329
|
+
])
|
|
330
|
+
]),
|
|
331
|
+
_: 1
|
|
332
|
+
}, 8, ["modelValue"]);
|
|
333
|
+
};
|
|
334
|
+
}
|
|
166
335
|
});
|
|
167
|
-
var
|
|
336
|
+
var ri = "firebase", si = "10.12.4";
|
|
168
337
|
/**
|
|
169
338
|
* @license
|
|
170
339
|
* Copyright 2020 Google LLC
|
|
@@ -181,13 +350,13 @@ var Ln = "firebase", Mn = "10.12.4";
|
|
|
181
350
|
* See the License for the specific language governing permissions and
|
|
182
351
|
* limitations under the License.
|
|
183
352
|
*/
|
|
184
|
-
|
|
185
|
-
function
|
|
353
|
+
Le(ri, si, "app");
|
|
354
|
+
function Rt() {
|
|
186
355
|
return {
|
|
187
356
|
"dependent-sdk-initialized-before-auth": "Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."
|
|
188
357
|
};
|
|
189
358
|
}
|
|
190
|
-
const
|
|
359
|
+
const oi = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
191
360
|
/**
|
|
192
361
|
* @license
|
|
193
362
|
* Copyright 2020 Google LLC
|
|
@@ -204,12 +373,12 @@ const Un = It, Tt = new Ce("auth", "Firebase", It());
|
|
|
204
373
|
* See the License for the specific language governing permissions and
|
|
205
374
|
* limitations under the License.
|
|
206
375
|
*/
|
|
207
|
-
const
|
|
208
|
-
function
|
|
209
|
-
|
|
376
|
+
const _e = new Tn("@firebase/auth");
|
|
377
|
+
function ai(n, ...e) {
|
|
378
|
+
_e.logLevel <= Et.WARN && _e.warn(`Auth (${re}): ${n}`, ...e);
|
|
210
379
|
}
|
|
211
|
-
function
|
|
212
|
-
|
|
380
|
+
function ue(n, ...e) {
|
|
381
|
+
_e.logLevel <= Et.ERROR && _e.error(`Auth (${re}): ${n}`, ...e);
|
|
213
382
|
}
|
|
214
383
|
/**
|
|
215
384
|
* @license
|
|
@@ -227,38 +396,38 @@ function re(n, ...e) {
|
|
|
227
396
|
* See the License for the specific language governing permissions and
|
|
228
397
|
* limitations under the License.
|
|
229
398
|
*/
|
|
230
|
-
function
|
|
231
|
-
throw
|
|
399
|
+
function O(n, ...e) {
|
|
400
|
+
throw He(n, ...e);
|
|
232
401
|
}
|
|
233
|
-
function
|
|
234
|
-
return
|
|
402
|
+
function b(n, ...e) {
|
|
403
|
+
return He(n, ...e);
|
|
235
404
|
}
|
|
236
|
-
function
|
|
237
|
-
const i = Object.assign(Object.assign({},
|
|
238
|
-
return new
|
|
405
|
+
function Pt(n, e, t) {
|
|
406
|
+
const i = Object.assign(Object.assign({}, oi()), { [e]: t });
|
|
407
|
+
return new Fe("auth", "Firebase", i).create(e, {
|
|
239
408
|
appName: n.name
|
|
240
409
|
});
|
|
241
410
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
411
|
+
function H(n) {
|
|
412
|
+
return Pt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
244
413
|
}
|
|
245
|
-
function
|
|
414
|
+
function He(n, ...e) {
|
|
246
415
|
if (typeof n != "string") {
|
|
247
416
|
const t = e[0], i = [...e.slice(1)];
|
|
248
417
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
249
418
|
}
|
|
250
|
-
return
|
|
419
|
+
return At.create(n, ...e);
|
|
251
420
|
}
|
|
252
421
|
function u(n, e, ...t) {
|
|
253
422
|
if (!n)
|
|
254
|
-
throw
|
|
423
|
+
throw He(e, ...t);
|
|
255
424
|
}
|
|
256
|
-
function
|
|
425
|
+
function P(n) {
|
|
257
426
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
258
|
-
throw
|
|
427
|
+
throw ue(e), new Error(e);
|
|
259
428
|
}
|
|
260
|
-
function
|
|
261
|
-
n ||
|
|
429
|
+
function L(n, e) {
|
|
430
|
+
n || P(e);
|
|
262
431
|
}
|
|
263
432
|
/**
|
|
264
433
|
* @license
|
|
@@ -276,14 +445,14 @@ function A(n, e) {
|
|
|
276
445
|
* See the License for the specific language governing permissions and
|
|
277
446
|
* limitations under the License.
|
|
278
447
|
*/
|
|
279
|
-
function
|
|
448
|
+
function Me() {
|
|
280
449
|
var n;
|
|
281
450
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
282
451
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
452
|
+
function ci() {
|
|
453
|
+
return nt() === "http:" || nt() === "https:";
|
|
285
454
|
}
|
|
286
|
-
function
|
|
455
|
+
function nt() {
|
|
287
456
|
var n;
|
|
288
457
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
|
289
458
|
}
|
|
@@ -303,15 +472,15 @@ function Je() {
|
|
|
303
472
|
* See the License for the specific language governing permissions and
|
|
304
473
|
* limitations under the License.
|
|
305
474
|
*/
|
|
306
|
-
function
|
|
475
|
+
function li() {
|
|
307
476
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
308
477
|
// This is especially true for Cordova apps which have unreliable
|
|
309
478
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
310
479
|
// installed which overwrites the native navigator.onLine value and
|
|
311
480
|
// defines navigator.connection.
|
|
312
|
-
(
|
|
481
|
+
(ci() || En() || "connection" in navigator) ? navigator.onLine : !0;
|
|
313
482
|
}
|
|
314
|
-
function
|
|
483
|
+
function ui() {
|
|
315
484
|
if (typeof navigator > "u")
|
|
316
485
|
return null;
|
|
317
486
|
const n = navigator;
|
|
@@ -339,12 +508,12 @@ function Vn() {
|
|
|
339
508
|
* See the License for the specific language governing permissions and
|
|
340
509
|
* limitations under the License.
|
|
341
510
|
*/
|
|
342
|
-
class
|
|
511
|
+
class oe {
|
|
343
512
|
constructor(e, t) {
|
|
344
|
-
this.shortDelay = e, this.longDelay = t,
|
|
513
|
+
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile = kn() || bn();
|
|
345
514
|
}
|
|
346
515
|
get() {
|
|
347
|
-
return
|
|
516
|
+
return li() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
348
517
|
}
|
|
349
518
|
}
|
|
350
519
|
/**
|
|
@@ -363,8 +532,8 @@ class X {
|
|
|
363
532
|
* See the License for the specific language governing permissions and
|
|
364
533
|
* limitations under the License.
|
|
365
534
|
*/
|
|
366
|
-
function
|
|
367
|
-
|
|
535
|
+
function je(n, e) {
|
|
536
|
+
L(n.emulator, "Emulator should always be set here");
|
|
368
537
|
const { url: t } = n.emulator;
|
|
369
538
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
370
539
|
}
|
|
@@ -384,7 +553,7 @@ function Me(n, e) {
|
|
|
384
553
|
* See the License for the specific language governing permissions and
|
|
385
554
|
* limitations under the License.
|
|
386
555
|
*/
|
|
387
|
-
class
|
|
556
|
+
class Ct {
|
|
388
557
|
static initialize(e, t, i) {
|
|
389
558
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
390
559
|
}
|
|
@@ -397,7 +566,7 @@ class wt {
|
|
|
397
566
|
return globalThis.fetch;
|
|
398
567
|
if (typeof fetch < "u")
|
|
399
568
|
return fetch;
|
|
400
|
-
|
|
569
|
+
P("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
401
570
|
}
|
|
402
571
|
static headers() {
|
|
403
572
|
if (this.headersImpl)
|
|
@@ -408,7 +577,7 @@ class wt {
|
|
|
408
577
|
return globalThis.Headers;
|
|
409
578
|
if (typeof Headers < "u")
|
|
410
579
|
return Headers;
|
|
411
|
-
|
|
580
|
+
P("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
412
581
|
}
|
|
413
582
|
static response() {
|
|
414
583
|
if (this.responseImpl)
|
|
@@ -419,7 +588,7 @@ class wt {
|
|
|
419
588
|
return globalThis.Response;
|
|
420
589
|
if (typeof Response < "u")
|
|
421
590
|
return Response;
|
|
422
|
-
|
|
591
|
+
P("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
423
592
|
}
|
|
424
593
|
}
|
|
425
594
|
/**
|
|
@@ -438,7 +607,7 @@ class wt {
|
|
|
438
607
|
* See the License for the specific language governing permissions and
|
|
439
608
|
* limitations under the License.
|
|
440
609
|
*/
|
|
441
|
-
const
|
|
610
|
+
const di = {
|
|
442
611
|
// Custom token errors.
|
|
443
612
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
444
613
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -529,93 +698,93 @@ const $n = {
|
|
|
529
698
|
* See the License for the specific language governing permissions and
|
|
530
699
|
* limitations under the License.
|
|
531
700
|
*/
|
|
532
|
-
const
|
|
533
|
-
function
|
|
701
|
+
const hi = new oe(3e4, 6e4);
|
|
702
|
+
function Te(n, e) {
|
|
534
703
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
535
704
|
}
|
|
536
|
-
async function
|
|
537
|
-
return
|
|
705
|
+
async function X(n, e, t, i, r = {}) {
|
|
706
|
+
return Nt(n, r, async () => {
|
|
538
707
|
let s = {}, o = {};
|
|
539
708
|
i && (e === "GET" ? o = i : s = {
|
|
540
709
|
body: JSON.stringify(i)
|
|
541
710
|
});
|
|
542
|
-
const c =
|
|
711
|
+
const c = se(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
543
712
|
return a[
|
|
544
713
|
"Content-Type"
|
|
545
714
|
/* HttpHeader.CONTENT_TYPE */
|
|
546
715
|
] = "application/json", n.languageCode && (a[
|
|
547
716
|
"X-Firebase-Locale"
|
|
548
717
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
549
|
-
] = n.languageCode),
|
|
718
|
+
] = n.languageCode), Ct.fetch()(Lt(n, n.config.apiHost, t, c), Object.assign({
|
|
550
719
|
method: e,
|
|
551
720
|
headers: a,
|
|
552
721
|
referrerPolicy: "no-referrer"
|
|
553
722
|
}, s));
|
|
554
723
|
});
|
|
555
724
|
}
|
|
556
|
-
async function
|
|
725
|
+
async function Nt(n, e, t) {
|
|
557
726
|
n._canInitEmulator = !1;
|
|
558
|
-
const i = Object.assign(Object.assign({},
|
|
727
|
+
const i = Object.assign(Object.assign({}, di), e);
|
|
559
728
|
try {
|
|
560
|
-
const r = new
|
|
729
|
+
const r = new fi(n), s = await Promise.race([
|
|
561
730
|
t(),
|
|
562
731
|
r.promise
|
|
563
732
|
]);
|
|
564
733
|
r.clearNetworkTimeout();
|
|
565
734
|
const o = await s.json();
|
|
566
735
|
if ("needConfirmation" in o)
|
|
567
|
-
throw
|
|
736
|
+
throw le(n, "account-exists-with-different-credential", o);
|
|
568
737
|
if (s.ok && !("errorMessage" in o))
|
|
569
738
|
return o;
|
|
570
739
|
{
|
|
571
740
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
572
741
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
573
|
-
throw
|
|
742
|
+
throw le(n, "credential-already-in-use", o);
|
|
574
743
|
if (a === "EMAIL_EXISTS")
|
|
575
|
-
throw
|
|
744
|
+
throw le(n, "email-already-in-use", o);
|
|
576
745
|
if (a === "USER_DISABLED")
|
|
577
|
-
throw
|
|
746
|
+
throw le(n, "user-disabled", o);
|
|
578
747
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
579
748
|
if (l)
|
|
580
|
-
throw
|
|
581
|
-
|
|
749
|
+
throw Pt(n, d, l);
|
|
750
|
+
O(n, d);
|
|
582
751
|
}
|
|
583
752
|
} catch (r) {
|
|
584
|
-
if (r instanceof
|
|
753
|
+
if (r instanceof Ve)
|
|
585
754
|
throw r;
|
|
586
|
-
|
|
755
|
+
O(n, "network-request-failed", { message: String(r) });
|
|
587
756
|
}
|
|
588
757
|
}
|
|
589
|
-
async function
|
|
590
|
-
const s = await
|
|
591
|
-
return "mfaPendingCredential" in s &&
|
|
758
|
+
async function Ot(n, e, t, i, r = {}) {
|
|
759
|
+
const s = await X(n, e, t, i, r);
|
|
760
|
+
return "mfaPendingCredential" in s && O(n, "multi-factor-auth-required", {
|
|
592
761
|
_serverResponse: s
|
|
593
762
|
}), s;
|
|
594
763
|
}
|
|
595
|
-
function
|
|
764
|
+
function Lt(n, e, t, i) {
|
|
596
765
|
const r = `${e}${t}?${i}`;
|
|
597
|
-
return n.config.emulator ?
|
|
766
|
+
return n.config.emulator ? je(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
598
767
|
}
|
|
599
|
-
class
|
|
768
|
+
class fi {
|
|
600
769
|
constructor(e) {
|
|
601
770
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
602
|
-
this.timer = setTimeout(() => i(
|
|
771
|
+
this.timer = setTimeout(() => i(b(
|
|
603
772
|
this.auth,
|
|
604
773
|
"network-request-failed"
|
|
605
774
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
606
|
-
)),
|
|
775
|
+
)), hi.get());
|
|
607
776
|
});
|
|
608
777
|
}
|
|
609
778
|
clearNetworkTimeout() {
|
|
610
779
|
clearTimeout(this.timer);
|
|
611
780
|
}
|
|
612
781
|
}
|
|
613
|
-
function
|
|
782
|
+
function le(n, e, t) {
|
|
614
783
|
const i = {
|
|
615
784
|
appName: n.name
|
|
616
785
|
};
|
|
617
786
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
618
|
-
const r =
|
|
787
|
+
const r = b(n, e, i);
|
|
619
788
|
return r.customData._tokenResponse = t, r;
|
|
620
789
|
}
|
|
621
790
|
/**
|
|
@@ -634,11 +803,11 @@ function ee(n, e, t) {
|
|
|
634
803
|
* See the License for the specific language governing permissions and
|
|
635
804
|
* limitations under the License.
|
|
636
805
|
*/
|
|
637
|
-
async function
|
|
638
|
-
return
|
|
806
|
+
async function pi(n, e) {
|
|
807
|
+
return X(n, "POST", "/v1/accounts:delete", e);
|
|
639
808
|
}
|
|
640
|
-
async function
|
|
641
|
-
return
|
|
809
|
+
async function Mt(n, e) {
|
|
810
|
+
return X(n, "POST", "/v1/accounts:lookup", e);
|
|
642
811
|
}
|
|
643
812
|
/**
|
|
644
813
|
* @license
|
|
@@ -656,7 +825,7 @@ async function St(n, e) {
|
|
|
656
825
|
* See the License for the specific language governing permissions and
|
|
657
826
|
* limitations under the License.
|
|
658
827
|
*/
|
|
659
|
-
function
|
|
828
|
+
function te(n) {
|
|
660
829
|
if (n)
|
|
661
830
|
try {
|
|
662
831
|
const e = new Date(Number(n));
|
|
@@ -665,8 +834,8 @@ function q(n) {
|
|
|
665
834
|
} catch {
|
|
666
835
|
}
|
|
667
836
|
}
|
|
668
|
-
async function
|
|
669
|
-
const t =
|
|
837
|
+
async function mi(n, e = !1) {
|
|
838
|
+
const t = Y(n), i = await t.getIdToken(e), r = We(i);
|
|
670
839
|
u(
|
|
671
840
|
r && r.exp && r.auth_time && r.iat,
|
|
672
841
|
t.auth,
|
|
@@ -677,29 +846,29 @@ async function Gn(n, e = !1) {
|
|
|
677
846
|
return {
|
|
678
847
|
claims: r,
|
|
679
848
|
token: i,
|
|
680
|
-
authTime:
|
|
681
|
-
issuedAtTime:
|
|
682
|
-
expirationTime:
|
|
849
|
+
authTime: te(Ce(r.auth_time)),
|
|
850
|
+
issuedAtTime: te(Ce(r.iat)),
|
|
851
|
+
expirationTime: te(Ce(r.exp)),
|
|
683
852
|
signInProvider: o || null,
|
|
684
853
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
685
854
|
};
|
|
686
855
|
}
|
|
687
|
-
function
|
|
856
|
+
function Ce(n) {
|
|
688
857
|
return Number(n) * 1e3;
|
|
689
858
|
}
|
|
690
|
-
function
|
|
859
|
+
function We(n) {
|
|
691
860
|
const [e, t, i] = n.split(".");
|
|
692
861
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
693
|
-
return
|
|
862
|
+
return ue("JWT malformed, contained fewer than 3 sections"), null;
|
|
694
863
|
try {
|
|
695
|
-
const r =
|
|
696
|
-
return r ? JSON.parse(r) : (
|
|
864
|
+
const r = Cn(t);
|
|
865
|
+
return r ? JSON.parse(r) : (ue("Failed to decode base64 JWT payload"), null);
|
|
697
866
|
} catch (r) {
|
|
698
|
-
return
|
|
867
|
+
return ue("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
699
868
|
}
|
|
700
869
|
}
|
|
701
|
-
function
|
|
702
|
-
const e =
|
|
870
|
+
function it(n) {
|
|
871
|
+
const e = We(n);
|
|
703
872
|
return u(
|
|
704
873
|
e,
|
|
705
874
|
"internal-error"
|
|
@@ -730,16 +899,16 @@ function Ye(n) {
|
|
|
730
899
|
* See the License for the specific language governing permissions and
|
|
731
900
|
* limitations under the License.
|
|
732
901
|
*/
|
|
733
|
-
async function
|
|
902
|
+
async function ie(n, e, t = !1) {
|
|
734
903
|
if (t)
|
|
735
904
|
return e;
|
|
736
905
|
try {
|
|
737
906
|
return await e;
|
|
738
907
|
} catch (i) {
|
|
739
|
-
throw i instanceof
|
|
908
|
+
throw i instanceof Ve && gi(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
740
909
|
}
|
|
741
910
|
}
|
|
742
|
-
function
|
|
911
|
+
function gi({ code: n }) {
|
|
743
912
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
744
913
|
}
|
|
745
914
|
/**
|
|
@@ -758,7 +927,7 @@ function Bn({ code: n }) {
|
|
|
758
927
|
* See the License for the specific language governing permissions and
|
|
759
928
|
* limitations under the License.
|
|
760
929
|
*/
|
|
761
|
-
class
|
|
930
|
+
class _i {
|
|
762
931
|
constructor(e) {
|
|
763
932
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
764
933
|
}
|
|
@@ -820,12 +989,12 @@ class zn {
|
|
|
820
989
|
* See the License for the specific language governing permissions and
|
|
821
990
|
* limitations under the License.
|
|
822
991
|
*/
|
|
823
|
-
class
|
|
992
|
+
class Ue {
|
|
824
993
|
constructor(e, t) {
|
|
825
994
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
826
995
|
}
|
|
827
996
|
_initializeTime() {
|
|
828
|
-
this.lastSignInTime =
|
|
997
|
+
this.lastSignInTime = te(this.lastLoginAt), this.creationTime = te(this.createdAt);
|
|
829
998
|
}
|
|
830
999
|
_copy(e) {
|
|
831
1000
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -853,9 +1022,9 @@ class Ae {
|
|
|
853
1022
|
* See the License for the specific language governing permissions and
|
|
854
1023
|
* limitations under the License.
|
|
855
1024
|
*/
|
|
856
|
-
async function
|
|
1025
|
+
async function ve(n) {
|
|
857
1026
|
var e;
|
|
858
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
1027
|
+
const t = n.auth, i = await n.getIdToken(), r = await ie(n, Mt(t, { idToken: i }));
|
|
859
1028
|
u(
|
|
860
1029
|
r == null ? void 0 : r.users.length,
|
|
861
1030
|
t,
|
|
@@ -864,7 +1033,7 @@ async function le(n) {
|
|
|
864
1033
|
);
|
|
865
1034
|
const s = r.users[0];
|
|
866
1035
|
n._notifyReloadListener(s);
|
|
867
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
1036
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c = Ii(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, m = {
|
|
868
1037
|
uid: s.localId,
|
|
869
1038
|
displayName: s.displayName || null,
|
|
870
1039
|
photoURL: s.photoUrl || null,
|
|
@@ -873,21 +1042,21 @@ async function le(n) {
|
|
|
873
1042
|
phoneNumber: s.phoneNumber || null,
|
|
874
1043
|
tenantId: s.tenantId || null,
|
|
875
1044
|
providerData: c,
|
|
876
|
-
metadata: new
|
|
1045
|
+
metadata: new Ue(s.createdAt, s.lastLoginAt),
|
|
877
1046
|
isAnonymous: d
|
|
878
1047
|
};
|
|
879
|
-
Object.assign(n,
|
|
1048
|
+
Object.assign(n, m);
|
|
880
1049
|
}
|
|
881
|
-
async function
|
|
882
|
-
const e =
|
|
883
|
-
await
|
|
1050
|
+
async function vi(n) {
|
|
1051
|
+
const e = Y(n);
|
|
1052
|
+
await ve(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
884
1053
|
}
|
|
885
|
-
function
|
|
1054
|
+
function Ii(n, e) {
|
|
886
1055
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
887
1056
|
}
|
|
888
|
-
function
|
|
1057
|
+
function Ut(n) {
|
|
889
1058
|
return n.map((e) => {
|
|
890
|
-
var { providerId: t } = e, i =
|
|
1059
|
+
var { providerId: t } = e, i = $e(e, ["providerId"]);
|
|
891
1060
|
return {
|
|
892
1061
|
providerId: t,
|
|
893
1062
|
uid: i.rawId || "",
|
|
@@ -914,16 +1083,16 @@ function Rt(n) {
|
|
|
914
1083
|
* See the License for the specific language governing permissions and
|
|
915
1084
|
* limitations under the License.
|
|
916
1085
|
*/
|
|
917
|
-
async function
|
|
918
|
-
const t = await
|
|
919
|
-
const i =
|
|
1086
|
+
async function yi(n, e) {
|
|
1087
|
+
const t = await Nt(n, {}, async () => {
|
|
1088
|
+
const i = se({
|
|
920
1089
|
grant_type: "refresh_token",
|
|
921
1090
|
refresh_token: e
|
|
922
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
1091
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = Lt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
923
1092
|
return c[
|
|
924
1093
|
"Content-Type"
|
|
925
1094
|
/* HttpHeader.CONTENT_TYPE */
|
|
926
|
-
] = "application/x-www-form-urlencoded",
|
|
1095
|
+
] = "application/x-www-form-urlencoded", Ct.fetch()(o, {
|
|
927
1096
|
method: "POST",
|
|
928
1097
|
headers: c,
|
|
929
1098
|
body: i
|
|
@@ -935,8 +1104,8 @@ async function Jn(n, e) {
|
|
|
935
1104
|
refreshToken: t.refresh_token
|
|
936
1105
|
};
|
|
937
1106
|
}
|
|
938
|
-
async function
|
|
939
|
-
return
|
|
1107
|
+
async function wi(n, e) {
|
|
1108
|
+
return X(n, "POST", "/v2/accounts:revokeToken", Te(n, e));
|
|
940
1109
|
}
|
|
941
1110
|
/**
|
|
942
1111
|
* @license
|
|
@@ -954,7 +1123,7 @@ async function Yn(n, e) {
|
|
|
954
1123
|
* See the License for the specific language governing permissions and
|
|
955
1124
|
* limitations under the License.
|
|
956
1125
|
*/
|
|
957
|
-
class
|
|
1126
|
+
class q {
|
|
958
1127
|
constructor() {
|
|
959
1128
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
960
1129
|
}
|
|
@@ -975,7 +1144,7 @@ class $ {
|
|
|
975
1144
|
"internal-error"
|
|
976
1145
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
977
1146
|
);
|
|
978
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
|
1147
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : it(e.idToken);
|
|
979
1148
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
|
980
1149
|
}
|
|
981
1150
|
updateFromIdToken(e) {
|
|
@@ -984,7 +1153,7 @@ class $ {
|
|
|
984
1153
|
"internal-error"
|
|
985
1154
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
986
1155
|
);
|
|
987
|
-
const t =
|
|
1156
|
+
const t = it(e);
|
|
988
1157
|
this.updateTokensAndExpiration(e, null, t);
|
|
989
1158
|
}
|
|
990
1159
|
async getToken(e, t = !1) {
|
|
@@ -999,14 +1168,14 @@ class $ {
|
|
|
999
1168
|
this.refreshToken = null;
|
|
1000
1169
|
}
|
|
1001
1170
|
async refresh(e, t) {
|
|
1002
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1171
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await yi(e, t);
|
|
1003
1172
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1004
1173
|
}
|
|
1005
1174
|
updateTokensAndExpiration(e, t, i) {
|
|
1006
1175
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1007
1176
|
}
|
|
1008
1177
|
static fromJSON(e, t) {
|
|
1009
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1178
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new q();
|
|
1010
1179
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1011
1180
|
appName: e
|
|
1012
1181
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1026,10 +1195,10 @@ class $ {
|
|
|
1026
1195
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1027
1196
|
}
|
|
1028
1197
|
_clone() {
|
|
1029
|
-
return Object.assign(new
|
|
1198
|
+
return Object.assign(new q(), this.toJSON());
|
|
1030
1199
|
}
|
|
1031
1200
|
_performRefresh() {
|
|
1032
|
-
return
|
|
1201
|
+
return P("not implemented");
|
|
1033
1202
|
}
|
|
1034
1203
|
}
|
|
1035
1204
|
/**
|
|
@@ -1048,16 +1217,16 @@ class $ {
|
|
|
1048
1217
|
* See the License for the specific language governing permissions and
|
|
1049
1218
|
* limitations under the License.
|
|
1050
1219
|
*/
|
|
1051
|
-
function
|
|
1220
|
+
function D(n, e) {
|
|
1052
1221
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1053
1222
|
}
|
|
1054
|
-
class
|
|
1223
|
+
class C {
|
|
1055
1224
|
constructor(e) {
|
|
1056
|
-
var { uid: t, auth: i, stsTokenManager: r } = e, s =
|
|
1057
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1225
|
+
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1226
|
+
this.providerId = "firebase", this.proactiveRefresh = new _i(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = i, this.stsTokenManager = r, this.accessToken = r.accessToken, this.displayName = s.displayName || null, this.email = s.email || null, this.emailVerified = s.emailVerified || !1, this.phoneNumber = s.phoneNumber || null, this.photoURL = s.photoURL || null, this.isAnonymous = s.isAnonymous || !1, this.tenantId = s.tenantId || null, this.providerData = s.providerData ? [...s.providerData] : [], this.metadata = new Ue(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1058
1227
|
}
|
|
1059
1228
|
async getIdToken(e) {
|
|
1060
|
-
const t = await
|
|
1229
|
+
const t = await ie(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1061
1230
|
return u(
|
|
1062
1231
|
t,
|
|
1063
1232
|
this.auth,
|
|
@@ -1066,10 +1235,10 @@ class b {
|
|
|
1066
1235
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1067
1236
|
}
|
|
1068
1237
|
getIdTokenResult(e) {
|
|
1069
|
-
return
|
|
1238
|
+
return mi(this, e);
|
|
1070
1239
|
}
|
|
1071
1240
|
reload() {
|
|
1072
|
-
return
|
|
1241
|
+
return vi(this);
|
|
1073
1242
|
}
|
|
1074
1243
|
_assign(e) {
|
|
1075
1244
|
this !== e && (u(
|
|
@@ -1080,7 +1249,7 @@ class b {
|
|
|
1080
1249
|
), 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
1250
|
}
|
|
1082
1251
|
_clone(e) {
|
|
1083
|
-
const t = new
|
|
1252
|
+
const t = new C(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1084
1253
|
return t.metadata._copy(this.metadata), t;
|
|
1085
1254
|
}
|
|
1086
1255
|
_onReload(e) {
|
|
@@ -1102,13 +1271,13 @@ class b {
|
|
|
1102
1271
|
}
|
|
1103
1272
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1104
1273
|
let i = !1;
|
|
1105
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1274
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await ve(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1106
1275
|
}
|
|
1107
1276
|
async delete() {
|
|
1108
|
-
if (
|
|
1109
|
-
return Promise.reject(
|
|
1277
|
+
if (A(this.auth.app))
|
|
1278
|
+
return Promise.reject(H(this.auth));
|
|
1110
1279
|
const e = await this.getIdToken();
|
|
1111
|
-
return await
|
|
1280
|
+
return await ie(this, pi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1112
1281
|
}
|
|
1113
1282
|
toJSON() {
|
|
1114
1283
|
return Object.assign(Object.assign({
|
|
@@ -1136,45 +1305,45 @@ class b {
|
|
|
1136
1305
|
}
|
|
1137
1306
|
static _fromJSON(e, t) {
|
|
1138
1307
|
var i, r, s, o, c, a, l, d;
|
|
1139
|
-
const
|
|
1308
|
+
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0, h = (r = t.email) !== null && r !== void 0 ? r : void 0, y = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, _ = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, p = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, T = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, M = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: k, emailVerified: Ke, isAnonymous: Je, providerData: Re, stsTokenManager: Ye } = t;
|
|
1140
1309
|
u(
|
|
1141
|
-
|
|
1310
|
+
k && Ye,
|
|
1142
1311
|
e,
|
|
1143
1312
|
"internal-error"
|
|
1144
1313
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1145
1314
|
);
|
|
1146
|
-
const
|
|
1315
|
+
const on = q.fromJSON(this.name, Ye);
|
|
1147
1316
|
u(
|
|
1148
|
-
typeof
|
|
1317
|
+
typeof k == "string",
|
|
1149
1318
|
e,
|
|
1150
1319
|
"internal-error"
|
|
1151
1320
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1152
|
-
),
|
|
1153
|
-
typeof
|
|
1321
|
+
), D(m, e.name), D(h, e.name), u(
|
|
1322
|
+
typeof Ke == "boolean",
|
|
1154
1323
|
e,
|
|
1155
1324
|
"internal-error"
|
|
1156
1325
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1157
1326
|
), u(
|
|
1158
|
-
typeof
|
|
1327
|
+
typeof Je == "boolean",
|
|
1159
1328
|
e,
|
|
1160
1329
|
"internal-error"
|
|
1161
1330
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1162
|
-
),
|
|
1163
|
-
const
|
|
1164
|
-
uid:
|
|
1331
|
+
), D(y, e.name), D(_, e.name), D(p, e.name), D(I, e.name), D(T, e.name), D(M, e.name);
|
|
1332
|
+
const Ae = new C({
|
|
1333
|
+
uid: k,
|
|
1165
1334
|
auth: e,
|
|
1166
|
-
email:
|
|
1167
|
-
emailVerified:
|
|
1168
|
-
displayName:
|
|
1169
|
-
isAnonymous:
|
|
1170
|
-
photoURL:
|
|
1171
|
-
phoneNumber:
|
|
1172
|
-
tenantId:
|
|
1173
|
-
stsTokenManager:
|
|
1174
|
-
createdAt:
|
|
1175
|
-
lastLoginAt:
|
|
1335
|
+
email: h,
|
|
1336
|
+
emailVerified: Ke,
|
|
1337
|
+
displayName: m,
|
|
1338
|
+
isAnonymous: Je,
|
|
1339
|
+
photoURL: _,
|
|
1340
|
+
phoneNumber: y,
|
|
1341
|
+
tenantId: p,
|
|
1342
|
+
stsTokenManager: on,
|
|
1343
|
+
createdAt: T,
|
|
1344
|
+
lastLoginAt: M
|
|
1176
1345
|
});
|
|
1177
|
-
return
|
|
1346
|
+
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((an) => Object.assign({}, an))), I && (Ae._redirectEventId = I), Ae;
|
|
1178
1347
|
}
|
|
1179
1348
|
/**
|
|
1180
1349
|
* Initialize a User from an idToken server response
|
|
@@ -1182,15 +1351,15 @@ class b {
|
|
|
1182
1351
|
* @param idTokenResponse
|
|
1183
1352
|
*/
|
|
1184
1353
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1185
|
-
const r = new
|
|
1354
|
+
const r = new q();
|
|
1186
1355
|
r.updateFromServerResponse(t);
|
|
1187
|
-
const s = new
|
|
1356
|
+
const s = new C({
|
|
1188
1357
|
uid: t.localId,
|
|
1189
1358
|
auth: e,
|
|
1190
1359
|
stsTokenManager: r,
|
|
1191
1360
|
isAnonymous: i
|
|
1192
1361
|
});
|
|
1193
|
-
return await
|
|
1362
|
+
return await ve(s), s;
|
|
1194
1363
|
}
|
|
1195
1364
|
/**
|
|
1196
1365
|
* Initialize a User from an idToken server response
|
|
@@ -1204,9 +1373,9 @@ class b {
|
|
|
1204
1373
|
"internal-error"
|
|
1205
1374
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1206
1375
|
);
|
|
1207
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1376
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new q();
|
|
1208
1377
|
c.updateFromIdToken(i);
|
|
1209
|
-
const a = new
|
|
1378
|
+
const a = new C({
|
|
1210
1379
|
uid: r.localId,
|
|
1211
1380
|
auth: e,
|
|
1212
1381
|
stsTokenManager: c,
|
|
@@ -1220,7 +1389,7 @@ class b {
|
|
|
1220
1389
|
phoneNumber: r.phoneNumber || null,
|
|
1221
1390
|
tenantId: r.tenantId || null,
|
|
1222
1391
|
providerData: s,
|
|
1223
|
-
metadata: new
|
|
1392
|
+
metadata: new Ue(r.createdAt, r.lastLoginAt),
|
|
1224
1393
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1225
1394
|
};
|
|
1226
1395
|
return Object.assign(a, l), a;
|
|
@@ -1242,11 +1411,11 @@ class b {
|
|
|
1242
1411
|
* See the License for the specific language governing permissions and
|
|
1243
1412
|
* limitations under the License.
|
|
1244
1413
|
*/
|
|
1245
|
-
const
|
|
1246
|
-
function
|
|
1247
|
-
|
|
1248
|
-
let e =
|
|
1249
|
-
return e ? (
|
|
1414
|
+
const rt = /* @__PURE__ */ new Map();
|
|
1415
|
+
function N(n) {
|
|
1416
|
+
L(n instanceof Function, "Expected a class definition");
|
|
1417
|
+
let e = rt.get(n);
|
|
1418
|
+
return e ? (L(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), rt.set(n, e), e);
|
|
1250
1419
|
}
|
|
1251
1420
|
/**
|
|
1252
1421
|
* @license
|
|
@@ -1264,7 +1433,7 @@ function S(n) {
|
|
|
1264
1433
|
* See the License for the specific language governing permissions and
|
|
1265
1434
|
* limitations under the License.
|
|
1266
1435
|
*/
|
|
1267
|
-
class
|
|
1436
|
+
class Dt {
|
|
1268
1437
|
constructor() {
|
|
1269
1438
|
this.type = "NONE", this.storage = {};
|
|
1270
1439
|
}
|
|
@@ -1286,8 +1455,8 @@ class At {
|
|
|
1286
1455
|
_removeListener(e, t) {
|
|
1287
1456
|
}
|
|
1288
1457
|
}
|
|
1289
|
-
|
|
1290
|
-
const
|
|
1458
|
+
Dt.type = "NONE";
|
|
1459
|
+
const st = Dt;
|
|
1291
1460
|
/**
|
|
1292
1461
|
* @license
|
|
1293
1462
|
* Copyright 2019 Google LLC
|
|
@@ -1304,21 +1473,21 @@ const Qe = At;
|
|
|
1304
1473
|
* See the License for the specific language governing permissions and
|
|
1305
1474
|
* limitations under the License.
|
|
1306
1475
|
*/
|
|
1307
|
-
function
|
|
1476
|
+
function de(n, e, t) {
|
|
1308
1477
|
return `firebase:${n}:${e}:${t}`;
|
|
1309
1478
|
}
|
|
1310
|
-
class
|
|
1479
|
+
class K {
|
|
1311
1480
|
constructor(e, t, i) {
|
|
1312
1481
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1313
1482
|
const { config: r, name: s } = this.auth;
|
|
1314
|
-
this.fullUserKey =
|
|
1483
|
+
this.fullUserKey = de(this.userKey, r.apiKey, s), this.fullPersistenceKey = de("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1315
1484
|
}
|
|
1316
1485
|
setCurrentUser(e) {
|
|
1317
1486
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
1318
1487
|
}
|
|
1319
1488
|
async getCurrentUser() {
|
|
1320
1489
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1321
|
-
return e ?
|
|
1490
|
+
return e ? C._fromJSON(this.auth, e) : null;
|
|
1322
1491
|
}
|
|
1323
1492
|
removeCurrentUser() {
|
|
1324
1493
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1338,32 +1507,32 @@ class H {
|
|
|
1338
1507
|
}
|
|
1339
1508
|
static async create(e, t, i = "authUser") {
|
|
1340
1509
|
if (!t.length)
|
|
1341
|
-
return new
|
|
1510
|
+
return new K(N(st), e, i);
|
|
1342
1511
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1343
1512
|
if (await l._isAvailable())
|
|
1344
1513
|
return l;
|
|
1345
1514
|
}))).filter((l) => l);
|
|
1346
|
-
let s = r[0] ||
|
|
1347
|
-
const o =
|
|
1515
|
+
let s = r[0] || N(st);
|
|
1516
|
+
const o = de(i, e.config.apiKey, e.name);
|
|
1348
1517
|
let c = null;
|
|
1349
1518
|
for (const l of t)
|
|
1350
1519
|
try {
|
|
1351
1520
|
const d = await l._get(o);
|
|
1352
1521
|
if (d) {
|
|
1353
|
-
const
|
|
1354
|
-
l !== s && (c =
|
|
1522
|
+
const m = C._fromJSON(e, d);
|
|
1523
|
+
l !== s && (c = m), s = l;
|
|
1355
1524
|
break;
|
|
1356
1525
|
}
|
|
1357
1526
|
} catch {
|
|
1358
1527
|
}
|
|
1359
1528
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1360
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1529
|
+
return !s._shouldAllowMigration || !a.length ? new K(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1361
1530
|
if (l !== s)
|
|
1362
1531
|
try {
|
|
1363
1532
|
await l._remove(o);
|
|
1364
1533
|
} catch {
|
|
1365
1534
|
}
|
|
1366
|
-
})), new
|
|
1535
|
+
})), new K(s, e, i));
|
|
1367
1536
|
}
|
|
1368
1537
|
}
|
|
1369
1538
|
/**
|
|
@@ -1382,29 +1551,29 @@ class H {
|
|
|
1382
1551
|
* See the License for the specific language governing permissions and
|
|
1383
1552
|
* limitations under the License.
|
|
1384
1553
|
*/
|
|
1385
|
-
function
|
|
1554
|
+
function ot(n) {
|
|
1386
1555
|
const e = n.toLowerCase();
|
|
1387
1556
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1388
1557
|
return "Opera";
|
|
1389
|
-
if (
|
|
1558
|
+
if (Vt(e))
|
|
1390
1559
|
return "IEMobile";
|
|
1391
1560
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1392
1561
|
return "IE";
|
|
1393
1562
|
if (e.includes("edge/"))
|
|
1394
1563
|
return "Edge";
|
|
1395
|
-
if (
|
|
1564
|
+
if (xt(e))
|
|
1396
1565
|
return "Firefox";
|
|
1397
1566
|
if (e.includes("silk/"))
|
|
1398
1567
|
return "Silk";
|
|
1399
|
-
if (
|
|
1568
|
+
if (Ht(e))
|
|
1400
1569
|
return "Blackberry";
|
|
1401
|
-
if (
|
|
1570
|
+
if (jt(e))
|
|
1402
1571
|
return "Webos";
|
|
1403
|
-
if (
|
|
1572
|
+
if (Ge(e))
|
|
1404
1573
|
return "Safari";
|
|
1405
|
-
if ((e.includes("chrome/") ||
|
|
1574
|
+
if ((e.includes("chrome/") || Ft(e)) && !e.includes("edge/"))
|
|
1406
1575
|
return "Chrome";
|
|
1407
|
-
if (
|
|
1576
|
+
if ($t(e))
|
|
1408
1577
|
return "Android";
|
|
1409
1578
|
{
|
|
1410
1579
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1413,42 +1582,42 @@ function Ze(n) {
|
|
|
1413
1582
|
}
|
|
1414
1583
|
return "Other";
|
|
1415
1584
|
}
|
|
1416
|
-
function
|
|
1585
|
+
function xt(n = w()) {
|
|
1417
1586
|
return /firefox\//i.test(n);
|
|
1418
1587
|
}
|
|
1419
|
-
function
|
|
1588
|
+
function Ge(n = w()) {
|
|
1420
1589
|
const e = n.toLowerCase();
|
|
1421
1590
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1422
1591
|
}
|
|
1423
|
-
function
|
|
1592
|
+
function Ft(n = w()) {
|
|
1424
1593
|
return /crios\//i.test(n);
|
|
1425
1594
|
}
|
|
1426
|
-
function
|
|
1595
|
+
function Vt(n = w()) {
|
|
1427
1596
|
return /iemobile/i.test(n);
|
|
1428
1597
|
}
|
|
1429
|
-
function
|
|
1598
|
+
function $t(n = w()) {
|
|
1430
1599
|
return /android/i.test(n);
|
|
1431
1600
|
}
|
|
1432
|
-
function
|
|
1601
|
+
function Ht(n = w()) {
|
|
1433
1602
|
return /blackberry/i.test(n);
|
|
1434
1603
|
}
|
|
1435
|
-
function
|
|
1604
|
+
function jt(n = w()) {
|
|
1436
1605
|
return /webos/i.test(n);
|
|
1437
1606
|
}
|
|
1438
|
-
function
|
|
1607
|
+
function ke(n = w()) {
|
|
1439
1608
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1440
1609
|
}
|
|
1441
|
-
function
|
|
1610
|
+
function Ti(n = w()) {
|
|
1442
1611
|
var e;
|
|
1443
|
-
return
|
|
1612
|
+
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1444
1613
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return
|
|
1614
|
+
function ki() {
|
|
1615
|
+
return Nn() && document.documentMode === 10;
|
|
1447
1616
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1617
|
+
function Wt(n = w()) {
|
|
1618
|
+
return ke(n) || $t(n) || jt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1450
1619
|
}
|
|
1451
|
-
function
|
|
1620
|
+
function bi() {
|
|
1452
1621
|
try {
|
|
1453
1622
|
return !!(window && window !== window.top);
|
|
1454
1623
|
} catch {
|
|
@@ -1471,20 +1640,20 @@ function Zn() {
|
|
|
1471
1640
|
* See the License for the specific language governing permissions and
|
|
1472
1641
|
* limitations under the License.
|
|
1473
1642
|
*/
|
|
1474
|
-
function
|
|
1643
|
+
function Gt(n, e = []) {
|
|
1475
1644
|
let t;
|
|
1476
1645
|
switch (n) {
|
|
1477
1646
|
case "Browser":
|
|
1478
|
-
t =
|
|
1647
|
+
t = ot(w());
|
|
1479
1648
|
break;
|
|
1480
1649
|
case "Worker":
|
|
1481
|
-
t = `${
|
|
1650
|
+
t = `${ot(w())}-${n}`;
|
|
1482
1651
|
break;
|
|
1483
1652
|
default:
|
|
1484
1653
|
t = n;
|
|
1485
1654
|
}
|
|
1486
1655
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1487
|
-
return `${t}/JsCore/${
|
|
1656
|
+
return `${t}/JsCore/${re}/${i}`;
|
|
1488
1657
|
}
|
|
1489
1658
|
/**
|
|
1490
1659
|
* @license
|
|
@@ -1502,7 +1671,7 @@ function Dt(n, e = []) {
|
|
|
1502
1671
|
* See the License for the specific language governing permissions and
|
|
1503
1672
|
* limitations under the License.
|
|
1504
1673
|
*/
|
|
1505
|
-
class
|
|
1674
|
+
class Ei {
|
|
1506
1675
|
constructor(e) {
|
|
1507
1676
|
this.auth = e, this.queue = [];
|
|
1508
1677
|
}
|
|
@@ -1557,8 +1726,8 @@ class ei {
|
|
|
1557
1726
|
* See the License for the specific language governing permissions and
|
|
1558
1727
|
* limitations under the License.
|
|
1559
1728
|
*/
|
|
1560
|
-
async function
|
|
1561
|
-
return
|
|
1729
|
+
async function Si(n, e = {}) {
|
|
1730
|
+
return X(n, "GET", "/v2/passwordPolicy", Te(n, e));
|
|
1562
1731
|
}
|
|
1563
1732
|
/**
|
|
1564
1733
|
* @license
|
|
@@ -1576,12 +1745,12 @@ async function ti(n, e = {}) {
|
|
|
1576
1745
|
* See the License for the specific language governing permissions and
|
|
1577
1746
|
* limitations under the License.
|
|
1578
1747
|
*/
|
|
1579
|
-
const
|
|
1580
|
-
class
|
|
1748
|
+
const Ri = 6;
|
|
1749
|
+
class Ai {
|
|
1581
1750
|
constructor(e) {
|
|
1582
1751
|
var t, i, r, s;
|
|
1583
1752
|
const o = e.customStrengthOptions;
|
|
1584
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1753
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Ri, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (r = (i = e.allowedNonAlphanumericCharacters) === null || i === void 0 ? void 0 : i.join("")) !== null && r !== void 0 ? r : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
|
1585
1754
|
}
|
|
1586
1755
|
validatePassword(e) {
|
|
1587
1756
|
var t, i, r, s, o, c;
|
|
@@ -1664,14 +1833,14 @@ class ii {
|
|
|
1664
1833
|
* See the License for the specific language governing permissions and
|
|
1665
1834
|
* limitations under the License.
|
|
1666
1835
|
*/
|
|
1667
|
-
class
|
|
1836
|
+
class Pi {
|
|
1668
1837
|
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
|
|
1838
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new Ei(this), this.redirectUser = null, this.isProactiveRefreshEnabled = !1, this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION = 1, this._canInitEmulator = !0, this._isInitialized = !1, this._deleted = !1, this._initializationPromise = null, this._popupRedirectResolver = null, this._errorFactory = At, this._agentRecaptchaConfig = null, this._tenantRecaptchaConfigs = {}, this._projectPasswordPolicy = null, this._tenantPasswordPolicies = {}, this.lastNotifiedUid = void 0, this.languageCode = null, this.tenantId = null, this.settings = { appVerificationDisabledForTesting: !1 }, this.frameworks = [], this.name = e.name, this.clientVersion = r.sdkClientVersion;
|
|
1670
1839
|
}
|
|
1671
1840
|
_initializeWithPersistence(e, t) {
|
|
1672
|
-
return t && (this._popupRedirectResolver =
|
|
1841
|
+
return t && (this._popupRedirectResolver = N(t)), this._initializationPromise = this.queue(async () => {
|
|
1673
1842
|
var i, r;
|
|
1674
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1843
|
+
if (!this._deleted && (this.persistenceManager = await K.create(this, e), !this._deleted)) {
|
|
1675
1844
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1676
1845
|
try {
|
|
1677
1846
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1702,7 +1871,7 @@ class ri {
|
|
|
1702
1871
|
}
|
|
1703
1872
|
async initializeCurrentUserFromIdToken(e) {
|
|
1704
1873
|
try {
|
|
1705
|
-
const t = await
|
|
1874
|
+
const t = await Mt(this, { idToken: e }), i = await C._fromGetAccountInfoResponse(this, t, e);
|
|
1706
1875
|
await this.directlySetCurrentUser(i);
|
|
1707
1876
|
} catch (t) {
|
|
1708
1877
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1710,7 +1879,7 @@ class ri {
|
|
|
1710
1879
|
}
|
|
1711
1880
|
async initializeCurrentUser(e) {
|
|
1712
1881
|
var t;
|
|
1713
|
-
if (
|
|
1882
|
+
if (A(this.app)) {
|
|
1714
1883
|
const o = this.app.settings.authIdToken;
|
|
1715
1884
|
return o ? new Promise((c) => {
|
|
1716
1885
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1752,7 +1921,7 @@ class ri {
|
|
|
1752
1921
|
}
|
|
1753
1922
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1754
1923
|
try {
|
|
1755
|
-
await
|
|
1924
|
+
await ve(e);
|
|
1756
1925
|
} catch (t) {
|
|
1757
1926
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1758
1927
|
return this.directlySetCurrentUser(null);
|
|
@@ -1760,15 +1929,15 @@ class ri {
|
|
|
1760
1929
|
return this.directlySetCurrentUser(e);
|
|
1761
1930
|
}
|
|
1762
1931
|
useDeviceLanguage() {
|
|
1763
|
-
this.languageCode =
|
|
1932
|
+
this.languageCode = ui();
|
|
1764
1933
|
}
|
|
1765
1934
|
async _delete() {
|
|
1766
1935
|
this._deleted = !0;
|
|
1767
1936
|
}
|
|
1768
1937
|
async updateCurrentUser(e) {
|
|
1769
|
-
if (
|
|
1770
|
-
return Promise.reject(
|
|
1771
|
-
const t = e ?
|
|
1938
|
+
if (A(this.app))
|
|
1939
|
+
return Promise.reject(H(this));
|
|
1940
|
+
const t = e ? Y(e) : null;
|
|
1772
1941
|
return t && u(
|
|
1773
1942
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1774
1943
|
this,
|
|
@@ -1788,15 +1957,15 @@ class ri {
|
|
|
1788
1957
|
});
|
|
1789
1958
|
}
|
|
1790
1959
|
async signOut() {
|
|
1791
|
-
return
|
|
1960
|
+
return A(this.app) ? Promise.reject(H(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1792
1961
|
null,
|
|
1793
1962
|
/* skipBeforeStateCallbacks */
|
|
1794
1963
|
!0
|
|
1795
1964
|
));
|
|
1796
1965
|
}
|
|
1797
1966
|
setPersistence(e) {
|
|
1798
|
-
return
|
|
1799
|
-
await this.assertedPersistence.setPersistence(
|
|
1967
|
+
return A(this.app) ? Promise.reject(H(this)) : this.queue(async () => {
|
|
1968
|
+
await this.assertedPersistence.setPersistence(N(e));
|
|
1800
1969
|
});
|
|
1801
1970
|
}
|
|
1802
1971
|
_getRecaptchaConfig() {
|
|
@@ -1811,14 +1980,14 @@ class ri {
|
|
|
1811
1980
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1812
1981
|
}
|
|
1813
1982
|
async _updatePasswordPolicy() {
|
|
1814
|
-
const e = await
|
|
1983
|
+
const e = await Si(this), t = new Ai(e);
|
|
1815
1984
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1816
1985
|
}
|
|
1817
1986
|
_getPersistence() {
|
|
1818
1987
|
return this.assertedPersistence.persistence.type;
|
|
1819
1988
|
}
|
|
1820
1989
|
_updateErrorMap(e) {
|
|
1821
|
-
this._errorFactory = new
|
|
1990
|
+
this._errorFactory = new Fe("auth", "Firebase", e());
|
|
1822
1991
|
}
|
|
1823
1992
|
onAuthStateChanged(e, t, i) {
|
|
1824
1993
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1851,7 +2020,7 @@ class ri {
|
|
|
1851
2020
|
token: e,
|
|
1852
2021
|
idToken: t
|
|
1853
2022
|
};
|
|
1854
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
2023
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await wi(this, i);
|
|
1855
2024
|
}
|
|
1856
2025
|
}
|
|
1857
2026
|
toJSON() {
|
|
@@ -1869,15 +2038,15 @@ class ri {
|
|
|
1869
2038
|
}
|
|
1870
2039
|
async getOrInitRedirectPersistenceManager(e) {
|
|
1871
2040
|
if (!this.redirectPersistenceManager) {
|
|
1872
|
-
const t = e &&
|
|
2041
|
+
const t = e && N(e) || this._popupRedirectResolver;
|
|
1873
2042
|
u(
|
|
1874
2043
|
t,
|
|
1875
2044
|
this,
|
|
1876
2045
|
"argument-error"
|
|
1877
2046
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
1878
|
-
), this.redirectPersistenceManager = await
|
|
2047
|
+
), this.redirectPersistenceManager = await K.create(
|
|
1879
2048
|
this,
|
|
1880
|
-
[
|
|
2049
|
+
[N(t._redirectPersistence)],
|
|
1881
2050
|
"redirectUser"
|
|
1882
2051
|
/* KeyName.REDIRECT_USER */
|
|
1883
2052
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -1964,7 +2133,7 @@ class ri {
|
|
|
1964
2133
|
), this.persistenceManager;
|
|
1965
2134
|
}
|
|
1966
2135
|
_logFramework(e) {
|
|
1967
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
2136
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Gt(this.config.clientPlatform, this._getFrameworks()));
|
|
1968
2137
|
}
|
|
1969
2138
|
_getFrameworks() {
|
|
1970
2139
|
return this.frameworks;
|
|
@@ -1994,15 +2163,15 @@ class ri {
|
|
|
1994
2163
|
async _getAppCheckToken() {
|
|
1995
2164
|
var e;
|
|
1996
2165
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1997
|
-
return t != null && t.error &&
|
|
2166
|
+
return t != null && t.error && ai(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1998
2167
|
}
|
|
1999
2168
|
}
|
|
2000
|
-
function
|
|
2001
|
-
return
|
|
2169
|
+
function be(n) {
|
|
2170
|
+
return Y(n);
|
|
2002
2171
|
}
|
|
2003
|
-
class
|
|
2172
|
+
class at {
|
|
2004
2173
|
constructor(e) {
|
|
2005
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2174
|
+
this.auth = e, this.observer = null, this.addObserver = Sn((t) => this.observer = t);
|
|
2006
2175
|
}
|
|
2007
2176
|
get next() {
|
|
2008
2177
|
return u(
|
|
@@ -2029,7 +2198,7 @@ class et {
|
|
|
2029
2198
|
* See the License for the specific language governing permissions and
|
|
2030
2199
|
* limitations under the License.
|
|
2031
2200
|
*/
|
|
2032
|
-
let
|
|
2201
|
+
let Be = {
|
|
2033
2202
|
async loadJS() {
|
|
2034
2203
|
throw new Error("Unable to load external scripts");
|
|
2035
2204
|
},
|
|
@@ -2037,16 +2206,16 @@ let Fe = {
|
|
|
2037
2206
|
recaptchaEnterpriseScript: "",
|
|
2038
2207
|
gapiScript: ""
|
|
2039
2208
|
};
|
|
2040
|
-
function
|
|
2041
|
-
|
|
2209
|
+
function Ci(n) {
|
|
2210
|
+
Be = n;
|
|
2042
2211
|
}
|
|
2043
|
-
function
|
|
2044
|
-
return
|
|
2212
|
+
function Ni(n) {
|
|
2213
|
+
return Be.loadJS(n);
|
|
2045
2214
|
}
|
|
2046
|
-
function
|
|
2047
|
-
return
|
|
2215
|
+
function Oi() {
|
|
2216
|
+
return Be.gapiScript;
|
|
2048
2217
|
}
|
|
2049
|
-
function
|
|
2218
|
+
function Li(n) {
|
|
2050
2219
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2051
2220
|
}
|
|
2052
2221
|
/**
|
|
@@ -2065,13 +2234,13 @@ function ci(n) {
|
|
|
2065
2234
|
* See the License for the specific language governing permissions and
|
|
2066
2235
|
* limitations under the License.
|
|
2067
2236
|
*/
|
|
2068
|
-
function
|
|
2069
|
-
const t =
|
|
2237
|
+
function Mi(n, e) {
|
|
2238
|
+
const t = bt(n, "auth");
|
|
2070
2239
|
if (t.isInitialized()) {
|
|
2071
2240
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2072
|
-
if (
|
|
2241
|
+
if (Pn(s, e ?? {}))
|
|
2073
2242
|
return r;
|
|
2074
|
-
|
|
2243
|
+
O(
|
|
2075
2244
|
r,
|
|
2076
2245
|
"already-initialized"
|
|
2077
2246
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2079,12 +2248,12 @@ function li(n, e) {
|
|
|
2079
2248
|
}
|
|
2080
2249
|
return t.initialize({ options: e });
|
|
2081
2250
|
}
|
|
2082
|
-
function
|
|
2083
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2251
|
+
function Ui(n, e) {
|
|
2252
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(N);
|
|
2084
2253
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2085
2254
|
}
|
|
2086
|
-
function
|
|
2087
|
-
const i =
|
|
2255
|
+
function Di(n, e, t) {
|
|
2256
|
+
const i = be(n);
|
|
2088
2257
|
u(
|
|
2089
2258
|
i._canInitEmulator,
|
|
2090
2259
|
i,
|
|
@@ -2096,38 +2265,38 @@ function di(n, e, t) {
|
|
|
2096
2265
|
"invalid-emulator-scheme"
|
|
2097
2266
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2098
2267
|
);
|
|
2099
|
-
const r = !1, s =
|
|
2268
|
+
const r = !1, s = Bt(e), { host: o, port: c } = xi(e), a = c === null ? "" : `:${c}`;
|
|
2100
2269
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2101
2270
|
host: o,
|
|
2102
2271
|
port: c,
|
|
2103
2272
|
protocol: s.replace(":", ""),
|
|
2104
2273
|
options: Object.freeze({ disableWarnings: r })
|
|
2105
|
-
}),
|
|
2274
|
+
}), Fi();
|
|
2106
2275
|
}
|
|
2107
|
-
function
|
|
2276
|
+
function Bt(n) {
|
|
2108
2277
|
const e = n.indexOf(":");
|
|
2109
2278
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2110
2279
|
}
|
|
2111
|
-
function
|
|
2112
|
-
const e =
|
|
2280
|
+
function xi(n) {
|
|
2281
|
+
const e = Bt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2113
2282
|
if (!t)
|
|
2114
2283
|
return { host: "", port: null };
|
|
2115
2284
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
2116
2285
|
if (r) {
|
|
2117
2286
|
const s = r[1];
|
|
2118
|
-
return { host: s, port:
|
|
2287
|
+
return { host: s, port: ct(i.substr(s.length + 1)) };
|
|
2119
2288
|
} else {
|
|
2120
2289
|
const [s, o] = i.split(":");
|
|
2121
|
-
return { host: s, port:
|
|
2290
|
+
return { host: s, port: ct(o) };
|
|
2122
2291
|
}
|
|
2123
2292
|
}
|
|
2124
|
-
function
|
|
2293
|
+
function ct(n) {
|
|
2125
2294
|
if (!n)
|
|
2126
2295
|
return null;
|
|
2127
2296
|
const e = Number(n);
|
|
2128
2297
|
return isNaN(e) ? null : e;
|
|
2129
2298
|
}
|
|
2130
|
-
function
|
|
2299
|
+
function Fi() {
|
|
2131
2300
|
function n() {
|
|
2132
2301
|
const e = document.createElement("p"), t = e.style;
|
|
2133
2302
|
e.innerText = "Running in emulator mode. Do not use with production credentials.", t.position = "fixed", t.width = "100%", t.backgroundColor = "#ffffff", t.border = ".1em solid #000000", t.color = "#b50000", t.bottom = "0px", t.left = "0px", t.margin = "0px", t.zIndex = "10000", t.textAlign = "center", e.classList.add("firebase-emulator-warning"), document.body.appendChild(e);
|
|
@@ -2150,7 +2319,7 @@ function fi() {
|
|
|
2150
2319
|
* See the License for the specific language governing permissions and
|
|
2151
2320
|
* limitations under the License.
|
|
2152
2321
|
*/
|
|
2153
|
-
class
|
|
2322
|
+
class zt {
|
|
2154
2323
|
/** @internal */
|
|
2155
2324
|
constructor(e, t) {
|
|
2156
2325
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2161,19 +2330,19 @@ class xt {
|
|
|
2161
2330
|
* @returns a JSON-serializable representation of this object.
|
|
2162
2331
|
*/
|
|
2163
2332
|
toJSON() {
|
|
2164
|
-
return
|
|
2333
|
+
return P("not implemented");
|
|
2165
2334
|
}
|
|
2166
2335
|
/** @internal */
|
|
2167
2336
|
_getIdTokenResponse(e) {
|
|
2168
|
-
return
|
|
2337
|
+
return P("not implemented");
|
|
2169
2338
|
}
|
|
2170
2339
|
/** @internal */
|
|
2171
2340
|
_linkToIdToken(e, t) {
|
|
2172
|
-
return
|
|
2341
|
+
return P("not implemented");
|
|
2173
2342
|
}
|
|
2174
2343
|
/** @internal */
|
|
2175
2344
|
_getReauthenticationResolver(e) {
|
|
2176
|
-
return
|
|
2345
|
+
return P("not implemented");
|
|
2177
2346
|
}
|
|
2178
2347
|
}
|
|
2179
2348
|
/**
|
|
@@ -2192,8 +2361,8 @@ class xt {
|
|
|
2192
2361
|
* See the License for the specific language governing permissions and
|
|
2193
2362
|
* limitations under the License.
|
|
2194
2363
|
*/
|
|
2195
|
-
async function
|
|
2196
|
-
return
|
|
2364
|
+
async function J(n, e) {
|
|
2365
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", Te(n, e));
|
|
2197
2366
|
}
|
|
2198
2367
|
/**
|
|
2199
2368
|
* @license
|
|
@@ -2211,15 +2380,15 @@ async function W(n, e) {
|
|
|
2211
2380
|
* See the License for the specific language governing permissions and
|
|
2212
2381
|
* limitations under the License.
|
|
2213
2382
|
*/
|
|
2214
|
-
const
|
|
2215
|
-
class
|
|
2383
|
+
const Vi = "http://localhost";
|
|
2384
|
+
class G extends zt {
|
|
2216
2385
|
constructor() {
|
|
2217
2386
|
super(...arguments), this.pendingToken = null;
|
|
2218
2387
|
}
|
|
2219
2388
|
/** @internal */
|
|
2220
2389
|
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) :
|
|
2390
|
+
const t = new G(e.providerId, e.signInMethod);
|
|
2391
|
+
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) : O(
|
|
2223
2392
|
"argument-error"
|
|
2224
2393
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2225
2394
|
), t;
|
|
@@ -2246,37 +2415,37 @@ class D extends xt {
|
|
|
2246
2415
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
|
2247
2416
|
*/
|
|
2248
2417
|
static fromJSON(e) {
|
|
2249
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s =
|
|
2418
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2250
2419
|
if (!i || !r)
|
|
2251
2420
|
return null;
|
|
2252
|
-
const o = new
|
|
2421
|
+
const o = new G(i, r);
|
|
2253
2422
|
return o.idToken = s.idToken || void 0, o.accessToken = s.accessToken || void 0, o.secret = s.secret, o.nonce = s.nonce, o.pendingToken = s.pendingToken || null, o;
|
|
2254
2423
|
}
|
|
2255
2424
|
/** @internal */
|
|
2256
2425
|
_getIdTokenResponse(e) {
|
|
2257
2426
|
const t = this.buildRequest();
|
|
2258
|
-
return
|
|
2427
|
+
return J(e, t);
|
|
2259
2428
|
}
|
|
2260
2429
|
/** @internal */
|
|
2261
2430
|
_linkToIdToken(e, t) {
|
|
2262
2431
|
const i = this.buildRequest();
|
|
2263
|
-
return i.idToken = t,
|
|
2432
|
+
return i.idToken = t, J(e, i);
|
|
2264
2433
|
}
|
|
2265
2434
|
/** @internal */
|
|
2266
2435
|
_getReauthenticationResolver(e) {
|
|
2267
2436
|
const t = this.buildRequest();
|
|
2268
|
-
return t.autoCreate = !1,
|
|
2437
|
+
return t.autoCreate = !1, J(e, t);
|
|
2269
2438
|
}
|
|
2270
2439
|
buildRequest() {
|
|
2271
2440
|
const e = {
|
|
2272
|
-
requestUri:
|
|
2441
|
+
requestUri: Vi,
|
|
2273
2442
|
returnSecureToken: !0
|
|
2274
2443
|
};
|
|
2275
2444
|
if (this.pendingToken)
|
|
2276
2445
|
e.pendingToken = this.pendingToken;
|
|
2277
2446
|
else {
|
|
2278
2447
|
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 =
|
|
2448
|
+
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 = se(t);
|
|
2280
2449
|
}
|
|
2281
2450
|
return e;
|
|
2282
2451
|
}
|
|
@@ -2297,7 +2466,7 @@ class D extends xt {
|
|
|
2297
2466
|
* See the License for the specific language governing permissions and
|
|
2298
2467
|
* limitations under the License.
|
|
2299
2468
|
*/
|
|
2300
|
-
class
|
|
2469
|
+
class qt {
|
|
2301
2470
|
/**
|
|
2302
2471
|
* Constructor for generic OAuth providers.
|
|
2303
2472
|
*
|
|
@@ -2350,7 +2519,7 @@ class Vt {
|
|
|
2350
2519
|
* See the License for the specific language governing permissions and
|
|
2351
2520
|
* limitations under the License.
|
|
2352
2521
|
*/
|
|
2353
|
-
class
|
|
2522
|
+
class ae extends qt {
|
|
2354
2523
|
constructor() {
|
|
2355
2524
|
super(...arguments), this.scopes = [];
|
|
2356
2525
|
}
|
|
@@ -2385,7 +2554,7 @@ class Q extends Vt {
|
|
|
2385
2554
|
* See the License for the specific language governing permissions and
|
|
2386
2555
|
* limitations under the License.
|
|
2387
2556
|
*/
|
|
2388
|
-
class
|
|
2557
|
+
class x extends ae {
|
|
2389
2558
|
constructor() {
|
|
2390
2559
|
super(
|
|
2391
2560
|
"facebook.com"
|
|
@@ -2405,9 +2574,9 @@ class C extends Q {
|
|
|
2405
2574
|
* @param accessToken - Facebook access token.
|
|
2406
2575
|
*/
|
|
2407
2576
|
static credential(e) {
|
|
2408
|
-
return
|
|
2409
|
-
providerId:
|
|
2410
|
-
signInMethod:
|
|
2577
|
+
return G._fromParams({
|
|
2578
|
+
providerId: x.PROVIDER_ID,
|
|
2579
|
+
signInMethod: x.FACEBOOK_SIGN_IN_METHOD,
|
|
2411
2580
|
accessToken: e
|
|
2412
2581
|
});
|
|
2413
2582
|
}
|
|
@@ -2417,7 +2586,7 @@ class C extends Q {
|
|
|
2417
2586
|
* @param userCredential - The user credential.
|
|
2418
2587
|
*/
|
|
2419
2588
|
static credentialFromResult(e) {
|
|
2420
|
-
return
|
|
2589
|
+
return x.credentialFromTaggedObject(e);
|
|
2421
2590
|
}
|
|
2422
2591
|
/**
|
|
2423
2592
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2426,20 +2595,20 @@ class C extends Q {
|
|
|
2426
2595
|
* @param userCredential - The user credential.
|
|
2427
2596
|
*/
|
|
2428
2597
|
static credentialFromError(e) {
|
|
2429
|
-
return
|
|
2598
|
+
return x.credentialFromTaggedObject(e.customData || {});
|
|
2430
2599
|
}
|
|
2431
2600
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2432
2601
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2433
2602
|
return null;
|
|
2434
2603
|
try {
|
|
2435
|
-
return
|
|
2604
|
+
return x.credential(e.oauthAccessToken);
|
|
2436
2605
|
} catch {
|
|
2437
2606
|
return null;
|
|
2438
2607
|
}
|
|
2439
2608
|
}
|
|
2440
2609
|
}
|
|
2441
|
-
|
|
2442
|
-
|
|
2610
|
+
x.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
2611
|
+
x.PROVIDER_ID = "facebook.com";
|
|
2443
2612
|
/**
|
|
2444
2613
|
* @license
|
|
2445
2614
|
* Copyright 2020 Google LLC
|
|
@@ -2456,7 +2625,7 @@ C.PROVIDER_ID = "facebook.com";
|
|
|
2456
2625
|
* See the License for the specific language governing permissions and
|
|
2457
2626
|
* limitations under the License.
|
|
2458
2627
|
*/
|
|
2459
|
-
class
|
|
2628
|
+
class F extends ae {
|
|
2460
2629
|
constructor() {
|
|
2461
2630
|
super(
|
|
2462
2631
|
"google.com"
|
|
@@ -2477,9 +2646,9 @@ class O extends Q {
|
|
|
2477
2646
|
* @param accessToken - Google access token.
|
|
2478
2647
|
*/
|
|
2479
2648
|
static credential(e, t) {
|
|
2480
|
-
return
|
|
2481
|
-
providerId:
|
|
2482
|
-
signInMethod:
|
|
2649
|
+
return G._fromParams({
|
|
2650
|
+
providerId: F.PROVIDER_ID,
|
|
2651
|
+
signInMethod: F.GOOGLE_SIGN_IN_METHOD,
|
|
2483
2652
|
idToken: e,
|
|
2484
2653
|
accessToken: t
|
|
2485
2654
|
});
|
|
@@ -2490,7 +2659,7 @@ class O extends Q {
|
|
|
2490
2659
|
* @param userCredential - The user credential.
|
|
2491
2660
|
*/
|
|
2492
2661
|
static credentialFromResult(e) {
|
|
2493
|
-
return
|
|
2662
|
+
return F.credentialFromTaggedObject(e);
|
|
2494
2663
|
}
|
|
2495
2664
|
/**
|
|
2496
2665
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2499,7 +2668,7 @@ class O extends Q {
|
|
|
2499
2668
|
* @param userCredential - The user credential.
|
|
2500
2669
|
*/
|
|
2501
2670
|
static credentialFromError(e) {
|
|
2502
|
-
return
|
|
2671
|
+
return F.credentialFromTaggedObject(e.customData || {});
|
|
2503
2672
|
}
|
|
2504
2673
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2505
2674
|
if (!e)
|
|
@@ -2508,14 +2677,14 @@ class O extends Q {
|
|
|
2508
2677
|
if (!t && !i)
|
|
2509
2678
|
return null;
|
|
2510
2679
|
try {
|
|
2511
|
-
return
|
|
2680
|
+
return F.credential(t, i);
|
|
2512
2681
|
} catch {
|
|
2513
2682
|
return null;
|
|
2514
2683
|
}
|
|
2515
2684
|
}
|
|
2516
2685
|
}
|
|
2517
|
-
|
|
2518
|
-
|
|
2686
|
+
F.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2687
|
+
F.PROVIDER_ID = "google.com";
|
|
2519
2688
|
/**
|
|
2520
2689
|
* @license
|
|
2521
2690
|
* Copyright 2020 Google LLC
|
|
@@ -2532,7 +2701,7 @@ O.PROVIDER_ID = "google.com";
|
|
|
2532
2701
|
* See the License for the specific language governing permissions and
|
|
2533
2702
|
* limitations under the License.
|
|
2534
2703
|
*/
|
|
2535
|
-
class
|
|
2704
|
+
class V extends ae {
|
|
2536
2705
|
constructor() {
|
|
2537
2706
|
super(
|
|
2538
2707
|
"github.com"
|
|
@@ -2545,9 +2714,9 @@ class N extends Q {
|
|
|
2545
2714
|
* @param accessToken - Github access token.
|
|
2546
2715
|
*/
|
|
2547
2716
|
static credential(e) {
|
|
2548
|
-
return
|
|
2549
|
-
providerId:
|
|
2550
|
-
signInMethod:
|
|
2717
|
+
return G._fromParams({
|
|
2718
|
+
providerId: V.PROVIDER_ID,
|
|
2719
|
+
signInMethod: V.GITHUB_SIGN_IN_METHOD,
|
|
2551
2720
|
accessToken: e
|
|
2552
2721
|
});
|
|
2553
2722
|
}
|
|
@@ -2557,7 +2726,7 @@ class N extends Q {
|
|
|
2557
2726
|
* @param userCredential - The user credential.
|
|
2558
2727
|
*/
|
|
2559
2728
|
static credentialFromResult(e) {
|
|
2560
|
-
return
|
|
2729
|
+
return V.credentialFromTaggedObject(e);
|
|
2561
2730
|
}
|
|
2562
2731
|
/**
|
|
2563
2732
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2566,20 +2735,20 @@ class N extends Q {
|
|
|
2566
2735
|
* @param userCredential - The user credential.
|
|
2567
2736
|
*/
|
|
2568
2737
|
static credentialFromError(e) {
|
|
2569
|
-
return
|
|
2738
|
+
return V.credentialFromTaggedObject(e.customData || {});
|
|
2570
2739
|
}
|
|
2571
2740
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2572
2741
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2573
2742
|
return null;
|
|
2574
2743
|
try {
|
|
2575
|
-
return
|
|
2744
|
+
return V.credential(e.oauthAccessToken);
|
|
2576
2745
|
} catch {
|
|
2577
2746
|
return null;
|
|
2578
2747
|
}
|
|
2579
2748
|
}
|
|
2580
2749
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2750
|
+
V.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2751
|
+
V.PROVIDER_ID = "github.com";
|
|
2583
2752
|
/**
|
|
2584
2753
|
* @license
|
|
2585
2754
|
* Copyright 2020 Google LLC
|
|
@@ -2596,7 +2765,7 @@ N.PROVIDER_ID = "github.com";
|
|
|
2596
2765
|
* See the License for the specific language governing permissions and
|
|
2597
2766
|
* limitations under the License.
|
|
2598
2767
|
*/
|
|
2599
|
-
class
|
|
2768
|
+
class $ extends ae {
|
|
2600
2769
|
constructor() {
|
|
2601
2770
|
super(
|
|
2602
2771
|
"twitter.com"
|
|
@@ -2610,9 +2779,9 @@ class L extends Q {
|
|
|
2610
2779
|
* @param secret - Twitter secret.
|
|
2611
2780
|
*/
|
|
2612
2781
|
static credential(e, t) {
|
|
2613
|
-
return
|
|
2614
|
-
providerId:
|
|
2615
|
-
signInMethod:
|
|
2782
|
+
return G._fromParams({
|
|
2783
|
+
providerId: $.PROVIDER_ID,
|
|
2784
|
+
signInMethod: $.TWITTER_SIGN_IN_METHOD,
|
|
2616
2785
|
oauthToken: e,
|
|
2617
2786
|
oauthTokenSecret: t
|
|
2618
2787
|
});
|
|
@@ -2623,7 +2792,7 @@ class L extends Q {
|
|
|
2623
2792
|
* @param userCredential - The user credential.
|
|
2624
2793
|
*/
|
|
2625
2794
|
static credentialFromResult(e) {
|
|
2626
|
-
return
|
|
2795
|
+
return $.credentialFromTaggedObject(e);
|
|
2627
2796
|
}
|
|
2628
2797
|
/**
|
|
2629
2798
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2632,7 +2801,7 @@ class L extends Q {
|
|
|
2632
2801
|
* @param userCredential - The user credential.
|
|
2633
2802
|
*/
|
|
2634
2803
|
static credentialFromError(e) {
|
|
2635
|
-
return
|
|
2804
|
+
return $.credentialFromTaggedObject(e.customData || {});
|
|
2636
2805
|
}
|
|
2637
2806
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2638
2807
|
if (!e)
|
|
@@ -2641,14 +2810,14 @@ class L extends Q {
|
|
|
2641
2810
|
if (!t || !i)
|
|
2642
2811
|
return null;
|
|
2643
2812
|
try {
|
|
2644
|
-
return
|
|
2813
|
+
return $.credential(t, i);
|
|
2645
2814
|
} catch {
|
|
2646
2815
|
return null;
|
|
2647
2816
|
}
|
|
2648
2817
|
}
|
|
2649
2818
|
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2819
|
+
$.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
2820
|
+
$.PROVIDER_ID = "twitter.com";
|
|
2652
2821
|
/**
|
|
2653
2822
|
* @license
|
|
2654
2823
|
* Copyright 2020 Google LLC
|
|
@@ -2665,13 +2834,13 @@ L.PROVIDER_ID = "twitter.com";
|
|
|
2665
2834
|
* See the License for the specific language governing permissions and
|
|
2666
2835
|
* limitations under the License.
|
|
2667
2836
|
*/
|
|
2668
|
-
class
|
|
2837
|
+
class B {
|
|
2669
2838
|
constructor(e) {
|
|
2670
2839
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2671
2840
|
}
|
|
2672
2841
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2673
|
-
const s = await
|
|
2674
|
-
return new
|
|
2842
|
+
const s = await C._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2843
|
+
return new B({
|
|
2675
2844
|
user: s,
|
|
2676
2845
|
providerId: o,
|
|
2677
2846
|
_tokenResponse: i,
|
|
@@ -2684,8 +2853,8 @@ class F {
|
|
|
2684
2853
|
/* reload */
|
|
2685
2854
|
!0
|
|
2686
2855
|
);
|
|
2687
|
-
const r =
|
|
2688
|
-
return new
|
|
2856
|
+
const r = lt(i);
|
|
2857
|
+
return new B({
|
|
2689
2858
|
user: e,
|
|
2690
2859
|
providerId: r,
|
|
2691
2860
|
_tokenResponse: i,
|
|
@@ -2693,7 +2862,7 @@ class F {
|
|
|
2693
2862
|
});
|
|
2694
2863
|
}
|
|
2695
2864
|
}
|
|
2696
|
-
function
|
|
2865
|
+
function lt(n) {
|
|
2697
2866
|
return n.providerId ? n.providerId : "phoneNumber" in n ? "phone" : null;
|
|
2698
2867
|
}
|
|
2699
2868
|
/**
|
|
@@ -2712,10 +2881,10 @@ function nt(n) {
|
|
|
2712
2881
|
* See the License for the specific language governing permissions and
|
|
2713
2882
|
* limitations under the License.
|
|
2714
2883
|
*/
|
|
2715
|
-
class
|
|
2884
|
+
class Ie extends Ve {
|
|
2716
2885
|
constructor(e, t, i, r) {
|
|
2717
2886
|
var s;
|
|
2718
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2887
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, Ie.prototype), this.customData = {
|
|
2719
2888
|
appName: e.name,
|
|
2720
2889
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2721
2890
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2723,17 +2892,17 @@ class ue extends Oe {
|
|
|
2723
2892
|
};
|
|
2724
2893
|
}
|
|
2725
2894
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2726
|
-
return new
|
|
2895
|
+
return new Ie(e, t, i, r);
|
|
2727
2896
|
}
|
|
2728
2897
|
}
|
|
2729
|
-
function
|
|
2898
|
+
function Kt(n, e, t, i) {
|
|
2730
2899
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2731
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2900
|
+
throw s.code === "auth/multi-factor-auth-required" ? Ie._fromErrorAndOperation(n, s, e, i) : s;
|
|
2732
2901
|
});
|
|
2733
2902
|
}
|
|
2734
|
-
async function
|
|
2735
|
-
const i = await
|
|
2736
|
-
return
|
|
2903
|
+
async function $i(n, e, t = !1) {
|
|
2904
|
+
const i = await ie(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2905
|
+
return B._forOperation(n, "link", i);
|
|
2737
2906
|
}
|
|
2738
2907
|
/**
|
|
2739
2908
|
* @license
|
|
@@ -2751,20 +2920,20 @@ async function mi(n, e, t = !1) {
|
|
|
2751
2920
|
* See the License for the specific language governing permissions and
|
|
2752
2921
|
* limitations under the License.
|
|
2753
2922
|
*/
|
|
2754
|
-
async function
|
|
2923
|
+
async function Hi(n, e, t = !1) {
|
|
2755
2924
|
const { auth: i } = n;
|
|
2756
|
-
if (
|
|
2757
|
-
return Promise.reject(
|
|
2925
|
+
if (A(i.app))
|
|
2926
|
+
return Promise.reject(H(i));
|
|
2758
2927
|
const r = "reauthenticate";
|
|
2759
2928
|
try {
|
|
2760
|
-
const s = await
|
|
2929
|
+
const s = await ie(n, Kt(i, r, e, n), t);
|
|
2761
2930
|
u(
|
|
2762
2931
|
s.idToken,
|
|
2763
2932
|
i,
|
|
2764
2933
|
"internal-error"
|
|
2765
2934
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2766
2935
|
);
|
|
2767
|
-
const o =
|
|
2936
|
+
const o = We(s.idToken);
|
|
2768
2937
|
u(
|
|
2769
2938
|
o,
|
|
2770
2939
|
i,
|
|
@@ -2777,9 +2946,9 @@ async function gi(n, e, t = !1) {
|
|
|
2777
2946
|
i,
|
|
2778
2947
|
"user-mismatch"
|
|
2779
2948
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2780
|
-
),
|
|
2949
|
+
), B._forOperation(n, r, s);
|
|
2781
2950
|
} catch (s) {
|
|
2782
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2951
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && O(
|
|
2783
2952
|
i,
|
|
2784
2953
|
"user-mismatch"
|
|
2785
2954
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2802,10 +2971,10 @@ async function gi(n, e, t = !1) {
|
|
|
2802
2971
|
* See the License for the specific language governing permissions and
|
|
2803
2972
|
* limitations under the License.
|
|
2804
2973
|
*/
|
|
2805
|
-
async function
|
|
2806
|
-
if (
|
|
2807
|
-
return Promise.reject(
|
|
2808
|
-
const i = "signIn", r = await
|
|
2974
|
+
async function ji(n, e, t = !1) {
|
|
2975
|
+
if (A(n.app))
|
|
2976
|
+
return Promise.reject(H(n));
|
|
2977
|
+
const i = "signIn", r = await Kt(n, i, e), s = await B._fromIdTokenResponse(n, i, r);
|
|
2809
2978
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2810
2979
|
}
|
|
2811
2980
|
/**
|
|
@@ -2824,8 +2993,8 @@ async function _i(n, e, t = !1) {
|
|
|
2824
2993
|
* See the License for the specific language governing permissions and
|
|
2825
2994
|
* limitations under the License.
|
|
2826
2995
|
*/
|
|
2827
|
-
async function
|
|
2828
|
-
return
|
|
2996
|
+
async function Wi(n, e) {
|
|
2997
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", Te(n, e));
|
|
2829
2998
|
}
|
|
2830
2999
|
/**
|
|
2831
3000
|
* @license
|
|
@@ -2843,22 +3012,22 @@ async function vi(n, e) {
|
|
|
2843
3012
|
* See the License for the specific language governing permissions and
|
|
2844
3013
|
* limitations under the License.
|
|
2845
3014
|
*/
|
|
2846
|
-
async function
|
|
2847
|
-
if (
|
|
2848
|
-
return Promise.reject(
|
|
2849
|
-
const t =
|
|
3015
|
+
async function Gi(n, e) {
|
|
3016
|
+
if (A(n.app))
|
|
3017
|
+
return Promise.reject(H(n));
|
|
3018
|
+
const t = be(n), i = await Wi(t, {
|
|
2850
3019
|
token: e,
|
|
2851
3020
|
returnSecureToken: !0
|
|
2852
|
-
}), r = await
|
|
3021
|
+
}), r = await B._fromIdTokenResponse(t, "signIn", i);
|
|
2853
3022
|
return await t._updateCurrentUser(r.user), r;
|
|
2854
3023
|
}
|
|
2855
|
-
function
|
|
2856
|
-
return
|
|
3024
|
+
function Bi(n, e, t, i) {
|
|
3025
|
+
return Y(n).onIdTokenChanged(e, t, i);
|
|
2857
3026
|
}
|
|
2858
|
-
function
|
|
2859
|
-
return
|
|
3027
|
+
function zi(n, e, t) {
|
|
3028
|
+
return Y(n).beforeAuthStateChanged(e, t);
|
|
2860
3029
|
}
|
|
2861
|
-
const
|
|
3030
|
+
const ye = "__sak";
|
|
2862
3031
|
/**
|
|
2863
3032
|
* @license
|
|
2864
3033
|
* Copyright 2019 Google LLC
|
|
@@ -2875,13 +3044,13 @@ const de = "__sak";
|
|
|
2875
3044
|
* See the License for the specific language governing permissions and
|
|
2876
3045
|
* limitations under the License.
|
|
2877
3046
|
*/
|
|
2878
|
-
class
|
|
3047
|
+
class Jt {
|
|
2879
3048
|
constructor(e, t) {
|
|
2880
3049
|
this.storageRetriever = e, this.type = t;
|
|
2881
3050
|
}
|
|
2882
3051
|
_isAvailable() {
|
|
2883
3052
|
try {
|
|
2884
|
-
return this.storage ? (this.storage.setItem(
|
|
3053
|
+
return this.storage ? (this.storage.setItem(ye, "1"), this.storage.removeItem(ye), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2885
3054
|
} catch {
|
|
2886
3055
|
return Promise.resolve(!1);
|
|
2887
3056
|
}
|
|
@@ -2916,18 +3085,18 @@ class Ht {
|
|
|
2916
3085
|
* See the License for the specific language governing permissions and
|
|
2917
3086
|
* limitations under the License.
|
|
2918
3087
|
*/
|
|
2919
|
-
function
|
|
2920
|
-
const n =
|
|
2921
|
-
return
|
|
3088
|
+
function qi() {
|
|
3089
|
+
const n = w();
|
|
3090
|
+
return Ge(n) || ke(n);
|
|
2922
3091
|
}
|
|
2923
|
-
const
|
|
2924
|
-
class
|
|
3092
|
+
const Ki = 1e3, Ji = 10;
|
|
3093
|
+
class Yt extends Jt {
|
|
2925
3094
|
constructor() {
|
|
2926
3095
|
super(
|
|
2927
3096
|
() => window.localStorage,
|
|
2928
3097
|
"LOCAL"
|
|
2929
3098
|
/* PersistenceType.LOCAL */
|
|
2930
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3099
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = qi() && bi(), this.fallbackToPolling = Wt(), this._shouldAllowMigration = !0;
|
|
2931
3100
|
}
|
|
2932
3101
|
forAllChangedKeys(e) {
|
|
2933
3102
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2954,7 +3123,7 @@ class Wt extends Ht {
|
|
|
2954
3123
|
const o = this.storage.getItem(i);
|
|
2955
3124
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2956
3125
|
}, s = this.storage.getItem(i);
|
|
2957
|
-
|
|
3126
|
+
ki() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ji) : r();
|
|
2958
3127
|
}
|
|
2959
3128
|
notifyListeners(e, t) {
|
|
2960
3129
|
this.localCache[e] = t;
|
|
@@ -2976,7 +3145,7 @@ class Wt extends Ht {
|
|
|
2976
3145
|
!0
|
|
2977
3146
|
);
|
|
2978
3147
|
});
|
|
2979
|
-
},
|
|
3148
|
+
}, Ki);
|
|
2980
3149
|
}
|
|
2981
3150
|
stopPolling() {
|
|
2982
3151
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3005,8 +3174,8 @@ class Wt extends Ht {
|
|
|
3005
3174
|
await super._remove(e), delete this.localCache[e];
|
|
3006
3175
|
}
|
|
3007
3176
|
}
|
|
3008
|
-
|
|
3009
|
-
const
|
|
3177
|
+
Yt.type = "LOCAL";
|
|
3178
|
+
const Yi = Yt;
|
|
3010
3179
|
/**
|
|
3011
3180
|
* @license
|
|
3012
3181
|
* Copyright 2020 Google LLC
|
|
@@ -3023,7 +3192,7 @@ const bi = Wt;
|
|
|
3023
3192
|
* See the License for the specific language governing permissions and
|
|
3024
3193
|
* limitations under the License.
|
|
3025
3194
|
*/
|
|
3026
|
-
class
|
|
3195
|
+
class Xt extends Jt {
|
|
3027
3196
|
constructor() {
|
|
3028
3197
|
super(
|
|
3029
3198
|
() => window.sessionStorage,
|
|
@@ -3036,8 +3205,8 @@ class jt extends Ht {
|
|
|
3036
3205
|
_removeListener(e, t) {
|
|
3037
3206
|
}
|
|
3038
3207
|
}
|
|
3039
|
-
|
|
3040
|
-
const
|
|
3208
|
+
Xt.type = "SESSION";
|
|
3209
|
+
const Qt = Xt;
|
|
3041
3210
|
/**
|
|
3042
3211
|
* @license
|
|
3043
3212
|
* Copyright 2019 Google LLC
|
|
@@ -3054,7 +3223,7 @@ const Gt = jt;
|
|
|
3054
3223
|
* See the License for the specific language governing permissions and
|
|
3055
3224
|
* limitations under the License.
|
|
3056
3225
|
*/
|
|
3057
|
-
function
|
|
3226
|
+
function Xi(n) {
|
|
3058
3227
|
return Promise.all(n.map(async (e) => {
|
|
3059
3228
|
try {
|
|
3060
3229
|
return {
|
|
@@ -3085,7 +3254,7 @@ function Si(n) {
|
|
|
3085
3254
|
* See the License for the specific language governing permissions and
|
|
3086
3255
|
* limitations under the License.
|
|
3087
3256
|
*/
|
|
3088
|
-
class
|
|
3257
|
+
class Ee {
|
|
3089
3258
|
constructor(e) {
|
|
3090
3259
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3091
3260
|
}
|
|
@@ -3099,7 +3268,7 @@ class ge {
|
|
|
3099
3268
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3100
3269
|
if (t)
|
|
3101
3270
|
return t;
|
|
3102
|
-
const i = new
|
|
3271
|
+
const i = new Ee(e);
|
|
3103
3272
|
return this.receivers.push(i), i;
|
|
3104
3273
|
}
|
|
3105
3274
|
isListeningto(e) {
|
|
@@ -3124,7 +3293,7 @@ class ge {
|
|
|
3124
3293
|
eventId: i,
|
|
3125
3294
|
eventType: r
|
|
3126
3295
|
});
|
|
3127
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3296
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Xi(c);
|
|
3128
3297
|
t.ports[0].postMessage({
|
|
3129
3298
|
status: "done",
|
|
3130
3299
|
eventId: i,
|
|
@@ -3153,7 +3322,7 @@ class ge {
|
|
|
3153
3322
|
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
3323
|
}
|
|
3155
3324
|
}
|
|
3156
|
-
|
|
3325
|
+
Ee.receivers = [];
|
|
3157
3326
|
/**
|
|
3158
3327
|
* @license
|
|
3159
3328
|
* Copyright 2020 Google LLC
|
|
@@ -3170,7 +3339,7 @@ ge.receivers = [];
|
|
|
3170
3339
|
* See the License for the specific language governing permissions and
|
|
3171
3340
|
* limitations under the License.
|
|
3172
3341
|
*/
|
|
3173
|
-
function
|
|
3342
|
+
function ze(n = "", e = 10) {
|
|
3174
3343
|
let t = "";
|
|
3175
3344
|
for (let i = 0; i < e; i++)
|
|
3176
3345
|
t += Math.floor(Math.random() * 10);
|
|
@@ -3192,7 +3361,7 @@ function xe(n = "", e = 10) {
|
|
|
3192
3361
|
* See the License for the specific language governing permissions and
|
|
3193
3362
|
* limitations under the License.
|
|
3194
3363
|
*/
|
|
3195
|
-
class
|
|
3364
|
+
class Qi {
|
|
3196
3365
|
constructor(e) {
|
|
3197
3366
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3198
3367
|
}
|
|
@@ -3226,7 +3395,7 @@ class Ri {
|
|
|
3226
3395
|
);
|
|
3227
3396
|
let s, o;
|
|
3228
3397
|
return new Promise((c, a) => {
|
|
3229
|
-
const l =
|
|
3398
|
+
const l = ze("", 20);
|
|
3230
3399
|
r.port1.start();
|
|
3231
3400
|
const d = setTimeout(() => {
|
|
3232
3401
|
a(new Error(
|
|
@@ -3236,10 +3405,10 @@ class Ri {
|
|
|
3236
3405
|
}, i);
|
|
3237
3406
|
o = {
|
|
3238
3407
|
messageChannel: r,
|
|
3239
|
-
onMessage(
|
|
3240
|
-
const
|
|
3241
|
-
if (
|
|
3242
|
-
switch (
|
|
3408
|
+
onMessage(m) {
|
|
3409
|
+
const h = m;
|
|
3410
|
+
if (h.data.eventId === l)
|
|
3411
|
+
switch (h.data.status) {
|
|
3243
3412
|
case "ack":
|
|
3244
3413
|
clearTimeout(d), s = setTimeout(
|
|
3245
3414
|
() => {
|
|
@@ -3253,7 +3422,7 @@ class Ri {
|
|
|
3253
3422
|
);
|
|
3254
3423
|
break;
|
|
3255
3424
|
case "done":
|
|
3256
|
-
clearTimeout(s), c(
|
|
3425
|
+
clearTimeout(s), c(h.data.response);
|
|
3257
3426
|
break;
|
|
3258
3427
|
default:
|
|
3259
3428
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3289,11 +3458,11 @@ class Ri {
|
|
|
3289
3458
|
* See the License for the specific language governing permissions and
|
|
3290
3459
|
* limitations under the License.
|
|
3291
3460
|
*/
|
|
3292
|
-
function
|
|
3461
|
+
function E() {
|
|
3293
3462
|
return window;
|
|
3294
3463
|
}
|
|
3295
|
-
function
|
|
3296
|
-
|
|
3464
|
+
function Zi(n) {
|
|
3465
|
+
E().location.href = n;
|
|
3297
3466
|
}
|
|
3298
3467
|
/**
|
|
3299
3468
|
* @license
|
|
@@ -3311,10 +3480,10 @@ function Ai(n) {
|
|
|
3311
3480
|
* See the License for the specific language governing permissions and
|
|
3312
3481
|
* limitations under the License.
|
|
3313
3482
|
*/
|
|
3314
|
-
function
|
|
3315
|
-
return typeof
|
|
3483
|
+
function Zt() {
|
|
3484
|
+
return typeof E().WorkerGlobalScope < "u" && typeof E().importScripts == "function";
|
|
3316
3485
|
}
|
|
3317
|
-
async function
|
|
3486
|
+
async function er() {
|
|
3318
3487
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3319
3488
|
return null;
|
|
3320
3489
|
try {
|
|
@@ -3323,12 +3492,12 @@ async function Pi() {
|
|
|
3323
3492
|
return null;
|
|
3324
3493
|
}
|
|
3325
3494
|
}
|
|
3326
|
-
function
|
|
3495
|
+
function tr() {
|
|
3327
3496
|
var n;
|
|
3328
3497
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3329
3498
|
}
|
|
3330
|
-
function
|
|
3331
|
-
return
|
|
3499
|
+
function nr() {
|
|
3500
|
+
return Zt() ? self : null;
|
|
3332
3501
|
}
|
|
3333
3502
|
/**
|
|
3334
3503
|
* @license
|
|
@@ -3346,8 +3515,8 @@ function Oi() {
|
|
|
3346
3515
|
* See the License for the specific language governing permissions and
|
|
3347
3516
|
* limitations under the License.
|
|
3348
3517
|
*/
|
|
3349
|
-
const
|
|
3350
|
-
class
|
|
3518
|
+
const en = "firebaseLocalStorageDb", ir = 1, we = "firebaseLocalStorage", tn = "fbase_key";
|
|
3519
|
+
class ce {
|
|
3351
3520
|
constructor(e) {
|
|
3352
3521
|
this.request = e;
|
|
3353
3522
|
}
|
|
@@ -3361,55 +3530,55 @@ class Z {
|
|
|
3361
3530
|
});
|
|
3362
3531
|
}
|
|
3363
3532
|
}
|
|
3364
|
-
function
|
|
3365
|
-
return n.transaction([
|
|
3533
|
+
function Se(n, e) {
|
|
3534
|
+
return n.transaction([we], e ? "readwrite" : "readonly").objectStore(we);
|
|
3366
3535
|
}
|
|
3367
|
-
function
|
|
3368
|
-
const n = indexedDB.deleteDatabase(
|
|
3369
|
-
return new
|
|
3536
|
+
function rr() {
|
|
3537
|
+
const n = indexedDB.deleteDatabase(en);
|
|
3538
|
+
return new ce(n).toPromise();
|
|
3370
3539
|
}
|
|
3371
|
-
function
|
|
3372
|
-
const n = indexedDB.open(
|
|
3540
|
+
function De() {
|
|
3541
|
+
const n = indexedDB.open(en, ir);
|
|
3373
3542
|
return new Promise((e, t) => {
|
|
3374
3543
|
n.addEventListener("error", () => {
|
|
3375
3544
|
t(n.error);
|
|
3376
3545
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3377
3546
|
const i = n.result;
|
|
3378
3547
|
try {
|
|
3379
|
-
i.createObjectStore(
|
|
3548
|
+
i.createObjectStore(we, { keyPath: tn });
|
|
3380
3549
|
} catch (r) {
|
|
3381
3550
|
t(r);
|
|
3382
3551
|
}
|
|
3383
3552
|
}), n.addEventListener("success", async () => {
|
|
3384
3553
|
const i = n.result;
|
|
3385
|
-
i.objectStoreNames.contains(
|
|
3554
|
+
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await rr(), e(await De()));
|
|
3386
3555
|
});
|
|
3387
3556
|
});
|
|
3388
3557
|
}
|
|
3389
|
-
async function
|
|
3390
|
-
const i =
|
|
3391
|
-
[
|
|
3558
|
+
async function ut(n, e, t) {
|
|
3559
|
+
const i = Se(n, !0).put({
|
|
3560
|
+
[tn]: e,
|
|
3392
3561
|
value: t
|
|
3393
3562
|
});
|
|
3394
|
-
return new
|
|
3563
|
+
return new ce(i).toPromise();
|
|
3395
3564
|
}
|
|
3396
|
-
async function
|
|
3397
|
-
const t =
|
|
3565
|
+
async function sr(n, e) {
|
|
3566
|
+
const t = Se(n, !1).get(e), i = await new ce(t).toPromise();
|
|
3398
3567
|
return i === void 0 ? null : i.value;
|
|
3399
3568
|
}
|
|
3400
|
-
function
|
|
3401
|
-
const t =
|
|
3402
|
-
return new
|
|
3569
|
+
function dt(n, e) {
|
|
3570
|
+
const t = Se(n, !0).delete(e);
|
|
3571
|
+
return new ce(t).toPromise();
|
|
3403
3572
|
}
|
|
3404
|
-
const
|
|
3405
|
-
class
|
|
3573
|
+
const or = 800, ar = 3;
|
|
3574
|
+
class nn {
|
|
3406
3575
|
constructor() {
|
|
3407
3576
|
this.type = "LOCAL", this._shouldAllowMigration = !0, this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.pendingWrites = 0, this.receiver = null, this.sender = null, this.serviceWorkerReceiverAvailable = !1, this.activeServiceWorker = null, this._workerInitializationPromise = this.initializeServiceWorkerMessaging().then(() => {
|
|
3408
3577
|
}, () => {
|
|
3409
3578
|
});
|
|
3410
3579
|
}
|
|
3411
3580
|
async _openDb() {
|
|
3412
|
-
return this.db ? this.db : (this.db = await
|
|
3581
|
+
return this.db ? this.db : (this.db = await De(), this.db);
|
|
3413
3582
|
}
|
|
3414
3583
|
async _withRetries(e) {
|
|
3415
3584
|
let t = 0;
|
|
@@ -3418,7 +3587,7 @@ class Kt {
|
|
|
3418
3587
|
const i = await this._openDb();
|
|
3419
3588
|
return await e(i);
|
|
3420
3589
|
} catch (i) {
|
|
3421
|
-
if (t++ >
|
|
3590
|
+
if (t++ > ar)
|
|
3422
3591
|
throw i;
|
|
3423
3592
|
this.db && (this.db.close(), this.db = void 0);
|
|
3424
3593
|
}
|
|
@@ -3428,13 +3597,13 @@ class Kt {
|
|
|
3428
3597
|
* postMessage interface to send these events to the worker ourselves.
|
|
3429
3598
|
*/
|
|
3430
3599
|
async initializeServiceWorkerMessaging() {
|
|
3431
|
-
return
|
|
3600
|
+
return Zt() ? this.initializeReceiver() : this.initializeSender();
|
|
3432
3601
|
}
|
|
3433
3602
|
/**
|
|
3434
3603
|
* As the worker we should listen to events from the main window.
|
|
3435
3604
|
*/
|
|
3436
3605
|
async initializeReceiver() {
|
|
3437
|
-
this.receiver =
|
|
3606
|
+
this.receiver = Ee._getInstance(nr()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3438
3607
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3439
3608
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3440
3609
|
"keyChanged"
|
|
@@ -3450,9 +3619,9 @@ class Kt {
|
|
|
3450
3619
|
*/
|
|
3451
3620
|
async initializeSender() {
|
|
3452
3621
|
var e, t;
|
|
3453
|
-
if (this.activeServiceWorker = await
|
|
3622
|
+
if (this.activeServiceWorker = await er(), !this.activeServiceWorker)
|
|
3454
3623
|
return;
|
|
3455
|
-
this.sender = new
|
|
3624
|
+
this.sender = new Qi(this.activeServiceWorker);
|
|
3456
3625
|
const i = await this.sender._send(
|
|
3457
3626
|
"ping",
|
|
3458
3627
|
{},
|
|
@@ -3474,7 +3643,7 @@ class Kt {
|
|
|
3474
3643
|
* @param key - Storage key which changed.
|
|
3475
3644
|
*/
|
|
3476
3645
|
async notifyServiceWorker(e) {
|
|
3477
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3646
|
+
if (!(!this.sender || !this.activeServiceWorker || tr() !== this.activeServiceWorker))
|
|
3478
3647
|
try {
|
|
3479
3648
|
await this.sender._send(
|
|
3480
3649
|
"keyChanged",
|
|
@@ -3490,8 +3659,8 @@ class Kt {
|
|
|
3490
3659
|
try {
|
|
3491
3660
|
if (!indexedDB)
|
|
3492
3661
|
return !1;
|
|
3493
|
-
const e = await
|
|
3494
|
-
return await
|
|
3662
|
+
const e = await De();
|
|
3663
|
+
return await ut(e, ye, "1"), await dt(e, ye), !0;
|
|
3495
3664
|
} catch {
|
|
3496
3665
|
}
|
|
3497
3666
|
return !1;
|
|
@@ -3505,19 +3674,19 @@ class Kt {
|
|
|
3505
3674
|
}
|
|
3506
3675
|
}
|
|
3507
3676
|
async _set(e, t) {
|
|
3508
|
-
return this._withPendingWrite(async () => (await this._withRetries((i) =>
|
|
3677
|
+
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3509
3678
|
}
|
|
3510
3679
|
async _get(e) {
|
|
3511
|
-
const t = await this._withRetries((i) =>
|
|
3680
|
+
const t = await this._withRetries((i) => sr(i, e));
|
|
3512
3681
|
return this.localCache[e] = t, t;
|
|
3513
3682
|
}
|
|
3514
3683
|
async _remove(e) {
|
|
3515
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
|
3684
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => dt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
|
3516
3685
|
}
|
|
3517
3686
|
async _poll() {
|
|
3518
3687
|
const e = await this._withRetries((r) => {
|
|
3519
|
-
const s =
|
|
3520
|
-
return new
|
|
3688
|
+
const s = Se(r, !1).getAll();
|
|
3689
|
+
return new ce(s).toPromise();
|
|
3521
3690
|
});
|
|
3522
3691
|
if (!e)
|
|
3523
3692
|
return [];
|
|
@@ -3539,7 +3708,7 @@ class Kt {
|
|
|
3539
3708
|
r(t);
|
|
3540
3709
|
}
|
|
3541
3710
|
startPolling() {
|
|
3542
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3711
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), or);
|
|
3543
3712
|
}
|
|
3544
3713
|
stopPolling() {
|
|
3545
3714
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3551,9 +3720,9 @@ class Kt {
|
|
|
3551
3720
|
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
3721
|
}
|
|
3553
3722
|
}
|
|
3554
|
-
|
|
3555
|
-
const
|
|
3556
|
-
new
|
|
3723
|
+
nn.type = "LOCAL";
|
|
3724
|
+
const cr = nn;
|
|
3725
|
+
new oe(3e4, 6e4);
|
|
3557
3726
|
/**
|
|
3558
3727
|
* @license
|
|
3559
3728
|
* Copyright 2021 Google LLC
|
|
@@ -3570,8 +3739,8 @@ new X(3e4, 6e4);
|
|
|
3570
3739
|
* See the License for the specific language governing permissions and
|
|
3571
3740
|
* limitations under the License.
|
|
3572
3741
|
*/
|
|
3573
|
-
function
|
|
3574
|
-
return e ?
|
|
3742
|
+
function lr(n, e) {
|
|
3743
|
+
return e ? N(e) : (u(
|
|
3575
3744
|
n._popupRedirectResolver,
|
|
3576
3745
|
n,
|
|
3577
3746
|
"argument-error"
|
|
@@ -3594,7 +3763,7 @@ function xi(n, e) {
|
|
|
3594
3763
|
* See the License for the specific language governing permissions and
|
|
3595
3764
|
* limitations under the License.
|
|
3596
3765
|
*/
|
|
3597
|
-
class
|
|
3766
|
+
class qe extends zt {
|
|
3598
3767
|
constructor(e) {
|
|
3599
3768
|
super(
|
|
3600
3769
|
"custom",
|
|
@@ -3603,13 +3772,13 @@ class Ve extends xt {
|
|
|
3603
3772
|
), this.params = e;
|
|
3604
3773
|
}
|
|
3605
3774
|
_getIdTokenResponse(e) {
|
|
3606
|
-
return
|
|
3775
|
+
return J(e, this._buildIdpRequest());
|
|
3607
3776
|
}
|
|
3608
3777
|
_linkToIdToken(e, t) {
|
|
3609
|
-
return
|
|
3778
|
+
return J(e, this._buildIdpRequest(t));
|
|
3610
3779
|
}
|
|
3611
3780
|
_getReauthenticationResolver(e) {
|
|
3612
|
-
return
|
|
3781
|
+
return J(e, this._buildIdpRequest());
|
|
3613
3782
|
}
|
|
3614
3783
|
_buildIdpRequest(e) {
|
|
3615
3784
|
const t = {
|
|
@@ -3624,26 +3793,26 @@ class Ve extends xt {
|
|
|
3624
3793
|
return e && (t.idToken = e), t;
|
|
3625
3794
|
}
|
|
3626
3795
|
}
|
|
3627
|
-
function
|
|
3628
|
-
return
|
|
3796
|
+
function ur(n) {
|
|
3797
|
+
return ji(n.auth, new qe(n), n.bypassAuthState);
|
|
3629
3798
|
}
|
|
3630
|
-
function
|
|
3799
|
+
function dr(n) {
|
|
3631
3800
|
const { auth: e, user: t } = n;
|
|
3632
3801
|
return u(
|
|
3633
3802
|
t,
|
|
3634
3803
|
e,
|
|
3635
3804
|
"internal-error"
|
|
3636
3805
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3637
|
-
),
|
|
3806
|
+
), Hi(t, new qe(n), n.bypassAuthState);
|
|
3638
3807
|
}
|
|
3639
|
-
async function
|
|
3808
|
+
async function hr(n) {
|
|
3640
3809
|
const { auth: e, user: t } = n;
|
|
3641
3810
|
return u(
|
|
3642
3811
|
t,
|
|
3643
3812
|
e,
|
|
3644
3813
|
"internal-error"
|
|
3645
3814
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3646
|
-
),
|
|
3815
|
+
), $i(t, new qe(n), n.bypassAuthState);
|
|
3647
3816
|
}
|
|
3648
3817
|
/**
|
|
3649
3818
|
* @license
|
|
@@ -3661,7 +3830,7 @@ async function Hi(n) {
|
|
|
3661
3830
|
* See the License for the specific language governing permissions and
|
|
3662
3831
|
* limitations under the License.
|
|
3663
3832
|
*/
|
|
3664
|
-
class
|
|
3833
|
+
class rn {
|
|
3665
3834
|
constructor(e, t, i, r, s = !1) {
|
|
3666
3835
|
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
3836
|
}
|
|
@@ -3703,15 +3872,15 @@ class Jt {
|
|
|
3703
3872
|
switch (e) {
|
|
3704
3873
|
case "signInViaPopup":
|
|
3705
3874
|
case "signInViaRedirect":
|
|
3706
|
-
return
|
|
3875
|
+
return ur;
|
|
3707
3876
|
case "linkViaPopup":
|
|
3708
3877
|
case "linkViaRedirect":
|
|
3709
|
-
return
|
|
3878
|
+
return hr;
|
|
3710
3879
|
case "reauthViaPopup":
|
|
3711
3880
|
case "reauthViaRedirect":
|
|
3712
|
-
return
|
|
3881
|
+
return dr;
|
|
3713
3882
|
default:
|
|
3714
|
-
|
|
3883
|
+
O(
|
|
3715
3884
|
this.auth,
|
|
3716
3885
|
"internal-error"
|
|
3717
3886
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3719,10 +3888,10 @@ class Jt {
|
|
|
3719
3888
|
}
|
|
3720
3889
|
}
|
|
3721
3890
|
resolve(e) {
|
|
3722
|
-
|
|
3891
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3723
3892
|
}
|
|
3724
3893
|
reject(e) {
|
|
3725
|
-
|
|
3894
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3726
3895
|
}
|
|
3727
3896
|
unregisterAndCleanUp() {
|
|
3728
3897
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3744,10 +3913,10 @@ class Jt {
|
|
|
3744
3913
|
* See the License for the specific language governing permissions and
|
|
3745
3914
|
* limitations under the License.
|
|
3746
3915
|
*/
|
|
3747
|
-
const
|
|
3748
|
-
class
|
|
3916
|
+
const fr = new oe(2e3, 1e4);
|
|
3917
|
+
class z extends rn {
|
|
3749
3918
|
constructor(e, t, i, r, s) {
|
|
3750
|
-
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null,
|
|
3919
|
+
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, z.currentPopupAction && z.currentPopupAction.cancel(), z.currentPopupAction = this;
|
|
3751
3920
|
}
|
|
3752
3921
|
async executeNotNull() {
|
|
3753
3922
|
const e = await this.execute();
|
|
@@ -3759,8 +3928,8 @@ class V extends Jt {
|
|
|
3759
3928
|
), e;
|
|
3760
3929
|
}
|
|
3761
3930
|
async onExecution() {
|
|
3762
|
-
|
|
3763
|
-
const e =
|
|
3931
|
+
L(this.filter.length === 1, "Popup operations only handle one event");
|
|
3932
|
+
const e = ze();
|
|
3764
3933
|
this.authWindow = await this.resolver._openPopup(
|
|
3765
3934
|
this.auth,
|
|
3766
3935
|
this.provider,
|
|
@@ -3770,7 +3939,7 @@ class V extends Jt {
|
|
|
3770
3939
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3771
3940
|
this.reject(t);
|
|
3772
3941
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3773
|
-
t || this.reject(
|
|
3942
|
+
t || this.reject(b(
|
|
3774
3943
|
this.auth,
|
|
3775
3944
|
"web-storage-unsupported"
|
|
3776
3945
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3782,14 +3951,14 @@ class V extends Jt {
|
|
|
3782
3951
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3783
3952
|
}
|
|
3784
3953
|
cancel() {
|
|
3785
|
-
this.reject(
|
|
3954
|
+
this.reject(b(
|
|
3786
3955
|
this.auth,
|
|
3787
3956
|
"cancelled-popup-request"
|
|
3788
3957
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
3789
3958
|
));
|
|
3790
3959
|
}
|
|
3791
3960
|
cleanUp() {
|
|
3792
|
-
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null,
|
|
3961
|
+
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null, z.currentPopupAction = null;
|
|
3793
3962
|
}
|
|
3794
3963
|
pollUserCancellation() {
|
|
3795
3964
|
const e = () => {
|
|
@@ -3797,7 +3966,7 @@ class V extends Jt {
|
|
|
3797
3966
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3798
3967
|
this.pollId = window.setTimeout(
|
|
3799
3968
|
() => {
|
|
3800
|
-
this.pollId = null, this.reject(
|
|
3969
|
+
this.pollId = null, this.reject(b(
|
|
3801
3970
|
this.auth,
|
|
3802
3971
|
"popup-closed-by-user"
|
|
3803
3972
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3808,12 +3977,12 @@ class V extends Jt {
|
|
|
3808
3977
|
);
|
|
3809
3978
|
return;
|
|
3810
3979
|
}
|
|
3811
|
-
this.pollId = window.setTimeout(e,
|
|
3980
|
+
this.pollId = window.setTimeout(e, fr.get());
|
|
3812
3981
|
};
|
|
3813
3982
|
e();
|
|
3814
3983
|
}
|
|
3815
3984
|
}
|
|
3816
|
-
|
|
3985
|
+
z.currentPopupAction = null;
|
|
3817
3986
|
/**
|
|
3818
3987
|
* @license
|
|
3819
3988
|
* Copyright 2020 Google LLC
|
|
@@ -3830,8 +3999,8 @@ V.currentPopupAction = null;
|
|
|
3830
3999
|
* See the License for the specific language governing permissions and
|
|
3831
4000
|
* limitations under the License.
|
|
3832
4001
|
*/
|
|
3833
|
-
const
|
|
3834
|
-
class
|
|
4002
|
+
const pr = "pendingRedirect", he = /* @__PURE__ */ new Map();
|
|
4003
|
+
class mr extends rn {
|
|
3835
4004
|
constructor(e, t, i = !1) {
|
|
3836
4005
|
super(e, [
|
|
3837
4006
|
"signInViaRedirect",
|
|
@@ -3846,17 +4015,17 @@ class Gi extends Jt {
|
|
|
3846
4015
|
* just return it.
|
|
3847
4016
|
*/
|
|
3848
4017
|
async execute() {
|
|
3849
|
-
let e =
|
|
4018
|
+
let e = he.get(this.auth._key());
|
|
3850
4019
|
if (!e) {
|
|
3851
4020
|
try {
|
|
3852
|
-
const i = await
|
|
4021
|
+
const i = await gr(this.resolver, this.auth) ? await super.execute() : null;
|
|
3853
4022
|
e = () => Promise.resolve(i);
|
|
3854
4023
|
} catch (t) {
|
|
3855
4024
|
e = () => Promise.reject(t);
|
|
3856
4025
|
}
|
|
3857
|
-
|
|
4026
|
+
he.set(this.auth._key(), e);
|
|
3858
4027
|
}
|
|
3859
|
-
return this.bypassAuthState ||
|
|
4028
|
+
return this.bypassAuthState || he.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3860
4029
|
}
|
|
3861
4030
|
async onAuthEvent(e) {
|
|
3862
4031
|
if (e.type === "signInViaRedirect")
|
|
@@ -3877,26 +4046,26 @@ class Gi extends Jt {
|
|
|
3877
4046
|
cleanUp() {
|
|
3878
4047
|
}
|
|
3879
4048
|
}
|
|
3880
|
-
async function
|
|
3881
|
-
const t =
|
|
4049
|
+
async function gr(n, e) {
|
|
4050
|
+
const t = Ir(e), i = vr(n);
|
|
3882
4051
|
if (!await i._isAvailable())
|
|
3883
4052
|
return !1;
|
|
3884
4053
|
const r = await i._get(t) === "true";
|
|
3885
4054
|
return await i._remove(t), r;
|
|
3886
4055
|
}
|
|
3887
|
-
function
|
|
3888
|
-
|
|
4056
|
+
function _r(n, e) {
|
|
4057
|
+
he.set(n._key(), e);
|
|
3889
4058
|
}
|
|
3890
|
-
function
|
|
3891
|
-
return
|
|
4059
|
+
function vr(n) {
|
|
4060
|
+
return N(n._redirectPersistence);
|
|
3892
4061
|
}
|
|
3893
|
-
function
|
|
3894
|
-
return
|
|
4062
|
+
function Ir(n) {
|
|
4063
|
+
return de(pr, n.config.apiKey, n.name);
|
|
3895
4064
|
}
|
|
3896
|
-
async function
|
|
3897
|
-
if (
|
|
3898
|
-
return Promise.reject(
|
|
3899
|
-
const i =
|
|
4065
|
+
async function yr(n, e, t = !1) {
|
|
4066
|
+
if (A(n.app))
|
|
4067
|
+
return Promise.reject(H(n));
|
|
4068
|
+
const i = be(n), r = lr(i, e), o = await new mr(i, r, t).execute();
|
|
3900
4069
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3901
4070
|
}
|
|
3902
4071
|
/**
|
|
@@ -3915,8 +4084,8 @@ async function Ji(n, e, t = !1) {
|
|
|
3915
4084
|
* See the License for the specific language governing permissions and
|
|
3916
4085
|
* limitations under the License.
|
|
3917
4086
|
*/
|
|
3918
|
-
const
|
|
3919
|
-
class
|
|
4087
|
+
const wr = 10 * 60 * 1e3;
|
|
4088
|
+
class Tr {
|
|
3920
4089
|
constructor(e) {
|
|
3921
4090
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3922
4091
|
}
|
|
@@ -3932,13 +4101,13 @@ class Xi {
|
|
|
3932
4101
|
let t = !1;
|
|
3933
4102
|
return this.consumers.forEach((i) => {
|
|
3934
4103
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3935
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4104
|
+
}), this.hasHandledPotentialRedirect || !kr(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3936
4105
|
}
|
|
3937
4106
|
sendToConsumer(e, t) {
|
|
3938
4107
|
var i;
|
|
3939
|
-
if (e.error && !
|
|
4108
|
+
if (e.error && !sn(e)) {
|
|
3940
4109
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
3941
|
-
t.onError(
|
|
4110
|
+
t.onError(b(this.auth, r));
|
|
3942
4111
|
} else
|
|
3943
4112
|
t.onAuthEvent(e);
|
|
3944
4113
|
}
|
|
@@ -3947,26 +4116,26 @@ class Xi {
|
|
|
3947
4116
|
return t.filter.includes(e.type) && i;
|
|
3948
4117
|
}
|
|
3949
4118
|
hasEventBeenHandled(e) {
|
|
3950
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4119
|
+
return Date.now() - this.lastProcessedEventTime >= wr && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
3951
4120
|
}
|
|
3952
4121
|
saveEventToCache(e) {
|
|
3953
|
-
this.cachedEventUids.add(
|
|
4122
|
+
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
3954
4123
|
}
|
|
3955
4124
|
}
|
|
3956
|
-
function
|
|
4125
|
+
function ht(n) {
|
|
3957
4126
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
3958
4127
|
}
|
|
3959
|
-
function
|
|
4128
|
+
function sn({ type: n, error: e }) {
|
|
3960
4129
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3961
4130
|
}
|
|
3962
|
-
function
|
|
4131
|
+
function kr(n) {
|
|
3963
4132
|
switch (n.type) {
|
|
3964
4133
|
case "signInViaRedirect":
|
|
3965
4134
|
case "linkViaRedirect":
|
|
3966
4135
|
case "reauthViaRedirect":
|
|
3967
4136
|
return !0;
|
|
3968
4137
|
case "unknown":
|
|
3969
|
-
return
|
|
4138
|
+
return sn(n);
|
|
3970
4139
|
default:
|
|
3971
4140
|
return !1;
|
|
3972
4141
|
}
|
|
@@ -3987,8 +4156,8 @@ function Qi(n) {
|
|
|
3987
4156
|
* See the License for the specific language governing permissions and
|
|
3988
4157
|
* limitations under the License.
|
|
3989
4158
|
*/
|
|
3990
|
-
async function
|
|
3991
|
-
return
|
|
4159
|
+
async function br(n, e = {}) {
|
|
4160
|
+
return X(n, "GET", "/v1/projects", e);
|
|
3992
4161
|
}
|
|
3993
4162
|
/**
|
|
3994
4163
|
* @license
|
|
@@ -4006,32 +4175,32 @@ async function Zi(n, e = {}) {
|
|
|
4006
4175
|
* See the License for the specific language governing permissions and
|
|
4007
4176
|
* limitations under the License.
|
|
4008
4177
|
*/
|
|
4009
|
-
const
|
|
4010
|
-
async function
|
|
4178
|
+
const Er = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Sr = /^https?/;
|
|
4179
|
+
async function Rr(n) {
|
|
4011
4180
|
if (n.config.emulator)
|
|
4012
4181
|
return;
|
|
4013
|
-
const { authorizedDomains: e } = await
|
|
4182
|
+
const { authorizedDomains: e } = await br(n);
|
|
4014
4183
|
for (const t of e)
|
|
4015
4184
|
try {
|
|
4016
|
-
if (
|
|
4185
|
+
if (Ar(t))
|
|
4017
4186
|
return;
|
|
4018
4187
|
} catch {
|
|
4019
4188
|
}
|
|
4020
|
-
|
|
4189
|
+
O(
|
|
4021
4190
|
n,
|
|
4022
4191
|
"unauthorized-domain"
|
|
4023
4192
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4024
4193
|
);
|
|
4025
4194
|
}
|
|
4026
|
-
function
|
|
4027
|
-
const e =
|
|
4195
|
+
function Ar(n) {
|
|
4196
|
+
const e = Me(), { protocol: t, hostname: i } = new URL(e);
|
|
4028
4197
|
if (n.startsWith("chrome-extension://")) {
|
|
4029
4198
|
const o = new URL(n);
|
|
4030
4199
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4031
4200
|
}
|
|
4032
|
-
if (!
|
|
4201
|
+
if (!Sr.test(t))
|
|
4033
4202
|
return !1;
|
|
4034
|
-
if (
|
|
4203
|
+
if (Er.test(n))
|
|
4035
4204
|
return i === n;
|
|
4036
4205
|
const r = n.replace(/\./g, "\\.");
|
|
4037
4206
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4052,9 +4221,9 @@ function ir(n) {
|
|
|
4052
4221
|
* See the License for the specific language governing permissions and
|
|
4053
4222
|
* limitations under the License.
|
|
4054
4223
|
*/
|
|
4055
|
-
const
|
|
4056
|
-
function
|
|
4057
|
-
const n =
|
|
4224
|
+
const Pr = new oe(3e4, 6e4);
|
|
4225
|
+
function ft() {
|
|
4226
|
+
const n = E().___jsl;
|
|
4058
4227
|
if (n != null && n.H) {
|
|
4059
4228
|
for (const e of Object.keys(n.H))
|
|
4060
4229
|
if (n.H[e].r = n.H[e].r || [], n.H[e].L = n.H[e].L || [], n.H[e].r = [...n.H[e].L], n.CP)
|
|
@@ -4062,45 +4231,45 @@ function ot() {
|
|
|
4062
4231
|
n.CP[t] = null;
|
|
4063
4232
|
}
|
|
4064
4233
|
}
|
|
4065
|
-
function
|
|
4234
|
+
function Cr(n) {
|
|
4066
4235
|
return new Promise((e, t) => {
|
|
4067
4236
|
var i, r, s;
|
|
4068
4237
|
function o() {
|
|
4069
|
-
|
|
4238
|
+
ft(), gapi.load("gapi.iframes", {
|
|
4070
4239
|
callback: () => {
|
|
4071
4240
|
e(gapi.iframes.getContext());
|
|
4072
4241
|
},
|
|
4073
4242
|
ontimeout: () => {
|
|
4074
|
-
|
|
4243
|
+
ft(), t(b(
|
|
4075
4244
|
n,
|
|
4076
4245
|
"network-request-failed"
|
|
4077
4246
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4078
4247
|
));
|
|
4079
4248
|
},
|
|
4080
|
-
timeout:
|
|
4249
|
+
timeout: Pr.get()
|
|
4081
4250
|
});
|
|
4082
4251
|
}
|
|
4083
|
-
if (!((r = (i =
|
|
4252
|
+
if (!((r = (i = E().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4084
4253
|
e(gapi.iframes.getContext());
|
|
4085
|
-
else if (!((s =
|
|
4254
|
+
else if (!((s = E().gapi) === null || s === void 0) && s.load)
|
|
4086
4255
|
o();
|
|
4087
4256
|
else {
|
|
4088
|
-
const c =
|
|
4089
|
-
return
|
|
4090
|
-
gapi.load ? o() : t(
|
|
4257
|
+
const c = Li("iframefcb");
|
|
4258
|
+
return E()[c] = () => {
|
|
4259
|
+
gapi.load ? o() : t(b(
|
|
4091
4260
|
n,
|
|
4092
4261
|
"network-request-failed"
|
|
4093
4262
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4094
4263
|
));
|
|
4095
|
-
},
|
|
4264
|
+
}, Ni(`${Oi()}?onload=${c}`).catch((a) => t(a));
|
|
4096
4265
|
}
|
|
4097
4266
|
}).catch((e) => {
|
|
4098
|
-
throw
|
|
4267
|
+
throw fe = null, e;
|
|
4099
4268
|
});
|
|
4100
4269
|
}
|
|
4101
|
-
let
|
|
4102
|
-
function
|
|
4103
|
-
return
|
|
4270
|
+
let fe = null;
|
|
4271
|
+
function Nr(n) {
|
|
4272
|
+
return fe = fe || Cr(n), fe;
|
|
4104
4273
|
}
|
|
4105
4274
|
/**
|
|
4106
4275
|
* @license
|
|
@@ -4118,7 +4287,7 @@ function or(n) {
|
|
|
4118
4287
|
* See the License for the specific language governing permissions and
|
|
4119
4288
|
* limitations under the License.
|
|
4120
4289
|
*/
|
|
4121
|
-
const
|
|
4290
|
+
const Or = new oe(5e3, 15e3), Lr = "__/auth/iframe", Mr = "emulator/auth/iframe", Ur = {
|
|
4122
4291
|
style: {
|
|
4123
4292
|
position: "absolute",
|
|
4124
4293
|
top: "-100px",
|
|
@@ -4127,13 +4296,13 @@ const ar = new X(5e3, 15e3), cr = "__/auth/iframe", lr = "emulator/auth/iframe",
|
|
|
4127
4296
|
},
|
|
4128
4297
|
"aria-hidden": "true",
|
|
4129
4298
|
tabindex: "-1"
|
|
4130
|
-
},
|
|
4299
|
+
}, Dr = /* @__PURE__ */ new Map([
|
|
4131
4300
|
["identitytoolkit.googleapis.com", "p"],
|
|
4132
4301
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4133
4302
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4134
4303
|
// test
|
|
4135
4304
|
]);
|
|
4136
|
-
function
|
|
4305
|
+
function xr(n) {
|
|
4137
4306
|
const e = n.config;
|
|
4138
4307
|
u(
|
|
4139
4308
|
e.authDomain,
|
|
@@ -4141,17 +4310,17 @@ function hr(n) {
|
|
|
4141
4310
|
"auth-domain-config-required"
|
|
4142
4311
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4143
4312
|
);
|
|
4144
|
-
const t = e.emulator ?
|
|
4313
|
+
const t = e.emulator ? je(e, Mr) : `https://${n.config.authDomain}/${Lr}`, i = {
|
|
4145
4314
|
apiKey: e.apiKey,
|
|
4146
4315
|
appName: n.name,
|
|
4147
|
-
v:
|
|
4148
|
-
}, r =
|
|
4316
|
+
v: re
|
|
4317
|
+
}, r = Dr.get(n.config.apiHost);
|
|
4149
4318
|
r && (i.eid = r);
|
|
4150
4319
|
const s = n._getFrameworks();
|
|
4151
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4320
|
+
return s.length && (i.fw = s.join(",")), `${t}?${se(i).slice(1)}`;
|
|
4152
4321
|
}
|
|
4153
|
-
async function
|
|
4154
|
-
const e = await
|
|
4322
|
+
async function Fr(n) {
|
|
4323
|
+
const e = await Nr(n), t = E().gapi;
|
|
4155
4324
|
return u(
|
|
4156
4325
|
t,
|
|
4157
4326
|
n,
|
|
@@ -4159,24 +4328,24 @@ async function fr(n) {
|
|
|
4159
4328
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4160
4329
|
), e.open({
|
|
4161
4330
|
where: document.body,
|
|
4162
|
-
url:
|
|
4331
|
+
url: xr(n),
|
|
4163
4332
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4164
|
-
attributes:
|
|
4333
|
+
attributes: Ur,
|
|
4165
4334
|
dontclear: !0
|
|
4166
4335
|
}, (i) => new Promise(async (r, s) => {
|
|
4167
4336
|
await i.restyle({
|
|
4168
4337
|
// Prevent iframe from closing on mouse out.
|
|
4169
4338
|
setHideOnLeave: !1
|
|
4170
4339
|
});
|
|
4171
|
-
const o =
|
|
4340
|
+
const o = b(
|
|
4172
4341
|
n,
|
|
4173
4342
|
"network-request-failed"
|
|
4174
4343
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4175
|
-
), c =
|
|
4344
|
+
), c = E().setTimeout(() => {
|
|
4176
4345
|
s(o);
|
|
4177
|
-
},
|
|
4346
|
+
}, Or.get());
|
|
4178
4347
|
function a() {
|
|
4179
|
-
|
|
4348
|
+
E().clearTimeout(c), r(i);
|
|
4180
4349
|
}
|
|
4181
4350
|
i.ping(a).then(a, () => {
|
|
4182
4351
|
s(o);
|
|
@@ -4199,13 +4368,13 @@ async function fr(n) {
|
|
|
4199
4368
|
* See the License for the specific language governing permissions and
|
|
4200
4369
|
* limitations under the License.
|
|
4201
4370
|
*/
|
|
4202
|
-
const
|
|
4371
|
+
const Vr = {
|
|
4203
4372
|
location: "yes",
|
|
4204
4373
|
resizable: "yes",
|
|
4205
4374
|
statusbar: "yes",
|
|
4206
4375
|
toolbar: "no"
|
|
4207
|
-
},
|
|
4208
|
-
class
|
|
4376
|
+
}, $r = 500, Hr = 600, jr = "_blank", Wr = "http://localhost";
|
|
4377
|
+
class pt {
|
|
4209
4378
|
constructor(e) {
|
|
4210
4379
|
this.window = e, this.associatedEvent = null;
|
|
4211
4380
|
}
|
|
@@ -4217,33 +4386,33 @@ class at {
|
|
|
4217
4386
|
}
|
|
4218
4387
|
}
|
|
4219
4388
|
}
|
|
4220
|
-
function
|
|
4389
|
+
function Gr(n, e, t, i = $r, r = Hr) {
|
|
4221
4390
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4222
4391
|
let c = "";
|
|
4223
|
-
const a = Object.assign(Object.assign({},
|
|
4392
|
+
const a = Object.assign(Object.assign({}, Vr), {
|
|
4224
4393
|
width: i.toString(),
|
|
4225
4394
|
height: r.toString(),
|
|
4226
4395
|
top: s,
|
|
4227
4396
|
left: o
|
|
4228
|
-
}), l =
|
|
4229
|
-
t && (c =
|
|
4230
|
-
const d = Object.entries(a).reduce((
|
|
4231
|
-
if (
|
|
4232
|
-
return
|
|
4233
|
-
const
|
|
4397
|
+
}), l = w().toLowerCase();
|
|
4398
|
+
t && (c = Ft(l) ? jr : t), xt(l) && (e = e || Wr, a.scrollbars = "yes");
|
|
4399
|
+
const d = Object.entries(a).reduce((h, [y, _]) => `${h}${y}=${_},`, "");
|
|
4400
|
+
if (Ti(l) && c !== "_self")
|
|
4401
|
+
return Br(e || "", c), new pt(null);
|
|
4402
|
+
const m = window.open(e || "", c, d);
|
|
4234
4403
|
u(
|
|
4235
|
-
|
|
4404
|
+
m,
|
|
4236
4405
|
n,
|
|
4237
4406
|
"popup-blocked"
|
|
4238
4407
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
4239
4408
|
);
|
|
4240
4409
|
try {
|
|
4241
|
-
|
|
4410
|
+
m.focus();
|
|
4242
4411
|
} catch {
|
|
4243
4412
|
}
|
|
4244
|
-
return new
|
|
4413
|
+
return new pt(m);
|
|
4245
4414
|
}
|
|
4246
|
-
function
|
|
4415
|
+
function Br(n, e) {
|
|
4247
4416
|
const t = document.createElement("a");
|
|
4248
4417
|
t.href = n, t.target = e;
|
|
4249
4418
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4265,8 +4434,8 @@ function Tr(n, e) {
|
|
|
4265
4434
|
* See the License for the specific language governing permissions and
|
|
4266
4435
|
* limitations under the License.
|
|
4267
4436
|
*/
|
|
4268
|
-
const
|
|
4269
|
-
async function
|
|
4437
|
+
const zr = "__/auth/handler", qr = "emulator/auth/handler", Kr = encodeURIComponent("fac");
|
|
4438
|
+
async function mt(n, e, t, i, r, s) {
|
|
4270
4439
|
u(
|
|
4271
4440
|
n.config.authDomain,
|
|
4272
4441
|
n,
|
|
@@ -4283,27 +4452,27 @@ async function ct(n, e, t, i, r, s) {
|
|
|
4283
4452
|
appName: n.name,
|
|
4284
4453
|
authType: t,
|
|
4285
4454
|
redirectUrl: i,
|
|
4286
|
-
v:
|
|
4455
|
+
v: re,
|
|
4287
4456
|
eventId: r
|
|
4288
4457
|
};
|
|
4289
|
-
if (e instanceof
|
|
4290
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4291
|
-
for (const [d,
|
|
4292
|
-
o[d] =
|
|
4458
|
+
if (e instanceof qt) {
|
|
4459
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", On(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4460
|
+
for (const [d, m] of Object.entries({}))
|
|
4461
|
+
o[d] = m;
|
|
4293
4462
|
}
|
|
4294
|
-
if (e instanceof
|
|
4295
|
-
const d = e.getScopes().filter((
|
|
4463
|
+
if (e instanceof ae) {
|
|
4464
|
+
const d = e.getScopes().filter((m) => m !== "");
|
|
4296
4465
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4297
4466
|
}
|
|
4298
4467
|
n.tenantId && (o.tid = n.tenantId);
|
|
4299
4468
|
const c = o;
|
|
4300
4469
|
for (const d of Object.keys(c))
|
|
4301
4470
|
c[d] === void 0 && delete c[d];
|
|
4302
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4303
|
-
return `${
|
|
4471
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Kr}=${encodeURIComponent(a)}` : "";
|
|
4472
|
+
return `${Jr(n)}?${se(c).slice(1)}${l}`;
|
|
4304
4473
|
}
|
|
4305
|
-
function
|
|
4306
|
-
return n.emulator ?
|
|
4474
|
+
function Jr({ config: n }) {
|
|
4475
|
+
return n.emulator ? je(n, qr) : `https://${n.authDomain}/${zr}`;
|
|
4307
4476
|
}
|
|
4308
4477
|
/**
|
|
4309
4478
|
* @license
|
|
@@ -4321,30 +4490,30 @@ function kr({ config: n }) {
|
|
|
4321
4490
|
* See the License for the specific language governing permissions and
|
|
4322
4491
|
* limitations under the License.
|
|
4323
4492
|
*/
|
|
4324
|
-
const
|
|
4325
|
-
class
|
|
4493
|
+
const Ne = "webStorageSupport";
|
|
4494
|
+
class Yr {
|
|
4326
4495
|
constructor() {
|
|
4327
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4496
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn = yr, this._overrideRedirectResult = _r;
|
|
4328
4497
|
}
|
|
4329
4498
|
// Wrapping in async even though we don't await anywhere in order
|
|
4330
4499
|
// to make sure errors are raised as promise rejections
|
|
4331
4500
|
async _openPopup(e, t, i, r) {
|
|
4332
4501
|
var s;
|
|
4333
|
-
|
|
4334
|
-
const o = await
|
|
4335
|
-
return
|
|
4502
|
+
L((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4503
|
+
const o = await mt(e, t, i, Me(), r);
|
|
4504
|
+
return Gr(e, o, ze());
|
|
4336
4505
|
}
|
|
4337
4506
|
async _openRedirect(e, t, i, r) {
|
|
4338
4507
|
await this._originValidation(e);
|
|
4339
|
-
const s = await
|
|
4340
|
-
return
|
|
4508
|
+
const s = await mt(e, t, i, Me(), r);
|
|
4509
|
+
return Zi(s), new Promise(() => {
|
|
4341
4510
|
});
|
|
4342
4511
|
}
|
|
4343
4512
|
_initialize(e) {
|
|
4344
4513
|
const t = e._key();
|
|
4345
4514
|
if (this.eventManagers[t]) {
|
|
4346
4515
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4347
|
-
return r ? Promise.resolve(r) : (
|
|
4516
|
+
return r ? Promise.resolve(r) : (L(s, "If manager is not set, promise should be"), s);
|
|
4348
4517
|
}
|
|
4349
4518
|
const i = this.initAndGetManager(e);
|
|
4350
4519
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4352,7 +4521,7 @@ class br {
|
|
|
4352
4521
|
}), i;
|
|
4353
4522
|
}
|
|
4354
4523
|
async initAndGetManager(e) {
|
|
4355
|
-
const t = await
|
|
4524
|
+
const t = await Fr(e), i = new Tr(e);
|
|
4356
4525
|
return t.register("authEvent", (r) => (u(
|
|
4357
4526
|
r == null ? void 0 : r.authEvent,
|
|
4358
4527
|
e,
|
|
@@ -4364,10 +4533,10 @@ class br {
|
|
|
4364
4533
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: i }, this.iframes[e._key()] = t, i;
|
|
4365
4534
|
}
|
|
4366
4535
|
_isIframeWebStorageSupported(e, t) {
|
|
4367
|
-
this.iframes[e._key()].send(
|
|
4536
|
+
this.iframes[e._key()].send(Ne, { type: Ne }, (r) => {
|
|
4368
4537
|
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),
|
|
4538
|
+
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
4539
|
+
o !== void 0 && t(!!o), O(
|
|
4371
4540
|
e,
|
|
4372
4541
|
"internal-error"
|
|
4373
4542
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4376,14 +4545,14 @@ class br {
|
|
|
4376
4545
|
}
|
|
4377
4546
|
_originValidation(e) {
|
|
4378
4547
|
const t = e._key();
|
|
4379
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4548
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Rr(e)), this.originValidationPromises[t];
|
|
4380
4549
|
}
|
|
4381
4550
|
get _shouldInitProactively() {
|
|
4382
|
-
return
|
|
4551
|
+
return Wt() || Ge() || ke();
|
|
4383
4552
|
}
|
|
4384
4553
|
}
|
|
4385
|
-
const
|
|
4386
|
-
var
|
|
4554
|
+
const Xr = Yr;
|
|
4555
|
+
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4387
4556
|
/**
|
|
4388
4557
|
* @license
|
|
4389
4558
|
* Copyright 2020 Google LLC
|
|
@@ -4400,7 +4569,7 @@ var lt = "@firebase/auth", ut = "1.7.5";
|
|
|
4400
4569
|
* See the License for the specific language governing permissions and
|
|
4401
4570
|
* limitations under the License.
|
|
4402
4571
|
*/
|
|
4403
|
-
class
|
|
4572
|
+
class Qr {
|
|
4404
4573
|
constructor(e) {
|
|
4405
4574
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4406
4575
|
}
|
|
@@ -4451,7 +4620,7 @@ class Rr {
|
|
|
4451
4620
|
* See the License for the specific language governing permissions and
|
|
4452
4621
|
* limitations under the License.
|
|
4453
4622
|
*/
|
|
4454
|
-
function
|
|
4623
|
+
function Zr(n) {
|
|
4455
4624
|
switch (n) {
|
|
4456
4625
|
case "Node":
|
|
4457
4626
|
return "node";
|
|
@@ -4467,8 +4636,8 @@ function Ar(n) {
|
|
|
4467
4636
|
return;
|
|
4468
4637
|
}
|
|
4469
4638
|
}
|
|
4470
|
-
function
|
|
4471
|
-
|
|
4639
|
+
function es(n) {
|
|
4640
|
+
Ze(new et(
|
|
4472
4641
|
"auth",
|
|
4473
4642
|
(e, { options: t }) => {
|
|
4474
4643
|
const i = e.getProvider("app").getImmediate(), r = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: c } = i.options;
|
|
@@ -4480,9 +4649,9 @@ function Pr(n) {
|
|
|
4480
4649
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4481
4650
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4482
4651
|
apiScheme: "https",
|
|
4483
|
-
sdkClientVersion:
|
|
4484
|
-
}, l = new
|
|
4485
|
-
return
|
|
4652
|
+
sdkClientVersion: Gt(n)
|
|
4653
|
+
}, l = new Pi(i, r, s, a);
|
|
4654
|
+
return Ui(l, t), l;
|
|
4486
4655
|
},
|
|
4487
4656
|
"PUBLIC"
|
|
4488
4657
|
/* ComponentType.PUBLIC */
|
|
@@ -4494,21 +4663,21 @@ function Pr(n) {
|
|
|
4494
4663
|
"auth-internal"
|
|
4495
4664
|
/* _ComponentName.AUTH_INTERNAL */
|
|
4496
4665
|
).initialize();
|
|
4497
|
-
})),
|
|
4666
|
+
})), Ze(new et(
|
|
4498
4667
|
"auth-internal",
|
|
4499
4668
|
(e) => {
|
|
4500
|
-
const t =
|
|
4669
|
+
const t = be(e.getProvider(
|
|
4501
4670
|
"auth"
|
|
4502
4671
|
/* _ComponentName.AUTH */
|
|
4503
4672
|
).getImmediate());
|
|
4504
|
-
return ((i) => new
|
|
4673
|
+
return ((i) => new Qr(i))(t);
|
|
4505
4674
|
},
|
|
4506
4675
|
"PRIVATE"
|
|
4507
4676
|
/* ComponentType.PRIVATE */
|
|
4508
4677
|
).setInstantiationMode(
|
|
4509
4678
|
"EXPLICIT"
|
|
4510
4679
|
/* InstantiationMode.EXPLICIT */
|
|
4511
|
-
)),
|
|
4680
|
+
)), Le(gt, _t, Zr(n)), Le(gt, _t, "esm2017");
|
|
4512
4681
|
}
|
|
4513
4682
|
/**
|
|
4514
4683
|
* @license
|
|
@@ -4526,117 +4695,118 @@ function Pr(n) {
|
|
|
4526
4695
|
* See the License for the specific language governing permissions and
|
|
4527
4696
|
* limitations under the License.
|
|
4528
4697
|
*/
|
|
4529
|
-
const
|
|
4530
|
-
let
|
|
4531
|
-
const
|
|
4698
|
+
const ts = 5 * 60, ns = kt("authIdTokenMaxAge") || ts;
|
|
4699
|
+
let vt = null;
|
|
4700
|
+
const is = (n) => async (e) => {
|
|
4532
4701
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4533
|
-
if (i && i >
|
|
4702
|
+
if (i && i > ns)
|
|
4534
4703
|
return;
|
|
4535
4704
|
const r = t == null ? void 0 : t.token;
|
|
4536
|
-
|
|
4705
|
+
vt !== r && (vt = r, await fetch(n, {
|
|
4537
4706
|
method: r ? "POST" : "DELETE",
|
|
4538
4707
|
headers: r ? {
|
|
4539
4708
|
Authorization: `Bearer ${r}`
|
|
4540
4709
|
} : {}
|
|
4541
4710
|
}));
|
|
4542
4711
|
};
|
|
4543
|
-
function
|
|
4544
|
-
const e =
|
|
4712
|
+
function rs(n = An()) {
|
|
4713
|
+
const e = bt(n, "auth");
|
|
4545
4714
|
if (e.isInitialized())
|
|
4546
4715
|
return e.getImmediate();
|
|
4547
|
-
const t =
|
|
4548
|
-
popupRedirectResolver:
|
|
4716
|
+
const t = Mi(n, {
|
|
4717
|
+
popupRedirectResolver: Xr,
|
|
4549
4718
|
persistence: [
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4719
|
+
cr,
|
|
4720
|
+
Yi,
|
|
4721
|
+
Qt
|
|
4553
4722
|
]
|
|
4554
|
-
}), i =
|
|
4723
|
+
}), i = kt("authTokenSyncURL");
|
|
4555
4724
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4556
4725
|
const s = new URL(i, location.origin);
|
|
4557
4726
|
if (location.origin === s.origin) {
|
|
4558
|
-
const o =
|
|
4559
|
-
|
|
4727
|
+
const o = is(s.toString());
|
|
4728
|
+
zi(t, o, () => o(t.currentUser)), Bi(t, (c) => o(c));
|
|
4560
4729
|
}
|
|
4561
4730
|
}
|
|
4562
|
-
const r =
|
|
4563
|
-
return r &&
|
|
4731
|
+
const r = Rn("auth");
|
|
4732
|
+
return r && Di(t, `http://${r}`), t;
|
|
4564
4733
|
}
|
|
4565
|
-
function
|
|
4734
|
+
function ss() {
|
|
4566
4735
|
var n, e;
|
|
4567
4736
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4568
4737
|
}
|
|
4569
|
-
|
|
4738
|
+
Ci({
|
|
4570
4739
|
loadJS(n) {
|
|
4571
4740
|
return new Promise((e, t) => {
|
|
4572
4741
|
const i = document.createElement("script");
|
|
4573
4742
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4574
|
-
const s =
|
|
4743
|
+
const s = b(
|
|
4575
4744
|
"internal-error"
|
|
4576
4745
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4577
4746
|
);
|
|
4578
4747
|
s.customData = r, t(s);
|
|
4579
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4748
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", ss().appendChild(i);
|
|
4580
4749
|
});
|
|
4581
4750
|
},
|
|
4582
4751
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4583
4752
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4584
4753
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4585
4754
|
});
|
|
4586
|
-
|
|
4755
|
+
es(
|
|
4587
4756
|
"Browser"
|
|
4588
4757
|
/* ClientPlatform.BROWSER */
|
|
4589
4758
|
);
|
|
4590
|
-
var
|
|
4591
|
-
const
|
|
4592
|
-
key:
|
|
4759
|
+
var os = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" }, as = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
4760
|
+
const cs = {
|
|
4761
|
+
key: 2,
|
|
4593
4762
|
class: "h-full w-full"
|
|
4594
|
-
},
|
|
4763
|
+
}, ls = ["src"], Ss = /* @__PURE__ */ xe({
|
|
4595
4764
|
__name: "App",
|
|
4596
4765
|
setup(n) {
|
|
4597
|
-
const e =
|
|
4598
|
-
const
|
|
4599
|
-
return `${
|
|
4766
|
+
const e = ge(), t = pn(), i = mn(), r = gn(), s = _n(), o = wt(), c = ee(o.query.showHeader !== "false"), a = ee(!1), { currentBusiness: l } = ge(), d = ee(!1), m = ne(() => i.version), h = ne(() => {
|
|
4767
|
+
const p = e.currentCountry.value || "MY", I = tt.getIdToken(), T = l.value._id;
|
|
4768
|
+
return `${as.marketingV1Portal}/b/${T}/marketing/overview?showHeader=false&country=${p}&token=${I}`;
|
|
4600
4769
|
});
|
|
4601
|
-
async function
|
|
4602
|
-
if (
|
|
4770
|
+
async function y() {
|
|
4771
|
+
if (Ln().length) {
|
|
4603
4772
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4604
4773
|
return;
|
|
4605
4774
|
}
|
|
4606
|
-
const
|
|
4607
|
-
await
|
|
4775
|
+
const p = Mn(os.firebase), I = await fn.getCustomToken(), T = rs();
|
|
4776
|
+
await Gi(T, I), Un(p), console.log("initFirebase", p);
|
|
4608
4777
|
}
|
|
4609
|
-
const
|
|
4610
|
-
d.value = !1, await
|
|
4778
|
+
const _ = async () => {
|
|
4779
|
+
d.value = !1, await dn(), console.log("forceRerender"), tt.setBusinessId(l.value._id), await i.readPremium(), !a.value && m.value === "v2" ? e.registerSidebarComponent(Vn) : e.hideSidebarToggle(!0), await y(), a.value = !0, d.value = !0;
|
|
4611
4780
|
};
|
|
4612
|
-
return
|
|
4613
|
-
if (
|
|
4614
|
-
const
|
|
4615
|
-
|
|
4781
|
+
return un(() => {
|
|
4782
|
+
if (Dn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4783
|
+
const p = document.getElementsByClassName("app-header")[0], I = document.getElementsByClassName("app-sidebar")[0], T = document.getElementsByClassName("app-container")[0], M = document.getElementsByTagName("main")[0];
|
|
4784
|
+
p == null || p.classList.add("!hidden"), I == null || I.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), M == null || M.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4616
4785
|
}
|
|
4617
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4618
|
-
}),
|
|
4786
|
+
l.value != null && (console.log("App mounted, forceRerender"), _());
|
|
4787
|
+
}), pe(
|
|
4619
4788
|
() => e.currentBusiness.value,
|
|
4620
|
-
async (
|
|
4621
|
-
console.log("Current business changed"),
|
|
4789
|
+
async (p, I) => {
|
|
4790
|
+
console.log("Current business changed"), p != null && p._id != I._id && (console.log("forceRerender when business changes", p, I), _());
|
|
4622
4791
|
}
|
|
4623
|
-
), (
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4792
|
+
), (p, I) => (W(), me(It, null, [
|
|
4793
|
+
g(d) && g(m) === "v2" ? (W(), Oe(g(hn), { key: 0 })) : Pe("", !0),
|
|
4794
|
+
g(d) && g(m) === "v2" && g(c) ? (W(), Oe(ii, { key: 1 })) : Pe("", !0),
|
|
4795
|
+
g(d) && g(m) !== "v2" ? (W(), me("div", cs, [
|
|
4796
|
+
S(wn, {
|
|
4797
|
+
json: { url: g(h) }
|
|
4628
4798
|
}, null, 8, ["json"]),
|
|
4629
|
-
|
|
4799
|
+
v("iframe", {
|
|
4630
4800
|
allow: "clipboard-read; clipboard-write",
|
|
4631
4801
|
frameBorder: "0",
|
|
4632
4802
|
height: "100%",
|
|
4633
4803
|
width: "100%",
|
|
4634
|
-
src:
|
|
4635
|
-
}, null, 8,
|
|
4636
|
-
])) :
|
|
4804
|
+
src: g(h)
|
|
4805
|
+
}, null, 8, ls)
|
|
4806
|
+
])) : Pe("", !0)
|
|
4637
4807
|
], 64));
|
|
4638
4808
|
}
|
|
4639
4809
|
});
|
|
4640
4810
|
export {
|
|
4641
|
-
|
|
4811
|
+
Ss as default
|
|
4642
4812
|
};
|