mooho-base-admin-plus 2.0.33 → 2.0.35
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/package/mooho-base-admin-plus.min.esm.js +863 -2345
- package/package/mooho-base-admin-plus.min.js +51 -47
- package/package.json +1 -1
- package/src/index.js +8 -1
- package/test/main.js +2 -18
- package/vite.config.js +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import require$$0, { watch, effectScope, reactive, computed, shallowRef, unref, nextTick, defineComponent, inject, h, provide, ref, getCurrentInstance, watchEffect, openBlock, createElementBlock, createElementVNode, normalizeStyle as normalizeStyle$1, toDisplayString as toDisplayString$1, withDirectives, vModelText, createCommentVNode, pushScopeId, popScopeId, resolveComponent, resolveDirective,
|
|
1
|
+
import require$$0, { watch, effectScope, reactive, computed, shallowRef, unref, nextTick, defineComponent, inject, h, provide, ref, getCurrentInstance, watchEffect, onMounted, onUnmounted, onBeforeMount, Fragment, isRef, createVNode as createVNode$1, Text, openBlock, createElementBlock, createElementVNode, normalizeStyle as normalizeStyle$1, toDisplayString as toDisplayString$1, withDirectives, vModelText, createCommentVNode, pushScopeId, popScopeId, resolveComponent, resolveDirective, withCtx, renderList, createBlock, createTextVNode, renderSlot, mergeProps, markRaw, resolveDynamicComponent, withModifiers, normalizeProps, guardReactiveProps, vShow, normalizeClass, Transition, KeepAlive } from "vue";
|
|
2
2
|
import ViewUIPlus from "view-ui-plus";
|
|
3
3
|
function getDevtoolsGlobalHook() {
|
|
4
4
|
return getTarget$1().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
@@ -161,7 +161,7 @@ function forEachValue(obj, fn) {
|
|
|
161
161
|
function isObject$6(obj) {
|
|
162
162
|
return obj !== null && typeof obj === "object";
|
|
163
163
|
}
|
|
164
|
-
function isPromise$
|
|
164
|
+
function isPromise$4(val) {
|
|
165
165
|
return val && typeof val.then === "function";
|
|
166
166
|
}
|
|
167
167
|
function assert$1(condition, msg) {
|
|
@@ -361,7 +361,7 @@ function registerAction$1(store2, type, handler, local) {
|
|
|
361
361
|
rootGetters: store2.getters,
|
|
362
362
|
rootState: store2.state
|
|
363
363
|
}, payload);
|
|
364
|
-
if (!isPromise$
|
|
364
|
+
if (!isPromise$4(res2)) {
|
|
365
365
|
res2 = Promise.resolve(res2);
|
|
366
366
|
}
|
|
367
367
|
if (store2._devtoolHook) {
|
|
@@ -2648,7 +2648,7 @@ var lodash$1 = { exports: {} };
|
|
|
2648
2648
|
var index2 = -1, length2 = array.length;
|
|
2649
2649
|
while (++index2 < length2) {
|
|
2650
2650
|
var value = array[index2], current = iteratee2(value);
|
|
2651
|
-
if (current != null && (computed2 === undefined$1 ? current === current && !
|
|
2651
|
+
if (current != null && (computed2 === undefined$1 ? current === current && !isSymbol(current) : comparator(current, computed2))) {
|
|
2652
2652
|
var computed2 = current, result3 = value;
|
|
2653
2653
|
}
|
|
2654
2654
|
}
|
|
@@ -3198,7 +3198,7 @@ var lodash$1 = { exports: {} };
|
|
|
3198
3198
|
if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
|
3199
3199
|
while (low < high) {
|
|
3200
3200
|
var mid = low + high >>> 1, computed2 = array[mid];
|
|
3201
|
-
if (computed2 !== null && !
|
|
3201
|
+
if (computed2 !== null && !isSymbol(computed2) && (retHighest ? computed2 <= value : computed2 < value)) {
|
|
3202
3202
|
low = mid + 1;
|
|
3203
3203
|
} else {
|
|
3204
3204
|
high = mid;
|
|
@@ -3214,9 +3214,9 @@ var lodash$1 = { exports: {} };
|
|
|
3214
3214
|
return 0;
|
|
3215
3215
|
}
|
|
3216
3216
|
value = iteratee2(value);
|
|
3217
|
-
var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol =
|
|
3217
|
+
var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined$1;
|
|
3218
3218
|
while (low < high) {
|
|
3219
|
-
var mid = nativeFloor((low + high) / 2), computed2 = iteratee2(array[mid]), othIsDefined = computed2 !== undefined$1, othIsNull = computed2 === null, othIsReflexive = computed2 === computed2, othIsSymbol =
|
|
3219
|
+
var mid = nativeFloor((low + high) / 2), computed2 = iteratee2(array[mid]), othIsDefined = computed2 !== undefined$1, othIsNull = computed2 === null, othIsReflexive = computed2 === computed2, othIsSymbol = isSymbol(computed2);
|
|
3220
3220
|
if (valIsNaN) {
|
|
3221
3221
|
var setLow = retHighest || othIsReflexive;
|
|
3222
3222
|
} else if (valIsUndefined) {
|
|
@@ -3253,7 +3253,7 @@ var lodash$1 = { exports: {} };
|
|
|
3253
3253
|
if (typeof value == "number") {
|
|
3254
3254
|
return value;
|
|
3255
3255
|
}
|
|
3256
|
-
if (
|
|
3256
|
+
if (isSymbol(value)) {
|
|
3257
3257
|
return NAN;
|
|
3258
3258
|
}
|
|
3259
3259
|
return +value;
|
|
@@ -3265,7 +3265,7 @@ var lodash$1 = { exports: {} };
|
|
|
3265
3265
|
if (isArray2(value)) {
|
|
3266
3266
|
return arrayMap(value, baseToString) + "";
|
|
3267
3267
|
}
|
|
3268
|
-
if (
|
|
3268
|
+
if (isSymbol(value)) {
|
|
3269
3269
|
return symbolToString ? symbolToString.call(value) : "";
|
|
3270
3270
|
}
|
|
3271
3271
|
var result3 = value + "";
|
|
@@ -3410,8 +3410,8 @@ var lodash$1 = { exports: {} };
|
|
|
3410
3410
|
}
|
|
3411
3411
|
function compareAscending(value, other) {
|
|
3412
3412
|
if (value !== other) {
|
|
3413
|
-
var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol =
|
|
3414
|
-
var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol =
|
|
3413
|
+
var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
|
|
3414
|
+
var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
|
|
3415
3415
|
if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
|
|
3416
3416
|
return 1;
|
|
3417
3417
|
}
|
|
@@ -4293,7 +4293,7 @@ var lodash$1 = { exports: {} };
|
|
|
4293
4293
|
return false;
|
|
4294
4294
|
}
|
|
4295
4295
|
var type = typeof value;
|
|
4296
|
-
if (type == "number" || type == "symbol" || type == "boolean" || value == null ||
|
|
4296
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
4297
4297
|
return true;
|
|
4298
4298
|
}
|
|
4299
4299
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
|
|
@@ -4472,7 +4472,7 @@ var lodash$1 = { exports: {} };
|
|
|
4472
4472
|
return result3;
|
|
4473
4473
|
});
|
|
4474
4474
|
function toKey(value) {
|
|
4475
|
-
if (typeof value == "string" ||
|
|
4475
|
+
if (typeof value == "string" || isSymbol(value)) {
|
|
4476
4476
|
return value;
|
|
4477
4477
|
}
|
|
4478
4478
|
var result3 = value + "";
|
|
@@ -5546,7 +5546,7 @@ var lodash$1 = { exports: {} };
|
|
|
5546
5546
|
function isString2(value) {
|
|
5547
5547
|
return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
|
|
5548
5548
|
}
|
|
5549
|
-
function
|
|
5549
|
+
function isSymbol(value) {
|
|
5550
5550
|
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
5551
5551
|
}
|
|
5552
5552
|
var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
@@ -5598,7 +5598,7 @@ var lodash$1 = { exports: {} };
|
|
|
5598
5598
|
if (typeof value == "number") {
|
|
5599
5599
|
return value;
|
|
5600
5600
|
}
|
|
5601
|
-
if (
|
|
5601
|
+
if (isSymbol(value)) {
|
|
5602
5602
|
return NAN;
|
|
5603
5603
|
}
|
|
5604
5604
|
if (isObject2(value)) {
|
|
@@ -6324,7 +6324,7 @@ var lodash$1 = { exports: {} };
|
|
|
6324
6324
|
if (isArray2(value)) {
|
|
6325
6325
|
return arrayMap(value, toKey);
|
|
6326
6326
|
}
|
|
6327
|
-
return
|
|
6327
|
+
return isSymbol(value) ? [value] : copyArray(stringToPath(toString3(value)));
|
|
6328
6328
|
}
|
|
6329
6329
|
function uniqueId(prefix2) {
|
|
6330
6330
|
var id = ++idCounter;
|
|
@@ -6598,7 +6598,7 @@ var lodash$1 = { exports: {} };
|
|
|
6598
6598
|
lodash2.isSafeInteger = isSafeInteger;
|
|
6599
6599
|
lodash2.isSet = isSet;
|
|
6600
6600
|
lodash2.isString = isString2;
|
|
6601
|
-
lodash2.isSymbol =
|
|
6601
|
+
lodash2.isSymbol = isSymbol;
|
|
6602
6602
|
lodash2.isTypedArray = isTypedArray2;
|
|
6603
6603
|
lodash2.isUndefined = isUndefined2;
|
|
6604
6604
|
lodash2.isWeakMap = isWeakMap;
|
|
@@ -6853,14 +6853,14 @@ var lodash$1 = { exports: {} };
|
|
|
6853
6853
|
}
|
|
6854
6854
|
}).call(commonjsGlobal);
|
|
6855
6855
|
})(lodash$1, lodash$1.exports);
|
|
6856
|
-
var isPromise$
|
|
6857
|
-
isPromise$
|
|
6858
|
-
isPromise$
|
|
6859
|
-
function isPromise$
|
|
6856
|
+
var isPromise$3 = { exports: {} };
|
|
6857
|
+
isPromise$3.exports = isPromise$2;
|
|
6858
|
+
isPromise$3.exports.default = isPromise$2;
|
|
6859
|
+
function isPromise$2(obj) {
|
|
6860
6860
|
return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
|
|
6861
6861
|
}
|
|
6862
6862
|
var lodash = lodash$1.exports;
|
|
6863
|
-
var isPromise$
|
|
6863
|
+
var isPromise$1 = isPromise$3.exports;
|
|
6864
6864
|
var main = function(adapter2) {
|
|
6865
6865
|
if (typeof adapter2 !== "object") {
|
|
6866
6866
|
throw new Error("An adapter must be provided, see https://github.com/typicode/lowdb/#usage");
|
|
@@ -6878,11 +6878,11 @@ var main = function(adapter2) {
|
|
|
6878
6878
|
db2._ = _;
|
|
6879
6879
|
db2.read = function() {
|
|
6880
6880
|
var r = adapter2.read();
|
|
6881
|
-
return isPromise$
|
|
6881
|
+
return isPromise$1(r) ? r.then(plant) : plant(r);
|
|
6882
6882
|
};
|
|
6883
6883
|
db2.write = function(returnValue) {
|
|
6884
6884
|
var w2 = adapter2.write(db2.getState());
|
|
6885
|
-
return isPromise$
|
|
6885
|
+
return isPromise$1(w2) ? w2.then(function() {
|
|
6886
6886
|
return returnValue;
|
|
6887
6887
|
}) : returnValue;
|
|
6888
6888
|
};
|
|
@@ -6983,7 +6983,7 @@ db$1.defaults({
|
|
|
6983
6983
|
sys: {},
|
|
6984
6984
|
database: {}
|
|
6985
6985
|
}).write();
|
|
6986
|
-
const util$
|
|
6986
|
+
const util$2 = {
|
|
6987
6987
|
cookies: cookies$2,
|
|
6988
6988
|
db: db$1
|
|
6989
6989
|
};
|
|
@@ -10476,7 +10476,7 @@ const warnAboutDepreation = (deprecatedParam, useInstead) => {
|
|
|
10476
10476
|
const callIfFunction = (arg) => typeof arg === "function" ? arg() : arg;
|
|
10477
10477
|
const hasToPromiseFn = (arg) => arg && typeof arg.toPromise === "function";
|
|
10478
10478
|
const asPromise = (arg) => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg);
|
|
10479
|
-
const isPromise
|
|
10479
|
+
const isPromise = (arg) => arg && Promise.resolve(arg) === arg;
|
|
10480
10480
|
const DismissReason = Object.freeze({
|
|
10481
10481
|
cancel: "cancel",
|
|
10482
10482
|
backdrop: "backdrop",
|
|
@@ -11146,7 +11146,7 @@ const renderInputType = {};
|
|
|
11146
11146
|
renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = (input, params) => {
|
|
11147
11147
|
if (typeof params.inputValue === "string" || typeof params.inputValue === "number") {
|
|
11148
11148
|
input.value = params.inputValue;
|
|
11149
|
-
} else if (!isPromise
|
|
11149
|
+
} else if (!isPromise(params.inputValue)) {
|
|
11150
11150
|
warn$2(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof params.inputValue}"`);
|
|
11151
11151
|
}
|
|
11152
11152
|
setInputPlaceholder(input, params);
|
|
@@ -12164,7 +12164,7 @@ const addClasses = (container, popup, params) => {
|
|
|
12164
12164
|
const handleInputOptionsAndValue = (instance, params) => {
|
|
12165
12165
|
if (params.input === "select" || params.input === "radio") {
|
|
12166
12166
|
handleInputOptions(instance, params);
|
|
12167
|
-
} else if (["text", "email", "number", "tel", "textarea"].includes(params.input) && (hasToPromiseFn(params.inputValue) || isPromise
|
|
12167
|
+
} else if (["text", "email", "number", "tel", "textarea"].includes(params.input) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) {
|
|
12168
12168
|
handleInputValue(instance, params);
|
|
12169
12169
|
}
|
|
12170
12170
|
};
|
|
@@ -12190,7 +12190,7 @@ const getFileValue = (input) => input.files.length ? input.getAttribute("multipl
|
|
|
12190
12190
|
const handleInputOptions = (instance, params) => {
|
|
12191
12191
|
const content = getContent();
|
|
12192
12192
|
const processInputOptions = (inputOptions) => populateInputOptions[params.input](content, formatInputOptions(inputOptions), params);
|
|
12193
|
-
if (hasToPromiseFn(params.inputOptions) || isPromise
|
|
12193
|
+
if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) {
|
|
12194
12194
|
showLoading();
|
|
12195
12195
|
asPromise(params.inputOptions).then((inputOptions) => {
|
|
12196
12196
|
instance.hideLoading();
|
|
@@ -12814,7 +12814,7 @@ service.interceptors.request.use(
|
|
|
12814
12814
|
store.commit("admin/loader/start");
|
|
12815
12815
|
let baseURL = window.$mode === "development" ? Setting.apiBaseURL.dev : Setting.apiBaseURL.prd;
|
|
12816
12816
|
config.url = baseURL + config.url;
|
|
12817
|
-
const token = util$
|
|
12817
|
+
const token = util$2.cookies.get("token");
|
|
12818
12818
|
config.headers["Authorization"] = "Bearer " + token;
|
|
12819
12819
|
return config;
|
|
12820
12820
|
},
|
|
@@ -12944,8 +12944,8 @@ var account = {
|
|
|
12944
12944
|
actions: {
|
|
12945
12945
|
async login({ dispatch: dispatch2 }, { username = "", password = "" } = {}) {
|
|
12946
12946
|
const res2 = await userlApi.login({ account: username, password });
|
|
12947
|
-
util$
|
|
12948
|
-
util$
|
|
12947
|
+
util$2.cookies.set("uuid", res2.user.id);
|
|
12948
|
+
util$2.cookies.set("token", res2.token);
|
|
12949
12949
|
await dispatch2("admin/user/set", res2.user, { root: true });
|
|
12950
12950
|
await dispatch2("admin/user/setData", res2.data, { root: true });
|
|
12951
12951
|
await dispatch2("load");
|
|
@@ -12953,8 +12953,8 @@ var account = {
|
|
|
12953
12953
|
},
|
|
12954
12954
|
logout({ dispatch: dispatch2 }, { confirm: confirm2 = false } = {}) {
|
|
12955
12955
|
async function logout() {
|
|
12956
|
-
util$
|
|
12957
|
-
util$
|
|
12956
|
+
util$2.cookies.remove("token");
|
|
12957
|
+
util$2.cookies.remove("uuid");
|
|
12958
12958
|
await dispatch2("admin/user/set", {}, { root: true });
|
|
12959
12959
|
if (router$1.currentRoute.value.path != "/login") {
|
|
12960
12960
|
router$1.push("/login?redirect=" + router$1.options.history.location);
|
|
@@ -15097,11 +15097,11 @@ var __glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
15097
15097
|
"default": dataView
|
|
15098
15098
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
15099
15099
|
function pathInit({ dbName = "database", path = "", user: user2 = true, validator: validator2 = () => true, defaultValue = "" }) {
|
|
15100
|
-
const uuid = util$
|
|
15100
|
+
const uuid = util$2.cookies.get("uuid") || "ghost-uuid";
|
|
15101
15101
|
const currentPath = `${dbName}.${user2 ? `user.${uuid}` : "public"}${path ? `.${path}` : ""}`;
|
|
15102
|
-
const value = util$
|
|
15102
|
+
const value = util$2.db.get(currentPath).value();
|
|
15103
15103
|
if (!(value !== void 0 && validator2(value))) {
|
|
15104
|
-
util$
|
|
15104
|
+
util$2.db.set(currentPath, defaultValue).write();
|
|
15105
15105
|
}
|
|
15106
15106
|
return currentPath;
|
|
15107
15107
|
}
|
|
@@ -15109,7 +15109,7 @@ var db = {
|
|
|
15109
15109
|
namespaced: true,
|
|
15110
15110
|
actions: {
|
|
15111
15111
|
set(context, { dbName = "database", path = "", value = "", user: user2 = false }) {
|
|
15112
|
-
util$
|
|
15112
|
+
util$2.db.set(
|
|
15113
15113
|
pathInit({
|
|
15114
15114
|
dbName,
|
|
15115
15115
|
path,
|
|
@@ -15122,7 +15122,7 @@ var db = {
|
|
|
15122
15122
|
return new Promise((resolve) => {
|
|
15123
15123
|
resolve(
|
|
15124
15124
|
lodash$1.exports.cloneDeep(
|
|
15125
|
-
util$
|
|
15125
|
+
util$2.db.get(
|
|
15126
15126
|
pathInit({
|
|
15127
15127
|
dbName,
|
|
15128
15128
|
path,
|
|
@@ -15137,7 +15137,7 @@ var db = {
|
|
|
15137
15137
|
database(context, { user: user2 = false } = {}) {
|
|
15138
15138
|
return new Promise((resolve) => {
|
|
15139
15139
|
resolve(
|
|
15140
|
-
util$
|
|
15140
|
+
util$2.db.get(
|
|
15141
15141
|
pathInit({
|
|
15142
15142
|
dbName: "database",
|
|
15143
15143
|
path: "",
|
|
@@ -15151,7 +15151,7 @@ var db = {
|
|
|
15151
15151
|
databaseClear(context, { user: user2 = false } = {}) {
|
|
15152
15152
|
return new Promise((resolve) => {
|
|
15153
15153
|
resolve(
|
|
15154
|
-
util$
|
|
15154
|
+
util$2.db.get(
|
|
15155
15155
|
pathInit({
|
|
15156
15156
|
dbName: "database",
|
|
15157
15157
|
path: "",
|
|
@@ -15166,7 +15166,7 @@ var db = {
|
|
|
15166
15166
|
databasePage(context, { basis = "fullPath", user: user2 = false } = {}) {
|
|
15167
15167
|
return new Promise((resolve) => {
|
|
15168
15168
|
resolve(
|
|
15169
|
-
util$
|
|
15169
|
+
util$2.db.get(
|
|
15170
15170
|
pathInit({
|
|
15171
15171
|
dbName: "database",
|
|
15172
15172
|
path: `$page.${router$1.app.$route[basis]}`,
|
|
@@ -15180,7 +15180,7 @@ var db = {
|
|
|
15180
15180
|
databasePageClear(context, { basis = "fullPath", user: user2 = false } = {}) {
|
|
15181
15181
|
return new Promise((resolve) => {
|
|
15182
15182
|
resolve(
|
|
15183
|
-
util$
|
|
15183
|
+
util$2.db.get(
|
|
15184
15184
|
pathInit({
|
|
15185
15185
|
dbName: "database",
|
|
15186
15186
|
path: `$page.${router$1.app.$route[basis]}`,
|
|
@@ -15195,7 +15195,7 @@ var db = {
|
|
|
15195
15195
|
pageSet(context, { instance, basis = "fullPath", user: user2 = false }) {
|
|
15196
15196
|
return new Promise((resolve) => {
|
|
15197
15197
|
resolve(
|
|
15198
|
-
util$
|
|
15198
|
+
util$2.db.get(
|
|
15199
15199
|
pathInit({
|
|
15200
15200
|
dbName: "database",
|
|
15201
15201
|
path: `$page.${router$1.app.$route[basis]}.$data`,
|
|
@@ -15211,7 +15211,7 @@ var db = {
|
|
|
15211
15211
|
return new Promise((resolve) => {
|
|
15212
15212
|
resolve(
|
|
15213
15213
|
lodash$1.exports.cloneDeep(
|
|
15214
|
-
util$
|
|
15214
|
+
util$2.db.get(
|
|
15215
15215
|
pathInit({
|
|
15216
15216
|
dbName: "database",
|
|
15217
15217
|
path: `$page.${router$1.app.$route[basis]}.$data`,
|
|
@@ -15226,7 +15226,7 @@ var db = {
|
|
|
15226
15226
|
pageClear(context, { basis = "fullPath", user: user2 = false }) {
|
|
15227
15227
|
return new Promise((resolve) => {
|
|
15228
15228
|
resolve(
|
|
15229
|
-
util$
|
|
15229
|
+
util$2.db.get(
|
|
15230
15230
|
pathInit({
|
|
15231
15231
|
dbName: "database",
|
|
15232
15232
|
path: `$page.${router$1.app.$route[basis]}.$data`,
|
|
@@ -15261,23 +15261,19 @@ var __glob_5_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
15261
15261
|
__proto__: null,
|
|
15262
15262
|
"default": t
|
|
15263
15263
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
15264
|
-
var vueI18n_cjs = {};
|
|
15265
|
-
var shared$3 = { exports: {} };
|
|
15266
|
-
var shared_cjs = {};
|
|
15267
15264
|
/*!
|
|
15268
15265
|
* shared v9.2.2
|
|
15269
15266
|
* (c) 2022 kazuya kawaguchi
|
|
15270
15267
|
* Released under the MIT License.
|
|
15271
15268
|
*/
|
|
15272
|
-
Object.defineProperty(shared_cjs, "__esModule", { value: true });
|
|
15273
15269
|
const inBrowser = typeof window !== "undefined";
|
|
15274
|
-
|
|
15275
|
-
|
|
15270
|
+
let mark;
|
|
15271
|
+
let measure;
|
|
15276
15272
|
{
|
|
15277
15273
|
const perf2 = inBrowser && window.performance;
|
|
15278
15274
|
if (perf2 && perf2.mark && perf2.measure && perf2.clearMarks && perf2.clearMeasures) {
|
|
15279
|
-
|
|
15280
|
-
|
|
15275
|
+
mark = (tag) => perf2.mark(tag);
|
|
15276
|
+
measure = (name, startTag, endTag) => {
|
|
15281
15277
|
perf2.measure(name, startTag, endTag);
|
|
15282
15278
|
perf2.clearMarks(startTag);
|
|
15283
15279
|
perf2.clearMarks(endTag);
|
|
@@ -15315,7 +15311,7 @@ function warn$1(msg, err) {
|
|
|
15315
15311
|
const assign = Object.assign;
|
|
15316
15312
|
let _globalThis;
|
|
15317
15313
|
const getGlobalThis = () => {
|
|
15318
|
-
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof
|
|
15314
|
+
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
15319
15315
|
};
|
|
15320
15316
|
function escapeHtml(rawText) {
|
|
15321
15317
|
return rawText.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -15328,11 +15324,7 @@ const isArray$2 = Array.isArray;
|
|
|
15328
15324
|
const isFunction$1 = (val) => typeof val === "function";
|
|
15329
15325
|
const isString$1 = (val) => typeof val === "string";
|
|
15330
15326
|
const isBoolean = (val) => typeof val === "boolean";
|
|
15331
|
-
const isSymbol = (val) => typeof val === "symbol";
|
|
15332
15327
|
const isObject$4 = (val) => val !== null && typeof val === "object";
|
|
15333
|
-
const isPromise = (val) => {
|
|
15334
|
-
return isObject$4(val) && isFunction$1(val.then) && isFunction$1(val.catch);
|
|
15335
|
-
};
|
|
15336
15328
|
const objectToString = Object.prototype.toString;
|
|
15337
15329
|
const toTypeString = (value) => objectToString.call(value);
|
|
15338
15330
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
@@ -15394,1743 +15386,11 @@ function createEmitter() {
|
|
|
15394
15386
|
};
|
|
15395
15387
|
return emitter;
|
|
15396
15388
|
}
|
|
15397
|
-
shared_cjs.assign = assign;
|
|
15398
|
-
shared_cjs.createEmitter = createEmitter;
|
|
15399
|
-
shared_cjs.escapeHtml = escapeHtml;
|
|
15400
|
-
shared_cjs.format = format$2;
|
|
15401
|
-
shared_cjs.friendlyJSONstringify = friendlyJSONstringify;
|
|
15402
|
-
shared_cjs.generateCodeFrame = generateCodeFrame;
|
|
15403
|
-
shared_cjs.generateFormatCacheKey = generateFormatCacheKey;
|
|
15404
|
-
shared_cjs.getGlobalThis = getGlobalThis;
|
|
15405
|
-
shared_cjs.hasOwn = hasOwn$1;
|
|
15406
|
-
shared_cjs.inBrowser = inBrowser;
|
|
15407
|
-
shared_cjs.isArray = isArray$2;
|
|
15408
|
-
shared_cjs.isBoolean = isBoolean;
|
|
15409
|
-
shared_cjs.isDate = isDate;
|
|
15410
|
-
shared_cjs.isEmptyObject = isEmptyObject;
|
|
15411
|
-
shared_cjs.isFunction = isFunction$1;
|
|
15412
|
-
shared_cjs.isNumber = isNumber$1;
|
|
15413
|
-
shared_cjs.isObject = isObject$4;
|
|
15414
|
-
shared_cjs.isPlainObject = isPlainObject;
|
|
15415
|
-
shared_cjs.isPromise = isPromise;
|
|
15416
|
-
shared_cjs.isRegExp = isRegExp$1;
|
|
15417
|
-
shared_cjs.isString = isString$1;
|
|
15418
|
-
shared_cjs.isSymbol = isSymbol;
|
|
15419
|
-
shared_cjs.makeSymbol = makeSymbol;
|
|
15420
|
-
shared_cjs.objectToString = objectToString;
|
|
15421
|
-
shared_cjs.toDisplayString = toDisplayString;
|
|
15422
|
-
shared_cjs.toTypeString = toTypeString;
|
|
15423
|
-
shared_cjs.warn = warn$1;
|
|
15424
|
-
{
|
|
15425
|
-
shared$3.exports = shared_cjs;
|
|
15426
|
-
}
|
|
15427
|
-
var coreBase$1 = { exports: {} };
|
|
15428
|
-
var coreBase_cjs = {};
|
|
15429
|
-
var messageCompiler$1 = { exports: {} };
|
|
15430
|
-
var messageCompiler_cjs = {};
|
|
15431
|
-
var sourceMap$1 = {};
|
|
15432
|
-
var sourceMapGenerator = {};
|
|
15433
|
-
var base64Vlq = {};
|
|
15434
|
-
var base64$1 = {};
|
|
15435
|
-
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
15436
|
-
base64$1.encode = function(number2) {
|
|
15437
|
-
if (0 <= number2 && number2 < intToCharMap.length) {
|
|
15438
|
-
return intToCharMap[number2];
|
|
15439
|
-
}
|
|
15440
|
-
throw new TypeError("Must be between 0 and 63: " + number2);
|
|
15441
|
-
};
|
|
15442
|
-
base64$1.decode = function(charCode) {
|
|
15443
|
-
var bigA = 65;
|
|
15444
|
-
var bigZ = 90;
|
|
15445
|
-
var littleA = 97;
|
|
15446
|
-
var littleZ = 122;
|
|
15447
|
-
var zero = 48;
|
|
15448
|
-
var nine = 57;
|
|
15449
|
-
var plus = 43;
|
|
15450
|
-
var slash = 47;
|
|
15451
|
-
var littleOffset = 26;
|
|
15452
|
-
var numberOffset = 52;
|
|
15453
|
-
if (bigA <= charCode && charCode <= bigZ) {
|
|
15454
|
-
return charCode - bigA;
|
|
15455
|
-
}
|
|
15456
|
-
if (littleA <= charCode && charCode <= littleZ) {
|
|
15457
|
-
return charCode - littleA + littleOffset;
|
|
15458
|
-
}
|
|
15459
|
-
if (zero <= charCode && charCode <= nine) {
|
|
15460
|
-
return charCode - zero + numberOffset;
|
|
15461
|
-
}
|
|
15462
|
-
if (charCode == plus) {
|
|
15463
|
-
return 62;
|
|
15464
|
-
}
|
|
15465
|
-
if (charCode == slash) {
|
|
15466
|
-
return 63;
|
|
15467
|
-
}
|
|
15468
|
-
return -1;
|
|
15469
|
-
};
|
|
15470
|
-
var base64 = base64$1;
|
|
15471
|
-
var VLQ_BASE_SHIFT = 5;
|
|
15472
|
-
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
15473
|
-
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
15474
|
-
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
15475
|
-
function toVLQSigned(aValue) {
|
|
15476
|
-
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
|
|
15477
|
-
}
|
|
15478
|
-
function fromVLQSigned(aValue) {
|
|
15479
|
-
var isNegative = (aValue & 1) === 1;
|
|
15480
|
-
var shifted = aValue >> 1;
|
|
15481
|
-
return isNegative ? -shifted : shifted;
|
|
15482
|
-
}
|
|
15483
|
-
base64Vlq.encode = function base64VLQ_encode(aValue) {
|
|
15484
|
-
var encoded = "";
|
|
15485
|
-
var digit;
|
|
15486
|
-
var vlq = toVLQSigned(aValue);
|
|
15487
|
-
do {
|
|
15488
|
-
digit = vlq & VLQ_BASE_MASK;
|
|
15489
|
-
vlq >>>= VLQ_BASE_SHIFT;
|
|
15490
|
-
if (vlq > 0) {
|
|
15491
|
-
digit |= VLQ_CONTINUATION_BIT;
|
|
15492
|
-
}
|
|
15493
|
-
encoded += base64.encode(digit);
|
|
15494
|
-
} while (vlq > 0);
|
|
15495
|
-
return encoded;
|
|
15496
|
-
};
|
|
15497
|
-
base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
|
15498
|
-
var strLen = aStr.length;
|
|
15499
|
-
var result2 = 0;
|
|
15500
|
-
var shift = 0;
|
|
15501
|
-
var continuation, digit;
|
|
15502
|
-
do {
|
|
15503
|
-
if (aIndex >= strLen) {
|
|
15504
|
-
throw new Error("Expected more digits in base 64 VLQ value.");
|
|
15505
|
-
}
|
|
15506
|
-
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
|
15507
|
-
if (digit === -1) {
|
|
15508
|
-
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
|
15509
|
-
}
|
|
15510
|
-
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
|
15511
|
-
digit &= VLQ_BASE_MASK;
|
|
15512
|
-
result2 = result2 + (digit << shift);
|
|
15513
|
-
shift += VLQ_BASE_SHIFT;
|
|
15514
|
-
} while (continuation);
|
|
15515
|
-
aOutParam.value = fromVLQSigned(result2);
|
|
15516
|
-
aOutParam.rest = aIndex;
|
|
15517
|
-
};
|
|
15518
|
-
var util$7 = {};
|
|
15519
|
-
(function(exports) {
|
|
15520
|
-
function getArg(aArgs, aName, aDefaultValue) {
|
|
15521
|
-
if (aName in aArgs) {
|
|
15522
|
-
return aArgs[aName];
|
|
15523
|
-
} else if (arguments.length === 3) {
|
|
15524
|
-
return aDefaultValue;
|
|
15525
|
-
} else {
|
|
15526
|
-
throw new Error('"' + aName + '" is a required argument.');
|
|
15527
|
-
}
|
|
15528
|
-
}
|
|
15529
|
-
exports.getArg = getArg;
|
|
15530
|
-
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
|
15531
|
-
var dataUrlRegexp = /^data:.+\,.+$/;
|
|
15532
|
-
function urlParse(aUrl) {
|
|
15533
|
-
var match2 = aUrl.match(urlRegexp);
|
|
15534
|
-
if (!match2) {
|
|
15535
|
-
return null;
|
|
15536
|
-
}
|
|
15537
|
-
return {
|
|
15538
|
-
scheme: match2[1],
|
|
15539
|
-
auth: match2[2],
|
|
15540
|
-
host: match2[3],
|
|
15541
|
-
port: match2[4],
|
|
15542
|
-
path: match2[5]
|
|
15543
|
-
};
|
|
15544
|
-
}
|
|
15545
|
-
exports.urlParse = urlParse;
|
|
15546
|
-
function urlGenerate(aParsedUrl) {
|
|
15547
|
-
var url = "";
|
|
15548
|
-
if (aParsedUrl.scheme) {
|
|
15549
|
-
url += aParsedUrl.scheme + ":";
|
|
15550
|
-
}
|
|
15551
|
-
url += "//";
|
|
15552
|
-
if (aParsedUrl.auth) {
|
|
15553
|
-
url += aParsedUrl.auth + "@";
|
|
15554
|
-
}
|
|
15555
|
-
if (aParsedUrl.host) {
|
|
15556
|
-
url += aParsedUrl.host;
|
|
15557
|
-
}
|
|
15558
|
-
if (aParsedUrl.port) {
|
|
15559
|
-
url += ":" + aParsedUrl.port;
|
|
15560
|
-
}
|
|
15561
|
-
if (aParsedUrl.path) {
|
|
15562
|
-
url += aParsedUrl.path;
|
|
15563
|
-
}
|
|
15564
|
-
return url;
|
|
15565
|
-
}
|
|
15566
|
-
exports.urlGenerate = urlGenerate;
|
|
15567
|
-
function normalize2(aPath) {
|
|
15568
|
-
var path = aPath;
|
|
15569
|
-
var url = urlParse(aPath);
|
|
15570
|
-
if (url) {
|
|
15571
|
-
if (!url.path) {
|
|
15572
|
-
return aPath;
|
|
15573
|
-
}
|
|
15574
|
-
path = url.path;
|
|
15575
|
-
}
|
|
15576
|
-
var isAbsolute = exports.isAbsolute(path);
|
|
15577
|
-
var parts = path.split(/\/+/);
|
|
15578
|
-
for (var part, up = 0, i3 = parts.length - 1; i3 >= 0; i3--) {
|
|
15579
|
-
part = parts[i3];
|
|
15580
|
-
if (part === ".") {
|
|
15581
|
-
parts.splice(i3, 1);
|
|
15582
|
-
} else if (part === "..") {
|
|
15583
|
-
up++;
|
|
15584
|
-
} else if (up > 0) {
|
|
15585
|
-
if (part === "") {
|
|
15586
|
-
parts.splice(i3 + 1, up);
|
|
15587
|
-
up = 0;
|
|
15588
|
-
} else {
|
|
15589
|
-
parts.splice(i3, 2);
|
|
15590
|
-
up--;
|
|
15591
|
-
}
|
|
15592
|
-
}
|
|
15593
|
-
}
|
|
15594
|
-
path = parts.join("/");
|
|
15595
|
-
if (path === "") {
|
|
15596
|
-
path = isAbsolute ? "/" : ".";
|
|
15597
|
-
}
|
|
15598
|
-
if (url) {
|
|
15599
|
-
url.path = path;
|
|
15600
|
-
return urlGenerate(url);
|
|
15601
|
-
}
|
|
15602
|
-
return path;
|
|
15603
|
-
}
|
|
15604
|
-
exports.normalize = normalize2;
|
|
15605
|
-
function join(aRoot, aPath) {
|
|
15606
|
-
if (aRoot === "") {
|
|
15607
|
-
aRoot = ".";
|
|
15608
|
-
}
|
|
15609
|
-
if (aPath === "") {
|
|
15610
|
-
aPath = ".";
|
|
15611
|
-
}
|
|
15612
|
-
var aPathUrl = urlParse(aPath);
|
|
15613
|
-
var aRootUrl = urlParse(aRoot);
|
|
15614
|
-
if (aRootUrl) {
|
|
15615
|
-
aRoot = aRootUrl.path || "/";
|
|
15616
|
-
}
|
|
15617
|
-
if (aPathUrl && !aPathUrl.scheme) {
|
|
15618
|
-
if (aRootUrl) {
|
|
15619
|
-
aPathUrl.scheme = aRootUrl.scheme;
|
|
15620
|
-
}
|
|
15621
|
-
return urlGenerate(aPathUrl);
|
|
15622
|
-
}
|
|
15623
|
-
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
|
15624
|
-
return aPath;
|
|
15625
|
-
}
|
|
15626
|
-
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
|
15627
|
-
aRootUrl.host = aPath;
|
|
15628
|
-
return urlGenerate(aRootUrl);
|
|
15629
|
-
}
|
|
15630
|
-
var joined = aPath.charAt(0) === "/" ? aPath : normalize2(aRoot.replace(/\/+$/, "") + "/" + aPath);
|
|
15631
|
-
if (aRootUrl) {
|
|
15632
|
-
aRootUrl.path = joined;
|
|
15633
|
-
return urlGenerate(aRootUrl);
|
|
15634
|
-
}
|
|
15635
|
-
return joined;
|
|
15636
|
-
}
|
|
15637
|
-
exports.join = join;
|
|
15638
|
-
exports.isAbsolute = function(aPath) {
|
|
15639
|
-
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
15640
|
-
};
|
|
15641
|
-
function relative(aRoot, aPath) {
|
|
15642
|
-
if (aRoot === "") {
|
|
15643
|
-
aRoot = ".";
|
|
15644
|
-
}
|
|
15645
|
-
aRoot = aRoot.replace(/\/$/, "");
|
|
15646
|
-
var level = 0;
|
|
15647
|
-
while (aPath.indexOf(aRoot + "/") !== 0) {
|
|
15648
|
-
var index2 = aRoot.lastIndexOf("/");
|
|
15649
|
-
if (index2 < 0) {
|
|
15650
|
-
return aPath;
|
|
15651
|
-
}
|
|
15652
|
-
aRoot = aRoot.slice(0, index2);
|
|
15653
|
-
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
|
15654
|
-
return aPath;
|
|
15655
|
-
}
|
|
15656
|
-
++level;
|
|
15657
|
-
}
|
|
15658
|
-
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
15659
|
-
}
|
|
15660
|
-
exports.relative = relative;
|
|
15661
|
-
var supportsNullProto = function() {
|
|
15662
|
-
var obj = /* @__PURE__ */ Object.create(null);
|
|
15663
|
-
return !("__proto__" in obj);
|
|
15664
|
-
}();
|
|
15665
|
-
function identity2(s3) {
|
|
15666
|
-
return s3;
|
|
15667
|
-
}
|
|
15668
|
-
function toSetString(aStr) {
|
|
15669
|
-
if (isProtoString(aStr)) {
|
|
15670
|
-
return "$" + aStr;
|
|
15671
|
-
}
|
|
15672
|
-
return aStr;
|
|
15673
|
-
}
|
|
15674
|
-
exports.toSetString = supportsNullProto ? identity2 : toSetString;
|
|
15675
|
-
function fromSetString(aStr) {
|
|
15676
|
-
if (isProtoString(aStr)) {
|
|
15677
|
-
return aStr.slice(1);
|
|
15678
|
-
}
|
|
15679
|
-
return aStr;
|
|
15680
|
-
}
|
|
15681
|
-
exports.fromSetString = supportsNullProto ? identity2 : fromSetString;
|
|
15682
|
-
function isProtoString(s3) {
|
|
15683
|
-
if (!s3) {
|
|
15684
|
-
return false;
|
|
15685
|
-
}
|
|
15686
|
-
var length2 = s3.length;
|
|
15687
|
-
if (length2 < 9) {
|
|
15688
|
-
return false;
|
|
15689
|
-
}
|
|
15690
|
-
if (s3.charCodeAt(length2 - 1) !== 95 || s3.charCodeAt(length2 - 2) !== 95 || s3.charCodeAt(length2 - 3) !== 111 || s3.charCodeAt(length2 - 4) !== 116 || s3.charCodeAt(length2 - 5) !== 111 || s3.charCodeAt(length2 - 6) !== 114 || s3.charCodeAt(length2 - 7) !== 112 || s3.charCodeAt(length2 - 8) !== 95 || s3.charCodeAt(length2 - 9) !== 95) {
|
|
15691
|
-
return false;
|
|
15692
|
-
}
|
|
15693
|
-
for (var i3 = length2 - 10; i3 >= 0; i3--) {
|
|
15694
|
-
if (s3.charCodeAt(i3) !== 36) {
|
|
15695
|
-
return false;
|
|
15696
|
-
}
|
|
15697
|
-
}
|
|
15698
|
-
return true;
|
|
15699
|
-
}
|
|
15700
|
-
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
|
15701
|
-
var cmp = strcmp(mappingA.source, mappingB.source);
|
|
15702
|
-
if (cmp !== 0) {
|
|
15703
|
-
return cmp;
|
|
15704
|
-
}
|
|
15705
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
15706
|
-
if (cmp !== 0) {
|
|
15707
|
-
return cmp;
|
|
15708
|
-
}
|
|
15709
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
15710
|
-
if (cmp !== 0 || onlyCompareOriginal) {
|
|
15711
|
-
return cmp;
|
|
15712
|
-
}
|
|
15713
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
15714
|
-
if (cmp !== 0) {
|
|
15715
|
-
return cmp;
|
|
15716
|
-
}
|
|
15717
|
-
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
15718
|
-
if (cmp !== 0) {
|
|
15719
|
-
return cmp;
|
|
15720
|
-
}
|
|
15721
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
15722
|
-
}
|
|
15723
|
-
exports.compareByOriginalPositions = compareByOriginalPositions;
|
|
15724
|
-
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
|
15725
|
-
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
15726
|
-
if (cmp !== 0) {
|
|
15727
|
-
return cmp;
|
|
15728
|
-
}
|
|
15729
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
15730
|
-
if (cmp !== 0 || onlyCompareGenerated) {
|
|
15731
|
-
return cmp;
|
|
15732
|
-
}
|
|
15733
|
-
cmp = strcmp(mappingA.source, mappingB.source);
|
|
15734
|
-
if (cmp !== 0) {
|
|
15735
|
-
return cmp;
|
|
15736
|
-
}
|
|
15737
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
15738
|
-
if (cmp !== 0) {
|
|
15739
|
-
return cmp;
|
|
15740
|
-
}
|
|
15741
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
15742
|
-
if (cmp !== 0) {
|
|
15743
|
-
return cmp;
|
|
15744
|
-
}
|
|
15745
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
15746
|
-
}
|
|
15747
|
-
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
|
15748
|
-
function strcmp(aStr1, aStr2) {
|
|
15749
|
-
if (aStr1 === aStr2) {
|
|
15750
|
-
return 0;
|
|
15751
|
-
}
|
|
15752
|
-
if (aStr1 === null) {
|
|
15753
|
-
return 1;
|
|
15754
|
-
}
|
|
15755
|
-
if (aStr2 === null) {
|
|
15756
|
-
return -1;
|
|
15757
|
-
}
|
|
15758
|
-
if (aStr1 > aStr2) {
|
|
15759
|
-
return 1;
|
|
15760
|
-
}
|
|
15761
|
-
return -1;
|
|
15762
|
-
}
|
|
15763
|
-
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
|
15764
|
-
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
15765
|
-
if (cmp !== 0) {
|
|
15766
|
-
return cmp;
|
|
15767
|
-
}
|
|
15768
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
15769
|
-
if (cmp !== 0) {
|
|
15770
|
-
return cmp;
|
|
15771
|
-
}
|
|
15772
|
-
cmp = strcmp(mappingA.source, mappingB.source);
|
|
15773
|
-
if (cmp !== 0) {
|
|
15774
|
-
return cmp;
|
|
15775
|
-
}
|
|
15776
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
15777
|
-
if (cmp !== 0) {
|
|
15778
|
-
return cmp;
|
|
15779
|
-
}
|
|
15780
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
15781
|
-
if (cmp !== 0) {
|
|
15782
|
-
return cmp;
|
|
15783
|
-
}
|
|
15784
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
15785
|
-
}
|
|
15786
|
-
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
|
15787
|
-
function parseSourceMapInput(str) {
|
|
15788
|
-
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
|
|
15789
|
-
}
|
|
15790
|
-
exports.parseSourceMapInput = parseSourceMapInput;
|
|
15791
|
-
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
15792
|
-
sourceURL = sourceURL || "";
|
|
15793
|
-
if (sourceRoot) {
|
|
15794
|
-
if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
|
|
15795
|
-
sourceRoot += "/";
|
|
15796
|
-
}
|
|
15797
|
-
sourceURL = sourceRoot + sourceURL;
|
|
15798
|
-
}
|
|
15799
|
-
if (sourceMapURL) {
|
|
15800
|
-
var parsed = urlParse(sourceMapURL);
|
|
15801
|
-
if (!parsed) {
|
|
15802
|
-
throw new Error("sourceMapURL could not be parsed");
|
|
15803
|
-
}
|
|
15804
|
-
if (parsed.path) {
|
|
15805
|
-
var index2 = parsed.path.lastIndexOf("/");
|
|
15806
|
-
if (index2 >= 0) {
|
|
15807
|
-
parsed.path = parsed.path.substring(0, index2 + 1);
|
|
15808
|
-
}
|
|
15809
|
-
}
|
|
15810
|
-
sourceURL = join(urlGenerate(parsed), sourceURL);
|
|
15811
|
-
}
|
|
15812
|
-
return normalize2(sourceURL);
|
|
15813
|
-
}
|
|
15814
|
-
exports.computeSourceURL = computeSourceURL;
|
|
15815
|
-
})(util$7);
|
|
15816
|
-
var arraySet = {};
|
|
15817
|
-
var util$6 = util$7;
|
|
15818
|
-
var has$2 = Object.prototype.hasOwnProperty;
|
|
15819
|
-
var hasNativeMap = typeof Map !== "undefined";
|
|
15820
|
-
function ArraySet$2() {
|
|
15821
|
-
this._array = [];
|
|
15822
|
-
this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
|
|
15823
|
-
}
|
|
15824
|
-
ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
|
15825
|
-
var set2 = new ArraySet$2();
|
|
15826
|
-
for (var i3 = 0, len2 = aArray.length; i3 < len2; i3++) {
|
|
15827
|
-
set2.add(aArray[i3], aAllowDuplicates);
|
|
15828
|
-
}
|
|
15829
|
-
return set2;
|
|
15830
|
-
};
|
|
15831
|
-
ArraySet$2.prototype.size = function ArraySet_size() {
|
|
15832
|
-
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
|
15833
|
-
};
|
|
15834
|
-
ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
|
15835
|
-
var sStr = hasNativeMap ? aStr : util$6.toSetString(aStr);
|
|
15836
|
-
var isDuplicate = hasNativeMap ? this.has(aStr) : has$2.call(this._set, sStr);
|
|
15837
|
-
var idx = this._array.length;
|
|
15838
|
-
if (!isDuplicate || aAllowDuplicates) {
|
|
15839
|
-
this._array.push(aStr);
|
|
15840
|
-
}
|
|
15841
|
-
if (!isDuplicate) {
|
|
15842
|
-
if (hasNativeMap) {
|
|
15843
|
-
this._set.set(aStr, idx);
|
|
15844
|
-
} else {
|
|
15845
|
-
this._set[sStr] = idx;
|
|
15846
|
-
}
|
|
15847
|
-
}
|
|
15848
|
-
};
|
|
15849
|
-
ArraySet$2.prototype.has = function ArraySet_has(aStr) {
|
|
15850
|
-
if (hasNativeMap) {
|
|
15851
|
-
return this._set.has(aStr);
|
|
15852
|
-
} else {
|
|
15853
|
-
var sStr = util$6.toSetString(aStr);
|
|
15854
|
-
return has$2.call(this._set, sStr);
|
|
15855
|
-
}
|
|
15856
|
-
};
|
|
15857
|
-
ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
|
15858
|
-
if (hasNativeMap) {
|
|
15859
|
-
var idx = this._set.get(aStr);
|
|
15860
|
-
if (idx >= 0) {
|
|
15861
|
-
return idx;
|
|
15862
|
-
}
|
|
15863
|
-
} else {
|
|
15864
|
-
var sStr = util$6.toSetString(aStr);
|
|
15865
|
-
if (has$2.call(this._set, sStr)) {
|
|
15866
|
-
return this._set[sStr];
|
|
15867
|
-
}
|
|
15868
|
-
}
|
|
15869
|
-
throw new Error('"' + aStr + '" is not in the set.');
|
|
15870
|
-
};
|
|
15871
|
-
ArraySet$2.prototype.at = function ArraySet_at(aIdx) {
|
|
15872
|
-
if (aIdx >= 0 && aIdx < this._array.length) {
|
|
15873
|
-
return this._array[aIdx];
|
|
15874
|
-
}
|
|
15875
|
-
throw new Error("No element indexed by " + aIdx);
|
|
15876
|
-
};
|
|
15877
|
-
ArraySet$2.prototype.toArray = function ArraySet_toArray() {
|
|
15878
|
-
return this._array.slice();
|
|
15879
|
-
};
|
|
15880
|
-
arraySet.ArraySet = ArraySet$2;
|
|
15881
|
-
var mappingList = {};
|
|
15882
|
-
var util$5 = util$7;
|
|
15883
|
-
function generatedPositionAfter(mappingA, mappingB) {
|
|
15884
|
-
var lineA = mappingA.generatedLine;
|
|
15885
|
-
var lineB = mappingB.generatedLine;
|
|
15886
|
-
var columnA = mappingA.generatedColumn;
|
|
15887
|
-
var columnB = mappingB.generatedColumn;
|
|
15888
|
-
return lineB > lineA || lineB == lineA && columnB >= columnA || util$5.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
|
15889
|
-
}
|
|
15890
|
-
function MappingList$1() {
|
|
15891
|
-
this._array = [];
|
|
15892
|
-
this._sorted = true;
|
|
15893
|
-
this._last = { generatedLine: -1, generatedColumn: 0 };
|
|
15894
|
-
}
|
|
15895
|
-
MappingList$1.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
|
|
15896
|
-
this._array.forEach(aCallback, aThisArg);
|
|
15897
|
-
};
|
|
15898
|
-
MappingList$1.prototype.add = function MappingList_add(aMapping) {
|
|
15899
|
-
if (generatedPositionAfter(this._last, aMapping)) {
|
|
15900
|
-
this._last = aMapping;
|
|
15901
|
-
this._array.push(aMapping);
|
|
15902
|
-
} else {
|
|
15903
|
-
this._sorted = false;
|
|
15904
|
-
this._array.push(aMapping);
|
|
15905
|
-
}
|
|
15906
|
-
};
|
|
15907
|
-
MappingList$1.prototype.toArray = function MappingList_toArray() {
|
|
15908
|
-
if (!this._sorted) {
|
|
15909
|
-
this._array.sort(util$5.compareByGeneratedPositionsInflated);
|
|
15910
|
-
this._sorted = true;
|
|
15911
|
-
}
|
|
15912
|
-
return this._array;
|
|
15913
|
-
};
|
|
15914
|
-
mappingList.MappingList = MappingList$1;
|
|
15915
|
-
var base64VLQ$1 = base64Vlq;
|
|
15916
|
-
var util$4 = util$7;
|
|
15917
|
-
var ArraySet$1 = arraySet.ArraySet;
|
|
15918
|
-
var MappingList = mappingList.MappingList;
|
|
15919
|
-
function SourceMapGenerator$1(aArgs) {
|
|
15920
|
-
if (!aArgs) {
|
|
15921
|
-
aArgs = {};
|
|
15922
|
-
}
|
|
15923
|
-
this._file = util$4.getArg(aArgs, "file", null);
|
|
15924
|
-
this._sourceRoot = util$4.getArg(aArgs, "sourceRoot", null);
|
|
15925
|
-
this._skipValidation = util$4.getArg(aArgs, "skipValidation", false);
|
|
15926
|
-
this._sources = new ArraySet$1();
|
|
15927
|
-
this._names = new ArraySet$1();
|
|
15928
|
-
this._mappings = new MappingList();
|
|
15929
|
-
this._sourcesContents = null;
|
|
15930
|
-
}
|
|
15931
|
-
SourceMapGenerator$1.prototype._version = 3;
|
|
15932
|
-
SourceMapGenerator$1.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
|
15933
|
-
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
|
15934
|
-
var generator = new SourceMapGenerator$1({
|
|
15935
|
-
file: aSourceMapConsumer.file,
|
|
15936
|
-
sourceRoot
|
|
15937
|
-
});
|
|
15938
|
-
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
15939
|
-
var newMapping = {
|
|
15940
|
-
generated: {
|
|
15941
|
-
line: mapping.generatedLine,
|
|
15942
|
-
column: mapping.generatedColumn
|
|
15943
|
-
}
|
|
15944
|
-
};
|
|
15945
|
-
if (mapping.source != null) {
|
|
15946
|
-
newMapping.source = mapping.source;
|
|
15947
|
-
if (sourceRoot != null) {
|
|
15948
|
-
newMapping.source = util$4.relative(sourceRoot, newMapping.source);
|
|
15949
|
-
}
|
|
15950
|
-
newMapping.original = {
|
|
15951
|
-
line: mapping.originalLine,
|
|
15952
|
-
column: mapping.originalColumn
|
|
15953
|
-
};
|
|
15954
|
-
if (mapping.name != null) {
|
|
15955
|
-
newMapping.name = mapping.name;
|
|
15956
|
-
}
|
|
15957
|
-
}
|
|
15958
|
-
generator.addMapping(newMapping);
|
|
15959
|
-
});
|
|
15960
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
15961
|
-
var sourceRelative = sourceFile;
|
|
15962
|
-
if (sourceRoot !== null) {
|
|
15963
|
-
sourceRelative = util$4.relative(sourceRoot, sourceFile);
|
|
15964
|
-
}
|
|
15965
|
-
if (!generator._sources.has(sourceRelative)) {
|
|
15966
|
-
generator._sources.add(sourceRelative);
|
|
15967
|
-
}
|
|
15968
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
15969
|
-
if (content != null) {
|
|
15970
|
-
generator.setSourceContent(sourceFile, content);
|
|
15971
|
-
}
|
|
15972
|
-
});
|
|
15973
|
-
return generator;
|
|
15974
|
-
};
|
|
15975
|
-
SourceMapGenerator$1.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
|
|
15976
|
-
var generated = util$4.getArg(aArgs, "generated");
|
|
15977
|
-
var original = util$4.getArg(aArgs, "original", null);
|
|
15978
|
-
var source2 = util$4.getArg(aArgs, "source", null);
|
|
15979
|
-
var name = util$4.getArg(aArgs, "name", null);
|
|
15980
|
-
if (!this._skipValidation) {
|
|
15981
|
-
this._validateMapping(generated, original, source2, name);
|
|
15982
|
-
}
|
|
15983
|
-
if (source2 != null) {
|
|
15984
|
-
source2 = String(source2);
|
|
15985
|
-
if (!this._sources.has(source2)) {
|
|
15986
|
-
this._sources.add(source2);
|
|
15987
|
-
}
|
|
15988
|
-
}
|
|
15989
|
-
if (name != null) {
|
|
15990
|
-
name = String(name);
|
|
15991
|
-
if (!this._names.has(name)) {
|
|
15992
|
-
this._names.add(name);
|
|
15993
|
-
}
|
|
15994
|
-
}
|
|
15995
|
-
this._mappings.add({
|
|
15996
|
-
generatedLine: generated.line,
|
|
15997
|
-
generatedColumn: generated.column,
|
|
15998
|
-
originalLine: original != null && original.line,
|
|
15999
|
-
originalColumn: original != null && original.column,
|
|
16000
|
-
source: source2,
|
|
16001
|
-
name
|
|
16002
|
-
});
|
|
16003
|
-
};
|
|
16004
|
-
SourceMapGenerator$1.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
16005
|
-
var source2 = aSourceFile;
|
|
16006
|
-
if (this._sourceRoot != null) {
|
|
16007
|
-
source2 = util$4.relative(this._sourceRoot, source2);
|
|
16008
|
-
}
|
|
16009
|
-
if (aSourceContent != null) {
|
|
16010
|
-
if (!this._sourcesContents) {
|
|
16011
|
-
this._sourcesContents = /* @__PURE__ */ Object.create(null);
|
|
16012
|
-
}
|
|
16013
|
-
this._sourcesContents[util$4.toSetString(source2)] = aSourceContent;
|
|
16014
|
-
} else if (this._sourcesContents) {
|
|
16015
|
-
delete this._sourcesContents[util$4.toSetString(source2)];
|
|
16016
|
-
if (Object.keys(this._sourcesContents).length === 0) {
|
|
16017
|
-
this._sourcesContents = null;
|
|
16018
|
-
}
|
|
16019
|
-
}
|
|
16020
|
-
};
|
|
16021
|
-
SourceMapGenerator$1.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
|
16022
|
-
var sourceFile = aSourceFile;
|
|
16023
|
-
if (aSourceFile == null) {
|
|
16024
|
-
if (aSourceMapConsumer.file == null) {
|
|
16025
|
-
throw new Error(
|
|
16026
|
-
`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
|
|
16027
|
-
);
|
|
16028
|
-
}
|
|
16029
|
-
sourceFile = aSourceMapConsumer.file;
|
|
16030
|
-
}
|
|
16031
|
-
var sourceRoot = this._sourceRoot;
|
|
16032
|
-
if (sourceRoot != null) {
|
|
16033
|
-
sourceFile = util$4.relative(sourceRoot, sourceFile);
|
|
16034
|
-
}
|
|
16035
|
-
var newSources = new ArraySet$1();
|
|
16036
|
-
var newNames = new ArraySet$1();
|
|
16037
|
-
this._mappings.unsortedForEach(function(mapping) {
|
|
16038
|
-
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
|
16039
|
-
var original = aSourceMapConsumer.originalPositionFor({
|
|
16040
|
-
line: mapping.originalLine,
|
|
16041
|
-
column: mapping.originalColumn
|
|
16042
|
-
});
|
|
16043
|
-
if (original.source != null) {
|
|
16044
|
-
mapping.source = original.source;
|
|
16045
|
-
if (aSourceMapPath != null) {
|
|
16046
|
-
mapping.source = util$4.join(aSourceMapPath, mapping.source);
|
|
16047
|
-
}
|
|
16048
|
-
if (sourceRoot != null) {
|
|
16049
|
-
mapping.source = util$4.relative(sourceRoot, mapping.source);
|
|
16050
|
-
}
|
|
16051
|
-
mapping.originalLine = original.line;
|
|
16052
|
-
mapping.originalColumn = original.column;
|
|
16053
|
-
if (original.name != null) {
|
|
16054
|
-
mapping.name = original.name;
|
|
16055
|
-
}
|
|
16056
|
-
}
|
|
16057
|
-
}
|
|
16058
|
-
var source2 = mapping.source;
|
|
16059
|
-
if (source2 != null && !newSources.has(source2)) {
|
|
16060
|
-
newSources.add(source2);
|
|
16061
|
-
}
|
|
16062
|
-
var name = mapping.name;
|
|
16063
|
-
if (name != null && !newNames.has(name)) {
|
|
16064
|
-
newNames.add(name);
|
|
16065
|
-
}
|
|
16066
|
-
}, this);
|
|
16067
|
-
this._sources = newSources;
|
|
16068
|
-
this._names = newNames;
|
|
16069
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile2) {
|
|
16070
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
|
|
16071
|
-
if (content != null) {
|
|
16072
|
-
if (aSourceMapPath != null) {
|
|
16073
|
-
sourceFile2 = util$4.join(aSourceMapPath, sourceFile2);
|
|
16074
|
-
}
|
|
16075
|
-
if (sourceRoot != null) {
|
|
16076
|
-
sourceFile2 = util$4.relative(sourceRoot, sourceFile2);
|
|
16077
|
-
}
|
|
16078
|
-
this.setSourceContent(sourceFile2, content);
|
|
16079
|
-
}
|
|
16080
|
-
}, this);
|
|
16081
|
-
};
|
|
16082
|
-
SourceMapGenerator$1.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
|
|
16083
|
-
if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
|
|
16084
|
-
throw new Error(
|
|
16085
|
-
"original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
|
|
16086
|
-
);
|
|
16087
|
-
}
|
|
16088
|
-
if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
|
|
16089
|
-
return;
|
|
16090
|
-
} else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
|
|
16091
|
-
return;
|
|
16092
|
-
} else {
|
|
16093
|
-
throw new Error("Invalid mapping: " + JSON.stringify({
|
|
16094
|
-
generated: aGenerated,
|
|
16095
|
-
source: aSource,
|
|
16096
|
-
original: aOriginal,
|
|
16097
|
-
name: aName
|
|
16098
|
-
}));
|
|
16099
|
-
}
|
|
16100
|
-
};
|
|
16101
|
-
SourceMapGenerator$1.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
|
|
16102
|
-
var previousGeneratedColumn = 0;
|
|
16103
|
-
var previousGeneratedLine = 1;
|
|
16104
|
-
var previousOriginalColumn = 0;
|
|
16105
|
-
var previousOriginalLine = 0;
|
|
16106
|
-
var previousName = 0;
|
|
16107
|
-
var previousSource = 0;
|
|
16108
|
-
var result2 = "";
|
|
16109
|
-
var next;
|
|
16110
|
-
var mapping;
|
|
16111
|
-
var nameIdx;
|
|
16112
|
-
var sourceIdx;
|
|
16113
|
-
var mappings = this._mappings.toArray();
|
|
16114
|
-
for (var i3 = 0, len2 = mappings.length; i3 < len2; i3++) {
|
|
16115
|
-
mapping = mappings[i3];
|
|
16116
|
-
next = "";
|
|
16117
|
-
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
16118
|
-
previousGeneratedColumn = 0;
|
|
16119
|
-
while (mapping.generatedLine !== previousGeneratedLine) {
|
|
16120
|
-
next += ";";
|
|
16121
|
-
previousGeneratedLine++;
|
|
16122
|
-
}
|
|
16123
|
-
} else {
|
|
16124
|
-
if (i3 > 0) {
|
|
16125
|
-
if (!util$4.compareByGeneratedPositionsInflated(mapping, mappings[i3 - 1])) {
|
|
16126
|
-
continue;
|
|
16127
|
-
}
|
|
16128
|
-
next += ",";
|
|
16129
|
-
}
|
|
16130
|
-
}
|
|
16131
|
-
next += base64VLQ$1.encode(mapping.generatedColumn - previousGeneratedColumn);
|
|
16132
|
-
previousGeneratedColumn = mapping.generatedColumn;
|
|
16133
|
-
if (mapping.source != null) {
|
|
16134
|
-
sourceIdx = this._sources.indexOf(mapping.source);
|
|
16135
|
-
next += base64VLQ$1.encode(sourceIdx - previousSource);
|
|
16136
|
-
previousSource = sourceIdx;
|
|
16137
|
-
next += base64VLQ$1.encode(mapping.originalLine - 1 - previousOriginalLine);
|
|
16138
|
-
previousOriginalLine = mapping.originalLine - 1;
|
|
16139
|
-
next += base64VLQ$1.encode(mapping.originalColumn - previousOriginalColumn);
|
|
16140
|
-
previousOriginalColumn = mapping.originalColumn;
|
|
16141
|
-
if (mapping.name != null) {
|
|
16142
|
-
nameIdx = this._names.indexOf(mapping.name);
|
|
16143
|
-
next += base64VLQ$1.encode(nameIdx - previousName);
|
|
16144
|
-
previousName = nameIdx;
|
|
16145
|
-
}
|
|
16146
|
-
}
|
|
16147
|
-
result2 += next;
|
|
16148
|
-
}
|
|
16149
|
-
return result2;
|
|
16150
|
-
};
|
|
16151
|
-
SourceMapGenerator$1.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
|
16152
|
-
return aSources.map(function(source2) {
|
|
16153
|
-
if (!this._sourcesContents) {
|
|
16154
|
-
return null;
|
|
16155
|
-
}
|
|
16156
|
-
if (aSourceRoot != null) {
|
|
16157
|
-
source2 = util$4.relative(aSourceRoot, source2);
|
|
16158
|
-
}
|
|
16159
|
-
var key = util$4.toSetString(source2);
|
|
16160
|
-
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
|
|
16161
|
-
}, this);
|
|
16162
|
-
};
|
|
16163
|
-
SourceMapGenerator$1.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
16164
|
-
var map2 = {
|
|
16165
|
-
version: this._version,
|
|
16166
|
-
sources: this._sources.toArray(),
|
|
16167
|
-
names: this._names.toArray(),
|
|
16168
|
-
mappings: this._serializeMappings()
|
|
16169
|
-
};
|
|
16170
|
-
if (this._file != null) {
|
|
16171
|
-
map2.file = this._file;
|
|
16172
|
-
}
|
|
16173
|
-
if (this._sourceRoot != null) {
|
|
16174
|
-
map2.sourceRoot = this._sourceRoot;
|
|
16175
|
-
}
|
|
16176
|
-
if (this._sourcesContents) {
|
|
16177
|
-
map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot);
|
|
16178
|
-
}
|
|
16179
|
-
return map2;
|
|
16180
|
-
};
|
|
16181
|
-
SourceMapGenerator$1.prototype.toString = function SourceMapGenerator_toString() {
|
|
16182
|
-
return JSON.stringify(this.toJSON());
|
|
16183
|
-
};
|
|
16184
|
-
sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$1;
|
|
16185
|
-
var sourceMapConsumer = {};
|
|
16186
|
-
var binarySearch$1 = {};
|
|
16187
|
-
(function(exports) {
|
|
16188
|
-
exports.GREATEST_LOWER_BOUND = 1;
|
|
16189
|
-
exports.LEAST_UPPER_BOUND = 2;
|
|
16190
|
-
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
16191
|
-
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
16192
|
-
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
16193
|
-
if (cmp === 0) {
|
|
16194
|
-
return mid;
|
|
16195
|
-
} else if (cmp > 0) {
|
|
16196
|
-
if (aHigh - mid > 1) {
|
|
16197
|
-
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
|
16198
|
-
}
|
|
16199
|
-
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
16200
|
-
return aHigh < aHaystack.length ? aHigh : -1;
|
|
16201
|
-
} else {
|
|
16202
|
-
return mid;
|
|
16203
|
-
}
|
|
16204
|
-
} else {
|
|
16205
|
-
if (mid - aLow > 1) {
|
|
16206
|
-
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
|
16207
|
-
}
|
|
16208
|
-
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
16209
|
-
return mid;
|
|
16210
|
-
} else {
|
|
16211
|
-
return aLow < 0 ? -1 : aLow;
|
|
16212
|
-
}
|
|
16213
|
-
}
|
|
16214
|
-
}
|
|
16215
|
-
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
16216
|
-
if (aHaystack.length === 0) {
|
|
16217
|
-
return -1;
|
|
16218
|
-
}
|
|
16219
|
-
var index2 = recursiveSearch(
|
|
16220
|
-
-1,
|
|
16221
|
-
aHaystack.length,
|
|
16222
|
-
aNeedle,
|
|
16223
|
-
aHaystack,
|
|
16224
|
-
aCompare,
|
|
16225
|
-
aBias || exports.GREATEST_LOWER_BOUND
|
|
16226
|
-
);
|
|
16227
|
-
if (index2 < 0) {
|
|
16228
|
-
return -1;
|
|
16229
|
-
}
|
|
16230
|
-
while (index2 - 1 >= 0) {
|
|
16231
|
-
if (aCompare(aHaystack[index2], aHaystack[index2 - 1], true) !== 0) {
|
|
16232
|
-
break;
|
|
16233
|
-
}
|
|
16234
|
-
--index2;
|
|
16235
|
-
}
|
|
16236
|
-
return index2;
|
|
16237
|
-
};
|
|
16238
|
-
})(binarySearch$1);
|
|
16239
|
-
var quickSort$1 = {};
|
|
16240
|
-
function swap(ary, x2, y3) {
|
|
16241
|
-
var temp = ary[x2];
|
|
16242
|
-
ary[x2] = ary[y3];
|
|
16243
|
-
ary[y3] = temp;
|
|
16244
|
-
}
|
|
16245
|
-
function randomIntInRange(low, high) {
|
|
16246
|
-
return Math.round(low + Math.random() * (high - low));
|
|
16247
|
-
}
|
|
16248
|
-
function doQuickSort(ary, comparator, p, r) {
|
|
16249
|
-
if (p < r) {
|
|
16250
|
-
var pivotIndex = randomIntInRange(p, r);
|
|
16251
|
-
var i3 = p - 1;
|
|
16252
|
-
swap(ary, pivotIndex, r);
|
|
16253
|
-
var pivot = ary[r];
|
|
16254
|
-
for (var j = p; j < r; j++) {
|
|
16255
|
-
if (comparator(ary[j], pivot) <= 0) {
|
|
16256
|
-
i3 += 1;
|
|
16257
|
-
swap(ary, i3, j);
|
|
16258
|
-
}
|
|
16259
|
-
}
|
|
16260
|
-
swap(ary, i3 + 1, j);
|
|
16261
|
-
var q2 = i3 + 1;
|
|
16262
|
-
doQuickSort(ary, comparator, p, q2 - 1);
|
|
16263
|
-
doQuickSort(ary, comparator, q2 + 1, r);
|
|
16264
|
-
}
|
|
16265
|
-
}
|
|
16266
|
-
quickSort$1.quickSort = function(ary, comparator) {
|
|
16267
|
-
doQuickSort(ary, comparator, 0, ary.length - 1);
|
|
16268
|
-
};
|
|
16269
|
-
var util$3 = util$7;
|
|
16270
|
-
var binarySearch = binarySearch$1;
|
|
16271
|
-
var ArraySet = arraySet.ArraySet;
|
|
16272
|
-
var base64VLQ = base64Vlq;
|
|
16273
|
-
var quickSort = quickSort$1.quickSort;
|
|
16274
|
-
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
16275
|
-
var sourceMap2 = aSourceMap;
|
|
16276
|
-
if (typeof aSourceMap === "string") {
|
|
16277
|
-
sourceMap2 = util$3.parseSourceMapInput(aSourceMap);
|
|
16278
|
-
}
|
|
16279
|
-
return sourceMap2.sections != null ? new IndexedSourceMapConsumer(sourceMap2, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap2, aSourceMapURL);
|
|
16280
|
-
}
|
|
16281
|
-
SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
|
|
16282
|
-
return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
|
|
16283
|
-
};
|
|
16284
|
-
SourceMapConsumer.prototype._version = 3;
|
|
16285
|
-
SourceMapConsumer.prototype.__generatedMappings = null;
|
|
16286
|
-
Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
|
|
16287
|
-
configurable: true,
|
|
16288
|
-
enumerable: true,
|
|
16289
|
-
get: function() {
|
|
16290
|
-
if (!this.__generatedMappings) {
|
|
16291
|
-
this._parseMappings(this._mappings, this.sourceRoot);
|
|
16292
|
-
}
|
|
16293
|
-
return this.__generatedMappings;
|
|
16294
|
-
}
|
|
16295
|
-
});
|
|
16296
|
-
SourceMapConsumer.prototype.__originalMappings = null;
|
|
16297
|
-
Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
|
|
16298
|
-
configurable: true,
|
|
16299
|
-
enumerable: true,
|
|
16300
|
-
get: function() {
|
|
16301
|
-
if (!this.__originalMappings) {
|
|
16302
|
-
this._parseMappings(this._mappings, this.sourceRoot);
|
|
16303
|
-
}
|
|
16304
|
-
return this.__originalMappings;
|
|
16305
|
-
}
|
|
16306
|
-
});
|
|
16307
|
-
SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index2) {
|
|
16308
|
-
var c2 = aStr.charAt(index2);
|
|
16309
|
-
return c2 === ";" || c2 === ",";
|
|
16310
|
-
};
|
|
16311
|
-
SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
16312
|
-
throw new Error("Subclasses must implement _parseMappings");
|
|
16313
|
-
};
|
|
16314
|
-
SourceMapConsumer.GENERATED_ORDER = 1;
|
|
16315
|
-
SourceMapConsumer.ORIGINAL_ORDER = 2;
|
|
16316
|
-
SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
|
|
16317
|
-
SourceMapConsumer.LEAST_UPPER_BOUND = 2;
|
|
16318
|
-
SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
|
|
16319
|
-
var context = aContext || null;
|
|
16320
|
-
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
|
|
16321
|
-
var mappings;
|
|
16322
|
-
switch (order) {
|
|
16323
|
-
case SourceMapConsumer.GENERATED_ORDER:
|
|
16324
|
-
mappings = this._generatedMappings;
|
|
16325
|
-
break;
|
|
16326
|
-
case SourceMapConsumer.ORIGINAL_ORDER:
|
|
16327
|
-
mappings = this._originalMappings;
|
|
16328
|
-
break;
|
|
16329
|
-
default:
|
|
16330
|
-
throw new Error("Unknown order of iteration.");
|
|
16331
|
-
}
|
|
16332
|
-
var sourceRoot = this.sourceRoot;
|
|
16333
|
-
mappings.map(function(mapping) {
|
|
16334
|
-
var source2 = mapping.source === null ? null : this._sources.at(mapping.source);
|
|
16335
|
-
source2 = util$3.computeSourceURL(sourceRoot, source2, this._sourceMapURL);
|
|
16336
|
-
return {
|
|
16337
|
-
source: source2,
|
|
16338
|
-
generatedLine: mapping.generatedLine,
|
|
16339
|
-
generatedColumn: mapping.generatedColumn,
|
|
16340
|
-
originalLine: mapping.originalLine,
|
|
16341
|
-
originalColumn: mapping.originalColumn,
|
|
16342
|
-
name: mapping.name === null ? null : this._names.at(mapping.name)
|
|
16343
|
-
};
|
|
16344
|
-
}, this).forEach(aCallback, context);
|
|
16345
|
-
};
|
|
16346
|
-
SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
|
|
16347
|
-
var line = util$3.getArg(aArgs, "line");
|
|
16348
|
-
var needle = {
|
|
16349
|
-
source: util$3.getArg(aArgs, "source"),
|
|
16350
|
-
originalLine: line,
|
|
16351
|
-
originalColumn: util$3.getArg(aArgs, "column", 0)
|
|
16352
|
-
};
|
|
16353
|
-
needle.source = this._findSourceIndex(needle.source);
|
|
16354
|
-
if (needle.source < 0) {
|
|
16355
|
-
return [];
|
|
16356
|
-
}
|
|
16357
|
-
var mappings = [];
|
|
16358
|
-
var index2 = this._findMapping(
|
|
16359
|
-
needle,
|
|
16360
|
-
this._originalMappings,
|
|
16361
|
-
"originalLine",
|
|
16362
|
-
"originalColumn",
|
|
16363
|
-
util$3.compareByOriginalPositions,
|
|
16364
|
-
binarySearch.LEAST_UPPER_BOUND
|
|
16365
|
-
);
|
|
16366
|
-
if (index2 >= 0) {
|
|
16367
|
-
var mapping = this._originalMappings[index2];
|
|
16368
|
-
if (aArgs.column === void 0) {
|
|
16369
|
-
var originalLine = mapping.originalLine;
|
|
16370
|
-
while (mapping && mapping.originalLine === originalLine) {
|
|
16371
|
-
mappings.push({
|
|
16372
|
-
line: util$3.getArg(mapping, "generatedLine", null),
|
|
16373
|
-
column: util$3.getArg(mapping, "generatedColumn", null),
|
|
16374
|
-
lastColumn: util$3.getArg(mapping, "lastGeneratedColumn", null)
|
|
16375
|
-
});
|
|
16376
|
-
mapping = this._originalMappings[++index2];
|
|
16377
|
-
}
|
|
16378
|
-
} else {
|
|
16379
|
-
var originalColumn = mapping.originalColumn;
|
|
16380
|
-
while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
|
|
16381
|
-
mappings.push({
|
|
16382
|
-
line: util$3.getArg(mapping, "generatedLine", null),
|
|
16383
|
-
column: util$3.getArg(mapping, "generatedColumn", null),
|
|
16384
|
-
lastColumn: util$3.getArg(mapping, "lastGeneratedColumn", null)
|
|
16385
|
-
});
|
|
16386
|
-
mapping = this._originalMappings[++index2];
|
|
16387
|
-
}
|
|
16388
|
-
}
|
|
16389
|
-
}
|
|
16390
|
-
return mappings;
|
|
16391
|
-
};
|
|
16392
|
-
sourceMapConsumer.SourceMapConsumer = SourceMapConsumer;
|
|
16393
|
-
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
16394
|
-
var sourceMap2 = aSourceMap;
|
|
16395
|
-
if (typeof aSourceMap === "string") {
|
|
16396
|
-
sourceMap2 = util$3.parseSourceMapInput(aSourceMap);
|
|
16397
|
-
}
|
|
16398
|
-
var version2 = util$3.getArg(sourceMap2, "version");
|
|
16399
|
-
var sources = util$3.getArg(sourceMap2, "sources");
|
|
16400
|
-
var names = util$3.getArg(sourceMap2, "names", []);
|
|
16401
|
-
var sourceRoot = util$3.getArg(sourceMap2, "sourceRoot", null);
|
|
16402
|
-
var sourcesContent = util$3.getArg(sourceMap2, "sourcesContent", null);
|
|
16403
|
-
var mappings = util$3.getArg(sourceMap2, "mappings");
|
|
16404
|
-
var file = util$3.getArg(sourceMap2, "file", null);
|
|
16405
|
-
if (version2 != this._version) {
|
|
16406
|
-
throw new Error("Unsupported version: " + version2);
|
|
16407
|
-
}
|
|
16408
|
-
if (sourceRoot) {
|
|
16409
|
-
sourceRoot = util$3.normalize(sourceRoot);
|
|
16410
|
-
}
|
|
16411
|
-
sources = sources.map(String).map(util$3.normalize).map(function(source2) {
|
|
16412
|
-
return sourceRoot && util$3.isAbsolute(sourceRoot) && util$3.isAbsolute(source2) ? util$3.relative(sourceRoot, source2) : source2;
|
|
16413
|
-
});
|
|
16414
|
-
this._names = ArraySet.fromArray(names.map(String), true);
|
|
16415
|
-
this._sources = ArraySet.fromArray(sources, true);
|
|
16416
|
-
this._absoluteSources = this._sources.toArray().map(function(s3) {
|
|
16417
|
-
return util$3.computeSourceURL(sourceRoot, s3, aSourceMapURL);
|
|
16418
|
-
});
|
|
16419
|
-
this.sourceRoot = sourceRoot;
|
|
16420
|
-
this.sourcesContent = sourcesContent;
|
|
16421
|
-
this._mappings = mappings;
|
|
16422
|
-
this._sourceMapURL = aSourceMapURL;
|
|
16423
|
-
this.file = file;
|
|
16424
|
-
}
|
|
16425
|
-
BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
16426
|
-
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
|
|
16427
|
-
BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
|
|
16428
|
-
var relativeSource = aSource;
|
|
16429
|
-
if (this.sourceRoot != null) {
|
|
16430
|
-
relativeSource = util$3.relative(this.sourceRoot, relativeSource);
|
|
16431
|
-
}
|
|
16432
|
-
if (this._sources.has(relativeSource)) {
|
|
16433
|
-
return this._sources.indexOf(relativeSource);
|
|
16434
|
-
}
|
|
16435
|
-
var i3;
|
|
16436
|
-
for (i3 = 0; i3 < this._absoluteSources.length; ++i3) {
|
|
16437
|
-
if (this._absoluteSources[i3] == aSource) {
|
|
16438
|
-
return i3;
|
|
16439
|
-
}
|
|
16440
|
-
}
|
|
16441
|
-
return -1;
|
|
16442
|
-
};
|
|
16443
|
-
BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
|
|
16444
|
-
var smc = Object.create(BasicSourceMapConsumer.prototype);
|
|
16445
|
-
var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
|
|
16446
|
-
var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
|
|
16447
|
-
smc.sourceRoot = aSourceMap._sourceRoot;
|
|
16448
|
-
smc.sourcesContent = aSourceMap._generateSourcesContent(
|
|
16449
|
-
smc._sources.toArray(),
|
|
16450
|
-
smc.sourceRoot
|
|
16451
|
-
);
|
|
16452
|
-
smc.file = aSourceMap._file;
|
|
16453
|
-
smc._sourceMapURL = aSourceMapURL;
|
|
16454
|
-
smc._absoluteSources = smc._sources.toArray().map(function(s3) {
|
|
16455
|
-
return util$3.computeSourceURL(smc.sourceRoot, s3, aSourceMapURL);
|
|
16456
|
-
});
|
|
16457
|
-
var generatedMappings = aSourceMap._mappings.toArray().slice();
|
|
16458
|
-
var destGeneratedMappings = smc.__generatedMappings = [];
|
|
16459
|
-
var destOriginalMappings = smc.__originalMappings = [];
|
|
16460
|
-
for (var i3 = 0, length2 = generatedMappings.length; i3 < length2; i3++) {
|
|
16461
|
-
var srcMapping = generatedMappings[i3];
|
|
16462
|
-
var destMapping = new Mapping();
|
|
16463
|
-
destMapping.generatedLine = srcMapping.generatedLine;
|
|
16464
|
-
destMapping.generatedColumn = srcMapping.generatedColumn;
|
|
16465
|
-
if (srcMapping.source) {
|
|
16466
|
-
destMapping.source = sources.indexOf(srcMapping.source);
|
|
16467
|
-
destMapping.originalLine = srcMapping.originalLine;
|
|
16468
|
-
destMapping.originalColumn = srcMapping.originalColumn;
|
|
16469
|
-
if (srcMapping.name) {
|
|
16470
|
-
destMapping.name = names.indexOf(srcMapping.name);
|
|
16471
|
-
}
|
|
16472
|
-
destOriginalMappings.push(destMapping);
|
|
16473
|
-
}
|
|
16474
|
-
destGeneratedMappings.push(destMapping);
|
|
16475
|
-
}
|
|
16476
|
-
quickSort(smc.__originalMappings, util$3.compareByOriginalPositions);
|
|
16477
|
-
return smc;
|
|
16478
|
-
};
|
|
16479
|
-
BasicSourceMapConsumer.prototype._version = 3;
|
|
16480
|
-
Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
|
|
16481
|
-
get: function() {
|
|
16482
|
-
return this._absoluteSources.slice();
|
|
16483
|
-
}
|
|
16484
|
-
});
|
|
16485
|
-
function Mapping() {
|
|
16486
|
-
this.generatedLine = 0;
|
|
16487
|
-
this.generatedColumn = 0;
|
|
16488
|
-
this.source = null;
|
|
16489
|
-
this.originalLine = null;
|
|
16490
|
-
this.originalColumn = null;
|
|
16491
|
-
this.name = null;
|
|
16492
|
-
}
|
|
16493
|
-
BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings2(aStr, aSourceRoot) {
|
|
16494
|
-
var generatedLine = 1;
|
|
16495
|
-
var previousGeneratedColumn = 0;
|
|
16496
|
-
var previousOriginalLine = 0;
|
|
16497
|
-
var previousOriginalColumn = 0;
|
|
16498
|
-
var previousSource = 0;
|
|
16499
|
-
var previousName = 0;
|
|
16500
|
-
var length2 = aStr.length;
|
|
16501
|
-
var index2 = 0;
|
|
16502
|
-
var cachedSegments = {};
|
|
16503
|
-
var temp = {};
|
|
16504
|
-
var originalMappings = [];
|
|
16505
|
-
var generatedMappings = [];
|
|
16506
|
-
var mapping, str, segment, end2, value;
|
|
16507
|
-
while (index2 < length2) {
|
|
16508
|
-
if (aStr.charAt(index2) === ";") {
|
|
16509
|
-
generatedLine++;
|
|
16510
|
-
index2++;
|
|
16511
|
-
previousGeneratedColumn = 0;
|
|
16512
|
-
} else if (aStr.charAt(index2) === ",") {
|
|
16513
|
-
index2++;
|
|
16514
|
-
} else {
|
|
16515
|
-
mapping = new Mapping();
|
|
16516
|
-
mapping.generatedLine = generatedLine;
|
|
16517
|
-
for (end2 = index2; end2 < length2; end2++) {
|
|
16518
|
-
if (this._charIsMappingSeparator(aStr, end2)) {
|
|
16519
|
-
break;
|
|
16520
|
-
}
|
|
16521
|
-
}
|
|
16522
|
-
str = aStr.slice(index2, end2);
|
|
16523
|
-
segment = cachedSegments[str];
|
|
16524
|
-
if (segment) {
|
|
16525
|
-
index2 += str.length;
|
|
16526
|
-
} else {
|
|
16527
|
-
segment = [];
|
|
16528
|
-
while (index2 < end2) {
|
|
16529
|
-
base64VLQ.decode(aStr, index2, temp);
|
|
16530
|
-
value = temp.value;
|
|
16531
|
-
index2 = temp.rest;
|
|
16532
|
-
segment.push(value);
|
|
16533
|
-
}
|
|
16534
|
-
if (segment.length === 2) {
|
|
16535
|
-
throw new Error("Found a source, but no line and column");
|
|
16536
|
-
}
|
|
16537
|
-
if (segment.length === 3) {
|
|
16538
|
-
throw new Error("Found a source and line, but no column");
|
|
16539
|
-
}
|
|
16540
|
-
cachedSegments[str] = segment;
|
|
16541
|
-
}
|
|
16542
|
-
mapping.generatedColumn = previousGeneratedColumn + segment[0];
|
|
16543
|
-
previousGeneratedColumn = mapping.generatedColumn;
|
|
16544
|
-
if (segment.length > 1) {
|
|
16545
|
-
mapping.source = previousSource + segment[1];
|
|
16546
|
-
previousSource += segment[1];
|
|
16547
|
-
mapping.originalLine = previousOriginalLine + segment[2];
|
|
16548
|
-
previousOriginalLine = mapping.originalLine;
|
|
16549
|
-
mapping.originalLine += 1;
|
|
16550
|
-
mapping.originalColumn = previousOriginalColumn + segment[3];
|
|
16551
|
-
previousOriginalColumn = mapping.originalColumn;
|
|
16552
|
-
if (segment.length > 4) {
|
|
16553
|
-
mapping.name = previousName + segment[4];
|
|
16554
|
-
previousName += segment[4];
|
|
16555
|
-
}
|
|
16556
|
-
}
|
|
16557
|
-
generatedMappings.push(mapping);
|
|
16558
|
-
if (typeof mapping.originalLine === "number") {
|
|
16559
|
-
originalMappings.push(mapping);
|
|
16560
|
-
}
|
|
16561
|
-
}
|
|
16562
|
-
}
|
|
16563
|
-
quickSort(generatedMappings, util$3.compareByGeneratedPositionsDeflated);
|
|
16564
|
-
this.__generatedMappings = generatedMappings;
|
|
16565
|
-
quickSort(originalMappings, util$3.compareByOriginalPositions);
|
|
16566
|
-
this.__originalMappings = originalMappings;
|
|
16567
|
-
};
|
|
16568
|
-
BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
|
|
16569
|
-
if (aNeedle[aLineName] <= 0) {
|
|
16570
|
-
throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
|
|
16571
|
-
}
|
|
16572
|
-
if (aNeedle[aColumnName] < 0) {
|
|
16573
|
-
throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
|
|
16574
|
-
}
|
|
16575
|
-
return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
|
|
16576
|
-
};
|
|
16577
|
-
BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
|
|
16578
|
-
for (var index2 = 0; index2 < this._generatedMappings.length; ++index2) {
|
|
16579
|
-
var mapping = this._generatedMappings[index2];
|
|
16580
|
-
if (index2 + 1 < this._generatedMappings.length) {
|
|
16581
|
-
var nextMapping = this._generatedMappings[index2 + 1];
|
|
16582
|
-
if (mapping.generatedLine === nextMapping.generatedLine) {
|
|
16583
|
-
mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
|
|
16584
|
-
continue;
|
|
16585
|
-
}
|
|
16586
|
-
}
|
|
16587
|
-
mapping.lastGeneratedColumn = Infinity;
|
|
16588
|
-
}
|
|
16589
|
-
};
|
|
16590
|
-
BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
|
|
16591
|
-
var needle = {
|
|
16592
|
-
generatedLine: util$3.getArg(aArgs, "line"),
|
|
16593
|
-
generatedColumn: util$3.getArg(aArgs, "column")
|
|
16594
|
-
};
|
|
16595
|
-
var index2 = this._findMapping(
|
|
16596
|
-
needle,
|
|
16597
|
-
this._generatedMappings,
|
|
16598
|
-
"generatedLine",
|
|
16599
|
-
"generatedColumn",
|
|
16600
|
-
util$3.compareByGeneratedPositionsDeflated,
|
|
16601
|
-
util$3.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
|
|
16602
|
-
);
|
|
16603
|
-
if (index2 >= 0) {
|
|
16604
|
-
var mapping = this._generatedMappings[index2];
|
|
16605
|
-
if (mapping.generatedLine === needle.generatedLine) {
|
|
16606
|
-
var source2 = util$3.getArg(mapping, "source", null);
|
|
16607
|
-
if (source2 !== null) {
|
|
16608
|
-
source2 = this._sources.at(source2);
|
|
16609
|
-
source2 = util$3.computeSourceURL(this.sourceRoot, source2, this._sourceMapURL);
|
|
16610
|
-
}
|
|
16611
|
-
var name = util$3.getArg(mapping, "name", null);
|
|
16612
|
-
if (name !== null) {
|
|
16613
|
-
name = this._names.at(name);
|
|
16614
|
-
}
|
|
16615
|
-
return {
|
|
16616
|
-
source: source2,
|
|
16617
|
-
line: util$3.getArg(mapping, "originalLine", null),
|
|
16618
|
-
column: util$3.getArg(mapping, "originalColumn", null),
|
|
16619
|
-
name
|
|
16620
|
-
};
|
|
16621
|
-
}
|
|
16622
|
-
}
|
|
16623
|
-
return {
|
|
16624
|
-
source: null,
|
|
16625
|
-
line: null,
|
|
16626
|
-
column: null,
|
|
16627
|
-
name: null
|
|
16628
|
-
};
|
|
16629
|
-
};
|
|
16630
|
-
BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
|
|
16631
|
-
if (!this.sourcesContent) {
|
|
16632
|
-
return false;
|
|
16633
|
-
}
|
|
16634
|
-
return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
|
|
16635
|
-
return sc == null;
|
|
16636
|
-
});
|
|
16637
|
-
};
|
|
16638
|
-
BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
16639
|
-
if (!this.sourcesContent) {
|
|
16640
|
-
return null;
|
|
16641
|
-
}
|
|
16642
|
-
var index2 = this._findSourceIndex(aSource);
|
|
16643
|
-
if (index2 >= 0) {
|
|
16644
|
-
return this.sourcesContent[index2];
|
|
16645
|
-
}
|
|
16646
|
-
var relativeSource = aSource;
|
|
16647
|
-
if (this.sourceRoot != null) {
|
|
16648
|
-
relativeSource = util$3.relative(this.sourceRoot, relativeSource);
|
|
16649
|
-
}
|
|
16650
|
-
var url;
|
|
16651
|
-
if (this.sourceRoot != null && (url = util$3.urlParse(this.sourceRoot))) {
|
|
16652
|
-
var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
|
|
16653
|
-
if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
|
|
16654
|
-
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
|
|
16655
|
-
}
|
|
16656
|
-
if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
|
|
16657
|
-
return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
|
|
16658
|
-
}
|
|
16659
|
-
}
|
|
16660
|
-
if (nullOnMissing) {
|
|
16661
|
-
return null;
|
|
16662
|
-
} else {
|
|
16663
|
-
throw new Error('"' + relativeSource + '" is not in the SourceMap.');
|
|
16664
|
-
}
|
|
16665
|
-
};
|
|
16666
|
-
BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
|
|
16667
|
-
var source2 = util$3.getArg(aArgs, "source");
|
|
16668
|
-
source2 = this._findSourceIndex(source2);
|
|
16669
|
-
if (source2 < 0) {
|
|
16670
|
-
return {
|
|
16671
|
-
line: null,
|
|
16672
|
-
column: null,
|
|
16673
|
-
lastColumn: null
|
|
16674
|
-
};
|
|
16675
|
-
}
|
|
16676
|
-
var needle = {
|
|
16677
|
-
source: source2,
|
|
16678
|
-
originalLine: util$3.getArg(aArgs, "line"),
|
|
16679
|
-
originalColumn: util$3.getArg(aArgs, "column")
|
|
16680
|
-
};
|
|
16681
|
-
var index2 = this._findMapping(
|
|
16682
|
-
needle,
|
|
16683
|
-
this._originalMappings,
|
|
16684
|
-
"originalLine",
|
|
16685
|
-
"originalColumn",
|
|
16686
|
-
util$3.compareByOriginalPositions,
|
|
16687
|
-
util$3.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
|
|
16688
|
-
);
|
|
16689
|
-
if (index2 >= 0) {
|
|
16690
|
-
var mapping = this._originalMappings[index2];
|
|
16691
|
-
if (mapping.source === needle.source) {
|
|
16692
|
-
return {
|
|
16693
|
-
line: util$3.getArg(mapping, "generatedLine", null),
|
|
16694
|
-
column: util$3.getArg(mapping, "generatedColumn", null),
|
|
16695
|
-
lastColumn: util$3.getArg(mapping, "lastGeneratedColumn", null)
|
|
16696
|
-
};
|
|
16697
|
-
}
|
|
16698
|
-
}
|
|
16699
|
-
return {
|
|
16700
|
-
line: null,
|
|
16701
|
-
column: null,
|
|
16702
|
-
lastColumn: null
|
|
16703
|
-
};
|
|
16704
|
-
};
|
|
16705
|
-
sourceMapConsumer.BasicSourceMapConsumer = BasicSourceMapConsumer;
|
|
16706
|
-
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
16707
|
-
var sourceMap2 = aSourceMap;
|
|
16708
|
-
if (typeof aSourceMap === "string") {
|
|
16709
|
-
sourceMap2 = util$3.parseSourceMapInput(aSourceMap);
|
|
16710
|
-
}
|
|
16711
|
-
var version2 = util$3.getArg(sourceMap2, "version");
|
|
16712
|
-
var sections = util$3.getArg(sourceMap2, "sections");
|
|
16713
|
-
if (version2 != this._version) {
|
|
16714
|
-
throw new Error("Unsupported version: " + version2);
|
|
16715
|
-
}
|
|
16716
|
-
this._sources = new ArraySet();
|
|
16717
|
-
this._names = new ArraySet();
|
|
16718
|
-
var lastOffset = {
|
|
16719
|
-
line: -1,
|
|
16720
|
-
column: 0
|
|
16721
|
-
};
|
|
16722
|
-
this._sections = sections.map(function(s3) {
|
|
16723
|
-
if (s3.url) {
|
|
16724
|
-
throw new Error("Support for url field in sections not implemented.");
|
|
16725
|
-
}
|
|
16726
|
-
var offset = util$3.getArg(s3, "offset");
|
|
16727
|
-
var offsetLine = util$3.getArg(offset, "line");
|
|
16728
|
-
var offsetColumn = util$3.getArg(offset, "column");
|
|
16729
|
-
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
|
|
16730
|
-
throw new Error("Section offsets must be ordered and non-overlapping.");
|
|
16731
|
-
}
|
|
16732
|
-
lastOffset = offset;
|
|
16733
|
-
return {
|
|
16734
|
-
generatedOffset: {
|
|
16735
|
-
generatedLine: offsetLine + 1,
|
|
16736
|
-
generatedColumn: offsetColumn + 1
|
|
16737
|
-
},
|
|
16738
|
-
consumer: new SourceMapConsumer(util$3.getArg(s3, "map"), aSourceMapURL)
|
|
16739
|
-
};
|
|
16740
|
-
});
|
|
16741
|
-
}
|
|
16742
|
-
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
16743
|
-
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
|
16744
|
-
IndexedSourceMapConsumer.prototype._version = 3;
|
|
16745
|
-
Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
|
|
16746
|
-
get: function() {
|
|
16747
|
-
var sources = [];
|
|
16748
|
-
for (var i3 = 0; i3 < this._sections.length; i3++) {
|
|
16749
|
-
for (var j = 0; j < this._sections[i3].consumer.sources.length; j++) {
|
|
16750
|
-
sources.push(this._sections[i3].consumer.sources[j]);
|
|
16751
|
-
}
|
|
16752
|
-
}
|
|
16753
|
-
return sources;
|
|
16754
|
-
}
|
|
16755
|
-
});
|
|
16756
|
-
IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
|
|
16757
|
-
var needle = {
|
|
16758
|
-
generatedLine: util$3.getArg(aArgs, "line"),
|
|
16759
|
-
generatedColumn: util$3.getArg(aArgs, "column")
|
|
16760
|
-
};
|
|
16761
|
-
var sectionIndex = binarySearch.search(
|
|
16762
|
-
needle,
|
|
16763
|
-
this._sections,
|
|
16764
|
-
function(needle2, section2) {
|
|
16765
|
-
var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
|
|
16766
|
-
if (cmp) {
|
|
16767
|
-
return cmp;
|
|
16768
|
-
}
|
|
16769
|
-
return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
|
|
16770
|
-
}
|
|
16771
|
-
);
|
|
16772
|
-
var section = this._sections[sectionIndex];
|
|
16773
|
-
if (!section) {
|
|
16774
|
-
return {
|
|
16775
|
-
source: null,
|
|
16776
|
-
line: null,
|
|
16777
|
-
column: null,
|
|
16778
|
-
name: null
|
|
16779
|
-
};
|
|
16780
|
-
}
|
|
16781
|
-
return section.consumer.originalPositionFor({
|
|
16782
|
-
line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
|
|
16783
|
-
column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
16784
|
-
bias: aArgs.bias
|
|
16785
|
-
});
|
|
16786
|
-
};
|
|
16787
|
-
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
|
|
16788
|
-
return this._sections.every(function(s3) {
|
|
16789
|
-
return s3.consumer.hasContentsOfAllSources();
|
|
16790
|
-
});
|
|
16791
|
-
};
|
|
16792
|
-
IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
16793
|
-
for (var i3 = 0; i3 < this._sections.length; i3++) {
|
|
16794
|
-
var section = this._sections[i3];
|
|
16795
|
-
var content = section.consumer.sourceContentFor(aSource, true);
|
|
16796
|
-
if (content) {
|
|
16797
|
-
return content;
|
|
16798
|
-
}
|
|
16799
|
-
}
|
|
16800
|
-
if (nullOnMissing) {
|
|
16801
|
-
return null;
|
|
16802
|
-
} else {
|
|
16803
|
-
throw new Error('"' + aSource + '" is not in the SourceMap.');
|
|
16804
|
-
}
|
|
16805
|
-
};
|
|
16806
|
-
IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
|
|
16807
|
-
for (var i3 = 0; i3 < this._sections.length; i3++) {
|
|
16808
|
-
var section = this._sections[i3];
|
|
16809
|
-
if (section.consumer._findSourceIndex(util$3.getArg(aArgs, "source")) === -1) {
|
|
16810
|
-
continue;
|
|
16811
|
-
}
|
|
16812
|
-
var generatedPosition = section.consumer.generatedPositionFor(aArgs);
|
|
16813
|
-
if (generatedPosition) {
|
|
16814
|
-
var ret = {
|
|
16815
|
-
line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
|
|
16816
|
-
column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
|
|
16817
|
-
};
|
|
16818
|
-
return ret;
|
|
16819
|
-
}
|
|
16820
|
-
}
|
|
16821
|
-
return {
|
|
16822
|
-
line: null,
|
|
16823
|
-
column: null
|
|
16824
|
-
};
|
|
16825
|
-
};
|
|
16826
|
-
IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
16827
|
-
this.__generatedMappings = [];
|
|
16828
|
-
this.__originalMappings = [];
|
|
16829
|
-
for (var i3 = 0; i3 < this._sections.length; i3++) {
|
|
16830
|
-
var section = this._sections[i3];
|
|
16831
|
-
var sectionMappings = section.consumer._generatedMappings;
|
|
16832
|
-
for (var j = 0; j < sectionMappings.length; j++) {
|
|
16833
|
-
var mapping = sectionMappings[j];
|
|
16834
|
-
var source2 = section.consumer._sources.at(mapping.source);
|
|
16835
|
-
source2 = util$3.computeSourceURL(section.consumer.sourceRoot, source2, this._sourceMapURL);
|
|
16836
|
-
this._sources.add(source2);
|
|
16837
|
-
source2 = this._sources.indexOf(source2);
|
|
16838
|
-
var name = null;
|
|
16839
|
-
if (mapping.name) {
|
|
16840
|
-
name = section.consumer._names.at(mapping.name);
|
|
16841
|
-
this._names.add(name);
|
|
16842
|
-
name = this._names.indexOf(name);
|
|
16843
|
-
}
|
|
16844
|
-
var adjustedMapping = {
|
|
16845
|
-
source: source2,
|
|
16846
|
-
generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
|
|
16847
|
-
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
16848
|
-
originalLine: mapping.originalLine,
|
|
16849
|
-
originalColumn: mapping.originalColumn,
|
|
16850
|
-
name
|
|
16851
|
-
};
|
|
16852
|
-
this.__generatedMappings.push(adjustedMapping);
|
|
16853
|
-
if (typeof adjustedMapping.originalLine === "number") {
|
|
16854
|
-
this.__originalMappings.push(adjustedMapping);
|
|
16855
|
-
}
|
|
16856
|
-
}
|
|
16857
|
-
}
|
|
16858
|
-
quickSort(this.__generatedMappings, util$3.compareByGeneratedPositionsDeflated);
|
|
16859
|
-
quickSort(this.__originalMappings, util$3.compareByOriginalPositions);
|
|
16860
|
-
};
|
|
16861
|
-
sourceMapConsumer.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
|
16862
|
-
var sourceNode = {};
|
|
16863
|
-
var SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
|
|
16864
|
-
var util$2 = util$7;
|
|
16865
|
-
var REGEX_NEWLINE = /(\r?\n)/;
|
|
16866
|
-
var NEWLINE_CODE = 10;
|
|
16867
|
-
var isSourceNode = "$$$isSourceNode$$$";
|
|
16868
|
-
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
|
16869
|
-
this.children = [];
|
|
16870
|
-
this.sourceContents = {};
|
|
16871
|
-
this.line = aLine == null ? null : aLine;
|
|
16872
|
-
this.column = aColumn == null ? null : aColumn;
|
|
16873
|
-
this.source = aSource == null ? null : aSource;
|
|
16874
|
-
this.name = aName == null ? null : aName;
|
|
16875
|
-
this[isSourceNode] = true;
|
|
16876
|
-
if (aChunks != null)
|
|
16877
|
-
this.add(aChunks);
|
|
16878
|
-
}
|
|
16879
|
-
SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
|
16880
|
-
var node = new SourceNode();
|
|
16881
|
-
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
|
16882
|
-
var remainingLinesIndex = 0;
|
|
16883
|
-
var shiftNextLine = function() {
|
|
16884
|
-
var lineContents = getNextLine();
|
|
16885
|
-
var newLine = getNextLine() || "";
|
|
16886
|
-
return lineContents + newLine;
|
|
16887
|
-
function getNextLine() {
|
|
16888
|
-
return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
|
|
16889
|
-
}
|
|
16890
|
-
};
|
|
16891
|
-
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
|
16892
|
-
var lastMapping = null;
|
|
16893
|
-
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
16894
|
-
if (lastMapping !== null) {
|
|
16895
|
-
if (lastGeneratedLine < mapping.generatedLine) {
|
|
16896
|
-
addMappingWithCode(lastMapping, shiftNextLine());
|
|
16897
|
-
lastGeneratedLine++;
|
|
16898
|
-
lastGeneratedColumn = 0;
|
|
16899
|
-
} else {
|
|
16900
|
-
var nextLine = remainingLines[remainingLinesIndex] || "";
|
|
16901
|
-
var code2 = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
|
|
16902
|
-
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
|
|
16903
|
-
lastGeneratedColumn = mapping.generatedColumn;
|
|
16904
|
-
addMappingWithCode(lastMapping, code2);
|
|
16905
|
-
lastMapping = mapping;
|
|
16906
|
-
return;
|
|
16907
|
-
}
|
|
16908
|
-
}
|
|
16909
|
-
while (lastGeneratedLine < mapping.generatedLine) {
|
|
16910
|
-
node.add(shiftNextLine());
|
|
16911
|
-
lastGeneratedLine++;
|
|
16912
|
-
}
|
|
16913
|
-
if (lastGeneratedColumn < mapping.generatedColumn) {
|
|
16914
|
-
var nextLine = remainingLines[remainingLinesIndex] || "";
|
|
16915
|
-
node.add(nextLine.substr(0, mapping.generatedColumn));
|
|
16916
|
-
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
|
16917
|
-
lastGeneratedColumn = mapping.generatedColumn;
|
|
16918
|
-
}
|
|
16919
|
-
lastMapping = mapping;
|
|
16920
|
-
}, this);
|
|
16921
|
-
if (remainingLinesIndex < remainingLines.length) {
|
|
16922
|
-
if (lastMapping) {
|
|
16923
|
-
addMappingWithCode(lastMapping, shiftNextLine());
|
|
16924
|
-
}
|
|
16925
|
-
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
|
16926
|
-
}
|
|
16927
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
16928
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
16929
|
-
if (content != null) {
|
|
16930
|
-
if (aRelativePath != null) {
|
|
16931
|
-
sourceFile = util$2.join(aRelativePath, sourceFile);
|
|
16932
|
-
}
|
|
16933
|
-
node.setSourceContent(sourceFile, content);
|
|
16934
|
-
}
|
|
16935
|
-
});
|
|
16936
|
-
return node;
|
|
16937
|
-
function addMappingWithCode(mapping, code2) {
|
|
16938
|
-
if (mapping === null || mapping.source === void 0) {
|
|
16939
|
-
node.add(code2);
|
|
16940
|
-
} else {
|
|
16941
|
-
var source2 = aRelativePath ? util$2.join(aRelativePath, mapping.source) : mapping.source;
|
|
16942
|
-
node.add(new SourceNode(
|
|
16943
|
-
mapping.originalLine,
|
|
16944
|
-
mapping.originalColumn,
|
|
16945
|
-
source2,
|
|
16946
|
-
code2,
|
|
16947
|
-
mapping.name
|
|
16948
|
-
));
|
|
16949
|
-
}
|
|
16950
|
-
}
|
|
16951
|
-
};
|
|
16952
|
-
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
|
16953
|
-
if (Array.isArray(aChunk)) {
|
|
16954
|
-
aChunk.forEach(function(chunk) {
|
|
16955
|
-
this.add(chunk);
|
|
16956
|
-
}, this);
|
|
16957
|
-
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
|
16958
|
-
if (aChunk) {
|
|
16959
|
-
this.children.push(aChunk);
|
|
16960
|
-
}
|
|
16961
|
-
} else {
|
|
16962
|
-
throw new TypeError(
|
|
16963
|
-
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
|
16964
|
-
);
|
|
16965
|
-
}
|
|
16966
|
-
return this;
|
|
16967
|
-
};
|
|
16968
|
-
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
|
16969
|
-
if (Array.isArray(aChunk)) {
|
|
16970
|
-
for (var i3 = aChunk.length - 1; i3 >= 0; i3--) {
|
|
16971
|
-
this.prepend(aChunk[i3]);
|
|
16972
|
-
}
|
|
16973
|
-
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
|
16974
|
-
this.children.unshift(aChunk);
|
|
16975
|
-
} else {
|
|
16976
|
-
throw new TypeError(
|
|
16977
|
-
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
|
16978
|
-
);
|
|
16979
|
-
}
|
|
16980
|
-
return this;
|
|
16981
|
-
};
|
|
16982
|
-
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
|
16983
|
-
var chunk;
|
|
16984
|
-
for (var i3 = 0, len2 = this.children.length; i3 < len2; i3++) {
|
|
16985
|
-
chunk = this.children[i3];
|
|
16986
|
-
if (chunk[isSourceNode]) {
|
|
16987
|
-
chunk.walk(aFn);
|
|
16988
|
-
} else {
|
|
16989
|
-
if (chunk !== "") {
|
|
16990
|
-
aFn(chunk, {
|
|
16991
|
-
source: this.source,
|
|
16992
|
-
line: this.line,
|
|
16993
|
-
column: this.column,
|
|
16994
|
-
name: this.name
|
|
16995
|
-
});
|
|
16996
|
-
}
|
|
16997
|
-
}
|
|
16998
|
-
}
|
|
16999
|
-
};
|
|
17000
|
-
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
|
17001
|
-
var newChildren;
|
|
17002
|
-
var i3;
|
|
17003
|
-
var len2 = this.children.length;
|
|
17004
|
-
if (len2 > 0) {
|
|
17005
|
-
newChildren = [];
|
|
17006
|
-
for (i3 = 0; i3 < len2 - 1; i3++) {
|
|
17007
|
-
newChildren.push(this.children[i3]);
|
|
17008
|
-
newChildren.push(aSep);
|
|
17009
|
-
}
|
|
17010
|
-
newChildren.push(this.children[i3]);
|
|
17011
|
-
this.children = newChildren;
|
|
17012
|
-
}
|
|
17013
|
-
return this;
|
|
17014
|
-
};
|
|
17015
|
-
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
|
17016
|
-
var lastChild2 = this.children[this.children.length - 1];
|
|
17017
|
-
if (lastChild2[isSourceNode]) {
|
|
17018
|
-
lastChild2.replaceRight(aPattern, aReplacement);
|
|
17019
|
-
} else if (typeof lastChild2 === "string") {
|
|
17020
|
-
this.children[this.children.length - 1] = lastChild2.replace(aPattern, aReplacement);
|
|
17021
|
-
} else {
|
|
17022
|
-
this.children.push("".replace(aPattern, aReplacement));
|
|
17023
|
-
}
|
|
17024
|
-
return this;
|
|
17025
|
-
};
|
|
17026
|
-
SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
|
17027
|
-
this.sourceContents[util$2.toSetString(aSourceFile)] = aSourceContent;
|
|
17028
|
-
};
|
|
17029
|
-
SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
|
|
17030
|
-
for (var i3 = 0, len2 = this.children.length; i3 < len2; i3++) {
|
|
17031
|
-
if (this.children[i3][isSourceNode]) {
|
|
17032
|
-
this.children[i3].walkSourceContents(aFn);
|
|
17033
|
-
}
|
|
17034
|
-
}
|
|
17035
|
-
var sources = Object.keys(this.sourceContents);
|
|
17036
|
-
for (var i3 = 0, len2 = sources.length; i3 < len2; i3++) {
|
|
17037
|
-
aFn(util$2.fromSetString(sources[i3]), this.sourceContents[sources[i3]]);
|
|
17038
|
-
}
|
|
17039
|
-
};
|
|
17040
|
-
SourceNode.prototype.toString = function SourceNode_toString() {
|
|
17041
|
-
var str = "";
|
|
17042
|
-
this.walk(function(chunk) {
|
|
17043
|
-
str += chunk;
|
|
17044
|
-
});
|
|
17045
|
-
return str;
|
|
17046
|
-
};
|
|
17047
|
-
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
|
17048
|
-
var generated = {
|
|
17049
|
-
code: "",
|
|
17050
|
-
line: 1,
|
|
17051
|
-
column: 0
|
|
17052
|
-
};
|
|
17053
|
-
var map2 = new SourceMapGenerator(aArgs);
|
|
17054
|
-
var sourceMappingActive = false;
|
|
17055
|
-
var lastOriginalSource = null;
|
|
17056
|
-
var lastOriginalLine = null;
|
|
17057
|
-
var lastOriginalColumn = null;
|
|
17058
|
-
var lastOriginalName = null;
|
|
17059
|
-
this.walk(function(chunk, original) {
|
|
17060
|
-
generated.code += chunk;
|
|
17061
|
-
if (original.source !== null && original.line !== null && original.column !== null) {
|
|
17062
|
-
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
|
|
17063
|
-
map2.addMapping({
|
|
17064
|
-
source: original.source,
|
|
17065
|
-
original: {
|
|
17066
|
-
line: original.line,
|
|
17067
|
-
column: original.column
|
|
17068
|
-
},
|
|
17069
|
-
generated: {
|
|
17070
|
-
line: generated.line,
|
|
17071
|
-
column: generated.column
|
|
17072
|
-
},
|
|
17073
|
-
name: original.name
|
|
17074
|
-
});
|
|
17075
|
-
}
|
|
17076
|
-
lastOriginalSource = original.source;
|
|
17077
|
-
lastOriginalLine = original.line;
|
|
17078
|
-
lastOriginalColumn = original.column;
|
|
17079
|
-
lastOriginalName = original.name;
|
|
17080
|
-
sourceMappingActive = true;
|
|
17081
|
-
} else if (sourceMappingActive) {
|
|
17082
|
-
map2.addMapping({
|
|
17083
|
-
generated: {
|
|
17084
|
-
line: generated.line,
|
|
17085
|
-
column: generated.column
|
|
17086
|
-
}
|
|
17087
|
-
});
|
|
17088
|
-
lastOriginalSource = null;
|
|
17089
|
-
sourceMappingActive = false;
|
|
17090
|
-
}
|
|
17091
|
-
for (var idx = 0, length2 = chunk.length; idx < length2; idx++) {
|
|
17092
|
-
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
|
17093
|
-
generated.line++;
|
|
17094
|
-
generated.column = 0;
|
|
17095
|
-
if (idx + 1 === length2) {
|
|
17096
|
-
lastOriginalSource = null;
|
|
17097
|
-
sourceMappingActive = false;
|
|
17098
|
-
} else if (sourceMappingActive) {
|
|
17099
|
-
map2.addMapping({
|
|
17100
|
-
source: original.source,
|
|
17101
|
-
original: {
|
|
17102
|
-
line: original.line,
|
|
17103
|
-
column: original.column
|
|
17104
|
-
},
|
|
17105
|
-
generated: {
|
|
17106
|
-
line: generated.line,
|
|
17107
|
-
column: generated.column
|
|
17108
|
-
},
|
|
17109
|
-
name: original.name
|
|
17110
|
-
});
|
|
17111
|
-
}
|
|
17112
|
-
} else {
|
|
17113
|
-
generated.column++;
|
|
17114
|
-
}
|
|
17115
|
-
}
|
|
17116
|
-
});
|
|
17117
|
-
this.walkSourceContents(function(sourceFile, sourceContent) {
|
|
17118
|
-
map2.setSourceContent(sourceFile, sourceContent);
|
|
17119
|
-
});
|
|
17120
|
-
return { code: generated.code, map: map2 };
|
|
17121
|
-
};
|
|
17122
|
-
sourceNode.SourceNode = SourceNode;
|
|
17123
|
-
sourceMap$1.SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
|
|
17124
|
-
sourceMap$1.SourceMapConsumer = sourceMapConsumer.SourceMapConsumer;
|
|
17125
|
-
sourceMap$1.SourceNode = sourceNode.SourceNode;
|
|
17126
15389
|
/*!
|
|
17127
15390
|
* message-compiler v9.2.2
|
|
17128
15391
|
* (c) 2022 kazuya kawaguchi
|
|
17129
15392
|
* Released under the MIT License.
|
|
17130
15393
|
*/
|
|
17131
|
-
Object.defineProperty(messageCompiler_cjs, "__esModule", { value: true });
|
|
17132
|
-
var shared$2 = shared$3.exports;
|
|
17133
|
-
var sourceMap = sourceMap$1;
|
|
17134
15394
|
const CompileErrorCodes = {
|
|
17135
15395
|
EXPECTED_TOKEN: 1,
|
|
17136
15396
|
INVALID_TOKEN_IN_PLACEHOLDER: 2,
|
|
@@ -17166,7 +15426,7 @@ const errorMessages$2 = {
|
|
|
17166
15426
|
};
|
|
17167
15427
|
function createCompileError(code2, loc, options = {}) {
|
|
17168
15428
|
const { domain, messages, args } = options;
|
|
17169
|
-
const msg =
|
|
15429
|
+
const msg = format$2((messages || errorMessages$2)[code2] || "", ...args || []);
|
|
17170
15430
|
const error2 = new SyntaxError(String(msg));
|
|
17171
15431
|
error2.code = code2;
|
|
17172
15432
|
if (loc) {
|
|
@@ -17178,10 +15438,6 @@ function createCompileError(code2, loc, options = {}) {
|
|
|
17178
15438
|
function defaultOnError(error2) {
|
|
17179
15439
|
throw error2;
|
|
17180
15440
|
}
|
|
17181
|
-
const LocationStub = {
|
|
17182
|
-
start: { line: 1, column: 1, offset: 0 },
|
|
17183
|
-
end: { line: 1, column: 1, offset: 0 }
|
|
17184
|
-
};
|
|
17185
15441
|
function createPosition(line, column, offset) {
|
|
17186
15442
|
return { line, column, offset };
|
|
17187
15443
|
}
|
|
@@ -18115,7 +16371,7 @@ function createParser(options = {}) {
|
|
|
18115
16371
|
}
|
|
18116
16372
|
}
|
|
18117
16373
|
function parse2(source2) {
|
|
18118
|
-
const tokenizer = createTokenizer(source2,
|
|
16374
|
+
const tokenizer = createTokenizer(source2, assign({}, options));
|
|
18119
16375
|
const context = tokenizer.context();
|
|
18120
16376
|
const node = startNode(0, context.offset, context.startLoc);
|
|
18121
16377
|
if (location2 && node.loc) {
|
|
@@ -18187,7 +16443,7 @@ function transform(ast, options = {}) {
|
|
|
18187
16443
|
ast.helpers = Array.from(context.helpers);
|
|
18188
16444
|
}
|
|
18189
16445
|
function createCodeGenerator(ast, options) {
|
|
18190
|
-
const { sourceMap
|
|
16446
|
+
const { sourceMap, filename, breakLineCode, needIndent: _needIndent } = options;
|
|
18191
16447
|
const _context = {
|
|
18192
16448
|
source: ast.loc.source,
|
|
18193
16449
|
filename,
|
|
@@ -18203,12 +16459,6 @@ function createCodeGenerator(ast, options) {
|
|
|
18203
16459
|
const context = () => _context;
|
|
18204
16460
|
function push2(code2, node) {
|
|
18205
16461
|
_context.code += code2;
|
|
18206
|
-
if (_context.map) {
|
|
18207
|
-
if (node && node.loc && node.loc !== LocationStub) {
|
|
18208
|
-
addMapping(node.loc.start, getMappingName(node));
|
|
18209
|
-
}
|
|
18210
|
-
advancePositionWithSource(_context, code2);
|
|
18211
|
-
}
|
|
18212
16462
|
}
|
|
18213
16463
|
function _newline(n2, withBreakLine = true) {
|
|
18214
16464
|
const _breakLineCode = withBreakLine ? breakLineCode : "";
|
|
@@ -18227,24 +16477,6 @@ function createCodeGenerator(ast, options) {
|
|
|
18227
16477
|
}
|
|
18228
16478
|
const helper2 = (key) => `_${key}`;
|
|
18229
16479
|
const needIndent = () => _context.needIndent;
|
|
18230
|
-
function addMapping(loc, name) {
|
|
18231
|
-
_context.map.addMapping({
|
|
18232
|
-
name,
|
|
18233
|
-
source: _context.filename,
|
|
18234
|
-
original: {
|
|
18235
|
-
line: loc.line,
|
|
18236
|
-
column: loc.column - 1
|
|
18237
|
-
},
|
|
18238
|
-
generated: {
|
|
18239
|
-
line: _context.line,
|
|
18240
|
-
column: _context.column - 1
|
|
18241
|
-
}
|
|
18242
|
-
});
|
|
18243
|
-
}
|
|
18244
|
-
if (sourceMap$12) {
|
|
18245
|
-
_context.map = new sourceMap.SourceMapGenerator();
|
|
18246
|
-
_context.map.setSourceContent(filename, _context.source);
|
|
18247
|
-
}
|
|
18248
16480
|
return {
|
|
18249
16481
|
context,
|
|
18250
16482
|
push: push2,
|
|
@@ -18346,16 +16578,16 @@ function generateNode(generator, node) {
|
|
|
18346
16578
|
}
|
|
18347
16579
|
}
|
|
18348
16580
|
const generate = (ast, options = {}) => {
|
|
18349
|
-
const mode =
|
|
18350
|
-
const filename =
|
|
18351
|
-
const
|
|
16581
|
+
const mode = isString$1(options.mode) ? options.mode : "normal";
|
|
16582
|
+
const filename = isString$1(options.filename) ? options.filename : "message.intl";
|
|
16583
|
+
const sourceMap = !!options.sourceMap;
|
|
18352
16584
|
const breakLineCode = options.breakLineCode != null ? options.breakLineCode : mode === "arrow" ? ";" : "\n";
|
|
18353
16585
|
const needIndent = options.needIndent ? options.needIndent : mode !== "arrow";
|
|
18354
16586
|
const helpers = ast.helpers || [];
|
|
18355
16587
|
const generator = createCodeGenerator(ast, {
|
|
18356
16588
|
mode,
|
|
18357
16589
|
filename,
|
|
18358
|
-
sourceMap
|
|
16590
|
+
sourceMap,
|
|
18359
16591
|
breakLineCode,
|
|
18360
16592
|
needIndent
|
|
18361
16593
|
});
|
|
@@ -18376,80 +16608,27 @@ const generate = (ast, options = {}) => {
|
|
|
18376
16608
|
map: map2 ? map2.toJSON() : void 0
|
|
18377
16609
|
};
|
|
18378
16610
|
};
|
|
18379
|
-
function getMappingName(node) {
|
|
18380
|
-
switch (node.type) {
|
|
18381
|
-
case 3:
|
|
18382
|
-
case 9:
|
|
18383
|
-
case 8:
|
|
18384
|
-
case 7:
|
|
18385
|
-
return node.value;
|
|
18386
|
-
case 5:
|
|
18387
|
-
return node.index.toString();
|
|
18388
|
-
case 4:
|
|
18389
|
-
return node.key;
|
|
18390
|
-
default:
|
|
18391
|
-
return void 0;
|
|
18392
|
-
}
|
|
18393
|
-
}
|
|
18394
|
-
function advancePositionWithSource(pos, source2, numberOfCharacters = source2.length) {
|
|
18395
|
-
let linesCount = 0;
|
|
18396
|
-
let lastNewLinePos = -1;
|
|
18397
|
-
for (let i3 = 0; i3 < numberOfCharacters; i3++) {
|
|
18398
|
-
if (source2.charCodeAt(i3) === 10) {
|
|
18399
|
-
linesCount++;
|
|
18400
|
-
lastNewLinePos = i3;
|
|
18401
|
-
}
|
|
18402
|
-
}
|
|
18403
|
-
pos.offset += numberOfCharacters;
|
|
18404
|
-
pos.line += linesCount;
|
|
18405
|
-
pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos;
|
|
18406
|
-
return pos;
|
|
18407
|
-
}
|
|
18408
16611
|
function baseCompile(source2, options = {}) {
|
|
18409
|
-
const assignedOptions =
|
|
16612
|
+
const assignedOptions = assign({}, options);
|
|
18410
16613
|
const parser = createParser(assignedOptions);
|
|
18411
16614
|
const ast = parser.parse(source2);
|
|
18412
16615
|
transform(ast, assignedOptions);
|
|
18413
16616
|
return generate(ast, assignedOptions);
|
|
18414
16617
|
}
|
|
18415
|
-
messageCompiler_cjs.CompileErrorCodes = CompileErrorCodes;
|
|
18416
|
-
messageCompiler_cjs.ERROR_DOMAIN = ERROR_DOMAIN;
|
|
18417
|
-
messageCompiler_cjs.LocationStub = LocationStub;
|
|
18418
|
-
messageCompiler_cjs.baseCompile = baseCompile;
|
|
18419
|
-
messageCompiler_cjs.createCompileError = createCompileError;
|
|
18420
|
-
messageCompiler_cjs.createLocation = createLocation;
|
|
18421
|
-
messageCompiler_cjs.createParser = createParser;
|
|
18422
|
-
messageCompiler_cjs.createPosition = createPosition;
|
|
18423
|
-
messageCompiler_cjs.defaultOnError = defaultOnError;
|
|
18424
|
-
messageCompiler_cjs.errorMessages = errorMessages$2;
|
|
18425
|
-
{
|
|
18426
|
-
messageCompiler$1.exports = messageCompiler_cjs;
|
|
18427
|
-
}
|
|
18428
|
-
var devtoolsIf$1 = { exports: {} };
|
|
18429
|
-
var devtoolsIf_cjs = {};
|
|
18430
16618
|
/*!
|
|
18431
16619
|
* devtools-if v9.2.2
|
|
18432
16620
|
* (c) 2022 kazuya kawaguchi
|
|
18433
16621
|
* Released under the MIT License.
|
|
18434
16622
|
*/
|
|
18435
|
-
Object.defineProperty(devtoolsIf_cjs, "__esModule", { value: true });
|
|
18436
16623
|
const IntlifyDevToolsHooks = {
|
|
18437
16624
|
I18nInit: "i18n:init",
|
|
18438
16625
|
FunctionTranslate: "function:translate"
|
|
18439
16626
|
};
|
|
18440
|
-
devtoolsIf_cjs.IntlifyDevToolsHooks = IntlifyDevToolsHooks;
|
|
18441
|
-
{
|
|
18442
|
-
devtoolsIf$1.exports = devtoolsIf_cjs;
|
|
18443
|
-
}
|
|
18444
16627
|
/*!
|
|
18445
16628
|
* core-base v9.2.2
|
|
18446
16629
|
* (c) 2022 kazuya kawaguchi
|
|
18447
16630
|
* Released under the MIT License.
|
|
18448
16631
|
*/
|
|
18449
|
-
Object.defineProperty(coreBase_cjs, "__esModule", { value: true });
|
|
18450
|
-
var messageCompiler = messageCompiler$1.exports;
|
|
18451
|
-
var shared$1 = shared$3.exports;
|
|
18452
|
-
var devtoolsIf = devtoolsIf$1.exports;
|
|
18453
16632
|
const pathStateMachine = [];
|
|
18454
16633
|
pathStateMachine[0] = {
|
|
18455
16634
|
["w"]: [0],
|
|
@@ -18626,10 +16805,10 @@ function parse$1(path) {
|
|
|
18626
16805
|
}
|
|
18627
16806
|
const cache = /* @__PURE__ */ new Map();
|
|
18628
16807
|
function resolveWithKeyValue(obj, path) {
|
|
18629
|
-
return
|
|
16808
|
+
return isObject$4(obj) ? obj[path] : null;
|
|
18630
16809
|
}
|
|
18631
16810
|
function resolveValue(obj, path) {
|
|
18632
|
-
if (!
|
|
16811
|
+
if (!isObject$4(obj)) {
|
|
18633
16812
|
return null;
|
|
18634
16813
|
}
|
|
18635
16814
|
let hit = cache.get(path);
|
|
@@ -18659,7 +16838,7 @@ const DEFAULT_MODIFIER = (str) => str;
|
|
|
18659
16838
|
const DEFAULT_MESSAGE = (ctx) => "";
|
|
18660
16839
|
const DEFAULT_MESSAGE_DATA_TYPE = "text";
|
|
18661
16840
|
const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : values.join("");
|
|
18662
|
-
const DEFAULT_INTERPOLATE =
|
|
16841
|
+
const DEFAULT_INTERPOLATE = toDisplayString;
|
|
18663
16842
|
function pluralDefault(choice, choicesLength) {
|
|
18664
16843
|
choice = Math.abs(choice);
|
|
18665
16844
|
if (choicesLength === 2) {
|
|
@@ -18668,8 +16847,8 @@ function pluralDefault(choice, choicesLength) {
|
|
|
18668
16847
|
return choice ? Math.min(choice, 2) : 0;
|
|
18669
16848
|
}
|
|
18670
16849
|
function getPluralIndex(options) {
|
|
18671
|
-
const index2 =
|
|
18672
|
-
return options.named && (
|
|
16850
|
+
const index2 = isNumber$1(options.pluralIndex) ? options.pluralIndex : -1;
|
|
16851
|
+
return options.named && (isNumber$1(options.named.count) || isNumber$1(options.named.n)) ? isNumber$1(options.named.count) ? options.named.count : isNumber$1(options.named.n) ? options.named.n : index2 : index2;
|
|
18673
16852
|
}
|
|
18674
16853
|
function normalizeNamed(pluralIndex, props) {
|
|
18675
16854
|
if (!props.count) {
|
|
@@ -18682,45 +16861,45 @@ function normalizeNamed(pluralIndex, props) {
|
|
|
18682
16861
|
function createMessageContext(options = {}) {
|
|
18683
16862
|
const locale2 = options.locale;
|
|
18684
16863
|
const pluralIndex = getPluralIndex(options);
|
|
18685
|
-
const pluralRule =
|
|
18686
|
-
const orgPluralRule =
|
|
16864
|
+
const pluralRule = isObject$4(options.pluralRules) && isString$1(locale2) && isFunction$1(options.pluralRules[locale2]) ? options.pluralRules[locale2] : pluralDefault;
|
|
16865
|
+
const orgPluralRule = isObject$4(options.pluralRules) && isString$1(locale2) && isFunction$1(options.pluralRules[locale2]) ? pluralDefault : void 0;
|
|
18687
16866
|
const plural = (messages) => {
|
|
18688
16867
|
return messages[pluralRule(pluralIndex, messages.length, orgPluralRule)];
|
|
18689
16868
|
};
|
|
18690
16869
|
const _list = options.list || [];
|
|
18691
16870
|
const list = (index2) => _list[index2];
|
|
18692
16871
|
const _named = options.named || {};
|
|
18693
|
-
|
|
16872
|
+
isNumber$1(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
|
|
18694
16873
|
const named = (key) => _named[key];
|
|
18695
16874
|
function message(key) {
|
|
18696
|
-
const msg =
|
|
16875
|
+
const msg = isFunction$1(options.messages) ? options.messages(key) : isObject$4(options.messages) ? options.messages[key] : false;
|
|
18697
16876
|
return !msg ? options.parent ? options.parent.message(key) : DEFAULT_MESSAGE : msg;
|
|
18698
16877
|
}
|
|
18699
16878
|
const _modifier = (name) => options.modifiers ? options.modifiers[name] : DEFAULT_MODIFIER;
|
|
18700
|
-
const normalize2 =
|
|
18701
|
-
const interpolate =
|
|
18702
|
-
const type =
|
|
16879
|
+
const normalize2 = isPlainObject(options.processor) && isFunction$1(options.processor.normalize) ? options.processor.normalize : DEFAULT_NORMALIZE;
|
|
16880
|
+
const interpolate = isPlainObject(options.processor) && isFunction$1(options.processor.interpolate) ? options.processor.interpolate : DEFAULT_INTERPOLATE;
|
|
16881
|
+
const type = isPlainObject(options.processor) && isString$1(options.processor.type) ? options.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
|
|
18703
16882
|
const linked = (key, ...args) => {
|
|
18704
16883
|
const [arg1, arg2] = args;
|
|
18705
16884
|
let type2 = "text";
|
|
18706
16885
|
let modifier = "";
|
|
18707
16886
|
if (args.length === 1) {
|
|
18708
|
-
if (
|
|
16887
|
+
if (isObject$4(arg1)) {
|
|
18709
16888
|
modifier = arg1.modifier || modifier;
|
|
18710
16889
|
type2 = arg1.type || type2;
|
|
18711
|
-
} else if (
|
|
16890
|
+
} else if (isString$1(arg1)) {
|
|
18712
16891
|
modifier = arg1 || modifier;
|
|
18713
16892
|
}
|
|
18714
16893
|
} else if (args.length === 2) {
|
|
18715
|
-
if (
|
|
16894
|
+
if (isString$1(arg1)) {
|
|
18716
16895
|
modifier = arg1 || modifier;
|
|
18717
16896
|
}
|
|
18718
|
-
if (
|
|
16897
|
+
if (isString$1(arg2)) {
|
|
18719
16898
|
type2 = arg2 || type2;
|
|
18720
16899
|
}
|
|
18721
16900
|
}
|
|
18722
16901
|
let msg = message(key)(ctx);
|
|
18723
|
-
if (type2 === "vnode" &&
|
|
16902
|
+
if (type2 === "vnode" && isArray$2(msg) && modifier) {
|
|
18724
16903
|
msg = msg[0];
|
|
18725
16904
|
}
|
|
18726
16905
|
return modifier ? _modifier(modifier)(msg, type2) : msg;
|
|
@@ -18741,18 +16920,15 @@ let devtools = null;
|
|
|
18741
16920
|
function setDevToolsHook(hook) {
|
|
18742
16921
|
devtools = hook;
|
|
18743
16922
|
}
|
|
18744
|
-
function getDevToolsHook() {
|
|
18745
|
-
return devtools;
|
|
18746
|
-
}
|
|
18747
16923
|
function initI18nDevTools(i18n2, version2, meta) {
|
|
18748
|
-
devtools && devtools.emit(
|
|
16924
|
+
devtools && devtools.emit(IntlifyDevToolsHooks.I18nInit, {
|
|
18749
16925
|
timestamp: Date.now(),
|
|
18750
16926
|
i18n: i18n2,
|
|
18751
16927
|
version: version2,
|
|
18752
16928
|
meta
|
|
18753
16929
|
});
|
|
18754
16930
|
}
|
|
18755
|
-
const translateDevTools = /* @__PURE__ */ createDevToolsHook(
|
|
16931
|
+
const translateDevTools = /* @__PURE__ */ createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);
|
|
18756
16932
|
function createDevToolsHook(hook) {
|
|
18757
16933
|
return (payloads) => devtools && devtools.emit(hook, payloads);
|
|
18758
16934
|
}
|
|
@@ -18774,16 +16950,16 @@ const warnMessages$1 = {
|
|
|
18774
16950
|
[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`
|
|
18775
16951
|
};
|
|
18776
16952
|
function getWarnMessage$1(code2, ...args) {
|
|
18777
|
-
return
|
|
16953
|
+
return format$2(warnMessages$1[code2], ...args);
|
|
18778
16954
|
}
|
|
18779
16955
|
function fallbackWithSimple(ctx, fallback, start2) {
|
|
18780
16956
|
return [.../* @__PURE__ */ new Set([
|
|
18781
16957
|
start2,
|
|
18782
|
-
...
|
|
16958
|
+
...isArray$2(fallback) ? fallback : isObject$4(fallback) ? Object.keys(fallback) : isString$1(fallback) ? [fallback] : [start2]
|
|
18783
16959
|
])];
|
|
18784
16960
|
}
|
|
18785
16961
|
function fallbackWithLocaleChain(ctx, fallback, start2) {
|
|
18786
|
-
const startLocale =
|
|
16962
|
+
const startLocale = isString$1(start2) ? start2 : DEFAULT_LOCALE$1;
|
|
18787
16963
|
const context = ctx;
|
|
18788
16964
|
if (!context.__localeChainCache) {
|
|
18789
16965
|
context.__localeChainCache = /* @__PURE__ */ new Map();
|
|
@@ -18792,12 +16968,12 @@ function fallbackWithLocaleChain(ctx, fallback, start2) {
|
|
|
18792
16968
|
if (!chain) {
|
|
18793
16969
|
chain = [];
|
|
18794
16970
|
let block = [start2];
|
|
18795
|
-
while (
|
|
16971
|
+
while (isArray$2(block)) {
|
|
18796
16972
|
block = appendBlockToChain(chain, block, fallback);
|
|
18797
16973
|
}
|
|
18798
|
-
const defaults2 =
|
|
18799
|
-
block =
|
|
18800
|
-
if (
|
|
16974
|
+
const defaults2 = isArray$2(fallback) || !isPlainObject(fallback) ? fallback : fallback["default"] ? fallback["default"] : null;
|
|
16975
|
+
block = isString$1(defaults2) ? [defaults2] : defaults2;
|
|
16976
|
+
if (isArray$2(block)) {
|
|
18801
16977
|
appendBlockToChain(chain, block, false);
|
|
18802
16978
|
}
|
|
18803
16979
|
context.__localeChainCache.set(startLocale, chain);
|
|
@@ -18806,9 +16982,9 @@ function fallbackWithLocaleChain(ctx, fallback, start2) {
|
|
|
18806
16982
|
}
|
|
18807
16983
|
function appendBlockToChain(chain, block, blocks) {
|
|
18808
16984
|
let follow = true;
|
|
18809
|
-
for (let i3 = 0; i3 < block.length &&
|
|
16985
|
+
for (let i3 = 0; i3 < block.length && isBoolean(follow); i3++) {
|
|
18810
16986
|
const locale2 = block[i3];
|
|
18811
|
-
if (
|
|
16987
|
+
if (isString$1(locale2)) {
|
|
18812
16988
|
follow = appendLocaleToChain(chain, block[i3], blocks);
|
|
18813
16989
|
}
|
|
18814
16990
|
}
|
|
@@ -18832,7 +17008,7 @@ function appendItemToChain(chain, target, blocks) {
|
|
|
18832
17008
|
follow = target[target.length - 1] !== "!";
|
|
18833
17009
|
const locale2 = target.replace(/!/g, "");
|
|
18834
17010
|
chain.push(locale2);
|
|
18835
|
-
if ((
|
|
17011
|
+
if ((isArray$2(blocks) || isPlainObject(blocks)) && blocks[locale2]) {
|
|
18836
17012
|
follow = blocks[locale2];
|
|
18837
17013
|
}
|
|
18838
17014
|
}
|
|
@@ -18847,13 +17023,13 @@ const capitalize = (str) => `${str.charAt(0).toLocaleUpperCase()}${str.substr(1)
|
|
|
18847
17023
|
function getDefaultLinkedModifiers() {
|
|
18848
17024
|
return {
|
|
18849
17025
|
upper: (val, type) => {
|
|
18850
|
-
return type === "text" &&
|
|
17026
|
+
return type === "text" && isString$1(val) ? val.toUpperCase() : type === "vnode" && isObject$4(val) && "__v_isVNode" in val ? val.children.toUpperCase() : val;
|
|
18851
17027
|
},
|
|
18852
17028
|
lower: (val, type) => {
|
|
18853
|
-
return type === "text" &&
|
|
17029
|
+
return type === "text" && isString$1(val) ? val.toLowerCase() : type === "vnode" && isObject$4(val) && "__v_isVNode" in val ? val.children.toLowerCase() : val;
|
|
18854
17030
|
},
|
|
18855
17031
|
capitalize: (val, type) => {
|
|
18856
|
-
return type === "text" &&
|
|
17032
|
+
return type === "text" && isString$1(val) ? capitalize(val) : type === "vnode" && isObject$4(val) && "__v_isVNode" in val ? capitalize(val.children) : val;
|
|
18857
17033
|
}
|
|
18858
17034
|
};
|
|
18859
17035
|
}
|
|
@@ -18881,32 +17057,32 @@ const setFallbackContext = (context) => {
|
|
|
18881
17057
|
const getFallbackContext = () => _fallbackContext;
|
|
18882
17058
|
let _cid = 0;
|
|
18883
17059
|
function createCoreContext(options = {}) {
|
|
18884
|
-
const version2 =
|
|
18885
|
-
const locale2 =
|
|
18886
|
-
const fallbackLocale =
|
|
18887
|
-
const messages =
|
|
18888
|
-
const datetimeFormats =
|
|
18889
|
-
const numberFormats =
|
|
18890
|
-
const modifiers =
|
|
17060
|
+
const version2 = isString$1(options.version) ? options.version : VERSION$1;
|
|
17061
|
+
const locale2 = isString$1(options.locale) ? options.locale : DEFAULT_LOCALE$1;
|
|
17062
|
+
const fallbackLocale = isArray$2(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || isString$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale2;
|
|
17063
|
+
const messages = isPlainObject(options.messages) ? options.messages : { [locale2]: {} };
|
|
17064
|
+
const datetimeFormats = isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [locale2]: {} };
|
|
17065
|
+
const numberFormats = isPlainObject(options.numberFormats) ? options.numberFormats : { [locale2]: {} };
|
|
17066
|
+
const modifiers = assign({}, options.modifiers || {}, getDefaultLinkedModifiers());
|
|
18891
17067
|
const pluralRules = options.pluralRules || {};
|
|
18892
|
-
const missing =
|
|
18893
|
-
const missingWarn =
|
|
18894
|
-
const fallbackWarn =
|
|
17068
|
+
const missing = isFunction$1(options.missing) ? options.missing : null;
|
|
17069
|
+
const missingWarn = isBoolean(options.missingWarn) || isRegExp$1(options.missingWarn) ? options.missingWarn : true;
|
|
17070
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp$1(options.fallbackWarn) ? options.fallbackWarn : true;
|
|
18895
17071
|
const fallbackFormat = !!options.fallbackFormat;
|
|
18896
17072
|
const unresolving = !!options.unresolving;
|
|
18897
|
-
const postTranslation =
|
|
18898
|
-
const processor =
|
|
18899
|
-
const warnHtmlMessage =
|
|
17073
|
+
const postTranslation = isFunction$1(options.postTranslation) ? options.postTranslation : null;
|
|
17074
|
+
const processor = isPlainObject(options.processor) ? options.processor : null;
|
|
17075
|
+
const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
|
|
18900
17076
|
const escapeParameter = !!options.escapeParameter;
|
|
18901
|
-
const
|
|
18902
|
-
const messageResolver =
|
|
18903
|
-
const localeFallbacker =
|
|
18904
|
-
const fallbackContext =
|
|
18905
|
-
const onWarn =
|
|
17077
|
+
const messageCompiler = isFunction$1(options.messageCompiler) ? options.messageCompiler : _compiler;
|
|
17078
|
+
const messageResolver = isFunction$1(options.messageResolver) ? options.messageResolver : _resolver || resolveWithKeyValue;
|
|
17079
|
+
const localeFallbacker = isFunction$1(options.localeFallbacker) ? options.localeFallbacker : _fallbacker || fallbackWithSimple;
|
|
17080
|
+
const fallbackContext = isObject$4(options.fallbackContext) ? options.fallbackContext : void 0;
|
|
17081
|
+
const onWarn = isFunction$1(options.onWarn) ? options.onWarn : warn$1;
|
|
18906
17082
|
const internalOptions = options;
|
|
18907
|
-
const __datetimeFormatters =
|
|
18908
|
-
const __numberFormatters =
|
|
18909
|
-
const __meta =
|
|
17083
|
+
const __datetimeFormatters = isObject$4(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
|
|
17084
|
+
const __numberFormatters = isObject$4(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
|
|
17085
|
+
const __meta = isObject$4(internalOptions.__meta) ? internalOptions.__meta : {};
|
|
18910
17086
|
_cid++;
|
|
18911
17087
|
const context = {
|
|
18912
17088
|
version: version2,
|
|
@@ -18925,7 +17101,7 @@ function createCoreContext(options = {}) {
|
|
|
18925
17101
|
processor,
|
|
18926
17102
|
warnHtmlMessage,
|
|
18927
17103
|
escapeParameter,
|
|
18928
|
-
messageCompiler
|
|
17104
|
+
messageCompiler,
|
|
18929
17105
|
messageResolver,
|
|
18930
17106
|
localeFallbacker,
|
|
18931
17107
|
fallbackContext,
|
|
@@ -18967,7 +17143,7 @@ function handleMissing(context, key, locale2, missingWarn, type) {
|
|
|
18967
17143
|
}
|
|
18968
17144
|
if (missing !== null) {
|
|
18969
17145
|
const ret = missing(context, locale2, key, type);
|
|
18970
|
-
return
|
|
17146
|
+
return isString$1(ret) ? ret : key;
|
|
18971
17147
|
} else {
|
|
18972
17148
|
if (isTranslateMissingWarn(missingWarn, key)) {
|
|
18973
17149
|
onWarn(getWarnMessage$1(CoreWarnCodes.NOT_FOUND_KEY, { key, locale: locale2 }));
|
|
@@ -18983,16 +17159,13 @@ function updateFallbackLocale(ctx, locale2, fallback) {
|
|
|
18983
17159
|
const RE_HTML_TAG = /<\/?[\w\s="/.':;#-\/]+>/;
|
|
18984
17160
|
const WARN_MESSAGE = `Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.`;
|
|
18985
17161
|
function checkHtmlMessage(source2, options) {
|
|
18986
|
-
const warnHtmlMessage =
|
|
17162
|
+
const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
|
|
18987
17163
|
if (warnHtmlMessage && RE_HTML_TAG.test(source2)) {
|
|
18988
|
-
|
|
17164
|
+
warn$1(format$2(WARN_MESSAGE, { source: source2 }));
|
|
18989
17165
|
}
|
|
18990
17166
|
}
|
|
18991
17167
|
const defaultOnCacheKey = (source2) => source2;
|
|
18992
17168
|
let compileCache = /* @__PURE__ */ Object.create(null);
|
|
18993
|
-
function clearCompileCache() {
|
|
18994
|
-
compileCache = /* @__PURE__ */ Object.create(null);
|
|
18995
|
-
}
|
|
18996
17169
|
function compileToFunction(source2, options = {}) {
|
|
18997
17170
|
{
|
|
18998
17171
|
checkHtmlMessage(source2, options);
|
|
@@ -19003,17 +17176,17 @@ function compileToFunction(source2, options = {}) {
|
|
|
19003
17176
|
return cached;
|
|
19004
17177
|
}
|
|
19005
17178
|
let occurred = false;
|
|
19006
|
-
const onError = options.onError ||
|
|
17179
|
+
const onError = options.onError || defaultOnError;
|
|
19007
17180
|
options.onError = (err) => {
|
|
19008
17181
|
occurred = true;
|
|
19009
17182
|
onError(err);
|
|
19010
17183
|
};
|
|
19011
|
-
const { code: code2 } =
|
|
17184
|
+
const { code: code2 } = baseCompile(source2, options);
|
|
19012
17185
|
const msg = new Function(`return ${code2}`)();
|
|
19013
17186
|
return !occurred ? compileCache[key] = msg : msg;
|
|
19014
17187
|
}
|
|
19015
17188
|
}
|
|
19016
|
-
let code$2 =
|
|
17189
|
+
let code$2 = CompileErrorCodes.__EXTEND_POINT__;
|
|
19017
17190
|
const inc$2 = () => ++code$2;
|
|
19018
17191
|
const CoreErrorCodes = {
|
|
19019
17192
|
INVALID_ARGUMENT: code$2,
|
|
@@ -19022,7 +17195,7 @@ const CoreErrorCodes = {
|
|
|
19022
17195
|
__EXTEND_POINT__: inc$2()
|
|
19023
17196
|
};
|
|
19024
17197
|
function createCoreError(code2) {
|
|
19025
|
-
return
|
|
17198
|
+
return createCompileError(code2, null, { messages: errorMessages$1 });
|
|
19026
17199
|
}
|
|
19027
17200
|
const errorMessages$1 = {
|
|
19028
17201
|
[CoreErrorCodes.INVALID_ARGUMENT]: "Invalid arguments",
|
|
@@ -19030,17 +17203,17 @@ const errorMessages$1 = {
|
|
|
19030
17203
|
[CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string"
|
|
19031
17204
|
};
|
|
19032
17205
|
const NOOP_MESSAGE_FUNCTION = () => "";
|
|
19033
|
-
const isMessageFunction = (val) =>
|
|
17206
|
+
const isMessageFunction = (val) => isFunction$1(val);
|
|
19034
17207
|
function translate$1(context, ...args) {
|
|
19035
|
-
const { fallbackFormat, postTranslation, unresolving, messageCompiler
|
|
17208
|
+
const { fallbackFormat, postTranslation, unresolving, messageCompiler, fallbackLocale, messages } = context;
|
|
19036
17209
|
const [key, options] = parseTranslateArgs(...args);
|
|
19037
|
-
const missingWarn =
|
|
19038
|
-
const fallbackWarn =
|
|
19039
|
-
const escapeParameter =
|
|
17210
|
+
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
|
|
17211
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
|
|
17212
|
+
const escapeParameter = isBoolean(options.escapeParameter) ? options.escapeParameter : context.escapeParameter;
|
|
19040
17213
|
const resolvedMessage = !!options.resolvedMessage;
|
|
19041
|
-
const defaultMsgOrKey =
|
|
17214
|
+
const defaultMsgOrKey = isString$1(options.default) || isBoolean(options.default) ? !isBoolean(options.default) ? options.default : !messageCompiler ? () => key : key : fallbackFormat ? !messageCompiler ? () => key : key : "";
|
|
19042
17215
|
const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== "";
|
|
19043
|
-
const locale2 =
|
|
17216
|
+
const locale2 = isString$1(options.locale) ? options.locale : context.locale;
|
|
19044
17217
|
escapeParameter && escapeParams(options);
|
|
19045
17218
|
let [formatScope, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale2, fallbackLocale, fallbackWarn, missingWarn) : [
|
|
19046
17219
|
key,
|
|
@@ -19049,17 +17222,17 @@ function translate$1(context, ...args) {
|
|
|
19049
17222
|
];
|
|
19050
17223
|
let format2 = formatScope;
|
|
19051
17224
|
let cacheBaseKey = key;
|
|
19052
|
-
if (!resolvedMessage && !(
|
|
17225
|
+
if (!resolvedMessage && !(isString$1(format2) || isMessageFunction(format2))) {
|
|
19053
17226
|
if (enableDefaultMsg) {
|
|
19054
17227
|
format2 = defaultMsgOrKey;
|
|
19055
17228
|
cacheBaseKey = format2;
|
|
19056
17229
|
}
|
|
19057
17230
|
}
|
|
19058
|
-
if (!resolvedMessage && (!(
|
|
17231
|
+
if (!resolvedMessage && (!(isString$1(format2) || isMessageFunction(format2)) || !isString$1(targetLocale))) {
|
|
19059
17232
|
return unresolving ? NOT_REOSLVED : key;
|
|
19060
17233
|
}
|
|
19061
|
-
if (
|
|
19062
|
-
|
|
17234
|
+
if (isString$1(format2) && context.messageCompiler == null) {
|
|
17235
|
+
warn$1(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${key}'.`);
|
|
19063
17236
|
return key;
|
|
19064
17237
|
}
|
|
19065
17238
|
let occurred = false;
|
|
@@ -19077,23 +17250,23 @@ function translate$1(context, ...args) {
|
|
|
19077
17250
|
{
|
|
19078
17251
|
const payloads = {
|
|
19079
17252
|
timestamp: Date.now(),
|
|
19080
|
-
key:
|
|
17253
|
+
key: isString$1(key) ? key : isMessageFunction(format2) ? format2.key : "",
|
|
19081
17254
|
locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
|
|
19082
|
-
format:
|
|
17255
|
+
format: isString$1(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
|
|
19083
17256
|
message: ret
|
|
19084
17257
|
};
|
|
19085
|
-
payloads.meta =
|
|
17258
|
+
payloads.meta = assign({}, context.__meta, getAdditionalMeta() || {});
|
|
19086
17259
|
translateDevTools(payloads);
|
|
19087
17260
|
}
|
|
19088
17261
|
return ret;
|
|
19089
17262
|
}
|
|
19090
17263
|
function escapeParams(options) {
|
|
19091
|
-
if (
|
|
19092
|
-
options.list = options.list.map((item) =>
|
|
19093
|
-
} else if (
|
|
17264
|
+
if (isArray$2(options.list)) {
|
|
17265
|
+
options.list = options.list.map((item) => isString$1(item) ? escapeHtml(item) : item);
|
|
17266
|
+
} else if (isObject$4(options.named)) {
|
|
19094
17267
|
Object.keys(options.named).forEach((key) => {
|
|
19095
|
-
if (
|
|
19096
|
-
options.named[key] =
|
|
17268
|
+
if (isString$1(options.named[key])) {
|
|
17269
|
+
options.named[key] = escapeHtml(options.named[key]);
|
|
19097
17270
|
}
|
|
19098
17271
|
});
|
|
19099
17272
|
}
|
|
@@ -19131,16 +17304,16 @@ function resolveMessageFormat(context, key, locale2, fallbackLocale, fallbackWar
|
|
|
19131
17304
|
let start2 = null;
|
|
19132
17305
|
let startTag;
|
|
19133
17306
|
let endTag;
|
|
19134
|
-
if (
|
|
17307
|
+
if (inBrowser) {
|
|
19135
17308
|
start2 = window.performance.now();
|
|
19136
17309
|
startTag = "intlify-message-resolve-start";
|
|
19137
17310
|
endTag = "intlify-message-resolve-end";
|
|
19138
|
-
|
|
17311
|
+
mark && mark(startTag);
|
|
19139
17312
|
}
|
|
19140
17313
|
if ((format2 = resolveValue2(message, key)) === null) {
|
|
19141
17314
|
format2 = message[key];
|
|
19142
17315
|
}
|
|
19143
|
-
if (
|
|
17316
|
+
if (inBrowser) {
|
|
19144
17317
|
const end2 = window.performance.now();
|
|
19145
17318
|
const emitter = context.__v_emitter;
|
|
19146
17319
|
if (emitter && start2 && format2) {
|
|
@@ -19152,12 +17325,12 @@ function resolveMessageFormat(context, key, locale2, fallbackLocale, fallbackWar
|
|
|
19152
17325
|
groupId: `${type}:${key}`
|
|
19153
17326
|
});
|
|
19154
17327
|
}
|
|
19155
|
-
if (startTag && endTag &&
|
|
19156
|
-
|
|
19157
|
-
|
|
17328
|
+
if (startTag && endTag && mark && measure) {
|
|
17329
|
+
mark(endTag);
|
|
17330
|
+
measure("intlify message resolve", startTag, endTag);
|
|
19158
17331
|
}
|
|
19159
17332
|
}
|
|
19160
|
-
if (
|
|
17333
|
+
if (isString$1(format2) || isFunction$1(format2))
|
|
19161
17334
|
break;
|
|
19162
17335
|
const missingRet = handleMissing(
|
|
19163
17336
|
context,
|
|
@@ -19174,14 +17347,14 @@ function resolveMessageFormat(context, key, locale2, fallbackLocale, fallbackWar
|
|
|
19174
17347
|
return [format2, targetLocale, message];
|
|
19175
17348
|
}
|
|
19176
17349
|
function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) {
|
|
19177
|
-
const { messageCompiler
|
|
17350
|
+
const { messageCompiler, warnHtmlMessage } = context;
|
|
19178
17351
|
if (isMessageFunction(format2)) {
|
|
19179
17352
|
const msg2 = format2;
|
|
19180
17353
|
msg2.locale = msg2.locale || targetLocale;
|
|
19181
17354
|
msg2.key = msg2.key || key;
|
|
19182
17355
|
return msg2;
|
|
19183
17356
|
}
|
|
19184
|
-
if (
|
|
17357
|
+
if (messageCompiler == null) {
|
|
19185
17358
|
const msg2 = () => format2;
|
|
19186
17359
|
msg2.locale = targetLocale;
|
|
19187
17360
|
msg2.key = key;
|
|
@@ -19190,14 +17363,14 @@ function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey,
|
|
|
19190
17363
|
let start2 = null;
|
|
19191
17364
|
let startTag;
|
|
19192
17365
|
let endTag;
|
|
19193
|
-
if (
|
|
17366
|
+
if (inBrowser) {
|
|
19194
17367
|
start2 = window.performance.now();
|
|
19195
17368
|
startTag = "intlify-message-compilation-start";
|
|
19196
17369
|
endTag = "intlify-message-compilation-end";
|
|
19197
|
-
|
|
17370
|
+
mark && mark(startTag);
|
|
19198
17371
|
}
|
|
19199
|
-
const msg =
|
|
19200
|
-
if (
|
|
17372
|
+
const msg = messageCompiler(format2, getCompileOptions(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, errorDetector));
|
|
17373
|
+
if (inBrowser) {
|
|
19201
17374
|
const end2 = window.performance.now();
|
|
19202
17375
|
const emitter = context.__v_emitter;
|
|
19203
17376
|
if (emitter && start2) {
|
|
@@ -19208,9 +17381,9 @@ function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey,
|
|
|
19208
17381
|
groupId: `${"translate"}:${key}`
|
|
19209
17382
|
});
|
|
19210
17383
|
}
|
|
19211
|
-
if (startTag && endTag &&
|
|
19212
|
-
|
|
19213
|
-
|
|
17384
|
+
if (startTag && endTag && mark && measure) {
|
|
17385
|
+
mark(endTag);
|
|
17386
|
+
measure("intlify message compilation", startTag, endTag);
|
|
19214
17387
|
}
|
|
19215
17388
|
}
|
|
19216
17389
|
msg.locale = targetLocale;
|
|
@@ -19222,14 +17395,14 @@ function evaluateMessage(context, msg, msgCtx) {
|
|
|
19222
17395
|
let start2 = null;
|
|
19223
17396
|
let startTag;
|
|
19224
17397
|
let endTag;
|
|
19225
|
-
if (
|
|
17398
|
+
if (inBrowser) {
|
|
19226
17399
|
start2 = window.performance.now();
|
|
19227
17400
|
startTag = "intlify-message-evaluation-start";
|
|
19228
17401
|
endTag = "intlify-message-evaluation-end";
|
|
19229
|
-
|
|
17402
|
+
mark && mark(startTag);
|
|
19230
17403
|
}
|
|
19231
17404
|
const messaged = msg(msgCtx);
|
|
19232
|
-
if (
|
|
17405
|
+
if (inBrowser) {
|
|
19233
17406
|
const end2 = window.performance.now();
|
|
19234
17407
|
const emitter = context.__v_emitter;
|
|
19235
17408
|
if (emitter && start2) {
|
|
@@ -19240,9 +17413,9 @@ function evaluateMessage(context, msg, msgCtx) {
|
|
|
19240
17413
|
groupId: `${"translate"}:${msg.key}`
|
|
19241
17414
|
});
|
|
19242
17415
|
}
|
|
19243
|
-
if (startTag && endTag &&
|
|
19244
|
-
|
|
19245
|
-
|
|
17416
|
+
if (startTag && endTag && mark && measure) {
|
|
17417
|
+
mark(endTag);
|
|
17418
|
+
measure("intlify message evaluation", startTag, endTag);
|
|
19246
17419
|
}
|
|
19247
17420
|
}
|
|
19248
17421
|
return messaged;
|
|
@@ -19250,25 +17423,25 @@ function evaluateMessage(context, msg, msgCtx) {
|
|
|
19250
17423
|
function parseTranslateArgs(...args) {
|
|
19251
17424
|
const [arg1, arg2, arg3] = args;
|
|
19252
17425
|
const options = {};
|
|
19253
|
-
if (!
|
|
17426
|
+
if (!isString$1(arg1) && !isNumber$1(arg1) && !isMessageFunction(arg1)) {
|
|
19254
17427
|
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
|
19255
17428
|
}
|
|
19256
|
-
const key =
|
|
19257
|
-
if (
|
|
17429
|
+
const key = isNumber$1(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
|
|
17430
|
+
if (isNumber$1(arg2)) {
|
|
19258
17431
|
options.plural = arg2;
|
|
19259
|
-
} else if (
|
|
17432
|
+
} else if (isString$1(arg2)) {
|
|
19260
17433
|
options.default = arg2;
|
|
19261
|
-
} else if (
|
|
17434
|
+
} else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {
|
|
19262
17435
|
options.named = arg2;
|
|
19263
|
-
} else if (
|
|
17436
|
+
} else if (isArray$2(arg2)) {
|
|
19264
17437
|
options.list = arg2;
|
|
19265
17438
|
}
|
|
19266
|
-
if (
|
|
17439
|
+
if (isNumber$1(arg3)) {
|
|
19267
17440
|
options.plural = arg3;
|
|
19268
|
-
} else if (
|
|
17441
|
+
} else if (isString$1(arg3)) {
|
|
19269
17442
|
options.default = arg3;
|
|
19270
|
-
} else if (
|
|
19271
|
-
|
|
17443
|
+
} else if (isPlainObject(arg3)) {
|
|
17444
|
+
assign(options, arg3);
|
|
19272
17445
|
}
|
|
19273
17446
|
return [key, options];
|
|
19274
17447
|
}
|
|
@@ -19279,7 +17452,7 @@ function getCompileOptions(context, locale2, key, source2, warnHtmlMessage, erro
|
|
|
19279
17452
|
errorDetector && errorDetector(err);
|
|
19280
17453
|
{
|
|
19281
17454
|
const message = `Message compilation error: ${err.message}`;
|
|
19282
|
-
const codeFrame = err.location &&
|
|
17455
|
+
const codeFrame = err.location && generateCodeFrame(source2, err.location.start.offset, err.location.end.offset);
|
|
19283
17456
|
const emitter = context.__v_emitter;
|
|
19284
17457
|
if (emitter) {
|
|
19285
17458
|
emitter.emit("compile-error", {
|
|
@@ -19294,7 +17467,7 @@ function getCompileOptions(context, locale2, key, source2, warnHtmlMessage, erro
|
|
|
19294
17467
|
${codeFrame}` : message);
|
|
19295
17468
|
}
|
|
19296
17469
|
},
|
|
19297
|
-
onCacheKey: (source3) =>
|
|
17470
|
+
onCacheKey: (source3) => generateFormatCacheKey(locale2, key, source3)
|
|
19298
17471
|
};
|
|
19299
17472
|
}
|
|
19300
17473
|
function getMessageContextOptions(context, locale2, message, options) {
|
|
@@ -19305,7 +17478,7 @@ function getMessageContextOptions(context, locale2, message, options) {
|
|
|
19305
17478
|
const [, , message2] = resolveMessageFormat(fallbackContext, key, locale2, fallbackLocale, fallbackWarn, missingWarn);
|
|
19306
17479
|
val = resolveValue2(message2, key);
|
|
19307
17480
|
}
|
|
19308
|
-
if (
|
|
17481
|
+
if (isString$1(val)) {
|
|
19309
17482
|
let occurred = false;
|
|
19310
17483
|
const errorDetector = () => {
|
|
19311
17484
|
occurred = true;
|
|
@@ -19333,7 +17506,7 @@ function getMessageContextOptions(context, locale2, message, options) {
|
|
|
19333
17506
|
if (options.named) {
|
|
19334
17507
|
ctxOptions.named = options.named;
|
|
19335
17508
|
}
|
|
19336
|
-
if (
|
|
17509
|
+
if (isNumber$1(options.plural)) {
|
|
19337
17510
|
ctxOptions.pluralIndex = options.plural;
|
|
19338
17511
|
}
|
|
19339
17512
|
return ctxOptions;
|
|
@@ -19351,16 +17524,16 @@ function datetime(context, ...args) {
|
|
|
19351
17524
|
return MISSING_RESOLVE_VALUE;
|
|
19352
17525
|
}
|
|
19353
17526
|
const [key, value, options, overrides] = parseDateTimeArgs(...args);
|
|
19354
|
-
const missingWarn =
|
|
19355
|
-
const fallbackWarn =
|
|
17527
|
+
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
|
|
17528
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
|
|
19356
17529
|
const part = !!options.part;
|
|
19357
|
-
const locale2 =
|
|
17530
|
+
const locale2 = isString$1(options.locale) ? options.locale : context.locale;
|
|
19358
17531
|
const locales = localeFallbacker(
|
|
19359
17532
|
context,
|
|
19360
17533
|
fallbackLocale,
|
|
19361
17534
|
locale2
|
|
19362
17535
|
);
|
|
19363
|
-
if (!
|
|
17536
|
+
if (!isString$1(key) || key === "") {
|
|
19364
17537
|
return new Intl.DateTimeFormat(locale2, overrides).format(value);
|
|
19365
17538
|
}
|
|
19366
17539
|
let datetimeFormat = {};
|
|
@@ -19391,21 +17564,21 @@ function datetime(context, ...args) {
|
|
|
19391
17564
|
}
|
|
19392
17565
|
datetimeFormat = datetimeFormats[targetLocale] || {};
|
|
19393
17566
|
format2 = datetimeFormat[key];
|
|
19394
|
-
if (
|
|
17567
|
+
if (isPlainObject(format2))
|
|
19395
17568
|
break;
|
|
19396
17569
|
handleMissing(context, key, targetLocale, missingWarn, type);
|
|
19397
17570
|
from = to;
|
|
19398
17571
|
}
|
|
19399
|
-
if (!
|
|
17572
|
+
if (!isPlainObject(format2) || !isString$1(targetLocale)) {
|
|
19400
17573
|
return unresolving ? NOT_REOSLVED : key;
|
|
19401
17574
|
}
|
|
19402
17575
|
let id = `${targetLocale}__${key}`;
|
|
19403
|
-
if (!
|
|
17576
|
+
if (!isEmptyObject(overrides)) {
|
|
19404
17577
|
id = `${id}__${JSON.stringify(overrides)}`;
|
|
19405
17578
|
}
|
|
19406
17579
|
let formatter = __datetimeFormatters.get(id);
|
|
19407
17580
|
if (!formatter) {
|
|
19408
|
-
formatter = new Intl.DateTimeFormat(targetLocale,
|
|
17581
|
+
formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format2, overrides));
|
|
19409
17582
|
__datetimeFormatters.set(id, formatter);
|
|
19410
17583
|
}
|
|
19411
17584
|
return !part ? formatter.format(value) : formatter.formatToParts(value);
|
|
@@ -19437,7 +17610,7 @@ function parseDateTimeArgs(...args) {
|
|
|
19437
17610
|
const options = {};
|
|
19438
17611
|
let overrides = {};
|
|
19439
17612
|
let value;
|
|
19440
|
-
if (
|
|
17613
|
+
if (isString$1(arg1)) {
|
|
19441
17614
|
const matches2 = arg1.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
|
|
19442
17615
|
if (!matches2) {
|
|
19443
17616
|
throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
|
|
@@ -19449,19 +17622,19 @@ function parseDateTimeArgs(...args) {
|
|
|
19449
17622
|
} catch (e3) {
|
|
19450
17623
|
throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
|
|
19451
17624
|
}
|
|
19452
|
-
} else if (
|
|
17625
|
+
} else if (isDate(arg1)) {
|
|
19453
17626
|
if (isNaN(arg1.getTime())) {
|
|
19454
17627
|
throw createCoreError(CoreErrorCodes.INVALID_DATE_ARGUMENT);
|
|
19455
17628
|
}
|
|
19456
17629
|
value = arg1;
|
|
19457
|
-
} else if (
|
|
17630
|
+
} else if (isNumber$1(arg1)) {
|
|
19458
17631
|
value = arg1;
|
|
19459
17632
|
} else {
|
|
19460
17633
|
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
|
19461
17634
|
}
|
|
19462
|
-
if (
|
|
17635
|
+
if (isString$1(arg2)) {
|
|
19463
17636
|
options.key = arg2;
|
|
19464
|
-
} else if (
|
|
17637
|
+
} else if (isPlainObject(arg2)) {
|
|
19465
17638
|
Object.keys(arg2).forEach((key) => {
|
|
19466
17639
|
if (DATETIME_FORMAT_OPTIONS_KEYS.includes(key)) {
|
|
19467
17640
|
overrides[key] = arg2[key];
|
|
@@ -19470,12 +17643,12 @@ function parseDateTimeArgs(...args) {
|
|
|
19470
17643
|
}
|
|
19471
17644
|
});
|
|
19472
17645
|
}
|
|
19473
|
-
if (
|
|
17646
|
+
if (isString$1(arg3)) {
|
|
19474
17647
|
options.locale = arg3;
|
|
19475
|
-
} else if (
|
|
17648
|
+
} else if (isPlainObject(arg3)) {
|
|
19476
17649
|
overrides = arg3;
|
|
19477
17650
|
}
|
|
19478
|
-
if (
|
|
17651
|
+
if (isPlainObject(arg4)) {
|
|
19479
17652
|
overrides = arg4;
|
|
19480
17653
|
}
|
|
19481
17654
|
return [options.key || "", value, options, overrides];
|
|
@@ -19498,16 +17671,16 @@ function number$1(context, ...args) {
|
|
|
19498
17671
|
return MISSING_RESOLVE_VALUE;
|
|
19499
17672
|
}
|
|
19500
17673
|
const [key, value, options, overrides] = parseNumberArgs(...args);
|
|
19501
|
-
const missingWarn =
|
|
19502
|
-
const fallbackWarn =
|
|
17674
|
+
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
|
|
17675
|
+
const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
|
|
19503
17676
|
const part = !!options.part;
|
|
19504
|
-
const locale2 =
|
|
17677
|
+
const locale2 = isString$1(options.locale) ? options.locale : context.locale;
|
|
19505
17678
|
const locales = localeFallbacker(
|
|
19506
17679
|
context,
|
|
19507
17680
|
fallbackLocale,
|
|
19508
17681
|
locale2
|
|
19509
17682
|
);
|
|
19510
|
-
if (!
|
|
17683
|
+
if (!isString$1(key) || key === "") {
|
|
19511
17684
|
return new Intl.NumberFormat(locale2, overrides).format(value);
|
|
19512
17685
|
}
|
|
19513
17686
|
let numberFormat = {};
|
|
@@ -19538,21 +17711,21 @@ function number$1(context, ...args) {
|
|
|
19538
17711
|
}
|
|
19539
17712
|
numberFormat = numberFormats[targetLocale] || {};
|
|
19540
17713
|
format2 = numberFormat[key];
|
|
19541
|
-
if (
|
|
17714
|
+
if (isPlainObject(format2))
|
|
19542
17715
|
break;
|
|
19543
17716
|
handleMissing(context, key, targetLocale, missingWarn, type);
|
|
19544
17717
|
from = to;
|
|
19545
17718
|
}
|
|
19546
|
-
if (!
|
|
17719
|
+
if (!isPlainObject(format2) || !isString$1(targetLocale)) {
|
|
19547
17720
|
return unresolving ? NOT_REOSLVED : key;
|
|
19548
17721
|
}
|
|
19549
17722
|
let id = `${targetLocale}__${key}`;
|
|
19550
|
-
if (!
|
|
17723
|
+
if (!isEmptyObject(overrides)) {
|
|
19551
17724
|
id = `${id}__${JSON.stringify(overrides)}`;
|
|
19552
17725
|
}
|
|
19553
17726
|
let formatter = __numberFormatters.get(id);
|
|
19554
17727
|
if (!formatter) {
|
|
19555
|
-
formatter = new Intl.NumberFormat(targetLocale,
|
|
17728
|
+
formatter = new Intl.NumberFormat(targetLocale, assign({}, format2, overrides));
|
|
19556
17729
|
__numberFormatters.set(id, formatter);
|
|
19557
17730
|
}
|
|
19558
17731
|
return !part ? formatter.format(value) : formatter.formatToParts(value);
|
|
@@ -19583,13 +17756,13 @@ function parseNumberArgs(...args) {
|
|
|
19583
17756
|
const [arg1, arg2, arg3, arg4] = args;
|
|
19584
17757
|
const options = {};
|
|
19585
17758
|
let overrides = {};
|
|
19586
|
-
if (!
|
|
17759
|
+
if (!isNumber$1(arg1)) {
|
|
19587
17760
|
throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
|
|
19588
17761
|
}
|
|
19589
17762
|
const value = arg1;
|
|
19590
|
-
if (
|
|
17763
|
+
if (isString$1(arg2)) {
|
|
19591
17764
|
options.key = arg2;
|
|
19592
|
-
} else if (
|
|
17765
|
+
} else if (isPlainObject(arg2)) {
|
|
19593
17766
|
Object.keys(arg2).forEach((key) => {
|
|
19594
17767
|
if (NUMBER_FORMAT_OPTIONS_KEYS.includes(key)) {
|
|
19595
17768
|
overrides[key] = arg2[key];
|
|
@@ -19598,12 +17771,12 @@ function parseNumberArgs(...args) {
|
|
|
19598
17771
|
}
|
|
19599
17772
|
});
|
|
19600
17773
|
}
|
|
19601
|
-
if (
|
|
17774
|
+
if (isString$1(arg3)) {
|
|
19602
17775
|
options.locale = arg3;
|
|
19603
|
-
} else if (
|
|
17776
|
+
} else if (isPlainObject(arg3)) {
|
|
19604
17777
|
overrides = arg3;
|
|
19605
17778
|
}
|
|
19606
|
-
if (
|
|
17779
|
+
if (isPlainObject(arg4)) {
|
|
19607
17780
|
overrides = arg4;
|
|
19608
17781
|
}
|
|
19609
17782
|
return [options.key || "", value, options, overrides];
|
|
@@ -19618,66 +17791,51 @@ function clearNumberFormat(ctx, locale2, format2) {
|
|
|
19618
17791
|
context.__numberFormatters.delete(id);
|
|
19619
17792
|
}
|
|
19620
17793
|
}
|
|
19621
|
-
coreBase_cjs.CompileErrorCodes = messageCompiler.CompileErrorCodes;
|
|
19622
|
-
coreBase_cjs.createCompileError = messageCompiler.createCompileError;
|
|
19623
|
-
coreBase_cjs.CoreErrorCodes = CoreErrorCodes;
|
|
19624
|
-
coreBase_cjs.CoreWarnCodes = CoreWarnCodes;
|
|
19625
|
-
coreBase_cjs.DATETIME_FORMAT_OPTIONS_KEYS = DATETIME_FORMAT_OPTIONS_KEYS;
|
|
19626
|
-
coreBase_cjs.DEFAULT_LOCALE = DEFAULT_LOCALE$1;
|
|
19627
|
-
coreBase_cjs.DEFAULT_MESSAGE_DATA_TYPE = DEFAULT_MESSAGE_DATA_TYPE;
|
|
19628
|
-
coreBase_cjs.MISSING_RESOLVE_VALUE = MISSING_RESOLVE_VALUE;
|
|
19629
|
-
coreBase_cjs.NOT_REOSLVED = NOT_REOSLVED;
|
|
19630
|
-
coreBase_cjs.NUMBER_FORMAT_OPTIONS_KEYS = NUMBER_FORMAT_OPTIONS_KEYS;
|
|
19631
|
-
coreBase_cjs.VERSION = VERSION$1;
|
|
19632
|
-
coreBase_cjs.clearCompileCache = clearCompileCache;
|
|
19633
|
-
coreBase_cjs.clearDateTimeFormat = clearDateTimeFormat;
|
|
19634
|
-
coreBase_cjs.clearNumberFormat = clearNumberFormat;
|
|
19635
|
-
coreBase_cjs.compileToFunction = compileToFunction;
|
|
19636
|
-
coreBase_cjs.createCoreContext = createCoreContext;
|
|
19637
|
-
coreBase_cjs.createCoreError = createCoreError;
|
|
19638
|
-
coreBase_cjs.createMessageContext = createMessageContext;
|
|
19639
|
-
coreBase_cjs.datetime = datetime;
|
|
19640
|
-
coreBase_cjs.fallbackWithLocaleChain = fallbackWithLocaleChain;
|
|
19641
|
-
coreBase_cjs.fallbackWithSimple = fallbackWithSimple;
|
|
19642
|
-
coreBase_cjs.getAdditionalMeta = getAdditionalMeta;
|
|
19643
|
-
coreBase_cjs.getDevToolsHook = getDevToolsHook;
|
|
19644
|
-
coreBase_cjs.getFallbackContext = getFallbackContext;
|
|
19645
|
-
coreBase_cjs.getWarnMessage = getWarnMessage$1;
|
|
19646
|
-
coreBase_cjs.handleMissing = handleMissing;
|
|
19647
|
-
coreBase_cjs.initI18nDevTools = initI18nDevTools;
|
|
19648
|
-
coreBase_cjs.isMessageFunction = isMessageFunction;
|
|
19649
|
-
coreBase_cjs.isTranslateFallbackWarn = isTranslateFallbackWarn;
|
|
19650
|
-
coreBase_cjs.isTranslateMissingWarn = isTranslateMissingWarn;
|
|
19651
|
-
coreBase_cjs.number = number$1;
|
|
19652
|
-
coreBase_cjs.parse = parse$1;
|
|
19653
|
-
coreBase_cjs.parseDateTimeArgs = parseDateTimeArgs;
|
|
19654
|
-
coreBase_cjs.parseNumberArgs = parseNumberArgs;
|
|
19655
|
-
coreBase_cjs.parseTranslateArgs = parseTranslateArgs;
|
|
19656
|
-
coreBase_cjs.registerLocaleFallbacker = registerLocaleFallbacker;
|
|
19657
|
-
coreBase_cjs.registerMessageCompiler = registerMessageCompiler;
|
|
19658
|
-
coreBase_cjs.registerMessageResolver = registerMessageResolver;
|
|
19659
|
-
coreBase_cjs.resolveValue = resolveValue;
|
|
19660
|
-
coreBase_cjs.resolveWithKeyValue = resolveWithKeyValue;
|
|
19661
|
-
coreBase_cjs.setAdditionalMeta = setAdditionalMeta;
|
|
19662
|
-
coreBase_cjs.setDevToolsHook = setDevToolsHook;
|
|
19663
|
-
coreBase_cjs.setFallbackContext = setFallbackContext;
|
|
19664
|
-
coreBase_cjs.translate = translate$1;
|
|
19665
|
-
coreBase_cjs.translateDevTools = translateDevTools;
|
|
19666
|
-
coreBase_cjs.updateFallbackLocale = updateFallbackLocale;
|
|
19667
17794
|
{
|
|
19668
|
-
|
|
17795
|
+
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
|
|
17796
|
+
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
|
17797
|
+
}
|
|
19669
17798
|
}
|
|
17799
|
+
/*!
|
|
17800
|
+
* vue-devtools v9.2.2
|
|
17801
|
+
* (c) 2022 kazuya kawaguchi
|
|
17802
|
+
* Released under the MIT License.
|
|
17803
|
+
*/
|
|
17804
|
+
const VueDevToolsLabels = {
|
|
17805
|
+
["vue-devtools-plugin-vue-i18n"]: "Vue I18n devtools",
|
|
17806
|
+
["vue-i18n-resource-inspector"]: "I18n Resources",
|
|
17807
|
+
["vue-i18n-timeline"]: "Vue I18n"
|
|
17808
|
+
};
|
|
17809
|
+
const VueDevToolsPlaceholders = {
|
|
17810
|
+
["vue-i18n-resource-inspector"]: "Search for scopes ..."
|
|
17811
|
+
};
|
|
17812
|
+
const VueDevToolsTimelineColors = {
|
|
17813
|
+
["vue-i18n-timeline"]: 16764185
|
|
17814
|
+
};
|
|
19670
17815
|
/*!
|
|
19671
17816
|
* vue-i18n v9.2.2
|
|
19672
17817
|
* (c) 2022 kazuya kawaguchi
|
|
19673
17818
|
* Released under the MIT License.
|
|
19674
17819
|
*/
|
|
19675
|
-
Object.defineProperty(vueI18n_cjs, "__esModule", { value: true });
|
|
19676
|
-
var shared = shared$3.exports;
|
|
19677
|
-
var coreBase = coreBase$1.exports;
|
|
19678
|
-
var vue = require$$0;
|
|
19679
17820
|
const VERSION = "9.2.2";
|
|
19680
|
-
|
|
17821
|
+
function initFeatureFlags() {
|
|
17822
|
+
let needWarn = false;
|
|
17823
|
+
if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") {
|
|
17824
|
+
needWarn = true;
|
|
17825
|
+
getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;
|
|
17826
|
+
}
|
|
17827
|
+
if (typeof __VUE_I18N_LEGACY_API__ !== "boolean") {
|
|
17828
|
+
needWarn = true;
|
|
17829
|
+
getGlobalThis().__VUE_I18N_LEGACY_API__ = true;
|
|
17830
|
+
}
|
|
17831
|
+
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
|
|
17832
|
+
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
|
17833
|
+
}
|
|
17834
|
+
if (needWarn) {
|
|
17835
|
+
console.warn(`You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.`);
|
|
17836
|
+
}
|
|
17837
|
+
}
|
|
17838
|
+
let code$1 = CoreWarnCodes.__EXTEND_POINT__;
|
|
19681
17839
|
const inc$1 = () => ++code$1;
|
|
19682
17840
|
const I18nWarnCodes = {
|
|
19683
17841
|
FALLBACK_TO_ROOT: code$1,
|
|
@@ -19698,9 +17856,9 @@ const warnMessages = {
|
|
|
19698
17856
|
[I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]: `Not found parent scope. use the global scope.`
|
|
19699
17857
|
};
|
|
19700
17858
|
function getWarnMessage(code2, ...args) {
|
|
19701
|
-
return
|
|
17859
|
+
return format$2(warnMessages[code2], ...args);
|
|
19702
17860
|
}
|
|
19703
|
-
let code =
|
|
17861
|
+
let code = CompileErrorCodes.__EXTEND_POINT__;
|
|
19704
17862
|
const inc = () => ++code;
|
|
19705
17863
|
const I18nErrorCodes = {
|
|
19706
17864
|
UNEXPECTED_RETURN_TYPE: code,
|
|
@@ -19720,7 +17878,7 @@ const I18nErrorCodes = {
|
|
|
19720
17878
|
__EXTEND_POINT__: inc()
|
|
19721
17879
|
};
|
|
19722
17880
|
function createI18nError(code2, ...args) {
|
|
19723
|
-
return
|
|
17881
|
+
return createCompileError(code2, null, { messages: errorMessages, args });
|
|
19724
17882
|
}
|
|
19725
17883
|
const errorMessages = {
|
|
19726
17884
|
[I18nErrorCodes.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
|
|
@@ -19738,25 +17896,24 @@ const errorMessages = {
|
|
|
19738
17896
|
[I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]: "Must define \u2018i18n\u2019 option or custom block in Composition API with using local scope in Legacy API mode",
|
|
19739
17897
|
[I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"
|
|
19740
17898
|
};
|
|
19741
|
-
const TransrateVNodeSymbol = /* @__PURE__ */
|
|
19742
|
-
const DatetimePartsSymbol = /* @__PURE__ */
|
|
19743
|
-
const NumberPartsSymbol = /* @__PURE__ */
|
|
19744
|
-
const EnableEmitter = /* @__PURE__ */
|
|
19745
|
-
const DisableEmitter = /* @__PURE__ */
|
|
19746
|
-
const SetPluralRulesSymbol =
|
|
19747
|
-
|
|
19748
|
-
const InejctWithOption = /* @__PURE__ */
|
|
19749
|
-
const __VUE_I18N_BRIDGE__ = "__VUE_I18N_BRIDGE__";
|
|
17899
|
+
const TransrateVNodeSymbol = /* @__PURE__ */ makeSymbol("__transrateVNode");
|
|
17900
|
+
const DatetimePartsSymbol = /* @__PURE__ */ makeSymbol("__datetimeParts");
|
|
17901
|
+
const NumberPartsSymbol = /* @__PURE__ */ makeSymbol("__numberParts");
|
|
17902
|
+
const EnableEmitter = /* @__PURE__ */ makeSymbol("__enableEmitter");
|
|
17903
|
+
const DisableEmitter = /* @__PURE__ */ makeSymbol("__disableEmitter");
|
|
17904
|
+
const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
|
|
17905
|
+
makeSymbol("__intlifyMeta");
|
|
17906
|
+
const InejctWithOption = /* @__PURE__ */ makeSymbol("__injectWithOption");
|
|
19750
17907
|
function handleFlatJson(obj) {
|
|
19751
|
-
if (!
|
|
17908
|
+
if (!isObject$4(obj)) {
|
|
19752
17909
|
return obj;
|
|
19753
17910
|
}
|
|
19754
17911
|
for (const key in obj) {
|
|
19755
|
-
if (!
|
|
17912
|
+
if (!hasOwn$1(obj, key)) {
|
|
19756
17913
|
continue;
|
|
19757
17914
|
}
|
|
19758
17915
|
if (!key.includes(".")) {
|
|
19759
|
-
if (
|
|
17916
|
+
if (isObject$4(obj[key])) {
|
|
19760
17917
|
handleFlatJson(obj[key]);
|
|
19761
17918
|
}
|
|
19762
17919
|
} else {
|
|
@@ -19771,7 +17928,7 @@ function handleFlatJson(obj) {
|
|
|
19771
17928
|
}
|
|
19772
17929
|
currentObj[subKeys[lastIndex]] = obj[key];
|
|
19773
17930
|
delete obj[key];
|
|
19774
|
-
if (
|
|
17931
|
+
if (isObject$4(currentObj[subKeys[lastIndex]])) {
|
|
19775
17932
|
handleFlatJson(currentObj[subKeys[lastIndex]]);
|
|
19776
17933
|
}
|
|
19777
17934
|
}
|
|
@@ -19780,8 +17937,8 @@ function handleFlatJson(obj) {
|
|
|
19780
17937
|
}
|
|
19781
17938
|
function getLocaleMessages(locale2, options) {
|
|
19782
17939
|
const { messages, __i18n, messageResolver, flatJson } = options;
|
|
19783
|
-
const ret =
|
|
19784
|
-
if (
|
|
17940
|
+
const ret = isPlainObject(messages) ? messages : isArray$2(__i18n) ? {} : { [locale2]: {} };
|
|
17941
|
+
if (isArray$2(__i18n)) {
|
|
19785
17942
|
__i18n.forEach((custom) => {
|
|
19786
17943
|
if ("locale" in custom && "resource" in custom) {
|
|
19787
17944
|
const { locale: locale3, resource } = custom;
|
|
@@ -19792,26 +17949,26 @@ function getLocaleMessages(locale2, options) {
|
|
|
19792
17949
|
deepCopy(resource, ret);
|
|
19793
17950
|
}
|
|
19794
17951
|
} else {
|
|
19795
|
-
|
|
17952
|
+
isString$1(custom) && deepCopy(JSON.parse(custom), ret);
|
|
19796
17953
|
}
|
|
19797
17954
|
});
|
|
19798
17955
|
}
|
|
19799
17956
|
if (messageResolver == null && flatJson) {
|
|
19800
17957
|
for (const key in ret) {
|
|
19801
|
-
if (
|
|
17958
|
+
if (hasOwn$1(ret, key)) {
|
|
19802
17959
|
handleFlatJson(ret[key]);
|
|
19803
17960
|
}
|
|
19804
17961
|
}
|
|
19805
17962
|
}
|
|
19806
17963
|
return ret;
|
|
19807
17964
|
}
|
|
19808
|
-
const isNotObjectOrIsArray = (val) => !
|
|
17965
|
+
const isNotObjectOrIsArray = (val) => !isObject$4(val) || isArray$2(val);
|
|
19809
17966
|
function deepCopy(src, des) {
|
|
19810
17967
|
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
|
|
19811
17968
|
throw createI18nError(I18nErrorCodes.INVALID_VALUE);
|
|
19812
17969
|
}
|
|
19813
17970
|
for (const key in src) {
|
|
19814
|
-
if (
|
|
17971
|
+
if (hasOwn$1(src, key)) {
|
|
19815
17972
|
if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
|
|
19816
17973
|
des[key] = src[key];
|
|
19817
17974
|
} else {
|
|
@@ -19824,7 +17981,7 @@ function getComponentOptions(instance) {
|
|
|
19824
17981
|
return instance.type;
|
|
19825
17982
|
}
|
|
19826
17983
|
function adjustI18nResources(global2, options, componentOptions) {
|
|
19827
|
-
let messages =
|
|
17984
|
+
let messages = isObject$4(options.messages) ? options.messages : {};
|
|
19828
17985
|
if ("__i18nGlobal" in componentOptions) {
|
|
19829
17986
|
messages = getLocaleMessages(global2.locale.value, {
|
|
19830
17987
|
messages,
|
|
@@ -19838,7 +17995,7 @@ function adjustI18nResources(global2, options, componentOptions) {
|
|
|
19838
17995
|
});
|
|
19839
17996
|
}
|
|
19840
17997
|
{
|
|
19841
|
-
if (
|
|
17998
|
+
if (isObject$4(options.datetimeFormats)) {
|
|
19842
17999
|
const locales2 = Object.keys(options.datetimeFormats);
|
|
19843
18000
|
if (locales2.length) {
|
|
19844
18001
|
locales2.forEach((locale2) => {
|
|
@@ -19846,7 +18003,7 @@ function adjustI18nResources(global2, options, componentOptions) {
|
|
|
19846
18003
|
});
|
|
19847
18004
|
}
|
|
19848
18005
|
}
|
|
19849
|
-
if (
|
|
18006
|
+
if (isObject$4(options.numberFormats)) {
|
|
19850
18007
|
const locales2 = Object.keys(options.numberFormats);
|
|
19851
18008
|
if (locales2.length) {
|
|
19852
18009
|
locales2.forEach((locale2) => {
|
|
@@ -19857,47 +18014,47 @@ function adjustI18nResources(global2, options, componentOptions) {
|
|
|
19857
18014
|
}
|
|
19858
18015
|
}
|
|
19859
18016
|
function createTextNode$1(key) {
|
|
19860
|
-
return
|
|
18017
|
+
return createVNode$1(Text, null, key, 0);
|
|
19861
18018
|
}
|
|
19862
18019
|
const DEVTOOLS_META = "__INTLIFY_META__";
|
|
19863
18020
|
let composerID = 0;
|
|
19864
18021
|
function defineCoreMissingHandler(missing) {
|
|
19865
18022
|
return (ctx, locale2, key, type) => {
|
|
19866
|
-
return missing(locale2, key,
|
|
18023
|
+
return missing(locale2, key, getCurrentInstance() || void 0, type);
|
|
19867
18024
|
};
|
|
19868
18025
|
}
|
|
19869
18026
|
const getMetaInfo = () => {
|
|
19870
|
-
const instance =
|
|
18027
|
+
const instance = getCurrentInstance();
|
|
19871
18028
|
let meta = null;
|
|
19872
18029
|
return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META]) ? { [DEVTOOLS_META]: meta } : null;
|
|
19873
18030
|
};
|
|
19874
18031
|
function createComposer(options = {}, VueI18nLegacy) {
|
|
19875
18032
|
const { __root } = options;
|
|
19876
18033
|
const _isGlobal = __root === void 0;
|
|
19877
|
-
let _inheritLocale =
|
|
19878
|
-
const _locale =
|
|
19879
|
-
__root && _inheritLocale ? __root.locale.value :
|
|
18034
|
+
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
|
18035
|
+
const _locale = ref(
|
|
18036
|
+
__root && _inheritLocale ? __root.locale.value : isString$1(options.locale) ? options.locale : DEFAULT_LOCALE$1
|
|
19880
18037
|
);
|
|
19881
|
-
const _fallbackLocale =
|
|
19882
|
-
__root && _inheritLocale ? __root.fallbackLocale.value :
|
|
18038
|
+
const _fallbackLocale = ref(
|
|
18039
|
+
__root && _inheritLocale ? __root.fallbackLocale.value : isString$1(options.fallbackLocale) || isArray$2(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
|
|
19883
18040
|
);
|
|
19884
|
-
const _messages =
|
|
19885
|
-
const _datetimeFormats =
|
|
19886
|
-
const _numberFormats =
|
|
19887
|
-
let _missingWarn = __root ? __root.missingWarn :
|
|
19888
|
-
let _fallbackWarn = __root ? __root.fallbackWarn :
|
|
19889
|
-
let _fallbackRoot = __root ? __root.fallbackRoot :
|
|
18041
|
+
const _messages = ref(getLocaleMessages(_locale.value, options));
|
|
18042
|
+
const _datetimeFormats = ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
|
18043
|
+
const _numberFormats = ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
|
18044
|
+
let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp$1(options.missingWarn) ? options.missingWarn : true;
|
|
18045
|
+
let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp$1(options.fallbackWarn) ? options.fallbackWarn : true;
|
|
18046
|
+
let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
|
|
19890
18047
|
let _fallbackFormat = !!options.fallbackFormat;
|
|
19891
|
-
let _missing =
|
|
19892
|
-
let _runtimeMissing =
|
|
19893
|
-
let _postTranslation =
|
|
19894
|
-
let _warnHtmlMessage = __root ? __root.warnHtmlMessage :
|
|
18048
|
+
let _missing = isFunction$1(options.missing) ? options.missing : null;
|
|
18049
|
+
let _runtimeMissing = isFunction$1(options.missing) ? defineCoreMissingHandler(options.missing) : null;
|
|
18050
|
+
let _postTranslation = isFunction$1(options.postTranslation) ? options.postTranslation : null;
|
|
18051
|
+
let _warnHtmlMessage = __root ? __root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
|
|
19895
18052
|
let _escapeParameter = !!options.escapeParameter;
|
|
19896
|
-
const _modifiers = __root ? __root.modifiers :
|
|
18053
|
+
const _modifiers = __root ? __root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
|
|
19897
18054
|
let _pluralRules = options.pluralRules || __root && __root.pluralRules;
|
|
19898
18055
|
let _context;
|
|
19899
18056
|
const getCoreContext = () => {
|
|
19900
|
-
_isGlobal &&
|
|
18057
|
+
_isGlobal && setFallbackContext(null);
|
|
19901
18058
|
const ctxOptions = {
|
|
19902
18059
|
version: VERSION,
|
|
19903
18060
|
locale: _locale.value,
|
|
@@ -19919,18 +18076,18 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
19919
18076
|
{
|
|
19920
18077
|
ctxOptions.datetimeFormats = _datetimeFormats.value;
|
|
19921
18078
|
ctxOptions.numberFormats = _numberFormats.value;
|
|
19922
|
-
ctxOptions.__datetimeFormatters =
|
|
19923
|
-
ctxOptions.__numberFormatters =
|
|
18079
|
+
ctxOptions.__datetimeFormatters = isPlainObject(_context) ? _context.__datetimeFormatters : void 0;
|
|
18080
|
+
ctxOptions.__numberFormatters = isPlainObject(_context) ? _context.__numberFormatters : void 0;
|
|
19924
18081
|
}
|
|
19925
18082
|
{
|
|
19926
|
-
ctxOptions.__v_emitter =
|
|
18083
|
+
ctxOptions.__v_emitter = isPlainObject(_context) ? _context.__v_emitter : void 0;
|
|
19927
18084
|
}
|
|
19928
|
-
const ctx =
|
|
19929
|
-
_isGlobal &&
|
|
18085
|
+
const ctx = createCoreContext(ctxOptions);
|
|
18086
|
+
_isGlobal && setFallbackContext(ctx);
|
|
19930
18087
|
return ctx;
|
|
19931
18088
|
};
|
|
19932
18089
|
_context = getCoreContext();
|
|
19933
|
-
|
|
18090
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
19934
18091
|
function trackReactivityValues() {
|
|
19935
18092
|
return [
|
|
19936
18093
|
_locale.value,
|
|
@@ -19940,26 +18097,26 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
19940
18097
|
_numberFormats.value
|
|
19941
18098
|
];
|
|
19942
18099
|
}
|
|
19943
|
-
const locale2 =
|
|
18100
|
+
const locale2 = computed({
|
|
19944
18101
|
get: () => _locale.value,
|
|
19945
18102
|
set: (val) => {
|
|
19946
18103
|
_locale.value = val;
|
|
19947
18104
|
_context.locale = _locale.value;
|
|
19948
18105
|
}
|
|
19949
18106
|
});
|
|
19950
|
-
const fallbackLocale =
|
|
18107
|
+
const fallbackLocale = computed({
|
|
19951
18108
|
get: () => _fallbackLocale.value,
|
|
19952
18109
|
set: (val) => {
|
|
19953
18110
|
_fallbackLocale.value = val;
|
|
19954
18111
|
_context.fallbackLocale = _fallbackLocale.value;
|
|
19955
|
-
|
|
18112
|
+
updateFallbackLocale(_context, _locale.value, val);
|
|
19956
18113
|
}
|
|
19957
18114
|
});
|
|
19958
|
-
const messages =
|
|
19959
|
-
const datetimeFormats = /* @__PURE__ */
|
|
19960
|
-
const numberFormats = /* @__PURE__ */
|
|
18115
|
+
const messages = computed(() => _messages.value);
|
|
18116
|
+
const datetimeFormats = /* @__PURE__ */ computed(() => _datetimeFormats.value);
|
|
18117
|
+
const numberFormats = /* @__PURE__ */ computed(() => _numberFormats.value);
|
|
19961
18118
|
function getPostTranslationHandler() {
|
|
19962
|
-
return
|
|
18119
|
+
return isFunction$1(_postTranslation) ? _postTranslation : null;
|
|
19963
18120
|
}
|
|
19964
18121
|
function setPostTranslationHandler(handler) {
|
|
19965
18122
|
_postTranslation = handler;
|
|
@@ -19983,23 +18140,23 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
19983
18140
|
let ret;
|
|
19984
18141
|
{
|
|
19985
18142
|
try {
|
|
19986
|
-
|
|
18143
|
+
setAdditionalMeta(getMetaInfo());
|
|
19987
18144
|
if (!_isGlobal) {
|
|
19988
|
-
_context.fallbackContext = __root ?
|
|
18145
|
+
_context.fallbackContext = __root ? getFallbackContext() : void 0;
|
|
19989
18146
|
}
|
|
19990
18147
|
ret = fn(_context);
|
|
19991
18148
|
} finally {
|
|
19992
|
-
|
|
18149
|
+
setAdditionalMeta(null);
|
|
19993
18150
|
if (!_isGlobal) {
|
|
19994
18151
|
_context.fallbackContext = void 0;
|
|
19995
18152
|
}
|
|
19996
18153
|
}
|
|
19997
18154
|
}
|
|
19998
|
-
if (
|
|
18155
|
+
if (isNumber$1(ret) && ret === NOT_REOSLVED) {
|
|
19999
18156
|
const [key, arg2] = argumentParser();
|
|
20000
|
-
if (__root &&
|
|
20001
|
-
if (_fallbackRoot && (
|
|
20002
|
-
|
|
18157
|
+
if (__root && isString$1(key) && isResolvedTranslateMessage(warnType, arg2)) {
|
|
18158
|
+
if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
|
|
18159
|
+
warn$1(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT, {
|
|
20003
18160
|
key,
|
|
20004
18161
|
type: warnType
|
|
20005
18162
|
}));
|
|
@@ -20024,23 +18181,23 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
20024
18181
|
}
|
|
20025
18182
|
};
|
|
20026
18183
|
function t3(...args) {
|
|
20027
|
-
return wrapWithDeps((context) => Reflect.apply(
|
|
18184
|
+
return wrapWithDeps((context) => Reflect.apply(translate$1, null, [context, ...args]), () => parseTranslateArgs(...args), "translate", (root) => Reflect.apply(root.t, root, [...args]), (key) => key, (val) => isString$1(val));
|
|
20028
18185
|
}
|
|
20029
18186
|
function rt2(...args) {
|
|
20030
18187
|
const [arg1, arg2, arg3] = args;
|
|
20031
|
-
if (arg3 && !
|
|
18188
|
+
if (arg3 && !isObject$4(arg3)) {
|
|
20032
18189
|
throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
|
|
20033
18190
|
}
|
|
20034
|
-
return t3(...[arg1, arg2,
|
|
18191
|
+
return t3(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);
|
|
20035
18192
|
}
|
|
20036
18193
|
function d3(...args) {
|
|
20037
|
-
return wrapWithDeps((context) => Reflect.apply(
|
|
18194
|
+
return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root) => Reflect.apply(root.d, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
|
|
20038
18195
|
}
|
|
20039
18196
|
function n2(...args) {
|
|
20040
|
-
return wrapWithDeps((context) => Reflect.apply(
|
|
18197
|
+
return wrapWithDeps((context) => Reflect.apply(number$1, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root) => Reflect.apply(root.n, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
|
|
20041
18198
|
}
|
|
20042
18199
|
function normalize2(values) {
|
|
20043
|
-
return values.map((val) =>
|
|
18200
|
+
return values.map((val) => isString$1(val) || isNumber$1(val) || isBoolean(val) ? createTextNode$1(String(val)) : val);
|
|
20044
18201
|
}
|
|
20045
18202
|
const interpolate = (val) => val;
|
|
20046
18203
|
const processor = {
|
|
@@ -20055,37 +18212,37 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
20055
18212
|
const _context2 = context;
|
|
20056
18213
|
try {
|
|
20057
18214
|
_context2.processor = processor;
|
|
20058
|
-
ret = Reflect.apply(
|
|
18215
|
+
ret = Reflect.apply(translate$1, null, [_context2, ...args]);
|
|
20059
18216
|
} finally {
|
|
20060
18217
|
_context2.processor = null;
|
|
20061
18218
|
}
|
|
20062
18219
|
return ret;
|
|
20063
18220
|
},
|
|
20064
|
-
() =>
|
|
18221
|
+
() => parseTranslateArgs(...args),
|
|
20065
18222
|
"translate",
|
|
20066
18223
|
(root) => root[TransrateVNodeSymbol](...args),
|
|
20067
18224
|
(key) => [createTextNode$1(key)],
|
|
20068
|
-
(val) =>
|
|
18225
|
+
(val) => isArray$2(val)
|
|
20069
18226
|
);
|
|
20070
18227
|
}
|
|
20071
18228
|
function numberParts(...args) {
|
|
20072
18229
|
return wrapWithDeps(
|
|
20073
|
-
(context) => Reflect.apply(
|
|
20074
|
-
() =>
|
|
18230
|
+
(context) => Reflect.apply(number$1, null, [context, ...args]),
|
|
18231
|
+
() => parseNumberArgs(...args),
|
|
20075
18232
|
"number format",
|
|
20076
18233
|
(root) => root[NumberPartsSymbol](...args),
|
|
20077
18234
|
() => [],
|
|
20078
|
-
(val) =>
|
|
18235
|
+
(val) => isString$1(val) || isArray$2(val)
|
|
20079
18236
|
);
|
|
20080
18237
|
}
|
|
20081
18238
|
function datetimeParts(...args) {
|
|
20082
18239
|
return wrapWithDeps(
|
|
20083
|
-
(context) => Reflect.apply(
|
|
20084
|
-
() =>
|
|
18240
|
+
(context) => Reflect.apply(datetime, null, [context, ...args]),
|
|
18241
|
+
() => parseDateTimeArgs(...args),
|
|
20085
18242
|
"datetime format",
|
|
20086
18243
|
(root) => root[DatetimePartsSymbol](...args),
|
|
20087
18244
|
() => [],
|
|
20088
|
-
(val) =>
|
|
18245
|
+
(val) => isString$1(val) || isArray$2(val)
|
|
20089
18246
|
);
|
|
20090
18247
|
}
|
|
20091
18248
|
function setPluralRules(rules) {
|
|
@@ -20093,13 +18250,13 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
20093
18250
|
_context.pluralRules = _pluralRules;
|
|
20094
18251
|
}
|
|
20095
18252
|
function te(key, locale3) {
|
|
20096
|
-
const targetLocale =
|
|
18253
|
+
const targetLocale = isString$1(locale3) ? locale3 : _locale.value;
|
|
20097
18254
|
const message = getLocaleMessage(targetLocale);
|
|
20098
18255
|
return _context.messageResolver(message, key) !== null;
|
|
20099
18256
|
}
|
|
20100
18257
|
function resolveMessages(key) {
|
|
20101
18258
|
let messages2 = null;
|
|
20102
|
-
const locales =
|
|
18259
|
+
const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value);
|
|
20103
18260
|
for (let i3 = 0; i3 < locales.length; i3++) {
|
|
20104
18261
|
const targetLocaleMessages = _messages.value[locales[i3]] || {};
|
|
20105
18262
|
const messageValue = _context.messageResolver(targetLocaleMessages, key);
|
|
@@ -20132,12 +18289,12 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
20132
18289
|
function setDateTimeFormat(locale3, format2) {
|
|
20133
18290
|
_datetimeFormats.value[locale3] = format2;
|
|
20134
18291
|
_context.datetimeFormats = _datetimeFormats.value;
|
|
20135
|
-
|
|
18292
|
+
clearDateTimeFormat(_context, locale3, format2);
|
|
20136
18293
|
}
|
|
20137
18294
|
function mergeDateTimeFormat(locale3, format2) {
|
|
20138
|
-
_datetimeFormats.value[locale3] =
|
|
18295
|
+
_datetimeFormats.value[locale3] = assign(_datetimeFormats.value[locale3] || {}, format2);
|
|
20139
18296
|
_context.datetimeFormats = _datetimeFormats.value;
|
|
20140
|
-
|
|
18297
|
+
clearDateTimeFormat(_context, locale3, format2);
|
|
20141
18298
|
}
|
|
20142
18299
|
function getNumberFormat(locale3) {
|
|
20143
18300
|
return _numberFormats.value[locale3] || {};
|
|
@@ -20145,27 +18302,27 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
20145
18302
|
function setNumberFormat(locale3, format2) {
|
|
20146
18303
|
_numberFormats.value[locale3] = format2;
|
|
20147
18304
|
_context.numberFormats = _numberFormats.value;
|
|
20148
|
-
|
|
18305
|
+
clearNumberFormat(_context, locale3, format2);
|
|
20149
18306
|
}
|
|
20150
18307
|
function mergeNumberFormat(locale3, format2) {
|
|
20151
|
-
_numberFormats.value[locale3] =
|
|
18308
|
+
_numberFormats.value[locale3] = assign(_numberFormats.value[locale3] || {}, format2);
|
|
20152
18309
|
_context.numberFormats = _numberFormats.value;
|
|
20153
|
-
|
|
18310
|
+
clearNumberFormat(_context, locale3, format2);
|
|
20154
18311
|
}
|
|
20155
18312
|
composerID++;
|
|
20156
|
-
if (__root &&
|
|
20157
|
-
|
|
18313
|
+
if (__root && inBrowser) {
|
|
18314
|
+
watch(__root.locale, (val) => {
|
|
20158
18315
|
if (_inheritLocale) {
|
|
20159
18316
|
_locale.value = val;
|
|
20160
18317
|
_context.locale = val;
|
|
20161
|
-
|
|
18318
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
20162
18319
|
}
|
|
20163
18320
|
});
|
|
20164
|
-
|
|
18321
|
+
watch(__root.fallbackLocale, (val) => {
|
|
20165
18322
|
if (_inheritLocale) {
|
|
20166
18323
|
_fallbackLocale.value = val;
|
|
20167
18324
|
_context.fallbackLocale = val;
|
|
20168
|
-
|
|
18325
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
20169
18326
|
}
|
|
20170
18327
|
});
|
|
20171
18328
|
}
|
|
@@ -20181,7 +18338,7 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
20181
18338
|
if (val && __root) {
|
|
20182
18339
|
_locale.value = __root.locale.value;
|
|
20183
18340
|
_fallbackLocale.value = __root.fallbackLocale.value;
|
|
20184
|
-
|
|
18341
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
20185
18342
|
}
|
|
20186
18343
|
},
|
|
20187
18344
|
get availableLocales() {
|
|
@@ -20278,32 +18435,32 @@ function createComposer(options = {}, VueI18nLegacy) {
|
|
|
20278
18435
|
return composer;
|
|
20279
18436
|
}
|
|
20280
18437
|
function convertComposerOptions(options) {
|
|
20281
|
-
const locale2 =
|
|
20282
|
-
const fallbackLocale =
|
|
20283
|
-
const missing =
|
|
20284
|
-
const missingWarn =
|
|
20285
|
-
const fallbackWarn =
|
|
20286
|
-
const fallbackRoot =
|
|
18438
|
+
const locale2 = isString$1(options.locale) ? options.locale : DEFAULT_LOCALE$1;
|
|
18439
|
+
const fallbackLocale = isString$1(options.fallbackLocale) || isArray$2(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale2;
|
|
18440
|
+
const missing = isFunction$1(options.missing) ? options.missing : void 0;
|
|
18441
|
+
const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp$1(options.silentTranslationWarn) ? !options.silentTranslationWarn : true;
|
|
18442
|
+
const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp$1(options.silentFallbackWarn) ? !options.silentFallbackWarn : true;
|
|
18443
|
+
const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
|
|
20287
18444
|
const fallbackFormat = !!options.formatFallbackMessages;
|
|
20288
|
-
const modifiers =
|
|
18445
|
+
const modifiers = isPlainObject(options.modifiers) ? options.modifiers : {};
|
|
20289
18446
|
const pluralizationRules = options.pluralizationRules;
|
|
20290
|
-
const postTranslation =
|
|
20291
|
-
const warnHtmlMessage =
|
|
18447
|
+
const postTranslation = isFunction$1(options.postTranslation) ? options.postTranslation : void 0;
|
|
18448
|
+
const warnHtmlMessage = isString$1(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true;
|
|
20292
18449
|
const escapeParameter = !!options.escapeParameterHtml;
|
|
20293
|
-
const inheritLocale =
|
|
18450
|
+
const inheritLocale = isBoolean(options.sync) ? options.sync : true;
|
|
20294
18451
|
if (options.formatter) {
|
|
20295
|
-
|
|
18452
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER));
|
|
20296
18453
|
}
|
|
20297
18454
|
if (options.preserveDirectiveContent) {
|
|
20298
|
-
|
|
18455
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE));
|
|
20299
18456
|
}
|
|
20300
18457
|
let messages = options.messages;
|
|
20301
|
-
if (
|
|
18458
|
+
if (isPlainObject(options.sharedMessages)) {
|
|
20302
18459
|
const sharedMessages = options.sharedMessages;
|
|
20303
18460
|
const locales = Object.keys(sharedMessages);
|
|
20304
18461
|
messages = locales.reduce((messages2, locale3) => {
|
|
20305
18462
|
const message = messages2[locale3] || (messages2[locale3] = {});
|
|
20306
|
-
|
|
18463
|
+
assign(message, sharedMessages[locale3]);
|
|
20307
18464
|
return messages2;
|
|
20308
18465
|
}, messages || {});
|
|
20309
18466
|
}
|
|
@@ -20365,7 +18522,7 @@ function createVueI18n(options = {}, VueI18nLegacy) {
|
|
|
20365
18522
|
return composer.availableLocales;
|
|
20366
18523
|
},
|
|
20367
18524
|
get formatter() {
|
|
20368
|
-
|
|
18525
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER));
|
|
20369
18526
|
return {
|
|
20370
18527
|
interpolate() {
|
|
20371
18528
|
return [];
|
|
@@ -20373,7 +18530,7 @@ function createVueI18n(options = {}, VueI18nLegacy) {
|
|
|
20373
18530
|
};
|
|
20374
18531
|
},
|
|
20375
18532
|
set formatter(val) {
|
|
20376
|
-
|
|
18533
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER));
|
|
20377
18534
|
},
|
|
20378
18535
|
get missing() {
|
|
20379
18536
|
return composer.getMissingHandler();
|
|
@@ -20382,16 +18539,16 @@ function createVueI18n(options = {}, VueI18nLegacy) {
|
|
|
20382
18539
|
composer.setMissingHandler(handler);
|
|
20383
18540
|
},
|
|
20384
18541
|
get silentTranslationWarn() {
|
|
20385
|
-
return
|
|
18542
|
+
return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
|
|
20386
18543
|
},
|
|
20387
18544
|
set silentTranslationWarn(val) {
|
|
20388
|
-
composer.missingWarn =
|
|
18545
|
+
composer.missingWarn = isBoolean(val) ? !val : val;
|
|
20389
18546
|
},
|
|
20390
18547
|
get silentFallbackWarn() {
|
|
20391
|
-
return
|
|
18548
|
+
return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
|
|
20392
18549
|
},
|
|
20393
18550
|
set silentFallbackWarn(val) {
|
|
20394
|
-
composer.fallbackWarn =
|
|
18551
|
+
composer.fallbackWarn = isBoolean(val) ? !val : val;
|
|
20395
18552
|
},
|
|
20396
18553
|
get modifiers() {
|
|
20397
18554
|
return composer.modifiers;
|
|
@@ -20427,11 +18584,11 @@ function createVueI18n(options = {}, VueI18nLegacy) {
|
|
|
20427
18584
|
composer.escapeParameter = val;
|
|
20428
18585
|
},
|
|
20429
18586
|
get preserveDirectiveContent() {
|
|
20430
|
-
|
|
18587
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE));
|
|
20431
18588
|
return true;
|
|
20432
18589
|
},
|
|
20433
18590
|
set preserveDirectiveContent(val) {
|
|
20434
|
-
|
|
18591
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE));
|
|
20435
18592
|
},
|
|
20436
18593
|
get pluralizationRules() {
|
|
20437
18594
|
return composer.pluralRules || {};
|
|
@@ -20442,20 +18599,20 @@ function createVueI18n(options = {}, VueI18nLegacy) {
|
|
|
20442
18599
|
const options2 = {};
|
|
20443
18600
|
let list = null;
|
|
20444
18601
|
let named = null;
|
|
20445
|
-
if (!
|
|
18602
|
+
if (!isString$1(arg1)) {
|
|
20446
18603
|
throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
|
|
20447
18604
|
}
|
|
20448
18605
|
const key = arg1;
|
|
20449
|
-
if (
|
|
18606
|
+
if (isString$1(arg2)) {
|
|
20450
18607
|
options2.locale = arg2;
|
|
20451
|
-
} else if (
|
|
18608
|
+
} else if (isArray$2(arg2)) {
|
|
20452
18609
|
list = arg2;
|
|
20453
|
-
} else if (
|
|
18610
|
+
} else if (isPlainObject(arg2)) {
|
|
20454
18611
|
named = arg2;
|
|
20455
18612
|
}
|
|
20456
|
-
if (
|
|
18613
|
+
if (isArray$2(arg3)) {
|
|
20457
18614
|
list = arg3;
|
|
20458
|
-
} else if (
|
|
18615
|
+
} else if (isPlainObject(arg3)) {
|
|
20459
18616
|
named = arg3;
|
|
20460
18617
|
}
|
|
20461
18618
|
return Reflect.apply(composer.t, composer, [
|
|
@@ -20472,24 +18629,24 @@ function createVueI18n(options = {}, VueI18nLegacy) {
|
|
|
20472
18629
|
const options2 = { plural: 1 };
|
|
20473
18630
|
let list = null;
|
|
20474
18631
|
let named = null;
|
|
20475
|
-
if (!
|
|
18632
|
+
if (!isString$1(arg1)) {
|
|
20476
18633
|
throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
|
|
20477
18634
|
}
|
|
20478
18635
|
const key = arg1;
|
|
20479
|
-
if (
|
|
18636
|
+
if (isString$1(arg2)) {
|
|
20480
18637
|
options2.locale = arg2;
|
|
20481
|
-
} else if (
|
|
18638
|
+
} else if (isNumber$1(arg2)) {
|
|
20482
18639
|
options2.plural = arg2;
|
|
20483
|
-
} else if (
|
|
18640
|
+
} else if (isArray$2(arg2)) {
|
|
20484
18641
|
list = arg2;
|
|
20485
|
-
} else if (
|
|
18642
|
+
} else if (isPlainObject(arg2)) {
|
|
20486
18643
|
named = arg2;
|
|
20487
18644
|
}
|
|
20488
|
-
if (
|
|
18645
|
+
if (isString$1(arg3)) {
|
|
20489
18646
|
options2.locale = arg3;
|
|
20490
|
-
} else if (
|
|
18647
|
+
} else if (isArray$2(arg3)) {
|
|
20491
18648
|
list = arg3;
|
|
20492
|
-
} else if (
|
|
18649
|
+
} else if (isPlainObject(arg3)) {
|
|
20493
18650
|
named = arg3;
|
|
20494
18651
|
}
|
|
20495
18652
|
return Reflect.apply(composer.t, composer, [
|
|
@@ -20538,7 +18695,7 @@ function createVueI18n(options = {}, VueI18nLegacy) {
|
|
|
20538
18695
|
composer.mergeNumberFormat(locale2, format2);
|
|
20539
18696
|
},
|
|
20540
18697
|
getChoiceIndex(choice, choicesLength) {
|
|
20541
|
-
|
|
18698
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_GET_CHOICE_INDEX));
|
|
20542
18699
|
return -1;
|
|
20543
18700
|
},
|
|
20544
18701
|
__onComponentInstanceCreated(target) {
|
|
@@ -20583,7 +18740,7 @@ function getInterpolateArg({ slots }, keys2) {
|
|
|
20583
18740
|
return ret.reduce((slot, current) => {
|
|
20584
18741
|
return slot = [
|
|
20585
18742
|
...slot,
|
|
20586
|
-
...
|
|
18743
|
+
...isArray$2(current.children) ? current.children : [current]
|
|
20587
18744
|
];
|
|
20588
18745
|
}, []);
|
|
20589
18746
|
} else {
|
|
@@ -20597,18 +18754,18 @@ function getInterpolateArg({ slots }, keys2) {
|
|
|
20597
18754
|
}
|
|
20598
18755
|
}
|
|
20599
18756
|
function getFragmentableTag(tag) {
|
|
20600
|
-
return
|
|
18757
|
+
return Fragment;
|
|
20601
18758
|
}
|
|
20602
18759
|
const Translation = {
|
|
20603
18760
|
name: "i18n-t",
|
|
20604
|
-
props:
|
|
18761
|
+
props: assign({
|
|
20605
18762
|
keypath: {
|
|
20606
18763
|
type: String,
|
|
20607
18764
|
required: true
|
|
20608
18765
|
},
|
|
20609
18766
|
plural: {
|
|
20610
18767
|
type: [Number, String],
|
|
20611
|
-
validator: (val) =>
|
|
18768
|
+
validator: (val) => isNumber$1(val) || !isNaN(val)
|
|
20612
18769
|
}
|
|
20613
18770
|
}, baseFormatProps),
|
|
20614
18771
|
setup(props, context) {
|
|
@@ -20624,18 +18781,18 @@ const Translation = {
|
|
|
20624
18781
|
options.locale = props.locale;
|
|
20625
18782
|
}
|
|
20626
18783
|
if (props.plural !== void 0) {
|
|
20627
|
-
options.plural =
|
|
18784
|
+
options.plural = isString$1(props.plural) ? +props.plural : props.plural;
|
|
20628
18785
|
}
|
|
20629
18786
|
const arg = getInterpolateArg(context, keys2);
|
|
20630
18787
|
const children = i18n2[TransrateVNodeSymbol](props.keypath, arg, options);
|
|
20631
|
-
const assignedAttrs =
|
|
20632
|
-
const tag =
|
|
20633
|
-
return
|
|
18788
|
+
const assignedAttrs = assign({}, attrs);
|
|
18789
|
+
const tag = isString$1(props.tag) || isObject$4(props.tag) ? props.tag : getFragmentableTag();
|
|
18790
|
+
return h(tag, assignedAttrs, children);
|
|
20634
18791
|
};
|
|
20635
18792
|
}
|
|
20636
18793
|
};
|
|
20637
18794
|
function isVNode(target) {
|
|
20638
|
-
return
|
|
18795
|
+
return isArray$2(target) && !isString$1(target[0]);
|
|
20639
18796
|
}
|
|
20640
18797
|
function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
20641
18798
|
const { slots, attrs } = context;
|
|
@@ -20645,19 +18802,19 @@ function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
|
20645
18802
|
if (props.locale) {
|
|
20646
18803
|
options.locale = props.locale;
|
|
20647
18804
|
}
|
|
20648
|
-
if (
|
|
18805
|
+
if (isString$1(props.format)) {
|
|
20649
18806
|
options.key = props.format;
|
|
20650
|
-
} else if (
|
|
20651
|
-
if (
|
|
18807
|
+
} else if (isObject$4(props.format)) {
|
|
18808
|
+
if (isString$1(props.format.key)) {
|
|
20652
18809
|
options.key = props.format.key;
|
|
20653
18810
|
}
|
|
20654
18811
|
overrides = Object.keys(props.format).reduce((options2, prop) => {
|
|
20655
|
-
return slotKeys.includes(prop) ?
|
|
18812
|
+
return slotKeys.includes(prop) ? assign({}, options2, { [prop]: props.format[prop] }) : options2;
|
|
20656
18813
|
}, {});
|
|
20657
18814
|
}
|
|
20658
18815
|
const parts = partFormatter(...[props.value, options, overrides]);
|
|
20659
18816
|
let children = [options.key];
|
|
20660
|
-
if (
|
|
18817
|
+
if (isArray$2(parts)) {
|
|
20661
18818
|
children = parts.map((part, index2) => {
|
|
20662
18819
|
const slot = slots[part.type];
|
|
20663
18820
|
const node = slot ? slot({ [part.type]: part.value, index: index2, parts }) : [part.value];
|
|
@@ -20666,17 +18823,17 @@ function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
|
20666
18823
|
}
|
|
20667
18824
|
return node;
|
|
20668
18825
|
});
|
|
20669
|
-
} else if (
|
|
18826
|
+
} else if (isString$1(parts)) {
|
|
20670
18827
|
children = [parts];
|
|
20671
18828
|
}
|
|
20672
|
-
const assignedAttrs =
|
|
20673
|
-
const tag =
|
|
20674
|
-
return
|
|
18829
|
+
const assignedAttrs = assign({}, attrs);
|
|
18830
|
+
const tag = isString$1(props.tag) || isObject$4(props.tag) ? props.tag : getFragmentableTag();
|
|
18831
|
+
return h(tag, assignedAttrs, children);
|
|
20675
18832
|
};
|
|
20676
18833
|
}
|
|
20677
18834
|
const NumberFormat = {
|
|
20678
18835
|
name: "i18n-n",
|
|
20679
|
-
props:
|
|
18836
|
+
props: assign({
|
|
20680
18837
|
value: {
|
|
20681
18838
|
type: Number,
|
|
20682
18839
|
required: true
|
|
@@ -20687,12 +18844,12 @@ const NumberFormat = {
|
|
|
20687
18844
|
}, baseFormatProps),
|
|
20688
18845
|
setup(props, context) {
|
|
20689
18846
|
const i18n2 = props.i18n || useI18n({ useScope: "parent", __useComponent: true });
|
|
20690
|
-
return renderFormatter(props, context,
|
|
18847
|
+
return renderFormatter(props, context, NUMBER_FORMAT_OPTIONS_KEYS, (...args) => i18n2[NumberPartsSymbol](...args));
|
|
20691
18848
|
}
|
|
20692
18849
|
};
|
|
20693
18850
|
const DatetimeFormat = {
|
|
20694
18851
|
name: "i18n-d",
|
|
20695
|
-
props:
|
|
18852
|
+
props: assign({
|
|
20696
18853
|
value: {
|
|
20697
18854
|
type: [Number, Date],
|
|
20698
18855
|
required: true
|
|
@@ -20703,10 +18860,10 @@ const DatetimeFormat = {
|
|
|
20703
18860
|
}, baseFormatProps),
|
|
20704
18861
|
setup(props, context) {
|
|
20705
18862
|
const i18n2 = props.i18n || useI18n({ useScope: "parent", __useComponent: true });
|
|
20706
|
-
return renderFormatter(props, context,
|
|
18863
|
+
return renderFormatter(props, context, DATETIME_FORMAT_OPTIONS_KEYS, (...args) => i18n2[DatetimePartsSymbol](...args));
|
|
20707
18864
|
}
|
|
20708
18865
|
};
|
|
20709
|
-
function getComposer$
|
|
18866
|
+
function getComposer$2(i18n2, instance) {
|
|
20710
18867
|
const i18nInternal = i18n2;
|
|
20711
18868
|
if (i18n2.mode === "composition") {
|
|
20712
18869
|
return i18nInternal.__getInstance(instance) || i18n2.global;
|
|
@@ -20721,9 +18878,9 @@ function vTDirective(i18n2) {
|
|
|
20721
18878
|
if (!instance || !instance.$) {
|
|
20722
18879
|
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
20723
18880
|
}
|
|
20724
|
-
const composer = getComposer$
|
|
18881
|
+
const composer = getComposer$2(i18n2, instance.$);
|
|
20725
18882
|
if (modifiers.preserve) {
|
|
20726
|
-
|
|
18883
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE));
|
|
20727
18884
|
}
|
|
20728
18885
|
const parsedValue = parseValue(value);
|
|
20729
18886
|
return [
|
|
@@ -20733,8 +18890,8 @@ function vTDirective(i18n2) {
|
|
|
20733
18890
|
};
|
|
20734
18891
|
const register3 = (el, binding) => {
|
|
20735
18892
|
const [textContent, composer] = _process(binding);
|
|
20736
|
-
if (
|
|
20737
|
-
el.__i18nWatcher =
|
|
18893
|
+
if (inBrowser && i18n2.global === composer) {
|
|
18894
|
+
el.__i18nWatcher = watch(composer.locale, () => {
|
|
20738
18895
|
binding.instance && binding.instance.$forceUpdate();
|
|
20739
18896
|
});
|
|
20740
18897
|
}
|
|
@@ -20742,7 +18899,7 @@ function vTDirective(i18n2) {
|
|
|
20742
18899
|
el.textContent = textContent;
|
|
20743
18900
|
};
|
|
20744
18901
|
const unregister3 = (el) => {
|
|
20745
|
-
if (
|
|
18902
|
+
if (inBrowser && el.__i18nWatcher) {
|
|
20746
18903
|
el.__i18nWatcher();
|
|
20747
18904
|
el.__i18nWatcher = void 0;
|
|
20748
18905
|
delete el.__i18nWatcher;
|
|
@@ -20773,9 +18930,9 @@ function vTDirective(i18n2) {
|
|
|
20773
18930
|
};
|
|
20774
18931
|
}
|
|
20775
18932
|
function parseValue(value) {
|
|
20776
|
-
if (
|
|
18933
|
+
if (isString$1(value)) {
|
|
20777
18934
|
return { path: value };
|
|
20778
|
-
} else if (
|
|
18935
|
+
} else if (isPlainObject(value)) {
|
|
20779
18936
|
if (!("path" in value)) {
|
|
20780
18937
|
throw createI18nError(I18nErrorCodes.REQUIRED_VALUE, "path");
|
|
20781
18938
|
}
|
|
@@ -20788,23 +18945,23 @@ function makeParams(value) {
|
|
|
20788
18945
|
const { path, locale: locale2, args, choice, plural } = value;
|
|
20789
18946
|
const options = {};
|
|
20790
18947
|
const named = args || {};
|
|
20791
|
-
if (
|
|
18948
|
+
if (isString$1(locale2)) {
|
|
20792
18949
|
options.locale = locale2;
|
|
20793
18950
|
}
|
|
20794
|
-
if (
|
|
18951
|
+
if (isNumber$1(choice)) {
|
|
20795
18952
|
options.plural = choice;
|
|
20796
18953
|
}
|
|
20797
|
-
if (
|
|
18954
|
+
if (isNumber$1(plural)) {
|
|
20798
18955
|
options.plural = plural;
|
|
20799
18956
|
}
|
|
20800
18957
|
return [path, named, options];
|
|
20801
18958
|
}
|
|
20802
18959
|
function apply(app, i18n2, ...options) {
|
|
20803
|
-
const pluginOptions =
|
|
18960
|
+
const pluginOptions = isPlainObject(options[0]) ? options[0] : {};
|
|
20804
18961
|
const useI18nComponentName = !!pluginOptions.useI18nComponentName;
|
|
20805
|
-
const globalInstall =
|
|
18962
|
+
const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
|
|
20806
18963
|
if (globalInstall && useI18nComponentName) {
|
|
20807
|
-
|
|
18964
|
+
warn$1(getWarnMessage(I18nWarnCodes.COMPONENT_NAME_LEGACY_COMPATIBLE, {
|
|
20808
18965
|
name: Translation.name
|
|
20809
18966
|
}));
|
|
20810
18967
|
}
|
|
@@ -20817,10 +18974,328 @@ function apply(app, i18n2, ...options) {
|
|
|
20817
18974
|
app.directive("t", vTDirective(i18n2));
|
|
20818
18975
|
}
|
|
20819
18976
|
}
|
|
18977
|
+
const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
|
|
18978
|
+
let devtoolsApi;
|
|
18979
|
+
async function enableDevTools(app, i18n2) {
|
|
18980
|
+
return new Promise((resolve, reject) => {
|
|
18981
|
+
try {
|
|
18982
|
+
setupDevtoolsPlugin({
|
|
18983
|
+
id: "vue-devtools-plugin-vue-i18n",
|
|
18984
|
+
label: VueDevToolsLabels["vue-devtools-plugin-vue-i18n"],
|
|
18985
|
+
packageName: "vue-i18n",
|
|
18986
|
+
homepage: "https://vue-i18n.intlify.dev",
|
|
18987
|
+
logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
|
|
18988
|
+
componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
|
|
18989
|
+
app
|
|
18990
|
+
}, (api2) => {
|
|
18991
|
+
devtoolsApi = api2;
|
|
18992
|
+
api2.on.visitComponentTree(({ componentInstance, treeNode }) => {
|
|
18993
|
+
updateComponentTreeTags(componentInstance, treeNode, i18n2);
|
|
18994
|
+
});
|
|
18995
|
+
api2.on.inspectComponent(({ componentInstance, instanceData }) => {
|
|
18996
|
+
if (componentInstance.vnode.el && componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
|
|
18997
|
+
if (i18n2.mode === "legacy") {
|
|
18998
|
+
if (componentInstance.vnode.el.__VUE_I18N__ !== i18n2.global.__composer) {
|
|
18999
|
+
inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
|
|
19000
|
+
}
|
|
19001
|
+
} else {
|
|
19002
|
+
inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
|
|
19003
|
+
}
|
|
19004
|
+
}
|
|
19005
|
+
});
|
|
19006
|
+
api2.addInspector({
|
|
19007
|
+
id: "vue-i18n-resource-inspector",
|
|
19008
|
+
label: VueDevToolsLabels["vue-i18n-resource-inspector"],
|
|
19009
|
+
icon: "language",
|
|
19010
|
+
treeFilterPlaceholder: VueDevToolsPlaceholders["vue-i18n-resource-inspector"]
|
|
19011
|
+
});
|
|
19012
|
+
api2.on.getInspectorTree((payload) => {
|
|
19013
|
+
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
19014
|
+
registerScope(payload, i18n2);
|
|
19015
|
+
}
|
|
19016
|
+
});
|
|
19017
|
+
const roots2 = /* @__PURE__ */ new Map();
|
|
19018
|
+
api2.on.getInspectorState(async (payload) => {
|
|
19019
|
+
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
19020
|
+
api2.unhighlightElement();
|
|
19021
|
+
inspectScope(payload, i18n2);
|
|
19022
|
+
if (payload.nodeId === "global") {
|
|
19023
|
+
if (!roots2.has(payload.app)) {
|
|
19024
|
+
const [root] = await api2.getComponentInstances(payload.app);
|
|
19025
|
+
roots2.set(payload.app, root);
|
|
19026
|
+
}
|
|
19027
|
+
api2.highlightElement(roots2.get(payload.app));
|
|
19028
|
+
} else {
|
|
19029
|
+
const instance = getComponentInstance(payload.nodeId, i18n2);
|
|
19030
|
+
instance && api2.highlightElement(instance);
|
|
19031
|
+
}
|
|
19032
|
+
}
|
|
19033
|
+
});
|
|
19034
|
+
api2.on.editInspectorState((payload) => {
|
|
19035
|
+
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
19036
|
+
editScope(payload, i18n2);
|
|
19037
|
+
}
|
|
19038
|
+
});
|
|
19039
|
+
api2.addTimelineLayer({
|
|
19040
|
+
id: "vue-i18n-timeline",
|
|
19041
|
+
label: VueDevToolsLabels["vue-i18n-timeline"],
|
|
19042
|
+
color: VueDevToolsTimelineColors["vue-i18n-timeline"]
|
|
19043
|
+
});
|
|
19044
|
+
resolve(true);
|
|
19045
|
+
});
|
|
19046
|
+
} catch (e3) {
|
|
19047
|
+
console.error(e3);
|
|
19048
|
+
reject(false);
|
|
19049
|
+
}
|
|
19050
|
+
});
|
|
19051
|
+
}
|
|
19052
|
+
function getI18nScopeLable(instance) {
|
|
19053
|
+
return instance.type.name || instance.type.displayName || instance.type.__file || "Anonymous";
|
|
19054
|
+
}
|
|
19055
|
+
function updateComponentTreeTags(instance, treeNode, i18n2) {
|
|
19056
|
+
const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
|
|
19057
|
+
if (instance && instance.vnode.el && instance.vnode.el.__VUE_I18N__) {
|
|
19058
|
+
if (instance.vnode.el.__VUE_I18N__ !== global2) {
|
|
19059
|
+
const tag = {
|
|
19060
|
+
label: `i18n (${getI18nScopeLable(instance)} Scope)`,
|
|
19061
|
+
textColor: 0,
|
|
19062
|
+
backgroundColor: 16764185
|
|
19063
|
+
};
|
|
19064
|
+
treeNode.tags.push(tag);
|
|
19065
|
+
}
|
|
19066
|
+
}
|
|
19067
|
+
}
|
|
19068
|
+
function inspectComposer(instanceData, composer) {
|
|
19069
|
+
const type = VUE_I18N_COMPONENT_TYPES;
|
|
19070
|
+
instanceData.state.push({
|
|
19071
|
+
type,
|
|
19072
|
+
key: "locale",
|
|
19073
|
+
editable: true,
|
|
19074
|
+
value: composer.locale.value
|
|
19075
|
+
});
|
|
19076
|
+
instanceData.state.push({
|
|
19077
|
+
type,
|
|
19078
|
+
key: "availableLocales",
|
|
19079
|
+
editable: false,
|
|
19080
|
+
value: composer.availableLocales
|
|
19081
|
+
});
|
|
19082
|
+
instanceData.state.push({
|
|
19083
|
+
type,
|
|
19084
|
+
key: "fallbackLocale",
|
|
19085
|
+
editable: true,
|
|
19086
|
+
value: composer.fallbackLocale.value
|
|
19087
|
+
});
|
|
19088
|
+
instanceData.state.push({
|
|
19089
|
+
type,
|
|
19090
|
+
key: "inheritLocale",
|
|
19091
|
+
editable: true,
|
|
19092
|
+
value: composer.inheritLocale
|
|
19093
|
+
});
|
|
19094
|
+
instanceData.state.push({
|
|
19095
|
+
type,
|
|
19096
|
+
key: "messages",
|
|
19097
|
+
editable: false,
|
|
19098
|
+
value: getLocaleMessageValue(composer.messages.value)
|
|
19099
|
+
});
|
|
19100
|
+
{
|
|
19101
|
+
instanceData.state.push({
|
|
19102
|
+
type,
|
|
19103
|
+
key: "datetimeFormats",
|
|
19104
|
+
editable: false,
|
|
19105
|
+
value: composer.datetimeFormats.value
|
|
19106
|
+
});
|
|
19107
|
+
instanceData.state.push({
|
|
19108
|
+
type,
|
|
19109
|
+
key: "numberFormats",
|
|
19110
|
+
editable: false,
|
|
19111
|
+
value: composer.numberFormats.value
|
|
19112
|
+
});
|
|
19113
|
+
}
|
|
19114
|
+
}
|
|
19115
|
+
function getLocaleMessageValue(messages) {
|
|
19116
|
+
const value = {};
|
|
19117
|
+
Object.keys(messages).forEach((key) => {
|
|
19118
|
+
const v = messages[key];
|
|
19119
|
+
if (isFunction$1(v) && "source" in v) {
|
|
19120
|
+
value[key] = getMessageFunctionDetails(v);
|
|
19121
|
+
} else if (isObject$4(v)) {
|
|
19122
|
+
value[key] = getLocaleMessageValue(v);
|
|
19123
|
+
} else {
|
|
19124
|
+
value[key] = v;
|
|
19125
|
+
}
|
|
19126
|
+
});
|
|
19127
|
+
return value;
|
|
19128
|
+
}
|
|
19129
|
+
const ESC = {
|
|
19130
|
+
"<": "<",
|
|
19131
|
+
">": ">",
|
|
19132
|
+
'"': """,
|
|
19133
|
+
"&": "&"
|
|
19134
|
+
};
|
|
19135
|
+
function escape$1(s3) {
|
|
19136
|
+
return s3.replace(/[<>"&]/g, escapeChar);
|
|
19137
|
+
}
|
|
19138
|
+
function escapeChar(a3) {
|
|
19139
|
+
return ESC[a3] || a3;
|
|
19140
|
+
}
|
|
19141
|
+
function getMessageFunctionDetails(func) {
|
|
19142
|
+
const argString = func.source ? `("${escape$1(func.source)}")` : `(?)`;
|
|
19143
|
+
return {
|
|
19144
|
+
_custom: {
|
|
19145
|
+
type: "function",
|
|
19146
|
+
display: `<span>\u0192</span> ${argString}`
|
|
19147
|
+
}
|
|
19148
|
+
};
|
|
19149
|
+
}
|
|
19150
|
+
function registerScope(payload, i18n2) {
|
|
19151
|
+
payload.rootNodes.push({
|
|
19152
|
+
id: "global",
|
|
19153
|
+
label: "Global Scope"
|
|
19154
|
+
});
|
|
19155
|
+
const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
|
|
19156
|
+
for (const [keyInstance, instance] of i18n2.__instances) {
|
|
19157
|
+
const composer = i18n2.mode === "composition" ? instance : instance.__composer;
|
|
19158
|
+
if (global2 === composer) {
|
|
19159
|
+
continue;
|
|
19160
|
+
}
|
|
19161
|
+
payload.rootNodes.push({
|
|
19162
|
+
id: composer.id.toString(),
|
|
19163
|
+
label: `${getI18nScopeLable(keyInstance)} Scope`
|
|
19164
|
+
});
|
|
19165
|
+
}
|
|
19166
|
+
}
|
|
19167
|
+
function getComponentInstance(nodeId, i18n2) {
|
|
19168
|
+
let instance = null;
|
|
19169
|
+
if (nodeId !== "global") {
|
|
19170
|
+
for (const [component, composer] of i18n2.__instances.entries()) {
|
|
19171
|
+
if (composer.id.toString() === nodeId) {
|
|
19172
|
+
instance = component;
|
|
19173
|
+
break;
|
|
19174
|
+
}
|
|
19175
|
+
}
|
|
19176
|
+
}
|
|
19177
|
+
return instance;
|
|
19178
|
+
}
|
|
19179
|
+
function getComposer$1(nodeId, i18n2) {
|
|
19180
|
+
if (nodeId === "global") {
|
|
19181
|
+
return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
|
|
19182
|
+
} else {
|
|
19183
|
+
const instance = Array.from(i18n2.__instances.values()).find((item) => item.id.toString() === nodeId);
|
|
19184
|
+
if (instance) {
|
|
19185
|
+
return i18n2.mode === "composition" ? instance : instance.__composer;
|
|
19186
|
+
} else {
|
|
19187
|
+
return null;
|
|
19188
|
+
}
|
|
19189
|
+
}
|
|
19190
|
+
}
|
|
19191
|
+
function inspectScope(payload, i18n2) {
|
|
19192
|
+
const composer = getComposer$1(payload.nodeId, i18n2);
|
|
19193
|
+
if (composer) {
|
|
19194
|
+
payload.state = makeScopeInspectState(composer);
|
|
19195
|
+
}
|
|
19196
|
+
return null;
|
|
19197
|
+
}
|
|
19198
|
+
function makeScopeInspectState(composer) {
|
|
19199
|
+
const state = {};
|
|
19200
|
+
const localeType = "Locale related info";
|
|
19201
|
+
const localeStates = [
|
|
19202
|
+
{
|
|
19203
|
+
type: localeType,
|
|
19204
|
+
key: "locale",
|
|
19205
|
+
editable: true,
|
|
19206
|
+
value: composer.locale.value
|
|
19207
|
+
},
|
|
19208
|
+
{
|
|
19209
|
+
type: localeType,
|
|
19210
|
+
key: "fallbackLocale",
|
|
19211
|
+
editable: true,
|
|
19212
|
+
value: composer.fallbackLocale.value
|
|
19213
|
+
},
|
|
19214
|
+
{
|
|
19215
|
+
type: localeType,
|
|
19216
|
+
key: "availableLocales",
|
|
19217
|
+
editable: false,
|
|
19218
|
+
value: composer.availableLocales
|
|
19219
|
+
},
|
|
19220
|
+
{
|
|
19221
|
+
type: localeType,
|
|
19222
|
+
key: "inheritLocale",
|
|
19223
|
+
editable: true,
|
|
19224
|
+
value: composer.inheritLocale
|
|
19225
|
+
}
|
|
19226
|
+
];
|
|
19227
|
+
state[localeType] = localeStates;
|
|
19228
|
+
const localeMessagesType = "Locale messages info";
|
|
19229
|
+
const localeMessagesStates = [
|
|
19230
|
+
{
|
|
19231
|
+
type: localeMessagesType,
|
|
19232
|
+
key: "messages",
|
|
19233
|
+
editable: false,
|
|
19234
|
+
value: getLocaleMessageValue(composer.messages.value)
|
|
19235
|
+
}
|
|
19236
|
+
];
|
|
19237
|
+
state[localeMessagesType] = localeMessagesStates;
|
|
19238
|
+
{
|
|
19239
|
+
const datetimeFormatsType = "Datetime formats info";
|
|
19240
|
+
const datetimeFormatsStates = [
|
|
19241
|
+
{
|
|
19242
|
+
type: datetimeFormatsType,
|
|
19243
|
+
key: "datetimeFormats",
|
|
19244
|
+
editable: false,
|
|
19245
|
+
value: composer.datetimeFormats.value
|
|
19246
|
+
}
|
|
19247
|
+
];
|
|
19248
|
+
state[datetimeFormatsType] = datetimeFormatsStates;
|
|
19249
|
+
const numberFormatsType = "Datetime formats info";
|
|
19250
|
+
const numberFormatsStates = [
|
|
19251
|
+
{
|
|
19252
|
+
type: numberFormatsType,
|
|
19253
|
+
key: "numberFormats",
|
|
19254
|
+
editable: false,
|
|
19255
|
+
value: composer.numberFormats.value
|
|
19256
|
+
}
|
|
19257
|
+
];
|
|
19258
|
+
state[numberFormatsType] = numberFormatsStates;
|
|
19259
|
+
}
|
|
19260
|
+
return state;
|
|
19261
|
+
}
|
|
19262
|
+
function addTimelineEvent(event, payload) {
|
|
19263
|
+
if (devtoolsApi) {
|
|
19264
|
+
let groupId;
|
|
19265
|
+
if (payload && "groupId" in payload) {
|
|
19266
|
+
groupId = payload.groupId;
|
|
19267
|
+
delete payload.groupId;
|
|
19268
|
+
}
|
|
19269
|
+
devtoolsApi.addTimelineEvent({
|
|
19270
|
+
layerId: "vue-i18n-timeline",
|
|
19271
|
+
event: {
|
|
19272
|
+
title: event,
|
|
19273
|
+
groupId,
|
|
19274
|
+
time: Date.now(),
|
|
19275
|
+
meta: {},
|
|
19276
|
+
data: payload || {},
|
|
19277
|
+
logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
|
|
19278
|
+
}
|
|
19279
|
+
});
|
|
19280
|
+
}
|
|
19281
|
+
}
|
|
19282
|
+
function editScope(payload, i18n2) {
|
|
19283
|
+
const composer = getComposer$1(payload.nodeId, i18n2);
|
|
19284
|
+
if (composer) {
|
|
19285
|
+
const [field] = payload.path;
|
|
19286
|
+
if (field === "locale" && isString$1(payload.state.value)) {
|
|
19287
|
+
composer.locale.value = payload.state.value;
|
|
19288
|
+
} else if (field === "fallbackLocale" && (isString$1(payload.state.value) || isArray$2(payload.state.value) || isObject$4(payload.state.value))) {
|
|
19289
|
+
composer.fallbackLocale.value = payload.state.value;
|
|
19290
|
+
} else if (field === "inheritLocale" && isBoolean(payload.state.value)) {
|
|
19291
|
+
composer.inheritLocale = payload.state.value;
|
|
19292
|
+
}
|
|
19293
|
+
}
|
|
19294
|
+
}
|
|
20820
19295
|
function defineMixin(vuei18n, composer, i18n2) {
|
|
20821
19296
|
return {
|
|
20822
19297
|
beforeCreate() {
|
|
20823
|
-
const instance =
|
|
19298
|
+
const instance = getCurrentInstance();
|
|
20824
19299
|
if (!instance) {
|
|
20825
19300
|
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
20826
19301
|
}
|
|
@@ -20864,12 +19339,30 @@ function defineMixin(vuei18n, composer, i18n2) {
|
|
|
20864
19339
|
this.$tm = (key) => this.$i18n.tm(key);
|
|
20865
19340
|
},
|
|
20866
19341
|
mounted() {
|
|
19342
|
+
if (this.$el && this.$i18n) {
|
|
19343
|
+
this.$el.__VUE_I18N__ = this.$i18n.__composer;
|
|
19344
|
+
const emitter = this.__v_emitter = createEmitter();
|
|
19345
|
+
const _vueI18n = this.$i18n;
|
|
19346
|
+
_vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
|
|
19347
|
+
emitter.on("*", addTimelineEvent);
|
|
19348
|
+
}
|
|
20867
19349
|
},
|
|
20868
19350
|
unmounted() {
|
|
20869
|
-
const instance =
|
|
19351
|
+
const instance = getCurrentInstance();
|
|
20870
19352
|
if (!instance) {
|
|
20871
19353
|
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
20872
19354
|
}
|
|
19355
|
+
if (this.$el && this.$el.__VUE_I18N__) {
|
|
19356
|
+
if (this.__v_emitter) {
|
|
19357
|
+
this.__v_emitter.off("*", addTimelineEvent);
|
|
19358
|
+
delete this.__v_emitter;
|
|
19359
|
+
}
|
|
19360
|
+
if (this.$i18n) {
|
|
19361
|
+
const _vueI18n = this.$i18n;
|
|
19362
|
+
_vueI18n.__disableEmitter && _vueI18n.__disableEmitter();
|
|
19363
|
+
delete this.$el.__VUE_I18N__;
|
|
19364
|
+
}
|
|
19365
|
+
}
|
|
20873
19366
|
delete this.$t;
|
|
20874
19367
|
delete this.$rt;
|
|
20875
19368
|
delete this.$tc;
|
|
@@ -20907,14 +19400,14 @@ function mergeToRoot(root, options) {
|
|
|
20907
19400
|
}
|
|
20908
19401
|
return root;
|
|
20909
19402
|
}
|
|
20910
|
-
const I18nInjectionKey = /* @__PURE__ */
|
|
19403
|
+
const I18nInjectionKey = /* @__PURE__ */ makeSymbol("global-vue-i18n");
|
|
20911
19404
|
function createI18n(options = {}, VueI18nLegacy) {
|
|
20912
|
-
const __legacyMode =
|
|
20913
|
-
const __globalInjection =
|
|
20914
|
-
const __allowComposition = __legacyMode ? !!options.allowComposition : true;
|
|
19405
|
+
const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean(options.legacy) ? options.legacy : __VUE_I18N_LEGACY_API__;
|
|
19406
|
+
const __globalInjection = isBoolean(options.globalInjection) ? options.globalInjection : true;
|
|
19407
|
+
const __allowComposition = __VUE_I18N_LEGACY_API__ && __legacyMode ? !!options.allowComposition : true;
|
|
20915
19408
|
const __instances = /* @__PURE__ */ new Map();
|
|
20916
19409
|
const [globalScope, __global] = createGlobal(options, __legacyMode);
|
|
20917
|
-
const symbol =
|
|
19410
|
+
const symbol = makeSymbol("vue-i18n");
|
|
20918
19411
|
function __getInstance(component) {
|
|
20919
19412
|
return __instances.get(component) || null;
|
|
20920
19413
|
}
|
|
@@ -20927,21 +19420,24 @@ function createI18n(options = {}, VueI18nLegacy) {
|
|
|
20927
19420
|
{
|
|
20928
19421
|
const i18n2 = {
|
|
20929
19422
|
get mode() {
|
|
20930
|
-
return __legacyMode ? "legacy" : "composition";
|
|
19423
|
+
return __VUE_I18N_LEGACY_API__ && __legacyMode ? "legacy" : "composition";
|
|
20931
19424
|
},
|
|
20932
19425
|
get allowComposition() {
|
|
20933
19426
|
return __allowComposition;
|
|
20934
19427
|
},
|
|
20935
19428
|
async install(app, ...options2) {
|
|
19429
|
+
{
|
|
19430
|
+
app.__VUE_I18N__ = i18n2;
|
|
19431
|
+
}
|
|
20936
19432
|
app.__VUE_I18N_SYMBOL__ = symbol;
|
|
20937
19433
|
app.provide(app.__VUE_I18N_SYMBOL__, i18n2);
|
|
20938
19434
|
if (!__legacyMode && __globalInjection) {
|
|
20939
19435
|
injectGlobalFields(app, i18n2.global);
|
|
20940
19436
|
}
|
|
20941
|
-
{
|
|
19437
|
+
if (__VUE_I18N_FULL_INSTALL__) {
|
|
20942
19438
|
apply(app, i18n2, ...options2);
|
|
20943
19439
|
}
|
|
20944
|
-
if (__legacyMode) {
|
|
19440
|
+
if (__VUE_I18N_LEGACY_API__ && __legacyMode) {
|
|
20945
19441
|
app.mixin(defineMixin(__global, __global.__composer, i18n2));
|
|
20946
19442
|
}
|
|
20947
19443
|
const unmountApp = app.unmount;
|
|
@@ -20949,6 +19445,21 @@ function createI18n(options = {}, VueI18nLegacy) {
|
|
|
20949
19445
|
i18n2.dispose();
|
|
20950
19446
|
unmountApp();
|
|
20951
19447
|
};
|
|
19448
|
+
{
|
|
19449
|
+
const ret = await enableDevTools(app, i18n2);
|
|
19450
|
+
if (!ret) {
|
|
19451
|
+
throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
|
|
19452
|
+
}
|
|
19453
|
+
const emitter = createEmitter();
|
|
19454
|
+
if (__legacyMode) {
|
|
19455
|
+
const _vueI18n = __global;
|
|
19456
|
+
_vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
|
|
19457
|
+
} else {
|
|
19458
|
+
const _composer = __global;
|
|
19459
|
+
_composer[EnableEmitter] && _composer[EnableEmitter](emitter);
|
|
19460
|
+
}
|
|
19461
|
+
emitter.on("*", addTimelineEvent);
|
|
19462
|
+
}
|
|
20952
19463
|
},
|
|
20953
19464
|
get global() {
|
|
20954
19465
|
return __global;
|
|
@@ -20965,7 +19476,7 @@ function createI18n(options = {}, VueI18nLegacy) {
|
|
|
20965
19476
|
}
|
|
20966
19477
|
}
|
|
20967
19478
|
function useI18n(options = {}) {
|
|
20968
|
-
const instance =
|
|
19479
|
+
const instance = getCurrentInstance();
|
|
20969
19480
|
if (instance == null) {
|
|
20970
19481
|
throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);
|
|
20971
19482
|
}
|
|
@@ -20976,7 +19487,7 @@ function useI18n(options = {}) {
|
|
|
20976
19487
|
const global2 = getGlobalComposer(i18n2);
|
|
20977
19488
|
const componentOptions = getComponentOptions(instance);
|
|
20978
19489
|
const scope = getScope(options, componentOptions);
|
|
20979
|
-
{
|
|
19490
|
+
if (__VUE_I18N_LEGACY_API__) {
|
|
20980
19491
|
if (i18n2.mode === "legacy" && !options.__useComponent) {
|
|
20981
19492
|
if (!i18n2.allowComposition) {
|
|
20982
19493
|
throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE);
|
|
@@ -20992,7 +19503,7 @@ function useI18n(options = {}) {
|
|
|
20992
19503
|
let composer2 = getComposer(i18n2, instance, options.__useComponent);
|
|
20993
19504
|
if (composer2 == null) {
|
|
20994
19505
|
{
|
|
20995
|
-
|
|
19506
|
+
warn$1(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE));
|
|
20996
19507
|
}
|
|
20997
19508
|
composer2 = global2;
|
|
20998
19509
|
}
|
|
@@ -21001,7 +19512,7 @@ function useI18n(options = {}) {
|
|
|
21001
19512
|
const i18nInternal = i18n2;
|
|
21002
19513
|
let composer = i18nInternal.__getInstance(instance);
|
|
21003
19514
|
if (composer == null) {
|
|
21004
|
-
const composerOptions =
|
|
19515
|
+
const composerOptions = assign({}, options);
|
|
21005
19516
|
if ("__i18n" in componentOptions) {
|
|
21006
19517
|
composerOptions.__i18n = componentOptions.__i18n;
|
|
21007
19518
|
}
|
|
@@ -21009,21 +19520,15 @@ function useI18n(options = {}) {
|
|
|
21009
19520
|
composerOptions.__root = global2;
|
|
21010
19521
|
}
|
|
21011
19522
|
composer = createComposer(composerOptions);
|
|
21012
|
-
setupLifeCycle(i18nInternal, instance);
|
|
19523
|
+
setupLifeCycle(i18nInternal, instance, composer);
|
|
21013
19524
|
i18nInternal.__setInstance(instance, composer);
|
|
21014
19525
|
}
|
|
21015
19526
|
return composer;
|
|
21016
19527
|
}
|
|
21017
|
-
const castToVueI18n = (i18n2) => {
|
|
21018
|
-
if (!(__VUE_I18N_BRIDGE__ in i18n2)) {
|
|
21019
|
-
throw createI18nError(I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N);
|
|
21020
|
-
}
|
|
21021
|
-
return i18n2;
|
|
21022
|
-
};
|
|
21023
19528
|
function createGlobal(options, legacyMode, VueI18nLegacy) {
|
|
21024
|
-
const scope =
|
|
19529
|
+
const scope = effectScope();
|
|
21025
19530
|
{
|
|
21026
|
-
const obj = legacyMode ? scope.run(() => createVueI18n(options)) : scope.run(() => createComposer(options));
|
|
19531
|
+
const obj = __VUE_I18N_LEGACY_API__ && legacyMode ? scope.run(() => createVueI18n(options)) : scope.run(() => createComposer(options));
|
|
21027
19532
|
if (obj == null) {
|
|
21028
19533
|
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
21029
19534
|
}
|
|
@@ -21032,7 +19537,7 @@ function createGlobal(options, legacyMode, VueI18nLegacy) {
|
|
|
21032
19537
|
}
|
|
21033
19538
|
function getI18nInstance(instance) {
|
|
21034
19539
|
{
|
|
21035
|
-
const i18n2 =
|
|
19540
|
+
const i18n2 = inject(!instance.isCE ? instance.appContext.app.__VUE_I18N_SYMBOL__ : I18nInjectionKey);
|
|
21036
19541
|
if (!i18n2) {
|
|
21037
19542
|
throw createI18nError(!instance.isCE ? I18nErrorCodes.UNEXPECTED_ERROR : I18nErrorCodes.NOT_INSLALLED_WITH_PROVIDE);
|
|
21038
19543
|
}
|
|
@@ -21040,7 +19545,7 @@ function getI18nInstance(instance) {
|
|
|
21040
19545
|
}
|
|
21041
19546
|
}
|
|
21042
19547
|
function getScope(options, componentOptions) {
|
|
21043
|
-
return
|
|
19548
|
+
return isEmptyObject(options) ? "__i18n" in componentOptions ? "local" : "global" : !options.useScope ? "local" : options.useScope;
|
|
21044
19549
|
}
|
|
21045
19550
|
function getGlobalComposer(i18n2) {
|
|
21046
19551
|
return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
|
|
@@ -21054,7 +19559,7 @@ function getComposer(i18n2, target, useComponent = false) {
|
|
|
21054
19559
|
if (i18n2.mode === "composition") {
|
|
21055
19560
|
composer = i18nInternal.__getInstance(current);
|
|
21056
19561
|
} else {
|
|
21057
|
-
{
|
|
19562
|
+
if (__VUE_I18N_LEGACY_API__) {
|
|
21058
19563
|
const vueI18n = i18nInternal.__getInstance(current);
|
|
21059
19564
|
if (vueI18n != null) {
|
|
21060
19565
|
composer = vueI18n.__composer;
|
|
@@ -21075,39 +19580,53 @@ function getComposer(i18n2, target, useComponent = false) {
|
|
|
21075
19580
|
return composer;
|
|
21076
19581
|
}
|
|
21077
19582
|
function setupLifeCycle(i18n2, target, composer) {
|
|
19583
|
+
let emitter = null;
|
|
21078
19584
|
{
|
|
21079
|
-
|
|
19585
|
+
onMounted(() => {
|
|
19586
|
+
if (target.vnode.el) {
|
|
19587
|
+
target.vnode.el.__VUE_I18N__ = composer;
|
|
19588
|
+
emitter = createEmitter();
|
|
19589
|
+
const _composer = composer;
|
|
19590
|
+
_composer[EnableEmitter] && _composer[EnableEmitter](emitter);
|
|
19591
|
+
emitter.on("*", addTimelineEvent);
|
|
19592
|
+
}
|
|
21080
19593
|
}, target);
|
|
21081
|
-
|
|
19594
|
+
onUnmounted(() => {
|
|
19595
|
+
if (target.vnode.el && target.vnode.el.__VUE_I18N__) {
|
|
19596
|
+
emitter && emitter.off("*", addTimelineEvent);
|
|
19597
|
+
const _composer = composer;
|
|
19598
|
+
_composer[DisableEmitter] && _composer[DisableEmitter]();
|
|
19599
|
+
delete target.vnode.el.__VUE_I18N__;
|
|
19600
|
+
}
|
|
21082
19601
|
i18n2.__deleteInstance(target);
|
|
21083
19602
|
}, target);
|
|
21084
19603
|
}
|
|
21085
19604
|
}
|
|
21086
19605
|
function useI18nForLegacy(instance, scope, root, options = {}) {
|
|
21087
19606
|
const isLocale = scope === "local";
|
|
21088
|
-
const _composer =
|
|
19607
|
+
const _composer = shallowRef(null);
|
|
21089
19608
|
if (isLocale && instance.proxy && !(instance.proxy.$options.i18n || instance.proxy.$options.__i18n)) {
|
|
21090
19609
|
throw createI18nError(I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);
|
|
21091
19610
|
}
|
|
21092
|
-
const _inheritLocale =
|
|
21093
|
-
const _locale =
|
|
21094
|
-
isLocale && _inheritLocale ? root.locale.value :
|
|
19611
|
+
const _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
|
19612
|
+
const _locale = ref(
|
|
19613
|
+
isLocale && _inheritLocale ? root.locale.value : isString$1(options.locale) ? options.locale : DEFAULT_LOCALE$1
|
|
21095
19614
|
);
|
|
21096
|
-
const _fallbackLocale =
|
|
21097
|
-
isLocale && _inheritLocale ? root.fallbackLocale.value :
|
|
19615
|
+
const _fallbackLocale = ref(
|
|
19616
|
+
isLocale && _inheritLocale ? root.fallbackLocale.value : isString$1(options.fallbackLocale) || isArray$2(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
|
|
21098
19617
|
);
|
|
21099
|
-
const _messages =
|
|
21100
|
-
const _datetimeFormats =
|
|
21101
|
-
const _numberFormats =
|
|
21102
|
-
const _missingWarn = isLocale ? root.missingWarn :
|
|
21103
|
-
const _fallbackWarn = isLocale ? root.fallbackWarn :
|
|
21104
|
-
const _fallbackRoot = isLocale ? root.fallbackRoot :
|
|
19618
|
+
const _messages = ref(getLocaleMessages(_locale.value, options));
|
|
19619
|
+
const _datetimeFormats = ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
|
19620
|
+
const _numberFormats = ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
|
19621
|
+
const _missingWarn = isLocale ? root.missingWarn : isBoolean(options.missingWarn) || isRegExp$1(options.missingWarn) ? options.missingWarn : true;
|
|
19622
|
+
const _fallbackWarn = isLocale ? root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp$1(options.fallbackWarn) ? options.fallbackWarn : true;
|
|
19623
|
+
const _fallbackRoot = isLocale ? root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
|
|
21105
19624
|
const _fallbackFormat = !!options.fallbackFormat;
|
|
21106
|
-
const _missing =
|
|
21107
|
-
const _postTranslation =
|
|
21108
|
-
const _warnHtmlMessage = isLocale ? root.warnHtmlMessage :
|
|
19625
|
+
const _missing = isFunction$1(options.missing) ? options.missing : null;
|
|
19626
|
+
const _postTranslation = isFunction$1(options.postTranslation) ? options.postTranslation : null;
|
|
19627
|
+
const _warnHtmlMessage = isLocale ? root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
|
|
21109
19628
|
const _escapeParameter = !!options.escapeParameter;
|
|
21110
|
-
const _modifiers = isLocale ? root.modifiers :
|
|
19629
|
+
const _modifiers = isLocale ? root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
|
|
21111
19630
|
const _pluralRules = options.pluralRules || isLocale && root.pluralRules;
|
|
21112
19631
|
function trackReactivityValues() {
|
|
21113
19632
|
return [
|
|
@@ -21118,7 +19637,7 @@ function useI18nForLegacy(instance, scope, root, options = {}) {
|
|
|
21118
19637
|
_numberFormats.value
|
|
21119
19638
|
];
|
|
21120
19639
|
}
|
|
21121
|
-
const locale2 =
|
|
19640
|
+
const locale2 = computed({
|
|
21122
19641
|
get: () => {
|
|
21123
19642
|
return _composer.value ? _composer.value.locale.value : _locale.value;
|
|
21124
19643
|
},
|
|
@@ -21129,7 +19648,7 @@ function useI18nForLegacy(instance, scope, root, options = {}) {
|
|
|
21129
19648
|
_locale.value = val;
|
|
21130
19649
|
}
|
|
21131
19650
|
});
|
|
21132
|
-
const fallbackLocale =
|
|
19651
|
+
const fallbackLocale = computed({
|
|
21133
19652
|
get: () => {
|
|
21134
19653
|
return _composer.value ? _composer.value.fallbackLocale.value : _fallbackLocale.value;
|
|
21135
19654
|
},
|
|
@@ -21140,15 +19659,15 @@ function useI18nForLegacy(instance, scope, root, options = {}) {
|
|
|
21140
19659
|
_fallbackLocale.value = val;
|
|
21141
19660
|
}
|
|
21142
19661
|
});
|
|
21143
|
-
const messages =
|
|
19662
|
+
const messages = computed(() => {
|
|
21144
19663
|
if (_composer.value) {
|
|
21145
19664
|
return _composer.value.messages.value;
|
|
21146
19665
|
} else {
|
|
21147
19666
|
return _messages.value;
|
|
21148
19667
|
}
|
|
21149
19668
|
});
|
|
21150
|
-
const datetimeFormats =
|
|
21151
|
-
const numberFormats =
|
|
19669
|
+
const datetimeFormats = computed(() => _datetimeFormats.value);
|
|
19670
|
+
const numberFormats = computed(() => _numberFormats.value);
|
|
21152
19671
|
function getPostTranslationHandler() {
|
|
21153
19672
|
return _composer.value ? _composer.value.getPostTranslationHandler() : _postTranslation;
|
|
21154
19673
|
}
|
|
@@ -21345,7 +19864,7 @@ function useI18nForLegacy(instance, scope, root, options = {}) {
|
|
|
21345
19864
|
composer.missingWarn = _missingWarn;
|
|
21346
19865
|
composer.warnHtmlMessage = _warnHtmlMessage;
|
|
21347
19866
|
}
|
|
21348
|
-
|
|
19867
|
+
onBeforeMount(() => {
|
|
21349
19868
|
if (instance.proxy == null || instance.proxy.$i18n == null) {
|
|
21350
19869
|
throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);
|
|
21351
19870
|
}
|
|
@@ -21375,7 +19894,7 @@ function injectGlobalFields(app, composer) {
|
|
|
21375
19894
|
if (!desc) {
|
|
21376
19895
|
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
21377
19896
|
}
|
|
21378
|
-
const wrap =
|
|
19897
|
+
const wrap = isRef(desc.value) ? {
|
|
21379
19898
|
get() {
|
|
21380
19899
|
return desc.value.value;
|
|
21381
19900
|
},
|
|
@@ -21398,24 +19917,18 @@ function injectGlobalFields(app, composer) {
|
|
|
21398
19917
|
Object.defineProperty(app.config.globalProperties, `$${method}`, desc);
|
|
21399
19918
|
});
|
|
21400
19919
|
}
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
|
|
19920
|
+
registerMessageCompiler(compileToFunction);
|
|
19921
|
+
registerMessageResolver(resolveValue);
|
|
19922
|
+
registerLocaleFallbacker(fallbackWithLocaleChain);
|
|
21404
19923
|
{
|
|
21405
|
-
|
|
19924
|
+
initFeatureFlags();
|
|
19925
|
+
}
|
|
19926
|
+
{
|
|
19927
|
+
const target = getGlobalThis();
|
|
21406
19928
|
target.__INTLIFY__ = true;
|
|
21407
|
-
|
|
21408
|
-
}
|
|
21409
|
-
|
|
21410
|
-
vueI18n_cjs.I18nInjectionKey = I18nInjectionKey;
|
|
21411
|
-
vueI18n_cjs.NumberFormat = NumberFormat;
|
|
21412
|
-
vueI18n_cjs.Translation = Translation;
|
|
21413
|
-
vueI18n_cjs.VERSION = VERSION;
|
|
21414
|
-
vueI18n_cjs.castToVueI18n = castToVueI18n;
|
|
21415
|
-
var createI18n_1 = vueI18n_cjs.createI18n = createI18n;
|
|
21416
|
-
vueI18n_cjs.useI18n = useI18n;
|
|
21417
|
-
vueI18n_cjs.vTDirective = vTDirective;
|
|
21418
|
-
var i18n$1 = createI18n_1({
|
|
19929
|
+
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
|
|
19930
|
+
}
|
|
19931
|
+
var i18n$1 = createI18n({
|
|
21419
19932
|
allowComposition: true,
|
|
21420
19933
|
globalInjection: true,
|
|
21421
19934
|
fallbackWarn: false,
|
|
@@ -21461,7 +19974,7 @@ var i18n = {
|
|
|
21461
19974
|
},
|
|
21462
19975
|
actions: {
|
|
21463
19976
|
setLocale({ state }, { locale: locale2 = Setting.i18n.default, vm }) {
|
|
21464
|
-
const db2 = util$
|
|
19977
|
+
const db2 = util$2.db.get(
|
|
21465
19978
|
pathInit({
|
|
21466
19979
|
dbName: "database",
|
|
21467
19980
|
path: "",
|
|
@@ -21480,7 +19993,7 @@ var i18n = {
|
|
|
21480
19993
|
},
|
|
21481
19994
|
async load({ state }, app) {
|
|
21482
19995
|
let locale2;
|
|
21483
|
-
const db2 = util$
|
|
19996
|
+
const db2 = util$2.db.get(
|
|
21484
19997
|
pathInit({
|
|
21485
19998
|
dbName: "database",
|
|
21486
19999
|
path: "",
|
|
@@ -21799,8 +20312,8 @@ var log$2 = {
|
|
|
21799
20312
|
time: format$3(new Date(), "yyyy-MM-dd HH:mm:ss"),
|
|
21800
20313
|
meta: {
|
|
21801
20314
|
user: rootState.admin.user.info,
|
|
21802
|
-
uuid: util$
|
|
21803
|
-
token: util$
|
|
20315
|
+
uuid: util$2.cookies.get("uuid"),
|
|
20316
|
+
token: util$2.cookies.get("token"),
|
|
21804
20317
|
url: lodash$1.exports.get(window, "location.href", ""),
|
|
21805
20318
|
...meta
|
|
21806
20319
|
}
|
|
@@ -22757,7 +21270,7 @@ const initRouter = (pages2, routes) => {
|
|
|
22757
21270
|
});
|
|
22758
21271
|
} else {
|
|
22759
21272
|
if (to.matched.some((item) => item.meta.auth)) {
|
|
22760
|
-
const token = util$
|
|
21273
|
+
const token = util$2.cookies.get("token");
|
|
22761
21274
|
if (token && token !== "undefined") {
|
|
22762
21275
|
const permissions = store.getters["admin/menu/permission"];
|
|
22763
21276
|
if (permissions[to.path.substring(1)]) {
|
|
@@ -22872,7 +21385,7 @@ var mixinPage = {
|
|
|
22872
21385
|
return this.apiBaseURL + "api/Attachment/add";
|
|
22873
21386
|
},
|
|
22874
21387
|
uploadHeaders() {
|
|
22875
|
-
const token = util$
|
|
21388
|
+
const token = util$2.cookies.get("token");
|
|
22876
21389
|
return {
|
|
22877
21390
|
Authorization: "Bearer " + token
|
|
22878
21391
|
};
|
|
@@ -35320,7 +33833,7 @@ const _sfc_main$D = {
|
|
|
35320
33833
|
},
|
|
35321
33834
|
computed: {
|
|
35322
33835
|
config() {
|
|
35323
|
-
const token = util$
|
|
33836
|
+
const token = util$2.cookies.get("token");
|
|
35324
33837
|
return {
|
|
35325
33838
|
height: this.height == null ? 500 : this.height,
|
|
35326
33839
|
fileTools_requestHeaders: {
|
|
@@ -48571,7 +47084,7 @@ var require$$1 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
48571
47084
|
var propertyIsEnumerableModule = __webpack_require__("d1e7");
|
|
48572
47085
|
var createNonEnumerableProperty = __webpack_require__("9112");
|
|
48573
47086
|
var redefine = __webpack_require__("6eeb");
|
|
48574
|
-
var
|
|
47087
|
+
var shared = __webpack_require__("5692");
|
|
48575
47088
|
var sharedKey = __webpack_require__("f772");
|
|
48576
47089
|
var hiddenKeys = __webpack_require__("d012");
|
|
48577
47090
|
var uid = __webpack_require__("90e3");
|
|
@@ -48594,11 +47107,11 @@ var require$$1 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
48594
47107
|
var nativeDefineProperty = definePropertyModule.f;
|
|
48595
47108
|
var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
|
48596
47109
|
var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
48597
|
-
var AllSymbols =
|
|
48598
|
-
var ObjectPrototypeSymbols =
|
|
48599
|
-
var StringToSymbolRegistry =
|
|
48600
|
-
var SymbolToStringRegistry =
|
|
48601
|
-
var WellKnownSymbolsStore =
|
|
47110
|
+
var AllSymbols = shared("symbols");
|
|
47111
|
+
var ObjectPrototypeSymbols = shared("op-symbols");
|
|
47112
|
+
var StringToSymbolRegistry = shared("string-to-symbol-registry");
|
|
47113
|
+
var SymbolToStringRegistry = shared("symbol-to-string-registry");
|
|
47114
|
+
var WellKnownSymbolsStore = shared("wks");
|
|
48602
47115
|
var QObject = global2.QObject;
|
|
48603
47116
|
var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
|
48604
47117
|
var setSymbolDescriptor = DESCRIPTORS && fails(function() {
|
|
@@ -48627,7 +47140,7 @@ var require$$1 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
48627
47140
|
symbol.description = description;
|
|
48628
47141
|
return symbol;
|
|
48629
47142
|
};
|
|
48630
|
-
var
|
|
47143
|
+
var isSymbol = USE_SYMBOL_AS_UID ? function(it) {
|
|
48631
47144
|
return typeof it == "symbol";
|
|
48632
47145
|
} : function(it) {
|
|
48633
47146
|
return Object(it) instanceof $Symbol;
|
|
@@ -48763,7 +47276,7 @@ var require$$1 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
48763
47276
|
return symbol;
|
|
48764
47277
|
},
|
|
48765
47278
|
keyFor: function keyFor(sym) {
|
|
48766
|
-
if (!
|
|
47279
|
+
if (!isSymbol(sym))
|
|
48767
47280
|
throw TypeError(sym + " is not a symbol");
|
|
48768
47281
|
if (has2(SymbolToStringRegistry, sym))
|
|
48769
47282
|
return SymbolToStringRegistry[sym];
|
|
@@ -48805,13 +47318,13 @@ var require$$1 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
48805
47318
|
while (arguments.length > index2)
|
|
48806
47319
|
args.push(arguments[index2++]);
|
|
48807
47320
|
$replacer = replacer;
|
|
48808
|
-
if (!isObject2(replacer) && it === void 0 ||
|
|
47321
|
+
if (!isObject2(replacer) && it === void 0 || isSymbol(it))
|
|
48809
47322
|
return;
|
|
48810
47323
|
if (!isArray2(replacer))
|
|
48811
47324
|
replacer = function(key, value) {
|
|
48812
47325
|
if (typeof $replacer == "function")
|
|
48813
47326
|
value = $replacer.call(this, key, value);
|
|
48814
|
-
if (!
|
|
47327
|
+
if (!isSymbol(value))
|
|
48815
47328
|
return value;
|
|
48816
47329
|
};
|
|
48817
47330
|
args[1] = replacer;
|
|
@@ -48989,12 +47502,12 @@ var require$$1 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
48989
47502
|
},
|
|
48990
47503
|
"b622": function(module2, exports2, __webpack_require__) {
|
|
48991
47504
|
var global2 = __webpack_require__("da84");
|
|
48992
|
-
var
|
|
47505
|
+
var shared = __webpack_require__("5692");
|
|
48993
47506
|
var has2 = __webpack_require__("5135");
|
|
48994
47507
|
var uid = __webpack_require__("90e3");
|
|
48995
47508
|
var NATIVE_SYMBOL = __webpack_require__("4930");
|
|
48996
47509
|
var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
|
|
48997
|
-
var WellKnownSymbolsStore =
|
|
47510
|
+
var WellKnownSymbolsStore = shared("wks");
|
|
48998
47511
|
var Symbol2 = global2.Symbol;
|
|
48999
47512
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
|
|
49000
47513
|
module2.exports = function(name) {
|
|
@@ -49693,9 +48206,9 @@ var require$$1 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
49693
48206
|
};
|
|
49694
48207
|
},
|
|
49695
48208
|
"f772": function(module2, exports2, __webpack_require__) {
|
|
49696
|
-
var
|
|
48209
|
+
var shared = __webpack_require__("5692");
|
|
49697
48210
|
var uid = __webpack_require__("90e3");
|
|
49698
|
-
var keys2 =
|
|
48211
|
+
var keys2 = shared("keys");
|
|
49699
48212
|
module2.exports = function(key) {
|
|
49700
48213
|
return keys2[key] || (keys2[key] = uid(key));
|
|
49701
48214
|
};
|
|
@@ -86006,10 +84519,10 @@ var SVGPainter = function() {
|
|
|
86006
84519
|
}
|
|
86007
84520
|
this._oldVNode = null;
|
|
86008
84521
|
};
|
|
86009
|
-
SVGPainter2.prototype.toDataURL = function(
|
|
84522
|
+
SVGPainter2.prototype.toDataURL = function(base64) {
|
|
86010
84523
|
var str = this.renderToString();
|
|
86011
84524
|
var prefix2 = "data:image/svg+xml;";
|
|
86012
|
-
if (
|
|
84525
|
+
if (base64) {
|
|
86013
84526
|
str = encodeBase64(str);
|
|
86014
84527
|
return str && prefix2 + "base64," + str;
|
|
86015
84528
|
}
|
|
@@ -127315,6 +125828,7 @@ const components = {
|
|
|
127315
125828
|
const install = function(app) {
|
|
127316
125829
|
if (install.installed)
|
|
127317
125830
|
return;
|
|
125831
|
+
app.use(router$1);
|
|
127318
125832
|
app.use(store);
|
|
127319
125833
|
app.use(i18n$1);
|
|
127320
125834
|
app.use(ViewUIPlus, {
|
|
@@ -127336,17 +125850,21 @@ const pages = {};
|
|
|
127336
125850
|
Object.keys(files).forEach((key) => {
|
|
127337
125851
|
pages[key.replace(/(\.\/pages\/)/g, "")] = files[key].default;
|
|
127338
125852
|
});
|
|
127339
|
-
const created = async (app,
|
|
125853
|
+
const created = async (app, routes, files2) => {
|
|
125854
|
+
app.use(API);
|
|
127340
125855
|
if (window) {
|
|
127341
125856
|
window.$app = getCurrentInstance();
|
|
127342
125857
|
window.$app.$t = i18n$1.global.t;
|
|
127343
125858
|
window.$app.$Message = app.config.globalProperties.$Message;
|
|
127344
125859
|
window.$app.$Notice = app.config.globalProperties.$Notice;
|
|
127345
125860
|
}
|
|
127346
|
-
|
|
125861
|
+
Object.keys(files2).forEach((key) => {
|
|
125862
|
+
pages[key.replace(/(\.\/pages\/)/g, "")] = files2[key].default;
|
|
125863
|
+
});
|
|
125864
|
+
initRouter(pages, routes);
|
|
127347
125865
|
store.dispatch("admin/i18n/load", app);
|
|
127348
125866
|
store.commit("admin/menu/setHeader", menuHeader);
|
|
127349
125867
|
store.dispatch("admin/account/load");
|
|
127350
|
-
app.config.globalProperties.$pages =
|
|
125868
|
+
app.config.globalProperties.$pages = pages;
|
|
127351
125869
|
};
|
|
127352
|
-
export { App, applicationApi, index as basicLayout, created, customModelApi, dataSourceApi, API as default, i18n$1 as i18n, initRouter, lodop, mixinPage, modelApi, pages, service as request, router$1 as router, Setting as setting, store, taskApi, util$
|
|
125870
|
+
export { App, applicationApi, index as basicLayout, created, customModelApi, dataSourceApi, API as default, i18n$1 as i18n, initRouter, lodop, mixinPage, modelApi, pages, service as request, router$1 as router, Setting as setting, store, taskApi, util$2 as util };
|