cloudinary-video-player 3.14.1 → 3.14.2-edge.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 (80) hide show
  1. package/README.md +3 -13
  2. package/dist/149.min.js +6 -0
  3. package/dist/309.min.js +3 -3
  4. package/dist/689.min.js +2 -2
  5. package/dist/801.min.js +6 -0
  6. package/dist/adaptive-streaming.js +2 -2
  7. package/dist/adaptive-streaming.min.js +2 -2
  8. package/dist/chapters.js +2 -2
  9. package/dist/chapters.min.js +2 -2
  10. package/dist/cld-player-core.js +3119 -11
  11. package/dist/cld-player-core.min.js +3 -3
  12. package/dist/cld-poster-url.js +2 -2
  13. package/dist/cld-poster-url.min.js +2 -2
  14. package/dist/cld-video-player.css +5 -5
  15. package/dist/cld-video-player.js +43 -42
  16. package/dist/cld-video-player.light.js +43 -42
  17. package/dist/cld-video-player.light.min.js +3 -5
  18. package/dist/cld-video-player.min.css +2 -2
  19. package/dist/cld-video-player.min.js +3 -5
  20. package/dist/colors.js +2 -2
  21. package/dist/colors.min.js +2 -2
  22. package/dist/dash.js +2 -2
  23. package/dist/dash.min.js +2 -2
  24. package/dist/debug.js +2 -2
  25. package/dist/debug.min.js +2 -2
  26. package/dist/ima.js +2 -2
  27. package/dist/ima.min.js +2 -2
  28. package/dist/interaction-areas.js +7 -7
  29. package/dist/interaction-areas.min.js +3 -3
  30. package/dist/node_modules_lodash_throttle_js.js +2 -2
  31. package/dist/{video-player_js.js → player-full.js} +1398 -29
  32. package/dist/player-full.min.js +6 -0
  33. package/dist/player.css +3128 -0
  34. package/dist/{cld-video-player-lazy.js → player.js} +69 -101
  35. package/dist/player.min.css +5 -0
  36. package/dist/player.min.js +6 -0
  37. package/dist/playlist.js +2 -2
  38. package/dist/playlist.min.js +2 -2
  39. package/dist/recommendations-overlay.js +2 -2
  40. package/dist/recommendations-overlay.min.js +2 -2
  41. package/dist/share.js +2 -2
  42. package/dist/share.min.js +2 -2
  43. package/dist/shoppable.js +23 -23
  44. package/dist/shoppable.min.js +3 -3
  45. package/dist/utils_fetch-config_js.js +101 -2
  46. package/dist/utils_schedule_js.js +2 -2
  47. package/dist/visual-search.js +2 -2
  48. package/dist/visual-search.min.js +2 -2
  49. package/lib/all.js +3 -4
  50. package/lib/chapters.js +2 -3
  51. package/lib/cld-video-player.min.css +2 -2
  52. package/lib/cloudinary-config-from-options.js +21 -2775
  53. package/lib/colors.js +3 -2
  54. package/lib/debug.js +2 -2
  55. package/lib/fetch-config.js +0 -2
  56. package/lib/index.full.js +57 -0
  57. package/lib/index.js +128 -11
  58. package/lib/index2.js +10331 -0
  59. package/lib/{interaction-areas.service.js → interaction-areas.js} +4 -3
  60. package/lib/player-api.js +7 -2
  61. package/lib/player.min.css +5 -0
  62. package/lib/playlist-panel.js +1 -1
  63. package/lib/playlist.js +4 -3
  64. package/lib/recommendations-overlay.js +2 -3
  65. package/lib/share.js +2 -3
  66. package/lib/shoppable-post-widget.js +1 -1
  67. package/lib/{shoppable-widget.js → shoppable.js} +1 -2
  68. package/lib/throttle.js +1 -1
  69. package/lib/toNumber.js +2 -2
  70. package/lib/validators-functions.js +2 -47
  71. package/lib/video-player.const.js +47 -5
  72. package/lib/video-player.js +401 -7997
  73. package/package.json +22 -23
  74. package/dist/350.min.js +0 -6
  75. package/dist/933.min.js +0 -8
  76. package/dist/cld-video-player-lazy.min.js +0 -6
  77. package/dist/plugins_cloudinary_url-helpers_js-utils_cloudinary-config-from-options_js-utils_querystring_j-adfe37.js +0 -996
  78. package/lib/lazy.js +0 -19
  79. package/lib/player.js +0 -9
  80. package/lib/videoPlayer.js +0 -9
