@mgdis/core-ui-helpers 1.2.1 → 1.2.2

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 (89) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +8 -8
  3. package/rollup.config.mjs +3 -3
  4. package/src/angular/mg-angular-logger/mg-angular-logger.spec.ts +1 -1
  5. package/src/angular/mg-angular-logger/mg-angular-logger.ts +2 -1
  6. package/src/locale/index.spec.ts +10 -1
  7. package/src/locale/locale.spec.ts +43 -18
  8. package/src/locale/locale.ts +13 -5
  9. package/src/playwright/utils/utils.spec.ts +16 -9
  10. package/src/playwright/utils/utils.ts +14 -6
  11. package/src/stencil/ide/cem.spec.ts +4 -4
  12. package/src/stencil/ide/cem.ts +9 -9
  13. package/src/stencil/ide/ide.ts +26 -26
  14. package/src/storybook/stencil/stencil.spec.ts +30 -6
  15. package/src/storybook/stencil/stencil.ts +24 -13
  16. package/src/tests/index.spec.ts +7 -1
  17. package/src/tests/unit/unit.conf.ts +9 -2
  18. package/src/tests/unit/unit.spec.ts +103 -61
  19. package/src/tests/unit/unit.ts +38 -11
  20. package/src/utils/attributes/id/id.spec.ts +9 -6
  21. package/src/utils/attributes/id/id.ts +3 -2
  22. package/src/utils/components/components.spec.ts +6 -6
  23. package/src/utils/components/components.ts +19 -5
  24. package/src/utils/elements/elements.ts +4 -2
  25. package/src/utils/number/number.spec.ts +2 -2
  26. package/src/utils/object/object.spec.ts +2 -2
  27. package/src/utils/object/object.ts +2 -1
  28. package/src/utils/string/string.spec.ts +12 -5
  29. package/src/utils/string/string.ts +2 -1
  30. package/src/utils/windows/windows.spec.ts +6 -2
  31. package/src/vue/mg-model/mg-model.ts +7 -2
  32. package/vitest.config.mts +1 -1
  33. package/.turbo/turbo-build.log +0 -49
  34. package/dist/angular/index.cjs +0 -27
  35. package/dist/angular/index.cjs.map +0 -1
  36. package/dist/angular/index.d.ts +0 -21
  37. package/dist/angular/index.js +0 -25
  38. package/dist/angular/index.js.map +0 -1
  39. package/dist/angular/index.umd.js +0 -33
  40. package/dist/angular/index.umd.js.map +0 -1
  41. package/dist/locale/index.cjs +0 -188
  42. package/dist/locale/index.cjs.map +0 -1
  43. package/dist/locale/index.d.ts +0 -110
  44. package/dist/locale/index.js +0 -179
  45. package/dist/locale/index.js.map +0 -1
  46. package/dist/locale/index.umd.js +0 -194
  47. package/dist/locale/index.umd.js.map +0 -1
  48. package/dist/playwright/index.cjs +0 -130
  49. package/dist/playwright/index.cjs.map +0 -1
  50. package/dist/playwright/index.d.ts +0 -39
  51. package/dist/playwright/index.js +0 -126
  52. package/dist/playwright/index.js.map +0 -1
  53. package/dist/playwright/index.umd.js +0 -136
  54. package/dist/playwright/index.umd.js.map +0 -1
  55. package/dist/stencil/index.cjs +0 -363
  56. package/dist/stencil/index.cjs.map +0 -1
  57. package/dist/stencil/index.d.ts +0 -222
  58. package/dist/stencil/index.js +0 -357
  59. package/dist/stencil/index.js.map +0 -1
  60. package/dist/stencil/index.umd.js +0 -369
  61. package/dist/stencil/index.umd.js.map +0 -1
  62. package/dist/storybook/index.cjs +0 -2333
  63. package/dist/storybook/index.cjs.map +0 -1
  64. package/dist/storybook/index.d.ts +0 -85
  65. package/dist/storybook/index.js +0 -2327
  66. package/dist/storybook/index.js.map +0 -1
  67. package/dist/storybook/index.umd.js +0 -2339
  68. package/dist/storybook/index.umd.js.map +0 -1
  69. package/dist/tests/index.cjs +0 -300
  70. package/dist/tests/index.cjs.map +0 -1
  71. package/dist/tests/index.d.ts +0 -100
  72. package/dist/tests/index.js +0 -294
  73. package/dist/tests/index.js.map +0 -1
  74. package/dist/tests/index.umd.js +0 -306
  75. package/dist/tests/index.umd.js.map +0 -1
  76. package/dist/utils/index.cjs +0 -433
  77. package/dist/utils/index.cjs.map +0 -1
  78. package/dist/utils/index.d.ts +0 -265
  79. package/dist/utils/index.js +0 -409
  80. package/dist/utils/index.js.map +0 -1
  81. package/dist/utils/index.umd.js +0 -439
  82. package/dist/utils/index.umd.js.map +0 -1
  83. package/dist/vue/index.cjs +0 -1934
  84. package/dist/vue/index.cjs.map +0 -1
  85. package/dist/vue/index.d.ts +0 -35
  86. package/dist/vue/index.js +0 -1932
  87. package/dist/vue/index.js.map +0 -1
  88. package/dist/vue/index.umd.js +0 -1940
  89. package/dist/vue/index.umd.js.map +0 -1
