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.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import o, { useState, useEffect, createContext, useCallback, useContext, useDebu
|
|
|
5
5
|
import { useClient as useClient$1, useSchema, definePlugin } from "sanity";
|
|
6
6
|
import { GT } from "generaltranslation";
|
|
7
7
|
import { libraryDefaultLocale } from "generaltranslation/internal";
|
|
8
|
+
import { htmlToBlocks } from "@portabletext/block-tools";
|
|
8
9
|
import { Schema } from "@sanity/schema";
|
|
9
10
|
import { toHTML } from "@portabletext/to-html";
|
|
10
11
|
import { extractWithPath, arrayToJSONMatchPath } from "@sanity/mutator";
|
|
@@ -175,2795 +176,7 @@ const pluginConfig = GTConfig.getInstance(), theme = buildTheme(), BaseTranslati
|
|
|
175
176
|
documentLevelMerge,
|
|
176
177
|
reconcileArray,
|
|
177
178
|
reconcileObject
|
|
178
|
-
}
|
|
179
|
-
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
180
|
-
function getDefaultExportFromCjs(x2) {
|
|
181
|
-
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2.default : x2;
|
|
182
|
-
}
|
|
183
|
-
var lodash_startcase, hasRequiredLodash_startcase;
|
|
184
|
-
function requireLodash_startcase() {
|
|
185
|
-
if (hasRequiredLodash_startcase) return lodash_startcase;
|
|
186
|
-
hasRequiredLodash_startcase = 1;
|
|
187
|
-
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([
|
|
188
|
-
rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
189
|
-
rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")",
|
|
190
|
-
rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr,
|
|
191
|
-
rsUpper + "+" + rsOptUpperContr,
|
|
192
|
-
rsDigits,
|
|
193
|
-
rsEmoji
|
|
194
|
-
].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 = {
|
|
195
|
-
// Latin-1 Supplement block.
|
|
196
|
-
\u00C0: "A",
|
|
197
|
-
\u00C1: "A",
|
|
198
|
-
\u00C2: "A",
|
|
199
|
-
\u00C3: "A",
|
|
200
|
-
\u00C4: "A",
|
|
201
|
-
\u00C5: "A",
|
|
202
|
-
\u00E0: "a",
|
|
203
|
-
\u00E1: "a",
|
|
204
|
-
\u00E2: "a",
|
|
205
|
-
\u00E3: "a",
|
|
206
|
-
\u00E4: "a",
|
|
207
|
-
\u00E5: "a",
|
|
208
|
-
\u00C7: "C",
|
|
209
|
-
\u00E7: "c",
|
|
210
|
-
\u00D0: "D",
|
|
211
|
-
\u00F0: "d",
|
|
212
|
-
\u00C8: "E",
|
|
213
|
-
\u00C9: "E",
|
|
214
|
-
\u00CA: "E",
|
|
215
|
-
\u00CB: "E",
|
|
216
|
-
\u00E8: "e",
|
|
217
|
-
\u00E9: "e",
|
|
218
|
-
\u00EA: "e",
|
|
219
|
-
\u00EB: "e",
|
|
220
|
-
\u00CC: "I",
|
|
221
|
-
\u00CD: "I",
|
|
222
|
-
\u00CE: "I",
|
|
223
|
-
\u00CF: "I",
|
|
224
|
-
\u00EC: "i",
|
|
225
|
-
\u00ED: "i",
|
|
226
|
-
\u00EE: "i",
|
|
227
|
-
\u00EF: "i",
|
|
228
|
-
\u00D1: "N",
|
|
229
|
-
\u00F1: "n",
|
|
230
|
-
\u00D2: "O",
|
|
231
|
-
\u00D3: "O",
|
|
232
|
-
\u00D4: "O",
|
|
233
|
-
\u00D5: "O",
|
|
234
|
-
\u00D6: "O",
|
|
235
|
-
\u00D8: "O",
|
|
236
|
-
\u00F2: "o",
|
|
237
|
-
\u00F3: "o",
|
|
238
|
-
\u00F4: "o",
|
|
239
|
-
\u00F5: "o",
|
|
240
|
-
\u00F6: "o",
|
|
241
|
-
\u00F8: "o",
|
|
242
|
-
\u00D9: "U",
|
|
243
|
-
\u00DA: "U",
|
|
244
|
-
\u00DB: "U",
|
|
245
|
-
\u00DC: "U",
|
|
246
|
-
\u00F9: "u",
|
|
247
|
-
\u00FA: "u",
|
|
248
|
-
\u00FB: "u",
|
|
249
|
-
\u00FC: "u",
|
|
250
|
-
\u00DD: "Y",
|
|
251
|
-
\u00FD: "y",
|
|
252
|
-
\u00FF: "y",
|
|
253
|
-
\u00C6: "Ae",
|
|
254
|
-
\u00E6: "ae",
|
|
255
|
-
\u00DE: "Th",
|
|
256
|
-
\u00FE: "th",
|
|
257
|
-
\u00DF: "ss",
|
|
258
|
-
// Latin Extended-A block.
|
|
259
|
-
\u0100: "A",
|
|
260
|
-
\u0102: "A",
|
|
261
|
-
\u0104: "A",
|
|
262
|
-
\u0101: "a",
|
|
263
|
-
\u0103: "a",
|
|
264
|
-
\u0105: "a",
|
|
265
|
-
\u0106: "C",
|
|
266
|
-
\u0108: "C",
|
|
267
|
-
\u010A: "C",
|
|
268
|
-
\u010C: "C",
|
|
269
|
-
\u0107: "c",
|
|
270
|
-
\u0109: "c",
|
|
271
|
-
\u010B: "c",
|
|
272
|
-
\u010D: "c",
|
|
273
|
-
\u010E: "D",
|
|
274
|
-
\u0110: "D",
|
|
275
|
-
\u010F: "d",
|
|
276
|
-
\u0111: "d",
|
|
277
|
-
\u0112: "E",
|
|
278
|
-
\u0114: "E",
|
|
279
|
-
\u0116: "E",
|
|
280
|
-
\u0118: "E",
|
|
281
|
-
\u011A: "E",
|
|
282
|
-
\u0113: "e",
|
|
283
|
-
\u0115: "e",
|
|
284
|
-
\u0117: "e",
|
|
285
|
-
\u0119: "e",
|
|
286
|
-
\u011B: "e",
|
|
287
|
-
\u011C: "G",
|
|
288
|
-
\u011E: "G",
|
|
289
|
-
\u0120: "G",
|
|
290
|
-
\u0122: "G",
|
|
291
|
-
\u011D: "g",
|
|
292
|
-
\u011F: "g",
|
|
293
|
-
\u0121: "g",
|
|
294
|
-
\u0123: "g",
|
|
295
|
-
\u0124: "H",
|
|
296
|
-
\u0126: "H",
|
|
297
|
-
\u0125: "h",
|
|
298
|
-
\u0127: "h",
|
|
299
|
-
\u0128: "I",
|
|
300
|
-
\u012A: "I",
|
|
301
|
-
\u012C: "I",
|
|
302
|
-
\u012E: "I",
|
|
303
|
-
\u0130: "I",
|
|
304
|
-
\u0129: "i",
|
|
305
|
-
\u012B: "i",
|
|
306
|
-
\u012D: "i",
|
|
307
|
-
\u012F: "i",
|
|
308
|
-
\u0131: "i",
|
|
309
|
-
\u0134: "J",
|
|
310
|
-
\u0135: "j",
|
|
311
|
-
\u0136: "K",
|
|
312
|
-
\u0137: "k",
|
|
313
|
-
\u0138: "k",
|
|
314
|
-
\u0139: "L",
|
|
315
|
-
\u013B: "L",
|
|
316
|
-
\u013D: "L",
|
|
317
|
-
\u013F: "L",
|
|
318
|
-
\u0141: "L",
|
|
319
|
-
\u013A: "l",
|
|
320
|
-
\u013C: "l",
|
|
321
|
-
\u013E: "l",
|
|
322
|
-
\u0140: "l",
|
|
323
|
-
\u0142: "l",
|
|
324
|
-
\u0143: "N",
|
|
325
|
-
\u0145: "N",
|
|
326
|
-
\u0147: "N",
|
|
327
|
-
\u014A: "N",
|
|
328
|
-
\u0144: "n",
|
|
329
|
-
\u0146: "n",
|
|
330
|
-
\u0148: "n",
|
|
331
|
-
\u014B: "n",
|
|
332
|
-
\u014C: "O",
|
|
333
|
-
\u014E: "O",
|
|
334
|
-
\u0150: "O",
|
|
335
|
-
\u014D: "o",
|
|
336
|
-
\u014F: "o",
|
|
337
|
-
\u0151: "o",
|
|
338
|
-
\u0154: "R",
|
|
339
|
-
\u0156: "R",
|
|
340
|
-
\u0158: "R",
|
|
341
|
-
\u0155: "r",
|
|
342
|
-
\u0157: "r",
|
|
343
|
-
\u0159: "r",
|
|
344
|
-
\u015A: "S",
|
|
345
|
-
\u015C: "S",
|
|
346
|
-
\u015E: "S",
|
|
347
|
-
\u0160: "S",
|
|
348
|
-
\u015B: "s",
|
|
349
|
-
\u015D: "s",
|
|
350
|
-
\u015F: "s",
|
|
351
|
-
\u0161: "s",
|
|
352
|
-
\u0162: "T",
|
|
353
|
-
\u0164: "T",
|
|
354
|
-
\u0166: "T",
|
|
355
|
-
\u0163: "t",
|
|
356
|
-
\u0165: "t",
|
|
357
|
-
\u0167: "t",
|
|
358
|
-
\u0168: "U",
|
|
359
|
-
\u016A: "U",
|
|
360
|
-
\u016C: "U",
|
|
361
|
-
\u016E: "U",
|
|
362
|
-
\u0170: "U",
|
|
363
|
-
\u0172: "U",
|
|
364
|
-
\u0169: "u",
|
|
365
|
-
\u016B: "u",
|
|
366
|
-
\u016D: "u",
|
|
367
|
-
\u016F: "u",
|
|
368
|
-
\u0171: "u",
|
|
369
|
-
\u0173: "u",
|
|
370
|
-
\u0174: "W",
|
|
371
|
-
\u0175: "w",
|
|
372
|
-
\u0176: "Y",
|
|
373
|
-
\u0177: "y",
|
|
374
|
-
\u0178: "Y",
|
|
375
|
-
\u0179: "Z",
|
|
376
|
-
\u017B: "Z",
|
|
377
|
-
\u017D: "Z",
|
|
378
|
-
\u017A: "z",
|
|
379
|
-
\u017C: "z",
|
|
380
|
-
\u017E: "z",
|
|
381
|
-
\u0132: "IJ",
|
|
382
|
-
\u0133: "ij",
|
|
383
|
-
\u0152: "Oe",
|
|
384
|
-
\u0153: "oe",
|
|
385
|
-
\u0149: "'n",
|
|
386
|
-
\u017F: "ss"
|
|
387
|
-
}, freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")();
|
|
388
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
389
|
-
for (var index = -1, length2 = array ? array.length : 0; ++index < length2; )
|
|
390
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
391
|
-
return accumulator;
|
|
392
|
-
}
|
|
393
|
-
function asciiToArray(string) {
|
|
394
|
-
return string.split("");
|
|
395
|
-
}
|
|
396
|
-
function asciiWords(string) {
|
|
397
|
-
return string.match(reAsciiWord) || [];
|
|
398
|
-
}
|
|
399
|
-
function basePropertyOf(object) {
|
|
400
|
-
return function(key) {
|
|
401
|
-
return object?.[key];
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
var deburrLetter = basePropertyOf(deburredLetters);
|
|
405
|
-
function hasUnicode(string) {
|
|
406
|
-
return reHasUnicode.test(string);
|
|
407
|
-
}
|
|
408
|
-
function hasUnicodeWord(string) {
|
|
409
|
-
return reHasUnicodeWord.test(string);
|
|
410
|
-
}
|
|
411
|
-
function stringToArray(string) {
|
|
412
|
-
return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
|
|
413
|
-
}
|
|
414
|
-
function unicodeToArray(string) {
|
|
415
|
-
return string.match(reUnicode) || [];
|
|
416
|
-
}
|
|
417
|
-
function unicodeWords(string) {
|
|
418
|
-
return string.match(reUnicodeWord) || [];
|
|
419
|
-
}
|
|
420
|
-
var objectProto = Object.prototype, objectToString2 = objectProto.toString, Symbol2 = root.Symbol, symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
421
|
-
function baseSlice(array, start, end) {
|
|
422
|
-
var index = -1, length2 = array.length;
|
|
423
|
-
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;
|
|
424
|
-
for (var result = Array(length2); ++index < length2; )
|
|
425
|
-
result[index] = array[index + start];
|
|
426
|
-
return result;
|
|
427
|
-
}
|
|
428
|
-
function baseToString(value) {
|
|
429
|
-
if (typeof value == "string")
|
|
430
|
-
return value;
|
|
431
|
-
if (isSymbol(value))
|
|
432
|
-
return symbolToString ? symbolToString.call(value) : "";
|
|
433
|
-
var result = value + "";
|
|
434
|
-
return result == "0" && 1 / value == -1 / 0 ? "-0" : result;
|
|
435
|
-
}
|
|
436
|
-
function castSlice(array, start, end) {
|
|
437
|
-
var length2 = array.length;
|
|
438
|
-
return end = end === void 0 ? length2 : end, !start && end >= length2 ? array : baseSlice(array, start, end);
|
|
439
|
-
}
|
|
440
|
-
function createCaseFirst(methodName) {
|
|
441
|
-
return function(string) {
|
|
442
|
-
string = toString(string);
|
|
443
|
-
var strSymbols = hasUnicode(string) ? stringToArray(string) : void 0, chr = strSymbols ? strSymbols[0] : string.charAt(0), trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
|
|
444
|
-
return chr[methodName]() + trailing;
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
function createCompounder(callback) {
|
|
448
|
-
return function(string) {
|
|
449
|
-
return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
function isObjectLike(value) {
|
|
453
|
-
return !!value && typeof value == "object";
|
|
454
|
-
}
|
|
455
|
-
function isSymbol(value) {
|
|
456
|
-
return typeof value == "symbol" || isObjectLike(value) && objectToString2.call(value) == symbolTag;
|
|
457
|
-
}
|
|
458
|
-
function toString(value) {
|
|
459
|
-
return value == null ? "" : baseToString(value);
|
|
460
|
-
}
|
|
461
|
-
function deburr(string) {
|
|
462
|
-
return string = toString(string), string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
463
|
-
}
|
|
464
|
-
var startCase = createCompounder(function(result, word, index) {
|
|
465
|
-
return result + (index ? " " : "") + upperFirst(word);
|
|
466
|
-
}), upperFirst = createCaseFirst("toUpperCase");
|
|
467
|
-
function words(string, pattern, guard) {
|
|
468
|
-
return string = toString(string), pattern = pattern, pattern === void 0 ? hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string) : string.match(pattern) || [];
|
|
469
|
-
}
|
|
470
|
-
return lodash_startcase = startCase, lodash_startcase;
|
|
471
|
-
}
|
|
472
|
-
requireLodash_startcase();
|
|
473
|
-
function getRandomValues(typedArray) {
|
|
474
|
-
const crypto = typeof window < "u" && "crypto" in window ? window.crypto : globalThis.crypto;
|
|
475
|
-
if (!crypto || !crypto.getRandomValues)
|
|
476
|
-
throw new Error("WebCrypto not available in this environment");
|
|
477
|
-
return crypto.getRandomValues(typedArray);
|
|
478
|
-
}
|
|
479
|
-
function createPortableTextMemberSchemaTypes(portableTextType) {
|
|
480
|
-
if (!portableTextType)
|
|
481
|
-
throw new Error("Parameter 'portabletextType' missing (required)");
|
|
482
|
-
const blockType = portableTextType.of?.find(findBlockType);
|
|
483
|
-
if (!blockType)
|
|
484
|
-
throw new Error("Block type is not defined in this schema (required)");
|
|
485
|
-
const childrenField = blockType.fields?.find(
|
|
486
|
-
(field) => field.name === "children"
|
|
487
|
-
);
|
|
488
|
-
if (!childrenField)
|
|
489
|
-
throw new Error("Children field for block type found in schema (required)");
|
|
490
|
-
const ofType = childrenField.type.of;
|
|
491
|
-
if (!ofType)
|
|
492
|
-
throw new Error(
|
|
493
|
-
"Valid types for block children not found in schema (required)"
|
|
494
|
-
);
|
|
495
|
-
const spanType = ofType.find((memberType) => memberType.name === "span");
|
|
496
|
-
if (!spanType)
|
|
497
|
-
throw new Error("Span type not found in schema (required)");
|
|
498
|
-
const inlineObjectTypes = ofType.filter(
|
|
499
|
-
(memberType) => memberType.name !== "span"
|
|
500
|
-
) || [], blockObjectTypes = portableTextType.of?.filter(
|
|
501
|
-
(field) => field.name !== blockType.name
|
|
502
|
-
) || [];
|
|
503
|
-
return {
|
|
504
|
-
styles: resolveEnabledStyles(blockType),
|
|
505
|
-
decorators: resolveEnabledDecorators(spanType),
|
|
506
|
-
lists: resolveEnabledListItems(blockType),
|
|
507
|
-
block: blockType,
|
|
508
|
-
span: spanType,
|
|
509
|
-
portableText: portableTextType,
|
|
510
|
-
inlineObjects: inlineObjectTypes,
|
|
511
|
-
blockObjects: blockObjectTypes,
|
|
512
|
-
annotations: spanType.annotations
|
|
513
|
-
};
|
|
514
|
-
}
|
|
515
|
-
function resolveEnabledStyles(blockType) {
|
|
516
|
-
const styleField = blockType.fields?.find(
|
|
517
|
-
(btField) => btField.name === "style"
|
|
518
|
-
);
|
|
519
|
-
if (!styleField)
|
|
520
|
-
throw new Error(
|
|
521
|
-
"A field with name 'style' is not defined in the block type (required)."
|
|
522
|
-
);
|
|
523
|
-
const textStyles = styleField.type.options?.list && styleField.type.options.list?.filter(
|
|
524
|
-
(style) => style.value
|
|
525
|
-
);
|
|
526
|
-
if (!textStyles || textStyles.length === 0)
|
|
527
|
-
throw new Error(
|
|
528
|
-
"The style fields need at least one style defined. I.e: {title: 'Normal', value: 'normal'}."
|
|
529
|
-
);
|
|
530
|
-
return textStyles;
|
|
531
|
-
}
|
|
532
|
-
function resolveEnabledDecorators(spanType) {
|
|
533
|
-
return spanType.decorators;
|
|
534
|
-
}
|
|
535
|
-
function resolveEnabledListItems(blockType) {
|
|
536
|
-
const listField = blockType.fields?.find(
|
|
537
|
-
(btField) => btField.name === "listItem"
|
|
538
|
-
);
|
|
539
|
-
if (!listField)
|
|
540
|
-
throw new Error(
|
|
541
|
-
"A field with name 'listItem' is not defined in the block type (required)."
|
|
542
|
-
);
|
|
543
|
-
const listItems = listField.type.options?.list && listField.type.options.list.filter((list) => list.value);
|
|
544
|
-
if (!listItems)
|
|
545
|
-
throw new Error("The list field need at least to be an empty array");
|
|
546
|
-
return listItems;
|
|
547
|
-
}
|
|
548
|
-
function findBlockType(type) {
|
|
549
|
-
return type.type ? findBlockType(type.type) : type.name === "block" ? type : null;
|
|
550
|
-
}
|
|
551
|
-
function portableTextMemberSchemaTypesToSchema(schema) {
|
|
552
|
-
return {
|
|
553
|
-
annotations: schema.annotations.map((annotation) => ({
|
|
554
|
-
name: annotation.name,
|
|
555
|
-
fields: annotation.fields.map((field) => ({
|
|
556
|
-
name: field.name,
|
|
557
|
-
type: field.type.jsonType,
|
|
558
|
-
title: field.type.title
|
|
559
|
-
})),
|
|
560
|
-
title: annotation.title
|
|
561
|
-
})),
|
|
562
|
-
block: {
|
|
563
|
-
name: schema.block.name
|
|
564
|
-
},
|
|
565
|
-
blockObjects: schema.blockObjects.map((blockObject) => ({
|
|
566
|
-
name: blockObject.name,
|
|
567
|
-
fields: blockObject.fields.map((field) => ({
|
|
568
|
-
name: field.name,
|
|
569
|
-
type: field.type.jsonType,
|
|
570
|
-
title: field.type.title
|
|
571
|
-
})),
|
|
572
|
-
title: blockObject.title
|
|
573
|
-
})),
|
|
574
|
-
decorators: schema.decorators.map((decorator) => ({
|
|
575
|
-
name: decorator.value,
|
|
576
|
-
title: decorator.title,
|
|
577
|
-
value: decorator.value
|
|
578
|
-
})),
|
|
579
|
-
inlineObjects: schema.inlineObjects.map((inlineObject) => ({
|
|
580
|
-
name: inlineObject.name,
|
|
581
|
-
fields: inlineObject.fields.map((field) => ({
|
|
582
|
-
name: field.name,
|
|
583
|
-
type: field.type.jsonType,
|
|
584
|
-
title: field.type.title
|
|
585
|
-
})),
|
|
586
|
-
title: inlineObject.title
|
|
587
|
-
})),
|
|
588
|
-
span: {
|
|
589
|
-
name: schema.span.name
|
|
590
|
-
},
|
|
591
|
-
styles: schema.styles.map((style) => ({
|
|
592
|
-
name: style.value,
|
|
593
|
-
title: style.title,
|
|
594
|
-
value: style.value
|
|
595
|
-
})),
|
|
596
|
-
lists: schema.lists.map((list) => ({
|
|
597
|
-
name: list.value,
|
|
598
|
-
title: list.title,
|
|
599
|
-
value: list.value
|
|
600
|
-
}))
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
function sanitySchemaToPortableTextSchema(sanitySchema) {
|
|
604
|
-
const portableTextMemberSchemaTypes = createPortableTextMemberSchemaTypes(
|
|
605
|
-
sanitySchema.hasOwnProperty("jsonType") ? sanitySchema : compileType(sanitySchema)
|
|
606
|
-
);
|
|
607
|
-
return portableTextMemberSchemaTypesToSchema(portableTextMemberSchemaTypes);
|
|
608
|
-
}
|
|
609
|
-
function compileType(rawType) {
|
|
610
|
-
return Schema.compile({
|
|
611
|
-
name: "blockTypeSchema",
|
|
612
|
-
types: [rawType]
|
|
613
|
-
}).get(rawType.name);
|
|
614
|
-
}
|
|
615
|
-
const keyGenerator$1 = () => randomKey$1(12), getByteHexTable = /* @__PURE__ */ (() => {
|
|
616
|
-
let table;
|
|
617
|
-
return () => {
|
|
618
|
-
if (table)
|
|
619
|
-
return table;
|
|
620
|
-
table = [];
|
|
621
|
-
for (let i = 0; i < 256; ++i)
|
|
622
|
-
table[i] = (i + 256).toString(16).slice(1);
|
|
623
|
-
return table;
|
|
624
|
-
};
|
|
625
|
-
})();
|
|
626
|
-
function whatwgRNG$1(length2 = 16) {
|
|
627
|
-
const rnds8 = new Uint8Array(length2);
|
|
628
|
-
return getRandomValues(rnds8), rnds8;
|
|
629
|
-
}
|
|
630
|
-
function randomKey$1(length2) {
|
|
631
|
-
const table = getByteHexTable();
|
|
632
|
-
return whatwgRNG$1(length2).reduce((str, n) => str + table[n], "").slice(0, length2);
|
|
633
|
-
}
|
|
634
|
-
`${keyGenerator$1()}`;
|
|
635
|
-
`${keyGenerator$1()}`;
|
|
636
|
-
`${keyGenerator$1()}`;
|
|
637
|
-
`${keyGenerator$1()}`;
|
|
638
|
-
function isTypedObject(object) {
|
|
639
|
-
return isRecord$1(object) && typeof object._type == "string";
|
|
640
|
-
}
|
|
641
|
-
function isRecord$1(value) {
|
|
642
|
-
return !!value && (typeof value == "object" || typeof value == "function");
|
|
643
|
-
}
|
|
644
|
-
function isTextBlock(context, block) {
|
|
645
|
-
return !(!isTypedObject(block) || block._type !== context.schema.block.name || !Array.isArray(block.children));
|
|
646
|
-
}
|
|
647
|
-
function isSpan(context, child) {
|
|
648
|
-
return !(!isTypedObject(child) || child._type !== context.schema.span.name || typeof child.text != "string");
|
|
649
|
-
}
|
|
650
|
-
var _arrayPush, hasRequired_arrayPush;
|
|
651
|
-
function require_arrayPush() {
|
|
652
|
-
if (hasRequired_arrayPush) return _arrayPush;
|
|
653
|
-
hasRequired_arrayPush = 1;
|
|
654
|
-
function arrayPush(array, values) {
|
|
655
|
-
for (var index = -1, length2 = values.length, offset = array.length; ++index < length2; )
|
|
656
|
-
array[offset + index] = values[index];
|
|
657
|
-
return array;
|
|
658
|
-
}
|
|
659
|
-
return _arrayPush = arrayPush, _arrayPush;
|
|
660
|
-
}
|
|
661
|
-
var _freeGlobal, hasRequired_freeGlobal;
|
|
662
|
-
function require_freeGlobal() {
|
|
663
|
-
if (hasRequired_freeGlobal) return _freeGlobal;
|
|
664
|
-
hasRequired_freeGlobal = 1;
|
|
665
|
-
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
666
|
-
return _freeGlobal = freeGlobal, _freeGlobal;
|
|
667
|
-
}
|
|
668
|
-
var _root, hasRequired_root;
|
|
669
|
-
function require_root() {
|
|
670
|
-
if (hasRequired_root) return _root;
|
|
671
|
-
hasRequired_root = 1;
|
|
672
|
-
var freeGlobal = require_freeGlobal(), freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")();
|
|
673
|
-
return _root = root, _root;
|
|
674
|
-
}
|
|
675
|
-
var _Symbol, hasRequired_Symbol;
|
|
676
|
-
function require_Symbol() {
|
|
677
|
-
if (hasRequired_Symbol) return _Symbol;
|
|
678
|
-
hasRequired_Symbol = 1;
|
|
679
|
-
var root = require_root(), Symbol2 = root.Symbol;
|
|
680
|
-
return _Symbol = Symbol2, _Symbol;
|
|
681
|
-
}
|
|
682
|
-
var _getRawTag, hasRequired_getRawTag;
|
|
683
|
-
function require_getRawTag() {
|
|
684
|
-
if (hasRequired_getRawTag) return _getRawTag;
|
|
685
|
-
hasRequired_getRawTag = 1;
|
|
686
|
-
var Symbol2 = require_Symbol(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, nativeObjectToString = objectProto.toString, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
687
|
-
function getRawTag(value) {
|
|
688
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
689
|
-
try {
|
|
690
|
-
value[symToStringTag] = void 0;
|
|
691
|
-
var unmasked = !0;
|
|
692
|
-
} catch {
|
|
693
|
-
}
|
|
694
|
-
var result = nativeObjectToString.call(value);
|
|
695
|
-
return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result;
|
|
696
|
-
}
|
|
697
|
-
return _getRawTag = getRawTag, _getRawTag;
|
|
698
|
-
}
|
|
699
|
-
var _objectToString, hasRequired_objectToString;
|
|
700
|
-
function require_objectToString() {
|
|
701
|
-
if (hasRequired_objectToString) return _objectToString;
|
|
702
|
-
hasRequired_objectToString = 1;
|
|
703
|
-
var objectProto = Object.prototype, nativeObjectToString = objectProto.toString;
|
|
704
|
-
function objectToString2(value) {
|
|
705
|
-
return nativeObjectToString.call(value);
|
|
706
|
-
}
|
|
707
|
-
return _objectToString = objectToString2, _objectToString;
|
|
708
|
-
}
|
|
709
|
-
var _baseGetTag, hasRequired_baseGetTag;
|
|
710
|
-
function require_baseGetTag() {
|
|
711
|
-
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
712
|
-
hasRequired_baseGetTag = 1;
|
|
713
|
-
var Symbol2 = require_Symbol(), getRawTag = require_getRawTag(), objectToString2 = require_objectToString(), nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
714
|
-
function baseGetTag(value) {
|
|
715
|
-
return value == null ? value === void 0 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString2(value);
|
|
716
|
-
}
|
|
717
|
-
return _baseGetTag = baseGetTag, _baseGetTag;
|
|
718
|
-
}
|
|
719
|
-
var isObjectLike_1, hasRequiredIsObjectLike;
|
|
720
|
-
function requireIsObjectLike() {
|
|
721
|
-
if (hasRequiredIsObjectLike) return isObjectLike_1;
|
|
722
|
-
hasRequiredIsObjectLike = 1;
|
|
723
|
-
function isObjectLike(value) {
|
|
724
|
-
return value != null && typeof value == "object";
|
|
725
|
-
}
|
|
726
|
-
return isObjectLike_1 = isObjectLike, isObjectLike_1;
|
|
727
|
-
}
|
|
728
|
-
var _baseIsArguments, hasRequired_baseIsArguments;
|
|
729
|
-
function require_baseIsArguments() {
|
|
730
|
-
if (hasRequired_baseIsArguments) return _baseIsArguments;
|
|
731
|
-
hasRequired_baseIsArguments = 1;
|
|
732
|
-
var baseGetTag = require_baseGetTag(), isObjectLike = requireIsObjectLike(), argsTag = "[object Arguments]";
|
|
733
|
-
function baseIsArguments(value) {
|
|
734
|
-
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
735
|
-
}
|
|
736
|
-
return _baseIsArguments = baseIsArguments, _baseIsArguments;
|
|
737
|
-
}
|
|
738
|
-
var isArguments_1, hasRequiredIsArguments;
|
|
739
|
-
function requireIsArguments() {
|
|
740
|
-
if (hasRequiredIsArguments) return isArguments_1;
|
|
741
|
-
hasRequiredIsArguments = 1;
|
|
742
|
-
var baseIsArguments = require_baseIsArguments(), isObjectLike = requireIsObjectLike(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, propertyIsEnumerable = objectProto.propertyIsEnumerable, isArguments = baseIsArguments(/* @__PURE__ */ (function() {
|
|
743
|
-
return arguments;
|
|
744
|
-
})()) ? baseIsArguments : function(value) {
|
|
745
|
-
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
746
|
-
};
|
|
747
|
-
return isArguments_1 = isArguments, isArguments_1;
|
|
748
|
-
}
|
|
749
|
-
var isArray_1, hasRequiredIsArray;
|
|
750
|
-
function requireIsArray() {
|
|
751
|
-
if (hasRequiredIsArray) return isArray_1;
|
|
752
|
-
hasRequiredIsArray = 1;
|
|
753
|
-
var isArray = Array.isArray;
|
|
754
|
-
return isArray_1 = isArray, isArray_1;
|
|
755
|
-
}
|
|
756
|
-
var _isFlattenable, hasRequired_isFlattenable;
|
|
757
|
-
function require_isFlattenable() {
|
|
758
|
-
if (hasRequired_isFlattenable) return _isFlattenable;
|
|
759
|
-
hasRequired_isFlattenable = 1;
|
|
760
|
-
var Symbol2 = require_Symbol(), isArguments = requireIsArguments(), isArray = requireIsArray(), spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
|
|
761
|
-
function isFlattenable(value) {
|
|
762
|
-
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
763
|
-
}
|
|
764
|
-
return _isFlattenable = isFlattenable, _isFlattenable;
|
|
765
|
-
}
|
|
766
|
-
var _baseFlatten, hasRequired_baseFlatten;
|
|
767
|
-
function require_baseFlatten() {
|
|
768
|
-
if (hasRequired_baseFlatten) return _baseFlatten;
|
|
769
|
-
hasRequired_baseFlatten = 1;
|
|
770
|
-
var arrayPush = require_arrayPush(), isFlattenable = require_isFlattenable();
|
|
771
|
-
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
772
|
-
var index = -1, length2 = array.length;
|
|
773
|
-
for (predicate || (predicate = isFlattenable), result || (result = []); ++index < length2; ) {
|
|
774
|
-
var value = array[index];
|
|
775
|
-
depth > 0 && predicate(value) ? depth > 1 ? baseFlatten(value, depth - 1, predicate, isStrict, result) : arrayPush(result, value) : isStrict || (result[result.length] = value);
|
|
776
|
-
}
|
|
777
|
-
return result;
|
|
778
|
-
}
|
|
779
|
-
return _baseFlatten = baseFlatten, _baseFlatten;
|
|
780
|
-
}
|
|
781
|
-
var flatten_1, hasRequiredFlatten;
|
|
782
|
-
function requireFlatten() {
|
|
783
|
-
if (hasRequiredFlatten) return flatten_1;
|
|
784
|
-
hasRequiredFlatten = 1;
|
|
785
|
-
var baseFlatten = require_baseFlatten();
|
|
786
|
-
function flatten2(array) {
|
|
787
|
-
var length2 = array == null ? 0 : array.length;
|
|
788
|
-
return length2 ? baseFlatten(array, 1) : [];
|
|
789
|
-
}
|
|
790
|
-
return flatten_1 = flatten2, flatten_1;
|
|
791
|
-
}
|
|
792
|
-
var flattenExports = requireFlatten(), flatten = /* @__PURE__ */ getDefaultExportFromCjs(flattenExports), _listCacheClear, hasRequired_listCacheClear;
|
|
793
|
-
function require_listCacheClear() {
|
|
794
|
-
if (hasRequired_listCacheClear) return _listCacheClear;
|
|
795
|
-
hasRequired_listCacheClear = 1;
|
|
796
|
-
function listCacheClear() {
|
|
797
|
-
this.__data__ = [], this.size = 0;
|
|
798
|
-
}
|
|
799
|
-
return _listCacheClear = listCacheClear, _listCacheClear;
|
|
800
|
-
}
|
|
801
|
-
var eq_1, hasRequiredEq;
|
|
802
|
-
function requireEq() {
|
|
803
|
-
if (hasRequiredEq) return eq_1;
|
|
804
|
-
hasRequiredEq = 1;
|
|
805
|
-
function eq(value, other) {
|
|
806
|
-
return value === other || value !== value && other !== other;
|
|
807
|
-
}
|
|
808
|
-
return eq_1 = eq, eq_1;
|
|
809
|
-
}
|
|
810
|
-
var _assocIndexOf, hasRequired_assocIndexOf;
|
|
811
|
-
function require_assocIndexOf() {
|
|
812
|
-
if (hasRequired_assocIndexOf) return _assocIndexOf;
|
|
813
|
-
hasRequired_assocIndexOf = 1;
|
|
814
|
-
var eq = requireEq();
|
|
815
|
-
function assocIndexOf(array, key) {
|
|
816
|
-
for (var length2 = array.length; length2--; )
|
|
817
|
-
if (eq(array[length2][0], key))
|
|
818
|
-
return length2;
|
|
819
|
-
return -1;
|
|
820
|
-
}
|
|
821
|
-
return _assocIndexOf = assocIndexOf, _assocIndexOf;
|
|
822
|
-
}
|
|
823
|
-
var _listCacheDelete, hasRequired_listCacheDelete;
|
|
824
|
-
function require_listCacheDelete() {
|
|
825
|
-
if (hasRequired_listCacheDelete) return _listCacheDelete;
|
|
826
|
-
hasRequired_listCacheDelete = 1;
|
|
827
|
-
var assocIndexOf = require_assocIndexOf(), arrayProto = Array.prototype, splice = arrayProto.splice;
|
|
828
|
-
function listCacheDelete(key) {
|
|
829
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
830
|
-
if (index < 0)
|
|
831
|
-
return !1;
|
|
832
|
-
var lastIndex = data.length - 1;
|
|
833
|
-
return index == lastIndex ? data.pop() : splice.call(data, index, 1), --this.size, !0;
|
|
834
|
-
}
|
|
835
|
-
return _listCacheDelete = listCacheDelete, _listCacheDelete;
|
|
836
|
-
}
|
|
837
|
-
var _listCacheGet, hasRequired_listCacheGet;
|
|
838
|
-
function require_listCacheGet() {
|
|
839
|
-
if (hasRequired_listCacheGet) return _listCacheGet;
|
|
840
|
-
hasRequired_listCacheGet = 1;
|
|
841
|
-
var assocIndexOf = require_assocIndexOf();
|
|
842
|
-
function listCacheGet(key) {
|
|
843
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
844
|
-
return index < 0 ? void 0 : data[index][1];
|
|
845
|
-
}
|
|
846
|
-
return _listCacheGet = listCacheGet, _listCacheGet;
|
|
847
|
-
}
|
|
848
|
-
var _listCacheHas, hasRequired_listCacheHas;
|
|
849
|
-
function require_listCacheHas() {
|
|
850
|
-
if (hasRequired_listCacheHas) return _listCacheHas;
|
|
851
|
-
hasRequired_listCacheHas = 1;
|
|
852
|
-
var assocIndexOf = require_assocIndexOf();
|
|
853
|
-
function listCacheHas(key) {
|
|
854
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
855
|
-
}
|
|
856
|
-
return _listCacheHas = listCacheHas, _listCacheHas;
|
|
857
|
-
}
|
|
858
|
-
var _listCacheSet, hasRequired_listCacheSet;
|
|
859
|
-
function require_listCacheSet() {
|
|
860
|
-
if (hasRequired_listCacheSet) return _listCacheSet;
|
|
861
|
-
hasRequired_listCacheSet = 1;
|
|
862
|
-
var assocIndexOf = require_assocIndexOf();
|
|
863
|
-
function listCacheSet(key, value) {
|
|
864
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
865
|
-
return index < 0 ? (++this.size, data.push([key, value])) : data[index][1] = value, this;
|
|
866
|
-
}
|
|
867
|
-
return _listCacheSet = listCacheSet, _listCacheSet;
|
|
868
|
-
}
|
|
869
|
-
var _ListCache, hasRequired_ListCache;
|
|
870
|
-
function require_ListCache() {
|
|
871
|
-
if (hasRequired_ListCache) return _ListCache;
|
|
872
|
-
hasRequired_ListCache = 1;
|
|
873
|
-
var listCacheClear = require_listCacheClear(), listCacheDelete = require_listCacheDelete(), listCacheGet = require_listCacheGet(), listCacheHas = require_listCacheHas(), listCacheSet = require_listCacheSet();
|
|
874
|
-
function ListCache(entries) {
|
|
875
|
-
var index = -1, length2 = entries == null ? 0 : entries.length;
|
|
876
|
-
for (this.clear(); ++index < length2; ) {
|
|
877
|
-
var entry = entries[index];
|
|
878
|
-
this.set(entry[0], entry[1]);
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
return ListCache.prototype.clear = listCacheClear, ListCache.prototype.delete = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet, _ListCache = ListCache, _ListCache;
|
|
882
|
-
}
|
|
883
|
-
var _stackClear, hasRequired_stackClear;
|
|
884
|
-
function require_stackClear() {
|
|
885
|
-
if (hasRequired_stackClear) return _stackClear;
|
|
886
|
-
hasRequired_stackClear = 1;
|
|
887
|
-
var ListCache = require_ListCache();
|
|
888
|
-
function stackClear() {
|
|
889
|
-
this.__data__ = new ListCache(), this.size = 0;
|
|
890
|
-
}
|
|
891
|
-
return _stackClear = stackClear, _stackClear;
|
|
892
|
-
}
|
|
893
|
-
var _stackDelete, hasRequired_stackDelete;
|
|
894
|
-
function require_stackDelete() {
|
|
895
|
-
if (hasRequired_stackDelete) return _stackDelete;
|
|
896
|
-
hasRequired_stackDelete = 1;
|
|
897
|
-
function stackDelete(key) {
|
|
898
|
-
var data = this.__data__, result = data.delete(key);
|
|
899
|
-
return this.size = data.size, result;
|
|
900
|
-
}
|
|
901
|
-
return _stackDelete = stackDelete, _stackDelete;
|
|
902
|
-
}
|
|
903
|
-
var _stackGet, hasRequired_stackGet;
|
|
904
|
-
function require_stackGet() {
|
|
905
|
-
if (hasRequired_stackGet) return _stackGet;
|
|
906
|
-
hasRequired_stackGet = 1;
|
|
907
|
-
function stackGet(key) {
|
|
908
|
-
return this.__data__.get(key);
|
|
909
|
-
}
|
|
910
|
-
return _stackGet = stackGet, _stackGet;
|
|
911
|
-
}
|
|
912
|
-
var _stackHas, hasRequired_stackHas;
|
|
913
|
-
function require_stackHas() {
|
|
914
|
-
if (hasRequired_stackHas) return _stackHas;
|
|
915
|
-
hasRequired_stackHas = 1;
|
|
916
|
-
function stackHas(key) {
|
|
917
|
-
return this.__data__.has(key);
|
|
918
|
-
}
|
|
919
|
-
return _stackHas = stackHas, _stackHas;
|
|
920
|
-
}
|
|
921
|
-
var isObject_1, hasRequiredIsObject;
|
|
922
|
-
function requireIsObject() {
|
|
923
|
-
if (hasRequiredIsObject) return isObject_1;
|
|
924
|
-
hasRequiredIsObject = 1;
|
|
925
|
-
function isObject(value) {
|
|
926
|
-
var type = typeof value;
|
|
927
|
-
return value != null && (type == "object" || type == "function");
|
|
928
|
-
}
|
|
929
|
-
return isObject_1 = isObject, isObject_1;
|
|
930
|
-
}
|
|
931
|
-
var isFunction_1, hasRequiredIsFunction;
|
|
932
|
-
function requireIsFunction() {
|
|
933
|
-
if (hasRequiredIsFunction) return isFunction_1;
|
|
934
|
-
hasRequiredIsFunction = 1;
|
|
935
|
-
var baseGetTag = require_baseGetTag(), isObject = requireIsObject(), asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
936
|
-
function isFunction(value) {
|
|
937
|
-
if (!isObject(value))
|
|
938
|
-
return !1;
|
|
939
|
-
var tag = baseGetTag(value);
|
|
940
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
941
|
-
}
|
|
942
|
-
return isFunction_1 = isFunction, isFunction_1;
|
|
943
|
-
}
|
|
944
|
-
var _coreJsData, hasRequired_coreJsData;
|
|
945
|
-
function require_coreJsData() {
|
|
946
|
-
if (hasRequired_coreJsData) return _coreJsData;
|
|
947
|
-
hasRequired_coreJsData = 1;
|
|
948
|
-
var root = require_root(), coreJsData = root["__core-js_shared__"];
|
|
949
|
-
return _coreJsData = coreJsData, _coreJsData;
|
|
950
|
-
}
|
|
951
|
-
var _isMasked, hasRequired_isMasked;
|
|
952
|
-
function require_isMasked() {
|
|
953
|
-
if (hasRequired_isMasked) return _isMasked;
|
|
954
|
-
hasRequired_isMasked = 1;
|
|
955
|
-
var coreJsData = require_coreJsData(), maskSrcKey = (function() {
|
|
956
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
957
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
958
|
-
})();
|
|
959
|
-
function isMasked(func) {
|
|
960
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
961
|
-
}
|
|
962
|
-
return _isMasked = isMasked, _isMasked;
|
|
963
|
-
}
|
|
964
|
-
var _toSource, hasRequired_toSource;
|
|
965
|
-
function require_toSource() {
|
|
966
|
-
if (hasRequired_toSource) return _toSource;
|
|
967
|
-
hasRequired_toSource = 1;
|
|
968
|
-
var funcProto = Function.prototype, funcToString = funcProto.toString;
|
|
969
|
-
function toSource(func) {
|
|
970
|
-
if (func != null) {
|
|
971
|
-
try {
|
|
972
|
-
return funcToString.call(func);
|
|
973
|
-
} catch {
|
|
974
|
-
}
|
|
975
|
-
try {
|
|
976
|
-
return func + "";
|
|
977
|
-
} catch {
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
return "";
|
|
981
|
-
}
|
|
982
|
-
return _toSource = toSource, _toSource;
|
|
983
|
-
}
|
|
984
|
-
var _baseIsNative, hasRequired_baseIsNative;
|
|
985
|
-
function require_baseIsNative() {
|
|
986
|
-
if (hasRequired_baseIsNative) return _baseIsNative;
|
|
987
|
-
hasRequired_baseIsNative = 1;
|
|
988
|
-
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(
|
|
989
|
-
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
990
|
-
);
|
|
991
|
-
function baseIsNative(value) {
|
|
992
|
-
if (!isObject(value) || isMasked(value))
|
|
993
|
-
return !1;
|
|
994
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
995
|
-
return pattern.test(toSource(value));
|
|
996
|
-
}
|
|
997
|
-
return _baseIsNative = baseIsNative, _baseIsNative;
|
|
998
|
-
}
|
|
999
|
-
var _getValue, hasRequired_getValue;
|
|
1000
|
-
function require_getValue() {
|
|
1001
|
-
if (hasRequired_getValue) return _getValue;
|
|
1002
|
-
hasRequired_getValue = 1;
|
|
1003
|
-
function getValue(object, key) {
|
|
1004
|
-
return object?.[key];
|
|
1005
|
-
}
|
|
1006
|
-
return _getValue = getValue, _getValue;
|
|
1007
|
-
}
|
|
1008
|
-
var _getNative, hasRequired_getNative;
|
|
1009
|
-
function require_getNative() {
|
|
1010
|
-
if (hasRequired_getNative) return _getNative;
|
|
1011
|
-
hasRequired_getNative = 1;
|
|
1012
|
-
var baseIsNative = require_baseIsNative(), getValue = require_getValue();
|
|
1013
|
-
function getNative(object, key) {
|
|
1014
|
-
var value = getValue(object, key);
|
|
1015
|
-
return baseIsNative(value) ? value : void 0;
|
|
1016
|
-
}
|
|
1017
|
-
return _getNative = getNative, _getNative;
|
|
1018
|
-
}
|
|
1019
|
-
var _Map, hasRequired_Map;
|
|
1020
|
-
function require_Map() {
|
|
1021
|
-
if (hasRequired_Map) return _Map;
|
|
1022
|
-
hasRequired_Map = 1;
|
|
1023
|
-
var getNative = require_getNative(), root = require_root(), Map2 = getNative(root, "Map");
|
|
1024
|
-
return _Map = Map2, _Map;
|
|
1025
|
-
}
|
|
1026
|
-
var _nativeCreate, hasRequired_nativeCreate;
|
|
1027
|
-
function require_nativeCreate() {
|
|
1028
|
-
if (hasRequired_nativeCreate) return _nativeCreate;
|
|
1029
|
-
hasRequired_nativeCreate = 1;
|
|
1030
|
-
var getNative = require_getNative(), nativeCreate = getNative(Object, "create");
|
|
1031
|
-
return _nativeCreate = nativeCreate, _nativeCreate;
|
|
1032
|
-
}
|
|
1033
|
-
var _hashClear, hasRequired_hashClear;
|
|
1034
|
-
function require_hashClear() {
|
|
1035
|
-
if (hasRequired_hashClear) return _hashClear;
|
|
1036
|
-
hasRequired_hashClear = 1;
|
|
1037
|
-
var nativeCreate = require_nativeCreate();
|
|
1038
|
-
function hashClear() {
|
|
1039
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0;
|
|
1040
|
-
}
|
|
1041
|
-
return _hashClear = hashClear, _hashClear;
|
|
1042
|
-
}
|
|
1043
|
-
var _hashDelete, hasRequired_hashDelete;
|
|
1044
|
-
function require_hashDelete() {
|
|
1045
|
-
if (hasRequired_hashDelete) return _hashDelete;
|
|
1046
|
-
hasRequired_hashDelete = 1;
|
|
1047
|
-
function hashDelete(key) {
|
|
1048
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
1049
|
-
return this.size -= result ? 1 : 0, result;
|
|
1050
|
-
}
|
|
1051
|
-
return _hashDelete = hashDelete, _hashDelete;
|
|
1052
|
-
}
|
|
1053
|
-
var _hashGet, hasRequired_hashGet;
|
|
1054
|
-
function require_hashGet() {
|
|
1055
|
-
if (hasRequired_hashGet) return _hashGet;
|
|
1056
|
-
hasRequired_hashGet = 1;
|
|
1057
|
-
var nativeCreate = require_nativeCreate(), HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1058
|
-
function hashGet(key) {
|
|
1059
|
-
var data = this.__data__;
|
|
1060
|
-
if (nativeCreate) {
|
|
1061
|
-
var result = data[key];
|
|
1062
|
-
return result === HASH_UNDEFINED ? void 0 : result;
|
|
1063
|
-
}
|
|
1064
|
-
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
1065
|
-
}
|
|
1066
|
-
return _hashGet = hashGet, _hashGet;
|
|
1067
|
-
}
|
|
1068
|
-
var _hashHas, hasRequired_hashHas;
|
|
1069
|
-
function require_hashHas() {
|
|
1070
|
-
if (hasRequired_hashHas) return _hashHas;
|
|
1071
|
-
hasRequired_hashHas = 1;
|
|
1072
|
-
var nativeCreate = require_nativeCreate(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1073
|
-
function hashHas(key) {
|
|
1074
|
-
var data = this.__data__;
|
|
1075
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
1076
|
-
}
|
|
1077
|
-
return _hashHas = hashHas, _hashHas;
|
|
1078
|
-
}
|
|
1079
|
-
var _hashSet, hasRequired_hashSet;
|
|
1080
|
-
function require_hashSet() {
|
|
1081
|
-
if (hasRequired_hashSet) return _hashSet;
|
|
1082
|
-
hasRequired_hashSet = 1;
|
|
1083
|
-
var nativeCreate = require_nativeCreate(), HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1084
|
-
function hashSet(key, value) {
|
|
1085
|
-
var data = this.__data__;
|
|
1086
|
-
return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value, this;
|
|
1087
|
-
}
|
|
1088
|
-
return _hashSet = hashSet, _hashSet;
|
|
1089
|
-
}
|
|
1090
|
-
var _Hash, hasRequired_Hash;
|
|
1091
|
-
function require_Hash() {
|
|
1092
|
-
if (hasRequired_Hash) return _Hash;
|
|
1093
|
-
hasRequired_Hash = 1;
|
|
1094
|
-
var hashClear = require_hashClear(), hashDelete = require_hashDelete(), hashGet = require_hashGet(), hashHas = require_hashHas(), hashSet = require_hashSet();
|
|
1095
|
-
function Hash(entries) {
|
|
1096
|
-
var index = -1, length2 = entries == null ? 0 : entries.length;
|
|
1097
|
-
for (this.clear(); ++index < length2; ) {
|
|
1098
|
-
var entry = entries[index];
|
|
1099
|
-
this.set(entry[0], entry[1]);
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
return Hash.prototype.clear = hashClear, Hash.prototype.delete = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet, _Hash = Hash, _Hash;
|
|
1103
|
-
}
|
|
1104
|
-
var _mapCacheClear, hasRequired_mapCacheClear;
|
|
1105
|
-
function require_mapCacheClear() {
|
|
1106
|
-
if (hasRequired_mapCacheClear) return _mapCacheClear;
|
|
1107
|
-
hasRequired_mapCacheClear = 1;
|
|
1108
|
-
var Hash = require_Hash(), ListCache = require_ListCache(), Map2 = require_Map();
|
|
1109
|
-
function mapCacheClear() {
|
|
1110
|
-
this.size = 0, this.__data__ = {
|
|
1111
|
-
hash: new Hash(),
|
|
1112
|
-
map: new (Map2 || ListCache)(),
|
|
1113
|
-
string: new Hash()
|
|
1114
|
-
};
|
|
1115
|
-
}
|
|
1116
|
-
return _mapCacheClear = mapCacheClear, _mapCacheClear;
|
|
1117
|
-
}
|
|
1118
|
-
var _isKeyable, hasRequired_isKeyable;
|
|
1119
|
-
function require_isKeyable() {
|
|
1120
|
-
if (hasRequired_isKeyable) return _isKeyable;
|
|
1121
|
-
hasRequired_isKeyable = 1;
|
|
1122
|
-
function isKeyable(value) {
|
|
1123
|
-
var type = typeof value;
|
|
1124
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
1125
|
-
}
|
|
1126
|
-
return _isKeyable = isKeyable, _isKeyable;
|
|
1127
|
-
}
|
|
1128
|
-
var _getMapData, hasRequired_getMapData;
|
|
1129
|
-
function require_getMapData() {
|
|
1130
|
-
if (hasRequired_getMapData) return _getMapData;
|
|
1131
|
-
hasRequired_getMapData = 1;
|
|
1132
|
-
var isKeyable = require_isKeyable();
|
|
1133
|
-
function getMapData(map, key) {
|
|
1134
|
-
var data = map.__data__;
|
|
1135
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
1136
|
-
}
|
|
1137
|
-
return _getMapData = getMapData, _getMapData;
|
|
1138
|
-
}
|
|
1139
|
-
var _mapCacheDelete, hasRequired_mapCacheDelete;
|
|
1140
|
-
function require_mapCacheDelete() {
|
|
1141
|
-
if (hasRequired_mapCacheDelete) return _mapCacheDelete;
|
|
1142
|
-
hasRequired_mapCacheDelete = 1;
|
|
1143
|
-
var getMapData = require_getMapData();
|
|
1144
|
-
function mapCacheDelete(key) {
|
|
1145
|
-
var result = getMapData(this, key).delete(key);
|
|
1146
|
-
return this.size -= result ? 1 : 0, result;
|
|
1147
|
-
}
|
|
1148
|
-
return _mapCacheDelete = mapCacheDelete, _mapCacheDelete;
|
|
1149
|
-
}
|
|
1150
|
-
var _mapCacheGet, hasRequired_mapCacheGet;
|
|
1151
|
-
function require_mapCacheGet() {
|
|
1152
|
-
if (hasRequired_mapCacheGet) return _mapCacheGet;
|
|
1153
|
-
hasRequired_mapCacheGet = 1;
|
|
1154
|
-
var getMapData = require_getMapData();
|
|
1155
|
-
function mapCacheGet(key) {
|
|
1156
|
-
return getMapData(this, key).get(key);
|
|
1157
|
-
}
|
|
1158
|
-
return _mapCacheGet = mapCacheGet, _mapCacheGet;
|
|
1159
|
-
}
|
|
1160
|
-
var _mapCacheHas, hasRequired_mapCacheHas;
|
|
1161
|
-
function require_mapCacheHas() {
|
|
1162
|
-
if (hasRequired_mapCacheHas) return _mapCacheHas;
|
|
1163
|
-
hasRequired_mapCacheHas = 1;
|
|
1164
|
-
var getMapData = require_getMapData();
|
|
1165
|
-
function mapCacheHas(key) {
|
|
1166
|
-
return getMapData(this, key).has(key);
|
|
1167
|
-
}
|
|
1168
|
-
return _mapCacheHas = mapCacheHas, _mapCacheHas;
|
|
1169
|
-
}
|
|
1170
|
-
var _mapCacheSet, hasRequired_mapCacheSet;
|
|
1171
|
-
function require_mapCacheSet() {
|
|
1172
|
-
if (hasRequired_mapCacheSet) return _mapCacheSet;
|
|
1173
|
-
hasRequired_mapCacheSet = 1;
|
|
1174
|
-
var getMapData = require_getMapData();
|
|
1175
|
-
function mapCacheSet(key, value) {
|
|
1176
|
-
var data = getMapData(this, key), size = data.size;
|
|
1177
|
-
return data.set(key, value), this.size += data.size == size ? 0 : 1, this;
|
|
1178
|
-
}
|
|
1179
|
-
return _mapCacheSet = mapCacheSet, _mapCacheSet;
|
|
1180
|
-
}
|
|
1181
|
-
var _MapCache, hasRequired_MapCache;
|
|
1182
|
-
function require_MapCache() {
|
|
1183
|
-
if (hasRequired_MapCache) return _MapCache;
|
|
1184
|
-
hasRequired_MapCache = 1;
|
|
1185
|
-
var mapCacheClear = require_mapCacheClear(), mapCacheDelete = require_mapCacheDelete(), mapCacheGet = require_mapCacheGet(), mapCacheHas = require_mapCacheHas(), mapCacheSet = require_mapCacheSet();
|
|
1186
|
-
function MapCache(entries) {
|
|
1187
|
-
var index = -1, length2 = entries == null ? 0 : entries.length;
|
|
1188
|
-
for (this.clear(); ++index < length2; ) {
|
|
1189
|
-
var entry = entries[index];
|
|
1190
|
-
this.set(entry[0], entry[1]);
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
return MapCache.prototype.clear = mapCacheClear, MapCache.prototype.delete = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet, _MapCache = MapCache, _MapCache;
|
|
1194
|
-
}
|
|
1195
|
-
var _stackSet, hasRequired_stackSet;
|
|
1196
|
-
function require_stackSet() {
|
|
1197
|
-
if (hasRequired_stackSet) return _stackSet;
|
|
1198
|
-
hasRequired_stackSet = 1;
|
|
1199
|
-
var ListCache = require_ListCache(), Map2 = require_Map(), MapCache = require_MapCache(), LARGE_ARRAY_SIZE = 200;
|
|
1200
|
-
function stackSet(key, value) {
|
|
1201
|
-
var data = this.__data__;
|
|
1202
|
-
if (data instanceof ListCache) {
|
|
1203
|
-
var pairs = data.__data__;
|
|
1204
|
-
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1)
|
|
1205
|
-
return pairs.push([key, value]), this.size = ++data.size, this;
|
|
1206
|
-
data = this.__data__ = new MapCache(pairs);
|
|
1207
|
-
}
|
|
1208
|
-
return data.set(key, value), this.size = data.size, this;
|
|
1209
|
-
}
|
|
1210
|
-
return _stackSet = stackSet, _stackSet;
|
|
1211
|
-
}
|
|
1212
|
-
var _Stack, hasRequired_Stack;
|
|
1213
|
-
function require_Stack() {
|
|
1214
|
-
if (hasRequired_Stack) return _Stack;
|
|
1215
|
-
hasRequired_Stack = 1;
|
|
1216
|
-
var ListCache = require_ListCache(), stackClear = require_stackClear(), stackDelete = require_stackDelete(), stackGet = require_stackGet(), stackHas = require_stackHas(), stackSet = require_stackSet();
|
|
1217
|
-
function Stack2(entries) {
|
|
1218
|
-
var data = this.__data__ = new ListCache(entries);
|
|
1219
|
-
this.size = data.size;
|
|
1220
|
-
}
|
|
1221
|
-
return Stack2.prototype.clear = stackClear, Stack2.prototype.delete = stackDelete, Stack2.prototype.get = stackGet, Stack2.prototype.has = stackHas, Stack2.prototype.set = stackSet, _Stack = Stack2, _Stack;
|
|
1222
|
-
}
|
|
1223
|
-
var _setCacheAdd, hasRequired_setCacheAdd;
|
|
1224
|
-
function require_setCacheAdd() {
|
|
1225
|
-
if (hasRequired_setCacheAdd) return _setCacheAdd;
|
|
1226
|
-
hasRequired_setCacheAdd = 1;
|
|
1227
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1228
|
-
function setCacheAdd(value) {
|
|
1229
|
-
return this.__data__.set(value, HASH_UNDEFINED), this;
|
|
1230
|
-
}
|
|
1231
|
-
return _setCacheAdd = setCacheAdd, _setCacheAdd;
|
|
1232
|
-
}
|
|
1233
|
-
var _setCacheHas, hasRequired_setCacheHas;
|
|
1234
|
-
function require_setCacheHas() {
|
|
1235
|
-
if (hasRequired_setCacheHas) return _setCacheHas;
|
|
1236
|
-
hasRequired_setCacheHas = 1;
|
|
1237
|
-
function setCacheHas(value) {
|
|
1238
|
-
return this.__data__.has(value);
|
|
1239
|
-
}
|
|
1240
|
-
return _setCacheHas = setCacheHas, _setCacheHas;
|
|
1241
|
-
}
|
|
1242
|
-
var _SetCache, hasRequired_SetCache;
|
|
1243
|
-
function require_SetCache() {
|
|
1244
|
-
if (hasRequired_SetCache) return _SetCache;
|
|
1245
|
-
hasRequired_SetCache = 1;
|
|
1246
|
-
var MapCache = require_MapCache(), setCacheAdd = require_setCacheAdd(), setCacheHas = require_setCacheHas();
|
|
1247
|
-
function SetCache(values) {
|
|
1248
|
-
var index = -1, length2 = values == null ? 0 : values.length;
|
|
1249
|
-
for (this.__data__ = new MapCache(); ++index < length2; )
|
|
1250
|
-
this.add(values[index]);
|
|
1251
|
-
}
|
|
1252
|
-
return SetCache.prototype.add = SetCache.prototype.push = setCacheAdd, SetCache.prototype.has = setCacheHas, _SetCache = SetCache, _SetCache;
|
|
1253
|
-
}
|
|
1254
|
-
var _arraySome, hasRequired_arraySome;
|
|
1255
|
-
function require_arraySome() {
|
|
1256
|
-
if (hasRequired_arraySome) return _arraySome;
|
|
1257
|
-
hasRequired_arraySome = 1;
|
|
1258
|
-
function arraySome(array, predicate) {
|
|
1259
|
-
for (var index = -1, length2 = array == null ? 0 : array.length; ++index < length2; )
|
|
1260
|
-
if (predicate(array[index], index, array))
|
|
1261
|
-
return !0;
|
|
1262
|
-
return !1;
|
|
1263
|
-
}
|
|
1264
|
-
return _arraySome = arraySome, _arraySome;
|
|
1265
|
-
}
|
|
1266
|
-
var _cacheHas, hasRequired_cacheHas;
|
|
1267
|
-
function require_cacheHas() {
|
|
1268
|
-
if (hasRequired_cacheHas) return _cacheHas;
|
|
1269
|
-
hasRequired_cacheHas = 1;
|
|
1270
|
-
function cacheHas(cache, key) {
|
|
1271
|
-
return cache.has(key);
|
|
1272
|
-
}
|
|
1273
|
-
return _cacheHas = cacheHas, _cacheHas;
|
|
1274
|
-
}
|
|
1275
|
-
var _equalArrays, hasRequired_equalArrays;
|
|
1276
|
-
function require_equalArrays() {
|
|
1277
|
-
if (hasRequired_equalArrays) return _equalArrays;
|
|
1278
|
-
hasRequired_equalArrays = 1;
|
|
1279
|
-
var SetCache = require_SetCache(), arraySome = require_arraySome(), cacheHas = require_cacheHas(), COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
1280
|
-
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1281
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
1282
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength))
|
|
1283
|
-
return !1;
|
|
1284
|
-
var arrStacked = stack.get(array), othStacked = stack.get(other);
|
|
1285
|
-
if (arrStacked && othStacked)
|
|
1286
|
-
return arrStacked == other && othStacked == array;
|
|
1287
|
-
var index = -1, result = !0, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
|
|
1288
|
-
for (stack.set(array, other), stack.set(other, array); ++index < arrLength; ) {
|
|
1289
|
-
var arrValue = array[index], othValue = other[index];
|
|
1290
|
-
if (customizer)
|
|
1291
|
-
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
1292
|
-
if (compared !== void 0) {
|
|
1293
|
-
if (compared)
|
|
1294
|
-
continue;
|
|
1295
|
-
result = !1;
|
|
1296
|
-
break;
|
|
1297
|
-
}
|
|
1298
|
-
if (seen) {
|
|
1299
|
-
if (!arraySome(other, function(othValue2, othIndex) {
|
|
1300
|
-
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack)))
|
|
1301
|
-
return seen.push(othIndex);
|
|
1302
|
-
})) {
|
|
1303
|
-
result = !1;
|
|
1304
|
-
break;
|
|
1305
|
-
}
|
|
1306
|
-
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1307
|
-
result = !1;
|
|
1308
|
-
break;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
return stack.delete(array), stack.delete(other), result;
|
|
1312
|
-
}
|
|
1313
|
-
return _equalArrays = equalArrays, _equalArrays;
|
|
1314
|
-
}
|
|
1315
|
-
var _Uint8Array, hasRequired_Uint8Array;
|
|
1316
|
-
function require_Uint8Array() {
|
|
1317
|
-
if (hasRequired_Uint8Array) return _Uint8Array;
|
|
1318
|
-
hasRequired_Uint8Array = 1;
|
|
1319
|
-
var root = require_root(), Uint8Array2 = root.Uint8Array;
|
|
1320
|
-
return _Uint8Array = Uint8Array2, _Uint8Array;
|
|
1321
|
-
}
|
|
1322
|
-
var _mapToArray, hasRequired_mapToArray;
|
|
1323
|
-
function require_mapToArray() {
|
|
1324
|
-
if (hasRequired_mapToArray) return _mapToArray;
|
|
1325
|
-
hasRequired_mapToArray = 1;
|
|
1326
|
-
function mapToArray(map) {
|
|
1327
|
-
var index = -1, result = Array(map.size);
|
|
1328
|
-
return map.forEach(function(value, key) {
|
|
1329
|
-
result[++index] = [key, value];
|
|
1330
|
-
}), result;
|
|
1331
|
-
}
|
|
1332
|
-
return _mapToArray = mapToArray, _mapToArray;
|
|
1333
|
-
}
|
|
1334
|
-
var _setToArray, hasRequired_setToArray;
|
|
1335
|
-
function require_setToArray() {
|
|
1336
|
-
if (hasRequired_setToArray) return _setToArray;
|
|
1337
|
-
hasRequired_setToArray = 1;
|
|
1338
|
-
function setToArray(set) {
|
|
1339
|
-
var index = -1, result = Array(set.size);
|
|
1340
|
-
return set.forEach(function(value) {
|
|
1341
|
-
result[++index] = value;
|
|
1342
|
-
}), result;
|
|
1343
|
-
}
|
|
1344
|
-
return _setToArray = setToArray, _setToArray;
|
|
1345
|
-
}
|
|
1346
|
-
var _equalByTag, hasRequired_equalByTag;
|
|
1347
|
-
function require_equalByTag() {
|
|
1348
|
-
if (hasRequired_equalByTag) return _equalByTag;
|
|
1349
|
-
hasRequired_equalByTag = 1;
|
|
1350
|
-
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;
|
|
1351
|
-
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1352
|
-
switch (tag) {
|
|
1353
|
-
case dataViewTag:
|
|
1354
|
-
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset)
|
|
1355
|
-
return !1;
|
|
1356
|
-
object = object.buffer, other = other.buffer;
|
|
1357
|
-
case arrayBufferTag:
|
|
1358
|
-
return !(object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other)));
|
|
1359
|
-
case boolTag:
|
|
1360
|
-
case dateTag:
|
|
1361
|
-
case numberTag:
|
|
1362
|
-
return eq(+object, +other);
|
|
1363
|
-
case errorTag:
|
|
1364
|
-
return object.name == other.name && object.message == other.message;
|
|
1365
|
-
case regexpTag:
|
|
1366
|
-
case stringTag:
|
|
1367
|
-
return object == other + "";
|
|
1368
|
-
case mapTag:
|
|
1369
|
-
var convert = mapToArray;
|
|
1370
|
-
case setTag:
|
|
1371
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
1372
|
-
if (convert || (convert = setToArray), object.size != other.size && !isPartial)
|
|
1373
|
-
return !1;
|
|
1374
|
-
var stacked = stack.get(object);
|
|
1375
|
-
if (stacked)
|
|
1376
|
-
return stacked == other;
|
|
1377
|
-
bitmask |= COMPARE_UNORDERED_FLAG, stack.set(object, other);
|
|
1378
|
-
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
1379
|
-
return stack.delete(object), result;
|
|
1380
|
-
case symbolTag:
|
|
1381
|
-
if (symbolValueOf)
|
|
1382
|
-
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
1383
|
-
}
|
|
1384
|
-
return !1;
|
|
1385
|
-
}
|
|
1386
|
-
return _equalByTag = equalByTag, _equalByTag;
|
|
1387
|
-
}
|
|
1388
|
-
var _baseGetAllKeys, hasRequired_baseGetAllKeys;
|
|
1389
|
-
function require_baseGetAllKeys() {
|
|
1390
|
-
if (hasRequired_baseGetAllKeys) return _baseGetAllKeys;
|
|
1391
|
-
hasRequired_baseGetAllKeys = 1;
|
|
1392
|
-
var arrayPush = require_arrayPush(), isArray = requireIsArray();
|
|
1393
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1394
|
-
var result = keysFunc(object);
|
|
1395
|
-
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
1396
|
-
}
|
|
1397
|
-
return _baseGetAllKeys = baseGetAllKeys, _baseGetAllKeys;
|
|
1398
|
-
}
|
|
1399
|
-
var _arrayFilter, hasRequired_arrayFilter;
|
|
1400
|
-
function require_arrayFilter() {
|
|
1401
|
-
if (hasRequired_arrayFilter) return _arrayFilter;
|
|
1402
|
-
hasRequired_arrayFilter = 1;
|
|
1403
|
-
function arrayFilter(array, predicate) {
|
|
1404
|
-
for (var index = -1, length2 = array == null ? 0 : array.length, resIndex = 0, result = []; ++index < length2; ) {
|
|
1405
|
-
var value = array[index];
|
|
1406
|
-
predicate(value, index, array) && (result[resIndex++] = value);
|
|
1407
|
-
}
|
|
1408
|
-
return result;
|
|
1409
|
-
}
|
|
1410
|
-
return _arrayFilter = arrayFilter, _arrayFilter;
|
|
1411
|
-
}
|
|
1412
|
-
var stubArray_1, hasRequiredStubArray;
|
|
1413
|
-
function requireStubArray() {
|
|
1414
|
-
if (hasRequiredStubArray) return stubArray_1;
|
|
1415
|
-
hasRequiredStubArray = 1;
|
|
1416
|
-
function stubArray() {
|
|
1417
|
-
return [];
|
|
1418
|
-
}
|
|
1419
|
-
return stubArray_1 = stubArray, stubArray_1;
|
|
1420
|
-
}
|
|
1421
|
-
var _getSymbols, hasRequired_getSymbols;
|
|
1422
|
-
function require_getSymbols() {
|
|
1423
|
-
if (hasRequired_getSymbols) return _getSymbols;
|
|
1424
|
-
hasRequired_getSymbols = 1;
|
|
1425
|
-
var arrayFilter = require_arrayFilter(), stubArray = requireStubArray(), objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable, nativeGetSymbols = Object.getOwnPropertySymbols, getSymbols = nativeGetSymbols ? function(object) {
|
|
1426
|
-
return object == null ? [] : (object = Object(object), arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
1427
|
-
return propertyIsEnumerable.call(object, symbol);
|
|
1428
|
-
}));
|
|
1429
|
-
} : stubArray;
|
|
1430
|
-
return _getSymbols = getSymbols, _getSymbols;
|
|
1431
|
-
}
|
|
1432
|
-
var _baseTimes, hasRequired_baseTimes;
|
|
1433
|
-
function require_baseTimes() {
|
|
1434
|
-
if (hasRequired_baseTimes) return _baseTimes;
|
|
1435
|
-
hasRequired_baseTimes = 1;
|
|
1436
|
-
function baseTimes(n, iteratee) {
|
|
1437
|
-
for (var index = -1, result = Array(n); ++index < n; )
|
|
1438
|
-
result[index] = iteratee(index);
|
|
1439
|
-
return result;
|
|
1440
|
-
}
|
|
1441
|
-
return _baseTimes = baseTimes, _baseTimes;
|
|
1442
|
-
}
|
|
1443
|
-
var isBuffer = { exports: {} }, stubFalse_1, hasRequiredStubFalse;
|
|
1444
|
-
function requireStubFalse() {
|
|
1445
|
-
if (hasRequiredStubFalse) return stubFalse_1;
|
|
1446
|
-
hasRequiredStubFalse = 1;
|
|
1447
|
-
function stubFalse() {
|
|
1448
|
-
return !1;
|
|
1449
|
-
}
|
|
1450
|
-
return stubFalse_1 = stubFalse, stubFalse_1;
|
|
1451
|
-
}
|
|
1452
|
-
var hasRequiredIsBuffer;
|
|
1453
|
-
function requireIsBuffer() {
|
|
1454
|
-
return hasRequiredIsBuffer || (hasRequiredIsBuffer = 1, (function(module, exports) {
|
|
1455
|
-
var root = require_root(), stubFalse = requireStubFalse(), freeExports = exports && !exports.nodeType && exports, freeModule = freeExports && !0 && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, Buffer = moduleExports ? root.Buffer : void 0, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, isBuffer2 = nativeIsBuffer || stubFalse;
|
|
1456
|
-
module.exports = isBuffer2;
|
|
1457
|
-
})(isBuffer, isBuffer.exports)), isBuffer.exports;
|
|
1458
|
-
}
|
|
1459
|
-
var _isIndex, hasRequired_isIndex;
|
|
1460
|
-
function require_isIndex() {
|
|
1461
|
-
if (hasRequired_isIndex) return _isIndex;
|
|
1462
|
-
hasRequired_isIndex = 1;
|
|
1463
|
-
var MAX_SAFE_INTEGER = 9007199254740991, reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
1464
|
-
function isIndex(value, length2) {
|
|
1465
|
-
var type = typeof value;
|
|
1466
|
-
return length2 = length2 ?? MAX_SAFE_INTEGER, !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length2;
|
|
1467
|
-
}
|
|
1468
|
-
return _isIndex = isIndex, _isIndex;
|
|
1469
|
-
}
|
|
1470
|
-
var isLength_1, hasRequiredIsLength;
|
|
1471
|
-
function requireIsLength() {
|
|
1472
|
-
if (hasRequiredIsLength) return isLength_1;
|
|
1473
|
-
hasRequiredIsLength = 1;
|
|
1474
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
1475
|
-
function isLength(value) {
|
|
1476
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1477
|
-
}
|
|
1478
|
-
return isLength_1 = isLength, isLength_1;
|
|
1479
|
-
}
|
|
1480
|
-
var _baseIsTypedArray, hasRequired_baseIsTypedArray;
|
|
1481
|
-
function require_baseIsTypedArray() {
|
|
1482
|
-
if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
|
|
1483
|
-
hasRequired_baseIsTypedArray = 1;
|
|
1484
|
-
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 = {};
|
|
1485
|
-
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;
|
|
1486
|
-
function baseIsTypedArray(value) {
|
|
1487
|
-
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
1488
|
-
}
|
|
1489
|
-
return _baseIsTypedArray = baseIsTypedArray, _baseIsTypedArray;
|
|
1490
|
-
}
|
|
1491
|
-
var _baseUnary, hasRequired_baseUnary;
|
|
1492
|
-
function require_baseUnary() {
|
|
1493
|
-
if (hasRequired_baseUnary) return _baseUnary;
|
|
1494
|
-
hasRequired_baseUnary = 1;
|
|
1495
|
-
function baseUnary(func) {
|
|
1496
|
-
return function(value) {
|
|
1497
|
-
return func(value);
|
|
1498
|
-
};
|
|
1499
|
-
}
|
|
1500
|
-
return _baseUnary = baseUnary, _baseUnary;
|
|
1501
|
-
}
|
|
1502
|
-
var _nodeUtil = { exports: {} }, hasRequired_nodeUtil;
|
|
1503
|
-
function require_nodeUtil() {
|
|
1504
|
-
return hasRequired_nodeUtil || (hasRequired_nodeUtil = 1, (function(module, exports) {
|
|
1505
|
-
var freeGlobal = require_freeGlobal(), freeExports = exports && !exports.nodeType && exports, freeModule = freeExports && !0 && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, freeProcess = moduleExports && freeGlobal.process, nodeUtil = (function() {
|
|
1506
|
-
try {
|
|
1507
|
-
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
1508
|
-
return types || freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
1509
|
-
} catch {
|
|
1510
|
-
}
|
|
1511
|
-
})();
|
|
1512
|
-
module.exports = nodeUtil;
|
|
1513
|
-
})(_nodeUtil, _nodeUtil.exports)), _nodeUtil.exports;
|
|
1514
|
-
}
|
|
1515
|
-
var isTypedArray_1, hasRequiredIsTypedArray;
|
|
1516
|
-
function requireIsTypedArray() {
|
|
1517
|
-
if (hasRequiredIsTypedArray) return isTypedArray_1;
|
|
1518
|
-
hasRequiredIsTypedArray = 1;
|
|
1519
|
-
var baseIsTypedArray = require_baseIsTypedArray(), baseUnary = require_baseUnary(), nodeUtil = require_nodeUtil(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1520
|
-
return isTypedArray_1 = isTypedArray, isTypedArray_1;
|
|
1521
|
-
}
|
|
1522
|
-
var _arrayLikeKeys, hasRequired_arrayLikeKeys;
|
|
1523
|
-
function require_arrayLikeKeys() {
|
|
1524
|
-
if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
|
|
1525
|
-
hasRequired_arrayLikeKeys = 1;
|
|
1526
|
-
var baseTimes = require_baseTimes(), isArguments = requireIsArguments(), isArray = requireIsArray(), isBuffer2 = requireIsBuffer(), isIndex = require_isIndex(), isTypedArray = requireIsTypedArray(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1527
|
-
function arrayLikeKeys(value, inherited) {
|
|
1528
|
-
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;
|
|
1529
|
-
for (var key in value)
|
|
1530
|
-
(inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1531
|
-
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1532
|
-
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1533
|
-
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
1534
|
-
isIndex(key, length2))) && result.push(key);
|
|
1535
|
-
return result;
|
|
1536
|
-
}
|
|
1537
|
-
return _arrayLikeKeys = arrayLikeKeys, _arrayLikeKeys;
|
|
1538
|
-
}
|
|
1539
|
-
var _isPrototype, hasRequired_isPrototype;
|
|
1540
|
-
function require_isPrototype() {
|
|
1541
|
-
if (hasRequired_isPrototype) return _isPrototype;
|
|
1542
|
-
hasRequired_isPrototype = 1;
|
|
1543
|
-
var objectProto = Object.prototype;
|
|
1544
|
-
function isPrototype(value) {
|
|
1545
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
1546
|
-
return value === proto;
|
|
1547
|
-
}
|
|
1548
|
-
return _isPrototype = isPrototype, _isPrototype;
|
|
1549
|
-
}
|
|
1550
|
-
var _overArg, hasRequired_overArg;
|
|
1551
|
-
function require_overArg() {
|
|
1552
|
-
if (hasRequired_overArg) return _overArg;
|
|
1553
|
-
hasRequired_overArg = 1;
|
|
1554
|
-
function overArg(func, transform) {
|
|
1555
|
-
return function(arg) {
|
|
1556
|
-
return func(transform(arg));
|
|
1557
|
-
};
|
|
1558
|
-
}
|
|
1559
|
-
return _overArg = overArg, _overArg;
|
|
1560
|
-
}
|
|
1561
|
-
var _nativeKeys, hasRequired_nativeKeys;
|
|
1562
|
-
function require_nativeKeys() {
|
|
1563
|
-
if (hasRequired_nativeKeys) return _nativeKeys;
|
|
1564
|
-
hasRequired_nativeKeys = 1;
|
|
1565
|
-
var overArg = require_overArg(), nativeKeys = overArg(Object.keys, Object);
|
|
1566
|
-
return _nativeKeys = nativeKeys, _nativeKeys;
|
|
1567
|
-
}
|
|
1568
|
-
var _baseKeys, hasRequired_baseKeys;
|
|
1569
|
-
function require_baseKeys() {
|
|
1570
|
-
if (hasRequired_baseKeys) return _baseKeys;
|
|
1571
|
-
hasRequired_baseKeys = 1;
|
|
1572
|
-
var isPrototype = require_isPrototype(), nativeKeys = require_nativeKeys(), objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1573
|
-
function baseKeys(object) {
|
|
1574
|
-
if (!isPrototype(object))
|
|
1575
|
-
return nativeKeys(object);
|
|
1576
|
-
var result = [];
|
|
1577
|
-
for (var key in Object(object))
|
|
1578
|
-
hasOwnProperty.call(object, key) && key != "constructor" && result.push(key);
|
|
1579
|
-
return result;
|
|
1580
|
-
}
|
|
1581
|
-
return _baseKeys = baseKeys, _baseKeys;
|
|
1582
|
-
}
|
|
1583
|
-
var isArrayLike_1, hasRequiredIsArrayLike;
|
|
1584
|
-
function requireIsArrayLike() {
|
|
1585
|
-
if (hasRequiredIsArrayLike) return isArrayLike_1;
|
|
1586
|
-
hasRequiredIsArrayLike = 1;
|
|
1587
|
-
var isFunction = requireIsFunction(), isLength = requireIsLength();
|
|
1588
|
-
function isArrayLike(value) {
|
|
1589
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
1590
|
-
}
|
|
1591
|
-
return isArrayLike_1 = isArrayLike, isArrayLike_1;
|
|
1592
|
-
}
|
|
1593
|
-
var keys_1, hasRequiredKeys;
|
|
1594
|
-
function requireKeys() {
|
|
1595
|
-
if (hasRequiredKeys) return keys_1;
|
|
1596
|
-
hasRequiredKeys = 1;
|
|
1597
|
-
var arrayLikeKeys = require_arrayLikeKeys(), baseKeys = require_baseKeys(), isArrayLike = requireIsArrayLike();
|
|
1598
|
-
function keys(object) {
|
|
1599
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
1600
|
-
}
|
|
1601
|
-
return keys_1 = keys, keys_1;
|
|
1602
|
-
}
|
|
1603
|
-
var _getAllKeys, hasRequired_getAllKeys;
|
|
1604
|
-
function require_getAllKeys() {
|
|
1605
|
-
if (hasRequired_getAllKeys) return _getAllKeys;
|
|
1606
|
-
hasRequired_getAllKeys = 1;
|
|
1607
|
-
var baseGetAllKeys = require_baseGetAllKeys(), getSymbols = require_getSymbols(), keys = requireKeys();
|
|
1608
|
-
function getAllKeys(object) {
|
|
1609
|
-
return baseGetAllKeys(object, keys, getSymbols);
|
|
1610
|
-
}
|
|
1611
|
-
return _getAllKeys = getAllKeys, _getAllKeys;
|
|
1612
|
-
}
|
|
1613
|
-
var _equalObjects, hasRequired_equalObjects;
|
|
1614
|
-
function require_equalObjects() {
|
|
1615
|
-
if (hasRequired_equalObjects) return _equalObjects;
|
|
1616
|
-
hasRequired_equalObjects = 1;
|
|
1617
|
-
var getAllKeys = require_getAllKeys(), COMPARE_PARTIAL_FLAG = 1, objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty;
|
|
1618
|
-
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1619
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
1620
|
-
if (objLength != othLength && !isPartial)
|
|
1621
|
-
return !1;
|
|
1622
|
-
for (var index = objLength; index--; ) {
|
|
1623
|
-
var key = objProps[index];
|
|
1624
|
-
if (!(isPartial ? key in other : hasOwnProperty.call(other, key)))
|
|
1625
|
-
return !1;
|
|
1626
|
-
}
|
|
1627
|
-
var objStacked = stack.get(object), othStacked = stack.get(other);
|
|
1628
|
-
if (objStacked && othStacked)
|
|
1629
|
-
return objStacked == other && othStacked == object;
|
|
1630
|
-
var result = !0;
|
|
1631
|
-
stack.set(object, other), stack.set(other, object);
|
|
1632
|
-
for (var skipCtor = isPartial; ++index < objLength; ) {
|
|
1633
|
-
key = objProps[index];
|
|
1634
|
-
var objValue = object[key], othValue = other[key];
|
|
1635
|
-
if (customizer)
|
|
1636
|
-
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
1637
|
-
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
1638
|
-
result = !1;
|
|
1639
|
-
break;
|
|
1640
|
-
}
|
|
1641
|
-
skipCtor || (skipCtor = key == "constructor");
|
|
1642
|
-
}
|
|
1643
|
-
if (result && !skipCtor) {
|
|
1644
|
-
var objCtor = object.constructor, othCtor = other.constructor;
|
|
1645
|
-
objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor) && (result = !1);
|
|
1646
|
-
}
|
|
1647
|
-
return stack.delete(object), stack.delete(other), result;
|
|
1648
|
-
}
|
|
1649
|
-
return _equalObjects = equalObjects, _equalObjects;
|
|
1650
|
-
}
|
|
1651
|
-
var _DataView, hasRequired_DataView;
|
|
1652
|
-
function require_DataView() {
|
|
1653
|
-
if (hasRequired_DataView) return _DataView;
|
|
1654
|
-
hasRequired_DataView = 1;
|
|
1655
|
-
var getNative = require_getNative(), root = require_root(), DataView = getNative(root, "DataView");
|
|
1656
|
-
return _DataView = DataView, _DataView;
|
|
1657
|
-
}
|
|
1658
|
-
var _Promise, hasRequired_Promise;
|
|
1659
|
-
function require_Promise() {
|
|
1660
|
-
if (hasRequired_Promise) return _Promise;
|
|
1661
|
-
hasRequired_Promise = 1;
|
|
1662
|
-
var getNative = require_getNative(), root = require_root(), Promise2 = getNative(root, "Promise");
|
|
1663
|
-
return _Promise = Promise2, _Promise;
|
|
1664
|
-
}
|
|
1665
|
-
var _Set, hasRequired_Set;
|
|
1666
|
-
function require_Set() {
|
|
1667
|
-
if (hasRequired_Set) return _Set;
|
|
1668
|
-
hasRequired_Set = 1;
|
|
1669
|
-
var getNative = require_getNative(), root = require_root(), Set2 = getNative(root, "Set");
|
|
1670
|
-
return _Set = Set2, _Set;
|
|
1671
|
-
}
|
|
1672
|
-
var _WeakMap, hasRequired_WeakMap;
|
|
1673
|
-
function require_WeakMap() {
|
|
1674
|
-
if (hasRequired_WeakMap) return _WeakMap;
|
|
1675
|
-
hasRequired_WeakMap = 1;
|
|
1676
|
-
var getNative = require_getNative(), root = require_root(), WeakMap = getNative(root, "WeakMap");
|
|
1677
|
-
return _WeakMap = WeakMap, _WeakMap;
|
|
1678
|
-
}
|
|
1679
|
-
var _getTag, hasRequired_getTag;
|
|
1680
|
-
function require_getTag() {
|
|
1681
|
-
if (hasRequired_getTag) return _getTag;
|
|
1682
|
-
hasRequired_getTag = 1;
|
|
1683
|
-
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;
|
|
1684
|
-
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) {
|
|
1685
|
-
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
1686
|
-
if (ctorString)
|
|
1687
|
-
switch (ctorString) {
|
|
1688
|
-
case dataViewCtorString:
|
|
1689
|
-
return dataViewTag;
|
|
1690
|
-
case mapCtorString:
|
|
1691
|
-
return mapTag;
|
|
1692
|
-
case promiseCtorString:
|
|
1693
|
-
return promiseTag;
|
|
1694
|
-
case setCtorString:
|
|
1695
|
-
return setTag;
|
|
1696
|
-
case weakMapCtorString:
|
|
1697
|
-
return weakMapTag;
|
|
1698
|
-
}
|
|
1699
|
-
return result;
|
|
1700
|
-
}), _getTag = getTag, _getTag;
|
|
1701
|
-
}
|
|
1702
|
-
var _baseIsEqualDeep, hasRequired_baseIsEqualDeep;
|
|
1703
|
-
function require_baseIsEqualDeep() {
|
|
1704
|
-
if (hasRequired_baseIsEqualDeep) return _baseIsEqualDeep;
|
|
1705
|
-
hasRequired_baseIsEqualDeep = 1;
|
|
1706
|
-
var Stack2 = 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;
|
|
1707
|
-
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1708
|
-
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
1709
|
-
objTag = objTag == argsTag ? objectTag : objTag, othTag = othTag == argsTag ? objectTag : othTag;
|
|
1710
|
-
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
1711
|
-
if (isSameTag && isBuffer2(object)) {
|
|
1712
|
-
if (!isBuffer2(other))
|
|
1713
|
-
return !1;
|
|
1714
|
-
objIsArr = !0, objIsObj = !1;
|
|
1715
|
-
}
|
|
1716
|
-
if (isSameTag && !objIsObj)
|
|
1717
|
-
return stack || (stack = new Stack2()), objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
1718
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
1719
|
-
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
1720
|
-
if (objIsWrapped || othIsWrapped) {
|
|
1721
|
-
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
1722
|
-
return stack || (stack = new Stack2()), equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
1723
|
-
}
|
|
1724
|
-
}
|
|
1725
|
-
return isSameTag ? (stack || (stack = new Stack2()), equalObjects(object, other, bitmask, customizer, equalFunc, stack)) : !1;
|
|
1726
|
-
}
|
|
1727
|
-
return _baseIsEqualDeep = baseIsEqualDeep, _baseIsEqualDeep;
|
|
1728
|
-
}
|
|
1729
|
-
var _baseIsEqual, hasRequired_baseIsEqual;
|
|
1730
|
-
function require_baseIsEqual() {
|
|
1731
|
-
if (hasRequired_baseIsEqual) return _baseIsEqual;
|
|
1732
|
-
hasRequired_baseIsEqual = 1;
|
|
1733
|
-
var baseIsEqualDeep = require_baseIsEqualDeep(), isObjectLike = requireIsObjectLike();
|
|
1734
|
-
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
1735
|
-
return value === other ? !0 : value == null || other == null || !isObjectLike(value) && !isObjectLike(other) ? value !== value && other !== other : baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
1736
|
-
}
|
|
1737
|
-
return _baseIsEqual = baseIsEqual, _baseIsEqual;
|
|
1738
|
-
}
|
|
1739
|
-
var isEqual_1, hasRequiredIsEqual;
|
|
1740
|
-
function requireIsEqual() {
|
|
1741
|
-
if (hasRequiredIsEqual) return isEqual_1;
|
|
1742
|
-
hasRequiredIsEqual = 1;
|
|
1743
|
-
var baseIsEqual = require_baseIsEqual();
|
|
1744
|
-
function isEqual2(value, other) {
|
|
1745
|
-
return baseIsEqual(value, other);
|
|
1746
|
-
}
|
|
1747
|
-
return isEqual_1 = isEqual2, isEqual_1;
|
|
1748
|
-
}
|
|
1749
|
-
var isEqualExports = requireIsEqual(), isEqual = /* @__PURE__ */ getDefaultExportFromCjs(isEqualExports), _baseFindIndex, hasRequired_baseFindIndex;
|
|
1750
|
-
function require_baseFindIndex() {
|
|
1751
|
-
if (hasRequired_baseFindIndex) return _baseFindIndex;
|
|
1752
|
-
hasRequired_baseFindIndex = 1;
|
|
1753
|
-
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
1754
|
-
for (var length2 = array.length, index = fromIndex + (fromRight ? 1 : -1); fromRight ? index-- : ++index < length2; )
|
|
1755
|
-
if (predicate(array[index], index, array))
|
|
1756
|
-
return index;
|
|
1757
|
-
return -1;
|
|
1758
|
-
}
|
|
1759
|
-
return _baseFindIndex = baseFindIndex, _baseFindIndex;
|
|
1760
|
-
}
|
|
1761
|
-
var _baseIsNaN, hasRequired_baseIsNaN;
|
|
1762
|
-
function require_baseIsNaN() {
|
|
1763
|
-
if (hasRequired_baseIsNaN) return _baseIsNaN;
|
|
1764
|
-
hasRequired_baseIsNaN = 1;
|
|
1765
|
-
function baseIsNaN(value) {
|
|
1766
|
-
return value !== value;
|
|
1767
|
-
}
|
|
1768
|
-
return _baseIsNaN = baseIsNaN, _baseIsNaN;
|
|
1769
|
-
}
|
|
1770
|
-
var _strictIndexOf, hasRequired_strictIndexOf;
|
|
1771
|
-
function require_strictIndexOf() {
|
|
1772
|
-
if (hasRequired_strictIndexOf) return _strictIndexOf;
|
|
1773
|
-
hasRequired_strictIndexOf = 1;
|
|
1774
|
-
function strictIndexOf(array, value, fromIndex) {
|
|
1775
|
-
for (var index = fromIndex - 1, length2 = array.length; ++index < length2; )
|
|
1776
|
-
if (array[index] === value)
|
|
1777
|
-
return index;
|
|
1778
|
-
return -1;
|
|
1779
|
-
}
|
|
1780
|
-
return _strictIndexOf = strictIndexOf, _strictIndexOf;
|
|
1781
|
-
}
|
|
1782
|
-
var _baseIndexOf, hasRequired_baseIndexOf;
|
|
1783
|
-
function require_baseIndexOf() {
|
|
1784
|
-
if (hasRequired_baseIndexOf) return _baseIndexOf;
|
|
1785
|
-
hasRequired_baseIndexOf = 1;
|
|
1786
|
-
var baseFindIndex = require_baseFindIndex(), baseIsNaN = require_baseIsNaN(), strictIndexOf = require_strictIndexOf();
|
|
1787
|
-
function baseIndexOf(array, value, fromIndex) {
|
|
1788
|
-
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
1789
|
-
}
|
|
1790
|
-
return _baseIndexOf = baseIndexOf, _baseIndexOf;
|
|
1791
|
-
}
|
|
1792
|
-
var _arrayIncludes, hasRequired_arrayIncludes;
|
|
1793
|
-
function require_arrayIncludes() {
|
|
1794
|
-
if (hasRequired_arrayIncludes) return _arrayIncludes;
|
|
1795
|
-
hasRequired_arrayIncludes = 1;
|
|
1796
|
-
var baseIndexOf = require_baseIndexOf();
|
|
1797
|
-
function arrayIncludes(array, value) {
|
|
1798
|
-
var length2 = array == null ? 0 : array.length;
|
|
1799
|
-
return !!length2 && baseIndexOf(array, value, 0) > -1;
|
|
1800
|
-
}
|
|
1801
|
-
return _arrayIncludes = arrayIncludes, _arrayIncludes;
|
|
1802
|
-
}
|
|
1803
|
-
var _arrayIncludesWith, hasRequired_arrayIncludesWith;
|
|
1804
|
-
function require_arrayIncludesWith() {
|
|
1805
|
-
if (hasRequired_arrayIncludesWith) return _arrayIncludesWith;
|
|
1806
|
-
hasRequired_arrayIncludesWith = 1;
|
|
1807
|
-
function arrayIncludesWith(array, value, comparator) {
|
|
1808
|
-
for (var index = -1, length2 = array == null ? 0 : array.length; ++index < length2; )
|
|
1809
|
-
if (comparator(value, array[index]))
|
|
1810
|
-
return !0;
|
|
1811
|
-
return !1;
|
|
1812
|
-
}
|
|
1813
|
-
return _arrayIncludesWith = arrayIncludesWith, _arrayIncludesWith;
|
|
1814
|
-
}
|
|
1815
|
-
var noop_1, hasRequiredNoop;
|
|
1816
|
-
function requireNoop() {
|
|
1817
|
-
if (hasRequiredNoop) return noop_1;
|
|
1818
|
-
hasRequiredNoop = 1;
|
|
1819
|
-
function noop() {
|
|
1820
|
-
}
|
|
1821
|
-
return noop_1 = noop, noop_1;
|
|
1822
|
-
}
|
|
1823
|
-
var _createSet, hasRequired_createSet;
|
|
1824
|
-
function require_createSet() {
|
|
1825
|
-
if (hasRequired_createSet) return _createSet;
|
|
1826
|
-
hasRequired_createSet = 1;
|
|
1827
|
-
var Set2 = require_Set(), noop = requireNoop(), setToArray = require_setToArray(), INFINITY = 1 / 0, createSet = Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY ? function(values) {
|
|
1828
|
-
return new Set2(values);
|
|
1829
|
-
} : noop;
|
|
1830
|
-
return _createSet = createSet, _createSet;
|
|
1831
|
-
}
|
|
1832
|
-
var _baseUniq, hasRequired_baseUniq;
|
|
1833
|
-
function require_baseUniq() {
|
|
1834
|
-
if (hasRequired_baseUniq) return _baseUniq;
|
|
1835
|
-
hasRequired_baseUniq = 1;
|
|
1836
|
-
var SetCache = require_SetCache(), arrayIncludes = require_arrayIncludes(), arrayIncludesWith = require_arrayIncludesWith(), cacheHas = require_cacheHas(), createSet = require_createSet(), setToArray = require_setToArray(), LARGE_ARRAY_SIZE = 200;
|
|
1837
|
-
function baseUniq(array, iteratee, comparator) {
|
|
1838
|
-
var index = -1, includes = arrayIncludes, length2 = array.length, isCommon = !0, result = [], seen = result;
|
|
1839
|
-
if (comparator)
|
|
1840
|
-
isCommon = !1, includes = arrayIncludesWith;
|
|
1841
|
-
else if (length2 >= LARGE_ARRAY_SIZE) {
|
|
1842
|
-
var set = iteratee ? null : createSet(array);
|
|
1843
|
-
if (set)
|
|
1844
|
-
return setToArray(set);
|
|
1845
|
-
isCommon = !1, includes = cacheHas, seen = new SetCache();
|
|
1846
|
-
} else
|
|
1847
|
-
seen = iteratee ? [] : result;
|
|
1848
|
-
outer:
|
|
1849
|
-
for (; ++index < length2; ) {
|
|
1850
|
-
var value = array[index], computed = iteratee ? iteratee(value) : value;
|
|
1851
|
-
if (value = comparator || value !== 0 ? value : 0, isCommon && computed === computed) {
|
|
1852
|
-
for (var seenIndex = seen.length; seenIndex--; )
|
|
1853
|
-
if (seen[seenIndex] === computed)
|
|
1854
|
-
continue outer;
|
|
1855
|
-
iteratee && seen.push(computed), result.push(value);
|
|
1856
|
-
} else includes(seen, computed, comparator) || (seen !== result && seen.push(computed), result.push(value));
|
|
1857
|
-
}
|
|
1858
|
-
return result;
|
|
1859
|
-
}
|
|
1860
|
-
return _baseUniq = baseUniq, _baseUniq;
|
|
1861
|
-
}
|
|
1862
|
-
var uniq_1, hasRequiredUniq;
|
|
1863
|
-
function requireUniq() {
|
|
1864
|
-
if (hasRequiredUniq) return uniq_1;
|
|
1865
|
-
hasRequiredUniq = 1;
|
|
1866
|
-
var baseUniq = require_baseUniq();
|
|
1867
|
-
function uniq2(array) {
|
|
1868
|
-
return array && array.length ? baseUniq(array) : [];
|
|
1869
|
-
}
|
|
1870
|
-
return uniq_1 = uniq2, uniq_1;
|
|
1871
|
-
}
|
|
1872
|
-
var uniqExports = requireUniq(), uniq = /* @__PURE__ */ getDefaultExportFromCjs(uniqExports);
|
|
1873
|
-
const objectToString = Object.prototype.toString;
|
|
1874
|
-
function resolveJsType(val) {
|
|
1875
|
-
switch (objectToString.call(val)) {
|
|
1876
|
-
case "[object Function]":
|
|
1877
|
-
return "function";
|
|
1878
|
-
case "[object Date]":
|
|
1879
|
-
return "date";
|
|
1880
|
-
case "[object RegExp]":
|
|
1881
|
-
return "regexp";
|
|
1882
|
-
case "[object Arguments]":
|
|
1883
|
-
return "arguments";
|
|
1884
|
-
case "[object Array]":
|
|
1885
|
-
return "array";
|
|
1886
|
-
case "[object String]":
|
|
1887
|
-
return "string";
|
|
1888
|
-
}
|
|
1889
|
-
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;
|
|
1890
|
-
}
|
|
1891
|
-
function isArbitraryTypedObject(object) {
|
|
1892
|
-
return isRecord(object) && typeof object._type == "string";
|
|
1893
|
-
}
|
|
1894
|
-
function isRecord(value) {
|
|
1895
|
-
return !!value && (typeof value == "object" || typeof value == "function");
|
|
1896
|
-
}
|
|
1897
|
-
function flattenNestedBlocks(context, blocks2) {
|
|
1898
|
-
return blocks2.flatMap((block) => {
|
|
1899
|
-
if (isBlockContainer(block))
|
|
1900
|
-
return flattenNestedBlocks(context, [block.block]);
|
|
1901
|
-
if (isTextBlock(context, block)) {
|
|
1902
|
-
const hasBlockObjects = block.children.some((child) => context.schema.blockObjects.some(
|
|
1903
|
-
(blockObject) => blockObject.name === child._type
|
|
1904
|
-
)), hasBlocks = block.children.some(
|
|
1905
|
-
(child) => child._type === "__block" || child._type === "block"
|
|
1906
|
-
);
|
|
1907
|
-
if (hasBlockObjects || hasBlocks) {
|
|
1908
|
-
const splitChildren = getSplitChildren(context, block);
|
|
1909
|
-
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, [
|
|
1910
|
-
slice2.block
|
|
1911
|
-
]) : slice2.children.length > 0 ? slice2.children.every(
|
|
1912
|
-
(child) => isSpan(context, child) && child.text.trim() === ""
|
|
1913
|
-
) ? [] : flattenNestedBlocks(context, [
|
|
1914
|
-
{
|
|
1915
|
-
...block,
|
|
1916
|
-
children: slice2.children
|
|
1917
|
-
}
|
|
1918
|
-
]) : []);
|
|
1919
|
-
}
|
|
1920
|
-
return [block];
|
|
1921
|
-
}
|
|
1922
|
-
return [block];
|
|
1923
|
-
});
|
|
1924
|
-
}
|
|
1925
|
-
function isBlockContainer(block) {
|
|
1926
|
-
return block._type === "__block" && isArbitraryTypedObject(block.block);
|
|
1927
|
-
}
|
|
1928
|
-
function getSplitChildren(context, block) {
|
|
1929
|
-
return block.children.reduce(
|
|
1930
|
-
(slices, child) => {
|
|
1931
|
-
const knownInlineObject = context.schema.inlineObjects.some(
|
|
1932
|
-
(inlineObject) => inlineObject.name === child._type
|
|
1933
|
-
), knownBlockObject = context.schema.blockObjects.some(
|
|
1934
|
-
(blockObject) => blockObject.name === child._type
|
|
1935
|
-
), lastSlice = slices.pop();
|
|
1936
|
-
return !isSpan(context, child) && !knownInlineObject && knownBlockObject ? [
|
|
1937
|
-
...slices,
|
|
1938
|
-
...lastSlice ? [lastSlice] : [],
|
|
1939
|
-
{ type: "block object", block: child }
|
|
1940
|
-
] : child._type === "__block" ? [
|
|
1941
|
-
...slices,
|
|
1942
|
-
...lastSlice ? [lastSlice] : [],
|
|
1943
|
-
{
|
|
1944
|
-
type: "block object",
|
|
1945
|
-
block: child.block
|
|
1946
|
-
}
|
|
1947
|
-
] : child._type === "block" ? [
|
|
1948
|
-
...slices,
|
|
1949
|
-
...lastSlice ? [lastSlice] : [],
|
|
1950
|
-
{ type: "block", block: child }
|
|
1951
|
-
] : lastSlice && lastSlice.type === "children" ? [
|
|
1952
|
-
...slices,
|
|
1953
|
-
{
|
|
1954
|
-
type: "children",
|
|
1955
|
-
children: [...lastSlice.children, child]
|
|
1956
|
-
}
|
|
1957
|
-
] : [
|
|
1958
|
-
...slices,
|
|
1959
|
-
...lastSlice ? [lastSlice] : [],
|
|
1960
|
-
{ type: "children", children: [child] }
|
|
1961
|
-
];
|
|
1962
|
-
},
|
|
1963
|
-
[]
|
|
1964
|
-
);
|
|
1965
|
-
}
|
|
1966
|
-
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 };
|
|
1967
|
-
new Array(4).fill(String.fromCodePoint(c[0])).join("");
|
|
1968
|
-
Object.fromEntries(Object.entries(c).map((t) => t.reverse()));
|
|
1969
|
-
Object.fromEntries(Object.entries(s).map((t) => t.reverse()));
|
|
1970
|
-
var S$1 = `${Object.values(s).map((t) => `\\u{${t.toString(16)}}`).join("")}`, f$1 = new RegExp(`[${S$1}]{4,}`, "gu");
|
|
1971
|
-
function _$1(t) {
|
|
1972
|
-
var e;
|
|
1973
|
-
return { cleaned: t.replace(f$1, ""), encoded: ((e = t.match(f$1)) == null ? void 0 : e[0]) || "" };
|
|
1974
|
-
}
|
|
1975
|
-
function O$1(t) {
|
|
1976
|
-
return t && JSON.parse(_$1(JSON.stringify(t)).cleaned);
|
|
1977
|
-
}
|
|
1978
|
-
const PRESERVE_WHITESPACE_TAGS = ["pre", "textarea", "code"], BLOCK_DEFAULT_STYLE = "normal", DEFAULT_BLOCK = Object.freeze({
|
|
1979
|
-
_type: "block",
|
|
1980
|
-
markDefs: [],
|
|
1981
|
-
style: BLOCK_DEFAULT_STYLE
|
|
1982
|
-
}), DEFAULT_SPAN = Object.freeze({
|
|
1983
|
-
_type: "span",
|
|
1984
|
-
marks: []
|
|
1985
|
-
}), HTML_BLOCK_TAGS = {
|
|
1986
|
-
p: DEFAULT_BLOCK,
|
|
1987
|
-
blockquote: { ...DEFAULT_BLOCK, style: "blockquote" }
|
|
1988
|
-
}, HTML_SPAN_TAGS = {
|
|
1989
|
-
span: { object: "text" }
|
|
1990
|
-
}, HTML_LIST_CONTAINER_TAGS = {
|
|
1991
|
-
ol: { object: null },
|
|
1992
|
-
ul: { object: null }
|
|
1993
|
-
}, HTML_HEADER_TAGS = {
|
|
1994
|
-
h1: { ...DEFAULT_BLOCK, style: "h1" },
|
|
1995
|
-
h2: { ...DEFAULT_BLOCK, style: "h2" },
|
|
1996
|
-
h3: { ...DEFAULT_BLOCK, style: "h3" },
|
|
1997
|
-
h4: { ...DEFAULT_BLOCK, style: "h4" },
|
|
1998
|
-
h5: { ...DEFAULT_BLOCK, style: "h5" },
|
|
1999
|
-
h6: { ...DEFAULT_BLOCK, style: "h6" }
|
|
2000
|
-
}, HTML_MISC_TAGS = {
|
|
2001
|
-
br: { ...DEFAULT_BLOCK, style: BLOCK_DEFAULT_STYLE }
|
|
2002
|
-
}, HTML_DECORATOR_TAGS = {
|
|
2003
|
-
b: "strong",
|
|
2004
|
-
strong: "strong",
|
|
2005
|
-
i: "em",
|
|
2006
|
-
em: "em",
|
|
2007
|
-
u: "underline",
|
|
2008
|
-
s: "strike-through",
|
|
2009
|
-
strike: "strike-through",
|
|
2010
|
-
del: "strike-through",
|
|
2011
|
-
code: "code",
|
|
2012
|
-
sup: "sup",
|
|
2013
|
-
sub: "sub",
|
|
2014
|
-
ins: "ins",
|
|
2015
|
-
mark: "mark",
|
|
2016
|
-
small: "small"
|
|
2017
|
-
}, HTML_LIST_ITEM_TAGS = {
|
|
2018
|
-
li: {
|
|
2019
|
-
...DEFAULT_BLOCK,
|
|
2020
|
-
style: BLOCK_DEFAULT_STYLE,
|
|
2021
|
-
level: 1,
|
|
2022
|
-
listItem: "bullet"
|
|
2023
|
-
}
|
|
2024
|
-
}, ELEMENT_MAP = {
|
|
2025
|
-
...HTML_BLOCK_TAGS,
|
|
2026
|
-
...HTML_SPAN_TAGS,
|
|
2027
|
-
...HTML_LIST_CONTAINER_TAGS,
|
|
2028
|
-
...HTML_LIST_ITEM_TAGS,
|
|
2029
|
-
...HTML_HEADER_TAGS,
|
|
2030
|
-
...HTML_MISC_TAGS
|
|
2031
|
-
};
|
|
2032
|
-
uniq(
|
|
2033
|
-
Object.values(ELEMENT_MAP).filter((tag) => "style" in tag).map((tag) => tag.style)
|
|
2034
|
-
);
|
|
2035
|
-
uniq(
|
|
2036
|
-
Object.values(HTML_DECORATOR_TAGS)
|
|
2037
|
-
);
|
|
2038
|
-
const _XPathResult = {
|
|
2039
|
-
BOOLEAN_TYPE: 3,
|
|
2040
|
-
ORDERED_NODE_ITERATOR_TYPE: 5,
|
|
2041
|
-
UNORDERED_NODE_SNAPSHOT_TYPE: 6
|
|
2042
|
-
};
|
|
2043
|
-
var preprocessGDocs = (_html, doc, options) => {
|
|
2044
|
-
const whitespaceOnPasteMode = options?.unstable_whitespaceOnPasteMode || "preserve";
|
|
2045
|
-
let gDocsRootOrSiblingNode = doc.evaluate(
|
|
2046
|
-
'//*[@id and contains(@id, "docs-internal-guid")]',
|
|
2047
|
-
doc,
|
|
2048
|
-
null,
|
|
2049
|
-
_XPathResult.ORDERED_NODE_ITERATOR_TYPE,
|
|
2050
|
-
null
|
|
2051
|
-
).iterateNext();
|
|
2052
|
-
if (gDocsRootOrSiblingNode) {
|
|
2053
|
-
const isWrappedRootTag = tagName(gDocsRootOrSiblingNode) === "b";
|
|
2054
|
-
switch (isWrappedRootTag || (gDocsRootOrSiblingNode = doc.body), whitespaceOnPasteMode) {
|
|
2055
|
-
case "normalize":
|
|
2056
|
-
normalizeWhitespace(gDocsRootOrSiblingNode);
|
|
2057
|
-
break;
|
|
2058
|
-
case "remove":
|
|
2059
|
-
removeAllWhitespace(gDocsRootOrSiblingNode);
|
|
2060
|
-
break;
|
|
2061
|
-
}
|
|
2062
|
-
const childNodes = doc.evaluate(
|
|
2063
|
-
"//*",
|
|
2064
|
-
doc,
|
|
2065
|
-
null,
|
|
2066
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2067
|
-
null
|
|
2068
|
-
);
|
|
2069
|
-
for (let i = childNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2070
|
-
const elm = childNodes.snapshotItem(i);
|
|
2071
|
-
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);
|
|
2072
|
-
}
|
|
2073
|
-
return isWrappedRootTag && doc.body.firstElementChild?.replaceWith(
|
|
2074
|
-
...Array.from(gDocsRootOrSiblingNode.childNodes)
|
|
2075
|
-
), doc;
|
|
2076
|
-
}
|
|
2077
|
-
return doc;
|
|
2078
|
-
};
|
|
2079
|
-
const unwantedWordDocumentPaths = [
|
|
2080
|
-
"/html/text()",
|
|
2081
|
-
"/html/head/text()",
|
|
2082
|
-
"/html/body/text()",
|
|
2083
|
-
"/html/body/ul/text()",
|
|
2084
|
-
"/html/body/ol/text()",
|
|
2085
|
-
"//comment()",
|
|
2086
|
-
"//style",
|
|
2087
|
-
"//xml",
|
|
2088
|
-
"//script",
|
|
2089
|
-
"//meta",
|
|
2090
|
-
"//link"
|
|
2091
|
-
];
|
|
2092
|
-
var preprocessHTML = (_html, doc) => {
|
|
2093
|
-
const bodyTextNodes = doc.evaluate(
|
|
2094
|
-
"/html/body/text()",
|
|
2095
|
-
doc,
|
|
2096
|
-
null,
|
|
2097
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2098
|
-
null
|
|
2099
|
-
);
|
|
2100
|
-
for (let i = bodyTextNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2101
|
-
const node2 = bodyTextNodes.snapshotItem(i), text = node2.textContent || "";
|
|
2102
|
-
if (text.replace(/[^\S\n]+$/g, "")) {
|
|
2103
|
-
const newNode = doc.createElement("span");
|
|
2104
|
-
newNode.appendChild(doc.createTextNode(text)), node2.parentNode?.replaceChild(newNode, node2);
|
|
2105
|
-
} else
|
|
2106
|
-
node2.parentNode?.removeChild(node2);
|
|
2107
|
-
}
|
|
2108
|
-
const unwantedNodes = doc.evaluate(
|
|
2109
|
-
unwantedWordDocumentPaths.join("|"),
|
|
2110
|
-
doc,
|
|
2111
|
-
null,
|
|
2112
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2113
|
-
null
|
|
2114
|
-
);
|
|
2115
|
-
for (let i = unwantedNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2116
|
-
const unwanted = unwantedNodes.snapshotItem(i);
|
|
2117
|
-
unwanted && unwanted.parentNode?.removeChild(unwanted);
|
|
2118
|
-
}
|
|
2119
|
-
return doc;
|
|
2120
|
-
}, preprocessNotion = (html, doc) => {
|
|
2121
|
-
const NOTION_REGEX = /<!-- notionvc:.*?-->/g;
|
|
2122
|
-
if (html.match(NOTION_REGEX)) {
|
|
2123
|
-
const childNodes = doc.evaluate(
|
|
2124
|
-
"//*",
|
|
2125
|
-
doc,
|
|
2126
|
-
null,
|
|
2127
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2128
|
-
null
|
|
2129
|
-
);
|
|
2130
|
-
for (let i = childNodes.snapshotLength - 1; i >= 0; i--)
|
|
2131
|
-
childNodes.snapshotItem(i)?.setAttribute("data-is-notion", "true");
|
|
2132
|
-
return doc;
|
|
2133
|
-
}
|
|
2134
|
-
return doc;
|
|
2135
|
-
}, preprocessWhitespace = (_2, doc) => {
|
|
2136
|
-
function processNode(node2) {
|
|
2137
|
-
if (node2.nodeType === _XPathResult.BOOLEAN_TYPE && !PRESERVE_WHITESPACE_TAGS.includes(
|
|
2138
|
-
node2.parentElement?.tagName.toLowerCase() || ""
|
|
2139
|
-
))
|
|
2140
|
-
node2.textContent = node2.textContent?.replace(/\s\s+/g, " ").replace(/[\r\n]+/g, " ") || "";
|
|
2141
|
-
else
|
|
2142
|
-
for (let i = 0; i < node2.childNodes.length; i++)
|
|
2143
|
-
processNode(node2.childNodes[i]);
|
|
2144
|
-
}
|
|
2145
|
-
return processNode(doc.body), doc;
|
|
2146
|
-
};
|
|
2147
|
-
const WORD_HTML_REGEX = /(class="?Mso|style=(?:"|')[^"]*?\bmso-|w:WordDocument|<o:\w+>|<\/font>)/, unwantedPaths = [
|
|
2148
|
-
"//o:p",
|
|
2149
|
-
"//span[@style='mso-list:Ignore']",
|
|
2150
|
-
"//span[@style='mso-list: Ignore']"
|
|
2151
|
-
], mappedPaths = [
|
|
2152
|
-
"//p[@class='MsoTocHeading']",
|
|
2153
|
-
"//p[@class='MsoTitle']",
|
|
2154
|
-
"//p[@class='MsoToaHeading']",
|
|
2155
|
-
"//p[@class='MsoSubtitle']",
|
|
2156
|
-
"//span[@class='MsoSubtleEmphasis']",
|
|
2157
|
-
"//span[@class='MsoIntenseEmphasis']"
|
|
2158
|
-
], elementMap = {
|
|
2159
|
-
MsoTocHeading: ["h3"],
|
|
2160
|
-
MsoTitle: ["h1"],
|
|
2161
|
-
MsoToaHeading: ["h2"],
|
|
2162
|
-
MsoSubtitle: ["h5"],
|
|
2163
|
-
MsoSubtleEmphasis: ["span", "em"],
|
|
2164
|
-
MsoIntenseEmphasis: ["span", "em", "strong"]
|
|
2165
|
-
// Remove cruft
|
|
2166
|
-
};
|
|
2167
|
-
function isWordHtml(html) {
|
|
2168
|
-
return WORD_HTML_REGEX.test(html);
|
|
2169
|
-
}
|
|
2170
|
-
var preprocessWord = (html, doc) => {
|
|
2171
|
-
if (!isWordHtml(html))
|
|
2172
|
-
return doc;
|
|
2173
|
-
const unwantedNodes = doc.evaluate(
|
|
2174
|
-
unwantedPaths.join("|"),
|
|
2175
|
-
doc,
|
|
2176
|
-
(prefix2) => prefix2 === "o" ? "urn:schemas-microsoft-com:office:office" : null,
|
|
2177
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2178
|
-
null
|
|
2179
|
-
);
|
|
2180
|
-
for (let i = unwantedNodes.snapshotLength - 1; i >= 0; i--) {
|
|
2181
|
-
const unwanted = unwantedNodes.snapshotItem(i);
|
|
2182
|
-
unwanted?.parentNode && unwanted.parentNode.removeChild(unwanted);
|
|
2183
|
-
}
|
|
2184
|
-
const mappedElements = doc.evaluate(
|
|
2185
|
-
mappedPaths.join("|"),
|
|
2186
|
-
doc,
|
|
2187
|
-
null,
|
|
2188
|
-
_XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
|
2189
|
-
null
|
|
2190
|
-
);
|
|
2191
|
-
for (let i = mappedElements.snapshotLength - 1; i >= 0; i--) {
|
|
2192
|
-
const mappedElm = mappedElements.snapshotItem(i), tags = elementMap[mappedElm.className], text = doc.createTextNode(mappedElm.textContent || "");
|
|
2193
|
-
if (!tags)
|
|
2194
|
-
continue;
|
|
2195
|
-
const parentElement = doc.createElement(tags[0]);
|
|
2196
|
-
let parent = parentElement, child = parentElement;
|
|
2197
|
-
tags.slice(1).forEach((tag) => {
|
|
2198
|
-
child = doc.createElement(tag), parent.appendChild(child), parent = child;
|
|
2199
|
-
}), child.appendChild(text), mappedElm?.parentNode?.replaceChild(parentElement, mappedElm);
|
|
2200
|
-
}
|
|
2201
|
-
return doc;
|
|
2202
|
-
}, preprocessors = [
|
|
2203
|
-
preprocessWhitespace,
|
|
2204
|
-
preprocessNotion,
|
|
2205
|
-
preprocessWord,
|
|
2206
|
-
preprocessGDocs,
|
|
2207
|
-
preprocessHTML
|
|
2208
|
-
];
|
|
2209
|
-
function tagName(el) {
|
|
2210
|
-
if (el && "tagName" in el)
|
|
2211
|
-
return el.tagName.toLowerCase();
|
|
2212
|
-
}
|
|
2213
|
-
function preprocess$1(html, parseHtml, options) {
|
|
2214
|
-
const cleanHTML = O$1(html), doc = parseHtml(normalizeHtmlBeforePreprocess(cleanHTML));
|
|
2215
|
-
return preprocessors.forEach((processor) => {
|
|
2216
|
-
processor(cleanHTML, doc, options);
|
|
2217
|
-
}), doc;
|
|
2218
|
-
}
|
|
2219
|
-
function normalizeHtmlBeforePreprocess(html) {
|
|
2220
|
-
return html.trim();
|
|
2221
|
-
}
|
|
2222
|
-
function defaultParseHtml() {
|
|
2223
|
-
if (resolveJsType(DOMParser) === "undefined")
|
|
2224
|
-
throw new Error(
|
|
2225
|
-
"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."
|
|
2226
|
-
);
|
|
2227
|
-
return (html) => new DOMParser().parseFromString(html, "text/html");
|
|
2228
|
-
}
|
|
2229
|
-
function nextSpan(block, index) {
|
|
2230
|
-
const next2 = block.children[index + 1];
|
|
2231
|
-
return next2 && next2._type === "span" ? next2 : null;
|
|
2232
|
-
}
|
|
2233
|
-
function prevSpan(block, index) {
|
|
2234
|
-
const prev2 = block.children[index - 1];
|
|
2235
|
-
return prev2 && prev2._type === "span" ? prev2 : null;
|
|
2236
|
-
}
|
|
2237
|
-
function isWhiteSpaceChar(text) {
|
|
2238
|
-
return ["\xA0", " "].includes(text);
|
|
2239
|
-
}
|
|
2240
|
-
function trimWhitespace(schema, blocks2) {
|
|
2241
|
-
return blocks2.forEach((block) => {
|
|
2242
|
-
isTextBlock({ schema }, block) && block.children.forEach((child, index) => {
|
|
2243
|
-
if (!isMinimalSpan(child))
|
|
2244
|
-
return;
|
|
2245
|
-
const nextChild = nextSpan(block, index), prevChild = prevSpan(block, index);
|
|
2246
|
-
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));
|
|
2247
|
-
});
|
|
2248
|
-
}), blocks2;
|
|
2249
|
-
}
|
|
2250
|
-
function ensureRootIsBlocks(schema, objects) {
|
|
2251
|
-
return objects.reduce((blocks2, node2, i, original) => {
|
|
2252
|
-
if (node2._type === "block")
|
|
2253
|
-
return blocks2.push(node2), blocks2;
|
|
2254
|
-
if (node2._type === "__block")
|
|
2255
|
-
return blocks2.push(node2.block), blocks2;
|
|
2256
|
-
const lastBlock = blocks2[blocks2.length - 1];
|
|
2257
|
-
if (i > 0 && !isTextBlock({ schema }, original[i - 1]) && isTextBlock({ schema }, lastBlock))
|
|
2258
|
-
return lastBlock.children.push(node2), blocks2;
|
|
2259
|
-
const block = {
|
|
2260
|
-
...DEFAULT_BLOCK,
|
|
2261
|
-
children: [node2]
|
|
2262
|
-
};
|
|
2263
|
-
return blocks2.push(block), blocks2;
|
|
2264
|
-
}, []);
|
|
2265
|
-
}
|
|
2266
|
-
function isNodeList(node2) {
|
|
2267
|
-
return Object.prototype.toString.call(node2) === "[object NodeList]";
|
|
2268
|
-
}
|
|
2269
|
-
function isMinimalSpan(node2) {
|
|
2270
|
-
return node2._type === "span";
|
|
2271
|
-
}
|
|
2272
|
-
function isMinimalBlock(node2) {
|
|
2273
|
-
return node2._type === "block";
|
|
2274
|
-
}
|
|
2275
|
-
function isPlaceholderDecorator(node2) {
|
|
2276
|
-
return node2._type === "__decorator";
|
|
2277
|
-
}
|
|
2278
|
-
function isPlaceholderAnnotation(node2) {
|
|
2279
|
-
return node2._type === "__annotation";
|
|
2280
|
-
}
|
|
2281
|
-
function isElement(node2) {
|
|
2282
|
-
return node2.nodeType === 1;
|
|
2283
|
-
}
|
|
2284
|
-
function normalizeWhitespace(rootNode) {
|
|
2285
|
-
let emptyBlockCount = 0, lastParent = null;
|
|
2286
|
-
const nodesToRemove = [];
|
|
2287
|
-
for (let child = rootNode.firstChild; child; child = child.nextSibling) {
|
|
2288
|
-
if (!isElement(child)) {
|
|
2289
|
-
normalizeWhitespace(child), emptyBlockCount = 0;
|
|
2290
|
-
continue;
|
|
2291
|
-
}
|
|
2292
|
-
const elm = child;
|
|
2293
|
-
isWhitespaceBlock(elm) ? (lastParent && elm.parentElement === lastParent ? (emptyBlockCount++, emptyBlockCount > 1 && nodesToRemove.push(elm)) : emptyBlockCount = 1, lastParent = elm.parentElement) : (normalizeWhitespace(child), emptyBlockCount = 0);
|
|
2294
|
-
}
|
|
2295
|
-
nodesToRemove.forEach((node2) => {
|
|
2296
|
-
node2.parentElement?.removeChild(node2);
|
|
2297
|
-
});
|
|
2298
|
-
}
|
|
2299
|
-
function removeAllWhitespace(rootNode) {
|
|
2300
|
-
const nodesToRemove = [];
|
|
2301
|
-
function collectNodesToRemove(currentNode) {
|
|
2302
|
-
if (isElement(currentNode)) {
|
|
2303
|
-
const elm = currentNode;
|
|
2304
|
-
if (tagName(elm) === "br" && (tagName(elm.nextElementSibling) === "p" || tagName(elm.previousElementSibling) === "p")) {
|
|
2305
|
-
nodesToRemove.push(elm);
|
|
2306
|
-
return;
|
|
2307
|
-
}
|
|
2308
|
-
if ((tagName(elm) === "p" || tagName(elm) === "br") && elm?.firstChild?.textContent?.trim() === "") {
|
|
2309
|
-
nodesToRemove.push(elm);
|
|
2310
|
-
return;
|
|
2311
|
-
}
|
|
2312
|
-
for (let child = elm.firstChild; child; child = child.nextSibling)
|
|
2313
|
-
collectNodesToRemove(child);
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
collectNodesToRemove(rootNode), nodesToRemove.forEach((node2) => {
|
|
2317
|
-
node2.parentElement?.removeChild(node2);
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
function isWhitespaceBlock(elm) {
|
|
2321
|
-
return ["p", "br"].includes(tagName(elm) || "") && !elm.textContent?.trim();
|
|
2322
|
-
}
|
|
2323
|
-
function keyGenerator() {
|
|
2324
|
-
return randomKey(12);
|
|
2325
|
-
}
|
|
2326
|
-
function whatwgRNG(length2 = 16) {
|
|
2327
|
-
const rnds8 = new Uint8Array(length2);
|
|
2328
|
-
return getRandomValues(rnds8), rnds8;
|
|
2329
|
-
}
|
|
2330
|
-
const byteToHex = [];
|
|
2331
|
-
for (let i = 0; i < 256; ++i)
|
|
2332
|
-
byteToHex[i] = (i + 256).toString(16).slice(1);
|
|
2333
|
-
function randomKey(length2) {
|
|
2334
|
-
return whatwgRNG(length2).reduce((str, n) => str + byteToHex[n], "").slice(0, length2);
|
|
2335
|
-
}
|
|
2336
|
-
const LIST_CONTAINER_TAGS = Object.keys(HTML_LIST_CONTAINER_TAGS);
|
|
2337
|
-
function isEmphasis$1(el) {
|
|
2338
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2339
|
-
return /font-style\s*:\s*italic/.test(style || "");
|
|
2340
|
-
}
|
|
2341
|
-
function isStrong$1(el) {
|
|
2342
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2343
|
-
return /font-weight\s*:\s*700/.test(style || "");
|
|
2344
|
-
}
|
|
2345
|
-
function isUnderline$1(el) {
|
|
2346
|
-
if (!isElement(el) || tagName(el.parentNode) === "a")
|
|
2347
|
-
return !1;
|
|
2348
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2349
|
-
return /text-decoration\s*:\s*underline/.test(style || "");
|
|
2350
|
-
}
|
|
2351
|
-
function isStrikethrough(el) {
|
|
2352
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2353
|
-
return /text-decoration\s*:\s*(?:.*line-through.*;)/.test(style || "");
|
|
2354
|
-
}
|
|
2355
|
-
function isGoogleDocs(el) {
|
|
2356
|
-
return isElement(el) && !!el.getAttribute("data-is-google-docs");
|
|
2357
|
-
}
|
|
2358
|
-
function isRootNode(el) {
|
|
2359
|
-
return isElement(el) && !!el.getAttribute("data-is-root-node");
|
|
2360
|
-
}
|
|
2361
|
-
function getListItemStyle$1(el) {
|
|
2362
|
-
const parentTag = tagName(el.parentNode);
|
|
2363
|
-
if (!(parentTag && !LIST_CONTAINER_TAGS.includes(parentTag)))
|
|
2364
|
-
return tagName(el.parentNode) === "ul" ? "bullet" : "number";
|
|
2365
|
-
}
|
|
2366
|
-
function getListItemLevel$1(el) {
|
|
2367
|
-
let level = 0;
|
|
2368
|
-
if (tagName(el) === "li") {
|
|
2369
|
-
let parentNode = el.parentNode;
|
|
2370
|
-
for (; parentNode; ) {
|
|
2371
|
-
const parentTag = tagName(parentNode);
|
|
2372
|
-
parentTag && LIST_CONTAINER_TAGS.includes(parentTag) && level++, parentNode = parentNode.parentNode;
|
|
2373
|
-
}
|
|
2374
|
-
} else
|
|
2375
|
-
level = 1;
|
|
2376
|
-
return level;
|
|
2377
|
-
}
|
|
2378
|
-
const blocks = {
|
|
2379
|
-
...HTML_BLOCK_TAGS,
|
|
2380
|
-
...HTML_HEADER_TAGS
|
|
2381
|
-
};
|
|
2382
|
-
function getBlockStyle(schema, el) {
|
|
2383
|
-
const childTag = tagName(el.firstChild), block = childTag && blocks[childTag];
|
|
2384
|
-
return block && schema.styles.some((style) => style.name === block.style) ? block.style : BLOCK_DEFAULT_STYLE;
|
|
2385
|
-
}
|
|
2386
|
-
function createGDocsRules(schema) {
|
|
2387
|
-
return [
|
|
2388
|
-
{
|
|
2389
|
-
deserialize(el, next2) {
|
|
2390
|
-
if (isElement(el) && tagName(el) === "span" && isGoogleDocs(el)) {
|
|
2391
|
-
if (!el.textContent)
|
|
2392
|
-
return !el.previousSibling && !el.nextSibling && el.setAttribute("data-lonely-child", "true"), next2(el.childNodes);
|
|
2393
|
-
const span = {
|
|
2394
|
-
...DEFAULT_SPAN,
|
|
2395
|
-
marks: [],
|
|
2396
|
-
text: el.textContent
|
|
2397
|
-
};
|
|
2398
|
-
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;
|
|
2399
|
-
}
|
|
2400
|
-
}
|
|
2401
|
-
},
|
|
2402
|
-
{
|
|
2403
|
-
deserialize(el, next2) {
|
|
2404
|
-
if (tagName(el) === "li" && isGoogleDocs(el))
|
|
2405
|
-
return {
|
|
2406
|
-
...DEFAULT_BLOCK,
|
|
2407
|
-
listItem: getListItemStyle$1(el),
|
|
2408
|
-
level: getListItemLevel$1(el),
|
|
2409
|
-
style: getBlockStyle(schema, el),
|
|
2410
|
-
children: next2(el.firstChild?.childNodes || [])
|
|
2411
|
-
};
|
|
2412
|
-
}
|
|
2413
|
-
},
|
|
2414
|
-
{
|
|
2415
|
-
deserialize(el) {
|
|
2416
|
-
if (tagName(el) === "br" && isGoogleDocs(el) && isElement(el) && el.classList.contains("apple-interchange-newline"))
|
|
2417
|
-
return {
|
|
2418
|
-
...DEFAULT_SPAN,
|
|
2419
|
-
text: ""
|
|
2420
|
-
};
|
|
2421
|
-
if (tagName(el) === "br" && isGoogleDocs(el) && isElement(el) && el?.parentNode?.textContent === "")
|
|
2422
|
-
return {
|
|
2423
|
-
...DEFAULT_SPAN,
|
|
2424
|
-
text: ""
|
|
2425
|
-
};
|
|
2426
|
-
if (tagName(el) === "br" && isGoogleDocs(el) && isElement(el) && isRootNode(el))
|
|
2427
|
-
return {
|
|
2428
|
-
...DEFAULT_SPAN,
|
|
2429
|
-
text: ""
|
|
2430
|
-
};
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
];
|
|
2434
|
-
}
|
|
2435
|
-
const whitespaceTextNodeRule = {
|
|
2436
|
-
deserialize(node2) {
|
|
2437
|
-
return node2.nodeName === "#text" && isWhitespaceTextNode(node2) ? {
|
|
2438
|
-
...DEFAULT_SPAN,
|
|
2439
|
-
marks: [],
|
|
2440
|
-
text: (node2.textContent ?? "").replace(/\s\s+/g, " ")
|
|
2441
|
-
} : void 0;
|
|
2442
|
-
}
|
|
2443
|
-
};
|
|
2444
|
-
function isWhitespaceTextNode(node2) {
|
|
2445
|
-
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";
|
|
2446
|
-
}
|
|
2447
|
-
function resolveListItem(schema, listNodeTagName) {
|
|
2448
|
-
if (listNodeTagName === "ul" && schema.lists.some((list) => list.name === "bullet"))
|
|
2449
|
-
return "bullet";
|
|
2450
|
-
if (listNodeTagName === "ol" && schema.lists.some((list) => list.name === "number"))
|
|
2451
|
-
return "number";
|
|
2452
|
-
}
|
|
2453
|
-
function createHTMLRules(schema, options) {
|
|
2454
|
-
return [
|
|
2455
|
-
whitespaceTextNodeRule,
|
|
2456
|
-
{
|
|
2457
|
-
// Pre element
|
|
2458
|
-
deserialize(el) {
|
|
2459
|
-
if (tagName(el) !== "pre")
|
|
2460
|
-
return;
|
|
2461
|
-
const isCodeEnabled = schema.styles.some(
|
|
2462
|
-
(style) => style.name === "code"
|
|
2463
|
-
);
|
|
2464
|
-
return {
|
|
2465
|
-
_type: "block",
|
|
2466
|
-
style: "normal",
|
|
2467
|
-
markDefs: [],
|
|
2468
|
-
children: [
|
|
2469
|
-
{
|
|
2470
|
-
...DEFAULT_SPAN,
|
|
2471
|
-
marks: isCodeEnabled ? ["code"] : [],
|
|
2472
|
-
text: el.textContent || ""
|
|
2473
|
-
}
|
|
2474
|
-
]
|
|
2475
|
-
};
|
|
2476
|
-
}
|
|
2477
|
-
},
|
|
2478
|
-
// Blockquote element
|
|
2479
|
-
{
|
|
2480
|
-
deserialize(el, next2) {
|
|
2481
|
-
if (tagName(el) !== "blockquote")
|
|
2482
|
-
return;
|
|
2483
|
-
const blocks2 = {
|
|
2484
|
-
...HTML_BLOCK_TAGS,
|
|
2485
|
-
...HTML_HEADER_TAGS
|
|
2486
|
-
};
|
|
2487
|
-
delete blocks2.blockquote;
|
|
2488
|
-
const nonBlockquoteBlocks = Object.keys(blocks2), children = [];
|
|
2489
|
-
return el.childNodes.forEach((node2, index) => {
|
|
2490
|
-
if (el.ownerDocument)
|
|
2491
|
-
if (node2.nodeType === 1 && nonBlockquoteBlocks.includes(
|
|
2492
|
-
node2.localName.toLowerCase()
|
|
2493
|
-
)) {
|
|
2494
|
-
const span = el.ownerDocument.createElement("span"), previousChild = children[children.length - 1];
|
|
2495
|
-
previousChild && previousChild.nodeType === 3 && previousChild.textContent?.trim() && span.appendChild(el.ownerDocument.createTextNode("\r")), node2.childNodes.forEach((cn) => {
|
|
2496
|
-
span.appendChild(cn.cloneNode(!0));
|
|
2497
|
-
}), index !== el.childNodes.length && span.appendChild(el.ownerDocument.createTextNode("\r")), children.push(span);
|
|
2498
|
-
} else
|
|
2499
|
-
children.push(node2);
|
|
2500
|
-
}), {
|
|
2501
|
-
_type: "block",
|
|
2502
|
-
style: "blockquote",
|
|
2503
|
-
markDefs: [],
|
|
2504
|
-
children: next2(children)
|
|
2505
|
-
};
|
|
2506
|
-
}
|
|
2507
|
-
},
|
|
2508
|
-
// Block elements
|
|
2509
|
-
{
|
|
2510
|
-
deserialize(el, next2) {
|
|
2511
|
-
const blocks2 = {
|
|
2512
|
-
...HTML_BLOCK_TAGS,
|
|
2513
|
-
...HTML_HEADER_TAGS
|
|
2514
|
-
}, tag = tagName(el);
|
|
2515
|
-
let block = tag ? blocks2[tag] : void 0;
|
|
2516
|
-
if (!block)
|
|
2517
|
-
return;
|
|
2518
|
-
if (el.parentNode && tagName(el.parentNode) === "li")
|
|
2519
|
-
return next2(el.childNodes);
|
|
2520
|
-
const blockStyle = block.style;
|
|
2521
|
-
return schema.styles.some((style) => style.name === blockStyle) || (block = DEFAULT_BLOCK), {
|
|
2522
|
-
...block,
|
|
2523
|
-
children: next2(el.childNodes)
|
|
2524
|
-
};
|
|
2525
|
-
}
|
|
2526
|
-
},
|
|
2527
|
-
// Ignore span tags
|
|
2528
|
-
{
|
|
2529
|
-
deserialize(el, next2) {
|
|
2530
|
-
const tag = tagName(el);
|
|
2531
|
-
if (!(!tag || !(tag in HTML_SPAN_TAGS)))
|
|
2532
|
-
return next2(el.childNodes);
|
|
2533
|
-
}
|
|
2534
|
-
},
|
|
2535
|
-
// Ignore div tags
|
|
2536
|
-
{
|
|
2537
|
-
deserialize(el, next2) {
|
|
2538
|
-
if (tagName(el) === "div")
|
|
2539
|
-
return next2(el.childNodes);
|
|
2540
|
-
}
|
|
2541
|
-
},
|
|
2542
|
-
// Ignore list containers
|
|
2543
|
-
{
|
|
2544
|
-
deserialize(el, next2) {
|
|
2545
|
-
const tag = tagName(el);
|
|
2546
|
-
if (!(!tag || !(tag in HTML_LIST_CONTAINER_TAGS)))
|
|
2547
|
-
return next2(el.childNodes);
|
|
2548
|
-
}
|
|
2549
|
-
},
|
|
2550
|
-
// Deal with br's
|
|
2551
|
-
{
|
|
2552
|
-
deserialize(el) {
|
|
2553
|
-
if (tagName(el) === "br")
|
|
2554
|
-
return {
|
|
2555
|
-
...DEFAULT_SPAN,
|
|
2556
|
-
text: `
|
|
2557
|
-
`
|
|
2558
|
-
};
|
|
2559
|
-
}
|
|
2560
|
-
},
|
|
2561
|
-
// Deal with list items
|
|
2562
|
-
{
|
|
2563
|
-
deserialize(el, next2, block) {
|
|
2564
|
-
const tag = tagName(el), listItem = tag ? HTML_LIST_ITEM_TAGS[tag] : void 0, parentTag = tagName(el.parentNode) || "";
|
|
2565
|
-
if (!listItem || !el.parentNode || !HTML_LIST_CONTAINER_TAGS[parentTag])
|
|
2566
|
-
return;
|
|
2567
|
-
const enabledListItem = resolveListItem(schema, parentTag);
|
|
2568
|
-
return enabledListItem ? (listItem.listItem = enabledListItem, {
|
|
2569
|
-
...listItem,
|
|
2570
|
-
children: next2(el.childNodes)
|
|
2571
|
-
}) : block({ _type: "block", children: next2(el.childNodes) });
|
|
2572
|
-
}
|
|
2573
|
-
},
|
|
2574
|
-
// Deal with decorators - this is a limited set of known html elements that we know how to deserialize
|
|
2575
|
-
{
|
|
2576
|
-
deserialize(el, next2) {
|
|
2577
|
-
const decorator = HTML_DECORATOR_TAGS[tagName(el) || ""];
|
|
2578
|
-
if (!(!decorator || !schema.decorators.some(
|
|
2579
|
-
(decoratorType) => decoratorType.name === decorator
|
|
2580
|
-
)))
|
|
2581
|
-
return {
|
|
2582
|
-
_type: "__decorator",
|
|
2583
|
-
name: decorator,
|
|
2584
|
-
children: next2(el.childNodes)
|
|
2585
|
-
};
|
|
2586
|
-
}
|
|
2587
|
-
},
|
|
2588
|
-
// Special case for hyperlinks, add annotation (if allowed by schema),
|
|
2589
|
-
// If not supported just write out the link text and href in plain text.
|
|
2590
|
-
{
|
|
2591
|
-
deserialize(el, next2) {
|
|
2592
|
-
if (tagName(el) !== "a")
|
|
2593
|
-
return;
|
|
2594
|
-
const linkEnabled = schema.annotations.some(
|
|
2595
|
-
(annotation) => annotation.name === "link"
|
|
2596
|
-
), href = isElement(el) && el.getAttribute("href");
|
|
2597
|
-
return href ? linkEnabled ? {
|
|
2598
|
-
_type: "__annotation",
|
|
2599
|
-
markDef: {
|
|
2600
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator(),
|
|
2601
|
-
_type: "link",
|
|
2602
|
-
href
|
|
2603
|
-
},
|
|
2604
|
-
children: next2(el.childNodes)
|
|
2605
|
-
} : el.appendChild(el.ownerDocument.createTextNode(` (${href})`)) && next2(el.childNodes) : next2(el.childNodes);
|
|
2606
|
-
}
|
|
2607
|
-
},
|
|
2608
|
-
{
|
|
2609
|
-
deserialize(el, next2) {
|
|
2610
|
-
if (isElement(el) && (tagName(el) === "td" || tagName(el) === "th"))
|
|
2611
|
-
return {
|
|
2612
|
-
...DEFAULT_BLOCK,
|
|
2613
|
-
children: next2(el.childNodes)
|
|
2614
|
-
};
|
|
2615
|
-
}
|
|
2616
|
-
},
|
|
2617
|
-
{
|
|
2618
|
-
deserialize(el) {
|
|
2619
|
-
if (isElement(el) && tagName(el) === "img") {
|
|
2620
|
-
const src = el.getAttribute("src") ?? void 0, alt = el.getAttribute("alt") ?? void 0, props = Object.fromEntries(
|
|
2621
|
-
Array.from(el.attributes).map((attr) => [attr.name, attr.value])
|
|
2622
|
-
), ancestorOfLonelyChild = el?.parentElement?.parentElement?.getAttribute("data-lonely-child"), ancestorOfListItem = el.closest("li") !== null;
|
|
2623
|
-
if (ancestorOfLonelyChild && !ancestorOfListItem) {
|
|
2624
|
-
const image2 = options.matchers?.image?.({
|
|
2625
|
-
context: {
|
|
2626
|
-
schema,
|
|
2627
|
-
keyGenerator: options.keyGenerator ?? keyGenerator
|
|
2628
|
-
},
|
|
2629
|
-
props: {
|
|
2630
|
-
...props,
|
|
2631
|
-
...src ? { src } : {},
|
|
2632
|
-
...alt ? { alt } : {}
|
|
2633
|
-
}
|
|
2634
|
-
});
|
|
2635
|
-
if (image2)
|
|
2636
|
-
return {
|
|
2637
|
-
_type: "__block",
|
|
2638
|
-
block: image2
|
|
2639
|
-
};
|
|
2640
|
-
}
|
|
2641
|
-
const inlineImage = options.matchers?.inlineImage?.({
|
|
2642
|
-
context: {
|
|
2643
|
-
schema,
|
|
2644
|
-
keyGenerator: options.keyGenerator ?? keyGenerator
|
|
2645
|
-
},
|
|
2646
|
-
props: {
|
|
2647
|
-
...props,
|
|
2648
|
-
...src ? { src } : {},
|
|
2649
|
-
...alt ? { alt } : {}
|
|
2650
|
-
}
|
|
2651
|
-
});
|
|
2652
|
-
if (inlineImage)
|
|
2653
|
-
return inlineImage;
|
|
2654
|
-
const image = options.matchers?.image?.({
|
|
2655
|
-
context: {
|
|
2656
|
-
schema,
|
|
2657
|
-
keyGenerator: options.keyGenerator ?? keyGenerator
|
|
2658
|
-
},
|
|
2659
|
-
props: {
|
|
2660
|
-
...props,
|
|
2661
|
-
...src ? { src } : {},
|
|
2662
|
-
...alt ? { alt } : {}
|
|
2663
|
-
}
|
|
2664
|
-
});
|
|
2665
|
-
if (image)
|
|
2666
|
-
return {
|
|
2667
|
-
_type: "__block",
|
|
2668
|
-
block: image
|
|
2669
|
-
};
|
|
2670
|
-
}
|
|
2671
|
-
}
|
|
2672
|
-
}
|
|
2673
|
-
];
|
|
2674
|
-
}
|
|
2675
|
-
function isEmphasis(el) {
|
|
2676
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2677
|
-
return /font-style:italic/.test(style || "");
|
|
2678
|
-
}
|
|
2679
|
-
function isStrong(el) {
|
|
2680
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2681
|
-
return /font-weight:700/.test(style || "") || /font-weight:600/.test(style || "");
|
|
2682
|
-
}
|
|
2683
|
-
function isUnderline(el) {
|
|
2684
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2685
|
-
return /text-decoration:underline/.test(style || "");
|
|
2686
|
-
}
|
|
2687
|
-
function isNotion(el) {
|
|
2688
|
-
return isElement(el) && !!el.getAttribute("data-is-notion");
|
|
2689
|
-
}
|
|
2690
|
-
function createNotionRules() {
|
|
2691
|
-
return [
|
|
2692
|
-
{
|
|
2693
|
-
deserialize(el) {
|
|
2694
|
-
if (isElement(el) && tagName(el) === "span" && isNotion(el)) {
|
|
2695
|
-
const span = {
|
|
2696
|
-
...DEFAULT_SPAN,
|
|
2697
|
-
marks: [],
|
|
2698
|
-
text: el.textContent
|
|
2699
|
-
};
|
|
2700
|
-
return isStrong(el) && span.marks.push("strong"), isUnderline(el) && span.marks.push("underline"), isEmphasis(el) && span.marks.push("em"), span;
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
}
|
|
2704
|
-
];
|
|
2705
|
-
}
|
|
2706
|
-
function getListItemStyle(el) {
|
|
2707
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2708
|
-
if (style && style.match(/lfo\d+/))
|
|
2709
|
-
return style.match("lfo1") ? "bullet" : "number";
|
|
2710
|
-
}
|
|
2711
|
-
function getListItemLevel(el) {
|
|
2712
|
-
const style = isElement(el) && el.getAttribute("style");
|
|
2713
|
-
if (!style)
|
|
2714
|
-
return;
|
|
2715
|
-
const levelMatch = style.match(/level\d+/);
|
|
2716
|
-
if (!levelMatch)
|
|
2717
|
-
return;
|
|
2718
|
-
const [level] = levelMatch[0].match(/\d/) || [];
|
|
2719
|
-
return (level ? Number.parseInt(level, 10) : 1) || 1;
|
|
2720
|
-
}
|
|
2721
|
-
function isWordListElement(el) {
|
|
2722
|
-
return isElement(el) && el.className ? el.className === "MsoListParagraphCxSpFirst" || el.className === "MsoListParagraphCxSpMiddle" || el.className === "MsoListParagraphCxSpLast" : !1;
|
|
2723
|
-
}
|
|
2724
|
-
function createWordRules() {
|
|
2725
|
-
return [
|
|
2726
|
-
{
|
|
2727
|
-
deserialize(el, next2) {
|
|
2728
|
-
if (tagName(el) === "p" && isWordListElement(el))
|
|
2729
|
-
return {
|
|
2730
|
-
...DEFAULT_BLOCK,
|
|
2731
|
-
listItem: getListItemStyle(el),
|
|
2732
|
-
level: getListItemLevel(el),
|
|
2733
|
-
style: BLOCK_DEFAULT_STYLE,
|
|
2734
|
-
children: next2(el.childNodes)
|
|
2735
|
-
};
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
];
|
|
2739
|
-
}
|
|
2740
|
-
function createRules(schema, options) {
|
|
2741
|
-
return [
|
|
2742
|
-
...createWordRules(),
|
|
2743
|
-
...createNotionRules(),
|
|
2744
|
-
...createGDocsRules(schema),
|
|
2745
|
-
...createHTMLRules(schema, options)
|
|
2746
|
-
];
|
|
2747
|
-
}
|
|
2748
|
-
class HtmlDeserializer {
|
|
2749
|
-
keyGenerator;
|
|
2750
|
-
schema;
|
|
2751
|
-
rules;
|
|
2752
|
-
parseHtml;
|
|
2753
|
-
_markDefs = [];
|
|
2754
|
-
/**
|
|
2755
|
-
* Create a new serializer respecting a Sanity block content type's schema
|
|
2756
|
-
*
|
|
2757
|
-
* @param blockContentType - Schema type for array containing _at least_ a block child type
|
|
2758
|
-
* @param options - Options for the deserialization process
|
|
2759
|
-
*/
|
|
2760
|
-
constructor(schema, options = {}) {
|
|
2761
|
-
const { rules = [], unstable_whitespaceOnPasteMode = "preserve" } = options, standardRules = createRules(schema, {
|
|
2762
|
-
keyGenerator: options.keyGenerator,
|
|
2763
|
-
matchers: options.matchers
|
|
2764
|
-
});
|
|
2765
|
-
this.schema = schema, this.keyGenerator = options.keyGenerator ?? keyGenerator, this.rules = [...rules, ...standardRules];
|
|
2766
|
-
const parseHtml = options.parseHtml || defaultParseHtml();
|
|
2767
|
-
this.parseHtml = (html) => preprocess$1(html, parseHtml, { unstable_whitespaceOnPasteMode }).body;
|
|
2768
|
-
}
|
|
2769
|
-
/**
|
|
2770
|
-
* Deserialize HTML.
|
|
2771
|
-
*
|
|
2772
|
-
* @param html - The HTML to deserialize, as a string
|
|
2773
|
-
* @returns Array of blocks - either portable text blocks or other allowed blocks
|
|
2774
|
-
*/
|
|
2775
|
-
deserialize = (html) => {
|
|
2776
|
-
this._markDefs = [];
|
|
2777
|
-
const { parseHtml } = this, fragment = parseHtml(html), children = Array.from(fragment.childNodes), blocks2 = trimWhitespace(
|
|
2778
|
-
this.schema,
|
|
2779
|
-
flattenNestedBlocks(
|
|
2780
|
-
{ schema: this.schema },
|
|
2781
|
-
ensureRootIsBlocks(
|
|
2782
|
-
this.schema,
|
|
2783
|
-
this.deserializeElements(children)
|
|
2784
|
-
)
|
|
2785
|
-
)
|
|
2786
|
-
);
|
|
2787
|
-
return this._markDefs.length > 0 && blocks2.filter((block) => isTextBlock({ schema: this.schema }, block)).forEach((block) => {
|
|
2788
|
-
block.markDefs = block.markDefs || [], block.markDefs = block.markDefs.concat(
|
|
2789
|
-
this._markDefs.filter((def) => flatten(
|
|
2790
|
-
block.children.map((child) => child.marks || [])
|
|
2791
|
-
).includes(def._key))
|
|
2792
|
-
);
|
|
2793
|
-
}), blocks2.map((block) => (block._type === "block" && (block._type = this.schema.block.name), block));
|
|
2794
|
-
};
|
|
2795
|
-
/**
|
|
2796
|
-
* Deserialize an array of DOM elements.
|
|
2797
|
-
*
|
|
2798
|
-
* @param elements - Array of DOM elements to deserialize
|
|
2799
|
-
* @returns
|
|
2800
|
-
*/
|
|
2801
|
-
deserializeElements = (elements = []) => {
|
|
2802
|
-
let nodes = [];
|
|
2803
|
-
return elements.forEach((element) => {
|
|
2804
|
-
nodes = nodes.concat(this.deserializeElement(element));
|
|
2805
|
-
}), nodes;
|
|
2806
|
-
};
|
|
2807
|
-
/**
|
|
2808
|
-
* Deserialize a DOM element
|
|
2809
|
-
*
|
|
2810
|
-
* @param element - Deserialize a DOM element
|
|
2811
|
-
* @returns
|
|
2812
|
-
*/
|
|
2813
|
-
deserializeElement = (element) => {
|
|
2814
|
-
const next2 = (elements) => {
|
|
2815
|
-
if (isNodeList(elements))
|
|
2816
|
-
return this.deserializeElements(Array.from(elements));
|
|
2817
|
-
if (Array.isArray(elements))
|
|
2818
|
-
return this.deserializeElements(elements);
|
|
2819
|
-
if (elements)
|
|
2820
|
-
return this.deserializeElement(elements);
|
|
2821
|
-
}, block = (props) => ({
|
|
2822
|
-
_type: "__block",
|
|
2823
|
-
block: props
|
|
2824
|
-
});
|
|
2825
|
-
let node2;
|
|
2826
|
-
for (let i = 0; i < this.rules.length; i++) {
|
|
2827
|
-
const rule = this.rules[i];
|
|
2828
|
-
if (!rule.deserialize)
|
|
2829
|
-
continue;
|
|
2830
|
-
const ret = rule.deserialize(element, next2, block), type = resolveJsType(ret);
|
|
2831
|
-
if (type !== "array" && type !== "object" && type !== "null" && type !== "undefined")
|
|
2832
|
-
throw new Error(
|
|
2833
|
-
`A rule returned an invalid deserialized representation: "${node2}".`
|
|
2834
|
-
);
|
|
2835
|
-
if (ret !== void 0) {
|
|
2836
|
-
{
|
|
2837
|
-
if (ret === null)
|
|
2838
|
-
throw new Error("Deserializer rule returned `null`");
|
|
2839
|
-
Array.isArray(ret) ? node2 = ret : isPlaceholderDecorator(ret) ? node2 = this.deserializeDecorator(ret) : isPlaceholderAnnotation(ret) ? node2 = this.deserializeAnnotation(ret) : node2 = ret;
|
|
2840
|
-
}
|
|
2841
|
-
if (ret && !Array.isArray(ret) && isMinimalBlock(ret) && "listItem" in ret) {
|
|
2842
|
-
let parent = element.parentNode?.parentNode;
|
|
2843
|
-
for (; parent && tagName(parent) === "li"; )
|
|
2844
|
-
parent = parent.parentNode?.parentNode, ret.level = ret.level ? ret.level + 1 : 1;
|
|
2845
|
-
}
|
|
2846
|
-
ret && !Array.isArray(ret) && isMinimalBlock(ret) && ret.style === "blockquote" && ret.children.forEach((child, index) => {
|
|
2847
|
-
isMinimalSpan(child) && child.text === "\r" && (child.text = `
|
|
2848
|
-
`, (index === 0 || index === ret.children.length - 1) && ret.children.splice(index, 1));
|
|
2849
|
-
});
|
|
2850
|
-
break;
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2853
|
-
return node2 || next2(element.childNodes) || [];
|
|
2854
|
-
};
|
|
2855
|
-
/**
|
|
2856
|
-
* Deserialize a `__decorator` type
|
|
2857
|
-
* (an internal made up type to process decorators exclusively)
|
|
2858
|
-
*
|
|
2859
|
-
* @param decorator -
|
|
2860
|
-
* @returns array of ...
|
|
2861
|
-
*/
|
|
2862
|
-
deserializeDecorator = (decorator) => {
|
|
2863
|
-
const { name } = decorator, applyDecorator = (node2) => {
|
|
2864
|
-
if (isPlaceholderDecorator(node2))
|
|
2865
|
-
return this.deserializeDecorator(node2);
|
|
2866
|
-
if (isMinimalSpan(node2))
|
|
2867
|
-
node2.marks = node2.marks || [], node2.text.trim() && node2.marks.unshift(name);
|
|
2868
|
-
else if ("children" in node2 && Array.isArray(node2.children)) {
|
|
2869
|
-
const block = node2;
|
|
2870
|
-
block.children = block.children.map(applyDecorator);
|
|
2871
|
-
}
|
|
2872
|
-
return node2;
|
|
2873
|
-
};
|
|
2874
|
-
return decorator.children.reduce((children, node2) => {
|
|
2875
|
-
const ret = applyDecorator(node2);
|
|
2876
|
-
return Array.isArray(ret) ? children.concat(ret) : (children.push(ret), children);
|
|
2877
|
-
}, []);
|
|
2878
|
-
};
|
|
2879
|
-
/**
|
|
2880
|
-
* Deserialize a `__annotation` object.
|
|
2881
|
-
* (an internal made up type to process annotations exclusively)
|
|
2882
|
-
*
|
|
2883
|
-
* @param annotation -
|
|
2884
|
-
* @returns Array of...
|
|
2885
|
-
*/
|
|
2886
|
-
deserializeAnnotation = (annotation) => {
|
|
2887
|
-
const { markDef } = annotation;
|
|
2888
|
-
this._markDefs.push(markDef);
|
|
2889
|
-
const applyAnnotation = (node2) => {
|
|
2890
|
-
if (isPlaceholderAnnotation(node2))
|
|
2891
|
-
return this.deserializeAnnotation(node2);
|
|
2892
|
-
if (isMinimalSpan(node2))
|
|
2893
|
-
node2.marks = node2.marks || [], node2.text.trim() && node2.marks.unshift(markDef._key);
|
|
2894
|
-
else if ("children" in node2 && Array.isArray(node2.children)) {
|
|
2895
|
-
const block = node2;
|
|
2896
|
-
block.children = block.children.map(applyAnnotation);
|
|
2897
|
-
}
|
|
2898
|
-
return node2;
|
|
2899
|
-
};
|
|
2900
|
-
return annotation.children.reduce((children, node2) => {
|
|
2901
|
-
const ret = applyAnnotation(node2);
|
|
2902
|
-
return Array.isArray(ret) ? children.concat(ret) : (children.push(ret), children);
|
|
2903
|
-
}, []);
|
|
2904
|
-
};
|
|
2905
|
-
}
|
|
2906
|
-
function normalizeBlock(node2, options = {}) {
|
|
2907
|
-
const schema = {
|
|
2908
|
-
block: {
|
|
2909
|
-
name: options.blockTypeName || "block"
|
|
2910
|
-
},
|
|
2911
|
-
span: {
|
|
2912
|
-
name: "span"
|
|
2913
|
-
},
|
|
2914
|
-
styles: [],
|
|
2915
|
-
lists: [],
|
|
2916
|
-
decorators: [],
|
|
2917
|
-
annotations: [],
|
|
2918
|
-
blockObjects: [],
|
|
2919
|
-
inlineObjects: []
|
|
2920
|
-
};
|
|
2921
|
-
if (node2._type !== (options.blockTypeName || "block"))
|
|
2922
|
-
return "_key" in node2 ? node2 : {
|
|
2923
|
-
...node2,
|
|
2924
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator()
|
|
2925
|
-
};
|
|
2926
|
-
const block = {
|
|
2927
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator(),
|
|
2928
|
-
children: [],
|
|
2929
|
-
markDefs: [],
|
|
2930
|
-
...node2
|
|
2931
|
-
}, lastChild = block.children[block.children.length - 1];
|
|
2932
|
-
if (!lastChild)
|
|
2933
|
-
return block.children = [
|
|
2934
|
-
{
|
|
2935
|
-
_type: "span",
|
|
2936
|
-
_key: options.keyGenerator ? options.keyGenerator() : keyGenerator(),
|
|
2937
|
-
text: "",
|
|
2938
|
-
marks: []
|
|
2939
|
-
}
|
|
2940
|
-
], block;
|
|
2941
|
-
const usedMarkDefs = [], allowedDecorators = options.allowedDecorators && Array.isArray(options.allowedDecorators) ? options.allowedDecorators : !1;
|
|
2942
|
-
return block.children = block.children.reduce(
|
|
2943
|
-
(acc, child) => {
|
|
2944
|
-
const previousChild = acc[acc.length - 1];
|
|
2945
|
-
return previousChild && isSpan({ schema }, child) && isSpan({ schema }, previousChild) && isEqual(previousChild.marks, child.marks) ? (lastChild && lastChild === child && child.text === "" && block.children.length > 1 || (previousChild.text += child.text), acc) : (acc.push(child), acc);
|
|
2946
|
-
},
|
|
2947
|
-
[]
|
|
2948
|
-
).map((child) => {
|
|
2949
|
-
if (!child)
|
|
2950
|
-
throw new Error("missing child");
|
|
2951
|
-
return child._key = options.keyGenerator ? options.keyGenerator() : keyGenerator(), isSpan({ schema }, child) && (child.marks ? allowedDecorators && (child.marks = child.marks.filter((mark) => {
|
|
2952
|
-
const isAllowed = allowedDecorators.includes(mark), isUsed = block.markDefs?.some((def) => def._key === mark);
|
|
2953
|
-
return isAllowed || isUsed;
|
|
2954
|
-
})) : child.marks = [], usedMarkDefs.push(...child.marks)), child;
|
|
2955
|
-
}), block.markDefs = (block.markDefs || []).filter(
|
|
2956
|
-
(markDef) => usedMarkDefs.includes(markDef._key)
|
|
2957
|
-
), block;
|
|
2958
|
-
}
|
|
2959
|
-
function htmlToBlocks(html, schemaType, options = {}) {
|
|
2960
|
-
const schema = isSanitySchema(schemaType) ? sanitySchemaToPortableTextSchema(schemaType) : schemaType;
|
|
2961
|
-
return new HtmlDeserializer(schema, options).deserialize(html).map((block) => normalizeBlock(block, { keyGenerator: options.keyGenerator }));
|
|
2962
|
-
}
|
|
2963
|
-
function isSanitySchema(schema) {
|
|
2964
|
-
return schema.hasOwnProperty("jsonType");
|
|
2965
|
-
}
|
|
2966
|
-
const defaultSchema = Schema.compile({
|
|
179
|
+
}, defaultSchema = Schema.compile({
|
|
2967
180
|
name: "default",
|
|
2968
181
|
types: [
|
|
2969
182
|
{
|
|
@@ -3181,7 +394,7 @@ const defaultStopTypes = [
|
|
|
3181
394
|
obj[field] && (filteredObj[field] = obj[field]);
|
|
3182
395
|
}), filteredObj;
|
|
3183
396
|
}, META_FIELDS = ["_key", "_type", "_id", "_weak"], BaseDocumentSerializer = (schemas) => {
|
|
3184
|
-
const getSchema = (name) => schemas?._original?.types.find((
|
|
397
|
+
const getSchema = (name) => schemas?._original?.types.find((s) => s.name === name), serializeObject = (obj, stopTypes, serializers) => {
|
|
3185
398
|
if (stopTypes.includes(obj._type))
|
|
3186
399
|
return "";
|
|
3187
400
|
if (serializers.types && Object.keys(serializers.types).includes(obj._type))
|
|
@@ -3307,10 +520,10 @@ const defaultStopTypes = [
|
|
|
3307
520
|
serializeObject
|
|
3308
521
|
};
|
|
3309
522
|
};
|
|
3310
|
-
function mergeBlocks(
|
|
3311
|
-
const mergedBlock = { ...
|
|
523
|
+
function mergeBlocks(blocks) {
|
|
524
|
+
const mergedBlock = { ...blocks[0] };
|
|
3312
525
|
mergedBlock.markDefs = mergedBlock.markDefs ?? [];
|
|
3313
|
-
for (const [idx, block] of
|
|
526
|
+
for (const [idx, block] of blocks.entries())
|
|
3314
527
|
idx !== 0 && (mergedBlock.children.push(...block.children), mergedBlock.markDefs.push(...block.markDefs ?? []));
|
|
3315
528
|
return mergedBlock._type = "block", mergedBlock;
|
|
3316
529
|
}
|
|
@@ -3382,7 +595,7 @@ const deserializeArray = (arrayHTML, deserializers = customDeserializers, blockD
|
|
|
3382
595
|
deserializeDocument: deserializeDocument$1,
|
|
3383
596
|
deserializeHTML
|
|
3384
597
|
};
|
|
3385
|
-
var lodash$1 = { exports: {} };
|
|
598
|
+
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, lodash$1 = { exports: {} };
|
|
3386
599
|
/**
|
|
3387
600
|
* @license
|
|
3388
601
|
* Lodash <https://lodash.com/>
|
|
@@ -4191,7 +1404,7 @@ function requireLodash() {
|
|
|
4191
1404
|
}
|
|
4192
1405
|
Stack2.prototype.clear = stackClear, Stack2.prototype.delete = stackDelete, Stack2.prototype.get = stackGet, Stack2.prototype.has = stackHas, Stack2.prototype.set = stackSet;
|
|
4193
1406
|
function arrayLikeKeys(value, inherited) {
|
|
4194
|
-
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg &&
|
|
1407
|
+
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;
|
|
4195
1408
|
for (var key in value)
|
|
4196
1409
|
(inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
4197
1410
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
@@ -4262,7 +1475,7 @@ function requireLodash() {
|
|
|
4262
1475
|
return copyArray(value, result2);
|
|
4263
1476
|
} else {
|
|
4264
1477
|
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
4265
|
-
if (
|
|
1478
|
+
if (isBuffer(value))
|
|
4266
1479
|
return cloneBuffer(value, isDeep);
|
|
4267
1480
|
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
4268
1481
|
if (result2 = isFlat || isFunc ? {} : initCloneObject(value), !isDeep)
|
|
@@ -4386,7 +1599,7 @@ function requireLodash() {
|
|
|
4386
1599
|
return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
|
|
4387
1600
|
}
|
|
4388
1601
|
function baseGetTag(value) {
|
|
4389
|
-
return value == null ? value === undefined$1 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) :
|
|
1602
|
+
return value == null ? value === undefined$1 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
|
|
4390
1603
|
}
|
|
4391
1604
|
function baseGt(value, other) {
|
|
4392
1605
|
return value > other;
|
|
@@ -4447,8 +1660,8 @@ function requireLodash() {
|
|
|
4447
1660
|
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
4448
1661
|
objTag = objTag == argsTag ? objectTag : objTag, othTag = othTag == argsTag ? objectTag : othTag;
|
|
4449
1662
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
4450
|
-
if (isSameTag &&
|
|
4451
|
-
if (!
|
|
1663
|
+
if (isSameTag && isBuffer(object)) {
|
|
1664
|
+
if (!isBuffer(other))
|
|
4452
1665
|
return !1;
|
|
4453
1666
|
objIsArr = !0, objIsObj = !1;
|
|
4454
1667
|
}
|
|
@@ -4564,7 +1777,7 @@ function requireLodash() {
|
|
|
4564
1777
|
}
|
|
4565
1778
|
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined$1, isCommon = newValue === undefined$1;
|
|
4566
1779
|
if (isCommon) {
|
|
4567
|
-
var isArr = isArray(srcValue), isBuff = !isArr &&
|
|
1780
|
+
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
4568
1781
|
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;
|
|
4569
1782
|
}
|
|
4570
1783
|
isCommon && (stack.set(srcValue, newValue), mergeFunc(newValue, srcValue, srcIndex, customizer, stack), stack.delete(srcValue)), assignMergeValue(object, key, newValue);
|
|
@@ -5302,7 +2515,7 @@ function requireLodash() {
|
|
|
5302
2515
|
return stack.delete(object), stack.delete(other), result2;
|
|
5303
2516
|
}
|
|
5304
2517
|
function flatRest(func) {
|
|
5305
|
-
return setToString(overRest(func, undefined$1,
|
|
2518
|
+
return setToString(overRest(func, undefined$1, flatten), func + "");
|
|
5306
2519
|
}
|
|
5307
2520
|
function getAllKeys(object) {
|
|
5308
2521
|
return baseGetAllKeys(object, keys, getSymbols);
|
|
@@ -5536,7 +2749,7 @@ function requireLodash() {
|
|
|
5536
2749
|
result2.push(key);
|
|
5537
2750
|
return result2;
|
|
5538
2751
|
}
|
|
5539
|
-
function
|
|
2752
|
+
function objectToString(value) {
|
|
5540
2753
|
return nativeObjectToString.call(value);
|
|
5541
2754
|
}
|
|
5542
2755
|
function overRest(func, start, transform2) {
|
|
@@ -5692,7 +2905,7 @@ function requireLodash() {
|
|
|
5692
2905
|
var index = length2 - 1;
|
|
5693
2906
|
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);
|
|
5694
2907
|
}
|
|
5695
|
-
function
|
|
2908
|
+
function flatten(array) {
|
|
5696
2909
|
var length2 = array == null ? 0 : array.length;
|
|
5697
2910
|
return length2 ? baseFlatten(array, 1) : [];
|
|
5698
2911
|
}
|
|
@@ -5848,7 +3061,7 @@ function requireLodash() {
|
|
|
5848
3061
|
var comparator = last(arrays);
|
|
5849
3062
|
return comparator = typeof comparator == "function" ? comparator : undefined$1, baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, !0), undefined$1, comparator);
|
|
5850
3063
|
});
|
|
5851
|
-
function
|
|
3064
|
+
function uniq(array) {
|
|
5852
3065
|
return array && array.length ? baseUniq(array) : [];
|
|
5853
3066
|
}
|
|
5854
3067
|
function uniqBy(array, iteratee2) {
|
|
@@ -6278,14 +3491,14 @@ function requireLodash() {
|
|
|
6278
3491
|
function isBoolean(value) {
|
|
6279
3492
|
return value === !0 || value === !1 || isObjectLike(value) && baseGetTag(value) == boolTag;
|
|
6280
3493
|
}
|
|
6281
|
-
var
|
|
6282
|
-
function
|
|
3494
|
+
var isBuffer = nativeIsBuffer || stubFalse, isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
3495
|
+
function isElement(value) {
|
|
6283
3496
|
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
|
6284
3497
|
}
|
|
6285
3498
|
function isEmpty(value) {
|
|
6286
3499
|
if (value == null)
|
|
6287
3500
|
return !0;
|
|
6288
|
-
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" ||
|
|
3501
|
+
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value)))
|
|
6289
3502
|
return !value.length;
|
|
6290
3503
|
var tag = getTag(value);
|
|
6291
3504
|
if (tag == mapTag || tag == setTag)
|
|
@@ -6297,7 +3510,7 @@ function requireLodash() {
|
|
|
6297
3510
|
return !1;
|
|
6298
3511
|
return !0;
|
|
6299
3512
|
}
|
|
6300
|
-
function
|
|
3513
|
+
function isEqual(value, other) {
|
|
6301
3514
|
return baseIsEqual(value, other);
|
|
6302
3515
|
}
|
|
6303
3516
|
function isEqualWith(value, other, customizer) {
|
|
@@ -6576,7 +3789,7 @@ function requireLodash() {
|
|
|
6576
3789
|
}
|
|
6577
3790
|
var toPairs = createToPairs(keys), toPairsIn = createToPairs(keysIn);
|
|
6578
3791
|
function transform(object, iteratee2, accumulator) {
|
|
6579
|
-
var isArr = isArray(object), isArrLike = isArr ||
|
|
3792
|
+
var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
|
|
6580
3793
|
if (iteratee2 = getIteratee(iteratee2, 4), accumulator == null) {
|
|
6581
3794
|
var Ctor = object && object.constructor;
|
|
6582
3795
|
isArrLike ? accumulator = isArr ? new Ctor() : [] : isObject(object) ? accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {} : accumulator = {};
|
|
@@ -6955,7 +4168,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6955
4168
|
function sumBy(array, iteratee2) {
|
|
6956
4169
|
return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
|
|
6957
4170
|
}
|
|
6958
|
-
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 =
|
|
4171
|
+
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() {
|
|
6959
4172
|
var source = {};
|
|
6960
4173
|
return baseForOwn(lodash2, function(func, methodName) {
|
|
6961
4174
|
hasOwnProperty.call(lodash2.prototype, methodName) || (source[methodName] = func);
|
|
@@ -8221,9 +5434,9 @@ const LanguageStatus = ({
|
|
|
8221
5434
|
};
|
|
8222
5435
|
var __assign = function() {
|
|
8223
5436
|
return __assign = Object.assign || function(t) {
|
|
8224
|
-
for (var
|
|
8225
|
-
|
|
8226
|
-
for (var p in
|
|
5437
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5438
|
+
s = arguments[i];
|
|
5439
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
8227
5440
|
}
|
|
8228
5441
|
return t;
|
|
8229
5442
|
}, __assign.apply(this, arguments);
|
|
@@ -8677,8 +5890,8 @@ function prefix(value, length2, children) {
|
|
|
8677
5890
|
// grid-(column|row)
|
|
8678
5891
|
case 5152:
|
|
8679
5892
|
case 5920:
|
|
8680
|
-
return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a, b,
|
|
8681
|
-
return MS + a + ":" + b + f2 + (
|
|
5893
|
+
return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a, b, c, d, e, f2) {
|
|
5894
|
+
return MS + a + ":" + b + f2 + (c ? MS + a + "-span:" + (d ? e : +e - +b) + f2 : "") + value;
|
|
8682
5895
|
});
|
|
8683
5896
|
// position: sticky
|
|
8684
5897
|
case 4949:
|
|
@@ -8817,7 +6030,7 @@ var unitlessKeys = {
|
|
|
8817
6030
|
}, 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*/
|
|
8818
6031
|
`, 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) {
|
|
8819
6032
|
if (process.env.NODE_ENV !== "production") {
|
|
8820
|
-
var o2 = n ? ' with the id of "'.concat(n, '"') : "",
|
|
6033
|
+
var o2 = n ? ' with the id of "'.concat(n, '"') : "", s = "The component ".concat(t).concat(o2, ` has been created dynamically.
|
|
8821
6034
|
`) + `You may see this warning because you've called styled inside another component.
|
|
8822
6035
|
To resolve this only create new StyledComponents outside of any render method and function component.
|
|
8823
6036
|
See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
|
|
@@ -8826,10 +6039,10 @@ See https://styled-components.com/docs/basics#define-styled-components-outside-o
|
|
|
8826
6039
|
var a = !0;
|
|
8827
6040
|
console.error = function(t2) {
|
|
8828
6041
|
for (var n2 = [], o3 = 1; o3 < arguments.length; o3++) n2[o3 - 1] = arguments[o3];
|
|
8829
|
-
E.test(t2) ? (a = !1, N.delete(
|
|
8830
|
-
}, useRef(), a && !N.has(
|
|
6042
|
+
E.test(t2) ? (a = !1, N.delete(s)) : i.apply(void 0, __spreadArray([t2], n2, !1));
|
|
6043
|
+
}, useRef(), a && !N.has(s) && (console.warn(s), N.add(s));
|
|
8831
6044
|
} catch (e) {
|
|
8832
|
-
E.test(e.message) && N.delete(
|
|
6045
|
+
E.test(e.message) && N.delete(s);
|
|
8833
6046
|
} finally {
|
|
8834
6047
|
console.error = i;
|
|
8835
6048
|
}
|
|
@@ -8879,12 +6092,12 @@ function oe(e, t, n) {
|
|
|
8879
6092
|
}
|
|
8880
6093
|
var r = K(t);
|
|
8881
6094
|
Q && (r = r.concat(Q(t)));
|
|
8882
|
-
for (var
|
|
8883
|
-
var
|
|
8884
|
-
if (!(
|
|
8885
|
-
var l = ee(t,
|
|
6095
|
+
for (var s = X(e), i = X(t), a = 0; a < r.length; ++a) {
|
|
6096
|
+
var c = r[a];
|
|
6097
|
+
if (!(c in H || n && n[c] || i && c in i || s && c in s)) {
|
|
6098
|
+
var l = ee(t, c);
|
|
8886
6099
|
try {
|
|
8887
|
-
Z(e,
|
|
6100
|
+
Z(e, c, l);
|
|
8888
6101
|
} catch {
|
|
8889
6102
|
}
|
|
8890
6103
|
}
|
|
@@ -8962,7 +6175,7 @@ Has styled-components' style tag been unmounted or altered by another script?
|
|
|
8962
6175
|
`, 18: "ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`" } : {};
|
|
8963
6176
|
function de() {
|
|
8964
6177
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
8965
|
-
for (var n = e[0], o2 = [], r = 1,
|
|
6178
|
+
for (var n = e[0], o2 = [], r = 1, s = e.length; r < s; r += 1) o2.push(e[r]);
|
|
8966
6179
|
return o2.forEach(function(e2) {
|
|
8967
6180
|
n = n.replace(/%[a-z]/, e2);
|
|
8968
6181
|
}), n;
|
|
@@ -8982,9 +6195,9 @@ var fe = (function() {
|
|
|
8982
6195
|
if (e2 >= this.groupSizes.length) {
|
|
8983
6196
|
for (var n = this.groupSizes, o2 = n.length, r = o2; e2 >= r; ) if ((r <<= 1) < 0) throw he(16, "".concat(e2));
|
|
8984
6197
|
this.groupSizes = new Uint32Array(r), this.groupSizes.set(n), this.length = r;
|
|
8985
|
-
for (var
|
|
6198
|
+
for (var s = o2; s < r; s++) this.groupSizes[s] = 0;
|
|
8986
6199
|
}
|
|
8987
|
-
for (var i = this.indexOfGroup(e2 + 1), a = (
|
|
6200
|
+
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++);
|
|
8988
6201
|
}, e.prototype.clearGroup = function(e2) {
|
|
8989
6202
|
if (e2 < this.length) {
|
|
8990
6203
|
var t = this.groupSizes[e2], n = this.indexOfGroup(e2), o2 = n + t;
|
|
@@ -8994,7 +6207,7 @@ var fe = (function() {
|
|
|
8994
6207
|
}, e.prototype.getGroup = function(e2) {
|
|
8995
6208
|
var t = "";
|
|
8996
6209
|
if (e2 >= this.length || this.groupSizes[e2] === 0) return t;
|
|
8997
|
-
for (var n = this.groupSizes[e2], o2 = this.indexOfGroup(e2), r = o2 + n,
|
|
6210
|
+
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);
|
|
8998
6211
|
return t;
|
|
8999
6212
|
}, e;
|
|
9000
6213
|
})(), me = 1 << 30, ye = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ge = 1, Se = function(e) {
|
|
@@ -9006,15 +6219,15 @@ var fe = (function() {
|
|
|
9006
6219
|
}, we = function(e, t) {
|
|
9007
6220
|
ge = t + 1, ye.set(e, t), ve.set(t, e);
|
|
9008
6221
|
}, be = "style[".concat(f, "][").concat(y, '="').concat(v, '"]'), Ee = new RegExp("^".concat(f, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Ne = function(e, t, n) {
|
|
9009
|
-
for (var o2, r = n.split(","),
|
|
6222
|
+
for (var o2, r = n.split(","), s = 0, i = r.length; s < i; s++) (o2 = r[s]) && e.registerName(t, o2);
|
|
9010
6223
|
}, Pe = function(e, t) {
|
|
9011
|
-
for (var n, o2 = ((n = t.textContent) !== null && n !== void 0 ? n : "").split(g), r = [],
|
|
9012
|
-
var a = o2[
|
|
6224
|
+
for (var n, o2 = ((n = t.textContent) !== null && n !== void 0 ? n : "").split(g), r = [], s = 0, i = o2.length; s < i; s++) {
|
|
6225
|
+
var a = o2[s].trim();
|
|
9013
6226
|
if (a) {
|
|
9014
|
-
var
|
|
9015
|
-
if (
|
|
9016
|
-
var l = 0 | parseInt(
|
|
9017
|
-
l !== 0 && (we(u, l), Ne(e, u,
|
|
6227
|
+
var c = a.match(Ee);
|
|
6228
|
+
if (c) {
|
|
6229
|
+
var l = 0 | parseInt(c[1], 10), u = c[2];
|
|
6230
|
+
l !== 0 && (we(u, l), Ne(e, u, c[3]), e.getTag().insertRules(l, r)), r.length = 0;
|
|
9018
6231
|
} else r.push(a);
|
|
9019
6232
|
}
|
|
9020
6233
|
}
|
|
@@ -9031,10 +6244,10 @@ var Ie = function(e) {
|
|
|
9031
6244
|
var t = document.head, n = e || t, o2 = document.createElement("style"), r = (function(e2) {
|
|
9032
6245
|
var t2 = Array.from(e2.querySelectorAll("style[".concat(f, "]")));
|
|
9033
6246
|
return t2[t2.length - 1];
|
|
9034
|
-
})(n),
|
|
6247
|
+
})(n), s = r !== void 0 ? r.nextSibling : null;
|
|
9035
6248
|
o2.setAttribute(f, m), o2.setAttribute(y, v);
|
|
9036
6249
|
var i = Ce();
|
|
9037
|
-
return i && o2.setAttribute("nonce", i), n.insertBefore(o2,
|
|
6250
|
+
return i && o2.setAttribute("nonce", i), n.insertBefore(o2, s), o2;
|
|
9038
6251
|
}, Ae = (function() {
|
|
9039
6252
|
function e(e2) {
|
|
9040
6253
|
this.element = Ie(e2), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e3) {
|
|
@@ -9095,13 +6308,13 @@ var Ie = function(e) {
|
|
|
9095
6308
|
return ve.get(e4);
|
|
9096
6309
|
})(n3);
|
|
9097
6310
|
if (r3 === void 0) return "continue";
|
|
9098
|
-
var
|
|
9099
|
-
if (
|
|
9100
|
-
var a = "".concat(f, ".g").concat(n3, '[id="').concat(r3, '"]'),
|
|
9101
|
-
|
|
9102
|
-
e4.length > 0 && (
|
|
9103
|
-
}), o3 += "".concat(i).concat(a, '{content:"').concat(
|
|
9104
|
-
},
|
|
6311
|
+
var s2 = e3.names.get(r3), i = t.getGroup(n3);
|
|
6312
|
+
if (s2 === void 0 || !s2.size || i.length === 0) return "continue";
|
|
6313
|
+
var a = "".concat(f, ".g").concat(n3, '[id="').concat(r3, '"]'), c = "";
|
|
6314
|
+
s2 !== void 0 && s2.forEach(function(e4) {
|
|
6315
|
+
e4.length > 0 && (c += "".concat(e4, ","));
|
|
6316
|
+
}), o3 += "".concat(i).concat(a, '{content:"').concat(c, '"}').concat(g);
|
|
6317
|
+
}, s = 0; s < n2; s++) r2(s);
|
|
9105
6318
|
return o3;
|
|
9106
6319
|
})(r);
|
|
9107
6320
|
});
|
|
@@ -9146,22 +6359,22 @@ function Ve(e, t) {
|
|
|
9146
6359
|
});
|
|
9147
6360
|
}
|
|
9148
6361
|
function Fe(e) {
|
|
9149
|
-
var t, n, o2, r = C,
|
|
6362
|
+
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) {
|
|
9150
6363
|
return r2.startsWith(n) && r2.endsWith(n) && r2.replaceAll(n, "").length > 0 ? ".".concat(t) : e2;
|
|
9151
|
-
}, u =
|
|
6364
|
+
}, u = c.slice();
|
|
9152
6365
|
u.push(function(e2) {
|
|
9153
6366
|
e2.type === RULESET && e2.value.includes("&") && (e2.props[0] = e2.props[0].replace(je, n).replace(o2, l));
|
|
9154
6367
|
}), i.prefix && u.push(prefixer), u.push(stringify);
|
|
9155
|
-
var p = function(e2, r2,
|
|
9156
|
-
r2 === void 0 && (r2 = ""),
|
|
9157
|
-
var
|
|
6368
|
+
var p = function(e2, r2, s2, a2) {
|
|
6369
|
+
r2 === void 0 && (r2 = ""), s2 === void 0 && (s2 = ""), a2 === void 0 && (a2 = "&"), t = a2, n = r2, o2 = new RegExp("\\".concat(n, "\\b"), "g");
|
|
6370
|
+
var c2 = e2.replace(xe, ""), l2 = compile(s2 || r2 ? "".concat(s2, " ").concat(r2, " { ").concat(c2, " }") : c2);
|
|
9158
6371
|
i.namespace && (l2 = Ve(l2, i.namespace));
|
|
9159
6372
|
var p2 = [];
|
|
9160
6373
|
return serialize(l2, middleware(u.concat(rulesheet(function(e3) {
|
|
9161
6374
|
return p2.push(e3);
|
|
9162
6375
|
})))), p2;
|
|
9163
6376
|
};
|
|
9164
|
-
return p.hash =
|
|
6377
|
+
return p.hash = c.length ? c.reduce(function(e2, t2) {
|
|
9165
6378
|
return t2.name || he(15), z(e2, t2.name);
|
|
9166
6379
|
}, F).toString() : "", p;
|
|
9167
6380
|
}
|
|
@@ -9199,9 +6412,9 @@ var Ue = function(e) {
|
|
|
9199
6412
|
return e == null || e === !1 || e === "";
|
|
9200
6413
|
}, Je = function(t) {
|
|
9201
6414
|
var n, o2, r = [];
|
|
9202
|
-
for (var
|
|
9203
|
-
var i = t[
|
|
9204
|
-
t.hasOwnProperty(
|
|
6415
|
+
for (var s in t) {
|
|
6416
|
+
var i = t[s];
|
|
6417
|
+
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")), ";")));
|
|
9205
6418
|
}
|
|
9206
6419
|
return r;
|
|
9207
6420
|
};
|
|
@@ -9209,11 +6422,11 @@ function Xe(e, t, n, o2) {
|
|
|
9209
6422
|
if (Ue(e)) return [];
|
|
9210
6423
|
if (se(e)) return [".".concat(e.styledComponentId)];
|
|
9211
6424
|
if (re(e)) {
|
|
9212
|
-
if (!re(
|
|
6425
|
+
if (!re(s = e) || s.prototype && s.prototype.isReactComponent || !t) return [e];
|
|
9213
6426
|
var r = e(t);
|
|
9214
6427
|
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);
|
|
9215
6428
|
}
|
|
9216
|
-
var
|
|
6429
|
+
var s;
|
|
9217
6430
|
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) {
|
|
9218
6431
|
return Xe(e2, t, n, o2);
|
|
9219
6432
|
})) : [e.toString()];
|
|
@@ -9233,32 +6446,32 @@ var Ke = M(v), Qe = (function() {
|
|
|
9233
6446
|
var o2 = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e2, t, n) : "";
|
|
9234
6447
|
if (this.isStatic && !n.hash) if (this.staticRulesId && t.hasNameForId(this.componentId, this.staticRulesId)) o2 = ie(o2, this.staticRulesId);
|
|
9235
6448
|
else {
|
|
9236
|
-
var r = ae(Xe(this.rules, e2, t, n)),
|
|
9237
|
-
if (!t.hasNameForId(this.componentId,
|
|
9238
|
-
var i = n(r, ".".concat(
|
|
9239
|
-
t.insertRules(this.componentId,
|
|
6449
|
+
var r = ae(Xe(this.rules, e2, t, n)), s = x(z(this.baseHash, r) >>> 0);
|
|
6450
|
+
if (!t.hasNameForId(this.componentId, s)) {
|
|
6451
|
+
var i = n(r, ".".concat(s), void 0, this.componentId);
|
|
6452
|
+
t.insertRules(this.componentId, s, i);
|
|
9240
6453
|
}
|
|
9241
|
-
o2 = ie(o2,
|
|
6454
|
+
o2 = ie(o2, s), this.staticRulesId = s;
|
|
9242
6455
|
}
|
|
9243
6456
|
else {
|
|
9244
|
-
for (var a = z(this.baseHash, n.hash),
|
|
6457
|
+
for (var a = z(this.baseHash, n.hash), c = "", l = 0; l < this.rules.length; l++) {
|
|
9245
6458
|
var u = this.rules[l];
|
|
9246
|
-
if (typeof u == "string")
|
|
6459
|
+
if (typeof u == "string") c += u, process.env.NODE_ENV !== "production" && (a = z(a, u));
|
|
9247
6460
|
else if (u) {
|
|
9248
6461
|
var p = ae(Xe(u, e2, t, n));
|
|
9249
|
-
a = z(a, p + l),
|
|
6462
|
+
a = z(a, p + l), c += p;
|
|
9250
6463
|
}
|
|
9251
6464
|
}
|
|
9252
|
-
if (
|
|
6465
|
+
if (c) {
|
|
9253
6466
|
var d = x(a >>> 0);
|
|
9254
|
-
t.hasNameForId(this.componentId, d) || t.insertRules(this.componentId, d, n(
|
|
6467
|
+
t.hasNameForId(this.componentId, d) || t.insertRules(this.componentId, d, n(c, ".".concat(d), void 0, this.componentId)), o2 = ie(o2, d);
|
|
9255
6468
|
}
|
|
9256
6469
|
}
|
|
9257
6470
|
return o2;
|
|
9258
6471
|
}, e;
|
|
9259
6472
|
})(), et = o.createContext(void 0), rt = {}, st = /* @__PURE__ */ new Set();
|
|
9260
|
-
function it(e, r,
|
|
9261
|
-
var i = se(e), a = e,
|
|
6473
|
+
function it(e, r, s) {
|
|
6474
|
+
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) {
|
|
9262
6475
|
var n = typeof e2 != "string" ? "sc" : R(e2);
|
|
9263
6476
|
rt[n] = (rt[n] || 0) + 1;
|
|
9264
6477
|
var o2 = "".concat(n, "-").concat($(v + n + rt[n]));
|
|
@@ -9275,17 +6488,17 @@ function it(e, r, s2) {
|
|
|
9275
6488
|
};
|
|
9276
6489
|
} else w2 = b;
|
|
9277
6490
|
}
|
|
9278
|
-
var N2 = new Qe(
|
|
6491
|
+
var N2 = new Qe(s, g2, i ? a.componentStyle : void 0);
|
|
9279
6492
|
function O2(e2, r2) {
|
|
9280
|
-
return (function(e3, r3,
|
|
9281
|
-
var i2 = e3.attrs, a2 = e3.componentStyle,
|
|
6493
|
+
return (function(e3, r3, s2) {
|
|
6494
|
+
var i2 = e3.attrs, a2 = e3.componentStyle, c2 = e3.defaultProps, p2 = e3.foldedComponentIds, d2 = e3.styledComponentId, h2 = e3.target, f3 = o.useContext(et), m3 = Le(), y3 = e3.shouldForwardProp || m3.shouldForwardProp;
|
|
9282
6495
|
process.env.NODE_ENV !== "production" && useDebugValue(d2);
|
|
9283
|
-
var v2 = I(r3, f3,
|
|
9284
|
-
for (var r4,
|
|
9285
|
-
var a3 = re(r4 = e4[i3]) ? r4(
|
|
9286
|
-
for (var
|
|
6496
|
+
var v2 = I(r3, f3, c2) || C, g3 = (function(e4, n, o2) {
|
|
6497
|
+
for (var r4, s3 = __assign(__assign({}, n), { className: void 0, theme: o2 }), i3 = 0; i3 < e4.length; i3 += 1) {
|
|
6498
|
+
var a3 = re(r4 = e4[i3]) ? r4(s3) : r4;
|
|
6499
|
+
for (var c3 in a3) s3[c3] = c3 === "className" ? ie(s3[c3], a3[c3]) : c3 === "style" ? __assign(__assign({}, s3[c3]), a3[c3]) : a3[c3];
|
|
9287
6500
|
}
|
|
9288
|
-
return n.className && (
|
|
6501
|
+
return n.className && (s3.className = ie(s3.className, n.className)), s3;
|
|
9289
6502
|
})(i2, r3, v2), S3 = g3.as || h2, w3 = {};
|
|
9290
6503
|
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.)')))));
|
|
9291
6504
|
var E3 = (function(e4, t) {
|
|
@@ -9294,7 +6507,7 @@ function it(e, r, s2) {
|
|
|
9294
6507
|
})(a2, g3);
|
|
9295
6508
|
process.env.NODE_ENV !== "production" && e3.warnTooManyClasses && e3.warnTooManyClasses(E3);
|
|
9296
6509
|
var N3 = ie(p2, d2);
|
|
9297
|
-
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[G(S3) && !A.has(S3) ? "class" : "className"] = N3,
|
|
6510
|
+
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[G(S3) && !A.has(S3) ? "class" : "className"] = N3, s2 && (w3.ref = s2), createElement(S3, w3);
|
|
9298
6511
|
})(D2, e2, r2);
|
|
9299
6512
|
}
|
|
9300
6513
|
O2.displayName = y2;
|
|
@@ -9311,8 +6524,8 @@ function it(e, r, s2) {
|
|
|
9311
6524
|
var n = {}, o2 = !1;
|
|
9312
6525
|
return function(r2) {
|
|
9313
6526
|
if (!o2 && (n[r2] = !0, Object.keys(n).length >= 200)) {
|
|
9314
|
-
var
|
|
9315
|
-
console.warn("Over ".concat(200, " classes were generated for component ").concat(e2).concat(
|
|
6527
|
+
var s2 = t ? ' with the id of "'.concat(t, '"') : "";
|
|
6528
|
+
console.warn("Over ".concat(200, " classes were generated for component ").concat(e2).concat(s2, `.
|
|
9316
6529
|
`) + `Consider using the attrs method, together with a style object for frequently changed styles.
|
|
9317
6530
|
Example:
|
|
9318
6531
|
const Component = styled.div.attrs(props => ({
|
|
@@ -9326,7 +6539,7 @@ Example:
|
|
|
9326
6539
|
};
|
|
9327
6540
|
})(y2, g2)), ue(D2, function() {
|
|
9328
6541
|
return ".".concat(D2.styledComponentId);
|
|
9329
|
-
}),
|
|
6542
|
+
}), c && oe(D2, e, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), D2;
|
|
9330
6543
|
}
|
|
9331
6544
|
function at(e, t) {
|
|
9332
6545
|
for (var n = [e[0]], o2 = 0, r = t.length; o2 < r; o2 += 1) n.push(t[o2], e[o2 + 1]);
|
|
@@ -9343,15 +6556,15 @@ function lt(t) {
|
|
|
9343
6556
|
}
|
|
9344
6557
|
function ut(n, o2, r) {
|
|
9345
6558
|
if (r === void 0 && (r = C), !o2) throw he(1, o2);
|
|
9346
|
-
var
|
|
9347
|
-
for (var
|
|
9348
|
-
return n(o2, r, lt.apply(void 0, __spreadArray([t],
|
|
6559
|
+
var s = function(t) {
|
|
6560
|
+
for (var s2 = [], i = 1; i < arguments.length; i++) s2[i - 1] = arguments[i];
|
|
6561
|
+
return n(o2, r, lt.apply(void 0, __spreadArray([t], s2, !1)));
|
|
9349
6562
|
};
|
|
9350
|
-
return
|
|
6563
|
+
return s.attrs = function(e) {
|
|
9351
6564
|
return ut(n, o2, __assign(__assign({}, r), { attrs: Array.prototype.concat(r.attrs, e).filter(Boolean) }));
|
|
9352
|
-
},
|
|
6565
|
+
}, s.withConfig = function(e) {
|
|
9353
6566
|
return ut(n, o2, __assign(__assign({}, r), e));
|
|
9354
|
-
},
|
|
6567
|
+
}, s;
|
|
9355
6568
|
}
|
|
9356
6569
|
var pt = function(e) {
|
|
9357
6570
|
return ut(it, e);
|