@@ -1,2341 +1,15 @@
1
- import { g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
2
- import { a as require_root, b as requireIsFunction, r as requireIsObject, c as require_baseGetTag, e as requireIsObjectLike, d as requireIsArray, f as require_Symbol, C as CLOUDINARY_CONFIG_PARAM } from './video-player.const.js';
3
-
4
- var _coreJsData;
5
- var hasRequired_coreJsData;
6
-
7
- function require_coreJsData () {
8
- if (hasRequired_coreJsData) return _coreJsData;
9
- hasRequired_coreJsData = 1;
10
- var root = require_root();
11
-
12
- /** Used to detect overreaching core-js shims. */
13
- var coreJsData = root['__core-js_shared__'];
14
-
15
- _coreJsData = coreJsData;
16
- return _coreJsData;
17
- }
18
-
19
- var _isMasked;
20
- var hasRequired_isMasked;
21
-
22
- function require_isMasked () {
23
- if (hasRequired_isMasked) return _isMasked;
24
- hasRequired_isMasked = 1;
25
- var coreJsData = require_coreJsData();
26
-
27
- /** Used to detect methods masquerading as native. */
28
- var maskSrcKey = (function() {
29
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
30
- return uid ? ('Symbol(src)_1.' + uid) : '';
31
- }());
32
-
33
- /**
34
- * Checks if `func` has its source masked.
35
- *
36
- * @private
37
- * @param {Function} func The function to check.
38
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
39
- */
40
- function isMasked(func) {
41
- return !!maskSrcKey && (maskSrcKey in func);
42
- }
43
-
44
- _isMasked = isMasked;
45
- return _isMasked;
46
- }
47
-
48
- /** Used for built-in method references. */
49
-
50
- var _toSource;
51
- var hasRequired_toSource;
52
-
53
- function require_toSource () {
54
- if (hasRequired_toSource) return _toSource;
55
- hasRequired_toSource = 1;
56
- var funcProto = Function.prototype;
57
-
58
- /** Used to resolve the decompiled source of functions. */
59
- var funcToString = funcProto.toString;
60
-
61
- /**
62
- * Converts `func` to its source code.
63
- *
64
- * @private
65
- * @param {Function} func The function to convert.
66
- * @returns {string} Returns the source code.
67
- */
68
- function toSource(func) {
69
- if (func != null) {
70
- try {
71
- return funcToString.call(func);
72
- } catch (e) {}
73
- try {
74
- return (func + '');
75
- } catch (e) {}
76
- }
77
- return '';
78
- }
79
-
80
- _toSource = toSource;
81
- return _toSource;
82
- }
83
-
84
- var _baseIsNative;
85
- var hasRequired_baseIsNative;
86
-
87
- function require_baseIsNative () {
88
- if (hasRequired_baseIsNative) return _baseIsNative;
89
- hasRequired_baseIsNative = 1;
90
- var isFunction = requireIsFunction(),
91
- isMasked = require_isMasked(),
92
- isObject = requireIsObject(),
93
- toSource = require_toSource();
94
-
95
- /**
96
- * Used to match `RegExp`
97
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
98
- */
99
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
100
-
101
- /** Used to detect host constructors (Safari). */
102
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
103
-
104
- /** Used for built-in method references. */
105
- var funcProto = Function.prototype,
106
- objectProto = Object.prototype;
107
-
108
- /** Used to resolve the decompiled source of functions. */
109
- var funcToString = funcProto.toString;
110
-
111
- /** Used to check objects for own properties. */
112
- var hasOwnProperty = objectProto.hasOwnProperty;
113
-
114
- /** Used to detect if a method is native. */
115
- var reIsNative = RegExp('^' +
116
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
117
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
118
- );
119
-
120
- /**
121
- * The base implementation of `_.isNative` without bad shim checks.
122
- *
123
- * @private
124
- * @param {*} value The value to check.
125
- * @returns {boolean} Returns `true` if `value` is a native function,
126
- * else `false`.
127
- */
128
- function baseIsNative(value) {
129
- if (!isObject(value) || isMasked(value)) {
130
- return false;
131
- }
132
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
133
- return pattern.test(toSource(value));
134
- }
135
-
136
- _baseIsNative = baseIsNative;
137
- return _baseIsNative;
138
- }
139
-
140
- /**
141
- * Gets the value at `key` of `object`.
142
- *
143
- * @private
144
- * @param {Object} [object] The object to query.
145
- * @param {string} key The key of the property to get.
146
- * @returns {*} Returns the property value.
147
- */
148
-
149
- var _getValue;
150
- var hasRequired_getValue;
151
-
152
- function require_getValue () {
153
- if (hasRequired_getValue) return _getValue;
154
- hasRequired_getValue = 1;
155
- function getValue(object, key) {
156
- return object == null ? undefined : object[key];
157
- }
158
-
159
- _getValue = getValue;
160
- return _getValue;
161
- }
162
-
163
- var _getNative;
164
- var hasRequired_getNative;
165
-
166
- function require_getNative () {
167
- if (hasRequired_getNative) return _getNative;
168
- hasRequired_getNative = 1;
169
- var baseIsNative = require_baseIsNative(),
170
- getValue = require_getValue();
171
-
172
- /**
173
- * Gets the native function at `key` of `object`.
174
- *
175
- * @private
176
- * @param {Object} object The object to query.
177
- * @param {string} key The key of the method to get.
178
- * @returns {*} Returns the function if it's native, else `undefined`.
179
- */
180
- function getNative(object, key) {
181
- var value = getValue(object, key);
182
- return baseIsNative(value) ? value : undefined;
183
- }
184
-
185
- _getNative = getNative;
186
- return _getNative;
187
- }
188
-
189
- var _Map;
190
- var hasRequired_Map;
191
-
192
- function require_Map () {
193
- if (hasRequired_Map) return _Map;
194
- hasRequired_Map = 1;
195
- var getNative = require_getNative(),
196
- root = require_root();
197
-
198
- /* Built-in method references that are verified to be native. */
199
- var Map = getNative(root, 'Map');
200
-
201
- _Map = Map;
202
- return _Map;
203
- }
204
-
205
- var _baseIsArguments;
206
- var hasRequired_baseIsArguments;
207
-
208
- function require_baseIsArguments () {
209
- if (hasRequired_baseIsArguments) return _baseIsArguments;
210
- hasRequired_baseIsArguments = 1;
211
- var baseGetTag = require_baseGetTag(),
212
- isObjectLike = requireIsObjectLike();
213
-
214
- /** `Object#toString` result references. */
215
- var argsTag = '[object Arguments]';
216
-
217
- /**
218
- * The base implementation of `_.isArguments`.
219
- *
220
- * @private
221
- * @param {*} value The value to check.
222
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
223
- */
224
- function baseIsArguments(value) {
225
- return isObjectLike(value) && baseGetTag(value) == argsTag;
226
- }
227
-
228
- _baseIsArguments = baseIsArguments;
229
- return _baseIsArguments;
230
- }
231
-
232
- var isArguments_1;
233
- var hasRequiredIsArguments;
234
-
235
- function requireIsArguments () {
236
- if (hasRequiredIsArguments) return isArguments_1;
237
- hasRequiredIsArguments = 1;
238
- var baseIsArguments = require_baseIsArguments(),
239
- isObjectLike = requireIsObjectLike();
240
-
241
- /** Used for built-in method references. */
242
- var objectProto = Object.prototype;
243
-
244
- /** Used to check objects for own properties. */
245
- var hasOwnProperty = objectProto.hasOwnProperty;
246
-
247
- /** Built-in value references. */
248
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
249
-
250
- /**
251
- * Checks if `value` is likely an `arguments` object.
252
- *
253
- * @static
254
- * @memberOf _
255
- * @since 0.1.0
256
- * @category Lang
257
- * @param {*} value The value to check.
258
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
259
- * else `false`.
260
- * @example
261
- *
262
- * _.isArguments(function() { return arguments; }());
263
- * // => true
264
- *
265
- * _.isArguments([1, 2, 3]);
266
- * // => false
267
- */
268
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
269
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
270
- !propertyIsEnumerable.call(value, 'callee');
271
- };
272
-
273
- isArguments_1 = isArguments;
274
- return isArguments_1;
275
- }
276
-
277
- /** Used as references for various `Number` constants. */
278
-
279
- var isLength_1;
280
- var hasRequiredIsLength;
281
-
282
- function requireIsLength () {
283
- if (hasRequiredIsLength) return isLength_1;
284
- hasRequiredIsLength = 1;
285
- var MAX_SAFE_INTEGER = 9007199254740991;
286
-
287
- /**
288
- * Checks if `value` is a valid array-like length.
289
- *
290
- * **Note:** This method is loosely based on
291
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
292
- *
293
- * @static
294
- * @memberOf _
295
- * @since 4.0.0
296
- * @category Lang
297
- * @param {*} value The value to check.
298
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
299
- * @example
300
- *
301
- * _.isLength(3);
302
- * // => true
303
- *
304
- * _.isLength(Number.MIN_VALUE);
305
- * // => false
306
- *
307
- * _.isLength(Infinity);
308
- * // => false
309
- *
310
- * _.isLength('3');
311
- * // => false
312
- */
313
- function isLength(value) {
314
- return typeof value == 'number' &&
315
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
316
- }
317
-
318
- isLength_1 = isLength;
319
- return isLength_1;
320
- }
321
-
322
- var isSymbol_1;
323
- var hasRequiredIsSymbol;
324
-
325
- function requireIsSymbol () {
326
- if (hasRequiredIsSymbol) return isSymbol_1;
327
- hasRequiredIsSymbol = 1;
328
- var baseGetTag = require_baseGetTag(),
329
- isObjectLike = requireIsObjectLike();
330
-
331
- /** `Object#toString` result references. */
332
- var symbolTag = '[object Symbol]';
333
-
334
- /**
335
- * Checks if `value` is classified as a `Symbol` primitive or object.
336
- *
337
- * @static
338
- * @memberOf _
339
- * @since 4.0.0
340
- * @category Lang
341
- * @param {*} value The value to check.
342
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
343
- * @example
344
- *
345
- * _.isSymbol(Symbol.iterator);
346
- * // => true
347
- *
348
- * _.isSymbol('abc');
349
- * // => false
350
- */
351
- function isSymbol(value) {
352
- return typeof value == 'symbol' ||
353
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
354
- }
355
-
356
- isSymbol_1 = isSymbol;
357
- return isSymbol_1;
358
- }
359
-
360
- var _isKey;
361
- var hasRequired_isKey;
362
-
363
- function require_isKey () {
364
- if (hasRequired_isKey) return _isKey;
365
- hasRequired_isKey = 1;
366
- var isArray = requireIsArray(),
367
- isSymbol = requireIsSymbol();
368
-
369
- /** Used to match property names within property paths. */
370
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
371
- reIsPlainProp = /^\w*$/;
372
-
373
- /**
374
- * Checks if `value` is a property name and not a property path.
375
- *
376
- * @private
377
- * @param {*} value The value to check.
378
- * @param {Object} [object] The object to query keys on.
379
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
380
- */
381
- function isKey(value, object) {
382
- if (isArray(value)) {
383
- return false;
384
- }
385
- var type = typeof value;
386
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
387
- value == null || isSymbol(value)) {
388
- return true;
389
- }
390
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
391
- (object != null && value in Object(object));
392
- }
393
-
394
- _isKey = isKey;
395
- return _isKey;
396
- }
397
-
398
- var _nativeCreate;
399
- var hasRequired_nativeCreate;
400
-
401
- function require_nativeCreate () {
402
- if (hasRequired_nativeCreate) return _nativeCreate;
403
- hasRequired_nativeCreate = 1;
404
- var getNative = require_getNative();
405
-
406
- /* Built-in method references that are verified to be native. */
407
- var nativeCreate = getNative(Object, 'create');
408
-
409
- _nativeCreate = nativeCreate;
410
- return _nativeCreate;
411
- }
412
-
413
- var _hashClear;
414
- var hasRequired_hashClear;
415
-
416
- function require_hashClear () {
417
- if (hasRequired_hashClear) return _hashClear;
418
- hasRequired_hashClear = 1;
419
- var nativeCreate = require_nativeCreate();
420
-
421
- /**
422
- * Removes all key-value entries from the hash.
423
- *
424
- * @private
425
- * @name clear
426
- * @memberOf Hash
427
- */
428
- function hashClear() {
429
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
430
- this.size = 0;
431
- }
432
-
433
- _hashClear = hashClear;
434
- return _hashClear;
435
- }
436
-
437
- /**
438
- * Removes `key` and its value from the hash.
439
- *
440
- * @private
441
- * @name delete
442
- * @memberOf Hash
443
- * @param {Object} hash The hash to modify.
444
- * @param {string} key The key of the value to remove.
445
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
446
- */
447
-
448
- var _hashDelete;
449
- var hasRequired_hashDelete;
450
-
451
- function require_hashDelete () {
452
- if (hasRequired_hashDelete) return _hashDelete;
453
- hasRequired_hashDelete = 1;
454
- function hashDelete(key) {
455
- var result = this.has(key) && delete this.__data__[key];
456
- this.size -= result ? 1 : 0;
457
- return result;
458
- }
459
-
460
- _hashDelete = hashDelete;
461
- return _hashDelete;
462
- }
463
-
464
- var _hashGet;
465
- var hasRequired_hashGet;
466
-
467
- function require_hashGet () {
468
- if (hasRequired_hashGet) return _hashGet;
469
- hasRequired_hashGet = 1;
470
- var nativeCreate = require_nativeCreate();
471
-
472
- /** Used to stand-in for `undefined` hash values. */
473
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
474
-
475
- /** Used for built-in method references. */
476
- var objectProto = Object.prototype;
477
-
478
- /** Used to check objects for own properties. */
479
- var hasOwnProperty = objectProto.hasOwnProperty;
480
-
481
- /**
482
- * Gets the hash value for `key`.
483
- *
484
- * @private
485
- * @name get
486
- * @memberOf Hash
487
- * @param {string} key The key of the value to get.
488
- * @returns {*} Returns the entry value.
489
- */
490
- function hashGet(key) {
491
- var data = this.__data__;
492
- if (nativeCreate) {
493
- var result = data[key];
494
- return result === HASH_UNDEFINED ? undefined : result;
495
- }
496
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
497
- }
498
-
499
- _hashGet = hashGet;
500
- return _hashGet;
501
- }
502
-
503
- var _hashHas;
504
- var hasRequired_hashHas;
505
-
506
- function require_hashHas () {
507
- if (hasRequired_hashHas) return _hashHas;
508
- hasRequired_hashHas = 1;
509
- var nativeCreate = require_nativeCreate();
510
-
511
- /** Used for built-in method references. */
512
- var objectProto = Object.prototype;
513
-
514
- /** Used to check objects for own properties. */
515
- var hasOwnProperty = objectProto.hasOwnProperty;
516
-
517
- /**
518
- * Checks if a hash value for `key` exists.
519
- *
520
- * @private
521
- * @name has
522
- * @memberOf Hash
523
- * @param {string} key The key of the entry to check.
524
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
525
- */
526
- function hashHas(key) {
527
- var data = this.__data__;
528
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
529
- }
530
-
531
- _hashHas = hashHas;
532
- return _hashHas;
533
- }
534
-
535
- var _hashSet;
536
- var hasRequired_hashSet;
537
-
538
- function require_hashSet () {
539
- if (hasRequired_hashSet) return _hashSet;
540
- hasRequired_hashSet = 1;
541
- var nativeCreate = require_nativeCreate();
542
-
543
- /** Used to stand-in for `undefined` hash values. */
544
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
545
-
546
- /**
547
- * Sets the hash `key` to `value`.
548
- *
549
- * @private
550
- * @name set
551
- * @memberOf Hash
552
- * @param {string} key The key of the value to set.
553
- * @param {*} value The value to set.
554
- * @returns {Object} Returns the hash instance.
555
- */
556
- function hashSet(key, value) {
557
- var data = this.__data__;
558
- this.size += this.has(key) ? 0 : 1;
559
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
560
- return this;
561
- }
562
-
563
- _hashSet = hashSet;
564
- return _hashSet;
565
- }
566
-
567
- var _Hash;
568
- var hasRequired_Hash;
569
-
570
- function require_Hash () {
571
- if (hasRequired_Hash) return _Hash;
572
- hasRequired_Hash = 1;
573
- var hashClear = require_hashClear(),
574
- hashDelete = require_hashDelete(),
575
- hashGet = require_hashGet(),
576
- hashHas = require_hashHas(),
577
- hashSet = require_hashSet();
578
-
579
- /**
580
- * Creates a hash object.
581
- *
582
- * @private
583
- * @constructor
584
- * @param {Array} [entries] The key-value pairs to cache.
585
- */
586
- function Hash(entries) {
587
- var index = -1,
588
- length = entries == null ? 0 : entries.length;
589
-
590
- this.clear();
591
- while (++index < length) {
592
- var entry = entries[index];
593
- this.set(entry[0], entry[1]);
594
- }
595
- }
596
-
597
- // Add methods to `Hash`.
598
- Hash.prototype.clear = hashClear;
599
- Hash.prototype['delete'] = hashDelete;
600
- Hash.prototype.get = hashGet;
601
- Hash.prototype.has = hashHas;
602
- Hash.prototype.set = hashSet;
603
-
604
- _Hash = Hash;
605
- return _Hash;
606
- }
607
-
608
- /**
609
- * Removes all key-value entries from the list cache.
610
- *
611
- * @private
612
- * @name clear
613
- * @memberOf ListCache
614
- */
615
-
616
- var _listCacheClear;
617
- var hasRequired_listCacheClear;
618
-
619
- function require_listCacheClear () {
620
- if (hasRequired_listCacheClear) return _listCacheClear;
621
- hasRequired_listCacheClear = 1;
622
- function listCacheClear() {
623
- this.__data__ = [];
624
- this.size = 0;
625
- }
626
-
627
- _listCacheClear = listCacheClear;
628
- return _listCacheClear;
629
- }
630
-
631
- /**
632
- * Performs a
633
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
634
- * comparison between two values to determine if they are equivalent.
635
- *
636
- * @static
637
- * @memberOf _
638
- * @since 4.0.0
639
- * @category Lang
640
- * @param {*} value The value to compare.
641
- * @param {*} other The other value to compare.
642
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
643
- * @example
644
- *
645
- * var object = { 'a': 1 };
646
- * var other = { 'a': 1 };
647
- *
648
- * _.eq(object, object);
649
- * // => true
650
- *
651
- * _.eq(object, other);
652
- * // => false
653
- *
654
- * _.eq('a', 'a');
655
- * // => true
656
- *
657
- * _.eq('a', Object('a'));
658
- * // => false
659
- *
660
- * _.eq(NaN, NaN);
661
- * // => true
662
- */
663
-
664
- var eq_1;
665
- var hasRequiredEq;
666
-
667
- function requireEq () {
668
- if (hasRequiredEq) return eq_1;
669
- hasRequiredEq = 1;
670
- function eq(value, other) {
671
- return value === other || (value !== value && other !== other);
672
- }
673
-
674
- eq_1 = eq;
675
- return eq_1;
676
- }
677
-
678
- var _assocIndexOf;
679
- var hasRequired_assocIndexOf;
680
-
681
- function require_assocIndexOf () {
682
- if (hasRequired_assocIndexOf) return _assocIndexOf;
683
- hasRequired_assocIndexOf = 1;
684
- var eq = requireEq();
685
-
686
- /**
687
- * Gets the index at which the `key` is found in `array` of key-value pairs.
688
- *
689
- * @private
690
- * @param {Array} array The array to inspect.
691
- * @param {*} key The key to search for.
692
- * @returns {number} Returns the index of the matched value, else `-1`.
693
- */
694
- function assocIndexOf(array, key) {
695
- var length = array.length;
696
- while (length--) {
697
- if (eq(array[length][0], key)) {
698
- return length;
699
- }
700
- }
701
- return -1;
702
- }
703
-
704
- _assocIndexOf = assocIndexOf;
705
- return _assocIndexOf;
706
- }
707
-
708
- var _listCacheDelete;
709
- var hasRequired_listCacheDelete;
710
-
711
- function require_listCacheDelete () {
712
- if (hasRequired_listCacheDelete) return _listCacheDelete;
713
- hasRequired_listCacheDelete = 1;
714
- var assocIndexOf = require_assocIndexOf();
715
-
716
- /** Used for built-in method references. */
717
- var arrayProto = Array.prototype;
718
-
719
- /** Built-in value references. */
720
- var splice = arrayProto.splice;
721
-
722
- /**
723
- * Removes `key` and its value from the list cache.
724
- *
725
- * @private
726
- * @name delete
727
- * @memberOf ListCache
728
- * @param {string} key The key of the value to remove.
729
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
730
- */
731
- function listCacheDelete(key) {
732
- var data = this.__data__,
733
- index = assocIndexOf(data, key);
734
-
735
- if (index < 0) {
736
- return false;
737
- }
738
- var lastIndex = data.length - 1;
739
- if (index == lastIndex) {
740
- data.pop();
741
- } else {
742
- splice.call(data, index, 1);
743
- }
744
- --this.size;
745
- return true;
746
- }
747
-
748
- _listCacheDelete = listCacheDelete;
749
- return _listCacheDelete;
750
- }
751
-
752
- var _listCacheGet;
753
- var hasRequired_listCacheGet;
754
-
755
- function require_listCacheGet () {
756
- if (hasRequired_listCacheGet) return _listCacheGet;
757
- hasRequired_listCacheGet = 1;
758
- var assocIndexOf = require_assocIndexOf();
759
-
760
- /**
761
- * Gets the list cache value for `key`.
762
- *
763
- * @private
764
- * @name get
765
- * @memberOf ListCache
766
- * @param {string} key The key of the value to get.
767
- * @returns {*} Returns the entry value.
768
- */
769
- function listCacheGet(key) {
770
- var data = this.__data__,
771
- index = assocIndexOf(data, key);
772
-
773
- return index < 0 ? undefined : data[index][1];
774
- }
775
-
776
- _listCacheGet = listCacheGet;
777
- return _listCacheGet;
778
- }
779
-
780
- var _listCacheHas;
781
- var hasRequired_listCacheHas;
782
-
783
- function require_listCacheHas () {
784
- if (hasRequired_listCacheHas) return _listCacheHas;
785
- hasRequired_listCacheHas = 1;
786
- var assocIndexOf = require_assocIndexOf();
787
-
788
- /**
789
- * Checks if a list cache value for `key` exists.
790
- *
791
- * @private
792
- * @name has
793
- * @memberOf ListCache
794
- * @param {string} key The key of the entry to check.
795
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
796
- */
797
- function listCacheHas(key) {
798
- return assocIndexOf(this.__data__, key) > -1;
799
- }
800
-
801
- _listCacheHas = listCacheHas;
802
- return _listCacheHas;
803
- }
804
-
805
- var _listCacheSet;
806
- var hasRequired_listCacheSet;
807
-
808
- function require_listCacheSet () {
809
- if (hasRequired_listCacheSet) return _listCacheSet;
810
- hasRequired_listCacheSet = 1;
811
- var assocIndexOf = require_assocIndexOf();
812
-
813
- /**
814
- * Sets the list cache `key` to `value`.
815
- *
816
- * @private
817
- * @name set
818
- * @memberOf ListCache
819
- * @param {string} key The key of the value to set.
820
- * @param {*} value The value to set.
821
- * @returns {Object} Returns the list cache instance.
822
- */
823
- function listCacheSet(key, value) {
824
- var data = this.__data__,
825
- index = assocIndexOf(data, key);
826
-
827
- if (index < 0) {
828
- ++this.size;
829
- data.push([key, value]);
830
- } else {
831
- data[index][1] = value;
832
- }
833
- return this;
834
- }
835
-
836
- _listCacheSet = listCacheSet;
837
- return _listCacheSet;
838
- }
839
-
840
- var _ListCache;
841
- var hasRequired_ListCache;
842
-
843
- function require_ListCache () {
844
- if (hasRequired_ListCache) return _ListCache;
845
- hasRequired_ListCache = 1;
846
- var listCacheClear = require_listCacheClear(),
847
- listCacheDelete = require_listCacheDelete(),
848
- listCacheGet = require_listCacheGet(),
849
- listCacheHas = require_listCacheHas(),
850
- listCacheSet = require_listCacheSet();
851
-
852
- /**
853
- * Creates an list cache object.
854
- *
855
- * @private
856
- * @constructor
857
- * @param {Array} [entries] The key-value pairs to cache.
858
- */
859
- function ListCache(entries) {
860
- var index = -1,
861
- length = entries == null ? 0 : entries.length;
862
-
863
- this.clear();
864
- while (++index < length) {
865
- var entry = entries[index];
866
- this.set(entry[0], entry[1]);
867
- }
868
- }
869
-
870
- // Add methods to `ListCache`.
871
- ListCache.prototype.clear = listCacheClear;
872
- ListCache.prototype['delete'] = listCacheDelete;
873
- ListCache.prototype.get = listCacheGet;
874
- ListCache.prototype.has = listCacheHas;
875
- ListCache.prototype.set = listCacheSet;
876
-
877
- _ListCache = ListCache;
878
- return _ListCache;
879
- }
880
-
881
- var _mapCacheClear;
882
- var hasRequired_mapCacheClear;
883
-
884
- function require_mapCacheClear () {
885
- if (hasRequired_mapCacheClear) return _mapCacheClear;
886
- hasRequired_mapCacheClear = 1;
887
- var Hash = require_Hash(),
888
- ListCache = require_ListCache(),
889
- Map = require_Map();
890
-
891
- /**
892
- * Removes all key-value entries from the map.
893
- *
894
- * @private
895
- * @name clear
896
- * @memberOf MapCache
897
- */
898
- function mapCacheClear() {
899
- this.size = 0;
900
- this.__data__ = {
901
- 'hash': new Hash,
902
- 'map': new (Map || ListCache),
903
- 'string': new Hash
904
- };
905
- }
906
-
907
- _mapCacheClear = mapCacheClear;
908
- return _mapCacheClear;
909
- }
910
-
911
- /**
912
- * Checks if `value` is suitable for use as unique object key.
913
- *
914
- * @private
915
- * @param {*} value The value to check.
916
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
917
- */
918
-
919
- var _isKeyable;
920
- var hasRequired_isKeyable;
921
-
922
- function require_isKeyable () {
923
- if (hasRequired_isKeyable) return _isKeyable;
924
- hasRequired_isKeyable = 1;
925
- function isKeyable(value) {
926
- var type = typeof value;
927
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
928
- ? (value !== '__proto__')
929
- : (value === null);
930
- }
931
-
932
- _isKeyable = isKeyable;
933
- return _isKeyable;
934
- }
935
-
936
- var _getMapData;
937
- var hasRequired_getMapData;
938
-
939
- function require_getMapData () {
940
- if (hasRequired_getMapData) return _getMapData;
941
- hasRequired_getMapData = 1;
942
- var isKeyable = require_isKeyable();
943
-
944
- /**
945
- * Gets the data for `map`.
946
- *
947
- * @private
948
- * @param {Object} map The map to query.
949
- * @param {string} key The reference key.
950
- * @returns {*} Returns the map data.
951
- */
952
- function getMapData(map, key) {
953
- var data = map.__data__;
954
- return isKeyable(key)
955
- ? data[typeof key == 'string' ? 'string' : 'hash']
956
- : data.map;
957
- }
958
-
959
- _getMapData = getMapData;
960
- return _getMapData;
961
- }
962
-
963
- var _mapCacheDelete;
964
- var hasRequired_mapCacheDelete;
965
-
966
- function require_mapCacheDelete () {
967
- if (hasRequired_mapCacheDelete) return _mapCacheDelete;
968
- hasRequired_mapCacheDelete = 1;
969
- var getMapData = require_getMapData();
970
-
971
- /**
972
- * Removes `key` and its value from the map.
973
- *
974
- * @private
975
- * @name delete
976
- * @memberOf MapCache
977
- * @param {string} key The key of the value to remove.
978
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
979
- */
980
- function mapCacheDelete(key) {
981
- var result = getMapData(this, key)['delete'](key);
982
- this.size -= result ? 1 : 0;
983
- return result;
984
- }
985
-
986
- _mapCacheDelete = mapCacheDelete;
987
- return _mapCacheDelete;
988
- }
989
-
990
- var _mapCacheGet;
991
- var hasRequired_mapCacheGet;
992
-
993
- function require_mapCacheGet () {
994
- if (hasRequired_mapCacheGet) return _mapCacheGet;
995
- hasRequired_mapCacheGet = 1;
996
- var getMapData = require_getMapData();
997
-
998
- /**
999
- * Gets the map value for `key`.
1000
- *
1001
- * @private
1002
- * @name get
1003
- * @memberOf MapCache
1004
- * @param {string} key The key of the value to get.
1005
- * @returns {*} Returns the entry value.
1006
- */
1007
- function mapCacheGet(key) {
1008
- return getMapData(this, key).get(key);
1009
- }
1010
-
1011
- _mapCacheGet = mapCacheGet;
1012
- return _mapCacheGet;
1013
- }
1014
-
1015
- var _mapCacheHas;
1016
- var hasRequired_mapCacheHas;
1017
-
1018
- function require_mapCacheHas () {
1019
- if (hasRequired_mapCacheHas) return _mapCacheHas;
1020
- hasRequired_mapCacheHas = 1;
1021
- var getMapData = require_getMapData();
1022
-
1023
- /**
1024
- * Checks if a map value for `key` exists.
1025
- *
1026
- * @private
1027
- * @name has
1028
- * @memberOf MapCache
1029
- * @param {string} key The key of the entry to check.
1030
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1031
- */
1032
- function mapCacheHas(key) {
1033
- return getMapData(this, key).has(key);
1034
- }
1035
-
1036
- _mapCacheHas = mapCacheHas;
1037
- return _mapCacheHas;
1038
- }
1039
-
1040
- var _mapCacheSet;
1041
- var hasRequired_mapCacheSet;
1042
-
1043
- function require_mapCacheSet () {
1044
- if (hasRequired_mapCacheSet) return _mapCacheSet;
1045
- hasRequired_mapCacheSet = 1;
1046
- var getMapData = require_getMapData();
1047
-
1048
- /**
1049
- * Sets the map `key` to `value`.
1050
- *
1051
- * @private
1052
- * @name set
1053
- * @memberOf MapCache
1054
- * @param {string} key The key of the value to set.
1055
- * @param {*} value The value to set.
1056
- * @returns {Object} Returns the map cache instance.
1057
- */
1058
- function mapCacheSet(key, value) {
1059
- var data = getMapData(this, key),
1060
- size = data.size;
1061
-
1062
- data.set(key, value);
1063
- this.size += data.size == size ? 0 : 1;
1064
- return this;
1065
- }
1066
-
1067
- _mapCacheSet = mapCacheSet;
1068
- return _mapCacheSet;
1069
- }
1070
-
1071
- var _MapCache;
1072
- var hasRequired_MapCache;
1073
-
1074
- function require_MapCache () {
1075
- if (hasRequired_MapCache) return _MapCache;
1076
- hasRequired_MapCache = 1;
1077
- var mapCacheClear = require_mapCacheClear(),
1078
- mapCacheDelete = require_mapCacheDelete(),
1079
- mapCacheGet = require_mapCacheGet(),
1080
- mapCacheHas = require_mapCacheHas(),
1081
- mapCacheSet = require_mapCacheSet();
1082
-
1083
- /**
1084
- * Creates a map cache object to store key-value pairs.
1085
- *
1086
- * @private
1087
- * @constructor
1088
- * @param {Array} [entries] The key-value pairs to cache.
1089
- */
1090
- function MapCache(entries) {
1091
- var index = -1,
1092
- length = entries == null ? 0 : entries.length;
1093
-
1094
- this.clear();
1095
- while (++index < length) {
1096
- var entry = entries[index];
1097
- this.set(entry[0], entry[1]);
1098
- }
1099
- }
1100
-
1101
- // Add methods to `MapCache`.
1102
- MapCache.prototype.clear = mapCacheClear;
1103
- MapCache.prototype['delete'] = mapCacheDelete;
1104
- MapCache.prototype.get = mapCacheGet;
1105
- MapCache.prototype.has = mapCacheHas;
1106
- MapCache.prototype.set = mapCacheSet;
1107
-
1108
- _MapCache = MapCache;
1109
- return _MapCache;
1110
- }
1111
-
1112
- var memoize_1;
1113
- var hasRequiredMemoize;
1114
-
1115
- function requireMemoize () {
1116
- if (hasRequiredMemoize) return memoize_1;
1117
- hasRequiredMemoize = 1;
1118
- var MapCache = require_MapCache();
1119
-
1120
- /** Error message constants. */
1121
- var FUNC_ERROR_TEXT = 'Expected a function';
1122
-
1123
- /**
1124
- * Creates a function that memoizes the result of `func`. If `resolver` is
1125
- * provided, it determines the cache key for storing the result based on the
1126
- * arguments provided to the memoized function. By default, the first argument
1127
- * provided to the memoized function is used as the map cache key. The `func`
1128
- * is invoked with the `this` binding of the memoized function.
1129
- *
1130
- * **Note:** The cache is exposed as the `cache` property on the memoized
1131
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
1132
- * constructor with one whose instances implement the
1133
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1134
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1135
- *
1136
- * @static
1137
- * @memberOf _
1138
- * @since 0.1.0
1139
- * @category Function
1140
- * @param {Function} func The function to have its output memoized.
1141
- * @param {Function} [resolver] The function to resolve the cache key.
1142
- * @returns {Function} Returns the new memoized function.
1143
- * @example
1144
- *
1145
- * var object = { 'a': 1, 'b': 2 };
1146
- * var other = { 'c': 3, 'd': 4 };
1147
- *
1148
- * var values = _.memoize(_.values);
1149
- * values(object);
1150
- * // => [1, 2]
1151
- *
1152
- * values(other);
1153
- * // => [3, 4]
1154
- *
1155
- * object.a = 2;
1156
- * values(object);
1157
- * // => [1, 2]
1158
- *
1159
- * // Modify the result cache.
1160
- * values.cache.set(object, ['a', 'b']);
1161
- * values(object);
1162
- * // => ['a', 'b']
1163
- *
1164
- * // Replace `_.memoize.Cache`.
1165
- * _.memoize.Cache = WeakMap;
1166
- */
1167
- function memoize(func, resolver) {
1168
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1169
- throw new TypeError(FUNC_ERROR_TEXT);
1170
- }
1171
- var memoized = function() {
1172
- var args = arguments,
1173
- key = resolver ? resolver.apply(this, args) : args[0],
1174
- cache = memoized.cache;
1175
-
1176
- if (cache.has(key)) {
1177
- return cache.get(key);
1178
- }
1179
- var result = func.apply(this, args);
1180
- memoized.cache = cache.set(key, result) || cache;
1181
- return result;
1182
- };
1183
- memoized.cache = new (memoize.Cache || MapCache);
1184
- return memoized;
1185
- }
1186
-
1187
- // Expose `MapCache`.
1188
- memoize.Cache = MapCache;
1189
-
1190
- memoize_1 = memoize;
1191
- return memoize_1;
1192
- }
1193
-
1194
- var _memoizeCapped;
1195
- var hasRequired_memoizeCapped;
1196
-
1197
- function require_memoizeCapped () {
1198
- if (hasRequired_memoizeCapped) return _memoizeCapped;
1199
- hasRequired_memoizeCapped = 1;
1200
- var memoize = requireMemoize();
1201
-
1202
- /** Used as the maximum memoize cache size. */
1203
- var MAX_MEMOIZE_SIZE = 500;
1204
-
1205
- /**
1206
- * A specialized version of `_.memoize` which clears the memoized function's
1207
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1208
- *
1209
- * @private
1210
- * @param {Function} func The function to have its output memoized.
1211
- * @returns {Function} Returns the new memoized function.
1212
- */
1213
- function memoizeCapped(func) {
1214
- var result = memoize(func, function(key) {
1215
- if (cache.size === MAX_MEMOIZE_SIZE) {
1216
- cache.clear();
1217
- }
1218
- return key;
1219
- });
1220
-
1221
- var cache = result.cache;
1222
- return result;
1223
- }
1224
-
1225
- _memoizeCapped = memoizeCapped;
1226
- return _memoizeCapped;
1227
- }
1228
-
1229
- var _stringToPath;
1230
- var hasRequired_stringToPath;
1231
-
1232
- function require_stringToPath () {
1233
- if (hasRequired_stringToPath) return _stringToPath;
1234
- hasRequired_stringToPath = 1;
1235
- var memoizeCapped = require_memoizeCapped();
1236
-
1237
- /** Used to match property names within property paths. */
1238
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1239
-
1240
- /** Used to match backslashes in property paths. */
1241
- var reEscapeChar = /\\(\\)?/g;
1242
-
1243
- /**
1244
- * Converts `string` to a property path array.
1245
- *
1246
- * @private
1247
- * @param {string} string The string to convert.
1248
- * @returns {Array} Returns the property path array.
1249
- */
1250
- var stringToPath = memoizeCapped(function(string) {
1251
- var result = [];
1252
- if (string.charCodeAt(0) === 46 /* . */) {
1253
- result.push('');
1254
- }
1255
- string.replace(rePropName, function(match, number, quote, subString) {
1256
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1257
- });
1258
- return result;
1259
- });
1260
-
1261
- _stringToPath = stringToPath;
1262
- return _stringToPath;
1263
- }
1264
-
1265
- /**
1266
- * A specialized version of `_.map` for arrays without support for iteratee
1267
- * shorthands.
1268
- *
1269
- * @private
1270
- * @param {Array} [array] The array to iterate over.
1271
- * @param {Function} iteratee The function invoked per iteration.
1272
- * @returns {Array} Returns the new mapped array.
1273
- */
1274
-
1275
- var _arrayMap;
1276
- var hasRequired_arrayMap;
1277
-
1278
- function require_arrayMap () {
1279
- if (hasRequired_arrayMap) return _arrayMap;
1280
- hasRequired_arrayMap = 1;
1281
- function arrayMap(array, iteratee) {
1282
- var index = -1,
1283
- length = array == null ? 0 : array.length,
1284
- result = Array(length);
1285
-
1286
- while (++index < length) {
1287
- result[index] = iteratee(array[index], index, array);
1288
- }
1289
- return result;
1290
- }
1291
-
1292
- _arrayMap = arrayMap;
1293
- return _arrayMap;
1294
- }
1295
-
1296
- var _baseToString;
1297
- var hasRequired_baseToString;
1298
-
1299
- function require_baseToString () {
1300
- if (hasRequired_baseToString) return _baseToString;
1301
- hasRequired_baseToString = 1;
1302
- var Symbol = require_Symbol(),
1303
- arrayMap = require_arrayMap(),
1304
- isArray = requireIsArray(),
1305
- isSymbol = requireIsSymbol();
1306
-
1307
- /** Used to convert symbols to primitives and strings. */
1308
- var symbolProto = Symbol ? Symbol.prototype : undefined,
1309
- symbolToString = symbolProto ? symbolProto.toString : undefined;
1310
-
1311
- /**
1312
- * The base implementation of `_.toString` which doesn't convert nullish
1313
- * values to empty strings.
1314
- *
1315
- * @private
1316
- * @param {*} value The value to process.
1317
- * @returns {string} Returns the string.
1318
- */
1319
- function baseToString(value) {
1320
- // Exit early for strings to avoid a performance hit in some environments.
1321
- if (typeof value == 'string') {
1322
- return value;
1323
- }
1324
- if (isArray(value)) {
1325
- // Recursively convert values (susceptible to call stack limits).
1326
- return arrayMap(value, baseToString) + '';
1327
- }
1328
- if (isSymbol(value)) {
1329
- return symbolToString ? symbolToString.call(value) : '';
1330
- }
1331
- var result = (value + '');
1332
- return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1333
- }
1334
-
1335
- _baseToString = baseToString;
1336
- return _baseToString;
1337
- }
1338
-
1339
- var toString_1;
1340
- var hasRequiredToString;
1341
-
1342
- function requireToString () {
1343
- if (hasRequiredToString) return toString_1;
1344
- hasRequiredToString = 1;
1345
- var baseToString = require_baseToString();
1346
-
1347
- /**
1348
- * Converts `value` to a string. An empty string is returned for `null`
1349
- * and `undefined` values. The sign of `-0` is preserved.
1350
- *
1351
- * @static
1352
- * @memberOf _
1353
- * @since 4.0.0
1354
- * @category Lang
1355
- * @param {*} value The value to convert.
1356
- * @returns {string} Returns the converted string.
1357
- * @example
1358
- *
1359
- * _.toString(null);
1360
- * // => ''
1361
- *
1362
- * _.toString(-0);
1363
- * // => '-0'
1364
- *
1365
- * _.toString([1, 2, 3]);
1366
- * // => '1,2,3'
1367
- */
1368
- function toString(value) {
1369
- return value == null ? '' : baseToString(value);
1370
- }
1371
-
1372
- toString_1 = toString;
1373
- return toString_1;
1374
- }
1375
-
1376
- var _castPath;
1377
- var hasRequired_castPath;
1378
-
1379
- function require_castPath () {
1380
- if (hasRequired_castPath) return _castPath;
1381
- hasRequired_castPath = 1;
1382
- var isArray = requireIsArray(),
1383
- isKey = require_isKey(),
1384
- stringToPath = require_stringToPath(),
1385
- toString = requireToString();
1386
-
1387
- /**
1388
- * Casts `value` to a path array if it's not one.
1389
- *
1390
- * @private
1391
- * @param {*} value The value to inspect.
1392
- * @param {Object} [object] The object to query keys on.
1393
- * @returns {Array} Returns the cast property path array.
1394
- */
1395
- function castPath(value, object) {
1396
- if (isArray(value)) {
1397
- return value;
1398
- }
1399
- return isKey(value, object) ? [value] : stringToPath(toString(value));
1400
- }
1401
-
1402
- _castPath = castPath;
1403
- return _castPath;
1404
- }
1405
-
1406
- var _toKey;
1407
- var hasRequired_toKey;
1408
-
1409
- function require_toKey () {
1410
- if (hasRequired_toKey) return _toKey;
1411
- hasRequired_toKey = 1;
1412
- var isSymbol = requireIsSymbol();
1413
-
1414
- /**
1415
- * Converts `value` to a string key if it's not a string or symbol.
1416
- *
1417
- * @private
1418
- * @param {*} value The value to inspect.
1419
- * @returns {string|symbol} Returns the key.
1420
- */
1421
- function toKey(value) {
1422
- if (typeof value == 'string' || isSymbol(value)) {
1423
- return value;
1424
- }
1425
- var result = (value + '');
1426
- return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1427
- }
1428
-
1429
- _toKey = toKey;
1430
- return _toKey;
1431
- }
1432
-
1433
- var _baseGet;
1434
- var hasRequired_baseGet;
1435
-
1436
- function require_baseGet () {
1437
- if (hasRequired_baseGet) return _baseGet;
1438
- hasRequired_baseGet = 1;
1439
- var castPath = require_castPath(),
1440
- toKey = require_toKey();
1441
-
1442
- /**
1443
- * The base implementation of `_.get` without support for default values.
1444
- *
1445
- * @private
1446
- * @param {Object} object The object to query.
1447
- * @param {Array|string} path The path of the property to get.
1448
- * @returns {*} Returns the resolved value.
1449
- */
1450
- function baseGet(object, path) {
1451
- path = castPath(path, object);
1452
-
1453
- var index = 0,
1454
- length = path.length;
1455
-
1456
- while (object != null && index < length) {
1457
- object = object[toKey(path[index++])];
1458
- }
1459
- return (index && index == length) ? object : undefined;
1460
- }
1461
-
1462
- _baseGet = baseGet;
1463
- return _baseGet;
1464
- }
1465
-
1466
- var _defineProperty;
1467
- var hasRequired_defineProperty;
1468
-
1469
- function require_defineProperty () {
1470
- if (hasRequired_defineProperty) return _defineProperty;
1471
- hasRequired_defineProperty = 1;
1472
- var getNative = require_getNative();
1473
-
1474
- var defineProperty = (function() {
1475
- try {
1476
- var func = getNative(Object, 'defineProperty');
1477
- func({}, '', {});
1478
- return func;
1479
- } catch (e) {}
1480
- }());
1481
-
1482
- _defineProperty = defineProperty;
1483
- return _defineProperty;
1484
- }
1485
-
1486
- var _baseAssignValue;
1487
- var hasRequired_baseAssignValue;
1488
-
1489
- function require_baseAssignValue () {
1490
- if (hasRequired_baseAssignValue) return _baseAssignValue;
1491
- hasRequired_baseAssignValue = 1;
1492
- var defineProperty = require_defineProperty();
1493
-
1494
- /**
1495
- * The base implementation of `assignValue` and `assignMergeValue` without
1496
- * value checks.
1497
- *
1498
- * @private
1499
- * @param {Object} object The object to modify.
1500
- * @param {string} key The key of the property to assign.
1501
- * @param {*} value The value to assign.
1502
- */
1503
- function baseAssignValue(object, key, value) {
1504
- if (key == '__proto__' && defineProperty) {
1505
- defineProperty(object, key, {
1506
- 'configurable': true,
1507
- 'enumerable': true,
1508
- 'value': value,
1509
- 'writable': true
1510
- });
1511
- } else {
1512
- object[key] = value;
1513
- }
1514
- }
1515
-
1516
- _baseAssignValue = baseAssignValue;
1517
- return _baseAssignValue;
1518
- }
1519
-
1520
- var _assignValue;
1521
- var hasRequired_assignValue;
1522
-
1523
- function require_assignValue () {
1524
- if (hasRequired_assignValue) return _assignValue;
1525
- hasRequired_assignValue = 1;
1526
- var baseAssignValue = require_baseAssignValue(),
1527
- eq = requireEq();
1528
-
1529
- /** Used for built-in method references. */
1530
- var objectProto = Object.prototype;
1531
-
1532
- /** Used to check objects for own properties. */
1533
- var hasOwnProperty = objectProto.hasOwnProperty;
1534
-
1535
- /**
1536
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
1537
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1538
- * for equality comparisons.
1539
- *
1540
- * @private
1541
- * @param {Object} object The object to modify.
1542
- * @param {string} key The key of the property to assign.
1543
- * @param {*} value The value to assign.
1544
- */
1545
- function assignValue(object, key, value) {
1546
- var objValue = object[key];
1547
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
1548
- (value === undefined && !(key in object))) {
1549
- baseAssignValue(object, key, value);
1550
- }
1551
- }
1552
-
1553
- _assignValue = assignValue;
1554
- return _assignValue;
1555
- }
1556
-
1557
- /** Used as references for various `Number` constants. */
1558
-
1559
- var _isIndex;
1560
- var hasRequired_isIndex;
1561
-
1562
- function require_isIndex () {
1563
- if (hasRequired_isIndex) return _isIndex;
1564
- hasRequired_isIndex = 1;
1565
- var MAX_SAFE_INTEGER = 9007199254740991;
1566
-
1567
- /** Used to detect unsigned integer values. */
1568
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1569
-
1570
- /**
1571
- * Checks if `value` is a valid array-like index.
1572
- *
1573
- * @private
1574
- * @param {*} value The value to check.
1575
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1576
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1577
- */
1578
- function isIndex(value, length) {
1579
- var type = typeof value;
1580
- length = length == null ? MAX_SAFE_INTEGER : length;
1581
-
1582
- return !!length &&
1583
- (type == 'number' ||
1584
- (type != 'symbol' && reIsUint.test(value))) &&
1585
- (value > -1 && value % 1 == 0 && value < length);
1586
- }
1587
-
1588
- _isIndex = isIndex;
1589
- return _isIndex;
1590
- }
1591
-
1592
- var _baseSet;
1593
- var hasRequired_baseSet;
1594
-
1595
- function require_baseSet () {
1596
- if (hasRequired_baseSet) return _baseSet;
1597
- hasRequired_baseSet = 1;
1598
- var assignValue = require_assignValue(),
1599
- castPath = require_castPath(),
1600
- isIndex = require_isIndex(),
1601
- isObject = requireIsObject(),
1602
- toKey = require_toKey();
1603
-
1604
- /**
1605
- * The base implementation of `_.set`.
1606
- *
1607
- * @private
1608
- * @param {Object} object The object to modify.
1609
- * @param {Array|string} path The path of the property to set.
1610
- * @param {*} value The value to set.
1611
- * @param {Function} [customizer] The function to customize path creation.
1612
- * @returns {Object} Returns `object`.
1613
- */
1614
- function baseSet(object, path, value, customizer) {
1615
- if (!isObject(object)) {
1616
- return object;
1617
- }
1618
- path = castPath(path, object);
1619
-
1620
- var index = -1,
1621
- length = path.length,
1622
- lastIndex = length - 1,
1623
- nested = object;
1624
-
1625
- while (nested != null && ++index < length) {
1626
- var key = toKey(path[index]),
1627
- newValue = value;
1628
-
1629
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
1630
- return object;
1631
- }
1632
-
1633
- if (index != lastIndex) {
1634
- var objValue = nested[key];
1635
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
1636
- if (newValue === undefined) {
1637
- newValue = isObject(objValue)
1638
- ? objValue
1639
- : (isIndex(path[index + 1]) ? [] : {});
1640
- }
1641
- }
1642
- assignValue(nested, key, newValue);
1643
- nested = nested[key];
1644
- }
1645
- return object;
1646
- }
1647
-
1648
- _baseSet = baseSet;
1649
- return _baseSet;
1650
- }
1651
-
1652
- var _basePickBy;
1653
- var hasRequired_basePickBy;
1654
-
1655
- function require_basePickBy () {
1656
- if (hasRequired_basePickBy) return _basePickBy;
1657
- hasRequired_basePickBy = 1;
1658
- var baseGet = require_baseGet(),
1659
- baseSet = require_baseSet(),
1660
- castPath = require_castPath();
1661
-
1662
- /**
1663
- * The base implementation of `_.pickBy` without support for iteratee shorthands.
1664
- *
1665
- * @private
1666
- * @param {Object} object The source object.
1667
- * @param {string[]} paths The property paths to pick.
1668
- * @param {Function} predicate The function invoked per property.
1669
- * @returns {Object} Returns the new object.
1670
- */
1671
- function basePickBy(object, paths, predicate) {
1672
- var index = -1,
1673
- length = paths.length,
1674
- result = {};
1675
-
1676
- while (++index < length) {
1677
- var path = paths[index],
1678
- value = baseGet(object, path);
1679
-
1680
- if (predicate(value, path)) {
1681
- baseSet(result, castPath(path, object), value);
1682
- }
1683
- }
1684
- return result;
1685
- }
1686
-
1687
- _basePickBy = basePickBy;
1688
- return _basePickBy;
1689
- }
1690
-
1691
- /**
1692
- * The base implementation of `_.hasIn` without support for deep paths.
1693
- *
1694
- * @private
1695
- * @param {Object} [object] The object to query.
1696
- * @param {Array|string} key The key to check.
1697
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
1698
- */
1699
-
1700
- var _baseHasIn;
1701
- var hasRequired_baseHasIn;
1702
-
1703
- function require_baseHasIn () {
1704
- if (hasRequired_baseHasIn) return _baseHasIn;
1705
- hasRequired_baseHasIn = 1;
1706
- function baseHasIn(object, key) {
1707
- return object != null && key in Object(object);
1708
- }
1709
-
1710
- _baseHasIn = baseHasIn;
1711
- return _baseHasIn;
1712
- }
1713
-
1714
- var _hasPath;
1715
- var hasRequired_hasPath;
1716
-
1717
- function require_hasPath () {
1718
- if (hasRequired_hasPath) return _hasPath;
1719
- hasRequired_hasPath = 1;
1720
- var castPath = require_castPath(),
1721
- isArguments = requireIsArguments(),
1722
- isArray = requireIsArray(),
1723
- isIndex = require_isIndex(),
1724
- isLength = requireIsLength(),
1725
- toKey = require_toKey();
1726
-
1727
- /**
1728
- * Checks if `path` exists on `object`.
1729
- *
1730
- * @private
1731
- * @param {Object} object The object to query.
1732
- * @param {Array|string} path The path to check.
1733
- * @param {Function} hasFunc The function to check properties.
1734
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
1735
- */
1736
- function hasPath(object, path, hasFunc) {
1737
- path = castPath(path, object);
1738
-
1739
- var index = -1,
1740
- length = path.length,
1741
- result = false;
1742
-
1743
- while (++index < length) {
1744
- var key = toKey(path[index]);
1745
- if (!(result = object != null && hasFunc(object, key))) {
1746
- break;
1747
- }
1748
- object = object[key];
1749
- }
1750
- if (result || ++index != length) {
1751
- return result;
1752
- }
1753
- length = object == null ? 0 : object.length;
1754
- return !!length && isLength(length) && isIndex(key, length) &&
1755
- (isArray(object) || isArguments(object));
1756
- }
1757
-
1758
- _hasPath = hasPath;
1759
- return _hasPath;
1760
- }
1761
-
1762
- var hasIn_1;
1763
- var hasRequiredHasIn;
1764
-
1765
- function requireHasIn () {
1766
- if (hasRequiredHasIn) return hasIn_1;
1767
- hasRequiredHasIn = 1;
1768
- var baseHasIn = require_baseHasIn(),
1769
- hasPath = require_hasPath();
1770
-
1771
- /**
1772
- * Checks if `path` is a direct or inherited property of `object`.
1773
- *
1774
- * @static
1775
- * @memberOf _
1776
- * @since 4.0.0
1777
- * @category Object
1778
- * @param {Object} object The object to query.
1779
- * @param {Array|string} path The path to check.
1780
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
1781
- * @example
1782
- *
1783
- * var object = _.create({ 'a': _.create({ 'b': 2 }) });
1784
- *
1785
- * _.hasIn(object, 'a');
1786
- * // => true
1787
- *
1788
- * _.hasIn(object, 'a.b');
1789
- * // => true
1790
- *
1791
- * _.hasIn(object, ['a', 'b']);
1792
- * // => true
1793
- *
1794
- * _.hasIn(object, 'b');
1795
- * // => false
1796
- */
1797
- function hasIn(object, path) {
1798
- return object != null && hasPath(object, path, baseHasIn);
1799
- }
1800
-
1801
- hasIn_1 = hasIn;
1802
- return hasIn_1;
1803
- }
1804
-
1805
- var _basePick;
1806
- var hasRequired_basePick;
1807
-
1808
- function require_basePick () {
1809
- if (hasRequired_basePick) return _basePick;
1810
- hasRequired_basePick = 1;
1811
- var basePickBy = require_basePickBy(),
1812
- hasIn = requireHasIn();
1813
-
1814
- /**
1815
- * The base implementation of `_.pick` without support for individual
1816
- * property identifiers.
1817
- *
1818
- * @private
1819
- * @param {Object} object The source object.
1820
- * @param {string[]} paths The property paths to pick.
1821
- * @returns {Object} Returns the new object.
1822
- */
1823
- function basePick(object, paths) {
1824
- return basePickBy(object, paths, function(value, path) {
1825
- return hasIn(object, path);
1826
- });
1827
- }
1828
-
1829
- _basePick = basePick;
1830
- return _basePick;
1831
- }
1832
-
1833
- /**
1834
- * Appends the elements of `values` to `array`.
1835
- *
1836
- * @private
1837
- * @param {Array} array The array to modify.
1838
- * @param {Array} values The values to append.
1839
- * @returns {Array} Returns `array`.
1840
- */
1841
-
1842
- var _arrayPush;
1843
- var hasRequired_arrayPush;
1844
-
1845
- function require_arrayPush () {
1846
- if (hasRequired_arrayPush) return _arrayPush;
1847
- hasRequired_arrayPush = 1;
1848
- function arrayPush(array, values) {
1849
- var index = -1,
1850
- length = values.length,
1851
- offset = array.length;
1852
-
1853
- while (++index < length) {
1854
- array[offset + index] = values[index];
1855
- }
1856
- return array;
1857
- }
1858
-
1859
- _arrayPush = arrayPush;
1860
- return _arrayPush;
1861
- }
1862
-
1863
- var _isFlattenable;
1864
- var hasRequired_isFlattenable;
1865
-
1866
- function require_isFlattenable () {
1867
- if (hasRequired_isFlattenable) return _isFlattenable;
1868
- hasRequired_isFlattenable = 1;
1869
- var Symbol = require_Symbol(),
1870
- isArguments = requireIsArguments(),
1871
- isArray = requireIsArray();
1872
-
1873
- /** Built-in value references. */
1874
- var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
1875
-
1876
- /**
1877
- * Checks if `value` is a flattenable `arguments` object or array.
1878
- *
1879
- * @private
1880
- * @param {*} value The value to check.
1881
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
1882
- */
1883
- function isFlattenable(value) {
1884
- return isArray(value) || isArguments(value) ||
1885
- !!(spreadableSymbol && value && value[spreadableSymbol]);
1886
- }
1887
-
1888
- _isFlattenable = isFlattenable;
1889
- return _isFlattenable;
1890
- }
1891
-
1892
- var _baseFlatten;
1893
- var hasRequired_baseFlatten;
1894
-
1895
- function require_baseFlatten () {
1896
- if (hasRequired_baseFlatten) return _baseFlatten;
1897
- hasRequired_baseFlatten = 1;
1898
- var arrayPush = require_arrayPush(),
1899
- isFlattenable = require_isFlattenable();
1900
-
1901
- /**
1902
- * The base implementation of `_.flatten` with support for restricting flattening.
1903
- *
1904
- * @private
1905
- * @param {Array} array The array to flatten.
1906
- * @param {number} depth The maximum recursion depth.
1907
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
1908
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
1909
- * @param {Array} [result=[]] The initial result value.
1910
- * @returns {Array} Returns the new flattened array.
1911
- */
1912
- function baseFlatten(array, depth, predicate, isStrict, result) {
1913
- var index = -1,
1914
- length = array.length;
1915
-
1916
- predicate || (predicate = isFlattenable);
1917
- result || (result = []);
1918
-
1919
- while (++index < length) {
1920
- var value = array[index];
1921
- if (depth > 0 && predicate(value)) {
1922
- if (depth > 1) {
1923
- // Recursively flatten arrays (susceptible to call stack limits).
1924
- baseFlatten(value, depth - 1, predicate, isStrict, result);
1925
- } else {
1926
- arrayPush(result, value);
1927
- }
1928
- } else if (!isStrict) {
1929
- result[result.length] = value;
1930
- }
1931
- }
1932
- return result;
1933
- }
1934
-
1935
- _baseFlatten = baseFlatten;
1936
- return _baseFlatten;
1937
- }
1938
-
1939
- var flatten_1;
1940
- var hasRequiredFlatten;
1941
-
1942
- function requireFlatten () {
1943
- if (hasRequiredFlatten) return flatten_1;
1944
- hasRequiredFlatten = 1;
1945
- var baseFlatten = require_baseFlatten();
1946
-
1947
- /**
1948
- * Flattens `array` a single level deep.
1949
- *
1950
- * @static
1951
- * @memberOf _
1952
- * @since 0.1.0
1953
- * @category Array
1954
- * @param {Array} array The array to flatten.
1955
- * @returns {Array} Returns the new flattened array.
1956
- * @example
1957
- *
1958
- * _.flatten([1, [2, [3, [4]], 5]]);
1959
- * // => [1, 2, [3, [4]], 5]
1960
- */
1961
- function flatten(array) {
1962
- var length = array == null ? 0 : array.length;
1963
- return length ? baseFlatten(array, 1) : [];
1964
- }
1965
-
1966
- flatten_1 = flatten;
1967
- return flatten_1;
1968
- }
1969
-
1970
- /**
1971
- * A faster alternative to `Function#apply`, this function invokes `func`
1972
- * with the `this` binding of `thisArg` and the arguments of `args`.
1973
- *
1974
- * @private
1975
- * @param {Function} func The function to invoke.
1976
- * @param {*} thisArg The `this` binding of `func`.
1977
- * @param {Array} args The arguments to invoke `func` with.
1978
- * @returns {*} Returns the result of `func`.
1979
- */
1980
-
1981
- var _apply;
1982
- var hasRequired_apply;
1983
-
1984
- function require_apply () {
1985
- if (hasRequired_apply) return _apply;
1986
- hasRequired_apply = 1;
1987
- function apply(func, thisArg, args) {
1988
- switch (args.length) {
1989
- case 0: return func.call(thisArg);
1990
- case 1: return func.call(thisArg, args[0]);
1991
- case 2: return func.call(thisArg, args[0], args[1]);
1992
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
1993
- }
1994
- return func.apply(thisArg, args);
1995
- }
1996
-
1997
- _apply = apply;
1998
- return _apply;
1999
- }
2000
-
2001
- var _overRest;
2002
- var hasRequired_overRest;
2003
-
2004
- function require_overRest () {
2005
- if (hasRequired_overRest) return _overRest;
2006
- hasRequired_overRest = 1;
2007
- var apply = require_apply();
2008
-
2009
- /* Built-in method references for those with the same name as other `lodash` methods. */
2010
- var nativeMax = Math.max;
2011
-
2012
- /**
2013
- * A specialized version of `baseRest` which transforms the rest array.
2014
- *
2015
- * @private
2016
- * @param {Function} func The function to apply a rest parameter to.
2017
- * @param {number} [start=func.length-1] The start position of the rest parameter.
2018
- * @param {Function} transform The rest array transform.
2019
- * @returns {Function} Returns the new function.
2020
- */
2021
- function overRest(func, start, transform) {
2022
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
2023
- return function() {
2024
- var args = arguments,
2025
- index = -1,
2026
- length = nativeMax(args.length - start, 0),
2027
- array = Array(length);
2028
-
2029
- while (++index < length) {
2030
- array[index] = args[start + index];
2031
- }
2032
- index = -1;
2033
- var otherArgs = Array(start + 1);
2034
- while (++index < start) {
2035
- otherArgs[index] = args[index];
2036
- }
2037
- otherArgs[start] = transform(array);
2038
- return apply(func, this, otherArgs);
2039
- };
2040
- }
2041
-
2042
- _overRest = overRest;
2043
- return _overRest;
2044
- }
2045
-
2046
- /**
2047
- * Creates a function that returns `value`.
2048
- *
2049
- * @static
2050
- * @memberOf _
2051
- * @since 2.4.0
2052
- * @category Util
2053
- * @param {*} value The value to return from the new function.
2054
- * @returns {Function} Returns the new constant function.
2055
- * @example
2056
- *
2057
- * var objects = _.times(2, _.constant({ 'a': 1 }));
2058
- *
2059
- * console.log(objects);
2060
- * // => [{ 'a': 1 }, { 'a': 1 }]
2061
- *
2062
- * console.log(objects[0] === objects[1]);
2063
- * // => true
2064
- */
2065
-
2066
- var constant_1;
2067
- var hasRequiredConstant;
2068
-
2069
- function requireConstant () {
2070
- if (hasRequiredConstant) return constant_1;
2071
- hasRequiredConstant = 1;
2072
- function constant(value) {
2073
- return function() {
2074
- return value;
2075
- };
2076
- }
2077
-
2078
- constant_1 = constant;
2079
- return constant_1;
2080
- }
2081
-
2082
- /**
2083
- * This method returns the first argument it receives.
2084
- *
2085
- * @static
2086
- * @since 0.1.0
2087
- * @memberOf _
2088
- * @category Util
2089
- * @param {*} value Any value.
2090
- * @returns {*} Returns `value`.
2091
- * @example
2092
- *
2093
- * var object = { 'a': 1 };
2094
- *
2095
- * console.log(_.identity(object) === object);
2096
- * // => true
2097
- */
2098
-
2099
- var identity_1;
2100
- var hasRequiredIdentity;
2101
-
2102
- function requireIdentity () {
2103
- if (hasRequiredIdentity) return identity_1;
2104
- hasRequiredIdentity = 1;
2105
- function identity(value) {
2106
- return value;
2107
- }
2108
-
2109
- identity_1 = identity;
2110
- return identity_1;
2111
- }
2112
-
2113
- var _baseSetToString;
2114
- var hasRequired_baseSetToString;
2115
-
2116
- function require_baseSetToString () {
2117
- if (hasRequired_baseSetToString) return _baseSetToString;
2118
- hasRequired_baseSetToString = 1;
2119
- var constant = requireConstant(),
2120
- defineProperty = require_defineProperty(),
2121
- identity = requireIdentity();
2122
-
2123
- /**
2124
- * The base implementation of `setToString` without support for hot loop shorting.
2125
- *
2126
- * @private
2127
- * @param {Function} func The function to modify.
2128
- * @param {Function} string The `toString` result.
2129
- * @returns {Function} Returns `func`.
2130
- */
2131
- var baseSetToString = !defineProperty ? identity : function(func, string) {
2132
- return defineProperty(func, 'toString', {
2133
- 'configurable': true,
2134
- 'enumerable': false,
2135
- 'value': constant(string),
2136
- 'writable': true
2137
- });
2138
- };
2139
-
2140
- _baseSetToString = baseSetToString;
2141
- return _baseSetToString;
2142
- }
2143
-
2144
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
2145
-
2146
- var _shortOut;
2147
- var hasRequired_shortOut;
2148
-
2149
- function require_shortOut () {
2150
- if (hasRequired_shortOut) return _shortOut;
2151
- hasRequired_shortOut = 1;
2152
- var HOT_COUNT = 800,
2153
- HOT_SPAN = 16;
2154
-
2155
- /* Built-in method references for those with the same name as other `lodash` methods. */
2156
- var nativeNow = Date.now;
2157
-
2158
- /**
2159
- * Creates a function that'll short out and invoke `identity` instead
2160
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
2161
- * milliseconds.
2162
- *
2163
- * @private
2164
- * @param {Function} func The function to restrict.
2165
- * @returns {Function} Returns the new shortable function.
2166
- */
2167
- function shortOut(func) {
2168
- var count = 0,
2169
- lastCalled = 0;
2170
-
2171
- return function() {
2172
- var stamp = nativeNow(),
2173
- remaining = HOT_SPAN - (stamp - lastCalled);
2174
-
2175
- lastCalled = stamp;
2176
- if (remaining > 0) {
2177
- if (++count >= HOT_COUNT) {
2178
- return arguments[0];
2179
- }
2180
- } else {
2181
- count = 0;
2182
- }
2183
- return func.apply(undefined, arguments);
2184
- };
2185
- }
2186
-
2187
- _shortOut = shortOut;
2188
- return _shortOut;
2189
- }
2190
-
2191
- var _setToString;
2192
- var hasRequired_setToString;
2193
-
2194
- function require_setToString () {
2195
- if (hasRequired_setToString) return _setToString;
2196
- hasRequired_setToString = 1;
2197
- var baseSetToString = require_baseSetToString(),
2198
- shortOut = require_shortOut();
2199
-
2200
- /**
2201
- * Sets the `toString` method of `func` to return `string`.
2202
- *
2203
- * @private
2204
- * @param {Function} func The function to modify.
2205
- * @param {Function} string The `toString` result.
2206
- * @returns {Function} Returns `func`.
2207
- */
2208
- var setToString = shortOut(baseSetToString);
2209
-
2210
- _setToString = setToString;
2211
- return _setToString;
2212
- }
2213
-
2214
- var _flatRest;
2215
- var hasRequired_flatRest;
2216
-
2217
- function require_flatRest () {
2218
- if (hasRequired_flatRest) return _flatRest;
2219
- hasRequired_flatRest = 1;
2220
- var flatten = requireFlatten(),
2221
- overRest = require_overRest(),
2222
- setToString = require_setToString();
2223
-
2224
- /**
2225
- * A specialized version of `baseRest` which flattens the rest array.
2226
- *
2227
- * @private
2228
- * @param {Function} func The function to apply a rest parameter to.
2229
- * @returns {Function} Returns the new function.
2230
- */
2231
- function flatRest(func) {
2232
- return setToString(overRest(func, undefined, flatten), func + '');
2233
- }
2234
-
2235
- _flatRest = flatRest;
2236
- return _flatRest;
2237
- }
2238
-
2239
- var pick_1;
2240
- var hasRequiredPick;
2241
-
2242
- function requirePick () {
2243
- if (hasRequiredPick) return pick_1;
2244
- hasRequiredPick = 1;
2245
- var basePick = require_basePick(),
2246
- flatRest = require_flatRest();
2247
-
2248
- /**
2249
- * Creates an object composed of the picked `object` properties.
2250
- *
2251
- * @static
2252
- * @since 0.1.0
2253
- * @memberOf _
2254
- * @category Object
2255
- * @param {Object} object The source object.
2256
- * @param {...(string|string[])} [paths] The property paths to pick.
2257
- * @returns {Object} Returns the new object.
2258
- * @example
2259
- *
2260
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
2261
- *
2262
- * _.pick(object, ['a', 'c']);
2263
- * // => { 'a': 1, 'c': 3 }
2264
- */
2265
- var pick = flatRest(function(object, paths) {
2266
- return object == null ? {} : basePick(object, paths);
2267
- });
2268
-
2269
- pick_1 = pick;
2270
- return pick_1;
2271
- }
2272
-
2273
- var pickExports = requirePick();
2274
- var pick = /*@__PURE__*/getDefaultExportFromCjs(pickExports);
2275
-
2276
1
  function utf8ToBase64(str) {
2277
2
  const utf8Bytes = new TextEncoder().encode(str);
2278
3
  const binaryStr = String.fromCharCode(...utf8Bytes);
2279
4
  return btoa(binaryStr);
2280
5
  }
