strapi-plugin-json-schema-validation 0.0.0
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/README.md +3 -0
- package/dist/admin/en-BraAp_Lr.js +16 -0
- package/dist/admin/en-BraAp_Lr.js.map +1 -0
- package/dist/admin/en-Cum_oOSk.mjs +16 -0
- package/dist/admin/en-Cum_oOSk.mjs.map +1 -0
- package/dist/admin/index-BcXgK01l.js +4392 -0
- package/dist/admin/index-BcXgK01l.js.map +1 -0
- package/dist/admin/index-C3Q0T-w5.mjs +4393 -0
- package/dist/admin/index-C3Q0T-w5.mjs.map +1 -0
- package/dist/admin/index-C42REwDe.js +138 -0
- package/dist/admin/index-C42REwDe.js.map +1 -0
- package/dist/admin/index-C9Ge6gj7.mjs +135 -0
- package/dist/admin/index-C9Ge6gj7.mjs.map +1 -0
- package/dist/admin/index.js +6 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/index.mjs +6 -0
- package/dist/admin/index.mjs.map +1 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/JSONSchemaValidationInput/index.d.ts +3 -0
- package/dist/admin/src/components/JSONSchemaValidationInput/styled.d.ts +13 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/index.d.ts +13 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/translations/en.json.d.ts +11 -0
- package/dist/admin/src/translations/types.d.ts +3 -0
- package/dist/admin/src/utils/getTranslation.d.ts +3 -0
- package/dist/admin/src/utils/prefixPluginTranslation.d.ts +3 -0
- package/dist/admin/src/utils/preloadedJsonSchema.d.ts +3 -0
- package/dist/server/index.js +164 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +161 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +5 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/controller.d.ts +9 -0
- package/dist/server/src/controllers/index.d.ts +25 -0
- package/dist/server/src/controllers/validation.d.ts +10 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +82 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin/index.d.ts +9 -0
- package/dist/server/src/routes/content-api/index.d.ts +12 -0
- package/dist/server/src/routes/index.d.ts +22 -0
- package/dist/server/src/services/index.d.ts +40 -0
- package/dist/server/src/services/service.d.ts +9 -0
- package/dist/server/src/services/validation.d.ts +31 -0
- package/dist/server/src/utils/ajv.d.ts +3 -0
- package/dist/server/src/utils/names.d.ts +4 -0
- package/package.json +96 -0
|
@@ -0,0 +1,4393 @@
|
|
|
1
|
+
import { Braces } from "lucide-react";
|
|
2
|
+
import { Validator } from "jsonschema";
|
|
3
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
4
|
+
const v2 = glob[path];
|
|
5
|
+
if (v2) {
|
|
6
|
+
return typeof v2 === "function" ? v2() : Promise.resolve(v2);
|
|
7
|
+
}
|
|
8
|
+
return new Promise((_, reject) => {
|
|
9
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
10
|
+
reject.bind(
|
|
11
|
+
null,
|
|
12
|
+
new Error(
|
|
13
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
14
|
+
)
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var map;
|
|
20
|
+
try {
|
|
21
|
+
map = Map;
|
|
22
|
+
} catch (_) {
|
|
23
|
+
}
|
|
24
|
+
var set;
|
|
25
|
+
try {
|
|
26
|
+
set = Set;
|
|
27
|
+
} catch (_) {
|
|
28
|
+
}
|
|
29
|
+
function baseClone(src, circulars, clones) {
|
|
30
|
+
if (!src || typeof src !== "object" || typeof src === "function") {
|
|
31
|
+
return src;
|
|
32
|
+
}
|
|
33
|
+
if (src.nodeType && "cloneNode" in src) {
|
|
34
|
+
return src.cloneNode(true);
|
|
35
|
+
}
|
|
36
|
+
if (src instanceof Date) {
|
|
37
|
+
return new Date(src.getTime());
|
|
38
|
+
}
|
|
39
|
+
if (src instanceof RegExp) {
|
|
40
|
+
return new RegExp(src);
|
|
41
|
+
}
|
|
42
|
+
if (Array.isArray(src)) {
|
|
43
|
+
return src.map(clone);
|
|
44
|
+
}
|
|
45
|
+
if (map && src instanceof map) {
|
|
46
|
+
return new Map(Array.from(src.entries()));
|
|
47
|
+
}
|
|
48
|
+
if (set && src instanceof set) {
|
|
49
|
+
return new Set(Array.from(src.values()));
|
|
50
|
+
}
|
|
51
|
+
if (src instanceof Object) {
|
|
52
|
+
circulars.push(src);
|
|
53
|
+
var obj = Object.create(src);
|
|
54
|
+
clones.push(obj);
|
|
55
|
+
for (var key in src) {
|
|
56
|
+
var idx = circulars.findIndex(function(i) {
|
|
57
|
+
return i === src[key];
|
|
58
|
+
});
|
|
59
|
+
obj[key] = idx > -1 ? clones[idx] : baseClone(src[key], circulars, clones);
|
|
60
|
+
}
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
return src;
|
|
64
|
+
}
|
|
65
|
+
function clone(src) {
|
|
66
|
+
return baseClone(src, [], []);
|
|
67
|
+
}
|
|
68
|
+
const toString = Object.prototype.toString;
|
|
69
|
+
const errorToString = Error.prototype.toString;
|
|
70
|
+
const regExpToString = RegExp.prototype.toString;
|
|
71
|
+
const symbolToString = typeof Symbol !== "undefined" ? Symbol.prototype.toString : () => "";
|
|
72
|
+
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
|
|
73
|
+
function printNumber(val) {
|
|
74
|
+
if (val != +val) return "NaN";
|
|
75
|
+
const isNegativeZero = val === 0 && 1 / val < 0;
|
|
76
|
+
return isNegativeZero ? "-0" : "" + val;
|
|
77
|
+
}
|
|
78
|
+
function printSimpleValue(val, quoteStrings = false) {
|
|
79
|
+
if (val == null || val === true || val === false) return "" + val;
|
|
80
|
+
const typeOf = typeof val;
|
|
81
|
+
if (typeOf === "number") return printNumber(val);
|
|
82
|
+
if (typeOf === "string") return quoteStrings ? `"${val}"` : val;
|
|
83
|
+
if (typeOf === "function") return "[Function " + (val.name || "anonymous") + "]";
|
|
84
|
+
if (typeOf === "symbol") return symbolToString.call(val).replace(SYMBOL_REGEXP, "Symbol($1)");
|
|
85
|
+
const tag = toString.call(val).slice(8, -1);
|
|
86
|
+
if (tag === "Date") return isNaN(val.getTime()) ? "" + val : val.toISOString(val);
|
|
87
|
+
if (tag === "Error" || val instanceof Error) return "[" + errorToString.call(val) + "]";
|
|
88
|
+
if (tag === "RegExp") return regExpToString.call(val);
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
function printValue(value, quoteStrings) {
|
|
92
|
+
let result = printSimpleValue(value, quoteStrings);
|
|
93
|
+
if (result !== null) return result;
|
|
94
|
+
return JSON.stringify(value, function(key, value2) {
|
|
95
|
+
let result2 = printSimpleValue(this[key], quoteStrings);
|
|
96
|
+
if (result2 !== null) return result2;
|
|
97
|
+
return value2;
|
|
98
|
+
}, 2);
|
|
99
|
+
}
|
|
100
|
+
let mixed = {
|
|
101
|
+
default: "${path} is invalid",
|
|
102
|
+
required: "${path} is a required field",
|
|
103
|
+
oneOf: "${path} must be one of the following values: ${values}",
|
|
104
|
+
notOneOf: "${path} must not be one of the following values: ${values}",
|
|
105
|
+
notType: ({
|
|
106
|
+
path,
|
|
107
|
+
type,
|
|
108
|
+
value,
|
|
109
|
+
originalValue
|
|
110
|
+
}) => {
|
|
111
|
+
let isCast = originalValue != null && originalValue !== value;
|
|
112
|
+
let msg = `${path} must be a \`${type}\` type, but the final value was: \`${printValue(value, true)}\`` + (isCast ? ` (cast from the value \`${printValue(originalValue, true)}\`).` : ".");
|
|
113
|
+
if (value === null) {
|
|
114
|
+
msg += `
|
|
115
|
+
If "null" is intended as an empty value be sure to mark the schema as \`.nullable()\``;
|
|
116
|
+
}
|
|
117
|
+
return msg;
|
|
118
|
+
},
|
|
119
|
+
defined: "${path} must be defined"
|
|
120
|
+
};
|
|
121
|
+
let string = {
|
|
122
|
+
length: "${path} must be exactly ${length} characters",
|
|
123
|
+
min: "${path} must be at least ${min} characters",
|
|
124
|
+
max: "${path} must be at most ${max} characters",
|
|
125
|
+
matches: '${path} must match the following: "${regex}"',
|
|
126
|
+
email: "${path} must be a valid email",
|
|
127
|
+
url: "${path} must be a valid URL",
|
|
128
|
+
uuid: "${path} must be a valid UUID",
|
|
129
|
+
trim: "${path} must be a trimmed string",
|
|
130
|
+
lowercase: "${path} must be a lowercase string",
|
|
131
|
+
uppercase: "${path} must be a upper case string"
|
|
132
|
+
};
|
|
133
|
+
let number = {
|
|
134
|
+
min: "${path} must be greater than or equal to ${min}",
|
|
135
|
+
max: "${path} must be less than or equal to ${max}",
|
|
136
|
+
lessThan: "${path} must be less than ${less}",
|
|
137
|
+
moreThan: "${path} must be greater than ${more}",
|
|
138
|
+
positive: "${path} must be a positive number",
|
|
139
|
+
negative: "${path} must be a negative number",
|
|
140
|
+
integer: "${path} must be an integer"
|
|
141
|
+
};
|
|
142
|
+
let date = {
|
|
143
|
+
min: "${path} field must be later than ${min}",
|
|
144
|
+
max: "${path} field must be at earlier than ${max}"
|
|
145
|
+
};
|
|
146
|
+
let boolean = {
|
|
147
|
+
isValue: "${path} field must be ${value}"
|
|
148
|
+
};
|
|
149
|
+
let object = {
|
|
150
|
+
noUnknown: "${path} field has unspecified keys: ${unknown}"
|
|
151
|
+
};
|
|
152
|
+
let array = {
|
|
153
|
+
min: "${path} field must have at least ${min} items",
|
|
154
|
+
max: "${path} field must have less than or equal to ${max} items",
|
|
155
|
+
length: "${path} must be have ${length} items"
|
|
156
|
+
};
|
|
157
|
+
Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
158
|
+
mixed,
|
|
159
|
+
string,
|
|
160
|
+
number,
|
|
161
|
+
date,
|
|
162
|
+
object,
|
|
163
|
+
array,
|
|
164
|
+
boolean
|
|
165
|
+
});
|
|
166
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
167
|
+
function getDefaultExportFromCjs(x) {
|
|
168
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
169
|
+
}
|
|
170
|
+
var _baseHas;
|
|
171
|
+
var hasRequired_baseHas;
|
|
172
|
+
function require_baseHas() {
|
|
173
|
+
if (hasRequired_baseHas) return _baseHas;
|
|
174
|
+
hasRequired_baseHas = 1;
|
|
175
|
+
var objectProto = Object.prototype;
|
|
176
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
177
|
+
function baseHas(object2, key) {
|
|
178
|
+
return object2 != null && hasOwnProperty.call(object2, key);
|
|
179
|
+
}
|
|
180
|
+
_baseHas = baseHas;
|
|
181
|
+
return _baseHas;
|
|
182
|
+
}
|
|
183
|
+
var isArray_1;
|
|
184
|
+
var hasRequiredIsArray;
|
|
185
|
+
function requireIsArray() {
|
|
186
|
+
if (hasRequiredIsArray) return isArray_1;
|
|
187
|
+
hasRequiredIsArray = 1;
|
|
188
|
+
var isArray = Array.isArray;
|
|
189
|
+
isArray_1 = isArray;
|
|
190
|
+
return isArray_1;
|
|
191
|
+
}
|
|
192
|
+
var _freeGlobal;
|
|
193
|
+
var hasRequired_freeGlobal;
|
|
194
|
+
function require_freeGlobal() {
|
|
195
|
+
if (hasRequired_freeGlobal) return _freeGlobal;
|
|
196
|
+
hasRequired_freeGlobal = 1;
|
|
197
|
+
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
198
|
+
_freeGlobal = freeGlobal;
|
|
199
|
+
return _freeGlobal;
|
|
200
|
+
}
|
|
201
|
+
var _root;
|
|
202
|
+
var hasRequired_root;
|
|
203
|
+
function require_root() {
|
|
204
|
+
if (hasRequired_root) return _root;
|
|
205
|
+
hasRequired_root = 1;
|
|
206
|
+
var freeGlobal = require_freeGlobal();
|
|
207
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
208
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
209
|
+
_root = root;
|
|
210
|
+
return _root;
|
|
211
|
+
}
|
|
212
|
+
var _Symbol;
|
|
213
|
+
var hasRequired_Symbol;
|
|
214
|
+
function require_Symbol() {
|
|
215
|
+
if (hasRequired_Symbol) return _Symbol;
|
|
216
|
+
hasRequired_Symbol = 1;
|
|
217
|
+
var root = require_root();
|
|
218
|
+
var Symbol2 = root.Symbol;
|
|
219
|
+
_Symbol = Symbol2;
|
|
220
|
+
return _Symbol;
|
|
221
|
+
}
|
|
222
|
+
var _getRawTag;
|
|
223
|
+
var hasRequired_getRawTag;
|
|
224
|
+
function require_getRawTag() {
|
|
225
|
+
if (hasRequired_getRawTag) return _getRawTag;
|
|
226
|
+
hasRequired_getRawTag = 1;
|
|
227
|
+
var Symbol2 = require_Symbol();
|
|
228
|
+
var objectProto = Object.prototype;
|
|
229
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
230
|
+
var nativeObjectToString = objectProto.toString;
|
|
231
|
+
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
232
|
+
function getRawTag(value) {
|
|
233
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
234
|
+
try {
|
|
235
|
+
value[symToStringTag] = void 0;
|
|
236
|
+
var unmasked = true;
|
|
237
|
+
} catch (e) {
|
|
238
|
+
}
|
|
239
|
+
var result = nativeObjectToString.call(value);
|
|
240
|
+
if (unmasked) {
|
|
241
|
+
if (isOwn) {
|
|
242
|
+
value[symToStringTag] = tag;
|
|
243
|
+
} else {
|
|
244
|
+
delete value[symToStringTag];
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
_getRawTag = getRawTag;
|
|
250
|
+
return _getRawTag;
|
|
251
|
+
}
|
|
252
|
+
var _objectToString;
|
|
253
|
+
var hasRequired_objectToString;
|
|
254
|
+
function require_objectToString() {
|
|
255
|
+
if (hasRequired_objectToString) return _objectToString;
|
|
256
|
+
hasRequired_objectToString = 1;
|
|
257
|
+
var objectProto = Object.prototype;
|
|
258
|
+
var nativeObjectToString = objectProto.toString;
|
|
259
|
+
function objectToString(value) {
|
|
260
|
+
return nativeObjectToString.call(value);
|
|
261
|
+
}
|
|
262
|
+
_objectToString = objectToString;
|
|
263
|
+
return _objectToString;
|
|
264
|
+
}
|
|
265
|
+
var _baseGetTag;
|
|
266
|
+
var hasRequired_baseGetTag;
|
|
267
|
+
function require_baseGetTag() {
|
|
268
|
+
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
269
|
+
hasRequired_baseGetTag = 1;
|
|
270
|
+
var Symbol2 = require_Symbol(), getRawTag = require_getRawTag(), objectToString = require_objectToString();
|
|
271
|
+
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
272
|
+
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
273
|
+
function baseGetTag(value) {
|
|
274
|
+
if (value == null) {
|
|
275
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
276
|
+
}
|
|
277
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
278
|
+
}
|
|
279
|
+
_baseGetTag = baseGetTag;
|
|
280
|
+
return _baseGetTag;
|
|
281
|
+
}
|
|
282
|
+
var isObjectLike_1;
|
|
283
|
+
var hasRequiredIsObjectLike;
|
|
284
|
+
function requireIsObjectLike() {
|
|
285
|
+
if (hasRequiredIsObjectLike) return isObjectLike_1;
|
|
286
|
+
hasRequiredIsObjectLike = 1;
|
|
287
|
+
function isObjectLike(value) {
|
|
288
|
+
return value != null && typeof value == "object";
|
|
289
|
+
}
|
|
290
|
+
isObjectLike_1 = isObjectLike;
|
|
291
|
+
return isObjectLike_1;
|
|
292
|
+
}
|
|
293
|
+
var isSymbol_1;
|
|
294
|
+
var hasRequiredIsSymbol;
|
|
295
|
+
function requireIsSymbol() {
|
|
296
|
+
if (hasRequiredIsSymbol) return isSymbol_1;
|
|
297
|
+
hasRequiredIsSymbol = 1;
|
|
298
|
+
var baseGetTag = require_baseGetTag(), isObjectLike = requireIsObjectLike();
|
|
299
|
+
var symbolTag = "[object Symbol]";
|
|
300
|
+
function isSymbol(value) {
|
|
301
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
302
|
+
}
|
|
303
|
+
isSymbol_1 = isSymbol;
|
|
304
|
+
return isSymbol_1;
|
|
305
|
+
}
|
|
306
|
+
var _isKey;
|
|
307
|
+
var hasRequired_isKey;
|
|
308
|
+
function require_isKey() {
|
|
309
|
+
if (hasRequired_isKey) return _isKey;
|
|
310
|
+
hasRequired_isKey = 1;
|
|
311
|
+
var isArray = requireIsArray(), isSymbol = requireIsSymbol();
|
|
312
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
|
|
313
|
+
function isKey(value, object2) {
|
|
314
|
+
if (isArray(value)) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
var type = typeof value;
|
|
318
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value in Object(object2);
|
|
322
|
+
}
|
|
323
|
+
_isKey = isKey;
|
|
324
|
+
return _isKey;
|
|
325
|
+
}
|
|
326
|
+
var isObject_1;
|
|
327
|
+
var hasRequiredIsObject;
|
|
328
|
+
function requireIsObject() {
|
|
329
|
+
if (hasRequiredIsObject) return isObject_1;
|
|
330
|
+
hasRequiredIsObject = 1;
|
|
331
|
+
function isObject(value) {
|
|
332
|
+
var type = typeof value;
|
|
333
|
+
return value != null && (type == "object" || type == "function");
|
|
334
|
+
}
|
|
335
|
+
isObject_1 = isObject;
|
|
336
|
+
return isObject_1;
|
|
337
|
+
}
|
|
338
|
+
var isFunction_1;
|
|
339
|
+
var hasRequiredIsFunction;
|
|
340
|
+
function requireIsFunction() {
|
|
341
|
+
if (hasRequiredIsFunction) return isFunction_1;
|
|
342
|
+
hasRequiredIsFunction = 1;
|
|
343
|
+
var baseGetTag = require_baseGetTag(), isObject = requireIsObject();
|
|
344
|
+
var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
345
|
+
function isFunction(value) {
|
|
346
|
+
if (!isObject(value)) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
var tag = baseGetTag(value);
|
|
350
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
351
|
+
}
|
|
352
|
+
isFunction_1 = isFunction;
|
|
353
|
+
return isFunction_1;
|
|
354
|
+
}
|
|
355
|
+
var _coreJsData;
|
|
356
|
+
var hasRequired_coreJsData;
|
|
357
|
+
function require_coreJsData() {
|
|
358
|
+
if (hasRequired_coreJsData) return _coreJsData;
|
|
359
|
+
hasRequired_coreJsData = 1;
|
|
360
|
+
var root = require_root();
|
|
361
|
+
var coreJsData = root["__core-js_shared__"];
|
|
362
|
+
_coreJsData = coreJsData;
|
|
363
|
+
return _coreJsData;
|
|
364
|
+
}
|
|
365
|
+
var _isMasked;
|
|
366
|
+
var hasRequired_isMasked;
|
|
367
|
+
function require_isMasked() {
|
|
368
|
+
if (hasRequired_isMasked) return _isMasked;
|
|
369
|
+
hasRequired_isMasked = 1;
|
|
370
|
+
var coreJsData = require_coreJsData();
|
|
371
|
+
var maskSrcKey = (function() {
|
|
372
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
373
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
374
|
+
})();
|
|
375
|
+
function isMasked(func) {
|
|
376
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
377
|
+
}
|
|
378
|
+
_isMasked = isMasked;
|
|
379
|
+
return _isMasked;
|
|
380
|
+
}
|
|
381
|
+
var _toSource;
|
|
382
|
+
var hasRequired_toSource;
|
|
383
|
+
function require_toSource() {
|
|
384
|
+
if (hasRequired_toSource) return _toSource;
|
|
385
|
+
hasRequired_toSource = 1;
|
|
386
|
+
var funcProto = Function.prototype;
|
|
387
|
+
var funcToString = funcProto.toString;
|
|
388
|
+
function toSource(func) {
|
|
389
|
+
if (func != null) {
|
|
390
|
+
try {
|
|
391
|
+
return funcToString.call(func);
|
|
392
|
+
} catch (e) {
|
|
393
|
+
}
|
|
394
|
+
try {
|
|
395
|
+
return func + "";
|
|
396
|
+
} catch (e) {
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return "";
|
|
400
|
+
}
|
|
401
|
+
_toSource = toSource;
|
|
402
|
+
return _toSource;
|
|
403
|
+
}
|
|
404
|
+
var _baseIsNative;
|
|
405
|
+
var hasRequired_baseIsNative;
|
|
406
|
+
function require_baseIsNative() {
|
|
407
|
+
if (hasRequired_baseIsNative) return _baseIsNative;
|
|
408
|
+
hasRequired_baseIsNative = 1;
|
|
409
|
+
var isFunction = requireIsFunction(), isMasked = require_isMasked(), isObject = requireIsObject(), toSource = require_toSource();
|
|
410
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
411
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
412
|
+
var funcProto = Function.prototype, objectProto = Object.prototype;
|
|
413
|
+
var funcToString = funcProto.toString;
|
|
414
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
415
|
+
var reIsNative = RegExp(
|
|
416
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
417
|
+
);
|
|
418
|
+
function baseIsNative(value) {
|
|
419
|
+
if (!isObject(value) || isMasked(value)) {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
423
|
+
return pattern.test(toSource(value));
|
|
424
|
+
}
|
|
425
|
+
_baseIsNative = baseIsNative;
|
|
426
|
+
return _baseIsNative;
|
|
427
|
+
}
|
|
428
|
+
var _getValue;
|
|
429
|
+
var hasRequired_getValue;
|
|
430
|
+
function require_getValue() {
|
|
431
|
+
if (hasRequired_getValue) return _getValue;
|
|
432
|
+
hasRequired_getValue = 1;
|
|
433
|
+
function getValue(object2, key) {
|
|
434
|
+
return object2 == null ? void 0 : object2[key];
|
|
435
|
+
}
|
|
436
|
+
_getValue = getValue;
|
|
437
|
+
return _getValue;
|
|
438
|
+
}
|
|
439
|
+
var _getNative;
|
|
440
|
+
var hasRequired_getNative;
|
|
441
|
+
function require_getNative() {
|
|
442
|
+
if (hasRequired_getNative) return _getNative;
|
|
443
|
+
hasRequired_getNative = 1;
|
|
444
|
+
var baseIsNative = require_baseIsNative(), getValue = require_getValue();
|
|
445
|
+
function getNative(object2, key) {
|
|
446
|
+
var value = getValue(object2, key);
|
|
447
|
+
return baseIsNative(value) ? value : void 0;
|
|
448
|
+
}
|
|
449
|
+
_getNative = getNative;
|
|
450
|
+
return _getNative;
|
|
451
|
+
}
|
|
452
|
+
var _nativeCreate;
|
|
453
|
+
var hasRequired_nativeCreate;
|
|
454
|
+
function require_nativeCreate() {
|
|
455
|
+
if (hasRequired_nativeCreate) return _nativeCreate;
|
|
456
|
+
hasRequired_nativeCreate = 1;
|
|
457
|
+
var getNative = require_getNative();
|
|
458
|
+
var nativeCreate = getNative(Object, "create");
|
|
459
|
+
_nativeCreate = nativeCreate;
|
|
460
|
+
return _nativeCreate;
|
|
461
|
+
}
|
|
462
|
+
var _hashClear;
|
|
463
|
+
var hasRequired_hashClear;
|
|
464
|
+
function require_hashClear() {
|
|
465
|
+
if (hasRequired_hashClear) return _hashClear;
|
|
466
|
+
hasRequired_hashClear = 1;
|
|
467
|
+
var nativeCreate = require_nativeCreate();
|
|
468
|
+
function hashClear() {
|
|
469
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
470
|
+
this.size = 0;
|
|
471
|
+
}
|
|
472
|
+
_hashClear = hashClear;
|
|
473
|
+
return _hashClear;
|
|
474
|
+
}
|
|
475
|
+
var _hashDelete;
|
|
476
|
+
var hasRequired_hashDelete;
|
|
477
|
+
function require_hashDelete() {
|
|
478
|
+
if (hasRequired_hashDelete) return _hashDelete;
|
|
479
|
+
hasRequired_hashDelete = 1;
|
|
480
|
+
function hashDelete(key) {
|
|
481
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
482
|
+
this.size -= result ? 1 : 0;
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
_hashDelete = hashDelete;
|
|
486
|
+
return _hashDelete;
|
|
487
|
+
}
|
|
488
|
+
var _hashGet;
|
|
489
|
+
var hasRequired_hashGet;
|
|
490
|
+
function require_hashGet() {
|
|
491
|
+
if (hasRequired_hashGet) return _hashGet;
|
|
492
|
+
hasRequired_hashGet = 1;
|
|
493
|
+
var nativeCreate = require_nativeCreate();
|
|
494
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
495
|
+
var objectProto = Object.prototype;
|
|
496
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
497
|
+
function hashGet(key) {
|
|
498
|
+
var data = this.__data__;
|
|
499
|
+
if (nativeCreate) {
|
|
500
|
+
var result = data[key];
|
|
501
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
502
|
+
}
|
|
503
|
+
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
504
|
+
}
|
|
505
|
+
_hashGet = hashGet;
|
|
506
|
+
return _hashGet;
|
|
507
|
+
}
|
|
508
|
+
var _hashHas;
|
|
509
|
+
var hasRequired_hashHas;
|
|
510
|
+
function require_hashHas() {
|
|
511
|
+
if (hasRequired_hashHas) return _hashHas;
|
|
512
|
+
hasRequired_hashHas = 1;
|
|
513
|
+
var nativeCreate = require_nativeCreate();
|
|
514
|
+
var objectProto = Object.prototype;
|
|
515
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
516
|
+
function hashHas(key) {
|
|
517
|
+
var data = this.__data__;
|
|
518
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
519
|
+
}
|
|
520
|
+
_hashHas = hashHas;
|
|
521
|
+
return _hashHas;
|
|
522
|
+
}
|
|
523
|
+
var _hashSet;
|
|
524
|
+
var hasRequired_hashSet;
|
|
525
|
+
function require_hashSet() {
|
|
526
|
+
if (hasRequired_hashSet) return _hashSet;
|
|
527
|
+
hasRequired_hashSet = 1;
|
|
528
|
+
var nativeCreate = require_nativeCreate();
|
|
529
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
530
|
+
function hashSet(key, value) {
|
|
531
|
+
var data = this.__data__;
|
|
532
|
+
this.size += this.has(key) ? 0 : 1;
|
|
533
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
534
|
+
return this;
|
|
535
|
+
}
|
|
536
|
+
_hashSet = hashSet;
|
|
537
|
+
return _hashSet;
|
|
538
|
+
}
|
|
539
|
+
var _Hash;
|
|
540
|
+
var hasRequired_Hash;
|
|
541
|
+
function require_Hash() {
|
|
542
|
+
if (hasRequired_Hash) return _Hash;
|
|
543
|
+
hasRequired_Hash = 1;
|
|
544
|
+
var hashClear = require_hashClear(), hashDelete = require_hashDelete(), hashGet = require_hashGet(), hashHas = require_hashHas(), hashSet = require_hashSet();
|
|
545
|
+
function Hash(entries) {
|
|
546
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
547
|
+
this.clear();
|
|
548
|
+
while (++index2 < length) {
|
|
549
|
+
var entry = entries[index2];
|
|
550
|
+
this.set(entry[0], entry[1]);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
Hash.prototype.clear = hashClear;
|
|
554
|
+
Hash.prototype["delete"] = hashDelete;
|
|
555
|
+
Hash.prototype.get = hashGet;
|
|
556
|
+
Hash.prototype.has = hashHas;
|
|
557
|
+
Hash.prototype.set = hashSet;
|
|
558
|
+
_Hash = Hash;
|
|
559
|
+
return _Hash;
|
|
560
|
+
}
|
|
561
|
+
var _listCacheClear;
|
|
562
|
+
var hasRequired_listCacheClear;
|
|
563
|
+
function require_listCacheClear() {
|
|
564
|
+
if (hasRequired_listCacheClear) return _listCacheClear;
|
|
565
|
+
hasRequired_listCacheClear = 1;
|
|
566
|
+
function listCacheClear() {
|
|
567
|
+
this.__data__ = [];
|
|
568
|
+
this.size = 0;
|
|
569
|
+
}
|
|
570
|
+
_listCacheClear = listCacheClear;
|
|
571
|
+
return _listCacheClear;
|
|
572
|
+
}
|
|
573
|
+
var eq_1;
|
|
574
|
+
var hasRequiredEq;
|
|
575
|
+
function requireEq() {
|
|
576
|
+
if (hasRequiredEq) return eq_1;
|
|
577
|
+
hasRequiredEq = 1;
|
|
578
|
+
function eq(value, other) {
|
|
579
|
+
return value === other || value !== value && other !== other;
|
|
580
|
+
}
|
|
581
|
+
eq_1 = eq;
|
|
582
|
+
return eq_1;
|
|
583
|
+
}
|
|
584
|
+
var _assocIndexOf;
|
|
585
|
+
var hasRequired_assocIndexOf;
|
|
586
|
+
function require_assocIndexOf() {
|
|
587
|
+
if (hasRequired_assocIndexOf) return _assocIndexOf;
|
|
588
|
+
hasRequired_assocIndexOf = 1;
|
|
589
|
+
var eq = requireEq();
|
|
590
|
+
function assocIndexOf(array2, key) {
|
|
591
|
+
var length = array2.length;
|
|
592
|
+
while (length--) {
|
|
593
|
+
if (eq(array2[length][0], key)) {
|
|
594
|
+
return length;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return -1;
|
|
598
|
+
}
|
|
599
|
+
_assocIndexOf = assocIndexOf;
|
|
600
|
+
return _assocIndexOf;
|
|
601
|
+
}
|
|
602
|
+
var _listCacheDelete;
|
|
603
|
+
var hasRequired_listCacheDelete;
|
|
604
|
+
function require_listCacheDelete() {
|
|
605
|
+
if (hasRequired_listCacheDelete) return _listCacheDelete;
|
|
606
|
+
hasRequired_listCacheDelete = 1;
|
|
607
|
+
var assocIndexOf = require_assocIndexOf();
|
|
608
|
+
var arrayProto = Array.prototype;
|
|
609
|
+
var splice = arrayProto.splice;
|
|
610
|
+
function listCacheDelete(key) {
|
|
611
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
612
|
+
if (index2 < 0) {
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
var lastIndex = data.length - 1;
|
|
616
|
+
if (index2 == lastIndex) {
|
|
617
|
+
data.pop();
|
|
618
|
+
} else {
|
|
619
|
+
splice.call(data, index2, 1);
|
|
620
|
+
}
|
|
621
|
+
--this.size;
|
|
622
|
+
return true;
|
|
623
|
+
}
|
|
624
|
+
_listCacheDelete = listCacheDelete;
|
|
625
|
+
return _listCacheDelete;
|
|
626
|
+
}
|
|
627
|
+
var _listCacheGet;
|
|
628
|
+
var hasRequired_listCacheGet;
|
|
629
|
+
function require_listCacheGet() {
|
|
630
|
+
if (hasRequired_listCacheGet) return _listCacheGet;
|
|
631
|
+
hasRequired_listCacheGet = 1;
|
|
632
|
+
var assocIndexOf = require_assocIndexOf();
|
|
633
|
+
function listCacheGet(key) {
|
|
634
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
635
|
+
return index2 < 0 ? void 0 : data[index2][1];
|
|
636
|
+
}
|
|
637
|
+
_listCacheGet = listCacheGet;
|
|
638
|
+
return _listCacheGet;
|
|
639
|
+
}
|
|
640
|
+
var _listCacheHas;
|
|
641
|
+
var hasRequired_listCacheHas;
|
|
642
|
+
function require_listCacheHas() {
|
|
643
|
+
if (hasRequired_listCacheHas) return _listCacheHas;
|
|
644
|
+
hasRequired_listCacheHas = 1;
|
|
645
|
+
var assocIndexOf = require_assocIndexOf();
|
|
646
|
+
function listCacheHas(key) {
|
|
647
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
648
|
+
}
|
|
649
|
+
_listCacheHas = listCacheHas;
|
|
650
|
+
return _listCacheHas;
|
|
651
|
+
}
|
|
652
|
+
var _listCacheSet;
|
|
653
|
+
var hasRequired_listCacheSet;
|
|
654
|
+
function require_listCacheSet() {
|
|
655
|
+
if (hasRequired_listCacheSet) return _listCacheSet;
|
|
656
|
+
hasRequired_listCacheSet = 1;
|
|
657
|
+
var assocIndexOf = require_assocIndexOf();
|
|
658
|
+
function listCacheSet(key, value) {
|
|
659
|
+
var data = this.__data__, index2 = assocIndexOf(data, key);
|
|
660
|
+
if (index2 < 0) {
|
|
661
|
+
++this.size;
|
|
662
|
+
data.push([key, value]);
|
|
663
|
+
} else {
|
|
664
|
+
data[index2][1] = value;
|
|
665
|
+
}
|
|
666
|
+
return this;
|
|
667
|
+
}
|
|
668
|
+
_listCacheSet = listCacheSet;
|
|
669
|
+
return _listCacheSet;
|
|
670
|
+
}
|
|
671
|
+
var _ListCache;
|
|
672
|
+
var hasRequired_ListCache;
|
|
673
|
+
function require_ListCache() {
|
|
674
|
+
if (hasRequired_ListCache) return _ListCache;
|
|
675
|
+
hasRequired_ListCache = 1;
|
|
676
|
+
var listCacheClear = require_listCacheClear(), listCacheDelete = require_listCacheDelete(), listCacheGet = require_listCacheGet(), listCacheHas = require_listCacheHas(), listCacheSet = require_listCacheSet();
|
|
677
|
+
function ListCache(entries) {
|
|
678
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
679
|
+
this.clear();
|
|
680
|
+
while (++index2 < length) {
|
|
681
|
+
var entry = entries[index2];
|
|
682
|
+
this.set(entry[0], entry[1]);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
ListCache.prototype.clear = listCacheClear;
|
|
686
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
687
|
+
ListCache.prototype.get = listCacheGet;
|
|
688
|
+
ListCache.prototype.has = listCacheHas;
|
|
689
|
+
ListCache.prototype.set = listCacheSet;
|
|
690
|
+
_ListCache = ListCache;
|
|
691
|
+
return _ListCache;
|
|
692
|
+
}
|
|
693
|
+
var _Map;
|
|
694
|
+
var hasRequired_Map;
|
|
695
|
+
function require_Map() {
|
|
696
|
+
if (hasRequired_Map) return _Map;
|
|
697
|
+
hasRequired_Map = 1;
|
|
698
|
+
var getNative = require_getNative(), root = require_root();
|
|
699
|
+
var Map2 = getNative(root, "Map");
|
|
700
|
+
_Map = Map2;
|
|
701
|
+
return _Map;
|
|
702
|
+
}
|
|
703
|
+
var _mapCacheClear;
|
|
704
|
+
var hasRequired_mapCacheClear;
|
|
705
|
+
function require_mapCacheClear() {
|
|
706
|
+
if (hasRequired_mapCacheClear) return _mapCacheClear;
|
|
707
|
+
hasRequired_mapCacheClear = 1;
|
|
708
|
+
var Hash = require_Hash(), ListCache = require_ListCache(), Map2 = require_Map();
|
|
709
|
+
function mapCacheClear() {
|
|
710
|
+
this.size = 0;
|
|
711
|
+
this.__data__ = {
|
|
712
|
+
"hash": new Hash(),
|
|
713
|
+
"map": new (Map2 || ListCache)(),
|
|
714
|
+
"string": new Hash()
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
_mapCacheClear = mapCacheClear;
|
|
718
|
+
return _mapCacheClear;
|
|
719
|
+
}
|
|
720
|
+
var _isKeyable;
|
|
721
|
+
var hasRequired_isKeyable;
|
|
722
|
+
function require_isKeyable() {
|
|
723
|
+
if (hasRequired_isKeyable) return _isKeyable;
|
|
724
|
+
hasRequired_isKeyable = 1;
|
|
725
|
+
function isKeyable(value) {
|
|
726
|
+
var type = typeof value;
|
|
727
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
728
|
+
}
|
|
729
|
+
_isKeyable = isKeyable;
|
|
730
|
+
return _isKeyable;
|
|
731
|
+
}
|
|
732
|
+
var _getMapData;
|
|
733
|
+
var hasRequired_getMapData;
|
|
734
|
+
function require_getMapData() {
|
|
735
|
+
if (hasRequired_getMapData) return _getMapData;
|
|
736
|
+
hasRequired_getMapData = 1;
|
|
737
|
+
var isKeyable = require_isKeyable();
|
|
738
|
+
function getMapData(map2, key) {
|
|
739
|
+
var data = map2.__data__;
|
|
740
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
741
|
+
}
|
|
742
|
+
_getMapData = getMapData;
|
|
743
|
+
return _getMapData;
|
|
744
|
+
}
|
|
745
|
+
var _mapCacheDelete;
|
|
746
|
+
var hasRequired_mapCacheDelete;
|
|
747
|
+
function require_mapCacheDelete() {
|
|
748
|
+
if (hasRequired_mapCacheDelete) return _mapCacheDelete;
|
|
749
|
+
hasRequired_mapCacheDelete = 1;
|
|
750
|
+
var getMapData = require_getMapData();
|
|
751
|
+
function mapCacheDelete(key) {
|
|
752
|
+
var result = getMapData(this, key)["delete"](key);
|
|
753
|
+
this.size -= result ? 1 : 0;
|
|
754
|
+
return result;
|
|
755
|
+
}
|
|
756
|
+
_mapCacheDelete = mapCacheDelete;
|
|
757
|
+
return _mapCacheDelete;
|
|
758
|
+
}
|
|
759
|
+
var _mapCacheGet;
|
|
760
|
+
var hasRequired_mapCacheGet;
|
|
761
|
+
function require_mapCacheGet() {
|
|
762
|
+
if (hasRequired_mapCacheGet) return _mapCacheGet;
|
|
763
|
+
hasRequired_mapCacheGet = 1;
|
|
764
|
+
var getMapData = require_getMapData();
|
|
765
|
+
function mapCacheGet(key) {
|
|
766
|
+
return getMapData(this, key).get(key);
|
|
767
|
+
}
|
|
768
|
+
_mapCacheGet = mapCacheGet;
|
|
769
|
+
return _mapCacheGet;
|
|
770
|
+
}
|
|
771
|
+
var _mapCacheHas;
|
|
772
|
+
var hasRequired_mapCacheHas;
|
|
773
|
+
function require_mapCacheHas() {
|
|
774
|
+
if (hasRequired_mapCacheHas) return _mapCacheHas;
|
|
775
|
+
hasRequired_mapCacheHas = 1;
|
|
776
|
+
var getMapData = require_getMapData();
|
|
777
|
+
function mapCacheHas(key) {
|
|
778
|
+
return getMapData(this, key).has(key);
|
|
779
|
+
}
|
|
780
|
+
_mapCacheHas = mapCacheHas;
|
|
781
|
+
return _mapCacheHas;
|
|
782
|
+
}
|
|
783
|
+
var _mapCacheSet;
|
|
784
|
+
var hasRequired_mapCacheSet;
|
|
785
|
+
function require_mapCacheSet() {
|
|
786
|
+
if (hasRequired_mapCacheSet) return _mapCacheSet;
|
|
787
|
+
hasRequired_mapCacheSet = 1;
|
|
788
|
+
var getMapData = require_getMapData();
|
|
789
|
+
function mapCacheSet(key, value) {
|
|
790
|
+
var data = getMapData(this, key), size = data.size;
|
|
791
|
+
data.set(key, value);
|
|
792
|
+
this.size += data.size == size ? 0 : 1;
|
|
793
|
+
return this;
|
|
794
|
+
}
|
|
795
|
+
_mapCacheSet = mapCacheSet;
|
|
796
|
+
return _mapCacheSet;
|
|
797
|
+
}
|
|
798
|
+
var _MapCache;
|
|
799
|
+
var hasRequired_MapCache;
|
|
800
|
+
function require_MapCache() {
|
|
801
|
+
if (hasRequired_MapCache) return _MapCache;
|
|
802
|
+
hasRequired_MapCache = 1;
|
|
803
|
+
var mapCacheClear = require_mapCacheClear(), mapCacheDelete = require_mapCacheDelete(), mapCacheGet = require_mapCacheGet(), mapCacheHas = require_mapCacheHas(), mapCacheSet = require_mapCacheSet();
|
|
804
|
+
function MapCache(entries) {
|
|
805
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
806
|
+
this.clear();
|
|
807
|
+
while (++index2 < length) {
|
|
808
|
+
var entry = entries[index2];
|
|
809
|
+
this.set(entry[0], entry[1]);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
813
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
814
|
+
MapCache.prototype.get = mapCacheGet;
|
|
815
|
+
MapCache.prototype.has = mapCacheHas;
|
|
816
|
+
MapCache.prototype.set = mapCacheSet;
|
|
817
|
+
_MapCache = MapCache;
|
|
818
|
+
return _MapCache;
|
|
819
|
+
}
|
|
820
|
+
var memoize_1;
|
|
821
|
+
var hasRequiredMemoize;
|
|
822
|
+
function requireMemoize() {
|
|
823
|
+
if (hasRequiredMemoize) return memoize_1;
|
|
824
|
+
hasRequiredMemoize = 1;
|
|
825
|
+
var MapCache = require_MapCache();
|
|
826
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
827
|
+
function memoize(func, resolver) {
|
|
828
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
829
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
830
|
+
}
|
|
831
|
+
var memoized = function() {
|
|
832
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
833
|
+
if (cache.has(key)) {
|
|
834
|
+
return cache.get(key);
|
|
835
|
+
}
|
|
836
|
+
var result = func.apply(this, args);
|
|
837
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
838
|
+
return result;
|
|
839
|
+
};
|
|
840
|
+
memoized.cache = new (memoize.Cache || MapCache)();
|
|
841
|
+
return memoized;
|
|
842
|
+
}
|
|
843
|
+
memoize.Cache = MapCache;
|
|
844
|
+
memoize_1 = memoize;
|
|
845
|
+
return memoize_1;
|
|
846
|
+
}
|
|
847
|
+
var _memoizeCapped;
|
|
848
|
+
var hasRequired_memoizeCapped;
|
|
849
|
+
function require_memoizeCapped() {
|
|
850
|
+
if (hasRequired_memoizeCapped) return _memoizeCapped;
|
|
851
|
+
hasRequired_memoizeCapped = 1;
|
|
852
|
+
var memoize = requireMemoize();
|
|
853
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
854
|
+
function memoizeCapped(func) {
|
|
855
|
+
var result = memoize(func, function(key) {
|
|
856
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
857
|
+
cache.clear();
|
|
858
|
+
}
|
|
859
|
+
return key;
|
|
860
|
+
});
|
|
861
|
+
var cache = result.cache;
|
|
862
|
+
return result;
|
|
863
|
+
}
|
|
864
|
+
_memoizeCapped = memoizeCapped;
|
|
865
|
+
return _memoizeCapped;
|
|
866
|
+
}
|
|
867
|
+
var _stringToPath;
|
|
868
|
+
var hasRequired_stringToPath;
|
|
869
|
+
function require_stringToPath() {
|
|
870
|
+
if (hasRequired_stringToPath) return _stringToPath;
|
|
871
|
+
hasRequired_stringToPath = 1;
|
|
872
|
+
var memoizeCapped = require_memoizeCapped();
|
|
873
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
874
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
875
|
+
var stringToPath = memoizeCapped(function(string2) {
|
|
876
|
+
var result = [];
|
|
877
|
+
if (string2.charCodeAt(0) === 46) {
|
|
878
|
+
result.push("");
|
|
879
|
+
}
|
|
880
|
+
string2.replace(rePropName, function(match, number2, quote, subString) {
|
|
881
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match);
|
|
882
|
+
});
|
|
883
|
+
return result;
|
|
884
|
+
});
|
|
885
|
+
_stringToPath = stringToPath;
|
|
886
|
+
return _stringToPath;
|
|
887
|
+
}
|
|
888
|
+
var _arrayMap;
|
|
889
|
+
var hasRequired_arrayMap;
|
|
890
|
+
function require_arrayMap() {
|
|
891
|
+
if (hasRequired_arrayMap) return _arrayMap;
|
|
892
|
+
hasRequired_arrayMap = 1;
|
|
893
|
+
function arrayMap(array2, iteratee) {
|
|
894
|
+
var index2 = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
|
|
895
|
+
while (++index2 < length) {
|
|
896
|
+
result[index2] = iteratee(array2[index2], index2, array2);
|
|
897
|
+
}
|
|
898
|
+
return result;
|
|
899
|
+
}
|
|
900
|
+
_arrayMap = arrayMap;
|
|
901
|
+
return _arrayMap;
|
|
902
|
+
}
|
|
903
|
+
var _baseToString;
|
|
904
|
+
var hasRequired_baseToString;
|
|
905
|
+
function require_baseToString() {
|
|
906
|
+
if (hasRequired_baseToString) return _baseToString;
|
|
907
|
+
hasRequired_baseToString = 1;
|
|
908
|
+
var Symbol2 = require_Symbol(), arrayMap = require_arrayMap(), isArray = requireIsArray(), isSymbol = requireIsSymbol();
|
|
909
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolToString2 = symbolProto ? symbolProto.toString : void 0;
|
|
910
|
+
function baseToString(value) {
|
|
911
|
+
if (typeof value == "string") {
|
|
912
|
+
return value;
|
|
913
|
+
}
|
|
914
|
+
if (isArray(value)) {
|
|
915
|
+
return arrayMap(value, baseToString) + "";
|
|
916
|
+
}
|
|
917
|
+
if (isSymbol(value)) {
|
|
918
|
+
return symbolToString2 ? symbolToString2.call(value) : "";
|
|
919
|
+
}
|
|
920
|
+
var result = value + "";
|
|
921
|
+
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
922
|
+
}
|
|
923
|
+
_baseToString = baseToString;
|
|
924
|
+
return _baseToString;
|
|
925
|
+
}
|
|
926
|
+
var toString_1;
|
|
927
|
+
var hasRequiredToString;
|
|
928
|
+
function requireToString() {
|
|
929
|
+
if (hasRequiredToString) return toString_1;
|
|
930
|
+
hasRequiredToString = 1;
|
|
931
|
+
var baseToString = require_baseToString();
|
|
932
|
+
function toString2(value) {
|
|
933
|
+
return value == null ? "" : baseToString(value);
|
|
934
|
+
}
|
|
935
|
+
toString_1 = toString2;
|
|
936
|
+
return toString_1;
|
|
937
|
+
}
|
|
938
|
+
var _castPath;
|
|
939
|
+
var hasRequired_castPath;
|
|
940
|
+
function require_castPath() {
|
|
941
|
+
if (hasRequired_castPath) return _castPath;
|
|
942
|
+
hasRequired_castPath = 1;
|
|
943
|
+
var isArray = requireIsArray(), isKey = require_isKey(), stringToPath = require_stringToPath(), toString2 = requireToString();
|
|
944
|
+
function castPath(value, object2) {
|
|
945
|
+
if (isArray(value)) {
|
|
946
|
+
return value;
|
|
947
|
+
}
|
|
948
|
+
return isKey(value, object2) ? [value] : stringToPath(toString2(value));
|
|
949
|
+
}
|
|
950
|
+
_castPath = castPath;
|
|
951
|
+
return _castPath;
|
|
952
|
+
}
|
|
953
|
+
var _baseIsArguments;
|
|
954
|
+
var hasRequired_baseIsArguments;
|
|
955
|
+
function require_baseIsArguments() {
|
|
956
|
+
if (hasRequired_baseIsArguments) return _baseIsArguments;
|
|
957
|
+
hasRequired_baseIsArguments = 1;
|
|
958
|
+
var baseGetTag = require_baseGetTag(), isObjectLike = requireIsObjectLike();
|
|
959
|
+
var argsTag = "[object Arguments]";
|
|
960
|
+
function baseIsArguments(value) {
|
|
961
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
962
|
+
}
|
|
963
|
+
_baseIsArguments = baseIsArguments;
|
|
964
|
+
return _baseIsArguments;
|
|
965
|
+
}
|
|
966
|
+
var isArguments_1;
|
|
967
|
+
var hasRequiredIsArguments;
|
|
968
|
+
function requireIsArguments() {
|
|
969
|
+
if (hasRequiredIsArguments) return isArguments_1;
|
|
970
|
+
hasRequiredIsArguments = 1;
|
|
971
|
+
var baseIsArguments = require_baseIsArguments(), isObjectLike = requireIsObjectLike();
|
|
972
|
+
var objectProto = Object.prototype;
|
|
973
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
974
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
975
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
|
|
976
|
+
return arguments;
|
|
977
|
+
})()) ? baseIsArguments : function(value) {
|
|
978
|
+
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
979
|
+
};
|
|
980
|
+
isArguments_1 = isArguments;
|
|
981
|
+
return isArguments_1;
|
|
982
|
+
}
|
|
983
|
+
var _isIndex;
|
|
984
|
+
var hasRequired_isIndex;
|
|
985
|
+
function require_isIndex() {
|
|
986
|
+
if (hasRequired_isIndex) return _isIndex;
|
|
987
|
+
hasRequired_isIndex = 1;
|
|
988
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
989
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
990
|
+
function isIndex(value, length) {
|
|
991
|
+
var type = typeof value;
|
|
992
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
993
|
+
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
994
|
+
}
|
|
995
|
+
_isIndex = isIndex;
|
|
996
|
+
return _isIndex;
|
|
997
|
+
}
|
|
998
|
+
var isLength_1;
|
|
999
|
+
var hasRequiredIsLength;
|
|
1000
|
+
function requireIsLength() {
|
|
1001
|
+
if (hasRequiredIsLength) return isLength_1;
|
|
1002
|
+
hasRequiredIsLength = 1;
|
|
1003
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
1004
|
+
function isLength(value) {
|
|
1005
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1006
|
+
}
|
|
1007
|
+
isLength_1 = isLength;
|
|
1008
|
+
return isLength_1;
|
|
1009
|
+
}
|
|
1010
|
+
var _toKey;
|
|
1011
|
+
var hasRequired_toKey;
|
|
1012
|
+
function require_toKey() {
|
|
1013
|
+
if (hasRequired_toKey) return _toKey;
|
|
1014
|
+
hasRequired_toKey = 1;
|
|
1015
|
+
var isSymbol = requireIsSymbol();
|
|
1016
|
+
function toKey(value) {
|
|
1017
|
+
if (typeof value == "string" || isSymbol(value)) {
|
|
1018
|
+
return value;
|
|
1019
|
+
}
|
|
1020
|
+
var result = value + "";
|
|
1021
|
+
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
1022
|
+
}
|
|
1023
|
+
_toKey = toKey;
|
|
1024
|
+
return _toKey;
|
|
1025
|
+
}
|
|
1026
|
+
var _hasPath;
|
|
1027
|
+
var hasRequired_hasPath;
|
|
1028
|
+
function require_hasPath() {
|
|
1029
|
+
if (hasRequired_hasPath) return _hasPath;
|
|
1030
|
+
hasRequired_hasPath = 1;
|
|
1031
|
+
var castPath = require_castPath(), isArguments = requireIsArguments(), isArray = requireIsArray(), isIndex = require_isIndex(), isLength = requireIsLength(), toKey = require_toKey();
|
|
1032
|
+
function hasPath(object2, path, hasFunc) {
|
|
1033
|
+
path = castPath(path, object2);
|
|
1034
|
+
var index2 = -1, length = path.length, result = false;
|
|
1035
|
+
while (++index2 < length) {
|
|
1036
|
+
var key = toKey(path[index2]);
|
|
1037
|
+
if (!(result = object2 != null && hasFunc(object2, key))) {
|
|
1038
|
+
break;
|
|
1039
|
+
}
|
|
1040
|
+
object2 = object2[key];
|
|
1041
|
+
}
|
|
1042
|
+
if (result || ++index2 != length) {
|
|
1043
|
+
return result;
|
|
1044
|
+
}
|
|
1045
|
+
length = object2 == null ? 0 : object2.length;
|
|
1046
|
+
return !!length && isLength(length) && isIndex(key, length) && (isArray(object2) || isArguments(object2));
|
|
1047
|
+
}
|
|
1048
|
+
_hasPath = hasPath;
|
|
1049
|
+
return _hasPath;
|
|
1050
|
+
}
|
|
1051
|
+
var has_1;
|
|
1052
|
+
var hasRequiredHas;
|
|
1053
|
+
function requireHas() {
|
|
1054
|
+
if (hasRequiredHas) return has_1;
|
|
1055
|
+
hasRequiredHas = 1;
|
|
1056
|
+
var baseHas = require_baseHas(), hasPath = require_hasPath();
|
|
1057
|
+
function has2(object2, path) {
|
|
1058
|
+
return object2 != null && hasPath(object2, path, baseHas);
|
|
1059
|
+
}
|
|
1060
|
+
has_1 = has2;
|
|
1061
|
+
return has_1;
|
|
1062
|
+
}
|
|
1063
|
+
var hasExports = requireHas();
|
|
1064
|
+
const has = /* @__PURE__ */ getDefaultExportFromCjs(hasExports);
|
|
1065
|
+
const isSchema = ((obj) => obj && obj.__isYupSchema__);
|
|
1066
|
+
class Condition {
|
|
1067
|
+
constructor(refs, options) {
|
|
1068
|
+
this.refs = refs;
|
|
1069
|
+
this.refs = refs;
|
|
1070
|
+
if (typeof options === "function") {
|
|
1071
|
+
this.fn = options;
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
if (!has(options, "is")) throw new TypeError("`is:` is required for `when()` conditions");
|
|
1075
|
+
if (!options.then && !options.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
|
|
1076
|
+
let {
|
|
1077
|
+
is,
|
|
1078
|
+
then,
|
|
1079
|
+
otherwise
|
|
1080
|
+
} = options;
|
|
1081
|
+
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
1082
|
+
this.fn = function(...args) {
|
|
1083
|
+
let options2 = args.pop();
|
|
1084
|
+
let schema = args.pop();
|
|
1085
|
+
let branch = check(...args) ? then : otherwise;
|
|
1086
|
+
if (!branch) return void 0;
|
|
1087
|
+
if (typeof branch === "function") return branch(schema);
|
|
1088
|
+
return schema.concat(branch.resolve(options2));
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
resolve(base, options) {
|
|
1092
|
+
let values = this.refs.map((ref) => ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context));
|
|
1093
|
+
let schema = this.fn.apply(base, values.concat(base, options));
|
|
1094
|
+
if (schema === void 0 || schema === base) return base;
|
|
1095
|
+
if (!isSchema(schema)) throw new TypeError("conditions must return a schema object");
|
|
1096
|
+
return schema.resolve(options);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
function toArray(value) {
|
|
1100
|
+
return value == null ? [] : [].concat(value);
|
|
1101
|
+
}
|
|
1102
|
+
function _extends$2() {
|
|
1103
|
+
_extends$2 = Object.assign || function(target) {
|
|
1104
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1105
|
+
var source = arguments[i];
|
|
1106
|
+
for (var key in source) {
|
|
1107
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1108
|
+
target[key] = source[key];
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
return target;
|
|
1113
|
+
};
|
|
1114
|
+
return _extends$2.apply(this, arguments);
|
|
1115
|
+
}
|
|
1116
|
+
let strReg = /\$\{\s*(\w+)\s*\}/g;
|
|
1117
|
+
class ValidationError extends Error {
|
|
1118
|
+
static formatError(message, params) {
|
|
1119
|
+
const path = params.label || params.path || "this";
|
|
1120
|
+
if (path !== params.path) params = _extends$2({}, params, {
|
|
1121
|
+
path
|
|
1122
|
+
});
|
|
1123
|
+
if (typeof message === "string") return message.replace(strReg, (_, key) => printValue(params[key]));
|
|
1124
|
+
if (typeof message === "function") return message(params);
|
|
1125
|
+
return message;
|
|
1126
|
+
}
|
|
1127
|
+
static isError(err) {
|
|
1128
|
+
return err && err.name === "ValidationError";
|
|
1129
|
+
}
|
|
1130
|
+
constructor(errorOrErrors, value, field, type) {
|
|
1131
|
+
super();
|
|
1132
|
+
this.name = "ValidationError";
|
|
1133
|
+
this.value = value;
|
|
1134
|
+
this.path = field;
|
|
1135
|
+
this.type = type;
|
|
1136
|
+
this.errors = [];
|
|
1137
|
+
this.inner = [];
|
|
1138
|
+
toArray(errorOrErrors).forEach((err) => {
|
|
1139
|
+
if (ValidationError.isError(err)) {
|
|
1140
|
+
this.errors.push(...err.errors);
|
|
1141
|
+
this.inner = this.inner.concat(err.inner.length ? err.inner : err);
|
|
1142
|
+
} else {
|
|
1143
|
+
this.errors.push(err);
|
|
1144
|
+
}
|
|
1145
|
+
});
|
|
1146
|
+
this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
|
|
1147
|
+
if (Error.captureStackTrace) Error.captureStackTrace(this, ValidationError);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
const once = (cb) => {
|
|
1151
|
+
let fired = false;
|
|
1152
|
+
return (...args) => {
|
|
1153
|
+
if (fired) return;
|
|
1154
|
+
fired = true;
|
|
1155
|
+
cb(...args);
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
function runTests(options, cb) {
|
|
1159
|
+
let {
|
|
1160
|
+
endEarly,
|
|
1161
|
+
tests,
|
|
1162
|
+
args,
|
|
1163
|
+
value,
|
|
1164
|
+
errors,
|
|
1165
|
+
sort,
|
|
1166
|
+
path
|
|
1167
|
+
} = options;
|
|
1168
|
+
let callback = once(cb);
|
|
1169
|
+
let count = tests.length;
|
|
1170
|
+
const nestedErrors = [];
|
|
1171
|
+
errors = errors ? errors : [];
|
|
1172
|
+
if (!count) return errors.length ? callback(new ValidationError(errors, value, path)) : callback(null, value);
|
|
1173
|
+
for (let i = 0; i < tests.length; i++) {
|
|
1174
|
+
const test = tests[i];
|
|
1175
|
+
test(args, function finishTestRun(err) {
|
|
1176
|
+
if (err) {
|
|
1177
|
+
if (!ValidationError.isError(err)) {
|
|
1178
|
+
return callback(err, value);
|
|
1179
|
+
}
|
|
1180
|
+
if (endEarly) {
|
|
1181
|
+
err.value = value;
|
|
1182
|
+
return callback(err, value);
|
|
1183
|
+
}
|
|
1184
|
+
nestedErrors.push(err);
|
|
1185
|
+
}
|
|
1186
|
+
if (--count <= 0) {
|
|
1187
|
+
if (nestedErrors.length) {
|
|
1188
|
+
if (sort) nestedErrors.sort(sort);
|
|
1189
|
+
if (errors.length) nestedErrors.push(...errors);
|
|
1190
|
+
errors = nestedErrors;
|
|
1191
|
+
}
|
|
1192
|
+
if (errors.length) {
|
|
1193
|
+
callback(new ValidationError(errors, value, path), value);
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
callback(null, value);
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
var _defineProperty;
|
|
1202
|
+
var hasRequired_defineProperty;
|
|
1203
|
+
function require_defineProperty() {
|
|
1204
|
+
if (hasRequired_defineProperty) return _defineProperty;
|
|
1205
|
+
hasRequired_defineProperty = 1;
|
|
1206
|
+
var getNative = require_getNative();
|
|
1207
|
+
var defineProperty = (function() {
|
|
1208
|
+
try {
|
|
1209
|
+
var func = getNative(Object, "defineProperty");
|
|
1210
|
+
func({}, "", {});
|
|
1211
|
+
return func;
|
|
1212
|
+
} catch (e) {
|
|
1213
|
+
}
|
|
1214
|
+
})();
|
|
1215
|
+
_defineProperty = defineProperty;
|
|
1216
|
+
return _defineProperty;
|
|
1217
|
+
}
|
|
1218
|
+
var _baseAssignValue;
|
|
1219
|
+
var hasRequired_baseAssignValue;
|
|
1220
|
+
function require_baseAssignValue() {
|
|
1221
|
+
if (hasRequired_baseAssignValue) return _baseAssignValue;
|
|
1222
|
+
hasRequired_baseAssignValue = 1;
|
|
1223
|
+
var defineProperty = require_defineProperty();
|
|
1224
|
+
function baseAssignValue(object2, key, value) {
|
|
1225
|
+
if (key == "__proto__" && defineProperty) {
|
|
1226
|
+
defineProperty(object2, key, {
|
|
1227
|
+
"configurable": true,
|
|
1228
|
+
"enumerable": true,
|
|
1229
|
+
"value": value,
|
|
1230
|
+
"writable": true
|
|
1231
|
+
});
|
|
1232
|
+
} else {
|
|
1233
|
+
object2[key] = value;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
_baseAssignValue = baseAssignValue;
|
|
1237
|
+
return _baseAssignValue;
|
|
1238
|
+
}
|
|
1239
|
+
var _createBaseFor;
|
|
1240
|
+
var hasRequired_createBaseFor;
|
|
1241
|
+
function require_createBaseFor() {
|
|
1242
|
+
if (hasRequired_createBaseFor) return _createBaseFor;
|
|
1243
|
+
hasRequired_createBaseFor = 1;
|
|
1244
|
+
function createBaseFor(fromRight) {
|
|
1245
|
+
return function(object2, iteratee, keysFunc) {
|
|
1246
|
+
var index2 = -1, iterable = Object(object2), props = keysFunc(object2), length = props.length;
|
|
1247
|
+
while (length--) {
|
|
1248
|
+
var key = props[fromRight ? length : ++index2];
|
|
1249
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
return object2;
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
_createBaseFor = createBaseFor;
|
|
1257
|
+
return _createBaseFor;
|
|
1258
|
+
}
|
|
1259
|
+
var _baseFor;
|
|
1260
|
+
var hasRequired_baseFor;
|
|
1261
|
+
function require_baseFor() {
|
|
1262
|
+
if (hasRequired_baseFor) return _baseFor;
|
|
1263
|
+
hasRequired_baseFor = 1;
|
|
1264
|
+
var createBaseFor = require_createBaseFor();
|
|
1265
|
+
var baseFor = createBaseFor();
|
|
1266
|
+
_baseFor = baseFor;
|
|
1267
|
+
return _baseFor;
|
|
1268
|
+
}
|
|
1269
|
+
var _baseTimes;
|
|
1270
|
+
var hasRequired_baseTimes;
|
|
1271
|
+
function require_baseTimes() {
|
|
1272
|
+
if (hasRequired_baseTimes) return _baseTimes;
|
|
1273
|
+
hasRequired_baseTimes = 1;
|
|
1274
|
+
function baseTimes(n, iteratee) {
|
|
1275
|
+
var index2 = -1, result = Array(n);
|
|
1276
|
+
while (++index2 < n) {
|
|
1277
|
+
result[index2] = iteratee(index2);
|
|
1278
|
+
}
|
|
1279
|
+
return result;
|
|
1280
|
+
}
|
|
1281
|
+
_baseTimes = baseTimes;
|
|
1282
|
+
return _baseTimes;
|
|
1283
|
+
}
|
|
1284
|
+
var isBuffer = { exports: {} };
|
|
1285
|
+
var stubFalse_1;
|
|
1286
|
+
var hasRequiredStubFalse;
|
|
1287
|
+
function requireStubFalse() {
|
|
1288
|
+
if (hasRequiredStubFalse) return stubFalse_1;
|
|
1289
|
+
hasRequiredStubFalse = 1;
|
|
1290
|
+
function stubFalse() {
|
|
1291
|
+
return false;
|
|
1292
|
+
}
|
|
1293
|
+
stubFalse_1 = stubFalse;
|
|
1294
|
+
return stubFalse_1;
|
|
1295
|
+
}
|
|
1296
|
+
isBuffer.exports;
|
|
1297
|
+
var hasRequiredIsBuffer;
|
|
1298
|
+
function requireIsBuffer() {
|
|
1299
|
+
if (hasRequiredIsBuffer) return isBuffer.exports;
|
|
1300
|
+
hasRequiredIsBuffer = 1;
|
|
1301
|
+
(function(module, exports) {
|
|
1302
|
+
var root = require_root(), stubFalse = requireStubFalse();
|
|
1303
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1304
|
+
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
1305
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1306
|
+
var Buffer = moduleExports ? root.Buffer : void 0;
|
|
1307
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
|
|
1308
|
+
var isBuffer2 = nativeIsBuffer || stubFalse;
|
|
1309
|
+
module.exports = isBuffer2;
|
|
1310
|
+
})(isBuffer, isBuffer.exports);
|
|
1311
|
+
return isBuffer.exports;
|
|
1312
|
+
}
|
|
1313
|
+
var _baseIsTypedArray;
|
|
1314
|
+
var hasRequired_baseIsTypedArray;
|
|
1315
|
+
function require_baseIsTypedArray() {
|
|
1316
|
+
if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
|
|
1317
|
+
hasRequired_baseIsTypedArray = 1;
|
|
1318
|
+
var baseGetTag = require_baseGetTag(), isLength = requireIsLength(), isObjectLike = requireIsObjectLike();
|
|
1319
|
+
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
|
|
1320
|
+
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
1321
|
+
var typedArrayTags = {};
|
|
1322
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
1323
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
1324
|
+
function baseIsTypedArray(value) {
|
|
1325
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
1326
|
+
}
|
|
1327
|
+
_baseIsTypedArray = baseIsTypedArray;
|
|
1328
|
+
return _baseIsTypedArray;
|
|
1329
|
+
}
|
|
1330
|
+
var _baseUnary;
|
|
1331
|
+
var hasRequired_baseUnary;
|
|
1332
|
+
function require_baseUnary() {
|
|
1333
|
+
if (hasRequired_baseUnary) return _baseUnary;
|
|
1334
|
+
hasRequired_baseUnary = 1;
|
|
1335
|
+
function baseUnary(func) {
|
|
1336
|
+
return function(value) {
|
|
1337
|
+
return func(value);
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
_baseUnary = baseUnary;
|
|
1341
|
+
return _baseUnary;
|
|
1342
|
+
}
|
|
1343
|
+
var _nodeUtil = { exports: {} };
|
|
1344
|
+
_nodeUtil.exports;
|
|
1345
|
+
var hasRequired_nodeUtil;
|
|
1346
|
+
function require_nodeUtil() {
|
|
1347
|
+
if (hasRequired_nodeUtil) return _nodeUtil.exports;
|
|
1348
|
+
hasRequired_nodeUtil = 1;
|
|
1349
|
+
(function(module, exports) {
|
|
1350
|
+
var freeGlobal = require_freeGlobal();
|
|
1351
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1352
|
+
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
1353
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1354
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
1355
|
+
var nodeUtil = (function() {
|
|
1356
|
+
try {
|
|
1357
|
+
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
1358
|
+
if (types) {
|
|
1359
|
+
return types;
|
|
1360
|
+
}
|
|
1361
|
+
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
1362
|
+
} catch (e) {
|
|
1363
|
+
}
|
|
1364
|
+
})();
|
|
1365
|
+
module.exports = nodeUtil;
|
|
1366
|
+
})(_nodeUtil, _nodeUtil.exports);
|
|
1367
|
+
return _nodeUtil.exports;
|
|
1368
|
+
}
|
|
1369
|
+
var isTypedArray_1;
|
|
1370
|
+
var hasRequiredIsTypedArray;
|
|
1371
|
+
function requireIsTypedArray() {
|
|
1372
|
+
if (hasRequiredIsTypedArray) return isTypedArray_1;
|
|
1373
|
+
hasRequiredIsTypedArray = 1;
|
|
1374
|
+
var baseIsTypedArray = require_baseIsTypedArray(), baseUnary = require_baseUnary(), nodeUtil = require_nodeUtil();
|
|
1375
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
1376
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1377
|
+
isTypedArray_1 = isTypedArray;
|
|
1378
|
+
return isTypedArray_1;
|
|
1379
|
+
}
|
|
1380
|
+
var _arrayLikeKeys;
|
|
1381
|
+
var hasRequired_arrayLikeKeys;
|
|
1382
|
+
function require_arrayLikeKeys() {
|
|
1383
|
+
if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
|
|
1384
|
+
hasRequired_arrayLikeKeys = 1;
|
|
1385
|
+
var baseTimes = require_baseTimes(), isArguments = requireIsArguments(), isArray = requireIsArray(), isBuffer2 = requireIsBuffer(), isIndex = require_isIndex(), isTypedArray = requireIsTypedArray();
|
|
1386
|
+
var objectProto = Object.prototype;
|
|
1387
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1388
|
+
function arrayLikeKeys(value, inherited) {
|
|
1389
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
1390
|
+
for (var key in value) {
|
|
1391
|
+
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1392
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1393
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1394
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
1395
|
+
isIndex(key, length)))) {
|
|
1396
|
+
result.push(key);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
return result;
|
|
1400
|
+
}
|
|
1401
|
+
_arrayLikeKeys = arrayLikeKeys;
|
|
1402
|
+
return _arrayLikeKeys;
|
|
1403
|
+
}
|
|
1404
|
+
var _isPrototype;
|
|
1405
|
+
var hasRequired_isPrototype;
|
|
1406
|
+
function require_isPrototype() {
|
|
1407
|
+
if (hasRequired_isPrototype) return _isPrototype;
|
|
1408
|
+
hasRequired_isPrototype = 1;
|
|
1409
|
+
var objectProto = Object.prototype;
|
|
1410
|
+
function isPrototype(value) {
|
|
1411
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
1412
|
+
return value === proto;
|
|
1413
|
+
}
|
|
1414
|
+
_isPrototype = isPrototype;
|
|
1415
|
+
return _isPrototype;
|
|
1416
|
+
}
|
|
1417
|
+
var _overArg;
|
|
1418
|
+
var hasRequired_overArg;
|
|
1419
|
+
function require_overArg() {
|
|
1420
|
+
if (hasRequired_overArg) return _overArg;
|
|
1421
|
+
hasRequired_overArg = 1;
|
|
1422
|
+
function overArg(func, transform) {
|
|
1423
|
+
return function(arg) {
|
|
1424
|
+
return func(transform(arg));
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
_overArg = overArg;
|
|
1428
|
+
return _overArg;
|
|
1429
|
+
}
|
|
1430
|
+
var _nativeKeys;
|
|
1431
|
+
var hasRequired_nativeKeys;
|
|
1432
|
+
function require_nativeKeys() {
|
|
1433
|
+
if (hasRequired_nativeKeys) return _nativeKeys;
|
|
1434
|
+
hasRequired_nativeKeys = 1;
|
|
1435
|
+
var overArg = require_overArg();
|
|
1436
|
+
var nativeKeys = overArg(Object.keys, Object);
|
|
1437
|
+
_nativeKeys = nativeKeys;
|
|
1438
|
+
return _nativeKeys;
|
|
1439
|
+
}
|
|
1440
|
+
var _baseKeys;
|
|
1441
|
+
var hasRequired_baseKeys;
|
|
1442
|
+
function require_baseKeys() {
|
|
1443
|
+
if (hasRequired_baseKeys) return _baseKeys;
|
|
1444
|
+
hasRequired_baseKeys = 1;
|
|
1445
|
+
var isPrototype = require_isPrototype(), nativeKeys = require_nativeKeys();
|
|
1446
|
+
var objectProto = Object.prototype;
|
|
1447
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1448
|
+
function baseKeys(object2) {
|
|
1449
|
+
if (!isPrototype(object2)) {
|
|
1450
|
+
return nativeKeys(object2);
|
|
1451
|
+
}
|
|
1452
|
+
var result = [];
|
|
1453
|
+
for (var key in Object(object2)) {
|
|
1454
|
+
if (hasOwnProperty.call(object2, key) && key != "constructor") {
|
|
1455
|
+
result.push(key);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
return result;
|
|
1459
|
+
}
|
|
1460
|
+
_baseKeys = baseKeys;
|
|
1461
|
+
return _baseKeys;
|
|
1462
|
+
}
|
|
1463
|
+
var isArrayLike_1;
|
|
1464
|
+
var hasRequiredIsArrayLike;
|
|
1465
|
+
function requireIsArrayLike() {
|
|
1466
|
+
if (hasRequiredIsArrayLike) return isArrayLike_1;
|
|
1467
|
+
hasRequiredIsArrayLike = 1;
|
|
1468
|
+
var isFunction = requireIsFunction(), isLength = requireIsLength();
|
|
1469
|
+
function isArrayLike(value) {
|
|
1470
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
1471
|
+
}
|
|
1472
|
+
isArrayLike_1 = isArrayLike;
|
|
1473
|
+
return isArrayLike_1;
|
|
1474
|
+
}
|
|
1475
|
+
var keys_1;
|
|
1476
|
+
var hasRequiredKeys;
|
|
1477
|
+
function requireKeys() {
|
|
1478
|
+
if (hasRequiredKeys) return keys_1;
|
|
1479
|
+
hasRequiredKeys = 1;
|
|
1480
|
+
var arrayLikeKeys = require_arrayLikeKeys(), baseKeys = require_baseKeys(), isArrayLike = requireIsArrayLike();
|
|
1481
|
+
function keys(object2) {
|
|
1482
|
+
return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2);
|
|
1483
|
+
}
|
|
1484
|
+
keys_1 = keys;
|
|
1485
|
+
return keys_1;
|
|
1486
|
+
}
|
|
1487
|
+
var _baseForOwn;
|
|
1488
|
+
var hasRequired_baseForOwn;
|
|
1489
|
+
function require_baseForOwn() {
|
|
1490
|
+
if (hasRequired_baseForOwn) return _baseForOwn;
|
|
1491
|
+
hasRequired_baseForOwn = 1;
|
|
1492
|
+
var baseFor = require_baseFor(), keys = requireKeys();
|
|
1493
|
+
function baseForOwn(object2, iteratee) {
|
|
1494
|
+
return object2 && baseFor(object2, iteratee, keys);
|
|
1495
|
+
}
|
|
1496
|
+
_baseForOwn = baseForOwn;
|
|
1497
|
+
return _baseForOwn;
|
|
1498
|
+
}
|
|
1499
|
+
var _stackClear;
|
|
1500
|
+
var hasRequired_stackClear;
|
|
1501
|
+
function require_stackClear() {
|
|
1502
|
+
if (hasRequired_stackClear) return _stackClear;
|
|
1503
|
+
hasRequired_stackClear = 1;
|
|
1504
|
+
var ListCache = require_ListCache();
|
|
1505
|
+
function stackClear() {
|
|
1506
|
+
this.__data__ = new ListCache();
|
|
1507
|
+
this.size = 0;
|
|
1508
|
+
}
|
|
1509
|
+
_stackClear = stackClear;
|
|
1510
|
+
return _stackClear;
|
|
1511
|
+
}
|
|
1512
|
+
var _stackDelete;
|
|
1513
|
+
var hasRequired_stackDelete;
|
|
1514
|
+
function require_stackDelete() {
|
|
1515
|
+
if (hasRequired_stackDelete) return _stackDelete;
|
|
1516
|
+
hasRequired_stackDelete = 1;
|
|
1517
|
+
function stackDelete(key) {
|
|
1518
|
+
var data = this.__data__, result = data["delete"](key);
|
|
1519
|
+
this.size = data.size;
|
|
1520
|
+
return result;
|
|
1521
|
+
}
|
|
1522
|
+
_stackDelete = stackDelete;
|
|
1523
|
+
return _stackDelete;
|
|
1524
|
+
}
|
|
1525
|
+
var _stackGet;
|
|
1526
|
+
var hasRequired_stackGet;
|
|
1527
|
+
function require_stackGet() {
|
|
1528
|
+
if (hasRequired_stackGet) return _stackGet;
|
|
1529
|
+
hasRequired_stackGet = 1;
|
|
1530
|
+
function stackGet(key) {
|
|
1531
|
+
return this.__data__.get(key);
|
|
1532
|
+
}
|
|
1533
|
+
_stackGet = stackGet;
|
|
1534
|
+
return _stackGet;
|
|
1535
|
+
}
|
|
1536
|
+
var _stackHas;
|
|
1537
|
+
var hasRequired_stackHas;
|
|
1538
|
+
function require_stackHas() {
|
|
1539
|
+
if (hasRequired_stackHas) return _stackHas;
|
|
1540
|
+
hasRequired_stackHas = 1;
|
|
1541
|
+
function stackHas(key) {
|
|
1542
|
+
return this.__data__.has(key);
|
|
1543
|
+
}
|
|
1544
|
+
_stackHas = stackHas;
|
|
1545
|
+
return _stackHas;
|
|
1546
|
+
}
|
|
1547
|
+
var _stackSet;
|
|
1548
|
+
var hasRequired_stackSet;
|
|
1549
|
+
function require_stackSet() {
|
|
1550
|
+
if (hasRequired_stackSet) return _stackSet;
|
|
1551
|
+
hasRequired_stackSet = 1;
|
|
1552
|
+
var ListCache = require_ListCache(), Map2 = require_Map(), MapCache = require_MapCache();
|
|
1553
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
1554
|
+
function stackSet(key, value) {
|
|
1555
|
+
var data = this.__data__;
|
|
1556
|
+
if (data instanceof ListCache) {
|
|
1557
|
+
var pairs = data.__data__;
|
|
1558
|
+
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
1559
|
+
pairs.push([key, value]);
|
|
1560
|
+
this.size = ++data.size;
|
|
1561
|
+
return this;
|
|
1562
|
+
}
|
|
1563
|
+
data = this.__data__ = new MapCache(pairs);
|
|
1564
|
+
}
|
|
1565
|
+
data.set(key, value);
|
|
1566
|
+
this.size = data.size;
|
|
1567
|
+
return this;
|
|
1568
|
+
}
|
|
1569
|
+
_stackSet = stackSet;
|
|
1570
|
+
return _stackSet;
|
|
1571
|
+
}
|
|
1572
|
+
var _Stack;
|
|
1573
|
+
var hasRequired_Stack;
|
|
1574
|
+
function require_Stack() {
|
|
1575
|
+
if (hasRequired_Stack) return _Stack;
|
|
1576
|
+
hasRequired_Stack = 1;
|
|
1577
|
+
var ListCache = require_ListCache(), stackClear = require_stackClear(), stackDelete = require_stackDelete(), stackGet = require_stackGet(), stackHas = require_stackHas(), stackSet = require_stackSet();
|
|
1578
|
+
function Stack(entries) {
|
|
1579
|
+
var data = this.__data__ = new ListCache(entries);
|
|
1580
|
+
this.size = data.size;
|
|
1581
|
+
}
|
|
1582
|
+
Stack.prototype.clear = stackClear;
|
|
1583
|
+
Stack.prototype["delete"] = stackDelete;
|
|
1584
|
+
Stack.prototype.get = stackGet;
|
|
1585
|
+
Stack.prototype.has = stackHas;
|
|
1586
|
+
Stack.prototype.set = stackSet;
|
|
1587
|
+
_Stack = Stack;
|
|
1588
|
+
return _Stack;
|
|
1589
|
+
}
|
|
1590
|
+
var _setCacheAdd;
|
|
1591
|
+
var hasRequired_setCacheAdd;
|
|
1592
|
+
function require_setCacheAdd() {
|
|
1593
|
+
if (hasRequired_setCacheAdd) return _setCacheAdd;
|
|
1594
|
+
hasRequired_setCacheAdd = 1;
|
|
1595
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1596
|
+
function setCacheAdd(value) {
|
|
1597
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
1598
|
+
return this;
|
|
1599
|
+
}
|
|
1600
|
+
_setCacheAdd = setCacheAdd;
|
|
1601
|
+
return _setCacheAdd;
|
|
1602
|
+
}
|
|
1603
|
+
var _setCacheHas;
|
|
1604
|
+
var hasRequired_setCacheHas;
|
|
1605
|
+
function require_setCacheHas() {
|
|
1606
|
+
if (hasRequired_setCacheHas) return _setCacheHas;
|
|
1607
|
+
hasRequired_setCacheHas = 1;
|
|
1608
|
+
function setCacheHas(value) {
|
|
1609
|
+
return this.__data__.has(value);
|
|
1610
|
+
}
|
|
1611
|
+
_setCacheHas = setCacheHas;
|
|
1612
|
+
return _setCacheHas;
|
|
1613
|
+
}
|
|
1614
|
+
var _SetCache;
|
|
1615
|
+
var hasRequired_SetCache;
|
|
1616
|
+
function require_SetCache() {
|
|
1617
|
+
if (hasRequired_SetCache) return _SetCache;
|
|
1618
|
+
hasRequired_SetCache = 1;
|
|
1619
|
+
var MapCache = require_MapCache(), setCacheAdd = require_setCacheAdd(), setCacheHas = require_setCacheHas();
|
|
1620
|
+
function SetCache(values) {
|
|
1621
|
+
var index2 = -1, length = values == null ? 0 : values.length;
|
|
1622
|
+
this.__data__ = new MapCache();
|
|
1623
|
+
while (++index2 < length) {
|
|
1624
|
+
this.add(values[index2]);
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
1628
|
+
SetCache.prototype.has = setCacheHas;
|
|
1629
|
+
_SetCache = SetCache;
|
|
1630
|
+
return _SetCache;
|
|
1631
|
+
}
|
|
1632
|
+
var _arraySome;
|
|
1633
|
+
var hasRequired_arraySome;
|
|
1634
|
+
function require_arraySome() {
|
|
1635
|
+
if (hasRequired_arraySome) return _arraySome;
|
|
1636
|
+
hasRequired_arraySome = 1;
|
|
1637
|
+
function arraySome(array2, predicate) {
|
|
1638
|
+
var index2 = -1, length = array2 == null ? 0 : array2.length;
|
|
1639
|
+
while (++index2 < length) {
|
|
1640
|
+
if (predicate(array2[index2], index2, array2)) {
|
|
1641
|
+
return true;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
return false;
|
|
1645
|
+
}
|
|
1646
|
+
_arraySome = arraySome;
|
|
1647
|
+
return _arraySome;
|
|
1648
|
+
}
|
|
1649
|
+
var _cacheHas;
|
|
1650
|
+
var hasRequired_cacheHas;
|
|
1651
|
+
function require_cacheHas() {
|
|
1652
|
+
if (hasRequired_cacheHas) return _cacheHas;
|
|
1653
|
+
hasRequired_cacheHas = 1;
|
|
1654
|
+
function cacheHas(cache, key) {
|
|
1655
|
+
return cache.has(key);
|
|
1656
|
+
}
|
|
1657
|
+
_cacheHas = cacheHas;
|
|
1658
|
+
return _cacheHas;
|
|
1659
|
+
}
|
|
1660
|
+
var _equalArrays;
|
|
1661
|
+
var hasRequired_equalArrays;
|
|
1662
|
+
function require_equalArrays() {
|
|
1663
|
+
if (hasRequired_equalArrays) return _equalArrays;
|
|
1664
|
+
hasRequired_equalArrays = 1;
|
|
1665
|
+
var SetCache = require_SetCache(), arraySome = require_arraySome(), cacheHas = require_cacheHas();
|
|
1666
|
+
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
1667
|
+
function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
|
|
1668
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
|
|
1669
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
1670
|
+
return false;
|
|
1671
|
+
}
|
|
1672
|
+
var arrStacked = stack.get(array2);
|
|
1673
|
+
var othStacked = stack.get(other);
|
|
1674
|
+
if (arrStacked && othStacked) {
|
|
1675
|
+
return arrStacked == other && othStacked == array2;
|
|
1676
|
+
}
|
|
1677
|
+
var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
|
|
1678
|
+
stack.set(array2, other);
|
|
1679
|
+
stack.set(other, array2);
|
|
1680
|
+
while (++index2 < arrLength) {
|
|
1681
|
+
var arrValue = array2[index2], othValue = other[index2];
|
|
1682
|
+
if (customizer) {
|
|
1683
|
+
var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack);
|
|
1684
|
+
}
|
|
1685
|
+
if (compared !== void 0) {
|
|
1686
|
+
if (compared) {
|
|
1687
|
+
continue;
|
|
1688
|
+
}
|
|
1689
|
+
result = false;
|
|
1690
|
+
break;
|
|
1691
|
+
}
|
|
1692
|
+
if (seen) {
|
|
1693
|
+
if (!arraySome(other, function(othValue2, othIndex) {
|
|
1694
|
+
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
1695
|
+
return seen.push(othIndex);
|
|
1696
|
+
}
|
|
1697
|
+
})) {
|
|
1698
|
+
result = false;
|
|
1699
|
+
break;
|
|
1700
|
+
}
|
|
1701
|
+
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1702
|
+
result = false;
|
|
1703
|
+
break;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
stack["delete"](array2);
|
|
1707
|
+
stack["delete"](other);
|
|
1708
|
+
return result;
|
|
1709
|
+
}
|
|
1710
|
+
_equalArrays = equalArrays;
|
|
1711
|
+
return _equalArrays;
|
|
1712
|
+
}
|
|
1713
|
+
var _Uint8Array;
|
|
1714
|
+
var hasRequired_Uint8Array;
|
|
1715
|
+
function require_Uint8Array() {
|
|
1716
|
+
if (hasRequired_Uint8Array) return _Uint8Array;
|
|
1717
|
+
hasRequired_Uint8Array = 1;
|
|
1718
|
+
var root = require_root();
|
|
1719
|
+
var Uint8Array = root.Uint8Array;
|
|
1720
|
+
_Uint8Array = Uint8Array;
|
|
1721
|
+
return _Uint8Array;
|
|
1722
|
+
}
|
|
1723
|
+
var _mapToArray;
|
|
1724
|
+
var hasRequired_mapToArray;
|
|
1725
|
+
function require_mapToArray() {
|
|
1726
|
+
if (hasRequired_mapToArray) return _mapToArray;
|
|
1727
|
+
hasRequired_mapToArray = 1;
|
|
1728
|
+
function mapToArray(map2) {
|
|
1729
|
+
var index2 = -1, result = Array(map2.size);
|
|
1730
|
+
map2.forEach(function(value, key) {
|
|
1731
|
+
result[++index2] = [key, value];
|
|
1732
|
+
});
|
|
1733
|
+
return result;
|
|
1734
|
+
}
|
|
1735
|
+
_mapToArray = mapToArray;
|
|
1736
|
+
return _mapToArray;
|
|
1737
|
+
}
|
|
1738
|
+
var _setToArray;
|
|
1739
|
+
var hasRequired_setToArray;
|
|
1740
|
+
function require_setToArray() {
|
|
1741
|
+
if (hasRequired_setToArray) return _setToArray;
|
|
1742
|
+
hasRequired_setToArray = 1;
|
|
1743
|
+
function setToArray(set2) {
|
|
1744
|
+
var index2 = -1, result = Array(set2.size);
|
|
1745
|
+
set2.forEach(function(value) {
|
|
1746
|
+
result[++index2] = value;
|
|
1747
|
+
});
|
|
1748
|
+
return result;
|
|
1749
|
+
}
|
|
1750
|
+
_setToArray = setToArray;
|
|
1751
|
+
return _setToArray;
|
|
1752
|
+
}
|
|
1753
|
+
var _equalByTag;
|
|
1754
|
+
var hasRequired_equalByTag;
|
|
1755
|
+
function require_equalByTag() {
|
|
1756
|
+
if (hasRequired_equalByTag) return _equalByTag;
|
|
1757
|
+
hasRequired_equalByTag = 1;
|
|
1758
|
+
var Symbol2 = require_Symbol(), Uint8Array = require_Uint8Array(), eq = requireEq(), equalArrays = require_equalArrays(), mapToArray = require_mapToArray(), setToArray = require_setToArray();
|
|
1759
|
+
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
1760
|
+
var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
|
|
1761
|
+
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
|
|
1762
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
1763
|
+
function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1764
|
+
switch (tag) {
|
|
1765
|
+
case dataViewTag:
|
|
1766
|
+
if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
|
|
1767
|
+
return false;
|
|
1768
|
+
}
|
|
1769
|
+
object2 = object2.buffer;
|
|
1770
|
+
other = other.buffer;
|
|
1771
|
+
case arrayBufferTag:
|
|
1772
|
+
if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array(object2), new Uint8Array(other))) {
|
|
1773
|
+
return false;
|
|
1774
|
+
}
|
|
1775
|
+
return true;
|
|
1776
|
+
case boolTag:
|
|
1777
|
+
case dateTag:
|
|
1778
|
+
case numberTag:
|
|
1779
|
+
return eq(+object2, +other);
|
|
1780
|
+
case errorTag:
|
|
1781
|
+
return object2.name == other.name && object2.message == other.message;
|
|
1782
|
+
case regexpTag:
|
|
1783
|
+
case stringTag:
|
|
1784
|
+
return object2 == other + "";
|
|
1785
|
+
case mapTag:
|
|
1786
|
+
var convert = mapToArray;
|
|
1787
|
+
case setTag:
|
|
1788
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
1789
|
+
convert || (convert = setToArray);
|
|
1790
|
+
if (object2.size != other.size && !isPartial) {
|
|
1791
|
+
return false;
|
|
1792
|
+
}
|
|
1793
|
+
var stacked = stack.get(object2);
|
|
1794
|
+
if (stacked) {
|
|
1795
|
+
return stacked == other;
|
|
1796
|
+
}
|
|
1797
|
+
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
1798
|
+
stack.set(object2, other);
|
|
1799
|
+
var result = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack);
|
|
1800
|
+
stack["delete"](object2);
|
|
1801
|
+
return result;
|
|
1802
|
+
case symbolTag:
|
|
1803
|
+
if (symbolValueOf) {
|
|
1804
|
+
return symbolValueOf.call(object2) == symbolValueOf.call(other);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
return false;
|
|
1808
|
+
}
|
|
1809
|
+
_equalByTag = equalByTag;
|
|
1810
|
+
return _equalByTag;
|
|
1811
|
+
}
|
|
1812
|
+
var _arrayPush;
|
|
1813
|
+
var hasRequired_arrayPush;
|
|
1814
|
+
function require_arrayPush() {
|
|
1815
|
+
if (hasRequired_arrayPush) return _arrayPush;
|
|
1816
|
+
hasRequired_arrayPush = 1;
|
|
1817
|
+
function arrayPush(array2, values) {
|
|
1818
|
+
var index2 = -1, length = values.length, offset = array2.length;
|
|
1819
|
+
while (++index2 < length) {
|
|
1820
|
+
array2[offset + index2] = values[index2];
|
|
1821
|
+
}
|
|
1822
|
+
return array2;
|
|
1823
|
+
}
|
|
1824
|
+
_arrayPush = arrayPush;
|
|
1825
|
+
return _arrayPush;
|
|
1826
|
+
}
|
|
1827
|
+
var _baseGetAllKeys;
|
|
1828
|
+
var hasRequired_baseGetAllKeys;
|
|
1829
|
+
function require_baseGetAllKeys() {
|
|
1830
|
+
if (hasRequired_baseGetAllKeys) return _baseGetAllKeys;
|
|
1831
|
+
hasRequired_baseGetAllKeys = 1;
|
|
1832
|
+
var arrayPush = require_arrayPush(), isArray = requireIsArray();
|
|
1833
|
+
function baseGetAllKeys(object2, keysFunc, symbolsFunc) {
|
|
1834
|
+
var result = keysFunc(object2);
|
|
1835
|
+
return isArray(object2) ? result : arrayPush(result, symbolsFunc(object2));
|
|
1836
|
+
}
|
|
1837
|
+
_baseGetAllKeys = baseGetAllKeys;
|
|
1838
|
+
return _baseGetAllKeys;
|
|
1839
|
+
}
|
|
1840
|
+
var _arrayFilter;
|
|
1841
|
+
var hasRequired_arrayFilter;
|
|
1842
|
+
function require_arrayFilter() {
|
|
1843
|
+
if (hasRequired_arrayFilter) return _arrayFilter;
|
|
1844
|
+
hasRequired_arrayFilter = 1;
|
|
1845
|
+
function arrayFilter(array2, predicate) {
|
|
1846
|
+
var index2 = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
|
|
1847
|
+
while (++index2 < length) {
|
|
1848
|
+
var value = array2[index2];
|
|
1849
|
+
if (predicate(value, index2, array2)) {
|
|
1850
|
+
result[resIndex++] = value;
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
return result;
|
|
1854
|
+
}
|
|
1855
|
+
_arrayFilter = arrayFilter;
|
|
1856
|
+
return _arrayFilter;
|
|
1857
|
+
}
|
|
1858
|
+
var stubArray_1;
|
|
1859
|
+
var hasRequiredStubArray;
|
|
1860
|
+
function requireStubArray() {
|
|
1861
|
+
if (hasRequiredStubArray) return stubArray_1;
|
|
1862
|
+
hasRequiredStubArray = 1;
|
|
1863
|
+
function stubArray() {
|
|
1864
|
+
return [];
|
|
1865
|
+
}
|
|
1866
|
+
stubArray_1 = stubArray;
|
|
1867
|
+
return stubArray_1;
|
|
1868
|
+
}
|
|
1869
|
+
var _getSymbols;
|
|
1870
|
+
var hasRequired_getSymbols;
|
|
1871
|
+
function require_getSymbols() {
|
|
1872
|
+
if (hasRequired_getSymbols) return _getSymbols;
|
|
1873
|
+
hasRequired_getSymbols = 1;
|
|
1874
|
+
var arrayFilter = require_arrayFilter(), stubArray = requireStubArray();
|
|
1875
|
+
var objectProto = Object.prototype;
|
|
1876
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
1877
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
1878
|
+
var getSymbols = !nativeGetSymbols ? stubArray : function(object2) {
|
|
1879
|
+
if (object2 == null) {
|
|
1880
|
+
return [];
|
|
1881
|
+
}
|
|
1882
|
+
object2 = Object(object2);
|
|
1883
|
+
return arrayFilter(nativeGetSymbols(object2), function(symbol) {
|
|
1884
|
+
return propertyIsEnumerable.call(object2, symbol);
|
|
1885
|
+
});
|
|
1886
|
+
};
|
|
1887
|
+
_getSymbols = getSymbols;
|
|
1888
|
+
return _getSymbols;
|
|
1889
|
+
}
|
|
1890
|
+
var _getAllKeys;
|
|
1891
|
+
var hasRequired_getAllKeys;
|
|
1892
|
+
function require_getAllKeys() {
|
|
1893
|
+
if (hasRequired_getAllKeys) return _getAllKeys;
|
|
1894
|
+
hasRequired_getAllKeys = 1;
|
|
1895
|
+
var baseGetAllKeys = require_baseGetAllKeys(), getSymbols = require_getSymbols(), keys = requireKeys();
|
|
1896
|
+
function getAllKeys(object2) {
|
|
1897
|
+
return baseGetAllKeys(object2, keys, getSymbols);
|
|
1898
|
+
}
|
|
1899
|
+
_getAllKeys = getAllKeys;
|
|
1900
|
+
return _getAllKeys;
|
|
1901
|
+
}
|
|
1902
|
+
var _equalObjects;
|
|
1903
|
+
var hasRequired_equalObjects;
|
|
1904
|
+
function require_equalObjects() {
|
|
1905
|
+
if (hasRequired_equalObjects) return _equalObjects;
|
|
1906
|
+
hasRequired_equalObjects = 1;
|
|
1907
|
+
var getAllKeys = require_getAllKeys();
|
|
1908
|
+
var COMPARE_PARTIAL_FLAG = 1;
|
|
1909
|
+
var objectProto = Object.prototype;
|
|
1910
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1911
|
+
function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
1912
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
1913
|
+
if (objLength != othLength && !isPartial) {
|
|
1914
|
+
return false;
|
|
1915
|
+
}
|
|
1916
|
+
var index2 = objLength;
|
|
1917
|
+
while (index2--) {
|
|
1918
|
+
var key = objProps[index2];
|
|
1919
|
+
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
1920
|
+
return false;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
var objStacked = stack.get(object2);
|
|
1924
|
+
var othStacked = stack.get(other);
|
|
1925
|
+
if (objStacked && othStacked) {
|
|
1926
|
+
return objStacked == other && othStacked == object2;
|
|
1927
|
+
}
|
|
1928
|
+
var result = true;
|
|
1929
|
+
stack.set(object2, other);
|
|
1930
|
+
stack.set(other, object2);
|
|
1931
|
+
var skipCtor = isPartial;
|
|
1932
|
+
while (++index2 < objLength) {
|
|
1933
|
+
key = objProps[index2];
|
|
1934
|
+
var objValue = object2[key], othValue = other[key];
|
|
1935
|
+
if (customizer) {
|
|
1936
|
+
var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack);
|
|
1937
|
+
}
|
|
1938
|
+
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
1939
|
+
result = false;
|
|
1940
|
+
break;
|
|
1941
|
+
}
|
|
1942
|
+
skipCtor || (skipCtor = key == "constructor");
|
|
1943
|
+
}
|
|
1944
|
+
if (result && !skipCtor) {
|
|
1945
|
+
var objCtor = object2.constructor, othCtor = other.constructor;
|
|
1946
|
+
if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
1947
|
+
result = false;
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
stack["delete"](object2);
|
|
1951
|
+
stack["delete"](other);
|
|
1952
|
+
return result;
|
|
1953
|
+
}
|
|
1954
|
+
_equalObjects = equalObjects;
|
|
1955
|
+
return _equalObjects;
|
|
1956
|
+
}
|
|
1957
|
+
var _DataView;
|
|
1958
|
+
var hasRequired_DataView;
|
|
1959
|
+
function require_DataView() {
|
|
1960
|
+
if (hasRequired_DataView) return _DataView;
|
|
1961
|
+
hasRequired_DataView = 1;
|
|
1962
|
+
var getNative = require_getNative(), root = require_root();
|
|
1963
|
+
var DataView = getNative(root, "DataView");
|
|
1964
|
+
_DataView = DataView;
|
|
1965
|
+
return _DataView;
|
|
1966
|
+
}
|
|
1967
|
+
var _Promise;
|
|
1968
|
+
var hasRequired_Promise;
|
|
1969
|
+
function require_Promise() {
|
|
1970
|
+
if (hasRequired_Promise) return _Promise;
|
|
1971
|
+
hasRequired_Promise = 1;
|
|
1972
|
+
var getNative = require_getNative(), root = require_root();
|
|
1973
|
+
var Promise2 = getNative(root, "Promise");
|
|
1974
|
+
_Promise = Promise2;
|
|
1975
|
+
return _Promise;
|
|
1976
|
+
}
|
|
1977
|
+
var _Set;
|
|
1978
|
+
var hasRequired_Set;
|
|
1979
|
+
function require_Set() {
|
|
1980
|
+
if (hasRequired_Set) return _Set;
|
|
1981
|
+
hasRequired_Set = 1;
|
|
1982
|
+
var getNative = require_getNative(), root = require_root();
|
|
1983
|
+
var Set2 = getNative(root, "Set");
|
|
1984
|
+
_Set = Set2;
|
|
1985
|
+
return _Set;
|
|
1986
|
+
}
|
|
1987
|
+
var _WeakMap;
|
|
1988
|
+
var hasRequired_WeakMap;
|
|
1989
|
+
function require_WeakMap() {
|
|
1990
|
+
if (hasRequired_WeakMap) return _WeakMap;
|
|
1991
|
+
hasRequired_WeakMap = 1;
|
|
1992
|
+
var getNative = require_getNative(), root = require_root();
|
|
1993
|
+
var WeakMap = getNative(root, "WeakMap");
|
|
1994
|
+
_WeakMap = WeakMap;
|
|
1995
|
+
return _WeakMap;
|
|
1996
|
+
}
|
|
1997
|
+
var _getTag;
|
|
1998
|
+
var hasRequired_getTag;
|
|
1999
|
+
function require_getTag() {
|
|
2000
|
+
if (hasRequired_getTag) return _getTag;
|
|
2001
|
+
hasRequired_getTag = 1;
|
|
2002
|
+
var DataView = require_DataView(), Map2 = require_Map(), Promise2 = require_Promise(), Set2 = require_Set(), WeakMap = require_WeakMap(), baseGetTag = require_baseGetTag(), toSource = require_toSource();
|
|
2003
|
+
var mapTag = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
|
|
2004
|
+
var dataViewTag = "[object DataView]";
|
|
2005
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
|
|
2006
|
+
var getTag = baseGetTag;
|
|
2007
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
|
|
2008
|
+
getTag = function(value) {
|
|
2009
|
+
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
2010
|
+
if (ctorString) {
|
|
2011
|
+
switch (ctorString) {
|
|
2012
|
+
case dataViewCtorString:
|
|
2013
|
+
return dataViewTag;
|
|
2014
|
+
case mapCtorString:
|
|
2015
|
+
return mapTag;
|
|
2016
|
+
case promiseCtorString:
|
|
2017
|
+
return promiseTag;
|
|
2018
|
+
case setCtorString:
|
|
2019
|
+
return setTag;
|
|
2020
|
+
case weakMapCtorString:
|
|
2021
|
+
return weakMapTag;
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
return result;
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
_getTag = getTag;
|
|
2028
|
+
return _getTag;
|
|
2029
|
+
}
|
|
2030
|
+
var _baseIsEqualDeep;
|
|
2031
|
+
var hasRequired_baseIsEqualDeep;
|
|
2032
|
+
function require_baseIsEqualDeep() {
|
|
2033
|
+
if (hasRequired_baseIsEqualDeep) return _baseIsEqualDeep;
|
|
2034
|
+
hasRequired_baseIsEqualDeep = 1;
|
|
2035
|
+
var Stack = require_Stack(), equalArrays = require_equalArrays(), equalByTag = require_equalByTag(), equalObjects = require_equalObjects(), getTag = require_getTag(), isArray = requireIsArray(), isBuffer2 = requireIsBuffer(), isTypedArray = requireIsTypedArray();
|
|
2036
|
+
var COMPARE_PARTIAL_FLAG = 1;
|
|
2037
|
+
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
|
|
2038
|
+
var objectProto = Object.prototype;
|
|
2039
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2040
|
+
function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) {
|
|
2041
|
+
var objIsArr = isArray(object2), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object2), othTag = othIsArr ? arrayTag : getTag(other);
|
|
2042
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
2043
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
2044
|
+
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
2045
|
+
if (isSameTag && isBuffer2(object2)) {
|
|
2046
|
+
if (!isBuffer2(other)) {
|
|
2047
|
+
return false;
|
|
2048
|
+
}
|
|
2049
|
+
objIsArr = true;
|
|
2050
|
+
objIsObj = false;
|
|
2051
|
+
}
|
|
2052
|
+
if (isSameTag && !objIsObj) {
|
|
2053
|
+
stack || (stack = new Stack());
|
|
2054
|
+
return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
2055
|
+
}
|
|
2056
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
2057
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
2058
|
+
if (objIsWrapped || othIsWrapped) {
|
|
2059
|
+
var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
2060
|
+
stack || (stack = new Stack());
|
|
2061
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
if (!isSameTag) {
|
|
2065
|
+
return false;
|
|
2066
|
+
}
|
|
2067
|
+
stack || (stack = new Stack());
|
|
2068
|
+
return equalObjects(object2, other, bitmask, customizer, equalFunc, stack);
|
|
2069
|
+
}
|
|
2070
|
+
_baseIsEqualDeep = baseIsEqualDeep;
|
|
2071
|
+
return _baseIsEqualDeep;
|
|
2072
|
+
}
|
|
2073
|
+
var _baseIsEqual;
|
|
2074
|
+
var hasRequired_baseIsEqual;
|
|
2075
|
+
function require_baseIsEqual() {
|
|
2076
|
+
if (hasRequired_baseIsEqual) return _baseIsEqual;
|
|
2077
|
+
hasRequired_baseIsEqual = 1;
|
|
2078
|
+
var baseIsEqualDeep = require_baseIsEqualDeep(), isObjectLike = requireIsObjectLike();
|
|
2079
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
2080
|
+
if (value === other) {
|
|
2081
|
+
return true;
|
|
2082
|
+
}
|
|
2083
|
+
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
2084
|
+
return value !== value && other !== other;
|
|
2085
|
+
}
|
|
2086
|
+
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
2087
|
+
}
|
|
2088
|
+
_baseIsEqual = baseIsEqual;
|
|
2089
|
+
return _baseIsEqual;
|
|
2090
|
+
}
|
|
2091
|
+
var _baseIsMatch;
|
|
2092
|
+
var hasRequired_baseIsMatch;
|
|
2093
|
+
function require_baseIsMatch() {
|
|
2094
|
+
if (hasRequired_baseIsMatch) return _baseIsMatch;
|
|
2095
|
+
hasRequired_baseIsMatch = 1;
|
|
2096
|
+
var Stack = require_Stack(), baseIsEqual = require_baseIsEqual();
|
|
2097
|
+
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
2098
|
+
function baseIsMatch(object2, source, matchData, customizer) {
|
|
2099
|
+
var index2 = matchData.length, length = index2, noCustomizer = !customizer;
|
|
2100
|
+
if (object2 == null) {
|
|
2101
|
+
return !length;
|
|
2102
|
+
}
|
|
2103
|
+
object2 = Object(object2);
|
|
2104
|
+
while (index2--) {
|
|
2105
|
+
var data = matchData[index2];
|
|
2106
|
+
if (noCustomizer && data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) {
|
|
2107
|
+
return false;
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
while (++index2 < length) {
|
|
2111
|
+
data = matchData[index2];
|
|
2112
|
+
var key = data[0], objValue = object2[key], srcValue = data[1];
|
|
2113
|
+
if (noCustomizer && data[2]) {
|
|
2114
|
+
if (objValue === void 0 && !(key in object2)) {
|
|
2115
|
+
return false;
|
|
2116
|
+
}
|
|
2117
|
+
} else {
|
|
2118
|
+
var stack = new Stack();
|
|
2119
|
+
if (customizer) {
|
|
2120
|
+
var result = customizer(objValue, srcValue, key, object2, source, stack);
|
|
2121
|
+
}
|
|
2122
|
+
if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
|
|
2123
|
+
return false;
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
return true;
|
|
2128
|
+
}
|
|
2129
|
+
_baseIsMatch = baseIsMatch;
|
|
2130
|
+
return _baseIsMatch;
|
|
2131
|
+
}
|
|
2132
|
+
var _isStrictComparable;
|
|
2133
|
+
var hasRequired_isStrictComparable;
|
|
2134
|
+
function require_isStrictComparable() {
|
|
2135
|
+
if (hasRequired_isStrictComparable) return _isStrictComparable;
|
|
2136
|
+
hasRequired_isStrictComparable = 1;
|
|
2137
|
+
var isObject = requireIsObject();
|
|
2138
|
+
function isStrictComparable(value) {
|
|
2139
|
+
return value === value && !isObject(value);
|
|
2140
|
+
}
|
|
2141
|
+
_isStrictComparable = isStrictComparable;
|
|
2142
|
+
return _isStrictComparable;
|
|
2143
|
+
}
|
|
2144
|
+
var _getMatchData;
|
|
2145
|
+
var hasRequired_getMatchData;
|
|
2146
|
+
function require_getMatchData() {
|
|
2147
|
+
if (hasRequired_getMatchData) return _getMatchData;
|
|
2148
|
+
hasRequired_getMatchData = 1;
|
|
2149
|
+
var isStrictComparable = require_isStrictComparable(), keys = requireKeys();
|
|
2150
|
+
function getMatchData(object2) {
|
|
2151
|
+
var result = keys(object2), length = result.length;
|
|
2152
|
+
while (length--) {
|
|
2153
|
+
var key = result[length], value = object2[key];
|
|
2154
|
+
result[length] = [key, value, isStrictComparable(value)];
|
|
2155
|
+
}
|
|
2156
|
+
return result;
|
|
2157
|
+
}
|
|
2158
|
+
_getMatchData = getMatchData;
|
|
2159
|
+
return _getMatchData;
|
|
2160
|
+
}
|
|
2161
|
+
var _matchesStrictComparable;
|
|
2162
|
+
var hasRequired_matchesStrictComparable;
|
|
2163
|
+
function require_matchesStrictComparable() {
|
|
2164
|
+
if (hasRequired_matchesStrictComparable) return _matchesStrictComparable;
|
|
2165
|
+
hasRequired_matchesStrictComparable = 1;
|
|
2166
|
+
function matchesStrictComparable(key, srcValue) {
|
|
2167
|
+
return function(object2) {
|
|
2168
|
+
if (object2 == null) {
|
|
2169
|
+
return false;
|
|
2170
|
+
}
|
|
2171
|
+
return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2));
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
_matchesStrictComparable = matchesStrictComparable;
|
|
2175
|
+
return _matchesStrictComparable;
|
|
2176
|
+
}
|
|
2177
|
+
var _baseMatches;
|
|
2178
|
+
var hasRequired_baseMatches;
|
|
2179
|
+
function require_baseMatches() {
|
|
2180
|
+
if (hasRequired_baseMatches) return _baseMatches;
|
|
2181
|
+
hasRequired_baseMatches = 1;
|
|
2182
|
+
var baseIsMatch = require_baseIsMatch(), getMatchData = require_getMatchData(), matchesStrictComparable = require_matchesStrictComparable();
|
|
2183
|
+
function baseMatches(source) {
|
|
2184
|
+
var matchData = getMatchData(source);
|
|
2185
|
+
if (matchData.length == 1 && matchData[0][2]) {
|
|
2186
|
+
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
2187
|
+
}
|
|
2188
|
+
return function(object2) {
|
|
2189
|
+
return object2 === source || baseIsMatch(object2, source, matchData);
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
_baseMatches = baseMatches;
|
|
2193
|
+
return _baseMatches;
|
|
2194
|
+
}
|
|
2195
|
+
var _baseGet;
|
|
2196
|
+
var hasRequired_baseGet;
|
|
2197
|
+
function require_baseGet() {
|
|
2198
|
+
if (hasRequired_baseGet) return _baseGet;
|
|
2199
|
+
hasRequired_baseGet = 1;
|
|
2200
|
+
var castPath = require_castPath(), toKey = require_toKey();
|
|
2201
|
+
function baseGet(object2, path) {
|
|
2202
|
+
path = castPath(path, object2);
|
|
2203
|
+
var index2 = 0, length = path.length;
|
|
2204
|
+
while (object2 != null && index2 < length) {
|
|
2205
|
+
object2 = object2[toKey(path[index2++])];
|
|
2206
|
+
}
|
|
2207
|
+
return index2 && index2 == length ? object2 : void 0;
|
|
2208
|
+
}
|
|
2209
|
+
_baseGet = baseGet;
|
|
2210
|
+
return _baseGet;
|
|
2211
|
+
}
|
|
2212
|
+
var get_1;
|
|
2213
|
+
var hasRequiredGet;
|
|
2214
|
+
function requireGet() {
|
|
2215
|
+
if (hasRequiredGet) return get_1;
|
|
2216
|
+
hasRequiredGet = 1;
|
|
2217
|
+
var baseGet = require_baseGet();
|
|
2218
|
+
function get(object2, path, defaultValue) {
|
|
2219
|
+
var result = object2 == null ? void 0 : baseGet(object2, path);
|
|
2220
|
+
return result === void 0 ? defaultValue : result;
|
|
2221
|
+
}
|
|
2222
|
+
get_1 = get;
|
|
2223
|
+
return get_1;
|
|
2224
|
+
}
|
|
2225
|
+
var _baseHasIn;
|
|
2226
|
+
var hasRequired_baseHasIn;
|
|
2227
|
+
function require_baseHasIn() {
|
|
2228
|
+
if (hasRequired_baseHasIn) return _baseHasIn;
|
|
2229
|
+
hasRequired_baseHasIn = 1;
|
|
2230
|
+
function baseHasIn(object2, key) {
|
|
2231
|
+
return object2 != null && key in Object(object2);
|
|
2232
|
+
}
|
|
2233
|
+
_baseHasIn = baseHasIn;
|
|
2234
|
+
return _baseHasIn;
|
|
2235
|
+
}
|
|
2236
|
+
var hasIn_1;
|
|
2237
|
+
var hasRequiredHasIn;
|
|
2238
|
+
function requireHasIn() {
|
|
2239
|
+
if (hasRequiredHasIn) return hasIn_1;
|
|
2240
|
+
hasRequiredHasIn = 1;
|
|
2241
|
+
var baseHasIn = require_baseHasIn(), hasPath = require_hasPath();
|
|
2242
|
+
function hasIn(object2, path) {
|
|
2243
|
+
return object2 != null && hasPath(object2, path, baseHasIn);
|
|
2244
|
+
}
|
|
2245
|
+
hasIn_1 = hasIn;
|
|
2246
|
+
return hasIn_1;
|
|
2247
|
+
}
|
|
2248
|
+
var _baseMatchesProperty;
|
|
2249
|
+
var hasRequired_baseMatchesProperty;
|
|
2250
|
+
function require_baseMatchesProperty() {
|
|
2251
|
+
if (hasRequired_baseMatchesProperty) return _baseMatchesProperty;
|
|
2252
|
+
hasRequired_baseMatchesProperty = 1;
|
|
2253
|
+
var baseIsEqual = require_baseIsEqual(), get = requireGet(), hasIn = requireHasIn(), isKey = require_isKey(), isStrictComparable = require_isStrictComparable(), matchesStrictComparable = require_matchesStrictComparable(), toKey = require_toKey();
|
|
2254
|
+
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
2255
|
+
function baseMatchesProperty(path, srcValue) {
|
|
2256
|
+
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
2257
|
+
return matchesStrictComparable(toKey(path), srcValue);
|
|
2258
|
+
}
|
|
2259
|
+
return function(object2) {
|
|
2260
|
+
var objValue = get(object2, path);
|
|
2261
|
+
return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
2262
|
+
};
|
|
2263
|
+
}
|
|
2264
|
+
_baseMatchesProperty = baseMatchesProperty;
|
|
2265
|
+
return _baseMatchesProperty;
|
|
2266
|
+
}
|
|
2267
|
+
var identity_1;
|
|
2268
|
+
var hasRequiredIdentity;
|
|
2269
|
+
function requireIdentity() {
|
|
2270
|
+
if (hasRequiredIdentity) return identity_1;
|
|
2271
|
+
hasRequiredIdentity = 1;
|
|
2272
|
+
function identity(value) {
|
|
2273
|
+
return value;
|
|
2274
|
+
}
|
|
2275
|
+
identity_1 = identity;
|
|
2276
|
+
return identity_1;
|
|
2277
|
+
}
|
|
2278
|
+
var _baseProperty;
|
|
2279
|
+
var hasRequired_baseProperty;
|
|
2280
|
+
function require_baseProperty() {
|
|
2281
|
+
if (hasRequired_baseProperty) return _baseProperty;
|
|
2282
|
+
hasRequired_baseProperty = 1;
|
|
2283
|
+
function baseProperty(key) {
|
|
2284
|
+
return function(object2) {
|
|
2285
|
+
return object2 == null ? void 0 : object2[key];
|
|
2286
|
+
};
|
|
2287
|
+
}
|
|
2288
|
+
_baseProperty = baseProperty;
|
|
2289
|
+
return _baseProperty;
|
|
2290
|
+
}
|
|
2291
|
+
var _basePropertyDeep;
|
|
2292
|
+
var hasRequired_basePropertyDeep;
|
|
2293
|
+
function require_basePropertyDeep() {
|
|
2294
|
+
if (hasRequired_basePropertyDeep) return _basePropertyDeep;
|
|
2295
|
+
hasRequired_basePropertyDeep = 1;
|
|
2296
|
+
var baseGet = require_baseGet();
|
|
2297
|
+
function basePropertyDeep(path) {
|
|
2298
|
+
return function(object2) {
|
|
2299
|
+
return baseGet(object2, path);
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2302
|
+
_basePropertyDeep = basePropertyDeep;
|
|
2303
|
+
return _basePropertyDeep;
|
|
2304
|
+
}
|
|
2305
|
+
var property_1;
|
|
2306
|
+
var hasRequiredProperty;
|
|
2307
|
+
function requireProperty() {
|
|
2308
|
+
if (hasRequiredProperty) return property_1;
|
|
2309
|
+
hasRequiredProperty = 1;
|
|
2310
|
+
var baseProperty = require_baseProperty(), basePropertyDeep = require_basePropertyDeep(), isKey = require_isKey(), toKey = require_toKey();
|
|
2311
|
+
function property(path) {
|
|
2312
|
+
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
|
|
2313
|
+
}
|
|
2314
|
+
property_1 = property;
|
|
2315
|
+
return property_1;
|
|
2316
|
+
}
|
|
2317
|
+
var _baseIteratee;
|
|
2318
|
+
var hasRequired_baseIteratee;
|
|
2319
|
+
function require_baseIteratee() {
|
|
2320
|
+
if (hasRequired_baseIteratee) return _baseIteratee;
|
|
2321
|
+
hasRequired_baseIteratee = 1;
|
|
2322
|
+
var baseMatches = require_baseMatches(), baseMatchesProperty = require_baseMatchesProperty(), identity = requireIdentity(), isArray = requireIsArray(), property = requireProperty();
|
|
2323
|
+
function baseIteratee(value) {
|
|
2324
|
+
if (typeof value == "function") {
|
|
2325
|
+
return value;
|
|
2326
|
+
}
|
|
2327
|
+
if (value == null) {
|
|
2328
|
+
return identity;
|
|
2329
|
+
}
|
|
2330
|
+
if (typeof value == "object") {
|
|
2331
|
+
return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
|
|
2332
|
+
}
|
|
2333
|
+
return property(value);
|
|
2334
|
+
}
|
|
2335
|
+
_baseIteratee = baseIteratee;
|
|
2336
|
+
return _baseIteratee;
|
|
2337
|
+
}
|
|
2338
|
+
var mapValues_1;
|
|
2339
|
+
var hasRequiredMapValues;
|
|
2340
|
+
function requireMapValues() {
|
|
2341
|
+
if (hasRequiredMapValues) return mapValues_1;
|
|
2342
|
+
hasRequiredMapValues = 1;
|
|
2343
|
+
var baseAssignValue = require_baseAssignValue(), baseForOwn = require_baseForOwn(), baseIteratee = require_baseIteratee();
|
|
2344
|
+
function mapValues2(object2, iteratee) {
|
|
2345
|
+
var result = {};
|
|
2346
|
+
iteratee = baseIteratee(iteratee, 3);
|
|
2347
|
+
baseForOwn(object2, function(value, key, object3) {
|
|
2348
|
+
baseAssignValue(result, key, iteratee(value, key, object3));
|
|
2349
|
+
});
|
|
2350
|
+
return result;
|
|
2351
|
+
}
|
|
2352
|
+
mapValues_1 = mapValues2;
|
|
2353
|
+
return mapValues_1;
|
|
2354
|
+
}
|
|
2355
|
+
var mapValuesExports = requireMapValues();
|
|
2356
|
+
const mapValues = /* @__PURE__ */ getDefaultExportFromCjs(mapValuesExports);
|
|
2357
|
+
var propertyExpr;
|
|
2358
|
+
var hasRequiredPropertyExpr;
|
|
2359
|
+
function requirePropertyExpr() {
|
|
2360
|
+
if (hasRequiredPropertyExpr) return propertyExpr;
|
|
2361
|
+
hasRequiredPropertyExpr = 1;
|
|
2362
|
+
function Cache(maxSize) {
|
|
2363
|
+
this._maxSize = maxSize;
|
|
2364
|
+
this.clear();
|
|
2365
|
+
}
|
|
2366
|
+
Cache.prototype.clear = function() {
|
|
2367
|
+
this._size = 0;
|
|
2368
|
+
this._values = /* @__PURE__ */ Object.create(null);
|
|
2369
|
+
};
|
|
2370
|
+
Cache.prototype.get = function(key) {
|
|
2371
|
+
return this._values[key];
|
|
2372
|
+
};
|
|
2373
|
+
Cache.prototype.set = function(key, value) {
|
|
2374
|
+
this._size >= this._maxSize && this.clear();
|
|
2375
|
+
if (!(key in this._values)) this._size++;
|
|
2376
|
+
return this._values[key] = value;
|
|
2377
|
+
};
|
|
2378
|
+
var SPLIT_REGEX = /[^.^\]^[]+|(?=\[\]|\.\.)/g, DIGIT_REGEX = /^\d+$/, LEAD_DIGIT_REGEX = /^\d/, SPEC_CHAR_REGEX = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, CLEAN_QUOTES_REGEX = /^\s*(['"]?)(.*?)(\1)\s*$/, MAX_CACHE_SIZE = 512;
|
|
2379
|
+
var pathCache = new Cache(MAX_CACHE_SIZE), setCache = new Cache(MAX_CACHE_SIZE), getCache = new Cache(MAX_CACHE_SIZE);
|
|
2380
|
+
propertyExpr = {
|
|
2381
|
+
Cache,
|
|
2382
|
+
split,
|
|
2383
|
+
normalizePath,
|
|
2384
|
+
setter: function(path) {
|
|
2385
|
+
var parts = normalizePath(path);
|
|
2386
|
+
return setCache.get(path) || setCache.set(path, function setter(obj, value) {
|
|
2387
|
+
var index2 = 0;
|
|
2388
|
+
var len = parts.length;
|
|
2389
|
+
var data = obj;
|
|
2390
|
+
while (index2 < len - 1) {
|
|
2391
|
+
var part = parts[index2];
|
|
2392
|
+
if (part === "__proto__" || part === "constructor" || part === "prototype") {
|
|
2393
|
+
return obj;
|
|
2394
|
+
}
|
|
2395
|
+
data = data[parts[index2++]];
|
|
2396
|
+
}
|
|
2397
|
+
data[parts[index2]] = value;
|
|
2398
|
+
});
|
|
2399
|
+
},
|
|
2400
|
+
getter: function(path, safe) {
|
|
2401
|
+
var parts = normalizePath(path);
|
|
2402
|
+
return getCache.get(path) || getCache.set(path, function getter(data) {
|
|
2403
|
+
var index2 = 0, len = parts.length;
|
|
2404
|
+
while (index2 < len) {
|
|
2405
|
+
if (data != null || !safe) data = data[parts[index2++]];
|
|
2406
|
+
else return;
|
|
2407
|
+
}
|
|
2408
|
+
return data;
|
|
2409
|
+
});
|
|
2410
|
+
},
|
|
2411
|
+
join: function(segments) {
|
|
2412
|
+
return segments.reduce(function(path, part) {
|
|
2413
|
+
return path + (isQuoted(part) || DIGIT_REGEX.test(part) ? "[" + part + "]" : (path ? "." : "") + part);
|
|
2414
|
+
}, "");
|
|
2415
|
+
},
|
|
2416
|
+
forEach: function(path, cb, thisArg) {
|
|
2417
|
+
forEach(Array.isArray(path) ? path : split(path), cb, thisArg);
|
|
2418
|
+
}
|
|
2419
|
+
};
|
|
2420
|
+
function normalizePath(path) {
|
|
2421
|
+
return pathCache.get(path) || pathCache.set(
|
|
2422
|
+
path,
|
|
2423
|
+
split(path).map(function(part) {
|
|
2424
|
+
return part.replace(CLEAN_QUOTES_REGEX, "$2");
|
|
2425
|
+
})
|
|
2426
|
+
);
|
|
2427
|
+
}
|
|
2428
|
+
function split(path) {
|
|
2429
|
+
return path.match(SPLIT_REGEX) || [""];
|
|
2430
|
+
}
|
|
2431
|
+
function forEach(parts, iter, thisArg) {
|
|
2432
|
+
var len = parts.length, part, idx, isArray, isBracket;
|
|
2433
|
+
for (idx = 0; idx < len; idx++) {
|
|
2434
|
+
part = parts[idx];
|
|
2435
|
+
if (part) {
|
|
2436
|
+
if (shouldBeQuoted(part)) {
|
|
2437
|
+
part = '"' + part + '"';
|
|
2438
|
+
}
|
|
2439
|
+
isBracket = isQuoted(part);
|
|
2440
|
+
isArray = !isBracket && /^\d+$/.test(part);
|
|
2441
|
+
iter.call(thisArg, part, isBracket, isArray, idx, parts);
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
function isQuoted(str) {
|
|
2446
|
+
return typeof str === "string" && str && ["'", '"'].indexOf(str.charAt(0)) !== -1;
|
|
2447
|
+
}
|
|
2448
|
+
function hasLeadingNumber(part) {
|
|
2449
|
+
return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX);
|
|
2450
|
+
}
|
|
2451
|
+
function hasSpecialChars(part) {
|
|
2452
|
+
return SPEC_CHAR_REGEX.test(part);
|
|
2453
|
+
}
|
|
2454
|
+
function shouldBeQuoted(part) {
|
|
2455
|
+
return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part));
|
|
2456
|
+
}
|
|
2457
|
+
return propertyExpr;
|
|
2458
|
+
}
|
|
2459
|
+
var propertyExprExports = requirePropertyExpr();
|
|
2460
|
+
const prefixes = {
|
|
2461
|
+
context: "$",
|
|
2462
|
+
value: "."
|
|
2463
|
+
};
|
|
2464
|
+
class Reference {
|
|
2465
|
+
constructor(key, options = {}) {
|
|
2466
|
+
if (typeof key !== "string") throw new TypeError("ref must be a string, got: " + key);
|
|
2467
|
+
this.key = key.trim();
|
|
2468
|
+
if (key === "") throw new TypeError("ref must be a non-empty string");
|
|
2469
|
+
this.isContext = this.key[0] === prefixes.context;
|
|
2470
|
+
this.isValue = this.key[0] === prefixes.value;
|
|
2471
|
+
this.isSibling = !this.isContext && !this.isValue;
|
|
2472
|
+
let prefix = this.isContext ? prefixes.context : this.isValue ? prefixes.value : "";
|
|
2473
|
+
this.path = this.key.slice(prefix.length);
|
|
2474
|
+
this.getter = this.path && propertyExprExports.getter(this.path, true);
|
|
2475
|
+
this.map = options.map;
|
|
2476
|
+
}
|
|
2477
|
+
getValue(value, parent, context) {
|
|
2478
|
+
let result = this.isContext ? context : this.isValue ? value : parent;
|
|
2479
|
+
if (this.getter) result = this.getter(result || {});
|
|
2480
|
+
if (this.map) result = this.map(result);
|
|
2481
|
+
return result;
|
|
2482
|
+
}
|
|
2483
|
+
/**
|
|
2484
|
+
*
|
|
2485
|
+
* @param {*} value
|
|
2486
|
+
* @param {Object} options
|
|
2487
|
+
* @param {Object=} options.context
|
|
2488
|
+
* @param {Object=} options.parent
|
|
2489
|
+
*/
|
|
2490
|
+
cast(value, options) {
|
|
2491
|
+
return this.getValue(value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context);
|
|
2492
|
+
}
|
|
2493
|
+
resolve() {
|
|
2494
|
+
return this;
|
|
2495
|
+
}
|
|
2496
|
+
describe() {
|
|
2497
|
+
return {
|
|
2498
|
+
type: "ref",
|
|
2499
|
+
key: this.key
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
toString() {
|
|
2503
|
+
return `Ref(${this.key})`;
|
|
2504
|
+
}
|
|
2505
|
+
static isRef(value) {
|
|
2506
|
+
return value && value.__isYupRef;
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
Reference.prototype.__isYupRef = true;
|
|
2510
|
+
function _extends$1() {
|
|
2511
|
+
_extends$1 = Object.assign || function(target) {
|
|
2512
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2513
|
+
var source = arguments[i];
|
|
2514
|
+
for (var key in source) {
|
|
2515
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2516
|
+
target[key] = source[key];
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
return target;
|
|
2521
|
+
};
|
|
2522
|
+
return _extends$1.apply(this, arguments);
|
|
2523
|
+
}
|
|
2524
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2525
|
+
if (source == null) return {};
|
|
2526
|
+
var target = {};
|
|
2527
|
+
var sourceKeys = Object.keys(source);
|
|
2528
|
+
var key, i;
|
|
2529
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2530
|
+
key = sourceKeys[i];
|
|
2531
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2532
|
+
target[key] = source[key];
|
|
2533
|
+
}
|
|
2534
|
+
return target;
|
|
2535
|
+
}
|
|
2536
|
+
function createValidation(config) {
|
|
2537
|
+
function validate(_ref, cb) {
|
|
2538
|
+
let {
|
|
2539
|
+
value,
|
|
2540
|
+
path = "",
|
|
2541
|
+
label,
|
|
2542
|
+
options,
|
|
2543
|
+
originalValue,
|
|
2544
|
+
sync
|
|
2545
|
+
} = _ref, rest = _objectWithoutPropertiesLoose(_ref, ["value", "path", "label", "options", "originalValue", "sync"]);
|
|
2546
|
+
const {
|
|
2547
|
+
name,
|
|
2548
|
+
test,
|
|
2549
|
+
params,
|
|
2550
|
+
message
|
|
2551
|
+
} = config;
|
|
2552
|
+
let {
|
|
2553
|
+
parent,
|
|
2554
|
+
context
|
|
2555
|
+
} = options;
|
|
2556
|
+
function resolve(item) {
|
|
2557
|
+
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
2558
|
+
}
|
|
2559
|
+
function createError(overrides = {}) {
|
|
2560
|
+
const nextParams = mapValues(_extends$1({
|
|
2561
|
+
value,
|
|
2562
|
+
originalValue,
|
|
2563
|
+
label,
|
|
2564
|
+
path: overrides.path || path
|
|
2565
|
+
}, params, overrides.params), resolve);
|
|
2566
|
+
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name);
|
|
2567
|
+
error.params = nextParams;
|
|
2568
|
+
return error;
|
|
2569
|
+
}
|
|
2570
|
+
let ctx = _extends$1({
|
|
2571
|
+
path,
|
|
2572
|
+
parent,
|
|
2573
|
+
type: name,
|
|
2574
|
+
createError,
|
|
2575
|
+
resolve,
|
|
2576
|
+
options,
|
|
2577
|
+
originalValue
|
|
2578
|
+
}, rest);
|
|
2579
|
+
if (!sync) {
|
|
2580
|
+
try {
|
|
2581
|
+
Promise.resolve(test.call(ctx, value, ctx)).then((validOrError) => {
|
|
2582
|
+
if (ValidationError.isError(validOrError)) cb(validOrError);
|
|
2583
|
+
else if (!validOrError) cb(createError());
|
|
2584
|
+
else cb(null, validOrError);
|
|
2585
|
+
});
|
|
2586
|
+
} catch (err) {
|
|
2587
|
+
cb(err);
|
|
2588
|
+
}
|
|
2589
|
+
return;
|
|
2590
|
+
}
|
|
2591
|
+
let result;
|
|
2592
|
+
try {
|
|
2593
|
+
var _ref2;
|
|
2594
|
+
result = test.call(ctx, value, ctx);
|
|
2595
|
+
if (typeof ((_ref2 = result) == null ? void 0 : _ref2.then) === "function") {
|
|
2596
|
+
throw new Error(`Validation test of type: "${ctx.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
|
|
2597
|
+
}
|
|
2598
|
+
} catch (err) {
|
|
2599
|
+
cb(err);
|
|
2600
|
+
return;
|
|
2601
|
+
}
|
|
2602
|
+
if (ValidationError.isError(result)) cb(result);
|
|
2603
|
+
else if (!result) cb(createError());
|
|
2604
|
+
else cb(null, result);
|
|
2605
|
+
}
|
|
2606
|
+
validate.OPTIONS = config;
|
|
2607
|
+
return validate;
|
|
2608
|
+
}
|
|
2609
|
+
let trim = (part) => part.substr(0, part.length - 1).substr(1);
|
|
2610
|
+
function getIn(schema, path, value, context = value) {
|
|
2611
|
+
let parent, lastPart, lastPartDebug;
|
|
2612
|
+
if (!path) return {
|
|
2613
|
+
parent,
|
|
2614
|
+
parentPath: path,
|
|
2615
|
+
schema
|
|
2616
|
+
};
|
|
2617
|
+
propertyExprExports.forEach(path, (_part, isBracket, isArray) => {
|
|
2618
|
+
let part = isBracket ? trim(_part) : _part;
|
|
2619
|
+
schema = schema.resolve({
|
|
2620
|
+
context,
|
|
2621
|
+
parent,
|
|
2622
|
+
value
|
|
2623
|
+
});
|
|
2624
|
+
if (schema.innerType) {
|
|
2625
|
+
let idx = isArray ? parseInt(part, 10) : 0;
|
|
2626
|
+
if (value && idx >= value.length) {
|
|
2627
|
+
throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. because there is no value at that index. `);
|
|
2628
|
+
}
|
|
2629
|
+
parent = value;
|
|
2630
|
+
value = value && value[idx];
|
|
2631
|
+
schema = schema.innerType;
|
|
2632
|
+
}
|
|
2633
|
+
if (!isArray) {
|
|
2634
|
+
if (!schema.fields || !schema.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema._type}")`);
|
|
2635
|
+
parent = value;
|
|
2636
|
+
value = value && value[part];
|
|
2637
|
+
schema = schema.fields[part];
|
|
2638
|
+
}
|
|
2639
|
+
lastPart = part;
|
|
2640
|
+
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
2641
|
+
});
|
|
2642
|
+
return {
|
|
2643
|
+
schema,
|
|
2644
|
+
parent,
|
|
2645
|
+
parentPath: lastPart
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2648
|
+
class ReferenceSet {
|
|
2649
|
+
constructor() {
|
|
2650
|
+
this.list = /* @__PURE__ */ new Set();
|
|
2651
|
+
this.refs = /* @__PURE__ */ new Map();
|
|
2652
|
+
}
|
|
2653
|
+
get size() {
|
|
2654
|
+
return this.list.size + this.refs.size;
|
|
2655
|
+
}
|
|
2656
|
+
describe() {
|
|
2657
|
+
const description = [];
|
|
2658
|
+
for (const item of this.list) description.push(item);
|
|
2659
|
+
for (const [, ref] of this.refs) description.push(ref.describe());
|
|
2660
|
+
return description;
|
|
2661
|
+
}
|
|
2662
|
+
toArray() {
|
|
2663
|
+
return Array.from(this.list).concat(Array.from(this.refs.values()));
|
|
2664
|
+
}
|
|
2665
|
+
add(value) {
|
|
2666
|
+
Reference.isRef(value) ? this.refs.set(value.key, value) : this.list.add(value);
|
|
2667
|
+
}
|
|
2668
|
+
delete(value) {
|
|
2669
|
+
Reference.isRef(value) ? this.refs.delete(value.key) : this.list.delete(value);
|
|
2670
|
+
}
|
|
2671
|
+
has(value, resolve) {
|
|
2672
|
+
if (this.list.has(value)) return true;
|
|
2673
|
+
let item, values = this.refs.values();
|
|
2674
|
+
while (item = values.next(), !item.done) if (resolve(item.value) === value) return true;
|
|
2675
|
+
return false;
|
|
2676
|
+
}
|
|
2677
|
+
clone() {
|
|
2678
|
+
const next = new ReferenceSet();
|
|
2679
|
+
next.list = new Set(this.list);
|
|
2680
|
+
next.refs = new Map(this.refs);
|
|
2681
|
+
return next;
|
|
2682
|
+
}
|
|
2683
|
+
merge(newItems, removeItems) {
|
|
2684
|
+
const next = this.clone();
|
|
2685
|
+
newItems.list.forEach((value) => next.add(value));
|
|
2686
|
+
newItems.refs.forEach((value) => next.add(value));
|
|
2687
|
+
removeItems.list.forEach((value) => next.delete(value));
|
|
2688
|
+
removeItems.refs.forEach((value) => next.delete(value));
|
|
2689
|
+
return next;
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
function _extends() {
|
|
2693
|
+
_extends = Object.assign || function(target) {
|
|
2694
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2695
|
+
var source = arguments[i];
|
|
2696
|
+
for (var key in source) {
|
|
2697
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2698
|
+
target[key] = source[key];
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
return target;
|
|
2703
|
+
};
|
|
2704
|
+
return _extends.apply(this, arguments);
|
|
2705
|
+
}
|
|
2706
|
+
class BaseSchema {
|
|
2707
|
+
constructor(options) {
|
|
2708
|
+
this.deps = [];
|
|
2709
|
+
this.conditions = [];
|
|
2710
|
+
this._whitelist = new ReferenceSet();
|
|
2711
|
+
this._blacklist = new ReferenceSet();
|
|
2712
|
+
this.exclusiveTests = /* @__PURE__ */ Object.create(null);
|
|
2713
|
+
this.tests = [];
|
|
2714
|
+
this.transforms = [];
|
|
2715
|
+
this.withMutation(() => {
|
|
2716
|
+
this.typeError(mixed.notType);
|
|
2717
|
+
});
|
|
2718
|
+
this.type = (options == null ? void 0 : options.type) || "mixed";
|
|
2719
|
+
this.spec = _extends({
|
|
2720
|
+
strip: false,
|
|
2721
|
+
strict: false,
|
|
2722
|
+
abortEarly: true,
|
|
2723
|
+
recursive: true,
|
|
2724
|
+
nullable: false,
|
|
2725
|
+
presence: "optional"
|
|
2726
|
+
}, options == null ? void 0 : options.spec);
|
|
2727
|
+
}
|
|
2728
|
+
// TODO: remove
|
|
2729
|
+
get _type() {
|
|
2730
|
+
return this.type;
|
|
2731
|
+
}
|
|
2732
|
+
_typeCheck(_value) {
|
|
2733
|
+
return true;
|
|
2734
|
+
}
|
|
2735
|
+
clone(spec) {
|
|
2736
|
+
if (this._mutate) {
|
|
2737
|
+
if (spec) Object.assign(this.spec, spec);
|
|
2738
|
+
return this;
|
|
2739
|
+
}
|
|
2740
|
+
const next = Object.create(Object.getPrototypeOf(this));
|
|
2741
|
+
next.type = this.type;
|
|
2742
|
+
next._typeError = this._typeError;
|
|
2743
|
+
next._whitelistError = this._whitelistError;
|
|
2744
|
+
next._blacklistError = this._blacklistError;
|
|
2745
|
+
next._whitelist = this._whitelist.clone();
|
|
2746
|
+
next._blacklist = this._blacklist.clone();
|
|
2747
|
+
next.exclusiveTests = _extends({}, this.exclusiveTests);
|
|
2748
|
+
next.deps = [...this.deps];
|
|
2749
|
+
next.conditions = [...this.conditions];
|
|
2750
|
+
next.tests = [...this.tests];
|
|
2751
|
+
next.transforms = [...this.transforms];
|
|
2752
|
+
next.spec = clone(_extends({}, this.spec, spec));
|
|
2753
|
+
return next;
|
|
2754
|
+
}
|
|
2755
|
+
label(label) {
|
|
2756
|
+
var next = this.clone();
|
|
2757
|
+
next.spec.label = label;
|
|
2758
|
+
return next;
|
|
2759
|
+
}
|
|
2760
|
+
meta(...args) {
|
|
2761
|
+
if (args.length === 0) return this.spec.meta;
|
|
2762
|
+
let next = this.clone();
|
|
2763
|
+
next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);
|
|
2764
|
+
return next;
|
|
2765
|
+
}
|
|
2766
|
+
// withContext<TContext extends AnyObject>(): BaseSchema<
|
|
2767
|
+
// TCast,
|
|
2768
|
+
// TContext,
|
|
2769
|
+
// TOutput
|
|
2770
|
+
// > {
|
|
2771
|
+
// return this as any;
|
|
2772
|
+
// }
|
|
2773
|
+
withMutation(fn) {
|
|
2774
|
+
let before = this._mutate;
|
|
2775
|
+
this._mutate = true;
|
|
2776
|
+
let result = fn(this);
|
|
2777
|
+
this._mutate = before;
|
|
2778
|
+
return result;
|
|
2779
|
+
}
|
|
2780
|
+
concat(schema) {
|
|
2781
|
+
if (!schema || schema === this) return this;
|
|
2782
|
+
if (schema.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema.type}`);
|
|
2783
|
+
let base = this;
|
|
2784
|
+
let combined = schema.clone();
|
|
2785
|
+
const mergedSpec = _extends({}, base.spec, combined.spec);
|
|
2786
|
+
combined.spec = mergedSpec;
|
|
2787
|
+
combined._typeError || (combined._typeError = base._typeError);
|
|
2788
|
+
combined._whitelistError || (combined._whitelistError = base._whitelistError);
|
|
2789
|
+
combined._blacklistError || (combined._blacklistError = base._blacklistError);
|
|
2790
|
+
combined._whitelist = base._whitelist.merge(schema._whitelist, schema._blacklist);
|
|
2791
|
+
combined._blacklist = base._blacklist.merge(schema._blacklist, schema._whitelist);
|
|
2792
|
+
combined.tests = base.tests;
|
|
2793
|
+
combined.exclusiveTests = base.exclusiveTests;
|
|
2794
|
+
combined.withMutation((next) => {
|
|
2795
|
+
schema.tests.forEach((fn) => {
|
|
2796
|
+
next.test(fn.OPTIONS);
|
|
2797
|
+
});
|
|
2798
|
+
});
|
|
2799
|
+
return combined;
|
|
2800
|
+
}
|
|
2801
|
+
isType(v2) {
|
|
2802
|
+
if (this.spec.nullable && v2 === null) return true;
|
|
2803
|
+
return this._typeCheck(v2);
|
|
2804
|
+
}
|
|
2805
|
+
resolve(options) {
|
|
2806
|
+
let schema = this;
|
|
2807
|
+
if (schema.conditions.length) {
|
|
2808
|
+
let conditions = schema.conditions;
|
|
2809
|
+
schema = schema.clone();
|
|
2810
|
+
schema.conditions = [];
|
|
2811
|
+
schema = conditions.reduce((schema2, condition) => condition.resolve(schema2, options), schema);
|
|
2812
|
+
schema = schema.resolve(options);
|
|
2813
|
+
}
|
|
2814
|
+
return schema;
|
|
2815
|
+
}
|
|
2816
|
+
/**
|
|
2817
|
+
*
|
|
2818
|
+
* @param {*} value
|
|
2819
|
+
* @param {Object} options
|
|
2820
|
+
* @param {*=} options.parent
|
|
2821
|
+
* @param {*=} options.context
|
|
2822
|
+
*/
|
|
2823
|
+
cast(value, options = {}) {
|
|
2824
|
+
let resolvedSchema = this.resolve(_extends({
|
|
2825
|
+
value
|
|
2826
|
+
}, options));
|
|
2827
|
+
let result = resolvedSchema._cast(value, options);
|
|
2828
|
+
if (value !== void 0 && options.assert !== false && resolvedSchema.isType(result) !== true) {
|
|
2829
|
+
let formattedValue = printValue(value);
|
|
2830
|
+
let formattedResult = printValue(result);
|
|
2831
|
+
throw new TypeError(`The value of ${options.path || "field"} could not be cast to a value that satisfies the schema type: "${resolvedSchema._type}".
|
|
2832
|
+
|
|
2833
|
+
attempted value: ${formattedValue}
|
|
2834
|
+
` + (formattedResult !== formattedValue ? `result of cast: ${formattedResult}` : ""));
|
|
2835
|
+
}
|
|
2836
|
+
return result;
|
|
2837
|
+
}
|
|
2838
|
+
_cast(rawValue, _options) {
|
|
2839
|
+
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((value2, fn) => fn.call(this, value2, rawValue, this), rawValue);
|
|
2840
|
+
if (value === void 0) {
|
|
2841
|
+
value = this.getDefault();
|
|
2842
|
+
}
|
|
2843
|
+
return value;
|
|
2844
|
+
}
|
|
2845
|
+
_validate(_value, options = {}, cb) {
|
|
2846
|
+
let {
|
|
2847
|
+
sync,
|
|
2848
|
+
path,
|
|
2849
|
+
from = [],
|
|
2850
|
+
originalValue = _value,
|
|
2851
|
+
strict = this.spec.strict,
|
|
2852
|
+
abortEarly = this.spec.abortEarly
|
|
2853
|
+
} = options;
|
|
2854
|
+
let value = _value;
|
|
2855
|
+
if (!strict) {
|
|
2856
|
+
value = this._cast(value, _extends({
|
|
2857
|
+
assert: false
|
|
2858
|
+
}, options));
|
|
2859
|
+
}
|
|
2860
|
+
let args = {
|
|
2861
|
+
value,
|
|
2862
|
+
path,
|
|
2863
|
+
options,
|
|
2864
|
+
originalValue,
|
|
2865
|
+
schema: this,
|
|
2866
|
+
label: this.spec.label,
|
|
2867
|
+
sync,
|
|
2868
|
+
from
|
|
2869
|
+
};
|
|
2870
|
+
let initialTests = [];
|
|
2871
|
+
if (this._typeError) initialTests.push(this._typeError);
|
|
2872
|
+
if (this._whitelistError) initialTests.push(this._whitelistError);
|
|
2873
|
+
if (this._blacklistError) initialTests.push(this._blacklistError);
|
|
2874
|
+
runTests({
|
|
2875
|
+
args,
|
|
2876
|
+
value,
|
|
2877
|
+
path,
|
|
2878
|
+
tests: initialTests,
|
|
2879
|
+
endEarly: abortEarly
|
|
2880
|
+
}, (err) => {
|
|
2881
|
+
if (err) return void cb(err, value);
|
|
2882
|
+
runTests({
|
|
2883
|
+
tests: this.tests,
|
|
2884
|
+
args,
|
|
2885
|
+
path,
|
|
2886
|
+
sync,
|
|
2887
|
+
value,
|
|
2888
|
+
endEarly: abortEarly
|
|
2889
|
+
}, cb);
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
validate(value, options, maybeCb) {
|
|
2893
|
+
let schema = this.resolve(_extends({}, options, {
|
|
2894
|
+
value
|
|
2895
|
+
}));
|
|
2896
|
+
return typeof maybeCb === "function" ? schema._validate(value, options, maybeCb) : new Promise((resolve, reject) => schema._validate(value, options, (err, value2) => {
|
|
2897
|
+
if (err) reject(err);
|
|
2898
|
+
else resolve(value2);
|
|
2899
|
+
}));
|
|
2900
|
+
}
|
|
2901
|
+
validateSync(value, options) {
|
|
2902
|
+
let schema = this.resolve(_extends({}, options, {
|
|
2903
|
+
value
|
|
2904
|
+
}));
|
|
2905
|
+
let result;
|
|
2906
|
+
schema._validate(value, _extends({}, options, {
|
|
2907
|
+
sync: true
|
|
2908
|
+
}), (err, value2) => {
|
|
2909
|
+
if (err) throw err;
|
|
2910
|
+
result = value2;
|
|
2911
|
+
});
|
|
2912
|
+
return result;
|
|
2913
|
+
}
|
|
2914
|
+
isValid(value, options) {
|
|
2915
|
+
return this.validate(value, options).then(() => true, (err) => {
|
|
2916
|
+
if (ValidationError.isError(err)) return false;
|
|
2917
|
+
throw err;
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
isValidSync(value, options) {
|
|
2921
|
+
try {
|
|
2922
|
+
this.validateSync(value, options);
|
|
2923
|
+
return true;
|
|
2924
|
+
} catch (err) {
|
|
2925
|
+
if (ValidationError.isError(err)) return false;
|
|
2926
|
+
throw err;
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
_getDefault() {
|
|
2930
|
+
let defaultValue = this.spec.default;
|
|
2931
|
+
if (defaultValue == null) {
|
|
2932
|
+
return defaultValue;
|
|
2933
|
+
}
|
|
2934
|
+
return typeof defaultValue === "function" ? defaultValue.call(this) : clone(defaultValue);
|
|
2935
|
+
}
|
|
2936
|
+
getDefault(options) {
|
|
2937
|
+
let schema = this.resolve(options || {});
|
|
2938
|
+
return schema._getDefault();
|
|
2939
|
+
}
|
|
2940
|
+
default(def) {
|
|
2941
|
+
if (arguments.length === 0) {
|
|
2942
|
+
return this._getDefault();
|
|
2943
|
+
}
|
|
2944
|
+
let next = this.clone({
|
|
2945
|
+
default: def
|
|
2946
|
+
});
|
|
2947
|
+
return next;
|
|
2948
|
+
}
|
|
2949
|
+
strict(isStrict = true) {
|
|
2950
|
+
var next = this.clone();
|
|
2951
|
+
next.spec.strict = isStrict;
|
|
2952
|
+
return next;
|
|
2953
|
+
}
|
|
2954
|
+
_isPresent(value) {
|
|
2955
|
+
return value != null;
|
|
2956
|
+
}
|
|
2957
|
+
defined(message = mixed.defined) {
|
|
2958
|
+
return this.test({
|
|
2959
|
+
message,
|
|
2960
|
+
name: "defined",
|
|
2961
|
+
exclusive: true,
|
|
2962
|
+
test(value) {
|
|
2963
|
+
return value !== void 0;
|
|
2964
|
+
}
|
|
2965
|
+
});
|
|
2966
|
+
}
|
|
2967
|
+
required(message = mixed.required) {
|
|
2968
|
+
return this.clone({
|
|
2969
|
+
presence: "required"
|
|
2970
|
+
}).withMutation((s) => s.test({
|
|
2971
|
+
message,
|
|
2972
|
+
name: "required",
|
|
2973
|
+
exclusive: true,
|
|
2974
|
+
test(value) {
|
|
2975
|
+
return this.schema._isPresent(value);
|
|
2976
|
+
}
|
|
2977
|
+
}));
|
|
2978
|
+
}
|
|
2979
|
+
notRequired() {
|
|
2980
|
+
var next = this.clone({
|
|
2981
|
+
presence: "optional"
|
|
2982
|
+
});
|
|
2983
|
+
next.tests = next.tests.filter((test) => test.OPTIONS.name !== "required");
|
|
2984
|
+
return next;
|
|
2985
|
+
}
|
|
2986
|
+
nullable(isNullable = true) {
|
|
2987
|
+
var next = this.clone({
|
|
2988
|
+
nullable: isNullable !== false
|
|
2989
|
+
});
|
|
2990
|
+
return next;
|
|
2991
|
+
}
|
|
2992
|
+
transform(fn) {
|
|
2993
|
+
var next = this.clone();
|
|
2994
|
+
next.transforms.push(fn);
|
|
2995
|
+
return next;
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
* Adds a test function to the schema's queue of tests.
|
|
2999
|
+
* tests can be exclusive or non-exclusive.
|
|
3000
|
+
*
|
|
3001
|
+
* - exclusive tests, will replace any existing tests of the same name.
|
|
3002
|
+
* - non-exclusive: can be stacked
|
|
3003
|
+
*
|
|
3004
|
+
* If a non-exclusive test is added to a schema with an exclusive test of the same name
|
|
3005
|
+
* the exclusive test is removed and further tests of the same name will be stacked.
|
|
3006
|
+
*
|
|
3007
|
+
* If an exclusive test is added to a schema with non-exclusive tests of the same name
|
|
3008
|
+
* the previous tests are removed and further tests of the same name will replace each other.
|
|
3009
|
+
*/
|
|
3010
|
+
test(...args) {
|
|
3011
|
+
let opts;
|
|
3012
|
+
if (args.length === 1) {
|
|
3013
|
+
if (typeof args[0] === "function") {
|
|
3014
|
+
opts = {
|
|
3015
|
+
test: args[0]
|
|
3016
|
+
};
|
|
3017
|
+
} else {
|
|
3018
|
+
opts = args[0];
|
|
3019
|
+
}
|
|
3020
|
+
} else if (args.length === 2) {
|
|
3021
|
+
opts = {
|
|
3022
|
+
name: args[0],
|
|
3023
|
+
test: args[1]
|
|
3024
|
+
};
|
|
3025
|
+
} else {
|
|
3026
|
+
opts = {
|
|
3027
|
+
name: args[0],
|
|
3028
|
+
message: args[1],
|
|
3029
|
+
test: args[2]
|
|
3030
|
+
};
|
|
3031
|
+
}
|
|
3032
|
+
if (opts.message === void 0) opts.message = mixed.default;
|
|
3033
|
+
if (typeof opts.test !== "function") throw new TypeError("`test` is a required parameters");
|
|
3034
|
+
let next = this.clone();
|
|
3035
|
+
let validate = createValidation(opts);
|
|
3036
|
+
let isExclusive = opts.exclusive || opts.name && next.exclusiveTests[opts.name] === true;
|
|
3037
|
+
if (opts.exclusive) {
|
|
3038
|
+
if (!opts.name) throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
|
|
3039
|
+
}
|
|
3040
|
+
if (opts.name) next.exclusiveTests[opts.name] = !!opts.exclusive;
|
|
3041
|
+
next.tests = next.tests.filter((fn) => {
|
|
3042
|
+
if (fn.OPTIONS.name === opts.name) {
|
|
3043
|
+
if (isExclusive) return false;
|
|
3044
|
+
if (fn.OPTIONS.test === validate.OPTIONS.test) return false;
|
|
3045
|
+
}
|
|
3046
|
+
return true;
|
|
3047
|
+
});
|
|
3048
|
+
next.tests.push(validate);
|
|
3049
|
+
return next;
|
|
3050
|
+
}
|
|
3051
|
+
when(keys, options) {
|
|
3052
|
+
if (!Array.isArray(keys) && typeof keys !== "string") {
|
|
3053
|
+
options = keys;
|
|
3054
|
+
keys = ".";
|
|
3055
|
+
}
|
|
3056
|
+
let next = this.clone();
|
|
3057
|
+
let deps = toArray(keys).map((key) => new Reference(key));
|
|
3058
|
+
deps.forEach((dep) => {
|
|
3059
|
+
if (dep.isSibling) next.deps.push(dep.key);
|
|
3060
|
+
});
|
|
3061
|
+
next.conditions.push(new Condition(deps, options));
|
|
3062
|
+
return next;
|
|
3063
|
+
}
|
|
3064
|
+
typeError(message) {
|
|
3065
|
+
var next = this.clone();
|
|
3066
|
+
next._typeError = createValidation({
|
|
3067
|
+
message,
|
|
3068
|
+
name: "typeError",
|
|
3069
|
+
test(value) {
|
|
3070
|
+
if (value !== void 0 && !this.schema.isType(value)) return this.createError({
|
|
3071
|
+
params: {
|
|
3072
|
+
type: this.schema._type
|
|
3073
|
+
}
|
|
3074
|
+
});
|
|
3075
|
+
return true;
|
|
3076
|
+
}
|
|
3077
|
+
});
|
|
3078
|
+
return next;
|
|
3079
|
+
}
|
|
3080
|
+
oneOf(enums, message = mixed.oneOf) {
|
|
3081
|
+
var next = this.clone();
|
|
3082
|
+
enums.forEach((val) => {
|
|
3083
|
+
next._whitelist.add(val);
|
|
3084
|
+
next._blacklist.delete(val);
|
|
3085
|
+
});
|
|
3086
|
+
next._whitelistError = createValidation({
|
|
3087
|
+
message,
|
|
3088
|
+
name: "oneOf",
|
|
3089
|
+
test(value) {
|
|
3090
|
+
if (value === void 0) return true;
|
|
3091
|
+
let valids = this.schema._whitelist;
|
|
3092
|
+
return valids.has(value, this.resolve) ? true : this.createError({
|
|
3093
|
+
params: {
|
|
3094
|
+
values: valids.toArray().join(", ")
|
|
3095
|
+
}
|
|
3096
|
+
});
|
|
3097
|
+
}
|
|
3098
|
+
});
|
|
3099
|
+
return next;
|
|
3100
|
+
}
|
|
3101
|
+
notOneOf(enums, message = mixed.notOneOf) {
|
|
3102
|
+
var next = this.clone();
|
|
3103
|
+
enums.forEach((val) => {
|
|
3104
|
+
next._blacklist.add(val);
|
|
3105
|
+
next._whitelist.delete(val);
|
|
3106
|
+
});
|
|
3107
|
+
next._blacklistError = createValidation({
|
|
3108
|
+
message,
|
|
3109
|
+
name: "notOneOf",
|
|
3110
|
+
test(value) {
|
|
3111
|
+
let invalids = this.schema._blacklist;
|
|
3112
|
+
if (invalids.has(value, this.resolve)) return this.createError({
|
|
3113
|
+
params: {
|
|
3114
|
+
values: invalids.toArray().join(", ")
|
|
3115
|
+
}
|
|
3116
|
+
});
|
|
3117
|
+
return true;
|
|
3118
|
+
}
|
|
3119
|
+
});
|
|
3120
|
+
return next;
|
|
3121
|
+
}
|
|
3122
|
+
strip(strip = true) {
|
|
3123
|
+
let next = this.clone();
|
|
3124
|
+
next.spec.strip = strip;
|
|
3125
|
+
return next;
|
|
3126
|
+
}
|
|
3127
|
+
describe() {
|
|
3128
|
+
const next = this.clone();
|
|
3129
|
+
const {
|
|
3130
|
+
label,
|
|
3131
|
+
meta
|
|
3132
|
+
} = next.spec;
|
|
3133
|
+
const description = {
|
|
3134
|
+
meta,
|
|
3135
|
+
label,
|
|
3136
|
+
type: next.type,
|
|
3137
|
+
oneOf: next._whitelist.describe(),
|
|
3138
|
+
notOneOf: next._blacklist.describe(),
|
|
3139
|
+
tests: next.tests.map((fn) => ({
|
|
3140
|
+
name: fn.OPTIONS.name,
|
|
3141
|
+
params: fn.OPTIONS.params
|
|
3142
|
+
})).filter((n, idx, list) => list.findIndex((c) => c.name === n.name) === idx)
|
|
3143
|
+
};
|
|
3144
|
+
return description;
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
BaseSchema.prototype.__isYupSchema__ = true;
|
|
3148
|
+
for (const method of ["validate", "validateSync"]) BaseSchema.prototype[`${method}At`] = function(path, value, options = {}) {
|
|
3149
|
+
const {
|
|
3150
|
+
parent,
|
|
3151
|
+
parentPath,
|
|
3152
|
+
schema
|
|
3153
|
+
} = getIn(this, path, value, options.context);
|
|
3154
|
+
return schema[method](parent && parent[parentPath], _extends({}, options, {
|
|
3155
|
+
parent,
|
|
3156
|
+
path
|
|
3157
|
+
}));
|
|
3158
|
+
};
|
|
3159
|
+
for (const alias of ["equals", "is"]) BaseSchema.prototype[alias] = BaseSchema.prototype.oneOf;
|
|
3160
|
+
for (const alias of ["not", "nope"]) BaseSchema.prototype[alias] = BaseSchema.prototype.notOneOf;
|
|
3161
|
+
BaseSchema.prototype.optional = BaseSchema.prototype.notRequired;
|
|
3162
|
+
const isAbsent = ((value) => value == null);
|
|
3163
|
+
let rEmail = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
|
|
3164
|
+
let rUrl = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
|
|
3165
|
+
let rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
3166
|
+
let isTrimmed = (value) => isAbsent(value) || value === value.trim();
|
|
3167
|
+
let objStringTag = {}.toString();
|
|
3168
|
+
function create() {
|
|
3169
|
+
return new StringSchema();
|
|
3170
|
+
}
|
|
3171
|
+
class StringSchema extends BaseSchema {
|
|
3172
|
+
constructor() {
|
|
3173
|
+
super({
|
|
3174
|
+
type: "string"
|
|
3175
|
+
});
|
|
3176
|
+
this.withMutation(() => {
|
|
3177
|
+
this.transform(function(value) {
|
|
3178
|
+
if (this.isType(value)) return value;
|
|
3179
|
+
if (Array.isArray(value)) return value;
|
|
3180
|
+
const strValue = value != null && value.toString ? value.toString() : value;
|
|
3181
|
+
if (strValue === objStringTag) return value;
|
|
3182
|
+
return strValue;
|
|
3183
|
+
});
|
|
3184
|
+
});
|
|
3185
|
+
}
|
|
3186
|
+
_typeCheck(value) {
|
|
3187
|
+
if (value instanceof String) value = value.valueOf();
|
|
3188
|
+
return typeof value === "string";
|
|
3189
|
+
}
|
|
3190
|
+
_isPresent(value) {
|
|
3191
|
+
return super._isPresent(value) && !!value.length;
|
|
3192
|
+
}
|
|
3193
|
+
length(length, message = string.length) {
|
|
3194
|
+
return this.test({
|
|
3195
|
+
message,
|
|
3196
|
+
name: "length",
|
|
3197
|
+
exclusive: true,
|
|
3198
|
+
params: {
|
|
3199
|
+
length
|
|
3200
|
+
},
|
|
3201
|
+
test(value) {
|
|
3202
|
+
return isAbsent(value) || value.length === this.resolve(length);
|
|
3203
|
+
}
|
|
3204
|
+
});
|
|
3205
|
+
}
|
|
3206
|
+
min(min, message = string.min) {
|
|
3207
|
+
return this.test({
|
|
3208
|
+
message,
|
|
3209
|
+
name: "min",
|
|
3210
|
+
exclusive: true,
|
|
3211
|
+
params: {
|
|
3212
|
+
min
|
|
3213
|
+
},
|
|
3214
|
+
test(value) {
|
|
3215
|
+
return isAbsent(value) || value.length >= this.resolve(min);
|
|
3216
|
+
}
|
|
3217
|
+
});
|
|
3218
|
+
}
|
|
3219
|
+
max(max, message = string.max) {
|
|
3220
|
+
return this.test({
|
|
3221
|
+
name: "max",
|
|
3222
|
+
exclusive: true,
|
|
3223
|
+
message,
|
|
3224
|
+
params: {
|
|
3225
|
+
max
|
|
3226
|
+
},
|
|
3227
|
+
test(value) {
|
|
3228
|
+
return isAbsent(value) || value.length <= this.resolve(max);
|
|
3229
|
+
}
|
|
3230
|
+
});
|
|
3231
|
+
}
|
|
3232
|
+
matches(regex, options) {
|
|
3233
|
+
let excludeEmptyString = false;
|
|
3234
|
+
let message;
|
|
3235
|
+
let name;
|
|
3236
|
+
if (options) {
|
|
3237
|
+
if (typeof options === "object") {
|
|
3238
|
+
({
|
|
3239
|
+
excludeEmptyString = false,
|
|
3240
|
+
message,
|
|
3241
|
+
name
|
|
3242
|
+
} = options);
|
|
3243
|
+
} else {
|
|
3244
|
+
message = options;
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
return this.test({
|
|
3248
|
+
name: name || "matches",
|
|
3249
|
+
message: message || string.matches,
|
|
3250
|
+
params: {
|
|
3251
|
+
regex
|
|
3252
|
+
},
|
|
3253
|
+
test: (value) => isAbsent(value) || value === "" && excludeEmptyString || value.search(regex) !== -1
|
|
3254
|
+
});
|
|
3255
|
+
}
|
|
3256
|
+
email(message = string.email) {
|
|
3257
|
+
return this.matches(rEmail, {
|
|
3258
|
+
name: "email",
|
|
3259
|
+
message,
|
|
3260
|
+
excludeEmptyString: true
|
|
3261
|
+
});
|
|
3262
|
+
}
|
|
3263
|
+
url(message = string.url) {
|
|
3264
|
+
return this.matches(rUrl, {
|
|
3265
|
+
name: "url",
|
|
3266
|
+
message,
|
|
3267
|
+
excludeEmptyString: true
|
|
3268
|
+
});
|
|
3269
|
+
}
|
|
3270
|
+
uuid(message = string.uuid) {
|
|
3271
|
+
return this.matches(rUUID, {
|
|
3272
|
+
name: "uuid",
|
|
3273
|
+
message,
|
|
3274
|
+
excludeEmptyString: false
|
|
3275
|
+
});
|
|
3276
|
+
}
|
|
3277
|
+
//-- transforms --
|
|
3278
|
+
ensure() {
|
|
3279
|
+
return this.default("").transform((val) => val === null ? "" : val);
|
|
3280
|
+
}
|
|
3281
|
+
trim(message = string.trim) {
|
|
3282
|
+
return this.transform((val) => val != null ? val.trim() : val).test({
|
|
3283
|
+
message,
|
|
3284
|
+
name: "trim",
|
|
3285
|
+
test: isTrimmed
|
|
3286
|
+
});
|
|
3287
|
+
}
|
|
3288
|
+
lowercase(message = string.lowercase) {
|
|
3289
|
+
return this.transform((value) => !isAbsent(value) ? value.toLowerCase() : value).test({
|
|
3290
|
+
message,
|
|
3291
|
+
name: "string_case",
|
|
3292
|
+
exclusive: true,
|
|
3293
|
+
test: (value) => isAbsent(value) || value === value.toLowerCase()
|
|
3294
|
+
});
|
|
3295
|
+
}
|
|
3296
|
+
uppercase(message = string.uppercase) {
|
|
3297
|
+
return this.transform((value) => !isAbsent(value) ? value.toUpperCase() : value).test({
|
|
3298
|
+
message,
|
|
3299
|
+
name: "string_case",
|
|
3300
|
+
exclusive: true,
|
|
3301
|
+
test: (value) => isAbsent(value) || value === value.toUpperCase()
|
|
3302
|
+
});
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
create.prototype = StringSchema.prototype;
|
|
3306
|
+
var isoReg = /^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;
|
|
3307
|
+
function parseIsoDate(date2) {
|
|
3308
|
+
var numericKeys = [1, 4, 5, 6, 7, 10, 11], minutesOffset = 0, timestamp, struct;
|
|
3309
|
+
if (struct = isoReg.exec(date2)) {
|
|
3310
|
+
for (var i = 0, k; k = numericKeys[i]; ++i) struct[k] = +struct[k] || 0;
|
|
3311
|
+
struct[2] = (+struct[2] || 1) - 1;
|
|
3312
|
+
struct[3] = +struct[3] || 1;
|
|
3313
|
+
struct[7] = struct[7] ? String(struct[7]).substr(0, 3) : 0;
|
|
3314
|
+
if ((struct[8] === void 0 || struct[8] === "") && (struct[9] === void 0 || struct[9] === "")) timestamp = +new Date(struct[1], struct[2], struct[3], struct[4], struct[5], struct[6], struct[7]);
|
|
3315
|
+
else {
|
|
3316
|
+
if (struct[8] !== "Z" && struct[9] !== void 0) {
|
|
3317
|
+
minutesOffset = struct[10] * 60 + struct[11];
|
|
3318
|
+
if (struct[9] === "+") minutesOffset = 0 - minutesOffset;
|
|
3319
|
+
}
|
|
3320
|
+
timestamp = Date.UTC(struct[1], struct[2], struct[3], struct[4], struct[5] + minutesOffset, struct[6], struct[7]);
|
|
3321
|
+
}
|
|
3322
|
+
} else timestamp = Date.parse ? Date.parse(date2) : NaN;
|
|
3323
|
+
return timestamp;
|
|
3324
|
+
}
|
|
3325
|
+
let invalidDate = /* @__PURE__ */ new Date("");
|
|
3326
|
+
let isDate = (obj) => Object.prototype.toString.call(obj) === "[object Date]";
|
|
3327
|
+
class DateSchema extends BaseSchema {
|
|
3328
|
+
constructor() {
|
|
3329
|
+
super({
|
|
3330
|
+
type: "date"
|
|
3331
|
+
});
|
|
3332
|
+
this.withMutation(() => {
|
|
3333
|
+
this.transform(function(value) {
|
|
3334
|
+
if (this.isType(value)) return value;
|
|
3335
|
+
value = parseIsoDate(value);
|
|
3336
|
+
return !isNaN(value) ? new Date(value) : invalidDate;
|
|
3337
|
+
});
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
_typeCheck(v2) {
|
|
3341
|
+
return isDate(v2) && !isNaN(v2.getTime());
|
|
3342
|
+
}
|
|
3343
|
+
prepareParam(ref, name) {
|
|
3344
|
+
let param;
|
|
3345
|
+
if (!Reference.isRef(ref)) {
|
|
3346
|
+
let cast = this.cast(ref);
|
|
3347
|
+
if (!this._typeCheck(cast)) throw new TypeError(`\`${name}\` must be a Date or a value that can be \`cast()\` to a Date`);
|
|
3348
|
+
param = cast;
|
|
3349
|
+
} else {
|
|
3350
|
+
param = ref;
|
|
3351
|
+
}
|
|
3352
|
+
return param;
|
|
3353
|
+
}
|
|
3354
|
+
min(min, message = date.min) {
|
|
3355
|
+
let limit = this.prepareParam(min, "min");
|
|
3356
|
+
return this.test({
|
|
3357
|
+
message,
|
|
3358
|
+
name: "min",
|
|
3359
|
+
exclusive: true,
|
|
3360
|
+
params: {
|
|
3361
|
+
min
|
|
3362
|
+
},
|
|
3363
|
+
test(value) {
|
|
3364
|
+
return isAbsent(value) || value >= this.resolve(limit);
|
|
3365
|
+
}
|
|
3366
|
+
});
|
|
3367
|
+
}
|
|
3368
|
+
max(max, message = date.max) {
|
|
3369
|
+
var limit = this.prepareParam(max, "max");
|
|
3370
|
+
return this.test({
|
|
3371
|
+
message,
|
|
3372
|
+
name: "max",
|
|
3373
|
+
exclusive: true,
|
|
3374
|
+
params: {
|
|
3375
|
+
max
|
|
3376
|
+
},
|
|
3377
|
+
test(value) {
|
|
3378
|
+
return isAbsent(value) || value <= this.resolve(limit);
|
|
3379
|
+
}
|
|
3380
|
+
});
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
DateSchema.INVALID_DATE = invalidDate;
|
|
3384
|
+
var _arrayReduce;
|
|
3385
|
+
var hasRequired_arrayReduce;
|
|
3386
|
+
function require_arrayReduce() {
|
|
3387
|
+
if (hasRequired_arrayReduce) return _arrayReduce;
|
|
3388
|
+
hasRequired_arrayReduce = 1;
|
|
3389
|
+
function arrayReduce(array2, iteratee, accumulator, initAccum) {
|
|
3390
|
+
var index2 = -1, length = array2 == null ? 0 : array2.length;
|
|
3391
|
+
if (initAccum && length) {
|
|
3392
|
+
accumulator = array2[++index2];
|
|
3393
|
+
}
|
|
3394
|
+
while (++index2 < length) {
|
|
3395
|
+
accumulator = iteratee(accumulator, array2[index2], index2, array2);
|
|
3396
|
+
}
|
|
3397
|
+
return accumulator;
|
|
3398
|
+
}
|
|
3399
|
+
_arrayReduce = arrayReduce;
|
|
3400
|
+
return _arrayReduce;
|
|
3401
|
+
}
|
|
3402
|
+
var _basePropertyOf;
|
|
3403
|
+
var hasRequired_basePropertyOf;
|
|
3404
|
+
function require_basePropertyOf() {
|
|
3405
|
+
if (hasRequired_basePropertyOf) return _basePropertyOf;
|
|
3406
|
+
hasRequired_basePropertyOf = 1;
|
|
3407
|
+
function basePropertyOf(object2) {
|
|
3408
|
+
return function(key) {
|
|
3409
|
+
return object2 == null ? void 0 : object2[key];
|
|
3410
|
+
};
|
|
3411
|
+
}
|
|
3412
|
+
_basePropertyOf = basePropertyOf;
|
|
3413
|
+
return _basePropertyOf;
|
|
3414
|
+
}
|
|
3415
|
+
var _deburrLetter;
|
|
3416
|
+
var hasRequired_deburrLetter;
|
|
3417
|
+
function require_deburrLetter() {
|
|
3418
|
+
if (hasRequired_deburrLetter) return _deburrLetter;
|
|
3419
|
+
hasRequired_deburrLetter = 1;
|
|
3420
|
+
var basePropertyOf = require_basePropertyOf();
|
|
3421
|
+
var deburredLetters = {
|
|
3422
|
+
// Latin-1 Supplement block.
|
|
3423
|
+
"À": "A",
|
|
3424
|
+
"Á": "A",
|
|
3425
|
+
"Â": "A",
|
|
3426
|
+
"Ã": "A",
|
|
3427
|
+
"Ä": "A",
|
|
3428
|
+
"Å": "A",
|
|
3429
|
+
"à": "a",
|
|
3430
|
+
"á": "a",
|
|
3431
|
+
"â": "a",
|
|
3432
|
+
"ã": "a",
|
|
3433
|
+
"ä": "a",
|
|
3434
|
+
"å": "a",
|
|
3435
|
+
"Ç": "C",
|
|
3436
|
+
"ç": "c",
|
|
3437
|
+
"Ð": "D",
|
|
3438
|
+
"ð": "d",
|
|
3439
|
+
"È": "E",
|
|
3440
|
+
"É": "E",
|
|
3441
|
+
"Ê": "E",
|
|
3442
|
+
"Ë": "E",
|
|
3443
|
+
"è": "e",
|
|
3444
|
+
"é": "e",
|
|
3445
|
+
"ê": "e",
|
|
3446
|
+
"ë": "e",
|
|
3447
|
+
"Ì": "I",
|
|
3448
|
+
"Í": "I",
|
|
3449
|
+
"Î": "I",
|
|
3450
|
+
"Ï": "I",
|
|
3451
|
+
"ì": "i",
|
|
3452
|
+
"í": "i",
|
|
3453
|
+
"î": "i",
|
|
3454
|
+
"ï": "i",
|
|
3455
|
+
"Ñ": "N",
|
|
3456
|
+
"ñ": "n",
|
|
3457
|
+
"Ò": "O",
|
|
3458
|
+
"Ó": "O",
|
|
3459
|
+
"Ô": "O",
|
|
3460
|
+
"Õ": "O",
|
|
3461
|
+
"Ö": "O",
|
|
3462
|
+
"Ø": "O",
|
|
3463
|
+
"ò": "o",
|
|
3464
|
+
"ó": "o",
|
|
3465
|
+
"ô": "o",
|
|
3466
|
+
"õ": "o",
|
|
3467
|
+
"ö": "o",
|
|
3468
|
+
"ø": "o",
|
|
3469
|
+
"Ù": "U",
|
|
3470
|
+
"Ú": "U",
|
|
3471
|
+
"Û": "U",
|
|
3472
|
+
"Ü": "U",
|
|
3473
|
+
"ù": "u",
|
|
3474
|
+
"ú": "u",
|
|
3475
|
+
"û": "u",
|
|
3476
|
+
"ü": "u",
|
|
3477
|
+
"Ý": "Y",
|
|
3478
|
+
"ý": "y",
|
|
3479
|
+
"ÿ": "y",
|
|
3480
|
+
"Æ": "Ae",
|
|
3481
|
+
"æ": "ae",
|
|
3482
|
+
"Þ": "Th",
|
|
3483
|
+
"þ": "th",
|
|
3484
|
+
"ß": "ss",
|
|
3485
|
+
// Latin Extended-A block.
|
|
3486
|
+
"Ā": "A",
|
|
3487
|
+
"Ă": "A",
|
|
3488
|
+
"Ą": "A",
|
|
3489
|
+
"ā": "a",
|
|
3490
|
+
"ă": "a",
|
|
3491
|
+
"ą": "a",
|
|
3492
|
+
"Ć": "C",
|
|
3493
|
+
"Ĉ": "C",
|
|
3494
|
+
"Ċ": "C",
|
|
3495
|
+
"Č": "C",
|
|
3496
|
+
"ć": "c",
|
|
3497
|
+
"ĉ": "c",
|
|
3498
|
+
"ċ": "c",
|
|
3499
|
+
"č": "c",
|
|
3500
|
+
"Ď": "D",
|
|
3501
|
+
"Đ": "D",
|
|
3502
|
+
"ď": "d",
|
|
3503
|
+
"đ": "d",
|
|
3504
|
+
"Ē": "E",
|
|
3505
|
+
"Ĕ": "E",
|
|
3506
|
+
"Ė": "E",
|
|
3507
|
+
"Ę": "E",
|
|
3508
|
+
"Ě": "E",
|
|
3509
|
+
"ē": "e",
|
|
3510
|
+
"ĕ": "e",
|
|
3511
|
+
"ė": "e",
|
|
3512
|
+
"ę": "e",
|
|
3513
|
+
"ě": "e",
|
|
3514
|
+
"Ĝ": "G",
|
|
3515
|
+
"Ğ": "G",
|
|
3516
|
+
"Ġ": "G",
|
|
3517
|
+
"Ģ": "G",
|
|
3518
|
+
"ĝ": "g",
|
|
3519
|
+
"ğ": "g",
|
|
3520
|
+
"ġ": "g",
|
|
3521
|
+
"ģ": "g",
|
|
3522
|
+
"Ĥ": "H",
|
|
3523
|
+
"Ħ": "H",
|
|
3524
|
+
"ĥ": "h",
|
|
3525
|
+
"ħ": "h",
|
|
3526
|
+
"Ĩ": "I",
|
|
3527
|
+
"Ī": "I",
|
|
3528
|
+
"Ĭ": "I",
|
|
3529
|
+
"Į": "I",
|
|
3530
|
+
"İ": "I",
|
|
3531
|
+
"ĩ": "i",
|
|
3532
|
+
"ī": "i",
|
|
3533
|
+
"ĭ": "i",
|
|
3534
|
+
"į": "i",
|
|
3535
|
+
"ı": "i",
|
|
3536
|
+
"Ĵ": "J",
|
|
3537
|
+
"ĵ": "j",
|
|
3538
|
+
"Ķ": "K",
|
|
3539
|
+
"ķ": "k",
|
|
3540
|
+
"ĸ": "k",
|
|
3541
|
+
"Ĺ": "L",
|
|
3542
|
+
"Ļ": "L",
|
|
3543
|
+
"Ľ": "L",
|
|
3544
|
+
"Ŀ": "L",
|
|
3545
|
+
"Ł": "L",
|
|
3546
|
+
"ĺ": "l",
|
|
3547
|
+
"ļ": "l",
|
|
3548
|
+
"ľ": "l",
|
|
3549
|
+
"ŀ": "l",
|
|
3550
|
+
"ł": "l",
|
|
3551
|
+
"Ń": "N",
|
|
3552
|
+
"Ņ": "N",
|
|
3553
|
+
"Ň": "N",
|
|
3554
|
+
"Ŋ": "N",
|
|
3555
|
+
"ń": "n",
|
|
3556
|
+
"ņ": "n",
|
|
3557
|
+
"ň": "n",
|
|
3558
|
+
"ŋ": "n",
|
|
3559
|
+
"Ō": "O",
|
|
3560
|
+
"Ŏ": "O",
|
|
3561
|
+
"Ő": "O",
|
|
3562
|
+
"ō": "o",
|
|
3563
|
+
"ŏ": "o",
|
|
3564
|
+
"ő": "o",
|
|
3565
|
+
"Ŕ": "R",
|
|
3566
|
+
"Ŗ": "R",
|
|
3567
|
+
"Ř": "R",
|
|
3568
|
+
"ŕ": "r",
|
|
3569
|
+
"ŗ": "r",
|
|
3570
|
+
"ř": "r",
|
|
3571
|
+
"Ś": "S",
|
|
3572
|
+
"Ŝ": "S",
|
|
3573
|
+
"Ş": "S",
|
|
3574
|
+
"Š": "S",
|
|
3575
|
+
"ś": "s",
|
|
3576
|
+
"ŝ": "s",
|
|
3577
|
+
"ş": "s",
|
|
3578
|
+
"š": "s",
|
|
3579
|
+
"Ţ": "T",
|
|
3580
|
+
"Ť": "T",
|
|
3581
|
+
"Ŧ": "T",
|
|
3582
|
+
"ţ": "t",
|
|
3583
|
+
"ť": "t",
|
|
3584
|
+
"ŧ": "t",
|
|
3585
|
+
"Ũ": "U",
|
|
3586
|
+
"Ū": "U",
|
|
3587
|
+
"Ŭ": "U",
|
|
3588
|
+
"Ů": "U",
|
|
3589
|
+
"Ű": "U",
|
|
3590
|
+
"Ų": "U",
|
|
3591
|
+
"ũ": "u",
|
|
3592
|
+
"ū": "u",
|
|
3593
|
+
"ŭ": "u",
|
|
3594
|
+
"ů": "u",
|
|
3595
|
+
"ű": "u",
|
|
3596
|
+
"ų": "u",
|
|
3597
|
+
"Ŵ": "W",
|
|
3598
|
+
"ŵ": "w",
|
|
3599
|
+
"Ŷ": "Y",
|
|
3600
|
+
"ŷ": "y",
|
|
3601
|
+
"Ÿ": "Y",
|
|
3602
|
+
"Ź": "Z",
|
|
3603
|
+
"Ż": "Z",
|
|
3604
|
+
"Ž": "Z",
|
|
3605
|
+
"ź": "z",
|
|
3606
|
+
"ż": "z",
|
|
3607
|
+
"ž": "z",
|
|
3608
|
+
"IJ": "IJ",
|
|
3609
|
+
"ij": "ij",
|
|
3610
|
+
"Œ": "Oe",
|
|
3611
|
+
"œ": "oe",
|
|
3612
|
+
"ʼn": "'n",
|
|
3613
|
+
"ſ": "s"
|
|
3614
|
+
};
|
|
3615
|
+
var deburrLetter = basePropertyOf(deburredLetters);
|
|
3616
|
+
_deburrLetter = deburrLetter;
|
|
3617
|
+
return _deburrLetter;
|
|
3618
|
+
}
|
|
3619
|
+
var deburr_1;
|
|
3620
|
+
var hasRequiredDeburr;
|
|
3621
|
+
function requireDeburr() {
|
|
3622
|
+
if (hasRequiredDeburr) return deburr_1;
|
|
3623
|
+
hasRequiredDeburr = 1;
|
|
3624
|
+
var deburrLetter = require_deburrLetter(), toString2 = requireToString();
|
|
3625
|
+
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
3626
|
+
var rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
3627
|
+
var rsCombo = "[" + rsComboRange + "]";
|
|
3628
|
+
var reComboMark = RegExp(rsCombo, "g");
|
|
3629
|
+
function deburr(string2) {
|
|
3630
|
+
string2 = toString2(string2);
|
|
3631
|
+
return string2 && string2.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
3632
|
+
}
|
|
3633
|
+
deburr_1 = deburr;
|
|
3634
|
+
return deburr_1;
|
|
3635
|
+
}
|
|
3636
|
+
var _asciiWords;
|
|
3637
|
+
var hasRequired_asciiWords;
|
|
3638
|
+
function require_asciiWords() {
|
|
3639
|
+
if (hasRequired_asciiWords) return _asciiWords;
|
|
3640
|
+
hasRequired_asciiWords = 1;
|
|
3641
|
+
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
3642
|
+
function asciiWords(string2) {
|
|
3643
|
+
return string2.match(reAsciiWord) || [];
|
|
3644
|
+
}
|
|
3645
|
+
_asciiWords = asciiWords;
|
|
3646
|
+
return _asciiWords;
|
|
3647
|
+
}
|
|
3648
|
+
var _hasUnicodeWord;
|
|
3649
|
+
var hasRequired_hasUnicodeWord;
|
|
3650
|
+
function require_hasUnicodeWord() {
|
|
3651
|
+
if (hasRequired_hasUnicodeWord) return _hasUnicodeWord;
|
|
3652
|
+
hasRequired_hasUnicodeWord = 1;
|
|
3653
|
+
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
3654
|
+
function hasUnicodeWord(string2) {
|
|
3655
|
+
return reHasUnicodeWord.test(string2);
|
|
3656
|
+
}
|
|
3657
|
+
_hasUnicodeWord = hasUnicodeWord;
|
|
3658
|
+
return _hasUnicodeWord;
|
|
3659
|
+
}
|
|
3660
|
+
var _unicodeWords;
|
|
3661
|
+
var hasRequired_unicodeWords;
|
|
3662
|
+
function require_unicodeWords() {
|
|
3663
|
+
if (hasRequired_unicodeWords) return _unicodeWords;
|
|
3664
|
+
hasRequired_unicodeWords = 1;
|
|
3665
|
+
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
3666
|
+
var rsApos = "['’]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
|
|
3667
|
+
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
|
|
3668
|
+
var reUnicodeWord = RegExp([
|
|
3669
|
+
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
3670
|
+
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
|
|
3671
|
+
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
3672
|
+
rsUpper + "+" + rsOptContrUpper,
|
|
3673
|
+
rsOrdUpper,
|
|
3674
|
+
rsOrdLower,
|
|
3675
|
+
rsDigits,
|
|
3676
|
+
rsEmoji
|
|
3677
|
+
].join("|"), "g");
|
|
3678
|
+
function unicodeWords(string2) {
|
|
3679
|
+
return string2.match(reUnicodeWord) || [];
|
|
3680
|
+
}
|
|
3681
|
+
_unicodeWords = unicodeWords;
|
|
3682
|
+
return _unicodeWords;
|
|
3683
|
+
}
|
|
3684
|
+
var words_1;
|
|
3685
|
+
var hasRequiredWords;
|
|
3686
|
+
function requireWords() {
|
|
3687
|
+
if (hasRequiredWords) return words_1;
|
|
3688
|
+
hasRequiredWords = 1;
|
|
3689
|
+
var asciiWords = require_asciiWords(), hasUnicodeWord = require_hasUnicodeWord(), toString2 = requireToString(), unicodeWords = require_unicodeWords();
|
|
3690
|
+
function words(string2, pattern, guard) {
|
|
3691
|
+
string2 = toString2(string2);
|
|
3692
|
+
pattern = guard ? void 0 : pattern;
|
|
3693
|
+
if (pattern === void 0) {
|
|
3694
|
+
return hasUnicodeWord(string2) ? unicodeWords(string2) : asciiWords(string2);
|
|
3695
|
+
}
|
|
3696
|
+
return string2.match(pattern) || [];
|
|
3697
|
+
}
|
|
3698
|
+
words_1 = words;
|
|
3699
|
+
return words_1;
|
|
3700
|
+
}
|
|
3701
|
+
var _createCompounder;
|
|
3702
|
+
var hasRequired_createCompounder;
|
|
3703
|
+
function require_createCompounder() {
|
|
3704
|
+
if (hasRequired_createCompounder) return _createCompounder;
|
|
3705
|
+
hasRequired_createCompounder = 1;
|
|
3706
|
+
var arrayReduce = require_arrayReduce(), deburr = requireDeburr(), words = requireWords();
|
|
3707
|
+
var rsApos = "['’]";
|
|
3708
|
+
var reApos = RegExp(rsApos, "g");
|
|
3709
|
+
function createCompounder(callback) {
|
|
3710
|
+
return function(string2) {
|
|
3711
|
+
return arrayReduce(words(deburr(string2).replace(reApos, "")), callback, "");
|
|
3712
|
+
};
|
|
3713
|
+
}
|
|
3714
|
+
_createCompounder = createCompounder;
|
|
3715
|
+
return _createCompounder;
|
|
3716
|
+
}
|
|
3717
|
+
var snakeCase_1;
|
|
3718
|
+
var hasRequiredSnakeCase;
|
|
3719
|
+
function requireSnakeCase() {
|
|
3720
|
+
if (hasRequiredSnakeCase) return snakeCase_1;
|
|
3721
|
+
hasRequiredSnakeCase = 1;
|
|
3722
|
+
var createCompounder = require_createCompounder();
|
|
3723
|
+
var snakeCase = createCompounder(function(result, word, index2) {
|
|
3724
|
+
return result + (index2 ? "_" : "") + word.toLowerCase();
|
|
3725
|
+
});
|
|
3726
|
+
snakeCase_1 = snakeCase;
|
|
3727
|
+
return snakeCase_1;
|
|
3728
|
+
}
|
|
3729
|
+
requireSnakeCase();
|
|
3730
|
+
var _baseSlice;
|
|
3731
|
+
var hasRequired_baseSlice;
|
|
3732
|
+
function require_baseSlice() {
|
|
3733
|
+
if (hasRequired_baseSlice) return _baseSlice;
|
|
3734
|
+
hasRequired_baseSlice = 1;
|
|
3735
|
+
function baseSlice(array2, start, end) {
|
|
3736
|
+
var index2 = -1, length = array2.length;
|
|
3737
|
+
if (start < 0) {
|
|
3738
|
+
start = -start > length ? 0 : length + start;
|
|
3739
|
+
}
|
|
3740
|
+
end = end > length ? length : end;
|
|
3741
|
+
if (end < 0) {
|
|
3742
|
+
end += length;
|
|
3743
|
+
}
|
|
3744
|
+
length = start > end ? 0 : end - start >>> 0;
|
|
3745
|
+
start >>>= 0;
|
|
3746
|
+
var result = Array(length);
|
|
3747
|
+
while (++index2 < length) {
|
|
3748
|
+
result[index2] = array2[index2 + start];
|
|
3749
|
+
}
|
|
3750
|
+
return result;
|
|
3751
|
+
}
|
|
3752
|
+
_baseSlice = baseSlice;
|
|
3753
|
+
return _baseSlice;
|
|
3754
|
+
}
|
|
3755
|
+
var _castSlice;
|
|
3756
|
+
var hasRequired_castSlice;
|
|
3757
|
+
function require_castSlice() {
|
|
3758
|
+
if (hasRequired_castSlice) return _castSlice;
|
|
3759
|
+
hasRequired_castSlice = 1;
|
|
3760
|
+
var baseSlice = require_baseSlice();
|
|
3761
|
+
function castSlice(array2, start, end) {
|
|
3762
|
+
var length = array2.length;
|
|
3763
|
+
end = end === void 0 ? length : end;
|
|
3764
|
+
return !start && end >= length ? array2 : baseSlice(array2, start, end);
|
|
3765
|
+
}
|
|
3766
|
+
_castSlice = castSlice;
|
|
3767
|
+
return _castSlice;
|
|
3768
|
+
}
|
|
3769
|
+
var _hasUnicode;
|
|
3770
|
+
var hasRequired_hasUnicode;
|
|
3771
|
+
function require_hasUnicode() {
|
|
3772
|
+
if (hasRequired_hasUnicode) return _hasUnicode;
|
|
3773
|
+
hasRequired_hasUnicode = 1;
|
|
3774
|
+
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
|
|
3775
|
+
var rsZWJ = "\\u200d";
|
|
3776
|
+
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
3777
|
+
function hasUnicode(string2) {
|
|
3778
|
+
return reHasUnicode.test(string2);
|
|
3779
|
+
}
|
|
3780
|
+
_hasUnicode = hasUnicode;
|
|
3781
|
+
return _hasUnicode;
|
|
3782
|
+
}
|
|
3783
|
+
var _asciiToArray;
|
|
3784
|
+
var hasRequired_asciiToArray;
|
|
3785
|
+
function require_asciiToArray() {
|
|
3786
|
+
if (hasRequired_asciiToArray) return _asciiToArray;
|
|
3787
|
+
hasRequired_asciiToArray = 1;
|
|
3788
|
+
function asciiToArray(string2) {
|
|
3789
|
+
return string2.split("");
|
|
3790
|
+
}
|
|
3791
|
+
_asciiToArray = asciiToArray;
|
|
3792
|
+
return _asciiToArray;
|
|
3793
|
+
}
|
|
3794
|
+
var _unicodeToArray;
|
|
3795
|
+
var hasRequired_unicodeToArray;
|
|
3796
|
+
function require_unicodeToArray() {
|
|
3797
|
+
if (hasRequired_unicodeToArray) return _unicodeToArray;
|
|
3798
|
+
hasRequired_unicodeToArray = 1;
|
|
3799
|
+
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
|
|
3800
|
+
var rsAstral = "[" + rsAstralRange + "]", rsCombo = "[" + rsComboRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ = "\\u200d";
|
|
3801
|
+
var reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
3802
|
+
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
3803
|
+
function unicodeToArray(string2) {
|
|
3804
|
+
return string2.match(reUnicode) || [];
|
|
3805
|
+
}
|
|
3806
|
+
_unicodeToArray = unicodeToArray;
|
|
3807
|
+
return _unicodeToArray;
|
|
3808
|
+
}
|
|
3809
|
+
var _stringToArray;
|
|
3810
|
+
var hasRequired_stringToArray;
|
|
3811
|
+
function require_stringToArray() {
|
|
3812
|
+
if (hasRequired_stringToArray) return _stringToArray;
|
|
3813
|
+
hasRequired_stringToArray = 1;
|
|
3814
|
+
var asciiToArray = require_asciiToArray(), hasUnicode = require_hasUnicode(), unicodeToArray = require_unicodeToArray();
|
|
3815
|
+
function stringToArray(string2) {
|
|
3816
|
+
return hasUnicode(string2) ? unicodeToArray(string2) : asciiToArray(string2);
|
|
3817
|
+
}
|
|
3818
|
+
_stringToArray = stringToArray;
|
|
3819
|
+
return _stringToArray;
|
|
3820
|
+
}
|
|
3821
|
+
var _createCaseFirst;
|
|
3822
|
+
var hasRequired_createCaseFirst;
|
|
3823
|
+
function require_createCaseFirst() {
|
|
3824
|
+
if (hasRequired_createCaseFirst) return _createCaseFirst;
|
|
3825
|
+
hasRequired_createCaseFirst = 1;
|
|
3826
|
+
var castSlice = require_castSlice(), hasUnicode = require_hasUnicode(), stringToArray = require_stringToArray(), toString2 = requireToString();
|
|
3827
|
+
function createCaseFirst(methodName) {
|
|
3828
|
+
return function(string2) {
|
|
3829
|
+
string2 = toString2(string2);
|
|
3830
|
+
var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0;
|
|
3831
|
+
var chr = strSymbols ? strSymbols[0] : string2.charAt(0);
|
|
3832
|
+
var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1);
|
|
3833
|
+
return chr[methodName]() + trailing;
|
|
3834
|
+
};
|
|
3835
|
+
}
|
|
3836
|
+
_createCaseFirst = createCaseFirst;
|
|
3837
|
+
return _createCaseFirst;
|
|
3838
|
+
}
|
|
3839
|
+
var upperFirst_1;
|
|
3840
|
+
var hasRequiredUpperFirst;
|
|
3841
|
+
function requireUpperFirst() {
|
|
3842
|
+
if (hasRequiredUpperFirst) return upperFirst_1;
|
|
3843
|
+
hasRequiredUpperFirst = 1;
|
|
3844
|
+
var createCaseFirst = require_createCaseFirst();
|
|
3845
|
+
var upperFirst = createCaseFirst("toUpperCase");
|
|
3846
|
+
upperFirst_1 = upperFirst;
|
|
3847
|
+
return upperFirst_1;
|
|
3848
|
+
}
|
|
3849
|
+
var capitalize_1;
|
|
3850
|
+
var hasRequiredCapitalize;
|
|
3851
|
+
function requireCapitalize() {
|
|
3852
|
+
if (hasRequiredCapitalize) return capitalize_1;
|
|
3853
|
+
hasRequiredCapitalize = 1;
|
|
3854
|
+
var toString2 = requireToString(), upperFirst = requireUpperFirst();
|
|
3855
|
+
function capitalize(string2) {
|
|
3856
|
+
return upperFirst(toString2(string2).toLowerCase());
|
|
3857
|
+
}
|
|
3858
|
+
capitalize_1 = capitalize;
|
|
3859
|
+
return capitalize_1;
|
|
3860
|
+
}
|
|
3861
|
+
var camelCase_1;
|
|
3862
|
+
var hasRequiredCamelCase;
|
|
3863
|
+
function requireCamelCase() {
|
|
3864
|
+
if (hasRequiredCamelCase) return camelCase_1;
|
|
3865
|
+
hasRequiredCamelCase = 1;
|
|
3866
|
+
var capitalize = requireCapitalize(), createCompounder = require_createCompounder();
|
|
3867
|
+
var camelCase = createCompounder(function(result, word, index2) {
|
|
3868
|
+
word = word.toLowerCase();
|
|
3869
|
+
return result + (index2 ? capitalize(word) : word);
|
|
3870
|
+
});
|
|
3871
|
+
camelCase_1 = camelCase;
|
|
3872
|
+
return camelCase_1;
|
|
3873
|
+
}
|
|
3874
|
+
requireCamelCase();
|
|
3875
|
+
var mapKeys_1;
|
|
3876
|
+
var hasRequiredMapKeys;
|
|
3877
|
+
function requireMapKeys() {
|
|
3878
|
+
if (hasRequiredMapKeys) return mapKeys_1;
|
|
3879
|
+
hasRequiredMapKeys = 1;
|
|
3880
|
+
var baseAssignValue = require_baseAssignValue(), baseForOwn = require_baseForOwn(), baseIteratee = require_baseIteratee();
|
|
3881
|
+
function mapKeys(object2, iteratee) {
|
|
3882
|
+
var result = {};
|
|
3883
|
+
iteratee = baseIteratee(iteratee, 3);
|
|
3884
|
+
baseForOwn(object2, function(value, key, object3) {
|
|
3885
|
+
baseAssignValue(result, iteratee(value, key, object3), value);
|
|
3886
|
+
});
|
|
3887
|
+
return result;
|
|
3888
|
+
}
|
|
3889
|
+
mapKeys_1 = mapKeys;
|
|
3890
|
+
return mapKeys_1;
|
|
3891
|
+
}
|
|
3892
|
+
requireMapKeys();
|
|
3893
|
+
var toposort = { exports: {} };
|
|
3894
|
+
var hasRequiredToposort;
|
|
3895
|
+
function requireToposort() {
|
|
3896
|
+
if (hasRequiredToposort) return toposort.exports;
|
|
3897
|
+
hasRequiredToposort = 1;
|
|
3898
|
+
toposort.exports = function(edges) {
|
|
3899
|
+
return toposort$1(uniqueNodes(edges), edges);
|
|
3900
|
+
};
|
|
3901
|
+
toposort.exports.array = toposort$1;
|
|
3902
|
+
function toposort$1(nodes, edges) {
|
|
3903
|
+
var cursor = nodes.length, sorted = new Array(cursor), visited = {}, i = cursor, outgoingEdges = makeOutgoingEdges(edges), nodesHash = makeNodesHash(nodes);
|
|
3904
|
+
edges.forEach(function(edge) {
|
|
3905
|
+
if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) {
|
|
3906
|
+
throw new Error("Unknown node. There is an unknown node in the supplied edges.");
|
|
3907
|
+
}
|
|
3908
|
+
});
|
|
3909
|
+
while (i--) {
|
|
3910
|
+
if (!visited[i]) visit(nodes[i], i, /* @__PURE__ */ new Set());
|
|
3911
|
+
}
|
|
3912
|
+
return sorted;
|
|
3913
|
+
function visit(node, i2, predecessors) {
|
|
3914
|
+
if (predecessors.has(node)) {
|
|
3915
|
+
var nodeRep;
|
|
3916
|
+
try {
|
|
3917
|
+
nodeRep = ", node was:" + JSON.stringify(node);
|
|
3918
|
+
} catch (e) {
|
|
3919
|
+
nodeRep = "";
|
|
3920
|
+
}
|
|
3921
|
+
throw new Error("Cyclic dependency" + nodeRep);
|
|
3922
|
+
}
|
|
3923
|
+
if (!nodesHash.has(node)) {
|
|
3924
|
+
throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(node));
|
|
3925
|
+
}
|
|
3926
|
+
if (visited[i2]) return;
|
|
3927
|
+
visited[i2] = true;
|
|
3928
|
+
var outgoing = outgoingEdges.get(node) || /* @__PURE__ */ new Set();
|
|
3929
|
+
outgoing = Array.from(outgoing);
|
|
3930
|
+
if (i2 = outgoing.length) {
|
|
3931
|
+
predecessors.add(node);
|
|
3932
|
+
do {
|
|
3933
|
+
var child = outgoing[--i2];
|
|
3934
|
+
visit(child, nodesHash.get(child), predecessors);
|
|
3935
|
+
} while (i2);
|
|
3936
|
+
predecessors.delete(node);
|
|
3937
|
+
}
|
|
3938
|
+
sorted[--cursor] = node;
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
function uniqueNodes(arr) {
|
|
3942
|
+
var res = /* @__PURE__ */ new Set();
|
|
3943
|
+
for (var i = 0, len = arr.length; i < len; i++) {
|
|
3944
|
+
var edge = arr[i];
|
|
3945
|
+
res.add(edge[0]);
|
|
3946
|
+
res.add(edge[1]);
|
|
3947
|
+
}
|
|
3948
|
+
return Array.from(res);
|
|
3949
|
+
}
|
|
3950
|
+
function makeOutgoingEdges(arr) {
|
|
3951
|
+
var edges = /* @__PURE__ */ new Map();
|
|
3952
|
+
for (var i = 0, len = arr.length; i < len; i++) {
|
|
3953
|
+
var edge = arr[i];
|
|
3954
|
+
if (!edges.has(edge[0])) edges.set(edge[0], /* @__PURE__ */ new Set());
|
|
3955
|
+
if (!edges.has(edge[1])) edges.set(edge[1], /* @__PURE__ */ new Set());
|
|
3956
|
+
edges.get(edge[0]).add(edge[1]);
|
|
3957
|
+
}
|
|
3958
|
+
return edges;
|
|
3959
|
+
}
|
|
3960
|
+
function makeNodesHash(arr) {
|
|
3961
|
+
var res = /* @__PURE__ */ new Map();
|
|
3962
|
+
for (var i = 0, len = arr.length; i < len; i++) {
|
|
3963
|
+
res.set(arr[i], i);
|
|
3964
|
+
}
|
|
3965
|
+
return res;
|
|
3966
|
+
}
|
|
3967
|
+
return toposort.exports;
|
|
3968
|
+
}
|
|
3969
|
+
requireToposort();
|
|
3970
|
+
const PLUGIN_ID = "strapi-plugin-json-schema-validation";
|
|
3971
|
+
const PLUGIN_CUSTOM_JSON_FIELD_NAME = "json-schema-validation";
|
|
3972
|
+
const JSON_SCHEMA_FIELD_OPTIONS_KEY = {
|
|
3973
|
+
base: {
|
|
3974
|
+
jsonSchema: "jsonSchema"
|
|
3975
|
+
}
|
|
3976
|
+
};
|
|
3977
|
+
const DRAFT_2020_12_SCHEMA = {
|
|
3978
|
+
$comment: "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
|
|
3979
|
+
$dynamicAnchor: "meta",
|
|
3980
|
+
$id: "https://json-schema.org/draft/2020-12/schema",
|
|
3981
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
3982
|
+
$vocabulary: {
|
|
3983
|
+
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
|
|
3984
|
+
"https://json-schema.org/draft/2020-12/vocab/content": true,
|
|
3985
|
+
"https://json-schema.org/draft/2020-12/vocab/core": true,
|
|
3986
|
+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
|
|
3987
|
+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
|
|
3988
|
+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
|
|
3989
|
+
"https://json-schema.org/draft/2020-12/vocab/validation": true
|
|
3990
|
+
},
|
|
3991
|
+
allOf: [
|
|
3992
|
+
{ $ref: "meta/core" },
|
|
3993
|
+
{ $ref: "meta/applicator" },
|
|
3994
|
+
{ $ref: "meta/unevaluated" },
|
|
3995
|
+
{ $ref: "meta/validation" },
|
|
3996
|
+
{ $ref: "meta/meta-data" },
|
|
3997
|
+
{ $ref: "meta/format-annotation" },
|
|
3998
|
+
{ $ref: "meta/content" }
|
|
3999
|
+
],
|
|
4000
|
+
properties: {
|
|
4001
|
+
$recursiveAnchor: {
|
|
4002
|
+
$comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
|
|
4003
|
+
$ref: "meta/core#/$defs/anchorString",
|
|
4004
|
+
deprecated: true
|
|
4005
|
+
},
|
|
4006
|
+
$recursiveRef: {
|
|
4007
|
+
$comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
|
|
4008
|
+
$ref: "meta/core#/$defs/uriReferenceString",
|
|
4009
|
+
deprecated: true
|
|
4010
|
+
},
|
|
4011
|
+
definitions: {
|
|
4012
|
+
$comment: '"definitions" has been replaced by "$defs".',
|
|
4013
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4014
|
+
default: {},
|
|
4015
|
+
deprecated: true,
|
|
4016
|
+
type: "object"
|
|
4017
|
+
},
|
|
4018
|
+
dependencies: {
|
|
4019
|
+
$comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
|
|
4020
|
+
additionalProperties: {
|
|
4021
|
+
anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }]
|
|
4022
|
+
},
|
|
4023
|
+
default: {},
|
|
4024
|
+
deprecated: true,
|
|
4025
|
+
type: "object"
|
|
4026
|
+
}
|
|
4027
|
+
},
|
|
4028
|
+
title: "Core and Validation specifications meta-schema",
|
|
4029
|
+
type: ["object", "boolean"]
|
|
4030
|
+
};
|
|
4031
|
+
const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
|
|
4032
|
+
const prefixPluginTranslations = (trad, pluginId) => {
|
|
4033
|
+
return Object.keys(trad).reduce((acc, current) => {
|
|
4034
|
+
acc[`${pluginId}.${current}`] = trad[current];
|
|
4035
|
+
return acc;
|
|
4036
|
+
}, {});
|
|
4037
|
+
};
|
|
4038
|
+
const DRAFT_2020_12_META_APPLICATOR = {
|
|
4039
|
+
$defs: {
|
|
4040
|
+
schemaArray: {
|
|
4041
|
+
items: { $dynamicRef: "#meta" },
|
|
4042
|
+
minItems: 1,
|
|
4043
|
+
type: "array"
|
|
4044
|
+
}
|
|
4045
|
+
},
|
|
4046
|
+
$dynamicAnchor: "meta",
|
|
4047
|
+
$id: "https://json-schema.org/draft/2020-12/meta/applicator",
|
|
4048
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4049
|
+
properties: {
|
|
4050
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4051
|
+
allOf: { $ref: "#/$defs/schemaArray" },
|
|
4052
|
+
anyOf: { $ref: "#/$defs/schemaArray" },
|
|
4053
|
+
contains: { $dynamicRef: "#meta" },
|
|
4054
|
+
dependentSchemas: {
|
|
4055
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4056
|
+
default: {},
|
|
4057
|
+
type: "object"
|
|
4058
|
+
},
|
|
4059
|
+
else: { $dynamicRef: "#meta" },
|
|
4060
|
+
if: { $dynamicRef: "#meta" },
|
|
4061
|
+
items: { $dynamicRef: "#meta" },
|
|
4062
|
+
not: { $dynamicRef: "#meta" },
|
|
4063
|
+
oneOf: { $ref: "#/$defs/schemaArray" },
|
|
4064
|
+
patternProperties: {
|
|
4065
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4066
|
+
default: {},
|
|
4067
|
+
propertyNames: { format: "regex" },
|
|
4068
|
+
type: "object"
|
|
4069
|
+
},
|
|
4070
|
+
prefixItems: { $ref: "#/$defs/schemaArray" },
|
|
4071
|
+
properties: {
|
|
4072
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4073
|
+
default: {},
|
|
4074
|
+
type: "object"
|
|
4075
|
+
},
|
|
4076
|
+
propertyNames: { $dynamicRef: "#meta" },
|
|
4077
|
+
then: { $dynamicRef: "#meta" }
|
|
4078
|
+
},
|
|
4079
|
+
title: "Applicator vocabulary meta-schema",
|
|
4080
|
+
type: ["object", "boolean"]
|
|
4081
|
+
};
|
|
4082
|
+
const metaContent = {
|
|
4083
|
+
$dynamicAnchor: "meta",
|
|
4084
|
+
$id: "https://json-schema.org/draft/2020-12/meta/content",
|
|
4085
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4086
|
+
properties: {
|
|
4087
|
+
contentEncoding: { type: "string" },
|
|
4088
|
+
contentMediaType: { type: "string" },
|
|
4089
|
+
contentSchema: { $dynamicRef: "#meta" }
|
|
4090
|
+
},
|
|
4091
|
+
title: "Content vocabulary meta-schema",
|
|
4092
|
+
type: ["object", "boolean"]
|
|
4093
|
+
};
|
|
4094
|
+
const metaCore = {
|
|
4095
|
+
$defs: {
|
|
4096
|
+
anchorString: {
|
|
4097
|
+
pattern: "^[A-Za-z_][-A-Za-z0-9._]*$",
|
|
4098
|
+
type: "string"
|
|
4099
|
+
},
|
|
4100
|
+
uriReferenceString: {
|
|
4101
|
+
format: "uri-reference",
|
|
4102
|
+
type: "string"
|
|
4103
|
+
},
|
|
4104
|
+
uriString: {
|
|
4105
|
+
format: "uri",
|
|
4106
|
+
type: "string"
|
|
4107
|
+
}
|
|
4108
|
+
},
|
|
4109
|
+
$dynamicAnchor: "meta",
|
|
4110
|
+
$id: "https://json-schema.org/draft/2020-12/meta/core",
|
|
4111
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4112
|
+
properties: {
|
|
4113
|
+
$anchor: { $ref: "#/$defs/anchorString" },
|
|
4114
|
+
$comment: {
|
|
4115
|
+
type: "string"
|
|
4116
|
+
},
|
|
4117
|
+
$defs: {
|
|
4118
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4119
|
+
type: "object"
|
|
4120
|
+
},
|
|
4121
|
+
$dynamicAnchor: { $ref: "#/$defs/anchorString" },
|
|
4122
|
+
$dynamicRef: { $ref: "#/$defs/uriReferenceString" },
|
|
4123
|
+
$id: {
|
|
4124
|
+
$comment: "Non-empty fragments not allowed.",
|
|
4125
|
+
$ref: "#/$defs/uriReferenceString",
|
|
4126
|
+
pattern: "^[^#]*#?$"
|
|
4127
|
+
},
|
|
4128
|
+
$ref: { $ref: "#/$defs/uriReferenceString" },
|
|
4129
|
+
$schema: { $ref: "#/$defs/uriString" },
|
|
4130
|
+
$vocabulary: {
|
|
4131
|
+
additionalProperties: {
|
|
4132
|
+
type: "boolean"
|
|
4133
|
+
},
|
|
4134
|
+
propertyNames: { $ref: "#/$defs/uriString" },
|
|
4135
|
+
type: "object"
|
|
4136
|
+
}
|
|
4137
|
+
},
|
|
4138
|
+
title: "Core vocabulary meta-schema",
|
|
4139
|
+
type: ["object", "boolean"]
|
|
4140
|
+
};
|
|
4141
|
+
const metaFormatAnnotation = {
|
|
4142
|
+
$dynamicAnchor: "meta",
|
|
4143
|
+
$id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
|
4144
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4145
|
+
properties: {
|
|
4146
|
+
format: { type: "string" }
|
|
4147
|
+
},
|
|
4148
|
+
title: "Format vocabulary meta-schema for annotation results",
|
|
4149
|
+
type: ["object", "boolean"]
|
|
4150
|
+
};
|
|
4151
|
+
const metaMetaData = {
|
|
4152
|
+
$dynamicAnchor: "meta",
|
|
4153
|
+
$id: "https://json-schema.org/draft/2020-12/meta/meta-data",
|
|
4154
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4155
|
+
properties: {
|
|
4156
|
+
default: true,
|
|
4157
|
+
deprecated: {
|
|
4158
|
+
default: false,
|
|
4159
|
+
type: "boolean"
|
|
4160
|
+
},
|
|
4161
|
+
description: {
|
|
4162
|
+
type: "string"
|
|
4163
|
+
},
|
|
4164
|
+
examples: {
|
|
4165
|
+
items: true,
|
|
4166
|
+
type: "array"
|
|
4167
|
+
},
|
|
4168
|
+
readOnly: {
|
|
4169
|
+
default: false,
|
|
4170
|
+
type: "boolean"
|
|
4171
|
+
},
|
|
4172
|
+
title: {
|
|
4173
|
+
type: "string"
|
|
4174
|
+
},
|
|
4175
|
+
writeOnly: {
|
|
4176
|
+
default: false,
|
|
4177
|
+
type: "boolean"
|
|
4178
|
+
}
|
|
4179
|
+
},
|
|
4180
|
+
title: "Meta-data vocabulary meta-schema",
|
|
4181
|
+
type: ["object", "boolean"]
|
|
4182
|
+
};
|
|
4183
|
+
const metaUnevaluated = {
|
|
4184
|
+
$dynamicAnchor: "meta",
|
|
4185
|
+
$id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
|
4186
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4187
|
+
properties: {
|
|
4188
|
+
unevaluatedItems: { $dynamicRef: "#meta" },
|
|
4189
|
+
unevaluatedProperties: { $dynamicRef: "#meta" }
|
|
4190
|
+
},
|
|
4191
|
+
title: "Unevaluated applicator vocabulary meta-schema",
|
|
4192
|
+
type: ["object", "boolean"]
|
|
4193
|
+
};
|
|
4194
|
+
const metaValidation = {
|
|
4195
|
+
$defs: {
|
|
4196
|
+
nonNegativeInteger: {
|
|
4197
|
+
minimum: 0,
|
|
4198
|
+
type: "integer"
|
|
4199
|
+
},
|
|
4200
|
+
nonNegativeIntegerDefault0: {
|
|
4201
|
+
$ref: "#/$defs/nonNegativeInteger",
|
|
4202
|
+
default: 0
|
|
4203
|
+
},
|
|
4204
|
+
simpleTypes: {
|
|
4205
|
+
enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
|
|
4206
|
+
},
|
|
4207
|
+
stringArray: {
|
|
4208
|
+
default: [],
|
|
4209
|
+
items: { type: "string" },
|
|
4210
|
+
type: "array",
|
|
4211
|
+
uniqueItems: true
|
|
4212
|
+
}
|
|
4213
|
+
},
|
|
4214
|
+
$dynamicAnchor: "meta",
|
|
4215
|
+
$id: "https://json-schema.org/draft/2020-12/meta/validation",
|
|
4216
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4217
|
+
properties: {
|
|
4218
|
+
const: true,
|
|
4219
|
+
dependentRequired: {
|
|
4220
|
+
additionalProperties: {
|
|
4221
|
+
$ref: "#/$defs/stringArray"
|
|
4222
|
+
},
|
|
4223
|
+
type: "object"
|
|
4224
|
+
},
|
|
4225
|
+
enum: {
|
|
4226
|
+
items: true,
|
|
4227
|
+
type: "array"
|
|
4228
|
+
},
|
|
4229
|
+
exclusiveMaximum: {
|
|
4230
|
+
type: "number"
|
|
4231
|
+
},
|
|
4232
|
+
exclusiveMinimum: {
|
|
4233
|
+
type: "number"
|
|
4234
|
+
},
|
|
4235
|
+
maxContains: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4236
|
+
maximum: {
|
|
4237
|
+
type: "number"
|
|
4238
|
+
},
|
|
4239
|
+
maxItems: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4240
|
+
maxLength: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4241
|
+
maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4242
|
+
minContains: {
|
|
4243
|
+
$ref: "#/$defs/nonNegativeInteger",
|
|
4244
|
+
default: 1
|
|
4245
|
+
},
|
|
4246
|
+
minimum: {
|
|
4247
|
+
type: "number"
|
|
4248
|
+
},
|
|
4249
|
+
minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
4250
|
+
minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
4251
|
+
minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
4252
|
+
multipleOf: {
|
|
4253
|
+
exclusiveMinimum: 0,
|
|
4254
|
+
type: "number"
|
|
4255
|
+
},
|
|
4256
|
+
pattern: {
|
|
4257
|
+
format: "regex",
|
|
4258
|
+
type: "string"
|
|
4259
|
+
},
|
|
4260
|
+
required: { $ref: "#/$defs/stringArray" },
|
|
4261
|
+
type: {
|
|
4262
|
+
anyOf: [
|
|
4263
|
+
{ $ref: "#/$defs/simpleTypes" },
|
|
4264
|
+
{
|
|
4265
|
+
items: { $ref: "#/$defs/simpleTypes" },
|
|
4266
|
+
minItems: 1,
|
|
4267
|
+
type: "array",
|
|
4268
|
+
uniqueItems: true
|
|
4269
|
+
}
|
|
4270
|
+
]
|
|
4271
|
+
},
|
|
4272
|
+
uniqueItems: {
|
|
4273
|
+
default: false,
|
|
4274
|
+
type: "boolean"
|
|
4275
|
+
}
|
|
4276
|
+
},
|
|
4277
|
+
title: "Validation vocabulary meta-schema",
|
|
4278
|
+
type: ["object", "boolean"]
|
|
4279
|
+
};
|
|
4280
|
+
const v = new Validator();
|
|
4281
|
+
v.addSchema(metaCore);
|
|
4282
|
+
v.addSchema(DRAFT_2020_12_META_APPLICATOR);
|
|
4283
|
+
v.addSchema(metaValidation);
|
|
4284
|
+
v.addSchema(metaContent);
|
|
4285
|
+
v.addSchema(metaFormatAnnotation);
|
|
4286
|
+
v.addSchema(metaMetaData);
|
|
4287
|
+
v.addSchema(metaUnevaluated);
|
|
4288
|
+
const index = {
|
|
4289
|
+
register(app) {
|
|
4290
|
+
app.customFields.register({
|
|
4291
|
+
components: {
|
|
4292
|
+
Input: async () => import("./index-C9Ge6gj7.mjs").then((module) => ({
|
|
4293
|
+
default: module.default
|
|
4294
|
+
}))
|
|
4295
|
+
},
|
|
4296
|
+
icon: Braces,
|
|
4297
|
+
intlDescription: {
|
|
4298
|
+
defaultMessage: "Enter a JSON Schema to validate the content of this field.",
|
|
4299
|
+
id: getTranslation("field.description")
|
|
4300
|
+
},
|
|
4301
|
+
intlLabel: {
|
|
4302
|
+
defaultMessage: "JSON Schema Validation",
|
|
4303
|
+
id: getTranslation("field.label")
|
|
4304
|
+
},
|
|
4305
|
+
name: PLUGIN_CUSTOM_JSON_FIELD_NAME,
|
|
4306
|
+
options: {
|
|
4307
|
+
base: [
|
|
4308
|
+
{
|
|
4309
|
+
items: [
|
|
4310
|
+
{
|
|
4311
|
+
description: {
|
|
4312
|
+
defaultMessage: "Follow JSON schema DRAFT 2020-12 specification.",
|
|
4313
|
+
id: getTranslation("options.base.jsonSchema.description")
|
|
4314
|
+
},
|
|
4315
|
+
intlLabel: {
|
|
4316
|
+
defaultMessage: "JSON Schema",
|
|
4317
|
+
id: getTranslation("options.base.jsonSchema.label")
|
|
4318
|
+
},
|
|
4319
|
+
name: `options.${JSON_SCHEMA_FIELD_OPTIONS_KEY.base.jsonSchema}`,
|
|
4320
|
+
type: "json"
|
|
4321
|
+
}
|
|
4322
|
+
],
|
|
4323
|
+
sectionTitle: null
|
|
4324
|
+
}
|
|
4325
|
+
],
|
|
4326
|
+
validator: () => ({
|
|
4327
|
+
[JSON_SCHEMA_FIELD_OPTIONS_KEY.base.jsonSchema]: create().required("JSON Schema is required").test("is-valid-json", "Invalid JSON", function(value) {
|
|
4328
|
+
if (!value) return true;
|
|
4329
|
+
try {
|
|
4330
|
+
JSON.parse(value);
|
|
4331
|
+
return true;
|
|
4332
|
+
} catch (_err) {
|
|
4333
|
+
return false;
|
|
4334
|
+
}
|
|
4335
|
+
}).test(
|
|
4336
|
+
"is-valid-json-schema",
|
|
4337
|
+
"The JSON Schema must follow the DRAFT 2020-12 specification",
|
|
4338
|
+
function(value) {
|
|
4339
|
+
if (!value) return true;
|
|
4340
|
+
let parsedData = "";
|
|
4341
|
+
try {
|
|
4342
|
+
parsedData = JSON.parse(value);
|
|
4343
|
+
} catch (err) {
|
|
4344
|
+
return this.createError({ message: `Invalid JSON format: ${err.message}` });
|
|
4345
|
+
}
|
|
4346
|
+
try {
|
|
4347
|
+
const metaValidationResult = v.validate(
|
|
4348
|
+
parsedData,
|
|
4349
|
+
DRAFT_2020_12_SCHEMA
|
|
4350
|
+
);
|
|
4351
|
+
const { errors, valid } = metaValidationResult;
|
|
4352
|
+
if (!valid) {
|
|
4353
|
+
return this.createError({
|
|
4354
|
+
message: `Invalid JSON Schema: ${errors?.map((e) => e.stack).join(", ")}`
|
|
4355
|
+
});
|
|
4356
|
+
}
|
|
4357
|
+
return true;
|
|
4358
|
+
} catch (err) {
|
|
4359
|
+
return this.createError({
|
|
4360
|
+
message: `Error during JSON Schema validation: ${err.message}`
|
|
4361
|
+
});
|
|
4362
|
+
}
|
|
4363
|
+
}
|
|
4364
|
+
)
|
|
4365
|
+
})
|
|
4366
|
+
},
|
|
4367
|
+
pluginId: PLUGIN_ID,
|
|
4368
|
+
type: "json"
|
|
4369
|
+
});
|
|
4370
|
+
},
|
|
4371
|
+
async registerTrads({ locales }) {
|
|
4372
|
+
return Promise.all(
|
|
4373
|
+
locales.map(async (locale) => {
|
|
4374
|
+
try {
|
|
4375
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-Cum_oOSk.mjs") }), `./translations/${locale}.json`, 3);
|
|
4376
|
+
return {
|
|
4377
|
+
data: {
|
|
4378
|
+
...prefixPluginTranslations(data, PLUGIN_ID)
|
|
4379
|
+
},
|
|
4380
|
+
locale
|
|
4381
|
+
};
|
|
4382
|
+
} catch {
|
|
4383
|
+
return { data: {}, locale };
|
|
4384
|
+
}
|
|
4385
|
+
})
|
|
4386
|
+
);
|
|
4387
|
+
}
|
|
4388
|
+
};
|
|
4389
|
+
export {
|
|
4390
|
+
PLUGIN_ID as P,
|
|
4391
|
+
index as i
|
|
4392
|
+
};
|
|
4393
|
+
//# sourceMappingURL=index-C3Q0T-w5.mjs.map
|