@hellpig/anarchy-shared 1.4.5 → 1.5.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/dist/Constants/CssUnits.d.ts +7 -0
  3. package/dist/Constants/FallBackFonts.d.ts +1 -0
  4. package/dist/Constants/FileSizes.d.ts +11 -0
  5. package/dist/Constants/Json.d.ts +15 -0
  6. package/dist/Constants/index.d.ts +4 -0
  7. package/dist/Constants/index.es.js +6 -0
  8. package/dist/Constants/index.es.js.map +1 -0
  9. package/dist/Models/TBrowserInfo.d.ts +2 -0
  10. package/dist/Models/TDeferredPromise.d.ts +5 -0
  11. package/dist/Models/index.d.ts +2 -0
  12. package/dist/Models/index.es.js +2 -0
  13. package/dist/Models/index.es.js.map +1 -0
  14. package/dist/Plugins/EmitDefineVitePlugin.d.ts +7 -0
  15. package/dist/Plugins/index.d.ts +1 -0
  16. package/dist/Plugins/index.es.js +17 -0
  17. package/dist/Plugins/index.es.js.map +1 -0
  18. package/dist/Utils/ArrayUtils.d.ts +8 -0
  19. package/dist/Utils/AsyncUtils.d.ts +2 -0
  20. package/dist/Utils/CheckUtils.d.ts +6 -0
  21. package/dist/Utils/CssUtils.d.ts +5 -0
  22. package/dist/Utils/DetectUtils.d.ts +2 -0
  23. package/dist/Utils/EnvSchemaUtils.d.ts +2 -0
  24. package/dist/Utils/FileUtils.d.ts +3 -0
  25. package/dist/Utils/MapUtils.d.ts +3 -0
  26. package/dist/Utils/MathUtils.d.ts +1 -0
  27. package/dist/Utils/ObjectUtils.d.ts +9 -0
  28. package/dist/Utils/RxJsUtils.d.ts +2 -0
  29. package/dist/Utils/SanitizeUtils.d.ts +4 -0
  30. package/dist/Utils/StringUtils.d.ts +2 -0
  31. package/dist/Utils/TrackingUtils.d.ts +4 -0
  32. package/dist/Utils/TypesUtils.d.ts +28 -0
  33. package/dist/Utils/UrlUtils.d.ts +2 -0
  34. package/dist/Utils/WebGlUtils.d.ts +2 -0
  35. package/dist/Utils/index.d.ts +17 -0
  36. package/dist/Utils/index.es.js +3736 -0
  37. package/dist/Utils/index.es.js.map +1 -0
  38. package/dist/assets/_constants.scss +18 -0
  39. package/dist/assets/_utils.scss +6 -0
  40. package/dist/chunks/Json.js +57 -0
  41. package/dist/chunks/Json.js.map +1 -0
  42. package/legal/NOTICE.md +1 -1
  43. package/legal/THIRD_PARTY_LICENSES.md +1 -1
  44. package/package.json +31 -5
