@wix/blog 1.0.714 → 1.0.716
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/_sdk-exports/context-blog-feed/runtime.d.ts +7 -0
- package/_sdk-exports/context-blog-feed/runtime.js +3 -3
- package/_sdk-exports/context-post-by-id/runtime.js +4 -4
- package/_sdk-exports/context-post-by-slug/runtime.js +3 -3
- package/_sdk-exports/context-post-list-item/runtime.d.ts +8 -3
- package/_sdk-exports/context-post-list-item/runtime.js +4 -4
- package/_sdk-exports/context-related-posts/runtime.d.ts +7 -0
- package/_sdk-exports/context-related-posts/runtime.js +3 -3
- package/build/cjs/context-blog-feed.d.ts +7 -0
- package/build/cjs/context-blog-feed.js +5 -6
- package/build/cjs/context-blog-feed.js.map +1 -1
- package/build/cjs/context-post-by-id.js +916 -894
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.js +146 -124
- package/build/cjs/context-post-by-slug.js.map +1 -1
- package/build/cjs/context-post-list-item.d.ts +8 -3
- package/build/cjs/context-post-list-item.js +896 -873
- package/build/cjs/context-post-list-item.js.map +1 -1
- package/build/cjs/context-related-posts.d.ts +7 -0
- package/build/cjs/context-related-posts.js +5 -6
- package/build/cjs/context-related-posts.js.map +1 -1
- package/build/es/context-blog-feed.d.mts +7 -0
- package/build/es/context-blog-feed.mjs +5 -6
- package/build/es/context-blog-feed.mjs.map +1 -1
- package/build/es/context-post-by-id.mjs +916 -894
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.mjs +146 -124
- package/build/es/context-post-by-slug.mjs.map +1 -1
- package/build/es/context-post-list-item.d.mts +8 -3
- package/build/es/context-post-list-item.mjs +896 -873
- package/build/es/context-post-list-item.mjs.map +1 -1
- package/build/es/context-related-posts.d.mts +7 -0
- package/build/es/context-related-posts.mjs +5 -6
- package/build/es/context-related-posts.mjs.map +1 -1
- package/build/internal/cjs/context-blog-feed.d.ts +7 -0
- package/build/internal/cjs/context-post-list-item.d.ts +8 -3
- package/build/internal/cjs/context-related-posts.d.ts +7 -0
- package/build/internal/es/context-blog-feed.d.mts +7 -0
- package/build/internal/es/context-post-list-item.d.mts +8 -3
- package/build/internal/es/context-related-posts.d.mts +7 -0
- package/package.json +2 -2
|
@@ -30,10 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// context-post-by-id.ts
|
|
31
31
|
var context_post_by_id_exports = {};
|
|
32
32
|
__export(context_post_by_id_exports, {
|
|
33
|
-
PostByIdProvider: () =>
|
|
34
|
-
default: () =>
|
|
35
|
-
injectAccessTokenGetter: () =>
|
|
36
|
-
usePostByIdContext: () =>
|
|
33
|
+
PostByIdProvider: () => bd,
|
|
34
|
+
default: () => bd,
|
|
35
|
+
injectAccessTokenGetter: () => xd,
|
|
36
|
+
usePostByIdContext: () => gd
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(context_post_by_id_exports);
|
|
39
39
|
|
|
@@ -827,21 +827,21 @@ function un(e6, t2) {
|
|
|
827
827
|
function dn(e6) {
|
|
828
828
|
return isFinite(e6) ? e6 : e6.toString();
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function fn(e6) {
|
|
831
831
|
return e6 === `NaN` ? NaN : e6 === `Infinity` ? 1 / 0 : e6 === `-Infinity` ? -1 / 0 : e6;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function pn(e6) {
|
|
834
834
|
return Uint8Array.from(atob(e6), (e7) => e7.charCodeAt(0));
|
|
835
835
|
}
|
|
836
|
-
var
|
|
837
|
-
var
|
|
836
|
+
var mn = `modulepreload`;
|
|
837
|
+
var hn = function(e6, t2) {
|
|
838
838
|
return new URL(e6, t2).href;
|
|
839
839
|
};
|
|
840
|
-
var
|
|
841
|
-
var
|
|
840
|
+
var gn = {};
|
|
841
|
+
var _n = function(e6) {
|
|
842
842
|
return e6.pathname.endsWith(`.css`);
|
|
843
843
|
};
|
|
844
|
-
var
|
|
844
|
+
var vn = function(e6, t2, n2) {
|
|
845
845
|
if (t2 in e6) return e6[t2];
|
|
846
846
|
let r2 = n2();
|
|
847
847
|
if (!r2) {
|
|
@@ -855,7 +855,7 @@ var _n = function(e6, t2, n2) {
|
|
|
855
855
|
});
|
|
856
856
|
return e6[t2] = i2, i2;
|
|
857
857
|
};
|
|
858
|
-
var
|
|
858
|
+
var yn = function(e6, t2, n2) {
|
|
859
859
|
let r2 = Promise.resolve();
|
|
860
860
|
if (t2 && t2.length > 0) {
|
|
861
861
|
let o3 = function(e8) {
|
|
@@ -866,9 +866,9 @@ var vn = function(e6, t2, n2) {
|
|
|
866
866
|
var o2 = o3, s2 = s3;
|
|
867
867
|
let e7, i3 = document.querySelector(`meta[property=csp-nonce]`), a2 = i3?.nonce || i3?.getAttribute(`nonce`);
|
|
868
868
|
r2 = o3(t2.map((t3) => {
|
|
869
|
-
t3 =
|
|
870
|
-
let r3 = s3(t3), i4 =
|
|
871
|
-
return
|
|
869
|
+
t3 = hn(t3, n2);
|
|
870
|
+
let r3 = s3(t3), i4 = _n(r3);
|
|
871
|
+
return vn(gn, r3.href, () => {
|
|
872
872
|
if (e7 === void 0) {
|
|
873
873
|
e7 = { all: /* @__PURE__ */ new Set(), styles: /* @__PURE__ */ new Set() };
|
|
874
874
|
let t5 = document.getElementsByTagName(`link`);
|
|
@@ -879,7 +879,7 @@ var vn = function(e6, t2, n2) {
|
|
|
879
879
|
}
|
|
880
880
|
if ((i4 ? e7.styles : e7.all).has(r3.href)) return;
|
|
881
881
|
let t4 = document.createElement(`link`);
|
|
882
|
-
if (t4.rel = i4 ? `stylesheet` :
|
|
882
|
+
if (t4.rel = i4 ? `stylesheet` : mn, i4 || (t4.as = `script`), t4.crossOrigin = ``, t4.href = r3.href, a2 && t4.setAttribute(`nonce`, a2), document.head.appendChild(t4), i4) return new Promise((e8, n3) => {
|
|
883
883
|
t4.addEventListener(`load`, e8), t4.addEventListener(`error`, () => n3(Error(`Unable to preload CSS for ${r3}`)));
|
|
884
884
|
});
|
|
885
885
|
});
|
|
@@ -894,30 +894,30 @@ var vn = function(e6, t2, n2) {
|
|
|
894
894
|
return e6().catch(i2);
|
|
895
895
|
});
|
|
896
896
|
};
|
|
897
|
-
var
|
|
898
|
-
var
|
|
899
|
-
var
|
|
900
|
-
var
|
|
901
|
-
let e6 =
|
|
902
|
-
if (e6) return { [
|
|
897
|
+
var bn = `x-wix-linguist`;
|
|
898
|
+
var xn = `00000000-0000-0000-0000-000000000000`;
|
|
899
|
+
var Sn = `false`;
|
|
900
|
+
var Cn = () => {
|
|
901
|
+
let e6 = En(`language`), t2 = En(`locale`);
|
|
902
|
+
if (e6) return { [bn]: [e6, t2 || e6, Sn, xn].join(`|`) };
|
|
903
903
|
};
|
|
904
|
-
function
|
|
904
|
+
function wn() {
|
|
905
905
|
let e6 = null, t2 = null;
|
|
906
906
|
return { promise: new Promise((n2, r2) => {
|
|
907
907
|
e6 = n2, t2 = r2;
|
|
908
908
|
}), resolve: e6, reject: t2 };
|
|
909
909
|
}
|
|
910
|
-
var
|
|
911
|
-
var
|
|
912
|
-
var
|
|
913
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 =
|
|
914
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
915
|
-
return
|
|
910
|
+
var Tn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
911
|
+
var En = (e6) => Tn()?.[e6];
|
|
912
|
+
var Dn = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host: (t2) => {
|
|
913
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 = kn();
|
|
914
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: En(`language`), locale: En(`locale`), get passThroughHeaders() {
|
|
915
|
+
return Cn();
|
|
916
916
|
} } };
|
|
917
917
|
}, auth: (e7) => {
|
|
918
918
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
919
|
-
!e7 &&
|
|
920
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
919
|
+
!e7 && On() && (e7 = t2?.getAccessTokenFunction?.());
|
|
920
|
+
let n2 = false, { resolve: r2, promise: i2 } = wn();
|
|
921
921
|
return { getAuthHeaders: async () => {
|
|
922
922
|
if (!e7 && n2 && (e7 = await i2), !e7) throw Error(`Failed to resolve auth token`);
|
|
923
923
|
return { headers: { Authorization: await e7() } };
|
|
@@ -925,37 +925,37 @@ var En = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host:
|
|
|
925
925
|
r2(e8);
|
|
926
926
|
}) };
|
|
927
927
|
} });
|
|
928
|
-
function
|
|
928
|
+
function On() {
|
|
929
929
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function kn() {
|
|
932
932
|
let e6 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
933
933
|
if (!e6) return;
|
|
934
934
|
let t2 = new URL(e6);
|
|
935
935
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
936
936
|
}
|
|
937
|
-
var
|
|
937
|
+
var An = ({ clientSdk: e6, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
938
938
|
if (!e6) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
939
939
|
return e6.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
940
940
|
}, getAccessToken: () => {
|
|
941
941
|
throw Error(`Not implemented`);
|
|
942
942
|
}, observeState: () => ({ disconnect: () => {
|
|
943
943
|
} }) });
|
|
944
|
-
var
|
|
944
|
+
var jn = Dn({ createHost: function(e6) {
|
|
945
945
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e6?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e6 || {};
|
|
946
946
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
947
|
-
return { channel:
|
|
947
|
+
return { channel: An({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
948
948
|
} };
|
|
949
949
|
} });
|
|
950
|
-
var
|
|
951
|
-
let n2 =
|
|
950
|
+
var Mn = (e6, t2) => {
|
|
951
|
+
let n2 = jn.host({ applicationId: e6, componentId: t2 }), r2 = jn.auth();
|
|
952
952
|
return Ye({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
953
953
|
};
|
|
954
|
-
var
|
|
955
|
-
function
|
|
954
|
+
var Nn = (e6) => Mn(`14bcded7-0066-7c35-14d7-466cb3f09103`, e6);
|
|
955
|
+
function Pn() {
|
|
956
956
|
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
957
957
|
if (e6) return { initWixModules(t3, n3) {
|
|
958
|
-
return
|
|
958
|
+
return Fn(() => e6(t3, n3));
|
|
959
959
|
}, fetchWithAuth() {
|
|
960
960
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
961
961
|
}, graphql() {
|
|
@@ -965,10 +965,10 @@ function Nn() {
|
|
|
965
965
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
966
966
|
if (r2) {
|
|
967
967
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
968
|
-
return
|
|
968
|
+
return Fn(() => n2.use(e7));
|
|
969
969
|
}
|
|
970
970
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
971
|
-
return
|
|
971
|
+
return Fn(() => t2.use(e7));
|
|
972
972
|
}, fetchWithAuth: (e7, n3) => {
|
|
973
973
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
974
974
|
return t2.fetchWithAuth(e7, n3);
|
|
@@ -980,7 +980,7 @@ function Nn() {
|
|
|
980
980
|
return t2.graphql(e7, n3, r2);
|
|
981
981
|
} };
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function Fn(e6) {
|
|
984
984
|
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
985
985
|
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
986
986
|
try {
|
|
@@ -989,17 +989,17 @@ function Pn(e6) {
|
|
|
989
989
|
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function In(e6, t2) {
|
|
993
993
|
return { ...e6, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
994
|
-
let r2 =
|
|
994
|
+
let r2 = Pn();
|
|
995
995
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
996
996
|
return r2.initWixModules(e6)[t3].apply(void 0, n2);
|
|
997
997
|
}])) };
|
|
998
998
|
}
|
|
999
|
-
function
|
|
1000
|
-
return
|
|
999
|
+
function Ln(e6) {
|
|
1000
|
+
return In({ __type: `host`, create: (t2) => Object.entries(e6).reduce((e7, [n2, r2]) => ({ ...e7, [n2]: r2(t2) }), {}) }, Object.keys(e6));
|
|
1001
1001
|
}
|
|
1002
|
-
var
|
|
1002
|
+
var Rn = class {
|
|
1003
1003
|
constructor(e6) {
|
|
1004
1004
|
this.message = e6, this.captureException = () => {
|
|
1005
1005
|
console.error(this.message);
|
|
@@ -1014,13 +1014,13 @@ var Ln = class {
|
|
|
1014
1014
|
};
|
|
1015
1015
|
}
|
|
1016
1016
|
};
|
|
1017
|
-
var
|
|
1018
|
-
var
|
|
1019
|
-
function
|
|
1017
|
+
var zn = (e6) => new Rn(e6);
|
|
1018
|
+
var Bn = Ln({ getMonitoringClient: (e6) => () => e6.getMonitoringClient ? e6.getMonitoringClient() : zn(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
1019
|
+
function Vn(e6) {
|
|
1020
1020
|
let t2 = Promise.resolve(e6);
|
|
1021
1021
|
return t2.status = `fulfilled`, t2.value = e6, t2;
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function Hn(e6) {
|
|
1024
1024
|
if (e6.status === `fulfilled`) return e6.value;
|
|
1025
1025
|
throw e6.status === `rejected` ? e6.reason : (e6.status === `pending` || (e6.status = `pending`, e6.then((t2) => {
|
|
1026
1026
|
e6.status = `fulfilled`, e6.value = t2;
|
|
@@ -1028,17 +1028,17 @@ function Vn(e6) {
|
|
|
1028
1028
|
e6.status = `rejected`, e6.reason = t2;
|
|
1029
1029
|
})), e6);
|
|
1030
1030
|
}
|
|
1031
|
-
var
|
|
1032
|
-
function
|
|
1033
|
-
let r2 =
|
|
1034
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
1031
|
+
var Un = /* @__PURE__ */ new WeakMap();
|
|
1032
|
+
function Wn(e6, t2, n2) {
|
|
1033
|
+
let r2 = Un.get(e6);
|
|
1034
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), Un.set(e6, r2));
|
|
1035
1035
|
let i2 = r2.get(t2);
|
|
1036
1036
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
1037
1037
|
let a2 = i2.get(n2);
|
|
1038
1038
|
if (!a2) {
|
|
1039
|
-
if (e6.status === `fulfilled`) a2 =
|
|
1039
|
+
if (e6.status === `fulfilled`) a2 = Vn(t2(e6.value));
|
|
1040
1040
|
else if (e6.status === `rejected`) try {
|
|
1041
|
-
a2 =
|
|
1041
|
+
a2 = Vn(n2(e6.reason));
|
|
1042
1042
|
} catch {
|
|
1043
1043
|
a2 = e6.then(t2, n2);
|
|
1044
1044
|
}
|
|
@@ -1047,36 +1047,36 @@ function Un(e6, t2, n2) {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
return a2;
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function F(e6) {
|
|
1051
1051
|
return e6;
|
|
1052
1052
|
}
|
|
1053
|
-
var
|
|
1054
|
-
var
|
|
1053
|
+
var Gn = F(`@wix/site-service-rendering-context`);
|
|
1054
|
+
var Kn = () => {
|
|
1055
1055
|
try {
|
|
1056
|
-
return (0, import_services_manager_react.useService)(
|
|
1056
|
+
return (0, import_services_manager_react.useService)(Gn).SSR;
|
|
1057
1057
|
} catch {
|
|
1058
1058
|
return false;
|
|
1059
1059
|
}
|
|
1060
1060
|
};
|
|
1061
|
-
var
|
|
1062
|
-
function
|
|
1061
|
+
var qn = (e6, t2) => e6.length === t2.length && e6.every((e7, n2) => Object.is(e7, t2[n2]));
|
|
1062
|
+
function Jn(e6, t2) {
|
|
1063
1063
|
let [n2, r2] = (0, import_react.useState)(() => ({ deps: t2, value: e6() }));
|
|
1064
1064
|
return (0, import_react.useEffect)(() => {
|
|
1065
|
-
if (
|
|
1065
|
+
if (qn(n2.deps, t2)) return;
|
|
1066
1066
|
let i2 = e6();
|
|
1067
1067
|
(0, import_react.startTransition)(() => r2({ deps: t2, value: i2 }));
|
|
1068
1068
|
}, t2), n2.value;
|
|
1069
1069
|
}
|
|
1070
|
-
var
|
|
1071
|
-
var
|
|
1070
|
+
var Yn = F(`@wix/viewer-service-site-members`);
|
|
1071
|
+
var Xn = () => {
|
|
1072
1072
|
try {
|
|
1073
|
-
return (0, import_services_manager_react.useService)(
|
|
1073
|
+
return (0, import_services_manager_react.useService)(Yn);
|
|
1074
1074
|
} catch {
|
|
1075
1075
|
return;
|
|
1076
1076
|
}
|
|
1077
1077
|
};
|
|
1078
|
-
var
|
|
1079
|
-
let n2 =
|
|
1078
|
+
var Zn = (e6, t2) => {
|
|
1079
|
+
let n2 = Xn(), [r2, i2] = (0, import_react.useState)(), a2 = !!e6.post?.preview;
|
|
1080
1080
|
return (0, import_react.useEffect)(() => {
|
|
1081
1081
|
if (!a2) return;
|
|
1082
1082
|
let e7 = true, r3 = () => {
|
|
@@ -1094,18 +1094,17 @@ var Xn = (e6, t2) => {
|
|
|
1094
1094
|
};
|
|
1095
1095
|
}, [a2, t2, n2]), (0, import_react.useMemo)(() => a2 && r2 && r2._id === e6.post?._id ? { ...e6, post: r2, paywall: void 0 } : e6, [a2, r2, e6]);
|
|
1096
1096
|
};
|
|
1097
|
-
var
|
|
1098
|
-
var
|
|
1099
|
-
var
|
|
1100
|
-
var
|
|
1101
|
-
var
|
|
1102
|
-
var
|
|
1103
|
-
var
|
|
1097
|
+
var Qn = F(`@wix/site-service-url`);
|
|
1098
|
+
var $n = `14bcded7-0066-7c35-14d7-466cb3f09103`;
|
|
1099
|
+
var er = `post`;
|
|
1100
|
+
var tr = `category`;
|
|
1101
|
+
var nr = `builder-post`;
|
|
1102
|
+
var rr = `__blog_unknown_section__`;
|
|
1103
|
+
var ir = (e6) => {
|
|
1104
1104
|
let t2;
|
|
1105
1105
|
try {
|
|
1106
|
-
let n3 = e6.appSectionRelativeUrl(
|
|
1107
|
-
if (n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`,
|
|
1108
|
-
t2 = e6.appSectionRelativeUrl(Qn, tr, true);
|
|
1106
|
+
let n3 = e6.appSectionRelativeUrl($n, nr);
|
|
1107
|
+
if (t2 = e6.appSectionRelativeUrl($n, nr, true), n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`, rr) && !n3?.endsWith(`/post-page`) && t2 === n3) return;
|
|
1109
1108
|
} catch {
|
|
1110
1109
|
return;
|
|
1111
1110
|
}
|
|
@@ -1113,12 +1112,12 @@ var rr = (e6) => {
|
|
|
1113
1112
|
let n2 = t2.split(`/`).filter(Boolean);
|
|
1114
1113
|
return n2[n2.length - 1] === `post-page` && n2.pop(), n2.length > 0 ? n2.join(`/`) : void 0;
|
|
1115
1114
|
};
|
|
1116
|
-
var
|
|
1117
|
-
var
|
|
1118
|
-
let t2 =
|
|
1119
|
-
if (t2 && e6.siteUrl) return `${e6.siteUrl.replace(/\/+$/, ``)}/${
|
|
1115
|
+
var ar = (e6) => `${e6}/${er}`;
|
|
1116
|
+
var or = (e6) => {
|
|
1117
|
+
let t2 = ir(e6);
|
|
1118
|
+
if (t2 && e6.siteUrl) return `${e6.siteUrl.replace(/\/+$/, ``)}/${ar(t2)}`;
|
|
1120
1119
|
};
|
|
1121
|
-
var
|
|
1120
|
+
var sr = (e6, t2) => {
|
|
1122
1121
|
if (!e6 || !t2) return;
|
|
1123
1122
|
let n2;
|
|
1124
1123
|
try {
|
|
@@ -1132,14 +1131,14 @@ var or = (e6, t2) => {
|
|
|
1132
1131
|
if (r2.endsWith(t3) && i2.endsWith(`/post`)) return `${n2.origin}${i2}`;
|
|
1133
1132
|
}
|
|
1134
1133
|
};
|
|
1135
|
-
var
|
|
1134
|
+
var cr = (e6) => {
|
|
1136
1135
|
if (!e6) return;
|
|
1137
1136
|
if (typeof e6 == `string`) return e6;
|
|
1138
1137
|
let { base: t2, path: n2 } = e6;
|
|
1139
1138
|
return t2 ? `${t2.replace(/\/+$/, ``)}${n2 ?? ``}` : void 0;
|
|
1140
1139
|
};
|
|
1141
|
-
var
|
|
1142
|
-
let n2 =
|
|
1140
|
+
var lr = (e6, t2) => {
|
|
1141
|
+
let n2 = cr(e6.url), r2 = `/${er}`;
|
|
1143
1142
|
if (!n2 || !t2?.endsWith(r2)) return;
|
|
1144
1143
|
let i2, a2;
|
|
1145
1144
|
try {
|
|
@@ -1150,41 +1149,41 @@ var cr = (e6, t2) => {
|
|
|
1150
1149
|
let o2 = a2.slice(0, -r2.length);
|
|
1151
1150
|
return o2 && i2.startsWith(`${o2}/`) && !i2.startsWith(`${a2}/`) ? n2 : void 0;
|
|
1152
1151
|
};
|
|
1153
|
-
var
|
|
1154
|
-
let n2 =
|
|
1152
|
+
var ur = (e6, t2) => {
|
|
1153
|
+
let n2 = lr(e6, t2);
|
|
1155
1154
|
if (n2) return { href: n2, target: `_self` };
|
|
1156
1155
|
if (t2 && e6.slug) return { href: `${t2}/${encodeURIComponent(e6.slug)}`, target: `_self` };
|
|
1157
|
-
let r2 =
|
|
1156
|
+
let r2 = cr(e6.url);
|
|
1158
1157
|
return r2 ? { href: r2, target: `_self` } : void 0;
|
|
1159
1158
|
};
|
|
1160
|
-
var
|
|
1161
|
-
let n2 =
|
|
1159
|
+
var dr = (e6, t2) => {
|
|
1160
|
+
let n2 = ir(e6);
|
|
1162
1161
|
if (n2 && e6.siteUrl) return `${e6.siteUrl.replace(/\/+$/, ``)}/${n2}/${t2}`;
|
|
1163
1162
|
};
|
|
1164
|
-
var
|
|
1163
|
+
var fr = (e6) => {
|
|
1165
1164
|
let t2;
|
|
1166
1165
|
try {
|
|
1167
|
-
t2 = (0, import_services_manager_react.useService)(
|
|
1166
|
+
t2 = (0, import_services_manager_react.useService)(Qn);
|
|
1168
1167
|
} catch {
|
|
1169
1168
|
return;
|
|
1170
1169
|
}
|
|
1171
|
-
return
|
|
1170
|
+
return or(t2) ?? sr(t2.currentUrl, e6);
|
|
1172
1171
|
};
|
|
1173
|
-
var
|
|
1174
|
-
var
|
|
1175
|
-
var
|
|
1172
|
+
var pr = { categoryHeader: `WixBlog.CategoryHeader`, coverMedia: `WixBlog.PostCoverMedia`, postActions: `WixBlog.PostActionBar`, postCategories: `WixBlog.PostCategoryList`, postCounters: `WixBlog.PostCounterBar`, postMetadata: `WixBlog.PostMetadataBar`, postTags: `WixBlog.PostTagList`, feedProvider: `WixBlog.BlogFeedContextProvider`, postBySlugProvider: `WixBlog.PostBySlugContextProvider`, postByIdProvider: `WixBlog.PostByIdContextProvider`, relatedPostsProvider: `WixBlog.RelatedPostsContextProvider` };
|
|
1173
|
+
var mr = (e6) => `${e6} rendered`;
|
|
1174
|
+
var hr = (e6, t2, n2) => {
|
|
1176
1175
|
(0, import_react.useEffect)(() => {
|
|
1177
1176
|
if (t2 !== `loading` && typeof performance < `u` && typeof performance.mark == `function`) try {
|
|
1178
|
-
performance.mark(
|
|
1177
|
+
performance.mark(mr(e6), { detail: { state: t2, compId: n2 } });
|
|
1179
1178
|
} catch {
|
|
1180
1179
|
}
|
|
1181
1180
|
}, [e6, t2, n2]);
|
|
1182
1181
|
};
|
|
1183
|
-
var
|
|
1184
|
-
function
|
|
1185
|
-
let e6 =
|
|
1182
|
+
var gr = F(`@wix/site-service-warmup-data`);
|
|
1183
|
+
function _r() {
|
|
1184
|
+
let e6 = Kn(), t2 = null;
|
|
1186
1185
|
try {
|
|
1187
|
-
t2 = (0, import_services_manager_react.useGetService)()(
|
|
1186
|
+
t2 = (0, import_services_manager_react.useGetService)()(gr);
|
|
1188
1187
|
} catch {
|
|
1189
1188
|
}
|
|
1190
1189
|
return (0, import_react.useMemo)(() => ({ isServer: e6, scope: t2 ?? void 0, get: async (n2) => {
|
|
@@ -1201,13 +1200,13 @@ function gr() {
|
|
|
1201
1200
|
}
|
|
1202
1201
|
} }), [e6, t2]);
|
|
1203
1202
|
}
|
|
1204
|
-
var
|
|
1203
|
+
var vr = () => {
|
|
1205
1204
|
let e6 = /* @__PURE__ */ new Map();
|
|
1206
1205
|
return { getOrInsert: (t2, n2) => (e6.has(t2) || e6.set(t2, n2().finally(() => {
|
|
1207
1206
|
e6.delete(t2);
|
|
1208
1207
|
})), e6.get(t2)) };
|
|
1209
1208
|
};
|
|
1210
|
-
var
|
|
1209
|
+
var yr = async (e6) => {
|
|
1211
1210
|
try {
|
|
1212
1211
|
let { default: t2 } = await e6();
|
|
1213
1212
|
return t2;
|
|
@@ -1215,9 +1214,9 @@ var vr = async (e6) => {
|
|
|
1215
1214
|
return;
|
|
1216
1215
|
}
|
|
1217
1216
|
};
|
|
1218
|
-
var
|
|
1219
|
-
let r2 =
|
|
1220
|
-
let [i3, a2] = await Promise.all([
|
|
1217
|
+
var br = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
1218
|
+
let r2 = vr(), i2 = async (r3) => {
|
|
1219
|
+
let [i3, a2] = await Promise.all([yr(() => t2(r3)), !e6 || !n2 ? void 0 : yr(() => n2(r3))]);
|
|
1221
1220
|
if (i3 && a2) return { ...i3, ...a2 };
|
|
1222
1221
|
if (i3) return i3;
|
|
1223
1222
|
if (a2) return a2;
|
|
@@ -1225,61 +1224,61 @@ var yr = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
|
1225
1224
|
};
|
|
1226
1225
|
return (e7) => r2.getOrInsert(e7, () => i2(e7));
|
|
1227
1226
|
};
|
|
1228
|
-
var
|
|
1229
|
-
var
|
|
1227
|
+
var I = (e6) => typeof e6 == `string`;
|
|
1228
|
+
var L = () => {
|
|
1230
1229
|
let e6, t2, n2 = new Promise((n3, r2) => {
|
|
1231
1230
|
e6 = n3, t2 = r2;
|
|
1232
1231
|
});
|
|
1233
1232
|
return n2.resolve = e6, n2.reject = t2, n2;
|
|
1234
1233
|
};
|
|
1235
|
-
var
|
|
1236
|
-
var
|
|
1234
|
+
var xr = (e6) => e6 == null ? `` : String(e6);
|
|
1235
|
+
var Sr = (e6, t2, n2) => {
|
|
1237
1236
|
e6.forEach((e7) => {
|
|
1238
1237
|
t2[e7] && (n2[e7] = t2[e7]);
|
|
1239
1238
|
});
|
|
1240
1239
|
};
|
|
1241
|
-
var
|
|
1242
|
-
var
|
|
1243
|
-
var
|
|
1244
|
-
var
|
|
1245
|
-
let r2 =
|
|
1240
|
+
var Cr = /###/g;
|
|
1241
|
+
var wr = (e6) => e6 && e6.includes(`###`) ? e6.replace(Cr, `.`) : e6;
|
|
1242
|
+
var Tr = (e6) => !e6 || I(e6);
|
|
1243
|
+
var R = (e6, t2, n2) => {
|
|
1244
|
+
let r2 = I(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1246
1245
|
for (; i2 < r2.length - 1; ) {
|
|
1247
|
-
if (
|
|
1248
|
-
let t3 =
|
|
1246
|
+
if (Tr(e6)) return {};
|
|
1247
|
+
let t3 = wr(r2[i2]);
|
|
1249
1248
|
!e6[t3] && n2 && (e6[t3] = new n2()), e6 = Object.prototype.hasOwnProperty.call(e6, t3) ? e6[t3] : {}, ++i2;
|
|
1250
1249
|
}
|
|
1251
|
-
return
|
|
1250
|
+
return Tr(e6) ? {} : { obj: e6, k: wr(r2[i2]) };
|
|
1252
1251
|
};
|
|
1253
|
-
var
|
|
1254
|
-
let { obj: r2, k: i2 } =
|
|
1252
|
+
var Er = (e6, t2, n2) => {
|
|
1253
|
+
let { obj: r2, k: i2 } = R(e6, t2, Object);
|
|
1255
1254
|
if (r2 !== void 0 || t2.length === 1) {
|
|
1256
1255
|
r2[i2] = n2;
|
|
1257
1256
|
return;
|
|
1258
1257
|
}
|
|
1259
|
-
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 =
|
|
1260
|
-
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 =
|
|
1258
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = R(e6, o2, Object);
|
|
1259
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = R(e6, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1261
1260
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1262
1261
|
};
|
|
1263
|
-
var
|
|
1264
|
-
let { obj: i2, k: a2 } =
|
|
1262
|
+
var Dr = (e6, t2, n2, r2) => {
|
|
1263
|
+
let { obj: i2, k: a2 } = R(e6, t2, Object);
|
|
1265
1264
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1266
1265
|
};
|
|
1267
|
-
var
|
|
1268
|
-
let { obj: n2, k: r2 } =
|
|
1266
|
+
var Or = (e6, t2) => {
|
|
1267
|
+
let { obj: n2, k: r2 } = R(e6, t2);
|
|
1269
1268
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1270
1269
|
};
|
|
1271
|
-
var Or = (e6, t2, n2) => {
|
|
1272
|
-
let r2 = Dr(e6, n2);
|
|
1273
|
-
return r2 === void 0 ? Dr(t2, n2) : r2;
|
|
1274
|
-
};
|
|
1275
1270
|
var kr = (e6, t2, n2) => {
|
|
1276
|
-
|
|
1271
|
+
let r2 = Or(e6, n2);
|
|
1272
|
+
return r2 === void 0 ? Or(t2, n2) : r2;
|
|
1273
|
+
};
|
|
1274
|
+
var Ar = (e6, t2, n2) => {
|
|
1275
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ? I(e6[r2]) || e6[r2] instanceof String || I(t2[r2]) || t2[r2] instanceof String ? n2 && (e6[r2] = t2[r2]) : Ar(e6[r2], t2[r2], n2) : e6[r2] = t2[r2]);
|
|
1277
1276
|
return e6;
|
|
1278
1277
|
};
|
|
1279
|
-
var
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1282
|
-
var
|
|
1278
|
+
var z = (e6) => e6.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1279
|
+
var jr = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1280
|
+
var Mr = (e6) => I(e6) ? e6.replace(/[&<>"'\/]/g, (e7) => jr[e7]) : e6;
|
|
1281
|
+
var Nr = class {
|
|
1283
1282
|
constructor(e6) {
|
|
1284
1283
|
this.capacity = e6, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1285
1284
|
}
|
|
@@ -1290,20 +1289,20 @@ var Mr = class {
|
|
|
1290
1289
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e6, n2), this.regExpQueue.push(e6), n2;
|
|
1291
1290
|
}
|
|
1292
1291
|
};
|
|
1293
|
-
var
|
|
1294
|
-
var
|
|
1295
|
-
var
|
|
1292
|
+
var Pr = [` `, `,`, `?`, `!`, `;`];
|
|
1293
|
+
var Fr = new Nr(20);
|
|
1294
|
+
var Ir = (e6, t2, n2) => {
|
|
1296
1295
|
t2 ||= ``, n2 ||= ``;
|
|
1297
|
-
let r2 =
|
|
1296
|
+
let r2 = Pr.filter((e7) => !t2.includes(e7) && !n2.includes(e7));
|
|
1298
1297
|
if (r2.length === 0) return true;
|
|
1299
|
-
let i2 =
|
|
1298
|
+
let i2 = Fr.getRegExp(`(${r2.map((e7) => e7 === `?` ? `\\?` : e7).join(`|`)})`), a2 = !i2.test(e6);
|
|
1300
1299
|
if (!a2) {
|
|
1301
1300
|
let t3 = e6.indexOf(n2);
|
|
1302
1301
|
t3 > 0 && !i2.test(e6.substring(0, t3)) && (a2 = true);
|
|
1303
1302
|
}
|
|
1304
1303
|
return a2;
|
|
1305
1304
|
};
|
|
1306
|
-
var
|
|
1305
|
+
var Lr = (e6, t2, n2 = `.`) => {
|
|
1307
1306
|
if (!e6) return;
|
|
1308
1307
|
if (e6[t2]) return Object.prototype.hasOwnProperty.call(e6, t2) ? e6[t2] : void 0;
|
|
1309
1308
|
let r2 = t2.split(n2), i2 = e6;
|
|
@@ -1319,8 +1318,8 @@ var Ir = (e6, t2, n2 = `.`) => {
|
|
|
1319
1318
|
}
|
|
1320
1319
|
return i2;
|
|
1321
1320
|
};
|
|
1322
|
-
var
|
|
1323
|
-
var
|
|
1321
|
+
var B = (e6) => e6?.replace(/_/g, `-`);
|
|
1322
|
+
var Rr = { type: `logger`, log(e6) {
|
|
1324
1323
|
this.output(`log`, e6);
|
|
1325
1324
|
}, warn(e6) {
|
|
1326
1325
|
this.output(`warn`, e6);
|
|
@@ -1329,12 +1328,12 @@ var Lr = { type: `logger`, log(e6) {
|
|
|
1329
1328
|
}, output(e6, t2) {
|
|
1330
1329
|
console?.[e6]?.apply?.(console, t2);
|
|
1331
1330
|
} };
|
|
1332
|
-
var
|
|
1331
|
+
var V = new class e2 {
|
|
1333
1332
|
constructor(e6, t2 = {}) {
|
|
1334
1333
|
this.init(e6, t2);
|
|
1335
1334
|
}
|
|
1336
1335
|
init(e6, t2 = {}) {
|
|
1337
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e6 ||
|
|
1336
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e6 || Rr, this.options = t2, this.debug = t2.debug;
|
|
1338
1337
|
}
|
|
1339
1338
|
log(...e6) {
|
|
1340
1339
|
return this.forward(e6, `log`, ``, true);
|
|
@@ -1349,7 +1348,7 @@ var H = new class e2 {
|
|
|
1349
1348
|
return this.forward(e6, `warn`, `WARNING DEPRECATED: `, true);
|
|
1350
1349
|
}
|
|
1351
1350
|
forward(e6, t2, n2, r2) {
|
|
1352
|
-
return r2 && !this.debug ? null : (e6 = e6.map((e7) =>
|
|
1351
|
+
return r2 && !this.debug ? null : (e6 = e6.map((e7) => I(e7) ? e7.replace(/[\r\n\x00-\x1F\x7F]/g, ` `) : e7), I(e6[0]) && (e6[0] = `${n2}${this.prefix} ${e6[0]}`), this.logger[t2](e6));
|
|
1353
1352
|
}
|
|
1354
1353
|
create(t2) {
|
|
1355
1354
|
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
@@ -1358,7 +1357,7 @@ var H = new class e2 {
|
|
|
1358
1357
|
return t2 ||= this.options, t2.prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
|
|
1359
1358
|
}
|
|
1360
1359
|
}();
|
|
1361
|
-
var
|
|
1360
|
+
var zr = class {
|
|
1362
1361
|
constructor() {
|
|
1363
1362
|
this.observers = {};
|
|
1364
1363
|
}
|
|
@@ -1386,8 +1385,8 @@ var Rr = class {
|
|
|
1386
1385
|
});
|
|
1387
1386
|
}
|
|
1388
1387
|
};
|
|
1389
|
-
var
|
|
1390
|
-
var
|
|
1388
|
+
var Br = /* @__PURE__ */ new WeakSet();
|
|
1389
|
+
var Vr = class extends zr {
|
|
1391
1390
|
constructor(e6, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1392
1391
|
super(), this.data = e6 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1393
1392
|
}
|
|
@@ -1400,23 +1399,23 @@ var Br = class extends Rr {
|
|
|
1400
1399
|
}
|
|
1401
1400
|
getResource(e6, t2, n2, r2 = {}) {
|
|
1402
1401
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1403
|
-
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) :
|
|
1404
|
-
let s2 =
|
|
1405
|
-
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !
|
|
1402
|
+
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : I(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1403
|
+
let s2 = Or(this.data, o2);
|
|
1404
|
+
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !I(n2) ? s2 : Lr(this.data?.[e6]?.[t2], n2, i2);
|
|
1406
1405
|
}
|
|
1407
1406
|
addResource(e6, t2, n2, r2, i2 = { silent: false }) {
|
|
1408
1407
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e6, t2];
|
|
1409
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1408
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Er(this.data, o2, r2), i2.silent || this.emit(`added`, e6, t2, n2, r2);
|
|
1410
1409
|
}
|
|
1411
1410
|
addResources(e6, t2, n2, r2 = { silent: false }) {
|
|
1412
|
-
for (let r3 in n2) (
|
|
1411
|
+
for (let r3 in n2) (I(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e6, t2, r3, n2[r3], { silent: true });
|
|
1413
1412
|
r2.silent || this.emit(`added`, e6, t2, n2);
|
|
1414
1413
|
}
|
|
1415
1414
|
addResourceBundle(e6, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
1416
1415
|
let o2 = [e6, t2];
|
|
1417
1416
|
e6.includes(`.`) && (o2 = e6.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1418
|
-
let s2 =
|
|
1419
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1417
|
+
let s2 = Or(this.data, o2) || {};
|
|
1418
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Ar(s2, n2, i2) : s2 = { ...s2, ...n2 }, Er(this.data, o2, s2), a2.silent || this.emit(`added`, e6, t2, n2);
|
|
1420
1419
|
}
|
|
1421
1420
|
removeResourceBundle(e6, t2) {
|
|
1422
1421
|
this.hasResourceBundle(e6, t2) && delete this.data[e6][t2], this.removeNamespaces(t2), this.emit(`removed`, e6, t2);
|
|
@@ -1434,37 +1433,37 @@ var Br = class extends Rr {
|
|
|
1434
1433
|
let t2 = this.getDataByLanguage(e6);
|
|
1435
1434
|
return !!(t2 && Object.keys(t2) || []).find((e7) => {
|
|
1436
1435
|
let n2 = t2[e7];
|
|
1437
|
-
return
|
|
1436
|
+
return Br.has(n2) ? true : !n2 || Object.keys(n2).length === 0 ? false : (typeof n2 == `object` && Br.add(n2), true);
|
|
1438
1437
|
});
|
|
1439
1438
|
}
|
|
1440
1439
|
toJSON() {
|
|
1441
1440
|
return this.data;
|
|
1442
1441
|
}
|
|
1443
1442
|
};
|
|
1444
|
-
var
|
|
1443
|
+
var Hr = { processors: {}, addPostProcessor(e6) {
|
|
1445
1444
|
this.processors[e6.name] = e6;
|
|
1446
1445
|
}, handle(e6, t2, n2, r2, i2) {
|
|
1447
1446
|
return e6.forEach((e7) => {
|
|
1448
1447
|
t2 = this.processors[e7]?.process(t2, n2, r2, i2) ?? t2;
|
|
1449
1448
|
}), t2;
|
|
1450
1449
|
} };
|
|
1451
|
-
var
|
|
1452
|
-
function
|
|
1450
|
+
var Ur = Symbol(`i18next/PATH_KEY`);
|
|
1451
|
+
function Wr() {
|
|
1453
1452
|
let e6 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1454
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1453
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Ur ? e6 : (e6.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1455
1454
|
}
|
|
1456
|
-
function
|
|
1457
|
-
let { [
|
|
1455
|
+
function H(e6, t2) {
|
|
1456
|
+
let { [Ur]: n2 } = e6(Wr()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`, a2 = t2?.enableSelector === `strict`;
|
|
1458
1457
|
if (n2.length > 1 && i2) {
|
|
1459
1458
|
let e7 = t2?.ns, o2 = a2 ? Array.isArray(e7) ? e7 : e7 ? [e7] : null : Array.isArray(e7) ? e7 : null;
|
|
1460
1459
|
if (o2 && (a2 ? o2 : o2.length > 1 ? o2.slice(1) : []).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1461
1460
|
}
|
|
1462
1461
|
return n2.join(r2);
|
|
1463
1462
|
}
|
|
1464
|
-
var
|
|
1465
|
-
var
|
|
1463
|
+
var Gr = (e6) => !I(e6) && typeof e6 != `boolean` && typeof e6 != `number`;
|
|
1464
|
+
var Kr = class e3 extends zr {
|
|
1466
1465
|
constructor(e6, t2 = {}) {
|
|
1467
|
-
super(),
|
|
1466
|
+
super(), Sr([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = V.create(`translator`), this.checkedLoadedFor = {};
|
|
1468
1467
|
}
|
|
1469
1468
|
changeLanguage(e6) {
|
|
1470
1469
|
e6 && (this.language = e6);
|
|
@@ -1474,33 +1473,33 @@ var Gr = class e3 extends Rr {
|
|
|
1474
1473
|
if (e6 == null) return false;
|
|
1475
1474
|
let r2 = this.resolve(e6, n2);
|
|
1476
1475
|
if (r2?.res === void 0) return false;
|
|
1477
|
-
let i2 =
|
|
1476
|
+
let i2 = Gr(r2.res);
|
|
1478
1477
|
return !(n2.returnObjects === false && i2);
|
|
1479
1478
|
}
|
|
1480
1479
|
extractFromKey(e6, t2) {
|
|
1481
1480
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1482
1481
|
n2 === void 0 && (n2 = `:`);
|
|
1483
|
-
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e6.includes(n2), o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !
|
|
1482
|
+
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e6.includes(n2), o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !Ir(e6, n2, r2);
|
|
1484
1483
|
if (a2 && !o2) {
|
|
1485
1484
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1486
|
-
if (t3 && t3.length > 0) return { key: e6, namespaces:
|
|
1485
|
+
if (t3 && t3.length > 0) return { key: e6, namespaces: I(i2) ? [i2] : i2 };
|
|
1487
1486
|
let a3 = e6.split(n2);
|
|
1488
1487
|
(n2 !== r2 || n2 === r2 && this.options.ns.includes(a3[0])) && (i2 = a3.shift()), e6 = a3.join(r2);
|
|
1489
1488
|
}
|
|
1490
|
-
return { key: e6, namespaces:
|
|
1489
|
+
return { key: e6, namespaces: I(i2) ? [i2] : i2 };
|
|
1491
1490
|
}
|
|
1492
1491
|
translate(t2, n2, r2) {
|
|
1493
1492
|
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1494
1493
|
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1495
|
-
typeof t2 == `function` && (t2 =
|
|
1494
|
+
typeof t2 == `function` && (t2 = H(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e6) => typeof e6 == `function` ? H(e6, { ...this.options, ...i2 }) : String(e6));
|
|
1496
1495
|
let a2 = i2.returnDetails === void 0 ? this.options.returnDetails : i2.returnDetails, o2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, { key: s2, namespaces: c2 } = this.extractFromKey(t2[t2.length - 1], i2), l2 = c2[c2.length - 1], u2 = i2.nsSeparator === void 0 ? this.options.nsSeparator : i2.nsSeparator;
|
|
1497
1496
|
u2 === void 0 && (u2 = `:`);
|
|
1498
1497
|
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1499
1498
|
if (d2?.toLowerCase() === `cimode`) return f2 ? a2 ? { res: `${l2}${u2}${s2}`, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : `${l2}${u2}${s2}` : a2 ? { res: s2, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : s2;
|
|
1500
|
-
let p2 = this.resolve(t2, i2), m2 = p2?.res, h2 = p2?.usedKey || s2, g2 = p2?.exactUsedKey || s2, _2 = [`[object Number]`, `[object Function]`, `[object RegExp]`], v2 = i2.joinArrays === void 0 ? this.options.joinArrays : i2.joinArrays, y2 = !this.i18nFormat || this.i18nFormat.handleAsObject, b2 = i2.count !== void 0 && !
|
|
1499
|
+
let p2 = this.resolve(t2, i2), m2 = p2?.res, h2 = p2?.usedKey || s2, g2 = p2?.exactUsedKey || s2, _2 = [`[object Number]`, `[object Function]`, `[object RegExp]`], v2 = i2.joinArrays === void 0 ? this.options.joinArrays : i2.joinArrays, y2 = !this.i18nFormat || this.i18nFormat.handleAsObject, b2 = i2.count !== void 0 && !I(i2.count), x2 = e3.hasDefaultValue(i2), S2 = b2 ? this.pluralResolver.getSuffix(d2, i2.count, i2) : ``, C2 = i2.ordinal && b2 ? this.pluralResolver.getSuffix(d2, i2.count, { ordinal: false }) : ``, ee2 = b2 && !i2.ordinal && i2.count === 0, w2 = ee2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${S2}`] || i2[`defaultValue${C2}`] || i2.defaultValue, T2 = m2;
|
|
1501
1500
|
y2 && !m2 && x2 && (T2 = w2);
|
|
1502
|
-
let te2 =
|
|
1503
|
-
if (y2 && T2 && te2 && !_2.includes(ne2) && !(
|
|
1501
|
+
let te2 = Gr(T2), ne2 = Object.prototype.toString.apply(T2);
|
|
1502
|
+
if (y2 && T2 && te2 && !_2.includes(ne2) && !(I(v2) && Array.isArray(T2))) {
|
|
1504
1503
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1505
1504
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1506
1505
|
let e6 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, T2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
@@ -1510,11 +1509,11 @@ var Gr = class e3 extends Rr {
|
|
|
1510
1509
|
let e6 = Array.isArray(T2), t3 = e6 ? [] : {}, n3 = e6 ? g2 : h2;
|
|
1511
1510
|
for (let e7 in T2) if (Object.prototype.hasOwnProperty.call(T2, e7)) {
|
|
1512
1511
|
let r3 = `${n3}${o2}${e7}`;
|
|
1513
|
-
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue:
|
|
1512
|
+
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: Gr(w2) ? w2[e7] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e7] === r3 && (t3[e7] = T2[e7]);
|
|
1514
1513
|
}
|
|
1515
1514
|
m2 = t3;
|
|
1516
1515
|
}
|
|
1517
|
-
} else if (y2 &&
|
|
1516
|
+
} else if (y2 && I(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1518
1517
|
else {
|
|
1519
1518
|
let e6 = false, n3 = false;
|
|
1520
1519
|
!this.isValidLookup(m2) && x2 && (e6 = true, m2 = w2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
@@ -1546,30 +1545,30 @@ var Gr = class e3 extends Rr {
|
|
|
1546
1545
|
if (this.i18nFormat?.parse) e6 = this.i18nFormat.parse(e6, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
|
|
1547
1546
|
else if (!n2.skipInterpolation) {
|
|
1548
1547
|
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1549
|
-
let a3 =
|
|
1548
|
+
let a3 = I(e6) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1550
1549
|
if (a3) {
|
|
1551
1550
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1552
1551
|
o3 = t3 && t3.length;
|
|
1553
1552
|
}
|
|
1554
|
-
let s2 = n2.replace && !
|
|
1553
|
+
let s2 = n2.replace && !I(n2.replace) ? n2.replace : n2;
|
|
1555
1554
|
if (this.options.interpolation.defaultVariables && (s2 = { ...this.options.interpolation.defaultVariables, ...s2 }), e6 = this.interpolator.interpolate(e6, s2, n2.lng || this.language || r2.usedLng, n2), a3) {
|
|
1556
1555
|
let t3 = e6.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1557
1556
|
o3 < r3 && (n2.nest = false);
|
|
1558
1557
|
}
|
|
1559
1558
|
!n2.lng && r2 && r2.res && (n2.lng = this.language || r2.usedLng), n2.nest !== false && (e6 = this.interpolator.nest(e6, (...e7) => i2?.[0] === e7[0] && !n2.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e7[0]} in key: ${t2[0]}`), null) : this.translate(...e7, t2), n2)), n2.interpolation && this.interpolator.reset();
|
|
1560
1559
|
}
|
|
1561
|
-
let a2 = n2.postProcess || this.options.postProcess, o2 =
|
|
1562
|
-
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 =
|
|
1560
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = I(a2) ? [a2] : a2;
|
|
1561
|
+
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 = Hr.handle(o2, e6, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e6;
|
|
1563
1562
|
}
|
|
1564
1563
|
resolve(e6, t2 = {}) {
|
|
1565
1564
|
let n2, r2, i2, a2, o2;
|
|
1566
|
-
return
|
|
1565
|
+
return I(e6) && (e6 = [e6]), Array.isArray(e6) && (e6 = e6.map((e7) => typeof e7 == `function` ? H(e7, { ...this.options, ...t2 }) : e7)), e6.forEach((e7) => {
|
|
1567
1566
|
if (this.isValidLookup(n2)) return;
|
|
1568
1567
|
let s2 = this.extractFromKey(e7, t2), c2 = s2.key;
|
|
1569
1568
|
r2 = c2;
|
|
1570
1569
|
let l2 = s2.namespaces;
|
|
1571
1570
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1572
|
-
let u2 = t2.count !== void 0 && !
|
|
1571
|
+
let u2 = t2.count !== void 0 && !I(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (I(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1573
1572
|
l2.forEach((e8) => {
|
|
1574
1573
|
this.isValidLookup(n2) || (o2 = e8, !this.checkedLoadedFor[`${p2[0]}-${e8}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (this.checkedLoadedFor[`${p2[0]}-${e8}`] = true, this.logger.warn(`key "${r2}" for languages "${p2.join(`, `)}" won't get resolved as namespace "${o2}" 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!!!`)), p2.forEach((r3) => {
|
|
1575
1574
|
if (this.isValidLookup(n2)) return;
|
|
@@ -1598,7 +1597,7 @@ var Gr = class e3 extends Rr {
|
|
|
1598
1597
|
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e6, t2, n2, r2) : this.resourceStore.getResource(e6, t2, n2, r2);
|
|
1599
1598
|
}
|
|
1600
1599
|
getUsedParamsDetails(e6 = {}) {
|
|
1601
|
-
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !
|
|
1600
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !I(e6.replace), r2 = n2 ? e6.replace : e6;
|
|
1602
1601
|
if (n2 && e6.count !== void 0 && (r2 = { ...r2, count: e6.count }), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1603
1602
|
r2 = { ...r2 };
|
|
1604
1603
|
for (let e7 of t2) delete r2[e7];
|
|
@@ -1610,25 +1609,25 @@ var Gr = class e3 extends Rr {
|
|
|
1610
1609
|
return false;
|
|
1611
1610
|
}
|
|
1612
1611
|
};
|
|
1613
|
-
var
|
|
1612
|
+
var qr = class {
|
|
1614
1613
|
constructor(e6) {
|
|
1615
|
-
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger =
|
|
1614
|
+
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger = V.create(`languageUtils`), this.resolveHierarchyCache = {};
|
|
1616
1615
|
}
|
|
1617
1616
|
clearCache() {
|
|
1618
1617
|
this.resolveHierarchyCache = {};
|
|
1619
1618
|
}
|
|
1620
1619
|
getScriptPartFromCode(e6) {
|
|
1621
|
-
if (e6 =
|
|
1620
|
+
if (e6 = B(e6), !e6 || !e6.includes(`-`)) return null;
|
|
1622
1621
|
let t2 = e6.split(`-`);
|
|
1623
1622
|
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1624
1623
|
}
|
|
1625
1624
|
getLanguagePartFromCode(e6) {
|
|
1626
|
-
if (e6 =
|
|
1625
|
+
if (e6 = B(e6), !e6 || !e6.includes(`-`)) return e6;
|
|
1627
1626
|
let t2 = e6.split(`-`);
|
|
1628
1627
|
return this.formatLanguageCode(t2[0]);
|
|
1629
1628
|
}
|
|
1630
1629
|
formatLanguageCode(e6) {
|
|
1631
|
-
if (
|
|
1630
|
+
if (I(e6) && e6.includes(`-`)) {
|
|
1632
1631
|
let t2;
|
|
1633
1632
|
try {
|
|
1634
1633
|
t2 = Intl.getCanonicalLocales(e6)[0];
|
|
@@ -1659,7 +1658,7 @@ var Kr = class {
|
|
|
1659
1658
|
}
|
|
1660
1659
|
getFallbackCodes(e6, t2) {
|
|
1661
1660
|
if (!e6) return [];
|
|
1662
|
-
if (typeof e6 == `function` && (e6 = e6(t2)),
|
|
1661
|
+
if (typeof e6 == `function` && (e6 = e6(t2)), I(e6) && (e6 = [e6]), Array.isArray(e6)) return e6;
|
|
1663
1662
|
if (!t2) return e6.default || [];
|
|
1664
1663
|
let n2 = e6[t2];
|
|
1665
1664
|
return n2 ||= e6[this.getScriptPartFromCode(t2)], n2 ||= e6[this.formatLanguageCode(t2)], n2 ||= e6[this.getLanguagePartFromCode(t2)], n2 ||= e6.default, n2 || [];
|
|
@@ -1667,7 +1666,7 @@ var Kr = class {
|
|
|
1667
1666
|
toResolveHierarchy(e6, t2) {
|
|
1668
1667
|
let n2 = this.options.fallbackLng, r2 = Array.isArray(n2) ? n2.join(`|`) : n2;
|
|
1669
1668
|
r2 !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r2);
|
|
1670
|
-
let i2 = t2 === void 0 || t2 === false ||
|
|
1669
|
+
let i2 = t2 === void 0 || t2 === false || I(t2), a2 = t2 === void 0 && typeof this.options.fallbackLng == `function`, o2 = I(e6) && i2 && !a2, s2 = null;
|
|
1671
1670
|
if (o2) {
|
|
1672
1671
|
let n3;
|
|
1673
1672
|
n3 = t2 === void 0 ? `undefined` : t2 === false ? `boolean:false` : `string:${t2}`, s2 = `${e6.length}:${e6}|${n3}`;
|
|
@@ -1679,30 +1678,30 @@ var Kr = class {
|
|
|
1679
1678
|
let c2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e6), l2 = [], u2 = (e7) => {
|
|
1680
1679
|
e7 && (this.isSupportedCode(e7) ? l2.push(e7) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e7}`));
|
|
1681
1680
|
};
|
|
1682
|
-
return
|
|
1681
|
+
return I(e6) && (e6.includes(`-`) || e6.includes(`_`)) ? (this.options.load !== `languageOnly` && u2(this.formatLanguageCode(e6)), this.options.load !== `languageOnly` && this.options.load !== `currentOnly` && u2(this.getScriptPartFromCode(e6)), this.options.load !== `currentOnly` && u2(this.getLanguagePartFromCode(e6))) : I(e6) && u2(this.formatLanguageCode(e6)), c2.forEach((e7) => {
|
|
1683
1682
|
let t3 = this.formatLanguageCode(e7);
|
|
1684
1683
|
l2.includes(t3) || u2(t3);
|
|
1685
1684
|
}), s2 === null ? l2 : (this.resolveHierarchyCache[s2] = l2, l2.slice());
|
|
1686
1685
|
}
|
|
1687
1686
|
};
|
|
1688
|
-
var
|
|
1689
|
-
var
|
|
1690
|
-
var
|
|
1687
|
+
var Jr = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
1688
|
+
var Yr = { select: (e6) => e6 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1689
|
+
var Xr = class {
|
|
1691
1690
|
constructor(e6, t2 = {}) {
|
|
1692
|
-
this.languageUtils = e6, this.options = t2, this.logger =
|
|
1691
|
+
this.languageUtils = e6, this.options = t2, this.logger = V.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1693
1692
|
}
|
|
1694
1693
|
clearCache() {
|
|
1695
1694
|
this.pluralRulesCache = {};
|
|
1696
1695
|
}
|
|
1697
1696
|
getRule(e6, t2 = {}) {
|
|
1698
|
-
let n2 =
|
|
1697
|
+
let n2 = B(e6 === `dev` ? `en` : e6), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1699
1698
|
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1700
1699
|
let a2;
|
|
1701
1700
|
try {
|
|
1702
1701
|
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
1703
1702
|
} catch {
|
|
1704
|
-
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`),
|
|
1705
|
-
if (!e6.match(/-|_/)) return
|
|
1703
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), Yr;
|
|
1704
|
+
if (!e6.match(/-|_/)) return Yr;
|
|
1706
1705
|
let n3 = this.languageUtils.getLanguagePartFromCode(e6);
|
|
1707
1706
|
a2 = this.getRule(n3, t2);
|
|
1708
1707
|
}
|
|
@@ -1717,26 +1716,26 @@ var Yr = class {
|
|
|
1717
1716
|
}
|
|
1718
1717
|
getSuffixes(e6, t2 = {}) {
|
|
1719
1718
|
let n2 = this.getRule(e6, t2);
|
|
1720
|
-
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) =>
|
|
1719
|
+
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) => Jr[e7] - Jr[t3]).map((e7) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ``}${e7}`) : [];
|
|
1721
1720
|
}
|
|
1722
1721
|
getSuffix(e6, t2, n2 = {}) {
|
|
1723
1722
|
let r2 = this.getRule(e6, n2);
|
|
1724
1723
|
return r2 ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ``}${r2.select(t2)}` : (this.logger.warn(`no plural rule found for: ${e6}`), this.getSuffix(`dev`, t2, n2));
|
|
1725
1724
|
}
|
|
1726
1725
|
};
|
|
1727
|
-
var
|
|
1728
|
-
let a2 =
|
|
1729
|
-
return !a2 && i2 &&
|
|
1726
|
+
var Zr = (e6, t2, n2, r2 = `.`, i2 = true) => {
|
|
1727
|
+
let a2 = kr(e6, t2, n2);
|
|
1728
|
+
return !a2 && i2 && I(n2) && (a2 = Lr(e6, n2, r2), a2 === void 0 && (a2 = Lr(t2, n2, r2))), a2;
|
|
1730
1729
|
};
|
|
1731
|
-
var
|
|
1732
|
-
var
|
|
1730
|
+
var Qr = (e6) => e6.replace(/\$/g, `$$$$`);
|
|
1731
|
+
var $r = class {
|
|
1733
1732
|
constructor(e6 = {}) {
|
|
1734
|
-
this.logger =
|
|
1733
|
+
this.logger = V.create(`interpolator`), this.options = e6, this.format = e6?.interpolation?.format || ((e7) => e7), this.init(e6);
|
|
1735
1734
|
}
|
|
1736
1735
|
init(e6 = {}) {
|
|
1737
1736
|
e6.interpolation ||= { escapeValue: true };
|
|
1738
1737
|
let { escape: t2, escapeValue: n2, useRawValueToEscape: r2, prefix: i2, prefixEscaped: a2, suffix: o2, suffixEscaped: s2, formatSeparator: c2, unescapeSuffix: l2, unescapePrefix: u2, nestingPrefix: d2, nestingPrefixEscaped: f2, nestingSuffix: p2, nestingSuffixEscaped: m2, nestingOptionsSeparator: h2, maxReplaces: g2, alwaysFormat: _2 } = e6.interpolation;
|
|
1739
|
-
this.escape = t2 === void 0 ?
|
|
1738
|
+
this.escape = t2 === void 0 ? Mr : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? z(i2) : a2 || `{{`, this.suffix = o2 ? z(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 ? z(u2) : `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 ? z(l2) : ``, this.nestingPrefix = d2 ? z(d2) : f2 || z(`$t(`), this.nestingSuffix = p2 ? z(p2) : m2 || z(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1740
1739
|
}
|
|
1741
1740
|
reset() {
|
|
1742
1741
|
this.options && this.init(this.options);
|
|
@@ -1748,11 +1747,11 @@ var Qr = class {
|
|
|
1748
1747
|
interpolate(e6, t2, n2, r2) {
|
|
1749
1748
|
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e7) => {
|
|
1750
1749
|
if (!e7.includes(this.formatSeparator)) {
|
|
1751
|
-
let i4 =
|
|
1750
|
+
let i4 = Zr(t2, s2, e7, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1752
1751
|
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e7 }) : i4;
|
|
1753
1752
|
}
|
|
1754
1753
|
let i3 = e7.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
1755
|
-
return this.format(
|
|
1754
|
+
return this.format(Zr(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
1756
1755
|
};
|
|
1757
1756
|
this.resetRegExp(), !this.escapeValue && typeof e6 == `string` && /\$t\([^)]*\{[^}]*\{\{/.test(e6) && this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false \u2014 if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);
|
|
1758
1757
|
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
@@ -1762,15 +1761,15 @@ var Qr = class {
|
|
|
1762
1761
|
if (a2 = c2(n3), a2 === void 0) {
|
|
1763
1762
|
if (typeof l2 == `function`) {
|
|
1764
1763
|
let t4 = l2(e6, i2, r2);
|
|
1765
|
-
a2 =
|
|
1764
|
+
a2 = I(t4) ? t4 : ``;
|
|
1766
1765
|
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1767
1766
|
else if (u2) {
|
|
1768
1767
|
a2 = i2[0];
|
|
1769
1768
|
continue;
|
|
1770
1769
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e6}`), a2 = ``;
|
|
1771
|
-
} else !
|
|
1770
|
+
} else !I(a2) && !this.useRawValueToEscape && (a2 = xr(a2));
|
|
1772
1771
|
let s3 = t3.safeValue(a2);
|
|
1773
|
-
if (e6 = e6.replace(i2[0],
|
|
1772
|
+
if (e6 = e6.replace(i2[0], Qr(s3)), u2 ? (t3.regex.lastIndex += s3.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1774
1773
|
}
|
|
1775
1774
|
}), e6;
|
|
1776
1775
|
}
|
|
@@ -1778,7 +1777,7 @@ var Qr = class {
|
|
|
1778
1777
|
let r2, i2, a2, o2 = (e7, t3) => {
|
|
1779
1778
|
let n3 = this.nestingOptionsSeparator;
|
|
1780
1779
|
if (!e7.includes(n3)) return e7;
|
|
1781
|
-
let r3 = e7.split(RegExp(`${
|
|
1780
|
+
let r3 = e7.split(RegExp(`${z(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1782
1781
|
e7 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1783
1782
|
let o3 = i3.match(/'/g), s3 = i3.match(/"/g);
|
|
1784
1783
|
((o3?.length ?? 0) % 2 == 0 && !s3 || (s3?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
@@ -1791,15 +1790,15 @@ var Qr = class {
|
|
|
1791
1790
|
}, s2 = new RegExp(this.nestingRegexp), c2 = ``, l2 = 0;
|
|
1792
1791
|
for (; r2 = s2.exec(e6); ) {
|
|
1793
1792
|
let u2 = [];
|
|
1794
|
-
a2 = { ...n2 }, a2 = a2.replace && !
|
|
1793
|
+
a2 = { ...n2 }, a2 = a2.replace && !I(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1795
1794
|
let d2 = /{.*}/s.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1796
|
-
if (d2 !== -1 && (u2 = r2[1].slice(d2).split(this.formatSeparator).map((e7) => e7.trim()).filter(Boolean), r2[1] = r2[1].slice(0, d2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e6 && !
|
|
1797
|
-
|
|
1795
|
+
if (d2 !== -1 && (u2 = r2[1].slice(d2).split(this.formatSeparator).map((e7) => e7.trim()).filter(Boolean), r2[1] = r2[1].slice(0, d2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e6 && !I(i2)) return i2;
|
|
1796
|
+
I(i2) || (i2 = xr(i2)), i2 ||= (this.logger.warn(`missed to resolve ${r2[1]} for nesting ${e6}`), ``), u2.length && (i2 = u2.reduce((e7, t3) => this.format(e7, t3, n2.lng, { ...n2, interpolationkey: r2[1].trim() }), i2.trim())), c2 += e6.slice(l2, r2.index) + xr(i2), l2 = s2.lastIndex, this.regexp.lastIndex = 0;
|
|
1798
1797
|
}
|
|
1799
1798
|
return l2 ? c2 + e6.slice(l2) : e6;
|
|
1800
1799
|
}
|
|
1801
1800
|
};
|
|
1802
|
-
var
|
|
1801
|
+
var ei = (e6) => {
|
|
1803
1802
|
let t2 = e6.toLowerCase().trim(), n2 = {};
|
|
1804
1803
|
if (e6.includes(`(`)) {
|
|
1805
1804
|
let r2 = e6.split(`(`);
|
|
@@ -1814,23 +1813,23 @@ var $r = (e6) => {
|
|
|
1814
1813
|
}
|
|
1815
1814
|
return { formatName: t2, formatOptions: n2 };
|
|
1816
1815
|
};
|
|
1817
|
-
var
|
|
1816
|
+
var ti = (e6) => {
|
|
1818
1817
|
let t2 = {};
|
|
1819
1818
|
return (n2, r2, i2) => {
|
|
1820
1819
|
let a2 = i2;
|
|
1821
1820
|
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1822
1821
|
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1823
|
-
return s2 || (s2 = e6(
|
|
1822
|
+
return s2 || (s2 = e6(B(r2), i2), t2[o2] = s2), s2(n2);
|
|
1824
1823
|
};
|
|
1825
1824
|
};
|
|
1826
|
-
var
|
|
1827
|
-
var
|
|
1825
|
+
var ni = (e6) => (t2, n2, r2) => e6(B(n2), r2)(t2);
|
|
1826
|
+
var ri = class {
|
|
1828
1827
|
constructor(e6 = {}) {
|
|
1829
|
-
this.logger =
|
|
1828
|
+
this.logger = V.create(`formatter`), this.options = e6, this.init(e6);
|
|
1830
1829
|
}
|
|
1831
1830
|
init(e6, t2 = { interpolation: {} }) {
|
|
1832
1831
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
1833
|
-
let n2 = t2.cacheInBuiltFormats ?
|
|
1832
|
+
let n2 = t2.cacheInBuiltFormats ? ti : ni;
|
|
1834
1833
|
this.formats = { number: n2((e7, t3) => {
|
|
1835
1834
|
let n3 = new Intl.NumberFormat(e7, { ...t3 });
|
|
1836
1835
|
return (e8) => n3.format(e8);
|
|
@@ -1852,7 +1851,7 @@ var ni = class {
|
|
|
1852
1851
|
this.formats[e6.toLowerCase().trim()] = t2;
|
|
1853
1852
|
}
|
|
1854
1853
|
addCached(e6, t2) {
|
|
1855
|
-
this.formats[e6.toLowerCase().trim()] =
|
|
1854
|
+
this.formats[e6.toLowerCase().trim()] = ti(t2);
|
|
1856
1855
|
}
|
|
1857
1856
|
format(e6, t2, n2, r2 = {}) {
|
|
1858
1857
|
if (!t2 || e6 == null) return e6;
|
|
@@ -1863,7 +1862,7 @@ var ni = class {
|
|
|
1863
1862
|
a2.push(t3);
|
|
1864
1863
|
}
|
|
1865
1864
|
return a2.reduce((e7, t3) => {
|
|
1866
|
-
let { formatName: i3, formatOptions: a3 } =
|
|
1865
|
+
let { formatName: i3, formatOptions: a3 } = ei(t3);
|
|
1867
1866
|
if (this.formats[i3]) {
|
|
1868
1867
|
let t4 = e7;
|
|
1869
1868
|
try {
|
|
@@ -1878,12 +1877,12 @@ var ni = class {
|
|
|
1878
1877
|
}, e6);
|
|
1879
1878
|
}
|
|
1880
1879
|
};
|
|
1881
|
-
var
|
|
1880
|
+
var ii = (e6, t2) => {
|
|
1882
1881
|
e6.pending[t2] !== void 0 && (delete e6.pending[t2], e6.pendingCount--);
|
|
1883
1882
|
};
|
|
1884
|
-
var
|
|
1883
|
+
var ai = class extends zr {
|
|
1885
1884
|
constructor(e6, t2, n2, r2 = {}) {
|
|
1886
|
-
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger =
|
|
1885
|
+
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = V.create(`backendConnector`), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n2, r2.backend, r2);
|
|
1887
1886
|
}
|
|
1888
1887
|
queueLoad(e6, t2, n2, r2) {
|
|
1889
1888
|
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
@@ -1900,7 +1899,7 @@ var ii = class extends Rr {
|
|
|
1900
1899
|
t2 && this.emit(`failedLoading`, i2, a2, t2), !t2 && n2 && this.store.addResourceBundle(i2, a2, n2, void 0, void 0, { skipCopy: true }), this.state[e6] = t2 ? -1 : 2, t2 && n2 && (this.state[e6] = 0);
|
|
1901
1900
|
let o2 = {};
|
|
1902
1901
|
this.queue.forEach((n3) => {
|
|
1903
|
-
|
|
1902
|
+
Dr(n3.loaded, [i2], a2), ii(n3, e6), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e7) => {
|
|
1904
1903
|
o2[e7] || (o2[e7] = {});
|
|
1905
1904
|
let t3 = n3.loaded[e7];
|
|
1906
1905
|
t3.length && t3.forEach((t4) => {
|
|
@@ -1935,7 +1934,7 @@ var ii = class extends Rr {
|
|
|
1935
1934
|
}
|
|
1936
1935
|
prepareLoading(e6, t2, n2 = {}, r2) {
|
|
1937
1936
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1938
|
-
|
|
1937
|
+
I(e6) && (e6 = this.languageUtils.toResolveHierarchy(e6)), I(t2) && (t2 = [t2]);
|
|
1939
1938
|
let i2 = this.queueLoad(e6, t2, n2, r2);
|
|
1940
1939
|
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1941
1940
|
i2.toLoad.forEach((e7) => {
|
|
@@ -1972,9 +1971,9 @@ var ii = class extends Rr {
|
|
|
1972
1971
|
}
|
|
1973
1972
|
}
|
|
1974
1973
|
};
|
|
1975
|
-
var
|
|
1974
|
+
var oi = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS: [`translation`], fallbackLng: [`dev`], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: `all`, preload: false, keySeparator: `.`, nsSeparator: `:`, pluralSeparator: `_`, contextSeparator: `_`, enableSelector: false, partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: `fallback`, saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: false, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: (e6) => {
|
|
1976
1975
|
let t2 = {};
|
|
1977
|
-
if (typeof e6[1] == `object` && (t2 = e6[1]),
|
|
1976
|
+
if (typeof e6[1] == `object` && (t2 = e6[1]), I(e6[1]) && (t2.defaultValue = e6[1]), I(e6[2]) && (t2.tDescription = e6[2]), typeof e6[2] == `object` || typeof e6[3] == `object`) {
|
|
1978
1977
|
let n2 = e6[3] || e6[2];
|
|
1979
1978
|
Object.keys(n2).forEach((e7) => {
|
|
1980
1979
|
t2[e7] = n2[e7];
|
|
@@ -1982,17 +1981,17 @@ var ai = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1982
1981
|
}
|
|
1983
1982
|
return t2;
|
|
1984
1983
|
}, interpolation: { escapeValue: true, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1985
|
-
var
|
|
1986
|
-
var
|
|
1984
|
+
var si = (e6) => (I(e6.ns) && (e6.ns = [e6.ns]), I(e6.fallbackLng) && (e6.fallbackLng = [e6.fallbackLng]), I(e6.fallbackNS) && (e6.fallbackNS = [e6.fallbackNS]), e6.supportedLngs && !e6.supportedLngs.includes(`cimode`) && (e6.supportedLngs = e6.supportedLngs.concat([`cimode`])), e6);
|
|
1985
|
+
var ci = () => {
|
|
1987
1986
|
};
|
|
1988
|
-
var
|
|
1987
|
+
var li = (e6) => {
|
|
1989
1988
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e6)).forEach((t2) => {
|
|
1990
1989
|
typeof e6[t2] == `function` && (e6[t2] = e6[t2].bind(e6));
|
|
1991
1990
|
});
|
|
1992
1991
|
};
|
|
1993
|
-
var
|
|
1992
|
+
var U = class e4 extends zr {
|
|
1994
1993
|
constructor(e6 = {}, t2) {
|
|
1995
|
-
if (super(), this.options =
|
|
1994
|
+
if (super(), this.options = si(e6), this.services = {}, this.logger = V, this.modules = { external: [] }, li(this), t2 && !this.isInitialized && !e6.isClone) {
|
|
1996
1995
|
if (!this.options.initAsync) return this.init(e6, t2), this;
|
|
1997
1996
|
setTimeout(() => {
|
|
1998
1997
|
this.init(e6, t2);
|
|
@@ -2000,26 +1999,26 @@ var W = class e4 extends Rr {
|
|
|
2000
1999
|
}
|
|
2001
2000
|
}
|
|
2002
2001
|
init(e6 = {}, t2) {
|
|
2003
|
-
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (
|
|
2004
|
-
let n2 =
|
|
2005
|
-
this.options = { ...n2, ...this.options, ...
|
|
2002
|
+
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (I(e6.ns) ? e6.defaultNS = e6.ns : e6.ns.includes(`translation`) || (e6.defaultNS = e6.ns[0]));
|
|
2003
|
+
let n2 = oi();
|
|
2004
|
+
this.options = { ...n2, ...this.options, ...si(e6) }, this.options.interpolation = { ...n2.interpolation, ...this.options.interpolation }, e6.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e6.keySeparator), e6.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e6.nsSeparator), typeof this.options.overloadTranslationOptionHandler != `function` && (this.options.overloadTranslationOptionHandler = n2.overloadTranslationOptionHandler);
|
|
2006
2005
|
let r2 = (e7) => e7 ? typeof e7 == `function` ? new e7() : e7 : null;
|
|
2007
2006
|
if (!this.options.isClone) {
|
|
2008
|
-
this.modules.logger ?
|
|
2007
|
+
this.modules.logger ? V.init(r2(this.modules.logger), this.options) : V.init(null, this.options);
|
|
2009
2008
|
let e7;
|
|
2010
|
-
e7 = this.modules.formatter ? this.modules.formatter :
|
|
2011
|
-
let t3 = new
|
|
2012
|
-
this.store = new
|
|
2009
|
+
e7 = this.modules.formatter ? this.modules.formatter : ri;
|
|
2010
|
+
let t3 = new qr(this.options);
|
|
2011
|
+
this.store = new Vr(this.options.resources, this.options);
|
|
2013
2012
|
let n3 = this.services;
|
|
2014
|
-
n3.logger =
|
|
2013
|
+
n3.logger = V, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new Xr(t3, { prepend: this.options.pluralSeparator }), e7 && (n3.formatter = r2(e7), n3.formatter.init && n3.formatter.init(n3, this.options), this.options.interpolation.format = n3.formatter.format.bind(n3.formatter)), n3.interpolator = new $r(this.options), n3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n3.backendConnector = new ai(r2(this.modules.backend), n3.resourceStore, n3, this.options), n3.backendConnector.on(`*`, (e8, ...t4) => {
|
|
2015
2014
|
this.emit(e8, ...t4);
|
|
2016
|
-
}), this.modules.languageDetector && (n3.languageDetector = r2(this.modules.languageDetector), n3.languageDetector.init && n3.languageDetector.init(n3, this.options.detection, this.options)), this.modules.i18nFormat && (n3.i18nFormat = r2(this.modules.i18nFormat), n3.i18nFormat.init && n3.i18nFormat.init(this)), this.translator = new
|
|
2015
|
+
}), this.modules.languageDetector && (n3.languageDetector = r2(this.modules.languageDetector), n3.languageDetector.init && n3.languageDetector.init(n3, this.options.detection, this.options)), this.modules.i18nFormat && (n3.i18nFormat = r2(this.modules.i18nFormat), n3.i18nFormat.init && n3.i18nFormat.init(this)), this.translator = new Kr(this.services, this.options), this.translator.on(`*`, (e8, ...t4) => {
|
|
2017
2016
|
this.emit(e8, ...t4);
|
|
2018
2017
|
}), this.modules.external.forEach((e8) => {
|
|
2019
2018
|
e8.init && e8.init(this);
|
|
2020
2019
|
});
|
|
2021
2020
|
}
|
|
2022
|
-
if (this.format = this.options.interpolation.format, t2 ||=
|
|
2021
|
+
if (this.format = this.options.interpolation.format, t2 ||= ci, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2023
2022
|
let e7 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2024
2023
|
e7.length > 0 && e7[0] !== `dev` && (this.options.lng = e7[0]);
|
|
2025
2024
|
}
|
|
@@ -2028,7 +2027,7 @@ var W = class e4 extends Rr {
|
|
|
2028
2027
|
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e7) => {
|
|
2029
2028
|
this[e7] = (...t3) => (this.store[e7](...t3), this);
|
|
2030
2029
|
});
|
|
2031
|
-
let i2 =
|
|
2030
|
+
let i2 = L(), a2 = () => {
|
|
2032
2031
|
let e7 = (e8, n3) => {
|
|
2033
2032
|
this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn(`init: i18next is already initialized. You should call init just once!`), this.isInitialized = true, this.options.isClone || this.logger.log(`initialized`, this.options), this.emit(`initialized`, this.options), i2.resolve(n3), t2(e8, n3);
|
|
2034
2033
|
};
|
|
@@ -2037,8 +2036,8 @@ var W = class e4 extends Rr {
|
|
|
2037
2036
|
};
|
|
2038
2037
|
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
2039
2038
|
}
|
|
2040
|
-
loadResources(e6, t2 =
|
|
2041
|
-
let n2 = t2, r2 =
|
|
2039
|
+
loadResources(e6, t2 = ci) {
|
|
2040
|
+
let n2 = t2, r2 = I(e6) ? e6 : this.language;
|
|
2042
2041
|
if (typeof e6 == `function` && (n2 = e6), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2043
2042
|
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
2044
2043
|
let e7 = [], t3 = (t4) => {
|
|
@@ -2052,15 +2051,15 @@ var W = class e4 extends Rr {
|
|
|
2052
2051
|
} else n2(null);
|
|
2053
2052
|
}
|
|
2054
2053
|
reloadResources(e6, t2, n2) {
|
|
2055
|
-
let r2 =
|
|
2056
|
-
return typeof e6 == `function` && (n2 = e6, e6 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e6 ||= this.languages, t2 ||= this.options.ns, n2 ||=
|
|
2054
|
+
let r2 = L();
|
|
2055
|
+
return typeof e6 == `function` && (n2 = e6, e6 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e6 ||= this.languages, t2 ||= this.options.ns, n2 ||= ci, this.services.backendConnector.reload(e6, t2, (e7) => {
|
|
2057
2056
|
r2.resolve(), n2(e7);
|
|
2058
2057
|
}), r2;
|
|
2059
2058
|
}
|
|
2060
2059
|
use(e6) {
|
|
2061
2060
|
if (!e6) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
2062
2061
|
if (!e6.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
2063
|
-
return e6.type === `backend` && (this.modules.backend = e6), (e6.type === `logger` || e6.log && e6.warn && e6.error) && (this.modules.logger = e6), e6.type === `languageDetector` && (this.modules.languageDetector = e6), e6.type === `i18nFormat` && (this.modules.i18nFormat = e6), e6.type === `postProcessor` &&
|
|
2062
|
+
return e6.type === `backend` && (this.modules.backend = e6), (e6.type === `logger` || e6.log && e6.warn && e6.error) && (this.modules.logger = e6), e6.type === `languageDetector` && (this.modules.languageDetector = e6), e6.type === `i18nFormat` && (this.modules.i18nFormat = e6), e6.type === `postProcessor` && Hr.addPostProcessor(e6), e6.type === `formatter` && (this.modules.formatter = e6), e6.type === `3rdParty` && this.modules.external.push(e6), this;
|
|
2064
2063
|
}
|
|
2065
2064
|
setResolvedLanguage(e6) {
|
|
2066
2065
|
if (e6 && this.languages && ![`cimode`, `dev`].includes(e6)) {
|
|
@@ -2076,7 +2075,7 @@ var W = class e4 extends Rr {
|
|
|
2076
2075
|
}
|
|
2077
2076
|
changeLanguage(e6, t2) {
|
|
2078
2077
|
this.isLanguageChangingTo = e6;
|
|
2079
|
-
let n2 =
|
|
2078
|
+
let n2 = L();
|
|
2080
2079
|
this.emit(`languageChanging`, e6);
|
|
2081
2080
|
let r2 = (e7) => {
|
|
2082
2081
|
this.language = e7, this.languages = this.services.languageUtils.toResolveHierarchy(e7), this.resolvedLanguage = void 0, this.setResolvedLanguage(e7);
|
|
@@ -2084,7 +2083,7 @@ var W = class e4 extends Rr {
|
|
|
2084
2083
|
a3 ? this.isLanguageChangingTo === e6 && (r2(a3), this.translator.changeLanguage(a3), this.isLanguageChangingTo = void 0, this.emit(`languageChanged`, a3), this.logger.log(`languageChanged`, a3)) : this.isLanguageChangingTo = void 0, n2.resolve((...e7) => this.t(...e7)), t2 && t2(i3, (...e7) => this.t(...e7));
|
|
2085
2084
|
}, a2 = (t3) => {
|
|
2086
2085
|
!e6 && !t3 && this.services.languageDetector && (t3 = []);
|
|
2087
|
-
let n3 =
|
|
2086
|
+
let n3 = I(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(I(t3) ? [t3] : t3);
|
|
2088
2087
|
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e7) => {
|
|
2089
2088
|
i2(e7, a3);
|
|
2090
2089
|
});
|
|
@@ -2098,11 +2097,11 @@ var W = class e4 extends Rr {
|
|
|
2098
2097
|
let s2 = o2.ns !== void 0 && o2.ns !== null;
|
|
2099
2098
|
o2.ns = o2.ns || a2.ns, o2.keyPrefix !== `` && (o2.keyPrefix = o2.keyPrefix || n2 || a2.keyPrefix);
|
|
2100
2099
|
let c2 = { ...this.options, ...o2 };
|
|
2101
|
-
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix =
|
|
2100
|
+
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix = H(o2.keyPrefix, c2));
|
|
2102
2101
|
let l2 = this.options.keySeparator || `.`, u2;
|
|
2103
|
-
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 =
|
|
2102
|
+
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 = H(e8, c2)), `${o2.keyPrefix}${l2}${e8}`)) : (typeof e7 == `function` && (e7 = H(e7, c2)), u2 = o2.keyPrefix ? `${o2.keyPrefix}${l2}${e7}` : e7), this.t(u2, o2);
|
|
2104
2103
|
};
|
|
2105
|
-
return
|
|
2104
|
+
return I(e6) ? a2.lng = e6 : a2.lngs = e6, a2.ns = t2, a2.keyPrefix = n2, a2;
|
|
2106
2105
|
}
|
|
2107
2106
|
t(...e6) {
|
|
2108
2107
|
return this.translator?.translate(...e6);
|
|
@@ -2131,16 +2130,16 @@ var W = class e4 extends Rr {
|
|
|
2131
2130
|
return !(s2 && !a2(s2, e6) || r2 && !a2(i2, e6));
|
|
2132
2131
|
}
|
|
2133
2132
|
loadNamespaces(e6, t2) {
|
|
2134
|
-
let n2 =
|
|
2135
|
-
return this.options.ns ? (
|
|
2133
|
+
let n2 = L();
|
|
2134
|
+
return this.options.ns ? (I(e6) && (e6 = [e6]), e6.forEach((e7) => {
|
|
2136
2135
|
this.options.ns.includes(e7) || this.options.ns.push(e7);
|
|
2137
2136
|
}), this.loadResources((e7) => {
|
|
2138
2137
|
n2.resolve(), t2 && t2(e7);
|
|
2139
2138
|
}), n2) : (t2 && t2(), Promise.resolve());
|
|
2140
2139
|
}
|
|
2141
2140
|
loadLanguages(e6, t2) {
|
|
2142
|
-
let n2 =
|
|
2143
|
-
|
|
2141
|
+
let n2 = L();
|
|
2142
|
+
I(e6) && (e6 = [e6]);
|
|
2144
2143
|
let r2 = this.options.preload || [], i2 = e6.filter((e7) => !r2.includes(e7) && this.services.languageUtils.isSupportedCode(e7));
|
|
2145
2144
|
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e7) => {
|
|
2146
2145
|
n2.resolve(), t2 && t2(e7);
|
|
@@ -2156,24 +2155,24 @@ var W = class e4 extends Rr {
|
|
|
2156
2155
|
}
|
|
2157
2156
|
} catch {
|
|
2158
2157
|
}
|
|
2159
|
-
let t2 = `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`.split(`.`), n2 = this.services?.languageUtils || new
|
|
2158
|
+
let t2 = `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`.split(`.`), n2 = this.services?.languageUtils || new qr(oi());
|
|
2160
2159
|
return e6.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.includes(n2.getLanguagePartFromCode(e6)) || e6.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
2161
2160
|
}
|
|
2162
2161
|
static createInstance(t2 = {}, n2) {
|
|
2163
2162
|
let r2 = new e4(t2, n2);
|
|
2164
2163
|
return r2.createInstance = e4.createInstance, r2;
|
|
2165
2164
|
}
|
|
2166
|
-
cloneInstance(t2 = {}, n2 =
|
|
2165
|
+
cloneInstance(t2 = {}, n2 = ci) {
|
|
2167
2166
|
let r2 = t2.forkResourceStore;
|
|
2168
2167
|
r2 && delete t2.forkResourceStore;
|
|
2169
2168
|
let i2 = { ...this.options, preload: false, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2170
2169
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e6) => {
|
|
2171
2170
|
a2[e6] = this[e6];
|
|
2172
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
2173
|
-
let e6 = { ...
|
|
2174
|
-
a2.services.interpolator = new
|
|
2171
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new Vr(Object.keys(this.store.data).reduce((e6, t3) => (e6[t3] = { ...this.store.data[t3] }, e6[t3] = Object.keys(e6[t3]).reduce((n3, r3) => (n3[r3] = { ...e6[t3][r3] }, n3), e6[t3]), e6), {}), i2), a2.services.resourceStore = a2.store), t2.interpolation) {
|
|
2172
|
+
let e6 = { ...oi().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e6 };
|
|
2173
|
+
a2.services.interpolator = new $r(n3);
|
|
2175
2174
|
}
|
|
2176
|
-
return a2.translator = new
|
|
2175
|
+
return a2.translator = new Kr(a2.services, i2), a2.translator.on(`*`, (e6, ...t3) => {
|
|
2177
2176
|
a2.emit(e6, ...t3);
|
|
2178
2177
|
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
2179
2178
|
}
|
|
@@ -2181,9 +2180,9 @@ var W = class e4 extends Rr {
|
|
|
2181
2180
|
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
|
|
2182
2181
|
}
|
|
2183
2182
|
}.createInstance();
|
|
2184
|
-
|
|
2185
|
-
var
|
|
2186
|
-
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 =
|
|
2183
|
+
U.createInstance, U.dir, U.init, U.loadResources, U.reloadResources, U.use, U.changeLanguage, U.getFixedT, U.t, U.exists, U.setDefaultNamespace, U.hasLoadedNamespace, U.loadNamespaces, U.loadLanguages;
|
|
2184
|
+
var ui = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 = false, disableAutoInit: i2 = false, bindI18n: a2 }, { icu: o2 } = {}) => {
|
|
2185
|
+
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 = U.createInstance(i2 ? s2 : void 0);
|
|
2187
2186
|
return o2 && c2.use(o2), t2 && c2.use({ type: `backend`, read: async (e7, n3, r3) => {
|
|
2188
2187
|
try {
|
|
2189
2188
|
return r3(null, await t2(e7));
|
|
@@ -2192,38 +2191,38 @@ var li = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 =
|
|
|
2192
2191
|
}
|
|
2193
2192
|
} }), n2 && (s2.resources = { [e6]: { translation: n2 } }), i2 || c2.init(s2), c2;
|
|
2194
2193
|
};
|
|
2195
|
-
function
|
|
2196
|
-
let n2 = t2 && t2.cache ? t2.cache :
|
|
2197
|
-
return (t2 && t2.strategy ? t2.strategy :
|
|
2194
|
+
function di(e6, t2) {
|
|
2195
|
+
let n2 = t2 && t2.cache ? t2.cache : xi, r2 = t2 && t2.serializer ? t2.serializer : yi;
|
|
2196
|
+
return (t2 && t2.strategy ? t2.strategy : gi)(e6, { cache: n2, serializer: r2 });
|
|
2198
2197
|
}
|
|
2199
|
-
function
|
|
2198
|
+
function fi(e6) {
|
|
2200
2199
|
return e6 == null || typeof e6 == `number` || typeof e6 == `boolean`;
|
|
2201
2200
|
}
|
|
2202
|
-
function
|
|
2203
|
-
let i2 =
|
|
2201
|
+
function pi(e6, t2, n2, r2) {
|
|
2202
|
+
let i2 = fi(r2) ? r2 : n2(r2), a2 = t2.get(i2);
|
|
2204
2203
|
return a2 === void 0 && (a2 = e6.call(this, r2), t2.set(i2, a2)), a2;
|
|
2205
2204
|
}
|
|
2206
|
-
function
|
|
2205
|
+
function mi(e6, t2, n2) {
|
|
2207
2206
|
let r2 = Array.prototype.slice.call(arguments, 3), i2 = n2(r2), a2 = t2.get(i2);
|
|
2208
2207
|
return a2 === void 0 && (a2 = e6.apply(this, r2), t2.set(i2, a2)), a2;
|
|
2209
2208
|
}
|
|
2210
|
-
function
|
|
2209
|
+
function hi(e6, t2, n2, r2, i2) {
|
|
2211
2210
|
return n2.bind(t2, e6, r2, i2);
|
|
2212
2211
|
}
|
|
2213
|
-
function hi(e6, t2) {
|
|
2214
|
-
let n2 = e6.length === 1 ? fi : pi;
|
|
2215
|
-
return mi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2216
|
-
}
|
|
2217
2212
|
function gi(e6, t2) {
|
|
2218
|
-
|
|
2213
|
+
let n2 = e6.length === 1 ? pi : mi;
|
|
2214
|
+
return hi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2219
2215
|
}
|
|
2220
2216
|
function _i(e6, t2) {
|
|
2221
|
-
return
|
|
2217
|
+
return hi(e6, this, mi, t2.cache.create(), t2.serializer);
|
|
2218
|
+
}
|
|
2219
|
+
function vi(e6, t2) {
|
|
2220
|
+
return hi(e6, this, pi, t2.cache.create(), t2.serializer);
|
|
2222
2221
|
}
|
|
2223
|
-
var
|
|
2222
|
+
var yi = function() {
|
|
2224
2223
|
return JSON.stringify(arguments);
|
|
2225
2224
|
};
|
|
2226
|
-
var
|
|
2225
|
+
var bi = class {
|
|
2227
2226
|
constructor() {
|
|
2228
2227
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2229
2228
|
}
|
|
@@ -2234,14 +2233,14 @@ var yi = class {
|
|
|
2234
2233
|
this.cache[e6] = t2;
|
|
2235
2234
|
}
|
|
2236
2235
|
};
|
|
2237
|
-
var
|
|
2238
|
-
return new
|
|
2236
|
+
var xi = { create: function() {
|
|
2237
|
+
return new bi();
|
|
2239
2238
|
} };
|
|
2240
|
-
var
|
|
2241
|
-
var
|
|
2242
|
-
function
|
|
2239
|
+
var Si = { variadic: _i, monadic: vi };
|
|
2240
|
+
var Ci = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
2241
|
+
function wi(e6) {
|
|
2243
2242
|
let t2 = {};
|
|
2244
|
-
return e6.replace(
|
|
2243
|
+
return e6.replace(Ci, (e7) => {
|
|
2245
2244
|
let n2 = e7.length;
|
|
2246
2245
|
switch (e7[0]) {
|
|
2247
2246
|
case `G`:
|
|
@@ -2328,10 +2327,10 @@ function Ci(e6) {
|
|
|
2328
2327
|
return ``;
|
|
2329
2328
|
}), t2;
|
|
2330
2329
|
}
|
|
2331
|
-
var
|
|
2332
|
-
function
|
|
2330
|
+
var Ti = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
2331
|
+
function Ei(e6) {
|
|
2333
2332
|
if (e6.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
2334
|
-
let t2 = e6.split(
|
|
2333
|
+
let t2 = e6.split(Ti).filter((e7) => e7.length > 0), n2 = [];
|
|
2335
2334
|
for (let e7 of t2) {
|
|
2336
2335
|
let t3 = e7.split(`/`);
|
|
2337
2336
|
if (t3.length === 0) throw Error(`Invalid number skeleton`);
|
|
@@ -2341,20 +2340,20 @@ function Ti(e6) {
|
|
|
2341
2340
|
}
|
|
2342
2341
|
return n2;
|
|
2343
2342
|
}
|
|
2344
|
-
function
|
|
2343
|
+
function Di(e6) {
|
|
2345
2344
|
return e6.replace(/^(.*?)-/, ``);
|
|
2346
2345
|
}
|
|
2347
|
-
var
|
|
2348
|
-
var
|
|
2349
|
-
var
|
|
2350
|
-
var
|
|
2351
|
-
function
|
|
2346
|
+
var Oi = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
2347
|
+
var ki = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
2348
|
+
var Ai = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
2349
|
+
var ji = /^(0+)$/;
|
|
2350
|
+
function Mi(e6) {
|
|
2352
2351
|
let t2 = {};
|
|
2353
|
-
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(
|
|
2352
|
+
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(ki, function(e7, n2, r2) {
|
|
2354
2353
|
return typeof r2 == `string` ? r2 === `+` ? t2.minimumSignificantDigits = n2.length : n2[0] === `#` ? t2.maximumSignificantDigits = n2.length : (t2.minimumSignificantDigits = n2.length, t2.maximumSignificantDigits = n2.length + (typeof r2 == `string` ? r2.length : 0)) : (t2.minimumSignificantDigits = n2.length, t2.maximumSignificantDigits = n2.length), ``;
|
|
2355
2354
|
}), t2;
|
|
2356
2355
|
}
|
|
2357
|
-
function
|
|
2356
|
+
function Ni(e6) {
|
|
2358
2357
|
switch (e6) {
|
|
2359
2358
|
case `sign-auto`:
|
|
2360
2359
|
return { signDisplay: `auto` };
|
|
@@ -2378,19 +2377,19 @@ function Mi(e6) {
|
|
|
2378
2377
|
return { signDisplay: `never` };
|
|
2379
2378
|
}
|
|
2380
2379
|
}
|
|
2381
|
-
function
|
|
2380
|
+
function Pi(e6) {
|
|
2382
2381
|
let t2;
|
|
2383
2382
|
if (e6[0] === `E` && e6[1] === `E` ? (t2 = { notation: `engineering` }, e6 = e6.slice(2)) : e6[0] === `E` && (t2 = { notation: `scientific` }, e6 = e6.slice(1)), t2) {
|
|
2384
2383
|
let n2 = e6.slice(0, 2);
|
|
2385
|
-
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !
|
|
2384
|
+
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !ji.test(e6)) throw Error(`Malformed concise eng/scientific notation`);
|
|
2386
2385
|
t2.minimumIntegerDigits = e6.length;
|
|
2387
2386
|
}
|
|
2388
2387
|
return t2;
|
|
2389
2388
|
}
|
|
2390
|
-
function Pi(e6) {
|
|
2391
|
-
return Mi(e6) || {};
|
|
2392
|
-
}
|
|
2393
2389
|
function Fi(e6) {
|
|
2390
|
+
return Ni(e6) || {};
|
|
2391
|
+
}
|
|
2392
|
+
function Ii(e6) {
|
|
2394
2393
|
let t2 = {};
|
|
2395
2394
|
for (let n2 of e6) {
|
|
2396
2395
|
switch (n2.stem) {
|
|
@@ -2414,7 +2413,7 @@ function Fi(e6) {
|
|
|
2414
2413
|
continue;
|
|
2415
2414
|
case `measure-unit`:
|
|
2416
2415
|
case `unit`:
|
|
2417
|
-
t2.style = `unit`, t2.unit =
|
|
2416
|
+
t2.style = `unit`, t2.unit = Di(n2.options[0]);
|
|
2418
2417
|
continue;
|
|
2419
2418
|
case `compact-short`:
|
|
2420
2419
|
case `K`:
|
|
@@ -2425,10 +2424,10 @@ function Fi(e6) {
|
|
|
2425
2424
|
t2.notation = `compact`, t2.compactDisplay = `long`;
|
|
2426
2425
|
continue;
|
|
2427
2426
|
case `scientific`:
|
|
2428
|
-
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2427
|
+
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Fi(t3) }), {}) };
|
|
2429
2428
|
continue;
|
|
2430
2429
|
case `engineering`:
|
|
2431
|
-
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2430
|
+
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Fi(t3) }), {}) };
|
|
2432
2431
|
continue;
|
|
2433
2432
|
case `notation-simple`:
|
|
2434
2433
|
t2.notation = `standard`;
|
|
@@ -2471,7 +2470,7 @@ function Fi(e6) {
|
|
|
2471
2470
|
continue;
|
|
2472
2471
|
case `integer-width`:
|
|
2473
2472
|
if (n2.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
|
|
2474
|
-
n2.options[0].replace(
|
|
2473
|
+
n2.options[0].replace(Ai, function(e8, n3, r3, i2, a2, o2) {
|
|
2475
2474
|
if (n3) t2.minimumIntegerDigits = r3.length;
|
|
2476
2475
|
else if (i2 && a2) throw Error(`We currently do not support maximum integer digits`);
|
|
2477
2476
|
else if (o2) throw Error(`We currently do not support exact integer digits`);
|
|
@@ -2479,83 +2478,83 @@ function Fi(e6) {
|
|
|
2479
2478
|
});
|
|
2480
2479
|
continue;
|
|
2481
2480
|
}
|
|
2482
|
-
if (
|
|
2481
|
+
if (ji.test(n2.stem)) {
|
|
2483
2482
|
t2.minimumIntegerDigits = n2.stem.length;
|
|
2484
2483
|
continue;
|
|
2485
2484
|
}
|
|
2486
|
-
if (
|
|
2485
|
+
if (Oi.test(n2.stem)) {
|
|
2487
2486
|
if (n2.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
|
|
2488
|
-
n2.stem.replace(
|
|
2487
|
+
n2.stem.replace(Oi, function(e9, n3, r3, i2, a2, o2) {
|
|
2489
2488
|
return r3 === `*` ? t2.minimumFractionDigits = n3.length : i2 && i2[0] === `#` ? t2.maximumFractionDigits = i2.length : a2 && o2 ? (t2.minimumFractionDigits = a2.length, t2.maximumFractionDigits = a2.length + o2.length) : (t2.minimumFractionDigits = n3.length, t2.maximumFractionDigits = n3.length), ``;
|
|
2490
2489
|
});
|
|
2491
2490
|
let e8 = n2.options[0];
|
|
2492
|
-
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...
|
|
2491
|
+
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...Mi(e8) });
|
|
2493
2492
|
continue;
|
|
2494
2493
|
}
|
|
2495
|
-
if (
|
|
2496
|
-
t2 = { ...t2, ...
|
|
2494
|
+
if (ki.test(n2.stem)) {
|
|
2495
|
+
t2 = { ...t2, ...Mi(n2.stem) };
|
|
2497
2496
|
continue;
|
|
2498
2497
|
}
|
|
2499
|
-
let e7 =
|
|
2498
|
+
let e7 = Ni(n2.stem);
|
|
2500
2499
|
e7 && (t2 = { ...t2, ...e7 });
|
|
2501
|
-
let r2 =
|
|
2500
|
+
let r2 = Pi(n2.stem);
|
|
2502
2501
|
r2 && (t2 = { ...t2, ...r2 });
|
|
2503
2502
|
}
|
|
2504
2503
|
return t2;
|
|
2505
2504
|
}
|
|
2506
|
-
var
|
|
2505
|
+
var Li = function(e6) {
|
|
2507
2506
|
return e6[e6.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = `EXPECT_ARGUMENT_CLOSING_BRACE`, e6[e6.EMPTY_ARGUMENT = 2] = `EMPTY_ARGUMENT`, e6[e6.MALFORMED_ARGUMENT = 3] = `MALFORMED_ARGUMENT`, e6[e6.EXPECT_ARGUMENT_TYPE = 4] = `EXPECT_ARGUMENT_TYPE`, e6[e6.INVALID_ARGUMENT_TYPE = 5] = `INVALID_ARGUMENT_TYPE`, e6[e6.EXPECT_ARGUMENT_STYLE = 6] = `EXPECT_ARGUMENT_STYLE`, e6[e6.INVALID_NUMBER_SKELETON = 7] = `INVALID_NUMBER_SKELETON`, e6[e6.INVALID_DATE_TIME_SKELETON = 8] = `INVALID_DATE_TIME_SKELETON`, e6[e6.EXPECT_NUMBER_SKELETON = 9] = `EXPECT_NUMBER_SKELETON`, e6[e6.EXPECT_DATE_TIME_SKELETON = 10] = `EXPECT_DATE_TIME_SKELETON`, e6[e6.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = `UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`, e6[e6.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = `EXPECT_SELECT_ARGUMENT_OPTIONS`, e6[e6.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = `EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`, e6[e6.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = `INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`, e6[e6.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = `EXPECT_SELECT_ARGUMENT_SELECTOR`, e6[e6.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = `EXPECT_PLURAL_ARGUMENT_SELECTOR`, e6[e6.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = `EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`, e6[e6.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = `EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`, e6[e6.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = `INVALID_PLURAL_ARGUMENT_SELECTOR`, e6[e6.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = `DUPLICATE_PLURAL_ARGUMENT_SELECTOR`, e6[e6.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = `DUPLICATE_SELECT_ARGUMENT_SELECTOR`, e6[e6.MISSING_OTHER_CLAUSE = 22] = `MISSING_OTHER_CLAUSE`, e6[e6.INVALID_TAG = 23] = `INVALID_TAG`, e6[e6.INVALID_TAG_NAME = 25] = `INVALID_TAG_NAME`, e6[e6.UNMATCHED_CLOSING_TAG = 26] = `UNMATCHED_CLOSING_TAG`, e6[e6.UNCLOSED_TAG = 27] = `UNCLOSED_TAG`, e6;
|
|
2508
2507
|
}({});
|
|
2509
|
-
function
|
|
2508
|
+
function Ri(e6) {
|
|
2510
2509
|
return e6.type === 0;
|
|
2511
2510
|
}
|
|
2512
|
-
function
|
|
2511
|
+
function zi(e6) {
|
|
2513
2512
|
return e6.type === 1;
|
|
2514
2513
|
}
|
|
2515
|
-
function
|
|
2514
|
+
function Bi(e6) {
|
|
2516
2515
|
return e6.type === 2;
|
|
2517
2516
|
}
|
|
2518
|
-
function
|
|
2517
|
+
function Vi(e6) {
|
|
2519
2518
|
return e6.type === 3;
|
|
2520
2519
|
}
|
|
2521
|
-
function
|
|
2520
|
+
function Hi(e6) {
|
|
2522
2521
|
return e6.type === 4;
|
|
2523
2522
|
}
|
|
2524
|
-
function
|
|
2523
|
+
function Ui(e6) {
|
|
2525
2524
|
return e6.type === 5;
|
|
2526
2525
|
}
|
|
2527
|
-
function
|
|
2526
|
+
function Wi(e6) {
|
|
2528
2527
|
return e6.type === 6;
|
|
2529
2528
|
}
|
|
2530
|
-
function
|
|
2529
|
+
function Gi(e6) {
|
|
2531
2530
|
return e6.type === 7;
|
|
2532
2531
|
}
|
|
2533
|
-
function
|
|
2532
|
+
function Ki(e6) {
|
|
2534
2533
|
return e6.type === 8;
|
|
2535
2534
|
}
|
|
2536
|
-
function
|
|
2535
|
+
function qi(e6) {
|
|
2537
2536
|
return !!(e6 && typeof e6 == `object` && e6.type === 0);
|
|
2538
2537
|
}
|
|
2539
|
-
function
|
|
2538
|
+
function Ji(e6) {
|
|
2540
2539
|
return !!(e6 && typeof e6 == `object` && e6.type === 1);
|
|
2541
2540
|
}
|
|
2542
|
-
var
|
|
2543
|
-
var
|
|
2544
|
-
function
|
|
2541
|
+
var Yi = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
2542
|
+
var W = { "001": [`H`, `h`], 419: [`h`, `H`, `hB`, `hb`], AC: [`H`, `h`, `hb`, `hB`], AD: [`H`, `hB`], AE: [`h`, `hB`, `hb`, `H`], AF: [`H`, `hb`, `hB`, `h`], AG: [`h`, `hb`, `H`, `hB`], AI: [`H`, `h`, `hb`, `hB`], AL: [`h`, `H`, `hB`], AM: [`H`, `hB`], AO: [`H`, `hB`], AR: [`h`, `H`, `hB`, `hb`], AS: [`h`, `H`], AT: [`H`, `hB`], AU: [`h`, `hb`, `H`, `hB`], AW: [`H`, `hB`], AX: [`H`], AZ: [`H`, `hB`, `h`], BA: [`H`, `hB`, `h`], BB: [`h`, `hb`, `H`, `hB`], BD: [`h`, `hB`, `H`], BE: [`H`, `hB`], BF: [`H`, `hB`], BG: [`H`, `hB`, `h`], BH: [`h`, `hB`, `hb`, `H`], BI: [`H`, `h`], BJ: [`H`, `hB`], BL: [`H`, `hB`], BM: [`h`, `hb`, `H`, `hB`], BN: [`hb`, `hB`, `h`, `H`], BO: [`h`, `H`, `hB`, `hb`], BQ: [`H`], BR: [`H`, `hB`], BS: [`h`, `hb`, `H`, `hB`], BT: [`h`, `H`], BW: [`H`, `h`, `hb`, `hB`], BY: [`H`, `h`], BZ: [`H`, `h`, `hb`, `hB`], CA: [`h`, `hb`, `H`, `hB`], CC: [`H`, `h`, `hb`, `hB`], CD: [`hB`, `H`], CF: [`H`, `h`, `hB`], CG: [`H`, `hB`], CH: [`H`, `hB`, `h`], CI: [`H`, `hB`], CK: [`H`, `h`, `hb`, `hB`], CL: [`h`, `H`, `hB`, `hb`], CM: [`H`, `h`, `hB`], CN: [`H`, `hB`, `hb`, `h`], CO: [`h`, `H`, `hB`, `hb`], CP: [`H`], CR: [`h`, `H`, `hB`, `hb`], CU: [`h`, `H`, `hB`, `hb`], CV: [`H`, `hB`], CW: [`H`, `hB`], CX: [`H`, `h`, `hb`, `hB`], CY: [`h`, `H`, `hb`, `hB`], CZ: [`H`], DE: [`H`, `hB`], DG: [`H`, `h`, `hb`, `hB`], DJ: [`h`, `H`], DK: [`H`], DM: [`h`, `hb`, `H`, `hB`], DO: [`h`, `H`, `hB`, `hb`], DZ: [`h`, `hB`, `hb`, `H`], EA: [`H`, `h`, `hB`, `hb`], EC: [`h`, `H`, `hB`, `hb`], EE: [`H`, `hB`], EG: [`h`, `hB`, `hb`, `H`], EH: [`h`, `hB`, `hb`, `H`], ER: [`h`, `H`], ES: [`H`, `hB`, `h`, `hb`], ET: [`hB`, `hb`, `h`, `H`], FI: [`H`], FJ: [`h`, `hb`, `H`, `hB`], FK: [`H`, `h`, `hb`, `hB`], FM: [`h`, `hb`, `H`, `hB`], FO: [`H`, `h`], FR: [`H`, `hB`], GA: [`H`, `hB`], GB: [`H`, `h`, `hb`, `hB`], GD: [`h`, `hb`, `H`, `hB`], GE: [`H`, `hB`, `h`], GF: [`H`, `hB`], GG: [`H`, `h`, `hb`, `hB`], GH: [`h`, `H`], GI: [`H`, `h`, `hb`, `hB`], GL: [`H`, `h`], GM: [`h`, `hb`, `H`, `hB`], GN: [`H`, `hB`], GP: [`H`, `hB`], GQ: [`H`, `hB`, `h`, `hb`], GR: [`h`, `H`, `hb`, `hB`], GS: [`H`, `h`, `hb`, `hB`], GT: [`h`, `H`, `hB`, `hb`], GU: [`h`, `hb`, `H`, `hB`], GW: [`H`, `hB`], GY: [`h`, `hb`, `H`, `hB`], HK: [`h`, `hB`, `hb`, `H`], HN: [`h`, `H`, `hB`, `hb`], HR: [`H`, `hB`], HU: [`H`, `h`], IC: [`H`, `h`, `hB`, `hb`], ID: [`H`], IE: [`H`, `h`, `hb`, `hB`], IL: [`H`, `hB`], IM: [`H`, `h`, `hb`, `hB`], IN: [`h`, `H`], IO: [`H`, `h`, `hb`, `hB`], IQ: [`h`, `hB`, `hb`, `H`], IR: [`hB`, `H`], IS: [`H`], IT: [`H`, `hB`], JE: [`H`, `h`, `hb`, `hB`], JM: [`h`, `hb`, `H`, `hB`], JO: [`h`, `hB`, `hb`, `H`], JP: [`H`, `K`, `h`], KE: [`hB`, `hb`, `H`, `h`], KG: [`H`, `h`, `hB`, `hb`], KH: [`hB`, `h`, `H`, `hb`], KI: [`h`, `hb`, `H`, `hB`], KM: [`H`, `h`, `hB`, `hb`], KN: [`h`, `hb`, `H`, `hB`], KP: [`h`, `H`, `hB`, `hb`], KR: [`h`, `H`, `hB`, `hb`], KW: [`h`, `hB`, `hb`, `H`], KY: [`h`, `hb`, `H`, `hB`], KZ: [`H`, `hB`], LA: [`H`, `hb`, `hB`, `h`], LB: [`h`, `hB`, `hb`, `H`], LC: [`h`, `hb`, `H`, `hB`], LI: [`H`, `hB`, `h`], LK: [`H`, `h`, `hB`, `hb`], LR: [`h`, `hb`, `H`, `hB`], LS: [`h`, `H`], LT: [`H`, `h`, `hb`, `hB`], LU: [`H`, `h`, `hB`], LV: [`H`, `hB`, `hb`, `h`], LY: [`h`, `hB`, `hb`, `H`], MA: [`H`, `h`, `hB`, `hb`], MC: [`H`, `hB`], MD: [`H`, `hB`], ME: [`H`, `hB`, `h`], MF: [`H`, `hB`], MG: [`H`, `h`], MH: [`h`, `hb`, `H`, `hB`], MK: [`H`, `h`, `hb`, `hB`], ML: [`H`], MM: [`hB`, `hb`, `H`, `h`], MN: [`H`, `h`, `hb`, `hB`], MO: [`h`, `hB`, `hb`, `H`], MP: [`h`, `hb`, `H`, `hB`], MQ: [`H`, `hB`], MR: [`h`, `hB`, `hb`, `H`], MS: [`H`, `h`, `hb`, `hB`], MT: [`H`, `h`], MU: [`H`, `h`], MV: [`H`, `h`], MW: [`h`, `hb`, `H`, `hB`], MX: [`h`, `H`, `hB`, `hb`], MY: [`hb`, `hB`, `h`, `H`], MZ: [`H`, `hB`], NA: [`h`, `H`, `hB`, `hb`], NC: [`H`, `hB`], NE: [`H`], NF: [`H`, `h`, `hb`, `hB`], NG: [`H`, `h`, `hb`, `hB`], NI: [`h`, `H`, `hB`, `hb`], NL: [`H`, `hB`], NO: [`H`, `h`], NP: [`H`, `h`, `hB`], NR: [`H`, `h`, `hb`, `hB`], NU: [`H`, `h`, `hb`, `hB`], NZ: [`h`, `hb`, `H`, `hB`], OM: [`h`, `hB`, `hb`, `H`], PA: [`h`, `H`, `hB`, `hb`], PE: [`h`, `H`, `hB`, `hb`], PF: [`H`, `h`, `hB`], PG: [`h`, `H`], PH: [`h`, `hB`, `hb`, `H`], PK: [`h`, `hB`, `H`], PL: [`H`, `h`], PM: [`H`, `hB`], PN: [`H`, `h`, `hb`, `hB`], PR: [`h`, `H`, `hB`, `hb`], PS: [`h`, `hB`, `hb`, `H`], PT: [`H`, `hB`], PW: [`h`, `H`], PY: [`h`, `H`, `hB`, `hb`], QA: [`h`, `hB`, `hb`, `H`], RE: [`H`, `hB`], RO: [`H`, `hB`], RS: [`H`, `hB`, `h`], RU: [`H`], RW: [`H`, `h`], SA: [`h`, `hB`, `hb`, `H`], SB: [`h`, `hb`, `H`, `hB`], SC: [`H`, `h`, `hB`], SD: [`h`, `hB`, `hb`, `H`], SE: [`H`], SG: [`h`, `hb`, `H`, `hB`], SH: [`H`, `h`, `hb`, `hB`], SI: [`H`, `hB`], SJ: [`H`], SK: [`H`], SL: [`h`, `hb`, `H`, `hB`], SM: [`H`, `h`, `hB`], SN: [`H`, `h`, `hB`], SO: [`h`, `H`], SR: [`H`, `hB`], SS: [`h`, `hb`, `H`, `hB`], ST: [`H`, `hB`], SV: [`h`, `H`, `hB`, `hb`], SX: [`H`, `h`, `hb`, `hB`], SY: [`h`, `hB`, `hb`, `H`], SZ: [`h`, `hb`, `H`, `hB`], TA: [`H`, `h`, `hb`, `hB`], TC: [`h`, `hb`, `H`, `hB`], TD: [`h`, `H`, `hB`], TF: [`H`, `h`, `hB`], TG: [`H`, `hB`], TH: [`H`, `h`], TJ: [`H`, `h`], TL: [`H`, `hB`, `hb`, `h`], TM: [`H`, `h`], TN: [`h`, `hB`, `hb`, `H`], TO: [`h`, `H`], TR: [`H`, `hB`], TT: [`h`, `hb`, `H`, `hB`], TW: [`hB`, `hb`, `h`, `H`], TZ: [`hB`, `hb`, `H`, `h`], UA: [`H`, `hB`, `h`], UG: [`hB`, `hb`, `H`, `h`], UM: [`h`, `hb`, `H`, `hB`], US: [`h`, `hb`, `H`, `hB`], UY: [`h`, `H`, `hB`, `hb`], UZ: [`H`, `hB`, `h`], VA: [`H`, `h`, `hB`], VC: [`h`, `hb`, `H`, `hB`], VE: [`h`, `H`, `hB`, `hb`], VG: [`h`, `hb`, `H`, `hB`], VI: [`h`, `hb`, `H`, `hB`], VN: [`H`, `h`], VU: [`h`, `H`], WF: [`H`, `hB`], WS: [`h`, `H`], XK: [`H`, `hB`, `h`], YE: [`h`, `hB`, `hb`, `H`], YT: [`H`, `hB`], ZA: [`H`, `h`, `hb`, `hB`], ZM: [`h`, `hb`, `H`, `hB`], ZW: [`H`, `h`], "af-ZA": [`H`, `h`, `hB`, `hb`], "ar-001": [`h`, `hB`, `hb`, `H`], "ca-ES": [`H`, `h`, `hB`], "en-001": [`h`, `hb`, `H`, `hB`], "en-HK": [`h`, `hb`, `H`, `hB`], "en-IL": [`H`, `h`, `hb`, `hB`], "en-MY": [`h`, `hb`, `H`, `hB`], "es-BR": [`H`, `h`, `hB`, `hb`], "es-ES": [`H`, `h`, `hB`, `hb`], "es-GQ": [`H`, `h`, `hB`, `hb`], "fr-CA": [`H`, `h`, `hB`], "gl-ES": [`H`, `h`, `hB`], "gu-IN": [`hB`, `hb`, `h`, `H`], "hi-IN": [`hB`, `h`, `H`], "it-CH": [`H`, `h`, `hB`], "it-IT": [`H`, `h`, `hB`], "kn-IN": [`hB`, `h`, `H`], "ku-SY": [`H`, `hB`], "ml-IN": [`hB`, `h`, `H`], "mr-IN": [`hB`, `hb`, `h`, `H`], "pa-IN": [`hB`, `hb`, `h`, `H`], "ta-IN": [`hB`, `h`, `hb`, `H`], "te-IN": [`hB`, `h`, `H`], "zu-ZA": [`H`, `hB`, `hb`, `h`] };
|
|
2543
|
+
function Xi(e6, t2) {
|
|
2545
2544
|
let n2 = ``;
|
|
2546
2545
|
for (let r2 = 0; r2 < e6.length; r2++) {
|
|
2547
2546
|
let i2 = e6.charAt(r2);
|
|
2548
2547
|
if (i2 === `j`) {
|
|
2549
2548
|
let a2 = 0;
|
|
2550
2549
|
for (; r2 + 1 < e6.length && e6.charAt(r2 + 1) === i2; ) a2++, r2++;
|
|
2551
|
-
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 =
|
|
2550
|
+
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 = Zi(t2);
|
|
2552
2551
|
for ((c2 == `H` || c2 == `k`) && (s2 = 0); s2-- > 0; ) n2 += `a`;
|
|
2553
2552
|
for (; o2-- > 0; ) n2 = c2 + n2;
|
|
2554
2553
|
} else n2 += i2 === `J` ? `H` : i2;
|
|
2555
2554
|
}
|
|
2556
2555
|
return n2;
|
|
2557
2556
|
}
|
|
2558
|
-
function
|
|
2557
|
+
function Zi(e6) {
|
|
2559
2558
|
let t2 = e6.hourCycle;
|
|
2560
2559
|
if (t2 === void 0) {
|
|
2561
2560
|
let n3 = e6;
|
|
@@ -2574,36 +2573,36 @@ function Xi(e6) {
|
|
|
2574
2573
|
throw Error(`Invalid hourCycle`);
|
|
2575
2574
|
}
|
|
2576
2575
|
let n2 = e6.language, r2;
|
|
2577
|
-
return n2 !== `root` && (r2 = e6.maximize().region), (
|
|
2576
|
+
return n2 !== `root` && (r2 = e6.maximize().region), (W[`${n2}-${r2}`] || W[r2 || ``] || W[n2 || ``] || W[`${n2}-001`] || W[`001`])[0].charAt(0);
|
|
2578
2577
|
}
|
|
2579
|
-
var
|
|
2580
|
-
var
|
|
2581
|
-
function
|
|
2578
|
+
var Qi = RegExp(`^${Yi.source}*`);
|
|
2579
|
+
var $i = RegExp(`${Yi.source}*$`);
|
|
2580
|
+
function G(e6, t2) {
|
|
2582
2581
|
return { start: e6, end: t2 };
|
|
2583
2582
|
}
|
|
2584
|
-
var
|
|
2585
|
-
var
|
|
2586
|
-
var
|
|
2587
|
-
var
|
|
2583
|
+
var ea = !!Object.fromEntries;
|
|
2584
|
+
var ta = !!String.prototype.trimStart;
|
|
2585
|
+
var na = !!String.prototype.trimEnd;
|
|
2586
|
+
var ra = ea ? Object.fromEntries : function(e6) {
|
|
2588
2587
|
let t2 = {};
|
|
2589
2588
|
for (let [n2, r2] of e6) t2[n2] = r2;
|
|
2590
2589
|
return t2;
|
|
2591
2590
|
};
|
|
2592
|
-
var
|
|
2591
|
+
var ia = ta ? function(e6) {
|
|
2593
2592
|
return e6.trimStart();
|
|
2594
2593
|
} : function(e6) {
|
|
2595
|
-
return e6.replace(
|
|
2594
|
+
return e6.replace(Qi, ``);
|
|
2596
2595
|
};
|
|
2597
|
-
var
|
|
2596
|
+
var aa = na ? function(e6) {
|
|
2598
2597
|
return e6.trimEnd();
|
|
2599
2598
|
} : function(e6) {
|
|
2600
|
-
return e6.replace(
|
|
2599
|
+
return e6.replace($i, ``);
|
|
2601
2600
|
};
|
|
2602
|
-
var
|
|
2603
|
-
function
|
|
2604
|
-
return
|
|
2601
|
+
var oa = RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
2602
|
+
function sa(e6, t2) {
|
|
2603
|
+
return oa.lastIndex = t2, oa.exec(e6)[1] ?? ``;
|
|
2605
2604
|
}
|
|
2606
|
-
function
|
|
2605
|
+
function ca(e6) {
|
|
2607
2606
|
if (e6.length === 0) return null;
|
|
2608
2607
|
let t2 = 1, n2 = 1;
|
|
2609
2608
|
for (let r2 = 0; r2 < e6.length; ) {
|
|
@@ -2624,7 +2623,7 @@ function sa(e6) {
|
|
|
2624
2623
|
}
|
|
2625
2624
|
return { offset: e6.length, line: t2, column: n2 };
|
|
2626
2625
|
}
|
|
2627
|
-
var
|
|
2626
|
+
var la = class {
|
|
2628
2627
|
constructor(e6, t2 = {}) {
|
|
2629
2628
|
this.message = e6, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!t2.ignoreTag, this.locale = t2.locale, this.requiresOtherClause = !!t2.requiresOtherClause, this.shouldParseSkeletons = !!t2.shouldParseSkeletons;
|
|
2630
2629
|
}
|
|
@@ -2633,10 +2632,10 @@ var ca = class {
|
|
|
2633
2632
|
if (this.message.length > 0) {
|
|
2634
2633
|
let e6 = this.message.charCodeAt(0);
|
|
2635
2634
|
if (e6 !== 35 && e6 !== 39 && e6 !== 60 && e6 !== 123 && e6 !== 125) {
|
|
2636
|
-
let e7 =
|
|
2635
|
+
let e7 = ca(this.message);
|
|
2637
2636
|
if (e7) {
|
|
2638
2637
|
let t2 = this.clonePosition();
|
|
2639
|
-
return this.position = e7, { val: [{ type: 0, value: this.message, location:
|
|
2638
|
+
return this.position = e7, { val: [{ type: 0, value: this.message, location: G(t2, this.clonePosition()) }], err: null };
|
|
2640
2639
|
}
|
|
2641
2640
|
}
|
|
2642
2641
|
}
|
|
@@ -2653,11 +2652,11 @@ var ca = class {
|
|
|
2653
2652
|
} else if (i2 === 125 && e6 > 0) break;
|
|
2654
2653
|
else if (i2 === 35 && (t2 === `plural` || t2 === `selectordinal`)) {
|
|
2655
2654
|
let e7 = this.clonePosition();
|
|
2656
|
-
this.bump(), r2.push({ type: 7, location:
|
|
2655
|
+
this.bump(), r2.push({ type: 7, location: G(e7, this.clonePosition()) });
|
|
2657
2656
|
} else if (i2 === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2658
2657
|
if (n2) break;
|
|
2659
|
-
return this.error(26,
|
|
2660
|
-
} else if (i2 === 60 && !this.ignoreTag &&
|
|
2658
|
+
return this.error(26, G(this.clonePosition(), this.clonePosition()));
|
|
2659
|
+
} else if (i2 === 60 && !this.ignoreTag && ua(this.peek() || 0)) {
|
|
2661
2660
|
let n3 = this.parseTag(e6, t2);
|
|
2662
2661
|
if (n3.err) return n3;
|
|
2663
2662
|
r2.push(n3.val);
|
|
@@ -2673,23 +2672,23 @@ var ca = class {
|
|
|
2673
2672
|
let n2 = this.clonePosition();
|
|
2674
2673
|
this.bump();
|
|
2675
2674
|
let r2 = this.parseTagName();
|
|
2676
|
-
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location:
|
|
2675
|
+
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location: G(n2, this.clonePosition()) }, err: null };
|
|
2677
2676
|
if (this.bumpIf(`>`)) {
|
|
2678
2677
|
let i2 = this.parseMessage(e6 + 1, t2, true);
|
|
2679
2678
|
if (i2.err) return i2;
|
|
2680
2679
|
let a2 = i2.val, o2 = this.clonePosition();
|
|
2681
2680
|
if (this.bumpIf(`</`)) {
|
|
2682
|
-
if (this.isEOF() || !
|
|
2681
|
+
if (this.isEOF() || !ua(this.char())) return this.error(23, G(o2, this.clonePosition()));
|
|
2683
2682
|
let e7 = this.clonePosition();
|
|
2684
|
-
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location:
|
|
2683
|
+
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location: G(n2, this.clonePosition()) }, err: null } : this.error(23, G(o2, this.clonePosition()))) : this.error(26, G(e7, this.clonePosition()));
|
|
2685
2684
|
}
|
|
2686
|
-
return this.error(27,
|
|
2685
|
+
return this.error(27, G(n2, this.clonePosition()));
|
|
2687
2686
|
}
|
|
2688
|
-
return this.error(23,
|
|
2687
|
+
return this.error(23, G(n2, this.clonePosition()));
|
|
2689
2688
|
}
|
|
2690
2689
|
parseTagName() {
|
|
2691
2690
|
let e6 = this.offset();
|
|
2692
|
-
for (this.bump(); !this.isEOF() &&
|
|
2691
|
+
for (this.bump(); !this.isEOF() && fa(this.char()); ) this.bump();
|
|
2693
2692
|
return this.message.slice(e6, this.offset());
|
|
2694
2693
|
}
|
|
2695
2694
|
parseLiteral(e6, t2) {
|
|
@@ -2709,11 +2708,11 @@ var ca = class {
|
|
|
2709
2708
|
if (a2) r2 += a2;
|
|
2710
2709
|
else break;
|
|
2711
2710
|
}
|
|
2712
|
-
let i2 =
|
|
2711
|
+
let i2 = G(n2, this.clonePosition());
|
|
2713
2712
|
return { val: { type: 0, value: r2, location: i2 }, err: null };
|
|
2714
2713
|
}
|
|
2715
2714
|
tryParseLeftAngleBracket() {
|
|
2716
|
-
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !
|
|
2715
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !da(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
2717
2716
|
}
|
|
2718
2717
|
tryParseQuote(e6) {
|
|
2719
2718
|
if (this.isEOF() || this.char() !== 39) return null;
|
|
@@ -2753,29 +2752,29 @@ var ca = class {
|
|
|
2753
2752
|
}
|
|
2754
2753
|
parseArgument(e6, t2) {
|
|
2755
2754
|
let n2 = this.clonePosition();
|
|
2756
|
-
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2757
|
-
if (this.char() === 125) return this.bump(), this.error(2,
|
|
2755
|
+
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1, G(n2, this.clonePosition()));
|
|
2756
|
+
if (this.char() === 125) return this.bump(), this.error(2, G(n2, this.clonePosition()));
|
|
2758
2757
|
let r2 = this.parseIdentifierIfPossible().value;
|
|
2759
|
-
if (!r2) return this.error(3,
|
|
2760
|
-
if (this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2758
|
+
if (!r2) return this.error(3, G(n2, this.clonePosition()));
|
|
2759
|
+
if (this.bumpSpace(), this.isEOF()) return this.error(1, G(n2, this.clonePosition()));
|
|
2761
2760
|
switch (this.char()) {
|
|
2762
2761
|
case 125:
|
|
2763
|
-
return this.bump(), { val: { type: 1, value: r2, location:
|
|
2762
|
+
return this.bump(), { val: { type: 1, value: r2, location: G(n2, this.clonePosition()) }, err: null };
|
|
2764
2763
|
case 44:
|
|
2765
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1,
|
|
2764
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1, G(n2, this.clonePosition())) : this.parseArgumentOptions(e6, t2, r2, n2);
|
|
2766
2765
|
default:
|
|
2767
|
-
return this.error(3,
|
|
2766
|
+
return this.error(3, G(n2, this.clonePosition()));
|
|
2768
2767
|
}
|
|
2769
2768
|
}
|
|
2770
2769
|
parseIdentifierIfPossible() {
|
|
2771
|
-
let e6 = this.clonePosition(), t2 = this.offset(), n2 =
|
|
2772
|
-
return this.bumpTo(r2), { value: n2, location:
|
|
2770
|
+
let e6 = this.clonePosition(), t2 = this.offset(), n2 = sa(this.message, t2), r2 = t2 + n2.length;
|
|
2771
|
+
return this.bumpTo(r2), { value: n2, location: G(e6, this.clonePosition()) };
|
|
2773
2772
|
}
|
|
2774
2773
|
parseArgumentOptions(e6, t2, n2, r2) {
|
|
2775
2774
|
let i2 = this.clonePosition(), a2 = this.parseIdentifierIfPossible().value, o2 = this.clonePosition();
|
|
2776
2775
|
switch (a2) {
|
|
2777
2776
|
case ``:
|
|
2778
|
-
return this.error(4,
|
|
2777
|
+
return this.error(4, G(i2, o2));
|
|
2779
2778
|
case `number`:
|
|
2780
2779
|
case `date`:
|
|
2781
2780
|
case `time`: {
|
|
@@ -2785,15 +2784,15 @@ var ca = class {
|
|
|
2785
2784
|
this.bumpSpace();
|
|
2786
2785
|
let t4 = this.clonePosition(), n3 = this.parseSimpleArgStyleIfPossible();
|
|
2787
2786
|
if (n3.err) return n3;
|
|
2788
|
-
let r3 =
|
|
2789
|
-
if (r3.length === 0) return this.error(6,
|
|
2790
|
-
e7 = { style: r3, styleLocation:
|
|
2787
|
+
let r3 = aa(n3.val);
|
|
2788
|
+
if (r3.length === 0) return this.error(6, G(this.clonePosition(), this.clonePosition()));
|
|
2789
|
+
e7 = { style: r3, styleLocation: G(t4, this.clonePosition()) };
|
|
2791
2790
|
}
|
|
2792
2791
|
let t3 = this.tryParseArgumentClose(r2);
|
|
2793
2792
|
if (t3.err) return t3;
|
|
2794
|
-
let i3 =
|
|
2793
|
+
let i3 = G(r2, this.clonePosition());
|
|
2795
2794
|
if (e7 && e7.style.startsWith(`::`)) {
|
|
2796
|
-
let t4 =
|
|
2795
|
+
let t4 = ia(e7.style.slice(2));
|
|
2797
2796
|
if (a2 === `number`) {
|
|
2798
2797
|
let r3 = this.parseNumberSkeletonFromString(t4, e7.styleLocation);
|
|
2799
2798
|
return r3.err ? r3 : { val: { type: 2, value: n2, location: i3, style: r3.val }, err: null };
|
|
@@ -2801,8 +2800,8 @@ var ca = class {
|
|
|
2801
2800
|
{
|
|
2802
2801
|
if (t4.length === 0) return this.error(10, i3);
|
|
2803
2802
|
let r3 = t4;
|
|
2804
|
-
this.locale && (r3 =
|
|
2805
|
-
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ?
|
|
2803
|
+
this.locale && (r3 = Xi(t4, this.locale));
|
|
2804
|
+
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ? wi(r3) : {} };
|
|
2806
2805
|
return { val: { type: a2 === `date` ? 3 : 4, value: n2, location: i3, style: o3 }, err: null };
|
|
2807
2806
|
}
|
|
2808
2807
|
}
|
|
@@ -2812,11 +2811,11 @@ var ca = class {
|
|
|
2812
2811
|
case `selectordinal`:
|
|
2813
2812
|
case `select`: {
|
|
2814
2813
|
let i3 = this.clonePosition();
|
|
2815
|
-
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12,
|
|
2814
|
+
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12, G(i3, { ...i3 }));
|
|
2816
2815
|
this.bumpSpace();
|
|
2817
2816
|
let o3 = this.parseIdentifierIfPossible(), s2 = 0;
|
|
2818
2817
|
if (a2 !== `select` && o3.value === `offset`) {
|
|
2819
|
-
if (!this.bumpIf(`:`)) return this.error(13,
|
|
2818
|
+
if (!this.bumpIf(`:`)) return this.error(13, G(this.clonePosition(), this.clonePosition()));
|
|
2820
2819
|
this.bumpSpace();
|
|
2821
2820
|
let e7 = this.tryParseDecimalInteger(13, 14);
|
|
2822
2821
|
if (e7.err) return e7;
|
|
@@ -2826,15 +2825,15 @@ var ca = class {
|
|
|
2826
2825
|
if (c2.err) return c2;
|
|
2827
2826
|
let l2 = this.tryParseArgumentClose(r2);
|
|
2828
2827
|
if (l2.err) return l2;
|
|
2829
|
-
let u2 =
|
|
2830
|
-
return a2 === `select` ? { val: { type: 5, value: n2, options:
|
|
2828
|
+
let u2 = G(r2, this.clonePosition());
|
|
2829
|
+
return a2 === `select` ? { val: { type: 5, value: n2, options: ra(c2.val), location: u2 }, err: null } : { val: { type: 6, value: n2, options: ra(c2.val), offset: s2, pluralType: a2 === `plural` ? `cardinal` : `ordinal`, location: u2 }, err: null };
|
|
2831
2830
|
}
|
|
2832
2831
|
default:
|
|
2833
|
-
return this.error(5,
|
|
2832
|
+
return this.error(5, G(i2, o2));
|
|
2834
2833
|
}
|
|
2835
2834
|
}
|
|
2836
2835
|
tryParseArgumentClose(e6) {
|
|
2837
|
-
return this.isEOF() || this.char() !== 125 ? this.error(1,
|
|
2836
|
+
return this.isEOF() || this.char() !== 125 ? this.error(1, G(e6, this.clonePosition())) : (this.bump(), { val: true, err: null });
|
|
2838
2837
|
}
|
|
2839
2838
|
parseSimpleArgStyleIfPossible() {
|
|
2840
2839
|
let e6 = 0, t2 = this.clonePosition();
|
|
@@ -2842,7 +2841,7 @@ var ca = class {
|
|
|
2842
2841
|
case 39: {
|
|
2843
2842
|
this.bump();
|
|
2844
2843
|
let e7 = this.clonePosition();
|
|
2845
|
-
if (!this.bumpUntil(`'`)) return this.error(11,
|
|
2844
|
+
if (!this.bumpUntil(`'`)) return this.error(11, G(e7, this.clonePosition()));
|
|
2846
2845
|
this.bump();
|
|
2847
2846
|
break;
|
|
2848
2847
|
}
|
|
@@ -2861,11 +2860,11 @@ var ca = class {
|
|
|
2861
2860
|
parseNumberSkeletonFromString(e6, t2) {
|
|
2862
2861
|
let n2 = [];
|
|
2863
2862
|
try {
|
|
2864
|
-
n2 =
|
|
2863
|
+
n2 = Ei(e6);
|
|
2865
2864
|
} catch {
|
|
2866
2865
|
return this.error(7, t2);
|
|
2867
2866
|
}
|
|
2868
|
-
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ?
|
|
2867
|
+
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ? Ii(n2) : {} }, err: null };
|
|
2869
2868
|
}
|
|
2870
2869
|
tryParsePluralOrSelectOptions(e6, t2, n2, r2) {
|
|
2871
2870
|
let i2 = false, a2 = [], o2 = /* @__PURE__ */ new Set(), { value: s2, location: c2 } = r2;
|
|
@@ -2875,20 +2874,20 @@ var ca = class {
|
|
|
2875
2874
|
if (t2 !== `select` && this.bumpIf(`=`)) {
|
|
2876
2875
|
let t3 = this.tryParseDecimalInteger(16, 19);
|
|
2877
2876
|
if (t3.err) return t3;
|
|
2878
|
-
c2 =
|
|
2877
|
+
c2 = G(e7, this.clonePosition()), s2 = this.message.slice(e7.offset, this.offset());
|
|
2879
2878
|
} else break;
|
|
2880
2879
|
}
|
|
2881
2880
|
if (o2.has(s2)) return this.error(t2 === `select` ? 21 : 20, c2);
|
|
2882
2881
|
s2 === `other` && (i2 = true), this.bumpSpace();
|
|
2883
2882
|
let r3 = this.clonePosition();
|
|
2884
|
-
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18,
|
|
2883
|
+
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18, G(this.clonePosition(), this.clonePosition()));
|
|
2885
2884
|
let l2 = this.parseMessage(e6 + 1, t2, n2);
|
|
2886
2885
|
if (l2.err) return l2;
|
|
2887
2886
|
let u2 = this.tryParseArgumentClose(r3);
|
|
2888
2887
|
if (u2.err) return u2;
|
|
2889
|
-
a2.push([s2, { value: l2.val, location:
|
|
2888
|
+
a2.push([s2, { value: l2.val, location: G(r3, this.clonePosition()) }]), o2.add(s2), this.bumpSpace(), { value: s2, location: c2 } = this.parseIdentifierIfPossible();
|
|
2890
2889
|
}
|
|
2891
|
-
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16,
|
|
2890
|
+
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16, G(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !i2 ? this.error(22, G(this.clonePosition(), this.clonePosition())) : { val: a2, err: null };
|
|
2892
2891
|
}
|
|
2893
2892
|
tryParseDecimalInteger(e6, t2) {
|
|
2894
2893
|
let n2 = 1, r2 = this.clonePosition();
|
|
@@ -2899,7 +2898,7 @@ var ca = class {
|
|
|
2899
2898
|
if (e7 >= 48 && e7 <= 57) i2 = true, a2 = a2 * 10 + (e7 - 48), this.bump();
|
|
2900
2899
|
else break;
|
|
2901
2900
|
}
|
|
2902
|
-
let o2 =
|
|
2901
|
+
let o2 = G(r2, this.clonePosition());
|
|
2903
2902
|
return i2 ? (a2 *= n2, Number.isSafeInteger(a2) ? { val: a2, err: null } : this.error(t2, o2)) : this.error(e6, o2);
|
|
2904
2903
|
}
|
|
2905
2904
|
offset() {
|
|
@@ -2947,7 +2946,7 @@ var ca = class {
|
|
|
2947
2946
|
}
|
|
2948
2947
|
}
|
|
2949
2948
|
bumpSpace() {
|
|
2950
|
-
for (; !this.isEOF() &&
|
|
2949
|
+
for (; !this.isEOF() && pa(this.char()); ) this.bump();
|
|
2951
2950
|
}
|
|
2952
2951
|
peek() {
|
|
2953
2952
|
if (this.isEOF()) return null;
|
|
@@ -2955,34 +2954,34 @@ var ca = class {
|
|
|
2955
2954
|
return this.message.charCodeAt(t2 + (e6 >= 65536 ? 2 : 1)) ?? null;
|
|
2956
2955
|
}
|
|
2957
2956
|
};
|
|
2958
|
-
function la(e6) {
|
|
2959
|
-
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
2960
|
-
}
|
|
2961
2957
|
function ua(e6) {
|
|
2962
|
-
return
|
|
2958
|
+
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
2963
2959
|
}
|
|
2964
2960
|
function da(e6) {
|
|
2965
|
-
return e6
|
|
2961
|
+
return ua(e6) || e6 === 47;
|
|
2966
2962
|
}
|
|
2967
2963
|
function fa(e6) {
|
|
2968
|
-
return e6 >=
|
|
2964
|
+
return e6 === 45 || e6 === 46 || e6 >= 48 && e6 <= 57 || e6 === 95 || e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90 || e6 == 183 || e6 >= 192 && e6 <= 214 || e6 >= 216 && e6 <= 246 || e6 >= 248 && e6 <= 893 || e6 >= 895 && e6 <= 8191 || e6 >= 8204 && e6 <= 8205 || e6 >= 8255 && e6 <= 8256 || e6 >= 8304 && e6 <= 8591 || e6 >= 11264 && e6 <= 12271 || e6 >= 12289 && e6 <= 55295 || e6 >= 63744 && e6 <= 64975 || e6 >= 65008 && e6 <= 65533 || e6 >= 65536 && e6 <= 983039;
|
|
2969
2965
|
}
|
|
2970
2966
|
function pa(e6) {
|
|
2967
|
+
return e6 >= 9 && e6 <= 13 || e6 === 32 || e6 === 133 || e6 >= 8206 && e6 <= 8207 || e6 === 8232 || e6 === 8233;
|
|
2968
|
+
}
|
|
2969
|
+
function ma(e6) {
|
|
2971
2970
|
e6.forEach((e7) => {
|
|
2972
|
-
if (delete e7.location,
|
|
2973
|
-
else
|
|
2971
|
+
if (delete e7.location, Ui(e7) || Wi(e7)) for (let t2 in e7.options) delete e7.options[t2].location, ma(e7.options[t2].value);
|
|
2972
|
+
else Bi(e7) && qi(e7.style) || (Vi(e7) || Hi(e7)) && Ji(e7.style) ? delete e7.style.location : Ki(e7) && ma(e7.children);
|
|
2974
2973
|
});
|
|
2975
2974
|
}
|
|
2976
|
-
function
|
|
2975
|
+
function ha(e6, t2 = {}) {
|
|
2977
2976
|
t2 = { shouldParseSkeletons: true, requiresOtherClause: true, ...t2 };
|
|
2978
|
-
let n2 = new
|
|
2977
|
+
let n2 = new la(e6, t2).parse();
|
|
2979
2978
|
if (n2.err) {
|
|
2980
|
-
let e7 = SyntaxError(
|
|
2979
|
+
let e7 = SyntaxError(Li[n2.err.kind]);
|
|
2981
2980
|
throw e7.location = n2.err.location, e7.originalMessage = n2.err.message, e7;
|
|
2982
2981
|
}
|
|
2983
|
-
return t2?.captureLocation ||
|
|
2982
|
+
return t2?.captureLocation || ma(n2.val), n2.val;
|
|
2984
2983
|
}
|
|
2985
|
-
var
|
|
2984
|
+
var ga = class extends Error {
|
|
2986
2985
|
constructor(e6, t2, n2) {
|
|
2987
2986
|
super(e6), this.code = t2, this.originalMessage = n2;
|
|
2988
2987
|
}
|
|
@@ -2990,54 +2989,54 @@ var ha = class extends Error {
|
|
|
2990
2989
|
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
2991
2990
|
}
|
|
2992
2991
|
};
|
|
2993
|
-
var
|
|
2992
|
+
var _a = class extends ga {
|
|
2994
2993
|
constructor(e6, t2, n2, r2) {
|
|
2995
2994
|
super(`Invalid values for "${e6}": "${t2}". Options are "${Object.keys(n2).join(`", "`)}"`, `INVALID_VALUE`, r2);
|
|
2996
2995
|
}
|
|
2997
2996
|
};
|
|
2998
|
-
var
|
|
2997
|
+
var va = class extends ga {
|
|
2999
2998
|
constructor(e6, t2, n2) {
|
|
3000
2999
|
super(`Value for "${e6}" must be of type ${t2}`, `INVALID_VALUE`, n2);
|
|
3001
3000
|
}
|
|
3002
3001
|
};
|
|
3003
|
-
var
|
|
3002
|
+
var ya = class extends ga {
|
|
3004
3003
|
constructor(e6, t2) {
|
|
3005
3004
|
super(`The intl string context variable "${e6}" was not provided to the string "${t2}"`, `MISSING_VALUE`, t2);
|
|
3006
3005
|
}
|
|
3007
3006
|
};
|
|
3008
|
-
function
|
|
3007
|
+
function ba(e6) {
|
|
3009
3008
|
return e6.length < 2 ? e6 : e6.reduce((e7, t2) => {
|
|
3010
3009
|
let n2 = e7[e7.length - 1];
|
|
3011
3010
|
return !n2 || n2.type !== 0 || t2.type !== 0 ? e7.push(t2) : n2.value += t2.value, e7;
|
|
3012
3011
|
}, []);
|
|
3013
3012
|
}
|
|
3014
|
-
function
|
|
3013
|
+
function xa(e6) {
|
|
3015
3014
|
return typeof e6 == `function`;
|
|
3016
3015
|
}
|
|
3017
|
-
function
|
|
3018
|
-
if (e6.length === 1 &&
|
|
3016
|
+
function Sa(e6, t2, n2, r2, i2, a2, o2) {
|
|
3017
|
+
if (e6.length === 1 && Ri(e6[0])) return [{ type: 0, value: e6[0].value }];
|
|
3019
3018
|
let s2 = [];
|
|
3020
3019
|
for (let c2 of e6) {
|
|
3021
|
-
if (
|
|
3020
|
+
if (Ri(c2)) {
|
|
3022
3021
|
s2.push({ type: 0, value: c2.value });
|
|
3023
3022
|
continue;
|
|
3024
3023
|
}
|
|
3025
|
-
if (
|
|
3024
|
+
if (Gi(c2)) {
|
|
3026
3025
|
typeof a2 == `number` && s2.push({ type: 0, value: n2.getNumberFormat(t2).format(a2) });
|
|
3027
3026
|
continue;
|
|
3028
3027
|
}
|
|
3029
3028
|
let { value: e7 } = c2;
|
|
3030
|
-
if (!(i2 && e7 in i2)) throw new
|
|
3029
|
+
if (!(i2 && e7 in i2)) throw new ya(e7, o2);
|
|
3031
3030
|
let l2 = i2[e7];
|
|
3032
|
-
if (
|
|
3033
|
-
else if (
|
|
3034
|
-
let e8 = typeof c2.style == `string` ? r2.date[c2.style] :
|
|
3031
|
+
if (zi(c2)) (!l2 || typeof l2 == `string` || typeof l2 == `number` || typeof l2 == `bigint`) && (l2 = typeof l2 == `string` || typeof l2 == `number` || typeof l2 == `bigint` ? String(l2) : ``), s2.push({ type: typeof l2 == `string` ? 0 : 1, value: l2 });
|
|
3032
|
+
else if (Vi(c2)) {
|
|
3033
|
+
let e8 = typeof c2.style == `string` ? r2.date[c2.style] : Ji(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3035
3034
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3036
|
-
} else if (
|
|
3037
|
-
let e8 = typeof c2.style == `string` ? r2.time[c2.style] :
|
|
3035
|
+
} else if (Hi(c2)) {
|
|
3036
|
+
let e8 = typeof c2.style == `string` ? r2.time[c2.style] : Ji(c2.style) ? c2.style.parsedOptions : r2.time.medium;
|
|
3038
3037
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3039
|
-
} else if (
|
|
3040
|
-
let e8 = typeof c2.style == `string` ? r2.number[c2.style] :
|
|
3038
|
+
} else if (Bi(c2)) {
|
|
3039
|
+
let e8 = typeof c2.style == `string` ? r2.number[c2.style] : qi(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3041
3040
|
if (e8 && e8.scale) {
|
|
3042
3041
|
let t3 = e8.scale || 1;
|
|
3043
3042
|
if (typeof l2 == `bigint`) {
|
|
@@ -3047,40 +3046,40 @@ function xa(e6, t2, n2, r2, i2, a2, o2) {
|
|
|
3047
3046
|
}
|
|
3048
3047
|
s2.push({ type: 0, value: n2.getNumberFormat(t2, e8).format(l2) });
|
|
3049
3048
|
} else {
|
|
3050
|
-
if (
|
|
3049
|
+
if (Ki(c2)) {
|
|
3051
3050
|
let { children: e8, value: l3 } = c2, u2 = i2[l3];
|
|
3052
|
-
if (!
|
|
3053
|
-
let d2 = u2(
|
|
3051
|
+
if (!xa(u2)) throw new va(l3, `function`, o2);
|
|
3052
|
+
let d2 = u2(Sa(e8, t2, n2, r2, i2, a2).map((e9) => e9.value));
|
|
3054
3053
|
Array.isArray(d2) || (d2 = [d2]), s2.push(...d2.map((e9) => ({ type: typeof e9 == `string` ? 0 : 1, value: e9 })));
|
|
3055
3054
|
}
|
|
3056
|
-
if (
|
|
3055
|
+
if (Ui(c2)) {
|
|
3057
3056
|
let e8 = l2, a3 = (Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0) || c2.options.other;
|
|
3058
|
-
if (!a3) throw new
|
|
3059
|
-
s2.push(...
|
|
3060
|
-
} else if (
|
|
3057
|
+
if (!a3) throw new _a(c2.value, l2, Object.keys(c2.options), o2);
|
|
3058
|
+
s2.push(...Sa(a3.value, t2, n2, r2, i2));
|
|
3059
|
+
} else if (Wi(c2)) {
|
|
3061
3060
|
let e8 = `=${l2}`, a3 = Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0;
|
|
3062
3061
|
if (!a3) {
|
|
3063
|
-
if (!Intl.PluralRules) throw new
|
|
3062
|
+
if (!Intl.PluralRules) throw new ga(`Intl.PluralRules is not available in this environment.
|
|
3064
3063
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3065
3064
|
`, `MISSING_INTL_API`, o2);
|
|
3066
3065
|
let e9 = typeof l2 == `bigint` ? Number(l2) : l2, r3 = n2.getPluralRules(t2, { type: c2.pluralType }).select(e9 - (c2.offset || 0));
|
|
3067
3066
|
a3 = (Object.prototype.hasOwnProperty.call(c2.options, r3) ? c2.options[r3] : void 0) || c2.options.other;
|
|
3068
3067
|
}
|
|
3069
|
-
if (!a3) throw new
|
|
3068
|
+
if (!a3) throw new _a(c2.value, l2, Object.keys(c2.options), o2);
|
|
3070
3069
|
let u2 = typeof l2 == `bigint` ? Number(l2) : l2;
|
|
3071
|
-
s2.push(...
|
|
3070
|
+
s2.push(...Sa(a3.value, t2, n2, r2, i2, u2 - (c2.offset || 0)));
|
|
3072
3071
|
}
|
|
3073
3072
|
}
|
|
3074
3073
|
}
|
|
3075
|
-
return
|
|
3074
|
+
return ba(s2);
|
|
3076
3075
|
}
|
|
3077
|
-
function
|
|
3076
|
+
function Ca(e6, t2) {
|
|
3078
3077
|
return t2 ? { ...e6, ...t2, ...Object.keys(e6).reduce((n2, r2) => (n2[r2] = { ...e6[r2], ...t2[r2] }, n2), {}) } : e6;
|
|
3079
3078
|
}
|
|
3080
|
-
function
|
|
3081
|
-
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] =
|
|
3079
|
+
function wa(e6, t2) {
|
|
3080
|
+
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] = Ca(e6[r2], t2[r2]), n2), { ...e6 }) : e6;
|
|
3082
3081
|
}
|
|
3083
|
-
function
|
|
3082
|
+
function Ta(e6) {
|
|
3084
3083
|
return { create() {
|
|
3085
3084
|
return { get(t2) {
|
|
3086
3085
|
return e6[t2];
|
|
@@ -3089,23 +3088,23 @@ function wa(e6) {
|
|
|
3089
3088
|
} };
|
|
3090
3089
|
} };
|
|
3091
3090
|
}
|
|
3092
|
-
function
|
|
3093
|
-
return { getNumberFormat:
|
|
3091
|
+
function Ea(e6 = { number: {}, dateTime: {}, pluralRules: {} }) {
|
|
3092
|
+
return { getNumberFormat: di((...e7) => new Intl.NumberFormat(...e7), { cache: Ta(e6.number), strategy: Si.variadic }), getDateTimeFormat: di((...e7) => new Intl.DateTimeFormat(...e7), { cache: Ta(e6.dateTime), strategy: Si.variadic }), getPluralRules: di((...e7) => new Intl.PluralRules(...e7), { cache: Ta(e6.pluralRules), strategy: Si.variadic }) };
|
|
3094
3093
|
}
|
|
3095
|
-
var
|
|
3094
|
+
var Da = class e5 {
|
|
3096
3095
|
constructor(t2, n2 = e5.defaultLocale, r2, i2) {
|
|
3097
3096
|
if (this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} }, this.format = (e6) => {
|
|
3098
3097
|
let t3 = this.formatToParts(e6);
|
|
3099
3098
|
if (t3.length === 1) return t3[0].value;
|
|
3100
3099
|
let n3 = t3.reduce((e7, t4) => (!e7.length || t4.type !== 0 || typeof e7[e7.length - 1] != `string` ? e7.push(t4.value) : e7[e7.length - 1] += t4.value, e7), []);
|
|
3101
3100
|
return n3.length <= 1 ? n3[0] || `` : n3;
|
|
3102
|
-
}, this.formatToParts = (e6) =>
|
|
3101
|
+
}, this.formatToParts = (e6) => Sa(this.ast, this.locales, this.formatters, this.formats, e6, void 0, this.message), this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] }), this.getAst = () => this.ast, this.locales = n2, this.resolvedLocale = e5.resolveLocale(n2), typeof t2 == `string`) {
|
|
3103
3102
|
if (this.message = t2, !e5.__parse) throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3104
3103
|
let { ...n3 } = i2 || {};
|
|
3105
3104
|
this.ast = e5.__parse(t2, { ...n3, locale: this.resolvedLocale });
|
|
3106
3105
|
} else this.ast = t2;
|
|
3107
3106
|
if (!Array.isArray(this.ast)) throw TypeError(`A message must be provided as a String or AST.`);
|
|
3108
|
-
this.formats =
|
|
3107
|
+
this.formats = wa(e5.formats, r2), this.formatters = i2 && i2.formatters || Ea(this.formatterCache);
|
|
3109
3108
|
}
|
|
3110
3109
|
static {
|
|
3111
3110
|
this.memoizedDefaultLocale = null;
|
|
@@ -3121,14 +3120,14 @@ var Ea = class e5 {
|
|
|
3121
3120
|
};
|
|
3122
3121
|
}
|
|
3123
3122
|
static {
|
|
3124
|
-
this.__parse =
|
|
3123
|
+
this.__parse = ha;
|
|
3125
3124
|
}
|
|
3126
3125
|
static {
|
|
3127
3126
|
this.formats = { number: { integer: { maximumFractionDigits: 0 }, currency: { style: `currency` }, percent: { style: `percent` } }, date: { short: { month: `numeric`, day: `numeric`, year: `2-digit` }, medium: { month: `short`, day: `numeric`, year: `numeric` }, long: { month: `long`, day: `numeric`, year: `numeric` }, full: { weekday: `long`, month: `long`, day: `numeric`, year: `numeric` } }, time: { short: { hour: `numeric`, minute: `numeric` }, medium: { hour: `numeric`, minute: `numeric`, second: `numeric` }, long: { hour: `numeric`, minute: `numeric`, second: `numeric`, timeZoneName: `short` }, full: { hour: `numeric`, minute: `numeric`, second: `numeric`, timeZoneName: `short` } } };
|
|
3128
3127
|
}
|
|
3129
3128
|
};
|
|
3130
|
-
var
|
|
3131
|
-
function
|
|
3129
|
+
var Oa = [`__proto__`, `constructor`, `prototype`];
|
|
3130
|
+
function ka(e6, t2, n2) {
|
|
3132
3131
|
function r2(e7) {
|
|
3133
3132
|
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
3134
3133
|
}
|
|
@@ -3138,49 +3137,49 @@ function Oa(e6, t2, n2) {
|
|
|
3138
3137
|
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
3139
3138
|
if (i2()) return {};
|
|
3140
3139
|
var o2 = r2(a2.shift());
|
|
3141
|
-
if (
|
|
3140
|
+
if (Oa.indexOf(o2) > -1) return {};
|
|
3142
3141
|
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
3143
3142
|
}
|
|
3144
3143
|
if (i2()) return {};
|
|
3145
3144
|
var s2 = r2(a2.shift());
|
|
3146
|
-
return
|
|
3145
|
+
return Oa.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
3147
3146
|
}
|
|
3148
|
-
function
|
|
3149
|
-
var r2 =
|
|
3147
|
+
function Aa(e6, t2, n2) {
|
|
3148
|
+
var r2 = ka(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
3150
3149
|
i2 !== void 0 && (i2[a2] = n2);
|
|
3151
3150
|
}
|
|
3152
|
-
function
|
|
3153
|
-
var n2 =
|
|
3151
|
+
function ja(e6, t2) {
|
|
3152
|
+
var n2 = ka(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
3154
3153
|
if (r2) return r2[i2];
|
|
3155
3154
|
}
|
|
3156
|
-
function
|
|
3155
|
+
function Ma(e6) {
|
|
3157
3156
|
return [...arguments].slice(1).forEach(function(t2) {
|
|
3158
3157
|
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
3159
3158
|
var i2 = r2[n2];
|
|
3160
|
-
|
|
3159
|
+
Oa.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
3161
3160
|
}
|
|
3162
3161
|
}), e6;
|
|
3163
3162
|
}
|
|
3164
|
-
function
|
|
3165
|
-
return
|
|
3163
|
+
function Na(e6, t2) {
|
|
3164
|
+
return Ra(e6) || La(e6, t2) || Fa(e6, t2) || Pa();
|
|
3166
3165
|
}
|
|
3167
|
-
function
|
|
3166
|
+
function Pa() {
|
|
3168
3167
|
throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3169
3168
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3170
3169
|
}
|
|
3171
|
-
function
|
|
3170
|
+
function Fa(e6, t2) {
|
|
3172
3171
|
if (e6) {
|
|
3173
|
-
if (typeof e6 == `string`) return
|
|
3172
|
+
if (typeof e6 == `string`) return Ia(e6, t2);
|
|
3174
3173
|
var n2 = {}.toString.call(e6).slice(8, -1);
|
|
3175
|
-
return n2 === `Object` && e6.constructor && (n2 = e6.constructor.name), n2 === `Map` || n2 === `Set` ? Array.from(e6) : n2 === `Arguments` || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ?
|
|
3174
|
+
return n2 === `Object` && e6.constructor && (n2 = e6.constructor.name), n2 === `Map` || n2 === `Set` ? Array.from(e6) : n2 === `Arguments` || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ? Ia(e6, t2) : void 0;
|
|
3176
3175
|
}
|
|
3177
3176
|
}
|
|
3178
|
-
function
|
|
3177
|
+
function Ia(e6, t2) {
|
|
3179
3178
|
(t2 == null || t2 > e6.length) && (t2 = e6.length);
|
|
3180
3179
|
for (var n2 = 0, r2 = Array(t2); n2 < t2; n2++) r2[n2] = e6[n2];
|
|
3181
3180
|
return r2;
|
|
3182
3181
|
}
|
|
3183
|
-
function
|
|
3182
|
+
function La(e6, t2) {
|
|
3184
3183
|
var n2 = e6 == null ? null : typeof Symbol < `u` && e6[Symbol.iterator] || e6[`@@iterator`];
|
|
3185
3184
|
if (n2 != null) {
|
|
3186
3185
|
var r2, i2, a2, o2, s2 = [], c2 = true, l2 = false;
|
|
@@ -3201,10 +3200,10 @@ function Ia(e6, t2) {
|
|
|
3201
3200
|
return s2;
|
|
3202
3201
|
}
|
|
3203
3202
|
}
|
|
3204
|
-
function
|
|
3203
|
+
function Ra(e6) {
|
|
3205
3204
|
if (Array.isArray(e6)) return e6;
|
|
3206
3205
|
}
|
|
3207
|
-
function
|
|
3206
|
+
function za(e6, t2) {
|
|
3208
3207
|
var n2 = Object.keys(e6);
|
|
3209
3208
|
if (Object.getOwnPropertySymbols) {
|
|
3210
3209
|
var r2 = Object.getOwnPropertySymbols(e6);
|
|
@@ -3214,101 +3213,101 @@ function Ra(e6, t2) {
|
|
|
3214
3213
|
}
|
|
3215
3214
|
return n2;
|
|
3216
3215
|
}
|
|
3217
|
-
function
|
|
3216
|
+
function Ba(e6) {
|
|
3218
3217
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
3219
3218
|
var n2 = arguments[t2] == null ? {} : arguments[t2];
|
|
3220
|
-
t2 % 2 ?
|
|
3221
|
-
|
|
3222
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) :
|
|
3219
|
+
t2 % 2 ? za(Object(n2), true).forEach(function(t3) {
|
|
3220
|
+
Va(e6, t3, n2[t3]);
|
|
3221
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) : za(Object(n2)).forEach(function(t3) {
|
|
3223
3222
|
Object.defineProperty(e6, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
3224
3223
|
});
|
|
3225
3224
|
}
|
|
3226
3225
|
return e6;
|
|
3227
3226
|
}
|
|
3228
|
-
function
|
|
3229
|
-
return (t2 =
|
|
3227
|
+
function Va(e6, t2, n2) {
|
|
3228
|
+
return (t2 = Ga(t2)) in e6 ? Object.defineProperty(e6, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e6[t2] = n2, e6;
|
|
3230
3229
|
}
|
|
3231
|
-
function
|
|
3230
|
+
function Ha(e6, t2) {
|
|
3232
3231
|
if (!(e6 instanceof t2)) throw TypeError(`Cannot call a class as a function`);
|
|
3233
3232
|
}
|
|
3234
|
-
function
|
|
3233
|
+
function Ua(e6, t2) {
|
|
3235
3234
|
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
3236
3235
|
var r2 = t2[n2];
|
|
3237
|
-
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6,
|
|
3236
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6, Ga(r2.key), r2);
|
|
3238
3237
|
}
|
|
3239
3238
|
}
|
|
3240
|
-
function
|
|
3241
|
-
return t2 &&
|
|
3239
|
+
function Wa(e6, t2, n2) {
|
|
3240
|
+
return t2 && Ua(e6.prototype, t2), n2 && Ua(e6, n2), Object.defineProperty(e6, "prototype", { writable: false }), e6;
|
|
3242
3241
|
}
|
|
3243
|
-
function
|
|
3244
|
-
var t2 =
|
|
3245
|
-
return
|
|
3242
|
+
function Ga(e6) {
|
|
3243
|
+
var t2 = Ka(e6, `string`);
|
|
3244
|
+
return K(t2) == `symbol` ? t2 : t2 + ``;
|
|
3246
3245
|
}
|
|
3247
|
-
function
|
|
3248
|
-
if (
|
|
3246
|
+
function Ka(e6, t2) {
|
|
3247
|
+
if (K(e6) != `object` || !e6) return e6;
|
|
3249
3248
|
var n2 = e6[Symbol.toPrimitive];
|
|
3250
3249
|
if (n2 !== void 0) {
|
|
3251
3250
|
var r2 = n2.call(e6, t2 || `default`);
|
|
3252
|
-
if (
|
|
3251
|
+
if (K(r2) != `object`) return r2;
|
|
3253
3252
|
throw TypeError(`@@toPrimitive must return a primitive value.`);
|
|
3254
3253
|
}
|
|
3255
3254
|
return (t2 === `string` ? String : Number)(e6);
|
|
3256
3255
|
}
|
|
3257
|
-
function
|
|
3256
|
+
function K(e6) {
|
|
3258
3257
|
"@babel/helpers - typeof";
|
|
3259
|
-
return
|
|
3258
|
+
return K = typeof Symbol == `function` && typeof Symbol.iterator == `symbol` ? function(e7) {
|
|
3260
3259
|
return typeof e7;
|
|
3261
3260
|
} : function(e7) {
|
|
3262
3261
|
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3263
|
-
},
|
|
3262
|
+
}, K(e6);
|
|
3264
3263
|
}
|
|
3265
|
-
var
|
|
3266
|
-
var
|
|
3267
|
-
function
|
|
3264
|
+
var qa = `https://www.i18next.com/how-to/using-icu-or-mf2`;
|
|
3265
|
+
var Ja = [`zero`, `one`, `two`, `few`, `many`, `other`];
|
|
3266
|
+
function Ya() {
|
|
3268
3267
|
return { memoize: true, memoizeFallback: false, bindI18n: ``, bindI18nStore: ``, parseErrorHandler: function(e6, t2, n2, r2) {
|
|
3269
3268
|
return n2;
|
|
3270
3269
|
}, parseLngForICU: function(e6) {
|
|
3271
3270
|
return e6;
|
|
3272
3271
|
}, escapeVariables: false };
|
|
3273
3272
|
}
|
|
3274
|
-
function
|
|
3275
|
-
return n2 && t2 &&
|
|
3273
|
+
function Xa(e6, t2, n2, r2) {
|
|
3274
|
+
return n2 && t2 && K(t2) === `object` ? `${r2} resolved to an object or array, but i18next-icu does not support returnObjects or joinArrays and returns the raw value unformatted.` : n2 && typeof t2 == `string` && t2.indexOf(`{{`) > -1 ? `${r2} could not be parsed (${e6.message}). It contains "{{": i18next interpolation like {{name}} does not work with ICU, use {name}.` : `${r2} could not be ${n2 ? `parsed` : `formatted`}: ${e6.message}`;
|
|
3276
3275
|
}
|
|
3277
|
-
var
|
|
3276
|
+
var Za = function() {
|
|
3278
3277
|
function e6(t2) {
|
|
3279
|
-
|
|
3278
|
+
Ha(this, e6), this.type = `i18nFormat`, this.mem = {}, this.warned = /* @__PURE__ */ new Set(), this.init(null, t2);
|
|
3280
3279
|
}
|
|
3281
|
-
return
|
|
3280
|
+
return Wa(e6, [{ key: `init`, value: function(e7, t2) {
|
|
3282
3281
|
var n2 = this, r2 = e7 && e7.options && e7.options.i18nFormat || {};
|
|
3283
|
-
if (this.options =
|
|
3282
|
+
if (this.options = Ma(r2, t2, this.options || {}, Ya()), this.formats = this.options.formats, e7) {
|
|
3284
3283
|
var i2 = this.options, a2 = i2.bindI18n, o2 = i2.bindI18nStore, s2 = i2.memoize;
|
|
3285
|
-
e7.IntlMessageFormat =
|
|
3284
|
+
e7.IntlMessageFormat = Da, e7.ICU = this, this.i18next = e7, this.debug = !!(e7.options && e7.options.debug), this.debug && e7.options.interpolation && e7.options.interpolation.escapeValue !== false && !this.options.escapeVariables && this.warn(`interpolation.escapeValue is not applied, values are inserted without HTML escaping. Set the i18next-icu option escapeVariables: true to escape them, or interpolation.escapeValue: false if your output is escaped elsewhere (e.g. by React).`), s2 && (a2 && e7.on(a2, function() {
|
|
3286
3285
|
return n2.clearCache();
|
|
3287
3286
|
}), o2 && e7.store.on(o2, function() {
|
|
3288
3287
|
return n2.clearCache();
|
|
3289
3288
|
}));
|
|
3290
3289
|
}
|
|
3291
3290
|
} }, { key: `addUserDefinedFormats`, value: function(e7) {
|
|
3292
|
-
this.formats = this.formats ?
|
|
3291
|
+
this.formats = this.formats ? Ba(Ba({}, this.formats), e7) : e7, this.clearCache();
|
|
3293
3292
|
} }, { key: `parse`, value: function(e7, t2, n2, r2, i2, a2) {
|
|
3294
3293
|
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize && [n2, r2, i2], c2;
|
|
3295
3294
|
if (this.options.memoize) {
|
|
3296
|
-
var l2 =
|
|
3295
|
+
var l2 = ja(this.mem, s2);
|
|
3297
3296
|
l2 && l2.res === e7 && (c2 = l2.fc);
|
|
3298
3297
|
}
|
|
3299
3298
|
try {
|
|
3300
|
-
c2 || (this.debug && typeof e7 == `string` && e7.indexOf(`$t(`) > -1 && this.firstTime(`nesting ${n2} ${r2} ${i2}`) && this.warn(`key "${i2}" (${n2}/${r2}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`), c2 = new
|
|
3301
|
-
var u2 = t2 && t2.replace &&
|
|
3299
|
+
c2 || (this.debug && typeof e7 == `string` && e7.indexOf(`$t(`) > -1 && this.firstTime(`nesting ${n2} ${r2} ${i2}`) && this.warn(`key "${i2}" (${n2}/${r2}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`), c2 = new Da(e7, this.options.parseLngForICU(n2), this.formats, { ignoreTag: true }), this.options.memoize && (this.options.memoizeFallback || !a2 || o2) && Aa(this.mem, s2, { res: e7, fc: c2 }));
|
|
3300
|
+
var u2 = t2 && t2.replace && K(t2.replace) === `object` ? Ba(Ba({}, t2), t2.replace) : t2;
|
|
3302
3301
|
return c2.format(this.escapeVariableValues(u2));
|
|
3303
3302
|
} catch (a3) {
|
|
3304
|
-
return this.debug && this.firstTime(`error ${n2} ${r2} ${i2}`) && this.warn(
|
|
3303
|
+
return this.debug && this.firstTime(`error ${n2} ${r2} ${i2}`) && this.warn(Xa(a3, e7, !c2, `key "${i2}" (${n2}/${r2})`)), this.options.parseErrorHandler(a3, i2, e7, t2);
|
|
3305
3304
|
}
|
|
3306
3305
|
} }, { key: `addLookupKeys`, value: function(e7, t2, n2, r2, i2) {
|
|
3307
3306
|
return this.debug && i2 && this.checkSuffixKeys(t2, n2, r2, i2), e7;
|
|
3308
3307
|
} }, { key: `checkSuffixKeys`, value: function(e7, t2, n2, r2) {
|
|
3309
3308
|
var i2 = r2.count, a2 = r2.context, o2 = this.i18next.options, s2 = o2.pluralSeparator, c2 = s2 === void 0 ? `_` : s2, l2 = o2.contextSeparator, u2 = l2 === void 0 ? `_` : l2, d2 = this.i18next.services.resourceStore, f2 = `key "${e7}" (${t2}/${n2})`;
|
|
3310
3309
|
if (i2 !== void 0 && this.firstTime(`plural ${t2} ${n2} ${e7}`)) {
|
|
3311
|
-
var p2 =
|
|
3310
|
+
var p2 = Ja.concat(Ja.map(function(e8) {
|
|
3312
3311
|
return `ordinal${c2}${e8}`;
|
|
3313
3312
|
})).map(function(t3) {
|
|
3314
3313
|
return `${e7}${c2}${t3}`;
|
|
@@ -3322,33 +3321,33 @@ var Xa = function() {
|
|
|
3322
3321
|
} }, { key: `firstTime`, value: function(e7) {
|
|
3323
3322
|
return !this.warned.has(e7) && (this.warned.add(e7), true);
|
|
3324
3323
|
} }, { key: `warn`, value: function(e7) {
|
|
3325
|
-
this.i18next.services.logger.warn(`i18next-icu: ${e7} See ${
|
|
3324
|
+
this.i18next.services.logger.warn(`i18next-icu: ${e7} See ${qa}`);
|
|
3326
3325
|
} }, { key: `clearCache`, value: function() {
|
|
3327
3326
|
this.mem = {};
|
|
3328
3327
|
} }, { key: `escapeVariableValues`, value: function(e7) {
|
|
3329
|
-
if (!this.options.escapeVariables || !e7 ||
|
|
3328
|
+
if (!this.options.escapeVariables || !e7 || K(e7) !== `object`) return e7;
|
|
3330
3329
|
for (var t2 = {}, n2 = 0, r2 = Object.entries(e7); n2 < r2.length; n2++) {
|
|
3331
|
-
var i2 =
|
|
3330
|
+
var i2 = Na(r2[n2], 2), a2 = i2[0], o2 = i2[1];
|
|
3332
3331
|
t2[a2] = typeof o2 == `string` ? o2.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`) : o2;
|
|
3333
3332
|
}
|
|
3334
3333
|
return t2;
|
|
3335
3334
|
} }]), e6;
|
|
3336
3335
|
}();
|
|
3337
|
-
|
|
3338
|
-
function
|
|
3336
|
+
Za.type = `i18nFormat`;
|
|
3337
|
+
function Qa({ icuOptions: e6 = {}, ...t2 }) {
|
|
3339
3338
|
let { parseErrorHandler: n2 = void 0 } = t2;
|
|
3340
|
-
return
|
|
3339
|
+
return ui(t2, { icu: new Za({ parseErrorHandler: n2, bindI18n: t2.bindI18n, ...e6 }) });
|
|
3341
3340
|
}
|
|
3342
|
-
var
|
|
3341
|
+
var $a = (e6, t2, n2, r2) => {
|
|
3343
3342
|
let i2 = [n2, { code: t2, ...r2 || {} }];
|
|
3344
3343
|
if (e6?.services?.logger?.forward) return e6.services.logger.forward(i2, `warn`, `react-i18next::`, true);
|
|
3345
|
-
|
|
3344
|
+
q(i2[0]) && (i2[0] = `react-i18next:: ${i2[0]}`), e6?.services?.logger?.warn ? e6.services.logger.warn(...i2) : console?.warn && console.warn(...i2);
|
|
3346
3345
|
};
|
|
3347
|
-
var
|
|
3348
|
-
var
|
|
3349
|
-
|
|
3346
|
+
var eo = {};
|
|
3347
|
+
var to = (e6, t2, n2, r2) => {
|
|
3348
|
+
q(n2) && eo[n2] || (q(n2) && (eo[n2] = /* @__PURE__ */ new Date()), $a(e6, t2, n2, r2));
|
|
3350
3349
|
};
|
|
3351
|
-
var
|
|
3350
|
+
var no = (e6, t2) => () => {
|
|
3352
3351
|
if (e6.isInitialized) t2();
|
|
3353
3352
|
else {
|
|
3354
3353
|
let n2 = () => {
|
|
@@ -3359,29 +3358,29 @@ var to = (e6, t2) => () => {
|
|
|
3359
3358
|
e6.on(`initialized`, n2);
|
|
3360
3359
|
}
|
|
3361
3360
|
};
|
|
3362
|
-
var
|
|
3363
|
-
e6.loadNamespaces(t2,
|
|
3361
|
+
var ro = (e6, t2, n2) => {
|
|
3362
|
+
e6.loadNamespaces(t2, no(e6, n2));
|
|
3364
3363
|
};
|
|
3365
|
-
var
|
|
3366
|
-
if (
|
|
3364
|
+
var io = (e6, t2, n2, r2) => {
|
|
3365
|
+
if (q(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return ro(e6, n2, r2);
|
|
3367
3366
|
n2.forEach((t3) => {
|
|
3368
3367
|
e6.options.ns.indexOf(t3) < 0 && e6.options.ns.push(t3);
|
|
3369
|
-
}), e6.loadLanguages(t2,
|
|
3368
|
+
}), e6.loadLanguages(t2, no(e6, r2));
|
|
3370
3369
|
};
|
|
3371
|
-
var
|
|
3370
|
+
var ao = (e6, t2, n2 = {}) => !t2.languages || !t2.languages.length ? (to(t2, `NO_LANGUAGES`, `i18n.languages were undefined or empty`, { languages: t2.languages }), true) : t2.hasLoadedNamespace(e6, { lng: n2.lng, precheck: (t3, r2) => {
|
|
3372
3371
|
if (n2.bindI18n && n2.bindI18n.indexOf(`languageChanging`) > -1 && t3.services.backendConnector.backend && t3.isLanguageChangingTo && !r2(t3.isLanguageChangingTo, e6)) return false;
|
|
3373
3372
|
} });
|
|
3374
|
-
var
|
|
3375
|
-
var
|
|
3376
|
-
var
|
|
3377
|
-
var
|
|
3378
|
-
var
|
|
3379
|
-
var
|
|
3380
|
-
var
|
|
3381
|
-
var
|
|
3382
|
-
var
|
|
3383
|
-
var
|
|
3384
|
-
var
|
|
3373
|
+
var q = (e6) => typeof e6 == `string`;
|
|
3374
|
+
var oo = (e6) => typeof e6 == `object` && !!e6;
|
|
3375
|
+
var so = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3376
|
+
var co = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
3377
|
+
var lo = (e6) => co[e6];
|
|
3378
|
+
var uo = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e6) => e6.replace(so, lo) };
|
|
3379
|
+
var fo = () => uo;
|
|
3380
|
+
var po;
|
|
3381
|
+
var mo = () => po;
|
|
3382
|
+
var ho = (0, import_react.createContext)();
|
|
3383
|
+
var go = class {
|
|
3385
3384
|
constructor() {
|
|
3386
3385
|
this.usedNamespaces = {};
|
|
3387
3386
|
}
|
|
@@ -3394,32 +3393,32 @@ var ho = class {
|
|
|
3394
3393
|
return Object.keys(this.usedNamespaces);
|
|
3395
3394
|
}
|
|
3396
3395
|
};
|
|
3397
|
-
var
|
|
3396
|
+
var _o = (e6, t2) => {
|
|
3398
3397
|
let n2 = (0, import_react.useRef)();
|
|
3399
3398
|
return (0, import_react.useEffect)(() => {
|
|
3400
3399
|
n2.current = t2 ? n2.current : e6;
|
|
3401
3400
|
}, [e6, t2]), n2.current;
|
|
3402
3401
|
};
|
|
3403
|
-
var
|
|
3404
|
-
var
|
|
3405
|
-
var
|
|
3406
|
-
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = (0, import_react.useContext)(
|
|
3407
|
-
if (a2 && !a2.reportNamespaces && (a2.reportNamespaces = new
|
|
3408
|
-
|
|
3409
|
-
let e7 = (e8, t4) =>
|
|
3402
|
+
var vo = (e6, t2, n2, r2) => e6.getFixedT(t2, n2, r2);
|
|
3403
|
+
var yo = (e6, t2, n2, r2) => (0, import_react.useCallback)(vo(e6, t2, n2, r2), [e6, t2, n2, r2]);
|
|
3404
|
+
var bo = (e6, t2 = {}) => {
|
|
3405
|
+
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = (0, import_react.useContext)(ho) || {}, a2 = n2 || r2 || mo();
|
|
3406
|
+
if (a2 && !a2.reportNamespaces && (a2.reportNamespaces = new go()), !a2) {
|
|
3407
|
+
to(a2, `NO_I18NEXT_INSTANCE`, `useTranslation: You will need to pass in an i18next instance by using initReactI18next`);
|
|
3408
|
+
let e7 = (e8, t4) => q(t4) ? t4 : oo(t4) && q(t4.defaultValue) ? t4.defaultValue : Array.isArray(e8) ? e8[e8.length - 1] : e8, t3 = [e7, {}, false];
|
|
3410
3409
|
return t3.t = e7, t3.i18n = {}, t3.ready = false, t3;
|
|
3411
3410
|
}
|
|
3412
|
-
a2.options.react?.wait &&
|
|
3413
|
-
let o2 = { ...
|
|
3414
|
-
p2 =
|
|
3415
|
-
let m2 = (a2.isInitialized || a2.initializedStoreOnce) && p2.every((e7) =>
|
|
3411
|
+
a2.options.react?.wait && to(a2, `DEPRECATED_OPTION`, `useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);
|
|
3412
|
+
let o2 = { ...fo(), ...a2.options.react, ...t2 }, { useSuspense: s2, keyPrefix: u2 } = o2, p2 = e6 || i2 || a2.options?.defaultNS;
|
|
3413
|
+
p2 = q(p2) ? [p2] : p2 || [`translation`], a2.reportNamespaces.addUsedNamespaces?.(p2);
|
|
3414
|
+
let m2 = (a2.isInitialized || a2.initializedStoreOnce) && p2.every((e7) => ao(e7, a2, o2)), h2 = yo(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), g2 = () => h2, _2 = () => vo(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), [v2, y2] = (0, import_react.useState)(g2), b2 = p2.join();
|
|
3416
3415
|
t2.lng && (b2 = `${t2.lng}${b2}`);
|
|
3417
|
-
let x2 =
|
|
3416
|
+
let x2 = _o(b2), S2 = (0, import_react.useRef)(true);
|
|
3418
3417
|
(0, import_react.useEffect)(() => {
|
|
3419
3418
|
let { bindI18n: e7, bindI18nStore: n3 } = o2;
|
|
3420
|
-
S2.current = true, !m2 && !s2 && (t2.lng ?
|
|
3419
|
+
S2.current = true, !m2 && !s2 && (t2.lng ? io(a2, t2.lng, p2, () => {
|
|
3421
3420
|
S2.current && y2(_2);
|
|
3422
|
-
}) :
|
|
3421
|
+
}) : ro(a2, p2, () => {
|
|
3423
3422
|
S2.current && y2(_2);
|
|
3424
3423
|
})), m2 && x2 && x2 !== b2 && S2.current && y2(_2);
|
|
3425
3424
|
let r3 = () => {
|
|
@@ -3434,134 +3433,134 @@ var yo = (e6, t2 = {}) => {
|
|
|
3434
3433
|
let C2 = [v2, a2, m2];
|
|
3435
3434
|
if (C2.t = v2, C2.i18n = a2, C2.ready = m2, m2 || !m2 && !s2) return C2;
|
|
3436
3435
|
throw new Promise((e7) => {
|
|
3437
|
-
t2.lng ?
|
|
3436
|
+
t2.lng ? io(a2, t2.lng, p2, () => e7()) : ro(a2, p2, () => e7());
|
|
3438
3437
|
});
|
|
3439
3438
|
};
|
|
3440
|
-
function
|
|
3439
|
+
function xo({ i18n: e6, defaultNS: t2, children: n2 }) {
|
|
3441
3440
|
let r2 = (0, import_react.useMemo)(() => ({ i18n: e6, defaultNS: t2 }), [e6, t2]);
|
|
3442
|
-
return (0, import_react.createElement)(
|
|
3441
|
+
return (0, import_react.createElement)(ho.Provider, { value: r2 }, n2);
|
|
3443
3442
|
}
|
|
3444
|
-
var
|
|
3445
|
-
var
|
|
3446
|
-
var
|
|
3443
|
+
var So = F(`@wix/site-service-locale`);
|
|
3444
|
+
var Co = F(`@wix/site-service-renderer-configuration`);
|
|
3445
|
+
var wo = () => {
|
|
3447
3446
|
let e6, t2;
|
|
3448
3447
|
try {
|
|
3449
|
-
e6 = (0, import_services_manager_react.useService)(
|
|
3448
|
+
e6 = (0, import_services_manager_react.useService)(Co).languageCode;
|
|
3450
3449
|
} catch {
|
|
3451
3450
|
}
|
|
3452
3451
|
try {
|
|
3453
|
-
t2 = (0, import_services_manager_react.useService)(
|
|
3452
|
+
t2 = (0, import_services_manager_react.useService)(So).language;
|
|
3454
3453
|
} catch {
|
|
3455
3454
|
}
|
|
3456
3455
|
return e6 || t2;
|
|
3457
3456
|
};
|
|
3458
|
-
var
|
|
3459
|
-
var
|
|
3460
|
-
function
|
|
3457
|
+
var To = `wix-warmup-data`;
|
|
3458
|
+
var Eo = null;
|
|
3459
|
+
function Do(e6) {
|
|
3461
3460
|
if (typeof document < `u`) try {
|
|
3462
|
-
let t2 = document.getElementById(
|
|
3463
|
-
return t2 ? (
|
|
3461
|
+
let t2 = document.getElementById(To)?.textContent;
|
|
3462
|
+
return t2 ? (Eo?.text !== t2 && (Eo = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Eo.data[e6] ?? void 0) : void 0;
|
|
3464
3463
|
} catch {
|
|
3465
3464
|
return;
|
|
3466
3465
|
}
|
|
3467
3466
|
}
|
|
3468
|
-
var
|
|
3469
|
-
var
|
|
3470
|
-
var
|
|
3471
|
-
var
|
|
3472
|
-
var
|
|
3473
|
-
let t2 = e6.scope ??
|
|
3474
|
-
return n2 || (n2 = /* @__PURE__ */ new Map(),
|
|
3467
|
+
var Oo = 5e3;
|
|
3468
|
+
var ko = 100;
|
|
3469
|
+
var Ao = {};
|
|
3470
|
+
var jo = /* @__PURE__ */ new WeakMap();
|
|
3471
|
+
var Mo = (e6) => {
|
|
3472
|
+
let t2 = e6.scope ?? Ao, n2 = jo.get(t2);
|
|
3473
|
+
return n2 || (n2 = /* @__PURE__ */ new Map(), jo.set(t2, n2)), n2;
|
|
3475
3474
|
};
|
|
3476
|
-
function
|
|
3475
|
+
function No({ key: e6, warmupData: t2, fetchData: n2 }) {
|
|
3477
3476
|
if (e6 === null) return n2();
|
|
3478
3477
|
if (t2.isServer) return n2().then((n3) => (t2.set(e6, n3), n3));
|
|
3479
|
-
let r2 =
|
|
3478
|
+
let r2 = Mo(t2), i2 = Date.now();
|
|
3480
3479
|
for (let [e7, t3] of r2) t3.expiresAt <= i2 && r2.delete(e7);
|
|
3481
3480
|
let a2 = r2.get(e6);
|
|
3482
3481
|
if (a2) return a2.promise;
|
|
3483
|
-
let o2 =
|
|
3482
|
+
let o2 = Do(e6);
|
|
3484
3483
|
if (o2 !== void 0) {
|
|
3485
|
-
let t3 =
|
|
3486
|
-
return r2.set(e6, { promise: t3, expiresAt: i2 +
|
|
3484
|
+
let t3 = Vn(o2);
|
|
3485
|
+
return r2.set(e6, { promise: t3, expiresAt: i2 + Oo }), t3;
|
|
3487
3486
|
}
|
|
3488
3487
|
let s2 = (async () => await t2.get(e6) ?? n2())();
|
|
3489
|
-
r2.size >=
|
|
3488
|
+
r2.size >= ko && r2.delete(r2.keys().next().value);
|
|
3490
3489
|
let c2 = { promise: s2, expiresAt: 1 / 0 };
|
|
3491
3490
|
return r2.set(e6, c2), s2.then(() => {
|
|
3492
|
-
c2.expiresAt = Date.now() +
|
|
3491
|
+
c2.expiresAt = Date.now() + Oo;
|
|
3493
3492
|
}, () => {
|
|
3494
3493
|
r2.get(e6) === c2 && r2.delete(e6);
|
|
3495
3494
|
}), s2;
|
|
3496
3495
|
}
|
|
3497
|
-
var
|
|
3498
|
-
var
|
|
3499
|
-
var
|
|
3500
|
-
var
|
|
3501
|
-
function
|
|
3502
|
-
let n2 =
|
|
3496
|
+
var Po = `blog-builder:i18n`;
|
|
3497
|
+
var Fo = `translation`;
|
|
3498
|
+
var Io = () => Do(Po);
|
|
3499
|
+
var Lo = /* @__PURE__ */ new Map();
|
|
3500
|
+
function Ro(e6, t2) {
|
|
3501
|
+
let n2 = Lo.get(e6);
|
|
3503
3502
|
if (n2) return n2;
|
|
3504
|
-
let r2 =
|
|
3505
|
-
return
|
|
3503
|
+
let r2 = Io(), i2 = r2?.locale === e6 ? r2.messages : void 0, a2 = Qa({ locale: e6, useSuspense: true, ...i2 ? { messages: i2 } : { asyncMessagesLoader: t2 } });
|
|
3504
|
+
return Lo.set(e6, a2), a2;
|
|
3506
3505
|
}
|
|
3507
|
-
function
|
|
3508
|
-
let t2 = () => e6.loadNamespaces(
|
|
3506
|
+
function zo(e6) {
|
|
3507
|
+
let t2 = () => e6.loadNamespaces(Fo).then(() => void 0, () => void 0);
|
|
3509
3508
|
return e6.isInitialized ? t2() : new Promise((n2) => {
|
|
3510
3509
|
e6.on(`initialized`, () => void t2().then(n2));
|
|
3511
3510
|
});
|
|
3512
3511
|
}
|
|
3513
|
-
function
|
|
3512
|
+
function Bo(e6, t2) {
|
|
3514
3513
|
return e6.getResourceBundle(t2, `translation`) ?? e6.getResourceBundle(`en`, `translation`);
|
|
3515
3514
|
}
|
|
3516
|
-
var
|
|
3515
|
+
var Vo = (e6, t2, n2) => {
|
|
3517
3516
|
let r2 = t2.lastIndexOf(`?`), i2 = e6[r2 === -1 || r2 < t2.lastIndexOf(`/`) ? t2 : t2.slice(0, r2)];
|
|
3518
3517
|
return i2 ? typeof i2 == `function` ? i2() : Promise.resolve(i2) : new Promise((e7, r3) => {
|
|
3519
3518
|
(typeof queueMicrotask == `function` ? queueMicrotask : setTimeout)(r3.bind(null, Error(`Unknown variable dynamic import: ` + t2 + (t2.split(`/`).length === n2 ? `` : `. Note that variables only represent file names one level deep.`))));
|
|
3520
3519
|
});
|
|
3521
3520
|
};
|
|
3522
|
-
var
|
|
3523
|
-
|
|
3524
|
-
var
|
|
3525
|
-
function
|
|
3526
|
-
let t2 =
|
|
3527
|
-
return t2 || (t2 =
|
|
3521
|
+
var Ho = (e6) => e6.split(`-`)[0] ?? e6;
|
|
3522
|
+
br({ isDev: false, loadMessages: (e6) => Vo(Object.assign({ "../assets/locale/messages_en.dev.json": () => yn(() => Promise.resolve().then(() => qo), void 0, import_meta.url), "../assets/locale/messages_en.json": () => yn(() => Promise.resolve().then(() => Yo), void 0, import_meta.url) }), `../assets/locale/messages_${Ho(e6)}.json`, 4), loadDevMessages: (e6) => Vo(Object.assign({ "../assets/locale/messages_en.dev.json": () => yn(() => Promise.resolve().then(() => qo), void 0, import_meta.url) }), `../assets/locale/messages_${Ho(e6)}.dev.json`, 4) });
|
|
3523
|
+
var Uo = /* @__PURE__ */ new WeakMap();
|
|
3524
|
+
function Wo(e6) {
|
|
3525
|
+
let t2 = Uo.get(e6);
|
|
3526
|
+
return t2 || (t2 = zo(e6).finally(() => Uo.delete(e6)), Uo.set(e6, t2)), t2;
|
|
3528
3527
|
}
|
|
3529
|
-
function
|
|
3530
|
-
let n2 =
|
|
3528
|
+
function Go({ i18n: e6, locale: t2 }) {
|
|
3529
|
+
let n2 = Kn(), r2 = _r();
|
|
3531
3530
|
if (!n2) return null;
|
|
3532
|
-
if (!e6.isInitialized || !e6.hasLoadedNamespace(`translation`)) throw
|
|
3533
|
-
let i2 =
|
|
3534
|
-
return i2 && r2.set(
|
|
3535
|
-
}
|
|
3536
|
-
function
|
|
3537
|
-
let t2 =
|
|
3538
|
-
return { i18n:
|
|
3539
|
-
}
|
|
3540
|
-
var
|
|
3541
|
-
var
|
|
3542
|
-
var
|
|
3543
|
-
var
|
|
3544
|
-
var
|
|
3545
|
-
var
|
|
3546
|
-
var
|
|
3547
|
-
let n2 =
|
|
3531
|
+
if (!e6.isInitialized || !e6.hasLoadedNamespace(`translation`)) throw Wo(e6);
|
|
3532
|
+
let i2 = Bo(e6, t2);
|
|
3533
|
+
return i2 && r2.set(Po, { locale: t2, messages: i2 }), null;
|
|
3534
|
+
}
|
|
3535
|
+
function Ko(e6) {
|
|
3536
|
+
let t2 = wo(), n2 = Io()?.locale ?? t2 ?? `en`;
|
|
3537
|
+
return { i18n: Ro(n2, e6), locale: n2 };
|
|
3538
|
+
}
|
|
3539
|
+
var qo = y({ default: () => Jo });
|
|
3540
|
+
var Jo = { "post.time-to-read": `{count, plural, one {# min read} other {# min read}}`, "post.view-count": `{count, plural, one {{formatted} view} other {{formatted} views}}`, "post.comment-count": `{count, plural, one {{formatted} comment} other {{formatted} comments}}`, "post.like-count": `{count, plural, one {{formatted} like} other {{formatted} likes}}`, "post-list.empty-state.title": `No posts yet`, "post-list.empty-state.description": `Once posts are published, they will appear here.`, "related-posts.empty-state.title": `No related posts yet`, "related-posts.empty-state.description": `Once more posts are published, they will appear here.`, "post-actions.like": `Like post`, "post-actions.unlike": `Unlike post`, "post-actions.share": `Share post`, "post-actions.share-dialog": `Share post`, "post-actions.link-copied": `Link copied`, "post-actions.copy-manually": `Copy the link below to share this post.`, "post-actions.link-label": `Post link`, "post-actions.copy-link": `Copy link`, "post-actions.close": `Close`, "post-counters.loading-likes": `Loading likes`, "cover-media.play": `Play video`, "cover-media.placeholder-alt": `Post cover image`, "post-comments.loading": `Loading comments\u2026`, "post-comments.no-post": `No post resolved for this URL yet.`, "post-comments.unavailable": `Comments are unavailable \u2014 no app instance.`, "post-comments.demo-notice": `Sample comments are shown while editing. Visitors will see real comments.`, "canvas.post-title": `Post Title`, "canvas.author-name": `Author Name`, "canvas.excerpt": `Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.`, "canvas.content": `This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`, "canvas.category": `Category`, "canvas.category-numbered": `Category {number}`, "canvas.tag-numbered": `Tag {number}`, "canvas.author-photo-alt": `Author photo`, "category-header.all-posts": `All Posts` };
|
|
3541
|
+
var Yo = y({ default: () => Zo, title: () => Xo });
|
|
3542
|
+
var Xo = `My App`;
|
|
3543
|
+
var Zo = { "canvas.category": `Category`, "post-list.empty-state.description": `Once posts are published, they will appear here.`, "canvas.tag-numbered": `Tag {number}`, "cover-media.play": `Play video`, "post-comments.unavailable": `Comments are unavailable \u2014 no app instance.`, "post-counters.loading-likes": `Loading likes`, "post-comments.loading": `Loading comments\u2026`, "post-actions.like": `Like post`, "canvas.content": `This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`, "related-posts.empty-state.title": `No related posts yet`, "post.time-to-read": `{count, plural, one {# min read} other {# min read}}`, "post-actions.link-copied": `Link copied`, "category-header.all-posts": `All Posts`, "post-actions.copy-manually": `Copy the link below to share this post.`, "post-actions.copy-link": `Copy link`, "cover-media.placeholder-alt": `Post cover image`, "post-actions.link-label": `Post link`, "post-list.empty-state.title": `No posts yet`, "post-actions.share-dialog": `Share post`, "canvas.post-title": `Post Title`, "post-actions.unlike": `Unlike post`, "post-comments.no-post": `No post resolved for this URL yet.`, "post.like-count": `{count, plural, one {{formatted} like} other {{formatted} likes}}`, "canvas.category-numbered": `Category {number}`, "post.comment-count": `{count, plural, one {{formatted} comment} other {{formatted} comments}}`, "post-actions.share": `Share post`, "post.view-count": `{count, plural, one {{formatted} view} other {{formatted} views}}`, "post-actions.close": `Close`, "canvas.category-description": `Add a short description of this category so readers know what they will find here. It shows under the category title, above the posts.`, "canvas.author-photo-alt": `Author photo`, "canvas.author-name": `Author Name`, "post-comments.demo-notice": `Sample comments are shown while editing. Visitors will see real comments.`, title: Xo, "related-posts.empty-state.description": `Once more posts are published, they will appear here.`, "canvas.excerpt": `Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.` };
|
|
3544
|
+
var Qo = Object.assign({ "../assets/locale/messages_en.dev.json": qo, "../assets/locale/messages_en.json": Yo });
|
|
3545
|
+
var $o = (e6, t2) => {
|
|
3546
|
+
let n2 = Qo[`../assets/locale/messages_${Ho(e6)}${t2}.json`];
|
|
3548
3547
|
return n2 ? Promise.resolve(n2) : Promise.reject(Error(`no messages file`));
|
|
3549
3548
|
};
|
|
3550
|
-
var
|
|
3551
|
-
var
|
|
3552
|
-
var
|
|
3553
|
-
function
|
|
3549
|
+
var es = br({ isDev: false, loadMessages: (e6) => $o(e6, ``), loadDevMessages: (e6) => $o(e6, `.dev`) });
|
|
3550
|
+
var ts = [{ path: `richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `richContent.nodes.galleryData.items.image.media.duration` }, { path: `richContent.nodes.galleryData.items.video.media.duration` }, { path: `richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `richContent.nodes.galleryData.options.item.ratio` }, { path: `richContent.nodes.imageData.image.duration` }, { path: `richContent.nodes.imageData.crop.x` }, { path: `richContent.nodes.imageData.crop.y` }, { path: `richContent.nodes.imageData.crop.width` }, { path: `richContent.nodes.imageData.crop.height` }, { path: `richContent.nodes.mapData.mapSettings.lat` }, { path: `richContent.nodes.mapData.mapSettings.lng` }, { path: `richContent.nodes.pollData.poll.image.duration` }, { path: `richContent.nodes.pollData.poll.options.image.duration` }, { path: `richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.nodes.appEmbedData.image.duration` }, { path: `richContent.nodes.videoData.video.duration` }, { path: `richContent.nodes.videoData.thumbnail.duration` }, { path: `richContent.nodes.audioData.audio.duration` }, { path: `richContent.nodes.audioData.coverImage.duration` }, { path: `richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `richContent.nodes.layoutData.background.gradient.centerX` }, { path: `richContent.nodes.layoutData.background.gradient.centerY` }, { path: `richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `richContent.nodes.shapeData.shape.duration` }, { path: `richContent.nodes.cardData.background.gradient.centerX` }, { path: `richContent.nodes.cardData.background.gradient.centerY` }, { path: `richContent.nodes.cardData.background.gradient.stops.position` }, { path: `richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `richContent.nodes.tocData.fontSize` }, { path: `richContent.nodes.tocData.itemSpacing` }, { path: `richContent.nodes.smartBlockCellData.shape.duration` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
3551
|
+
var ns = [{ path: `richContent.metadata.createdTimestamp` }, { path: `richContent.metadata.updatedTimestamp` }];
|
|
3552
|
+
function rs(e6) {
|
|
3554
3553
|
return P(Object.assign(e6, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], _: [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/blog-paywall-service/v1/post-paywalls`, destPath: `/v1/post-paywalls` }] } }));
|
|
3555
3554
|
}
|
|
3556
|
-
var
|
|
3557
|
-
function
|
|
3555
|
+
var is = `@wix/auto_sdk_blog_post-paywalls`;
|
|
3556
|
+
function as(e6) {
|
|
3558
3557
|
function t2({ host: t3 }) {
|
|
3559
|
-
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName:
|
|
3558
|
+
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName: is, migrationOptions: { optInTransformResponse: true }, url: rs({ protoPath: `/v1/post-paywalls/{postFqdn}/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: fn, paths: ts }, { transformFn: k, paths: ns }]) };
|
|
3560
3559
|
}
|
|
3561
3560
|
return t2;
|
|
3562
3561
|
}
|
|
3563
|
-
async function
|
|
3564
|
-
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 =
|
|
3562
|
+
async function os(e6, t2) {
|
|
3563
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = as(D({ postFqdn: e6?.postFqdn, postId: e6?.postId, language: t2?.language }, []));
|
|
3565
3564
|
r2?.onSiteCall?.();
|
|
3566
3565
|
try {
|
|
3567
3566
|
let e7 = await n2.request(i2);
|
|
@@ -3571,29 +3570,29 @@ async function as(e6, t2) {
|
|
|
3571
3570
|
throw r2?.onError?.(e7), t3;
|
|
3572
3571
|
}
|
|
3573
3572
|
}
|
|
3574
|
-
function
|
|
3575
|
-
return (t2, n2) =>
|
|
3573
|
+
function ss(e6) {
|
|
3574
|
+
return (t2, n2) => os(t2, n2, { httpClient: e6 });
|
|
3576
3575
|
}
|
|
3577
|
-
var
|
|
3578
|
-
function
|
|
3576
|
+
var cs = M(ss);
|
|
3577
|
+
function ls(e6) {
|
|
3579
3578
|
return Object.keys(e6).length === 1 && `$and` in e6 && Array.isArray(e6.$and);
|
|
3580
3579
|
}
|
|
3581
|
-
function
|
|
3580
|
+
function us(e6) {
|
|
3582
3581
|
return Object.keys(e6).length === 1 && `$or` in e6 && Array.isArray(e6.$or);
|
|
3583
3582
|
}
|
|
3584
|
-
function
|
|
3583
|
+
function ds(e6) {
|
|
3585
3584
|
return Object.keys(e6).length === 1 && `$not` in e6 && typeof e6.$not == `object`;
|
|
3586
3585
|
}
|
|
3587
|
-
function
|
|
3588
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...
|
|
3586
|
+
function J(e6, t2) {
|
|
3587
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...ls(e6) ? e6.$and : [e6], ...ls(t2) ? t2.$and : [t2]] };
|
|
3589
3588
|
}
|
|
3590
|
-
function
|
|
3591
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...
|
|
3589
|
+
function fs(e6, t2) {
|
|
3590
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...us(e6) ? e6.$or : [e6], ...us(t2) ? t2.$or : [t2]] };
|
|
3592
3591
|
}
|
|
3593
|
-
function
|
|
3594
|
-
if (e6 !== void 0 && Object.keys(e6).length !== 0) return
|
|
3592
|
+
function ps(e6) {
|
|
3593
|
+
if (e6 !== void 0 && Object.keys(e6).length !== 0) return ds(e6) ? e6.$not : { $not: e6 };
|
|
3595
3594
|
}
|
|
3596
|
-
var
|
|
3595
|
+
var ms = class {
|
|
3597
3596
|
_items;
|
|
3598
3597
|
_fetchNextPage;
|
|
3599
3598
|
_fetchPrevPage;
|
|
@@ -3623,7 +3622,7 @@ var ps = class {
|
|
|
3623
3622
|
return await this._fetchPrevPage();
|
|
3624
3623
|
}
|
|
3625
3624
|
};
|
|
3626
|
-
var
|
|
3625
|
+
var hs = class extends ms {
|
|
3627
3626
|
_nextCursor;
|
|
3628
3627
|
_prevCursor;
|
|
3629
3628
|
cursors;
|
|
@@ -3637,7 +3636,7 @@ var ms = class extends ps {
|
|
|
3637
3636
|
return !!this._prevCursor;
|
|
3638
3637
|
}
|
|
3639
3638
|
};
|
|
3640
|
-
var
|
|
3639
|
+
var gs = class extends ms {
|
|
3641
3640
|
_totalCount;
|
|
3642
3641
|
_offset;
|
|
3643
3642
|
_tooManyToCount;
|
|
@@ -3660,76 +3659,76 @@ var hs = class extends ps {
|
|
|
3660
3659
|
return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
|
|
3661
3660
|
}
|
|
3662
3661
|
};
|
|
3663
|
-
function
|
|
3662
|
+
function _s(e6) {
|
|
3664
3663
|
let t2 = (n2) => ({ query: n2, async find() {
|
|
3665
3664
|
try {
|
|
3666
3665
|
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [$e]: a2, [et]: o2 } = e6.responseTransformer(i2);
|
|
3667
3666
|
if (e6.pagingMethod === `OFFSET`) {
|
|
3668
3667
|
let e7 = n2;
|
|
3669
|
-
return new
|
|
3668
|
+
return new gs({ items: a2 ?? [], fetchNextPage: () => t2({ ...e7, paging: { offset: e7.paging.offset + e7.paging.limit, limit: e7.paging.limit } }).find(), fetchPrevPage: () => t2({ ...n2, paging: { offset: Math.max(e7.paging.offset - e7.paging.limit, 0), limit: e7.paging.limit } }).find(), offset: e7.paging.offset, limit: e7.paging.limit, totalCount: o2?.total, tooManyToCount: o2?.tooManyToCount, originQuery: this });
|
|
3670
3669
|
}
|
|
3671
3670
|
let s2 = n2.cursorPaging;
|
|
3672
|
-
return new
|
|
3671
|
+
return new hs({ items: a2 ?? [], limit: s2.limit, originQuery: this, fetchNextPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.next ?? void 0, limit: s2.limit } }).find(), fetchPrevPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.prev ?? void 0, limit: s2.limit } }).find(), prevCursor: o2?.cursors?.prev ?? void 0, nextCursor: o2?.cursors?.next ?? void 0 });
|
|
3673
3672
|
} catch (t3) {
|
|
3674
3673
|
throw e6.errorTransformer(t3);
|
|
3675
3674
|
}
|
|
3676
3675
|
}, skipTo(e7) {
|
|
3677
3676
|
return t2({ ...n2, cursorPaging: { cursor: e7, limit: n2.cursorPaging.limit } });
|
|
3678
3677
|
}, eq(r2, i2) {
|
|
3679
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3680
|
-
return t2({ ...n2, filter:
|
|
3678
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [Y(e6.transformationPaths, r2)]: a2 };
|
|
3679
|
+
return t2({ ...n2, filter: J(n2.filter, o2) });
|
|
3681
3680
|
}, ne(r2, i2) {
|
|
3682
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3683
|
-
return t2({ ...n2, filter:
|
|
3681
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [Y(e6.transformationPaths, r2)]: { $ne: a2 } };
|
|
3682
|
+
return t2({ ...n2, filter: J(n2.filter, o2) });
|
|
3684
3683
|
}, ge(r2, i2) {
|
|
3685
|
-
let a2 = { [
|
|
3686
|
-
return t2({ ...n2, filter:
|
|
3684
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $gte: i2 } };
|
|
3685
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3687
3686
|
}, gt(r2, i2) {
|
|
3688
|
-
let a2 = { [
|
|
3689
|
-
return t2({ ...n2, filter:
|
|
3687
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $gt: i2 } };
|
|
3688
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3690
3689
|
}, le(r2, i2) {
|
|
3691
|
-
let a2 = { [
|
|
3692
|
-
return t2({ ...n2, filter:
|
|
3690
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $lte: i2 } };
|
|
3691
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3693
3692
|
}, lt(r2, i2) {
|
|
3694
|
-
let a2 = { [
|
|
3695
|
-
return t2({ ...n2, filter:
|
|
3693
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $lt: i2 } };
|
|
3694
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3696
3695
|
}, isNotEmpty(e7) {
|
|
3697
3696
|
return this.ne(e7, null);
|
|
3698
3697
|
}, isEmpty(e7) {
|
|
3699
3698
|
return this.eq(e7, null);
|
|
3700
3699
|
}, startsWith(r2, i2) {
|
|
3701
|
-
let a2 = { [
|
|
3702
|
-
return t2({ ...n2, filter:
|
|
3700
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $startsWith: i2 } };
|
|
3701
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3703
3702
|
}, endsWith(r2, i2) {
|
|
3704
|
-
let a2 = { [
|
|
3705
|
-
return t2({ ...n2, filter:
|
|
3703
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $endsWith: i2 } };
|
|
3704
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3706
3705
|
}, contains(r2, i2) {
|
|
3707
|
-
let a2 = { [
|
|
3708
|
-
return t2({ ...n2, filter:
|
|
3706
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $contains: i2 } };
|
|
3707
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3709
3708
|
}, hasSome(r2, ...i2) {
|
|
3710
|
-
let a2 = { [
|
|
3711
|
-
return t2({ ...n2, filter:
|
|
3709
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3710
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3712
3711
|
}, hasAll(r2, ...i2) {
|
|
3713
|
-
let a2 = { [
|
|
3714
|
-
return t2({ ...n2, filter:
|
|
3712
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3713
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3715
3714
|
}, between(e7, t3, n3) {
|
|
3716
3715
|
return this.ge(e7, t3).lt(e7, n3);
|
|
3717
3716
|
}, in(r2, i2) {
|
|
3718
|
-
let a2 = { [
|
|
3719
|
-
return t2({ ...n2, filter:
|
|
3717
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $in: i2 } };
|
|
3718
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3720
3719
|
}, exists(r2, i2 = true) {
|
|
3721
|
-
let a2 = { [
|
|
3722
|
-
return t2({ ...n2, filter:
|
|
3720
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $exists: i2 } };
|
|
3721
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3723
3722
|
}, or(e7) {
|
|
3724
|
-
return t2({ ...n2, filter:
|
|
3723
|
+
return t2({ ...n2, filter: fs(n2.filter, e7.query.filter) });
|
|
3725
3724
|
}, and(e7) {
|
|
3726
|
-
return t2({ ...n2, filter:
|
|
3725
|
+
return t2({ ...n2, filter: J(n2.filter, e7.query.filter) });
|
|
3727
3726
|
}, not(e7) {
|
|
3728
|
-
return t2({ ...n2, filter:
|
|
3727
|
+
return t2({ ...n2, filter: ps(e7.query.filter) });
|
|
3729
3728
|
}, ascending(...r2) {
|
|
3730
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3729
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: Y(e6.transformationPaths, t3), order: `ASC` }))] });
|
|
3731
3730
|
}, descending(...r2) {
|
|
3732
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3731
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: Y(e6.transformationPaths, t3), order: `DESC` }))] });
|
|
3733
3732
|
}, skip(e7) {
|
|
3734
3733
|
return t2({ ...n2, paging: { offset: e7, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
|
|
3735
3734
|
}, limit(r2) {
|
|
@@ -3742,71 +3741,71 @@ function gs(e6) {
|
|
|
3742
3741
|
} });
|
|
3743
3742
|
return t2({ filter: {}, ...e6.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
|
|
3744
3743
|
}
|
|
3745
|
-
function
|
|
3744
|
+
function Y(e6, t2) {
|
|
3746
3745
|
let n2 = Object.entries(e6).find(([e7]) => e7 === t2 || t2.startsWith(`${e7}.`))?.[0];
|
|
3747
3746
|
return n2 ? t2.replace(n2, e6[n2]) : nt(t2, { ...e6, ...tt });
|
|
3748
3747
|
}
|
|
3749
|
-
var
|
|
3750
|
-
var
|
|
3751
|
-
var
|
|
3752
|
-
var
|
|
3753
|
-
var
|
|
3754
|
-
var
|
|
3755
|
-
function
|
|
3748
|
+
var vs = `filter`;
|
|
3749
|
+
var ys = `sort`;
|
|
3750
|
+
var bs = `cursorPaging`;
|
|
3751
|
+
var xs = `paging`;
|
|
3752
|
+
var Ss = [vs, ys, bs];
|
|
3753
|
+
var Cs = [vs, ys, xs];
|
|
3754
|
+
function ws(e6, t2) {
|
|
3756
3755
|
return !e6 || typeof e6 != `object` ? false : t2.some((t3) => e6.hasOwnProperty(t3));
|
|
3757
3756
|
}
|
|
3758
|
-
function ws(e6) {
|
|
3759
|
-
return Cs(e6, xs);
|
|
3760
|
-
}
|
|
3761
3757
|
function Ts(e6) {
|
|
3762
|
-
return
|
|
3758
|
+
return ws(e6, Ss);
|
|
3763
3759
|
}
|
|
3764
3760
|
function Es(e6) {
|
|
3761
|
+
return ws(e6, Cs);
|
|
3762
|
+
}
|
|
3763
|
+
function Ds(e6) {
|
|
3765
3764
|
let { hasOptionsParameter: t2 } = e6;
|
|
3766
3765
|
return function(...n2) {
|
|
3767
|
-
return t2 ?
|
|
3766
|
+
return t2 ? ks(n2, e6) : Os(n2, e6);
|
|
3768
3767
|
};
|
|
3769
3768
|
}
|
|
3770
|
-
function
|
|
3769
|
+
function Os(e6, t2) {
|
|
3771
3770
|
return e6.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e6[0]);
|
|
3772
3771
|
}
|
|
3773
|
-
function
|
|
3772
|
+
function ks(e6, t2) {
|
|
3774
3773
|
switch (e6.length) {
|
|
3775
3774
|
case 0:
|
|
3776
3775
|
return t2.builderQueryFunction();
|
|
3777
3776
|
case 1:
|
|
3778
|
-
return
|
|
3777
|
+
return Ts(e6[0]) || Es(e6[0]) ? t2.typedQueryFunction(e6[0]) : t2.builderQueryFunction(e6[0]);
|
|
3779
3778
|
default:
|
|
3780
3779
|
return t2.typedQueryFunction(e6[0], e6[1]);
|
|
3781
3780
|
}
|
|
3782
3781
|
}
|
|
3783
|
-
var
|
|
3784
|
-
var
|
|
3785
|
-
function
|
|
3782
|
+
var As = [{ path: `like.createdDate` }];
|
|
3783
|
+
var js = [{ path: `likes.createdDate` }];
|
|
3784
|
+
function Ms(e6) {
|
|
3786
3785
|
return P(Object.assign(e6, { domainToMappings: { _: [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/blog-like-service`, destPath: `` }], "social-blog._base_domain_": [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/blog/v1/likes`, destPath: `/v1/likes` }], "*.dev.wix-code.com": [{ srcPath: `/blog/v1/likes`, destPath: `/v1/likes` }] } }));
|
|
3787
3786
|
}
|
|
3788
|
-
var
|
|
3789
|
-
function
|
|
3787
|
+
var Ns = `@wix/auto_sdk_blog_likes`;
|
|
3788
|
+
function Ps(e6) {
|
|
3790
3789
|
function t2({ host: t3 }) {
|
|
3791
|
-
let n2 = A(e6, [{ transformFn: st, paths:
|
|
3792
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName:
|
|
3790
|
+
let n2 = A(e6, [{ transformFn: st, paths: As }]);
|
|
3791
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName: Ns, migrationOptions: { optInTransformResponse: true }, url: Ms({ protoPath: `/v1/likes`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: As }]) };
|
|
3793
3792
|
}
|
|
3794
3793
|
return t2;
|
|
3795
3794
|
}
|
|
3796
|
-
function
|
|
3795
|
+
function Fs(e6) {
|
|
3797
3796
|
function t2({ host: t3 }) {
|
|
3798
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.QueryLikes`, packageName:
|
|
3797
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.QueryLikes`, packageName: Ns, migrationOptions: { optInTransformResponse: true }, url: Ms({ protoPath: `/v1/likes/query`, data: e6, host: t3 }), data: e6, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: js }]) };
|
|
3799
3798
|
}
|
|
3800
3799
|
return t2;
|
|
3801
3800
|
}
|
|
3802
|
-
function
|
|
3801
|
+
function Is(e6) {
|
|
3803
3802
|
function t2({ host: t3 }) {
|
|
3804
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `DELETE`, methodFqn: `wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`, packageName:
|
|
3803
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `DELETE`, methodFqn: `wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`, packageName: Ns, migrationOptions: { optInTransformResponse: true }, url: Ms({ protoPath: `/v1/likes/fqdn/{fqdn}/entity-id/{entityId}`, data: e6, host: t3 }), params: N(e6) };
|
|
3805
3804
|
}
|
|
3806
3805
|
return t2;
|
|
3807
3806
|
}
|
|
3808
|
-
async function
|
|
3809
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
3807
|
+
async function Ls(e6) {
|
|
3808
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ps(D({ like: e6?.like }));
|
|
3810
3809
|
n2?.onSiteCall?.();
|
|
3811
3810
|
try {
|
|
3812
3811
|
let e7 = await t2.request(r2);
|
|
@@ -3816,10 +3815,10 @@ async function Is(e6) {
|
|
|
3816
3815
|
throw n2?.onError?.(e7), t3;
|
|
3817
3816
|
}
|
|
3818
3817
|
}
|
|
3819
|
-
function
|
|
3818
|
+
function Rs() {
|
|
3820
3819
|
let { httpClient: e6, sideEffects: t2 } = arguments[0];
|
|
3821
|
-
return
|
|
3822
|
-
let r2 =
|
|
3820
|
+
return _s({ func: async (n2) => {
|
|
3821
|
+
let r2 = Fs(n2);
|
|
3823
3822
|
t2?.onSiteCall?.();
|
|
3824
3823
|
try {
|
|
3825
3824
|
let n3 = await e6.request(r2);
|
|
@@ -3837,8 +3836,8 @@ function Ls() {
|
|
|
3837
3836
|
throw j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
3838
3837
|
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
3839
3838
|
}
|
|
3840
|
-
async function
|
|
3841
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
3839
|
+
async function zs(e6) {
|
|
3840
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Fs(D({ query: e6 }));
|
|
3842
3841
|
n2?.onSiteCall?.();
|
|
3843
3842
|
try {
|
|
3844
3843
|
let e7 = await t2.request(r2);
|
|
@@ -3848,8 +3847,8 @@ async function Rs(e6) {
|
|
|
3848
3847
|
throw n2?.onError?.(e7), t3;
|
|
3849
3848
|
}
|
|
3850
3849
|
}
|
|
3851
|
-
async function
|
|
3852
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
3850
|
+
async function Bs(e6) {
|
|
3851
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Is(D({ fqdn: e6?.fqdn, entityId: e6?.entityId }));
|
|
3853
3852
|
n2?.onSiteCall?.();
|
|
3854
3853
|
try {
|
|
3855
3854
|
let e7 = await t2.request(r2);
|
|
@@ -3859,34 +3858,34 @@ async function zs(e6) {
|
|
|
3859
3858
|
throw n2?.onError?.(e7), t3;
|
|
3860
3859
|
}
|
|
3861
3860
|
}
|
|
3862
|
-
function Bs(e6) {
|
|
3863
|
-
return (t2) => Is(t2, { httpClient: e6 });
|
|
3864
|
-
}
|
|
3865
3861
|
function Vs(e6) {
|
|
3866
|
-
return () => Ls({ httpClient: e6 });
|
|
3862
|
+
return (t2) => Ls(t2, { httpClient: e6 });
|
|
3867
3863
|
}
|
|
3868
3864
|
function Hs(e6) {
|
|
3869
|
-
return (
|
|
3865
|
+
return () => Rs({ httpClient: e6 });
|
|
3870
3866
|
}
|
|
3871
3867
|
function Us(e6) {
|
|
3872
3868
|
return (t2) => zs(t2, { httpClient: e6 });
|
|
3873
3869
|
}
|
|
3874
3870
|
function Ws(e6) {
|
|
3875
|
-
|
|
3871
|
+
return (t2) => Bs(t2, { httpClient: e6 });
|
|
3872
|
+
}
|
|
3873
|
+
function Gs(e6) {
|
|
3874
|
+
let t2 = Ds({ builderQueryFunction: () => Hs(e6)(), typedQueryFunction: (t3) => Us(e6)(t3), hasOptionsParameter: false });
|
|
3876
3875
|
function n2(e7) {
|
|
3877
3876
|
return t2(...arguments);
|
|
3878
3877
|
}
|
|
3879
3878
|
return n2;
|
|
3880
3879
|
}
|
|
3881
|
-
var
|
|
3882
|
-
var Ks = M(Us);
|
|
3880
|
+
var Ks = M(Vs);
|
|
3883
3881
|
var qs = M(Ws);
|
|
3884
|
-
|
|
3882
|
+
var Js = M(Gs);
|
|
3883
|
+
function Ys(e6) {
|
|
3885
3884
|
if (!e6) return;
|
|
3886
3885
|
let t2 = ``;
|
|
3887
3886
|
return (e6.filename || e6.altText) && (t2 = `/${encodeURIComponent(e6.filename || e6.altText)}`), e6.id ? `wix:image://v1/${e6.id}${t2}#originWidth=${e6.width}&originHeight=${e6.height}` : e6.url;
|
|
3888
3887
|
}
|
|
3889
|
-
function
|
|
3888
|
+
function X(e6) {
|
|
3890
3889
|
if (e6) return [`http://`, `https://`].some((t2) => e6.base?.startsWith(t2)) ? `${e6.base}${e6.path}` : `http://${e6.base}${e6.path}`;
|
|
3891
3890
|
}
|
|
3892
3891
|
var Xs = [{ path: `categories.updatedDate` }, { path: `categories.coverImage.urlExpirationDate` }];
|
|
@@ -3897,7 +3896,7 @@ function Qs(e6) {
|
|
|
3897
3896
|
var $s = `@wix/auto_sdk_blog_categories`;
|
|
3898
3897
|
function ec(e6) {
|
|
3899
3898
|
function t2({ host: t3 }) {
|
|
3900
|
-
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn:
|
|
3899
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn: fn, paths: Zs }]) };
|
|
3901
3900
|
}
|
|
3902
3901
|
return t2;
|
|
3903
3902
|
}
|
|
@@ -3908,7 +3907,7 @@ async function rc(e6) {
|
|
|
3908
3907
|
n2?.onSiteCall?.();
|
|
3909
3908
|
try {
|
|
3910
3909
|
let e7 = await t2.request(r2);
|
|
3911
|
-
return n2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn:
|
|
3910
|
+
return n2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn: X, paths: tc }, { transformFn: Ys, paths: nc }]));
|
|
3912
3911
|
} catch (e7) {
|
|
3913
3912
|
let t3 = j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { paging: `$[0].paging`, fieldsets: `$[0].fieldsets`, language: `$[0].language` }, singleArgumentUnchanged: false }, [`options`]);
|
|
3914
3913
|
throw n2?.onError?.(e7), t3;
|
|
@@ -3943,13 +3942,13 @@ function dc(e6) {
|
|
|
3943
3942
|
var fc = `@wix/auto_sdk_blog_posts`;
|
|
3944
3943
|
function pc(e6) {
|
|
3945
3944
|
function t2({ host: t3 }) {
|
|
3946
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn:
|
|
3945
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn: pn, paths: cc }, { transformFn: fn, paths: lc }]) };
|
|
3947
3946
|
}
|
|
3948
3947
|
return t2;
|
|
3949
3948
|
}
|
|
3950
3949
|
function mc(e6) {
|
|
3951
3950
|
function t2({ host: t3 }) {
|
|
3952
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn:
|
|
3951
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: fn, paths: uc }]) };
|
|
3953
3952
|
}
|
|
3954
3953
|
return t2;
|
|
3955
3954
|
}
|
|
@@ -3962,7 +3961,7 @@ async function vc(e6, t2) {
|
|
|
3962
3961
|
r2?.onSiteCall?.();
|
|
3963
3962
|
try {
|
|
3964
3963
|
let e7 = await n2.request(i2);
|
|
3965
|
-
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn:
|
|
3964
|
+
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn: X, paths: hc }, { transformFn: Ys, paths: gc }, { transformFn: oc, paths: _c }]), [`post.richContent`, `post.rich_content`]);
|
|
3966
3965
|
} catch (e7) {
|
|
3967
3966
|
let t3 = j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { postId: `$[0]`, fieldsets: `$[1].fieldsets` }, singleArgumentUnchanged: false }, [`postId`, `options`]);
|
|
3968
3967
|
throw r2?.onError?.(e7), t3;
|
|
@@ -4003,7 +4002,7 @@ function Oc(e6) {
|
|
|
4003
4002
|
var kc = [{ path: `tags.url` }];
|
|
4004
4003
|
function Ac(e6) {
|
|
4005
4004
|
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
4006
|
-
return
|
|
4005
|
+
return _s({ func: async (r2) => {
|
|
4007
4006
|
let i2 = Oc({ ...r2, ...e6 ?? {} });
|
|
4008
4007
|
n2?.onSiteCall?.();
|
|
4009
4008
|
try {
|
|
@@ -4016,7 +4015,7 @@ function Ac(e6) {
|
|
|
4016
4015
|
let n3 = [t3, e6];
|
|
4017
4016
|
return D({ ...n3?.[1], query: n3?.[0] });
|
|
4018
4017
|
}, responseTransformer: ({ data: e7 }) => {
|
|
4019
|
-
let t3 = O(A(e7, [{ transformFn:
|
|
4018
|
+
let t3 = O(A(e7, [{ transformFn: X, paths: kc }]));
|
|
4020
4019
|
return { items: t3?.tags, pagingMetadata: t3?.pagingMetadata };
|
|
4021
4020
|
}, errorTransformer: (e7) => {
|
|
4022
4021
|
throw j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
@@ -4027,7 +4026,7 @@ async function jc(e6, t2) {
|
|
|
4027
4026
|
r2?.onSiteCall?.();
|
|
4028
4027
|
try {
|
|
4029
4028
|
let e7 = await n2.request(i2);
|
|
4030
|
-
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn:
|
|
4029
|
+
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn: X, paths: kc }]));
|
|
4031
4030
|
} catch (e7) {
|
|
4032
4031
|
let t3 = j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
4033
4032
|
throw r2?.onError?.(e7), t3;
|
|
@@ -4040,14 +4039,14 @@ function Nc(e6) {
|
|
|
4040
4039
|
return (t2, n2) => jc(t2, n2, { httpClient: e6 });
|
|
4041
4040
|
}
|
|
4042
4041
|
function Pc(e6) {
|
|
4043
|
-
let t2 =
|
|
4042
|
+
let t2 = Ds({ builderQueryFunction: (t3) => Mc(e6)(t3), typedQueryFunction: (t3, n3) => Nc(e6)(t3, n3), hasOptionsParameter: true });
|
|
4044
4043
|
function n2(e7, n3) {
|
|
4045
4044
|
return t2(...arguments);
|
|
4046
4045
|
}
|
|
4047
4046
|
return n2;
|
|
4048
4047
|
}
|
|
4049
4048
|
var Fc = M(Pc);
|
|
4050
|
-
var Ic = (e6) => O(A(e6, [{ transformFn:
|
|
4049
|
+
var Ic = (e6) => O(A(e6, [{ transformFn: X, paths: [{ path: `posts.url` }, { path: `posts.translations.url` }] }, { transformFn: Ys, paths: [{ path: `posts.heroImage` }, { path: `posts.media.wixMedia.image` }] }, { transformFn: oc, paths: [{ path: `posts.media.wixMedia.videoV2` }] }]), [`posts.richContent`, `posts.rich_content`]).posts ?? [];
|
|
4051
4050
|
var Lc = `https://blog.wixsite.com/blog-demo-posts`;
|
|
4052
4051
|
M((e6) => async (t2) => {
|
|
4053
4052
|
let n2 = await e6.fetchWithAuth(`${globalThis.location.origin}/_serverless/blog-demo-posts/v3/demo-posts?${N(t2)}`);
|
|
@@ -4089,7 +4088,7 @@ var Gc = async (e6) => {
|
|
|
4089
4088
|
};
|
|
4090
4089
|
var Kc = `wix.blog.v4.post`;
|
|
4091
4090
|
var qc = async (e6, t2) => {
|
|
4092
|
-
let n2 = await
|
|
4091
|
+
let n2 = await cs({ postFqdn: Kc, postId: e6 }, t2 ? { language: t2 } : void 0);
|
|
4093
4092
|
if (typeof n2 != `object` || !n2) throw Error(`No Wix SDK context for the post paywall read`);
|
|
4094
4093
|
let { richContent: r2 } = n2;
|
|
4095
4094
|
return D(r2);
|
|
@@ -4125,7 +4124,7 @@ var il = `@wix/auto_sdk_blog_posts`;
|
|
|
4125
4124
|
function al(e6) {
|
|
4126
4125
|
function t2({ host: t3 }) {
|
|
4127
4126
|
let n2 = A(e6, [{ transformFn: dn, paths: nl }]);
|
|
4128
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn:
|
|
4127
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn: pn, paths: el }, { transformFn: fn, paths: tl }]) };
|
|
4129
4128
|
}
|
|
4130
4129
|
return t2;
|
|
4131
4130
|
}
|
|
@@ -4310,11 +4309,11 @@ var zl = (e6) => Ll(e6?.[Rl]);
|
|
|
4310
4309
|
var Bl = (e6) => {
|
|
4311
4310
|
let t2;
|
|
4312
4311
|
try {
|
|
4313
|
-
t2 = (0, import_services_manager_react.useService)(
|
|
4312
|
+
t2 = (0, import_services_manager_react.useService)(Qn);
|
|
4314
4313
|
} catch {
|
|
4315
4314
|
return;
|
|
4316
4315
|
}
|
|
4317
|
-
return
|
|
4316
|
+
return dr(t2, e6);
|
|
4318
4317
|
};
|
|
4319
4318
|
var Vl = 1e4;
|
|
4320
4319
|
function Hl(e6) {
|
|
@@ -4326,313 +4325,336 @@ function Hl(e6) {
|
|
|
4326
4325
|
}
|
|
4327
4326
|
var Ul = `wix.blog.v3.post`;
|
|
4328
4327
|
var Wl = async (e6) => {
|
|
4329
|
-
await
|
|
4328
|
+
await Ks({ like: { entityId: e6, fqdn: Ul } });
|
|
4330
4329
|
};
|
|
4331
4330
|
var Gl = async (e6) => {
|
|
4332
|
-
await
|
|
4331
|
+
await qs({ fqdn: Ul, entityId: e6 });
|
|
4332
|
+
};
|
|
4333
|
+
var Kl = 100;
|
|
4334
|
+
var ql;
|
|
4335
|
+
var Jl = (e6) => {
|
|
4336
|
+
let t2 = [...e6.keys()];
|
|
4337
|
+
for (let n2 = 0; n2 < t2.length; n2 += Kl) {
|
|
4338
|
+
let r2 = t2.slice(n2, n2 + Kl);
|
|
4339
|
+
Js().eq(`fqdn`, Ul).in(`entityId`, r2).limit(r2.length).find().then(({ items: t3 }) => {
|
|
4340
|
+
let n3 = new Set(t3.map((e7) => e7.entityId));
|
|
4341
|
+
for (let t4 of r2) e6.get(t4)?.forEach((e7) => e7.resolve(n3.has(t4)));
|
|
4342
|
+
}, (t3) => {
|
|
4343
|
+
for (let n3 of r2) e6.get(n3)?.forEach((e7) => e7.reject(t3));
|
|
4344
|
+
});
|
|
4345
|
+
}
|
|
4333
4346
|
};
|
|
4334
|
-
var
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4347
|
+
var Yl = (e6) => new Promise((t2, n2) => {
|
|
4348
|
+
if (!ql) {
|
|
4349
|
+
let e7 = /* @__PURE__ */ new Map();
|
|
4350
|
+
ql = e7, setTimeout(() => {
|
|
4351
|
+
ql = void 0, Jl(e7);
|
|
4352
|
+
});
|
|
4353
|
+
}
|
|
4354
|
+
ql.set(e6, [...ql.get(e6) ?? [], { resolve: t2, reject: n2 }]);
|
|
4355
|
+
});
|
|
4356
|
+
var Xl = (e6) => typeof e6 == `number` ? e6 : void 0;
|
|
4357
|
+
var Zl = async (e6, t2 = true) => {
|
|
4358
|
+
let [n2, r2] = await Promise.allSettled([Yl(e6), t2 ? Cc(e6) : void 0]), i2 = r2.status === `fulfilled` ? r2.value?.metrics : void 0;
|
|
4359
|
+
return { liked: n2.status === `fulfilled` && n2.value, likeCount: Xl(i2?.likes), viewCount: Xl(i2?.views), commentCount: Xl(i2?.comments) };
|
|
4338
4360
|
};
|
|
4339
|
-
var
|
|
4340
|
-
var
|
|
4361
|
+
var Ql = F(`@wix/site-service-editor-context`);
|
|
4362
|
+
var $l = () => {
|
|
4341
4363
|
try {
|
|
4342
|
-
return !!(0, import_services_manager_react.useService)(
|
|
4364
|
+
return !!(0, import_services_manager_react.useService)(Ql).previewMode;
|
|
4343
4365
|
} catch {
|
|
4344
4366
|
return false;
|
|
4345
4367
|
}
|
|
4346
4368
|
};
|
|
4347
|
-
var
|
|
4348
|
-
var
|
|
4349
|
-
var
|
|
4369
|
+
var eu = { liked: false, baselineLiked: false, freshLikeCount: void 0, viewCount: void 0, commentCount: void 0, isLikeCountLoaded: false };
|
|
4370
|
+
var tu = `wix-blog:post-like-toggled`;
|
|
4371
|
+
var nu = () => {
|
|
4350
4372
|
let e6 = window;
|
|
4351
|
-
return e6[
|
|
4373
|
+
return e6[tu] ??= /* @__PURE__ */ new Map();
|
|
4352
4374
|
};
|
|
4353
|
-
var
|
|
4354
|
-
|
|
4375
|
+
var ru = (e6) => {
|
|
4376
|
+
nu().set(e6.postId, e6.liked), window.dispatchEvent(new CustomEvent(tu, { detail: e6 }));
|
|
4355
4377
|
};
|
|
4356
|
-
var
|
|
4357
|
-
var
|
|
4358
|
-
let
|
|
4378
|
+
var iu = (e6, t2) => ({ isLiked: e6.liked, likeCount: Math.max(0, (e6.freshLikeCount ?? t2) + Number(e6.liked) - Number(e6.baselineLiked)), isLikeCountLoaded: e6.isLikeCountLoaded, viewCount: e6.viewCount, commentCount: e6.commentCount });
|
|
4379
|
+
var au = (e6, t2, n2 = false, r2, i2 = true) => {
|
|
4380
|
+
let a2 = $l() || n2, [c2, p2] = (0, import_react.useState)(eu), m2 = (0, import_react.useRef)(eu), h2 = (0, import_react.useRef)(t2), g2 = (0, import_react.useRef)(/* @__PURE__ */ new Set()), _2 = (0, import_react.useRef)(false), v2 = (0, import_react.useRef)(false), y2 = (0, import_react.useRef)(void 0), b2 = Xn(), [x2, S2] = (0, import_react.useState)(0);
|
|
4359
4381
|
(0, import_react.useEffect)(() => {
|
|
4360
|
-
let e7 =
|
|
4361
|
-
|
|
4382
|
+
let e7 = b2?.addMemberLoginListener?.(() => {
|
|
4383
|
+
nu().clear(), S2((e8) => e8 + 1);
|
|
4362
4384
|
});
|
|
4363
4385
|
return () => {
|
|
4364
|
-
e7 !== void 0 &&
|
|
4386
|
+
e7 !== void 0 && b2?.removeMemberLoginListener?.(e7);
|
|
4365
4387
|
};
|
|
4366
|
-
}, [
|
|
4367
|
-
let
|
|
4368
|
-
let t3 =
|
|
4369
|
-
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (
|
|
4370
|
-
}, []),
|
|
4371
|
-
|
|
4388
|
+
}, [b2]);
|
|
4389
|
+
let C2 = (0, import_react.useCallback)((e7) => {
|
|
4390
|
+
let t3 = m2.current, n3 = { ...t3, ...e7 };
|
|
4391
|
+
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (m2.current = n3, g2.current.forEach((e8) => e8()), (0, import_react.startTransition)(() => p2(n3)));
|
|
4392
|
+
}, []), ee2 = (0, import_react.useMemo)(() => ({ get: () => iu(m2.current, h2.current), subscribe: (e7) => (g2.current.add(e7), () => {
|
|
4393
|
+
g2.current.delete(e7);
|
|
4372
4394
|
}) }), []);
|
|
4373
4395
|
(0, import_react.useEffect)(() => {
|
|
4374
|
-
|
|
4396
|
+
h2.current !== t2 && (h2.current = t2, g2.current.forEach((e7) => e7()));
|
|
4375
4397
|
}, [t2]), (0, import_react.useEffect)(() => {
|
|
4376
|
-
if (
|
|
4377
|
-
|
|
4398
|
+
if (y2.current !== e6 && (y2.current = e6, C2(eu)), v2.current = false, !e6 || a2) {
|
|
4399
|
+
C2({ isLikeCountLoaded: true });
|
|
4378
4400
|
return;
|
|
4379
4401
|
}
|
|
4380
4402
|
let t3 = false;
|
|
4381
|
-
return
|
|
4382
|
-
t3 ||
|
|
4403
|
+
return Zl(e6, i2).then(({ liked: e7, likeCount: n3, viewCount: r3, commentCount: i3 }) => {
|
|
4404
|
+
t3 || C2({ isLikeCountLoaded: true, viewCount: r3, commentCount: i3, baselineLiked: e7, freshLikeCount: n3, ...!v2.current && { liked: e7 } });
|
|
4383
4405
|
}).catch((n3) => {
|
|
4384
|
-
t3 ||
|
|
4406
|
+
t3 || C2({ isLikeCountLoaded: true }), Nl(r2, n3, { feature: Al.likes, action: `read-like-state`, level: `warning`, contexts: { likes: { postId: e6 } } });
|
|
4385
4407
|
}), () => {
|
|
4386
4408
|
t3 = true;
|
|
4387
4409
|
};
|
|
4388
|
-
}, [e6,
|
|
4410
|
+
}, [e6, a2, r2, C2, x2, i2]), (0, import_react.useEffect)(() => {
|
|
4389
4411
|
if (!e6) return;
|
|
4390
4412
|
let t3 = (e7) => {
|
|
4391
|
-
|
|
4392
|
-
}, n3 =
|
|
4413
|
+
v2.current = true, C2({ liked: e7 });
|
|
4414
|
+
}, n3 = nu().get(e6);
|
|
4393
4415
|
n3 !== void 0 && t3(n3);
|
|
4394
4416
|
let r3 = (n4) => {
|
|
4395
4417
|
let { detail: r4 } = n4;
|
|
4396
4418
|
r4.postId === e6 && t3(r4.liked);
|
|
4397
4419
|
};
|
|
4398
|
-
return window.addEventListener(
|
|
4399
|
-
}, [e6,
|
|
4400
|
-
let
|
|
4401
|
-
if (!e6 ||
|
|
4402
|
-
|
|
4403
|
-
let n3 = !
|
|
4404
|
-
if (
|
|
4405
|
-
|
|
4420
|
+
return window.addEventListener(tu, r3), () => window.removeEventListener(tu, r3);
|
|
4421
|
+
}, [e6, C2]);
|
|
4422
|
+
let w2 = (0, import_react.useCallback)(async (t3) => {
|
|
4423
|
+
if (!e6 || _2.current) return;
|
|
4424
|
+
v2.current = true;
|
|
4425
|
+
let n3 = !m2.current.liked;
|
|
4426
|
+
if (C2({ liked: n3 }), ru({ postId: e6, liked: n3 }), !a2) {
|
|
4427
|
+
_2.current = true;
|
|
4406
4428
|
try {
|
|
4407
4429
|
await (n3 ? Wl(e6) : Gl(e6));
|
|
4408
4430
|
} catch (t4) {
|
|
4409
|
-
|
|
4431
|
+
C2({ liked: !n3 }), ru({ postId: e6, liked: !n3 }), Nl(r2, t4, { feature: Al.likes, action: n3 ? `like-post` : `unlike-post`, contexts: { likes: { postId: e6 } } });
|
|
4410
4432
|
} finally {
|
|
4411
|
-
|
|
4433
|
+
_2.current = false;
|
|
4412
4434
|
}
|
|
4413
4435
|
}
|
|
4414
|
-
}, [e6,
|
|
4415
|
-
return { ...
|
|
4436
|
+
}, [e6, a2, r2, C2]);
|
|
4437
|
+
return { ...iu(c2, t2), toggleLike: w2, liveLikes: ee2 };
|
|
4416
4438
|
};
|
|
4417
|
-
var
|
|
4418
|
-
var
|
|
4439
|
+
var ou = F(`@wix/viewer-service-multilingual`);
|
|
4440
|
+
var su = () => {
|
|
4419
4441
|
let e6;
|
|
4420
4442
|
try {
|
|
4421
|
-
let { multilingualEnabled: t3, currentLocale: n3 } = (0, import_services_manager_react.useService)(
|
|
4443
|
+
let { multilingualEnabled: t3, currentLocale: n3 } = (0, import_services_manager_react.useService)(ou);
|
|
4422
4444
|
t3 && n3 && !n3.primaryLocale && (e6 = n3.regionalFormat);
|
|
4423
4445
|
} catch {
|
|
4424
4446
|
}
|
|
4425
4447
|
let t2, n2;
|
|
4426
4448
|
try {
|
|
4427
|
-
({ locale: t2, language: n2 } = (0, import_services_manager_react.useService)(
|
|
4449
|
+
({ locale: t2, language: n2 } = (0, import_services_manager_react.useService)(So));
|
|
4428
4450
|
} catch {
|
|
4429
4451
|
}
|
|
4430
4452
|
return e6 || t2 || n2;
|
|
4431
4453
|
};
|
|
4432
|
-
var
|
|
4454
|
+
var cu = () => {
|
|
4433
4455
|
try {
|
|
4434
|
-
return Xc((0, import_services_manager_react.useService)(
|
|
4456
|
+
return Xc((0, import_services_manager_react.useService)(Qn));
|
|
4435
4457
|
} catch {
|
|
4436
4458
|
return;
|
|
4437
4459
|
}
|
|
4438
4460
|
};
|
|
4439
|
-
var
|
|
4461
|
+
var lu = (e6, t2, n2) => typeof e6 != `number` || !Number.isFinite(e6) || e6 < 0 ? `` : new Intl.NumberFormat(n2, t2 === `compact` ? { notation: `compact`, maximumFractionDigits: 1 } : void 0).format(e6);
|
|
4440
4462
|
var Q = { timeToRead: `post.time-to-read`, viewCount: `post.view-count`, commentCount: `post.comment-count`, likeCount: `post.like-count`, noPostsTitle: `post-list.empty-state.title`, noPostsDescription: `post-list.empty-state.description`, noRelatedPostsTitle: `related-posts.empty-state.title`, noRelatedPostsDescription: `related-posts.empty-state.description`, canvasPostTitle: `canvas.post-title`, canvasAuthorName: `canvas.author-name`, canvasExcerpt: `canvas.excerpt`, canvasContent: `canvas.content`, canvasCategory: `canvas.category`, canvasCategoryNumbered: `canvas.category-numbered`, canvasTagNumbered: `canvas.tag-numbered`, canvasCoverAlt: `cover-media.placeholder-alt`, canvasAuthorPhotoAlt: `canvas.author-photo-alt` };
|
|
4441
|
-
var
|
|
4442
|
-
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted:
|
|
4463
|
+
var uu = (e6, t2) => {
|
|
4464
|
+
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: lu(r2, `full`, t2) });
|
|
4443
4465
|
return { timeToRead: (t3) => e6(Q.timeToRead, { count: t3 }), viewCount: n2(Q.viewCount), commentCount: n2(Q.commentCount), likeCount: n2(Q.likeCount), noPostsEmptyState: () => ({ title: e6(Q.noPostsTitle), description: e6(Q.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6(Q.noRelatedPostsTitle), description: e6(Q.noRelatedPostsDescription) }), canvas: { postTitle: () => e6(Q.canvasPostTitle), authorName: () => e6(Q.canvasAuthorName), excerpt: () => e6(Q.canvasExcerpt), content: () => e6(Q.canvasContent), category: () => e6(Q.canvasCategory), categoryNumbered: (t3) => e6(Q.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6(Q.canvasTagNumbered, { number: t3 }), coverAlt: () => e6(Q.canvasCoverAlt), authorPhotoAlt: () => e6(Q.canvasAuthorPhotoAlt) } };
|
|
4444
4466
|
};
|
|
4445
|
-
var
|
|
4446
|
-
var
|
|
4447
|
-
var
|
|
4448
|
-
var
|
|
4467
|
+
var du = (0, import_react.createContext)({ isEditor: false, isPreview: false });
|
|
4468
|
+
var fu = () => (0, import_react.useContext)(du);
|
|
4469
|
+
var pu = ({ isEditor: e6, isPreview: t2 }) => e6 && !t2;
|
|
4470
|
+
var mu = () => {
|
|
4449
4471
|
try {
|
|
4450
|
-
let { SSR: e6, SEO: t2 } = (0, import_services_manager_react.useService)(
|
|
4472
|
+
let { SSR: e6, SEO: t2 } = (0, import_services_manager_react.useService)(Gn);
|
|
4451
4473
|
return e6 || t2;
|
|
4452
4474
|
} catch {
|
|
4453
4475
|
return false;
|
|
4454
4476
|
}
|
|
4455
4477
|
};
|
|
4456
|
-
var
|
|
4457
|
-
let e6 =
|
|
4458
|
-
return
|
|
4478
|
+
var hu = () => {
|
|
4479
|
+
let e6 = mu();
|
|
4480
|
+
return pu(fu()) && !e6;
|
|
4459
4481
|
};
|
|
4460
|
-
var
|
|
4461
|
-
var
|
|
4482
|
+
var gu = (e6) => ({ href: e6 ?? `#`, target: `_self` });
|
|
4483
|
+
var _u = (e6) => {
|
|
4462
4484
|
if (!e6) return;
|
|
4463
4485
|
let t2 = e6 instanceof Date ? e6 : new Date(e6);
|
|
4464
4486
|
return Number.isFinite(t2.getTime()) ? t2.toISOString() : void 0;
|
|
4465
4487
|
};
|
|
4466
|
-
var
|
|
4467
|
-
var
|
|
4468
|
-
var $ = (e6) => ({ text: e6, html: `<p>${
|
|
4469
|
-
var
|
|
4470
|
-
var
|
|
4471
|
-
var
|
|
4472
|
-
var
|
|
4473
|
-
var
|
|
4474
|
-
var
|
|
4488
|
+
var vu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
4489
|
+
var yu = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
4490
|
+
var $ = (e6) => ({ text: e6, html: `<p>${yu(e6)}</p>`, linkList: [] });
|
|
4491
|
+
var bu = 6e4;
|
|
4492
|
+
var xu = bu * 60;
|
|
4493
|
+
var Su = xu * 24;
|
|
4494
|
+
var Cu = Su * 7;
|
|
4495
|
+
var wu = (e6) => e6 < bu ? [`second`, e6 / 1e3] : e6 < xu ? [`minute`, e6 / bu] : e6 < Su ? [`hour`, e6 / xu] : [`day`, e6 / Su];
|
|
4496
|
+
var Tu = (e6, t2, n2 = Date.now()) => {
|
|
4475
4497
|
let r2 = e6 instanceof Date ? e6 : new Date(e6), i2 = n2 - r2.getTime();
|
|
4476
|
-
if (i2 >= 0 && i2 <
|
|
4477
|
-
let [e7, n3] =
|
|
4498
|
+
if (i2 >= 0 && i2 < Cu) {
|
|
4499
|
+
let [e7, n3] = wu(i2);
|
|
4478
4500
|
return new Intl.RelativeTimeFormat(t2).format(-Math.round(n3), e7);
|
|
4479
4501
|
}
|
|
4480
4502
|
let a2 = r2.getFullYear() === new Date(n2).getFullYear();
|
|
4481
4503
|
return new Intl.DateTimeFormat(t2, { ...a2 ? {} : { year: `numeric` }, month: `short`, day: `numeric` }).format(r2);
|
|
4482
4504
|
};
|
|
4483
|
-
var
|
|
4484
|
-
var
|
|
4485
|
-
var
|
|
4505
|
+
var Eu = `https://static.wixstatic.com/media/`;
|
|
4506
|
+
var Du = 100;
|
|
4507
|
+
var Ou = (e6, t2 = ``) => {
|
|
4486
4508
|
let n2 = e6?.profile?.photo;
|
|
4487
4509
|
if (!n2?.url) return;
|
|
4488
|
-
let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(
|
|
4489
|
-
return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width ||
|
|
4490
|
-
};
|
|
4491
|
-
var
|
|
4492
|
-
var
|
|
4493
|
-
var
|
|
4494
|
-
var
|
|
4495
|
-
var
|
|
4510
|
+
let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(Eu) ? n2.url.slice(35).split(/[?#]/)[0] : void 0);
|
|
4511
|
+
return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width || Du, height: n2.height || Du, alt: r2 ?? t2 };
|
|
4512
|
+
};
|
|
4513
|
+
var ku = `https://static.wixstatic.com/media/`;
|
|
4514
|
+
var Au = `wix:image://`;
|
|
4515
|
+
var ju = 1200;
|
|
4516
|
+
var Mu = 800;
|
|
4517
|
+
var Nu = (e6) => {
|
|
4496
4518
|
if (!e6) return;
|
|
4497
4519
|
let t2 = Number.parseInt(e6, 10);
|
|
4498
4520
|
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
4499
4521
|
};
|
|
4500
|
-
var
|
|
4501
|
-
if (!e6.startsWith(
|
|
4522
|
+
var Pu = (e6) => {
|
|
4523
|
+
if (!e6.startsWith(Au)) {
|
|
4502
4524
|
let t3 = e6.split(/[?#]/)[0];
|
|
4503
4525
|
return t3 ? { uri: t3 } : void 0;
|
|
4504
4526
|
}
|
|
4505
4527
|
let [t2, n2] = e6.slice(12).split(`#`), [, r2, i2] = t2.split(`/`).filter(Boolean);
|
|
4506
4528
|
if (!r2) return;
|
|
4507
4529
|
let a2 = new URLSearchParams(n2 ?? ``);
|
|
4508
|
-
return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width:
|
|
4530
|
+
return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width: Nu(a2.get(`originWidth`)), height: Nu(a2.get(`originHeight`)) };
|
|
4509
4531
|
};
|
|
4510
|
-
var
|
|
4532
|
+
var Fu = (e6, t2) => {
|
|
4511
4533
|
if (!e6) return;
|
|
4512
|
-
let n2 =
|
|
4534
|
+
let n2 = Pu(e6);
|
|
4513
4535
|
if (!n2) return;
|
|
4514
4536
|
let r2 = n2.name ?? n2.uri;
|
|
4515
|
-
return { uri: n2.uri, url: `${
|
|
4537
|
+
return { uri: n2.uri, url: `${ku}${n2.uri}`, name: r2, width: n2.width ?? ju, height: n2.height ?? Mu, alt: t2 ?? r2 };
|
|
4516
4538
|
};
|
|
4517
|
-
var
|
|
4539
|
+
var Iu = (e6) => {
|
|
4518
4540
|
let t2 = e6?.media?.wixMedia?.image;
|
|
4519
4541
|
if (!t2) return;
|
|
4520
|
-
let n2 =
|
|
4542
|
+
let n2 = Pu(t2);
|
|
4521
4543
|
if (!n2) return;
|
|
4522
4544
|
let r2 = n2.name ?? n2.uri;
|
|
4523
|
-
return { uri: n2.uri, url: `${
|
|
4545
|
+
return { uri: n2.uri, url: `${ku}${n2.uri}`, name: r2, width: n2.width ?? ju, height: n2.height ?? Mu, alt: e6?.media?.altText ?? e6?.title ?? r2 };
|
|
4524
4546
|
};
|
|
4525
|
-
var
|
|
4526
|
-
var
|
|
4527
|
-
var
|
|
4547
|
+
var Lu = `https://static.wixstatic.com/media/`;
|
|
4548
|
+
var Ru = `wix:video://`;
|
|
4549
|
+
var zu = (e6) => {
|
|
4528
4550
|
if (!e6) return;
|
|
4529
4551
|
let t2 = Number.parseInt(e6, 10);
|
|
4530
4552
|
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
4531
4553
|
};
|
|
4532
|
-
var
|
|
4533
|
-
if (!e6.startsWith(
|
|
4554
|
+
var Bu = (e6) => {
|
|
4555
|
+
if (!e6.startsWith(Ru)) return;
|
|
4534
4556
|
let [t2, n2] = e6.slice(12).split(`#`), [, r2] = t2.split(`/`).filter(Boolean);
|
|
4535
4557
|
if (!r2) return;
|
|
4536
4558
|
let i2 = new URLSearchParams(n2 ?? ``), a2 = i2.get(`posterUri`);
|
|
4537
|
-
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${
|
|
4559
|
+
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${Lu}${a2}` : void 0, posterWidth: zu(i2.get(`posterWidth`)), posterHeight: zu(i2.get(`posterHeight`)) };
|
|
4538
4560
|
};
|
|
4539
|
-
var
|
|
4540
|
-
var
|
|
4541
|
-
var
|
|
4561
|
+
var Vu = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
|
|
4562
|
+
var Hu = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
|
|
4563
|
+
var Uu = (e6, t2) => {
|
|
4542
4564
|
for (let n2 of e6) {
|
|
4543
4565
|
let e7 = n2.exec(t2);
|
|
4544
4566
|
if (e7) return e7[1];
|
|
4545
4567
|
}
|
|
4546
4568
|
};
|
|
4547
|
-
var
|
|
4548
|
-
let t2 =
|
|
4569
|
+
var Wu = (e6) => {
|
|
4570
|
+
let t2 = Uu(Vu, e6);
|
|
4549
4571
|
if (t2) return { provider: `youtube`, embedUrl: `https://www.youtube.com/embed/${t2}?autoplay=1` };
|
|
4550
|
-
let n2 =
|
|
4572
|
+
let n2 = Uu(Hu, e6);
|
|
4551
4573
|
return n2 ? { provider: `vimeo`, embedUrl: `https://player.vimeo.com/video/${n2}?autoplay=1` } : { provider: `unknown` };
|
|
4552
4574
|
};
|
|
4553
|
-
var
|
|
4575
|
+
var Gu = (e6, t2 = []) => {
|
|
4554
4576
|
let n2 = e6?.media;
|
|
4555
4577
|
if (!n2 || n2.displayed === false) return;
|
|
4556
|
-
let r2 =
|
|
4578
|
+
let r2 = Iu(e6);
|
|
4557
4579
|
if (r2) return { kind: `image`, image: r2 };
|
|
4558
|
-
let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ?
|
|
4580
|
+
let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? Bu(n2.wixMedia.videoV2) : void 0;
|
|
4559
4581
|
if (a2) return { kind: `wixVideo`, ...a2, sources: t2, altText: i2 };
|
|
4560
4582
|
let o2 = n2.embedMedia?.video?.url;
|
|
4561
4583
|
if (o2) {
|
|
4562
4584
|
let { thumbnail: e7 } = n2.embedMedia ?? {};
|
|
4563
|
-
return { kind: `embed`, videoUrl: o2, ...
|
|
4585
|
+
return { kind: `embed`, videoUrl: o2, ...Wu(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
|
|
4564
4586
|
}
|
|
4565
4587
|
};
|
|
4566
|
-
var
|
|
4567
|
-
let t2 =
|
|
4588
|
+
var Ku = (e6) => {
|
|
4589
|
+
let t2 = Iu(e6), n2 = e6?.media?.wixMedia?.videoV2;
|
|
4568
4590
|
if (t2 || !n2) return t2;
|
|
4569
|
-
let r2 =
|
|
4591
|
+
let r2 = Bu(n2), i2 = Fu(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
|
|
4570
4592
|
return i2 && { ...i2, width: r2?.posterWidth ?? i2.width, height: r2?.posterHeight ?? i2.height };
|
|
4571
4593
|
};
|
|
4572
|
-
var
|
|
4573
|
-
var
|
|
4574
|
-
let n2 =
|
|
4594
|
+
var qu = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
|
|
4595
|
+
var Ju = (e6, t2) => {
|
|
4596
|
+
let n2 = qu(e6, t2);
|
|
4575
4597
|
return n2 ? { href: n2, target: `_self` } : void 0;
|
|
4576
4598
|
};
|
|
4577
|
-
var
|
|
4578
|
-
var
|
|
4599
|
+
var Yu = { href: `#`, target: `_self` };
|
|
4600
|
+
var Xu = (e6, t2) => {
|
|
4579
4601
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4580
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink:
|
|
4602
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Ju(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
|
|
4581
4603
|
};
|
|
4582
|
-
var
|
|
4583
|
-
var
|
|
4604
|
+
var Zu = 2;
|
|
4605
|
+
var Qu = (e6) => Array.from({ length: Zu }, (t2, n2) => {
|
|
4584
4606
|
let r2 = e6.canvas.categoryNumbered(n2 + 1);
|
|
4585
|
-
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink:
|
|
4607
|
+
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Yu, categoryItem: { label: r2, slug: `` } };
|
|
4586
4608
|
});
|
|
4587
|
-
var
|
|
4609
|
+
var $u = (e6, t2) => {
|
|
4588
4610
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4589
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink:
|
|
4611
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Ju(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
|
|
4590
4612
|
};
|
|
4591
|
-
var
|
|
4592
|
-
var
|
|
4613
|
+
var ed = 3;
|
|
4614
|
+
var td = (e6) => Array.from({ length: ed }, (t2, n2) => {
|
|
4593
4615
|
let r2 = e6.canvas.tagNumbered(n2 + 1);
|
|
4594
|
-
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink:
|
|
4616
|
+
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Yu, tagItem: { label: r2, slug: `` } };
|
|
4595
4617
|
});
|
|
4596
|
-
var
|
|
4597
|
-
var
|
|
4598
|
-
var
|
|
4599
|
-
var
|
|
4600
|
-
var
|
|
4601
|
-
var
|
|
4602
|
-
var
|
|
4603
|
-
var
|
|
4604
|
-
var
|
|
4605
|
-
let { t: a2 } =
|
|
4618
|
+
var nd = 1;
|
|
4619
|
+
var rd = { views: 120, comments: 4, likes: 12 };
|
|
4620
|
+
var id = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
|
|
4621
|
+
var ad = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
4622
|
+
var od = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
|
|
4623
|
+
var sd = { nodes: [] };
|
|
4624
|
+
var cd = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: sd, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], itemCategoryLabel: $(``), postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
|
|
4625
|
+
var ld = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? cd() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Ku(e6), coverMedia: Gu(e6, a2), richContent: e6?.richContent ?? id(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: Ou(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(nd) : ``), publishedDate: $(Tu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: ad(n2?.views, rd.views, c2, o2.viewCount), commentCount: ad(n2?.comments, rd.comments, c2, o2.commentCount), likeCount: ad(n2?.likes, rd.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? Qu(o2) : r2.map((e7) => Xu(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? td(o2) : i2.map((e7) => $u(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Ku(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: _u(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: vu(e6?.minutesToRead) ?? (c2 ? nd : void 0), viewCountValue: od(n2?.views, rd.views, c2), commentCountValue: od(n2?.comments, rd.comments, c2) };
|
|
4626
|
+
var ud = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
|
|
4627
|
+
let { t: a2 } = bo(), o2 = su(), s2 = (0, import_react.useMemo)(() => uu(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = hu(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = au(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(tr), y2 = Bl(`tag`), b2 = (0, import_react.useMemo)(() => kl(e6.post), [e6]), x2 = cu(), S2 = (0, import_react.useMemo)(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
|
|
4606
4628
|
return (0, import_react.useMemo)(() => {
|
|
4607
|
-
let n3 =
|
|
4629
|
+
let n3 = ld(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : ur(e6.post, i2), u2 = a3 ?? (l2 ? gu(i2) : void 0);
|
|
4608
4630
|
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount: $(s2.likeCount(f2)) } : {}, isLiked: d2, likeCountValue: f2, isLikeCountLoaded: p2, toggleLike: g2, liveLikes: _2, clockValue: c2, isLoadingPost: false, hasError: t2, isEmpty: !e6.post && !l2 };
|
|
4609
4631
|
}, [e6, t2, b2, S2, s2, o2, c2, f2, d2, p2, m2, h2, g2, _2, l2, r2, i2, v2, y2]);
|
|
4610
4632
|
};
|
|
4611
|
-
var
|
|
4612
|
-
var
|
|
4613
|
-
var
|
|
4633
|
+
var dd = (e6) => ({ post: e6, hasError: false });
|
|
4634
|
+
var fd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
|
|
4635
|
+
var pd = (e6) => {
|
|
4614
4636
|
throw e6;
|
|
4615
4637
|
};
|
|
4616
|
-
var
|
|
4638
|
+
var md = { ...cd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4617
4639
|
}, liveLikes: void 0, postUrl: void 0, itemLink: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, commentingEnabled: void 0, isLoadingPost: true, hasError: false, isEmpty: false };
|
|
4618
|
-
var
|
|
4619
|
-
function
|
|
4640
|
+
var hd = { ...md, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4641
|
+
function gd() {
|
|
4620
4642
|
return (0, import_post_context_provider.usePostContext)();
|
|
4621
4643
|
}
|
|
4622
|
-
var
|
|
4623
|
-
var
|
|
4624
|
-
var
|
|
4625
|
-
let { post: a2, hasError: o2 } =
|
|
4626
|
-
return
|
|
4644
|
+
var _d = 2500;
|
|
4645
|
+
var vd = Promise.resolve(dd({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
|
|
4646
|
+
var yd = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
|
|
4647
|
+
let { post: a2, hasError: o2 } = Hn(r2), c2 = Zn(a2, (0, import_react.useCallback)(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ud({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: fr() });
|
|
4648
|
+
return hr(pr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: l2, children: t2 });
|
|
4627
4649
|
};
|
|
4628
|
-
function
|
|
4629
|
-
let i2 = zl(n2), a2 =
|
|
4650
|
+
function bd({ children: t2, postPicker: n2 }) {
|
|
4651
|
+
let i2 = zl(n2), a2 = Kn(), o2 = _r(), s2 = (0, import_react.useMemo)(() => jl(Bn), []), { i18n: c2, locale: l2 } = Ko(es), d2 = Jn(() => i2 ? Wn(No({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
|
|
4630
4652
|
let e6 = Dl(i2, a2);
|
|
4631
|
-
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6,
|
|
4632
|
-
} }),
|
|
4633
|
-
return (0, import_jsx_runtime.jsx)(
|
|
4653
|
+
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, _d, `post-by-id`) : e6));
|
|
4654
|
+
} }), dd, a2 ? pd : fd) : vd, [i2, a2, o2, s2]);
|
|
4655
|
+
return (0, import_jsx_runtime.jsx)(xo, { i18n: c2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: md, children: t2 }), children: [(0, import_jsx_runtime.jsx)(Go, { i18n: c2, locale: l2 }), (0, import_jsx_runtime.jsx)(Fl, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: hd, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: (0, import_jsx_runtime.jsx)(yd, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
|
|
4634
4656
|
}
|
|
4635
|
-
var
|
|
4657
|
+
var xd = Nn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
|
|
4636
4658
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4637
4659
|
0 && (module.exports = {
|
|
4638
4660
|
PostByIdProvider,
|