@feedmepos/mf-connect 0.1.38-beta.9 → 0.1.38-beta.91
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/{Analytic-3MN2saaU.js → Analytic-Drbkm5By.js} +31 -32
- package/dist/{App-Co8X5Wdy.js → App-C0cdcG5i.js} +741 -728
- package/dist/AuditLogs-BZZLtf2u.js +2013 -0
- package/dist/{Bin-8a56ZDib.js → Bin-DRV5lRmj.js} +10 -10
- package/dist/Broadcast-C90FN2LB.js +266 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BVXlfq31.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsdxwjCn.js} +6 -6
- package/dist/{Card-B8_09LJu.js → Card-CWF84A1O.js} +145 -140
- package/dist/Collections-ja0gMaFf.js +540 -0
- package/dist/Credit-D8U2AJgq.js +260 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-YR62BvBG.js +3120 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVbhDMqH.js +351 -0
- package/dist/Experience-DDXLGizu.js +259 -0
- package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-Dng61jiL.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
- package/dist/Game-CMOilzsW.js +330 -0
- package/dist/Grab-tPVQB39R.js +300 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-BbtEXO4b.js} +49 -48
- package/dist/{Index-DLF71mx_.js → Index-Ch7wiShF.js} +54 -54
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-DLO0jj6Z.js +48 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CplyhUFF.js} +1 -1
- package/dist/{MainLayout-B1aJoR95.js → MainLayout-BMqnfxHh.js} +1 -1
- package/dist/Marketing-C0weDg-u.js +236 -0
- package/dist/MarketingMaterialEdit-BD-SyXVQ.js +1036 -0
- package/dist/{Member-Bkw4aqtv.js → Member-Bpf0amjr.js} +38 -37
- package/dist/{MemberList-a3PdVYB3.js → MemberList-cWYPEpL4.js} +485 -489
- package/dist/{MemberTransactions-CPDBd-n3.js → MemberTransactions-vzRUVwpO.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-pbN8pN1m.js → MessageInput.vue_vue_type_script_setup_true_lang-DY3L9CvB.js} +10392 -9967
- package/dist/Mission-HRwIp1QY.js +334 -0
- package/dist/{Overview-De97NDoe.js → Overview-D9cfX4Kr.js} +34 -34
- package/dist/Point-Dz-Z0_m9.js +262 -0
- package/dist/Promotion-Csb0bdI6.js +397 -0
- package/dist/{Queue-ISVZxCE2.js → Queue-CAVKh9bK.js} +18 -18
- package/dist/{Record-2FMByNC6.js → Record-bPnIoHnT.js} +15 -14
- package/dist/Review-D2DfvLqJ.js +621 -0
- package/dist/ReviewFacebookCallback-CI7V3xbp.js +243 -0
- package/dist/ReviewGoogleCallback-LA2S8FLZ.js +213 -0
- package/dist/{Reward-DPRyQ37x.js → Reward-DdHF5Pr7.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Ba7-3bL-.js → RewardGroup.vue_vue_type_script_setup_true_lang-DyZhWnI4.js} +13 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B0OSLJVN.js +1912 -0
- package/dist/Segment-DV1zcWF7.js +1015 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DZbyDVid.js → SelectItems.vue_vue_type_script_setup_true_lang-Df1HE9sL.js} +23 -23
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ioMFYIwK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C0K9giqI.js} +12 -12
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzJL8Xl0.js +226 -0
- package/dist/Setting-DZiZy8A5.js +2039 -0
- package/dist/SettingAdvertisements-Bb9shWVJ.js +264 -0
- package/dist/Store-mymtMyho.js +1996 -0
- package/dist/StoreRewards-jcjZfSv7.js +537 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B-b5_TFL.js +1130 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-sCa1J_hq.js +7007 -0
- package/dist/{Tier-CwRj0oJ1.js → Tier-Ba6aHC3R.js} +562 -480
- package/dist/{Title-EII5OxSP.js → Title-C4uKD8E1.js} +151 -149
- package/dist/{Transaction-1MTkAfej.js → Transaction-Bf2uG6co.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BlQVWQHJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C3ttU-bw.js} +7 -7
- package/dist/Voucher-Lsc2pKCk.js +421 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-MA7tsTm-.js +421 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CTeGK4bk.js → ZodTextField.vue_vue_type_script_setup_true_lang-DEDavbCx.js} +2 -2
- package/dist/app-BRrGcz9U.js +59647 -0
- package/dist/app.js +1 -1
- package/dist/{business-DjnN-J4U.js → business-TBSvPv65.js} +11 -8
- package/dist/campaign-CL95CZkI.js +219 -0
- package/dist/campaign-DxcuYXB7.js +254 -0
- package/dist/campaign.enum-DRydaoy9.js +26 -0
- package/dist/campaign.fn-BsoUwQ5N.js +776 -0
- package/dist/{collectible.enum-r6N115Lu.js → collectible.enum-CpTbpumt.js} +1 -1
- package/dist/{collection.fn-CSsfVv26.js → collection.fn-BNrPdDIr.js} +2 -2
- package/dist/dto-BGrkIVqX.js +222 -0
- package/dist/duplicateCampaign-DBaFROXd.js +51 -0
- package/dist/effect-fonU-1xO.js +89 -0
- package/dist/{email-addresses-D8uheCCF.js → email-addresses-WeV5Gvxa.js} +2 -2
- package/dist/{export-Ver6WiX6.js → export-DDXf8yf_.js} +4 -4
- package/dist/{helper-Bg4xoFbh.js → helper-DwnzJKxo.js} +22 -7
- package/dist/index-10x-WMiS.js +30289 -0
- package/dist/index-9Wt89ReU.js +3625 -0
- package/dist/{index-Bb0CHeNx.js → index-Brh5FXQ7.js} +3 -3
- package/dist/index-BxxNZQUc.js +8910 -0
- package/dist/{index-hJUxCNsF.js → index-CDAMmPIn.js} +1 -1
- package/dist/{index-CNhr0_Zx.js → index-Cg1vzNzf.js} +617 -191
- package/dist/{index-BZZ4iF4-.js → index-Cl7QnFc4.js} +23 -12
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/{index-BPQyQc4q.js → index-Cvw-xFek.js} +1 -1
- package/dist/index-DCJ_r_e2.js +85 -0
- package/dist/{index-Dn_bmcns.js → index-DLG8B-TK.js} +3 -3
- package/dist/{index-D4JOeJJJ.js → index-DWhh_u0L.js} +1 -1
- package/dist/index-DsQJTvKe.js +28900 -0
- package/dist/index-oR7xhhIt.js +48 -0
- package/dist/{index.esm2017-hK1Mi9yY.js → index.esm2017-CFvohTUs.js} +122 -122
- package/dist/{loading-kIQFOTwH.js → loading-DiD8J1Jc.js} +4 -3
- package/dist/{lodash-B5I3zXaY.js → lodash-BJgKlNEt.js} +1 -1
- package/dist/{membership--xR-HZoa.js → membership-C8HuK9_K.js} +38 -18
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-c-ITXnlg.js → money-DXl1-c0l.js} +1 -1
- package/dist/{number-DfZSBLOY.js → number-C6RGu6qp.js} +1 -1
- package/dist/objectid-8Boc1xMT.js +145 -0
- package/dist/{campaign-BpJ1O6KS.js → plugins-CxBcRdUi.js} +677 -699
- package/dist/remy-D_Deb3ue.js +13 -0
- package/dist/{reward-CE0ifMHS.js → reward-CEh2CA9Z.js} +1 -1
- package/dist/{rule-DrjdmpaB.js → rule-DEfU8NOO.js} +505 -487
- package/dist/rule-builder-BZIx2IzX.js +102 -0
- package/dist/string-Gcy5IM_H.js +32 -0
- package/dist/style.css +11 -2
- package/dist/template-Ba8NxY41.js +188 -0
- package/dist/timezone-DUqMvcwo.js +1156 -0
- package/dist/trigger-KQ-DPHv-.js +213 -0
- package/dist/useMarketingMaterialActions-DSI7Fpu9.js +96 -0
- package/dist/usePagination-BeTADCIt.js +220 -0
- package/dist/{user-Cl3IotYV.js → user-DN6_QE2j.js} +15 -14
- package/dist/vue-i18n-B4dOYJz4.js +2365 -0
- package/dist/{xlsx-BDBzdOuM.js → xlsx-BDFTkXYe.js} +1 -1
- package/dist/{zod-Bg2FbC-D.js → zod-B8WJKIxe.js} +32 -31
- package/package.json +14 -6
- package/dist/AuditLogs-DTq6IAuc.js +0 -1887
- package/dist/Broadcast-UreS5Kiq.js +0 -227
- package/dist/Collections-B0I5ULxR.js +0 -465
- package/dist/Credit-B4Ad8DWP.js +0 -222
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DjgACf9F.js +0 -2185
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-y5JnuIev.js +0 -347
- package/dist/Experience-xO5KpTTm.js +0 -223
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
- package/dist/Game-ChgrVvz5.js +0 -278
- package/dist/Marketing-BlmRXSGl.js +0 -20073
- package/dist/Mission-B07wK0HX.js +0 -296
- package/dist/Point-Ckj9QIeH.js +0 -226
- package/dist/Promotion-aGNCOeRN.js +0 -289
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DWj-421v.js +0 -1751
- package/dist/Segment-CRMNJ11X.js +0 -882
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cfp8XXdO.js +0 -147
- package/dist/Setting-c0FWRZsD.js +0 -1936
- package/dist/Store-Bm1_15s8.js +0 -1842
- package/dist/StoreRewards-BCQHHfay.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfTF2l-D.js +0 -1029
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-rvhoxo0w.js +0 -139
- package/dist/Voucher-CYvjCb-v.js +0 -384
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-63Jr71dJ.js +0 -419
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/app-BJLHk8ao.js +0 -33357
- package/dist/app-BzIk1ojT.js +0 -7086
- package/dist/campaign-BHNS5kXt.js +0 -96
- package/dist/campaign.enum-CJDWE_Om.js +0 -20
- package/dist/campaign.fn-C0HQE9uh.js +0 -758
- package/dist/dto-Byq51uVH.js +0 -214
- package/dist/effect-Do3yTM-_.js +0 -78
- package/dist/index-B1V9UnI9.js +0 -76
- package/dist/index-BM9CWjC6.js +0 -38
- package/dist/index-CsaQJMAR.js +0 -66
- package/dist/index-D6VxioBg.js +0 -30038
- package/dist/index-DGKlRWn3.js +0 -32260
- package/dist/index-DLKyOu7W.js +0 -8861
- package/dist/index-DyYF6HYL.js +0 -121
- package/dist/index-UXtH44XQ.js +0 -3120
- package/dist/objectid-DKbha9-x.js +0 -145
- package/dist/plugins-DtakupKW.js +0 -208
- package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
- package/dist/rule-builder-B_hCyq3x.js +0 -89
- package/dist/template-WI4a-lFY.js +0 -190
- package/dist/trigger-DieDHht3.js +0 -144
- package/dist/usePagination-BeF5K3M7.js +0 -223
- package/dist/vue-i18n-DKh0SMhL.js +0 -2365
|
@@ -1,73 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import { e as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { C as j } from "./campaign.fn-C0HQE9uh.js";
|
|
9
|
-
import { c as ce } from "./plugins-DtakupKW.js";
|
|
10
|
-
import { e as je, Z as S, a as fe, i as Re, z as Fe } from "./app-BzIk1ojT.js";
|
|
11
|
-
import { detectLocale as Ie, createFeedMeI18n as De } from "@feedmepos/mf-common";
|
|
12
|
-
import { h as B } from "vue";
|
|
13
|
-
import { F as R } from "./campaign.enum-CJDWE_Om.js";
|
|
14
|
-
const d = (a) => typeof a == "string", _ = () => {
|
|
15
|
-
let a, e;
|
|
1
|
+
import { u as fe, v as ge, x as Ee, w as Ie, y as Fe } from "./index.esm2017-CFvohTUs.js";
|
|
2
|
+
import { u as oe } from "./app-wDQR6dpb.js";
|
|
3
|
+
import { e as Ae, Z as O, b as de, i as ke, z as De } from "./app-BRrGcz9U.js";
|
|
4
|
+
import { detectLocale as Te, createFeedMeI18n as Ke } from "@feedmepos/mf-common";
|
|
5
|
+
import { S as k } from "./index-DsQJTvKe.js";
|
|
6
|
+
const d = (n) => typeof n == "string", H = () => {
|
|
7
|
+
let n, e;
|
|
16
8
|
const t = new Promise((s, i) => {
|
|
17
|
-
|
|
9
|
+
n = s, e = i;
|
|
18
10
|
});
|
|
19
|
-
return t.resolve =
|
|
20
|
-
},
|
|
21
|
-
|
|
11
|
+
return t.resolve = n, t.reject = e, t;
|
|
12
|
+
}, pe = (n) => n == null ? "" : "" + n, Me = (n, e, t) => {
|
|
13
|
+
n.forEach((s) => {
|
|
22
14
|
e[s] && (t[s] = e[s]);
|
|
23
15
|
});
|
|
24
|
-
},
|
|
16
|
+
}, Ue = /###/g, me = (n) => n && n.indexOf("###") > -1 ? n.replace(Ue, ".") : n, ve = (n) => !n || d(n), B = (n, e, t) => {
|
|
25
17
|
const s = d(e) ? e.split(".") : e;
|
|
26
18
|
let i = 0;
|
|
27
19
|
for (; i < s.length - 1; ) {
|
|
28
|
-
if (
|
|
29
|
-
const r =
|
|
30
|
-
!
|
|
20
|
+
if (ve(n)) return {};
|
|
21
|
+
const r = me(s[i]);
|
|
22
|
+
!n[r] && t && (n[r] = new t()), Object.prototype.hasOwnProperty.call(n, r) ? n = n[r] : n = {}, ++i;
|
|
31
23
|
}
|
|
32
|
-
return
|
|
33
|
-
obj:
|
|
34
|
-
k:
|
|
24
|
+
return ve(n) ? {} : {
|
|
25
|
+
obj: n,
|
|
26
|
+
k: me(s[i])
|
|
35
27
|
};
|
|
36
|
-
},
|
|
28
|
+
}, xe = (n, e, t) => {
|
|
37
29
|
const {
|
|
38
30
|
obj: s,
|
|
39
31
|
k: i
|
|
40
|
-
} =
|
|
32
|
+
} = B(n, e, Object);
|
|
41
33
|
if (s !== void 0 || e.length === 1) {
|
|
42
34
|
s[i] = t;
|
|
43
35
|
return;
|
|
44
36
|
}
|
|
45
|
-
let r = e[e.length - 1],
|
|
46
|
-
for (; o.obj === void 0 &&
|
|
47
|
-
r = `${
|
|
37
|
+
let r = e[e.length - 1], a = e.slice(0, e.length - 1), o = B(n, a, Object);
|
|
38
|
+
for (; o.obj === void 0 && a.length; )
|
|
39
|
+
r = `${a[a.length - 1]}.${r}`, a = a.slice(0, a.length - 1), o = B(n, a, Object), o != null && o.obj && typeof o.obj[`${o.k}.${r}`] < "u" && (o.obj = void 0);
|
|
48
40
|
o.obj[`${o.k}.${r}`] = t;
|
|
49
|
-
},
|
|
41
|
+
}, He = (n, e, t, s) => {
|
|
50
42
|
const {
|
|
51
43
|
obj: i,
|
|
52
44
|
k: r
|
|
53
|
-
} =
|
|
45
|
+
} = B(n, e, Object);
|
|
54
46
|
i[r] = i[r] || [], i[r].push(t);
|
|
55
|
-
},
|
|
47
|
+
}, Y = (n, e) => {
|
|
56
48
|
const {
|
|
57
49
|
obj: t,
|
|
58
50
|
k: s
|
|
59
|
-
} =
|
|
51
|
+
} = B(n, e);
|
|
60
52
|
if (t && Object.prototype.hasOwnProperty.call(t, s))
|
|
61
53
|
return t[s];
|
|
62
|
-
},
|
|
63
|
-
const s =
|
|
64
|
-
return s !== void 0 ? s :
|
|
65
|
-
},
|
|
54
|
+
}, Be = (n, e, t) => {
|
|
55
|
+
const s = Y(n, t);
|
|
56
|
+
return s !== void 0 ? s : Y(e, t);
|
|
57
|
+
}, Ne = (n, e, t) => {
|
|
66
58
|
for (const s in e)
|
|
67
|
-
s !== "__proto__" && s !== "constructor" && (s in
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
var
|
|
59
|
+
s !== "__proto__" && s !== "constructor" && (s in n ? d(n[s]) || n[s] instanceof String || d(e[s]) || e[s] instanceof String ? t && (n[s] = e[s]) : Ne(n[s], e[s], t) : n[s] = e[s]);
|
|
60
|
+
return n;
|
|
61
|
+
}, F = (n) => n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
62
|
+
var ze = {
|
|
71
63
|
"&": "&",
|
|
72
64
|
"<": "<",
|
|
73
65
|
">": ">",
|
|
@@ -75,7 +67,7 @@ var Ue = {
|
|
|
75
67
|
"'": "'",
|
|
76
68
|
"/": "/"
|
|
77
69
|
};
|
|
78
|
-
const
|
|
70
|
+
const Je = (n) => d(n) ? n.replace(/[&<>"'\/]/g, (e) => ze[e]) : n;
|
|
79
71
|
class _e {
|
|
80
72
|
constructor(e) {
|
|
81
73
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
@@ -88,62 +80,62 @@ class _e {
|
|
|
88
80
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, s), this.regExpQueue.push(e), s;
|
|
89
81
|
}
|
|
90
82
|
}
|
|
91
|
-
const
|
|
83
|
+
const We = [" ", ",", "?", "!", ";"], Ze = new _e(20), Ye = (n, e, t) => {
|
|
92
84
|
e = e || "", t = t || "";
|
|
93
|
-
const s =
|
|
85
|
+
const s = We.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
94
86
|
if (s.length === 0) return !0;
|
|
95
|
-
const i =
|
|
96
|
-
let r = !i.test(
|
|
87
|
+
const i = Ze.getRegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
88
|
+
let r = !i.test(n);
|
|
97
89
|
if (!r) {
|
|
98
|
-
const
|
|
99
|
-
|
|
90
|
+
const a = n.indexOf(t);
|
|
91
|
+
a > 0 && !i.test(n.substring(0, a)) && (r = !0);
|
|
100
92
|
}
|
|
101
93
|
return r;
|
|
102
|
-
},
|
|
94
|
+
}, ae = function(n, e) {
|
|
103
95
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
104
|
-
if (!
|
|
105
|
-
if (
|
|
106
|
-
return Object.prototype.hasOwnProperty.call(
|
|
96
|
+
if (!n) return;
|
|
97
|
+
if (n[e])
|
|
98
|
+
return Object.prototype.hasOwnProperty.call(n, e) ? n[e] : void 0;
|
|
107
99
|
const s = e.split(t);
|
|
108
|
-
let i =
|
|
100
|
+
let i = n;
|
|
109
101
|
for (let r = 0; r < s.length; ) {
|
|
110
102
|
if (!i || typeof i != "object")
|
|
111
103
|
return;
|
|
112
|
-
let
|
|
104
|
+
let a, o = "";
|
|
113
105
|
for (let l = r; l < s.length; ++l)
|
|
114
|
-
if (l !== r && (o += t), o += s[l],
|
|
115
|
-
if (["string", "number", "boolean"].indexOf(typeof
|
|
106
|
+
if (l !== r && (o += t), o += s[l], a = i[o], a !== void 0) {
|
|
107
|
+
if (["string", "number", "boolean"].indexOf(typeof a) > -1 && l < s.length - 1)
|
|
116
108
|
continue;
|
|
117
109
|
r += l - r + 1;
|
|
118
110
|
break;
|
|
119
111
|
}
|
|
120
|
-
i =
|
|
112
|
+
i = a;
|
|
121
113
|
}
|
|
122
114
|
return i;
|
|
123
|
-
}, Q = (
|
|
115
|
+
}, Q = (n) => n == null ? void 0 : n.replace("_", "-"), Qe = {
|
|
124
116
|
type: "logger",
|
|
125
|
-
log(
|
|
126
|
-
this.output("log",
|
|
117
|
+
log(n) {
|
|
118
|
+
this.output("log", n);
|
|
127
119
|
},
|
|
128
|
-
warn(
|
|
129
|
-
this.output("warn",
|
|
120
|
+
warn(n) {
|
|
121
|
+
this.output("warn", n);
|
|
130
122
|
},
|
|
131
|
-
error(
|
|
132
|
-
this.output("error",
|
|
123
|
+
error(n) {
|
|
124
|
+
this.output("error", n);
|
|
133
125
|
},
|
|
134
|
-
output(
|
|
126
|
+
output(n, e) {
|
|
135
127
|
var t, s;
|
|
136
|
-
(s = (t = console == null ? void 0 : console[
|
|
128
|
+
(s = (t = console == null ? void 0 : console[n]) == null ? void 0 : t.apply) == null || s.call(t, console, e);
|
|
137
129
|
}
|
|
138
130
|
};
|
|
139
|
-
class
|
|
131
|
+
class G {
|
|
140
132
|
constructor(e) {
|
|
141
133
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
142
134
|
this.init(e, t);
|
|
143
135
|
}
|
|
144
136
|
init(e) {
|
|
145
137
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
146
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
138
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || Qe, this.options = t, this.debug = t.debug;
|
|
147
139
|
}
|
|
148
140
|
log() {
|
|
149
141
|
for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
|
|
@@ -169,17 +161,17 @@ class X {
|
|
|
169
161
|
return i && !this.debug ? null : (d(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
170
162
|
}
|
|
171
163
|
create(e) {
|
|
172
|
-
return new
|
|
164
|
+
return new G(this.logger, {
|
|
173
165
|
prefix: `${this.prefix}:${e}:`,
|
|
174
166
|
...this.options
|
|
175
167
|
});
|
|
176
168
|
}
|
|
177
169
|
clone(e) {
|
|
178
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new
|
|
170
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new G(this.logger, e);
|
|
179
171
|
}
|
|
180
172
|
}
|
|
181
|
-
var P = new
|
|
182
|
-
class
|
|
173
|
+
var P = new G();
|
|
174
|
+
class X {
|
|
183
175
|
constructor() {
|
|
184
176
|
this.observers = {};
|
|
185
177
|
}
|
|
@@ -202,18 +194,18 @@ class ee {
|
|
|
202
194
|
emit(e) {
|
|
203
195
|
for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
|
|
204
196
|
s[i - 1] = arguments[i];
|
|
205
|
-
this.observers[e] && Array.from(this.observers[e].entries()).forEach((
|
|
206
|
-
let [o, l] =
|
|
197
|
+
this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
|
|
198
|
+
let [o, l] = a;
|
|
207
199
|
for (let u = 0; u < l; u++)
|
|
208
200
|
o(...s);
|
|
209
|
-
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((
|
|
210
|
-
let [o, l] =
|
|
201
|
+
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
|
|
202
|
+
let [o, l] = a;
|
|
211
203
|
for (let u = 0; u < l; u++)
|
|
212
204
|
o.apply(o, [e, ...s]);
|
|
213
205
|
});
|
|
214
206
|
}
|
|
215
207
|
}
|
|
216
|
-
class
|
|
208
|
+
class ye extends X {
|
|
217
209
|
constructor(e) {
|
|
218
210
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
219
211
|
ns: ["translation"],
|
|
@@ -229,21 +221,21 @@ class me extends ee {
|
|
|
229
221
|
t > -1 && this.options.ns.splice(t, 1);
|
|
230
222
|
}
|
|
231
223
|
getResource(e, t, s) {
|
|
232
|
-
var u,
|
|
224
|
+
var u, h;
|
|
233
225
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
234
|
-
const r = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator,
|
|
226
|
+
const r = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
235
227
|
let o;
|
|
236
228
|
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) : d(s) && r ? o.push(...s.split(r)) : o.push(s)));
|
|
237
|
-
const l =
|
|
238
|
-
return !l && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), l || !
|
|
229
|
+
const l = Y(this.data, o);
|
|
230
|
+
return !l && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), l || !a || !d(s) ? l : ae((h = (u = this.data) == null ? void 0 : u[e]) == null ? void 0 : h[t], s, r);
|
|
239
231
|
}
|
|
240
232
|
addResource(e, t, s, i) {
|
|
241
233
|
let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
242
234
|
silent: !1
|
|
243
235
|
};
|
|
244
|
-
const
|
|
236
|
+
const a = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
|
|
245
237
|
let o = [e, t];
|
|
246
|
-
s && (o = o.concat(
|
|
238
|
+
s && (o = o.concat(a ? s.split(a) : s)), e.indexOf(".") > -1 && (o = e.split("."), i = t, t = o[1]), this.addNamespaces(t), xe(this.data, o, i), r.silent || this.emit("added", e, t, s, i);
|
|
247
239
|
}
|
|
248
240
|
addResources(e, t, s) {
|
|
249
241
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
@@ -256,16 +248,16 @@ class me extends ee {
|
|
|
256
248
|
i.silent || this.emit("added", e, t, s);
|
|
257
249
|
}
|
|
258
250
|
addResourceBundle(e, t, s, i, r) {
|
|
259
|
-
let
|
|
251
|
+
let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
|
|
260
252
|
silent: !1,
|
|
261
253
|
skipCopy: !1
|
|
262
254
|
}, o = [e, t];
|
|
263
255
|
e.indexOf(".") > -1 && (o = e.split("."), i = s, s = t, t = o[1]), this.addNamespaces(t);
|
|
264
|
-
let l =
|
|
265
|
-
|
|
256
|
+
let l = Y(this.data, o) || {};
|
|
257
|
+
a.skipCopy || (s = JSON.parse(JSON.stringify(s))), i ? Ne(l, s, r) : l = {
|
|
266
258
|
...l,
|
|
267
259
|
...s
|
|
268
|
-
},
|
|
260
|
+
}, xe(this.data, o, l), a.silent || this.emit("added", e, t, s);
|
|
269
261
|
}
|
|
270
262
|
removeResourceBundle(e, t) {
|
|
271
263
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -287,23 +279,23 @@ class me extends ee {
|
|
|
287
279
|
return this.data;
|
|
288
280
|
}
|
|
289
281
|
}
|
|
290
|
-
var
|
|
282
|
+
var Ve = {
|
|
291
283
|
processors: {},
|
|
292
|
-
addPostProcessor(
|
|
293
|
-
this.processors[
|
|
284
|
+
addPostProcessor(n) {
|
|
285
|
+
this.processors[n.name] = n;
|
|
294
286
|
},
|
|
295
|
-
handle(
|
|
296
|
-
return
|
|
297
|
-
var
|
|
298
|
-
e = ((
|
|
287
|
+
handle(n, e, t, s, i) {
|
|
288
|
+
return n.forEach((r) => {
|
|
289
|
+
var a;
|
|
290
|
+
e = ((a = this.processors[r]) == null ? void 0 : a.process(e, t, s, i)) ?? e;
|
|
299
291
|
}), e;
|
|
300
292
|
}
|
|
301
293
|
};
|
|
302
|
-
const
|
|
303
|
-
class q extends
|
|
294
|
+
const be = {};
|
|
295
|
+
class q extends X {
|
|
304
296
|
constructor(e) {
|
|
305
297
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
306
|
-
super(),
|
|
298
|
+
super(), Me(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
|
|
307
299
|
}
|
|
308
300
|
changeLanguage(e) {
|
|
309
301
|
e && (this.language = e);
|
|
@@ -322,8 +314,8 @@ class q extends ee {
|
|
|
322
314
|
s === void 0 && (s = ":");
|
|
323
315
|
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
324
316
|
let r = t.ns || this.options.defaultNS || [];
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
317
|
+
const a = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ye(e, s, i);
|
|
318
|
+
if (a && !o) {
|
|
327
319
|
const l = e.match(this.interpolator.nestingRegexp);
|
|
328
320
|
if (l && l.length > 0)
|
|
329
321
|
return {
|
|
@@ -344,97 +336,97 @@ class q extends ee {
|
|
|
344
336
|
}), t || (t = {}), e == null) return "";
|
|
345
337
|
Array.isArray(e) || (e = [String(e)]);
|
|
346
338
|
const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, r = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
347
|
-
key:
|
|
339
|
+
key: a,
|
|
348
340
|
namespaces: o
|
|
349
|
-
} = this.extractFromKey(e[e.length - 1], t), l = o[o.length - 1], u = t.lng || this.language,
|
|
341
|
+
} = this.extractFromKey(e[e.length - 1], t), l = o[o.length - 1], u = t.lng || this.language, h = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
350
342
|
if ((u == null ? void 0 : u.toLowerCase()) === "cimode") {
|
|
351
|
-
if (
|
|
352
|
-
const
|
|
343
|
+
if (h) {
|
|
344
|
+
const x = t.nsSeparator || this.options.nsSeparator;
|
|
353
345
|
return i ? {
|
|
354
|
-
res: `${l}${
|
|
355
|
-
usedKey:
|
|
356
|
-
exactUsedKey:
|
|
346
|
+
res: `${l}${x}${a}`,
|
|
347
|
+
usedKey: a,
|
|
348
|
+
exactUsedKey: a,
|
|
357
349
|
usedLng: u,
|
|
358
350
|
usedNS: l,
|
|
359
351
|
usedParams: this.getUsedParamsDetails(t)
|
|
360
|
-
} : `${l}${
|
|
352
|
+
} : `${l}${x}${a}`;
|
|
361
353
|
}
|
|
362
354
|
return i ? {
|
|
363
|
-
res:
|
|
364
|
-
usedKey:
|
|
365
|
-
exactUsedKey:
|
|
355
|
+
res: a,
|
|
356
|
+
usedKey: a,
|
|
357
|
+
exactUsedKey: a,
|
|
366
358
|
usedLng: u,
|
|
367
359
|
usedNS: l,
|
|
368
360
|
usedParams: this.getUsedParamsDetails(t)
|
|
369
|
-
} :
|
|
361
|
+
} : a;
|
|
370
362
|
}
|
|
371
|
-
const
|
|
372
|
-
let c =
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
363
|
+
const f = this.resolve(e, t);
|
|
364
|
+
let c = f == null ? void 0 : f.res;
|
|
365
|
+
const p = (f == null ? void 0 : f.usedKey) || a, g = (f == null ? void 0 : f.exactUsedKey) || a, m = Object.prototype.toString.apply(c), v = ["[object Number]", "[object Function]", "[object RegExp]"], w = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, C = !this.i18nFormat || this.i18nFormat.handleAsObject, E = !d(c) && typeof c != "boolean" && typeof c != "number";
|
|
366
|
+
if (C && c && E && v.indexOf(m) < 0 && !(d(w) && Array.isArray(c))) {
|
|
375
367
|
if (!t.returnObjects && !this.options.returnObjects) {
|
|
376
368
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
377
|
-
const
|
|
369
|
+
const x = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, c, {
|
|
378
370
|
...t,
|
|
379
371
|
ns: o
|
|
380
|
-
}) : `key '${
|
|
381
|
-
return i ? (
|
|
372
|
+
}) : `key '${a} (${this.language})' returned an object instead of string.`;
|
|
373
|
+
return i ? (f.res = x, f.usedParams = this.getUsedParamsDetails(t), f) : x;
|
|
382
374
|
}
|
|
383
375
|
if (r) {
|
|
384
|
-
const
|
|
385
|
-
for (const
|
|
386
|
-
if (Object.prototype.hasOwnProperty.call(c,
|
|
387
|
-
const N = `${
|
|
388
|
-
|
|
376
|
+
const x = Array.isArray(c), L = x ? [] : {}, R = x ? g : p;
|
|
377
|
+
for (const y in c)
|
|
378
|
+
if (Object.prototype.hasOwnProperty.call(c, y)) {
|
|
379
|
+
const N = `${R}${r}${y}`;
|
|
380
|
+
L[y] = this.translate(N, {
|
|
389
381
|
...t,
|
|
390
382
|
joinArrays: !1,
|
|
391
383
|
ns: o
|
|
392
|
-
}),
|
|
384
|
+
}), L[y] === N && (L[y] = c[y]);
|
|
393
385
|
}
|
|
394
|
-
c =
|
|
386
|
+
c = L;
|
|
395
387
|
}
|
|
396
|
-
} else if (
|
|
397
|
-
c = c.join(
|
|
388
|
+
} else if (C && d(w) && Array.isArray(c))
|
|
389
|
+
c = c.join(w), c && (c = this.extendTranslation(c, e, t, s));
|
|
398
390
|
else {
|
|
399
|
-
let
|
|
400
|
-
const
|
|
391
|
+
let x = !1, L = !1;
|
|
392
|
+
const R = t.count !== void 0 && !d(t.count), y = q.hasDefaultValue(t), N = R ? this.pluralResolver.getSuffix(u, t.count, t) : "", I = t.ordinal && R ? this.pluralResolver.getSuffix(u, t.count, {
|
|
401
393
|
ordinal: !1
|
|
402
|
-
}) : "",
|
|
403
|
-
!this.isValidLookup(c) &&
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
if (this.logger.log(K ? "updateKey" : "missingKey", u, l,
|
|
407
|
-
const
|
|
394
|
+
}) : "", V = R && !t.ordinal && t.count === 0, T = V && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${N}`] || t[`defaultValue${I}`] || t.defaultValue;
|
|
395
|
+
!this.isValidLookup(c) && y && (x = !0, c = T), this.isValidLookup(c) || (L = !0, c = a);
|
|
396
|
+
const je = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && L ? void 0 : c, K = y && T !== c && this.options.updateMissing;
|
|
397
|
+
if (L || x || K) {
|
|
398
|
+
if (this.logger.log(K ? "updateKey" : "missingKey", u, l, a, K ? T : c), r) {
|
|
399
|
+
const $ = this.resolve(a, {
|
|
408
400
|
...t,
|
|
409
401
|
keySeparator: !1
|
|
410
402
|
});
|
|
411
|
-
|
|
403
|
+
$ && $.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
412
404
|
}
|
|
413
|
-
let
|
|
414
|
-
const
|
|
415
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
416
|
-
for (let
|
|
417
|
-
|
|
418
|
-
else this.options.saveMissingTo === "all" ?
|
|
419
|
-
const
|
|
420
|
-
var
|
|
421
|
-
const
|
|
422
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
405
|
+
let M = [];
|
|
406
|
+
const J = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
407
|
+
if (this.options.saveMissingTo === "fallback" && J && J[0])
|
|
408
|
+
for (let $ = 0; $ < J.length; $++)
|
|
409
|
+
M.push(J[$]);
|
|
410
|
+
else this.options.saveMissingTo === "all" ? M = this.languageUtils.toResolveHierarchy(t.lng || this.language) : M.push(t.lng || this.language);
|
|
411
|
+
const ue = ($, j, U) => {
|
|
412
|
+
var he;
|
|
413
|
+
const ce = y && U !== c ? U : je;
|
|
414
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler($, l, j, ce, K, t) : (he = this.backendConnector) != null && he.saveMissing && this.backendConnector.saveMissing($, l, j, ce, K, t), this.emit("missingKey", $, l, j, c);
|
|
423
415
|
};
|
|
424
|
-
this.options.saveMissing && (this.options.saveMissingPlurals &&
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
416
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && R ? M.forEach(($) => {
|
|
417
|
+
const j = this.pluralResolver.getSuffixes($, t);
|
|
418
|
+
V && t[`defaultValue${this.options.pluralSeparator}zero`] && j.indexOf(`${this.options.pluralSeparator}zero`) < 0 && j.push(`${this.options.pluralSeparator}zero`), j.forEach((U) => {
|
|
419
|
+
ue([$], a + U, t[`defaultValue${U}`] || T);
|
|
428
420
|
});
|
|
429
|
-
}) :
|
|
421
|
+
}) : ue(M, a, T));
|
|
430
422
|
}
|
|
431
|
-
c = this.extendTranslation(c, e, t,
|
|
423
|
+
c = this.extendTranslation(c, e, t, f, s), L && c === a && this.options.appendNamespaceToMissingKey && (c = `${l}:${a}`), (L || x) && this.options.parseMissingKeyHandler && (c = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}:${a}` : a, x ? c : void 0));
|
|
432
424
|
}
|
|
433
|
-
return i ? (
|
|
425
|
+
return i ? (f.res = c, f.usedParams = this.getUsedParamsDetails(t), f) : c;
|
|
434
426
|
}
|
|
435
427
|
extendTranslation(e, t, s, i, r) {
|
|
436
|
-
var u,
|
|
437
|
-
var
|
|
428
|
+
var u, h;
|
|
429
|
+
var a = this;
|
|
438
430
|
if ((u = this.i18nFormat) != null && u.parse)
|
|
439
431
|
e = this.i18nFormat.parse(e, {
|
|
440
432
|
...this.options.interpolation.defaultVariables,
|
|
@@ -450,28 +442,28 @@ class q extends ee {
|
|
|
450
442
|
...s.interpolation
|
|
451
443
|
}
|
|
452
444
|
});
|
|
453
|
-
const
|
|
445
|
+
const f = d(e) && (((h = s == null ? void 0 : s.interpolation) == null ? void 0 : h.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
454
446
|
let c;
|
|
455
|
-
if (
|
|
447
|
+
if (f) {
|
|
456
448
|
const g = e.match(this.interpolator.nestingRegexp);
|
|
457
449
|
c = g && g.length;
|
|
458
450
|
}
|
|
459
|
-
let
|
|
460
|
-
if (this.options.interpolation.defaultVariables && (
|
|
451
|
+
let p = s.replace && !d(s.replace) ? s.replace : s;
|
|
452
|
+
if (this.options.interpolation.defaultVariables && (p = {
|
|
461
453
|
...this.options.interpolation.defaultVariables,
|
|
462
|
-
...
|
|
463
|
-
}), e = this.interpolator.interpolate(e,
|
|
464
|
-
const g = e.match(this.interpolator.nestingRegexp),
|
|
465
|
-
c <
|
|
454
|
+
...p
|
|
455
|
+
}), e = this.interpolator.interpolate(e, p, s.lng || this.language || i.usedLng, s), f) {
|
|
456
|
+
const g = e.match(this.interpolator.nestingRegexp), m = g && g.length;
|
|
457
|
+
c < m && (s.nest = !1);
|
|
466
458
|
}
|
|
467
459
|
!s.lng && i && i.res && (s.lng = this.language || i.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
468
|
-
for (var g = arguments.length,
|
|
469
|
-
|
|
470
|
-
return (r == null ? void 0 : r[0]) ===
|
|
460
|
+
for (var g = arguments.length, m = new Array(g), v = 0; v < g; v++)
|
|
461
|
+
m[v] = arguments[v];
|
|
462
|
+
return (r == null ? void 0 : r[0]) === m[0] && !s.context ? (a.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`), null) : a.translate(...m, t);
|
|
471
463
|
}, s)), s.interpolation && this.interpolator.reset();
|
|
472
464
|
}
|
|
473
465
|
const o = s.postProcess || this.options.postProcess, l = d(o) ? [o] : o;
|
|
474
|
-
return e != null && (l != null && l.length) && s.applyPostProcessor !== !1 && (e =
|
|
466
|
+
return e != null && (l != null && l.length) && s.applyPostProcessor !== !1 && (e = Ve.handle(l, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
475
467
|
i18nResolved: {
|
|
476
468
|
...i,
|
|
477
469
|
usedParams: this.getUsedParamsDetails(s)
|
|
@@ -480,42 +472,42 @@ class q extends ee {
|
|
|
480
472
|
} : s, this)), e;
|
|
481
473
|
}
|
|
482
474
|
resolve(e) {
|
|
483
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, i, r,
|
|
475
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, i, r, a, o;
|
|
484
476
|
return d(e) && (e = [e]), e.forEach((l) => {
|
|
485
477
|
if (this.isValidLookup(s)) return;
|
|
486
|
-
const u = this.extractFromKey(l, t),
|
|
487
|
-
i =
|
|
488
|
-
let
|
|
489
|
-
this.options.fallbackNS && (
|
|
490
|
-
const c = t.count !== void 0 && !d(t.count),
|
|
491
|
-
|
|
492
|
-
var
|
|
493
|
-
this.isValidLookup(s) || (o = v, !
|
|
494
|
-
var
|
|
478
|
+
const u = this.extractFromKey(l, t), h = u.key;
|
|
479
|
+
i = h;
|
|
480
|
+
let f = u.namespaces;
|
|
481
|
+
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
482
|
+
const c = t.count !== void 0 && !d(t.count), p = c && !t.ordinal && t.count === 0, g = t.context !== void 0 && (d(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
483
|
+
f.forEach((v) => {
|
|
484
|
+
var w, C;
|
|
485
|
+
this.isValidLookup(s) || (o = v, !be[`${m[0]}-${v}`] && ((w = this.utils) != null && w.hasLoadedNamespace) && !((C = this.utils) != null && C.hasLoadedNamespace(o)) && (be[`${m[0]}-${v}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), m.forEach((E) => {
|
|
486
|
+
var R;
|
|
495
487
|
if (this.isValidLookup(s)) return;
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
if ((
|
|
499
|
-
this.i18nFormat.addLookupKeys(
|
|
488
|
+
a = E;
|
|
489
|
+
const x = [h];
|
|
490
|
+
if ((R = this.i18nFormat) != null && R.addLookupKeys)
|
|
491
|
+
this.i18nFormat.addLookupKeys(x, h, E, v, t);
|
|
500
492
|
else {
|
|
501
|
-
let
|
|
502
|
-
c && (
|
|
503
|
-
const N = `${this.options.pluralSeparator}zero`,
|
|
504
|
-
if (c && (
|
|
505
|
-
const
|
|
506
|
-
|
|
493
|
+
let y;
|
|
494
|
+
c && (y = this.pluralResolver.getSuffix(E, t.count, t));
|
|
495
|
+
const N = `${this.options.pluralSeparator}zero`, I = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
496
|
+
if (c && (x.push(h + y), t.ordinal && y.indexOf(I) === 0 && x.push(h + y.replace(I, this.options.pluralSeparator)), p && x.push(h + N)), g) {
|
|
497
|
+
const V = `${h}${this.options.contextSeparator}${t.context}`;
|
|
498
|
+
x.push(V), c && (x.push(V + y), t.ordinal && y.indexOf(I) === 0 && x.push(V + y.replace(I, this.options.pluralSeparator)), p && x.push(V + N));
|
|
507
499
|
}
|
|
508
500
|
}
|
|
509
|
-
let
|
|
510
|
-
for (;
|
|
511
|
-
this.isValidLookup(s) || (r =
|
|
501
|
+
let L;
|
|
502
|
+
for (; L = x.pop(); )
|
|
503
|
+
this.isValidLookup(s) || (r = L, s = this.getResource(E, v, L, t));
|
|
512
504
|
}));
|
|
513
505
|
});
|
|
514
506
|
}), {
|
|
515
507
|
res: s,
|
|
516
508
|
usedKey: i,
|
|
517
509
|
exactUsedKey: r,
|
|
518
|
-
usedLng:
|
|
510
|
+
usedLng: a,
|
|
519
511
|
usedNS: o
|
|
520
512
|
};
|
|
521
513
|
}
|
|
@@ -551,7 +543,7 @@ class q extends ee {
|
|
|
551
543
|
return !1;
|
|
552
544
|
}
|
|
553
545
|
}
|
|
554
|
-
class
|
|
546
|
+
class Se {
|
|
555
547
|
constructor(e) {
|
|
556
548
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
|
|
557
549
|
}
|
|
@@ -605,28 +597,28 @@ class ye {
|
|
|
605
597
|
return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
|
|
606
598
|
}
|
|
607
599
|
toResolveHierarchy(e, t) {
|
|
608
|
-
const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], r = (
|
|
609
|
-
|
|
600
|
+
const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], r = (a) => {
|
|
601
|
+
a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
|
|
610
602
|
};
|
|
611
|
-
return d(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && r(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && r(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && r(this.getLanguagePartFromCode(e))) : d(e) && r(this.formatLanguageCode(e)), s.forEach((
|
|
612
|
-
i.indexOf(
|
|
603
|
+
return d(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && r(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && r(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && r(this.getLanguagePartFromCode(e))) : d(e) && r(this.formatLanguageCode(e)), s.forEach((a) => {
|
|
604
|
+
i.indexOf(a) < 0 && r(this.formatLanguageCode(a));
|
|
613
605
|
}), i;
|
|
614
606
|
}
|
|
615
607
|
}
|
|
616
|
-
const
|
|
608
|
+
const Oe = {
|
|
617
609
|
zero: 0,
|
|
618
610
|
one: 1,
|
|
619
611
|
two: 2,
|
|
620
612
|
few: 3,
|
|
621
613
|
many: 4,
|
|
622
614
|
other: 5
|
|
623
|
-
},
|
|
624
|
-
select: (
|
|
615
|
+
}, Le = {
|
|
616
|
+
select: (n) => n === 1 ? "one" : "other",
|
|
625
617
|
resolvedOptions: () => ({
|
|
626
618
|
pluralCategories: ["one", "other"]
|
|
627
619
|
})
|
|
628
620
|
};
|
|
629
|
-
class
|
|
621
|
+
class Ge {
|
|
630
622
|
constructor(e) {
|
|
631
623
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
632
624
|
this.languageUtils = e, this.options = t, this.logger = P.create("pluralResolver"), this.pluralRulesCache = {};
|
|
@@ -645,19 +637,19 @@ class We {
|
|
|
645
637
|
});
|
|
646
638
|
if (r in this.pluralRulesCache)
|
|
647
639
|
return this.pluralRulesCache[r];
|
|
648
|
-
let
|
|
640
|
+
let a;
|
|
649
641
|
try {
|
|
650
|
-
|
|
642
|
+
a = new Intl.PluralRules(s, {
|
|
651
643
|
type: i
|
|
652
644
|
});
|
|
653
645
|
} catch {
|
|
654
646
|
if (!Intl)
|
|
655
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
656
|
-
if (!e.match(/-|_/)) return
|
|
647
|
+
return this.logger.error("No Intl support, please use an Intl polyfill!"), Le;
|
|
648
|
+
if (!e.match(/-|_/)) return Le;
|
|
657
649
|
const l = this.languageUtils.getLanguagePartFromCode(e);
|
|
658
|
-
|
|
650
|
+
a = this.getRule(l, t);
|
|
659
651
|
}
|
|
660
|
-
return this.pluralRulesCache[r] =
|
|
652
|
+
return this.pluralRulesCache[r] = a, a;
|
|
661
653
|
}
|
|
662
654
|
needsPlural(e) {
|
|
663
655
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = this.getRule(e, t);
|
|
@@ -669,7 +661,7 @@ class We {
|
|
|
669
661
|
}
|
|
670
662
|
getSuffixes(e) {
|
|
671
663
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = this.getRule(e, t);
|
|
672
|
-
return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((i, r) =>
|
|
664
|
+
return s || (s = this.getRule("dev", t)), s ? s.resolvedOptions().pluralCategories.sort((i, r) => Oe[i] - Oe[r]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
|
|
673
665
|
}
|
|
674
666
|
getSuffix(e, t) {
|
|
675
667
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -677,11 +669,11 @@ class We {
|
|
|
677
669
|
return i ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, s));
|
|
678
670
|
}
|
|
679
671
|
}
|
|
680
|
-
const
|
|
681
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r =
|
|
682
|
-
return !r && i && d(t) && (r =
|
|
683
|
-
},
|
|
684
|
-
class
|
|
672
|
+
const we = function(n, e, t) {
|
|
673
|
+
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = Be(n, e, t);
|
|
674
|
+
return !r && i && d(t) && (r = ae(n, t, s), r === void 0 && (r = ae(e, t, s))), r;
|
|
675
|
+
}, ee = (n) => n.replace(/\$/g, "$$$$");
|
|
676
|
+
class qe {
|
|
685
677
|
constructor() {
|
|
686
678
|
var t;
|
|
687
679
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -697,21 +689,21 @@ class Ge {
|
|
|
697
689
|
escapeValue: s,
|
|
698
690
|
useRawValueToEscape: i,
|
|
699
691
|
prefix: r,
|
|
700
|
-
prefixEscaped:
|
|
692
|
+
prefixEscaped: a,
|
|
701
693
|
suffix: o,
|
|
702
694
|
suffixEscaped: l,
|
|
703
695
|
formatSeparator: u,
|
|
704
|
-
unescapeSuffix:
|
|
705
|
-
unescapePrefix:
|
|
696
|
+
unescapeSuffix: h,
|
|
697
|
+
unescapePrefix: f,
|
|
706
698
|
nestingPrefix: c,
|
|
707
|
-
nestingPrefixEscaped:
|
|
699
|
+
nestingPrefixEscaped: p,
|
|
708
700
|
nestingSuffix: g,
|
|
709
|
-
nestingSuffixEscaped:
|
|
701
|
+
nestingSuffixEscaped: m,
|
|
710
702
|
nestingOptionsSeparator: v,
|
|
711
|
-
maxReplaces:
|
|
712
|
-
alwaysFormat:
|
|
703
|
+
maxReplaces: w,
|
|
704
|
+
alwaysFormat: C
|
|
713
705
|
} = e.interpolation;
|
|
714
|
-
this.escape = t !== void 0 ? t :
|
|
706
|
+
this.escape = t !== void 0 ? t : Je, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = r ? F(r) : a || "{{", this.suffix = o ? F(o) : l || "}}", this.formatSeparator = u || ",", this.unescapePrefix = h ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : h || "", this.nestingPrefix = c ? F(c) : p || F("$t("), this.nestingSuffix = g ? F(g) : m || F(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = w || 1e3, this.alwaysFormat = C !== void 0 ? C : !1, this.resetRegExp();
|
|
715
707
|
}
|
|
716
708
|
reset() {
|
|
717
709
|
this.options && this.init(this.options);
|
|
@@ -721,85 +713,85 @@ class Ge {
|
|
|
721
713
|
this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
|
|
722
714
|
}
|
|
723
715
|
interpolate(e, t, s, i) {
|
|
724
|
-
var
|
|
725
|
-
let r,
|
|
716
|
+
var p;
|
|
717
|
+
let r, a, o;
|
|
726
718
|
const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (g) => {
|
|
727
719
|
if (g.indexOf(this.formatSeparator) < 0) {
|
|
728
|
-
const
|
|
729
|
-
return this.alwaysFormat ? this.format(
|
|
720
|
+
const C = we(t, l, g, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
721
|
+
return this.alwaysFormat ? this.format(C, void 0, s, {
|
|
730
722
|
...i,
|
|
731
723
|
...t,
|
|
732
724
|
interpolationkey: g
|
|
733
|
-
}) :
|
|
725
|
+
}) : C;
|
|
734
726
|
}
|
|
735
|
-
const
|
|
736
|
-
return this.format(
|
|
727
|
+
const m = g.split(this.formatSeparator), v = m.shift().trim(), w = m.join(this.formatSeparator).trim();
|
|
728
|
+
return this.format(we(t, l, v, this.options.keySeparator, this.options.ignoreJSONStructure), w, s, {
|
|
737
729
|
...i,
|
|
738
730
|
...t,
|
|
739
731
|
interpolationkey: v
|
|
740
732
|
});
|
|
741
733
|
};
|
|
742
734
|
this.resetRegExp();
|
|
743
|
-
const
|
|
735
|
+
const h = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, f = ((p = i == null ? void 0 : i.interpolation) == null ? void 0 : p.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
744
736
|
return [{
|
|
745
737
|
regex: this.regexpUnescape,
|
|
746
|
-
safeValue: (g) =>
|
|
738
|
+
safeValue: (g) => ee(g)
|
|
747
739
|
}, {
|
|
748
740
|
regex: this.regexp,
|
|
749
|
-
safeValue: (g) => this.escapeValue ?
|
|
741
|
+
safeValue: (g) => this.escapeValue ? ee(this.escape(g)) : ee(g)
|
|
750
742
|
}].forEach((g) => {
|
|
751
743
|
for (o = 0; r = g.regex.exec(e); ) {
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
754
|
-
if (typeof
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
} else if (i && Object.prototype.hasOwnProperty.call(i,
|
|
758
|
-
|
|
759
|
-
else if (
|
|
760
|
-
|
|
744
|
+
const m = r[1].trim();
|
|
745
|
+
if (a = u(m), a === void 0)
|
|
746
|
+
if (typeof h == "function") {
|
|
747
|
+
const w = h(e, r, i);
|
|
748
|
+
a = d(w) ? w : "";
|
|
749
|
+
} else if (i && Object.prototype.hasOwnProperty.call(i, m))
|
|
750
|
+
a = "";
|
|
751
|
+
else if (f) {
|
|
752
|
+
a = r[0];
|
|
761
753
|
continue;
|
|
762
754
|
} else
|
|
763
|
-
this.logger.warn(`missed to pass in variable ${
|
|
764
|
-
else !d(
|
|
765
|
-
const v = g.safeValue(
|
|
766
|
-
if (e = e.replace(r[0], v),
|
|
755
|
+
this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`), a = "";
|
|
756
|
+
else !d(a) && !this.useRawValueToEscape && (a = pe(a));
|
|
757
|
+
const v = g.safeValue(a);
|
|
758
|
+
if (e = e.replace(r[0], v), f ? (g.regex.lastIndex += a.length, g.regex.lastIndex -= r[0].length) : g.regex.lastIndex = 0, o++, o >= this.maxReplaces)
|
|
767
759
|
break;
|
|
768
760
|
}
|
|
769
761
|
}), e;
|
|
770
762
|
}
|
|
771
763
|
nest(e, t) {
|
|
772
|
-
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, r,
|
|
764
|
+
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, r, a;
|
|
773
765
|
const o = (l, u) => {
|
|
774
|
-
const
|
|
775
|
-
if (l.indexOf(
|
|
776
|
-
const
|
|
777
|
-
let c = `{${
|
|
778
|
-
l =
|
|
779
|
-
const
|
|
780
|
-
(((
|
|
766
|
+
const h = this.nestingOptionsSeparator;
|
|
767
|
+
if (l.indexOf(h) < 0) return l;
|
|
768
|
+
const f = l.split(new RegExp(`${h}[ ]*{`));
|
|
769
|
+
let c = `{${f[1]}`;
|
|
770
|
+
l = f[0], c = this.interpolate(c, a);
|
|
771
|
+
const p = c.match(/'/g), g = c.match(/"/g);
|
|
772
|
+
(((p == null ? void 0 : p.length) ?? 0) % 2 === 0 && !g || g.length % 2 !== 0) && (c = c.replace(/'/g, '"'));
|
|
781
773
|
try {
|
|
782
|
-
|
|
774
|
+
a = JSON.parse(c), u && (a = {
|
|
783
775
|
...u,
|
|
784
|
-
...
|
|
776
|
+
...a
|
|
785
777
|
});
|
|
786
|
-
} catch (
|
|
787
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${l}`,
|
|
778
|
+
} catch (m) {
|
|
779
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${l}`, m), `${l}${h}${c}`;
|
|
788
780
|
}
|
|
789
|
-
return
|
|
781
|
+
return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, l;
|
|
790
782
|
};
|
|
791
783
|
for (; i = this.nestingRegexp.exec(e); ) {
|
|
792
784
|
let l = [];
|
|
793
|
-
|
|
785
|
+
a = {
|
|
794
786
|
...s
|
|
795
|
-
},
|
|
787
|
+
}, a = a.replace && !d(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
796
788
|
let u = !1;
|
|
797
789
|
if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
|
|
798
|
-
const
|
|
799
|
-
i[1] =
|
|
790
|
+
const h = i[1].split(this.formatSeparator).map((f) => f.trim());
|
|
791
|
+
i[1] = h.shift(), l = h, u = !0;
|
|
800
792
|
}
|
|
801
|
-
if (r = t(o.call(this, i[1].trim(),
|
|
802
|
-
d(r) || (r =
|
|
793
|
+
if (r = t(o.call(this, i[1].trim(), a), a), r && i[0] === e && !d(r)) return r;
|
|
794
|
+
d(r) || (r = pe(r)), r || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), r = ""), u && (r = l.reduce((h, f) => this.format(h, f, s.lng, {
|
|
803
795
|
...s,
|
|
804
796
|
interpolationkey: i[1].trim()
|
|
805
797
|
}), r.trim())), e = e.replace(i[0], r), this.regexp.lastIndex = 0;
|
|
@@ -807,17 +799,17 @@ class Ge {
|
|
|
807
799
|
return e;
|
|
808
800
|
}
|
|
809
801
|
}
|
|
810
|
-
const
|
|
811
|
-
let e =
|
|
802
|
+
const Xe = (n) => {
|
|
803
|
+
let e = n.toLowerCase().trim();
|
|
812
804
|
const t = {};
|
|
813
|
-
if (
|
|
814
|
-
const s =
|
|
805
|
+
if (n.indexOf("(") > -1) {
|
|
806
|
+
const s = n.split("(");
|
|
815
807
|
e = s[0].toLowerCase().trim();
|
|
816
808
|
const i = s[1].substring(0, s[1].length - 1);
|
|
817
|
-
e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((
|
|
818
|
-
if (
|
|
819
|
-
const [o, ...l] =
|
|
820
|
-
t[
|
|
809
|
+
e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((a) => {
|
|
810
|
+
if (a) {
|
|
811
|
+
const [o, ...l] = a.split(":"), u = l.join(":").trim().replace(/^'+|'+$/g, ""), h = o.trim();
|
|
812
|
+
t[h] || (t[h] = u), u === "false" && (t[h] = !1), u === "true" && (t[h] = !0), isNaN(u) || (t[h] = parseInt(u, 10));
|
|
821
813
|
}
|
|
822
814
|
});
|
|
823
815
|
}
|
|
@@ -825,7 +817,7 @@ const Ze = (a) => {
|
|
|
825
817
|
formatName: e,
|
|
826
818
|
formatOptions: t
|
|
827
819
|
};
|
|
828
|
-
}, A = (
|
|
820
|
+
}, A = (n) => {
|
|
829
821
|
const e = {};
|
|
830
822
|
return (t, s, i) => {
|
|
831
823
|
let r = i;
|
|
@@ -833,12 +825,12 @@ const Ze = (a) => {
|
|
|
833
825
|
...r,
|
|
834
826
|
[i.interpolationkey]: void 0
|
|
835
827
|
});
|
|
836
|
-
const
|
|
837
|
-
let o = e[
|
|
838
|
-
return o || (o =
|
|
828
|
+
const a = s + JSON.stringify(r);
|
|
829
|
+
let o = e[a];
|
|
830
|
+
return o || (o = n(Q(s), i), e[a] = o), o(t);
|
|
839
831
|
};
|
|
840
832
|
};
|
|
841
|
-
class
|
|
833
|
+
class et {
|
|
842
834
|
constructor() {
|
|
843
835
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
844
836
|
this.logger = P.create("formatter"), this.options = e, this.formats = {
|
|
@@ -895,22 +887,22 @@ class Qe {
|
|
|
895
887
|
r[0] = [r[0], ...r.splice(1, o)].join(this.formatSeparator);
|
|
896
888
|
}
|
|
897
889
|
return r.reduce((o, l) => {
|
|
898
|
-
var
|
|
890
|
+
var f;
|
|
899
891
|
const {
|
|
900
892
|
formatName: u,
|
|
901
|
-
formatOptions:
|
|
902
|
-
} =
|
|
893
|
+
formatOptions: h
|
|
894
|
+
} = Xe(l);
|
|
903
895
|
if (this.formats[u]) {
|
|
904
896
|
let c = o;
|
|
905
897
|
try {
|
|
906
|
-
const
|
|
898
|
+
const p = ((f = i == null ? void 0 : i.formatParams) == null ? void 0 : f[i.interpolationkey]) || {}, g = p.locale || p.lng || i.locale || i.lng || s;
|
|
907
899
|
c = this.formats[u](o, g, {
|
|
908
|
-
...
|
|
900
|
+
...h,
|
|
909
901
|
...i,
|
|
910
|
-
...
|
|
902
|
+
...p
|
|
911
903
|
});
|
|
912
|
-
} catch (
|
|
913
|
-
this.logger.warn(
|
|
904
|
+
} catch (p) {
|
|
905
|
+
this.logger.warn(p);
|
|
914
906
|
}
|
|
915
907
|
return c;
|
|
916
908
|
} else
|
|
@@ -919,55 +911,55 @@ class Qe {
|
|
|
919
911
|
}, e);
|
|
920
912
|
}
|
|
921
913
|
}
|
|
922
|
-
const
|
|
923
|
-
|
|
914
|
+
const tt = (n, e) => {
|
|
915
|
+
n.pending[e] !== void 0 && (delete n.pending[e], n.pendingCount--);
|
|
924
916
|
};
|
|
925
|
-
class
|
|
917
|
+
class st extends X {
|
|
926
918
|
constructor(e, t, s) {
|
|
927
|
-
var r,
|
|
919
|
+
var r, a;
|
|
928
920
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
929
|
-
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = P.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (
|
|
921
|
+
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = P.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (a = (r = this.backend) == null ? void 0 : r.init) == null || a.call(r, s, i.backend, i);
|
|
930
922
|
}
|
|
931
923
|
queueLoad(e, t, s, i) {
|
|
932
|
-
const r = {},
|
|
924
|
+
const r = {}, a = {}, o = {}, l = {};
|
|
933
925
|
return e.forEach((u) => {
|
|
934
|
-
let
|
|
935
|
-
t.forEach((
|
|
936
|
-
const c = `${u}|${
|
|
937
|
-
!s.reload && this.store.hasResourceBundle(u,
|
|
938
|
-
}),
|
|
939
|
-
}), (Object.keys(r).length || Object.keys(
|
|
940
|
-
pending:
|
|
941
|
-
pendingCount: Object.keys(
|
|
926
|
+
let h = !0;
|
|
927
|
+
t.forEach((f) => {
|
|
928
|
+
const c = `${u}|${f}`;
|
|
929
|
+
!s.reload && this.store.hasResourceBundle(u, f) ? this.state[c] = 2 : this.state[c] < 0 || (this.state[c] === 1 ? a[c] === void 0 && (a[c] = !0) : (this.state[c] = 1, h = !1, a[c] === void 0 && (a[c] = !0), r[c] === void 0 && (r[c] = !0), l[f] === void 0 && (l[f] = !0)));
|
|
930
|
+
}), h || (o[u] = !0);
|
|
931
|
+
}), (Object.keys(r).length || Object.keys(a).length) && this.queue.push({
|
|
932
|
+
pending: a,
|
|
933
|
+
pendingCount: Object.keys(a).length,
|
|
942
934
|
loaded: {},
|
|
943
935
|
errors: [],
|
|
944
936
|
callback: i
|
|
945
937
|
}), {
|
|
946
938
|
toLoad: Object.keys(r),
|
|
947
|
-
pending: Object.keys(
|
|
939
|
+
pending: Object.keys(a),
|
|
948
940
|
toLoadLanguages: Object.keys(o),
|
|
949
941
|
toLoadNamespaces: Object.keys(l)
|
|
950
942
|
};
|
|
951
943
|
}
|
|
952
944
|
loaded(e, t, s) {
|
|
953
|
-
const i = e.split("|"), r = i[0],
|
|
954
|
-
t && this.emit("failedLoading", r,
|
|
945
|
+
const i = e.split("|"), r = i[0], a = i[1];
|
|
946
|
+
t && this.emit("failedLoading", r, a, t), !t && s && this.store.addResourceBundle(r, a, s, void 0, void 0, {
|
|
955
947
|
skipCopy: !0
|
|
956
948
|
}), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
|
|
957
949
|
const o = {};
|
|
958
950
|
this.queue.forEach((l) => {
|
|
959
|
-
|
|
951
|
+
He(l.loaded, [r], a), tt(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((u) => {
|
|
960
952
|
o[u] || (o[u] = {});
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
o[u][
|
|
953
|
+
const h = l.loaded[u];
|
|
954
|
+
h.length && h.forEach((f) => {
|
|
955
|
+
o[u][f] === void 0 && (o[u][f] = !0);
|
|
964
956
|
});
|
|
965
957
|
}), l.done = !0, l.errors.length ? l.callback(l.errors) : l.callback());
|
|
966
958
|
}), this.emit("loaded", o), this.queue = this.queue.filter((l) => !l.done);
|
|
967
959
|
}
|
|
968
960
|
read(e, t, s) {
|
|
969
|
-
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout,
|
|
970
|
-
if (!e.length) return
|
|
961
|
+
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
|
|
962
|
+
if (!e.length) return a(null, {});
|
|
971
963
|
if (this.readingCalls >= this.maxParallelReads) {
|
|
972
964
|
this.waitingReads.push({
|
|
973
965
|
lng: e,
|
|
@@ -975,28 +967,28 @@ class qe extends ee {
|
|
|
975
967
|
fcName: s,
|
|
976
968
|
tried: i,
|
|
977
969
|
wait: r,
|
|
978
|
-
callback:
|
|
970
|
+
callback: a
|
|
979
971
|
});
|
|
980
972
|
return;
|
|
981
973
|
}
|
|
982
974
|
this.readingCalls++;
|
|
983
|
-
const o = (u,
|
|
975
|
+
const o = (u, h) => {
|
|
984
976
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
985
|
-
const
|
|
986
|
-
this.read(
|
|
977
|
+
const f = this.waitingReads.shift();
|
|
978
|
+
this.read(f.lng, f.ns, f.fcName, f.tried, f.wait, f.callback);
|
|
987
979
|
}
|
|
988
|
-
if (u &&
|
|
980
|
+
if (u && h && i < this.maxRetries) {
|
|
989
981
|
setTimeout(() => {
|
|
990
|
-
this.read.call(this, e, t, s, i + 1, r * 2,
|
|
982
|
+
this.read.call(this, e, t, s, i + 1, r * 2, a);
|
|
991
983
|
}, r);
|
|
992
984
|
return;
|
|
993
985
|
}
|
|
994
|
-
|
|
986
|
+
a(u, h);
|
|
995
987
|
}, l = this.backend[s].bind(this.backend);
|
|
996
988
|
if (l.length === 2) {
|
|
997
989
|
try {
|
|
998
990
|
const u = l(e, t);
|
|
999
|
-
u && typeof u.then == "function" ? u.then((
|
|
991
|
+
u && typeof u.then == "function" ? u.then((h) => o(null, h)).catch(o) : o(null, u);
|
|
1000
992
|
} catch (u) {
|
|
1001
993
|
o(u);
|
|
1002
994
|
}
|
|
@@ -1012,8 +1004,8 @@ class qe extends ee {
|
|
|
1012
1004
|
const r = this.queueLoad(e, t, s, i);
|
|
1013
1005
|
if (!r.toLoad.length)
|
|
1014
1006
|
return r.pending.length || i(), null;
|
|
1015
|
-
r.toLoad.forEach((
|
|
1016
|
-
this.loadOne(
|
|
1007
|
+
r.toLoad.forEach((a) => {
|
|
1008
|
+
this.loadOne(a);
|
|
1017
1009
|
});
|
|
1018
1010
|
}
|
|
1019
1011
|
load(e, t, s) {
|
|
@@ -1027,39 +1019,39 @@ class qe extends ee {
|
|
|
1027
1019
|
loadOne(e) {
|
|
1028
1020
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1029
1021
|
const s = e.split("|"), i = s[0], r = s[1];
|
|
1030
|
-
this.read(i, r, "read", void 0, void 0, (
|
|
1031
|
-
|
|
1022
|
+
this.read(i, r, "read", void 0, void 0, (a, o) => {
|
|
1023
|
+
a && this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`, a), !a && o && this.logger.log(`${t}loaded namespace ${r} for language ${i}`, o), this.loaded(e, a, o);
|
|
1032
1024
|
});
|
|
1033
1025
|
}
|
|
1034
1026
|
saveMissing(e, t, s, i, r) {
|
|
1035
|
-
var l, u,
|
|
1036
|
-
let
|
|
1027
|
+
var l, u, h, f, c;
|
|
1028
|
+
let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
|
|
1037
1029
|
};
|
|
1038
|
-
if ((u = (l = this.services) == null ? void 0 : l.utils) != null && u.hasLoadedNamespace && !((
|
|
1030
|
+
if ((u = (l = this.services) == null ? void 0 : l.utils) != null && u.hasLoadedNamespace && !((f = (h = this.services) == null ? void 0 : h.utils) != null && f.hasLoadedNamespace(t))) {
|
|
1039
1031
|
this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
1040
1032
|
return;
|
|
1041
1033
|
}
|
|
1042
1034
|
if (!(s == null || s === "")) {
|
|
1043
1035
|
if ((c = this.backend) != null && c.create) {
|
|
1044
|
-
const
|
|
1045
|
-
...
|
|
1036
|
+
const p = {
|
|
1037
|
+
...a,
|
|
1046
1038
|
isUpdate: r
|
|
1047
1039
|
}, g = this.backend.create.bind(this.backend);
|
|
1048
1040
|
if (g.length < 6)
|
|
1049
1041
|
try {
|
|
1050
|
-
let
|
|
1051
|
-
g.length === 5 ?
|
|
1052
|
-
} catch (
|
|
1053
|
-
o(
|
|
1042
|
+
let m;
|
|
1043
|
+
g.length === 5 ? m = g(e, t, s, i, p) : m = g(e, t, s, i), m && typeof m.then == "function" ? m.then((v) => o(null, v)).catch(o) : o(null, m);
|
|
1044
|
+
} catch (m) {
|
|
1045
|
+
o(m);
|
|
1054
1046
|
}
|
|
1055
1047
|
else
|
|
1056
|
-
g(e, t, s, i, o,
|
|
1048
|
+
g(e, t, s, i, o, p);
|
|
1057
1049
|
}
|
|
1058
1050
|
!e || !e[0] || this.store.addResource(e[0], t, s, i);
|
|
1059
1051
|
}
|
|
1060
1052
|
}
|
|
1061
1053
|
}
|
|
1062
|
-
const
|
|
1054
|
+
const $e = () => ({
|
|
1063
1055
|
debug: !1,
|
|
1064
1056
|
initAsync: !0,
|
|
1065
1057
|
ns: ["translation"],
|
|
@@ -1092,10 +1084,10 @@ const Oe = () => ({
|
|
|
1092
1084
|
parseMissingKeyHandler: !1,
|
|
1093
1085
|
appendNamespaceToMissingKey: !1,
|
|
1094
1086
|
appendNamespaceToCIMode: !1,
|
|
1095
|
-
overloadTranslationOptionHandler: (
|
|
1087
|
+
overloadTranslationOptionHandler: (n) => {
|
|
1096
1088
|
let e = {};
|
|
1097
|
-
if (typeof
|
|
1098
|
-
const t =
|
|
1089
|
+
if (typeof n[1] == "object" && (e = n[1]), d(n[1]) && (e.defaultValue = n[1]), d(n[2]) && (e.tDescription = n[2]), typeof n[2] == "object" || typeof n[3] == "object") {
|
|
1090
|
+
const t = n[3] || n[2];
|
|
1099
1091
|
Object.keys(t).forEach((s) => {
|
|
1100
1092
|
e[s] = t[s];
|
|
1101
1093
|
});
|
|
@@ -1104,7 +1096,7 @@ const Oe = () => ({
|
|
|
1104
1096
|
},
|
|
1105
1097
|
interpolation: {
|
|
1106
1098
|
escapeValue: !0,
|
|
1107
|
-
format: (
|
|
1099
|
+
format: (n) => n,
|
|
1108
1100
|
prefix: "{{",
|
|
1109
1101
|
suffix: "}}",
|
|
1110
1102
|
formatSeparator: ",",
|
|
@@ -1115,21 +1107,21 @@ const Oe = () => ({
|
|
|
1115
1107
|
maxReplaces: 1e3,
|
|
1116
1108
|
skipOnVariables: !0
|
|
1117
1109
|
}
|
|
1118
|
-
}),
|
|
1110
|
+
}), Ce = (n) => {
|
|
1119
1111
|
var e, t;
|
|
1120
|
-
return d(
|
|
1121
|
-
},
|
|
1122
|
-
},
|
|
1123
|
-
Object.getOwnPropertyNames(Object.getPrototypeOf(
|
|
1124
|
-
typeof
|
|
1112
|
+
return d(n.ns) && (n.ns = [n.ns]), d(n.fallbackLng) && (n.fallbackLng = [n.fallbackLng]), d(n.fallbackNS) && (n.fallbackNS = [n.fallbackNS]), ((t = (e = n.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (n.supportedLngs = n.supportedLngs.concat(["cimode"])), typeof n.initImmediate == "boolean" && (n.initAsync = n.initImmediate), n;
|
|
1113
|
+
}, _ = () => {
|
|
1114
|
+
}, it = (n) => {
|
|
1115
|
+
Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t) => {
|
|
1116
|
+
typeof n[t] == "function" && (n[t] = n[t].bind(n));
|
|
1125
1117
|
});
|
|
1126
1118
|
};
|
|
1127
|
-
class
|
|
1119
|
+
class z extends X {
|
|
1128
1120
|
constructor() {
|
|
1129
1121
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1130
|
-
if (super(), this.options =
|
|
1122
|
+
if (super(), this.options = Ce(e), this.services = {}, this.logger = P, this.modules = {
|
|
1131
1123
|
external: []
|
|
1132
|
-
},
|
|
1124
|
+
}, it(this), t && !this.isInitialized && !e.isClone) {
|
|
1133
1125
|
if (!this.options.initAsync)
|
|
1134
1126
|
return this.init(e, t), this;
|
|
1135
1127
|
setTimeout(() => {
|
|
@@ -1141,90 +1133,90 @@ class J extends ee {
|
|
|
1141
1133
|
var e = this;
|
|
1142
1134
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
|
|
1143
1135
|
this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), t.defaultNS == null && t.ns && (d(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
1144
|
-
const i =
|
|
1136
|
+
const i = $e();
|
|
1145
1137
|
this.options = {
|
|
1146
1138
|
...i,
|
|
1147
1139
|
...this.options,
|
|
1148
|
-
...
|
|
1140
|
+
...Ce(t)
|
|
1149
1141
|
}, this.options.interpolation = {
|
|
1150
1142
|
...i.interpolation,
|
|
1151
1143
|
...this.options.interpolation
|
|
1152
1144
|
}, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
|
1153
|
-
const r = (
|
|
1145
|
+
const r = (h) => h ? typeof h == "function" ? new h() : h : null;
|
|
1154
1146
|
if (!this.options.isClone) {
|
|
1155
1147
|
this.modules.logger ? P.init(r(this.modules.logger), this.options) : P.init(null, this.options);
|
|
1156
|
-
let
|
|
1157
|
-
this.modules.formatter ?
|
|
1158
|
-
const
|
|
1159
|
-
this.store = new
|
|
1148
|
+
let h;
|
|
1149
|
+
this.modules.formatter ? h = this.modules.formatter : h = et;
|
|
1150
|
+
const f = new Se(this.options);
|
|
1151
|
+
this.store = new ye(this.options.resources, this.options);
|
|
1160
1152
|
const c = this.services;
|
|
1161
|
-
c.logger = P, c.resourceStore = this.store, c.languageUtils =
|
|
1153
|
+
c.logger = P, c.resourceStore = this.store, c.languageUtils = f, c.pluralResolver = new Ge(f, {
|
|
1162
1154
|
prepend: this.options.pluralSeparator,
|
|
1163
1155
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1164
|
-
}),
|
|
1156
|
+
}), h && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (c.formatter = r(h), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new qe(this.options), c.utils = {
|
|
1165
1157
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1166
|
-
}, c.backendConnector = new
|
|
1167
|
-
for (var g = arguments.length,
|
|
1168
|
-
|
|
1169
|
-
e.emit(
|
|
1170
|
-
}), this.modules.languageDetector && (c.languageDetector = r(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = r(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new q(this.services, this.options), this.translator.on("*", function(
|
|
1171
|
-
for (var g = arguments.length,
|
|
1172
|
-
|
|
1173
|
-
e.emit(
|
|
1174
|
-
}), this.modules.external.forEach((
|
|
1175
|
-
|
|
1158
|
+
}, c.backendConnector = new st(r(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", function(p) {
|
|
1159
|
+
for (var g = arguments.length, m = new Array(g > 1 ? g - 1 : 0), v = 1; v < g; v++)
|
|
1160
|
+
m[v - 1] = arguments[v];
|
|
1161
|
+
e.emit(p, ...m);
|
|
1162
|
+
}), this.modules.languageDetector && (c.languageDetector = r(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = r(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new q(this.services, this.options), this.translator.on("*", function(p) {
|
|
1163
|
+
for (var g = arguments.length, m = new Array(g > 1 ? g - 1 : 0), v = 1; v < g; v++)
|
|
1164
|
+
m[v - 1] = arguments[v];
|
|
1165
|
+
e.emit(p, ...m);
|
|
1166
|
+
}), this.modules.external.forEach((p) => {
|
|
1167
|
+
p.init && p.init(this);
|
|
1176
1168
|
});
|
|
1177
1169
|
}
|
|
1178
|
-
if (this.format = this.options.interpolation.format, s || (s =
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1170
|
+
if (this.format = this.options.interpolation.format, s || (s = _), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1171
|
+
const h = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1172
|
+
h.length > 0 && h[0] !== "dev" && (this.options.lng = h[0]);
|
|
1181
1173
|
}
|
|
1182
|
-
!this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((
|
|
1183
|
-
this[
|
|
1184
|
-
return e.store[
|
|
1174
|
+
!this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((h) => {
|
|
1175
|
+
this[h] = function() {
|
|
1176
|
+
return e.store[h](...arguments);
|
|
1185
1177
|
};
|
|
1186
|
-
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((
|
|
1187
|
-
this[
|
|
1188
|
-
return e.store[
|
|
1178
|
+
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((h) => {
|
|
1179
|
+
this[h] = function() {
|
|
1180
|
+
return e.store[h](...arguments), e;
|
|
1189
1181
|
};
|
|
1190
1182
|
});
|
|
1191
|
-
const l =
|
|
1192
|
-
const
|
|
1193
|
-
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), l.resolve(c), s(
|
|
1183
|
+
const l = H(), u = () => {
|
|
1184
|
+
const h = (f, c) => {
|
|
1185
|
+
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), l.resolve(c), s(f, c);
|
|
1194
1186
|
};
|
|
1195
|
-
if (this.languages && !this.isInitialized) return
|
|
1196
|
-
this.changeLanguage(this.options.lng,
|
|
1187
|
+
if (this.languages && !this.isInitialized) return h(null, this.t.bind(this));
|
|
1188
|
+
this.changeLanguage(this.options.lng, h);
|
|
1197
1189
|
};
|
|
1198
1190
|
return this.options.resources || !this.options.initAsync ? u() : setTimeout(u, 0), l;
|
|
1199
1191
|
}
|
|
1200
1192
|
loadResources(e) {
|
|
1201
|
-
var r,
|
|
1202
|
-
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1193
|
+
var r, a;
|
|
1194
|
+
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _;
|
|
1203
1195
|
const i = d(e) ? e : this.language;
|
|
1204
1196
|
if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1205
1197
|
if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
|
|
1206
1198
|
const o = [], l = (u) => {
|
|
1207
1199
|
if (!u || u === "cimode") return;
|
|
1208
|
-
this.services.languageUtils.toResolveHierarchy(u).forEach((
|
|
1209
|
-
|
|
1200
|
+
this.services.languageUtils.toResolveHierarchy(u).forEach((f) => {
|
|
1201
|
+
f !== "cimode" && o.indexOf(f) < 0 && o.push(f);
|
|
1210
1202
|
});
|
|
1211
1203
|
};
|
|
1212
|
-
i ? l(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((
|
|
1204
|
+
i ? l(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((h) => l(h)), (a = (r = this.options.preload) == null ? void 0 : r.forEach) == null || a.call(r, (u) => l(u)), this.services.backendConnector.load(o, this.options.ns, (u) => {
|
|
1213
1205
|
!u && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(u);
|
|
1214
1206
|
});
|
|
1215
1207
|
} else
|
|
1216
1208
|
s(null);
|
|
1217
1209
|
}
|
|
1218
1210
|
reloadResources(e, t, s) {
|
|
1219
|
-
const i =
|
|
1220
|
-
return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s =
|
|
1211
|
+
const i = H();
|
|
1212
|
+
return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = _), this.services.backendConnector.reload(e, t, (r) => {
|
|
1221
1213
|
i.resolve(), s(r);
|
|
1222
1214
|
}), i;
|
|
1223
1215
|
}
|
|
1224
1216
|
use(e) {
|
|
1225
1217
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1226
1218
|
if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1227
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
1219
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && Ve.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1228
1220
|
}
|
|
1229
1221
|
setResolvedLanguage(e) {
|
|
1230
1222
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
|
|
@@ -1239,42 +1231,42 @@ class J extends ee {
|
|
|
1239
1231
|
changeLanguage(e, t) {
|
|
1240
1232
|
var s = this;
|
|
1241
1233
|
this.isLanguageChangingTo = e;
|
|
1242
|
-
const i =
|
|
1234
|
+
const i = H();
|
|
1243
1235
|
this.emit("languageChanging", e);
|
|
1244
1236
|
const r = (l) => {
|
|
1245
1237
|
this.language = l, this.languages = this.services.languageUtils.toResolveHierarchy(l), this.resolvedLanguage = void 0, this.setResolvedLanguage(l);
|
|
1246
|
-
},
|
|
1238
|
+
}, a = (l, u) => {
|
|
1247
1239
|
u ? (r(u), this.translator.changeLanguage(u), this.isLanguageChangingTo = void 0, this.emit("languageChanged", u), this.logger.log("languageChanged", u)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
|
|
1248
1240
|
return s.t(...arguments);
|
|
1249
1241
|
}), t && t(l, function() {
|
|
1250
1242
|
return s.t(...arguments);
|
|
1251
1243
|
});
|
|
1252
1244
|
}, o = (l) => {
|
|
1253
|
-
var
|
|
1245
|
+
var h, f;
|
|
1254
1246
|
!e && !l && this.services.languageDetector && (l = []);
|
|
1255
1247
|
const u = d(l) ? l : this.services.languageUtils.getBestMatchFromCodes(l);
|
|
1256
|
-
u && (this.language || r(u), this.translator.language || this.translator.changeLanguage(u), (
|
|
1257
|
-
|
|
1248
|
+
u && (this.language || r(u), this.translator.language || this.translator.changeLanguage(u), (f = (h = this.services.languageDetector) == null ? void 0 : h.cacheUserLanguage) == null || f.call(h, u)), this.loadResources(u, (c) => {
|
|
1249
|
+
a(c, u);
|
|
1258
1250
|
});
|
|
1259
1251
|
};
|
|
1260
1252
|
return !e && this.services.languageDetector && !this.services.languageDetector.async ? o(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(o) : this.services.languageDetector.detect(o) : o(e), i;
|
|
1261
1253
|
}
|
|
1262
1254
|
getFixedT(e, t, s) {
|
|
1263
1255
|
var i = this;
|
|
1264
|
-
const r = function(
|
|
1256
|
+
const r = function(a, o) {
|
|
1265
1257
|
let l;
|
|
1266
1258
|
if (typeof o != "object") {
|
|
1267
|
-
for (var u = arguments.length,
|
|
1268
|
-
f
|
|
1269
|
-
l = i.options.overloadTranslationOptionHandler([
|
|
1259
|
+
for (var u = arguments.length, h = new Array(u > 2 ? u - 2 : 0), f = 2; f < u; f++)
|
|
1260
|
+
h[f - 2] = arguments[f];
|
|
1261
|
+
l = i.options.overloadTranslationOptionHandler([a, o].concat(h));
|
|
1270
1262
|
} else
|
|
1271
1263
|
l = {
|
|
1272
1264
|
...o
|
|
1273
1265
|
};
|
|
1274
1266
|
l.lng = l.lng || r.lng, l.lngs = l.lngs || r.lngs, l.ns = l.ns || r.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || s || r.keyPrefix);
|
|
1275
1267
|
const c = i.options.keySeparator || ".";
|
|
1276
|
-
let
|
|
1277
|
-
return l.keyPrefix && Array.isArray(
|
|
1268
|
+
let p;
|
|
1269
|
+
return l.keyPrefix && Array.isArray(a) ? p = a.map((g) => `${l.keyPrefix}${c}${g}`) : p = l.keyPrefix ? `${l.keyPrefix}${c}${a}` : a, i.t(p, l);
|
|
1278
1270
|
};
|
|
1279
1271
|
return d(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = s, r;
|
|
1280
1272
|
}
|
|
@@ -1301,18 +1293,18 @@ class J extends ee {
|
|
|
1301
1293
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
1302
1294
|
const s = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
|
|
1303
1295
|
if (s.toLowerCase() === "cimode") return !0;
|
|
1304
|
-
const
|
|
1296
|
+
const a = (o, l) => {
|
|
1305
1297
|
const u = this.services.backendConnector.state[`${o}|${l}`];
|
|
1306
1298
|
return u === -1 || u === 0 || u === 2;
|
|
1307
1299
|
};
|
|
1308
1300
|
if (t.precheck) {
|
|
1309
|
-
const o = t.precheck(this,
|
|
1301
|
+
const o = t.precheck(this, a);
|
|
1310
1302
|
if (o !== void 0) return o;
|
|
1311
1303
|
}
|
|
1312
|
-
return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages ||
|
|
1304
|
+
return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, e) && (!i || a(r, e)));
|
|
1313
1305
|
}
|
|
1314
1306
|
loadNamespaces(e, t) {
|
|
1315
|
-
const s =
|
|
1307
|
+
const s = H();
|
|
1316
1308
|
return this.options.ns ? (d(e) && (e = [e]), e.forEach((i) => {
|
|
1317
1309
|
this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
|
|
1318
1310
|
}), this.loadResources((i) => {
|
|
@@ -1320,32 +1312,32 @@ class J extends ee {
|
|
|
1320
1312
|
}), s) : (t && t(), Promise.resolve());
|
|
1321
1313
|
}
|
|
1322
1314
|
loadLanguages(e, t) {
|
|
1323
|
-
const s =
|
|
1315
|
+
const s = H();
|
|
1324
1316
|
d(e) && (e = [e]);
|
|
1325
|
-
const i = this.options.preload || [], r = e.filter((
|
|
1326
|
-
return r.length ? (this.options.preload = i.concat(r), this.loadResources((
|
|
1327
|
-
s.resolve(), t && t(
|
|
1317
|
+
const i = this.options.preload || [], r = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
|
|
1318
|
+
return r.length ? (this.options.preload = i.concat(r), this.loadResources((a) => {
|
|
1319
|
+
s.resolve(), t && t(a);
|
|
1328
1320
|
}), s) : (t && t(), Promise.resolve());
|
|
1329
1321
|
}
|
|
1330
1322
|
dir(e) {
|
|
1331
1323
|
var i, r;
|
|
1332
1324
|
if (e || (e = this.resolvedLanguage || (((i = this.languages) == null ? void 0 : i.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
1333
|
-
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], s = ((r = this.services) == null ? void 0 : r.languageUtils) || new
|
|
1325
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], s = ((r = this.services) == null ? void 0 : r.languageUtils) || new Se($e());
|
|
1334
1326
|
return t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1335
1327
|
}
|
|
1336
1328
|
static createInstance() {
|
|
1337
1329
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1338
|
-
return new
|
|
1330
|
+
return new z(e, t);
|
|
1339
1331
|
}
|
|
1340
1332
|
cloneInstance() {
|
|
1341
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1333
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _;
|
|
1342
1334
|
const s = e.forkResourceStore;
|
|
1343
1335
|
s && delete e.forkResourceStore;
|
|
1344
1336
|
const i = {
|
|
1345
1337
|
...this.options,
|
|
1346
1338
|
...e,
|
|
1347
1339
|
isClone: !0
|
|
1348
|
-
}, r = new
|
|
1340
|
+
}, r = new z(i);
|
|
1349
1341
|
if ((e.debug !== void 0 || e.prefix !== void 0) && (r.logger = r.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
|
|
1350
1342
|
r[o] = this[o];
|
|
1351
1343
|
}), r.services = {
|
|
@@ -1355,14 +1347,14 @@ class J extends ee {
|
|
|
1355
1347
|
}, s) {
|
|
1356
1348
|
const o = Object.keys(this.store.data).reduce((l, u) => (l[u] = {
|
|
1357
1349
|
...this.store.data[u]
|
|
1358
|
-
}, Object.keys(l[u]).reduce((
|
|
1359
|
-
...l[u][
|
|
1360
|
-
},
|
|
1361
|
-
r.store = new
|
|
1350
|
+
}, Object.keys(l[u]).reduce((h, f) => (h[f] = {
|
|
1351
|
+
...l[u][f]
|
|
1352
|
+
}, h), {})), {});
|
|
1353
|
+
r.store = new ye(o, i), r.services.resourceStore = r.store;
|
|
1362
1354
|
}
|
|
1363
1355
|
return r.translator = new q(r.services, i), r.translator.on("*", function(o) {
|
|
1364
|
-
for (var l = arguments.length, u = new Array(l > 1 ? l - 1 : 0),
|
|
1365
|
-
u[
|
|
1356
|
+
for (var l = arguments.length, u = new Array(l > 1 ? l - 1 : 0), h = 1; h < l; h++)
|
|
1357
|
+
u[h - 1] = arguments[h];
|
|
1366
1358
|
r.emit(o, ...u);
|
|
1367
1359
|
}), r.init(i, t), r.translator.options = i, r.translator.backendConnector.services.utils = {
|
|
1368
1360
|
hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
|
|
@@ -1378,56 +1370,56 @@ class J extends ee {
|
|
|
1378
1370
|
};
|
|
1379
1371
|
}
|
|
1380
1372
|
}
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
var
|
|
1398
|
-
function
|
|
1399
|
-
return
|
|
1373
|
+
const S = z.createInstance();
|
|
1374
|
+
S.createInstance = z.createInstance;
|
|
1375
|
+
S.createInstance;
|
|
1376
|
+
S.dir;
|
|
1377
|
+
S.init;
|
|
1378
|
+
S.loadResources;
|
|
1379
|
+
S.reloadResources;
|
|
1380
|
+
S.use;
|
|
1381
|
+
S.changeLanguage;
|
|
1382
|
+
S.getFixedT;
|
|
1383
|
+
S.t;
|
|
1384
|
+
S.exists;
|
|
1385
|
+
S.setDefaultNamespace;
|
|
1386
|
+
S.hasLoadedNamespace;
|
|
1387
|
+
S.loadNamespaces;
|
|
1388
|
+
S.loadLanguages;
|
|
1389
|
+
var rt = (n, e) => typeof e == "bigint" ? e.toString() : e;
|
|
1390
|
+
function te(n, e = " | ") {
|
|
1391
|
+
return n.map((t) => typeof t == "string" ? `'${t}'` : t).join(e);
|
|
1400
1392
|
}
|
|
1401
|
-
var
|
|
1402
|
-
if (typeof
|
|
1393
|
+
var Pe = (n) => {
|
|
1394
|
+
if (typeof n != "object" || n === null)
|
|
1403
1395
|
return !1;
|
|
1404
|
-
for (const e in
|
|
1405
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1396
|
+
for (const e in n)
|
|
1397
|
+
if (!Object.prototype.hasOwnProperty.call(n, e))
|
|
1406
1398
|
return !1;
|
|
1407
1399
|
return !0;
|
|
1408
|
-
},
|
|
1409
|
-
if (typeof
|
|
1410
|
-
return { key:
|
|
1411
|
-
if (
|
|
1412
|
-
const t = "key" in
|
|
1400
|
+
}, nt = (n, e) => {
|
|
1401
|
+
if (typeof n == "string")
|
|
1402
|
+
return { key: n, values: {} };
|
|
1403
|
+
if (Pe(n)) {
|
|
1404
|
+
const t = "key" in n && typeof n.key == "string" ? n.key : e, s = "values" in n && Pe(n.values) ? n.values : {};
|
|
1413
1405
|
return { key: t, values: s };
|
|
1414
1406
|
}
|
|
1415
1407
|
return { key: e, values: {} };
|
|
1416
|
-
},
|
|
1408
|
+
}, Re = "zod", at = (n) => (e, t) => {
|
|
1417
1409
|
var l;
|
|
1418
1410
|
const { t: s, ns: i, handlePath: r } = {
|
|
1419
|
-
t:
|
|
1420
|
-
ns:
|
|
1421
|
-
...
|
|
1422
|
-
handlePath: (
|
|
1411
|
+
t: S.t,
|
|
1412
|
+
ns: Re,
|
|
1413
|
+
...n,
|
|
1414
|
+
handlePath: (n == null ? void 0 : n.handlePath) !== !1 ? {
|
|
1423
1415
|
context: "with_path",
|
|
1424
|
-
ns: (
|
|
1416
|
+
ns: (n == null ? void 0 : n.ns) ?? Re,
|
|
1425
1417
|
keyPrefix: void 0,
|
|
1426
|
-
...
|
|
1418
|
+
...n == null ? void 0 : n.handlePath
|
|
1427
1419
|
} : null
|
|
1428
1420
|
};
|
|
1429
|
-
let
|
|
1430
|
-
|
|
1421
|
+
let a;
|
|
1422
|
+
a = Ae(e, t).message;
|
|
1431
1423
|
const o = e.path.length > 0 && r ? {
|
|
1432
1424
|
context: r.context,
|
|
1433
1425
|
path: s(
|
|
@@ -1439,16 +1431,16 @@ var Ce = (a) => {
|
|
|
1439
1431
|
)
|
|
1440
1432
|
} : {};
|
|
1441
1433
|
switch (e.code) {
|
|
1442
|
-
case
|
|
1443
|
-
e.received ===
|
|
1434
|
+
case O.invalid_type:
|
|
1435
|
+
e.received === de.undefined ? a = s("errors.invalid_type_received_undefined", {
|
|
1444
1436
|
ns: i,
|
|
1445
|
-
defaultValue:
|
|
1437
|
+
defaultValue: a,
|
|
1446
1438
|
...o
|
|
1447
|
-
}) : e.received ===
|
|
1439
|
+
}) : e.received === de.null ? a = s("errors.invalid_type_received_null", {
|
|
1448
1440
|
ns: i,
|
|
1449
|
-
defaultValue:
|
|
1441
|
+
defaultValue: a,
|
|
1450
1442
|
...o
|
|
1451
|
-
}) :
|
|
1443
|
+
}) : a = s("errors.invalid_type", {
|
|
1452
1444
|
expected: s(`types.${e.expected}`, {
|
|
1453
1445
|
defaultValue: e.expected,
|
|
1454
1446
|
ns: i
|
|
@@ -1458,353 +1450,339 @@ var Ce = (a) => {
|
|
|
1458
1450
|
ns: i
|
|
1459
1451
|
}),
|
|
1460
1452
|
ns: i,
|
|
1461
|
-
defaultValue:
|
|
1453
|
+
defaultValue: a,
|
|
1462
1454
|
...o
|
|
1463
1455
|
});
|
|
1464
1456
|
break;
|
|
1465
|
-
case
|
|
1466
|
-
|
|
1467
|
-
expected: JSON.stringify(e.expected,
|
|
1457
|
+
case O.invalid_literal:
|
|
1458
|
+
a = s("errors.invalid_literal", {
|
|
1459
|
+
expected: JSON.stringify(e.expected, rt),
|
|
1468
1460
|
ns: i,
|
|
1469
|
-
defaultValue:
|
|
1461
|
+
defaultValue: a,
|
|
1470
1462
|
...o
|
|
1471
1463
|
});
|
|
1472
1464
|
break;
|
|
1473
|
-
case
|
|
1474
|
-
|
|
1475
|
-
keys:
|
|
1465
|
+
case O.unrecognized_keys:
|
|
1466
|
+
a = s("errors.unrecognized_keys", {
|
|
1467
|
+
keys: te(e.keys, ", "),
|
|
1476
1468
|
count: e.keys.length,
|
|
1477
1469
|
ns: i,
|
|
1478
|
-
defaultValue:
|
|
1470
|
+
defaultValue: a,
|
|
1479
1471
|
...o
|
|
1480
1472
|
});
|
|
1481
1473
|
break;
|
|
1482
|
-
case
|
|
1483
|
-
|
|
1474
|
+
case O.invalid_union:
|
|
1475
|
+
a = s("errors.invalid_union", {
|
|
1484
1476
|
ns: i,
|
|
1485
|
-
defaultValue:
|
|
1477
|
+
defaultValue: a,
|
|
1486
1478
|
...o
|
|
1487
1479
|
});
|
|
1488
1480
|
break;
|
|
1489
|
-
case
|
|
1490
|
-
|
|
1491
|
-
options:
|
|
1481
|
+
case O.invalid_union_discriminator:
|
|
1482
|
+
a = s("errors.invalid_union_discriminator", {
|
|
1483
|
+
options: te(e.options),
|
|
1492
1484
|
ns: i,
|
|
1493
|
-
defaultValue:
|
|
1485
|
+
defaultValue: a,
|
|
1494
1486
|
...o
|
|
1495
1487
|
});
|
|
1496
1488
|
break;
|
|
1497
|
-
case
|
|
1498
|
-
|
|
1499
|
-
options:
|
|
1489
|
+
case O.invalid_enum_value:
|
|
1490
|
+
a = s("errors.invalid_enum_value", {
|
|
1491
|
+
options: te(e.options),
|
|
1500
1492
|
received: e.received,
|
|
1501
1493
|
ns: i,
|
|
1502
|
-
defaultValue:
|
|
1494
|
+
defaultValue: a,
|
|
1503
1495
|
...o
|
|
1504
1496
|
});
|
|
1505
1497
|
break;
|
|
1506
|
-
case
|
|
1507
|
-
|
|
1498
|
+
case O.invalid_arguments:
|
|
1499
|
+
a = s("errors.invalid_arguments", {
|
|
1508
1500
|
ns: i,
|
|
1509
|
-
defaultValue:
|
|
1501
|
+
defaultValue: a,
|
|
1510
1502
|
...o
|
|
1511
1503
|
});
|
|
1512
1504
|
break;
|
|
1513
|
-
case
|
|
1514
|
-
|
|
1505
|
+
case O.invalid_return_type:
|
|
1506
|
+
a = s("errors.invalid_return_type", {
|
|
1515
1507
|
ns: i,
|
|
1516
|
-
defaultValue:
|
|
1508
|
+
defaultValue: a,
|
|
1517
1509
|
...o
|
|
1518
1510
|
});
|
|
1519
1511
|
break;
|
|
1520
|
-
case
|
|
1521
|
-
|
|
1512
|
+
case O.invalid_date:
|
|
1513
|
+
a = s("errors.invalid_date", {
|
|
1522
1514
|
ns: i,
|
|
1523
|
-
defaultValue:
|
|
1515
|
+
defaultValue: a,
|
|
1524
1516
|
...o
|
|
1525
1517
|
});
|
|
1526
1518
|
break;
|
|
1527
|
-
case
|
|
1528
|
-
typeof e.validation == "object" ? "startsWith" in e.validation ?
|
|
1519
|
+
case O.invalid_string:
|
|
1520
|
+
typeof e.validation == "object" ? "startsWith" in e.validation ? a = s("errors.invalid_string.startsWith", {
|
|
1529
1521
|
startsWith: e.validation.startsWith,
|
|
1530
1522
|
ns: i,
|
|
1531
|
-
defaultValue:
|
|
1523
|
+
defaultValue: a,
|
|
1532
1524
|
...o
|
|
1533
|
-
}) : "endsWith" in e.validation && (
|
|
1525
|
+
}) : "endsWith" in e.validation && (a = s("errors.invalid_string.endsWith", {
|
|
1534
1526
|
endsWith: e.validation.endsWith,
|
|
1535
1527
|
ns: i,
|
|
1536
|
-
defaultValue:
|
|
1528
|
+
defaultValue: a,
|
|
1537
1529
|
...o
|
|
1538
|
-
})) :
|
|
1530
|
+
})) : a = s(`errors.invalid_string.${e.validation}`, {
|
|
1539
1531
|
validation: s(`validations.${e.validation}`, {
|
|
1540
1532
|
defaultValue: e.validation,
|
|
1541
1533
|
ns: i
|
|
1542
1534
|
}),
|
|
1543
1535
|
ns: i,
|
|
1544
|
-
defaultValue:
|
|
1536
|
+
defaultValue: a,
|
|
1545
1537
|
...o
|
|
1546
1538
|
});
|
|
1547
1539
|
break;
|
|
1548
|
-
case
|
|
1540
|
+
case O.too_small:
|
|
1549
1541
|
const u = e.type === "date" ? new Date(e.minimum) : e.minimum;
|
|
1550
|
-
|
|
1542
|
+
a = s(
|
|
1551
1543
|
`errors.too_small.${e.type}.${e.exact ? "exact" : e.inclusive ? "inclusive" : "not_inclusive"}`,
|
|
1552
1544
|
{
|
|
1553
1545
|
minimum: u,
|
|
1554
1546
|
count: typeof u == "number" ? u : void 0,
|
|
1555
1547
|
ns: i,
|
|
1556
|
-
defaultValue:
|
|
1548
|
+
defaultValue: a,
|
|
1557
1549
|
...o
|
|
1558
1550
|
}
|
|
1559
1551
|
);
|
|
1560
1552
|
break;
|
|
1561
|
-
case
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1553
|
+
case O.too_big:
|
|
1554
|
+
const h = e.type === "date" ? new Date(e.maximum) : e.maximum;
|
|
1555
|
+
a = s(
|
|
1564
1556
|
`errors.too_big.${e.type}.${e.exact ? "exact" : e.inclusive ? "inclusive" : "not_inclusive"}`,
|
|
1565
1557
|
{
|
|
1566
|
-
maximum:
|
|
1567
|
-
count: typeof
|
|
1558
|
+
maximum: h,
|
|
1559
|
+
count: typeof h == "number" ? h : void 0,
|
|
1568
1560
|
ns: i,
|
|
1569
|
-
defaultValue:
|
|
1561
|
+
defaultValue: a,
|
|
1570
1562
|
...o
|
|
1571
1563
|
}
|
|
1572
1564
|
);
|
|
1573
1565
|
break;
|
|
1574
|
-
case
|
|
1575
|
-
const { key:
|
|
1566
|
+
case O.custom:
|
|
1567
|
+
const { key: f, values: c } = nt(
|
|
1576
1568
|
(l = e.params) == null ? void 0 : l.i18n,
|
|
1577
1569
|
"errors.custom"
|
|
1578
1570
|
);
|
|
1579
|
-
|
|
1571
|
+
a = s(f, {
|
|
1580
1572
|
...c,
|
|
1581
1573
|
ns: i,
|
|
1582
|
-
defaultValue:
|
|
1574
|
+
defaultValue: a,
|
|
1583
1575
|
...o
|
|
1584
1576
|
});
|
|
1585
1577
|
break;
|
|
1586
|
-
case
|
|
1587
|
-
|
|
1578
|
+
case O.invalid_intersection_types:
|
|
1579
|
+
a = s("errors.invalid_intersection_types", {
|
|
1588
1580
|
ns: i,
|
|
1589
|
-
defaultValue:
|
|
1581
|
+
defaultValue: a,
|
|
1590
1582
|
...o
|
|
1591
1583
|
});
|
|
1592
1584
|
break;
|
|
1593
|
-
case
|
|
1594
|
-
|
|
1585
|
+
case O.not_multiple_of:
|
|
1586
|
+
a = s("errors.not_multiple_of", {
|
|
1595
1587
|
multipleOf: e.multipleOf,
|
|
1596
1588
|
ns: i,
|
|
1597
|
-
defaultValue:
|
|
1589
|
+
defaultValue: a,
|
|
1598
1590
|
...o
|
|
1599
1591
|
});
|
|
1600
1592
|
break;
|
|
1601
|
-
case
|
|
1602
|
-
|
|
1593
|
+
case O.not_finite:
|
|
1594
|
+
a = s("errors.not_finite", {
|
|
1603
1595
|
ns: i,
|
|
1604
|
-
defaultValue:
|
|
1596
|
+
defaultValue: a,
|
|
1605
1597
|
...o
|
|
1606
1598
|
});
|
|
1607
1599
|
break;
|
|
1608
1600
|
}
|
|
1609
|
-
return { message:
|
|
1601
|
+
return { message: a };
|
|
1610
1602
|
};
|
|
1611
|
-
const
|
|
1612
|
-
locale:
|
|
1613
|
-
messages:
|
|
1603
|
+
const le = Te(), D = Ke({
|
|
1604
|
+
locale: le,
|
|
1605
|
+
messages: ke
|
|
1614
1606
|
});
|
|
1615
|
-
console.
|
|
1616
|
-
|
|
1617
|
-
lng:
|
|
1618
|
-
resources:
|
|
1607
|
+
console.info("Current locale:", le);
|
|
1608
|
+
S.init({
|
|
1609
|
+
lng: le,
|
|
1610
|
+
resources: ke
|
|
1619
1611
|
});
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
class: `${a.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
|
|
1627
|
-
},
|
|
1628
|
-
[
|
|
1629
|
-
B(ie.FmIcon, { size: "sm", name: a.icon, outline: !0 }),
|
|
1630
|
-
B("span", { class: "fm-typo-en-body-md-600" }, a.name)
|
|
1631
|
-
]
|
|
1632
|
-
);
|
|
1612
|
+
De.setErrorMap(at({ ns: ["connectZod", "connectZodCustom"] }));
|
|
1613
|
+
var b = [];
|
|
1614
|
+
for (var se = 0; se < 256; ++se)
|
|
1615
|
+
b.push((se + 256).toString(16).slice(1));
|
|
1616
|
+
function ot(n, e = 0) {
|
|
1617
|
+
return (b[n[e + 0]] + b[n[e + 1]] + b[n[e + 2]] + b[n[e + 3]] + "-" + b[n[e + 4]] + b[n[e + 5]] + "-" + b[n[e + 6]] + b[n[e + 7]] + "-" + b[n[e + 8]] + b[n[e + 9]] + "-" + b[n[e + 10]] + b[n[e + 11]] + b[n[e + 12]] + b[n[e + 13]] + b[n[e + 14]] + b[n[e + 15]]).toLowerCase();
|
|
1633
1618
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1619
|
+
var W, lt = new Uint8Array(16);
|
|
1620
|
+
function ut() {
|
|
1621
|
+
if (!W && (W = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !W))
|
|
1622
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1623
|
+
return W(lt);
|
|
1624
|
+
}
|
|
1625
|
+
var ie, Z, re = 0, ne = 0;
|
|
1626
|
+
function ct(n, e, t) {
|
|
1627
|
+
var s = e && t || 0, i = e || new Array(16);
|
|
1628
|
+
n = n || {};
|
|
1629
|
+
var r = n.node, a = n.clockseq;
|
|
1630
|
+
if (n._v6 || (r || (r = ie), a == null && (a = Z)), r == null || a == null) {
|
|
1631
|
+
var o = n.random || (n.rng || ut)();
|
|
1632
|
+
r == null && (r = [o[0], o[1], o[2], o[3], o[4], o[5]], !ie && !n._v6 && (r[0] |= 1, ie = r)), a == null && (a = (o[6] << 8 | o[7]) & 16383, Z === void 0 && !n._v6 && (Z = a));
|
|
1633
|
+
}
|
|
1634
|
+
var l = n.msecs !== void 0 ? n.msecs : Date.now(), u = n.nsecs !== void 0 ? n.nsecs : ne + 1, h = l - re + (u - ne) / 1e4;
|
|
1635
|
+
if (h < 0 && n.clockseq === void 0 && (a = a + 1 & 16383), (h < 0 || l > re) && n.nsecs === void 0 && (u = 0), u >= 1e4)
|
|
1636
|
+
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
1637
|
+
re = l, ne = u, Z = a, l += 122192928e5;
|
|
1638
|
+
var f = ((l & 268435455) * 1e4 + u) % 4294967296;
|
|
1639
|
+
i[s++] = f >>> 24 & 255, i[s++] = f >>> 16 & 255, i[s++] = f >>> 8 & 255, i[s++] = f & 255;
|
|
1640
|
+
var c = l / 4294967296 * 1e4 & 268435455;
|
|
1641
|
+
i[s++] = c >>> 8 & 255, i[s++] = c & 255, i[s++] = c >>> 24 & 15 | 16, i[s++] = c >>> 16 & 255, i[s++] = a >>> 8 | 128, i[s++] = a & 255;
|
|
1642
|
+
for (var p = 0; p < 6; ++p)
|
|
1643
|
+
i[s + p] = r[p];
|
|
1644
|
+
return e || ot(i);
|
|
1645
|
+
}
|
|
1646
|
+
async function vt(n, e) {
|
|
1647
|
+
await new Promise((t) => {
|
|
1648
|
+
const s = document.createElement("input");
|
|
1649
|
+
s.value = n, document.body.appendChild(s), s.select(), document.execCommand("copy"), document.body.removeChild(s), t("");
|
|
1650
|
+
}).then(() => {
|
|
1651
|
+
var t;
|
|
1652
|
+
(t = oe().snackbar) == null || t.open({
|
|
1653
|
+
message: (e == null ? void 0 : e.successMessage) || "Copied to clipboard",
|
|
1654
|
+
type: "success",
|
|
1655
|
+
dismissable: !0
|
|
1656
|
+
});
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
const xt = {
|
|
1660
|
+
fileExtension(n) {
|
|
1661
|
+
return (n == null ? void 0 : n.type.replace(/video\/|image\//, "")) || void 0;
|
|
1642
1662
|
},
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
icon: "loyalty",
|
|
1646
|
-
name: "Promotion",
|
|
1647
|
-
chip() {
|
|
1648
|
-
return $(this);
|
|
1649
|
-
}
|
|
1663
|
+
generateId(n) {
|
|
1664
|
+
return [ct(), this.fileExtension(n)].filter(Boolean).join(".");
|
|
1650
1665
|
},
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
icon: "sell",
|
|
1654
|
-
name: ne.global.t("connect.campaign.voucher.title"),
|
|
1655
|
-
chip() {
|
|
1656
|
-
return $(this);
|
|
1657
|
-
}
|
|
1666
|
+
campaignPath(n) {
|
|
1667
|
+
return `business/${k.getBusinessId()}/campaigns/${n || this.generateId()}`;
|
|
1658
1668
|
},
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
icon: "award_star",
|
|
1662
|
-
name: "Experience",
|
|
1663
|
-
chip() {
|
|
1664
|
-
return $(this);
|
|
1665
|
-
}
|
|
1669
|
+
coverImagePath() {
|
|
1670
|
+
return `business/${k.getBusinessId()}/membership/design/image.png`;
|
|
1666
1671
|
},
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
icon: "campaign",
|
|
1670
|
-
name: "Broadcast",
|
|
1671
|
-
chip() {
|
|
1672
|
-
return $(this);
|
|
1673
|
-
}
|
|
1672
|
+
advertisementPath(n, e) {
|
|
1673
|
+
return `business/${k.getBusinessId()}/membership/advertisement/${n}.${this.fileExtension(e)}`;
|
|
1674
1674
|
},
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
icon: "database",
|
|
1678
|
-
name: "Token",
|
|
1679
|
-
chip() {
|
|
1680
|
-
return $(this);
|
|
1681
|
-
}
|
|
1675
|
+
designPath(n, e) {
|
|
1676
|
+
return `business/${k.getBusinessId()}/membership/design/${n}.${this.fileExtension(e)}`;
|
|
1682
1677
|
},
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
icon: "editor_choice",
|
|
1686
|
-
name: "Reward Pool",
|
|
1687
|
-
chip() {
|
|
1688
|
-
return $(this);
|
|
1689
|
-
}
|
|
1678
|
+
bundleImagePath(n, e) {
|
|
1679
|
+
return `business/${k.getBusinessId()}/membership/bundles/${n || this.generateId(e)}`;
|
|
1690
1680
|
},
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
icon: "monetization_on",
|
|
1694
|
-
name: "Point",
|
|
1695
|
-
chip() {
|
|
1696
|
-
return $(this);
|
|
1697
|
-
}
|
|
1681
|
+
collectibleImagePath(n, e) {
|
|
1682
|
+
return `business/${k.getBusinessId()}/membership/collectibles/${n || this.generateId(e)}`;
|
|
1698
1683
|
},
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
icon: "",
|
|
1702
|
-
name: "Membership",
|
|
1703
|
-
chip() {
|
|
1704
|
-
return $(this);
|
|
1705
|
-
}
|
|
1684
|
+
tierImagePath(n, e) {
|
|
1685
|
+
return `business/${k.getBusinessId()}/membership/tiers/${n || this.generateId(e)}`;
|
|
1706
1686
|
},
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1687
|
+
referralTermAndConditionPath() {
|
|
1688
|
+
return `business/${k.getBusinessId()}/membership/referral/term_and_condition.pdf`;
|
|
1689
|
+
},
|
|
1690
|
+
async update(n, e, t) {
|
|
1691
|
+
const s = fe(void 0, t), i = ge(s, n);
|
|
1692
|
+
return await Ee(i, e), Ie(i);
|
|
1693
|
+
},
|
|
1694
|
+
async delete(n, e) {
|
|
1695
|
+
const t = fe(void 0, e), s = ge(t, n);
|
|
1696
|
+
await Fe(s);
|
|
1715
1697
|
}
|
|
1716
|
-
}
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1698
|
+
}, yt = {
|
|
1699
|
+
get dialog() {
|
|
1700
|
+
return oe().dialog;
|
|
1701
|
+
},
|
|
1702
|
+
confirm(n, e = D.global.t("connect.common.confirm"), t = D.global.t("connect.common.confirm"), s = D.global.t("connect.common.cancel")) {
|
|
1703
|
+
return new Promise((i) => {
|
|
1704
|
+
var r;
|
|
1705
|
+
(r = this.dialog) == null || r.open({
|
|
1706
|
+
title: e,
|
|
1707
|
+
message: n,
|
|
1708
|
+
closeButton: !0,
|
|
1709
|
+
overlay: !0,
|
|
1710
|
+
primaryActions: {
|
|
1711
|
+
close: !0,
|
|
1712
|
+
text: t
|
|
1713
|
+
},
|
|
1714
|
+
secondaryActions: {
|
|
1715
|
+
variant: "tertiary",
|
|
1716
|
+
close: !0,
|
|
1717
|
+
text: s
|
|
1718
|
+
}
|
|
1719
|
+
}).onPrimary(() => {
|
|
1720
|
+
i(!0);
|
|
1721
|
+
}).onSecondary(() => {
|
|
1722
|
+
i(!1);
|
|
1723
|
+
}).onClose(() => {
|
|
1724
|
+
i(!1);
|
|
1725
|
+
});
|
|
1726
|
+
});
|
|
1727
|
+
},
|
|
1728
|
+
remove(n, e = D.global.t("connect.common.remove"), t = D.global.t("connect.common.remove"), s = D.global.t("connect.common.cancel")) {
|
|
1729
|
+
return new Promise((i) => {
|
|
1730
|
+
var r;
|
|
1731
|
+
(r = this.dialog) == null || r.open({
|
|
1732
|
+
title: e,
|
|
1733
|
+
message: n,
|
|
1734
|
+
closeButton: !0,
|
|
1735
|
+
overlay: !0,
|
|
1736
|
+
primaryActions: {
|
|
1737
|
+
close: !0,
|
|
1738
|
+
variant: "destructive",
|
|
1739
|
+
text: t
|
|
1740
|
+
},
|
|
1741
|
+
secondaryActions: {
|
|
1742
|
+
variant: "tertiary",
|
|
1743
|
+
close: !0,
|
|
1744
|
+
text: s
|
|
1745
|
+
}
|
|
1746
|
+
}).onPrimary(() => {
|
|
1747
|
+
i(!0);
|
|
1748
|
+
}).onClose(() => {
|
|
1749
|
+
i(!1);
|
|
1750
|
+
});
|
|
1751
|
+
});
|
|
1740
1752
|
}
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
},
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
) ? "active" : F().isAfter(a.timeframeOptions.end) ? "expired" : "upcoming" : "active";
|
|
1769
|
-
}
|
|
1770
|
-
function Lt(a) {
|
|
1771
|
-
var e, t;
|
|
1772
|
-
switch (a.event.type) {
|
|
1773
|
-
case "BILL_COMPLETED":
|
|
1774
|
-
const s = `Spend to get ${j.formattedType(a.type)}`;
|
|
1775
|
-
switch (a.type) {
|
|
1776
|
-
case "POINT":
|
|
1777
|
-
case "CREDIT":
|
|
1778
|
-
case "COIN":
|
|
1779
|
-
return a.earningOption.type == "FIXED" ? `Spend to get ${a.earningOption.amount} ${j.formattedType(a.type)}` : `Every ${a.earningOption.every} amount spent get ${a.earningOption.amount} ${j.formattedType(a.type)}`;
|
|
1780
|
-
case "VOUCHER":
|
|
1781
|
-
const i = (t = (e = a == null ? void 0 : a.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : t.effect;
|
|
1782
|
-
return i ? `${s} - ${G(i)}` : s;
|
|
1783
|
-
default:
|
|
1784
|
-
return s;
|
|
1785
|
-
}
|
|
1786
|
-
case "FEEDBACK":
|
|
1787
|
-
return `Give feedback to receive ${j.formattedType(a.type)}`;
|
|
1788
|
-
case "SCHEDULE":
|
|
1789
|
-
return `Receive ${j.formattedType(a.type)} on scheduled time`;
|
|
1790
|
-
case "SIMPLE_CLAIM":
|
|
1791
|
-
return "Simple claim voucher";
|
|
1792
|
-
case "TIER_UPGRADED":
|
|
1793
|
-
return `Receive ${j.formattedType(a.type)} when member tier upgraded`;
|
|
1794
|
-
case "MEMBERSHIP_JOINED":
|
|
1795
|
-
return `Receive ${j.formattedType(a.type)} when member joined`;
|
|
1796
|
-
case "MAKING_ORDER":
|
|
1797
|
-
return a.type !== "PROMOTION" ? void 0 : G(a.effect);
|
|
1798
|
-
default:
|
|
1799
|
-
throw new Error(
|
|
1800
|
-
`Not implemented ${JSON.stringify({ cause: a.event.type })}`
|
|
1801
|
-
);
|
|
1753
|
+
}, bt = {
|
|
1754
|
+
get snackbar() {
|
|
1755
|
+
return oe().snackbar;
|
|
1756
|
+
},
|
|
1757
|
+
success(n, e = 2e3) {
|
|
1758
|
+
var t;
|
|
1759
|
+
return (t = this.snackbar) == null ? void 0 : t.open({ message: n, type: "success" }, e);
|
|
1760
|
+
},
|
|
1761
|
+
error(n, e = 2e3) {
|
|
1762
|
+
var t;
|
|
1763
|
+
return (t = this.snackbar) == null ? void 0 : t.open({ message: n, type: "error" }, e);
|
|
1764
|
+
},
|
|
1765
|
+
info(n, e = 2e3, t = !1) {
|
|
1766
|
+
var s;
|
|
1767
|
+
return (s = this.snackbar) == null ? void 0 : s.open(
|
|
1768
|
+
{
|
|
1769
|
+
message: n,
|
|
1770
|
+
type: "info",
|
|
1771
|
+
dismissable: e !== null,
|
|
1772
|
+
spinner: t
|
|
1773
|
+
},
|
|
1774
|
+
e
|
|
1775
|
+
);
|
|
1776
|
+
},
|
|
1777
|
+
close(n) {
|
|
1778
|
+
var e;
|
|
1779
|
+
return (e = this.snackbar) == null ? void 0 : e.close(n);
|
|
1802
1780
|
}
|
|
1803
|
-
}
|
|
1781
|
+
};
|
|
1804
1782
|
export {
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1783
|
+
vt as c,
|
|
1784
|
+
xt as f,
|
|
1785
|
+
D as i,
|
|
1786
|
+
bt as n,
|
|
1787
|
+
yt as p
|
|
1810
1788
|
};
|