@@ -0,0 +1,3736 @@
1
+ import { C as CssUnits, F as FileSizes, D as DefaultBannedInJsonKeys, a as JsonSpecialCharactersUnicode, J as JsonSpecialCharactersAscii } from '../chunks/Json.js';
2
+ import Bowser from 'bowser';
3
+
4
+ function omitInArray(array, item) {
5
+ return array.filter((arrayItem) => arrayItem !== item);
6
+ }
7
+ function forEachEnum(enumType, callback) {
8
+ Object.keys(enumType).forEach((key, index) => callback(enumType[key], key, index));
9
+ }
10
+ function removeDuplicates(array) {
11
+ const uniqueMap = /* @__PURE__ */ new Map();
12
+ for (const item of array) {
13
+ uniqueMap.set(item.id, item);
14
+ }
15
+ return Array.from(uniqueMap.values());
16
+ }
17
+ const removeDuplicatesStr = (arr) => Array.from(new Set(arr));
18
+ function asRecord(key, list) {
19
+ return list.reduce(
20
+ (acc, item) => {
21
+ acc[item[key]] = item;
22
+ return acc;
23
+ },
24
+ {}
25
+ );
26
+ }
27
+ function findDuplicateString(arr) {
28
+ const seen = /* @__PURE__ */ new Set();
29
+ for (const str of arr) {
30
+ if (seen.has(str)) return str;
31
+ seen.add(str);
32
+ }
33
+ return void 0;
34
+ }
35
+
36
+ function createDeferredPromise() {
37
+ let resolve;
38
+ let reject;
39
+ const promise = new Promise((res, rej) => {
40
+ resolve = res;
41
+ reject = rej;
42
+ });
43
+ return {
44
+ resolve,
45
+ reject,
46
+ promise
47
+ };
48
+ }
49
+
50
+ const isDefined = (value) => value !== void 0 && value !== null;
51
+ const isAllDefined = (values) => !values.some(isNotDefined);
52
+ const isNotDefined = (value) => !isDefined(value);
53
+ const isAllNotDefined = (values) => values.every(isNotDefined);
54
+ const isString = (value) => typeof value === "string";
55
+ const isBoolean = (value) => typeof value === "boolean";
56
+
57
+ function getBaseTextSize() {
58
+ return parseFloat(getComputedStyle(document.documentElement).fontSize);
59
+ }
60
+ function toPx(value) {
61
+ const defaultBaseTextSize = 16;
62
+ const baseTextSize = getBaseTextSize() || defaultBaseTextSize;
63
+ if (isNotDefined(value)) return `${baseTextSize}px`;
64
+ if (typeof value === "number") return `${value}px`;
65
+ return getSizeInPx(value);
66
+ }
67
+ function toRem(value) {
68
+ const defaultBaseTextSize = 16;
69
+ const baseTextSize = getBaseTextSize() || defaultBaseTextSize;
70
+ if (isNotDefined(value)) return `${baseTextSize / 16}rem`;
71
+ if (typeof value === "number") return `${value / baseTextSize}rem`;
72
+ return getSizeInRem(value);
73
+ }
74
+ const stripUnits = (value) => parseFloat(value);
75
+ function getSizeInPx(size) {
76
+ const units = getUnitsFromCssValue(size);
77
+ const value = stripUnits(size);
78
+ switch (units) {
79
+ case CssUnits.Px:
80
+ return `${value}px`;
81
+ case CssUnits.Em:
82
+ return `${value * getBaseTextSize()}px`;
83
+ case CssUnits.Rem:
84
+ return `${value * getBaseTextSize()}px`;
85
+ case CssUnits.Percent:
86
+ return `${value * getBaseTextSize() / 100}px`;
87
+ case CssUnits.Pt:
88
+ return `${value * 4 / 3}px`;
89
+ // 1pt = 1.3333px
90
+ default:
91
+ return size;
92
+ }
93
+ }
94
+ function getSizeInRem(size) {
95
+ const units = getUnitsFromCssValue(size);
96
+ const value = stripUnits(size);
97
+ switch (units) {
98
+ case CssUnits.Px:
99
+ return `${value / getBaseTextSize()}rem`;
100
+ case CssUnits.Em:
101
+ return `${value}rem`;
102
+ // Em is relative to the font size of the element, so it remains the same
103
+ case CssUnits.Rem:
104
+ return `${value}rem`;
105
+ case CssUnits.Percent:
106
+ return `${value / 100 * (getBaseTextSize() / 16)}rem`;
107
+ case CssUnits.Pt:
108
+ return `${value * 4 / (3 * getBaseTextSize())}rem`;
109
+ // 1pt = 1.3333px
110
+ default:
111
+ return size;
112
+ }
113
+ }
114
+ function getUnitsFromCssValue(value) {
115
+ const match = value.match(/([a-zA-Z%]+)$/);
116
+ return match ? match[1] : "";
117
+ }
118
+
119
+ const getBrowserInfo = () => Bowser.parse(window.navigator.userAgent);
120
+
121
+ //#region src/storages/globalConfig/globalConfig.ts
122
+ let store$4;
123
+ /**
124
+ * Returns the global configuration.
125
+ *
126
+ * @param config The config to merge.
127
+ *
128
+ * @returns The configuration.
129
+ */
130
+ /* @__NO_SIDE_EFFECTS__ */
131
+ function getGlobalConfig(config$1) {
132
+ return {
133
+ lang: config$1?.lang ?? store$4?.lang,
134
+ message: config$1?.message,
135
+ abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
136
+ abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
137
+ };
138
+ }
139
+
140
+ //#endregion
141
+ //#region src/storages/globalMessage/globalMessage.ts
142
+ let store$3;
143
+ /**
144
+ * Returns a global error message.
145
+ *
146
+ * @param lang The language of the message.
147
+ *
148
+ * @returns The error message.
149
+ */
150
+ /* @__NO_SIDE_EFFECTS__ */
151
+ function getGlobalMessage(lang) {
152
+ return store$3?.get(lang);
153
+ }
154
+
155
+ //#endregion
156
+ //#region src/storages/schemaMessage/schemaMessage.ts
157
+ let store$2;
158
+ /**
159
+ * Returns a schema error message.
160
+ *
161
+ * @param lang The language of the message.
162
+ *
163
+ * @returns The error message.
164
+ */
165
+ /* @__NO_SIDE_EFFECTS__ */
166
+ function getSchemaMessage(lang) {
167
+ return store$2?.get(lang);
168
+ }
169
+
170
+ //#endregion
171
+ //#region src/storages/specificMessage/specificMessage.ts
172
+ let store$1;
173
+ /**
174
+ * Returns a specific error message.
175
+ *
176
+ * @param reference The identifier reference.
177
+ * @param lang The language of the message.
178
+ *
179
+ * @returns The error message.
180
+ */
181
+ /* @__NO_SIDE_EFFECTS__ */
182
+ function getSpecificMessage(reference, lang) {
183
+ return store$1?.get(reference)?.get(lang);
184
+ }
185
+
186
+ //#endregion
187
+ //#region src/utils/_stringify/_stringify.ts
188
+ /**
189
+ * Stringifies an unknown input to a literal or type string.
190
+ *
191
+ * @param input The unknown input.
192
+ *
193
+ * @returns A literal or type string.
194
+ *
195
+ * @internal
196
+ */
197
+ /* @__NO_SIDE_EFFECTS__ */
198
+ function _stringify(input) {
199
+ const type = typeof input;
200
+ if (type === "string") return `"${input}"`;
201
+ if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
202
+ if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
203
+ return type;
204
+ }
205
+
206
+ //#endregion
207
+ //#region src/utils/_addIssue/_addIssue.ts
208
+ /**
209
+ * Adds an issue to the dataset.
210
+ *
211
+ * @param context The issue context.
212
+ * @param label The issue label.
213
+ * @param dataset The input dataset.
214
+ * @param config The configuration.
215
+ * @param other The optional props.
216
+ *
217
+ * @internal
218
+ */
219
+ function _addIssue(context, label, dataset, config$1, other) {
220
+ const input = dataset.value;
221
+ const expected = context.expects ?? null;
222
+ const received = /* @__PURE__ */ _stringify(input);
223
+ const issue = {
224
+ kind: context.kind,
225
+ type: context.type,
226
+ input,
227
+ expected,
228
+ received,
229
+ message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
230
+ requirement: context.requirement,
231
+ path: other?.path,
232
+ issues: other?.issues,
233
+ lang: config$1.lang,
234
+ abortEarly: config$1.abortEarly,
235
+ abortPipeEarly: config$1.abortPipeEarly
236
+ };
237
+ const isSchema = context.kind === "schema";
238
+ const message$1 = context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
239
+ if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
240
+ if (isSchema) dataset.typed = false;
241
+ if (dataset.issues) dataset.issues.push(issue);
242
+ else dataset.issues = [issue];
243
+ }
244
+
245
+ //#endregion
246
+ //#region src/utils/_getStandardProps/_getStandardProps.ts
247
+ /**
248
+ * Returns the Standard Schema properties.
249
+ *
250
+ * @param context The schema context.
251
+ *
252
+ * @returns The Standard Schema properties.
253
+ */
254
+ /* @__NO_SIDE_EFFECTS__ */
255
+ function _getStandardProps(context) {
256
+ return {
257
+ version: 1,
258
+ vendor: "valibot",
259
+ validate(value$1) {
260
+ return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
261
+ }
262
+ };
263
+ }
264
+
265
+ //#endregion
266
+ //#region src/actions/transform/transform.ts
267
+ /**
268
+ * Creates a custom transformation action.
269
+ *
270
+ * @param operation The transformation operation.
271
+ *
272
+ * @returns A transform action.
273
+ */
274
+ /* @__NO_SIDE_EFFECTS__ */
275
+ function transform(operation) {
276
+ return {
277
+ kind: "transformation",
278
+ type: "transform",
279
+ reference: transform,
280
+ async: false,
281
+ operation,
282
+ "~run"(dataset) {
283
+ dataset.value = this.operation(dataset.value);
284
+ return dataset;
285
+ }
286
+ };
287
+ }
288
+
289
+ //#endregion
290
+ //#region src/schemas/string/string.ts
291
+ /* @__NO_SIDE_EFFECTS__ */
292
+ function string(message$1) {
293
+ return {
294
+ kind: "schema",
295
+ type: "string",
296
+ reference: string,
297
+ expects: "string",
298
+ async: false,
299
+ message: message$1,
300
+ get "~standard"() {
301
+ return /* @__PURE__ */ _getStandardProps(this);
302
+ },
303
+ "~run"(dataset, config$1) {
304
+ if (typeof dataset.value === "string") dataset.typed = true;
305
+ else _addIssue(this, "type", dataset, config$1);
306
+ return dataset;
307
+ }
308
+ };
309
+ }
310
+
311
+ //#endregion
312
+ //#region src/methods/pipe/pipe.ts
313
+ /* @__NO_SIDE_EFFECTS__ */
314
+ function pipe(...pipe$1) {
315
+ return {
316
+ ...pipe$1[0],
317
+ pipe: pipe$1,
318
+ get "~standard"() {
319
+ return /* @__PURE__ */ _getStandardProps(this);
320
+ },
321
+ "~run"(dataset, config$1) {
322
+ for (const item of pipe$1) if (item.kind !== "metadata") {
323
+ if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
324
+ dataset.typed = false;
325
+ break;
326
+ }
327
+ if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
328
+ }
329
+ return dataset;
330
+ }
331
+ };
332
+ }
333
+
334
+ const toBool = pipe(
335
+ string(),
336
+ transform((v) => v === "true")
337
+ );
338
+ const toInt = pipe(
339
+ string(),
340
+ transform((v) => parseInt(v, 10))
341
+ );
342
+
343
+ function getHumanReadableMemorySize(bytes, decimals = 2) {
344
+ if (!+bytes) return "0 Bytes";
345
+ const k = 1024;
346
+ const dm = decimals < 0 ? 0 : decimals;
347
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
348
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${Object.values(FileSizes)[i]}`;
349
+ }
350
+ function getFileExtension(name) {
351
+ const extension = /^.+\.([^.]+)$/.exec(name);
352
+ return isDefined(extension) ? extension[1] : void 0;
353
+ }
354
+ const toPosix = (s) => s.replace(/\\/g, "/");
355
+
356
+ function findInMap(map, cb) {
357
+ for (const [key, value] of map) {
358
+ if (cb(value, key)) return map.get(key);
359
+ }
360
+ return void 0;
361
+ }
362
+ function findKeyInMap(map, cb) {
363
+ for (const [key, value] of map) {
364
+ if (cb(value, key)) return key;
365
+ }
366
+ return void 0;
367
+ }
368
+ function findKeyWithValue(map, value) {
369
+ for (const [key, val] of map.entries()) if (val === value) return key;
370
+ return void 0;
371
+ }
372
+
373
+ function clamp(val, minimum, maximum) {
374
+ const min = Math.min(minimum, maximum);
375
+ const max = Math.max(minimum, maximum);
376
+ return Math.max(min, Math.min(max, val));
377
+ }
378
+
379
+ /** Detect free variable `global` from Node.js. */
380
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
381
+
382
+ /** Detect free variable `self`. */
383
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
384
+
385
+ /** Used as a reference to the global object. */
386
+ var root = freeGlobal || freeSelf || Function('return this')();
387
+
388
+ /** Built-in value references. */
389
+ var Symbol$1 = root.Symbol;
390
+
391
+ /** Used for built-in method references. */
392
+ var objectProto$c = Object.prototype;
393
+
394
+ /** Used to check objects for own properties. */
395
+ var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
396
+
397
+ /**
398
+ * Used to resolve the
399
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
400
+ * of values.
401
+ */
402
+ var nativeObjectToString$1 = objectProto$c.toString;
403
+
404
+ /** Built-in value references. */
405
+ var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
406
+
407
+ /**
408
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
409
+ *
410
+ * @private
411
+ * @param {*} value The value to query.
412
+ * @returns {string} Returns the raw `toStringTag`.
413
+ */
414
+ function getRawTag(value) {
415
+ var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
416
+ tag = value[symToStringTag$1];
417
+
418
+ try {
419
+ value[symToStringTag$1] = undefined;
420
+ var unmasked = true;
421
+ } catch (e) {}
422
+
423
+ var result = nativeObjectToString$1.call(value);
424
+ if (unmasked) {
425
+ if (isOwn) {
426
+ value[symToStringTag$1] = tag;
427
+ } else {
428
+ delete value[symToStringTag$1];
429
+ }
430
+ }
431
+ return result;
432
+ }
433
+
434
+ /** Used for built-in method references. */
435
+ var objectProto$b = Object.prototype;
436
+
437
+ /**
438
+ * Used to resolve the
439
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
440
+ * of values.
441
+ */
442
+ var nativeObjectToString = objectProto$b.toString;
443
+
444
+ /**
445
+ * Converts `value` to a string using `Object.prototype.toString`.
446
+ *
447
+ * @private
448
+ * @param {*} value The value to convert.
449
+ * @returns {string} Returns the converted string.
450
+ */
451
+ function objectToString(value) {
452
+ return nativeObjectToString.call(value);
453
+ }
454
+
455
+ /** `Object#toString` result references. */
456
+ var nullTag = '[object Null]',
457
+ undefinedTag = '[object Undefined]';
458
+
459
+ /** Built-in value references. */
460
+ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
461
+
462
+ /**
463
+ * The base implementation of `getTag` without fallbacks for buggy environments.
464
+ *
465
+ * @private
466
+ * @param {*} value The value to query.
467
+ * @returns {string} Returns the `toStringTag`.
468
+ */
469
+ function baseGetTag(value) {
470
+ if (value == null) {
471
+ return value === undefined ? undefinedTag : nullTag;
472
+ }
473
+ return (symToStringTag && symToStringTag in Object(value))
474
+ ? getRawTag(value)
475
+ : objectToString(value);
476
+ }
477
+
478
+ /**
479
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
480
+ * and has a `typeof` result of "object".
481
+ *
482
+ * @static
483
+ * @memberOf _
484
+ * @since 4.0.0
485
+ * @category Lang
486
+ * @param {*} value The value to check.
487
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
488
+ * @example
489
+ *
490
+ * _.isObjectLike({});
491
+ * // => true
492
+ *
493
+ * _.isObjectLike([1, 2, 3]);
494
+ * // => true
495
+ *
496
+ * _.isObjectLike(_.noop);
497
+ * // => false
498
+ *
499
+ * _.isObjectLike(null);
500
+ * // => false
501
+ */
502
+ function isObjectLike(value) {
503
+ return value != null && typeof value == 'object';
504
+ }
505
+
506
+ /**
507
+ * Checks if `value` is classified as an `Array` object.
508
+ *
509
+ * @static
510
+ * @memberOf _
511
+ * @since 0.1.0
512
+ * @category Lang
513
+ * @param {*} value The value to check.
514
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
515
+ * @example
516
+ *
517
+ * _.isArray([1, 2, 3]);
518
+ * // => true
519
+ *
520
+ * _.isArray(document.body.children);
521
+ * // => false
522
+ *
523
+ * _.isArray('abc');
524
+ * // => false
525
+ *
526
+ * _.isArray(_.noop);
527
+ * // => false
528
+ */
529
+ var isArray = Array.isArray;
530
+
531
+ /**
532
+ * Checks if `value` is the
533
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
534
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
535
+ *
536
+ * @static
537
+ * @memberOf _
538
+ * @since 0.1.0
539
+ * @category Lang
540
+ * @param {*} value The value to check.
541
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
542
+ * @example
543
+ *
544
+ * _.isObject({});
545
+ * // => true
546
+ *
547
+ * _.isObject([1, 2, 3]);
548
+ * // => true
549
+ *
550
+ * _.isObject(_.noop);
551
+ * // => true
552
+ *
553
+ * _.isObject(null);
554
+ * // => false
555
+ */
556
+ function isObject$1(value) {
557
+ var type = typeof value;
558
+ return value != null && (type == 'object' || type == 'function');
559
+ }
560
+
561
+ /** `Object#toString` result references. */
562
+ var asyncTag = '[object AsyncFunction]',
563
+ funcTag$2 = '[object Function]',
564
+ genTag$1 = '[object GeneratorFunction]',
565
+ proxyTag = '[object Proxy]';
566
+
567
+ /**
568
+ * Checks if `value` is classified as a `Function` object.
569
+ *
570
+ * @static
571
+ * @memberOf _
572
+ * @since 0.1.0
573
+ * @category Lang
574
+ * @param {*} value The value to check.
575
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
576
+ * @example
577
+ *
578
+ * _.isFunction(_);
579
+ * // => true
580
+ *
581
+ * _.isFunction(/abc/);
582
+ * // => false
583
+ */
584
+ function isFunction$1(value) {
585
+ if (!isObject$1(value)) {
586
+ return false;
587
+ }
588
+ // The use of `Object#toString` avoids issues with the `typeof` operator
589
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
590
+ var tag = baseGetTag(value);
591
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
592
+ }
593
+
594
+ /** Used to detect overreaching core-js shims. */
595
+ var coreJsData = root['__core-js_shared__'];
596
+
597
+ /** Used to detect methods masquerading as native. */
598
+ var maskSrcKey = (function() {
599
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
600
+ return uid ? ('Symbol(src)_1.' + uid) : '';
601
+ }());
602
+
603
+ /**
604
+ * Checks if `func` has its source masked.
605
+ *
606
+ * @private
607
+ * @param {Function} func The function to check.
608
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
609
+ */
610
+ function isMasked(func) {
611
+ return !!maskSrcKey && (maskSrcKey in func);
612
+ }
613
+
614
+ /** Used for built-in method references. */
615
+ var funcProto$2 = Function.prototype;
616
+
617
+ /** Used to resolve the decompiled source of functions. */
618
+ var funcToString$2 = funcProto$2.toString;
619
+
620
+ /**
621
+ * Converts `func` to its source code.
622
+ *
623
+ * @private
624
+ * @param {Function} func The function to convert.
625
+ * @returns {string} Returns the source code.
626
+ */
627
+ function toSource(func) {
628
+ if (func != null) {
629
+ try {
630
+ return funcToString$2.call(func);
631
+ } catch (e) {}
632
+ try {
633
+ return (func + '');
634
+ } catch (e) {}
635
+ }
636
+ return '';
637
+ }
638
+
639
+ /**
640
+ * Used to match `RegExp`
641
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
642
+ */
643
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
644
+
645
+ /** Used to detect host constructors (Safari). */
646
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
647
+
648
+ /** Used for built-in method references. */
649
+ var funcProto$1 = Function.prototype,
650
+ objectProto$a = Object.prototype;
651
+
652
+ /** Used to resolve the decompiled source of functions. */
653
+ var funcToString$1 = funcProto$1.toString;
654
+
655
+ /** Used to check objects for own properties. */
656
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
657
+
658
+ /** Used to detect if a method is native. */
659
+ var reIsNative = RegExp('^' +
660
+ funcToString$1.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
661
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
662
+ );
663
+
664
+ /**
665
+ * The base implementation of `_.isNative` without bad shim checks.
666
+ *
667
+ * @private
668
+ * @param {*} value The value to check.
669
+ * @returns {boolean} Returns `true` if `value` is a native function,
670
+ * else `false`.
671
+ */
672
+ function baseIsNative(value) {
673
+ if (!isObject$1(value) || isMasked(value)) {
674
+ return false;
675
+ }
676
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
677
+ return pattern.test(toSource(value));
678
+ }
679
+
680
+ /**
681
+ * Gets the value at `key` of `object`.
682
+ *
683
+ * @private
684
+ * @param {Object} [object] The object to query.
685
+ * @param {string} key The key of the property to get.
686
+ * @returns {*} Returns the property value.
687
+ */
688
+ function getValue(object, key) {
689
+ return object == null ? undefined : object[key];
690
+ }
691
+
692
+ /**
693
+ * Gets the native function at `key` of `object`.
694
+ *
695
+ * @private
696
+ * @param {Object} object The object to query.
697
+ * @param {string} key The key of the method to get.
698
+ * @returns {*} Returns the function if it's native, else `undefined`.
699
+ */
700
+ function getNative(object, key) {
701
+ var value = getValue(object, key);
702
+ return baseIsNative(value) ? value : undefined;
703
+ }
704
+
705
+ /* Built-in method references that are verified to be native. */
706
+ var WeakMap = getNative(root, 'WeakMap');
707
+
708
+ /** Built-in value references. */
709
+ var objectCreate = Object.create;
710
+
711
+ /**
712
+ * The base implementation of `_.create` without support for assigning
713
+ * properties to the created object.
714
+ *
715
+ * @private
716
+ * @param {Object} proto The object to inherit from.
717
+ * @returns {Object} Returns the new object.
718
+ */
719
+ var baseCreate = (function() {
720
+ function object() {}
721
+ return function(proto) {
722
+ if (!isObject$1(proto)) {
723
+ return {};
724
+ }
725
+ if (objectCreate) {
726
+ return objectCreate(proto);
727
+ }
728
+ object.prototype = proto;
729
+ var result = new object;
730
+ object.prototype = undefined;
731
+ return result;
732
+ };
733
+ }());
734
+
735
+ var defineProperty = (function() {
736
+ try {
737
+ var func = getNative(Object, 'defineProperty');
738
+ func({}, '', {});
739
+ return func;
740
+ } catch (e) {}
741
+ }());
742
+
743
+ /**
744
+ * A specialized version of `_.forEach` for arrays without support for
745
+ * iteratee shorthands.
746
+ *
747
+ * @private
748
+ * @param {Array} [array] The array to iterate over.
749
+ * @param {Function} iteratee The function invoked per iteration.
750
+ * @returns {Array} Returns `array`.
751
+ */
752
+ function arrayEach(array, iteratee) {
753
+ var index = -1,
754
+ length = array == null ? 0 : array.length;
755
+
756
+ while (++index < length) {
757
+ if (iteratee(array[index], index, array) === false) {
758
+ break;
759
+ }
760
+ }
761
+ return array;
762
+ }
763
+
764
+ /** Used as references for various `Number` constants. */
765
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
766
+
767
+ /** Used to detect unsigned integer values. */
768
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
769
+
770
+ /**
771
+ * Checks if `value` is a valid array-like index.
772
+ *
773
+ * @private
774
+ * @param {*} value The value to check.
775
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
776
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
777
+ */
778
+ function isIndex(value, length) {
779
+ var type = typeof value;
780
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
781
+
782
+ return !!length &&
783
+ (type == 'number' ||
784
+ (type != 'symbol' && reIsUint.test(value))) &&
785
+ (value > -1 && value % 1 == 0 && value < length);
786
+ }
787
+
788
+ /**
789
+ * The base implementation of `assignValue` and `assignMergeValue` without
790
+ * value checks.
791
+ *
792
+ * @private
793
+ * @param {Object} object The object to modify.
794
+ * @param {string} key The key of the property to assign.
795
+ * @param {*} value The value to assign.
796
+ */
797
+ function baseAssignValue(object, key, value) {
798
+ if (key == '__proto__' && defineProperty) {
799
+ defineProperty(object, key, {
800
+ 'configurable': true,
801
+ 'enumerable': true,
802
+ 'value': value,
803
+ 'writable': true
804
+ });
805
+ } else {
806
+ object[key] = value;
807
+ }
808
+ }
809
+
810
+ /**
811
+ * Performs a
812
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
813
+ * comparison between two values to determine if they are equivalent.
814
+ *
815
+ * @static
816
+ * @memberOf _
817
+ * @since 4.0.0
818
+ * @category Lang
819
+ * @param {*} value The value to compare.
820
+ * @param {*} other The other value to compare.
821
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
822
+ * @example
823
+ *
824
+ * var object = { 'a': 1 };
825
+ * var other = { 'a': 1 };
826
+ *
827
+ * _.eq(object, object);
828
+ * // => true
829
+ *
830
+ * _.eq(object, other);
831
+ * // => false
832
+ *
833
+ * _.eq('a', 'a');
834
+ * // => true
835
+ *
836
+ * _.eq('a', Object('a'));
837
+ * // => false
838
+ *
839
+ * _.eq(NaN, NaN);
840
+ * // => true
841
+ */
842
+ function eq(value, other) {
843
+ return value === other || (value !== value && other !== other);
844
+ }
845
+
846
+ /** Used for built-in method references. */
847
+ var objectProto$9 = Object.prototype;
848
+
849
+ /** Used to check objects for own properties. */
850
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
851
+
852
+ /**
853
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
854
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
855
+ * for equality comparisons.
856
+ *
857
+ * @private
858
+ * @param {Object} object The object to modify.
859
+ * @param {string} key The key of the property to assign.
860
+ * @param {*} value The value to assign.
861
+ */
862
+ function assignValue(object, key, value) {
863
+ var objValue = object[key];
864
+ if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) ||
865
+ (value === undefined && !(key in object))) {
866
+ baseAssignValue(object, key, value);
867
+ }
868
+ }
869
+
870
+ /** Used as references for various `Number` constants. */
871
+ var MAX_SAFE_INTEGER = 9007199254740991;
872
+
873
+ /**
874
+ * Checks if `value` is a valid array-like length.
875
+ *
876
+ * **Note:** This method is loosely based on
877
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
878
+ *
879
+ * @static
880
+ * @memberOf _
881
+ * @since 4.0.0
882
+ * @category Lang
883
+ * @param {*} value The value to check.
884
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
885
+ * @example
886
+ *
887
+ * _.isLength(3);
888
+ * // => true
889
+ *
890
+ * _.isLength(Number.MIN_VALUE);
891
+ * // => false
892
+ *
893
+ * _.isLength(Infinity);
894
+ * // => false
895
+ *
896
+ * _.isLength('3');
897
+ * // => false
898
+ */
899
+ function isLength(value) {
900
+ return typeof value == 'number' &&
901
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
902
+ }
903
+
904
+ /**
905
+ * Checks if `value` is array-like. A value is considered array-like if it's
906
+ * not a function and has a `value.length` that's an integer greater than or
907
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
908
+ *
909
+ * @static
910
+ * @memberOf _
911
+ * @since 4.0.0
912
+ * @category Lang
913
+ * @param {*} value The value to check.
914
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
915
+ * @example
916
+ *
917
+ * _.isArrayLike([1, 2, 3]);
918
+ * // => true
919
+ *
920
+ * _.isArrayLike(document.body.children);
921
+ * // => true
922
+ *
923
+ * _.isArrayLike('abc');
924
+ * // => true
925
+ *
926
+ * _.isArrayLike(_.noop);
927
+ * // => false
928
+ */
929
+ function isArrayLike$1(value) {
930
+ return value != null && isLength(value.length) && !isFunction$1(value);
931
+ }
932
+
933
+ /** Used for built-in method references. */
934
+ var objectProto$8 = Object.prototype;
935
+
936
+ /**
937
+ * Checks if `value` is likely a prototype object.
938
+ *
939
+ * @private
940
+ * @param {*} value The value to check.
941
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
942
+ */
943
+ function isPrototype(value) {
944
+ var Ctor = value && value.constructor,
945
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
946
+
947
+ return value === proto;
948
+ }
949
+
950
+ /**
951
+ * The base implementation of `_.times` without support for iteratee shorthands
952
+ * or max array length checks.
953
+ *
954
+ * @private
955
+ * @param {number} n The number of times to invoke `iteratee`.
956
+ * @param {Function} iteratee The function invoked per iteration.
957
+ * @returns {Array} Returns the array of results.
958
+ */
959
+ function baseTimes(n, iteratee) {
960
+ var index = -1,
961
+ result = Array(n);
962
+
963
+ while (++index < n) {
964
+ result[index] = iteratee(index);
965
+ }
966
+ return result;
967
+ }
968
+
969
+ /** `Object#toString` result references. */
970
+ var argsTag$2 = '[object Arguments]';
971
+
972
+ /**
973
+ * The base implementation of `_.isArguments`.
974
+ *
975
+ * @private
976
+ * @param {*} value The value to check.
977
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
978
+ */
979
+ function baseIsArguments(value) {
980
+ return isObjectLike(value) && baseGetTag(value) == argsTag$2;
981
+ }
982
+
983
+ /** Used for built-in method references. */
984
+ var objectProto$7 = Object.prototype;
985
+
986
+ /** Used to check objects for own properties. */
987
+ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
988
+
989
+ /** Built-in value references. */
990
+ var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
991
+
992
+ /**
993
+ * Checks if `value` is likely an `arguments` object.
994
+ *
995
+ * @static
996
+ * @memberOf _
997
+ * @since 0.1.0
998
+ * @category Lang
999
+ * @param {*} value The value to check.
1000
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1001
+ * else `false`.
1002
+ * @example
1003
+ *
1004
+ * _.isArguments(function() { return arguments; }());
1005
+ * // => true
1006
+ *
1007
+ * _.isArguments([1, 2, 3]);
1008
+ * // => false
1009
+ */
1010
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1011
+ return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') &&
1012
+ !propertyIsEnumerable$1.call(value, 'callee');
1013
+ };
1014
+
1015
+ /**
1016
+ * This method returns `false`.
1017
+ *
1018
+ * @static
1019
+ * @memberOf _
1020
+ * @since 4.13.0
1021
+ * @category Util
1022
+ * @returns {boolean} Returns `false`.
1023
+ * @example
1024
+ *
1025
+ * _.times(2, _.stubFalse);
1026
+ * // => [false, false]
1027
+ */
1028
+ function stubFalse() {
1029
+ return false;
1030
+ }
1031
+
1032
+ /** Detect free variable `exports`. */
1033
+ var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
1034
+
1035
+ /** Detect free variable `module`. */
1036
+ var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
1037
+
1038
+ /** Detect the popular CommonJS extension `module.exports`. */
1039
+ var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
1040
+
1041
+ /** Built-in value references. */
1042
+ var Buffer$2 = moduleExports$2 ? root.Buffer : undefined;
1043
+
1044
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1045
+ var nativeIsBuffer = Buffer$2 ? Buffer$2.isBuffer : undefined;
1046
+
1047
+ /**
1048
+ * Checks if `value` is a buffer.
1049
+ *
1050
+ * @static
1051
+ * @memberOf _
1052
+ * @since 4.3.0
1053
+ * @category Lang
1054
+ * @param {*} value The value to check.
1055
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1056
+ * @example
1057
+ *
1058
+ * _.isBuffer(new Buffer(2));
1059
+ * // => true
1060
+ *
1061
+ * _.isBuffer(new Uint8Array(2));
1062
+ * // => false
1063
+ */
1064
+ var isBuffer = nativeIsBuffer || stubFalse;
1065
+
1066
+ /** `Object#toString` result references. */
1067
+ var argsTag$1 = '[object Arguments]',
1068
+ arrayTag$1 = '[object Array]',
1069
+ boolTag$2 = '[object Boolean]',
1070
+ dateTag$2 = '[object Date]',
1071
+ errorTag$1 = '[object Error]',
1072
+ funcTag$1 = '[object Function]',
1073
+ mapTag$4 = '[object Map]',
1074
+ numberTag$2 = '[object Number]',
1075
+ objectTag$3 = '[object Object]',
1076
+ regexpTag$2 = '[object RegExp]',
1077
+ setTag$4 = '[object Set]',
1078
+ stringTag$2 = '[object String]',
1079
+ weakMapTag$2 = '[object WeakMap]';
1080
+
1081
+ var arrayBufferTag$2 = '[object ArrayBuffer]',
1082
+ dataViewTag$3 = '[object DataView]',
1083
+ float32Tag$2 = '[object Float32Array]',
1084
+ float64Tag$2 = '[object Float64Array]',
1085
+ int8Tag$2 = '[object Int8Array]',
1086
+ int16Tag$2 = '[object Int16Array]',
1087
+ int32Tag$2 = '[object Int32Array]',
1088
+ uint8Tag$2 = '[object Uint8Array]',
1089
+ uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1090
+ uint16Tag$2 = '[object Uint16Array]',
1091
+ uint32Tag$2 = '[object Uint32Array]';
1092
+
1093
+ /** Used to identify `toStringTag` values of typed arrays. */
1094
+ var typedArrayTags = {};
1095
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1096
+ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1097
+ typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1098
+ typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1099
+ typedArrayTags[uint32Tag$2] = true;
1100
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1101
+ typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1102
+ typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1103
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1104
+ typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
1105
+ typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$2] =
1106
+ typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
1107
+ typedArrayTags[weakMapTag$2] = false;
1108
+
1109
+ /**
1110
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1111
+ *
1112
+ * @private
1113
+ * @param {*} value The value to check.
1114
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1115
+ */
1116
+ function baseIsTypedArray(value) {
1117
+ return isObjectLike(value) &&
1118
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1119
+ }
1120
+
1121
+ /**
1122
+ * The base implementation of `_.unary` without support for storing metadata.
1123
+ *
1124
+ * @private
1125
+ * @param {Function} func The function to cap arguments for.
1126
+ * @returns {Function} Returns the new capped function.
1127
+ */
1128
+ function baseUnary(func) {
1129
+ return function(value) {
1130
+ return func(value);
1131
+ };
1132
+ }
1133
+
1134
+ /** Detect free variable `exports`. */
1135
+ var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
1136
+
1137
+ /** Detect free variable `module`. */
1138
+ var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
1139
+
1140
+ /** Detect the popular CommonJS extension `module.exports`. */
1141
+ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
1142
+
1143
+ /** Detect free variable `process` from Node.js. */
1144
+ var freeProcess = moduleExports$1 && freeGlobal.process;
1145
+
1146
+ /** Used to access faster Node.js helpers. */
1147
+ var nodeUtil = (function() {
1148
+ try {
1149
+ // Use `util.types` for Node.js 10+.
1150
+ var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
1151
+
1152
+ if (types) {
1153
+ return types;
1154
+ }
1155
+
1156
+ // Legacy `process.binding('util')` for Node.js < 10.
1157
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
1158
+ } catch (e) {}
1159
+ }());
1160
+
1161
+ /* Node.js helper references. */
1162
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1163
+
1164
+ /**
1165
+ * Checks if `value` is classified as a typed array.
1166
+ *
1167
+ * @static
1168
+ * @memberOf _
1169
+ * @since 3.0.0
1170
+ * @category Lang
1171
+ * @param {*} value The value to check.
1172
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1173
+ * @example
1174
+ *
1175
+ * _.isTypedArray(new Uint8Array);
1176
+ * // => true
1177
+ *
1178
+ * _.isTypedArray([]);
1179
+ * // => false
1180
+ */
1181
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1182
+
1183
+ /** Used for built-in method references. */
1184
+ var objectProto$6 = Object.prototype;
1185
+
1186
+ /** Used to check objects for own properties. */
1187
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
1188
+
1189
+ /**
1190
+ * Creates an array of the enumerable property names of the array-like `value`.
1191
+ *
1192
+ * @private
1193
+ * @param {*} value The value to query.
1194
+ * @param {boolean} inherited Specify returning inherited property names.
1195
+ * @returns {Array} Returns the array of property names.
1196
+ */
1197
+ function arrayLikeKeys(value, inherited) {
1198
+ var isArr = isArray(value),
1199
+ isArg = !isArr && isArguments(value),
1200
+ isBuff = !isArr && !isArg && isBuffer(value),
1201
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1202
+ skipIndexes = isArr || isArg || isBuff || isType,
1203
+ result = skipIndexes ? baseTimes(value.length, String) : [],
1204
+ length = result.length;
1205
+
1206
+ for (var key in value) {
1207
+ if ((hasOwnProperty$5.call(value, key)) &&
1208
+ !(skipIndexes && (
1209
+ // Safari 9 has enumerable `arguments.length` in strict mode.
1210
+ key == 'length' ||
1211
+ // Node.js 0.10 has enumerable non-index properties on buffers.
1212
+ (isBuff && (key == 'offset' || key == 'parent')) ||
1213
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
1214
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1215
+ // Skip index properties.
1216
+ isIndex(key, length)
1217
+ ))) {
1218
+ result.push(key);
1219
+ }
1220
+ }
1221
+ return result;
1222
+ }
1223
+
1224
+ /**
1225
+ * Creates a unary function that invokes `func` with its argument transformed.
1226
+ *
1227
+ * @private
1228
+ * @param {Function} func The function to wrap.
1229
+ * @param {Function} transform The argument transform.
1230
+ * @returns {Function} Returns the new function.
1231
+ */
1232
+ function overArg(func, transform) {
1233
+ return function(arg) {
1234
+ return func(transform(arg));
1235
+ };
1236
+ }
1237
+
1238
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1239
+ var nativeKeys = overArg(Object.keys, Object);
1240
+
1241
+ /** Used for built-in method references. */
1242
+ var objectProto$5 = Object.prototype;
1243
+
1244
+ /** Used to check objects for own properties. */
1245
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1246
+
1247
+ /**
1248
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1249
+ *
1250
+ * @private
1251
+ * @param {Object} object The object to query.
1252
+ * @returns {Array} Returns the array of property names.
1253
+ */
1254
+ function baseKeys(object) {
1255
+ if (!isPrototype(object)) {
1256
+ return nativeKeys(object);
1257
+ }
1258
+ var result = [];
1259
+ for (var key in Object(object)) {
1260
+ if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
1261
+ result.push(key);
1262
+ }
1263
+ }
1264
+ return result;
1265
+ }
1266
+
1267
+ /**
1268
+ * Creates an array of the own enumerable property names of `object`.
1269
+ *
1270
+ * **Note:** Non-object values are coerced to objects. See the
1271
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1272
+ * for more details.
1273
+ *
1274
+ * @static
1275
+ * @since 0.1.0
1276
+ * @memberOf _
1277
+ * @category Object
1278
+ * @param {Object} object The object to query.
1279
+ * @returns {Array} Returns the array of property names.
1280
+ * @example
1281
+ *
1282
+ * function Foo() {
1283
+ * this.a = 1;
1284
+ * this.b = 2;
1285
+ * }
1286
+ *
1287
+ * Foo.prototype.c = 3;
1288
+ *
1289
+ * _.keys(new Foo);
1290
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1291
+ *
1292
+ * _.keys('hi');
1293
+ * // => ['0', '1']
1294
+ */
1295
+ function keys(object) {
1296
+ return isArrayLike$1(object) ? arrayLikeKeys(object) : baseKeys(object);
1297
+ }
1298
+
1299
+ /* Built-in method references that are verified to be native. */
1300
+ var nativeCreate = getNative(Object, 'create');
1301
+
1302
+ /**
1303
+ * Removes all key-value entries from the hash.
1304
+ *
1305
+ * @private
1306
+ * @name clear
1307
+ * @memberOf Hash
1308
+ */
1309
+ function hashClear() {
1310
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
1311
+ this.size = 0;
1312
+ }
1313
+
1314
+ /**
1315
+ * Removes `key` and its value from the hash.
1316
+ *
1317
+ * @private
1318
+ * @name delete
1319
+ * @memberOf Hash
1320
+ * @param {Object} hash The hash to modify.
1321
+ * @param {string} key The key of the value to remove.
1322
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1323
+ */
1324
+ function hashDelete(key) {
1325
+ var result = this.has(key) && delete this.__data__[key];
1326
+ this.size -= result ? 1 : 0;
1327
+ return result;
1328
+ }
1329
+
1330
+ /** Used to stand-in for `undefined` hash values. */
1331
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1332
+
1333
+ /** Used for built-in method references. */
1334
+ var objectProto$4 = Object.prototype;
1335
+
1336
+ /** Used to check objects for own properties. */
1337
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1338
+
1339
+ /**
1340
+ * Gets the hash value for `key`.
1341
+ *
1342
+ * @private
1343
+ * @name get
1344
+ * @memberOf Hash
1345
+ * @param {string} key The key of the value to get.
1346
+ * @returns {*} Returns the entry value.
1347
+ */
1348
+ function hashGet(key) {
1349
+ var data = this.__data__;
1350
+ if (nativeCreate) {
1351
+ var result = data[key];
1352
+ return result === HASH_UNDEFINED$1 ? undefined : result;
1353
+ }
1354
+ return hasOwnProperty$3.call(data, key) ? data[key] : undefined;
1355
+ }
1356
+
1357
+ /** Used for built-in method references. */
1358
+ var objectProto$3 = Object.prototype;
1359
+
1360
+ /** Used to check objects for own properties. */
1361
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1362
+
1363
+ /**
1364
+ * Checks if a hash value for `key` exists.
1365
+ *
1366
+ * @private
1367
+ * @name has
1368
+ * @memberOf Hash
1369
+ * @param {string} key The key of the entry to check.
1370
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1371
+ */
1372
+ function hashHas(key) {
1373
+ var data = this.__data__;
1374
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$2.call(data, key);
1375
+ }
1376
+
1377
+ /** Used to stand-in for `undefined` hash values. */
1378
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1379
+
1380
+ /**
1381
+ * Sets the hash `key` to `value`.
1382
+ *
1383
+ * @private
1384
+ * @name set
1385
+ * @memberOf Hash
1386
+ * @param {string} key The key of the value to set.
1387
+ * @param {*} value The value to set.
1388
+ * @returns {Object} Returns the hash instance.
1389
+ */
1390
+ function hashSet(key, value) {
1391
+ var data = this.__data__;
1392
+ this.size += this.has(key) ? 0 : 1;
1393
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1394
+ return this;
1395
+ }
1396
+
1397
+ /**
1398
+ * Creates a hash object.
1399
+ *
1400
+ * @private
1401
+ * @constructor
1402
+ * @param {Array} [entries] The key-value pairs to cache.
1403
+ */
1404
+ function Hash(entries) {
1405
+ var index = -1,
1406
+ length = entries == null ? 0 : entries.length;
1407
+
1408
+ this.clear();
1409
+ while (++index < length) {
1410
+ var entry = entries[index];
1411
+ this.set(entry[0], entry[1]);
1412
+ }
1413
+ }
1414
+
1415
+ // Add methods to `Hash`.
1416
+ Hash.prototype.clear = hashClear;
1417
+ Hash.prototype['delete'] = hashDelete;
1418
+ Hash.prototype.get = hashGet;
1419
+ Hash.prototype.has = hashHas;
1420
+ Hash.prototype.set = hashSet;
1421
+
1422
+ /**
1423
+ * Removes all key-value entries from the list cache.
1424
+ *
1425
+ * @private
1426
+ * @name clear
1427
+ * @memberOf ListCache
1428
+ */
1429
+ function listCacheClear() {
1430
+ this.__data__ = [];
1431
+ this.size = 0;
1432
+ }
1433
+
1434
+ /**
1435
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
1436
+ *
1437
+ * @private
1438
+ * @param {Array} array The array to inspect.
1439
+ * @param {*} key The key to search for.
1440
+ * @returns {number} Returns the index of the matched value, else `-1`.
1441
+ */
1442
+ function assocIndexOf(array, key) {
1443
+ var length = array.length;
1444
+ while (length--) {
1445
+ if (eq(array[length][0], key)) {
1446
+ return length;
1447
+ }
1448
+ }
1449
+ return -1;
1450
+ }
1451
+
1452
+ /** Used for built-in method references. */
1453
+ var arrayProto = Array.prototype;
1454
+
1455
+ /** Built-in value references. */
1456
+ var splice = arrayProto.splice;
1457
+
1458
+ /**
1459
+ * Removes `key` and its value from the list cache.
1460
+ *
1461
+ * @private
1462
+ * @name delete
1463
+ * @memberOf ListCache
1464
+ * @param {string} key The key of the value to remove.
1465
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1466
+ */
1467
+ function listCacheDelete(key) {
1468
+ var data = this.__data__,
1469
+ index = assocIndexOf(data, key);
1470
+
1471
+ if (index < 0) {
1472
+ return false;
1473
+ }
1474
+ var lastIndex = data.length - 1;
1475
+ if (index == lastIndex) {
1476
+ data.pop();
1477
+ } else {
1478
+ splice.call(data, index, 1);
1479
+ }
1480
+ --this.size;
1481
+ return true;
1482
+ }
1483
+
1484
+ /**
1485
+ * Gets the list cache value for `key`.
1486
+ *
1487
+ * @private
1488
+ * @name get
1489
+ * @memberOf ListCache
1490
+ * @param {string} key The key of the value to get.
1491
+ * @returns {*} Returns the entry value.
1492
+ */
1493
+ function listCacheGet(key) {
1494
+ var data = this.__data__,
1495
+ index = assocIndexOf(data, key);
1496
+
1497
+ return index < 0 ? undefined : data[index][1];
1498
+ }
1499
+
1500
+ /**
1501
+ * Checks if a list cache value for `key` exists.
1502
+ *
1503
+ * @private
1504
+ * @name has
1505
+ * @memberOf ListCache
1506
+ * @param {string} key The key of the entry to check.
1507
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1508
+ */
1509
+ function listCacheHas(key) {
1510
+ return assocIndexOf(this.__data__, key) > -1;
1511
+ }
1512
+
1513
+ /**
1514
+ * Sets the list cache `key` to `value`.
1515
+ *
1516
+ * @private
1517
+ * @name set
1518
+ * @memberOf ListCache
1519
+ * @param {string} key The key of the value to set.
1520
+ * @param {*} value The value to set.
1521
+ * @returns {Object} Returns the list cache instance.
1522
+ */
1523
+ function listCacheSet(key, value) {
1524
+ var data = this.__data__,
1525
+ index = assocIndexOf(data, key);
1526
+
1527
+ if (index < 0) {
1528
+ ++this.size;
1529
+ data.push([key, value]);
1530
+ } else {
1531
+ data[index][1] = value;
1532
+ }
1533
+ return this;
1534
+ }
1535
+
1536
+ /**
1537
+ * Creates an list cache object.
1538
+ *
1539
+ * @private
1540
+ * @constructor
1541
+ * @param {Array} [entries] The key-value pairs to cache.
1542
+ */
1543
+ function ListCache(entries) {
1544
+ var index = -1,
1545
+ length = entries == null ? 0 : entries.length;
1546
+
1547
+ this.clear();
1548
+ while (++index < length) {
1549
+ var entry = entries[index];
1550
+ this.set(entry[0], entry[1]);
1551
+ }
1552
+ }
1553
+
1554
+ // Add methods to `ListCache`.
1555
+ ListCache.prototype.clear = listCacheClear;
1556
+ ListCache.prototype['delete'] = listCacheDelete;
1557
+ ListCache.prototype.get = listCacheGet;
1558
+ ListCache.prototype.has = listCacheHas;
1559
+ ListCache.prototype.set = listCacheSet;
1560
+
1561
+ /* Built-in method references that are verified to be native. */
1562
+ var Map$1 = getNative(root, 'Map');
1563
+
1564
+ /**
1565
+ * Removes all key-value entries from the map.
1566
+ *
1567
+ * @private
1568
+ * @name clear
1569
+ * @memberOf MapCache
1570
+ */
1571
+ function mapCacheClear() {
1572
+ this.size = 0;
1573
+ this.__data__ = {
1574
+ 'hash': new Hash,
1575
+ 'map': new (Map$1 || ListCache),
1576
+ 'string': new Hash
1577
+ };
1578
+ }
1579
+
1580
+ /**
1581
+ * Checks if `value` is suitable for use as unique object key.
1582
+ *
1583
+ * @private
1584
+ * @param {*} value The value to check.
1585
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1586
+ */
1587
+ function isKeyable(value) {
1588
+ var type = typeof value;
1589
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1590
+ ? (value !== '__proto__')
1591
+ : (value === null);
1592
+ }
1593
+
1594
+ /**
1595
+ * Gets the data for `map`.
1596
+ *
1597
+ * @private
1598
+ * @param {Object} map The map to query.
1599
+ * @param {string} key The reference key.
1600
+ * @returns {*} Returns the map data.
1601
+ */
1602
+ function getMapData(map, key) {
1603
+ var data = map.__data__;
1604
+ return isKeyable(key)
1605
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1606
+ : data.map;
1607
+ }
1608
+
1609
+ /**
1610
+ * Removes `key` and its value from the map.
1611
+ *
1612
+ * @private
1613
+ * @name delete
1614
+ * @memberOf MapCache
1615
+ * @param {string} key The key of the value to remove.
1616
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1617
+ */
1618
+ function mapCacheDelete(key) {
1619
+ var result = getMapData(this, key)['delete'](key);
1620
+ this.size -= result ? 1 : 0;
1621
+ return result;
1622
+ }
1623
+
1624
+ /**
1625
+ * Gets the map value for `key`.
1626
+ *
1627
+ * @private
1628
+ * @name get
1629
+ * @memberOf MapCache
1630
+ * @param {string} key The key of the value to get.
1631
+ * @returns {*} Returns the entry value.
1632
+ */
1633
+ function mapCacheGet(key) {
1634
+ return getMapData(this, key).get(key);
1635
+ }
1636
+
1637
+ /**
1638
+ * Checks if a map value for `key` exists.
1639
+ *
1640
+ * @private
1641
+ * @name has
1642
+ * @memberOf MapCache
1643
+ * @param {string} key The key of the entry to check.
1644
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1645
+ */
1646
+ function mapCacheHas(key) {
1647
+ return getMapData(this, key).has(key);
1648
+ }
1649
+
1650
+ /**
1651
+ * Sets the map `key` to `value`.
1652
+ *
1653
+ * @private
1654
+ * @name set
1655
+ * @memberOf MapCache
1656
+ * @param {string} key The key of the value to set.
1657
+ * @param {*} value The value to set.
1658
+ * @returns {Object} Returns the map cache instance.
1659
+ */
1660
+ function mapCacheSet(key, value) {
1661
+ var data = getMapData(this, key),
1662
+ size = data.size;
1663
+
1664
+ data.set(key, value);
1665
+ this.size += data.size == size ? 0 : 1;
1666
+ return this;
1667
+ }
1668
+
1669
+ /**
1670
+ * Creates a map cache object to store key-value pairs.
1671
+ *
1672
+ * @private
1673
+ * @constructor
1674
+ * @param {Array} [entries] The key-value pairs to cache.
1675
+ */
1676
+ function MapCache(entries) {
1677
+ var index = -1,
1678
+ length = entries == null ? 0 : entries.length;
1679
+
1680
+ this.clear();
1681
+ while (++index < length) {
1682
+ var entry = entries[index];
1683
+ this.set(entry[0], entry[1]);
1684
+ }
1685
+ }
1686
+
1687
+ // Add methods to `MapCache`.
1688
+ MapCache.prototype.clear = mapCacheClear;
1689
+ MapCache.prototype['delete'] = mapCacheDelete;
1690
+ MapCache.prototype.get = mapCacheGet;
1691
+ MapCache.prototype.has = mapCacheHas;
1692
+ MapCache.prototype.set = mapCacheSet;
1693
+
1694
+ /**
1695
+ * Appends the elements of `values` to `array`.
1696
+ *
1697
+ * @private
1698
+ * @param {Array} array The array to modify.
1699
+ * @param {Array} values The values to append.
1700
+ * @returns {Array} Returns `array`.
1701
+ */
1702
+ function arrayPush(array, values) {
1703
+ var index = -1,
1704
+ length = values.length,
1705
+ offset = array.length;
1706
+
1707
+ while (++index < length) {
1708
+ array[offset + index] = values[index];
1709
+ }
1710
+ return array;
1711
+ }
1712
+
1713
+ /** Built-in value references. */
1714
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
1715
+
1716
+ /** `Object#toString` result references. */
1717
+ var objectTag$2 = '[object Object]';
1718
+
1719
+ /** Used for built-in method references. */
1720
+ var funcProto = Function.prototype,
1721
+ objectProto$2 = Object.prototype;
1722
+
1723
+ /** Used to resolve the decompiled source of functions. */
1724
+ var funcToString = funcProto.toString;
1725
+
1726
+ /** Used to check objects for own properties. */
1727
+ var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1728
+
1729
+ /** Used to infer the `Object` constructor. */
1730
+ var objectCtorString = funcToString.call(Object);
1731
+
1732
+ /**
1733
+ * Checks if `value` is a plain object, that is, an object created by the
1734
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
1735
+ *
1736
+ * @static
1737
+ * @memberOf _
1738
+ * @since 0.8.0
1739
+ * @category Lang
1740
+ * @param {*} value The value to check.
1741
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
1742
+ * @example
1743
+ *
1744
+ * function Foo() {
1745
+ * this.a = 1;
1746
+ * }
1747
+ *
1748
+ * _.isPlainObject(new Foo);
1749
+ * // => false
1750
+ *
1751
+ * _.isPlainObject([1, 2, 3]);
1752
+ * // => false
1753
+ *
1754
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
1755
+ * // => true
1756
+ *
1757
+ * _.isPlainObject(Object.create(null));
1758
+ * // => true
1759
+ */
1760
+ function isPlainObject(value) {
1761
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag$2) {
1762
+ return false;
1763
+ }
1764
+ var proto = getPrototype(value);
1765
+ if (proto === null) {
1766
+ return true;
1767
+ }
1768
+ var Ctor = hasOwnProperty$1.call(proto, 'constructor') && proto.constructor;
1769
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
1770
+ funcToString.call(Ctor) == objectCtorString;
1771
+ }
1772
+
1773
+ /**
1774
+ * Removes all key-value entries from the stack.
1775
+ *
1776
+ * @private
1777
+ * @name clear
1778
+ * @memberOf Stack
1779
+ */
1780
+ function stackClear() {
1781
+ this.__data__ = new ListCache;
1782
+ this.size = 0;
1783
+ }
1784
+
1785
+ /**
1786
+ * Removes `key` and its value from the stack.
1787
+ *
1788
+ * @private
1789
+ * @name delete
1790
+ * @memberOf Stack
1791
+ * @param {string} key The key of the value to remove.
1792
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1793
+ */
1794
+ function stackDelete(key) {
1795
+ var data = this.__data__,
1796
+ result = data['delete'](key);
1797
+
1798
+ this.size = data.size;
1799
+ return result;
1800
+ }
1801
+
1802
+ /**
1803
+ * Gets the stack value for `key`.
1804
+ *
1805
+ * @private
1806
+ * @name get
1807
+ * @memberOf Stack
1808
+ * @param {string} key The key of the value to get.
1809
+ * @returns {*} Returns the entry value.
1810
+ */
1811
+ function stackGet(key) {
1812
+ return this.__data__.get(key);
1813
+ }
1814
+
1815
+ /**
1816
+ * Checks if a stack value for `key` exists.
1817
+ *
1818
+ * @private
1819
+ * @name has
1820
+ * @memberOf Stack
1821
+ * @param {string} key The key of the entry to check.
1822
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1823
+ */
1824
+ function stackHas(key) {
1825
+ return this.__data__.has(key);
1826
+ }
1827
+
1828
+ /** Used as the size to enable large array optimizations. */
1829
+ var LARGE_ARRAY_SIZE = 200;
1830
+
1831
+ /**
1832
+ * Sets the stack `key` to `value`.
1833
+ *
1834
+ * @private
1835
+ * @name set
1836
+ * @memberOf Stack
1837
+ * @param {string} key The key of the value to set.
1838
+ * @param {*} value The value to set.
1839
+ * @returns {Object} Returns the stack cache instance.
1840
+ */
1841
+ function stackSet(key, value) {
1842
+ var data = this.__data__;
1843
+ if (data instanceof ListCache) {
1844
+ var pairs = data.__data__;
1845
+ if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1846
+ pairs.push([key, value]);
1847
+ this.size = ++data.size;
1848
+ return this;
1849
+ }
1850
+ data = this.__data__ = new MapCache(pairs);
1851
+ }
1852
+ data.set(key, value);
1853
+ this.size = data.size;
1854
+ return this;
1855
+ }
1856
+
1857
+ /**
1858
+ * Creates a stack cache object to store key-value pairs.
1859
+ *
1860
+ * @private
1861
+ * @constructor
1862
+ * @param {Array} [entries] The key-value pairs to cache.
1863
+ */
1864
+ function Stack(entries) {
1865
+ var data = this.__data__ = new ListCache(entries);
1866
+ this.size = data.size;
1867
+ }
1868
+
1869
+ // Add methods to `Stack`.
1870
+ Stack.prototype.clear = stackClear;
1871
+ Stack.prototype['delete'] = stackDelete;
1872
+ Stack.prototype.get = stackGet;
1873
+ Stack.prototype.has = stackHas;
1874
+ Stack.prototype.set = stackSet;
1875
+
1876
+ /** Detect free variable `exports`. */
1877
+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1878
+
1879
+ /** Detect free variable `module`. */
1880
+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
1881
+
1882
+ /** Detect the popular CommonJS extension `module.exports`. */
1883
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1884
+
1885
+ /** Built-in value references. */
1886
+ var Buffer$1 = moduleExports ? root.Buffer : undefined;
1887
+ Buffer$1 ? Buffer$1.allocUnsafe : undefined;
1888
+
1889
+ /**
1890
+ * Creates a clone of `buffer`.
1891
+ *
1892
+ * @private
1893
+ * @param {Buffer} buffer The buffer to clone.
1894
+ * @param {boolean} [isDeep] Specify a deep clone.
1895
+ * @returns {Buffer} Returns the cloned buffer.
1896
+ */
1897
+ function cloneBuffer(buffer, isDeep) {
1898
+ {
1899
+ return buffer.slice();
1900
+ }
1901
+ }
1902
+
1903
+ /**
1904
+ * A specialized version of `_.filter` for arrays without support for
1905
+ * iteratee shorthands.
1906
+ *
1907
+ * @private
1908
+ * @param {Array} [array] The array to iterate over.
1909
+ * @param {Function} predicate The function invoked per iteration.
1910
+ * @returns {Array} Returns the new filtered array.
1911
+ */
1912
+ function arrayFilter(array, predicate) {
1913
+ var index = -1,
1914
+ length = array == null ? 0 : array.length,
1915
+ resIndex = 0,
1916
+ result = [];
1917
+
1918
+ while (++index < length) {
1919
+ var value = array[index];
1920
+ if (predicate(value, index, array)) {
1921
+ result[resIndex++] = value;
1922
+ }
1923
+ }
1924
+ return result;
1925
+ }
1926
+
1927
+ /**
1928
+ * This method returns a new empty array.
1929
+ *
1930
+ * @static
1931
+ * @memberOf _
1932
+ * @since 4.13.0
1933
+ * @category Util
1934
+ * @returns {Array} Returns the new empty array.
1935
+ * @example
1936
+ *
1937
+ * var arrays = _.times(2, _.stubArray);
1938
+ *
1939
+ * console.log(arrays);
1940
+ * // => [[], []]
1941
+ *
1942
+ * console.log(arrays[0] === arrays[1]);
1943
+ * // => false
1944
+ */
1945
+ function stubArray() {
1946
+ return [];
1947
+ }
1948
+
1949
+ /** Used for built-in method references. */
1950
+ var objectProto$1 = Object.prototype;
1951
+
1952
+ /** Built-in value references. */
1953
+ var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1954
+
1955
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1956
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1957
+
1958
+ /**
1959
+ * Creates an array of the own enumerable symbols of `object`.
1960
+ *
1961
+ * @private
1962
+ * @param {Object} object The object to query.
1963
+ * @returns {Array} Returns the array of symbols.
1964
+ */
1965
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1966
+ if (object == null) {
1967
+ return [];
1968
+ }
1969
+ object = Object(object);
1970
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1971
+ return propertyIsEnumerable.call(object, symbol);
1972
+ });
1973
+ };
1974
+
1975
+ /**
1976
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1977
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1978
+ * symbols of `object`.
1979
+ *
1980
+ * @private
1981
+ * @param {Object} object The object to query.
1982
+ * @param {Function} keysFunc The function to get the keys of `object`.
1983
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1984
+ * @returns {Array} Returns the array of property names and symbols.
1985
+ */
1986
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1987
+ var result = keysFunc(object);
1988
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1989
+ }
1990
+
1991
+ /**
1992
+ * Creates an array of own enumerable property names and symbols of `object`.
1993
+ *
1994
+ * @private
1995
+ * @param {Object} object The object to query.
1996
+ * @returns {Array} Returns the array of property names and symbols.
1997
+ */
1998
+ function getAllKeys(object) {
1999
+ return baseGetAllKeys(object, keys, getSymbols);
2000
+ }
2001
+
2002
+ /* Built-in method references that are verified to be native. */
2003
+ var DataView = getNative(root, 'DataView');
2004
+
2005
+ /* Built-in method references that are verified to be native. */
2006
+ var Promise$1 = getNative(root, 'Promise');
2007
+
2008
+ /* Built-in method references that are verified to be native. */
2009
+ var Set$1 = getNative(root, 'Set');
2010
+
2011
+ /** `Object#toString` result references. */
2012
+ var mapTag$3 = '[object Map]',
2013
+ objectTag$1 = '[object Object]',
2014
+ promiseTag = '[object Promise]',
2015
+ setTag$3 = '[object Set]',
2016
+ weakMapTag$1 = '[object WeakMap]';
2017
+
2018
+ var dataViewTag$2 = '[object DataView]';
2019
+
2020
+ /** Used to detect maps, sets, and weakmaps. */
2021
+ var dataViewCtorString = toSource(DataView),
2022
+ mapCtorString = toSource(Map$1),
2023
+ promiseCtorString = toSource(Promise$1),
2024
+ setCtorString = toSource(Set$1),
2025
+ weakMapCtorString = toSource(WeakMap);
2026
+
2027
+ /**
2028
+ * Gets the `toStringTag` of `value`.
2029
+ *
2030
+ * @private
2031
+ * @param {*} value The value to query.
2032
+ * @returns {string} Returns the `toStringTag`.
2033
+ */
2034
+ var getTag = baseGetTag;
2035
+
2036
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2037
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
2038
+ (Map$1 && getTag(new Map$1) != mapTag$3) ||
2039
+ (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
2040
+ (Set$1 && getTag(new Set$1) != setTag$3) ||
2041
+ (WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
2042
+ getTag = function(value) {
2043
+ var result = baseGetTag(value),
2044
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
2045
+ ctorString = Ctor ? toSource(Ctor) : '';
2046
+
2047
+ if (ctorString) {
2048
+ switch (ctorString) {
2049
+ case dataViewCtorString: return dataViewTag$2;
2050
+ case mapCtorString: return mapTag$3;
2051
+ case promiseCtorString: return promiseTag;
2052
+ case setCtorString: return setTag$3;
2053
+ case weakMapCtorString: return weakMapTag$1;
2054
+ }
2055
+ }
2056
+ return result;
2057
+ };
2058
+ }
2059
+
2060
+ /** Used for built-in method references. */
2061
+ var objectProto = Object.prototype;
2062
+
2063
+ /** Used to check objects for own properties. */
2064
+ var hasOwnProperty = objectProto.hasOwnProperty;
2065
+
2066
+ /**
2067
+ * Initializes an array clone.
2068
+ *
2069
+ * @private
2070
+ * @param {Array} array The array to clone.
2071
+ * @returns {Array} Returns the initialized clone.
2072
+ */
2073
+ function initCloneArray(array) {
2074
+ var length = array.length,
2075
+ result = new array.constructor(length);
2076
+
2077
+ // Add properties assigned by `RegExp#exec`.
2078
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2079
+ result.index = array.index;
2080
+ result.input = array.input;
2081
+ }
2082
+ return result;
2083
+ }
2084
+
2085
+ /** Built-in value references. */
2086
+ var Uint8Array = root.Uint8Array;
2087
+
2088
+ /**
2089
+ * Creates a clone of `arrayBuffer`.
2090
+ *
2091
+ * @private
2092
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2093
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
2094
+ */
2095
+ function cloneArrayBuffer(arrayBuffer) {
2096
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2097
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
2098
+ return result;
2099
+ }
2100
+
2101
+ /**
2102
+ * Creates a clone of `dataView`.
2103
+ *
2104
+ * @private
2105
+ * @param {Object} dataView The data view to clone.
2106
+ * @param {boolean} [isDeep] Specify a deep clone.
2107
+ * @returns {Object} Returns the cloned data view.
2108
+ */
2109
+ function cloneDataView(dataView, isDeep) {
2110
+ var buffer = cloneArrayBuffer(dataView.buffer) ;
2111
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2112
+ }
2113
+
2114
+ /** Used to match `RegExp` flags from their coerced string values. */
2115
+ var reFlags = /\w*$/;
2116
+
2117
+ /**
2118
+ * Creates a clone of `regexp`.
2119
+ *
2120
+ * @private
2121
+ * @param {Object} regexp The regexp to clone.
2122
+ * @returns {Object} Returns the cloned regexp.
2123
+ */
2124
+ function cloneRegExp(regexp) {
2125
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2126
+ result.lastIndex = regexp.lastIndex;
2127
+ return result;
2128
+ }
2129
+
2130
+ /** Used to convert symbols to primitives and strings. */
2131
+ var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
2132
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2133
+
2134
+ /**
2135
+ * Creates a clone of the `symbol` object.
2136
+ *
2137
+ * @private
2138
+ * @param {Object} symbol The symbol object to clone.
2139
+ * @returns {Object} Returns the cloned symbol object.
2140
+ */
2141
+ function cloneSymbol(symbol) {
2142
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2143
+ }
2144
+
2145
+ /**
2146
+ * Creates a clone of `typedArray`.
2147
+ *
2148
+ * @private
2149
+ * @param {Object} typedArray The typed array to clone.
2150
+ * @param {boolean} [isDeep] Specify a deep clone.
2151
+ * @returns {Object} Returns the cloned typed array.
2152
+ */
2153
+ function cloneTypedArray(typedArray, isDeep) {
2154
+ var buffer = cloneArrayBuffer(typedArray.buffer) ;
2155
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2156
+ }
2157
+
2158
+ /** `Object#toString` result references. */
2159
+ var boolTag$1 = '[object Boolean]',
2160
+ dateTag$1 = '[object Date]',
2161
+ mapTag$2 = '[object Map]',
2162
+ numberTag$1 = '[object Number]',
2163
+ regexpTag$1 = '[object RegExp]',
2164
+ setTag$2 = '[object Set]',
2165
+ stringTag$1 = '[object String]',
2166
+ symbolTag$1 = '[object Symbol]';
2167
+
2168
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
2169
+ dataViewTag$1 = '[object DataView]',
2170
+ float32Tag$1 = '[object Float32Array]',
2171
+ float64Tag$1 = '[object Float64Array]',
2172
+ int8Tag$1 = '[object Int8Array]',
2173
+ int16Tag$1 = '[object Int16Array]',
2174
+ int32Tag$1 = '[object Int32Array]',
2175
+ uint8Tag$1 = '[object Uint8Array]',
2176
+ uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2177
+ uint16Tag$1 = '[object Uint16Array]',
2178
+ uint32Tag$1 = '[object Uint32Array]';
2179
+
2180
+ /**
2181
+ * Initializes an object clone based on its `toStringTag`.
2182
+ *
2183
+ * **Note:** This function only supports cloning values with tags of
2184
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2185
+ *
2186
+ * @private
2187
+ * @param {Object} object The object to clone.
2188
+ * @param {string} tag The `toStringTag` of the object to clone.
2189
+ * @param {boolean} [isDeep] Specify a deep clone.
2190
+ * @returns {Object} Returns the initialized clone.
2191
+ */
2192
+ function initCloneByTag(object, tag, isDeep) {
2193
+ var Ctor = object.constructor;
2194
+ switch (tag) {
2195
+ case arrayBufferTag$1:
2196
+ return cloneArrayBuffer(object);
2197
+
2198
+ case boolTag$1:
2199
+ case dateTag$1:
2200
+ return new Ctor(+object);
2201
+
2202
+ case dataViewTag$1:
2203
+ return cloneDataView(object);
2204
+
2205
+ case float32Tag$1: case float64Tag$1:
2206
+ case int8Tag$1: case int16Tag$1: case int32Tag$1:
2207
+ case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2208
+ return cloneTypedArray(object);
2209
+
2210
+ case mapTag$2:
2211
+ return new Ctor;
2212
+
2213
+ case numberTag$1:
2214
+ case stringTag$1:
2215
+ return new Ctor(object);
2216
+
2217
+ case regexpTag$1:
2218
+ return cloneRegExp(object);
2219
+
2220
+ case setTag$2:
2221
+ return new Ctor;
2222
+
2223
+ case symbolTag$1:
2224
+ return cloneSymbol(object);
2225
+ }
2226
+ }
2227
+
2228
+ /**
2229
+ * Initializes an object clone.
2230
+ *
2231
+ * @private
2232
+ * @param {Object} object The object to clone.
2233
+ * @returns {Object} Returns the initialized clone.
2234
+ */
2235
+ function initCloneObject(object) {
2236
+ return (typeof object.constructor == 'function' && !isPrototype(object))
2237
+ ? baseCreate(getPrototype(object))
2238
+ : {};
2239
+ }
2240
+
2241
+ /** `Object#toString` result references. */
2242
+ var mapTag$1 = '[object Map]';
2243
+
2244
+ /**
2245
+ * The base implementation of `_.isMap` without Node.js optimizations.
2246
+ *
2247
+ * @private
2248
+ * @param {*} value The value to check.
2249
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2250
+ */
2251
+ function baseIsMap(value) {
2252
+ return isObjectLike(value) && getTag(value) == mapTag$1;
2253
+ }
2254
+
2255
+ /* Node.js helper references. */
2256
+ var nodeIsMap = nodeUtil && nodeUtil.isMap;
2257
+
2258
+ /**
2259
+ * Checks if `value` is classified as a `Map` object.
2260
+ *
2261
+ * @static
2262
+ * @memberOf _
2263
+ * @since 4.3.0
2264
+ * @category Lang
2265
+ * @param {*} value The value to check.
2266
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2267
+ * @example
2268
+ *
2269
+ * _.isMap(new Map);
2270
+ * // => true
2271
+ *
2272
+ * _.isMap(new WeakMap);
2273
+ * // => false
2274
+ */
2275
+ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
2276
+
2277
+ /** `Object#toString` result references. */
2278
+ var setTag$1 = '[object Set]';
2279
+
2280
+ /**
2281
+ * The base implementation of `_.isSet` without Node.js optimizations.
2282
+ *
2283
+ * @private
2284
+ * @param {*} value The value to check.
2285
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2286
+ */
2287
+ function baseIsSet(value) {
2288
+ return isObjectLike(value) && getTag(value) == setTag$1;
2289
+ }
2290
+
2291
+ /* Node.js helper references. */
2292
+ var nodeIsSet = nodeUtil && nodeUtil.isSet;
2293
+
2294
+ /**
2295
+ * Checks if `value` is classified as a `Set` object.
2296
+ *
2297
+ * @static
2298
+ * @memberOf _
2299
+ * @since 4.3.0
2300
+ * @category Lang
2301
+ * @param {*} value The value to check.
2302
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2303
+ * @example
2304
+ *
2305
+ * _.isSet(new Set);
2306
+ * // => true
2307
+ *
2308
+ * _.isSet(new WeakSet);
2309
+ * // => false
2310
+ */
2311
+ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2312
+
2313
+ /** `Object#toString` result references. */
2314
+ var argsTag = '[object Arguments]',
2315
+ arrayTag = '[object Array]',
2316
+ boolTag = '[object Boolean]',
2317
+ dateTag = '[object Date]',
2318
+ errorTag = '[object Error]',
2319
+ funcTag = '[object Function]',
2320
+ genTag = '[object GeneratorFunction]',
2321
+ mapTag = '[object Map]',
2322
+ numberTag = '[object Number]',
2323
+ objectTag = '[object Object]',
2324
+ regexpTag = '[object RegExp]',
2325
+ setTag = '[object Set]',
2326
+ stringTag = '[object String]',
2327
+ symbolTag = '[object Symbol]',
2328
+ weakMapTag = '[object WeakMap]';
2329
+
2330
+ var arrayBufferTag = '[object ArrayBuffer]',
2331
+ dataViewTag = '[object DataView]',
2332
+ float32Tag = '[object Float32Array]',
2333
+ float64Tag = '[object Float64Array]',
2334
+ int8Tag = '[object Int8Array]',
2335
+ int16Tag = '[object Int16Array]',
2336
+ int32Tag = '[object Int32Array]',
2337
+ uint8Tag = '[object Uint8Array]',
2338
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2339
+ uint16Tag = '[object Uint16Array]',
2340
+ uint32Tag = '[object Uint32Array]';
2341
+
2342
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
2343
+ var cloneableTags = {};
2344
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
2345
+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2346
+ cloneableTags[boolTag] = cloneableTags[dateTag] =
2347
+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2348
+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2349
+ cloneableTags[int32Tag] = cloneableTags[mapTag] =
2350
+ cloneableTags[numberTag] = cloneableTags[objectTag] =
2351
+ cloneableTags[regexpTag] = cloneableTags[setTag] =
2352
+ cloneableTags[stringTag] = cloneableTags[symbolTag] =
2353
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2354
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2355
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
2356
+ cloneableTags[weakMapTag] = false;
2357
+
2358
+ /**
2359
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2360
+ * traversed objects.
2361
+ *
2362
+ * @private
2363
+ * @param {*} value The value to clone.
2364
+ * @param {boolean} bitmask The bitmask flags.
2365
+ * 1 - Deep clone
2366
+ * 2 - Flatten inherited properties
2367
+ * 4 - Clone symbols
2368
+ * @param {Function} [customizer] The function to customize cloning.
2369
+ * @param {string} [key] The key of `value`.
2370
+ * @param {Object} [object] The parent object of `value`.
2371
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2372
+ * @returns {*} Returns the cloned value.
2373
+ */
2374
+ function baseClone(value, bitmask, customizer, key, object, stack) {
2375
+ var result;
2376
+
2377
+ if (customizer) {
2378
+ result = object ? customizer(value, key, object, stack) : customizer(value);
2379
+ }
2380
+ if (result !== undefined) {
2381
+ return result;
2382
+ }
2383
+ if (!isObject$1(value)) {
2384
+ return value;
2385
+ }
2386
+ var isArr = isArray(value);
2387
+ if (isArr) {
2388
+ result = initCloneArray(value);
2389
+ } else {
2390
+ var tag = getTag(value),
2391
+ isFunc = tag == funcTag || tag == genTag;
2392
+
2393
+ if (isBuffer(value)) {
2394
+ return cloneBuffer(value);
2395
+ }
2396
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2397
+ result = (isFunc) ? {} : initCloneObject(value);
2398
+ } else {
2399
+ if (!cloneableTags[tag]) {
2400
+ return object ? value : {};
2401
+ }
2402
+ result = initCloneByTag(value, tag);
2403
+ }
2404
+ }
2405
+ // Check for circular references and return its corresponding clone.
2406
+ stack || (stack = new Stack);
2407
+ var stacked = stack.get(value);
2408
+ if (stacked) {
2409
+ return stacked;
2410
+ }
2411
+ stack.set(value, result);
2412
+
2413
+ if (isSet(value)) {
2414
+ value.forEach(function(subValue) {
2415
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2416
+ });
2417
+ } else if (isMap(value)) {
2418
+ value.forEach(function(subValue, key) {
2419
+ result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2420
+ });
2421
+ }
2422
+
2423
+ var keysFunc = (getAllKeys)
2424
+ ;
2425
+
2426
+ var props = isArr ? undefined : keysFunc(value);
2427
+ arrayEach(props || value, function(subValue, key) {
2428
+ if (props) {
2429
+ key = subValue;
2430
+ subValue = value[key];
2431
+ }
2432
+ // Recursively populate clone (susceptible to call stack limits).
2433
+ assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2434
+ });
2435
+ return result;
2436
+ }
2437
+
2438
+ /** Used to compose bitmasks for cloning. */
2439
+ var CLONE_DEEP_FLAG = 1,
2440
+ CLONE_SYMBOLS_FLAG = 4;
2441
+
2442
+ /**
2443
+ * This method is like `_.cloneWith` except that it recursively clones `value`.
2444
+ *
2445
+ * @static
2446
+ * @memberOf _
2447
+ * @since 4.0.0
2448
+ * @category Lang
2449
+ * @param {*} value The value to recursively clone.
2450
+ * @param {Function} [customizer] The function to customize cloning.
2451
+ * @returns {*} Returns the deep cloned value.
2452
+ * @see _.cloneWith
2453
+ * @example
2454
+ *
2455
+ * function customizer(value) {
2456
+ * if (_.isElement(value)) {
2457
+ * return value.cloneNode(true);
2458
+ * }
2459
+ * }
2460
+ *
2461
+ * var el = _.cloneDeepWith(document.body, customizer);
2462
+ *
2463
+ * console.log(el === document.body);
2464
+ * // => false
2465
+ * console.log(el.nodeName);
2466
+ * // => 'BODY'
2467
+ * console.log(el.childNodes.length);
2468
+ * // => 20
2469
+ */
2470
+ function cloneDeepWith(value, customizer) {
2471
+ customizer = typeof customizer == 'function' ? customizer : undefined;
2472
+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
2473
+ }
2474
+
2475
+ function cleanObject(obj) {
2476
+ Object.keys(obj).forEach((key) => {
2477
+ obj[key] = null;
2478
+ delete obj[key];
2479
+ });
2480
+ }
2481
+ function isObject(obj, shouldAllowCustomObjects = false) {
2482
+ if (!obj) return false;
2483
+ const hasConstructor = shouldAllowCustomObjects ? true : obj.constructor === Object;
2484
+ return typeof obj === "object" && !Array.isArray(obj) && hasConstructor;
2485
+ }
2486
+ const isEmptyObject = (obj) => Object.keys(obj).length === 0 && isObject(obj);
2487
+ const omitInObjectWithoutMutation = (obj, keys) => {
2488
+ let result = {};
2489
+ Object.keys(obj).forEach((key) => {
2490
+ if (!keys.includes(key)) {
2491
+ result = { ...result, [key]: obj[key] };
2492
+ }
2493
+ });
2494
+ return result;
2495
+ };
2496
+ const omitInObjectWithMutation = (obj, keys) => {
2497
+ keys.forEach((key) => delete obj[key]);
2498
+ return obj;
2499
+ };
2500
+ const filterValues = (value) => value !== void 0 && value !== null && value !== Infinity && value !== -Infinity;
2501
+ function filterOutEmptyFields(item) {
2502
+ if (Array.isArray(item)) return item.filter(filterValues);
2503
+ return Object.fromEntries(Object.entries(item).filter(([, value]) => filterValues(value)));
2504
+ }
2505
+ function filterOutEmptyFieldsRecursive(input) {
2506
+ const customizer = (value) => {
2507
+ if (value === null || typeof value !== "object" || value instanceof Date || value instanceof RegExp || value instanceof Map || value instanceof Set || typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value))
2508
+ return void 0;
2509
+ if (Array.isArray(value)) {
2510
+ const cleaned = value.map((v) => cloneDeepWith(v, customizer));
2511
+ return cleaned.filter((v) => v !== void 0);
2512
+ }
2513
+ if (isPlainObject(value)) {
2514
+ const src = value;
2515
+ return Object.entries(src).filter(([, v]) => v !== void 0).map(([k, v]) => [k, cloneDeepWith(v, customizer)]).filter(([, cleanedValue]) => cleanedValue !== void 0).reduce((acc, [k, cleanedValue]) => ({ ...acc, [k]: cleanedValue }), {});
2516
+ }
2517
+ return void 0;
2518
+ };
2519
+ return cloneDeepWith(input, customizer);
2520
+ }
2521
+ function patchObject(base, patch) {
2522
+ if (patch === void 0) return base;
2523
+ if (!isObject(base) || Array.isArray(patch)) return patch;
2524
+ const out = { ...base };
2525
+ Object.entries(patch).forEach(([key, patchVal]) => {
2526
+ if (patchVal === void 0) return;
2527
+ const baseVal = base[key];
2528
+ out[key] = Array.isArray(patchVal) ? patchVal.slice() : isObject(patchVal) && isObject(baseVal) ? patchObject(baseVal, patchVal) : patchVal;
2529
+ });
2530
+ return out;
2531
+ }
2532
+
2533
+ /******************************************************************************
2534
+ Copyright (c) Microsoft Corporation.
2535
+
2536
+ Permission to use, copy, modify, and/or distribute this software for any
2537
+ purpose with or without fee is hereby granted.
2538
+
2539
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2540
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2541
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2542
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2543
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2544
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2545
+ PERFORMANCE OF THIS SOFTWARE.
2546
+ ***************************************************************************** */
2547
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
2548
+
2549
+ var extendStatics = function(d, b) {
2550
+ extendStatics = Object.setPrototypeOf ||
2551
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2552
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2553
+ return extendStatics(d, b);
2554
+ };
2555
+
2556
+ function __extends(d, b) {
2557
+ if (typeof b !== "function" && b !== null)
2558
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2559
+ extendStatics(d, b);
2560
+ function __() { this.constructor = d; }
2561
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2562
+ }
2563
+
2564
+ function __awaiter(thisArg, _arguments, P, generator) {
2565
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2566
+ return new (P || (P = Promise))(function (resolve, reject) {
2567
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2568
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2569
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2570
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2571
+ });
2572
+ }
2573
+
2574
+ function __generator(thisArg, body) {
2575
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
2576
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
2577
+ function verb(n) { return function (v) { return step([n, v]); }; }
2578
+ function step(op) {
2579
+ if (f) throw new TypeError("Generator is already executing.");
2580
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
2581
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2582
+ if (y = 0, t) op = [op[0] & 2, t.value];
2583
+ switch (op[0]) {
2584
+ case 0: case 1: t = op; break;
2585
+ case 4: _.label++; return { value: op[1], done: false };
2586
+ case 5: _.label++; y = op[1]; op = [0]; continue;
2587
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
2588
+ default:
2589
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
2590
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
2591
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
2592
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
2593
+ if (t[2]) _.ops.pop();
2594
+ _.trys.pop(); continue;
2595
+ }
2596
+ op = body.call(thisArg, _);
2597
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
2598
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2599
+ }
2600
+ }
2601
+
2602
+ function __values(o) {
2603
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2604
+ if (m) return m.call(o);
2605
+ if (o && typeof o.length === "number") return {
2606
+ next: function () {
2607
+ if (o && i >= o.length) o = void 0;
2608
+ return { value: o && o[i++], done: !o };
2609
+ }
2610
+ };
2611
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2612
+ }
2613
+
2614
+ function __read(o, n) {
2615
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
2616
+ if (!m) return o;
2617
+ var i = m.call(o), r, ar = [], e;
2618
+ try {
2619
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
2620
+ }
2621
+ catch (error) { e = { error: error }; }
2622
+ finally {
2623
+ try {
2624
+ if (r && !r.done && (m = i["return"])) m.call(i);
2625
+ }
2626
+ finally { if (e) throw e.error; }
2627
+ }
2628
+ return ar;
2629
+ }
2630
+
2631
+ function __spreadArray(to, from, pack) {
2632
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
2633
+ if (ar || !(i in from)) {
2634
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
2635
+ ar[i] = from[i];
2636
+ }
2637
+ }
2638
+ return to.concat(ar || Array.prototype.slice.call(from));
2639
+ }
2640
+
2641
+ function __await(v) {
2642
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
2643
+ }
2644
+
2645
+ function __asyncGenerator(thisArg, _arguments, generator) {
2646
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2647
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
2648
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
2649
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
2650
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
2651
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
2652
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
2653
+ function fulfill(value) { resume("next", value); }
2654
+ function reject(value) { resume("throw", value); }
2655
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
2656
+ }
2657
+
2658
+ function __asyncValues(o) {
2659
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2660
+ var m = o[Symbol.asyncIterator], i;
2661
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
2662
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
2663
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
2664
+ }
2665
+
2666
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
2667
+ var e = new Error(message);
2668
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2669
+ };
2670
+
2671
+ function isFunction(value) {
2672
+ return typeof value === 'function';
2673
+ }
2674
+
2675
+ function createErrorClass(createImpl) {
2676
+ var _super = function (instance) {
2677
+ Error.call(instance);
2678
+ instance.stack = new Error().stack;
2679
+ };
2680
+ var ctorFunc = createImpl(_super);
2681
+ ctorFunc.prototype = Object.create(Error.prototype);
2682
+ ctorFunc.prototype.constructor = ctorFunc;
2683
+ return ctorFunc;
2684
+ }
2685
+
2686
+ var UnsubscriptionError = createErrorClass(function (_super) {
2687
+ return function UnsubscriptionErrorImpl(errors) {
2688
+ _super(this);
2689
+ this.message = errors
2690
+ ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ')
2691
+ : '';
2692
+ this.name = 'UnsubscriptionError';
2693
+ this.errors = errors;
2694
+ };
2695
+ });
2696
+
2697
+ function arrRemove(arr, item) {
2698
+ if (arr) {
2699
+ var index = arr.indexOf(item);
2700
+ 0 <= index && arr.splice(index, 1);
2701
+ }
2702
+ }
2703
+
2704
+ var Subscription = (function () {
2705
+ function Subscription(initialTeardown) {
2706
+ this.initialTeardown = initialTeardown;
2707
+ this.closed = false;
2708
+ this._parentage = null;
2709
+ this._finalizers = null;
2710
+ }
2711
+ Subscription.prototype.unsubscribe = function () {
2712
+ var e_1, _a, e_2, _b;
2713
+ var errors;
2714
+ if (!this.closed) {
2715
+ this.closed = true;
2716
+ var _parentage = this._parentage;
2717
+ if (_parentage) {
2718
+ this._parentage = null;
2719
+ if (Array.isArray(_parentage)) {
2720
+ try {
2721
+ for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
2722
+ var parent_1 = _parentage_1_1.value;
2723
+ parent_1.remove(this);
2724
+ }
2725
+ }
2726
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2727
+ finally {
2728
+ try {
2729
+ if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
2730
+ }
2731
+ finally { if (e_1) throw e_1.error; }
2732
+ }
2733
+ }
2734
+ else {
2735
+ _parentage.remove(this);
2736
+ }
2737
+ }
2738
+ var initialFinalizer = this.initialTeardown;
2739
+ if (isFunction(initialFinalizer)) {
2740
+ try {
2741
+ initialFinalizer();
2742
+ }
2743
+ catch (e) {
2744
+ errors = e instanceof UnsubscriptionError ? e.errors : [e];
2745
+ }
2746
+ }
2747
+ var _finalizers = this._finalizers;
2748
+ if (_finalizers) {
2749
+ this._finalizers = null;
2750
+ try {
2751
+ for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
2752
+ var finalizer = _finalizers_1_1.value;
2753
+ try {
2754
+ execFinalizer(finalizer);
2755
+ }
2756
+ catch (err) {
2757
+ errors = errors !== null && errors !== void 0 ? errors : [];
2758
+ if (err instanceof UnsubscriptionError) {
2759
+ errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
2760
+ }
2761
+ else {
2762
+ errors.push(err);
2763
+ }
2764
+ }
2765
+ }
2766
+ }
2767
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
2768
+ finally {
2769
+ try {
2770
+ if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
2771
+ }
2772
+ finally { if (e_2) throw e_2.error; }
2773
+ }
2774
+ }
2775
+ if (errors) {
2776
+ throw new UnsubscriptionError(errors);
2777
+ }
2778
+ }
2779
+ };
2780
+ Subscription.prototype.add = function (teardown) {
2781
+ var _a;
2782
+ if (teardown && teardown !== this) {
2783
+ if (this.closed) {
2784
+ execFinalizer(teardown);
2785
+ }
2786
+ else {
2787
+ if (teardown instanceof Subscription) {
2788
+ if (teardown.closed || teardown._hasParent(this)) {
2789
+ return;
2790
+ }
2791
+ teardown._addParent(this);
2792
+ }
2793
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
2794
+ }
2795
+ }
2796
+ };
2797
+ Subscription.prototype._hasParent = function (parent) {
2798
+ var _parentage = this._parentage;
2799
+ return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
2800
+ };
2801
+ Subscription.prototype._addParent = function (parent) {
2802
+ var _parentage = this._parentage;
2803
+ this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
2804
+ };
2805
+ Subscription.prototype._removeParent = function (parent) {
2806
+ var _parentage = this._parentage;
2807
+ if (_parentage === parent) {
2808
+ this._parentage = null;
2809
+ }
2810
+ else if (Array.isArray(_parentage)) {
2811
+ arrRemove(_parentage, parent);
2812
+ }
2813
+ };
2814
+ Subscription.prototype.remove = function (teardown) {
2815
+ var _finalizers = this._finalizers;
2816
+ _finalizers && arrRemove(_finalizers, teardown);
2817
+ if (teardown instanceof Subscription) {
2818
+ teardown._removeParent(this);
2819
+ }
2820
+ };
2821
+ Subscription.EMPTY = (function () {
2822
+ var empty = new Subscription();
2823
+ empty.closed = true;
2824
+ return empty;
2825
+ })();
2826
+ return Subscription;
2827
+ }());
2828
+ Subscription.EMPTY;
2829
+ function isSubscription(value) {
2830
+ return (value instanceof Subscription ||
2831
+ (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
2832
+ }
2833
+ function execFinalizer(finalizer) {
2834
+ if (isFunction(finalizer)) {
2835
+ finalizer();
2836
+ }
2837
+ else {
2838
+ finalizer.unsubscribe();
2839
+ }
2840
+ }
2841
+
2842
+ var config = {
2843
+ Promise: undefined};
2844
+
2845
+ var timeoutProvider = {
2846
+ setTimeout: function (handler, timeout) {
2847
+ var args = [];
2848
+ for (var _i = 2; _i < arguments.length; _i++) {
2849
+ args[_i - 2] = arguments[_i];
2850
+ }
2851
+ return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
2852
+ },
2853
+ clearTimeout: function (handle) {
2854
+ return (clearTimeout)(handle);
2855
+ },
2856
+ delegate: undefined,
2857
+ };
2858
+
2859
+ function reportUnhandledError(err) {
2860
+ timeoutProvider.setTimeout(function () {
2861
+ {
2862
+ throw err;
2863
+ }
2864
+ });
2865
+ }
2866
+
2867
+ function noop() { }
2868
+
2869
+ function errorContext(cb) {
2870
+ {
2871
+ cb();
2872
+ }
2873
+ }
2874
+
2875
+ var Subscriber = (function (_super) {
2876
+ __extends(Subscriber, _super);
2877
+ function Subscriber(destination) {
2878
+ var _this = _super.call(this) || this;
2879
+ _this.isStopped = false;
2880
+ if (destination) {
2881
+ _this.destination = destination;
2882
+ if (isSubscription(destination)) {
2883
+ destination.add(_this);
2884
+ }
2885
+ }
2886
+ else {
2887
+ _this.destination = EMPTY_OBSERVER;
2888
+ }
2889
+ return _this;
2890
+ }
2891
+ Subscriber.create = function (next, error, complete) {
2892
+ return new SafeSubscriber(next, error, complete);
2893
+ };
2894
+ Subscriber.prototype.next = function (value) {
2895
+ if (this.isStopped) ;
2896
+ else {
2897
+ this._next(value);
2898
+ }
2899
+ };
2900
+ Subscriber.prototype.error = function (err) {
2901
+ if (this.isStopped) ;
2902
+ else {
2903
+ this.isStopped = true;
2904
+ this._error(err);
2905
+ }
2906
+ };
2907
+ Subscriber.prototype.complete = function () {
2908
+ if (this.isStopped) ;
2909
+ else {
2910
+ this.isStopped = true;
2911
+ this._complete();
2912
+ }
2913
+ };
2914
+ Subscriber.prototype.unsubscribe = function () {
2915
+ if (!this.closed) {
2916
+ this.isStopped = true;
2917
+ _super.prototype.unsubscribe.call(this);
2918
+ this.destination = null;
2919
+ }
2920
+ };
2921
+ Subscriber.prototype._next = function (value) {
2922
+ this.destination.next(value);
2923
+ };
2924
+ Subscriber.prototype._error = function (err) {
2925
+ try {
2926
+ this.destination.error(err);
2927
+ }
2928
+ finally {
2929
+ this.unsubscribe();
2930
+ }
2931
+ };
2932
+ Subscriber.prototype._complete = function () {
2933
+ try {
2934
+ this.destination.complete();
2935
+ }
2936
+ finally {
2937
+ this.unsubscribe();
2938
+ }
2939
+ };
2940
+ return Subscriber;
2941
+ }(Subscription));
2942
+ var ConsumerObserver = (function () {
2943
+ function ConsumerObserver(partialObserver) {
2944
+ this.partialObserver = partialObserver;
2945
+ }
2946
+ ConsumerObserver.prototype.next = function (value) {
2947
+ var partialObserver = this.partialObserver;
2948
+ if (partialObserver.next) {
2949
+ try {
2950
+ partialObserver.next(value);
2951
+ }
2952
+ catch (error) {
2953
+ handleUnhandledError(error);
2954
+ }
2955
+ }
2956
+ };
2957
+ ConsumerObserver.prototype.error = function (err) {
2958
+ var partialObserver = this.partialObserver;
2959
+ if (partialObserver.error) {
2960
+ try {
2961
+ partialObserver.error(err);
2962
+ }
2963
+ catch (error) {
2964
+ handleUnhandledError(error);
2965
+ }
2966
+ }
2967
+ else {
2968
+ handleUnhandledError(err);
2969
+ }
2970
+ };
2971
+ ConsumerObserver.prototype.complete = function () {
2972
+ var partialObserver = this.partialObserver;
2973
+ if (partialObserver.complete) {
2974
+ try {
2975
+ partialObserver.complete();
2976
+ }
2977
+ catch (error) {
2978
+ handleUnhandledError(error);
2979
+ }
2980
+ }
2981
+ };
2982
+ return ConsumerObserver;
2983
+ }());
2984
+ var SafeSubscriber = (function (_super) {
2985
+ __extends(SafeSubscriber, _super);
2986
+ function SafeSubscriber(observerOrNext, error, complete) {
2987
+ var _this = _super.call(this) || this;
2988
+ var partialObserver;
2989
+ if (isFunction(observerOrNext) || !observerOrNext) {
2990
+ partialObserver = {
2991
+ next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
2992
+ error: error !== null && error !== void 0 ? error : undefined,
2993
+ complete: complete !== null && complete !== void 0 ? complete : undefined,
2994
+ };
2995
+ }
2996
+ else {
2997
+ {
2998
+ partialObserver = observerOrNext;
2999
+ }
3000
+ }
3001
+ _this.destination = new ConsumerObserver(partialObserver);
3002
+ return _this;
3003
+ }
3004
+ return SafeSubscriber;
3005
+ }(Subscriber));
3006
+ function handleUnhandledError(error) {
3007
+ {
3008
+ reportUnhandledError(error);
3009
+ }
3010
+ }
3011
+ function defaultErrorHandler(err) {
3012
+ throw err;
3013
+ }
3014
+ var EMPTY_OBSERVER = {
3015
+ closed: true,
3016
+ next: noop,
3017
+ error: defaultErrorHandler,
3018
+ complete: noop,
3019
+ };
3020
+
3021
+ var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();
3022
+
3023
+ function identity(x) {
3024
+ return x;
3025
+ }
3026
+
3027
+ function pipeFromArray(fns) {
3028
+ if (fns.length === 0) {
3029
+ return identity;
3030
+ }
3031
+ if (fns.length === 1) {
3032
+ return fns[0];
3033
+ }
3034
+ return function piped(input) {
3035
+ return fns.reduce(function (prev, fn) { return fn(prev); }, input);
3036
+ };
3037
+ }
3038
+
3039
+ var Observable = (function () {
3040
+ function Observable(subscribe) {
3041
+ if (subscribe) {
3042
+ this._subscribe = subscribe;
3043
+ }
3044
+ }
3045
+ Observable.prototype.lift = function (operator) {
3046
+ var observable = new Observable();
3047
+ observable.source = this;
3048
+ observable.operator = operator;
3049
+ return observable;
3050
+ };
3051
+ Observable.prototype.subscribe = function (observerOrNext, error, complete) {
3052
+ var _this = this;
3053
+ var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
3054
+ errorContext(function () {
3055
+ var _a = _this, operator = _a.operator, source = _a.source;
3056
+ subscriber.add(operator
3057
+ ?
3058
+ operator.call(subscriber, source)
3059
+ : source
3060
+ ?
3061
+ _this._subscribe(subscriber)
3062
+ :
3063
+ _this._trySubscribe(subscriber));
3064
+ });
3065
+ return subscriber;
3066
+ };
3067
+ Observable.prototype._trySubscribe = function (sink) {
3068
+ try {
3069
+ return this._subscribe(sink);
3070
+ }
3071
+ catch (err) {
3072
+ sink.error(err);
3073
+ }
3074
+ };
3075
+ Observable.prototype.forEach = function (next, promiseCtor) {
3076
+ var _this = this;
3077
+ promiseCtor = getPromiseCtor(promiseCtor);
3078
+ return new promiseCtor(function (resolve, reject) {
3079
+ var subscriber = new SafeSubscriber({
3080
+ next: function (value) {
3081
+ try {
3082
+ next(value);
3083
+ }
3084
+ catch (err) {
3085
+ reject(err);
3086
+ subscriber.unsubscribe();
3087
+ }
3088
+ },
3089
+ error: reject,
3090
+ complete: resolve,
3091
+ });
3092
+ _this.subscribe(subscriber);
3093
+ });
3094
+ };
3095
+ Observable.prototype._subscribe = function (subscriber) {
3096
+ var _a;
3097
+ return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
3098
+ };
3099
+ Observable.prototype[observable] = function () {
3100
+ return this;
3101
+ };
3102
+ Observable.prototype.pipe = function () {
3103
+ var operations = [];
3104
+ for (var _i = 0; _i < arguments.length; _i++) {
3105
+ operations[_i] = arguments[_i];
3106
+ }
3107
+ return pipeFromArray(operations)(this);
3108
+ };
3109
+ Observable.prototype.toPromise = function (promiseCtor) {
3110
+ var _this = this;
3111
+ promiseCtor = getPromiseCtor(promiseCtor);
3112
+ return new promiseCtor(function (resolve, reject) {
3113
+ var value;
3114
+ _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });
3115
+ });
3116
+ };
3117
+ Observable.create = function (subscribe) {
3118
+ return new Observable(subscribe);
3119
+ };
3120
+ return Observable;
3121
+ }());
3122
+ function getPromiseCtor(promiseCtor) {
3123
+ var _a;
3124
+ return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
3125
+ }
3126
+ function isObserver(value) {
3127
+ return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
3128
+ }
3129
+ function isSubscriber(value) {
3130
+ return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
3131
+ }
3132
+
3133
+ function hasLift(source) {
3134
+ return isFunction(source === null || source === void 0 ? void 0 : source.lift);
3135
+ }
3136
+ function operate(init) {
3137
+ return function (source) {
3138
+ if (hasLift(source)) {
3139
+ return source.lift(function (liftedSource) {
3140
+ try {
3141
+ return init(liftedSource, this);
3142
+ }
3143
+ catch (err) {
3144
+ this.error(err);
3145
+ }
3146
+ });
3147
+ }
3148
+ throw new TypeError('Unable to lift unknown Observable type');
3149
+ };
3150
+ }
3151
+
3152
+ function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
3153
+ return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
3154
+ }
3155
+ var OperatorSubscriber = (function (_super) {
3156
+ __extends(OperatorSubscriber, _super);
3157
+ function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
3158
+ var _this = _super.call(this, destination) || this;
3159
+ _this.onFinalize = onFinalize;
3160
+ _this.shouldUnsubscribe = shouldUnsubscribe;
3161
+ _this._next = onNext
3162
+ ? function (value) {
3163
+ try {
3164
+ onNext(value);
3165
+ }
3166
+ catch (err) {
3167
+ destination.error(err);
3168
+ }
3169
+ }
3170
+ : _super.prototype._next;
3171
+ _this._error = onError
3172
+ ? function (err) {
3173
+ try {
3174
+ onError(err);
3175
+ }
3176
+ catch (err) {
3177
+ destination.error(err);
3178
+ }
3179
+ finally {
3180
+ this.unsubscribe();
3181
+ }
3182
+ }
3183
+ : _super.prototype._error;
3184
+ _this._complete = onComplete
3185
+ ? function () {
3186
+ try {
3187
+ onComplete();
3188
+ }
3189
+ catch (err) {
3190
+ destination.error(err);
3191
+ }
3192
+ finally {
3193
+ this.unsubscribe();
3194
+ }
3195
+ }
3196
+ : _super.prototype._complete;
3197
+ return _this;
3198
+ }
3199
+ OperatorSubscriber.prototype.unsubscribe = function () {
3200
+ var _a;
3201
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
3202
+ var closed_1 = this.closed;
3203
+ _super.prototype.unsubscribe.call(this);
3204
+ !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
3205
+ }
3206
+ };
3207
+ return OperatorSubscriber;
3208
+ }(Subscriber));
3209
+
3210
+ function isScheduler(value) {
3211
+ return value && isFunction(value.schedule);
3212
+ }
3213
+
3214
+ function last(arr) {
3215
+ return arr[arr.length - 1];
3216
+ }
3217
+ function popScheduler(args) {
3218
+ return isScheduler(last(args)) ? args.pop() : undefined;
3219
+ }
3220
+
3221
+ var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
3222
+
3223
+ function isPromise(value) {
3224
+ return isFunction(value === null || value === void 0 ? void 0 : value.then);
3225
+ }
3226
+
3227
+ function isInteropObservable(input) {
3228
+ return isFunction(input[observable]);
3229
+ }
3230
+
3231
+ function isAsyncIterable(obj) {
3232
+ return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
3233
+ }
3234
+
3235
+ function createInvalidObservableTypeError(input) {
3236
+ return new TypeError("You provided " + (input !== null && typeof input === 'object' ? 'an invalid object' : "'" + input + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
3237
+ }
3238
+
3239
+ function getSymbolIterator() {
3240
+ if (typeof Symbol !== 'function' || !Symbol.iterator) {
3241
+ return '@@iterator';
3242
+ }
3243
+ return Symbol.iterator;
3244
+ }
3245
+ var iterator = getSymbolIterator();
3246
+
3247
+ function isIterable(input) {
3248
+ return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
3249
+ }
3250
+
3251
+ function readableStreamLikeToAsyncGenerator(readableStream) {
3252
+ return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
3253
+ var reader, _a, value, done;
3254
+ return __generator(this, function (_b) {
3255
+ switch (_b.label) {
3256
+ case 0:
3257
+ reader = readableStream.getReader();
3258
+ _b.label = 1;
3259
+ case 1:
3260
+ _b.trys.push([1, , 9, 10]);
3261
+ _b.label = 2;
3262
+ case 2:
3263
+ return [4, __await(reader.read())];
3264
+ case 3:
3265
+ _a = _b.sent(), value = _a.value, done = _a.done;
3266
+ if (!done) return [3, 5];
3267
+ return [4, __await(void 0)];
3268
+ case 4: return [2, _b.sent()];
3269
+ case 5: return [4, __await(value)];
3270
+ case 6: return [4, _b.sent()];
3271
+ case 7:
3272
+ _b.sent();
3273
+ return [3, 2];
3274
+ case 8: return [3, 10];
3275
+ case 9:
3276
+ reader.releaseLock();
3277
+ return [7];
3278
+ case 10: return [2];
3279
+ }
3280
+ });
3281
+ });
3282
+ }
3283
+ function isReadableStreamLike(obj) {
3284
+ return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
3285
+ }
3286
+
3287
+ function innerFrom(input) {
3288
+ if (input instanceof Observable) {
3289
+ return input;
3290
+ }
3291
+ if (input != null) {
3292
+ if (isInteropObservable(input)) {
3293
+ return fromInteropObservable(input);
3294
+ }
3295
+ if (isArrayLike(input)) {
3296
+ return fromArrayLike(input);
3297
+ }
3298
+ if (isPromise(input)) {
3299
+ return fromPromise(input);
3300
+ }
3301
+ if (isAsyncIterable(input)) {
3302
+ return fromAsyncIterable(input);
3303
+ }
3304
+ if (isIterable(input)) {
3305
+ return fromIterable(input);
3306
+ }
3307
+ if (isReadableStreamLike(input)) {
3308
+ return fromReadableStreamLike(input);
3309
+ }
3310
+ }
3311
+ throw createInvalidObservableTypeError(input);
3312
+ }
3313
+ function fromInteropObservable(obj) {
3314
+ return new Observable(function (subscriber) {
3315
+ var obs = obj[observable]();
3316
+ if (isFunction(obs.subscribe)) {
3317
+ return obs.subscribe(subscriber);
3318
+ }
3319
+ throw new TypeError('Provided object does not correctly implement Symbol.observable');
3320
+ });
3321
+ }
3322
+ function fromArrayLike(array) {
3323
+ return new Observable(function (subscriber) {
3324
+ for (var i = 0; i < array.length && !subscriber.closed; i++) {
3325
+ subscriber.next(array[i]);
3326
+ }
3327
+ subscriber.complete();
3328
+ });
3329
+ }
3330
+ function fromPromise(promise) {
3331
+ return new Observable(function (subscriber) {
3332
+ promise
3333
+ .then(function (value) {
3334
+ if (!subscriber.closed) {
3335
+ subscriber.next(value);
3336
+ subscriber.complete();
3337
+ }
3338
+ }, function (err) { return subscriber.error(err); })
3339
+ .then(null, reportUnhandledError);
3340
+ });
3341
+ }
3342
+ function fromIterable(iterable) {
3343
+ return new Observable(function (subscriber) {
3344
+ var e_1, _a;
3345
+ try {
3346
+ for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {
3347
+ var value = iterable_1_1.value;
3348
+ subscriber.next(value);
3349
+ if (subscriber.closed) {
3350
+ return;
3351
+ }
3352
+ }
3353
+ }
3354
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3355
+ finally {
3356
+ try {
3357
+ if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);
3358
+ }
3359
+ finally { if (e_1) throw e_1.error; }
3360
+ }
3361
+ subscriber.complete();
3362
+ });
3363
+ }
3364
+ function fromAsyncIterable(asyncIterable) {
3365
+ return new Observable(function (subscriber) {
3366
+ process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });
3367
+ });
3368
+ }
3369
+ function fromReadableStreamLike(readableStream) {
3370
+ return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
3371
+ }
3372
+ function process(asyncIterable, subscriber) {
3373
+ var asyncIterable_1, asyncIterable_1_1;
3374
+ var e_2, _a;
3375
+ return __awaiter(this, void 0, void 0, function () {
3376
+ var value, e_2_1;
3377
+ return __generator(this, function (_b) {
3378
+ switch (_b.label) {
3379
+ case 0:
3380
+ _b.trys.push([0, 5, 6, 11]);
3381
+ asyncIterable_1 = __asyncValues(asyncIterable);
3382
+ _b.label = 1;
3383
+ case 1: return [4, asyncIterable_1.next()];
3384
+ case 2:
3385
+ if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];
3386
+ value = asyncIterable_1_1.value;
3387
+ subscriber.next(value);
3388
+ if (subscriber.closed) {
3389
+ return [2];
3390
+ }
3391
+ _b.label = 3;
3392
+ case 3: return [3, 1];
3393
+ case 4: return [3, 11];
3394
+ case 5:
3395
+ e_2_1 = _b.sent();
3396
+ e_2 = { error: e_2_1 };
3397
+ return [3, 11];
3398
+ case 6:
3399
+ _b.trys.push([6, , 9, 10]);
3400
+ if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];
3401
+ return [4, _a.call(asyncIterable_1)];
3402
+ case 7:
3403
+ _b.sent();
3404
+ _b.label = 8;
3405
+ case 8: return [3, 10];
3406
+ case 9:
3407
+ if (e_2) throw e_2.error;
3408
+ return [7];
3409
+ case 10: return [7];
3410
+ case 11:
3411
+ subscriber.complete();
3412
+ return [2];
3413
+ }
3414
+ });
3415
+ });
3416
+ }
3417
+
3418
+ function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {
3419
+ if (delay === void 0) { delay = 0; }
3420
+ if (repeat === void 0) { repeat = false; }
3421
+ var scheduleSubscription = scheduler.schedule(function () {
3422
+ work();
3423
+ if (repeat) {
3424
+ parentSubscription.add(this.schedule(null, delay));
3425
+ }
3426
+ else {
3427
+ this.unsubscribe();
3428
+ }
3429
+ }, delay);
3430
+ parentSubscription.add(scheduleSubscription);
3431
+ if (!repeat) {
3432
+ return scheduleSubscription;
3433
+ }
3434
+ }
3435
+
3436
+ function observeOn(scheduler, delay) {
3437
+ if (delay === void 0) { delay = 0; }
3438
+ return operate(function (source, subscriber) {
3439
+ source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));
3440
+ });
3441
+ }
3442
+
3443
+ function subscribeOn(scheduler, delay) {
3444
+ if (delay === void 0) { delay = 0; }
3445
+ return operate(function (source, subscriber) {
3446
+ subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));
3447
+ });
3448
+ }
3449
+
3450
+ function scheduleObservable(input, scheduler) {
3451
+ return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
3452
+ }
3453
+
3454
+ function schedulePromise(input, scheduler) {
3455
+ return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
3456
+ }
3457
+
3458
+ function scheduleArray(input, scheduler) {
3459
+ return new Observable(function (subscriber) {
3460
+ var i = 0;
3461
+ return scheduler.schedule(function () {
3462
+ if (i === input.length) {
3463
+ subscriber.complete();
3464
+ }
3465
+ else {
3466
+ subscriber.next(input[i++]);
3467
+ if (!subscriber.closed) {
3468
+ this.schedule();
3469
+ }
3470
+ }
3471
+ });
3472
+ });
3473
+ }
3474
+
3475
+ function scheduleIterable(input, scheduler) {
3476
+ return new Observable(function (subscriber) {
3477
+ var iterator$1;
3478
+ executeSchedule(subscriber, scheduler, function () {
3479
+ iterator$1 = input[iterator]();
3480
+ executeSchedule(subscriber, scheduler, function () {
3481
+ var _a;
3482
+ var value;
3483
+ var done;
3484
+ try {
3485
+ (_a = iterator$1.next(), value = _a.value, done = _a.done);
3486
+ }
3487
+ catch (err) {
3488
+ subscriber.error(err);
3489
+ return;
3490
+ }
3491
+ if (done) {
3492
+ subscriber.complete();
3493
+ }
3494
+ else {
3495
+ subscriber.next(value);
3496
+ }
3497
+ }, 0, true);
3498
+ });
3499
+ return function () { return isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return(); };
3500
+ });
3501
+ }
3502
+
3503
+ function scheduleAsyncIterable(input, scheduler) {
3504
+ if (!input) {
3505
+ throw new Error('Iterable cannot be null');
3506
+ }
3507
+ return new Observable(function (subscriber) {
3508
+ executeSchedule(subscriber, scheduler, function () {
3509
+ var iterator = input[Symbol.asyncIterator]();
3510
+ executeSchedule(subscriber, scheduler, function () {
3511
+ iterator.next().then(function (result) {
3512
+ if (result.done) {
3513
+ subscriber.complete();
3514
+ }
3515
+ else {
3516
+ subscriber.next(result.value);
3517
+ }
3518
+ });
3519
+ }, 0, true);
3520
+ });
3521
+ });
3522
+ }
3523
+
3524
+ function scheduleReadableStreamLike(input, scheduler) {
3525
+ return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
3526
+ }
3527
+
3528
+ function scheduled(input, scheduler) {
3529
+ if (input != null) {
3530
+ if (isInteropObservable(input)) {
3531
+ return scheduleObservable(input, scheduler);
3532
+ }
3533
+ if (isArrayLike(input)) {
3534
+ return scheduleArray(input, scheduler);
3535
+ }
3536
+ if (isPromise(input)) {
3537
+ return schedulePromise(input, scheduler);
3538
+ }
3539
+ if (isAsyncIterable(input)) {
3540
+ return scheduleAsyncIterable(input, scheduler);
3541
+ }
3542
+ if (isIterable(input)) {
3543
+ return scheduleIterable(input, scheduler);
3544
+ }
3545
+ if (isReadableStreamLike(input)) {
3546
+ return scheduleReadableStreamLike(input, scheduler);
3547
+ }
3548
+ }
3549
+ throw createInvalidObservableTypeError(input);
3550
+ }
3551
+
3552
+ function from(input, scheduler) {
3553
+ return scheduler ? scheduled(input, scheduler) : innerFrom(input);
3554
+ }
3555
+
3556
+ function of() {
3557
+ var args = [];
3558
+ for (var _i = 0; _i < arguments.length; _i++) {
3559
+ args[_i] = arguments[_i];
3560
+ }
3561
+ var scheduler = popScheduler(args);
3562
+ return from(args, scheduler);
3563
+ }
3564
+
3565
+ function isObservable(obj) {
3566
+ return !!obj && (obj instanceof Observable || (isFunction(obj.lift) && isFunction(obj.subscribe)));
3567
+ }
3568
+
3569
+ const toObservable$ = (x) => isObservable(x) ? x : of(x);
3570
+
3571
+ const { TAB, DEL, LF, CR, MAX_CONTROL } = JsonSpecialCharactersAscii;
3572
+ const { BOM, QUOTE, LINE_SEPARATOR, PARAGRAPH_SEPARATOR, BACKSLASH } = JsonSpecialCharactersUnicode;
3573
+ function validateJson(json, dangerousKeys = DefaultBannedInJsonKeys, options = {}) {
3574
+ if (typeof json !== "string" || json.length === 0) throw new Error("[JSON] Invalid input: JSON must be a non-empty string");
3575
+ const maxBytes = options.maxBytes ?? 5 * 1024 * 1024;
3576
+ const maxDepth = options.maxDepth ?? 200;
3577
+ const byteSize = Buffer.byteLength(json, "utf8");
3578
+ if (byteSize > maxBytes) throw new Error(`[JSON] The size is too large: ${byteSize} bytes (limit ${maxBytes})`);
3579
+ scanText(json);
3580
+ let parsedData;
3581
+ try {
3582
+ parsedData = JSON.parse(json);
3583
+ } catch (error) {
3584
+ throw new Error(`[JSON] Parse failed: ${error.message}`);
3585
+ }
3586
+ assertTree(parsedData, maxDepth, dangerousKeys);
3587
+ return parsedData;
3588
+ }
3589
+ function getContext(text, index, radius = 24) {
3590
+ const start = Math.max(0, index - radius);
3591
+ const end = Math.min(text.length, index + radius);
3592
+ const char = text[index] ?? "";
3593
+ return text.slice(start, index) + "⟦" + char + "⟧" + text.slice(index + 1, end);
3594
+ }
3595
+ function isAllowedControlCharacter(charCode) {
3596
+ return charCode === TAB || charCode === LF || charCode === CR;
3597
+ }
3598
+ function isControlCharacter(charCode) {
3599
+ return charCode <= MAX_CONTROL || charCode === DEL;
3600
+ }
3601
+ function validateCharacterOutsideString(charCode, index, text) {
3602
+ if (isControlCharacter(charCode) && !isAllowedControlCharacter(charCode)) {
3603
+ const hexCode = charCode.toString(16).padStart(4, "0").toUpperCase();
3604
+ throw new Error(`[JSON] Invalid control outside string at index ${index} (U+${hexCode}).
3605
+ ${getContext(text, index)}`);
3606
+ }
3607
+ if (charCode === LINE_SEPARATOR || charCode === PARAGRAPH_SEPARATOR) {
3608
+ const hexCode = charCode.toString(16).toUpperCase();
3609
+ throw new Error(`[JSON] Disallowed U+${hexCode} outside string at index ${index}.
3610
+ ${getContext(text, index)}`);
3611
+ }
3612
+ }
3613
+ function validateCharacterInsideString(charCode, index, text) {
3614
+ if (isControlCharacter(charCode)) {
3615
+ const hexCode = charCode.toString(16).padStart(4, "0").toUpperCase();
3616
+ throw new Error(`[JSON] Unescaped control in string at index ${index} (U+${hexCode}).
3617
+ Controls must be escaped as \\n, \\t, \\r or \\u00XX.
3618
+ ${getContext(text, index)}`);
3619
+ }
3620
+ }
3621
+ function scanText(raw) {
3622
+ if (raw.charCodeAt(0) === BOM) throw new Error(`[JSON] Invalid JSON text: BOM U+FEFF at start.
3623
+ ${getContext(raw, 0)}`);
3624
+ let inString = false;
3625
+ let isEscaped = false;
3626
+ Array.from(raw).forEach((_char, index) => {
3627
+ const charCode = raw.charCodeAt(index);
3628
+ if (!inString) {
3629
+ validateCharacterOutsideString(charCode, index, raw);
3630
+ if (charCode === QUOTE) {
3631
+ inString = true;
3632
+ isEscaped = false;
3633
+ }
3634
+ return;
3635
+ }
3636
+ if (isEscaped) {
3637
+ isEscaped = false;
3638
+ return;
3639
+ }
3640
+ if (charCode === BACKSLASH) {
3641
+ isEscaped = true;
3642
+ return;
3643
+ }
3644
+ if (charCode === QUOTE) {
3645
+ inString = false;
3646
+ return;
3647
+ }
3648
+ validateCharacterInsideString(charCode, index, raw);
3649
+ });
3650
+ }
3651
+ function assertTree(value, maxDepth, dangerousKeys, path = "", depth = 0) {
3652
+ if (depth > maxDepth) {
3653
+ const location = path || "<root>";
3654
+ throw new Error(`[JSON] Max depth exceeded at ${location} (> ${maxDepth})`);
3655
+ }
3656
+ if (value === null || typeof value !== "object") return;
3657
+ if (Array.isArray(value)) {
3658
+ value.forEach((item, index) => {
3659
+ const itemPath = `${path}[${index}]`;
3660
+ assertTree(item, maxDepth, dangerousKeys, itemPath, depth + 1);
3661
+ });
3662
+ return;
3663
+ }
3664
+ const obj = value;
3665
+ Object.keys(obj).forEach((key) => {
3666
+ if (dangerousKeys.includes(key)) {
3667
+ const keyPath2 = path ? `${path}.${key}` : key;
3668
+ throw new Error(`[JSON] Dangerous key "${key}" at ${keyPath2}`);
3669
+ }
3670
+ const keyPath = path ? `${path}.${key}` : key;
3671
+ assertTree(obj[key], maxDepth, dangerousKeys, keyPath, depth + 1);
3672
+ });
3673
+ }
3674
+
3675
+ function camelToKebab(str) {
3676
+ return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3677
+ }
3678
+ function kebabToCamel(input) {
3679
+ if (!input.includes("-")) return input;
3680
+ return input.toLowerCase().split("-").map((part, index) => index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)).join("");
3681
+ }
3682
+
3683
+ function parseDistName(distName) {
3684
+ if (!distName) return { platform: "unknown", arch: "unknown" };
3685
+ const parts = distName.toLowerCase().trim().split("-");
3686
+ const [platform, arch] = parts;
3687
+ return { platform: platform || "unknown", arch: arch || "unknown" };
3688
+ }
3689
+
3690
+ function nullsToUndefined(obj) {
3691
+ const result = {};
3692
+ for (const key in obj) {
3693
+ const value = obj[key];
3694
+ result[key] = value === null ? void 0 : value;
3695
+ }
3696
+ return result;
3697
+ }
3698
+
3699
+ const getQueryParams = (urlString = window.location.href) => {
3700
+ const url = new URL(urlString);
3701
+ const entries = Array.from(url.searchParams.entries());
3702
+ return Object.fromEntries(entries);
3703
+ };
3704
+ function buildPublicUrl(baseUrl, relPath) {
3705
+ const base = new URL(baseUrl, window.location.origin);
3706
+ const clean = relPath.replace(/^\/+/, "");
3707
+ return new URL(clean, base).toString();
3708
+ }
3709
+
3710
+ function isWebGLAvailable() {
3711
+ let canvas = void 0;
3712
+ try {
3713
+ if (!window || !document) return false;
3714
+ canvas = document.createElement("canvas");
3715
+ if (!canvas) return false;
3716
+ return !!(window.WebGLRenderingContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl")));
3717
+ } catch {
3718
+ return false;
3719
+ } finally {
3720
+ canvas = void 0;
3721
+ }
3722
+ }
3723
+ function isWebGL2Available() {
3724
+ let canvas = void 0;
3725
+ try {
3726
+ if (!window || !document) return false;
3727
+ canvas = document.createElement("canvas");
3728
+ if (!canvas) return false;
3729
+ return !!(window.WebGL2RenderingContext && canvas.getContext("webgl2"));
3730
+ } finally {
3731
+ canvas = void 0;
3732
+ }
3733
+ }
3734
+
3735
+ export { asRecord, buildPublicUrl, camelToKebab, clamp, cleanObject, createDeferredPromise, filterOutEmptyFields, filterOutEmptyFieldsRecursive, findDuplicateString, findInMap, findKeyInMap, findKeyWithValue, forEachEnum, getBaseTextSize, getBrowserInfo, getFileExtension, getHumanReadableMemorySize, getQueryParams, getUnitsFromCssValue, isAllDefined, isAllNotDefined, isBoolean, isDefined, isEmptyObject, isNotDefined, isObject, isString, isWebGL2Available, isWebGLAvailable, kebabToCamel, nullsToUndefined, omitInArray, omitInObjectWithMutation, omitInObjectWithoutMutation, parseDistName, patchObject, removeDuplicates, removeDuplicatesStr, stripUnits, toBool, toInt, toObservable$, toPosix, toPx, toRem, validateJson };
3736
+ //# sourceMappingURL=index.es.js.map