2281
6
 
2282
- const DEFAULT_POSTER_PARAMS = {
2283
- format: 'jpg',
2284
- resource_type: 'video'
2285
- };
2286
- const DEFAULT_VIDEO_PARAMS = {
2287
- resource_type: 'video',
2288
- type: 'upload',
2289
- hdr: false,
2290
- transformation: [],
2291
- sourceTransformation: {},
2292
- sourceTypes: ['auto'],
2293
- recommendations: null,
2294
- info: {},
2295
- interactionAreas: {},
2296
- chapters: {}
2297
- };
2298
- const COMMON_VIDEO_EXTENSIONS = ['3g2', '3gp', 'avi', 'flv', 'm3u8', 'ts', 'm2ts', 'mts', 'mov', 'mkv', 'mp4', 'mpeg', 'mpd', 'mxf', 'ogv', 'webm', 'wmv']; // https://cloudinary.com/documentation/video_manipulation_and_delivery#supported_video_formats
2299
-
2300
- const VIDEO_SUFFIX_REMOVAL_PATTERN = RegExp(`\\.(${COMMON_VIDEO_EXTENSIONS.join('|')})$$`);
2301
-
7
+ /**
8
+ * Detects http(s) profile/config URLs. Split from `video-source.const` so fetch-config
9
+ * does not pull MIME maps and related defaults into the async chunk.
10
+ */
2302
11
  // eslint-disable-next-line no-control-regex
