gt-sanity 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +104 -2892
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +98 -2885
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/serialization/__tests__/BaseDocumentDeserializer/baseDeserialization.test.ts +4 -4
- package/src/serialization/__tests__/global.setup.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
-
var jsxRuntime = require("react/jsx-runtime"), ui = require("@sanity/ui"), theme$1 = require("@sanity/ui/theme"), o = require("react"), sanity = require("sanity"), generaltranslation = require("generaltranslation"), internal = require("generaltranslation/internal"), schema = require("@sanity/schema"), toHtml = require("@portabletext/to-html"), mutator = require("@sanity/mutator"), jsonpathPlus = require("jsonpath-plus"), JSONPointer = require("jsonpointer"), icons = require("@sanity/icons"), router = require("sanity/router");
|
|
3
|
+
var jsxRuntime = require("react/jsx-runtime"), ui = require("@sanity/ui"), theme$1 = require("@sanity/ui/theme"), o = require("react"), sanity = require("sanity"), generaltranslation = require("generaltranslation"), internal = require("generaltranslation/internal"), blockTools = require("@portabletext/block-tools"), schema = require("@sanity/schema"), toHtml = require("@portabletext/to-html"), mutator = require("@sanity/mutator"), jsonpathPlus = require("jsonpath-plus"), JSONPointer = require("jsonpointer"), icons = require("@sanity/icons"), router = require("sanity/router");
|
|
4
4
|
function _interopDefaultCompat(e) {
|
|
5
5
|
return e && typeof e == "object" && "default" in e ? e : { default: e };
|
|
6
6
|
}
|
|
@@ -168,2795 +168,7 @@ const pluginConfig = GTConfig.getInstance(), theme = theme$1.buildTheme(), BaseT
|
|
|
168
168
|
documentLevelMerge,
|
|
169
169
|
reconcileArray,
|
|
170
170
|
reconcileObject
|
|
171
|
-
}
|
|
172
|
-
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
173
|
-
function getDefaultExportFromCjs(x2) {
|
|
174
|
-
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2.default : x2;
|
|
175
|
-
}
|
|
176
|
-
var lodash_startcase, hasRequiredLodash_startcase;
|
|
177
|
-
function requireLodash_startcase() {
|
|
178
|
-
if (hasRequiredLodash_startcase) return lodash_startcase;
|
|
179
|
-
hasRequiredLodash_startcase = 1;
|
|
180
|
-
var symbolTag = "[object Symbol]", reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23", rsComboSymbolsRange = "\\u20d0-\\u20f0", 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, rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]", 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", rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")", rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")", reApos = RegExp(rsApos, "g"), reComboMark = RegExp(rsCombo, "g"), reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"), reUnicodeWord = RegExp([
|
|
181
|
-
rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
182
|
-
rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")",
|
|
183
|
-
rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr,
|
|
184
|
-
rsUpper + "+" + rsOptUpperContr,
|
|
185
|
-
rsDigits,
|
|
186
|
-
rsEmoji
|
|
187
|
-
].join("|"), "g"), reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + "]"), reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, deburredLetters = {
|
|
188
|
-
// Latin-1 Supplement block.
|
|
189
|
-
\u00C0: "A",
|
|
190
|
-
\u00C1: "A",
|
|
191
|
-
\u00C2: "A",
|
|
192
|
-
\u00C3: "A",
|
|
193
|
-
\u00C4: "A",
|
|
194
|
-
\u00C5: "A",
|
|
195
|
-
\u00E0: "a",
|
|
196
|
-
\u00E1: "a",
|
|
197
|
-
\u00E2: "a",
|
|
198
|
-
\u00E3: "a",
|
|
199
|
-
\u00E4: "a",
|
|
200
|
-
\u00E5: "a",
|
|
201
|
-
\u00C7: "C",
|
|
202
|
-
\u00E7: "c",
|
|
203
|
-
\u00D0: "D",
|
|
204
|
-
\u00F0: "d",
|
|
205
|
-
\u00C8: "E",
|
|
206
|
-
\u00C9: "E",
|
|
207
|
-
\u00CA: "E",
|
|
208
|
-
\u00CB: "E",
|
|
209
|
-
\u00E8: "e",
|
|
210
|
-
\u00E9: "e",
|
|
211
|
-
\u00EA: "e",
|
|
212
|
-
\u00EB: "e",
|
|
213
|
-
\u00CC: "I",
|
|
214
|
-
\u00CD: "I",
|
|
215
|
-
\u00CE: "I",
|
|
216
|
-
\u00CF: "I",
|
|
217
|
-
\u00EC: "i",
|
|
218
|
-
\u00ED: "i",
|
|
219
|
-
\u00EE: "i",
|
|
220
|
-
\u00EF: "i",
|
|
221
|
-
\u00D1: "N",
|
|
222
|
-
\u00F1: "n",
|
|
223
|
-
\u00D2: "O",
|
|
224
|
-
\u00D3: "O",
|
|
225
|
-
\u00D4: "O",
|
|
226
|
-
\u00D5: "O",
|
|
227
|
-
\u00D6: "O",
|
|
228
|
-
\u00D8: "O",
|
|
229
|
-
\u00F2: "o",
|
|
230
|
-
\u00F3: "o",
|
|
231
|
-
\u00F4: "o",
|
|
232
|
-
\u00F5: "o",
|
|
233
|
-
\u00F6: "o",
|
|
234
|
-
\u00F8: "o",
|
|
235
|
-
\u00D9: "U",
|
|
236
|
-
\u00DA: "U",
|
|
237
|
-
\u00DB: "U",
|
|
238
|
-
\u00DC: "U",
|
|
239
|
-
\u00F9: "u",
|
|
240
|
-
\u00FA: "u",
|
|
241
|
-
\u00FB: "u",
|
|
242
|
-
\u00FC: "u",
|
|
243
|
-
\u00DD: "Y",
|
|
244
|
-
\u00FD: "y",
|
|
245
|
-
\u00FF: "y",
|
|
246
|
-
\u00C6: "Ae",
|
|
247
|
-
\u00E6: "ae",
|
|
248
|
-
\u00DE: "Th",
|
|
249
|
-
\u00FE: "th",
|
|
250
|
-
\u00DF: "ss",
|
|
251
|
-
// Latin Extended-A block.
|
|
252
|
-
\u0100: "A",
|
|
253
|
-
\u0102: "A",
|
|
254
|
-
\u0104: "A",
|
|
255
|
-
\u0101: "a",
|
|
256
|
-
\u0103: "a",
|
|
257
|
-
\u0105: "a",
|
|
258
|
-
\u0106: "C",
|
|
259
|
-
\u0108: "C",
|
|
260
|
-
\u010A: "C",
|
|
261
|
-
\u010C: "C",
|
|
262
|
-
\u0107: "c",
|
|
263
|
-
\u0109: "c",
|
|
264
|
-
\u010B: "c",
|
|
265
|
-
\u010D: "c",
|
|
266
|
-
\u010E: "D",
|
|
267
|
-
\u0110: "D",
|
|
268
|
-
\u010F: "d",
|
|
269
|
-
\u0111: "d",
|
|
270
|
-
\u0112: "E",
|
|
271
|
-
\u0114: "E",
|
|
272
|
-
\u0116: "E",
|
|
273
|
-
\u0118: "E",
|
|
274
|
-
\u011A: "E",
|
|
275
|
-
\u0113: "e",
|
|
276
|
-
\u0115: "e",
|
|
277
|
-
\u0117: "e",
|
|
278
|
-
\u0119: "e",
|
|
279
|
-
\u011B: "e",
|
|
280
|
-
\u011C: "G",
|
|
281
|
-
\u011E: "G",
|
|
282
|
-
\u0120: "G",
|
|
283
|
-
\u0122: "G",
|
|
284
|
-
\u011D: "g",
|
|
285
|
-
\u011F: "g",
|
|
286
|
-
\u0121: "g",
|
|
287
|
-
\u0123: "g",
|
|
288
|
-
\u0124: "H",
|
|
289
|
-
\u0126: "H",
|
|
290
|
-
\u0125: "h",
|
|
291
|
-
\u0127: "h",
|
|
292
|
-
\u0128: "I",
|
|
293
|
-
\u012A: "I",
|
|
294
|
-
\u012C: "I",
|
|
295
|
-
\u012E: "I",
|
|
296
|
-
\u0130: "I",
|
|
297
|
-
\u0129: "i",
|
|
298
|
-
\u012B: "i",
|
|
299
|
-
\u012D: "i",
|
|
300
|
-
\u012F: "i",
|
|
301
|
-
\u0131: "i",
|
|
302
|
-
\u0134: "J",
|
|
303
|
-
\u0135: "j",
|
|
304
|
-
\u0136: "K",
|
|
305
|
-
\u0137: "k",
|
|
306
|
-
\u0138: "k",
|
|
307
|
-
\u0139: "L",
|
|
308
|
-
\u013B: "L",
|
|
309
|
-
\u013D: "L",
|
|
310
|
-
\u013F: "L",
|
|
311
|
-
\u0141: "L",
|
|
312
|
-
\u013A: "l",
|
|
313
|
-
\u013C: "l",
|
|
314
|
-
\u013E: "l",
|
|
315
|
-
\u0140: "l",
|
|
316
|
-
\u0142: "l",
|
|
317
|
-
\u0143: "N",
|
|
318
|
-
\u0145: "N",
|
|
319
|
-
\u0147: "N",
|
|
320
|
-
\u014A: "N",
|
|
321
|
-
\u0144: "n",
|
|
322
|
-
\u0146: "n",
|
|
323
|
-
\u0148: "n",
|
|
324
|
-
\u014B: "n",
|
|
325
|
-
\u014C: "O",
|
|
326
|
-
\u014E: "O",
|
|
327
|
-
\u0150: "O",
|
|
328
|
-
\u014D: "o",
|
|
329
|
-
\u014F: "o",
|
|
330
|
-
\u0151: "o",
|
|
331
|
-
\u0154: "R",
|
|
332
|
-
\u0156: "R",
|
|
333
|
-
\u0158: "R",
|
|
334
|
-
\u0155: "r",
|
|
335
|
-
\u0157: "r",
|
|
336
|
-
\u0159: "r",
|
|
337
|
-
\u015A: "S",
|
|
338
|
-
\u015C: "S",
|
|
339
|
-
\u015E: "S",
|
|
340
|
-
\u0160: "S",
|
|
341
|
-
\u015B: "s",
|
|
342
|
-
\u015D: "s",
|
|
343
|
-
\u015F: "s",
|
|
344
|
-
\u0161: "s",
|
|
345
|
-
\u0162: "T",
|
|
346
|
-
\u0164: "T",
|
|
347
|
-
\u0166: "T",
|
|
348
|
-
\u0163: "t",
|
|
349
|
-
\u0165: "t",
|
|
350
|
-
\u0167: "t",
|
|
351
|
-
\u0168: "U",
|
|
352
|
-
\u016A: "U",
|
|
353
|
-
\u016C: "U",
|
|
354
|
-
\u016E: "U",
|
|
355
|
-
\u0170: "U",
|
|
356
|
-
\u0172: "U",
|
|
357
|
-
\u0169: "u",
|
|
358
|
-
\u016B: "u",
|
|
359
|
-
\u016D: "u",
|
|
360
|
-
\u016F: "u",
|
|
361
|
-
\u0171: "u",
|
|
362
|
-
\u0173: "u",
|
|
363
|
-
\u0174: "W",
|
|
364
|
-
\u0175: "w",
|
|
365
|
-
\u0176: "Y",
|
|
366
|
-
\u0177: "y",
|
|
367
|
-
\u0178: "Y",
|
|
368
|
-
\u0179: "Z",
|
|
369
|
-
\u017B: "Z",
|
|
370
|
-
\u017D: "Z",
|
|
371
|
-
\u017A: "z",
|
|
372
|
-
\u017C: "z",
|
|
373
|
-
\u017E: "z",
|
|
374
|
-
\u0132: "IJ",
|
|
375
|
-
\u0133: "ij",
|
|
376
|
-
\u0152: "Oe",
|
|
377
|
-
\u0153: "oe",
|
|
378
|
-
\u0149: "'n",
|
|
379
|
-
\u017F: "ss"
|
|
380
|
-
}, freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")();
|
|
381
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
382
|
-
for (var index = -1, length2 = array ? array.length : 0; ++index < length2; )
|
|
383
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
384
|
-
return accumulator;
|
|
385
|
-
}
|
|
386
|
-
function asciiToArray(string) {
|
|
387
|
-
return string.split("");
|
|
388
|
-
}
|
|
389
|
-
function asciiWords(string) {
|
|
390
|
-
return string.match(reAsciiWord) || [];
|
|
391
|
-
}
|
|
392
|
-
function basePropertyOf(object) {
|
|
393
|
-
return function(key) {
|
|
394
|
-
return object?.[key];
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
var deburrLetter = basePropertyOf(deburredLetters);
|
|
398
|
-
function hasUnicode(string) {
|
|
399
|
-
return reHasUnicode.test(string);
|
|
400
|
-
}
|
|
401
|
-
function hasUnicodeWord(string) {
|
|
402
|
-
return reHasUnicodeWord.test(string);
|
|
403
|
-
}
|
|
404
|
-
function stringToArray(string) {
|
|
405
|
-
return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
|
|
406
|
-
}
|
|
407
|
-
function unicodeToArray(string) {
|
|
408
|
-
return string.match(reUnicode) || [];
|
|
409
|
-
}
|
|
410
|
-
function unicodeWords(string) {
|
|
411
|
-
return string.match(reUnicodeWord) || [];
|
|
412
|
-
}
|
|
413
|
-
var objectProto = Object.prototype, objectToString2 = objectProto.toString, Symbol2 = root.Symbol, symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
414
|
-
function baseSlice(array, start, end) {
|
|
415
|
-
var index = -1, length2 = array.length;
|
|
416
|
-
start < 0 && (start = -start > length2 ? 0 : length2 + start), end = end > length2 ? length2 : end, end < 0 && (end += length2), length2 = start > end ? 0 : end - start >>> 0, start >>>= 0;
|
|
417
|
-
for (var result = Array(length2); ++index < length2; )
|
|
418
|
-
result[index] = array[index + start];
|
|
419
|
-
return result;
|
|
420
|
-
}
|
|
421
|
-
function baseToString(value) {
|
|
422
|
-
if (typeof value == "string")
|
|
423
|
-
return value;
|
|
424
|
-
if (isSymbol(value))
|
|
425
|
-
return symbolToString ? symbolToString.call(value) : "";
|
|
426
|
-
var result = value + "";
|
|
427
|
-
return result == "0" && 1 / value == -1 / 0 ? "-0" : result;
|
|
428
|
-
}
|
|
429
|
-
function castSlice(array, start, end) {
|
|
430
|
-
var length2 = array.length;
|
|
431
|
-
return end = end === void 0 ? length2 : end, !start && end >= length2 ? array : baseSlice(array, start, end);
|
|
432
|
-
}
|
|
433
|
-
function createCaseFirst(methodName) {
|
|
434
|
-
return function(string) {
|
|
435
|
-
string = toString(string);
|
|
436
|
-
var strSymbols = hasUnicode(string) ? stringToArray(string) : void 0, chr = strSymbols ? strSymbols[0] : string.charAt(0), trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
|
|
437
|
-
return chr[methodName]() + trailing;
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
function createCompounder(callback) {
|
|
441
|
-
return function(string) {
|
|
442
|
-
return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
function isObjectLike(value) {
|
|
446
|
-
return !!value && typeof value == "object";
|
|
447
|
-
}
|
|
448
|
-
function isSymbol(value) {
|
|
449
|
-
return typeof value == "symbol" || isObjectLike(value) && objectToString2.call(value) == symbolTag;
|
|
450
|
-
}
|
|
451
|
-
function toString(value) {
|
|
452
|
-
return value == null ? "" : baseToString(value);
|
|
453
|
-
}
|
|
454
|
-
function deburr(string) {
|
|
455
|
-
return string = toString(string), string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
456
|
-
}
|
|
457
|
-
var startCase = createCompounder(function(result, word, index) {
|
|
458
|
-
return result + (index ? " " : "") + upperFirst(word);
|
|
459
|
-
}), upperFirst = createCaseFirst("toUpperCase");
|
|
460
|
-
function words(string, pattern, guard) {
|
|
461
|
-
return string = toString(string), pattern = pattern, pattern === void 0 ? hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string) : string.match(pattern) || [];
|
|
462
|
-
}
|
|
463
|
-
return lodash_startcase = startCase, lodash_startcase;
|
|
464
|
-
}
|
|
465
|
-
requireLodash_startcase();
|
|
466
|
-
function getRandomValues(typedArray) {
|
|
467
|
-
const crypto = typeof window < "u" && "crypto" in window ? window.crypto : globalThis.crypto;
|
|
468
|
-
if (!crypto || !crypto.getRandomValues)
|
|
469
|
-
throw new Error("WebCrypto not available in this environment");
|
|
470
|
-
return crypto.getRandomValues(typedArray);
|
|
471
|
-
}
|
|
472
|
-
function createPortableTextMemberSchemaTypes(portableTextType) {
|
|
473
|
-
if (!portableTextType)
|
|
474
|
-
throw new Error("Parameter 'portabletextType' missing (required)");
|
|
475
|
-
const blockType = portableTextType.of?.find(findBlockType);
|
|
476
|
-
if (!blockType)
|
|
477
|
-
throw new Error("Block type is not defined in this schema (required)");
|
|
478
|
-
const childrenField = blockType.fields?.find(
|
|
479
|
-
(field) => field.name === "children"
|
|
480
|
-
);
|
|
481
|
-
if (!childrenField)
|
|
482
|
-
throw new Error("Children field for block type found in schema (required)");
|
|
483
|
-
const ofType = childrenField.type.of;
|
|
484
|
-
if (!ofType)
|
|
485
|
-
throw new Error(
|
|
486
|
-
"Valid types for block children not found in schema (required)"
|
|
487
|
-
);
|
|
488
|
-
const spanType = ofType.find((memberType) => memberType.name === "span");
|
|
489
|
-
if (!spanType)
|
|
490
|
-
throw new Error("Span type not found in schema (required)");
|
|
491
|
-
const inlineObjectTypes = ofType.filter(
|
|
492
|
-
(memberType) => memberType.name !== "span"
|
|
493
|
-
) || [], blockObjectTypes = portableTextType.of?.filter(
|
|
494
|
-
(field) => field.name !== blockType.name
|
|
495
|
-
) || [];
|
|
496
|
-
return {
|
|
497
|
-
styles: resolveEnabledStyles(blockType),
|
|
498
|
-
decorators: resolveEnabledDecorators(spanType),
|
|
499
|
-
lists: resolveEnabledListItems(blockType),
|
|
500
|
-
block: blockType,
|
|
501
|
-
span: spanType,
|
|
502
|
-
portableText: portableTextType,
|
|
503
|
-
inlineObjects: inlineObjectTypes,
|
|
504
|
-
blockObjects: blockObjectTypes,
|
|
505
|
-
annotations: spanType.annotations
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
function resolveEnabledStyles(blockType) {
|
|
509
|
-
const styleField = blockType.fields?.find(
|
|
510
|
-
(btField) => btField.name === "style"
|
|
511
|
-
);
|
|
512
|
-
if (!styleField)
|
|
513
|
-
throw new Error(
|
|
514
|
-
"A field with name 'style' is not defined in the block type (required)."
|
|
515
|
-
);
|
|
516
|
-
const textStyles = styleField.type.options?.list && styleField.type.options.list?.filter(
|
|
517
|
-
(style) => style.value
|
|
518
|
-
);
|
|
519
|
-
if (!textStyles || textStyles.length === 0)
|
|
520
|
-
throw new Error(
|
|
521
|
-
"The style fields need at least one style defined. I.e: {title: 'Normal', value: 'normal'}."
|
|
522
|
-
);
|
|
523
|
-
return textStyles;
|
|
524
|
-
}
|
|
525
|
-
function resolveEnabledDecorators(spanType) {
|
|
526
|
-
return spanType.decorators;
|
|
527
|
-
}
|
|
528
|
-
function resolveEnabledListItems(blockType) {
|
|
529
|
-
const listField = blockType.fields?.find(
|
|
530
|
-
(btField) => btField.name === "listItem"
|
|
531
|
-
);
|
|
532
|
-
if (!listField)
|
|
533
|
-
throw new Error(
|
|
534
|
-
"A field with name 'listItem' is not defined in the block type (required)."
|
|
535
|
-
);
|
|
536
|
-
const listItems = listField.type.options?.list && listField.type.options.list.filter((list) => list.value);
|
|
537
|
-
if (!listItems)
|
|
538
|
-
throw new Error("The list field need at least to be an empty array");
|
|
539
|
-
return listItems;
|
|
540
|
-
}
|
|
541
|
-
function findBlockType(type) {
|
|
542
|
-
return type.type ? findBlockType(type.type) : type.name === "block" ? type : null;
|
|
543
|
-
}
|
|
544
|
-
function portableTextMemberSchemaTypesToSchema(schema2) {
|
|
545
|
-
return {
|
|
546
|
-
annotations: schema2.annotations.map((annotation) => ({
|
|
547
|
-
name: annotation.name,
|
|
548
|
-
fields: annotation.fields.map((field) => ({
|
|
549
|
-
name: field.name,
|
|
550
|
-
type: field.type.jsonType,
|
|
551
|
-
title: field.type.title
|
|
552
|
-
})),
|
|
553
|
-
title: annotation.title
|
|
554
|
-
})),
|
|
555
|
-
block: {
|
|
556
|
-
name: schema2.block.name
|
|
557
|
-
},
|
|
558
|
-
blockObjects: schema2.blockObjects.map((blockObject) => ({
|
|
559
|
-
name: blockObject.name,
|
|
560
|
-
fields: blockObject.fields.map((field) => ({
|
|
561
|
-
name: field.name,
|
|
562
|
-
type: field.type.jsonType,
|
|
563
|
-
title: field.type.title
|
|
564
|
-
})),
|
|
565
|
-
title: blockObject.title
|
|
566
|
-
})),
|
|
567
|
-
decorators: schema2.decorators.map((decorator) => ({
|
|
568
|
-
name: decorator.value,
|
|
569
|
-
title: decorator.title,
|
|
570
|
-
value: decorator.value
|
|
571
|
-
})),
|
|
572
|
-
inlineObjects: schema2.inlineObjects.map((inlineObject) => ({
|
|
573
|
-
name: inlineObject.name,
|
|
574
|
-
fields: inlineObject.fields.map((field) => ({
|
|
575
|
-
name: field.name,
|
|
576
|
-
type: field.type.jsonType,
|
|
577
|
-
title: field.type.title
|
|
578
|
-
})),
|
|
579
|
-
title: inlineObject.title
|
|
580
|
-
})),
|
|
581
|
-
span: {
|
|
582
|
-
name: schema2.span.name
|
|
583
|
-
},
|
|
584
|
-
styles: schema2.styles.map((style) => ({
|
|
585
|
-
name: style.value,
|
|
586
|
-
title: style.title,
|
|
587
|
-
value: style.value
|
|
588
|
-
})),
|
|
589
|
-
lists: schema2.lists.map((list) => ({
|
|
590
|
-
name: list.value,
|
|
591
|
-
title: list.title,
|
|
592
|
-
value: list.value
|
|
593
|
-
}))
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
function sanitySchemaToPortableTextSchema(sanitySchema) {
|
|
597
|
-
const portableTextMemberSchemaTypes = createPortableTextMemberSchemaTypes(
|
|
598
|
-
sanitySchema.hasOwnProperty("jsonType") ? sanitySchema : compileType(sanitySchema)
|
|
599
|
-
);
|
|
600
|
-
return portableTextMemberSchemaTypesToSchema(portableTextMemberSchemaTypes);
|
|
601
|
-
}
|
|
602
|
-
function compileType(rawType) {
|
|
603
|
-
return schema.Schema.compile({
|
|
604
|
-
name: "blockTypeSchema",
|
|
605
|
-
types: [rawType]
|
|
606
|
-
}).get(rawType.name);
|
|
607
|
-
}
|
|
608
|
-
const keyGenerator$1 = () => randomKey$1(12), getByteHexTable = /* @__PURE__ */ (() => {
|
|
609
|
-
let table;
|
|
610
|
-
return () => {
|
|
611
|
-
if (table)
|
|
612
|
-
return table;
|
|
613
|
-
table = [];
|
|
614
|
-
for (let i = 0; i < 256; ++i)
|
|
615
|
-
table[i] = (i + 256).toString(16).slice(1);
|
|
616
|
-
return table;
|
|
617
|
-
};
|
|
618
|
-
})();
|
|
619
|
-
function whatwgRNG$1(length2 = 16) {
|
|
620
|
-
const rnds8 = new Uint8Array(length2);
|
|
621
|
-
return getRandomValues(rnds8), rnds8;
|
|
622
|
-
}
|
|
623
|
-
function randomKey$1(length2) {
|
|
624
|
-
const table = getByteHexTable();
|
|
625
|
-
return whatwgRNG$1(length2).reduce((str, n) => str + table[n], "").slice(0, length2);
|
|
626
|
-
}
|
|
627
|
-
`${keyGenerator$1()}`;
|
|
628
|
-
`${keyGenerator$1()}`;
|
|
629
|
-
`${keyGenerator$1()}`;
|
|
630
|
-
`${keyGenerator$1()}`;
|
|
631
|
-
function isTypedObject(object) {
|
|
632
|
-
return isRecord$1(object) && typeof object._type == "string";
|
|
633
|
-
}
|
|
634
|
-
function isRecord$1(value) {
|
|
635
|
-
return !!value && (typeof value == "object" || typeof value == "function");
|
|
636
|
-
}
|
|
637
|
-
function isTextBlock(context, block) {
|
|
638
|
-
return !(!isTypedObject(block) || block._type !== context.schema.block.name || !Array.isArray(block.children));
|
|
639
|
-
}
|
|
640
|
-
function isSpan(context, child) {
|
|
641
|
-
return !(!isTypedObject(child) || child._type !== context.schema.span.name || typeof child.text != "string");
|
|
642
|
-
}
|
|
643
|
-
var _arrayPush, hasRequired_arrayPush;
|
|
644
|
-
function require_arrayPush() {
|
|
645
|
-
if (hasRequired_arrayPush) return _arrayPush;
|
|
646
|
-
hasRequired_arrayPush = 1;
|
|
647
|
-
function arrayPush(array, values) {
|
|
648
|
-
for (var index = -1, length2 = values.length, offset = array.length; ++index < length2; )
|
|
649
|
-
array[offset + index] = values[index];
|
|
650
|
-
return array;
|
|
651
|
-
}
|
|
652
|
-
return _arrayPush = arrayPush, _arrayPush;
|
|
653
|
-
}
|
|
654
|
-
var _freeGlobal, hasRequired_freeGlobal;
|
|
655
|
-
function require_freeGlobal() {
|
|
656
|
-
if (hasRequired_freeGlobal) return _freeGlobal;
|
|
657
|
-
hasRequired_freeGlobal = 1;
|
|
658
|
-
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
659
|
-
return _freeGlobal = freeGlobal, _freeGlobal;
|
|
660
|
-
}
|
|
661
|
-
var _root, hasRequired_root;
|
|
662
|
-
function require_root() {
|
|
663
|
-
if (hasRequired_root) return _root;
|
|
664
|
-
hasRequired_root = 1;
|
|
665
|
-
var freeGlobal = require_freeGlobal(), freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")();
|
|
666
|
-
return _root = root, _root;
|
|
667
|
-
}
|
|
668
|
-
var _Symbol, hasRequired_Symbol;
|
|
669
|
-
function require_Symbol() {
|
|
670
|
-
if (hasRequired_Symbol) return _Symbol;
|
|
671
|
-
hasRequired_Symbol = 1;
|
|
672
|
-
var root = require_root(), Symbol2 = root.Symbol;
|
|
673
|
-
return _Symbol = Symbol2, _Symbol;
|
|
674
|
-
}
|
|
675
|
-
var _getRawTag, hasRequired_getRawTag;
|
|
676
|
-
function require_getRawTag() {
|
|
677
|
-
if (hasRequired_getRawTag) return _getRawTag;
|
|
678
|
-
hasRequired_getRawTag = 1;
|
|
679
|
-
var Symbol2 = require_Symbol(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, nativeObjectToString = objectProto.toString, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
680
|
-
function getRawTag(value) {
|
|
681
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
682
|
-
try {
|
|
683
|
-
value[symToStringTag] = void 0;
|
|
684
|
-
var unmasked = !0;
|
|
685
|
-
} catch {
|
|
686
|
-
}
|
|
687
|
-
var result = nativeObjectToString.call(value);
|
|
688
|
-
return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result;
|
|
689
|
-
}
|
|
690
|
-
return _getRawTag = getRawTag, _getRawTag;
|
|
691
|
-
}
|
|
692
|
-
var _objectToString, hasRequired_objectToString;
|
|
693
|
-
function require_objectToString() {
|
|
694
|
-
if (hasRequired_objectToString) return _objectToString;
|
|
695
|
-
hasRequired_objectToString = 1;
|
|
696
|
-
var objectProto = Object.prototype, nativeObjectToString = objectProto.toString;
|
|
697
|
-
function objectToString2(value) {
|
|
698
|
-
return nativeObjectToString.call(value);
|
|
699
|
-
}
|
|
700
|
-
return _objectToString = objectToString2, _objectToString;
|
|
701
|
-
}
|
|
702
|
-
var _baseGetTag, hasRequired_baseGetTag;
|
|
703
|
-
function require_baseGetTag() {
|
|
704
|
-
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
705
|
-
hasRequired_baseGetTag = 1;
|
|
706
|
-
var Symbol2 = require_Symbol(), getRawTag = require_getRawTag(), objectToString2 = require_objectToString(), nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
707
|
-
function baseGetTag(value) {
|
|
708
|
-
return value == null ? value === void 0 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString2(value);
|
|
709
|
-
}
|
|
710
|
-
return _baseGetTag = baseGetTag, _baseGetTag;
|
|
711
|
-
}
|
|
712
|
-
var isObjectLike_1, hasRequiredIsObjectLike;
|
|
713
|
-
function requireIsObjectLike() {
|
|
714
|
-
if (hasRequiredIsObjectLike) return isObjectLike_1;
|
|
715
|
-
hasRequiredIsObjectLike = 1;
|
|
716
|
-
function isObjectLike(value) {
|
|
717
|
-
return value != null && typeof value == "object";
|
|
718
|
-
}
|
|
719
|
-
return isObjectLike_1 = isObjectLike, isObjectLike_1;
|
|
720
|
-
}
|
|
721
|
-
var _baseIsArguments, hasRequired_baseIsArguments;
|
|
722
|
-
function require_baseIsArguments() {
|
|
723
|
-
if (hasRequired_baseIsArguments) return _baseIsArguments;
|
|
724
|
-
hasRequired_baseIsArguments = 1;
|
|
725
|
-
var baseGetTag = require_baseGetTag(), isObjectLike = requireIsObjectLike(), argsTag = "[object Arguments]";
|
|
726
|
-
function baseIsArguments(value) {
|
|
727
|
-
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
728
|
-
}
|
|
729
|
-
return _baseIsArguments = baseIsArguments, _baseIsArguments;
|
|
730
|
-
}
|
|
731
|
-
var isArguments_1, hasRequiredIsArguments;
|
|
732
|
-
function requireIsArguments() {
|
|
733
|
-
if (hasRequiredIsArguments) return isArguments_1;
|
|
734
|
-
hasRequiredIsArguments = 1;
|
|
735
|
-
var baseIsArguments = require_baseIsArguments(), isObjectLike = requireIsObjectLike(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, propertyIsEnumerable = objectProto.propertyIsEnumerable, isArguments = baseIsArguments(/* @__PURE__ */ (function() {
|
|
736
|
-
return arguments;
|
|
737
|
-
})()) ? baseIsArguments : function(value) {
|
|
738
|
-
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
739
|
-
};
|
|
740
|
-
return isArguments_1 = isArguments, isArguments_1;
|
|
741
|
-
}
|
|
742
|
-
var isArray_1, hasRequiredIsArray;
|
|
743
|
-
function requireIsArray() {
|
|
744
|
-
if (hasRequiredIsArray) return isArray_1;
|
|
745
|
-
hasRequiredIsArray = 1;
|
|
746
|
-
var isArray = Array.isArray;
|
|
747
|
-
return isArray_1 = isArray, isArray_1;
|
|
748
|
-
}
|
|
749
|
-
var _isFlattenable, hasRequired_isFlattenable;
|
|
750
|
-
function require_isFlattenable() {
|
|
751
|
-
if (hasRequired_isFlattenable) return _isFlattenable;
|
|
752
|
-
hasRequired_isFlattenable = 1;
|
|
753
|
-
var Symbol2 = require_Symbol(), isArguments = requireIsArguments(), isArray = requireIsArray(), spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
|
|
754
|
-
function isFlattenable(value) {
|
|
755
|
-
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
756
|
-
}
|
|
757
|
-
return _isFlattenable = isFlattenable, _isFlattenable;
|
|
758
|
-
}
|
|
759
|
-
var _baseFlatten, hasRequired_baseFlatten;
|
|
760
|
-
function require_baseFlatten() {
|
|
761
|
-
if (hasRequired_baseFlatten) return _baseFlatten;
|
|
762
|
-
hasRequired_baseFlatten = 1;
|
|
763
|
-
var arrayPush = require_arrayPush(), isFlattenable = require_isFlattenable();
|
|
764
|
-
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
765
|
-
var index = -1, length2 = array.length;
|
|
766
|
-
for (predicate || (predicate = isFlattenable), result || (result = []); ++index < length2; ) {
|
|
767
|
-
var value = array[index];
|
|
768
|
-
depth > 0 && predicate(value) ? depth > 1 ? baseFlatten(value, depth - 1, predicate, isStrict, result) : arrayPush(result, value) : isStrict || (result[result.length] = value);
|
|
769
|
-
}
|
|
770
|
-
return result;
|
|
771
|
-
}
|
|
772
|
-
return _baseFlatten = baseFlatten, _baseFlatten;
|
|
773
|
-
}
|
|
774
|
-
var flatten_1, hasRequiredFlatten;
|
|
775
|
-
function requireFlatten() {
|
|
776
|
-
if (hasRequiredFlatten) return flatten_1;
|
|
777
|
-
hasRequiredFlatten = 1;
|
|
778
|
-
var baseFlatten = require_baseFlatten();
|
|
779
|
-
function flatten2(array) {
|
|
780
|
-
var length2 = array == null ? 0 : array.length;
|
|
781
|
-
return length2 ? baseFlatten(array, 1) : [];
|
|
782
|
-
}
|
|
783
|
-
return flatten_1 = flatten2, flatten_1;
|
|
784
|
-
}
|
|
785
|
-
var flattenExports = requireFlatten(), flatten = /* @__PURE__ */ getDefaultExportFromCjs(flattenExports), _listCacheClear, hasRequired_listCacheClear;
|
|
786
|
-
function require_listCacheClear() {
|
|
787
|
-
if (hasRequired_listCacheClear) return _listCacheClear;
|
|
788
|
-
hasRequired_listCacheClear = 1;
|
|
789
|
-
function listCacheClear() {
|
|
790
|
-
this.__data__ = [], this.size = 0;
|
|
791
|
-
}
|
|
792
|
-
return _listCacheClear = listCacheClear, _listCacheClear;
|
|
793
|
-
}
|
|
794
|
-
var eq_1, hasRequiredEq;
|
|
795
|
-
function requireEq() {
|
|
796
|
-
if (hasRequiredEq) return eq_1;
|
|
797
|
-
hasRequiredEq = 1;
|
|
798
|
-
function eq(value, other) {
|
|
799
|
-
return value === other || value !== value && other !== other;
|
|
800
|
-
}
|
|
801
|
-
return eq_1 = eq, eq_1;
|
|
802
|
-
}
|
|
803
|
-
var _assocIndexOf, hasRequired_assocIndexOf;
|
|
804
|
-
function require_assocIndexOf() {
|
|
805
|
-
if (hasRequired_assocIndexOf) return _assocIndexOf;
|
|
806
|
-
hasRequired_assocIndexOf = 1;
|
|
807
|
-
var eq = requireEq();
|
|
808
|
-
function assocIndexOf(array, key) {
|
|
809
|
-
for (var length2 = array.length; length2--; )
|
|
810
|
-
if (eq(array[length2][0], key))
|
|
811
|
-
return length2;
|
|
812
|
-
return -1;
|
|
813
|
-
}
|
|
814
|
-
return _assocIndexOf = assocIndexOf, _assocIndexOf;
|
|
815
|
-
}
|
|
816
|
-
var _listCacheDelete, hasRequired_listCacheDelete;
|
|
817
|
-
function require_listCacheDelete() {
|
|
818
|
-
if (hasRequired_listCacheDelete) return _listCacheDelete;
|
|
819
|
-
hasRequired_listCacheDelete = 1;
|
|
820
|
-
var assocIndexOf = require_assocIndexOf(), arrayProto = Array.prototype, splice = arrayProto.splice;
|
|
821
|
-
function listCacheDelete(key) {
|
|
822
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
823
|
-
if (index < 0)
|
|
824
|
-
return !1;
|
|
825
|
-
var lastIndex = data.length - 1;
|
|
826
|
-
return index == lastIndex ? data.pop() : splice.call(data, index, 1), --this.size, !0;
|
|
827
|
-
}
|
|
828
|
-
return _listCacheDelete = listCacheDelete, _listCacheDelete;
|
|
829
|
-
}
|
|
830
|
-
var _listCacheGet, hasRequired_listCacheGet;
|
|
831
|
-
function require_listCacheGet() {
|
|
832
|
-
if (hasRequired_listCacheGet) return _listCacheGet;
|
|
833
|
-
hasRequired_listCacheGet = 1;
|
|
834
|
-
var assocIndexOf = require_assocIndexOf();
|
|
835
|
-
function listCacheGet(key) {
|
|
836
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
837
|
-
return index < 0 ? void 0 : data[index][1];
|
|
838
|
-
}
|
|
839
|
-
return _listCacheGet = listCacheGet, _listCacheGet;
|
|
840
|
-
}
|
|
841
|
-
var _listCacheHas, hasRequired_listCacheHas;
|
|
842
|
-
function require_listCacheHas() {
|
|
843
|
-
if (hasRequired_listCacheHas) return _listCacheHas;
|
|
844
|
-
hasRequired_listCacheHas = 1;
|
|
845
|
-
var assocIndexOf = require_assocIndexOf();
|
|
846
|
-
function listCacheHas(key) {
|
|
847
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
848
|
-
}
|
|
849
|
-
return _listCacheHas = listCacheHas, _listCacheHas;
|
|
850
|
-
}
|
|
851
|
-
var _listCacheSet, hasRequired_listCacheSet;
|
|
852
|
-
function require_listCacheSet() {
|
|
853
|
-
if (hasRequired_listCacheSet) return _listCacheSet;
|
|
854
|
-
hasRequired_listCacheSet = 1;
|
|
855
|
-
var assocIndexOf = require_assocIndexOf();
|
|
856
|
-
function listCacheSet(key, value) {
|
|
857
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
858
|
-
return index < 0 ? (++this.size, data.push([key, value])) : data[index][1] = value, this;
|
|
859
|
-
}
|
|
860
|
-
return _listCacheSet = listCacheSet, _listCacheSet;
|
|
861
|
-
}
|
|
862
|
-
var _ListCache, hasRequired_ListCache;
|
|
863
|
-
function require_ListCache() {
|
|
864
|
-
if (hasRequired_ListCache) return _ListCache;
|
|
865
|
-
hasRequired_ListCache = 1;
|
|
866
|
-
var listCacheClear = require_listCacheClear(), listCacheDelete = require_listCacheDelete(), listCacheGet = require_listCacheGet(), listCacheHas = require_listCacheHas(), listCacheSet = require_listCacheSet();
|
|
867
|
-
function ListCache(entries) {
|
|
868
|
-
var index = -1, length2 = entries == null ? 0 : entries.length;
|
|
869
|
-
for (this.clear(); ++index < length2; ) {
|
|
870
|
-
var entry = entries[index];
|
|
871
|
-
this.set(entry[0], entry[1]);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
return ListCache.prototype.clear = listCacheClear, ListCache.prototype.delete = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet, _ListCache = ListCache, _ListCache;
|
|
875
|
-
}
|
|
876
|
-
var _stackClear, hasRequired_stackClear;
|
|
877
|
-
function require_stackClear() {
|
|
878
|
-
if (hasRequired_stackClear) return _stackClear;
|
|
879
|
-
hasRequired_stackClear = 1;
|
|
880
|
-
var ListCache = require_ListCache();
|
|
881
|
-
function stackClear() {
|
|
882
|
-
this.__data__ = new ListCache(), this.size = 0;
|
|
883
|
-
}
|
|
884
|
-
return _stackClear = stackClear, _stackClear;
|
|
885
|
-
}
|
|
886
|
-
var _stackDelete, hasRequired_stackDelete;
|
|
887
|
-
function require_stackDelete() {
|
|
888
|
-
if (hasRequired_stackDelete) return _stackDelete;
|
|
889
|
-
hasRequired_stackDelete = 1;
|
|
890
|
-
function stackDelete(key) {
|
|
891
|
-
var data = this.__data__, result = data.delete(key);
|
|
892
|
-
return this.size = data.size, result;
|
|
893
|
-
}
|
|
894
|
-
return _stackDelete = stackDelete, _stackDelete;
|
|
895
|
-
}
|
|
896
|
-
var _stackGet, hasRequired_stackGet;
|
|
897
|
-
function require_stackGet() {
|
|
898
|
-
if (hasRequired_stackGet) return _stackGet;
|
|
899
|
-
hasRequired_stackGet = 1;
|
|
900
|
-
function stackGet(key) {
|
|
901
|
-
return this.__data__.get(key);
|
|
902
|
-
}
|
|
903
|
-
return _stackGet = stackGet, _stackGet;
|
|
904
|
-
}
|
|
905
|
-
var _stackHas, hasRequired_stackHas;
|
|
906
|
-
function require_stackHas() {
|
|
907
|
-
if (hasRequired_stackHas) return _stackHas;
|
|
908
|
-
hasRequired_stackHas = 1;
|
|
909
|
-
function stackHas(key) {
|
|
910
|
-
return this.__data__.has(key);
|
|
911
|
-
}
|
|
912
|
-
return _stackHas = stackHas, _stackHas;
|
|
913
|
-
}
|
|
914
|
-
var isObject_1, hasRequiredIsObject;
|
|
915
|
-
function requireIsObject() {
|
|
916
|
-
if (hasRequiredIsObject) return isObject_1;
|
|
917
|
-
hasRequiredIsObject = 1;
|
|
918
|
-
function isObject(value) {
|
|
919
|
-
var type = typeof value;
|
|
920
|
-
return value != null && (type == "object" || type == "function");
|
|
921
|
-
}
|
|
922
|
-
return isObject_1 = isObject, isObject_1;
|
|
923
|
-
}
|
|
924
|
-
var isFunction_1, hasRequiredIsFunction;
|
|
925
|
-
function requireIsFunction() {
|
|
926
|
-
if (hasRequiredIsFunction) return isFunction_1;
|
|
927
|
-
hasRequiredIsFunction = 1;
|
|
928
|
-
var baseGetTag = require_baseGetTag(), isObject = requireIsObject(), asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
929
|
-
function isFunction(value) {
|
|
930
|
-
if (!isObject(value))
|
|
931
|
-
return !1;
|
|
932
|
-
var tag = baseGetTag(value);
|
|
933
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
934
|
-
}
|
|
935
|
-
return isFunction_1 = isFunction, isFunction_1;
|
|
936
|
-
}
|
|
937
|
-
var _coreJsData, hasRequired_coreJsData;
|
|
938
|
-
function require_coreJsData() {
|
|
939
|
-
if (hasRequired_coreJsData) return _coreJsData;
|
|
940
|
-
hasRequired_coreJsData = 1;
|
|
941
|
-
var root = require_root(), coreJsData = root["__core-js_shared__"];
|
|
942
|
-
return _coreJsData = coreJsData, _coreJsData;
|
|
943
|
-
}
|
|
944
|
-
var _isMasked, hasRequired_isMasked;
|
|
945
|
-
function require_isMasked() {
|
|
946
|
-
if (hasRequired_isMasked) return _isMasked;
|
|
947
|
-
hasRequired_isMasked = 1;
|
|
948
|
-
var coreJsData = require_coreJsData(), maskSrcKey = (function() {
|
|
949
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
950
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
951
|
-
})();
|
|
952
|
-
function isMasked(func) {
|
|
953
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
954
|
-
}
|
|
955
|
-
return _isMasked = isMasked, _isMasked;
|
|
956
|
-
}
|
|
957
|
-
var _toSource, hasRequired_toSource;
|
|
958
|
-
function require_toSource() {
|
|
959
|
-
if (hasRequired_toSource) return _toSource;
|
|
960
|
-
hasRequired_toSource = 1;
|
|
961
|
-
var funcProto = Function.prototype, funcToString = funcProto.toString;
|
|
962
|
-
function toSource(func) {
|
|
963
|
-
if (func != null) {
|
|
964
|
-
try {
|
|
965
|
-
return funcToString.call(func);
|
|
966
|
-
} catch {
|
|
967
|
-
}
|
|
968
|
-
try {
|
|
969
|
-
return func + "";
|
|
970
|
-
} catch {
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
return "";
|
|
974
|
-
}
|
|
975
|
-
return _toSource = toSource, _toSource;
|
|
976
|
-
}
|
|
977
|
-
var _baseIsNative, hasRequired_baseIsNative;
|
|
978
|
-
function require_baseIsNative() {
|
|
979
|
-
if (hasRequired_baseIsNative) return _baseIsNative;
|
|
980
|
-
hasRequired_baseIsNative = 1;
|
|
981
|
-
var isFunction = requireIsFunction(), isMasked = require_isMasked(), isObject = requireIsObject(), toSource = require_toSource(), reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, funcProto = Function.prototype, objectProto = Object.prototype, funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, reIsNative = RegExp(
|
|
982
|
-
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
983
|
-
);
|
|
984
|
-
function baseIsNative(value) {
|
|
985
|
-
if (!isObject(value) || isMasked(value))
|
|
986
|
-
return !1;
|
|
987
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
988
|
-
return pattern.test(toSource(value));
|
|
989
|
-
}
|
|
990
|
-
return _baseIsNative = baseIsNative, _baseIsNative;
|
|
991
|
-
}
|
|
992
|
-
var _getValue, hasRequired_getValue;
|
|
993
|
-
function require_getValue() {
|
|
994
|
-
if (hasRequired_getValue) return _getValue;
|
|
995
|
-
hasRequired_getValue = 1;
|
|
996
|
-
function getValue(object, key) {
|
|
997
|
-
return object?.[key];
|
|
998
|
-
}
|
|
999
|
-
return _getValue = getValue, _getValue;
|
|
1000
|
-
}
|
|
1001
|
-
var _getNative, hasRequired_getNative;
|
|
1002
|
-
function require_getNative() {
|
|
1003
|
-
if (hasRequired_getNative) return _getNative;
|
|
1004
|
-
hasRequired_getNative = 1;
|
|
1005
|
-
var baseIsNative = require_baseIsNative(), getValue = require_getValue();
|
|
1006
|
-
function getNative(object, key) {
|
|
1007
|
-
var value = getValue(object, key);
|
|
1008
|
-
return baseIsNative(value) ? value : void 0;
|
|
1009
|
-
}
|
|
1010
|
-
return _getNative = getNative, _getNative;
|
|
1011
|
-
}
|
|
1012
|
-
var _Map, hasRequired_Map;
|
|
1013
|
-
function require_Map() {
|
|
1014
|
-
if (hasRequired_Map) return _Map;
|
|
1015
|
-
hasRequired_Map = 1;
|
|
1016
|
-
var getNative = require_getNative(), root = require_root(), Map2 = getNative(root, "Map");
|
|
1017
|
-
return _Map = Map2, _Map;
|
|
1018
|
-
}
|
|
1019
|
-
var _nativeCreate, hasRequired_nativeCreate;
|
|
1020
|
-
function require_nativeCreate() {
|
|
1021
|
-
if (hasRequired_nativeCreate) return _nativeCreate;
|
|
1022
|
-
hasRequired_nativeCreate = 1;
|
|
1023
|
-
var getNative = require_getNative(), nativeCreate = getNative(Object, "create");
|
|
1024
|
-
return _nativeCreate = nativeCreate, _nativeCreate;
|
|
1025
|
-
}
|
|
1026
|
-
var _hashClear, hasRequired_hashClear;
|
|
1027
|
-
function require_hashClear() {
|
|
1028
|
-
if (hasRequired_hashClear) return _hashClear;
|
|
1029
|
-
hasRequired_hashClear = 1;
|
|
1030
|
-
var nativeCreate = require_nativeCreate();
|
|
1031
|
-
function hashClear() {
|
|
1032
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0;
|
|
1033
|
-
}
|
|
1034
|
-
return _hashClear = hashClear, _hashClear;
|
|
1035
|
-
}
|
|
1036
|
-
var _hashDelete, hasRequired_hashDelete;
|
|
1037
|
-
function require_hashDelete() {
|
|
1038
|
-
if (hasRequired_hashDelete) return _hashDelete;
|
|
1039
|
-
hasRequired_hashDelete = 1;
|
|
1040
|
-
function hashDelete(key) {
|
|
1041
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
1042
|
-
return this.size -= result ? 1 : 0, result;
|
|
1043
|
-
}
|
|
1044
|
-
return _hashDelete = hashDelete, _hashDelete;
|
|
1045
|
-
}
|
|
1046
|
-
var _hashGet, hasRequired_hashGet;
|
|
1047
|
-
function require_hashGet() {
|
|
1048
|
-
if (hasRequired_hashGet) return _hashGet;
|
|
1049
|
-
hasRequired_hashGet = 1;
|
|
1050
|
-
var nativeCreate = require_nativeCreate(), HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1051
|
-
function hashGet(key) {
|
|
1052
|
-
var data = this.__data__;
|
|
1053
|
-
if (nativeCreate) {
|
|
1054
|
-
var result = data[key];
|
|
1055
|
-
return result === HASH_UNDEFINED ? void 0 : result;
|
|
1056
|
-
}
|
|
1057
|
-
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
1058
|
-
}
|
|
1059
|
-
return _hashGet = hashGet, _hashGet;
|
|
1060
|
-
}
|
|
1061
|
-
var _hashHas, hasRequired_hashHas;
|
|
1062
|
-
function require_hashHas() {
|
|
1063
|
-
if (hasRequired_hashHas) return _hashHas;
|
|
1064
|
-
hasRequired_hashHas = 1;
|
|
1065
|
-
var nativeCreate = require_nativeCreate(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1066
|
-
function hashHas(key) {
|
|
1067
|
-
var data = this.__data__;
|
|
1068
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
1069
|
-
}
|
|
1070
|
-
return _hashHas = hashHas, _hashHas;
|
|
1071
|
-
}
|
|
1072
|
-
var _hashSet, hasRequired_hashSet;
|
|
1073
|
-
function require_hashSet() {
|
|
1074
|
-
if (hasRequired_hashSet) return _hashSet;
|
|
1075
|
-
hasRequired_hashSet = 1;
|
|
1076
|
-
var nativeCreate = require_nativeCreate(), HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1077
|
-
function hashSet(key, value) {
|
|
1078
|
-
var data = this.__data__;
|
|
1079
|
-
return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value, this;
|
|
1080
|
-
}
|
|
1081
|
-
return _hashSet = hashSet, _hashSet;
|
|
1082
|
-
}
|
|
1083
|
-
var _Hash, hasRequired_Hash;
|
|
1084
|
-
function require_Hash() {
|
|
1085
|
-
if (hasRequired_Hash) return _Hash;
|
|
1086
|
-
hasRequired_Hash = 1;
|
|
1087
|
-
var hashClear = require_hashClear(), hashDelete = require_hashDelete(), hashGet = require_hashGet(), hashHas = require_hashHas(), hashSet = require_hashSet();
|
|
1088
|
-
function Hash(entries) {
|
|
1089
|
-
var index = -1, length2 = entries == null ? 0 : entries.length;
|
|
1090
|
-
for (this.clear(); ++index < length2; ) {
|
|
1091
|
-
var entry = entries[index];
|
|
1092
|
-
this.set(entry[0], entry[1]);
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
return Hash.prototype.clear = hashClear, Hash.prototype.delete = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet, _Hash = Hash, _Hash;
|
|
1096
|
-
}
|
|
1097
|
-
var _mapCacheClear, hasRequired_mapCacheClear;
|
|
1098
|
-
function require_mapCacheClear() {
|
|
1099
|
-
if (hasRequired_mapCacheClear) return _mapCacheClear;
|
|
1100
|
-
hasRequired_mapCacheClear = 1;
|
|
1101
|
-
var Hash = require_Hash(), ListCache = require_ListCache(), Map2 = require_Map();
|
|
1102
|
-
function mapCacheClear() {
|
|
1103
|
-
this.size = 0, this.__data__ = {
|
|
1104
|
-
hash: new Hash(),
|
|
1105
|
-
map: new (Map2 || ListCache)(),
|
|
1106
|
-
string: new Hash()
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
return _mapCacheClear = mapCacheClear, _mapCacheClear;
|
|
1110
|
-
}
|
|
1111
|
-
var _isKeyable, hasRequired_isKeyable;
|
|
1112
|
-
function require_isKeyable() {
|
|
1113
|
-
if (hasRequired_isKeyable) return _isKeyable;
|
|
1114
|
-
hasRequired_isKeyable = 1;
|
|
1115
|
-
function isKeyable(value) {
|
|
1116
|
-
var type = typeof value;
|
|
1117
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
1118
|
-
}
|
|
1119
|
-
return _isKeyable = isKeyable, _isKeyable;
|
|
1120
|
-
}
|
|
1121
|
-
var _getMapData, hasRequired_getMapData;
|
|
1122
|
-
function require_getMapData() {
|
|
1123
|
-
if (hasRequired_getMapData) return _getMapData;
|
|
1124
|
-
hasRequired_getMapData = 1;
|
|
1125
|
-
var isKeyable = require_isKeyable();
|
|
1126
|
-
function getMapData(map, key) {
|
|
1127
|
-
var data = map.__data__;
|
|
1128
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
1129
|
-
}
|
|
1130
|
-
return _getMapData = getMapData, _getMapData;
|
|
1131
|
-
}
|
|
1132
|
-
var _mapCacheDelete, hasRequired_mapCacheDelete;
|
|
1133
|
-
function require_mapCacheDelete() {
|
|
1134
|
-
if (hasRequired_mapCacheDelete) return _mapCacheDelete;
|
|
1135
|
-
hasRequired_mapCacheDelete = 1;
|
|
1136
|
-
var getMapData = require_getMapData();
|
|
1137
|
-
function mapCacheDelete(key) {
|
|
1138
|
-
var result = getMapData(this, key).delete(key);
|
|
1139
|
-
return this.size -= result ? 1 : 0, result;
|
|
1140
|
-
}
|
|
1141
|
-
return _mapCacheDelete = mapCacheDelete, _mapCacheDelete;
|
|
1142
|
-
}
|
|
1143
|
-
var _mapCacheGet, hasRequired_mapCacheGet;
|
|
1144
|
-
function require_mapCacheGet() {
|
|
1145
|
-
if (hasRequired_mapCacheGet) return _mapCacheGet;
|
|
1146
|
-
hasRequired_mapCacheGet = 1;
|
|
1147
|
-
var getMapData = require_getMapData();
|
|
1148
|
-
function mapCacheGet(key) {
|
|
1149
|
-
return getMapData(this, key).get(key);
|
|
1150
|
-
}
|
|
1151
|
-
return _mapCacheGet = mapCacheGet, _mapCacheGet;
|
|
1152
|
-
}
|
|
1153
|
-
var _mapCacheHas, hasRequired_mapCacheHas;
|
|
1154
|
-
function require_mapCacheHas() {
|
|
1155
|
-
if (hasRequired_mapCacheHas) return _mapCacheHas;
|
|
1156
|
-
hasRequired_mapCacheHas = 1;
|
|
1157
|
-
var getMapData = require_getMapData();
|
|
1158
|
-
function mapCacheHas(key) {
|
|
1159
|
-
return getMapData(this, key).has(key);
|
|
1160
|
-
}
|
|
1161
|
-
return _mapCacheHas = mapCacheHas, _mapCacheHas;
|
|
1162
|
-
}
|
|
1163
|
-
var _mapCacheSet, hasRequired_mapCacheSet;
|
|
1164
|
-
function require_mapCacheSet() {
|
|
1165
|
-
if (hasRequired_mapCacheSet) return _mapCacheSet;
|
|
1166
|
-
hasRequired_mapCacheSet = 1;
|
|
1167
|
-
var getMapData = require_getMapData();
|
|
1168
|
-
function mapCacheSet(key, value) {
|
|
1169
|
-
var data = getMapData(this, key), size = data.size;
|
|
1170
|
-
return data.set(key, value), this.size += data.size == size ? 0 : 1, this;
|
|
1171
|
-
}
|
|
1172
|
-
return _mapCacheSet = mapCacheSet, _mapCacheSet;
|
|
1173
|
-
}
|
|
1174
|
-
var _MapCache, hasRequired_MapCache;
|
|
1175
|
-
function require_MapCache() {
|
|
1176
|
-
if (hasRequired_MapCache) return _MapCache;
|
|
1177
|
-
hasRequired_MapCache = 1;
|
|
1178
|
-
var mapCacheClear = require_mapCacheClear(), mapCacheDelete = require_mapCacheDelete(), mapCacheGet = require_mapCacheGet(), mapCacheHas = require_mapCacheHas(), mapCacheSet = require_mapCacheSet();
|
|
1179
|
-
function MapCache(entries) {
|
|
1180
|
-
var index = -1, length2 = entries == null ? 0 : entries.length;
|
|
1181
|
-
for (this.clear(); ++index < length2; ) {
|
|
1182
|
-
var entry = entries[index];
|
|
1183
|
-
this.set(entry[0], entry[1]);
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
return MapCache.prototype.clear = mapCacheClear, MapCache.prototype.delete = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet, _MapCache = MapCache, _MapCache;
|
|
1187
|
-
}
|
|
1188
|
-
var _stackSet, hasRequired_stackSet;
|
|
1189
|
-
function require_stackSet() {
|
|
1190
|
-
if (hasRequired_stackSet) return _stackSet;
|
|
1191
|
-
hasRequired_stackSet = 1;
|
|
1192
|
-
var ListCache = require_ListCache(), Map2 = require_Map(), MapCache = require_MapCache(), LARGE_ARRAY_SIZE = 200;
|
|
1193
|
-
function stackSet(key, value) {
|
|
1194
|
-
var data = this.__data__;
|
|
1195
|
-
if (data instanceof ListCache) {
|
|
1196
|
-
var pairs = data.__data__;
|
|
1197
|
-
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1)
|
|
1198
|
-
return pairs.push([key, value]), this.size = ++data.size, this;
|
|
1199
|
-
data = this.__data__ = new MapCache(pairs);
|
|
1200
|
-
}
|
|
1201
|
-
return data.set(key, value), this.size = data.size, this;
|
|
1202
|
-
}
|
|
1203
|
-
return _stackSet = stackSet, _stackSet;
|
|
1204
|
-
}
|
|
1205
|
-
var _Stack, hasRequired_Stack;
|
|
1206
|
-
function require_Stack() {
|
|
1207
|
-
if (hasRequired_Stack) return _Stack;
|
|
1208
|
-
hasRequired_Stack = 1;
|
|
1209
|
-
var ListCache = require_ListCache(), stackClear = require_stackClear(), stackDelete = require_stackDelete(), stackGet = require_stackGet(), stackHas = require_stackHas(), stackSet = require_stackSet();
|
|
1210
|
-
function Stack(entries) {
|
|
1211
|
-
var data = this.__data__ = new ListCache(entries);
|
|
1212
|
-
this.size = data.size;
|
|
1213
|
-
}
|
|
1214
|
-
return Stack.prototype.clear = stackClear, Stack.prototype.delete = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet, _Stack = Stack, _Stack;
|
|
1215
|
-
}
|
|
1216
|
-
var _setCacheAdd, hasRequired_setCacheAdd;
|
|
1217
|
-
function require_setCacheAdd() {
|
|
1218
|
-
if (hasRequired_setCacheAdd) return _setCacheAdd;
|
|
1219
|
-
hasRequired_setCacheAdd = 1;
|
|
1220
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1221
|
-
function setCacheAdd(value) {
|
|
1222
|
-
return this.__data__.set(value, HASH_UNDEFINED), this;
|
|
1223
|
-
}
|
|
1224
|
-
return _setCacheAdd = setCacheAdd, _setCacheAdd;
|
|
1225
|
-
}
|
|
1226
|
-
var _setCacheHas, hasRequired_setCacheHas;
|
|
1227
|
-
function require_setCacheHas() {
|
|
1228
|
-
if (hasRequired_setCacheHas) return _setCacheHas;
|
|
1229
|
-
hasRequired_setCacheHas = 1;
|
|
1230
|
-
function setCacheHas(value) {
|
|
1231
|
-
return this.__data__.has(value);
|
|
1232
|
-
}
|
|
1233
|
-
return _setCacheHas = setCacheHas, _setCacheHas;
|
|
1234
|
-
}
|
|
1235
|
-
var _SetCache, hasRequired_SetCache;
|
|
1236
|
-
function require_SetCache() {
|
|
1237
|
-
if (hasRequired_SetCache) return _SetCache;
|
|
1238
|
-
hasRequired_SetCache = 1;
|
|
1239
|
-
var MapCache = require_MapCache(), setCacheAdd = require_setCacheAdd(), setCacheHas = require_setCacheHas();
|
|
1240
|
-
function SetCache(values) {
|
|
1241
|
-
var index = -1, length2 = values == null ? 0 : values.length;
|
|
1242
|
-
for (this.__data__ = new MapCache(); ++index < length2; )
|
|
1243
|
-
this.add(values[index]);
|
|
1244
|
-
}
|
|
1245
|
-
return SetCache.prototype.add = SetCache.prototype.push = setCacheAdd, SetCache.prototype.has = setCacheHas, _SetCache = SetCache, _SetCache;
|
|
1246
|
-
}
|
|
1247
|
-
var _arraySome, hasRequired_arraySome;
|
|
1248
|
-
function require_arraySome() {
|
|
1249
|
-
if (hasRequired_arraySome) return _arraySome;
|
|
1250
|
-
hasRequired_arraySome = 1;
|
|
1251
|
-
function arraySome(array, predicate) {
|
|
1252
|
-
for (var index = -1, length2 = array == null ? 0 : array.length; ++index < length2; )
|
|
1253
|
-
if (predicate(array[index], index, array))
|
|
1254
|
-
return !0;
|
|
1255
|
-
return !1;
|
|
1256
|
-
}
|
|
1257
|
-
return _arraySome = arraySome, _arraySome;
|
|
1258
|
-
}
|
|
1259
|
-
var _cacheHas, hasRequired_cacheHas;
|
|
1260
|
-
function require_cacheHas() {
|
|
1261
|
-
if (hasRequired_cacheHas) return _cacheHas;
|
|
1262
|
-
hasRequired_cacheHas = 1;
|
|
1263
|
-
function cacheHas(cache, key) {
|
|
1264
|
-
return cache.has(key);
|
|
1265
|
-
}
|
|
1266
|
-
return _cacheHas = cacheHas, _cacheHas;
|
|
1267
|
-
}
|
|
1268
|
-
var _equalArrays, hasRequired_equalArrays;
|
|
1269
|
-
function require_equalArrays() {
|
|
1270
|
-
if (hasRequired_equalArrays) return _equalArrays;
|
|
1271
|
-
hasRequired_equalArrays = 1;
|
|
1272
|
-
var SetCache = require_SetCache(), arraySome = require_arraySome(), cacheHas = require_cacheHas(), COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
1273
|
-
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1274
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
1275
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength))
|
|
1276
|
-
return !1;
|
|
1277
|
-
var arrStacked = stack.get(array), othStacked = stack.get(other);
|
|
1278
|
-
if (arrStacked && othStacked)
|
|
1279
|
-
return arrStacked == other && othStacked == array;
|
|
1280
|
-
var index = -1, result = !0, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
|
|
1281
|
-
for (stack.set(array, other), stack.set(other, array); ++index < arrLength; ) {
|
|
1282
|
-
var arrValue = array[index], othValue = other[index];
|
|
1283
|
-
if (customizer)
|
|
1284
|
-
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
1285
|
-
if (compared !== void 0) {
|
|
1286
|
-
if (compared)
|
|
1287
|
-
continue;
|
|
1288
|
-
result = !1;
|
|
1289
|
-
break;
|
|
1290
|
-
}
|
|
1291
|
-
if (seen) {
|
|
1292
|
-
if (!arraySome(other, function(othValue2, othIndex) {
|
|
1293
|
-
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack)))
|
|
1294
|
-
return seen.push(othIndex);
|
|
1295
|
-
})) {
|
|
1296
|
-
result = !1;
|
|
1297
|
-
break;
|
|
1298
|
-
}
|
|
1299
|
-
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1300
|
-
result = !1;
|
|
1301
|
-
break;
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
return stack.delete(array), stack.delete(other), result;
|
|
1305
|
-
}
|
|
1306
|
-
return _equalArrays = equalArrays, _equalArrays;
|
|
1307
|
-
}
|
|
1308
|
-
var _Uint8Array, hasRequired_Uint8Array;
|
|
1309
|
-
function require_Uint8Array() {
|
|
1310
|
-
if (hasRequired_Uint8Array) return _Uint8Array;
|
|
1311
|
-
hasRequired_Uint8Array = 1;
|
|
1312
|
-
var root = require_root(), Uint8Array2 = root.Uint8Array;
|
|
1313
|
-
return _Uint8Array = Uint8Array2, _Uint8Array;
|
|
1314
|
-
}
|
|
1315
|
-
var _mapToArray, hasRequired_mapToArray;
|
|
1316
|
-
function require_mapToArray() {
|
|
1317
|
-
if (hasRequired_mapToArray) return _mapToArray;
|
|
1318
|
-
hasRequired_mapToArray = 1;
|
|
1319
|
-
function mapToArray(map) {
|
|
1320
|
-
var index = -1, result = Array(map.size);
|
|
1321
|
-
return map.forEach(function(value, key) {
|
|
1322
|
-
result[++index] = [key, value];
|
|
1323
|
-
}), result;
|
|
1324
|
-
}
|
|
1325
|
-
return _mapToArray = mapToArray, _mapToArray;
|
|
1326
|
-
}
|
|
1327
|
-
var _setToArray, hasRequired_setToArray;
|
|
1328
|
-
function require_setToArray() {
|
|
1329
|
-
if (hasRequired_setToArray) return _setToArray;
|
|
1330
|
-
hasRequired_setToArray = 1;
|
|
1331
|
-
function setToArray(set) {
|
|
1332
|
-
var index = -1, result = Array(set.size);
|
|
1333
|
-
return set.forEach(function(value) {
|
|
1334
|
-
result[++index] = value;
|
|
1335
|
-
}), result;
|
|
1336
|
-
}
|
|
1337
|
-
return _setToArray = setToArray, _setToArray;
|
|
1338
|
-
}
|
|
1339
|
-
var _equalByTag, hasRequired_equalByTag;
|
|
1340
|
-
function require_equalByTag() {
|
|
1341
|
-
if (hasRequired_equalByTag) return _equalByTag;
|
|
1342
|
-
hasRequired_equalByTag = 1;
|
|
1343
|
-
var Symbol2 = require_Symbol(), Uint8Array2 = require_Uint8Array(), eq = requireEq(), equalArrays = require_equalArrays(), mapToArray = require_mapToArray(), setToArray = require_setToArray(), COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2, 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]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
1344
|
-
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1345
|
-
switch (tag) {
|
|
1346
|
-
case dataViewTag:
|
|
1347
|
-
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset)
|
|
1348
|
-
return !1;
|
|
1349
|
-
object = object.buffer, other = other.buffer;
|
|
1350
|
-
case arrayBufferTag:
|
|
1351
|
-
return !(object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other)));
|
|
1352
|
-
case boolTag:
|
|
1353
|
-
case dateTag:
|
|
1354
|
-
case numberTag:
|
|
1355
|
-
return eq(+object, +other);
|
|
1356
|
-
case errorTag:
|
|
1357
|
-
return object.name == other.name && object.message == other.message;
|
|
1358
|
-
case regexpTag:
|
|
1359
|
-
case stringTag:
|
|
1360
|
-
return object == other + "";
|
|
1361
|
-
case mapTag:
|
|
1362
|
-
var convert = mapToArray;
|
|
1363
|
-
case setTag:
|
|
1364
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
1365
|
-
if (convert || (convert = setToArray), object.size != other.size && !isPartial)
|
|
1366
|
-
return !1;
|
|
1367
|
-
var stacked = stack.get(object);
|
|
1368
|
-
if (stacked)
|
|
1369
|
-
return stacked == other;
|
|
1370
|
-
bitmask |= COMPARE_UNORDERED_FLAG, stack.set(object, other);
|
|
1371
|
-
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
1372
|
-
return stack.delete(object), result;
|
|
1373
|
-
case symbolTag:
|
|
1374
|
-
if (symbolValueOf)
|
|
1375
|
-
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
1376
|
-
}
|
|
1377
|
-
return !1;
|
|
1378
|
-
}
|
|
1379
|
-
return _equalByTag = equalByTag, _equalByTag;
|
|
1380
|
-
}
|
|
1381
|
-
var _baseGetAllKeys, hasRequired_baseGetAllKeys;
|
|
1382
|
-
function require_baseGetAllKeys() {
|
|
1383
|
-
if (hasRequired_baseGetAllKeys) return _baseGetAllKeys;
|
|
1384
|
-
hasRequired_baseGetAllKeys = 1;
|
|
1385
|
-
var arrayPush = require_arrayPush(), isArray = requireIsArray();
|
|
1386
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1387
|
-
var result = keysFunc(object);
|
|
1388
|
-
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
1389
|
-
}
|
|
1390
|
-
return _baseGetAllKeys = baseGetAllKeys, _baseGetAllKeys;
|
|
1391
|
-
}
|
|
1392
|
-
var _arrayFilter, hasRequired_arrayFilter;
|
|
1393
|
-
function require_arrayFilter() {
|
|
1394
|
-
if (hasRequired_arrayFilter) return _arrayFilter;
|
|
1395
|
-
hasRequired_arrayFilter = 1;
|
|
1396
|
-
function arrayFilter(array, predicate) {
|
|
1397
|
-
for (var index = -1, length2 = array == null ? 0 : array.length, resIndex = 0, result = []; ++index < length2; ) {
|
|
1398
|
-
var value = array[index];
|
|
1399
|
-
predicate(value, index, array) && (result[resIndex++] = value);
|
|
1400
|
-
}
|
|
1401
|
-
return result;
|
|
1402
|
-
}
|
|
1403
|
-
return _arrayFilter = arrayFilter, _arrayFilter;
|
|
1404
|
-
}
|
|
1405
|
-
var stubArray_1, hasRequiredStubArray;
|
|
1406
|
-
function requireStubArray() {
|
|
1407
|
-
if (hasRequiredStubArray) return stubArray_1;
|
|
1408
|
-
hasRequiredStubArray = 1;
|
|
1409
|
-
function stubArray() {
|
|
1410
|
-
return [];
|
|
1411
|
-
}
|
|
1412
|
-
return stubArray_1 = stubArray, stubArray_1;
|
|
1413
|
-
}
|
|
1414
|
-
var _getSymbols, hasRequired_getSymbols;
|
|
1415
|
-
function require_getSymbols() {
|
|
1416
|
-
if (hasRequired_getSymbols) return _getSymbols;
|
|
1417
|
-
hasRequired_getSymbols = 1;
|
|
1418
|
-
var arrayFilter = require_arrayFilter(), stubArray = requireStubArray(), objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable, nativeGetSymbols = Object.getOwnPropertySymbols, getSymbols = nativeGetSymbols ? function(object) {
|
|
1419
|
-
return object == null ? [] : (object = Object(object), arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
1420
|
-
return propertyIsEnumerable.call(object, symbol);
|
|
1421
|
-
}));
|
|
1422
|
-
} : stubArray;
|
|
1423
|
-
return _getSymbols = getSymbols, _getSymbols;
|
|
1424
|
-
}
|
|
1425
|
-
var _baseTimes, hasRequired_baseTimes;
|
|
1426
|
-
function require_baseTimes() {
|
|
1427
|
-
if (hasRequired_baseTimes) return _baseTimes;
|
|
1428
|
-
hasRequired_baseTimes = 1;
|
|
1429
|
-
function baseTimes(n, iteratee) {
|
|
1430
|
-
for (var index = -1, result = Array(n); ++index < n; )
|
|
1431
|
-
result[index] = iteratee(index);
|
|
1432
|
-
return result;
|
|
1433
|
-
}
|
|
1434
|
-
return _baseTimes = baseTimes, _baseTimes;
|
|
1435
|
-
}
|
|
1436
|
-
var isBuffer = { exports: {} }, stubFalse_1, hasRequiredStubFalse;
|
|
1437
|
-
function requireStubFalse() {
|
|
1438
|
-
if (hasRequiredStubFalse) return stubFalse_1;
|
|
1439
|
-
hasRequiredStubFalse = 1;
|
|
1440
|
-
function stubFalse() {
|
|
1441
|
-
return !1;
|
|
1442
|
-
}
|
|
1443
|
-
return stubFalse_1 = stubFalse, stubFalse_1;
|
|
1444
|
-
}
|
|
1445
|
-
var hasRequiredIsBuffer;
|
|
1446
|
-
function requireIsBuffer() {
|
|
1447
|
-
return hasRequiredIsBuffer || (hasRequiredIsBuffer = 1, (function(module2, exports2) {
|
|
1448
|
-
var root = require_root(), stubFalse = requireStubFalse(), freeExports = exports2 && !exports2.nodeType && exports2, freeModule = freeExports && !0 && module2 && !module2.nodeType && module2, moduleExports = freeModule && freeModule.exports === freeExports, Buffer = moduleExports ? root.Buffer : void 0, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, isBuffer2 = nativeIsBuffer || stubFalse;
|
|
1449
|
-
module2.exports = isBuffer2;
|
|
1450
|
-
})(isBuffer, isBuffer.exports)), isBuffer.exports;
|
|
1451
|
-
}
|
|
1452
|
-
var _isIndex, hasRequired_isIndex;
|
|
1453
|
-
function require_isIndex() {
|
|
1454
|
-
if (hasRequired_isIndex) return _isIndex;
|
|
1455
|
-
hasRequired_isIndex = 1;
|
|
1456
|
-
var MAX_SAFE_INTEGER = 9007199254740991, reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
1457
|
-
function isIndex(value, length2) {
|
|
1458
|
-
var type = typeof value;
|
|
1459
|
-
return length2 = length2 ?? MAX_SAFE_INTEGER, !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length2;
|
|
1460
|
-
}
|
|
1461
|
-
return _isIndex = isIndex, _isIndex;
|
|
1462
|
-
}
|
|
1463
|
-
var isLength_1, hasRequiredIsLength;
|
|
1464
|
-
function requireIsLength() {
|
|
1465
|
-
if (hasRequiredIsLength) return isLength_1;
|
|
1466
|
-
hasRequiredIsLength = 1;
|
|
1467
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
1468
|
-
function isLength(value) {
|
|
1469
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1470
|
-
}
|
|
1471
|
-
return isLength_1 = isLength, isLength_1;
|
|
1472
|
-
}
|
|
1473
|
-
var _baseIsTypedArray, hasRequired_baseIsTypedArray;
|
|
1474
|
-
function require_baseIsTypedArray() {
|
|
1475
|
-
if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
|
|
1476
|
-
hasRequired_baseIsTypedArray = 1;
|
|
1477
|
-
var baseGetTag = require_baseGetTag(), isLength = requireIsLength(), isObjectLike = requireIsObjectLike(), 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]", 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]", typedArrayTags = {};
|
|
1478
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = !0, 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] = !1;
|
|
1479
|
-
function baseIsTypedArray(value) {
|
|
1480
|
-
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
1481
|
-
}
|
|
1482
|
-
return _baseIsTypedArray = baseIsTypedArray, _baseIsTypedArray;
|
|
1483
|
-
}
|
|
1484
|
-
var _baseUnary, hasRequired_baseUnary;
|
|
1485
|
-
function require_baseUnary() {
|
|
1486
|
-
if (hasRequired_baseUnary) return _baseUnary;
|
|
1487
|
-
hasRequired_baseUnary = 1;
|
|
1488
|
-
function baseUnary(func) {
|
|
1489
|
-
return function(value) {
|
|
1490
|
-
return func(value);
|
|
1491
|
-
};
|
|
1492
|
-
}
|
|
1493
|
-
return _baseUnary = baseUnary, _baseUnary;
|
|
1494
|
-
}
|
|
1495
|
-
var _nodeUtil = { exports: {} }, hasRequired_nodeUtil;
|
|
1496
|
-
function require_nodeUtil() {
|
|
1497
|
-
return hasRequired_nodeUtil || (hasRequired_nodeUtil = 1, (function(module2, exports2) {
|
|
1498
|
-
var freeGlobal = require_freeGlobal(), freeExports = exports2 && !exports2.nodeType && exports2, freeModule = freeExports && !0 && module2 && !module2.nodeType && module2, moduleExports = freeModule && freeModule.exports === freeExports, freeProcess = moduleExports && freeGlobal.process, nodeUtil = (function() {
|
|
1499
|
-
try {
|
|
1500
|
-
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
1501
|
-
return types || freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
1502
|
-
} catch {
|
|
1503
|
-
}
|
|
1504
|
-
})();
|
|
1505
|
-
module2.exports = nodeUtil;
|
|
1506
|
-
})(_nodeUtil, _nodeUtil.exports)), _nodeUtil.exports;
|
|
1507
|
-
}
|
|
1508
|
-
var isTypedArray_1, hasRequiredIsTypedArray;
|
|
1509
|
-
function requireIsTypedArray() {
|
|
1510
|
-
if (hasRequiredIsTypedArray) return isTypedArray_1;
|
|
1511
|
-
hasRequiredIsTypedArray = 1;
|
|
1512
|
-
var baseIsTypedArray = require_baseIsTypedArray(), baseUnary = require_baseUnary(), nodeUtil = require_nodeUtil(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1513
|
-
return isTypedArray_1 = isTypedArray, isTypedArray_1;
|
|
1514
|
-
}
|
|
1515
|
-
var _arrayLikeKeys, hasRequired_arrayLikeKeys;
|
|
1516
|
-
function require_arrayLikeKeys() {
|
|
1517
|
-
if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
|
|
1518
|
-
hasRequired_arrayLikeKeys = 1;
|
|
1519
|
-
var baseTimes = require_baseTimes(), isArguments = requireIsArguments(), isArray = requireIsArray(), isBuffer2 = requireIsBuffer(), isIndex = require_isIndex(), isTypedArray = requireIsTypedArray(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1520
|
-
function arrayLikeKeys(value, inherited) {
|
|
1521
|
-
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) : [], length2 = result.length;
|
|
1522
|
-
for (var key in value)
|
|
1523
|
-
(inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1524
|
-
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1525
|
-
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1526
|
-
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
1527
|
-
isIndex(key, length2))) && result.push(key);
|
|
1528
|
-
return result;
|
|
1529
|
-
}
|
|
1530
|
-
return _arrayLikeKeys = arrayLikeKeys, _arrayLikeKeys;
|
|
1531
|
-
}
|
|
1532
|
-
var _isPrototype, hasRequired_isPrototype;
|
|
1533
|
-
function require_isPrototype() {
|
|
1534
|
-
if (hasRequired_isPrototype) return _isPrototype;
|
|
1535
|
-
hasRequired_isPrototype = 1;
|
|
1536
|
-
var objectProto = Object.prototype;
|
|
1537
|
-
function isPrototype(value) {
|
|
1538
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
1539
|
-
return value === proto;
|
|
1540
|
-
}
|
|
1541
|
-
return _isPrototype = isPrototype, _isPrototype;
|
|
1542
|
-
}
|
|
1543
|
-
var _overArg, hasRequired_overArg;
|
|
1544
|
-
function require_overArg() {
|
|
1545
|
-
if (hasRequired_overArg) return _overArg;
|
|
1546
|
-
hasRequired_overArg = 1;
|
|
1547
|
-
function overArg(func, transform) {
|
|
1548
|
-
return function(arg) {
|
|
1549
|
-
return func(transform(arg));
|
|
1550
|
-
};
|
|
1551
|
-
}
|
|
1552
|
-
return _overArg = overArg, _overArg;
|
|
1553
|
-
}
|
|
1554
|
-
var _nativeKeys, hasRequired_nativeKeys;
|
|
1555
|
-
function require_nativeKeys() {
|
|
1556
|
-
if (hasRequired_nativeKeys) return _nativeKeys;
|
|
1557
|
-
hasRequired_nativeKeys = 1;
|
|
1558
|
-
var overArg = require_overArg(), nativeKeys = overArg(Object.keys, Object);
|
|
1559
|
-
return _nativeKeys = nativeKeys, _nativeKeys;
|
|
1560
|
-
}
|
|
1561
|
-
var _baseKeys, hasRequired_baseKeys;
|
|
1562
|
-
function require_baseKeys() {
|
|
1563
|
-
if (hasRequired_baseKeys) return _baseKeys;
|
|
1564
|
-
hasRequired_baseKeys = 1;
|
|
1565
|
-
var isPrototype = require_isPrototype(), nativeKeys = require_nativeKeys(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1566
|
-
function baseKeys(object) {
|
|
1567
|
-
if (!isPrototype(object))
|
|
1568
|
-
return nativeKeys(object);
|
|
1569
|
-
var result = [];
|
|
1570
|
-
for (var key in Object(object))
|
|
1571
|
-
hasOwnProperty.call(object, key) && key != "constructor" && result.push(key);
|
|
1572
|
-
return result;
|
|
1573
|
-
}
|
|
1574
|
-
return _baseKeys = baseKeys, _baseKeys;
|
|
1575
|
-
}
|
|
1576
|
-
var isArrayLike_1, hasRequiredIsArrayLike;
|
|
1577
|
-
function requireIsArrayLike() {
|
|
1578
|
-
if (hasRequiredIsArrayLike) return isArrayLike_1;
|
|
1579
|
-
hasRequiredIsArrayLike = 1;
|
|
1580
|
-
var isFunction = requireIsFunction(), isLength = requireIsLength();
|
|
1581
|
-
function isArrayLike(value) {
|
|
1582
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
1583
|
-
}
|
|
1584
|
-
return isArrayLike_1 = isArrayLike, isArrayLike_1;
|
|
1585
|
-
}
|
|
1586
|
-
var keys_1, hasRequiredKeys;
|
|
1587
|
-
function requireKeys() {
|
|
1588
|
-
if (hasRequiredKeys) return keys_1;
|
|
1589
|
-
hasRequiredKeys = 1;
|
|
1590
|
-
var arrayLikeKeys = require_arrayLikeKeys(), baseKeys = require_baseKeys(), isArrayLike = requireIsArrayLike();
|
|
1591
|
-
function keys(object) {
|
|
1592
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
1593
|
-
}
|
|
1594
|
-
return keys_1 = keys, keys_1;
|
|
1595
|
-
}
|
|
1596
|
-
var _getAllKeys, hasRequired_getAllKeys;
|
|
1597
|
-
function require_getAllKeys() {
|
|
1598
|
-
if (hasRequired_getAllKeys) return _getAllKeys;
|
|
1599
|
-
hasRequired_getAllKeys = 1;
|
|
1600
|
-
var baseGetAllKeys = require_baseGetAllKeys(), getSymbols = require_getSymbols(), keys = requireKeys();
|
|
1601
|
-
function getAllKeys(object) {
|
|
1602
|
-
return baseGetAllKeys(object, keys, getSymbols);
|
|
1603
|
-
}
|
|
1604
|
-
return _getAllKeys = getAllKeys, _getAllKeys;
|
|
1605
|
-
}
|
|
1606
|
-
var _equalObjects, hasRequired_equalObjects;
|
|
1607
|
-
function require_equalObjects() {
|
|
1608
|
-
if (hasRequired_equalObjects) return _equalObjects;
|
|
1609
|
-
hasRequired_equalObjects = 1;
|
|
1610
|
-
var getAllKeys = require_getAllKeys(), COMPARE_PARTIAL_FLAG = 1, objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1611
|
-
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1612
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
1613
|
-
if (objLength != othLength && !isPartial)
|
|
1614
|
-
return !1;
|
|
1615
|
-
for (var index = objLength; index--; ) {
|
|
1616
|
-
var key = objProps[index];
|
|
1617
|
-
if (!(isPartial ? key in other : hasOwnProperty.call(other, key)))
|
|
1618
|
-
return !1;
|
|
1619
|
-
}
|
|
1620
|
-
var objStacked = stack.get(object), othStacked = stack.get(other);
|
|
1621
|
-
if (objStacked && othStacked)
|
|
1622
|
-
return objStacked == other && othStacked == object;
|
|
1623
|
-
var result = !0;
|
|
1624
|
-
stack.set(object, other), stack.set(other, object);
|
|
1625
|
-
for (var skipCtor = isPartial; ++index < objLength; ) {
|
|
1626
|
-
key = objProps[index];
|
|
1627
|
-
var objValue = object[key], othValue = other[key];
|
|
1628
|
-
if (customizer)
|
|
1629
|
-
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
1630
|
-
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
1631
|
-
result = !1;
|
|
1632
|
-
break;
|
|
1633
|
-
}
|
|
1634
|
-
skipCtor || (skipCtor = key == "constructor");
|
|
1635
|
-
}
|
|
1636
|
-
if (result && !skipCtor) {
|
|
1637
|
-
var objCtor = object.constructor, othCtor = other.constructor;
|
|
1638
|
-
objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor) && (result = !1);
|
|
1639
|
-
}
|
|
1640
|
-
return stack.delete(object), stack.delete(other), result;
|
|
1641
|
-
}
|
|
1642
|
-
return _equalObjects = equalObjects, _equalObjects;
|
|
1643
|
-
}
|
|
1644
|
-
var _DataView, hasRequired_DataView;
|
|
1645
|
-
function require_DataView() {
|
|
1646
|
-
if (hasRequired_DataView) return _DataView;
|
|
1647
|
-
hasRequired_DataView = 1;
|
|
1648
|
-
var getNative = require_getNative(), root = require_root(), DataView = getNative(root, "DataView");
|
|
1649
|
-
return _DataView = DataView, _DataView;
|
|
1650
|
-
}
|
|
1651
|
-
var _Promise, hasRequired_Promise;
|
|
1652
|
-
function require_Promise() {
|
|
1653
|
-
if (hasRequired_Promise) return _Promise;
|
|
1654
|
-
hasRequired_Promise = 1;
|
|
1655
|
-
var getNative = require_getNative(), root = require_root(), Promise2 = getNative(root, "Promise");
|
|
1656
|
-
return _Promise = Promise2, _Promise;
|
|
1657
|
-
}
|
|
1658
|
-
var _Set, hasRequired_Set;
|
|
1659
|
-
function require_Set() {
|
|
1660
|
-
if (hasRequired_Set) return _Set;
|
|
1661
|
-
hasRequired_Set = 1;
|
|
1662
|
-
var getNative = require_getNative(), root = require_root(), Set2 = getNative(root, "Set");
|
|
1663
|
-
return _Set = Set2, _Set;
|
|
1664
|
-
}
|
|
1665
|
-
var _WeakMap, hasRequired_WeakMap;
|
|
1666
|
-
function require_WeakMap() {
|
|
1667
|
-
if (hasRequired_WeakMap) return _WeakMap;
|
|
1668
|
-
hasRequired_WeakMap = 1;
|
|
1669
|
-
var getNative = require_getNative(), root = require_root(), WeakMap = getNative(root, "WeakMap");
|
|
1670
|
-
return _WeakMap = WeakMap, _WeakMap;
|
|
1671
|
-
}
|
|
1672
|
-
var _getTag, hasRequired_getTag;
|
|
1673
|
-
function require_getTag() {
|
|
1674
|
-
if (hasRequired_getTag) return _getTag;
|
|
1675
|
-
hasRequired_getTag = 1;
|
|
1676
|
-
var DataView = require_DataView(), Map2 = require_Map(), Promise2 = require_Promise(), Set2 = require_Set(), WeakMap = require_WeakMap(), baseGetTag = require_baseGetTag(), toSource = require_toSource(), mapTag = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]", dataViewTag = "[object DataView]", dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap), getTag = baseGetTag;
|
|
1677
|
-
return (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) && (getTag = function(value) {
|
|
1678
|
-
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
1679
|
-
if (ctorString)
|
|
1680
|
-
switch (ctorString) {
|
|
1681
|
-
case dataViewCtorString:
|
|
1682
|
-
return dataViewTag;
|
|
1683
|
-
case mapCtorString:
|
|
1684
|
-
return mapTag;
|
|
1685
|
-
case promiseCtorString:
|
|
1686
|
-
return promiseTag;
|
|
1687
|
-
case setCtorString:
|
|
1688
|
-
return setTag;
|
|
1689
|
-
case weakMapCtorString:
|
|
1690
|
-
return weakMapTag;
|
|
1691
|
-
}
|
|
1692
|
-
return result;
|
|
1693
|
-
}), _getTag = getTag, _getTag;
|
|
1694
|
-
}
|
|
1695
|
-
var _baseIsEqualDeep, hasRequired_baseIsEqualDeep;
|
|
1696
|
-
function require_baseIsEqualDeep() {
|
|
1697
|
-
if (hasRequired_baseIsEqualDeep) return _baseIsEqualDeep;
|
|
1698
|
-
hasRequired_baseIsEqualDeep = 1;
|
|
1699
|
-
var Stack = require_Stack(), equalArrays = require_equalArrays(), equalByTag = require_equalByTag(), equalObjects = require_equalObjects(), getTag = require_getTag(), isArray = requireIsArray(), isBuffer2 = requireIsBuffer(), isTypedArray = requireIsTypedArray(), COMPARE_PARTIAL_FLAG = 1, argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]", objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1700
|
-
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1701
|
-
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
1702
|
-
objTag = objTag == argsTag ? objectTag : objTag, othTag = othTag == argsTag ? objectTag : othTag;
|
|
1703
|
-
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
1704
|
-
if (isSameTag && isBuffer2(object)) {
|
|
1705
|
-
if (!isBuffer2(other))
|
|
1706
|
-
return !1;
|
|
1707
|
-
objIsArr = !0, objIsObj = !1;
|
|
1708
|
-
}
|
|
1709
|
-
if (isSameTag && !objIsObj)
|
|
1710
|
-
return stack || (stack = new Stack()), objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
1711
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
1712
|
-
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
1713
|
-
if (objIsWrapped || othIsWrapped) {
|
|
1714
|
-
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
1715
|
-
return stack || (stack = new Stack()), equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
return isSameTag ? (stack || (stack = new Stack()), equalObjects(object, other, bitmask, customizer, equalFunc, stack)) : !1;
|
|
1719
|
-
}
|
|
1720
|
-
return _baseIsEqualDeep = baseIsEqualDeep, _baseIsEqualDeep;
|
|
1721
|
-
}
|
|
1722
|
-
var _baseIsEqual, hasRequired_baseIsEqual;
|
|
1723
|
-
function require_baseIsEqual() {
|
|
1724
|
-
if (hasRequired_baseIsEqual) return _baseIsEqual;
|
|
1725
|
-
hasRequired_baseIsEqual = 1;
|
|
1726
|
-
var baseIsEqualDeep = require_baseIsEqualDeep(), isObjectLike = requireIsObjectLike();
|
|
1727
|
-
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
1728
|
-
return value === other ? !0 : value == null || other == null || !isObjectLike(value) && !isObjectLike(other) ? value !== value && other !== other : baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
1729
|
-
}
|
|
1730
|
-
return _baseIsEqual = baseIsEqual, _baseIsEqual;
|
|
1731
|
-
}
|
|
1732
|
-
var isEqual_1, hasRequiredIsEqual;
|
|
1733
|
-
function requireIsEqual() {
|
|
1734
|
-
if (hasRequiredIsEqual) return isEqual_1;
|
|
1735
|
-
hasRequiredIsEqual = 1;
|
|
1736
|
-
var baseIsEqual = require_baseIsEqual();
|
|
1737
|
-
function isEqual2(value, other) {
|
|
1738
|
-
return baseIsEqual(value, other);
|
|
1739
|
-
}
|
|
1740
|
-
return isEqual_1 = isEqual2, isEqual_1;
|
|
1741
|
-
}
|
|
1742
|
-
var isEqualExports = requireIsEqual(), isEqual = /* @__PURE__ */ getDefaultExportFromCjs(isEqualExports), _baseFindIndex, hasRequired_baseFindIndex;
|
|
1743
|
-
function require_baseFindIndex() {
|
|
1744
|
-
if (hasRequired_baseFindIndex) return _baseFindIndex;
|
|
1745
|
-
hasRequired_baseFindIndex = 1;
|
|
1746
|
-
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
1747
|
-
for (var length2 = array.length, index = fromIndex + (fromRight ? 1 : -1); fromRight ? index-- : ++index < length2; )
|
|
1748
|
-
if (predicate(array[index], index, array))
|
|
1749
|
-
return index;
|
|
1750
|
-
return -1;
|
|
1751
|
-
}
|
|
1752
|
-
return _baseFindIndex = baseFindIndex, _baseFindIndex;
|
|
1753
|
-
}
|
|
1754
|
-
var _baseIsNaN, hasRequired_baseIsNaN;
|
|
1755
|
-
function require_baseIsNaN() {
|
|
1756
|
-
if (hasRequired_baseIsNaN) return _baseIsNaN;
|
|
1757
|
-
hasRequired_baseIsNaN = 1;
|
|
1758
|
-
function baseIsNaN(value) {
|
|
1759
|
-
return value !== value;
|
|
1760
|
-
}
|
|
1761
|
-
return _baseIsNaN = baseIsNaN, _baseIsNaN;
|
|
1762
|
-
}
|
|
1763
|
-
var _strictIndexOf, hasRequired_strictIndexOf;
|
|
1764
|
-
function require_strictIndexOf() {
|
|
1765
|
-
if (hasRequired_strictIndexOf) return _strictIndexOf;
|
|
1766
|
-
hasRequired_strictIndexOf = 1;
|
|
1767
|
-
function strictIndexOf(array, value, fromIndex) {
|
|
1768
|
-
for (var index = fromIndex - 1, length2 = array.length; ++index < length2; )
|
|
1769
|
-
if (array[index] === value)
|
|
1770
|
-
return index;
|
|
1771
|
-
return -1;
|
|
1772
|
-
}
|
|
1773
|
-
return _strictIndexOf = strictIndexOf, _strictIndexOf;
|
|
1774
|
-
}
|
|
1775
|
-
var _baseIndexOf, hasRequired_baseIndexOf;
|
|
1776
|
-
function require_baseIndexOf() {
|
|
1777
|
-
if (hasRequired_baseIndexOf) return _baseIndexOf;
|
|
1778
|
-
hasRequired_baseIndexOf = 1;
|
|
1779
|
-
var baseFindIndex = require_baseFindIndex(), baseIsNaN = require_baseIsNaN(), strictIndexOf = require_strictIndexOf();
|
|
1780
|
-
function baseIndexOf(array, value, fromIndex) {
|
|
1781
|
-
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
1782
|
-
}
|
|
1783
|
-
return _baseIndexOf = baseIndexOf, _baseIndexOf;
|
|
1784
|
-
}
|
|
1785
|
-
var _arrayIncludes, hasRequired_arrayIncludes;
|
|
1786
|
-
function require_arrayIncludes() {
|
|
1787
|
-
if (hasRequired_arrayIncludes) return _arrayIncludes;
|
|
1788
|
-
hasRequired_arrayIncludes = 1;
|
|
1789
|
-
var baseIndexOf = require_baseIndexOf();
|
|
1790
|
-
function arrayIncludes(array, value) {
|
|
1791
|
-
var length2 = array == null ? 0 : array.length;
|
|
1792
|
-
return !!length2 && baseIndexOf(array, value, 0) > -1;
|
|
1793
|
-
}
|
|
1794
|
-
return _arrayIncludes = arrayIncludes, _arrayIncludes;
|
|
1795
|
-
}
|
|
1796
|
-
var _arrayIncludesWith, hasRequired_arrayIncludesWith;
|
|
1797
|
-
function require_arrayIncludesWith() {
|
|
1798
|
-
if (hasRequired_arrayIncludesWith) return _arrayIncludesWith;
|
|
1799
|
-
hasRequired_arrayIncludesWith = 1;
|
|
1800
|
-
function arrayIncludesWith(array, value, comparator) {
|
|
1801
|
-
for (var index = -1, length2 = array == null ? 0 : array.length; ++index < length2; )
|
|
1802
|
-
if (comparator(value, array[index]))
|
|
1803
|
-
return !0;
|
|
1804
|
-
return !1;
|
|
1805
|
-
}
|
|
1806
|
-
return _arrayIncludesWith = arrayIncludesWith, _arrayIncludesWith;
|
|
1807
|
-
}
|
|
1808
|
-
var noop_1, hasRequiredNoop;
|
|
1809
|
-
function requireNoop() {
|
|
1810
|
-
if (hasRequiredNoop) return noop_1;
|
|
1811
|
-
hasRequiredNoop = 1;
|
|
1812
|
-
function noop() {
|
|
1813
|
-
}
|
|
1814
|
-
return noop_1 = noop, noop_1;
|
|
1815
|
-
}
|
|
1816
|
-
var _createSet, hasRequired_createSet;
|
|
1817
|
-
function require_createSet() {
|
|
1818
|
-
if (hasRequired_createSet) return _createSet;
|
|
1819
|
-
hasRequired_createSet = 1;
|
|
1820
|
-
var Set2 = require_Set(), noop = requireNoop(), setToArray = require_setToArray(), INFINITY = 1 / 0, createSet = Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY ? function(values) {
|
|
1821
|
-
return new Set2(values);
|
|
1822
|
-
} : noop;
|
|
1823
|
-
return _createSet = createSet, _createSet;
|
|
1824
|
-
}
|
|
1825
|
-
var _baseUniq, hasRequired_baseUniq;
|
|
1826
|
-
function require_baseUniq() {
|
|
1827
|
-
if (hasRequired_baseUniq) return _baseUniq;
|
|
1828
|
-
hasRequired_baseUniq = 1;
|
|
1829
|
-
var SetCache = require_SetCache(), arrayIncludes = require_arrayIncludes(), arrayIncludesWith = require_arrayIncludesWith(), cacheHas = require_cacheHas(), createSet = require_createSet(), setToArray = require_setToArray(), LARGE_ARRAY_SIZE = 200;
|
|
1830
|
-
function baseUniq(array, iteratee, comparator) {
|
|
1831
|
-
var index = -1, includes = arrayIncludes, length2 = array.length, isCommon = !0, result = [], seen = result;
|
|
1832
|
-
if (comparator)
|
|
1833
|
-
isCommon = !1, includes = arrayIncludesWith;
|
|
1834
|
-
else if (length2 >= LARGE_ARRAY_SIZE) {
|
|
1835
|
-
var set = iteratee ? null : createSet(array);
|
|
1836
|
-
if (set)
|
|
1837
|
-
return setToArray(set);
|
|
1838
|
-
isCommon = !1, includes = cacheHas, seen = new SetCache();
|
|
1839
|
-
} else
|
|
1840
|
-
seen = iteratee ? [] : result;
|
|
1841
|
-
outer:
|
|
1842
|
-
for (; ++index < length2; ) {
|
|
1843
|
-
var value = array[index], computed = iteratee ? iteratee(value) : value;
|
|
1844
|
-
if (value = comparator || value !== 0 ? value : 0, isCommon && computed === computed) {
|
|
1845
|
-
for (var seenIndex = seen.length; seenIndex--; )
|
|
1846
|
-
if (seen[seenIndex] === computed)
|
|
1847
|
-
continue outer;
|
|
1848
|
-
iteratee && seen.push(computed), result.push(value);
|
|
1849
|
-
} else includes(seen, computed, comparator) || (seen !== result && seen.push(computed), result.push(value));
|
|
1850
|
-
}
|
|
1851
|
-
return result;
|
|
1852
|
-
}
|
|
1853
|
-
return _baseUniq = baseUniq, _baseUniq;
|
|
1854
|
-
}
|
|
1855
|
-
var uniq_1, hasRequiredUniq;
|
|
1856
|
-
function requireUniq() {
|
|
1857
|
-
if (hasRequiredUniq) return uniq_1;
|
|
1858
|
-
hasRequiredUniq = 1;
|
|
1859
|
-
var baseUniq = require_baseUniq();
|
|
1860
|
-
function uniq2(array) {
|
|
1861
|
-
return array && array.length ? baseUniq(array) : [];
|
|
1862
|
-
}
|
|
1863
|
-
return uniq_1 = uniq2, uniq_1;
|
|
1864
|
-
}
|
|
1865
|
-
var uniqExports = requireUniq(), uniq = /* @__PURE__ */ getDefaultExportFromCjs(uniqExports);
|
|
1866
|
-
const objectToString = Object.prototype.toString;
|
|
1867
|
-
function resolveJsType(val) {
|
|
1868
|
-
switch (objectToString.call(val)) {
|
|
1869
|
-
case "[object Function]":
|
|
1870
|
-
return "function";
|
|
1871
|
-
case "[object Date]":
|
|
1872
|
-
return "date";
|
|
1873
|
-
case "[object RegExp]":
|
|
1874
|
-
return "regexp";
|
|
1875
|
-
case "[object Arguments]":
|
|
1876
|
-
return "arguments";
|
|
1877
|
-
case "[object Array]":
|
|
1878
|
-
return "array";
|
|
1879
|
-
case "[object String]":
|
|
1880
|
-
return "string";
|
|
1881
|
-
}
|
|
1882
|
-
return val === null ? "null" : val === void 0 ? "undefined" : val && typeof val == "object" && "nodeType" in val && val.nodeType === 1 ? "element" : val === Object(val) ? "object" : typeof val;
|
|
1883
|
-
}
|
|
1884
|
-
function isArbitraryTypedObject(object) {
|
|
1885
|
-
return isRecord(object) && typeof object._type == "string";
|
|
1886
|
-
}
|
|
1887
|
-
function isRecord(value) {
|
|
1888
|
-
return !!value && (typeof value == "object" || typeof value == "function");
|
|
1889
|
-
}
|
|
1890
|
-
function flattenNestedBlocks(context, blocks2) {
|
|
1891
|
-
return blocks2.flatMap((block) => {
|
|
1892
|
-
if (isBlockContainer(block))
|
|
1893
|
-
return flattenNestedBlocks(context, [block.block]);
|
|
1894
|
-
if (isTextBlock(context, block)) {
|
|
1895
|
-
const hasBlockObjects = block.children.some((child) => context.schema.blockObjects.some(
|
|
1896
|
-
(blockObject) => blockObject.name === child._type
|
|
1897
|
-
)), hasBlocks = block.children.some(
|
|
1898
|
-
(child) => child._type === "__block" || child._type === "block"
|
|
1899
|
-
);
|
|
1900
|
-
if (hasBlockObjects || hasBlocks) {
|
|
1901
|
-
const splitChildren = getSplitChildren(context, block);
|
|
1902
|
-
return splitChildren.length === 1 && splitChildren[0].type === "children" && isEqual(splitChildren[0].children, block.children) ? [block] : splitChildren.flatMap((slice2) => slice2.type === "block object" ? [slice2.block] : slice2.type === "block" ? flattenNestedBlocks(context, [
|
|
1903
|
-
slice2.block
|
|
1904
|
-
]) : slice2.children.length > 0 ? slice2.children.every(
|
|
1905
|
-
(child) => isSpan(context, child) && child.text.trim() === ""
|
|
1906
|
-
) ? [] : flattenNestedBlocks(context, [
|
|
1907
|
-
{
|
|
1908
|
-
...block,
|
|
1909
|
-
children: slice2.children
|
|
1910
|
-
}
|
|
1911
|
-
]) : []);
|
|
1912
|
-
}
|
|
1913
|
-
return [block];
|
|
1914
|
-
}
|
|
1915
|
-
return [block];
|
|
1916
|
-
});
|
|
1917
|
-
}
|
|
1918
|
-
function isBlockContainer(block) {
|
|
1919
|
-
return block._type === "__block" && isArbitraryTypedObject(block.block);
|
|
1920
|
-
}
|
|
1921
|
-
function getSplitChildren(context, block) {
|
|
1922
|
-
return block.children.reduce(
|
|
1923
|
-
(slices, child) => {
|
|
1924
|
-
const knownInlineObject = context.schema.inlineObjects.some(
|
|
1925
|
-
(inlineObject) => inlineObject.name === child._type
|
|
1926
|
-
), knownBlockObject = context.schema.blockObjects.some(
|
|
1927
|
-
(blockObject) => blockObject.name === child._type
|
|
1928
|
-
), lastSlice = slices.pop();
|
|
1929
|
-
return !isSpan(context, child) && !knownInlineObject && knownBlockObject ? [
|
|
1930
|
-
...slices,
|
|
1931
|
-
...lastSlice ? [lastSlice] : [],
|
|
1932
|
-
{ type: "block object", block: child }
|
|
1933
|
-
] : child._type === "__block" ? [
|
|
1934
|
-
...slices,
|
|
1935
|
-
...lastSlice ? [lastSlice] : [],
|
|
1936
|
-
{
|
|
1937
|
-
type: "block object",
|
|
1938
|
-
block: child.block
|
|
1939
|
-
}
|
|
1940
|
-
] : child._type === "block" ? [
|
|
1941
|
-
...slices,
|
|
1942
|
-
...lastSlice ? [lastSlice] : [],
|
|
1943
|
-
{ type: "block", block: child }
|
|
1944
|
-
] : lastSlice && lastSlice.type === "children" ? [
|
|
1945
|
-
...slices,
|
|
1946
|
-
{
|
|
1947
|
-
type: "children",
|
|
1948
|
-
children: [...lastSlice.children, child]
|
|
1949
|
-
}
|
|
1950
|
-
] : [
|
|
1951
|
-
...slices,
|
|
1952
|
-
...lastSlice ? [lastSlice] : [],
|
|
1953
|
-
{ type: "children", children: [child] }
|
|
1954
|
-
];
|
|
1955
|
-
},
|
|
1956
|
-
[]
|
|
1957
|
-
);
|
|
1958
|
-
}
|
|
1959
|
-
var s = { 0: 8203, 1: 8204, 2: 8205, 3: 8290, 4: 8291, 5: 8288, 6: 65279, 7: 8289, 8: 119155, 9: 119156, a: 119157, b: 119158, c: 119159, d: 119160, e: 119161, f: 119162 }, c = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 };
|
|
1960
|
-
new Array(4).fill(String.fromCodePoint(c[0])).join("");
|
|
1961
|
-
Object.fromEntries(Object.entries(c).map((t) => t.reverse()));
|
|
1962
|
-
Object.fromEntries(Object.entries(s).map((t) => t.reverse()));
|
|
1963
|
-
var S$1 = `${Object.values(s).map((t) => `\\u{${t.toString(16)}}`).join("")}`, f$1 = new RegExp(`[${S$1}]{4,}`, "gu");
|
|
1964
|
-
function _$1(t) {
|
|
1965
|
-
var e;
|
|
1966
|
-
return { cleaned: t.replace(f$1, ""), encoded: ((e = t.match(f$1)) == null ? void 0 : e[0]) || "" };
|
|
1967
|
-
}
|
|
1968
|
-
function O$1(t) {
|
|
1969
|
-
return t && JSON.parse(_$1(JSON.stringify(t)).cleaned);
|
|
1970
|
-
}
|
|
1971
|
-
const PRESERVE_WHITESPACE_TAGS = ["pre", "textarea", "code"], BLOCK_DEFAULT_STYLE = "normal", DEFAULT_BLOCK = Object.freeze({
|
|
1972
|
-
_type: "block",
|
|
1973
|
-
markDefs: [],
|
|
1974
|
-
style: BLOCK_DEFAULT_STYLE
|
|
1975
|
-
}), DEFAULT_SPAN = Object.freeze({
|
|
1976
|
-
_type: "span",
|
|
1977
|
-
marks: []
|
|
1978
|
-
}), HTML_BLOCK_TAGS = {
|
|
1979
|
-
p: DEFAULT_BLOCK,
|
|
1980
|
-
blockquote: { ...DEFAULT_BLOCK, style: "blockquote" }
|
|
1981
|
-
}, HTML_SPAN_TAGS = {
|
|
1982
|
-
span: { object: "text" }
|
|
1983
|
-
}, HTML_LIST_CONTAINER_TAGS = {
|
|
1984
|
-
ol: { object: null },
|
|
1985
|
-
ul: { object: null }
|
|
1986
|
-
}, HTML_HEADER_TAGS = {
|
|
1987
|
-
h1: { ...DEFAULT_BLOCK, style: "h1" },
|
|
1988
|
-
h2: { ...DEFAULT_BLOCK, style: "h2" },
|
|
1989
|
-
h3: { ...DEFAULT_BLOCK, style: "h3" },
|
|
1990
|
-
h4: { ...DEFAULT_BLOCK, style: "h4" },
|
|
1991
|
-
h5: { ...DEFAULT_BLOCK, style: "h5" },
|
|
1992
|
-
h6: { ...DEFAULT_BLOCK, style: "h6" }
|
|
1993
|
-
}, HTML_MISC_TAGS = {
|
|
1994
|
-
br: { ...DEFAULT_BLOCK, style: BLOCK_DEFAULT_STYLE }
|
|
1995
|
-
}, HTML_DECORATOR_TAGS = {
|
|
1996
|
-
b: "strong",
|
|
1997
|
-
strong: "strong",
|
|
1998
|
-
i: "em",
|
|
1999
|
-
em: "em",
|
|
2000
|
-
u: "underline",
|
|
2001
|
-
s: "strike-through",
|
|
2002
|
-
strike: "strike-through",
|
|
2003
|
-
del: "strike-through",
|
|
2004
|
-
code: "code",
|
|
2005
|
-
sup: "sup",
|
|
2006
|
-
sub: "sub",
|
|
2007
|
-
ins: "ins",
|
|
2008
|
-
mark: "mark",
|
|
2009
|
-
small: "small"
|
|
2010
|
-
}, HTML_LIST_ITEM_TAGS = {
|
|
2011
|
-
li: {
|
|
2012
|
-
...DEFAULT_BLOCK,
|
|
2013
|
-
style: BLOCK_DEFAULT_STYLE,
|
|
2014
|
-
level: 1,
|
|
2015
|
-
listItem: "bullet"
|
|
2016
|
-
}
|
|
2017
|
-
}, ELEMENT_MAP = {
|
|
2018
|
-
...HTML_BLOCK_TAGS,
|
|
2019
|
-
...HTML_SPAN_TAGS,
|
|
2020
|
-
...HTML_LIST_CONTAINER_TAGS,
|
|
2021
|
-
...HTML_LIST_ITEM_TAGS,
|
|
2022
|
-
...HTML_HEADER_TAGS,
|
|
2023
|
-
...HTML_MISC_TAGS
|
|
2024
|
-
};
|
|
2025
|
-
uniq(
|
|
2026
|
-
Object.values(ELEMENT_MAP).filter((tag) => "style" in tag).map((tag) => tag.style)
|
|
2027
|
-
);
|
|
2028
|
-
uniq(
|
|
2029
|
-
Object.values(HTML_DECORATOR_TAGS)
|
|
2030
|
-
);
|
|
2031
|
-
const _XPathResult = {
|
|
2032
|
-
BOOLEAN_TYPE: 3,
|
|
2033
|
-
ORDERED_NODE_ITERATOR_TYPE: 5,
|
|
2034
|
-
UNORDERED_NODE_SNAPSHOT_TYPE: 6
|
|
2035
|
-
};
|
|
2036
|
-
var preprocessGDocs = (_html, doc, options) => {
|
|
2037
|
-
const whitespaceOnPasteMode = options?.unstable_whitespaceOnPasteMode || "preserve";
|
|
2038
|
-
let gDocsRootOrSiblingNode = doc.evaluate(
|
|
2039
|
-
'//*[@id and contains(@id, "docs-internal-guid")]',
|
|
2040
|
-
doc,
|
|
2041
|
-
null,
|
|
2042
|
-
_XPathResult.ORDERED_NODE_ITERATOR_TYPE,
|
|
2043
|
-
null
|
|
2044
|
-
).iterateNext();
|
|
2045
|
-
if (gDocsRootOrSiblingNode) {
|
|
2046
|
-
const isWrappedRootTag = tagName(gDocsRootOrSiblingNode) === "b";
|
|
2047
|
-
switch (isWrappedRootTag || (gDocsRootOrSiblingNode = doc.body), whitespaceOnPasteMode) {
|
|
2048
|
-
case "normalize":
|
|
2049
|
-
normalizeWhitespace(gDocsRootOrSiblingNode);
|
|
2050
|
-
break;
|
|
2051
|
-
case "remove":
|
|
2052
|
-
removeAllWhitespace(gDocsRootOrSiblingNode);
|
|
2053
|
-
break;
|
|
2054
|
-
}
|
|
2055
|
-
const childNodes = doc.evaluate(
|
|
2056
|
-
"//*",
|
|
2057
|
-
doc,
|
|
2058
|
-
null,
|
|
2059
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2060
|
-
null
|
|
2061
|
-
);
|
|
2062
|
-
for (let i = childNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2063
|
-
const elm = childNodes.snapshotItem(i);
|
|
2064
|
-
elm?.setAttribute("data-is-google-docs", "true"), (elm?.parentElement === gDocsRootOrSiblingNode || !isWrappedRootTag && elm.parentElement === doc.body) && (elm?.setAttribute("data-is-root-node", "true"), tagName(elm)), tagName(elm) === "li" && elm.firstChild && tagName(elm?.firstChild) === "img" && elm.removeChild(elm.firstChild);
|
|
2065
|
-
}
|
|
2066
|
-
return isWrappedRootTag && doc.body.firstElementChild?.replaceWith(
|
|
2067
|
-
...Array.from(gDocsRootOrSiblingNode.childNodes)
|
|
2068
|
-
), doc;
|
|
2069
|
-
}
|
|
2070
|
-
return doc;
|
|
2071
|
-
};
|
|
2072
|
-
const unwantedWordDocumentPaths = [
|
|
2073
|
-
"/html/text()",
|
|
2074
|
-
"/html/head/text()",
|
|
2075
|
-
"/html/body/text()",
|
|
2076
|
-
"/html/body/ul/text()",
|
|
2077
|
-
"/html/body/ol/text()",
|
|
2078
|
-
"//comment()",
|
|
2079
|
-
"//style",
|
|
2080
|
-
"//xml",
|
|
2081
|
-
"//script",
|
|
2082
|
-
"//meta",
|
|
2083
|
-
"//link"
|
|
2084
|
-
];
|
|
2085
|
-
var preprocessHTML = (_html, doc) => {
|
|
2086
|
-
const bodyTextNodes = doc.evaluate(
|
|
2087
|
-
"/html/body/text()",
|
|
2088
|
-
doc,
|
|
2089
|
-
null,
|
|
2090
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2091
|
-
null
|
|
2092
|
-
);
|
|
2093
|
-
for (let i = bodyTextNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2094
|
-
const node2 = bodyTextNodes.snapshotItem(i), text = node2.textContent || "";
|
|
2095
|
-
if (text.replace(/[^\S\n]+$/g, "")) {
|
|
2096
|
-
const newNode = doc.createElement("span");
|
|
2097
|
-
newNode.appendChild(doc.createTextNode(text)), node2.parentNode?.replaceChild(newNode, node2);
|
|
2098
|
-
} else
|
|
2099
|
-
node2.parentNode?.removeChild(node2);
|
|
2100
|
-
}
|
|
2101
|
-
const unwantedNodes = doc.evaluate(
|
|
2102
|
-
unwantedWordDocumentPaths.join("|"),
|
|
2103
|
-
doc,
|
|
2104
|
-
null,
|
|
2105
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2106
|
-
null
|
|
2107
|
-
);
|
|
2108
|
-
for (let i = unwantedNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2109
|
-
const unwanted = unwantedNodes.snapshotItem(i);
|
|
2110
|
-
unwanted && unwanted.parentNode?.removeChild(unwanted);
|
|
2111
|
-
}
|
|
2112
|
-
return doc;
|
|
2113
|
-
}, preprocessNotion = (html, doc) => {
|
|
2114
|
-
const NOTION_REGEX = /<!-- notionvc:.*?-->/g;
|
|
2115
|
-
if (html.match(NOTION_REGEX)) {
|
|
2116
|
-
const childNodes = doc.evaluate(
|
|
2117
|
-
"//*",
|
|
2118
|
-
doc,
|
|
2119
|
-
null,
|
|
2120
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2121
|
-
null
|
|
2122
|
-
);
|
|
2123
|
-
for (let i = childNodes.snapshotLength - 1; i >= 0; i--)
|
|
2124
|
-
childNodes.snapshotItem(i)?.setAttribute("data-is-notion", "true");
|
|
2125
|
-
return doc;
|
|
2126
|
-
}
|
|
2127
|
-
return doc;
|
|
2128
|
-
}, preprocessWhitespace = (_2, doc) => {
|
|
2129
|
-
function processNode(node2) {
|
|
2130
|
-
if (node2.nodeType === _XPathResult.BOOLEAN_TYPE && !PRESERVE_WHITESPACE_TAGS.includes(
|
|
2131
|
-
node2.parentElement?.tagName.toLowerCase() || ""
|
|
2132
|
-
))
|
|
2133
|
-
node2.textContent = node2.textContent?.replace(/\s\s+/g, " ").replace(/[\r\n]+/g, " ") || "";
|
|
2134
|
-
else
|
|
2135
|
-
for (let i = 0; i < node2.childNodes.length; i++)
|
|
2136
|
-
processNode(node2.childNodes[i]);
|
|
2137
|
-
}
|
|
2138
|
-
return processNode(doc.body), doc;
|
|
2139
|
-
};
|
|
2140
|
-
const WORD_HTML_REGEX = /(class="?Mso|style=(?:"|')[^"]*?\bmso-|w:WordDocument|<o:\w+>|<\/font>)/, unwantedPaths = [
|
|
2141
|
-
"//o:p",
|
|
2142
|
-
"//span[@style='mso-list:Ignore']",
|
|
2143
|
-
"//span[@style='mso-list: Ignore']"
|
|
2144
|
-
], mappedPaths = [
|
|
2145
|
-
"//p[@class='MsoTocHeading']",
|
|
2146
|
-
"//p[@class='MsoTitle']",
|
|
2147
|
-
"//p[@class='MsoToaHeading']",
|
|
2148
|
-
"//p[@class='MsoSubtitle']",
|
|
2149
|
-
"//span[@class='MsoSubtleEmphasis']",
|
|
2150
|
-
"//span[@class='MsoIntenseEmphasis']"
|
|
2151
|
-
], elementMap = {
|
|
2152
|
-
MsoTocHeading: ["h3"],
|
|
2153
|
-
MsoTitle: ["h1"],
|
|
2154
|
-
MsoToaHeading: ["h2"],
|
|
2155
|
-
MsoSubtitle: ["h5"],
|
|
2156
|
-
MsoSubtleEmphasis: ["span", "em"],
|
|
2157
|
-
MsoIntenseEmphasis: ["span", "em", "strong"]
|
|
2158
|
-
// Remove cruft
|
|
2159
|
-
};
|
|
2160
|
-
function isWordHtml(html) {
|
|
2161
|
-
return WORD_HTML_REGEX.test(html);
|
|
2162
|
-
}
|
|
2163
|
-
var preprocessWord = (html, doc) => {
|
|
2164
|
-
if (!isWordHtml(html))
|
|
2165
|
-
return doc;
|
|
2166
|
-
const unwantedNodes = doc.evaluate(
|
|
2167
|
-
unwantedPaths.join("|"),
|
|
2168
|
-
doc,
|
|
2169
|
-
(prefix2) => prefix2 === "o" ? "urn:schemas-microsoft-com:office:office" : null,
|
|
2170
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2171
|
-
null
|
|
2172
|
-
);
|
|
2173
|
-
for (let i = unwantedNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2174
|
-
const unwanted = unwantedNodes.snapshotItem(i);
|
|
2175
|
-
unwanted?.parentNode && unwanted.parentNode.removeChild(unwanted);
|
|
2176
|
-
}
|
|
2177
|
-
const mappedElements = doc.evaluate(
|
|
2178
|
-
mappedPaths.join("|"),
|
|
2179
|
-
doc,
|
|
2180
|
-
null,
|
|
2181
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2182
|
-
null
|
|
2183
|
-
);
|
|
2184
|
-
for (let i = mappedElements.snapshotLength - 1; i >= 0; i--) {
|
|
2185
|
-
const mappedElm = mappedElements.snapshotItem(i), tags = elementMap[mappedElm.className], text = doc.createTextNode(mappedElm.textContent || "");
|
|
2186
|
-
if (!tags)
|
|
2187
|
-
continue;
|
|
2188
|
-
const parentElement = doc.createElement(tags[0]);
|
|
2189
|
-
let parent = parentElement, child = parentElement;
|
|
2190
|
-
tags.slice(1).forEach((tag) => {
|
|
2191
|
-
child = doc.createElement(tag), parent.appendChild(child), parent = child;
|
|
2192
|
-
}), child.appendChild(text), mappedElm?.parentNode?.replaceChild(parentElement, mappedElm);
|
|
2193
|
-
}
|
|
2194
|
-
return doc;
|
|
2195
|
-
}, preprocessors = [
|
|
2196
|
-
preprocessWhitespace,
|
|
2197
|
-
preprocessNotion,
|
|
2198
|
-
preprocessWord,
|
|
2199
|
-
preprocessGDocs,
|
|
2200
|
-
preprocessHTML
|
|
2201
|
-
];
|
|
2202
|
-
function tagName(el) {
|
|
2203
|
-
if (el && "tagName" in el)
|
|
2204
|
-
return el.tagName.toLowerCase();
|
|
2205
|
-
}
|
|
2206
|
-
function preprocess$1(html, parseHtml, options) {
|
|
2207
|
-
const cleanHTML = O$1(html), doc = parseHtml(normalizeHtmlBeforePreprocess(cleanHTML));
|
|
2208
|
-
return preprocessors.forEach((processor) => {
|
|
2209
|
-
processor(cleanHTML, doc, options);
|
|
2210
|
-
}), doc;
|
|
2211
|
-
}
|
|
2212
|
-
function normalizeHtmlBeforePreprocess(html) {
|
|
2213
|
-
return html.trim();
|
|
2214
|
-
}
|
|
2215
|
-
function defaultParseHtml() {
|
|
2216
|
-
if (resolveJsType(DOMParser) === "undefined")
|
|
2217
|
-
throw new Error(
|
|
2218
|
-
"The native `DOMParser` global which the `Html` deserializer uses by default is not present in this environment. You must supply the `options.parseHtml` function instead."
|
|
2219
|
-
);
|
|
2220
|
-
return (html) => new DOMParser().parseFromString(html, "text/html");
|
|
2221
|
-
}
|
|
2222
|
-
function nextSpan(block, index) {
|
|
2223
|
-
const next2 = block.children[index + 1];
|
|
2224
|
-
return next2 && next2._type === "span" ? next2 : null;
|
|
2225
|
-
}
|
|
2226
|
-
function prevSpan(block, index) {
|
|
2227
|
-
const prev2 = block.children[index - 1];
|
|
2228
|
-
return prev2 && prev2._type === "span" ? prev2 : null;
|
|
2229
|
-
}
|
|
2230
|
-
function isWhiteSpaceChar(text) {
|
|
2231
|
-
return ["\xA0", " "].includes(text);
|
|
2232
|
-
}
|
|
2233
|
-
function trimWhitespace(schema2, blocks2) {
|
|
2234
|
-
return blocks2.forEach((block) => {
|
|
2235
|
-
isTextBlock({ schema: schema2 }, block) && block.children.forEach((child, index) => {
|
|
2236
|
-
if (!isMinimalSpan(child))
|
|
2237
|
-
return;
|
|
2238
|
-
const nextChild = nextSpan(block, index), prevChild = prevSpan(block, index);
|
|
2239
|
-
index === 0 && (child.text = child.text.replace(/^[^\S\n]+/g, "")), index === block.children.length - 1 && (child.text = child.text.replace(/[^\S\n]+$/g, "")), /\s/.test(child.text.slice(Math.max(0, child.text.length - 1))) && nextChild && isMinimalSpan(nextChild) && /\s/.test(nextChild.text.slice(0, 1)) && (child.text = child.text.replace(/[^\S\n]+$/g, "")), /\s/.test(child.text.slice(0, 1)) && prevChild && isMinimalSpan(prevChild) && /\s/.test(prevChild.text.slice(Math.max(0, prevChild.text.length - 1))) && (child.text = child.text.replace(/^[^\S\n]+/g, "")), child.text || block.children.splice(index, 1), prevChild && isEqual(prevChild.marks, child.marks) && isWhiteSpaceChar(child.text) ? (prevChild.text += " ", block.children.splice(index, 1)) : nextChild && isEqual(nextChild.marks, child.marks) && isWhiteSpaceChar(child.text) && (nextChild.text = ` ${nextChild.text}`, block.children.splice(index, 1));
|
|
2240
|
-
});
|
|
2241
|
-
}), blocks2;
|
|
2242
|
-
}
|
|
2243
|
-
function ensureRootIsBlocks(schema2, objects) {
|
|
2244
|
-
return objects.reduce((blocks2, node2, i, original) => {
|
|
2245
|
-
if (node2._type === "block")
|
|
2246
|
-
return blocks2.push(node2), blocks2;
|
|
2247
|
-
if (node2._type === "__block")
|
|
2248
|
-
return blocks2.push(node2.block), blocks2;
|
|
2249
|
-
const lastBlock = blocks2[blocks2.length - 1];
|
|
2250
|
-
if (i > 0 && !isTextBlock({ schema: schema2 }, original[i - 1]) && isTextBlock({ schema: schema2 }, lastBlock))
|
|
2251
|
-
return lastBlock.children.push(node2), blocks2;
|
|
2252
|
-
const block = {
|
|
2253
|
-
...DEFAULT_BLOCK,
|
|
2254
|
-
children: [node2]
|
|
2255
|
-
};
|
|
2256
|
-
return blocks2.push(block), blocks2;
|
|
2257
|
-
}, []);
|
|
2258
|
-
}
|
|
2259
|
-
function isNodeList(node2) {
|
|
2260
|
-
return Object.prototype.toString.call(node2) === "[object NodeList]";
|
|
2261
|
-
}
|
|
2262
|
-
function isMinimalSpan(node2) {
|
|
2263
|
-
return node2._type === "span";
|
|
2264
|
-
}
|
|
2265
|
-
function isMinimalBlock(node2) {
|
|
2266
|
-
return node2._type === "block";
|
|
2267
|
-
}
|
|
2268
|
-
function isPlaceholderDecorator(node2) {
|
|
2269
|
-
return node2._type === "__decorator";
|
|
2270
|
-
}
|
|
2271
|
-
function isPlaceholderAnnotation(node2) {
|
|
2272
|
-
return node2._type === "__annotation";
|
|
2273
|
-
}
|
|
2274
|
-
function isElement(node2) {
|
|
2275
|
-
return node2.nodeType === 1;
|
|
2276
|
-
}
|
|
2277
|
-
function normalizeWhitespace(rootNode) {
|
|
2278
|
-
let emptyBlockCount = 0, lastParent = null;
|
|
2279
|
-
const nodesToRemove = [];
|
|
2280
|
-
for (let child = rootNode.firstChild; child; child = child.nextSibling) {
|
|
2281
|
-
if (!isElement(child)) {
|
|
2282
|
-
normalizeWhitespace(child), emptyBlockCount = 0;
|
|
2283
|
-
continue;
|
|
2284
|
-
}
|
|
2285
|
-
const elm = child;
|
|
2286
|
-
isWhitespaceBlock(elm) ? (lastParent && elm.parentElement === lastParent ? (emptyBlockCount++, emptyBlockCount > 1 && nodesToRemove.push(elm)) : emptyBlockCount = 1, lastParent = elm.parentElement) : (normalizeWhitespace(child), emptyBlockCount = 0);
|
|
2287
|
-
}
|
|
2288
|
-
nodesToRemove.forEach((node2) => {
|
|
2289
|
-
node2.parentElement?.removeChild(node2);
|
|
2290
|
-
});
|
|
2291
|
-
}
|
|
2292
|
-
function removeAllWhitespace(rootNode) {
|
|
2293
|
-
const nodesToRemove = [];
|
|
2294
|
-
function collectNodesToRemove(currentNode) {
|
|
2295
|
-
if (isElement(currentNode)) {
|
|
2296
|
-
const elm = currentNode;
|
|
2297
|
-
if (tagName(elm) === "br" && (tagName(elm.nextElementSibling) === "p" || tagName(elm.previousElementSibling) === "p")) {
|
|
2298
|
-
nodesToRemove.push(elm);
|
|
2299
|
-
return;
|
|
2300
|
-
}
|
|
2301
|
-
if ((tagName(elm) === "p" || tagName(elm) === "br") && elm?.firstChild?.textContent?.trim() === "") {
|
|
2302
|
-
nodesToRemove.push(elm);
|
|
2303
|
-
return;
|
|
2304
|
-
}
|
|
2305
|
-
for (let child = elm.firstChild; child; child = child.nextSibling)
|
|
2306
|
-
collectNodesToRemove(child);
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
collectNodesToRemove(rootNode), nodesToRemove.forEach((node2) => {
|
|
2310
|
-
node2.parentElement?.removeChild(node2);
|
|
2311
|
-
});
|
|
2312
|
-
}
|
|
2313
|
-
function isWhitespaceBlock(elm) {
|
|
2314
|
-
return ["p", "br"].includes(tagName(elm) || "") && !elm.textContent?.trim();
|
|
2315
|
-
}
|
|
2316
|
-
function keyGenerator() {
|
|
2317
|
-
return randomKey(12);
|
|
2318
|
-
}
|
|
2319
|
-
function whatwgRNG(length2 = 16) {
|
|
2320
|
-
const rnds8 = new Uint8Array(length2);
|
|
2321
|
-
return getRandomValues(rnds8), rnds8;
|
|
2322
|
-
}
|
|
2323
|
-
const byteToHex = [];
|
|
2324
|
-
for (let i = 0; i < 256; ++i)
|
|
2325
|
-
byteToHex[i] = (i + 256).toString(16).slice(1);
|
|
2326
|
-
function randomKey(length2) {
|
|
2327
|
-
return whatwgRNG(length2).reduce((str, n) => str + byteToHex[n], "").slice(0, length2);
|
|
2328
|
-
}
|
|
2329
|
-
const LIST_CONTAINER_TAGS = Object.keys(HTML_LIST_CONTAINER_TAGS);
|
|
2330
|
-
function isEmphasis$1(el) {
|
|
2331
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2332
|
-
return /font-style\s*:\s*italic/.test(style || "");
|
|
2333
|
-
}
|
|
2334
|
-
function isStrong$1(el) {
|
|
2335
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2336
|
-
return /font-weight\s*:\s*700/.test(style || "");
|
|
2337
|
-
}
|
|
2338
|
-
function isUnderline$1(el) {
|
|
2339
|
-
if (!isElement(el) || tagName(el.parentNode) === "a")
|
|
2340
|
-
return !1;
|
|
2341
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2342
|
-
return /text-decoration\s*:\s*underline/.test(style || "");
|
|
2343
|
-
}
|
|
2344
|
-
function isStrikethrough(el) {
|
|
2345
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2346
|
-
return /text-decoration\s*:\s*(?:.*line-through.*;)/.test(style || "");
|
|
2347
|
-
}
|
|
2348
|
-
function isGoogleDocs(el) {
|
|
2349
|
-
return isElement(el) && !!el.getAttribute("data-is-google-docs");
|
|
2350
|
-
}
|
|
2351
|
-
function isRootNode(el) {
|
|
2352
|
-
return isElement(el) && !!el.getAttribute("data-is-root-node");
|
|
2353
|
-
}
|
|
2354
|
-
function getListItemStyle$1(el) {
|
|
2355
|
-
const parentTag = tagName(el.parentNode);
|
|
2356
|
-
if (!(parentTag && !LIST_CONTAINER_TAGS.includes(parentTag)))
|
|
2357
|
-
return tagName(el.parentNode) === "ul" ? "bullet" : "number";
|
|
2358
|
-
}
|
|
2359
|
-
function getListItemLevel$1(el) {
|
|
2360
|
-
let level = 0;
|
|
2361
|
-
if (tagName(el) === "li") {
|
|
2362
|
-
let parentNode = el.parentNode;
|
|
2363
|
-
for (; parentNode; ) {
|
|
2364
|
-
const parentTag = tagName(parentNode);
|
|
2365
|
-
parentTag && LIST_CONTAINER_TAGS.includes(parentTag) && level++, parentNode = parentNode.parentNode;
|
|
2366
|
-
}
|
|
2367
|
-
} else
|
|
2368
|
-
level = 1;
|
|
2369
|
-
return level;
|
|
2370
|
-
}
|
|
2371
|
-
const blocks = {
|
|
2372
|
-
...HTML_BLOCK_TAGS,
|
|
2373
|
-
...HTML_HEADER_TAGS
|
|
2374
|
-
};
|
|
2375
|
-
function getBlockStyle(schema2, el) {
|
|
2376
|
-
const childTag = tagName(el.firstChild), block = childTag && blocks[childTag];
|
|
2377
|
-
return block && schema2.styles.some((style) => style.name === block.style) ? block.style : BLOCK_DEFAULT_STYLE;
|
|
2378
|
-
}
|
|
2379
|
-
function createGDocsRules(schema2) {
|
|
2380
|
-
return [
|
|
2381
|
-
{
|
|
2382
|
-
deserialize(el, next2) {
|
|
2383
|
-
if (isElement(el) && tagName(el) === "span" && isGoogleDocs(el)) {
|
|
2384
|
-
if (!el.textContent)
|
|
2385
|
-
return !el.previousSibling && !el.nextSibling && el.setAttribute("data-lonely-child", "true"), next2(el.childNodes);
|
|
2386
|
-
const span = {
|
|
2387
|
-
...DEFAULT_SPAN,
|
|
2388
|
-
marks: [],
|
|
2389
|
-
text: el.textContent
|
|
2390
|
-
};
|
|
2391
|
-
return isStrong$1(el) && span.marks.push("strong"), isUnderline$1(el) && span.marks.push("underline"), isStrikethrough(el) && span.marks.push("strike-through"), isEmphasis$1(el) && span.marks.push("em"), span;
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
},
|
|
2395
|
-
{
|
|
2396
|
-
deserialize(el, next2) {
|
|
2397
|
-
if (tagName(el) === "li" && isGoogleDocs(el))
|
|
2398
|
-
return {
|
|
2399
|
-
...DEFAULT_BLOCK,
|
|
2400
|
-
listItem: getListItemStyle$1(el),
|
|
2401
|
-
level: getListItemLevel$1(el),
|
|
2402
|
-
style: getBlockStyle(schema2, el),
|
|
2403
|
-
children: next2(el.firstChild?.childNodes || [])
|
|
2404
|
-
};
|
|
2405
|
-
}
|
|
2406
|
-
},
|
|
2407
|
-
{
|
|
2408
|
-
deserialize(el) {
|
|
2409
|
-
if (tagName(el) === "br" && isGoogleDocs(el) && isElement(el) && el.classList.contains("apple-interchange-newline"))
|
|
2410
|
-
return {
|
|
2411
|
-
...DEFAULT_SPAN,
|
|
2412
|
-
text: ""
|
|
2413
|
-
};
|
|
2414
|
-
if (tagName(el) === "br" && isGoogleDocs(el) && isElement(el) && el?.parentNode?.textContent === "")
|
|
2415
|
-
return {
|
|
2416
|
-
...DEFAULT_SPAN,
|
|
2417
|
-
text: ""
|
|
2418
|
-
};
|
|
2419
|
-
if (tagName(el) === "br" && isGoogleDocs(el) && isElement(el) && isRootNode(el))
|
|
2420
|
-
return {
|
|
2421
|
-
...DEFAULT_SPAN,
|
|
2422
|
-
text: ""
|
|
2423
|
-
};
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
];
|
|
2427
|
-
}
|
|
2428
|
-
const whitespaceTextNodeRule = {
|
|
2429
|
-
deserialize(node2) {
|
|
2430
|
-
return node2.nodeName === "#text" && isWhitespaceTextNode(node2) ? {
|
|
2431
|
-
...DEFAULT_SPAN,
|
|
2432
|
-
marks: [],
|
|
2433
|
-
text: (node2.textContent ?? "").replace(/\s\s+/g, " ")
|
|
2434
|
-
} : void 0;
|
|
2435
|
-
}
|
|
2436
|
-
};
|
|
2437
|
-
function isWhitespaceTextNode(node2) {
|
|
2438
|
-
return (node2.nodeType === 3 && (node2.textContent || "").replace(/[\r\n]/g, " ").replace(/\s\s+/g, " ") === " " && node2.nextSibling && node2.nextSibling.nodeType !== 3 && node2.previousSibling && node2.previousSibling.nodeType !== 3 || node2.textContent !== " ") && tagName(node2.parentNode) !== "body";
|
|
2439
|
-
}
|
|
2440
|
-
function resolveListItem(schema2, listNodeTagName) {
|
|
2441
|
-
if (listNodeTagName === "ul" && schema2.lists.some((list) => list.name === "bullet"))
|
|
2442
|
-
return "bullet";
|
|
2443
|
-
if (listNodeTagName === "ol" && schema2.lists.some((list) => list.name === "number"))
|
|
2444
|
-
return "number";
|
|
2445
|
-
}
|
|
2446
|
-
function createHTMLRules(schema2, options) {
|
|
2447
|
-
return [
|
|
2448
|
-
whitespaceTextNodeRule,
|
|
2449
|
-
{
|
|
2450
|
-
// Pre element
|
|
2451
|
-
deserialize(el) {
|
|
2452
|
-
if (tagName(el) !== "pre")
|
|
2453
|
-
return;
|
|
2454
|
-
const isCodeEnabled = schema2.styles.some(
|
|
2455
|
-
(style) => style.name === "code"
|
|
2456
|
-
);
|
|
2457
|
-
return {
|
|
2458
|
-
_type: "block",
|
|
2459
|
-
style: "normal",
|
|
2460
|
-
markDefs: [],
|
|
2461
|
-
children: [
|
|
2462
|
-
{
|
|
2463
|
-
...DEFAULT_SPAN,
|
|
2464
|
-
marks: isCodeEnabled ? ["code"] : [],
|
|
2465
|
-
text: el.textContent || ""
|
|
2466
|
-
}
|
|
2467
|
-
]
|
|
2468
|
-
};
|
|
2469
|
-
}
|
|
2470
|
-
},
|
|
2471
|
-
// Blockquote element
|
|
2472
|
-
{
|
|
2473
|
-
deserialize(el, next2) {
|
|
2474
|
-
if (tagName(el) !== "blockquote")
|
|
2475
|
-
return;
|
|
2476
|
-
const blocks2 = {
|
|
2477
|
-
...HTML_BLOCK_TAGS,
|
|
2478
|
-
...HTML_HEADER_TAGS
|
|
2479
|
-
};
|
|
2480
|
-
delete blocks2.blockquote;
|
|
2481
|
-
const nonBlockquoteBlocks = Object.keys(blocks2), children = [];
|
|
2482
|
-
return el.childNodes.forEach((node2, index) => {
|
|
2483
|
-
if (el.ownerDocument)
|
|
2484
|
-
if (node2.nodeType === 1 && nonBlockquoteBlocks.includes(
|
|
2485
|
-
node2.localName.toLowerCase()
|
|
2486
|
-
)) {
|
|
2487
|
-
const span = el.ownerDocument.createElement("span"), previousChild = children[children.length - 1];
|
|
2488
|
-
previousChild && previousChild.nodeType === 3 && previousChild.textContent?.trim() && span.appendChild(el.ownerDocument.createTextNode("\r")), node2.childNodes.forEach((cn) => {
|
|
2489
|
-
span.appendChild(cn.cloneNode(!0));
|
|
2490
|
-
}), index !== el.childNodes.length && span.appendChild(el.ownerDocument.createTextNode("\r")), children.push(span);
|
|
2491
|
-
} else
|
|
2492
|
-
children.push(node2);
|
|
2493
|
-
}), {
|
|
2494
|
-
_type: "block",
|
|
2495
|
-
style: "blockquote",
|
|
2496
|
-
markDefs: [],
|
|
2497
|
-
children: next2(children)
|
|
2498
|
-
};
|
|
2499
|
-
}
|
|
2500
|
-
},
|
|
2501
|
-
// Block elements
|
|
2502
|
-
{
|
|
2503
|
-
deserialize(el, next2) {
|
|
2504
|
-
const blocks2 = {
|
|
2505
|
-
...HTML_BLOCK_TAGS,
|
|
2506
|
-
...HTML_HEADER_TAGS
|
|
2507
|
-
}, tag = tagName(el);
|
|
2508
|
-
let block = tag ? blocks2[tag] : void 0;
|
|
2509
|
-
if (!block)
|
|
2510
|
-
return;
|
|
2511
|
-
if (el.parentNode && tagName(el.parentNode) === "li")
|
|
2512
|
-
return next2(el.childNodes);
|
|
2513
|
-
const blockStyle = block.style;
|
|
2514
|
-
return schema2.styles.some((style) => style.name === blockStyle) || (block = DEFAULT_BLOCK), {
|
|
2515
|
-
...block,
|
|
2516
|
-
children: next2(el.childNodes)
|
|
2517
|
-
};
|
|
2518
|
-
}
|
|
2519
|
-
},
|
|
2520
|
-
// Ignore span tags
|
|
2521
|
-
{
|
|
2522
|
-
deserialize(el, next2) {
|
|
2523
|
-
const tag = tagName(el);
|
|
2524
|
-
if (!(!tag || !(tag in HTML_SPAN_TAGS)))
|
|
2525
|
-
return next2(el.childNodes);
|
|
2526
|
-
}
|
|
2527
|
-
},
|
|
2528
|
-
// Ignore div tags
|
|
2529
|
-
{
|
|
2530
|
-
deserialize(el, next2) {
|
|
2531
|
-
if (tagName(el) === "div")
|
|
2532
|
-
return next2(el.childNodes);
|
|
2533
|
-
}
|
|
2534
|
-
},
|
|
2535
|
-
// Ignore list containers
|
|
2536
|
-
{
|
|
2537
|
-
deserialize(el, next2) {
|
|
2538
|
-
const tag = tagName(el);
|
|
2539
|
-
if (!(!tag || !(tag in HTML_LIST_CONTAINER_TAGS)))
|
|
2540
|
-
return next2(el.childNodes);
|
|
2541
|
-
}
|
|
2542
|
-
},
|
|
2543
|
-
// Deal with br's
|
|
2544
|
-
{
|
|
2545
|
-
deserialize(el) {
|
|
2546
|
-
if (tagName(el) === "br")
|
|
2547
|
-
return {
|
|
2548
|
-
...DEFAULT_SPAN,
|
|
2549
|
-
text: `
|
|
2550
|
-
`
|
|
2551
|
-
};
|
|
2552
|
-
}
|
|
2553
|
-
},
|
|
2554
|
-
// Deal with list items
|
|
2555
|
-
{
|
|
2556
|
-
deserialize(el, next2, block) {
|
|
2557
|
-
const tag = tagName(el), listItem = tag ? HTML_LIST_ITEM_TAGS[tag] : void 0, parentTag = tagName(el.parentNode) || "";
|
|
2558
|
-
if (!listItem || !el.parentNode || !HTML_LIST_CONTAINER_TAGS[parentTag])
|
|
2559
|
-
return;
|
|
2560
|
-
const enabledListItem = resolveListItem(schema2, parentTag);
|
|
2561
|
-
return enabledListItem ? (listItem.listItem = enabledListItem, {
|
|
2562
|
-
...listItem,
|
|
2563
|
-
children: next2(el.childNodes)
|
|
2564
|
-
}) : block({ _type: "block", children: next2(el.childNodes) });
|
|
2565
|
-
}
|
|
2566
|
-
},
|
|
2567
|
-
// Deal with decorators - this is a limited set of known html elements that we know how to deserialize
|
|
2568
|
-
{
|
|
2569
|
-
deserialize(el, next2) {
|
|
2570
|
-
const decorator = HTML_DECORATOR_TAGS[tagName(el) || ""];
|
|
2571
|
-
if (!(!decorator || !schema2.decorators.some(
|
|
2572
|
-
(decoratorType) => decoratorType.name === decorator
|
|
2573
|
-
)))
|
|
2574
|
-
return {
|
|
2575
|
-
_type: "__decorator",
|
|
2576
|
-
name: decorator,
|
|
2577
|
-
children: next2(el.childNodes)
|
|
2578
|
-
};
|
|
2579
|
-
}
|
|
2580
|
-
},
|
|
2581
|
-
// Special case for hyperlinks, add annotation (if allowed by schema),
|
|
2582
|
-
// If not supported just write out the link text and href in plain text.
|
|
2583
|
-
{
|
|
2584
|
-
deserialize(el, next2) {
|
|
2585
|
-
if (tagName(el) !== "a")
|
|
2586
|
-
return;
|
|
2587
|
-
const linkEnabled = schema2.annotations.some(
|
|
2588
|
-
(annotation) => annotation.name === "link"
|
|
2589
|
-
), href = isElement(el) && el.getAttribute("href");
|
|
2590
|
-
return href ? linkEnabled ? {
|
|
2591
|
-
_type: "__annotation",
|
|
2592
|
-
markDef: {
|
|
2593
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator(),
|
|
2594
|
-
_type: "link",
|
|
2595
|
-
href
|
|
2596
|
-
},
|
|
2597
|
-
children: next2(el.childNodes)
|
|
2598
|
-
} : el.appendChild(el.ownerDocument.createTextNode(` (${href})`)) && next2(el.childNodes) : next2(el.childNodes);
|
|
2599
|
-
}
|
|
2600
|
-
},
|
|
2601
|
-
{
|
|
2602
|
-
deserialize(el, next2) {
|
|
2603
|
-
if (isElement(el) && (tagName(el) === "td" || tagName(el) === "th"))
|
|
2604
|
-
return {
|
|
2605
|
-
...DEFAULT_BLOCK,
|
|
2606
|
-
children: next2(el.childNodes)
|
|
2607
|
-
};
|
|
2608
|
-
}
|
|
2609
|
-
},
|
|
2610
|
-
{
|
|
2611
|
-
deserialize(el) {
|
|
2612
|
-
if (isElement(el) && tagName(el) === "img") {
|
|
2613
|
-
const src = el.getAttribute("src") ?? void 0, alt = el.getAttribute("alt") ?? void 0, props = Object.fromEntries(
|
|
2614
|
-
Array.from(el.attributes).map((attr) => [attr.name, attr.value])
|
|
2615
|
-
), ancestorOfLonelyChild = el?.parentElement?.parentElement?.getAttribute("data-lonely-child"), ancestorOfListItem = el.closest("li") !== null;
|
|
2616
|
-
if (ancestorOfLonelyChild && !ancestorOfListItem) {
|
|
2617
|
-
const image2 = options.matchers?.image?.({
|
|
2618
|
-
context: {
|
|
2619
|
-
schema: schema2,
|
|
2620
|
-
keyGenerator: options.keyGenerator ?? keyGenerator
|
|
2621
|
-
},
|
|
2622
|
-
props: {
|
|
2623
|
-
...props,
|
|
2624
|
-
...src ? { src } : {},
|
|
2625
|
-
...alt ? { alt } : {}
|
|
2626
|
-
}
|
|
2627
|
-
});
|
|
2628
|
-
if (image2)
|
|
2629
|
-
return {
|
|
2630
|
-
_type: "__block",
|
|
2631
|
-
block: image2
|
|
2632
|
-
};
|
|
2633
|
-
}
|
|
2634
|
-
const inlineImage = options.matchers?.inlineImage?.({
|
|
2635
|
-
context: {
|
|
2636
|
-
schema: schema2,
|
|
2637
|
-
keyGenerator: options.keyGenerator ?? keyGenerator
|
|
2638
|
-
},
|
|
2639
|
-
props: {
|
|
2640
|
-
...props,
|
|
2641
|
-
...src ? { src } : {},
|
|
2642
|
-
...alt ? { alt } : {}
|
|
2643
|
-
}
|
|
2644
|
-
});
|
|
2645
|
-
if (inlineImage)
|
|
2646
|
-
return inlineImage;
|
|
2647
|
-
const image = options.matchers?.image?.({
|
|
2648
|
-
context: {
|
|
2649
|
-
schema: schema2,
|
|
2650
|
-
keyGenerator: options.keyGenerator ?? keyGenerator
|
|
2651
|
-
},
|
|
2652
|
-
props: {
|
|
2653
|
-
...props,
|
|
2654
|
-
...src ? { src } : {},
|
|
2655
|
-
...alt ? { alt } : {}
|
|
2656
|
-
}
|
|
2657
|
-
});
|
|
2658
|
-
if (image)
|
|
2659
|
-
return {
|
|
2660
|
-
_type: "__block",
|
|
2661
|
-
block: image
|
|
2662
|
-
};
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
];
|
|
2667
|
-
}
|
|
2668
|
-
function isEmphasis(el) {
|
|
2669
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2670
|
-
return /font-style:italic/.test(style || "");
|
|
2671
|
-
}
|
|
2672
|
-
function isStrong(el) {
|
|
2673
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2674
|
-
return /font-weight:700/.test(style || "") || /font-weight:600/.test(style || "");
|
|
2675
|
-
}
|
|
2676
|
-
function isUnderline(el) {
|
|
2677
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2678
|
-
return /text-decoration:underline/.test(style || "");
|
|
2679
|
-
}
|
|
2680
|
-
function isNotion(el) {
|
|
2681
|
-
return isElement(el) && !!el.getAttribute("data-is-notion");
|
|
2682
|
-
}
|
|
2683
|
-
function createNotionRules() {
|
|
2684
|
-
return [
|
|
2685
|
-
{
|
|
2686
|
-
deserialize(el) {
|
|
2687
|
-
if (isElement(el) && tagName(el) === "span" && isNotion(el)) {
|
|
2688
|
-
const span = {
|
|
2689
|
-
...DEFAULT_SPAN,
|
|
2690
|
-
marks: [],
|
|
2691
|
-
text: el.textContent
|
|
2692
|
-
};
|
|
2693
|
-
return isStrong(el) && span.marks.push("strong"), isUnderline(el) && span.marks.push("underline"), isEmphasis(el) && span.marks.push("em"), span;
|
|
2694
|
-
}
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
];
|
|
2698
|
-
}
|
|
2699
|
-
function getListItemStyle(el) {
|
|
2700
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2701
|
-
if (style && style.match(/lfo\d+/))
|
|
2702
|
-
return style.match("lfo1") ? "bullet" : "number";
|
|
2703
|
-
}
|
|
2704
|
-
function getListItemLevel(el) {
|
|
2705
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2706
|
-
if (!style)
|
|
2707
|
-
return;
|
|
2708
|
-
const levelMatch = style.match(/level\d+/);
|
|
2709
|
-
if (!levelMatch)
|
|
2710
|
-
return;
|
|
2711
|
-
const [level] = levelMatch[0].match(/\d/) || [];
|
|
2712
|
-
return (level ? Number.parseInt(level, 10) : 1) || 1;
|
|
2713
|
-
}
|
|
2714
|
-
function isWordListElement(el) {
|
|
2715
|
-
return isElement(el) && el.className ? el.className === "MsoListParagraphCxSpFirst" || el.className === "MsoListParagraphCxSpMiddle" || el.className === "MsoListParagraphCxSpLast" : !1;
|
|
2716
|
-
}
|
|
2717
|
-
function createWordRules() {
|
|
2718
|
-
return [
|
|
2719
|
-
{
|
|
2720
|
-
deserialize(el, next2) {
|
|
2721
|
-
if (tagName(el) === "p" && isWordListElement(el))
|
|
2722
|
-
return {
|
|
2723
|
-
...DEFAULT_BLOCK,
|
|
2724
|
-
listItem: getListItemStyle(el),
|
|
2725
|
-
level: getListItemLevel(el),
|
|
2726
|
-
style: BLOCK_DEFAULT_STYLE,
|
|
2727
|
-
children: next2(el.childNodes)
|
|
2728
|
-
};
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
];
|
|
2732
|
-
}
|
|
2733
|
-
function createRules(schema2, options) {
|
|
2734
|
-
return [
|
|
2735
|
-
...createWordRules(),
|
|
2736
|
-
...createNotionRules(),
|
|
2737
|
-
...createGDocsRules(schema2),
|
|
2738
|
-
...createHTMLRules(schema2, options)
|
|
2739
|
-
];
|
|
2740
|
-
}
|
|
2741
|
-
class HtmlDeserializer {
|
|
2742
|
-
keyGenerator;
|
|
2743
|
-
schema;
|
|
2744
|
-
rules;
|
|
2745
|
-
parseHtml;
|
|
2746
|
-
_markDefs = [];
|
|
2747
|
-
/**
|
|
2748
|
-
* Create a new serializer respecting a Sanity block content type's schema
|
|
2749
|
-
*
|
|
2750
|
-
* @param blockContentType - Schema type for array containing _at least_ a block child type
|
|
2751
|
-
* @param options - Options for the deserialization process
|
|
2752
|
-
*/
|
|
2753
|
-
constructor(schema2, options = {}) {
|
|
2754
|
-
const { rules = [], unstable_whitespaceOnPasteMode = "preserve" } = options, standardRules = createRules(schema2, {
|
|
2755
|
-
keyGenerator: options.keyGenerator,
|
|
2756
|
-
matchers: options.matchers
|
|
2757
|
-
});
|
|
2758
|
-
this.schema = schema2, this.keyGenerator = options.keyGenerator ?? keyGenerator, this.rules = [...rules, ...standardRules];
|
|
2759
|
-
const parseHtml = options.parseHtml || defaultParseHtml();
|
|
2760
|
-
this.parseHtml = (html) => preprocess$1(html, parseHtml, { unstable_whitespaceOnPasteMode }).body;
|
|
2761
|
-
}
|
|
2762
|
-
/**
|
|
2763
|
-
* Deserialize HTML.
|
|
2764
|
-
*
|
|
2765
|
-
* @param html - The HTML to deserialize, as a string
|
|
2766
|
-
* @returns Array of blocks - either portable text blocks or other allowed blocks
|
|
2767
|
-
*/
|
|
2768
|
-
deserialize = (html) => {
|
|
2769
|
-
this._markDefs = [];
|
|
2770
|
-
const { parseHtml } = this, fragment = parseHtml(html), children = Array.from(fragment.childNodes), blocks2 = trimWhitespace(
|
|
2771
|
-
this.schema,
|
|
2772
|
-
flattenNestedBlocks(
|
|
2773
|
-
{ schema: this.schema },
|
|
2774
|
-
ensureRootIsBlocks(
|
|
2775
|
-
this.schema,
|
|
2776
|
-
this.deserializeElements(children)
|
|
2777
|
-
)
|
|
2778
|
-
)
|
|
2779
|
-
);
|
|
2780
|
-
return this._markDefs.length > 0 && blocks2.filter((block) => isTextBlock({ schema: this.schema }, block)).forEach((block) => {
|
|
2781
|
-
block.markDefs = block.markDefs || [], block.markDefs = block.markDefs.concat(
|
|
2782
|
-
this._markDefs.filter((def) => flatten(
|
|
2783
|
-
block.children.map((child) => child.marks || [])
|
|
2784
|
-
).includes(def._key))
|
|
2785
|
-
);
|
|
2786
|
-
}), blocks2.map((block) => (block._type === "block" && (block._type = this.schema.block.name), block));
|
|
2787
|
-
};
|
|
2788
|
-
/**
|
|
2789
|
-
* Deserialize an array of DOM elements.
|
|
2790
|
-
*
|
|
2791
|
-
* @param elements - Array of DOM elements to deserialize
|
|
2792
|
-
* @returns
|
|
2793
|
-
*/
|
|
2794
|
-
deserializeElements = (elements = []) => {
|
|
2795
|
-
let nodes = [];
|
|
2796
|
-
return elements.forEach((element) => {
|
|
2797
|
-
nodes = nodes.concat(this.deserializeElement(element));
|
|
2798
|
-
}), nodes;
|
|
2799
|
-
};
|
|
2800
|
-
/**
|
|
2801
|
-
* Deserialize a DOM element
|
|
2802
|
-
*
|
|
2803
|
-
* @param element - Deserialize a DOM element
|
|
2804
|
-
* @returns
|
|
2805
|
-
*/
|
|
2806
|
-
deserializeElement = (element) => {
|
|
2807
|
-
const next2 = (elements) => {
|
|
2808
|
-
if (isNodeList(elements))
|
|
2809
|
-
return this.deserializeElements(Array.from(elements));
|
|
2810
|
-
if (Array.isArray(elements))
|
|
2811
|
-
return this.deserializeElements(elements);
|
|
2812
|
-
if (elements)
|
|
2813
|
-
return this.deserializeElement(elements);
|
|
2814
|
-
}, block = (props) => ({
|
|
2815
|
-
_type: "__block",
|
|
2816
|
-
block: props
|
|
2817
|
-
});
|
|
2818
|
-
let node2;
|
|
2819
|
-
for (let i = 0; i < this.rules.length; i++) {
|
|
2820
|
-
const rule = this.rules[i];
|
|
2821
|
-
if (!rule.deserialize)
|
|
2822
|
-
continue;
|
|
2823
|
-
const ret = rule.deserialize(element, next2, block), type = resolveJsType(ret);
|
|
2824
|
-
if (type !== "array" && type !== "object" && type !== "null" && type !== "undefined")
|
|
2825
|
-
throw new Error(
|
|
2826
|
-
`A rule returned an invalid deserialized representation: "${node2}".`
|
|
2827
|
-
);
|
|
2828
|
-
if (ret !== void 0) {
|
|
2829
|
-
{
|
|
2830
|
-
if (ret === null)
|
|
2831
|
-
throw new Error("Deserializer rule returned `null`");
|
|
2832
|
-
Array.isArray(ret) ? node2 = ret : isPlaceholderDecorator(ret) ? node2 = this.deserializeDecorator(ret) : isPlaceholderAnnotation(ret) ? node2 = this.deserializeAnnotation(ret) : node2 = ret;
|
|
2833
|
-
}
|
|
2834
|
-
if (ret && !Array.isArray(ret) && isMinimalBlock(ret) && "listItem" in ret) {
|
|
2835
|
-
let parent = element.parentNode?.parentNode;
|
|
2836
|
-
for (; parent && tagName(parent) === "li"; )
|
|
2837
|
-
parent = parent.parentNode?.parentNode, ret.level = ret.level ? ret.level + 1 : 1;
|
|
2838
|
-
}
|
|
2839
|
-
ret && !Array.isArray(ret) && isMinimalBlock(ret) && ret.style === "blockquote" && ret.children.forEach((child, index) => {
|
|
2840
|
-
isMinimalSpan(child) && child.text === "\r" && (child.text = `
|
|
2841
|
-
`, (index === 0 || index === ret.children.length - 1) && ret.children.splice(index, 1));
|
|
2842
|
-
});
|
|
2843
|
-
break;
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
return node2 || next2(element.childNodes) || [];
|
|
2847
|
-
};
|
|
2848
|
-
/**
|
|
2849
|
-
* Deserialize a `__decorator` type
|
|
2850
|
-
* (an internal made up type to process decorators exclusively)
|
|
2851
|
-
*
|
|
2852
|
-
* @param decorator -
|
|
2853
|
-
* @returns array of ...
|
|
2854
|
-
*/
|
|
2855
|
-
deserializeDecorator = (decorator) => {
|
|
2856
|
-
const { name } = decorator, applyDecorator = (node2) => {
|
|
2857
|
-
if (isPlaceholderDecorator(node2))
|
|
2858
|
-
return this.deserializeDecorator(node2);
|
|
2859
|
-
if (isMinimalSpan(node2))
|
|
2860
|
-
node2.marks = node2.marks || [], node2.text.trim() && node2.marks.unshift(name);
|
|
2861
|
-
else if ("children" in node2 && Array.isArray(node2.children)) {
|
|
2862
|
-
const block = node2;
|
|
2863
|
-
block.children = block.children.map(applyDecorator);
|
|
2864
|
-
}
|
|
2865
|
-
return node2;
|
|
2866
|
-
};
|
|
2867
|
-
return decorator.children.reduce((children, node2) => {
|
|
2868
|
-
const ret = applyDecorator(node2);
|
|
2869
|
-
return Array.isArray(ret) ? children.concat(ret) : (children.push(ret), children);
|
|
2870
|
-
}, []);
|
|
2871
|
-
};
|
|
2872
|
-
/**
|
|
2873
|
-
* Deserialize a `__annotation` object.
|
|
2874
|
-
* (an internal made up type to process annotations exclusively)
|
|
2875
|
-
*
|
|
2876
|
-
* @param annotation -
|
|
2877
|
-
* @returns Array of...
|
|
2878
|
-
*/
|
|
2879
|
-
deserializeAnnotation = (annotation) => {
|
|
2880
|
-
const { markDef } = annotation;
|
|
2881
|
-
this._markDefs.push(markDef);
|
|
2882
|
-
const applyAnnotation = (node2) => {
|
|
2883
|
-
if (isPlaceholderAnnotation(node2))
|
|
2884
|
-
return this.deserializeAnnotation(node2);
|
|
2885
|
-
if (isMinimalSpan(node2))
|
|
2886
|
-
node2.marks = node2.marks || [], node2.text.trim() && node2.marks.unshift(markDef._key);
|
|
2887
|
-
else if ("children" in node2 && Array.isArray(node2.children)) {
|
|
2888
|
-
const block = node2;
|
|
2889
|
-
block.children = block.children.map(applyAnnotation);
|
|
2890
|
-
}
|
|
2891
|
-
return node2;
|
|
2892
|
-
};
|
|
2893
|
-
return annotation.children.reduce((children, node2) => {
|
|
2894
|
-
const ret = applyAnnotation(node2);
|
|
2895
|
-
return Array.isArray(ret) ? children.concat(ret) : (children.push(ret), children);
|
|
2896
|
-
}, []);
|
|
2897
|
-
};
|
|
2898
|
-
}
|
|
2899
|
-
function normalizeBlock(node2, options = {}) {
|
|
2900
|
-
const schema2 = {
|
|
2901
|
-
block: {
|
|
2902
|
-
name: options.blockTypeName || "block"
|
|
2903
|
-
},
|
|
2904
|
-
span: {
|
|
2905
|
-
name: "span"
|
|
2906
|
-
},
|
|
2907
|
-
styles: [],
|
|
2908
|
-
lists: [],
|
|
2909
|
-
decorators: [],
|
|
2910
|
-
annotations: [],
|
|
2911
|
-
blockObjects: [],
|
|
2912
|
-
inlineObjects: []
|
|
2913
|
-
};
|
|
2914
|
-
if (node2._type !== (options.blockTypeName || "block"))
|
|
2915
|
-
return "_key" in node2 ? node2 : {
|
|
2916
|
-
...node2,
|
|
2917
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator()
|
|
2918
|
-
};
|
|
2919
|
-
const block = {
|
|
2920
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator(),
|
|
2921
|
-
children: [],
|
|
2922
|
-
markDefs: [],
|
|
2923
|
-
...node2
|
|
2924
|
-
}, lastChild = block.children[block.children.length - 1];
|
|
2925
|
-
if (!lastChild)
|
|
2926
|
-
return block.children = [
|
|
2927
|
-
{
|
|
2928
|
-
_type: "span",
|
|
2929
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator(),
|
|
2930
|
-
text: "",
|
|
2931
|
-
marks: []
|
|
2932
|
-
}
|
|
2933
|
-
], block;
|
|
2934
|
-
const usedMarkDefs = [], allowedDecorators = options.allowedDecorators && Array.isArray(options.allowedDecorators) ? options.allowedDecorators : !1;
|
|
2935
|
-
return block.children = block.children.reduce(
|
|
2936
|
-
(acc, child) => {
|
|
2937
|
-
const previousChild = acc[acc.length - 1];
|
|
2938
|
-
return previousChild && isSpan({ schema: schema2 }, child) && isSpan({ schema: schema2 }, previousChild) && isEqual(previousChild.marks, child.marks) ? (lastChild && lastChild === child && child.text === "" && block.children.length > 1 || (previousChild.text += child.text), acc) : (acc.push(child), acc);
|
|
2939
|
-
},
|
|
2940
|
-
[]
|
|
2941
|
-
).map((child) => {
|
|
2942
|
-
if (!child)
|
|
2943
|
-
throw new Error("missing child");
|
|
2944
|
-
return child._key = options.keyGenerator ? options.keyGenerator() : keyGenerator(), isSpan({ schema: schema2 }, child) && (child.marks ? allowedDecorators && (child.marks = child.marks.filter((mark) => {
|
|
2945
|
-
const isAllowed = allowedDecorators.includes(mark), isUsed = block.markDefs?.some((def) => def._key === mark);
|
|
2946
|
-
return isAllowed || isUsed;
|
|
2947
|
-
})) : child.marks = [], usedMarkDefs.push(...child.marks)), child;
|
|
2948
|
-
}), block.markDefs = (block.markDefs || []).filter(
|
|
2949
|
-
(markDef) => usedMarkDefs.includes(markDef._key)
|
|
2950
|
-
), block;
|
|
2951
|
-
}
|
|
2952
|
-
function htmlToBlocks(html, schemaType, options = {}) {
|
|
2953
|
-
const schema2 = isSanitySchema(schemaType) ? sanitySchemaToPortableTextSchema(schemaType) : schemaType;
|
|
2954
|
-
return new HtmlDeserializer(schema2, options).deserialize(html).map((block) => normalizeBlock(block, { keyGenerator: options.keyGenerator }));
|
|
2955
|
-
}
|
|
2956
|
-
function isSanitySchema(schema2) {
|
|
2957
|
-
return schema2.hasOwnProperty("jsonType");
|
|
2958
|
-
}
|
|
2959
|
-
const defaultSchema = schema.Schema.compile({
|
|
171
|
+
}, defaultSchema = schema.Schema.compile({
|
|
2960
172
|
name: "default",
|
|
2961
173
|
types: [
|
|
2962
174
|
{
|
|
@@ -2972,7 +184,7 @@ const defaultSchema = schema.Schema.compile({
|
|
|
2972
184
|
}
|
|
2973
185
|
]
|
|
2974
186
|
}), blockContentType = defaultSchema.get("default").fields.find((field) => field.name === "block").type, preprocess = (html) => {
|
|
2975
|
-
const intermediateBlocks = htmlToBlocks(
|
|
187
|
+
const intermediateBlocks = blockTools.htmlToBlocks(
|
|
2976
188
|
`<p>${html}</p>`,
|
|
2977
189
|
blockContentType
|
|
2978
190
|
);
|
|
@@ -3064,7 +276,7 @@ const defaultStopTypes = [
|
|
|
3064
276
|
deserialize(el, next2) {
|
|
3065
277
|
if (!el.hasChildNodes() || !el.getAttribute("data-gt-internal"))
|
|
3066
278
|
return;
|
|
3067
|
-
const { html, data } = detachGTData(el.outerHTML), block = htmlToBlocks(html, blockContentType)[0], children = next2(el.childNodes);
|
|
279
|
+
const { html, data } = detachGTData(el.outerHTML), block = blockTools.htmlToBlocks(html, blockContentType)[0], children = next2(el.childNodes);
|
|
3068
280
|
let markDefs = [];
|
|
3069
281
|
return "markDefs" in block && (markDefs = block.markDefs ?? []), data?.markDef && markDefs.push(data.markDef), children && children.forEach((child) => {
|
|
3070
282
|
child.marks = data?.markDef?._key ? [...child.marks || [], data.markDef._key] : [...child.marks || []];
|
|
@@ -3082,7 +294,7 @@ const defaultStopTypes = [
|
|
|
3082
294
|
return;
|
|
3083
295
|
const style = el.getAttribute("data-style") ?? "";
|
|
3084
296
|
return {
|
|
3085
|
-
...htmlToBlocks(el.outerHTML, blockContentType)[0],
|
|
297
|
+
...blockTools.htmlToBlocks(el.outerHTML, blockContentType)[0],
|
|
3086
298
|
style,
|
|
3087
299
|
children: next2(el.childNodes)
|
|
3088
300
|
};
|
|
@@ -3103,10 +315,10 @@ const defaultStopTypes = [
|
|
|
3103
315
|
if (!listItem)
|
|
3104
316
|
return;
|
|
3105
317
|
const level = el.getAttribute("data-level") && parseInt(el.getAttribute("data-level") || "0", 10), _key = el.id;
|
|
3106
|
-
let block = htmlToBlocks(parent.outerHTML, blockContentType)[0];
|
|
318
|
+
let block = blockTools.htmlToBlocks(parent.outerHTML, blockContentType)[0];
|
|
3107
319
|
const customStyle = el.children?.[0]?.getAttribute("data-style");
|
|
3108
320
|
if (new RegExp(/<("[^"]*"|'[^']*'|[^'">])*>/).test(el.innerHTML)) {
|
|
3109
|
-
const newBlock = htmlToBlocks(el.innerHTML, blockContentType)[0];
|
|
321
|
+
const newBlock = blockTools.htmlToBlocks(el.innerHTML, blockContentType)[0];
|
|
3110
322
|
if (newBlock && (block = {
|
|
3111
323
|
...block,
|
|
3112
324
|
...newBlock,
|
|
@@ -3174,7 +386,7 @@ const defaultStopTypes = [
|
|
|
3174
386
|
obj[field] && (filteredObj[field] = obj[field]);
|
|
3175
387
|
}), filteredObj;
|
|
3176
388
|
}, META_FIELDS = ["_key", "_type", "_id", "_weak"], BaseDocumentSerializer = (schemas) => {
|
|
3177
|
-
const getSchema = (name) => schemas?._original?.types.find((
|
|
389
|
+
const getSchema = (name) => schemas?._original?.types.find((s) => s.name === name), serializeObject = (obj, stopTypes, serializers) => {
|
|
3178
390
|
if (stopTypes.includes(obj._type))
|
|
3179
391
|
return "";
|
|
3180
392
|
if (serializers.types && Object.keys(serializers.types).includes(obj._type))
|
|
@@ -3300,10 +512,10 @@ const defaultStopTypes = [
|
|
|
3300
512
|
serializeObject
|
|
3301
513
|
};
|
|
3302
514
|
};
|
|
3303
|
-
function mergeBlocks(
|
|
3304
|
-
const mergedBlock = { ...
|
|
515
|
+
function mergeBlocks(blocks) {
|
|
516
|
+
const mergedBlock = { ...blocks[0] };
|
|
3305
517
|
mergedBlock.markDefs = mergedBlock.markDefs ?? [];
|
|
3306
|
-
for (const [idx, block] of
|
|
518
|
+
for (const [idx, block] of blocks.entries())
|
|
3307
519
|
idx !== 0 && (mergedBlock.children.push(...block.children), mergedBlock.markDefs.push(...block.markDefs ?? []));
|
|
3308
520
|
return mergedBlock._type = "block", mergedBlock;
|
|
3309
521
|
}
|
|
@@ -3316,7 +528,7 @@ const deserializeArray = (arrayHTML, deserializers = customDeserializers, blockD
|
|
|
3316
528
|
child,
|
|
3317
529
|
deserializers,
|
|
3318
530
|
blockDeserializers
|
|
3319
|
-
), deserializedObject._key = child.id) : (deserializedObject = htmlToBlocks(child.outerHTML, blockContentType, {
|
|
531
|
+
), deserializedObject._key = child.id) : (deserializedObject = blockTools.htmlToBlocks(child.outerHTML, blockContentType, {
|
|
3320
532
|
rules: blockDeserializers
|
|
3321
533
|
}), deserializedObject = mergeBlocks(deserializedObject), deserializedObject._key = child.id);
|
|
3322
534
|
} catch (e) {
|
|
@@ -3375,7 +587,7 @@ const deserializeArray = (arrayHTML, deserializers = customDeserializers, blockD
|
|
|
3375
587
|
deserializeDocument: deserializeDocument$1,
|
|
3376
588
|
deserializeHTML
|
|
3377
589
|
};
|
|
3378
|
-
var lodash$1 = { exports: {} };
|
|
590
|
+
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, lodash$1 = { exports: {} };
|
|
3379
591
|
/**
|
|
3380
592
|
* @license
|
|
3381
593
|
* Lodash <https://lodash.com/>
|
|
@@ -4184,7 +1396,7 @@ function requireLodash() {
|
|
|
4184
1396
|
}
|
|
4185
1397
|
Stack.prototype.clear = stackClear, Stack.prototype.delete = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet;
|
|
4186
1398
|
function arrayLikeKeys(value, inherited) {
|
|
4187
|
-
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg &&
|
|
1399
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length2 = result2.length;
|
|
4188
1400
|
for (var key in value)
|
|
4189
1401
|
(inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
4190
1402
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
@@ -4255,7 +1467,7 @@ function requireLodash() {
|
|
|
4255
1467
|
return copyArray(value, result2);
|
|
4256
1468
|
} else {
|
|
4257
1469
|
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
4258
|
-
if (
|
|
1470
|
+
if (isBuffer(value))
|
|
4259
1471
|
return cloneBuffer(value, isDeep);
|
|
4260
1472
|
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
4261
1473
|
if (result2 = isFlat || isFunc ? {} : initCloneObject(value), !isDeep)
|
|
@@ -4379,7 +1591,7 @@ function requireLodash() {
|
|
|
4379
1591
|
return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
|
|
4380
1592
|
}
|
|
4381
1593
|
function baseGetTag(value) {
|
|
4382
|
-
return value == null ? value === undefined$1 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) :
|
|
1594
|
+
return value == null ? value === undefined$1 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
|
|
4383
1595
|
}
|
|
4384
1596
|
function baseGt(value, other) {
|
|
4385
1597
|
return value > other;
|
|
@@ -4440,8 +1652,8 @@ function requireLodash() {
|
|
|
4440
1652
|
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
4441
1653
|
objTag = objTag == argsTag ? objectTag : objTag, othTag = othTag == argsTag ? objectTag : othTag;
|
|
4442
1654
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
4443
|
-
if (isSameTag &&
|
|
4444
|
-
if (!
|
|
1655
|
+
if (isSameTag && isBuffer(object)) {
|
|
1656
|
+
if (!isBuffer(other))
|
|
4445
1657
|
return !1;
|
|
4446
1658
|
objIsArr = !0, objIsObj = !1;
|
|
4447
1659
|
}
|
|
@@ -4557,7 +1769,7 @@ function requireLodash() {
|
|
|
4557
1769
|
}
|
|
4558
1770
|
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined$1, isCommon = newValue === undefined$1;
|
|
4559
1771
|
if (isCommon) {
|
|
4560
|
-
var isArr = isArray(srcValue), isBuff = !isArr &&
|
|
1772
|
+
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
4561
1773
|
newValue = srcValue, isArr || isBuff || isTyped ? isArray(objValue) ? newValue = objValue : isArrayLikeObject(objValue) ? newValue = copyArray(objValue) : isBuff ? (isCommon = !1, newValue = cloneBuffer(srcValue, !0)) : isTyped ? (isCommon = !1, newValue = cloneTypedArray(srcValue, !0)) : newValue = [] : isPlainObject(srcValue) || isArguments(srcValue) ? (newValue = objValue, isArguments(objValue) ? newValue = toPlainObject(objValue) : (!isObject(objValue) || isFunction(objValue)) && (newValue = initCloneObject(srcValue))) : isCommon = !1;
|
|
4562
1774
|
}
|
|
4563
1775
|
isCommon && (stack.set(srcValue, newValue), mergeFunc(newValue, srcValue, srcIndex, customizer, stack), stack.delete(srcValue)), assignMergeValue(object, key, newValue);
|
|
@@ -5295,7 +2507,7 @@ function requireLodash() {
|
|
|
5295
2507
|
return stack.delete(object), stack.delete(other), result2;
|
|
5296
2508
|
}
|
|
5297
2509
|
function flatRest(func) {
|
|
5298
|
-
return setToString(overRest(func, undefined$1,
|
|
2510
|
+
return setToString(overRest(func, undefined$1, flatten), func + "");
|
|
5299
2511
|
}
|
|
5300
2512
|
function getAllKeys(object) {
|
|
5301
2513
|
return baseGetAllKeys(object, keys, getSymbols);
|
|
@@ -5529,7 +2741,7 @@ function requireLodash() {
|
|
|
5529
2741
|
result2.push(key);
|
|
5530
2742
|
return result2;
|
|
5531
2743
|
}
|
|
5532
|
-
function
|
|
2744
|
+
function objectToString(value) {
|
|
5533
2745
|
return nativeObjectToString.call(value);
|
|
5534
2746
|
}
|
|
5535
2747
|
function overRest(func, start, transform2) {
|
|
@@ -5685,7 +2897,7 @@ function requireLodash() {
|
|
|
5685
2897
|
var index = length2 - 1;
|
|
5686
2898
|
return fromIndex !== undefined$1 && (index = toInteger(fromIndex), index = fromIndex < 0 ? nativeMax(length2 + index, 0) : nativeMin(index, length2 - 1)), baseFindIndex(array, getIteratee(predicate, 3), index, !0);
|
|
5687
2899
|
}
|
|
5688
|
-
function
|
|
2900
|
+
function flatten(array) {
|
|
5689
2901
|
var length2 = array == null ? 0 : array.length;
|
|
5690
2902
|
return length2 ? baseFlatten(array, 1) : [];
|
|
5691
2903
|
}
|
|
@@ -5841,7 +3053,7 @@ function requireLodash() {
|
|
|
5841
3053
|
var comparator = last(arrays);
|
|
5842
3054
|
return comparator = typeof comparator == "function" ? comparator : undefined$1, baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, !0), undefined$1, comparator);
|
|
5843
3055
|
});
|
|
5844
|
-
function
|
|
3056
|
+
function uniq(array) {
|
|
5845
3057
|
return array && array.length ? baseUniq(array) : [];
|
|
5846
3058
|
}
|
|
5847
3059
|
function uniqBy(array, iteratee2) {
|
|
@@ -6271,14 +3483,14 @@ function requireLodash() {
|
|
|
6271
3483
|
function isBoolean(value) {
|
|
6272
3484
|
return value === !0 || value === !1 || isObjectLike(value) && baseGetTag(value) == boolTag;
|
|
6273
3485
|
}
|
|
6274
|
-
var
|
|
6275
|
-
function
|
|
3486
|
+
var isBuffer = nativeIsBuffer || stubFalse, isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
3487
|
+
function isElement(value) {
|
|
6276
3488
|
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
|
6277
3489
|
}
|
|
6278
3490
|
function isEmpty(value) {
|
|
6279
3491
|
if (value == null)
|
|
6280
3492
|
return !0;
|
|
6281
|
-
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" ||
|
|
3493
|
+
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value)))
|
|
6282
3494
|
return !value.length;
|
|
6283
3495
|
var tag = getTag(value);
|
|
6284
3496
|
if (tag == mapTag || tag == setTag)
|
|
@@ -6290,7 +3502,7 @@ function requireLodash() {
|
|
|
6290
3502
|
return !1;
|
|
6291
3503
|
return !0;
|
|
6292
3504
|
}
|
|
6293
|
-
function
|
|
3505
|
+
function isEqual(value, other) {
|
|
6294
3506
|
return baseIsEqual(value, other);
|
|
6295
3507
|
}
|
|
6296
3508
|
function isEqualWith(value, other, customizer) {
|
|
@@ -6569,7 +3781,7 @@ function requireLodash() {
|
|
|
6569
3781
|
}
|
|
6570
3782
|
var toPairs = createToPairs(keys), toPairsIn = createToPairs(keysIn);
|
|
6571
3783
|
function transform(object, iteratee2, accumulator) {
|
|
6572
|
-
var isArr = isArray(object), isArrLike = isArr ||
|
|
3784
|
+
var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
|
|
6573
3785
|
if (iteratee2 = getIteratee(iteratee2, 4), accumulator == null) {
|
|
6574
3786
|
var Ctor = object && object.constructor;
|
|
6575
3787
|
isArrLike ? accumulator = isArr ? new Ctor() : [] : isObject(object) ? accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {} : accumulator = {};
|
|
@@ -6948,7 +4160,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6948
4160
|
function sumBy(array, iteratee2) {
|
|
6949
4161
|
return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
|
|
6950
4162
|
}
|
|
6951
|
-
return lodash2.after = after, lodash2.ary = ary, lodash2.assign = assign2, lodash2.assignIn = assignIn, lodash2.assignInWith = assignInWith, lodash2.assignWith = assignWith, lodash2.at = at2, lodash2.before = before, lodash2.bind = bind, lodash2.bindAll = bindAll, lodash2.bindKey = bindKey, lodash2.castArray = castArray, lodash2.chain = chain, lodash2.chunk = chunk, lodash2.compact = compact, lodash2.concat = concat, lodash2.cond = cond, lodash2.conforms = conforms, lodash2.constant = constant, lodash2.countBy = countBy, lodash2.create = create, lodash2.curry = curry, lodash2.curryRight = curryRight, lodash2.debounce = debounce, lodash2.defaults = defaults, lodash2.defaultsDeep = defaultsDeep, lodash2.defer = defer, lodash2.delay = delay, lodash2.difference = difference, lodash2.differenceBy = differenceBy, lodash2.differenceWith = differenceWith, lodash2.drop = drop, lodash2.dropRight = dropRight, lodash2.dropRightWhile = dropRightWhile, lodash2.dropWhile = dropWhile, lodash2.fill = fill, lodash2.filter = filter2, lodash2.flatMap = flatMap, lodash2.flatMapDeep = flatMapDeep, lodash2.flatMapDepth = flatMapDepth, lodash2.flatten =
|
|
4163
|
+
return lodash2.after = after, lodash2.ary = ary, lodash2.assign = assign2, lodash2.assignIn = assignIn, lodash2.assignInWith = assignInWith, lodash2.assignWith = assignWith, lodash2.at = at2, lodash2.before = before, lodash2.bind = bind, lodash2.bindAll = bindAll, lodash2.bindKey = bindKey, lodash2.castArray = castArray, lodash2.chain = chain, lodash2.chunk = chunk, lodash2.compact = compact, lodash2.concat = concat, lodash2.cond = cond, lodash2.conforms = conforms, lodash2.constant = constant, lodash2.countBy = countBy, lodash2.create = create, lodash2.curry = curry, lodash2.curryRight = curryRight, lodash2.debounce = debounce, lodash2.defaults = defaults, lodash2.defaultsDeep = defaultsDeep, lodash2.defer = defer, lodash2.delay = delay, lodash2.difference = difference, lodash2.differenceBy = differenceBy, lodash2.differenceWith = differenceWith, lodash2.drop = drop, lodash2.dropRight = dropRight, lodash2.dropRightWhile = dropRightWhile, lodash2.dropWhile = dropWhile, lodash2.fill = fill, lodash2.filter = filter2, lodash2.flatMap = flatMap, lodash2.flatMapDeep = flatMapDeep, lodash2.flatMapDepth = flatMapDepth, lodash2.flatten = flatten, lodash2.flattenDeep = flattenDeep, lodash2.flattenDepth = flattenDepth, lodash2.flip = flip, lodash2.flow = flow, lodash2.flowRight = flowRight, lodash2.fromPairs = fromPairs, lodash2.functions = functions, lodash2.functionsIn = functionsIn, lodash2.groupBy = groupBy, lodash2.initial = initial, lodash2.intersection = intersection, lodash2.intersectionBy = intersectionBy, lodash2.intersectionWith = intersectionWith, lodash2.invert = invert, lodash2.invertBy = invertBy, lodash2.invokeMap = invokeMap, lodash2.iteratee = iteratee, lodash2.keyBy = keyBy, lodash2.keys = keys, lodash2.keysIn = keysIn, lodash2.map = map, lodash2.mapKeys = mapKeys, lodash2.mapValues = mapValues, lodash2.matches = matches, lodash2.matchesProperty = matchesProperty, lodash2.memoize = memoize2, lodash2.merge = merge, lodash2.mergeWith = mergeWith, lodash2.method = method, lodash2.methodOf = methodOf, lodash2.mixin = mixin, lodash2.negate = negate, lodash2.nthArg = nthArg, lodash2.omit = omit, lodash2.omitBy = omitBy, lodash2.once = once, lodash2.orderBy = orderBy, lodash2.over = over, lodash2.overArgs = overArgs, lodash2.overEvery = overEvery, lodash2.overSome = overSome, lodash2.partial = partial, lodash2.partialRight = partialRight, lodash2.partition = partition, lodash2.pick = pick, lodash2.pickBy = pickBy, lodash2.property = property, lodash2.propertyOf = propertyOf, lodash2.pull = pull, lodash2.pullAll = pullAll, lodash2.pullAllBy = pullAllBy, lodash2.pullAllWith = pullAllWith, lodash2.pullAt = pullAt, lodash2.range = range, lodash2.rangeRight = rangeRight, lodash2.rearg = rearg, lodash2.reject = reject, lodash2.remove = remove, lodash2.rest = rest, lodash2.reverse = reverse, lodash2.sampleSize = sampleSize, lodash2.set = set, lodash2.setWith = setWith, lodash2.shuffle = shuffle, lodash2.slice = slice2, lodash2.sortBy = sortBy, lodash2.sortedUniq = sortedUniq, lodash2.sortedUniqBy = sortedUniqBy, lodash2.split = split, lodash2.spread = spread, lodash2.tail = tail, lodash2.take = take, lodash2.takeRight = takeRight, lodash2.takeRightWhile = takeRightWhile, lodash2.takeWhile = takeWhile, lodash2.tap = tap, lodash2.throttle = throttle, lodash2.thru = thru, lodash2.toArray = toArray, lodash2.toPairs = toPairs, lodash2.toPairsIn = toPairsIn, lodash2.toPath = toPath, lodash2.toPlainObject = toPlainObject, lodash2.transform = transform, lodash2.unary = unary, lodash2.union = union, lodash2.unionBy = unionBy, lodash2.unionWith = unionWith, lodash2.uniq = uniq, lodash2.uniqBy = uniqBy, lodash2.uniqWith = uniqWith, lodash2.unset = unset, lodash2.unzip = unzip, lodash2.unzipWith = unzipWith, lodash2.update = update, lodash2.updateWith = updateWith, lodash2.values = values, lodash2.valuesIn = valuesIn, lodash2.without = without, lodash2.words = words, lodash2.wrap = wrap, lodash2.xor = xor, lodash2.xorBy = xorBy, lodash2.xorWith = xorWith, lodash2.zip = zip, lodash2.zipObject = zipObject, lodash2.zipObjectDeep = zipObjectDeep, lodash2.zipWith = zipWith, lodash2.entries = toPairs, lodash2.entriesIn = toPairsIn, lodash2.extend = assignIn, lodash2.extendWith = assignInWith, mixin(lodash2, lodash2), lodash2.add = add, lodash2.attempt = attempt, lodash2.camelCase = camelCase, lodash2.capitalize = capitalize, lodash2.ceil = ceil, lodash2.clamp = clamp, lodash2.clone = clone, lodash2.cloneDeep = cloneDeep, lodash2.cloneDeepWith = cloneDeepWith, lodash2.cloneWith = cloneWith, lodash2.conformsTo = conformsTo, lodash2.deburr = deburr, lodash2.defaultTo = defaultTo, lodash2.divide = divide, lodash2.endsWith = endsWith, lodash2.eq = eq, lodash2.escape = escape, lodash2.escapeRegExp = escapeRegExp, lodash2.every = every, lodash2.find = find, lodash2.findIndex = findIndex, lodash2.findKey = findKey, lodash2.findLast = findLast, lodash2.findLastIndex = findLastIndex, lodash2.findLastKey = findLastKey, lodash2.floor = floor, lodash2.forEach = forEach, lodash2.forEachRight = forEachRight, lodash2.forIn = forIn, lodash2.forInRight = forInRight, lodash2.forOwn = forOwn, lodash2.forOwnRight = forOwnRight, lodash2.get = get, lodash2.gt = gt2, lodash2.gte = gte, lodash2.has = has, lodash2.hasIn = hasIn, lodash2.head = head, lodash2.identity = identity, lodash2.includes = includes, lodash2.indexOf = indexOf, lodash2.inRange = inRange, lodash2.invoke = invoke, lodash2.isArguments = isArguments, lodash2.isArray = isArray, lodash2.isArrayBuffer = isArrayBuffer, lodash2.isArrayLike = isArrayLike, lodash2.isArrayLikeObject = isArrayLikeObject, lodash2.isBoolean = isBoolean, lodash2.isBuffer = isBuffer, lodash2.isDate = isDate, lodash2.isElement = isElement, lodash2.isEmpty = isEmpty, lodash2.isEqual = isEqual, lodash2.isEqualWith = isEqualWith, lodash2.isError = isError, lodash2.isFinite = isFinite, lodash2.isFunction = isFunction, lodash2.isInteger = isInteger, lodash2.isLength = isLength, lodash2.isMap = isMap, lodash2.isMatch = isMatch, lodash2.isMatchWith = isMatchWith, lodash2.isNaN = isNaN, lodash2.isNative = isNative, lodash2.isNil = isNil, lodash2.isNull = isNull, lodash2.isNumber = isNumber, lodash2.isObject = isObject, lodash2.isObjectLike = isObjectLike, lodash2.isPlainObject = isPlainObject, lodash2.isRegExp = isRegExp, lodash2.isSafeInteger = isSafeInteger, lodash2.isSet = isSet, lodash2.isString = isString, lodash2.isSymbol = isSymbol, lodash2.isTypedArray = isTypedArray, lodash2.isUndefined = isUndefined, lodash2.isWeakMap = isWeakMap, lodash2.isWeakSet = isWeakSet, lodash2.join = join, lodash2.kebabCase = kebabCase, lodash2.last = last, lodash2.lastIndexOf = lastIndexOf, lodash2.lowerCase = lowerCase, lodash2.lowerFirst = lowerFirst, lodash2.lt = lt2, lodash2.lte = lte, lodash2.max = max, lodash2.maxBy = maxBy, lodash2.mean = mean, lodash2.meanBy = meanBy, lodash2.min = min, lodash2.minBy = minBy, lodash2.stubArray = stubArray, lodash2.stubFalse = stubFalse, lodash2.stubObject = stubObject, lodash2.stubString = stubString, lodash2.stubTrue = stubTrue, lodash2.multiply = multiply, lodash2.nth = nth, lodash2.noConflict = noConflict, lodash2.noop = noop, lodash2.now = now, lodash2.pad = pad, lodash2.padEnd = padEnd, lodash2.padStart = padStart, lodash2.parseInt = parseInt2, lodash2.random = random, lodash2.reduce = reduce, lodash2.reduceRight = reduceRight, lodash2.repeat = repeat, lodash2.replace = replace2, lodash2.result = result, lodash2.round = round, lodash2.runInContext = runInContext2, lodash2.sample = sample, lodash2.size = size, lodash2.snakeCase = snakeCase, lodash2.some = some, lodash2.sortedIndex = sortedIndex, lodash2.sortedIndexBy = sortedIndexBy, lodash2.sortedIndexOf = sortedIndexOf, lodash2.sortedLastIndex = sortedLastIndex, lodash2.sortedLastIndexBy = sortedLastIndexBy, lodash2.sortedLastIndexOf = sortedLastIndexOf, lodash2.startCase = startCase, lodash2.startsWith = startsWith, lodash2.subtract = subtract, lodash2.sum = sum, lodash2.sumBy = sumBy, lodash2.template = template, lodash2.times = times, lodash2.toFinite = toFinite, lodash2.toInteger = toInteger, lodash2.toLength = toLength, lodash2.toLower = toLower, lodash2.toNumber = toNumber, lodash2.toSafeInteger = toSafeInteger, lodash2.toString = toString, lodash2.toUpper = toUpper, lodash2.trim = trim2, lodash2.trimEnd = trimEnd, lodash2.trimStart = trimStart, lodash2.truncate = truncate, lodash2.unescape = unescape, lodash2.uniqueId = uniqueId, lodash2.upperCase = upperCase, lodash2.upperFirst = upperFirst, lodash2.each = forEach, lodash2.eachRight = forEachRight, lodash2.first = head, mixin(lodash2, (function() {
|
|
6952
4164
|
var source = {};
|
|
6953
4165
|
return baseForOwn(lodash2, function(func, methodName) {
|
|
6954
4166
|
hasOwnProperty.call(lodash2.prototype, methodName) || (source[methodName] = func);
|
|
@@ -8214,9 +5426,9 @@ const LanguageStatus = ({
|
|
|
8214
5426
|
};
|
|
8215
5427
|
var __assign = function() {
|
|
8216
5428
|
return __assign = Object.assign || function(t) {
|
|
8217
|
-
for (var
|
|
8218
|
-
|
|
8219
|
-
for (var p in
|
|
5429
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5430
|
+
s = arguments[i];
|
|
5431
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
8220
5432
|
}
|
|
8221
5433
|
return t;
|
|
8222
5434
|
}, __assign.apply(this, arguments);
|
|
@@ -8670,8 +5882,8 @@ function prefix(value, length2, children) {
|
|
|
8670
5882
|
// grid-(column|row)
|
|
8671
5883
|
case 5152:
|
|
8672
5884
|
case 5920:
|
|
8673
|
-
return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a, b,
|
|
8674
|
-
return MS + a + ":" + b + f2 + (
|
|
5885
|
+
return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a, b, c, d, e, f2) {
|
|
5886
|
+
return MS + a + ":" + b + f2 + (c ? MS + a + "-span:" + (d ? e : +e - +b) + f2 : "") + value;
|
|
8675
5887
|
});
|
|
8676
5888
|
// position: sticky
|
|
8677
5889
|
case 4949:
|
|
@@ -8810,7 +6022,7 @@ var unitlessKeys = {
|
|
|
8810
6022
|
}, f = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", m = "active", y = "data-styled-version", v = "6.1.19", g = `/*!sc*/
|
|
8811
6023
|
`, S = typeof window < "u" && typeof document < "u", w = !!(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== "" ? process.env.REACT_APP_SC_DISABLE_SPEEDY !== "false" && process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.SC_DISABLE_SPEEDY !== void 0 && process.env.SC_DISABLE_SPEEDY !== "" ? process.env.SC_DISABLE_SPEEDY !== "false" && process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== "production"), E = /invalid hook call/i, N = /* @__PURE__ */ new Set(), P = function(t, n) {
|
|
8812
6024
|
if (process.env.NODE_ENV !== "production") {
|
|
8813
|
-
var o$1 = n ? ' with the id of "'.concat(n, '"') : "",
|
|
6025
|
+
var o$1 = n ? ' with the id of "'.concat(n, '"') : "", s = "The component ".concat(t).concat(o$1, ` has been created dynamically.
|
|
8814
6026
|
`) + `You may see this warning because you've called styled inside another component.
|
|
8815
6027
|
To resolve this only create new StyledComponents outside of any render method and function component.
|
|
8816
6028
|
See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
|
|
@@ -8819,10 +6031,10 @@ See https://styled-components.com/docs/basics#define-styled-components-outside-o
|
|
|
8819
6031
|
var a = !0;
|
|
8820
6032
|
console.error = function(t2) {
|
|
8821
6033
|
for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2];
|
|
8822
|
-
E.test(t2) ? (a = !1, N.delete(
|
|
8823
|
-
}, o.useRef(), a && !N.has(
|
|
6034
|
+
E.test(t2) ? (a = !1, N.delete(s)) : i.apply(void 0, __spreadArray([t2], n2, !1));
|
|
6035
|
+
}, o.useRef(), a && !N.has(s) && (console.warn(s), N.add(s));
|
|
8824
6036
|
} catch (e) {
|
|
8825
|
-
E.test(e.message) && N.delete(
|
|
6037
|
+
E.test(e.message) && N.delete(s);
|
|
8826
6038
|
} finally {
|
|
8827
6039
|
console.error = i;
|
|
8828
6040
|
}
|
|
@@ -8872,12 +6084,12 @@ function oe(e, t, n) {
|
|
|
8872
6084
|
}
|
|
8873
6085
|
var r = K(t);
|
|
8874
6086
|
Q && (r = r.concat(Q(t)));
|
|
8875
|
-
for (var
|
|
8876
|
-
var
|
|
8877
|
-
if (!(
|
|
8878
|
-
var l = ee(t,
|
|
6087
|
+
for (var s = X(e), i = X(t), a = 0; a < r.length; ++a) {
|
|
6088
|
+
var c = r[a];
|
|
6089
|
+
if (!(c in H || n && n[c] || i && c in i || s && c in s)) {
|
|
6090
|
+
var l = ee(t, c);
|
|
8879
6091
|
try {
|
|
8880
|
-
Z(e,
|
|
6092
|
+
Z(e, c, l);
|
|
8881
6093
|
} catch {
|
|
8882
6094
|
}
|
|
8883
6095
|
}
|
|
@@ -8955,7 +6167,7 @@ Has styled-components' style tag been unmounted or altered by another script?
|
|
|
8955
6167
|
`, 18: "ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`" } : {};
|
|
8956
6168
|
function de() {
|
|
8957
6169
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
8958
|
-
for (var n = e[0], o2 = [], r = 1,
|
|
6170
|
+
for (var n = e[0], o2 = [], r = 1, s = e.length; r < s; r += 1) o2.push(e[r]);
|
|
8959
6171
|
return o2.forEach(function(e2) {
|
|
8960
6172
|
n = n.replace(/%[a-z]/, e2);
|
|
8961
6173
|
}), n;
|
|
@@ -8975,9 +6187,9 @@ var fe = (function() {
|
|
|
8975
6187
|
if (e2 >= this.groupSizes.length) {
|
|
8976
6188
|
for (var n = this.groupSizes, o2 = n.length, r = o2; e2 >= r; ) if ((r <<= 1) < 0) throw he(16, "".concat(e2));
|
|
8977
6189
|
this.groupSizes = new Uint32Array(r), this.groupSizes.set(n), this.length = r;
|
|
8978
|
-
for (var
|
|
6190
|
+
for (var s = o2; s < r; s++) this.groupSizes[s] = 0;
|
|
8979
6191
|
}
|
|
8980
|
-
for (var i = this.indexOfGroup(e2 + 1), a = (
|
|
6192
|
+
for (var i = this.indexOfGroup(e2 + 1), a = (s = 0, t.length); s < a; s++) this.tag.insertRule(i, t[s]) && (this.groupSizes[e2]++, i++);
|
|
8981
6193
|
}, e.prototype.clearGroup = function(e2) {
|
|
8982
6194
|
if (e2 < this.length) {
|
|
8983
6195
|
var t = this.groupSizes[e2], n = this.indexOfGroup(e2), o2 = n + t;
|
|
@@ -8987,7 +6199,7 @@ var fe = (function() {
|
|
|
8987
6199
|
}, e.prototype.getGroup = function(e2) {
|
|
8988
6200
|
var t = "";
|
|
8989
6201
|
if (e2 >= this.length || this.groupSizes[e2] === 0) return t;
|
|
8990
|
-
for (var n = this.groupSizes[e2], o2 = this.indexOfGroup(e2), r = o2 + n,
|
|
6202
|
+
for (var n = this.groupSizes[e2], o2 = this.indexOfGroup(e2), r = o2 + n, s = o2; s < r; s++) t += "".concat(this.tag.getRule(s)).concat(g);
|
|
8991
6203
|
return t;
|
|
8992
6204
|
}, e;
|
|
8993
6205
|
})(), me = 1 << 30, ye = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ge = 1, Se = function(e) {
|
|
@@ -8999,15 +6211,15 @@ var fe = (function() {
|
|
|
8999
6211
|
}, we = function(e, t) {
|
|
9000
6212
|
ge = t + 1, ye.set(e, t), ve.set(t, e);
|
|
9001
6213
|
}, be = "style[".concat(f, "][").concat(y, '="').concat(v, '"]'), Ee = new RegExp("^".concat(f, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Ne = function(e, t, n) {
|
|
9002
|
-
for (var o2, r = n.split(","),
|
|
6214
|
+
for (var o2, r = n.split(","), s = 0, i = r.length; s < i; s++) (o2 = r[s]) && e.registerName(t, o2);
|
|
9003
6215
|
}, Pe = function(e, t) {
|
|
9004
|
-
for (var n, o2 = ((n = t.textContent) !== null && n !== void 0 ? n : "").split(g), r = [],
|
|
9005
|
-
var a = o2[
|
|
6216
|
+
for (var n, o2 = ((n = t.textContent) !== null && n !== void 0 ? n : "").split(g), r = [], s = 0, i = o2.length; s < i; s++) {
|
|
6217
|
+
var a = o2[s].trim();
|
|
9006
6218
|
if (a) {
|
|
9007
|
-
var
|
|
9008
|
-
if (
|
|
9009
|
-
var l = 0 | parseInt(
|
|
9010
|
-
l !== 0 && (we(u, l), Ne(e, u,
|
|
6219
|
+
var c = a.match(Ee);
|
|
6220
|
+
if (c) {
|
|
6221
|
+
var l = 0 | parseInt(c[1], 10), u = c[2];
|
|
6222
|
+
l !== 0 && (we(u, l), Ne(e, u, c[3]), e.getTag().insertRules(l, r)), r.length = 0;
|
|
9011
6223
|
} else r.push(a);
|
|
9012
6224
|
}
|
|
9013
6225
|
}
|
|
@@ -9024,10 +6236,10 @@ var Ie = function(e) {
|
|
|
9024
6236
|
var t = document.head, n = e || t, o2 = document.createElement("style"), r = (function(e2) {
|
|
9025
6237
|
var t2 = Array.from(e2.querySelectorAll("style[".concat(f, "]")));
|
|
9026
6238
|
return t2[t2.length - 1];
|
|
9027
|
-
})(n),
|
|
6239
|
+
})(n), s = r !== void 0 ? r.nextSibling : null;
|
|
9028
6240
|
o2.setAttribute(f, m), o2.setAttribute(y, v);
|
|
9029
6241
|
var i = Ce();
|
|
9030
|
-
return i && o2.setAttribute("nonce", i), n.insertBefore(o2,
|
|
6242
|
+
return i && o2.setAttribute("nonce", i), n.insertBefore(o2, s), o2;
|
|
9031
6243
|
}, Ae = (function() {
|
|
9032
6244
|
function e(e2) {
|
|
9033
6245
|
this.element = Ie(e2), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e3) {
|
|
@@ -9088,13 +6300,13 @@ var Ie = function(e) {
|
|
|
9088
6300
|
return ve.get(e4);
|
|
9089
6301
|
})(n3);
|
|
9090
6302
|
if (r3 === void 0) return "continue";
|
|
9091
|
-
var
|
|
9092
|
-
if (
|
|
9093
|
-
var a = "".concat(f, ".g").concat(n3, '[id="').concat(r3, '"]'),
|
|
9094
|
-
|
|
9095
|
-
e4.length > 0 && (
|
|
9096
|
-
}), o3 += "".concat(i).concat(a, '{content:"').concat(
|
|
9097
|
-
},
|
|
6303
|
+
var s2 = e3.names.get(r3), i = t.getGroup(n3);
|
|
6304
|
+
if (s2 === void 0 || !s2.size || i.length === 0) return "continue";
|
|
6305
|
+
var a = "".concat(f, ".g").concat(n3, '[id="').concat(r3, '"]'), c = "";
|
|
6306
|
+
s2 !== void 0 && s2.forEach(function(e4) {
|
|
6307
|
+
e4.length > 0 && (c += "".concat(e4, ","));
|
|
6308
|
+
}), o3 += "".concat(i).concat(a, '{content:"').concat(c, '"}').concat(g);
|
|
6309
|
+
}, s = 0; s < n2; s++) r2(s);
|
|
9098
6310
|
return o3;
|
|
9099
6311
|
})(r);
|
|
9100
6312
|
});
|
|
@@ -9139,22 +6351,22 @@ function Ve(e, t) {
|
|
|
9139
6351
|
});
|
|
9140
6352
|
}
|
|
9141
6353
|
function Fe(e) {
|
|
9142
|
-
var t, n, o2, r = C,
|
|
6354
|
+
var t, n, o2, r = C, s = r.options, i = s === void 0 ? C : s, a = r.plugins, c = a === void 0 ? _ : a, l = function(e2, o3, r2) {
|
|
9143
6355
|
return r2.startsWith(n) && r2.endsWith(n) && r2.replaceAll(n, "").length > 0 ? ".".concat(t) : e2;
|
|
9144
|
-
}, u =
|
|
6356
|
+
}, u = c.slice();
|
|
9145
6357
|
u.push(function(e2) {
|
|
9146
6358
|
e2.type === RULESET && e2.value.includes("&") && (e2.props[0] = e2.props[0].replace(je, n).replace(o2, l));
|
|
9147
6359
|
}), i.prefix && u.push(prefixer), u.push(stringify);
|
|
9148
|
-
var p = function(e2, r2,
|
|
9149
|
-
r2 === void 0 && (r2 = ""),
|
|
9150
|
-
var
|
|
6360
|
+
var p = function(e2, r2, s2, a2) {
|
|
6361
|
+
r2 === void 0 && (r2 = ""), s2 === void 0 && (s2 = ""), a2 === void 0 && (a2 = "&"), t = a2, n = r2, o2 = new RegExp("\\".concat(n, "\\b"), "g");
|
|
6362
|
+
var c2 = e2.replace(xe, ""), l2 = compile(s2 || r2 ? "".concat(s2, " ").concat(r2, " { ").concat(c2, " }") : c2);
|
|
9151
6363
|
i.namespace && (l2 = Ve(l2, i.namespace));
|
|
9152
6364
|
var p2 = [];
|
|
9153
6365
|
return serialize(l2, middleware(u.concat(rulesheet(function(e3) {
|
|
9154
6366
|
return p2.push(e3);
|
|
9155
6367
|
})))), p2;
|
|
9156
6368
|
};
|
|
9157
|
-
return p.hash =
|
|
6369
|
+
return p.hash = c.length ? c.reduce(function(e2, t2) {
|
|
9158
6370
|
return t2.name || he(15), z(e2, t2.name);
|
|
9159
6371
|
}, F).toString() : "", p;
|
|
9160
6372
|
}
|
|
@@ -9192,9 +6404,9 @@ var Ue = function(e) {
|
|
|
9192
6404
|
return e == null || e === !1 || e === "";
|
|
9193
6405
|
}, Je = function(t) {
|
|
9194
6406
|
var n, o2, r = [];
|
|
9195
|
-
for (var
|
|
9196
|
-
var i = t[
|
|
9197
|
-
t.hasOwnProperty(
|
|
6407
|
+
for (var s in t) {
|
|
6408
|
+
var i = t[s];
|
|
6409
|
+
t.hasOwnProperty(s) && !Ue(i) && (Array.isArray(i) && i.isCss || re(i) ? r.push("".concat(He(s), ":"), i, ";") : ce(i) ? r.push.apply(r, __spreadArray(__spreadArray(["".concat(s, " {")], Je(i), !1), ["}"], !1)) : r.push("".concat(He(s), ": ").concat((n = s, (o2 = i) == null || typeof o2 == "boolean" || o2 === "" ? "" : typeof o2 != "number" || o2 === 0 || n in unitlessKeys || n.startsWith("--") ? String(o2).trim() : "".concat(o2, "px")), ";")));
|
|
9198
6410
|
}
|
|
9199
6411
|
return r;
|
|
9200
6412
|
};
|
|
@@ -9202,11 +6414,11 @@ function Xe(e, t, n, o2) {
|
|
|
9202
6414
|
if (Ue(e)) return [];
|
|
9203
6415
|
if (se(e)) return [".".concat(e.styledComponentId)];
|
|
9204
6416
|
if (re(e)) {
|
|
9205
|
-
if (!re(
|
|
6417
|
+
if (!re(s = e) || s.prototype && s.prototype.isReactComponent || !t) return [e];
|
|
9206
6418
|
var r = e(t);
|
|
9207
6419
|
return process.env.NODE_ENV === "production" || typeof r != "object" || Array.isArray(r) || r instanceof qe || ce(r) || r === null || console.error("".concat(B(e), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")), Xe(r, t, n, o2);
|
|
9208
6420
|
}
|
|
9209
|
-
var
|
|
6421
|
+
var s;
|
|
9210
6422
|
return e instanceof qe ? n ? (e.inject(n, o2), [e.getName(o2)]) : [e] : ce(e) ? Je(e) : Array.isArray(e) ? Array.prototype.concat.apply(_, e.map(function(e2) {
|
|
9211
6423
|
return Xe(e2, t, n, o2);
|
|
9212
6424
|
})) : [e.toString()];
|
|
@@ -9226,32 +6438,32 @@ var Ke = M(v), Qe = (function() {
|
|
|
9226
6438
|
var o2 = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e2, t, n) : "";
|
|
9227
6439
|
if (this.isStatic && !n.hash) if (this.staticRulesId && t.hasNameForId(this.componentId, this.staticRulesId)) o2 = ie(o2, this.staticRulesId);
|
|
9228
6440
|
else {
|
|
9229
|
-
var r = ae(Xe(this.rules, e2, t, n)),
|
|
9230
|
-
if (!t.hasNameForId(this.componentId,
|
|
9231
|
-
var i = n(r, ".".concat(
|
|
9232
|
-
t.insertRules(this.componentId,
|
|
6441
|
+
var r = ae(Xe(this.rules, e2, t, n)), s = x(z(this.baseHash, r) >>> 0);
|
|
6442
|
+
if (!t.hasNameForId(this.componentId, s)) {
|
|
6443
|
+
var i = n(r, ".".concat(s), void 0, this.componentId);
|
|
6444
|
+
t.insertRules(this.componentId, s, i);
|
|
9233
6445
|
}
|
|
9234
|
-
o2 = ie(o2,
|
|
6446
|
+
o2 = ie(o2, s), this.staticRulesId = s;
|
|
9235
6447
|
}
|
|
9236
6448
|
else {
|
|
9237
|
-
for (var a = z(this.baseHash, n.hash),
|
|
6449
|
+
for (var a = z(this.baseHash, n.hash), c = "", l = 0; l < this.rules.length; l++) {
|
|
9238
6450
|
var u = this.rules[l];
|
|
9239
|
-
if (typeof u == "string")
|
|
6451
|
+
if (typeof u == "string") c += u, process.env.NODE_ENV !== "production" && (a = z(a, u));
|
|
9240
6452
|
else if (u) {
|
|
9241
6453
|
var p = ae(Xe(u, e2, t, n));
|
|
9242
|
-
a = z(a, p + l),
|
|
6454
|
+
a = z(a, p + l), c += p;
|
|
9243
6455
|
}
|
|
9244
6456
|
}
|
|
9245
|
-
if (
|
|
6457
|
+
if (c) {
|
|
9246
6458
|
var d = x(a >>> 0);
|
|
9247
|
-
t.hasNameForId(this.componentId, d) || t.insertRules(this.componentId, d, n(
|
|
6459
|
+
t.hasNameForId(this.componentId, d) || t.insertRules(this.componentId, d, n(c, ".".concat(d), void 0, this.componentId)), o2 = ie(o2, d);
|
|
9248
6460
|
}
|
|
9249
6461
|
}
|
|
9250
6462
|
return o2;
|
|
9251
6463
|
}, e;
|
|
9252
6464
|
})(), et = o__default.default.createContext(void 0), rt = {}, st = /* @__PURE__ */ new Set();
|
|
9253
|
-
function it(e, r,
|
|
9254
|
-
var i = se(e), a = e,
|
|
6465
|
+
function it(e, r, s) {
|
|
6466
|
+
var i = se(e), a = e, c = !G(e), p = r.attrs, d = p === void 0 ? _ : p, h = r.componentId, f2 = h === void 0 ? (function(e2, t) {
|
|
9255
6467
|
var n = typeof e2 != "string" ? "sc" : R(e2);
|
|
9256
6468
|
rt[n] = (rt[n] || 0) + 1;
|
|
9257
6469
|
var o2 = "".concat(n, "-").concat($(v + n + rt[n]));
|
|
@@ -9268,17 +6480,17 @@ function it(e, r, s2) {
|
|
|
9268
6480
|
};
|
|
9269
6481
|
} else w2 = b;
|
|
9270
6482
|
}
|
|
9271
|
-
var N2 = new Qe(
|
|
6483
|
+
var N2 = new Qe(s, g2, i ? a.componentStyle : void 0);
|
|
9272
6484
|
function O2(e2, r2) {
|
|
9273
|
-
return (function(e3, r3,
|
|
9274
|
-
var i2 = e3.attrs, a2 = e3.componentStyle,
|
|
6485
|
+
return (function(e3, r3, s2) {
|
|
6486
|
+
var i2 = e3.attrs, a2 = e3.componentStyle, c2 = e3.defaultProps, p2 = e3.foldedComponentIds, d2 = e3.styledComponentId, h2 = e3.target, f3 = o__default.default.useContext(et), m3 = Le(), y3 = e3.shouldForwardProp || m3.shouldForwardProp;
|
|
9275
6487
|
process.env.NODE_ENV !== "production" && o.useDebugValue(d2);
|
|
9276
|
-
var v2 = I(r3, f3,
|
|
9277
|
-
for (var r4,
|
|
9278
|
-
var a3 = re(r4 = e4[i3]) ? r4(
|
|
9279
|
-
for (var
|
|
6488
|
+
var v2 = I(r3, f3, c2) || C, g3 = (function(e4, n, o2) {
|
|
6489
|
+
for (var r4, s3 = __assign(__assign({}, n), { className: void 0, theme: o2 }), i3 = 0; i3 < e4.length; i3 += 1) {
|
|
6490
|
+
var a3 = re(r4 = e4[i3]) ? r4(s3) : r4;
|
|
6491
|
+
for (var c3 in a3) s3[c3] = c3 === "className" ? ie(s3[c3], a3[c3]) : c3 === "style" ? __assign(__assign({}, s3[c3]), a3[c3]) : a3[c3];
|
|
9280
6492
|
}
|
|
9281
|
-
return n.className && (
|
|
6493
|
+
return n.className && (s3.className = ie(s3.className, n.className)), s3;
|
|
9282
6494
|
})(i2, r3, v2), S3 = g3.as || h2, w3 = {};
|
|
9283
6495
|
for (var b2 in g3) g3[b2] === void 0 || b2[0] === "$" || b2 === "as" || b2 === "theme" && g3.theme === v2 || (b2 === "forwardedAs" ? w3.as = g3.forwardedAs : y3 && !y3(b2, S3) || (w3[b2] = g3[b2], y3 || process.env.NODE_ENV !== "development" || isPropValid(b2) || st.has(b2) || !A.has(S3) || (st.add(b2), console.warn('styled-components: it looks like an unknown prop "'.concat(b2, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
|
|
9284
6496
|
var E3 = (function(e4, t) {
|
|
@@ -9287,7 +6499,7 @@ function it(e, r, s2) {
|
|
|
9287
6499
|
})(a2, g3);
|
|
9288
6500
|
process.env.NODE_ENV !== "production" && e3.warnTooManyClasses && e3.warnTooManyClasses(E3);
|
|
9289
6501
|
var N3 = ie(p2, d2);
|
|
9290
|
-
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[G(S3) && !A.has(S3) ? "class" : "className"] = N3,
|
|
6502
|
+
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[G(S3) && !A.has(S3) ? "class" : "className"] = N3, s2 && (w3.ref = s2), o.createElement(S3, w3);
|
|
9291
6503
|
})(D2, e2, r2);
|
|
9292
6504
|
}
|
|
9293
6505
|
O2.displayName = y2;
|
|
@@ -9304,8 +6516,8 @@ function it(e, r, s2) {
|
|
|
9304
6516
|
var n = {}, o2 = !1;
|
|
9305
6517
|
return function(r2) {
|
|
9306
6518
|
if (!o2 && (n[r2] = !0, Object.keys(n).length >= 200)) {
|
|
9307
|
-
var
|
|
9308
|
-
console.warn("Over ".concat(200, " classes were generated for component ").concat(e2).concat(
|
|
6519
|
+
var s2 = t ? ' with the id of "'.concat(t, '"') : "";
|
|
6520
|
+
console.warn("Over ".concat(200, " classes were generated for component ").concat(e2).concat(s2, `.
|
|
9309
6521
|
`) + `Consider using the attrs method, together with a style object for frequently changed styles.
|
|
9310
6522
|
Example:
|
|
9311
6523
|
const Component = styled.div.attrs(props => ({
|
|
@@ -9319,7 +6531,7 @@ Example:
|
|
|
9319
6531
|
};
|
|
9320
6532
|
})(y2, g2)), ue(D2, function() {
|
|
9321
6533
|
return ".".concat(D2.styledComponentId);
|
|
9322
|
-
}),
|
|
6534
|
+
}), c && oe(D2, e, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), D2;
|
|
9323
6535
|
}
|
|
9324
6536
|
function at(e, t) {
|
|
9325
6537
|
for (var n = [e[0]], o2 = 0, r = t.length; o2 < r; o2 += 1) n.push(t[o2], e[o2 + 1]);
|
|
@@ -9336,15 +6548,15 @@ function lt(t) {
|
|
|
9336
6548
|
}
|
|
9337
6549
|
function ut(n, o2, r) {
|
|
9338
6550
|
if (r === void 0 && (r = C), !o2) throw he(1, o2);
|
|
9339
|
-
var
|
|
9340
|
-
for (var
|
|
9341
|
-
return n(o2, r, lt.apply(void 0, __spreadArray([t],
|
|
6551
|
+
var s = function(t) {
|
|
6552
|
+
for (var s2 = [], i = 1; i < arguments.length; i++) s2[i - 1] = arguments[i];
|
|
6553
|
+
return n(o2, r, lt.apply(void 0, __spreadArray([t], s2, !1)));
|
|
9342
6554
|
};
|
|
9343
|
-
return
|
|
6555
|
+
return s.attrs = function(e) {
|
|
9344
6556
|
return ut(n, o2, __assign(__assign({}, r), { attrs: Array.prototype.concat(r.attrs, e).filter(Boolean) }));
|
|
9345
|
-
},
|
|
6557
|
+
}, s.withConfig = function(e) {
|
|
9346
6558
|
return ut(n, o2, __assign(__assign({}, r), e));
|
|
9347
|
-
},
|
|
6559
|
+
}, s;
|
|
9348
6560
|
}
|
|
9349
6561
|
var pt = function(e) {
|
|
9350
6562
|
return ut(it, e);
|