images-viewer-vue3
Version:
A lightweight image viewer for Vue3
1,341 lines (1,340 loc) • 41.8 kB
JavaScript
import { e as y, n as x, b as d, i as R, f as T, y as C, w as de, l as wt, g as J, k as xt, c as P, d as O, h as ae, a as $, p as ne, j as Ht, z as Ee, A as te, B as se } from "./npm-@intlify-shared-B92O6p09.js";
import { s as Gt, C as Yt, D as ze, u as B, N as jt, a as Bt, b as Xt, c as Jt, d as Fe, e as Re, i as Ke, f as zt, g as Kt, h as qt, j as Qt, k as Zt, p as ke, t as Pe, M as ye, l as De, m as Ce, n as Se, o as Ve, q as ea, r as qe, v as ta, w as aa, x as na, y as Ae, z as sa, A as la } from "./npm-@intlify-core-base-OLlse01z.js";
import { defineComponent as be, h as Qe, getCurrentInstance as z, effectScope as ra, inject as oa, onMounted as ia, onUnmounted as ca, computed as X, watch as ie, Fragment as Ze, isRef as ua, ref as _a, shallowRef as ma, createVNode as fa, Text as ga } from "vue";
import { s as da } from "./npm-@vue-devtools-api-aVYGocXp.js";
import { c as Ea } from "./npm-@intlify-message-compiler-BFc0vbAd.js";
/*!
* vue-i18n v10.0.4
* (c) 2024 kazuya kawaguchi
* Released under the MIT License.
*/
const ba = "10.0.4";
function va() {
typeof __VUE_I18N_FULL_INSTALL__ != "boolean" && (J().__VUE_I18N_FULL_INSTALL__ = !0), typeof __VUE_I18N_LEGACY_API__ != "boolean" && (J().__VUE_I18N_LEGACY_API__ = !0), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (J().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1), typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (J().__INTLIFY_PROD_DEVTOOLS__ = !1);
}
const V = {
FALLBACK_TO_ROOT: Xt,
// 8
NOT_FOUND_PARENT_SCOPE: 9,
IGNORE_OBJ_FLATTEN: 10,
DEPRECATE_TC: 11
}, pa = {
[V.FALLBACK_TO_ROOT]: "Fall back to {type} '{key}' with root locale.",
[V.NOT_FOUND_PARENT_SCOPE]: "Not found parent scope. use the global scope.",
[V.IGNORE_OBJ_FLATTEN]: "Ignore object flatten: '{key}' key has an string value",
[V.DEPRECATE_TC]: "'tc' and '$tc' has been deprecated in v10. Use 't' or '$t' instead. 'tc' and '$tc’ are going to remove in v11."
};
function le(e, ...t) {
return xt(pa[e], ...t);
}
const b = {
// composer module errors
UNEXPECTED_RETURN_TYPE: Yt,
// 24
// legacy module errors
INVALID_ARGUMENT: 25,
// i18n module errors
MUST_BE_CALL_SETUP_TOP: 26,
NOT_INSTALLED: 27,
// directive module errors
REQUIRED_VALUE: 28,
INVALID_VALUE: 29,
// vue-devtools errors
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30,
NOT_INSTALLED_WITH_PROVIDE: 31,
// unexpected error
UNEXPECTED_ERROR: 32,
// not compatible legacy vue-i18n constructor
NOT_COMPATIBLE_LEGACY_VUE_I18N: 33,
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: 34
};
function h(e, ...t) {
return Ea(e, null, process.env.NODE_ENV !== "production" ? { messages: Na, args: t } : void 0);
}
const Na = {
[b.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
[b.INVALID_ARGUMENT]: "Invalid argument",
[b.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
[b.NOT_INSTALLED]: "Need to install with `app.use` function",
[b.UNEXPECTED_ERROR]: "Unexpected error",
[b.REQUIRED_VALUE]: "Required in value: {0}",
[b.INVALID_VALUE]: "Invalid value",
[b.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: "Cannot setup vue-devtools plugin",
[b.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
[b.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
[b.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"
}, ce = /* @__PURE__ */ C("__translateVNode"), ue = /* @__PURE__ */ C("__datetimeParts"), _e = /* @__PURE__ */ C("__numberParts"), W = /* @__PURE__ */ C("__enableEmitter"), K = /* @__PURE__ */ C("__disableEmitter"), et = C("__setPluralRules"), tt = /* @__PURE__ */ C("__injectWithOption"), me = /* @__PURE__ */ C("__dispose");
function q(e) {
if (!R(e))
return e;
for (const t in e)
if (se(e, t))
if (!t.includes("."))
R(e[t]) && q(e[t]);
else {
const l = t.split("."), s = l.length - 1;
let a = e, o = !1;
for (let n = 0; n < s; n++) {
if (l[n] in a || (a[l[n]] = {}), !R(a[l[n]])) {
process.env.NODE_ENV !== "production" && de(le(V.IGNORE_OBJ_FLATTEN, {
key: l[n]
})), o = !0;
break;
}
a = a[l[n]];
}
o || (a[l[s]] = e[t], delete e[t]), R(a[l[s]]) && q(a[l[s]]);
}
return e;
}
function ve(e, t) {
const { messages: l, __i18n: s, messageResolver: a, flatJson: o } = t, n = O(l) ? l : P(s) ? {} : { [e]: {} };
if (P(s) && s.forEach((c) => {
if ("locale" in c && "resource" in c) {
const { locale: u, resource: m } = c;
u ? (n[u] = n[u] || {}, te(m, n[u])) : te(m, n);
} else
d(c) && te(JSON.parse(c), n);
}), a == null && o)
for (const c in n)
se(n, c) && q(n[c]);
return n;
}
function at(e) {
return e.type;
}
function nt(e, t, l) {
let s = R(t.messages) ? t.messages : {};
"__i18nGlobal" in l && (s = ve(e.locale.value, {
messages: s,
__i18n: l.__i18nGlobal
}));
const a = Object.keys(s);
a.length && a.forEach((o) => {
e.mergeLocaleMessage(o, s[o]);
});
{
if (R(t.datetimeFormats)) {
const o = Object.keys(t.datetimeFormats);
o.length && o.forEach((n) => {
e.mergeDateTimeFormat(n, t.datetimeFormats[n]);
});
}
if (R(t.numberFormats)) {
const o = Object.keys(t.numberFormats);
o.length && o.forEach((n) => {
e.mergeNumberFormat(n, t.numberFormats[n]);
});
}
}
}
function Me(e) {
return fa(ga, null, e, 0);
}
const Ue = "__INTLIFY_META__", $e = () => [], Ia = () => !1;
let We = 0;
function we(e) {
return (t, l, s, a) => e(l, s, z() || void 0, a);
}
const Ta = /* @__NO_SIDE_EFFECTS__ */ () => {
const e = z();
let t = null;
return e && (t = at(e)[Ue]) ? { [Ue]: t } : null;
};
function pe(e = {}) {
const { __root: t, __injectWithOption: l } = e, s = t === void 0, a = e.flatJson, o = ne ? _a : ma;
let n = T(e.inheritLocale) ? e.inheritLocale : !0;
const c = o(
// prettier-ignore
t && n ? t.locale.value : d(e.locale) ? e.locale : ze
), u = o(
// prettier-ignore
t && n ? t.fallbackLocale.value : d(e.fallbackLocale) || P(e.fallbackLocale) || O(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : c.value
), m = o(ve(c.value, e)), v = o(O(e.datetimeFormats) ? e.datetimeFormats : { [c.value]: {} }), E = o(O(e.numberFormats) ? e.numberFormats : { [c.value]: {} });
let f = t ? t.missingWarn : T(e.missingWarn) || ae(e.missingWarn) ? e.missingWarn : !0, N = t ? t.fallbackWarn : T(e.fallbackWarn) || ae(e.fallbackWarn) ? e.fallbackWarn : !0, L = t ? t.fallbackRoot : T(e.fallbackRoot) ? e.fallbackRoot : !0, k = !!e.fallbackFormat, S = $(e.missing) ? e.missing : null, D = $(e.missing) ? we(e.missing) : null, F = $(e.postTranslation) ? e.postTranslation : null, H = t ? t.warnHtmlMessage : T(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, G = !!e.escapeParameter;
const Y = t ? t.modifiers : O(e.modifiers) ? e.modifiers : {};
let j = e.pluralRules || t && t.pluralRules, _;
_ = (() => {
s && Ae(null);
const r = {
version: ba,
locale: c.value,
fallbackLocale: u.value,
messages: m.value,
modifiers: Y,
pluralRules: j,
missing: D === null ? void 0 : D,
missingWarn: f,
fallbackWarn: N,
fallbackFormat: k,
unresolving: !0,
postTranslation: F === null ? void 0 : F,
warnHtmlMessage: H,
escapeParameter: G,
messageResolver: e.messageResolver,
messageCompiler: e.messageCompiler,
__meta: { framework: "vue" }
};
r.datetimeFormats = v.value, r.numberFormats = E.value, r.__datetimeFormatters = O(_) ? _.__datetimeFormatters : void 0, r.__numberFormatters = O(_) ? _.__numberFormatters : void 0, process.env.NODE_ENV !== "production" && (r.__v_emitter = O(_) ? _.__v_emitter : void 0);
const i = Jt(r);
return s && Ae(i), i;
})(), B(_, c.value, u.value);
function re() {
return [
c.value,
u.value,
m.value,
v.value,
E.value
];
}
const ct = X({
get: () => c.value,
set: (r) => {
c.value = r, _.locale = c.value;
}
}), ut = X({
get: () => u.value,
set: (r) => {
u.value = r, _.fallbackLocale = u.value, B(_, c.value, r);
}
}), _t = X(() => m.value), mt = /* @__PURE__ */ X(() => v.value), ft = /* @__PURE__ */ X(() => E.value);
function gt() {
return $(F) ? F : null;
}
function dt(r) {
F = r, _.postTranslation = r;
}
function Et() {
return S;
}
function bt(r) {
r !== null && (D = we(r)), S = r, _.missing = D;
}
function vt(r, i) {
return r !== "translate" || !i.resolvedMessage;
}
const A = (r, i, g, p, M, ee) => {
re();
let w;
try {
(process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) && zt(/* @__PURE__ */ Ta()), s || (_.fallbackContext = t ? Kt() : void 0), w = r(_);
} finally {
process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__, s || (_.fallbackContext = void 0);
}
if (g !== "translate exists" && // for not `te` (e.g `t`)
x(w) && w === qt || g === "translate exists" && !w) {
const [U, Wt] = i();
if (process.env.NODE_ENV !== "production" && t && d(U) && vt(g, Wt) && (L && (Qt(N, U) || Zt(f, U)) && de(le(V.FALLBACK_TO_ROOT, {
key: U,
type: g
})), process.env.NODE_ENV !== "production")) {
const { __v_emitter: he } = _;
he && L && he.emit("fallback", {
type: g,
key: U,
to: "global",
groupId: `${g}:${U}`
});
}
return t && L ? p(t) : M(U);
} else {
if (ee(w))
return w;
throw h(b.UNEXPECTED_RETURN_TYPE);
}
};
function Le(...r) {
return A((i) => Reflect.apply(Pe, null, [i, ...r]), () => ke(...r), "translate", (i) => Reflect.apply(i.t, i, [...r]), (i) => i, (i) => d(i));
}
function pt(...r) {
const [i, g, p] = r;
if (p && !R(p))
throw h(b.INVALID_ARGUMENT);
return Le(i, g, y({ resolvedMessage: !0 }, p || {}));
}
function Nt(...r) {
return A((i) => Reflect.apply(Ce, null, [i, ...r]), () => De(...r), "datetime format", (i) => Reflect.apply(i.d, i, [...r]), () => ye, (i) => d(i));
}
function It(...r) {
return A((i) => Reflect.apply(Ve, null, [i, ...r]), () => Se(...r), "number format", (i) => Reflect.apply(i.n, i, [...r]), () => ye, (i) => d(i));
}
function Tt(r) {
return r.map((i) => d(i) || x(i) || T(i) ? Me(String(i)) : i);
}
const Lt = {
normalize: Tt,
interpolate: (r) => r,
type: "vnode"
};
function Ot(...r) {
return A((i) => {
let g;
const p = i;
try {
p.processor = Lt, g = Reflect.apply(Pe, null, [p, ...r]);
} finally {
p.processor = null;
}
return g;
}, () => ke(...r), "translate", (i) => i[ce](...r), (i) => [Me(i)], (i) => P(i));
}
function ht(...r) {
return A((i) => Reflect.apply(Ve, null, [i, ...r]), () => Se(...r), "number format", (i) => i[_e](...r), $e, (i) => d(i) || P(i));
}
function Ft(...r) {
return A((i) => Reflect.apply(Ce, null, [i, ...r]), () => De(...r), "datetime format", (i) => i[ue](...r), $e, (i) => d(i) || P(i));
}
function Rt(r) {
j = r, _.pluralRules = j;
}
function kt(r, i) {
return A(() => {
if (!r)
return !1;
const g = d(i) ? i : c.value, p = Oe(g), M = _.messageResolver(p, r);
return Ke(M) || ea(M) || d(M);
}, () => [r], "translate exists", (g) => Reflect.apply(g.te, g, [r, i]), Ia, (g) => T(g));
}
function Pt(r) {
let i = null;
const g = qe(_, u.value, c.value);
for (let p = 0; p < g.length; p++) {
const M = m.value[g[p]] || {}, ee = _.messageResolver(M, r);
if (ee != null) {
i = ee;
break;
}
}
return i;
}
function yt(r) {
const i = Pt(r);
return i ?? (t ? t.tm(r) || {} : {});
}
function Oe(r) {
return m.value[r] || {};
}
function Dt(r, i) {
if (a) {
const g = { [r]: i };
for (const p in g)
se(g, p) && q(g[p]);
i = g[r];
}
m.value[r] = i, _.messages = m.value;
}
function Ct(r, i) {
m.value[r] = m.value[r] || {};
const g = { [r]: i };
if (a)
for (const p in g)
se(g, p) && q(g[p]);
i = g[r], te(i, m.value[r]), _.messages = m.value;
}
function St(r) {
return v.value[r] || {};
}
function Vt(r, i) {
v.value[r] = i, _.datetimeFormats = v.value, Fe(_, r, i);
}
function At(r, i) {
v.value[r] = y(v.value[r] || {}, i), _.datetimeFormats = v.value, Fe(_, r, i);
}
function Mt(r) {
return E.value[r] || {};
}
function Ut(r, i) {
E.value[r] = i, _.numberFormats = E.value, Re(_, r, i);
}
function $t(r, i) {
E.value[r] = y(E.value[r] || {}, i), _.numberFormats = E.value, Re(_, r, i);
}
We++, t && ne && (ie(t.locale, (r) => {
n && (c.value = r, _.locale = r, B(_, c.value, u.value));
}), ie(t.fallbackLocale, (r) => {
n && (u.value = r, _.fallbackLocale = r, B(_, c.value, u.value));
}));
const I = {
id: We,
locale: ct,
fallbackLocale: ut,
get inheritLocale() {
return n;
},
set inheritLocale(r) {
n = r, r && t && (c.value = t.locale.value, u.value = t.fallbackLocale.value, B(_, c.value, u.value));
},
get availableLocales() {
return Object.keys(m.value).sort();
},
messages: _t,
get modifiers() {
return Y;
},
get pluralRules() {
return j || {};
},
get isGlobal() {
return s;
},
get missingWarn() {
return f;
},
set missingWarn(r) {
f = r, _.missingWarn = f;
},
get fallbackWarn() {
return N;
},
set fallbackWarn(r) {
N = r, _.fallbackWarn = N;
},
get fallbackRoot() {
return L;
},
set fallbackRoot(r) {
L = r;
},
get fallbackFormat() {
return k;
},
set fallbackFormat(r) {
k = r, _.fallbackFormat = k;
},
get warnHtmlMessage() {
return H;
},
set warnHtmlMessage(r) {
H = r, _.warnHtmlMessage = r;
},
get escapeParameter() {
return G;
},
set escapeParameter(r) {
G = r, _.escapeParameter = r;
},
t: Le,
getLocaleMessage: Oe,
setLocaleMessage: Dt,
mergeLocaleMessage: Ct,
getPostTranslationHandler: gt,
setPostTranslationHandler: dt,
getMissingHandler: Et,
setMissingHandler: bt,
[et]: Rt
};
return I.datetimeFormats = mt, I.numberFormats = ft, I.rt = pt, I.te = kt, I.tm = yt, I.d = Nt, I.n = It, I.getDateTimeFormat = St, I.setDateTimeFormat = Vt, I.mergeDateTimeFormat = At, I.getNumberFormat = Mt, I.setNumberFormat = Ut, I.mergeNumberFormat = $t, I[tt] = l, I[ce] = Ot, I[ue] = Ft, I[_e] = ht, process.env.NODE_ENV !== "production" && (I[W] = (r) => {
_.__v_emitter = r;
}, I[K] = () => {
_.__v_emitter = void 0;
}), I;
}
const st = "vue-i18n: composer properties", oe = {
"vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
"vue-i18n-resource-inspector": "Vue I18n DevTools",
"vue-i18n-timeline": "Vue I18n"
}, La = {
"vue-i18n-resource-inspector": "Search for scopes ..."
}, Oa = {
"vue-i18n-timeline": 16764185
};
let fe;
async function ha(e, t) {
return new Promise((l, s) => {
try {
da({
id: "vue-devtools-plugin-vue-i18n",
label: oe["vue-devtools-plugin-vue-i18n"],
packageName: "vue-i18n",
homepage: "https://vue-i18n.intlify.dev",
logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
componentStateTypes: [st],
app: e
// eslint-disable-line @typescript-eslint/no-explicit-any
}, (a) => {
fe = a, a.on.visitComponentTree(({ componentInstance: n, treeNode: c }) => {
Fa(n, c, t);
}), a.on.inspectComponent(({ componentInstance: n, instanceData: c }) => {
n.vnode.el && n.vnode.el.__VUE_I18N__ && c && (t.mode === "legacy" ? n.vnode.el.__VUE_I18N__ !== t.global.__composer && xe(c, n.vnode.el.__VUE_I18N__) : xe(c, n.vnode.el.__VUE_I18N__));
}), a.addInspector({
id: "vue-i18n-resource-inspector",
label: oe["vue-i18n-resource-inspector"],
icon: "language",
treeFilterPlaceholder: La["vue-i18n-resource-inspector"]
}), a.on.getInspectorTree((n) => {
n.app === e && n.inspectorId === "vue-i18n-resource-inspector" && Da(n, t);
});
const o = /* @__PURE__ */ new Map();
a.on.getInspectorState(async (n) => {
if (n.app === e && n.inspectorId === "vue-i18n-resource-inspector")
if (a.unhighlightElement(), Sa(n, t), n.nodeId === "global") {
if (!o.has(n.app)) {
const [c] = await a.getComponentInstances(n.app);
o.set(n.app, c);
}
a.highlightElement(o.get(n.app));
} else {
const c = Ca(n.nodeId, t);
c && a.highlightElement(c);
}
}), a.on.editInspectorState((n) => {
n.app === e && n.inspectorId === "vue-i18n-resource-inspector" && Aa(n, t);
}), a.addTimelineLayer({
id: "vue-i18n-timeline",
label: oe["vue-i18n-timeline"],
color: Oa["vue-i18n-timeline"]
}), l(!0);
});
} catch (a) {
console.error(a), s(!1);
}
});
}
function lt(e) {
return e.type.name || e.type.displayName || e.type.__file || "Anonymous";
}
function Fa(e, t, l) {
const s = l.mode === "composition" ? l.global : l.global.__composer;
if (e && e.vnode.el && e.vnode.el.__VUE_I18N__ && e.vnode.el.__VUE_I18N__ !== s) {
const a = {
label: `i18n (${lt(e)} Scope)`,
textColor: 0,
backgroundColor: 16764185
};
t.tags.push(a);
}
}
function xe(e, t) {
const l = st;
e.state.push({
type: l,
key: "locale",
editable: !0,
value: t.locale.value
}), e.state.push({
type: l,
key: "availableLocales",
editable: !1,
value: t.availableLocales
}), e.state.push({
type: l,
key: "fallbackLocale",
editable: !0,
value: t.fallbackLocale.value
}), e.state.push({
type: l,
key: "inheritLocale",
editable: !0,
value: t.inheritLocale
}), e.state.push({
type: l,
key: "messages",
editable: !1,
value: Ne(t.messages.value)
}), e.state.push({
type: l,
key: "datetimeFormats",
editable: !1,
value: t.datetimeFormats.value
}), e.state.push({
type: l,
key: "numberFormats",
editable: !1,
value: t.numberFormats.value
});
}
function Ne(e) {
const t = {};
return Object.keys(e).forEach((l) => {
const s = e[l];
$(s) && "source" in s ? t[l] = ya(s) : Ke(s) && s.loc && s.loc.source ? t[l] = s.loc.source : R(s) ? t[l] = Ne(s) : t[l] = s;
}), t;
}
const Ra = {
"<": "<",
">": ">",
'"': """,
"&": "&"
};
function ka(e) {
return e.replace(/[<>"&]/g, Pa);
}
function Pa(e) {
return Ra[e] || e;
}
function ya(e) {
return {
_custom: {
type: "function",
display: `<span>ƒ</span> ${e.source ? `("${ka(e.source)}")` : "(?)"}`
}
};
}
function Da(e, t) {
e.rootNodes.push({
id: "global",
label: "Global Scope"
});
const l = t.mode === "composition" ? t.global : t.global.__composer;
for (const [s, a] of t.__instances) {
const o = t.mode === "composition" ? a : a.__composer;
l !== o && e.rootNodes.push({
id: o.id.toString(),
label: `${lt(s)} Scope`
});
}
}
function Ca(e, t) {
let l = null;
if (e !== "global") {
for (const [s, a] of t.__instances.entries())
if (a.id.toString() === e) {
l = s;
break;
}
}
return l;
}
function rt(e, t) {
if (e === "global")
return t.mode === "composition" ? t.global : t.global.__composer;
{
const l = Array.from(t.__instances.values()).find((s) => s.id.toString() === e);
return l ? t.mode === "composition" ? l : l.__composer : null;
}
}
function Sa(e, t) {
const l = rt(e.nodeId, t);
return l && (e.state = Va(l)), null;
}
function Va(e) {
const t = {}, l = "Locale related info", s = [
{
type: l,
key: "locale",
editable: !0,
value: e.locale.value
},
{
type: l,
key: "fallbackLocale",
editable: !0,
value: e.fallbackLocale.value
},
{
type: l,
key: "availableLocales",
editable: !1,
value: e.availableLocales
},
{
type: l,
key: "inheritLocale",
editable: !0,
value: e.inheritLocale
}
];
t[l] = s;
const a = "Locale messages info", o = [
{
type: a,
key: "messages",
editable: !1,
value: Ne(e.messages.value)
}
];
t[a] = o;
{
const n = "Datetime formats info", c = [
{
type: n,
key: "datetimeFormats",
editable: !1,
value: e.datetimeFormats.value
}
];
t[n] = c;
const u = "Datetime formats info", m = [
{
type: u,
key: "numberFormats",
editable: !1,
value: e.numberFormats.value
}
];
t[u] = m;
}
return t;
}
function Q(e, t) {
if (fe) {
let l;
t && "groupId" in t && (l = t.groupId, delete t.groupId), fe.addTimelineEvent({
layerId: "vue-i18n-timeline",
event: {
title: e,
groupId: l,
time: Date.now(),
meta: {},
data: t || {},
logType: e === "compile-error" ? "error" : e === "fallback" || e === "missing" ? "warning" : "default"
}
});
}
}
function Aa(e, t) {
const l = rt(e.nodeId, t);
if (l) {
const [s] = e.path;
s === "locale" && d(e.state.value) ? l.locale.value = e.state.value : s === "fallbackLocale" && (d(e.state.value) || P(e.state.value) || R(e.state.value)) ? l.fallbackLocale.value = e.state.value : s === "inheritLocale" && T(e.state.value) && (l.inheritLocale = e.state.value);
}
}
function Ma(e) {
const t = d(e.locale) ? e.locale : ze, l = d(e.fallbackLocale) || P(e.fallbackLocale) || O(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : t, s = $(e.missing) ? e.missing : void 0, a = T(e.silentTranslationWarn) || ae(e.silentTranslationWarn) ? !e.silentTranslationWarn : !0, o = T(e.silentFallbackWarn) || ae(e.silentFallbackWarn) ? !e.silentFallbackWarn : !0, n = T(e.fallbackRoot) ? e.fallbackRoot : !0, c = !!e.formatFallbackMessages, u = O(e.modifiers) ? e.modifiers : {}, m = e.pluralizationRules, v = $(e.postTranslation) ? e.postTranslation : void 0, E = d(e.warnHtmlInMessage) ? e.warnHtmlInMessage !== "off" : !0, f = !!e.escapeParameterHtml, N = T(e.sync) ? e.sync : !0;
let L = e.messages;
if (O(e.sharedMessages)) {
const Y = e.sharedMessages;
L = Object.keys(Y).reduce((_, Z) => {
const re = _[Z] || (_[Z] = {});
return y(re, Y[Z]), _;
}, L || {});
}
const { __i18n: k, __root: S, __injectWithOption: D } = e, F = e.datetimeFormats, H = e.numberFormats, G = e.flatJson;
return {
locale: t,
fallbackLocale: l,
messages: L,
flatJson: G,
datetimeFormats: F,
numberFormats: H,
missing: s,
missingWarn: a,
fallbackWarn: o,
fallbackRoot: n,
fallbackFormat: c,
modifiers: u,
pluralRules: m,
postTranslation: v,
warnHtmlMessage: E,
escapeParameter: f,
messageResolver: e.messageResolver,
inheritLocale: N,
__i18n: k,
__root: S,
__injectWithOption: D
};
}
function ge(e = {}) {
const t = pe(Ma(e)), { __extender: l } = e, s = {
// id
id: t.id,
// locale
get locale() {
return t.locale.value;
},
set locale(a) {
t.locale.value = a;
},
// fallbackLocale
get fallbackLocale() {
return t.fallbackLocale.value;
},
set fallbackLocale(a) {
t.fallbackLocale.value = a;
},
// messages
get messages() {
return t.messages.value;
},
// datetimeFormats
get datetimeFormats() {
return t.datetimeFormats.value;
},
// numberFormats
get numberFormats() {
return t.numberFormats.value;
},
// availableLocales
get availableLocales() {
return t.availableLocales;
},
// missing
get missing() {
return t.getMissingHandler();
},
set missing(a) {
t.setMissingHandler(a);
},
// silentTranslationWarn
get silentTranslationWarn() {
return T(t.missingWarn) ? !t.missingWarn : t.missingWarn;
},
set silentTranslationWarn(a) {
t.missingWarn = T(a) ? !a : a;
},
// silentFallbackWarn
get silentFallbackWarn() {
return T(t.fallbackWarn) ? !t.fallbackWarn : t.fallbackWarn;
},
set silentFallbackWarn(a) {
t.fallbackWarn = T(a) ? !a : a;
},
// modifiers
get modifiers() {
return t.modifiers;
},
// formatFallbackMessages
get formatFallbackMessages() {
return t.fallbackFormat;
},
set formatFallbackMessages(a) {
t.fallbackFormat = a;
},
// postTranslation
get postTranslation() {
return t.getPostTranslationHandler();
},
set postTranslation(a) {
t.setPostTranslationHandler(a);
},
// sync
get sync() {
return t.inheritLocale;
},
set sync(a) {
t.inheritLocale = a;
},
// warnInHtmlMessage
get warnHtmlInMessage() {
return t.warnHtmlMessage ? "warn" : "off";
},
set warnHtmlInMessage(a) {
t.warnHtmlMessage = a !== "off";
},
// escapeParameterHtml
get escapeParameterHtml() {
return t.escapeParameter;
},
set escapeParameterHtml(a) {
t.escapeParameter = a;
},
// pluralizationRules
get pluralizationRules() {
return t.pluralRules || {};
},
// for internal
__composer: t,
// t
t(...a) {
return Reflect.apply(t.t, t, [...a]);
},
// rt
rt(...a) {
return Reflect.apply(t.rt, t, [...a]);
},
// tc
tc(...a) {
const [o, n, c] = a, u = { plural: 1 };
let m = null, v = null;
if (process.env.NODE_ENV !== "production" && Ht(le(V.DEPRECATE_TC)), !d(o))
throw h(b.INVALID_ARGUMENT);
const E = o;
return d(n) ? u.locale = n : x(n) ? u.plural = n : P(n) ? m = n : O(n) && (v = n), d(c) ? u.locale = c : P(c) ? m = c : O(c) && (v = c), Reflect.apply(t.t, t, [
E,
m || v || {},
u
]);
},
// te
te(a, o) {
return t.te(a, o);
},
// tm
tm(a) {
return t.tm(a);
},
// getLocaleMessage
getLocaleMessage(a) {
return t.getLocaleMessage(a);
},
// setLocaleMessage
setLocaleMessage(a, o) {
t.setLocaleMessage(a, o);
},
// mergeLocaleMessage
mergeLocaleMessage(a, o) {
t.mergeLocaleMessage(a, o);
},
// d
d(...a) {
return Reflect.apply(t.d, t, [...a]);
},
// getDateTimeFormat
getDateTimeFormat(a) {
return t.getDateTimeFormat(a);
},
// setDateTimeFormat
setDateTimeFormat(a, o) {
t.setDateTimeFormat(a, o);
},
// mergeDateTimeFormat
mergeDateTimeFormat(a, o) {
t.mergeDateTimeFormat(a, o);
},
// n
n(...a) {
return Reflect.apply(t.n, t, [...a]);
},
// getNumberFormat
getNumberFormat(a) {
return t.getNumberFormat(a);
},
// setNumberFormat
setNumberFormat(a, o) {
t.setNumberFormat(a, o);
},
// mergeNumberFormat
mergeNumberFormat(a, o) {
t.mergeNumberFormat(a, o);
}
};
return s.__extender = l, process.env.NODE_ENV !== "production" && (s.__enableEmitter = (a) => {
const o = t;
o[W] && o[W](a);
}, s.__disableEmitter = () => {
const a = t;
a[K] && a[K]();
}), s;
}
function Ua(e, t, l) {
return {
beforeCreate() {
const s = z();
if (!s)
throw h(b.UNEXPECTED_ERROR);
const a = this.$options;
if (a.i18n) {
const o = a.i18n;
if (a.__i18n && (o.__i18n = a.__i18n), o.__root = t, this === this.$root)
this.$i18n = He(e, o);
else {
o.__injectWithOption = !0, o.__extender = l.__vueI18nExtend, this.$i18n = ge(o);
const n = this.$i18n;
n.__extender && (n.__disposer = n.__extender(this.$i18n));
}
} else if (a.__i18n)
if (this === this.$root)
this.$i18n = He(e, a);
else {
this.$i18n = ge({
__i18n: a.__i18n,
__injectWithOption: !0,
__extender: l.__vueI18nExtend,
__root: t
});
const o = this.$i18n;
o.__extender && (o.__disposer = o.__extender(this.$i18n));
}
else
this.$i18n = e;
a.__i18nGlobal && nt(t, a, a), this.$t = (...o) => this.$i18n.t(...o), this.$rt = (...o) => this.$i18n.rt(...o), this.$tc = (...o) => this.$i18n.tc(...o), this.$te = (o, n) => this.$i18n.te(o, n), this.$d = (...o) => this.$i18n.d(...o), this.$n = (...o) => this.$i18n.n(...o), this.$tm = (o) => this.$i18n.tm(o), l.__setInstance(s, this.$i18n);
},
mounted() {
if (process.env.NODE_ENV !== "production" && this.$el && this.$i18n) {
const s = this.$i18n;
this.$el.__VUE_I18N__ = s.__composer;
const a = this.__v_emitter = Ee();
s.__enableEmitter && s.__enableEmitter(a), a.on("*", Q);
}
},
unmounted() {
const s = z();
if (!s)
throw h(b.UNEXPECTED_ERROR);
const a = this.$i18n;
process.env.NODE_ENV !== "production" && this.$el && this.$el.__VUE_I18N__ && (this.__v_emitter && (this.__v_emitter.off("*", Q), delete this.__v_emitter), this.$i18n && (a.__disableEmitter && a.__disableEmitter(), delete this.$el.__VUE_I18N__)), delete this.$t, delete this.$rt, delete this.$tc, delete this.$te, delete this.$d, delete this.$n, delete this.$tm, a.__disposer && (a.__disposer(), delete a.__disposer, delete a.__extender), l.__deleteInstance(s), delete this.$i18n;
}
};
}
function He(e, t) {
e.locale = t.locale || e.locale, e.fallbackLocale = t.fallbackLocale || e.fallbackLocale, e.missing = t.missing || e.missing, e.silentTranslationWarn = t.silentTranslationWarn || e.silentFallbackWarn, e.silentFallbackWarn = t.silentFallbackWarn || e.silentFallbackWarn, e.formatFallbackMessages = t.formatFallbackMessages || e.formatFallbackMessages, e.postTranslation = t.postTranslation || e.postTranslation, e.warnHtmlInMessage = t.warnHtmlInMessage || e.warnHtmlInMessage, e.escapeParameterHtml = t.escapeParameterHtml || e.escapeParameterHtml, e.sync = t.sync || e.sync, e.__composer[et](t.pluralizationRules || e.pluralizationRules);
const l = ve(e.locale, {
messages: t.messages,
__i18n: t.__i18n
});
return Object.keys(l).forEach((s) => e.mergeLocaleMessage(s, l[s])), t.datetimeFormats && Object.keys(t.datetimeFormats).forEach((s) => e.mergeDateTimeFormat(s, t.datetimeFormats[s])), t.numberFormats && Object.keys(t.numberFormats).forEach((s) => e.mergeNumberFormat(s, t.numberFormats[s])), e;
}
const Ie = {
tag: {
type: [String, Object]
},
locale: {
type: String
},
scope: {
type: String,
// NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
validator: (e) => e === "parent" || e === "global",
default: "parent"
/* ComponentI18nScope */
},
i18n: {
type: Object
}
};
function $a({ slots: e }, t) {
return t.length === 1 && t[0] === "default" ? (e.default ? e.default() : []).reduce((s, a) => [
...s,
// prettier-ignore
...a.type === Ze ? a.children : [a]
], []) : t.reduce((l, s) => {
const a = e[s];
return a && (l[s] = a()), l;
}, {});
}
function ot() {
return Ze;
}
const Wa = /* @__PURE__ */ be({
/* eslint-disable */
name: "i18n-t",
props: y({
keypath: {
type: String,
required: !0
},
plural: {
type: [Number, String],
validator: (e) => x(e) || !isNaN(e)
}
}, Ie),
/* eslint-enable */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup(e, t) {
const { slots: l, attrs: s } = t, a = e.i18n || Te({
useScope: e.scope,
__useComponent: !0
});
return () => {
const o = Object.keys(l).filter((E) => E !== "_"), n = {};
e.locale && (n.locale = e.locale), e.plural !== void 0 && (n.plural = d(e.plural) ? +e.plural : e.plural);
const c = $a(t, o), u = a[ce](e.keypath, c, n), m = y({}, s), v = d(e.tag) || R(e.tag) ? e.tag : ot();
return Qe(v, m, u);
};
}
}), Ge = Wa;
function wa(e) {
return P(e) && !d(e[0]);
}
function it(e, t, l, s) {
const { slots: a, attrs: o } = t;
return () => {
const n = { part: !0 };
let c = {};
e.locale && (n.locale = e.locale), d(e.format) ? n.key = e.format : R(e.format) && (d(e.format.key) && (n.key = e.format.key), c = Object.keys(e.format).reduce((f, N) => l.includes(N) ? y({}, f, { [N]: e.format[N] }) : f, {}));
const u = s(e.value, n, c);
let m = [n.key];
P(u) ? m = u.map((f, N) => {
const L = a[f.type], k = L ? L({ [f.type]: f.value, index: N, parts: u }) : [f.value];
return wa(k) && (k[0].key = `${f.type}-${N}`), k;
}) : d(u) && (m = [u]);
const v = y({}, o), E = d(e.tag) || R(e.tag) ? e.tag : ot();
return Qe(E, v, m);
};
}
const xa = /* @__PURE__ */ be({
/* eslint-disable */
name: "i18n-n",
props: y({
value: {
type: Number,
required: !0
},
format: {
type: [String, Object]
}
}, Ie),
/* eslint-enable */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup(e, t) {
const l = e.i18n || Te({
useScope: e.scope,
__useComponent: !0
});
return it(e, t, jt, (...s) => (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
l[_e](...s)
));
}
}), Ye = xa, Ha = /* @__PURE__ */ be({
/* eslint-disable */
name: "i18n-d",
props: y({
value: {
type: [Number, Date],
required: !0
},
format: {
type: [String, Object]
}
}, Ie),
/* eslint-enable */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup(e, t) {
const l = e.i18n || Te({
useScope: e.scope,
__useComponent: !0
});
return it(e, t, Bt, (...s) => (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
l[ue](...s)
));
}
}), je = Ha;
function Ga(e, t) {
const l = e;
if (e.mode === "composition")
return l.__getInstance(t) || e.global;
{
const s = l.__getInstance(t);
return s != null ? s.__composer : e.global.__composer;
}
}
function Ya(e) {
const t = (n) => {
const { instance: c, value: u } = n;
if (!c || !c.$)
throw h(b.UNEXPECTED_ERROR);
const m = Ga(e, c.$), v = Be(u);
return [
Reflect.apply(m.t, m, [...Xe(v)]),
m
];
};
return {
created: (n, c) => {
const [u, m] = t(c);
ne && e.global === m && (n.__i18nWatcher = ie(m.locale, () => {
c.instance && c.instance.$forceUpdate();
})), n.__composer = m, n.textContent = u;
},
unmounted: (n) => {
ne && n.__i18nWatcher && (n.__i18nWatcher(), n.__i18nWatcher = void 0, delete n.__i18nWatcher), n.__composer && (n.__composer = void 0, delete n.__composer);
},
beforeUpdate: (n, { value: c }) => {
if (n.__composer) {
const u = n.__composer, m = Be(c);
n.textContent = Reflect.apply(u.t, u, [
...Xe(m)
]);
}
},
getSSRProps: (n) => {
const [c] = t(n);
return { textContent: c };
}
};
}
function Be(e) {
if (d(e))
return { path: e };
if (O(e)) {
if (!("path" in e))
throw h(b.REQUIRED_VALUE, "path");
return e;
} else
throw h(b.INVALID_VALUE);
}
function Xe(e) {
const { path: t, locale: l, args: s, choice: a, plural: o } = e, n = {}, c = s || {};
return d(l) && (n.locale = l), x(a) && (n.plural = a), x(o) && (n.plural = o), [t, c, n];
}
function ja(e, t, ...l) {
const s = O(l[0]) ? l[0] : {};
(T(s.globalInstall) ? s.globalInstall : !0) && ([Ge.name, "I18nT"].forEach((o) => e.component(o, Ge)), [Ye.name, "I18nN"].forEach((o) => e.component(o, Ye)), [je.name, "I18nD"].forEach((o) => e.component(o, je))), e.directive("t", Ya(t));
}
const Ba = /* @__PURE__ */ C("global-vue-i18n");
function cn(e = {}, t) {
const l = __VUE_I18N_LEGACY_API__ && T(e.legacy) ? e.legacy : __VUE_I18N_LEGACY_API__, s = T(e.globalInjection) ? e.globalInjection : !0, a = /* @__PURE__ */ new Map(), [o, n] = Xa(e, l), c = /* @__PURE__ */ C(process.env.NODE_ENV !== "production" ? "vue-i18n" : "");
function u(f) {
return a.get(f) || null;
}
function m(f, N) {
a.set(f, N);
}
function v(f) {
a.delete(f);
}
const E = {
// mode
get mode() {
return __VUE_I18N_LEGACY_API__ && l ? "legacy" : "composition";
},
// install plugin
async install(f, ...N) {
if (process.env.NODE_ENV !== "production" && (f.__VUE_I18N__ = E), f.__VUE_I18N_SYMBOL__ = c, f.provide(f.__VUE_I18N_SYMBOL__, E), O(N[0])) {
const S = N[0];
E.__composerExtend = S.__composerExtend, E.__vueI18nExtend = S.__vueI18nExtend;
}
let L = null;
!l && s && (L = tn(f, E.global)), __VUE_I18N_FULL_INSTALL__ && ja(f, E, ...N), __VUE_I18N_LEGACY_API__ && l && f.mixin(Ua(n, n.__composer, E));
const k = f.unmount;
if (f.unmount = () => {
L && L(), E.dispose(), k();
}, process.env.NODE_ENV !== "production") {
if (!await ha(f, E))
throw h(b.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
const D = Ee();
if (l) {
const F = n;
F.__enableEmitter && F.__enableEmitter(D);
} else {
const F = n;
F[W] && F[W](D);
}
D.on("*", Q);
}
},
// global accessor
get global() {
return n;
},
dispose() {
o.stop();
},
// @internal
__instances: a,
// @internal
__getInstance: u,
// @internal
__setInstance: m,
// @internal
__deleteInstance: v
};
return E;
}
function Te(e = {}) {
const t = z();
if (t == null)
throw h(b.MUST_BE_CALL_SETUP_TOP);
if (!t.isCE && t.appContext.app != null && !t.appContext.app.__VUE_I18N_SYMBOL__)
throw h(b.NOT_INSTALLED);
const l = Ja(t), s = Ka(l), a = at(t), o = za(e, a);
if (o === "global")
return nt(s, e, a), s;
if (o === "parent") {
let u = qa(l, t, e.__useComponent);
return u == null && (process.env.NODE_ENV !== "production" && de(le(V.NOT_FOUND_PARENT_SCOPE)), u = s), u;
}
const n = l;
let c = n.__getInstance(t);
if (c == null) {
const u = y({}, e);
"__i18n" in a && (u.__i18n = a.__i18n), s && (u.__root = s), c = pe(u), n.__composerExtend && (c[me] = n.__composerExtend(c)), Za(n, t, c), n.__setInstance(t, c);
}
return c;
}
function Xa(e, t, l) {
const s = ra(), a = __VUE_I18N_LEGACY_API__ && t ? s.run(() => ge(e)) : s.run(() => pe(e));
if (a == null)
throw h(b.UNEXPECTED_ERROR);
return [s, a];
}
function Ja(e) {
const t = oa(e.isCE ? Ba : e.appContext.app.__VUE_I18N_SYMBOL__);
if (!t)
throw h(e.isCE ? b.NOT_INSTALLED_WITH_PROVIDE : b.UNEXPECTED_ERROR);
return t;
}
function za(e, t) {
return wt(e) ? "__i18n" in t ? "local" : "global" : e.useScope ? e.useScope : "local";
}
function Ka(e) {
return e.mode === "composition" ? e.global : e.global.__composer;
}
function qa(e, t, l = !1) {
let s = null;
const a = t.root;
let o = Qa(t, l);
for (; o != null; ) {
const n = e;
if (e.mode === "composition")
s = n.__getInstance(o);
else if (__VUE_I18N_LEGACY_API__) {
const c = n.__getInstance(o);
c != null && (s = c.__composer, l && s && !s[tt] && (s = null));
}
if (s != null || a === o)
break;
o = o.parent;
}
return s;
}
function Qa(e, t = !1) {
return e == null ? null : t && e.vnode.ctx || e.parent;
}
function Za(e, t, l) {
let s = null;
ia(() => {
if (process.env.NODE_ENV !== "production" && t.vnode.el) {
t.vnode.el.__VUE_I18N__ = l, s = Ee();
const a = l;
a[W] && a[W](s), s.on("*", Q);
}
}, t), ca(() => {
const a = l;
process.env.NODE_ENV !== "production" && t.vnode.el && t.vnode.el.__VUE_I18N__ && (s && s.off("*", Q), a[K] && a[K](), delete t.vnode.el.__VUE_I18N__), e.__deleteInstance(t);
const o = a[me];
o && (o(), delete a[me]);
}, t);
}
const en = [
"locale",
"fallbackLocale",
"availableLocales"
], Je = ["t", "rt", "d", "n", "tm", "te"];
function tn(e, t) {
const l = /* @__PURE__ */ Object.create(null);
return en.forEach((a) => {
const o = Object.getOwnPropertyDescriptor(t, a);
if (!o)
throw h(b.UNEXPECTED_ERROR);
const n = ua(o.value) ? {
get() {
return o.value.value;
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
set(c) {
o.value.value = c;
}
} : {
get() {
return o.get && o.get();
}
};
Object.defineProperty(l, a, n);
}), e.config.globalProperties.$i18n = l, Je.forEach((a) => {
const o = Object.getOwnPropertyDescriptor(t, a);
if (!o || !o.value)
throw h(b.UNEXPECTED_ERROR);
Object.defineProperty(e.config.globalProperties, `$${a}`, o);
}), () => {
delete e.config.globalProperties.$i18n, Je.forEach((a) => {
delete e.config.globalProperties[`$${a}`];
});
};
}
va();
ta(sa);
aa(la);
na(qe);
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
const e = J();
e.__INTLIFY__ = !0, Gt(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
}
process.env.NODE_ENV;
export {
cn as c
};