2303
- const URL_PATTERN = RegExp('https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\+.~#?&/=]*)');
2304
- const CONTAINER_MIME_TYPES = {
2305
- hls: 'application/x-mpegURL',
2306
- dash: 'application/dash+xml',
2307
- // See: https://docs.videojs.com/utils_mimetypes.js.html
2308
- opus: 'video/ogg',
2309
- ogv: 'video/ogg',
2310
- mp4: 'video/mp4',
2311
- mov: 'video/mp4',
2312
- m4v: 'video/mp4',
2313
- mkv: 'video/x-matroska',
2314
- m4a: 'audio/mp4',
2315
- mp3: 'audio/mpeg',
2316
- aac: 'audio/aac',
2317
- caf: 'audio/x-caf',
2318
- flac: 'audio/flac',
2319
- oga: 'audio/ogg',
2320
- wav: 'audio/wav',
2321
- m3u8: 'application/x-mpegURL',
2322
- mpd: 'application/dash+xml',
2323
- jpg: 'image/jpeg',
2324
- jpeg: 'image/jpeg',
2325
- gif: 'image/gif',
2326
- png: 'image/png',
2327
- svg: 'image/svg+xml',
2328
- webp: 'image/webp'
2329
- };
2330
- const ADAPTIVE_SOURCETYPES = ['hls', 'dash', 'mpd', 'm3u8'];
2331
- const FORMAT_MAPPINGS = {
2332
- hls: 'm3u8',
2333
- dash: 'mpd'
2334
- };
2335
-
2336
- // Breakpoints constants
2337
- const DEFAULT_DPR = 2.0;
2338
- const RENDITIONS = [640, 848, 1280, 1920, 2560, 3840];
12
+ const URL_PATTERN = RegExp('https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)');
2339
13
 