package/dist/vue/index.js DELETED
@@ -1,1932 +0,0 @@
1
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
-
3
- function getDefaultExportFromCjs (x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
- }
6
-
7
- /** Detect free variable `global` from Node.js. */
8
-
9
- var _freeGlobal;
10
- var hasRequired_freeGlobal;
11
-
12
- function require_freeGlobal () {
13
- if (hasRequired_freeGlobal) return _freeGlobal;
14
- hasRequired_freeGlobal = 1;
15
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
16
-
17
- _freeGlobal = freeGlobal;
18
- return _freeGlobal;
19
- }
20
-
21
- var _root;
22
- var hasRequired_root;
23
-
24
- function require_root () {
25
- if (hasRequired_root) return _root;
26
- hasRequired_root = 1;
27
- var freeGlobal = require_freeGlobal();
28
-
29
- /** Detect free variable `self`. */
30
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
31
-
32
- /** Used as a reference to the global object. */
33
- var root = freeGlobal || freeSelf || Function('return this')();
34
-
35
- _root = root;
36
- return _root;
37
- }
38
-
39
- var _Symbol;
40
- var hasRequired_Symbol;
41
-
42
- function require_Symbol () {
43
- if (hasRequired_Symbol) return _Symbol;
44
- hasRequired_Symbol = 1;
45
- var root = require_root();
46
-
47
- /** Built-in value references. */
48
- var Symbol = root.Symbol;
49
-
50
- _Symbol = Symbol;
51
- return _Symbol;
52
- }
53
-
54
- var _getRawTag;
55
- var hasRequired_getRawTag;
56
-
57
- function require_getRawTag () {
58
- if (hasRequired_getRawTag) return _getRawTag;
59
- hasRequired_getRawTag = 1;
60
- var Symbol = require_Symbol();
61
-
62
- /** Used for built-in method references. */
63
- var objectProto = Object.prototype;
64
-
65
- /** Used to check objects for own properties. */
66
- var hasOwnProperty = objectProto.hasOwnProperty;
67
-
68
- /**
69
- * Used to resolve the
70
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
71
- * of values.
72
- */
73
- var nativeObjectToString = objectProto.toString;
74
-
75
- /** Built-in value references. */
76
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
77
-
78
- /**
79
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
80
- *
81
- * @private
82
- * @param {*} value The value to query.
83
- * @returns {string} Returns the raw `toStringTag`.
84
- */
85
- function getRawTag(value) {
86
- var isOwn = hasOwnProperty.call(value, symToStringTag),
87
- tag = value[symToStringTag];
88
-
89
- try {
90
- value[symToStringTag] = undefined;
91
- var unmasked = true;
92
- } catch (e) {}
93
-
94
- var result = nativeObjectToString.call(value);
95
- if (unmasked) {
96
- if (isOwn) {
97
- value[symToStringTag] = tag;
98
- } else {
99
- delete value[symToStringTag];
100
- }
101
- }
102
- return result;
103
- }
104
-
105
- _getRawTag = getRawTag;
106
- return _getRawTag;
107
- }
108
-
109
- /** Used for built-in method references. */
110
-
111
- var _objectToString;
112
- var hasRequired_objectToString;
113
-
114
- function require_objectToString () {
115
- if (hasRequired_objectToString) return _objectToString;
116
- hasRequired_objectToString = 1;
117
- var objectProto = Object.prototype;
118
-
119
- /**
120
- * Used to resolve the
121
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
122
- * of values.
123
- */
124
- var nativeObjectToString = objectProto.toString;
125
-
126
- /**
127
- * Converts `value` to a string using `Object.prototype.toString`.
128
- *
129
- * @private
130
- * @param {*} value The value to convert.
131
- * @returns {string} Returns the converted string.
132
- */
133
- function objectToString(value) {
134
- return nativeObjectToString.call(value);
135
- }
136
-
137
- _objectToString = objectToString;
138
- return _objectToString;
139
- }
140
-
141
- var _baseGetTag;
142
- var hasRequired_baseGetTag;
143
-
144
- function require_baseGetTag () {
145
- if (hasRequired_baseGetTag) return _baseGetTag;
146
- hasRequired_baseGetTag = 1;
147
- var Symbol = require_Symbol(),
148
- getRawTag = require_getRawTag(),
149
- objectToString = require_objectToString();
150
-
151
- /** `Object#toString` result references. */
152
- var nullTag = '[object Null]',
153
- undefinedTag = '[object Undefined]';
154
-
155
- /** Built-in value references. */
156
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
157
-
158
- /**
159
- * The base implementation of `getTag` without fallbacks for buggy environments.
160
- *
161
- * @private
162
- * @param {*} value The value to query.
163
- * @returns {string} Returns the `toStringTag`.
164
- */
165
- function baseGetTag(value) {
166
- if (value == null) {
167
- return value === undefined ? undefinedTag : nullTag;
168
- }
169
- return (symToStringTag && symToStringTag in Object(value))
170
- ? getRawTag(value)
171
- : objectToString(value);
172
- }
173
-
174
- _baseGetTag = baseGetTag;
175
- return _baseGetTag;
176
- }
177
-
178
- /**
179
- * Checks if `value` is the
180
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
181
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
182
- *
183
- * @static
184
- * @memberOf _
185
- * @since 0.1.0
186
- * @category Lang
187
- * @param {*} value The value to check.
188
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
189
- * @example
190
- *
191
- * _.isObject({});
192
- * // => true
193
- *
194
- * _.isObject([1, 2, 3]);
195
- * // => true
196
- *
197
- * _.isObject(_.noop);
198
- * // => true
199
- *
200
- * _.isObject(null);
201
- * // => false
202
- */
203
-
204
- var isObject_1;
205
- var hasRequiredIsObject;
206
-
207
- function requireIsObject () {
208
- if (hasRequiredIsObject) return isObject_1;
209
- hasRequiredIsObject = 1;
210
- function isObject(value) {
211
- var type = typeof value;
212
- return value != null && (type == 'object' || type == 'function');
213
- }
214
-
215
- isObject_1 = isObject;
216
- return isObject_1;
217
- }
218
-
219
- var isFunction_1;
220
- var hasRequiredIsFunction;
221
-
222
- function requireIsFunction () {
223
- if (hasRequiredIsFunction) return isFunction_1;
224
- hasRequiredIsFunction = 1;
225
- var baseGetTag = require_baseGetTag(),
226
- isObject = requireIsObject();
227
-
228
- /** `Object#toString` result references. */
229
- var asyncTag = '[object AsyncFunction]',
230
- funcTag = '[object Function]',
231
- genTag = '[object GeneratorFunction]',
232
- proxyTag = '[object Proxy]';
233
-
234
- /**
235
- * Checks if `value` is classified as a `Function` object.
236
- *
237
- * @static
238
- * @memberOf _
239
- * @since 0.1.0
240
- * @category Lang
241
- * @param {*} value The value to check.
242
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
243
- * @example
244
- *
245
- * _.isFunction(_);
246
- * // => true
247
- *
248
- * _.isFunction(/abc/);
249
- * // => false
250
- */
251
- function isFunction(value) {
252
- if (!isObject(value)) {
253
- return false;
254
- }
255
- // The use of `Object#toString` avoids issues with the `typeof` operator
256
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
257
- var tag = baseGetTag(value);
258
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
259
- }
260
-
261
- isFunction_1 = isFunction;
262
- return isFunction_1;
263
- }
264
-
265
- var _coreJsData;
266
- var hasRequired_coreJsData;
267
-
268
- function require_coreJsData () {
269
- if (hasRequired_coreJsData) return _coreJsData;
270
- hasRequired_coreJsData = 1;
271
- var root = require_root();
272
-
273
- /** Used to detect overreaching core-js shims. */
274
- var coreJsData = root['__core-js_shared__'];
275
-
276
- _coreJsData = coreJsData;
277
- return _coreJsData;
278
- }
279
-
280
- var _isMasked;
281
- var hasRequired_isMasked;
282
-
283
- function require_isMasked () {
284
- if (hasRequired_isMasked) return _isMasked;
285
- hasRequired_isMasked = 1;
286
- var coreJsData = require_coreJsData();
287
-
288
- /** Used to detect methods masquerading as native. */
289
- var maskSrcKey = (function() {
290
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
291
- return uid ? ('Symbol(src)_1.' + uid) : '';
292
- }());
293
-
294
- /**
295
- * Checks if `func` has its source masked.
296
- *
297
- * @private
298
- * @param {Function} func The function to check.
299
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
300
- */
301
- function isMasked(func) {
302
- return !!maskSrcKey && (maskSrcKey in func);
303
- }
304
-
305
- _isMasked = isMasked;
306
- return _isMasked;
307
- }
308
-
309
- /** Used for built-in method references. */
310
-
311
- var _toSource;
312
- var hasRequired_toSource;
313
-
314
- function require_toSource () {
315
- if (hasRequired_toSource) return _toSource;
316
- hasRequired_toSource = 1;
317
- var funcProto = Function.prototype;
318
-
319
- /** Used to resolve the decompiled source of functions. */
320
- var funcToString = funcProto.toString;
321
-
322
- /**
323
- * Converts `func` to its source code.
324
- *
325
- * @private
326
- * @param {Function} func The function to convert.
327
- * @returns {string} Returns the source code.
328
- */
329
- function toSource(func) {
330
- if (func != null) {
331
- try {
332
- return funcToString.call(func);
333
- } catch (e) {}
334
- try {
335
- return (func + '');
336
- } catch (e) {}
337
- }
338
- return '';
339
- }
340
-
341
- _toSource = toSource;
342
- return _toSource;
343
- }
344
-
345
- var _baseIsNative;
346
- var hasRequired_baseIsNative;
347
-
348
- function require_baseIsNative () {
349
- if (hasRequired_baseIsNative) return _baseIsNative;
350
- hasRequired_baseIsNative = 1;
351
- var isFunction = requireIsFunction(),
352
- isMasked = require_isMasked(),
353
- isObject = requireIsObject(),
354
- toSource = require_toSource();
355
-
356
- /**
357
- * Used to match `RegExp`
358
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
359
- */
360
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
361
-
362
- /** Used to detect host constructors (Safari). */
363
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
364
-
365
- /** Used for built-in method references. */
366
- var funcProto = Function.prototype,
367
- objectProto = Object.prototype;
368
-
369
- /** Used to resolve the decompiled source of functions. */
370
- var funcToString = funcProto.toString;
371
-
372
- /** Used to check objects for own properties. */
373
- var hasOwnProperty = objectProto.hasOwnProperty;
374
-
375
- /** Used to detect if a method is native. */
376
- var reIsNative = RegExp('^' +
377
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
378
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
379
- );
380
-
381
- /**
382
- * The base implementation of `_.isNative` without bad shim checks.
383
- *
384
- * @private
385
- * @param {*} value The value to check.
386
- * @returns {boolean} Returns `true` if `value` is a native function,
387
- * else `false`.
388
- */
389
- function baseIsNative(value) {
390
- if (!isObject(value) || isMasked(value)) {
391
- return false;
392
- }
393
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
394
- return pattern.test(toSource(value));
395
- }
396
-
397
- _baseIsNative = baseIsNative;
398
- return _baseIsNative;
399
- }
400
-
401
- /**
402
- * Gets the value at `key` of `object`.
403
- *
404
- * @private
405
- * @param {Object} [object] The object to query.
406
- * @param {string} key The key of the property to get.
407
- * @returns {*} Returns the property value.
408
- */
409
-
410
- var _getValue;
411
- var hasRequired_getValue;
412
-
413
- function require_getValue () {
414
- if (hasRequired_getValue) return _getValue;
415
- hasRequired_getValue = 1;
416
- function getValue(object, key) {
417
- return object == null ? undefined : object[key];
418
- }
419
-
420
- _getValue = getValue;
421
- return _getValue;
422
- }
423
-
424
- var _getNative;
425
- var hasRequired_getNative;
426
-
427
- function require_getNative () {
428
- if (hasRequired_getNative) return _getNative;
429
- hasRequired_getNative = 1;
430
- var baseIsNative = require_baseIsNative(),
431
- getValue = require_getValue();
432
-
433
- /**
434
- * Gets the native function at `key` of `object`.
435
- *
436
- * @private
437
- * @param {Object} object The object to query.
438
- * @param {string} key The key of the method to get.
439
- * @returns {*} Returns the function if it's native, else `undefined`.
440
- */
441
- function getNative(object, key) {
442
- var value = getValue(object, key);
443
- return baseIsNative(value) ? value : undefined;
444
- }
445
-
446
- _getNative = getNative;
447
- return _getNative;
448
- }
449
-
450
- var _defineProperty;
451
- var hasRequired_defineProperty;
452
-
453
- function require_defineProperty () {
454
- if (hasRequired_defineProperty) return _defineProperty;
455
- hasRequired_defineProperty = 1;
456
- var getNative = require_getNative();
457
-
458
- var defineProperty = (function() {
459
- try {
460
- var func = getNative(Object, 'defineProperty');
461
- func({}, '', {});
462
- return func;
463
- } catch (e) {}
464
- }());
465
-
466
- _defineProperty = defineProperty;
467
- return _defineProperty;
468
- }
469
-
470
- var _baseAssignValue;
471
- var hasRequired_baseAssignValue;
472
-
473
- function require_baseAssignValue () {
474
- if (hasRequired_baseAssignValue) return _baseAssignValue;
475
- hasRequired_baseAssignValue = 1;
476
- var defineProperty = require_defineProperty();
477
-
478
- /**
479
- * The base implementation of `assignValue` and `assignMergeValue` without
480
- * value checks.
481
- *
482
- * @private
483
- * @param {Object} object The object to modify.
484
- * @param {string} key The key of the property to assign.
485
- * @param {*} value The value to assign.
486
- */
487
- function baseAssignValue(object, key, value) {
488
- if (key == '__proto__' && defineProperty) {
489
- defineProperty(object, key, {
490
- 'configurable': true,
491
- 'enumerable': true,
492
- 'value': value,
493
- 'writable': true
494
- });
495
- } else {
496
- object[key] = value;
497
- }
498
- }
499
-
500
- _baseAssignValue = baseAssignValue;
501
- return _baseAssignValue;
502
- }
503
-
504
- /**
505
- * Performs a
506
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
507
- * comparison between two values to determine if they are equivalent.
508
- *
509
- * @static
510
- * @memberOf _
511
- * @since 4.0.0
512
- * @category Lang
513
- * @param {*} value The value to compare.
514
- * @param {*} other The other value to compare.
515
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
516
- * @example
517
- *
518
- * var object = { 'a': 1 };
519
- * var other = { 'a': 1 };
520
- *
521
- * _.eq(object, object);
522
- * // => true
523
- *
524
- * _.eq(object, other);
525
- * // => false
526
- *
527
- * _.eq('a', 'a');
528
- * // => true
529
- *
530
- * _.eq('a', Object('a'));
531
- * // => false
532
- *
533
- * _.eq(NaN, NaN);
534
- * // => true
535
- */
536
-
537
- var eq_1;
538
- var hasRequiredEq;
539
-
540
- function requireEq () {
541
- if (hasRequiredEq) return eq_1;
542
- hasRequiredEq = 1;
543
- function eq(value, other) {
544
- return value === other || (value !== value && other !== other);
545
- }
546
-
547
- eq_1 = eq;
548
- return eq_1;
549
- }
550
-
551
- var _assignValue;
552
- var hasRequired_assignValue;
553
-
554
- function require_assignValue () {
555
- if (hasRequired_assignValue) return _assignValue;
556
- hasRequired_assignValue = 1;
557
- var baseAssignValue = require_baseAssignValue(),
558
- eq = requireEq();
559
-
560
- /** Used for built-in method references. */
561
- var objectProto = Object.prototype;
562
-
563
- /** Used to check objects for own properties. */
564
- var hasOwnProperty = objectProto.hasOwnProperty;
565
-
566
- /**
567
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
568
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
569
- * for equality comparisons.
570
- *
571
- * @private
572
- * @param {Object} object The object to modify.
573
- * @param {string} key The key of the property to assign.
574
- * @param {*} value The value to assign.
575
- */
576
- function assignValue(object, key, value) {
577
- var objValue = object[key];
578
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
579
- (value === undefined && !(key in object))) {
580
- baseAssignValue(object, key, value);
581
- }
582
- }
583
-
584
- _assignValue = assignValue;
585
- return _assignValue;
586
- }
587
-
588
- /**
589
- * Checks if `value` is classified as an `Array` object.
590
- *
591
- * @static
592
- * @memberOf _
593
- * @since 0.1.0
594
- * @category Lang
595
- * @param {*} value The value to check.
596
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
597
- * @example
598
- *
599
- * _.isArray([1, 2, 3]);
600
- * // => true
601
- *
602
- * _.isArray(document.body.children);
603
- * // => false
604
- *
605
- * _.isArray('abc');
606
- * // => false
607
- *
608
- * _.isArray(_.noop);
609
- * // => false
610
- */
611
-
612
- var isArray_1;
613
- var hasRequiredIsArray;
614
-
615
- function requireIsArray () {
616
- if (hasRequiredIsArray) return isArray_1;
617
- hasRequiredIsArray = 1;
618
- var isArray = Array.isArray;
619
-
620
- isArray_1 = isArray;
621
- return isArray_1;
622
- }
623
-
624
- /**
625
- * Checks if `value` is object-like. A value is object-like if it's not `null`
626
- * and has a `typeof` result of "object".
627
- *
628
- * @static
629
- * @memberOf _
630
- * @since 4.0.0
631
- * @category Lang
632
- * @param {*} value The value to check.
633
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
634
- * @example
635
- *
636
- * _.isObjectLike({});
637
- * // => true
638
- *
639
- * _.isObjectLike([1, 2, 3]);
640
- * // => true
641
- *
642
- * _.isObjectLike(_.noop);
643
- * // => false
644
- *
645
- * _.isObjectLike(null);
646
- * // => false
647
- */
648
-
649
- var isObjectLike_1;
650
- var hasRequiredIsObjectLike;
651
-
652
- function requireIsObjectLike () {
653
- if (hasRequiredIsObjectLike) return isObjectLike_1;
654
- hasRequiredIsObjectLike = 1;
655
- function isObjectLike(value) {
656
- return value != null && typeof value == 'object';
657
- }
658
-
659
- isObjectLike_1 = isObjectLike;
660
- return isObjectLike_1;
661
- }
662
-
663
- var isSymbol_1;
664
- var hasRequiredIsSymbol;
665
-
666
- function requireIsSymbol () {
667
- if (hasRequiredIsSymbol) return isSymbol_1;
668
- hasRequiredIsSymbol = 1;
669
- var baseGetTag = require_baseGetTag(),
670
- isObjectLike = requireIsObjectLike();
671
-
672
- /** `Object#toString` result references. */
673
- var symbolTag = '[object Symbol]';
674
-
675
- /**
676
- * Checks if `value` is classified as a `Symbol` primitive or object.
677
- *
678
- * @static
679
- * @memberOf _
680
- * @since 4.0.0
681
- * @category Lang
682
- * @param {*} value The value to check.
683
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
684
- * @example
685
- *
686
- * _.isSymbol(Symbol.iterator);
687
- * // => true
688
- *
689
- * _.isSymbol('abc');
690
- * // => false
691
- */
692
- function isSymbol(value) {
693
- return typeof value == 'symbol' ||
694
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
695
- }
696
-
697
- isSymbol_1 = isSymbol;
698
- return isSymbol_1;
699
- }
700
-
701
- var _isKey;
702
- var hasRequired_isKey;
703
-
704
- function require_isKey () {
705
- if (hasRequired_isKey) return _isKey;
706
- hasRequired_isKey = 1;
707
- var isArray = requireIsArray(),
708
- isSymbol = requireIsSymbol();
709
-
710
- /** Used to match property names within property paths. */
711
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
712
- reIsPlainProp = /^\w*$/;
713
-
714
- /**
715
- * Checks if `value` is a property name and not a property path.
716
- *
717
- * @private
718
- * @param {*} value The value to check.
719
- * @param {Object} [object] The object to query keys on.
720
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
721
- */
722
- function isKey(value, object) {
723
- if (isArray(value)) {
724
- return false;
725
- }
726
- var type = typeof value;
727
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
728
- value == null || isSymbol(value)) {
729
- return true;
730
- }
731
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
732
- (object != null && value in Object(object));
733
- }
734
-
735
- _isKey = isKey;
736
- return _isKey;
737
- }
738
-
739
- var _nativeCreate;
740
- var hasRequired_nativeCreate;
741
-
742
- function require_nativeCreate () {
743
- if (hasRequired_nativeCreate) return _nativeCreate;
744
- hasRequired_nativeCreate = 1;
745
- var getNative = require_getNative();
746
-
747
- /* Built-in method references that are verified to be native. */
748
- var nativeCreate = getNative(Object, 'create');
749
-
750
- _nativeCreate = nativeCreate;
751
- return _nativeCreate;
752
- }
753
-
754
- var _hashClear;
755
- var hasRequired_hashClear;
756
-
757
- function require_hashClear () {
758
- if (hasRequired_hashClear) return _hashClear;
759
- hasRequired_hashClear = 1;
760
- var nativeCreate = require_nativeCreate();
761
-
762
- /**
763
- * Removes all key-value entries from the hash.
764
- *
765
- * @private
766
- * @name clear
767
- * @memberOf Hash
768
- */
769
- function hashClear() {
770
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
771
- this.size = 0;
772
- }
773
-
774
- _hashClear = hashClear;
775
- return _hashClear;
776
- }
777
-
778
- /**
779
- * Removes `key` and its value from the hash.
780
- *
781
- * @private
782
- * @name delete
783
- * @memberOf Hash
784
- * @param {Object} hash The hash to modify.
785
- * @param {string} key The key of the value to remove.
786
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
787
- */
788
-
789
- var _hashDelete;
790
- var hasRequired_hashDelete;
791
-
792
- function require_hashDelete () {
793
- if (hasRequired_hashDelete) return _hashDelete;
794
- hasRequired_hashDelete = 1;
795
- function hashDelete(key) {
796
- var result = this.has(key) && delete this.__data__[key];
797
- this.size -= result ? 1 : 0;
798
- return result;
799
- }
800
-
801
- _hashDelete = hashDelete;
802
- return _hashDelete;
803
- }
804
-
805
- var _hashGet;
806
- var hasRequired_hashGet;
807
-
808
- function require_hashGet () {
809
- if (hasRequired_hashGet) return _hashGet;
810
- hasRequired_hashGet = 1;
811
- var nativeCreate = require_nativeCreate();
812
-
813
- /** Used to stand-in for `undefined` hash values. */
814
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
815
-
816
- /** Used for built-in method references. */
817
- var objectProto = Object.prototype;
818
-
819
- /** Used to check objects for own properties. */
820
- var hasOwnProperty = objectProto.hasOwnProperty;
821
-
822
- /**
823
- * Gets the hash value for `key`.
824
- *
825
- * @private
826
- * @name get
827
- * @memberOf Hash
828
- * @param {string} key The key of the value to get.
829
- * @returns {*} Returns the entry value.
830
- */
831
- function hashGet(key) {
832
- var data = this.__data__;
833
- if (nativeCreate) {
834
- var result = data[key];
835
- return result === HASH_UNDEFINED ? undefined : result;
836
- }
837
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
838
- }
839
-
840
- _hashGet = hashGet;
841
- return _hashGet;
842
- }
843
-
844
- var _hashHas;
845
- var hasRequired_hashHas;
846
-
847
- function require_hashHas () {
848
- if (hasRequired_hashHas) return _hashHas;
849
- hasRequired_hashHas = 1;
850
- var nativeCreate = require_nativeCreate();
851
-
852
- /** Used for built-in method references. */
853
- var objectProto = Object.prototype;
854
-
855
- /** Used to check objects for own properties. */
856
- var hasOwnProperty = objectProto.hasOwnProperty;
857
-
858
- /**
859
- * Checks if a hash value for `key` exists.
860
- *
861
- * @private
862
- * @name has
863
- * @memberOf Hash
864
- * @param {string} key The key of the entry to check.
865
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
866
- */
867
- function hashHas(key) {
868
- var data = this.__data__;
869
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
870
- }
871
-
872
- _hashHas = hashHas;
873
- return _hashHas;
874
- }
875
-
876
- var _hashSet;
877
- var hasRequired_hashSet;
878
-
879
- function require_hashSet () {
880
- if (hasRequired_hashSet) return _hashSet;
881
- hasRequired_hashSet = 1;
882
- var nativeCreate = require_nativeCreate();
883
-
884
- /** Used to stand-in for `undefined` hash values. */
885
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
886
-
887
- /**
888
- * Sets the hash `key` to `value`.
889
- *
890
- * @private
891
- * @name set
892
- * @memberOf Hash
893
- * @param {string} key The key of the value to set.
894
- * @param {*} value The value to set.
895
- * @returns {Object} Returns the hash instance.
896
- */
897
- function hashSet(key, value) {
898
- var data = this.__data__;
899
- this.size += this.has(key) ? 0 : 1;
900
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
901
- return this;
902
- }
903
-
904
- _hashSet = hashSet;
905
- return _hashSet;
906
- }
907
-
908
- var _Hash;
909
- var hasRequired_Hash;
910
-
911
- function require_Hash () {
912
- if (hasRequired_Hash) return _Hash;
913
- hasRequired_Hash = 1;
914
- var hashClear = require_hashClear(),
915
- hashDelete = require_hashDelete(),
916
- hashGet = require_hashGet(),
917
- hashHas = require_hashHas(),
918
- hashSet = require_hashSet();
919
-
920
- /**
921
- * Creates a hash object.
922
- *
923
- * @private
924
- * @constructor
925
- * @param {Array} [entries] The key-value pairs to cache.
926
- */
927
- function Hash(entries) {
928
- var index = -1,
929
- length = entries == null ? 0 : entries.length;
930
-
931
- this.clear();
932
- while (++index < length) {
933
- var entry = entries[index];
934
- this.set(entry[0], entry[1]);
935
- }
936
- }
937
-
938
- // Add methods to `Hash`.
939
- Hash.prototype.clear = hashClear;
940
- Hash.prototype['delete'] = hashDelete;
941
- Hash.prototype.get = hashGet;
942
- Hash.prototype.has = hashHas;
943
- Hash.prototype.set = hashSet;
944
-
945
- _Hash = Hash;
946
- return _Hash;
947
- }
948
-
949
- /**
950
- * Removes all key-value entries from the list cache.
951
- *
952
- * @private
953
- * @name clear
954
- * @memberOf ListCache
955
- */
956
-
957
- var _listCacheClear;
958
- var hasRequired_listCacheClear;
959
-
960
- function require_listCacheClear () {
961
- if (hasRequired_listCacheClear) return _listCacheClear;
962
- hasRequired_listCacheClear = 1;
963
- function listCacheClear() {
964
- this.__data__ = [];
965
- this.size = 0;
966
- }
967
-
968
- _listCacheClear = listCacheClear;
969
- return _listCacheClear;
970
- }
971
-
972
- var _assocIndexOf;
973
- var hasRequired_assocIndexOf;
974
-
975
- function require_assocIndexOf () {
976
- if (hasRequired_assocIndexOf) return _assocIndexOf;
977
- hasRequired_assocIndexOf = 1;
978
- var eq = requireEq();
979
-
980
- /**
981
- * Gets the index at which the `key` is found in `array` of key-value pairs.
982
- *
983
- * @private
984
- * @param {Array} array The array to inspect.
985
- * @param {*} key The key to search for.
986
- * @returns {number} Returns the index of the matched value, else `-1`.
987
- */
988
- function assocIndexOf(array, key) {
989
- var length = array.length;
990
- while (length--) {
991
- if (eq(array[length][0], key)) {
992
- return length;
993
- }
994
- }
995
- return -1;
996
- }
997
-
998
- _assocIndexOf = assocIndexOf;
999
- return _assocIndexOf;
1000
- }
1001
-
1002
- var _listCacheDelete;
1003
- var hasRequired_listCacheDelete;
1004
-
1005
- function require_listCacheDelete () {
1006
- if (hasRequired_listCacheDelete) return _listCacheDelete;
1007
- hasRequired_listCacheDelete = 1;
1008
- var assocIndexOf = require_assocIndexOf();
1009
-
1010
- /** Used for built-in method references. */
1011
- var arrayProto = Array.prototype;
1012
-
1013
- /** Built-in value references. */
1014
- var splice = arrayProto.splice;
1015
-
1016
- /**
1017
- * Removes `key` and its value from the list cache.
1018
- *
1019
- * @private
1020
- * @name delete
1021
- * @memberOf ListCache
1022
- * @param {string} key The key of the value to remove.
1023
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1024
- */
1025
- function listCacheDelete(key) {
1026
- var data = this.__data__,
1027
- index = assocIndexOf(data, key);
1028
-
1029
- if (index < 0) {
1030
- return false;
1031
- }
1032
- var lastIndex = data.length - 1;
1033
- if (index == lastIndex) {
1034
- data.pop();
1035
- } else {
1036
- splice.call(data, index, 1);
1037
- }
1038
- --this.size;
1039
- return true;
1040
- }
1041
-
1042
- _listCacheDelete = listCacheDelete;
1043
- return _listCacheDelete;
1044
- }
1045
-
1046
- var _listCacheGet;
1047
- var hasRequired_listCacheGet;
1048
-
1049
- function require_listCacheGet () {
1050
- if (hasRequired_listCacheGet) return _listCacheGet;
1051
- hasRequired_listCacheGet = 1;
1052
- var assocIndexOf = require_assocIndexOf();
1053
-
1054
- /**
1055
- * Gets the list cache value for `key`.
1056
- *
1057
- * @private
1058
- * @name get
1059
- * @memberOf ListCache
1060
- * @param {string} key The key of the value to get.
1061
- * @returns {*} Returns the entry value.
1062
- */
1063
- function listCacheGet(key) {
1064
- var data = this.__data__,
1065
- index = assocIndexOf(data, key);
1066
-
1067
- return index < 0 ? undefined : data[index][1];
1068
- }
1069
-
1070
- _listCacheGet = listCacheGet;
1071
- return _listCacheGet;
1072
- }
1073
-
1074
- var _listCacheHas;
1075
- var hasRequired_listCacheHas;
1076
-
1077
- function require_listCacheHas () {
1078
- if (hasRequired_listCacheHas) return _listCacheHas;
1079
- hasRequired_listCacheHas = 1;
1080
- var assocIndexOf = require_assocIndexOf();
1081
-
1082
- /**
1083
- * Checks if a list cache value for `key` exists.
1084
- *
1085
- * @private
1086
- * @name has
1087
- * @memberOf ListCache
1088
- * @param {string} key The key of the entry to check.
1089
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1090
- */
1091
- function listCacheHas(key) {
1092
- return assocIndexOf(this.__data__, key) > -1;
1093
- }
1094
-
1095
- _listCacheHas = listCacheHas;
1096
- return _listCacheHas;
1097
- }
1098
-
1099
- var _listCacheSet;
1100
- var hasRequired_listCacheSet;
1101
-
1102
- function require_listCacheSet () {
1103
- if (hasRequired_listCacheSet) return _listCacheSet;
1104
- hasRequired_listCacheSet = 1;
1105
- var assocIndexOf = require_assocIndexOf();
1106
-
1107
- /**
1108
- * Sets the list cache `key` to `value`.
1109
- *
1110
- * @private
1111
- * @name set
1112
- * @memberOf ListCache
1113
- * @param {string} key The key of the value to set.
1114
- * @param {*} value The value to set.
1115
- * @returns {Object} Returns the list cache instance.
1116
- */
1117
- function listCacheSet(key, value) {
1118
- var data = this.__data__,
1119
- index = assocIndexOf(data, key);
1120
-
1121
- if (index < 0) {
1122
- ++this.size;
1123
- data.push([key, value]);
1124
- } else {
1125
- data[index][1] = value;
1126
- }
1127
- return this;
1128
- }
1129
-
1130
- _listCacheSet = listCacheSet;
1131
- return _listCacheSet;
1132
- }
1133
-
1134
- var _ListCache;
1135
- var hasRequired_ListCache;
1136
-
1137
- function require_ListCache () {
1138
- if (hasRequired_ListCache) return _ListCache;
1139
- hasRequired_ListCache = 1;
1140
- var listCacheClear = require_listCacheClear(),
1141
- listCacheDelete = require_listCacheDelete(),
1142
- listCacheGet = require_listCacheGet(),
1143
- listCacheHas = require_listCacheHas(),
1144
- listCacheSet = require_listCacheSet();
1145
-
1146
- /**
1147
- * Creates an list cache object.
1148
- *
1149
- * @private
1150
- * @constructor
1151
- * @param {Array} [entries] The key-value pairs to cache.
1152
- */
1153
- function ListCache(entries) {
1154
- var index = -1,
1155
- length = entries == null ? 0 : entries.length;
1156
-
1157
- this.clear();
1158
- while (++index < length) {
1159
- var entry = entries[index];
1160
- this.set(entry[0], entry[1]);
1161
- }
1162
- }
1163
-
1164
- // Add methods to `ListCache`.
1165
- ListCache.prototype.clear = listCacheClear;
1166
- ListCache.prototype['delete'] = listCacheDelete;
1167
- ListCache.prototype.get = listCacheGet;
1168
- ListCache.prototype.has = listCacheHas;
1169
- ListCache.prototype.set = listCacheSet;
1170
-
1171
- _ListCache = ListCache;
1172
- return _ListCache;
1173
- }
1174
-
1175
- var _Map;
1176
- var hasRequired_Map;
1177
-
1178
- function require_Map () {
1179
- if (hasRequired_Map) return _Map;
1180
- hasRequired_Map = 1;
1181
- var getNative = require_getNative(),
1182
- root = require_root();
1183
-
1184
- /* Built-in method references that are verified to be native. */
1185
- var Map = getNative(root, 'Map');
1186
-
1187
- _Map = Map;
1188
- return _Map;
1189
- }
1190
-
1191
- var _mapCacheClear;
1192
- var hasRequired_mapCacheClear;
1193
-
1194
- function require_mapCacheClear () {
1195
- if (hasRequired_mapCacheClear) return _mapCacheClear;
1196
- hasRequired_mapCacheClear = 1;
1197
- var Hash = require_Hash(),
1198
- ListCache = require_ListCache(),
1199
- Map = require_Map();
1200
-
1201
- /**
1202
- * Removes all key-value entries from the map.
1203
- *
1204
- * @private
1205
- * @name clear
1206
- * @memberOf MapCache
1207
- */
1208
- function mapCacheClear() {
1209
- this.size = 0;
1210
- this.__data__ = {
1211
- 'hash': new Hash,
1212
- 'map': new (Map || ListCache),
1213
- 'string': new Hash
1214
- };
1215
- }
1216
-
1217
- _mapCacheClear = mapCacheClear;
1218
- return _mapCacheClear;
1219
- }
1220
-
1221
- /**
1222
- * Checks if `value` is suitable for use as unique object key.
1223
- *
1224
- * @private
1225
- * @param {*} value The value to check.
1226
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1227
- */
1228
-
1229
- var _isKeyable;
1230
- var hasRequired_isKeyable;
1231
-
1232
- function require_isKeyable () {
1233
- if (hasRequired_isKeyable) return _isKeyable;
1234
- hasRequired_isKeyable = 1;
1235
- function isKeyable(value) {
1236
- var type = typeof value;
1237
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1238
- ? (value !== '__proto__')
1239
- : (value === null);
1240
- }
1241
-
1242
- _isKeyable = isKeyable;
1243
- return _isKeyable;
1244
- }
1245
-
1246
- var _getMapData;
1247
- var hasRequired_getMapData;
1248
-
1249
- function require_getMapData () {
1250
- if (hasRequired_getMapData) return _getMapData;
1251
- hasRequired_getMapData = 1;
1252
- var isKeyable = require_isKeyable();
1253
-
1254
- /**
1255
- * Gets the data for `map`.
1256
- *
1257
- * @private
1258
- * @param {Object} map The map to query.
1259
- * @param {string} key The reference key.
1260
- * @returns {*} Returns the map data.
1261
- */
1262
- function getMapData(map, key) {
1263
- var data = map.__data__;
1264
- return isKeyable(key)
1265
- ? data[typeof key == 'string' ? 'string' : 'hash']
1266
- : data.map;
1267
- }
1268
-
1269
- _getMapData = getMapData;
1270
- return _getMapData;
1271
- }
1272
-
1273
- var _mapCacheDelete;
1274
- var hasRequired_mapCacheDelete;
1275
-
1276
- function require_mapCacheDelete () {
1277
- if (hasRequired_mapCacheDelete) return _mapCacheDelete;
1278
- hasRequired_mapCacheDelete = 1;
1279
- var getMapData = require_getMapData();
1280
-
1281
- /**
1282
- * Removes `key` and its value from the map.
1283
- *
1284
- * @private
1285
- * @name delete
1286
- * @memberOf MapCache
1287
- * @param {string} key The key of the value to remove.
1288
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1289
- */
1290
- function mapCacheDelete(key) {
1291
- var result = getMapData(this, key)['delete'](key);
1292
- this.size -= result ? 1 : 0;
1293
- return result;
1294
- }
1295
-
1296
- _mapCacheDelete = mapCacheDelete;
1297
- return _mapCacheDelete;
1298
- }
1299
-
1300
- var _mapCacheGet;
1301
- var hasRequired_mapCacheGet;
1302
-
1303
- function require_mapCacheGet () {
1304
- if (hasRequired_mapCacheGet) return _mapCacheGet;
1305
- hasRequired_mapCacheGet = 1;
1306
- var getMapData = require_getMapData();
1307
-
1308
- /**
1309
- * Gets the map value for `key`.
1310
- *
1311
- * @private
1312
- * @name get
1313
- * @memberOf MapCache
1314
- * @param {string} key The key of the value to get.
1315
- * @returns {*} Returns the entry value.
1316
- */
1317
- function mapCacheGet(key) {
1318
- return getMapData(this, key).get(key);
1319
- }
1320
-
1321
- _mapCacheGet = mapCacheGet;
1322
- return _mapCacheGet;
1323
- }
1324
-
1325
- var _mapCacheHas;
1326
- var hasRequired_mapCacheHas;
1327
-
1328
- function require_mapCacheHas () {
1329
- if (hasRequired_mapCacheHas) return _mapCacheHas;
1330
- hasRequired_mapCacheHas = 1;
1331
- var getMapData = require_getMapData();
1332
-
1333
- /**
1334
- * Checks if a map value for `key` exists.
1335
- *
1336
- * @private
1337
- * @name has
1338
- * @memberOf MapCache
1339
- * @param {string} key The key of the entry to check.
1340
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1341
- */
1342
- function mapCacheHas(key) {
1343
- return getMapData(this, key).has(key);
1344
- }
1345
-
1346
- _mapCacheHas = mapCacheHas;
1347
- return _mapCacheHas;
1348
- }
1349
-
1350
- var _mapCacheSet;
1351
- var hasRequired_mapCacheSet;
1352
-
1353
- function require_mapCacheSet () {
1354
- if (hasRequired_mapCacheSet) return _mapCacheSet;
1355
- hasRequired_mapCacheSet = 1;
1356
- var getMapData = require_getMapData();
1357
-
1358
- /**
1359
- * Sets the map `key` to `value`.
1360
- *
1361
- * @private
1362
- * @name set
1363
- * @memberOf MapCache
1364
- * @param {string} key The key of the value to set.
1365
- * @param {*} value The value to set.
1366
- * @returns {Object} Returns the map cache instance.
1367
- */
1368
- function mapCacheSet(key, value) {
1369
- var data = getMapData(this, key),
1370
- size = data.size;
1371
-
1372
- data.set(key, value);
1373
- this.size += data.size == size ? 0 : 1;
1374
- return this;
1375
- }
1376
-
1377
- _mapCacheSet = mapCacheSet;
1378
- return _mapCacheSet;
1379
- }
1380
-
1381
- var _MapCache;
1382
- var hasRequired_MapCache;
1383
-
1384
- function require_MapCache () {
1385
- if (hasRequired_MapCache) return _MapCache;
1386
- hasRequired_MapCache = 1;
1387
- var mapCacheClear = require_mapCacheClear(),
1388
- mapCacheDelete = require_mapCacheDelete(),
1389
- mapCacheGet = require_mapCacheGet(),
1390
- mapCacheHas = require_mapCacheHas(),
1391
- mapCacheSet = require_mapCacheSet();
1392
-
1393
- /**
1394
- * Creates a map cache object to store key-value pairs.
1395
- *
1396
- * @private
1397
- * @constructor
1398
- * @param {Array} [entries] The key-value pairs to cache.
1399
- */
1400
- function MapCache(entries) {
1401
- var index = -1,
1402
- length = entries == null ? 0 : entries.length;
1403
-
1404
- this.clear();
1405
- while (++index < length) {
1406
- var entry = entries[index];
1407
- this.set(entry[0], entry[1]);
1408
- }
1409
- }
1410
-
1411
- // Add methods to `MapCache`.
1412
- MapCache.prototype.clear = mapCacheClear;
1413
- MapCache.prototype['delete'] = mapCacheDelete;
1414
- MapCache.prototype.get = mapCacheGet;
1415
- MapCache.prototype.has = mapCacheHas;
1416
- MapCache.prototype.set = mapCacheSet;
1417
-
1418
- _MapCache = MapCache;
1419
- return _MapCache;
1420
- }
1421
-
1422
- var memoize_1;
1423
- var hasRequiredMemoize;
1424
-
1425
- function requireMemoize () {
1426
- if (hasRequiredMemoize) return memoize_1;
1427
- hasRequiredMemoize = 1;
1428
- var MapCache = require_MapCache();
1429
-
1430
- /** Error message constants. */
1431
- var FUNC_ERROR_TEXT = 'Expected a function';
1432
-
1433
- /**
1434
- * Creates a function that memoizes the result of `func`. If `resolver` is
1435
- * provided, it determines the cache key for storing the result based on the
1436
- * arguments provided to the memoized function. By default, the first argument
1437
- * provided to the memoized function is used as the map cache key. The `func`
1438
- * is invoked with the `this` binding of the memoized function.
1439
- *
1440
- * **Note:** The cache is exposed as the `cache` property on the memoized
1441
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
1442
- * constructor with one whose instances implement the
1443
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1444
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1445
- *
1446
- * @static
1447
- * @memberOf _
1448
- * @since 0.1.0
1449
- * @category Function
1450
- * @param {Function} func The function to have its output memoized.
1451
- * @param {Function} [resolver] The function to resolve the cache key.
1452
- * @returns {Function} Returns the new memoized function.
1453
- * @example
1454
- *
1455
- * var object = { 'a': 1, 'b': 2 };
1456
- * var other = { 'c': 3, 'd': 4 };
1457
- *
1458
- * var values = _.memoize(_.values);
1459
- * values(object);
1460
- * // => [1, 2]
1461
- *
1462
- * values(other);
1463
- * // => [3, 4]
1464
- *
1465
- * object.a = 2;
1466
- * values(object);
1467
- * // => [1, 2]
1468
- *
1469
- * // Modify the result cache.
1470
- * values.cache.set(object, ['a', 'b']);
1471
- * values(object);
1472
- * // => ['a', 'b']
1473
- *
1474
- * // Replace `_.memoize.Cache`.
1475
- * _.memoize.Cache = WeakMap;
1476
- */
1477
- function memoize(func, resolver) {
1478
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1479
- throw new TypeError(FUNC_ERROR_TEXT);
1480
- }
1481
- var memoized = function() {
1482
- var args = arguments,
1483
- key = resolver ? resolver.apply(this, args) : args[0],
1484
- cache = memoized.cache;
1485
-
1486
- if (cache.has(key)) {
1487
- return cache.get(key);
1488
- }
1489
- var result = func.apply(this, args);
1490
- memoized.cache = cache.set(key, result) || cache;
1491
- return result;
1492
- };
1493
- memoized.cache = new (memoize.Cache || MapCache);
1494
- return memoized;
1495
- }
1496
-
1497
- // Expose `MapCache`.
1498
- memoize.Cache = MapCache;
1499
-
1500
- memoize_1 = memoize;
1501
- return memoize_1;
1502
- }
1503
-
1504
- var _memoizeCapped;
1505
- var hasRequired_memoizeCapped;
1506
-
1507
- function require_memoizeCapped () {
1508
- if (hasRequired_memoizeCapped) return _memoizeCapped;
1509
- hasRequired_memoizeCapped = 1;
1510
- var memoize = requireMemoize();
1511
-
1512
- /** Used as the maximum memoize cache size. */
1513
- var MAX_MEMOIZE_SIZE = 500;
1514
-
1515
- /**
1516
- * A specialized version of `_.memoize` which clears the memoized function's
1517
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1518
- *
1519
- * @private
1520
- * @param {Function} func The function to have its output memoized.
1521
- * @returns {Function} Returns the new memoized function.
1522
- */
1523
- function memoizeCapped(func) {
1524
- var result = memoize(func, function(key) {
1525
- if (cache.size === MAX_MEMOIZE_SIZE) {
1526
- cache.clear();
1527
- }
1528
- return key;
1529
- });
1530
-
1531
- var cache = result.cache;
1532
- return result;
1533
- }
1534
-
1535
- _memoizeCapped = memoizeCapped;
1536
- return _memoizeCapped;
1537
- }
1538
-
1539
- var _stringToPath;
1540
- var hasRequired_stringToPath;
1541
-
1542
- function require_stringToPath () {
1543
- if (hasRequired_stringToPath) return _stringToPath;
1544
- hasRequired_stringToPath = 1;
1545
- var memoizeCapped = require_memoizeCapped();
1546
-
1547
- /** Used to match property names within property paths. */
1548
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1549
-
1550
- /** Used to match backslashes in property paths. */
1551
- var reEscapeChar = /\\(\\)?/g;
1552
-
1553
- /**
1554
- * Converts `string` to a property path array.
1555
- *
1556
- * @private
1557
- * @param {string} string The string to convert.
1558
- * @returns {Array} Returns the property path array.
1559
- */
1560
- var stringToPath = memoizeCapped(function(string) {
1561
- var result = [];
1562
- if (string.charCodeAt(0) === 46 /* . */) {
1563
- result.push('');
1564
- }
1565
- string.replace(rePropName, function(match, number, quote, subString) {
1566
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1567
- });
1568
- return result;
1569
- });
1570
-
1571
- _stringToPath = stringToPath;
1572
- return _stringToPath;
1573
- }
1574
-
1575
- /**
1576
- * A specialized version of `_.map` for arrays without support for iteratee
1577
- * shorthands.
1578
- *
1579
- * @private
1580
- * @param {Array} [array] The array to iterate over.
1581
- * @param {Function} iteratee The function invoked per iteration.
1582
- * @returns {Array} Returns the new mapped array.
1583
- */
1584
-
1585
- var _arrayMap;
1586
- var hasRequired_arrayMap;
1587
-
1588
- function require_arrayMap () {
1589
- if (hasRequired_arrayMap) return _arrayMap;
1590
- hasRequired_arrayMap = 1;
1591
- function arrayMap(array, iteratee) {
1592
- var index = -1,
1593
- length = array == null ? 0 : array.length,
1594
- result = Array(length);
1595
-
1596
- while (++index < length) {
1597
- result[index] = iteratee(array[index], index, array);
1598
- }
1599
- return result;
1600
- }
1601
-
1602
- _arrayMap = arrayMap;
1603
- return _arrayMap;
1604
- }
1605
-
1606
- var _baseToString;
1607
- var hasRequired_baseToString;
1608
-
1609
- function require_baseToString () {
1610
- if (hasRequired_baseToString) return _baseToString;
1611
- hasRequired_baseToString = 1;
1612
- var Symbol = require_Symbol(),
1613
- arrayMap = require_arrayMap(),
1614
- isArray = requireIsArray(),
1615
- isSymbol = requireIsSymbol();
1616
-
1617
- /** Used to convert symbols to primitives and strings. */
1618
- var symbolProto = Symbol ? Symbol.prototype : undefined,
1619
- symbolToString = symbolProto ? symbolProto.toString : undefined;
1620
-
1621
- /**
1622
- * The base implementation of `_.toString` which doesn't convert nullish
1623
- * values to empty strings.
1624
- *
1625
- * @private
1626
- * @param {*} value The value to process.
1627
- * @returns {string} Returns the string.
1628
- */
1629
- function baseToString(value) {
1630
- // Exit early for strings to avoid a performance hit in some environments.
1631
- if (typeof value == 'string') {
1632
- return value;
1633
- }
1634
- if (isArray(value)) {
1635
- // Recursively convert values (susceptible to call stack limits).
1636
- return arrayMap(value, baseToString) + '';
1637
- }
1638
- if (isSymbol(value)) {
1639
- return symbolToString ? symbolToString.call(value) : '';
1640
- }
1641
- var result = (value + '');
1642
- return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1643
- }
1644
-
1645
- _baseToString = baseToString;
1646
- return _baseToString;
1647
- }
1648
-
1649
- var toString_1;
1650
- var hasRequiredToString;
1651
-
1652
- function requireToString () {
1653
- if (hasRequiredToString) return toString_1;
1654
- hasRequiredToString = 1;
1655
- var baseToString = require_baseToString();
1656
-
1657
- /**
1658
- * Converts `value` to a string. An empty string is returned for `null`
1659
- * and `undefined` values. The sign of `-0` is preserved.
1660
- *
1661
- * @static
1662
- * @memberOf _
1663
- * @since 4.0.0
1664
- * @category Lang
1665
- * @param {*} value The value to convert.
1666
- * @returns {string} Returns the converted string.
1667
- * @example
1668
- *
1669
- * _.toString(null);
1670
- * // => ''
1671
- *
1672
- * _.toString(-0);
1673
- * // => '-0'
1674
- *
1675
- * _.toString([1, 2, 3]);
1676
- * // => '1,2,3'
1677
- */
1678
- function toString(value) {
1679
- return value == null ? '' : baseToString(value);
1680
- }
1681
-
1682
- toString_1 = toString;
1683
- return toString_1;
1684
- }
1685
-
1686
- var _castPath;
1687
- var hasRequired_castPath;
1688
-
1689
- function require_castPath () {
1690
- if (hasRequired_castPath) return _castPath;
1691
- hasRequired_castPath = 1;
1692
- var isArray = requireIsArray(),
1693
- isKey = require_isKey(),
1694
- stringToPath = require_stringToPath(),
1695
- toString = requireToString();
1696
-
1697
- /**
1698
- * Casts `value` to a path array if it's not one.
1699
- *
1700
- * @private
1701
- * @param {*} value The value to inspect.
1702
- * @param {Object} [object] The object to query keys on.
1703
- * @returns {Array} Returns the cast property path array.
1704
- */
1705
- function castPath(value, object) {
1706
- if (isArray(value)) {
1707
- return value;
1708
- }
1709
- return isKey(value, object) ? [value] : stringToPath(toString(value));
1710
- }
1711
-
1712
- _castPath = castPath;
1713
- return _castPath;
1714
- }
1715
-
1716
- /** Used as references for various `Number` constants. */
1717
-
1718
- var _isIndex;
1719
- var hasRequired_isIndex;
1720
-
1721
- function require_isIndex () {
1722
- if (hasRequired_isIndex) return _isIndex;
1723
- hasRequired_isIndex = 1;
1724
- var MAX_SAFE_INTEGER = 9007199254740991;
1725
-
1726
- /** Used to detect unsigned integer values. */
1727
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1728
-
1729
- /**
1730
- * Checks if `value` is a valid array-like index.
1731
- *
1732
- * @private
1733
- * @param {*} value The value to check.
1734
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1735
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1736
- */
1737
- function isIndex(value, length) {
1738
- var type = typeof value;
1739
- length = length == null ? MAX_SAFE_INTEGER : length;
1740
-
1741
- return !!length &&
1742
- (type == 'number' ||
1743
- (type != 'symbol' && reIsUint.test(value))) &&
1744
- (value > -1 && value % 1 == 0 && value < length);
1745
- }
1746
-
1747
- _isIndex = isIndex;
1748
- return _isIndex;
1749
- }
1750
-
1751
- var _toKey;
1752
- var hasRequired_toKey;
1753
-
1754
- function require_toKey () {
1755
- if (hasRequired_toKey) return _toKey;
1756
- hasRequired_toKey = 1;
1757
- var isSymbol = requireIsSymbol();
1758
-
1759
- /**
1760
- * Converts `value` to a string key if it's not a string or symbol.
1761
- *
1762
- * @private
1763
- * @param {*} value The value to inspect.
1764
- * @returns {string|symbol} Returns the key.
1765
- */
1766
- function toKey(value) {
1767
- if (typeof value == 'string' || isSymbol(value)) {
1768
- return value;
1769
- }
1770
- var result = (value + '');
1771
- return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1772
- }
1773
-
1774
- _toKey = toKey;
1775
- return _toKey;
1776
- }
1777
-
1778
- var _baseSet;
1779
- var hasRequired_baseSet;
1780
-
1781
- function require_baseSet () {
1782
- if (hasRequired_baseSet) return _baseSet;
1783
- hasRequired_baseSet = 1;
1784
- var assignValue = require_assignValue(),
1785
- castPath = require_castPath(),
1786
- isIndex = require_isIndex(),
1787
- isObject = requireIsObject(),
1788
- toKey = require_toKey();
1789
-
1790
- /**
1791
- * The base implementation of `_.set`.
1792
- *
1793
- * @private
1794
- * @param {Object} object The object to modify.
1795
- * @param {Array|string} path The path of the property to set.
1796
- * @param {*} value The value to set.
1797
- * @param {Function} [customizer] The function to customize path creation.
1798
- * @returns {Object} Returns `object`.
1799
- */
1800
- function baseSet(object, path, value, customizer) {
1801
- if (!isObject(object)) {
1802
- return object;
1803
- }
1804
- path = castPath(path, object);
1805
-
1806
- var index = -1,
1807
- length = path.length,
1808
- lastIndex = length - 1,
1809
- nested = object;
1810
-
1811
- while (nested != null && ++index < length) {
1812
- var key = toKey(path[index]),
1813
- newValue = value;
1814
-
1815
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
1816
- return object;
1817
- }
1818
-
1819
- if (index != lastIndex) {
1820
- var objValue = nested[key];
1821
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
1822
- if (newValue === undefined) {
1823
- newValue = isObject(objValue)
1824
- ? objValue
1825
- : (isIndex(path[index + 1]) ? [] : {});
1826
- }
1827
- }
1828
- assignValue(nested, key, newValue);
1829
- nested = nested[key];
1830
- }
1831
- return object;
1832
- }
1833
-
1834
- _baseSet = baseSet;
1835
- return _baseSet;
1836
- }
1837
-
1838
- var set_1;
1839
- var hasRequiredSet;
1840
-
1841
- function requireSet () {
1842
- if (hasRequiredSet) return set_1;
1843
- hasRequiredSet = 1;
1844
- var baseSet = require_baseSet();
1845
-
1846
- /**
1847
- * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
1848
- * it's created. Arrays are created for missing index properties while objects
1849
- * are created for all other missing properties. Use `_.setWith` to customize
1850
- * `path` creation.
1851
- *
1852
- * **Note:** This method mutates `object`.
1853
- *
1854
- * @static
1855
- * @memberOf _
1856
- * @since 3.7.0
1857
- * @category Object
1858
- * @param {Object} object The object to modify.
1859
- * @param {Array|string} path The path of the property to set.
1860
- * @param {*} value The value to set.
1861
- * @returns {Object} Returns `object`.
1862
- * @example
1863
- *
1864
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1865
- *
1866
- * _.set(object, 'a[0].b.c', 4);
1867
- * console.log(object.a[0].b.c);
1868
- * // => 4
1869
- *
1870
- * _.set(object, ['x', '0', 'y', 'z'], 5);
1871
- * console.log(object.x[0].y.z);
1872
- * // => 5
1873
- */
1874
- function set(object, path, value) {
1875
- return object == null ? object : baseSet(object, path, value);
1876
- }
1877
-
1878
- set_1 = set;
1879
- return set_1;
1880
- }
1881
-
1882
- var setExports = requireSet();
1883
- var set = /*@__PURE__*/getDefaultExportFromCjs(setExports);
1884
-
1885
- const wm = new WeakMap();
1886
- /**
1887
- * Custom `v-mg-model` directive
1888
- *
1889
- * @remarks
1890
- * Packages requirements
1891
- * - "\@mgdis/mg-components": \>=3
1892
- * - "vue": \>=2
1893
- * - "lodash"
1894
- *
1895
- * @example
1896
- * ```js
1897
- * // src/main.js
1898
- * import Vue from 'vue';
1899
- * import App from './App.vue';
1900
- * import { mgModel } from '@mgdis/core-ui-helpers/dist/vue';
1901
- *
1902
- * Vue.use(mgModel);
1903
- *
1904
- * new Vue({
1905
- * render: (h) => h(App),
1906
- * }).$mount('#app');
1907
- * ```
1908
- */
1909
- const mgModel = {
1910
- install(Vue) {
1911
- Vue.directive('mg-model', {
1912
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1913
- bind(el, binding, vnode) {
1914
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1915
- const valueChangeHandler = (event) => set(vnode.context, binding.expression, event.target.value);
1916
- wm.set(el, valueChangeHandler);
1917
- el.value = binding.value ?? '';
1918
- el.addEventListener('value-change', valueChangeHandler);
1919
- },
1920
- componentUpdated(el, binding) {
1921
- el.value = binding.value ?? '';
1922
- },
1923
- unbind(el) {
1924
- const valueChangeHandler = wm.get(el);
1925
- el.removeEventListener('value-change', valueChangeHandler);
1926
- },
1927
- });
1928
- },
1929
- };
1930
-
1931
- export { mgModel };
1932
- //# sourceMappingURL=index.js.map