2340
14
  const isRawUrl = publicId => URL_PATTERN.test(publicId);
2341
15
 
@@ -2354,460 +28,32 @@ const appendQueryParams = (url, params) => {
2354
28
  };
2355
29
 
2356
30
  /**
2357
- * A specialized version of `_.reduce` for arrays without support for
2358
- * iteratee shorthands.
2359
- *
2360
- * @private
2361
- * @param {Array} [array] The array to iterate over.
2362
- * @param {Function} iteratee The function invoked per iteration.
2363
- * @param {*} [accumulator] The initial value.
2364
- * @param {boolean} [initAccum] Specify using the first element of `array` as
2365
- * the initial value.
2366
- * @returns {*} Returns the accumulated value.
31
+ * Cloudinary SDK config keys (snake_case). Duplicated from `video-player.const` so
32
+ * modules that only need this list do not import the full player constants table.
2367
33
  */
34
+ const CLOUDINARY_CONFIG_PARAM = ['api_secret', 'auth_token', 'cdn_subdomain', 'cloud_name', 'cname', 'private_cdn', 'secure', 'secure_cdn_subdomain', 'secure_distribution', 'shorten', 'sign_url', 'url_suffix', 'use_root_path'];
2368
35
 
2369
- var _arrayReduce;
2370
- var hasRequired_arrayReduce;
2371
-
2372
- function require_arrayReduce () {
2373
- if (hasRequired_arrayReduce) return _arrayReduce;
2374
- hasRequired_arrayReduce = 1;
2375
- function arrayReduce(array, iteratee, accumulator, initAccum) {
2376
- var index = -1,
2377
- length = array == null ? 0 : array.length;
2378
-
2379
- if (initAccum && length) {
2380
- accumulator = array[++index];
2381
- }
2382
- while (++index < length) {
2383
- accumulator = iteratee(accumulator, array[index], index, array);
2384
- }
2385
- return accumulator;
2386
- }
2387
-
2388
- _arrayReduce = arrayReduce;
2389
- return _arrayReduce;
2390
- }
36
+ const CLOUDINARY_CONFIG_KEYS = new Set(CLOUDINARY_CONFIG_PARAM);
2391
37
 
2392
38
  /**
2393
- * The base implementation of `_.propertyOf` without support for deep paths.
2394
- *
2395
- * @private
2396
- * @param {Object} object The object to query.
2397
- * @returns {Function} Returns the new accessor function.
39
+ * Matches lodash `snakeCase` (avoids heavy lodash in lazy-player).
2398
40
  */
2399
-
2400
- var _basePropertyOf;
2401
- var hasRequired_basePropertyOf;
2402
-
2403
- function require_basePropertyOf () {
2404
- if (hasRequired_basePropertyOf) return _basePropertyOf;
2405
- hasRequired_basePropertyOf = 1;
2406
- function basePropertyOf(object) {
2407
- return function(key) {
2408
- return object == null ? undefined : object[key];
2409
- };
2410
- }
2411
-
2412
- _basePropertyOf = basePropertyOf;
2413
- return _basePropertyOf;
2414
- }
2415
-
2416
- var _deburrLetter;
2417
- var hasRequired_deburrLetter;
2418
-
2419
- function require_deburrLetter () {
2420
- if (hasRequired_deburrLetter) return _deburrLetter;
2421
- hasRequired_deburrLetter = 1;
2422
- var basePropertyOf = require_basePropertyOf();
2423
-
2424
- /** Used to map Latin Unicode letters to basic Latin letters. */
2425
- var deburredLetters = {
2426
- // Latin-1 Supplement block.
2427
- '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
2428
- '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
2429
- '\xc7': 'C', '\xe7': 'c',
2430
- '\xd0': 'D', '\xf0': 'd',
2431
- '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
2432
- '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
2433
- '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
2434
- '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
2435
- '\xd1': 'N', '\xf1': 'n',
2436
- '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
2437
- '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
2438
- '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
2439
- '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
2440
- '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
2441
- '\xc6': 'Ae', '\xe6': 'ae',
2442
- '\xde': 'Th', '\xfe': 'th',
2443
- '\xdf': 'ss',
2444
- // Latin Extended-A block.
2445
- '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
2446
- '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
2447
- '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
2448
- '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
2449
- '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
2450
- '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
2451
- '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
2452
- '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
2453
- '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
2454
- '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
2455
- '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
2456
- '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
2457
- '\u0134': 'J', '\u0135': 'j',
2458
- '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
2459
- '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
2460
- '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
2461
- '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
2462
- '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
2463
- '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
2464
- '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
2465
- '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
2466
- '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
2467
- '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
2468
- '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
2469
- '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
2470
- '\u0163': 't', '\u0165': 't', '\u0167': 't',
2471
- '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
2472
- '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
2473
- '\u0174': 'W', '\u0175': 'w',
2474
- '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
2475
- '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
2476
- '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
2477
- '\u0132': 'IJ', '\u0133': 'ij',
2478
- '\u0152': 'Oe', '\u0153': 'oe',
2479
- '\u0149': "'n", '\u017f': 's'
2480
- };
2481
-
2482
- /**
2483
- * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
2484
- * letters to basic Latin letters.
2485
- *
2486
- * @private
2487
- * @param {string} letter The matched letter to deburr.
2488
- * @returns {string} Returns the deburred letter.
2489
- */
2490
- var deburrLetter = basePropertyOf(deburredLetters);
2491
-
2492
- _deburrLetter = deburrLetter;
2493
- return _deburrLetter;
2494
- }
2495
-
2496
- var deburr_1;
2497
- var hasRequiredDeburr;
2498
-
2499
- function requireDeburr () {
2500
- if (hasRequiredDeburr) return deburr_1;
2501
- hasRequiredDeburr = 1;
2502
- var deburrLetter = require_deburrLetter(),
2503
- toString = requireToString();
2504
-
2505
- /** Used to match Latin Unicode letters (excluding mathematical operators). */
2506
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
2507
-
2508
- /** Used to compose unicode character classes. */
2509
- var rsComboMarksRange = '\\u0300-\\u036f',
2510
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
2511
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
2512
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
2513
-
2514
- /** Used to compose unicode capture groups. */
2515
- var rsCombo = '[' + rsComboRange + ']';
2516
-
2517
- /**
2518
- * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
2519
- * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
2520
- */
2521
- var reComboMark = RegExp(rsCombo, 'g');
2522
-
2523
- /**
2524
- * Deburrs `string` by converting
2525
- * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
2526
- * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
2527
- * letters to basic Latin letters and removing
2528
- * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
2529
- *
2530
- * @static
2531
- * @memberOf _
2532
- * @since 3.0.0
2533
- * @category String
2534
- * @param {string} [string=''] The string to deburr.
2535
- * @returns {string} Returns the deburred string.
2536
- * @example
2537
- *
2538
- * _.deburr('déjà vu');
2539
- * // => 'deja vu'
2540
- */
2541
- function deburr(string) {
2542
- string = toString(string);
2543
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
2544
- }
2545
-
2546
- deburr_1 = deburr;
2547
- return deburr_1;
2548
- }
2549
-
2550
- /** Used to match words composed of alphanumeric characters. */
2551
-
2552
- var _asciiWords;
2553
- var hasRequired_asciiWords;
2554
-
2555
- function require_asciiWords () {
2556
- if (hasRequired_asciiWords) return _asciiWords;
2557
- hasRequired_asciiWords = 1;
2558
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
2559
-
2560
- /**
2561
- * Splits an ASCII `string` into an array of its words.
2562
- *
2563
- * @private
2564
- * @param {string} The string to inspect.
2565
- * @returns {Array} Returns the words of `string`.
2566
- */
2567
- function asciiWords(string) {
2568
- return string.match(reAsciiWord) || [];
2569
- }
2570
-
2571
- _asciiWords = asciiWords;
2572
- return _asciiWords;
2573
- }
2574
-
2575
- /** Used to detect strings that need a more robust regexp to match words. */
2576
-
2577
- var _hasUnicodeWord;
2578
- var hasRequired_hasUnicodeWord;
2579
-
2580
- function require_hasUnicodeWord () {
2581
- if (hasRequired_hasUnicodeWord) return _hasUnicodeWord;
2582
- hasRequired_hasUnicodeWord = 1;
2583
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
2584
-
2585
- /**
2586
- * Checks if `string` contains a word composed of Unicode symbols.
2587
- *
2588
- * @private
2589
- * @param {string} string The string to inspect.
2590
- * @returns {boolean} Returns `true` if a word is found, else `false`.
2591
- */
2592
- function hasUnicodeWord(string) {
2593
- return reHasUnicodeWord.test(string);
2594
- }
2595
-
2596
- _hasUnicodeWord = hasUnicodeWord;
2597
- return _hasUnicodeWord;
2598
- }
2599
-
2600
- /** Used to compose unicode character classes. */
2601
-
2602
- var _unicodeWords;
2603
- var hasRequired_unicodeWords;
2604
-
2605
- function require_unicodeWords () {
2606
- if (hasRequired_unicodeWords) return _unicodeWords;
2607
- hasRequired_unicodeWords = 1;
2608
- var rsAstralRange = '\\ud800-\\udfff',
2609
- rsComboMarksRange = '\\u0300-\\u036f',
2610
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
2611
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
2612
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
2613
- rsDingbatRange = '\\u2700-\\u27bf',
2614
- rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
2615
- rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
2616
- rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
2617
- rsPunctuationRange = '\\u2000-\\u206f',
2618
- rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
2619
- rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
2620
- rsVarRange = '\\ufe0e\\ufe0f',
2621
- rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
2622
-
2623
- /** Used to compose unicode capture groups. */
2624
- var rsApos = "['\u2019]",
2625
- rsBreak = '[' + rsBreakRange + ']',
2626
- rsCombo = '[' + rsComboRange + ']',
2627
- rsDigits = '\\d+',
2628
- rsDingbat = '[' + rsDingbatRange + ']',
2629
- rsLower = '[' + rsLowerRange + ']',
2630
- rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
2631
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
2632
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
2633
- rsNonAstral = '[^' + rsAstralRange + ']',
2634
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
2635
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
2636
- rsUpper = '[' + rsUpperRange + ']',
2637
- rsZWJ = '\\u200d';
2638
-
2639
- /** Used to compose unicode regexes. */
2640
- var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
2641
- rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
2642
- rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
2643
- rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
2644
- reOptMod = rsModifier + '?',
2645
- rsOptVar = '[' + rsVarRange + ']?',
2646
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
2647
- rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
2648
- rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
2649
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
2650
- rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
2651
-
2652
- /** Used to match complex or compound words. */
2653
- var reUnicodeWord = RegExp([
2654
- rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
2655
- rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
2656
- rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
2657
- rsUpper + '+' + rsOptContrUpper,
2658
- rsOrdUpper,
2659
- rsOrdLower,
2660
- rsDigits,
2661
- rsEmoji
2662
- ].join('|'), 'g');
2663
-
2664
- /**
2665
- * Splits a Unicode `string` into an array of its words.
2666
- *
2667
- * @private
2668
- * @param {string} The string to inspect.
2669
- * @returns {Array} Returns the words of `string`.
2670
- */
2671
- function unicodeWords(string) {
2672
- return string.match(reUnicodeWord) || [];
2673
- }
2674
-
2675
- _unicodeWords = unicodeWords;
2676
- return _unicodeWords;
2677
- }
2678
-
2679
- var words_1;
2680
- var hasRequiredWords;
2681
-
2682
- function requireWords () {
2683
- if (hasRequiredWords) return words_1;
2684
- hasRequiredWords = 1;
2685
- var asciiWords = require_asciiWords(),
2686
- hasUnicodeWord = require_hasUnicodeWord(),
2687
- toString = requireToString(),
2688
- unicodeWords = require_unicodeWords();
2689
-
2690
- /**
2691
- * Splits `string` into an array of its words.
2692
- *
2693
- * @static
2694
- * @memberOf _
2695
- * @since 3.0.0
2696
- * @category String
2697
- * @param {string} [string=''] The string to inspect.
2698
- * @param {RegExp|string} [pattern] The pattern to match words.
2699
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
2700
- * @returns {Array} Returns the words of `string`.
2701
- * @example
2702
- *
2703
- * _.words('fred, barney, & pebbles');
2704
- * // => ['fred', 'barney', 'pebbles']
2705
- *
2706
- * _.words('fred, barney, & pebbles', /[^, ]+/g);
2707
- * // => ['fred', 'barney', '&', 'pebbles']
2708
- */
2709
- function words(string, pattern, guard) {
2710
- string = toString(string);
2711
- pattern = guard ? undefined : pattern;
2712
-
2713
- if (pattern === undefined) {
2714
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
2715
- }
2716
- return string.match(pattern) || [];
2717
- }
2718
-
2719
- words_1 = words;
2720
- return words_1;
2721
- }
2722
-
2723
- var _createCompounder;
2724
- var hasRequired_createCompounder;
2725
-
2726
- function require_createCompounder () {
2727
- if (hasRequired_createCompounder) return _createCompounder;
2728
- hasRequired_createCompounder = 1;
2729
- var arrayReduce = require_arrayReduce(),
2730
- deburr = requireDeburr(),
2731
- words = requireWords();
2732
-
2733
- /** Used to compose unicode capture groups. */
2734
- var rsApos = "['\u2019]";
2735
-
2736
- /** Used to match apostrophes. */
2737
- var reApos = RegExp(rsApos, 'g');
2738
-
2739
- /**
2740
- * Creates a function like `_.camelCase`.
2741
- *
2742
- * @private
2743
- * @param {Function} callback The function to combine each word.
2744
- * @returns {Function} Returns the new compounder function.
2745
- */
2746
- function createCompounder(callback) {
2747
- return function(string) {
2748
- return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
2749
- };
2750
- }
2751
-
2752
- _createCompounder = createCompounder;
2753
- return _createCompounder;
2754
- }
2755
-
2756
- var snakeCase_1;
2757
- var hasRequiredSnakeCase;
2758
-
2759
- function requireSnakeCase () {
2760
- if (hasRequiredSnakeCase) return snakeCase_1;
2761
- hasRequiredSnakeCase = 1;
2762
- var createCompounder = require_createCompounder();
2763
-
2764
- /**
2765
- * Converts `string` to
2766
- * [snake case](https://en.wikipedia.org/wiki/Snake_case).
2767
- *
2768
- * @static
2769
- * @memberOf _
2770
- * @since 3.0.0
2771
- * @category String
2772
- * @param {string} [string=''] The string to convert.
2773
- * @returns {string} Returns the snake cased string.
2774
- * @example
2775
- *
2776
- * _.snakeCase('Foo Bar');
2777
- * // => 'foo_bar'
2778
- *
2779
- * _.snakeCase('fooBar');
2780
- * // => 'foo_bar'
2781
- *
2782
- * _.snakeCase('--FOO-BAR--');
2783
- * // => 'foo_bar'
2784
- */
2785
- var snakeCase = createCompounder(function(result, word, index) {
2786
- return result + (index ? '_' : '') + word.toLowerCase();
2787
- });
2788
-
2789
- snakeCase_1 = snakeCase;
2790
- return snakeCase_1;
2791
- }
2792
-
2793
- var snakeCaseExports = requireSnakeCase();
2794
- var snakeCase = /*@__PURE__*/getDefaultExportFromCjs(snakeCaseExports);
2795
-
2796
- const convertKeysToSnakeCase = obj => {
2797
- let snakeCaseObj = {};
2798
- for (const key of Object.keys(obj)) {
2799
- const snakeCaseKey = snakeCase(key);
2800
- snakeCaseObj[snakeCaseKey] = obj[key];
41
+ const toSnakeCase = key => key.replace(/([a-z0-9])([A-Z])/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
42
+ const pickCloudinaryKeysFromOptions = options => {
43
+ const out = {};
44
+ for (const key of Object.keys(options)) {
45
+ const snake = toSnakeCase(key);
46
+ if (CLOUDINARY_CONFIG_KEYS.has(snake)) {
47
+ out[snake] = options[key];
48
+ }
2801
49
  }
2802
- return snakeCaseObj;
50
+ return out;
2803
51
  };
2804
-
2805
52
  const getCloudinaryConfigFromOptions = options => {
2806
53
  if (options.cloudinaryConfig) {
2807
54
  return options.cloudinaryConfig;
2808
55
  }
2809
- const snakeCaseCloudinaryConfig = pick(convertKeysToSnakeCase(options), CLOUDINARY_CONFIG_PARAM);
2810
- return Object.assign({}, snakeCaseCloudinaryConfig);
56
+ return Object.assign({}, pickCloudinaryKeysFromOptions(options));
2811
57
  };
2812
58
 
2813
- export { ADAPTIVE_SOURCETYPES as A, CONTAINER_MIME_TYPES as C, DEFAULT_VIDEO_PARAMS as D, FORMAT_MAPPINGS as F, RENDITIONS as R, VIDEO_SUFFIX_REMOVAL_PATTERN as V, appendQueryParams as a, require_getNative as b, require_Map as c, require_toSource as d, requireIsLength as e, requireIsArguments as f, getCloudinaryConfigFromOptions as g, require_baseGet as h, isRawUrl as i, require_ListCache as j, require_MapCache as k, require_assignValue as l, require_baseAssignValue as m, require_isIndex as n, require_arrayPush as o, require_castPath as p, require_toKey as q, requireIsSymbol as r, require_arrayMap as s, require_flatRest as t, utf8ToBase64 as u, DEFAULT_POSTER_PARAMS as v, DEFAULT_DPR as w, requireToString as x, require_createCompounder as y, pick as z };
59
+ export { CLOUDINARY_CONFIG_PARAM as C, appendQueryParams as a, getCloudinaryConfigFromOptions as g, isRawUrl as i, utf8ToBase64 as u };