@medipass/checkout-sdk 2.0.1 → 3.0.0-alpha.0

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.
@@ -1,2193 +0,0 @@
1
- /*! @medipass/checkout-sdk v2.0.1 */
2
- (function webpackUniversalModuleDefinition(root, factory) {
3
- if(typeof exports === 'object' && typeof module === 'object')
4
- module.exports = factory();
5
- else if(typeof define === 'function' && define.amd)
6
- define([], factory);
7
- else if(typeof exports === 'object')
8
- exports["MedipassCheckoutSDK"] = factory();
9
- else
10
- root["MedipassCheckoutSDK"] = factory();
11
- })(window, function() {
12
- return /******/ (function(modules) { // webpackBootstrap
13
- /******/ // The module cache
14
- /******/ var installedModules = {};
15
- /******/
16
- /******/ // The require function
17
- /******/ function __webpack_require__(moduleId) {
18
- /******/
19
- /******/ // Check if module is in cache
20
- /******/ if(installedModules[moduleId]) {
21
- /******/ return installedModules[moduleId].exports;
22
- /******/ }
23
- /******/ // Create a new module (and put it into the cache)
24
- /******/ var module = installedModules[moduleId] = {
25
- /******/ i: moduleId,
26
- /******/ l: false,
27
- /******/ exports: {}
28
- /******/ };
29
- /******/
30
- /******/ // Execute the module function
31
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
32
- /******/
33
- /******/ // Flag the module as loaded
34
- /******/ module.l = true;
35
- /******/
36
- /******/ // Return the exports of the module
37
- /******/ return module.exports;
38
- /******/ }
39
- /******/
40
- /******/
41
- /******/ // expose the modules object (__webpack_modules__)
42
- /******/ __webpack_require__.m = modules;
43
- /******/
44
- /******/ // expose the module cache
45
- /******/ __webpack_require__.c = installedModules;
46
- /******/
47
- /******/ // define getter function for harmony exports
48
- /******/ __webpack_require__.d = function(exports, name, getter) {
49
- /******/ if(!__webpack_require__.o(exports, name)) {
50
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
51
- /******/ }
52
- /******/ };
53
- /******/
54
- /******/ // define __esModule on exports
55
- /******/ __webpack_require__.r = function(exports) {
56
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
57
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
58
- /******/ }
59
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
60
- /******/ };
61
- /******/
62
- /******/ // create a fake namespace object
63
- /******/ // mode & 1: value is a module id, require it
64
- /******/ // mode & 2: merge all properties of value into the ns
65
- /******/ // mode & 4: return value when already ns object
66
- /******/ // mode & 8|1: behave like require
67
- /******/ __webpack_require__.t = function(value, mode) {
68
- /******/ if(mode & 1) value = __webpack_require__(value);
69
- /******/ if(mode & 8) return value;
70
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
71
- /******/ var ns = Object.create(null);
72
- /******/ __webpack_require__.r(ns);
73
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
74
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
75
- /******/ return ns;
76
- /******/ };
77
- /******/
78
- /******/ // getDefaultExport function for compatibility with non-harmony modules
79
- /******/ __webpack_require__.n = function(module) {
80
- /******/ var getter = module && module.__esModule ?
81
- /******/ function getDefault() { return module['default']; } :
82
- /******/ function getModuleExports() { return module; };
83
- /******/ __webpack_require__.d(getter, 'a', getter);
84
- /******/ return getter;
85
- /******/ };
86
- /******/
87
- /******/ // Object.prototype.hasOwnProperty.call
88
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
89
- /******/
90
- /******/ // __webpack_public_path__
91
- /******/ __webpack_require__.p = "";
92
- /******/
93
- /******/
94
- /******/ // Load entry module and return exports
95
- /******/ return __webpack_require__(__webpack_require__.s = 11);
96
- /******/ })
97
- /************************************************************************/
98
- /******/ ([
99
- /* 0 */
100
- /***/ (function(module, exports, __webpack_require__) {
101
-
102
- var baseGet = __webpack_require__(12);
103
-
104
- /**
105
- * Gets the value at `path` of `object`. If the resolved value is
106
- * `undefined`, the `defaultValue` is returned in its place.
107
- *
108
- * @static
109
- * @memberOf _
110
- * @since 3.7.0
111
- * @category Object
112
- * @param {Object} object The object to query.
113
- * @param {Array|string} path The path of the property to get.
114
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
115
- * @returns {*} Returns the resolved value.
116
- * @example
117
- *
118
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
119
- *
120
- * _.get(object, 'a[0].b.c');
121
- * // => 3
122
- *
123
- * _.get(object, ['a', '0', 'b', 'c']);
124
- * // => 3
125
- *
126
- * _.get(object, 'a.b.c', 'default');
127
- * // => 'default'
128
- */
129
- function get(object, path, defaultValue) {
130
- var result = object == null ? undefined : baseGet(object, path);
131
- return result === undefined ? defaultValue : result;
132
- }
133
-
134
- module.exports = get;
135
-
136
-
137
- /***/ }),
138
- /* 1 */
139
- /***/ (function(module, exports, __webpack_require__) {
140
-
141
- var getNative = __webpack_require__(9);
142
-
143
- /* Built-in method references that are verified to be native. */
144
- var nativeCreate = getNative(Object, 'create');
145
-
146
- module.exports = nativeCreate;
147
-
148
-
149
- /***/ }),
150
- /* 2 */
151
- /***/ (function(module, exports, __webpack_require__) {
152
-
153
- var eq = __webpack_require__(40);
154
-
155
- /**
156
- * Gets the index at which the `key` is found in `array` of key-value pairs.
157
- *
158
- * @private
159
- * @param {Array} array The array to inspect.
160
- * @param {*} key The key to search for.
161
- * @returns {number} Returns the index of the matched value, else `-1`.
162
- */
163
- function assocIndexOf(array, key) {
164
- var length = array.length;
165
- while (length--) {
166
- if (eq(array[length][0], key)) {
167
- return length;
168
- }
169
- }
170
- return -1;
171
- }
172
-
173
- module.exports = assocIndexOf;
174
-
175
-
176
- /***/ }),
177
- /* 3 */
178
- /***/ (function(module, exports, __webpack_require__) {
179
-
180
- var isKeyable = __webpack_require__(46);
181
-
182
- /**
183
- * Gets the data for `map`.
184
- *
185
- * @private
186
- * @param {Object} map The map to query.
187
- * @param {string} key The reference key.
188
- * @returns {*} Returns the map data.
189
- */
190
- function getMapData(map, key) {
191
- var data = map.__data__;
192
- return isKeyable(key)
193
- ? data[typeof key == 'string' ? 'string' : 'hash']
194
- : data.map;
195
- }
196
-
197
- module.exports = getMapData;
198
-
199
-
200
- /***/ }),
201
- /* 4 */
202
- /***/ (function(module, exports) {
203
-
204
- /**
205
- * Checks if `value` is classified as an `Array` object.
206
- *
207
- * @static
208
- * @memberOf _
209
- * @since 0.1.0
210
- * @category Lang
211
- * @param {*} value The value to check.
212
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
213
- * @example
214
- *
215
- * _.isArray([1, 2, 3]);
216
- * // => true
217
- *
218
- * _.isArray(document.body.children);
219
- * // => false
220
- *
221
- * _.isArray('abc');
222
- * // => false
223
- *
224
- * _.isArray(_.noop);
225
- * // => false
226
- */
227
- var isArray = Array.isArray;
228
-
229
- module.exports = isArray;
230
-
231
-
232
- /***/ }),
233
- /* 5 */
234
- /***/ (function(module, exports, __webpack_require__) {
235
-
236
- var baseGetTag = __webpack_require__(8),
237
- isObjectLike = __webpack_require__(19);
238
-
239
- /** `Object#toString` result references. */
240
- var symbolTag = '[object Symbol]';
241
-
242
- /**
243
- * Checks if `value` is classified as a `Symbol` primitive or object.
244
- *
245
- * @static
246
- * @memberOf _
247
- * @since 4.0.0
248
- * @category Lang
249
- * @param {*} value The value to check.
250
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
251
- * @example
252
- *
253
- * _.isSymbol(Symbol.iterator);
254
- * // => true
255
- *
256
- * _.isSymbol('abc');
257
- * // => false
258
- */
259
- function isSymbol(value) {
260
- return typeof value == 'symbol' ||
261
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
262
- }
263
-
264
- module.exports = isSymbol;
265
-
266
-
267
- /***/ }),
268
- /* 6 */
269
- /***/ (function(module, exports, __webpack_require__) {
270
-
271
- var root = __webpack_require__(7);
272
-
273
- /** Built-in value references. */
274
- var Symbol = root.Symbol;
275
-
276
- module.exports = Symbol;
277
-
278
-
279
- /***/ }),
280
- /* 7 */
281
- /***/ (function(module, exports, __webpack_require__) {
282
-
283
- var freeGlobal = __webpack_require__(15);
284
-
285
- /** Detect free variable `self`. */
286
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
287
-
288
- /** Used as a reference to the global object. */
289
- var root = freeGlobal || freeSelf || Function('return this')();
290
-
291
- module.exports = root;
292
-
293
-
294
- /***/ }),
295
- /* 8 */
296
- /***/ (function(module, exports, __webpack_require__) {
297
-
298
- var Symbol = __webpack_require__(6),
299
- getRawTag = __webpack_require__(17),
300
- objectToString = __webpack_require__(18);
301
-
302
- /** `Object#toString` result references. */
303
- var nullTag = '[object Null]',
304
- undefinedTag = '[object Undefined]';
305
-
306
- /** Built-in value references. */
307
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
308
-
309
- /**
310
- * The base implementation of `getTag` without fallbacks for buggy environments.
311
- *
312
- * @private
313
- * @param {*} value The value to query.
314
- * @returns {string} Returns the `toStringTag`.
315
- */
316
- function baseGetTag(value) {
317
- if (value == null) {
318
- return value === undefined ? undefinedTag : nullTag;
319
- }
320
- return (symToStringTag && symToStringTag in Object(value))
321
- ? getRawTag(value)
322
- : objectToString(value);
323
- }
324
-
325
- module.exports = baseGetTag;
326
-
327
-
328
- /***/ }),
329
- /* 9 */
330
- /***/ (function(module, exports, __webpack_require__) {
331
-
332
- var baseIsNative = __webpack_require__(27),
333
- getValue = __webpack_require__(32);
334
-
335
- /**
336
- * Gets the native function at `key` of `object`.
337
- *
338
- * @private
339
- * @param {Object} object The object to query.
340
- * @param {string} key The key of the method to get.
341
- * @returns {*} Returns the function if it's native, else `undefined`.
342
- */
343
- function getNative(object, key) {
344
- var value = getValue(object, key);
345
- return baseIsNative(value) ? value : undefined;
346
- }
347
-
348
- module.exports = getNative;
349
-
350
-
351
- /***/ }),
352
- /* 10 */
353
- /***/ (function(module, exports) {
354
-
355
- /**
356
- * Checks if `value` is the
357
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
358
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
359
- *
360
- * @static
361
- * @memberOf _
362
- * @since 0.1.0
363
- * @category Lang
364
- * @param {*} value The value to check.
365
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
366
- * @example
367
- *
368
- * _.isObject({});
369
- * // => true
370
- *
371
- * _.isObject([1, 2, 3]);
372
- * // => true
373
- *
374
- * _.isObject(_.noop);
375
- * // => true
376
- *
377
- * _.isObject(null);
378
- * // => false
379
- */
380
- function isObject(value) {
381
- var type = typeof value;
382
- return value != null && (type == 'object' || type == 'function');
383
- }
384
-
385
- module.exports = isObject;
386
-
387
-
388
- /***/ }),
389
- /* 11 */
390
- /***/ (function(module, exports, __webpack_require__) {
391
-
392
- module.exports = __webpack_require__(55);
393
-
394
-
395
- /***/ }),
396
- /* 12 */
397
- /***/ (function(module, exports, __webpack_require__) {
398
-
399
- var castPath = __webpack_require__(13),
400
- toKey = __webpack_require__(53);
401
-
402
- /**
403
- * The base implementation of `_.get` without support for default values.
404
- *
405
- * @private
406
- * @param {Object} object The object to query.
407
- * @param {Array|string} path The path of the property to get.
408
- * @returns {*} Returns the resolved value.
409
- */
410
- function baseGet(object, path) {
411
- path = castPath(path, object);
412
-
413
- var index = 0,
414
- length = path.length;
415
-
416
- while (object != null && index < length) {
417
- object = object[toKey(path[index++])];
418
- }
419
- return (index && index == length) ? object : undefined;
420
- }
421
-
422
- module.exports = baseGet;
423
-
424
-
425
- /***/ }),
426
- /* 13 */
427
- /***/ (function(module, exports, __webpack_require__) {
428
-
429
- var isArray = __webpack_require__(4),
430
- isKey = __webpack_require__(14),
431
- stringToPath = __webpack_require__(20),
432
- toString = __webpack_require__(50);
433
-
434
- /**
435
- * Casts `value` to a path array if it's not one.
436
- *
437
- * @private
438
- * @param {*} value The value to inspect.
439
- * @param {Object} [object] The object to query keys on.
440
- * @returns {Array} Returns the cast property path array.
441
- */
442
- function castPath(value, object) {
443
- if (isArray(value)) {
444
- return value;
445
- }
446
- return isKey(value, object) ? [value] : stringToPath(toString(value));
447
- }
448
-
449
- module.exports = castPath;
450
-
451
-
452
- /***/ }),
453
- /* 14 */
454
- /***/ (function(module, exports, __webpack_require__) {
455
-
456
- var isArray = __webpack_require__(4),
457
- isSymbol = __webpack_require__(5);
458
-
459
- /** Used to match property names within property paths. */
460
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
461
- reIsPlainProp = /^\w*$/;
462
-
463
- /**
464
- * Checks if `value` is a property name and not a property path.
465
- *
466
- * @private
467
- * @param {*} value The value to check.
468
- * @param {Object} [object] The object to query keys on.
469
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
470
- */
471
- function isKey(value, object) {
472
- if (isArray(value)) {
473
- return false;
474
- }
475
- var type = typeof value;
476
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
477
- value == null || isSymbol(value)) {
478
- return true;
479
- }
480
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
481
- (object != null && value in Object(object));
482
- }
483
-
484
- module.exports = isKey;
485
-
486
-
487
- /***/ }),
488
- /* 15 */
489
- /***/ (function(module, exports, __webpack_require__) {
490
-
491
- /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
492
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
493
-
494
- module.exports = freeGlobal;
495
-
496
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(16)))
497
-
498
- /***/ }),
499
- /* 16 */
500
- /***/ (function(module, exports) {
501
-
502
- var g;
503
-
504
- // This works in non-strict mode
505
- g = (function() {
506
- return this;
507
- })();
508
-
509
- try {
510
- // This works if eval is allowed (see CSP)
511
- g = g || new Function("return this")();
512
- } catch (e) {
513
- // This works if the window reference is available
514
- if (typeof window === "object") g = window;
515
- }
516
-
517
- // g can still be undefined, but nothing to do about it...
518
- // We return undefined, instead of nothing here, so it's
519
- // easier to handle this case. if(!global) { ...}
520
-
521
- module.exports = g;
522
-
523
-
524
- /***/ }),
525
- /* 17 */
526
- /***/ (function(module, exports, __webpack_require__) {
527
-
528
- var Symbol = __webpack_require__(6);
529
-
530
- /** Used for built-in method references. */
531
- var objectProto = Object.prototype;
532
-
533
- /** Used to check objects for own properties. */
534
- var hasOwnProperty = objectProto.hasOwnProperty;
535
-
536
- /**
537
- * Used to resolve the
538
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
539
- * of values.
540
- */
541
- var nativeObjectToString = objectProto.toString;
542
-
543
- /** Built-in value references. */
544
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
545
-
546
- /**
547
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
548
- *
549
- * @private
550
- * @param {*} value The value to query.
551
- * @returns {string} Returns the raw `toStringTag`.
552
- */
553
- function getRawTag(value) {
554
- var isOwn = hasOwnProperty.call(value, symToStringTag),
555
- tag = value[symToStringTag];
556
-
557
- try {
558
- value[symToStringTag] = undefined;
559
- var unmasked = true;
560
- } catch (e) {}
561
-
562
- var result = nativeObjectToString.call(value);
563
- if (unmasked) {
564
- if (isOwn) {
565
- value[symToStringTag] = tag;
566
- } else {
567
- delete value[symToStringTag];
568
- }
569
- }
570
- return result;
571
- }
572
-
573
- module.exports = getRawTag;
574
-
575
-
576
- /***/ }),
577
- /* 18 */
578
- /***/ (function(module, exports) {
579
-
580
- /** Used for built-in method references. */
581
- var objectProto = Object.prototype;
582
-
583
- /**
584
- * Used to resolve the
585
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
586
- * of values.
587
- */
588
- var nativeObjectToString = objectProto.toString;
589
-
590
- /**
591
- * Converts `value` to a string using `Object.prototype.toString`.
592
- *
593
- * @private
594
- * @param {*} value The value to convert.
595
- * @returns {string} Returns the converted string.
596
- */
597
- function objectToString(value) {
598
- return nativeObjectToString.call(value);
599
- }
600
-
601
- module.exports = objectToString;
602
-
603
-
604
- /***/ }),
605
- /* 19 */
606
- /***/ (function(module, exports) {
607
-
608
- /**
609
- * Checks if `value` is object-like. A value is object-like if it's not `null`
610
- * and has a `typeof` result of "object".
611
- *
612
- * @static
613
- * @memberOf _
614
- * @since 4.0.0
615
- * @category Lang
616
- * @param {*} value The value to check.
617
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
618
- * @example
619
- *
620
- * _.isObjectLike({});
621
- * // => true
622
- *
623
- * _.isObjectLike([1, 2, 3]);
624
- * // => true
625
- *
626
- * _.isObjectLike(_.noop);
627
- * // => false
628
- *
629
- * _.isObjectLike(null);
630
- * // => false
631
- */
632
- function isObjectLike(value) {
633
- return value != null && typeof value == 'object';
634
- }
635
-
636
- module.exports = isObjectLike;
637
-
638
-
639
- /***/ }),
640
- /* 20 */
641
- /***/ (function(module, exports, __webpack_require__) {
642
-
643
- var memoizeCapped = __webpack_require__(21);
644
-
645
- /** Used to match property names within property paths. */
646
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
647
-
648
- /** Used to match backslashes in property paths. */
649
- var reEscapeChar = /\\(\\)?/g;
650
-
651
- /**
652
- * Converts `string` to a property path array.
653
- *
654
- * @private
655
- * @param {string} string The string to convert.
656
- * @returns {Array} Returns the property path array.
657
- */
658
- var stringToPath = memoizeCapped(function(string) {
659
- var result = [];
660
- if (string.charCodeAt(0) === 46 /* . */) {
661
- result.push('');
662
- }
663
- string.replace(rePropName, function(match, number, quote, subString) {
664
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
665
- });
666
- return result;
667
- });
668
-
669
- module.exports = stringToPath;
670
-
671
-
672
- /***/ }),
673
- /* 21 */
674
- /***/ (function(module, exports, __webpack_require__) {
675
-
676
- var memoize = __webpack_require__(22);
677
-
678
- /** Used as the maximum memoize cache size. */
679
- var MAX_MEMOIZE_SIZE = 500;
680
-
681
- /**
682
- * A specialized version of `_.memoize` which clears the memoized function's
683
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
684
- *
685
- * @private
686
- * @param {Function} func The function to have its output memoized.
687
- * @returns {Function} Returns the new memoized function.
688
- */
689
- function memoizeCapped(func) {
690
- var result = memoize(func, function(key) {
691
- if (cache.size === MAX_MEMOIZE_SIZE) {
692
- cache.clear();
693
- }
694
- return key;
695
- });
696
-
697
- var cache = result.cache;
698
- return result;
699
- }
700
-
701
- module.exports = memoizeCapped;
702
-
703
-
704
- /***/ }),
705
- /* 22 */
706
- /***/ (function(module, exports, __webpack_require__) {
707
-
708
- var MapCache = __webpack_require__(23);
709
-
710
- /** Error message constants. */
711
- var FUNC_ERROR_TEXT = 'Expected a function';
712
-
713
- /**
714
- * Creates a function that memoizes the result of `func`. If `resolver` is
715
- * provided, it determines the cache key for storing the result based on the
716
- * arguments provided to the memoized function. By default, the first argument
717
- * provided to the memoized function is used as the map cache key. The `func`
718
- * is invoked with the `this` binding of the memoized function.
719
- *
720
- * **Note:** The cache is exposed as the `cache` property on the memoized
721
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
722
- * constructor with one whose instances implement the
723
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
724
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
725
- *
726
- * @static
727
- * @memberOf _
728
- * @since 0.1.0
729
- * @category Function
730
- * @param {Function} func The function to have its output memoized.
731
- * @param {Function} [resolver] The function to resolve the cache key.
732
- * @returns {Function} Returns the new memoized function.
733
- * @example
734
- *
735
- * var object = { 'a': 1, 'b': 2 };
736
- * var other = { 'c': 3, 'd': 4 };
737
- *
738
- * var values = _.memoize(_.values);
739
- * values(object);
740
- * // => [1, 2]
741
- *
742
- * values(other);
743
- * // => [3, 4]
744
- *
745
- * object.a = 2;
746
- * values(object);
747
- * // => [1, 2]
748
- *
749
- * // Modify the result cache.
750
- * values.cache.set(object, ['a', 'b']);
751
- * values(object);
752
- * // => ['a', 'b']
753
- *
754
- * // Replace `_.memoize.Cache`.
755
- * _.memoize.Cache = WeakMap;
756
- */
757
- function memoize(func, resolver) {
758
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
759
- throw new TypeError(FUNC_ERROR_TEXT);
760
- }
761
- var memoized = function() {
762
- var args = arguments,
763
- key = resolver ? resolver.apply(this, args) : args[0],
764
- cache = memoized.cache;
765
-
766
- if (cache.has(key)) {
767
- return cache.get(key);
768
- }
769
- var result = func.apply(this, args);
770
- memoized.cache = cache.set(key, result) || cache;
771
- return result;
772
- };
773
- memoized.cache = new (memoize.Cache || MapCache);
774
- return memoized;
775
- }
776
-
777
- // Expose `MapCache`.
778
- memoize.Cache = MapCache;
779
-
780
- module.exports = memoize;
781
-
782
-
783
- /***/ }),
784
- /* 23 */
785
- /***/ (function(module, exports, __webpack_require__) {
786
-
787
- var mapCacheClear = __webpack_require__(24),
788
- mapCacheDelete = __webpack_require__(45),
789
- mapCacheGet = __webpack_require__(47),
790
- mapCacheHas = __webpack_require__(48),
791
- mapCacheSet = __webpack_require__(49);
792
-
793
- /**
794
- * Creates a map cache object to store key-value pairs.
795
- *
796
- * @private
797
- * @constructor
798
- * @param {Array} [entries] The key-value pairs to cache.
799
- */
800
- function MapCache(entries) {
801
- var index = -1,
802
- length = entries == null ? 0 : entries.length;
803
-
804
- this.clear();
805
- while (++index < length) {
806
- var entry = entries[index];
807
- this.set(entry[0], entry[1]);
808
- }
809
- }
810
-
811
- // Add methods to `MapCache`.
812
- MapCache.prototype.clear = mapCacheClear;
813
- MapCache.prototype['delete'] = mapCacheDelete;
814
- MapCache.prototype.get = mapCacheGet;
815
- MapCache.prototype.has = mapCacheHas;
816
- MapCache.prototype.set = mapCacheSet;
817
-
818
- module.exports = MapCache;
819
-
820
-
821
- /***/ }),
822
- /* 24 */
823
- /***/ (function(module, exports, __webpack_require__) {
824
-
825
- var Hash = __webpack_require__(25),
826
- ListCache = __webpack_require__(37),
827
- Map = __webpack_require__(44);
828
-
829
- /**
830
- * Removes all key-value entries from the map.
831
- *
832
- * @private
833
- * @name clear
834
- * @memberOf MapCache
835
- */
836
- function mapCacheClear() {
837
- this.size = 0;
838
- this.__data__ = {
839
- 'hash': new Hash,
840
- 'map': new (Map || ListCache),
841
- 'string': new Hash
842
- };
843
- }
844
-
845
- module.exports = mapCacheClear;
846
-
847
-
848
- /***/ }),
849
- /* 25 */
850
- /***/ (function(module, exports, __webpack_require__) {
851
-
852
- var hashClear = __webpack_require__(26),
853
- hashDelete = __webpack_require__(33),
854
- hashGet = __webpack_require__(34),
855
- hashHas = __webpack_require__(35),
856
- hashSet = __webpack_require__(36);
857
-
858
- /**
859
- * Creates a hash object.
860
- *
861
- * @private
862
- * @constructor
863
- * @param {Array} [entries] The key-value pairs to cache.
864
- */
865
- function Hash(entries) {
866
- var index = -1,
867
- length = entries == null ? 0 : entries.length;
868
-
869
- this.clear();
870
- while (++index < length) {
871
- var entry = entries[index];
872
- this.set(entry[0], entry[1]);
873
- }
874
- }
875
-
876
- // Add methods to `Hash`.
877
- Hash.prototype.clear = hashClear;
878
- Hash.prototype['delete'] = hashDelete;
879
- Hash.prototype.get = hashGet;
880
- Hash.prototype.has = hashHas;
881
- Hash.prototype.set = hashSet;
882
-
883
- module.exports = Hash;
884
-
885
-
886
- /***/ }),
887
- /* 26 */
888
- /***/ (function(module, exports, __webpack_require__) {
889
-
890
- var nativeCreate = __webpack_require__(1);
891
-
892
- /**
893
- * Removes all key-value entries from the hash.
894
- *
895
- * @private
896
- * @name clear
897
- * @memberOf Hash
898
- */
899
- function hashClear() {
900
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
901
- this.size = 0;
902
- }
903
-
904
- module.exports = hashClear;
905
-
906
-
907
- /***/ }),
908
- /* 27 */
909
- /***/ (function(module, exports, __webpack_require__) {
910
-
911
- var isFunction = __webpack_require__(28),
912
- isMasked = __webpack_require__(29),
913
- isObject = __webpack_require__(10),
914
- toSource = __webpack_require__(31);
915
-
916
- /**
917
- * Used to match `RegExp`
918
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
919
- */
920
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
921
-
922
- /** Used to detect host constructors (Safari). */
923
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
924
-
925
- /** Used for built-in method references. */
926
- var funcProto = Function.prototype,
927
- objectProto = Object.prototype;
928
-
929
- /** Used to resolve the decompiled source of functions. */
930
- var funcToString = funcProto.toString;
931
-
932
- /** Used to check objects for own properties. */
933
- var hasOwnProperty = objectProto.hasOwnProperty;
934
-
935
- /** Used to detect if a method is native. */
936
- var reIsNative = RegExp('^' +
937
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
938
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
939
- );
940
-
941
- /**
942
- * The base implementation of `_.isNative` without bad shim checks.
943
- *
944
- * @private
945
- * @param {*} value The value to check.
946
- * @returns {boolean} Returns `true` if `value` is a native function,
947
- * else `false`.
948
- */
949
- function baseIsNative(value) {
950
- if (!isObject(value) || isMasked(value)) {
951
- return false;
952
- }
953
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
954
- return pattern.test(toSource(value));
955
- }
956
-
957
- module.exports = baseIsNative;
958
-
959
-
960
- /***/ }),
961
- /* 28 */
962
- /***/ (function(module, exports, __webpack_require__) {
963
-
964
- var baseGetTag = __webpack_require__(8),
965
- isObject = __webpack_require__(10);
966
-
967
- /** `Object#toString` result references. */
968
- var asyncTag = '[object AsyncFunction]',
969
- funcTag = '[object Function]',
970
- genTag = '[object GeneratorFunction]',
971
- proxyTag = '[object Proxy]';
972
-
973
- /**
974
- * Checks if `value` is classified as a `Function` object.
975
- *
976
- * @static
977
- * @memberOf _
978
- * @since 0.1.0
979
- * @category Lang
980
- * @param {*} value The value to check.
981
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
982
- * @example
983
- *
984
- * _.isFunction(_);
985
- * // => true
986
- *
987
- * _.isFunction(/abc/);
988
- * // => false
989
- */
990
- function isFunction(value) {
991
- if (!isObject(value)) {
992
- return false;
993
- }
994
- // The use of `Object#toString` avoids issues with the `typeof` operator
995
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
996
- var tag = baseGetTag(value);
997
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
998
- }
999
-
1000
- module.exports = isFunction;
1001
-
1002
-
1003
- /***/ }),
1004
- /* 29 */
1005
- /***/ (function(module, exports, __webpack_require__) {
1006
-
1007
- var coreJsData = __webpack_require__(30);
1008
-
1009
- /** Used to detect methods masquerading as native. */
1010
- var maskSrcKey = (function() {
1011
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1012
- return uid ? ('Symbol(src)_1.' + uid) : '';
1013
- }());
1014
-
1015
- /**
1016
- * Checks if `func` has its source masked.
1017
- *
1018
- * @private
1019
- * @param {Function} func The function to check.
1020
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1021
- */
1022
- function isMasked(func) {
1023
- return !!maskSrcKey && (maskSrcKey in func);
1024
- }
1025
-
1026
- module.exports = isMasked;
1027
-
1028
-
1029
- /***/ }),
1030
- /* 30 */
1031
- /***/ (function(module, exports, __webpack_require__) {
1032
-
1033
- var root = __webpack_require__(7);
1034
-
1035
- /** Used to detect overreaching core-js shims. */
1036
- var coreJsData = root['__core-js_shared__'];
1037
-
1038
- module.exports = coreJsData;
1039
-
1040
-
1041
- /***/ }),
1042
- /* 31 */
1043
- /***/ (function(module, exports) {
1044
-
1045
- /** Used for built-in method references. */
1046
- var funcProto = Function.prototype;
1047
-
1048
- /** Used to resolve the decompiled source of functions. */
1049
- var funcToString = funcProto.toString;
1050
-
1051
- /**
1052
- * Converts `func` to its source code.
1053
- *
1054
- * @private
1055
- * @param {Function} func The function to convert.
1056
- * @returns {string} Returns the source code.
1057
- */
1058
- function toSource(func) {
1059
- if (func != null) {
1060
- try {
1061
- return funcToString.call(func);
1062
- } catch (e) {}
1063
- try {
1064
- return (func + '');
1065
- } catch (e) {}
1066
- }
1067
- return '';
1068
- }
1069
-
1070
- module.exports = toSource;
1071
-
1072
-
1073
- /***/ }),
1074
- /* 32 */
1075
- /***/ (function(module, exports) {
1076
-
1077
- /**
1078
- * Gets the value at `key` of `object`.
1079
- *
1080
- * @private
1081
- * @param {Object} [object] The object to query.
1082
- * @param {string} key The key of the property to get.
1083
- * @returns {*} Returns the property value.
1084
- */
1085
- function getValue(object, key) {
1086
- return object == null ? undefined : object[key];
1087
- }
1088
-
1089
- module.exports = getValue;
1090
-
1091
-
1092
- /***/ }),
1093
- /* 33 */
1094
- /***/ (function(module, exports) {
1095
-
1096
- /**
1097
- * Removes `key` and its value from the hash.
1098
- *
1099
- * @private
1100
- * @name delete
1101
- * @memberOf Hash
1102
- * @param {Object} hash The hash to modify.
1103
- * @param {string} key The key of the value to remove.
1104
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1105
- */
1106
- function hashDelete(key) {
1107
- var result = this.has(key) && delete this.__data__[key];
1108
- this.size -= result ? 1 : 0;
1109
- return result;
1110
- }
1111
-
1112
- module.exports = hashDelete;
1113
-
1114
-
1115
- /***/ }),
1116
- /* 34 */
1117
- /***/ (function(module, exports, __webpack_require__) {
1118
-
1119
- var nativeCreate = __webpack_require__(1);
1120
-
1121
- /** Used to stand-in for `undefined` hash values. */
1122
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1123
-
1124
- /** Used for built-in method references. */
1125
- var objectProto = Object.prototype;
1126
-
1127
- /** Used to check objects for own properties. */
1128
- var hasOwnProperty = objectProto.hasOwnProperty;
1129
-
1130
- /**
1131
- * Gets the hash value for `key`.
1132
- *
1133
- * @private
1134
- * @name get
1135
- * @memberOf Hash
1136
- * @param {string} key The key of the value to get.
1137
- * @returns {*} Returns the entry value.
1138
- */
1139
- function hashGet(key) {
1140
- var data = this.__data__;
1141
- if (nativeCreate) {
1142
- var result = data[key];
1143
- return result === HASH_UNDEFINED ? undefined : result;
1144
- }
1145
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
1146
- }
1147
-
1148
- module.exports = hashGet;
1149
-
1150
-
1151
- /***/ }),
1152
- /* 35 */
1153
- /***/ (function(module, exports, __webpack_require__) {
1154
-
1155
- var nativeCreate = __webpack_require__(1);
1156
-
1157
- /** Used for built-in method references. */
1158
- var objectProto = Object.prototype;
1159
-
1160
- /** Used to check objects for own properties. */
1161
- var hasOwnProperty = objectProto.hasOwnProperty;
1162
-
1163
- /**
1164
- * Checks if a hash value for `key` exists.
1165
- *
1166
- * @private
1167
- * @name has
1168
- * @memberOf Hash
1169
- * @param {string} key The key of the entry to check.
1170
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1171
- */
1172
- function hashHas(key) {
1173
- var data = this.__data__;
1174
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
1175
- }
1176
-
1177
- module.exports = hashHas;
1178
-
1179
-
1180
- /***/ }),
1181
- /* 36 */
1182
- /***/ (function(module, exports, __webpack_require__) {
1183
-
1184
- var nativeCreate = __webpack_require__(1);
1185
-
1186
- /** Used to stand-in for `undefined` hash values. */
1187
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1188
-
1189
- /**
1190
- * Sets the hash `key` to `value`.
1191
- *
1192
- * @private
1193
- * @name set
1194
- * @memberOf Hash
1195
- * @param {string} key The key of the value to set.
1196
- * @param {*} value The value to set.
1197
- * @returns {Object} Returns the hash instance.
1198
- */
1199
- function hashSet(key, value) {
1200
- var data = this.__data__;
1201
- this.size += this.has(key) ? 0 : 1;
1202
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1203
- return this;
1204
- }
1205
-
1206
- module.exports = hashSet;
1207
-
1208
-
1209
- /***/ }),
1210
- /* 37 */
1211
- /***/ (function(module, exports, __webpack_require__) {
1212
-
1213
- var listCacheClear = __webpack_require__(38),
1214
- listCacheDelete = __webpack_require__(39),
1215
- listCacheGet = __webpack_require__(41),
1216
- listCacheHas = __webpack_require__(42),
1217
- listCacheSet = __webpack_require__(43);
1218
-
1219
- /**
1220
- * Creates an list cache object.
1221
- *
1222
- * @private
1223
- * @constructor
1224
- * @param {Array} [entries] The key-value pairs to cache.
1225
- */
1226
- function ListCache(entries) {
1227
- var index = -1,
1228
- length = entries == null ? 0 : entries.length;
1229
-
1230
- this.clear();
1231
- while (++index < length) {
1232
- var entry = entries[index];
1233
- this.set(entry[0], entry[1]);
1234
- }
1235
- }
1236
-
1237
- // Add methods to `ListCache`.
1238
- ListCache.prototype.clear = listCacheClear;
1239
- ListCache.prototype['delete'] = listCacheDelete;
1240
- ListCache.prototype.get = listCacheGet;
1241
- ListCache.prototype.has = listCacheHas;
1242
- ListCache.prototype.set = listCacheSet;
1243
-
1244
- module.exports = ListCache;
1245
-
1246
-
1247
- /***/ }),
1248
- /* 38 */
1249
- /***/ (function(module, exports) {
1250
-
1251
- /**
1252
- * Removes all key-value entries from the list cache.
1253
- *
1254
- * @private
1255
- * @name clear
1256
- * @memberOf ListCache
1257
- */
1258
- function listCacheClear() {
1259
- this.__data__ = [];
1260
- this.size = 0;
1261
- }
1262
-
1263
- module.exports = listCacheClear;
1264
-
1265
-
1266
- /***/ }),
1267
- /* 39 */
1268
- /***/ (function(module, exports, __webpack_require__) {
1269
-
1270
- var assocIndexOf = __webpack_require__(2);
1271
-
1272
- /** Used for built-in method references. */
1273
- var arrayProto = Array.prototype;
1274
-
1275
- /** Built-in value references. */
1276
- var splice = arrayProto.splice;
1277
-
1278
- /**
1279
- * Removes `key` and its value from the list cache.
1280
- *
1281
- * @private
1282
- * @name delete
1283
- * @memberOf ListCache
1284
- * @param {string} key The key of the value to remove.
1285
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1286
- */
1287
- function listCacheDelete(key) {
1288
- var data = this.__data__,
1289
- index = assocIndexOf(data, key);
1290
-
1291
- if (index < 0) {
1292
- return false;
1293
- }
1294
- var lastIndex = data.length - 1;
1295
- if (index == lastIndex) {
1296
- data.pop();
1297
- } else {
1298
- splice.call(data, index, 1);
1299
- }
1300
- --this.size;
1301
- return true;
1302
- }
1303
-
1304
- module.exports = listCacheDelete;
1305
-
1306
-
1307
- /***/ }),
1308
- /* 40 */
1309
- /***/ (function(module, exports) {
1310
-
1311
- /**
1312
- * Performs a
1313
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1314
- * comparison between two values to determine if they are equivalent.
1315
- *
1316
- * @static
1317
- * @memberOf _
1318
- * @since 4.0.0
1319
- * @category Lang
1320
- * @param {*} value The value to compare.
1321
- * @param {*} other The other value to compare.
1322
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1323
- * @example
1324
- *
1325
- * var object = { 'a': 1 };
1326
- * var other = { 'a': 1 };
1327
- *
1328
- * _.eq(object, object);
1329
- * // => true
1330
- *
1331
- * _.eq(object, other);
1332
- * // => false
1333
- *
1334
- * _.eq('a', 'a');
1335
- * // => true
1336
- *
1337
- * _.eq('a', Object('a'));
1338
- * // => false
1339
- *
1340
- * _.eq(NaN, NaN);
1341
- * // => true
1342
- */
1343
- function eq(value, other) {
1344
- return value === other || (value !== value && other !== other);
1345
- }
1346
-
1347
- module.exports = eq;
1348
-
1349
-
1350
- /***/ }),
1351
- /* 41 */
1352
- /***/ (function(module, exports, __webpack_require__) {
1353
-
1354
- var assocIndexOf = __webpack_require__(2);
1355
-
1356
- /**
1357
- * Gets the list cache value for `key`.
1358
- *
1359
- * @private
1360
- * @name get
1361
- * @memberOf ListCache
1362
- * @param {string} key The key of the value to get.
1363
- * @returns {*} Returns the entry value.
1364
- */
1365
- function listCacheGet(key) {
1366
- var data = this.__data__,
1367
- index = assocIndexOf(data, key);
1368
-
1369
- return index < 0 ? undefined : data[index][1];
1370
- }
1371
-
1372
- module.exports = listCacheGet;
1373
-
1374
-
1375
- /***/ }),
1376
- /* 42 */
1377
- /***/ (function(module, exports, __webpack_require__) {
1378
-
1379
- var assocIndexOf = __webpack_require__(2);
1380
-
1381
- /**
1382
- * Checks if a list cache value for `key` exists.
1383
- *
1384
- * @private
1385
- * @name has
1386
- * @memberOf ListCache
1387
- * @param {string} key The key of the entry to check.
1388
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1389
- */
1390
- function listCacheHas(key) {
1391
- return assocIndexOf(this.__data__, key) > -1;
1392
- }
1393
-
1394
- module.exports = listCacheHas;
1395
-
1396
-
1397
- /***/ }),
1398
- /* 43 */
1399
- /***/ (function(module, exports, __webpack_require__) {
1400
-
1401
- var assocIndexOf = __webpack_require__(2);
1402
-
1403
- /**
1404
- * Sets the list cache `key` to `value`.
1405
- *
1406
- * @private
1407
- * @name set
1408
- * @memberOf ListCache
1409
- * @param {string} key The key of the value to set.
1410
- * @param {*} value The value to set.
1411
- * @returns {Object} Returns the list cache instance.
1412
- */
1413
- function listCacheSet(key, value) {
1414
- var data = this.__data__,
1415
- index = assocIndexOf(data, key);
1416
-
1417
- if (index < 0) {
1418
- ++this.size;
1419
- data.push([key, value]);
1420
- } else {
1421
- data[index][1] = value;
1422
- }
1423
- return this;
1424
- }
1425
-
1426
- module.exports = listCacheSet;
1427
-
1428
-
1429
- /***/ }),
1430
- /* 44 */
1431
- /***/ (function(module, exports, __webpack_require__) {
1432
-
1433
- var getNative = __webpack_require__(9),
1434
- root = __webpack_require__(7);
1435
-
1436
- /* Built-in method references that are verified to be native. */
1437
- var Map = getNative(root, 'Map');
1438
-
1439
- module.exports = Map;
1440
-
1441
-
1442
- /***/ }),
1443
- /* 45 */
1444
- /***/ (function(module, exports, __webpack_require__) {
1445
-
1446
- var getMapData = __webpack_require__(3);
1447
-
1448
- /**
1449
- * Removes `key` and its value from the map.
1450
- *
1451
- * @private
1452
- * @name delete
1453
- * @memberOf MapCache
1454
- * @param {string} key The key of the value to remove.
1455
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1456
- */
1457
- function mapCacheDelete(key) {
1458
- var result = getMapData(this, key)['delete'](key);
1459
- this.size -= result ? 1 : 0;
1460
- return result;
1461
- }
1462
-
1463
- module.exports = mapCacheDelete;
1464
-
1465
-
1466
- /***/ }),
1467
- /* 46 */
1468
- /***/ (function(module, exports) {
1469
-
1470
- /**
1471
- * Checks if `value` is suitable for use as unique object key.
1472
- *
1473
- * @private
1474
- * @param {*} value The value to check.
1475
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1476
- */
1477
- function isKeyable(value) {
1478
- var type = typeof value;
1479
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1480
- ? (value !== '__proto__')
1481
- : (value === null);
1482
- }
1483
-
1484
- module.exports = isKeyable;
1485
-
1486
-
1487
- /***/ }),
1488
- /* 47 */
1489
- /***/ (function(module, exports, __webpack_require__) {
1490
-
1491
- var getMapData = __webpack_require__(3);
1492
-
1493
- /**
1494
- * Gets the map value for `key`.
1495
- *
1496
- * @private
1497
- * @name get
1498
- * @memberOf MapCache
1499
- * @param {string} key The key of the value to get.
1500
- * @returns {*} Returns the entry value.
1501
- */
1502
- function mapCacheGet(key) {
1503
- return getMapData(this, key).get(key);
1504
- }
1505
-
1506
- module.exports = mapCacheGet;
1507
-
1508
-
1509
- /***/ }),
1510
- /* 48 */
1511
- /***/ (function(module, exports, __webpack_require__) {
1512
-
1513
- var getMapData = __webpack_require__(3);
1514
-
1515
- /**
1516
- * Checks if a map value for `key` exists.
1517
- *
1518
- * @private
1519
- * @name has
1520
- * @memberOf MapCache
1521
- * @param {string} key The key of the entry to check.
1522
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1523
- */
1524
- function mapCacheHas(key) {
1525
- return getMapData(this, key).has(key);
1526
- }
1527
-
1528
- module.exports = mapCacheHas;
1529
-
1530
-
1531
- /***/ }),
1532
- /* 49 */
1533
- /***/ (function(module, exports, __webpack_require__) {
1534
-
1535
- var getMapData = __webpack_require__(3);
1536
-
1537
- /**
1538
- * Sets the map `key` to `value`.
1539
- *
1540
- * @private
1541
- * @name set
1542
- * @memberOf MapCache
1543
- * @param {string} key The key of the value to set.
1544
- * @param {*} value The value to set.
1545
- * @returns {Object} Returns the map cache instance.
1546
- */
1547
- function mapCacheSet(key, value) {
1548
- var data = getMapData(this, key),
1549
- size = data.size;
1550
-
1551
- data.set(key, value);
1552
- this.size += data.size == size ? 0 : 1;
1553
- return this;
1554
- }
1555
-
1556
- module.exports = mapCacheSet;
1557
-
1558
-
1559
- /***/ }),
1560
- /* 50 */
1561
- /***/ (function(module, exports, __webpack_require__) {
1562
-
1563
- var baseToString = __webpack_require__(51);
1564
-
1565
- /**
1566
- * Converts `value` to a string. An empty string is returned for `null`
1567
- * and `undefined` values. The sign of `-0` is preserved.
1568
- *
1569
- * @static
1570
- * @memberOf _
1571
- * @since 4.0.0
1572
- * @category Lang
1573
- * @param {*} value The value to convert.
1574
- * @returns {string} Returns the converted string.
1575
- * @example
1576
- *
1577
- * _.toString(null);
1578
- * // => ''
1579
- *
1580
- * _.toString(-0);
1581
- * // => '-0'
1582
- *
1583
- * _.toString([1, 2, 3]);
1584
- * // => '1,2,3'
1585
- */
1586
- function toString(value) {
1587
- return value == null ? '' : baseToString(value);
1588
- }
1589
-
1590
- module.exports = toString;
1591
-
1592
-
1593
- /***/ }),
1594
- /* 51 */
1595
- /***/ (function(module, exports, __webpack_require__) {
1596
-
1597
- var Symbol = __webpack_require__(6),
1598
- arrayMap = __webpack_require__(52),
1599
- isArray = __webpack_require__(4),
1600
- isSymbol = __webpack_require__(5);
1601
-
1602
- /** Used as references for various `Number` constants. */
1603
- var INFINITY = 1 / 0;
1604
-
1605
- /** Used to convert symbols to primitives and strings. */
1606
- var symbolProto = Symbol ? Symbol.prototype : undefined,
1607
- symbolToString = symbolProto ? symbolProto.toString : undefined;
1608
-
1609
- /**
1610
- * The base implementation of `_.toString` which doesn't convert nullish
1611
- * values to empty strings.
1612
- *
1613
- * @private
1614
- * @param {*} value The value to process.
1615
- * @returns {string} Returns the string.
1616
- */
1617
- function baseToString(value) {
1618
- // Exit early for strings to avoid a performance hit in some environments.
1619
- if (typeof value == 'string') {
1620
- return value;
1621
- }
1622
- if (isArray(value)) {
1623
- // Recursively convert values (susceptible to call stack limits).
1624
- return arrayMap(value, baseToString) + '';
1625
- }
1626
- if (isSymbol(value)) {
1627
- return symbolToString ? symbolToString.call(value) : '';
1628
- }
1629
- var result = (value + '');
1630
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1631
- }
1632
-
1633
- module.exports = baseToString;
1634
-
1635
-
1636
- /***/ }),
1637
- /* 52 */
1638
- /***/ (function(module, exports) {
1639
-
1640
- /**
1641
- * A specialized version of `_.map` for arrays without support for iteratee
1642
- * shorthands.
1643
- *
1644
- * @private
1645
- * @param {Array} [array] The array to iterate over.
1646
- * @param {Function} iteratee The function invoked per iteration.
1647
- * @returns {Array} Returns the new mapped array.
1648
- */
1649
- function arrayMap(array, iteratee) {
1650
- var index = -1,
1651
- length = array == null ? 0 : array.length,
1652
- result = Array(length);
1653
-
1654
- while (++index < length) {
1655
- result[index] = iteratee(array[index], index, array);
1656
- }
1657
- return result;
1658
- }
1659
-
1660
- module.exports = arrayMap;
1661
-
1662
-
1663
- /***/ }),
1664
- /* 53 */
1665
- /***/ (function(module, exports, __webpack_require__) {
1666
-
1667
- var isSymbol = __webpack_require__(5);
1668
-
1669
- /** Used as references for various `Number` constants. */
1670
- var INFINITY = 1 / 0;
1671
-
1672
- /**
1673
- * Converts `value` to a string key if it's not a string or symbol.
1674
- *
1675
- * @private
1676
- * @param {*} value The value to inspect.
1677
- * @returns {string|symbol} Returns the key.
1678
- */
1679
- function toKey(value) {
1680
- if (typeof value == 'string' || isSymbol(value)) {
1681
- return value;
1682
- }
1683
- var result = (value + '');
1684
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1685
- }
1686
-
1687
- module.exports = toKey;
1688
-
1689
-
1690
- /***/ }),
1691
- /* 54 */
1692
- /***/ (function(module, exports, __webpack_require__) {
1693
-
1694
- // extracted by mini-css-extract-plugin
1695
-
1696
- /***/ }),
1697
- /* 55 */
1698
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1699
-
1700
- "use strict";
1701
- // ESM COMPAT FLAG
1702
- __webpack_require__.r(__webpack_exports__);
1703
-
1704
- // EXTERNAL MODULE: ./node_modules/lodash/get.js
1705
- var get = __webpack_require__(0);
1706
- var get_default = /*#__PURE__*/__webpack_require__.n(get);
1707
-
1708
- // CONCATENATED MODULE: ./src/constants.js
1709
- var _ORIGINS;
1710
-
1711
- var ENVS = {
1712
- LOCAL: 'local',
1713
- DEV: 'dev',
1714
- STG: 'stg',
1715
- PROD_BLUE: 'prod-blue',
1716
- PROD: 'prod'
1717
- };
1718
- var ORIGINS = (_ORIGINS = {}, _ORIGINS[ENVS.LOCAL] = 'http://localhost:3001', _ORIGINS[ENVS.DEV] = 'https://dev-my.medipass.io', _ORIGINS[ENVS.STG] = 'https://stg-my.medipass.io', _ORIGINS[ENVS.PROD_BLUE] = 'https://my-blue.medipass.io', _ORIGINS[ENVS.PROD] = 'https://my.medipass.io', _ORIGINS);
1719
- var EVENTS = {
1720
- SUCCESS: 'success',
1721
- fAILURE: 'failure',
1722
- CANCEL: 'cancel'
1723
- };
1724
- var ROOT_ELEMENT_ID = 'medipass-checkout-sdk-root';
1725
- // CONCATENATED MODULE: ./src/utils/object-to-css.js
1726
- /* harmony default export */ var object_to_css = (function (style) {
1727
- return JSON.stringify(style, null, '\t').replace(/"/g, '').replace(/,\n/g, ';').replace(/\}/g, '').replace(/\{/g, '');
1728
- });
1729
- // CONCATENATED MODULE: ./src/overlay.js
1730
-
1731
-
1732
-
1733
- var SUBHEADING_ELEMENT_ID = 'medipass-checkout-sdk-subheading';
1734
-
1735
- function createElement(_ref) {
1736
- var window = _ref.window,
1737
- element = _ref.element,
1738
- text = _ref.text,
1739
- id = _ref.id,
1740
- styles = _ref.styles,
1741
- onClick = _ref.onClick;
1742
- if (!window) return;
1743
- var newElement = window.document.createElement(element);
1744
-
1745
- if (text) {
1746
- newElement.innerHTML = text;
1747
- }
1748
-
1749
- if (id) {
1750
- newElement.id = id;
1751
- }
1752
-
1753
- if (styles) {
1754
- newElement.style.cssText = object_to_css(styles);
1755
- }
1756
-
1757
- if (get_default()(newElement, 'addEventListener') && onClick) {
1758
- newElement.addEventListener('click', function () {
1759
- onClick();
1760
- });
1761
- }
1762
-
1763
- return newElement;
1764
- }
1765
-
1766
- var overlay = {
1767
- contentElement: null,
1768
- removeOverlay: function removeOverlay() {
1769
- var containerDiv = document.getElementById(ROOT_ELEMENT_ID);
1770
- if (!containerDiv) return;
1771
- containerDiv.remove();
1772
- },
1773
- createOverlay: function createOverlay(_ref2) {
1774
- var window = _ref2.window,
1775
- onClickRelaunch = _ref2.onClickRelaunch,
1776
- onClickCancel = _ref2.onClickCancel;
1777
- if (!window) return;
1778
- var containerDiv = createElement({
1779
- window: window,
1780
- element: 'div',
1781
- id: ROOT_ELEMENT_ID,
1782
- styles: {
1783
- 'z-index': '2147483100',
1784
- position: 'fixed',
1785
- top: '0',
1786
- left: '0',
1787
- width: '100%',
1788
- height: '100%',
1789
- 'background-color': 'rgba(0, 0, 0, 0.8)',
1790
- 'font-family': 'Lato',
1791
- color: 'white',
1792
- display: 'flex'
1793
- }
1794
- });
1795
- var content = createElement({
1796
- window: window,
1797
- element: 'div',
1798
- styles: {
1799
- 'max-width': '360px',
1800
- 'margin-left': 'auto',
1801
- 'margin-right': 'auto',
1802
- 'margin-top': 'auto',
1803
- 'margin-bottom': 'auto',
1804
- 'text-align': 'center'
1805
- }
1806
- });
1807
- this.contentElement = content; ////////////////////////////////////////////////////////////
1808
-
1809
- var heading = createElement({
1810
- window: window,
1811
- element: 'div',
1812
- text: 'Secure Medipass payment in progress',
1813
- styles: {
1814
- color: 'white',
1815
- 'font-size': '35px',
1816
- 'font-weight': '600',
1817
- 'margin-bottom': '30px'
1818
- }
1819
- }); ////////////////////////////////////////////////////////////
1820
-
1821
- var subHeading = this.createSubHeading({
1822
- window: window,
1823
- onClickRelaunch: onClickRelaunch,
1824
- onClickCancel: onClickCancel
1825
- }); ////////////////////////////////////////////////////////////
1826
-
1827
- content.appendChild(heading);
1828
- content.appendChild(subHeading);
1829
- containerDiv.appendChild(content); ////////////////////////////////////////////////////////////
1830
-
1831
- window.document.body.appendChild(containerDiv);
1832
- },
1833
- createSubHeading: function createSubHeading(_ref3) {
1834
- var window = _ref3.window,
1835
- onClickRelaunch = _ref3.onClickRelaunch,
1836
- onClickCancel = _ref3.onClickCancel;
1837
- if (!window) return;
1838
- var subHeadingContainer = createElement({
1839
- window: window,
1840
- id: SUBHEADING_ELEMENT_ID,
1841
- element: 'div'
1842
- });
1843
- var subHeading1 = createElement({
1844
- window: window,
1845
- element: 'div',
1846
- text: 'Don\'t see the payment window?'
1847
- });
1848
- var link1 = createElement({
1849
- window: window,
1850
- element: 'a',
1851
- text: 'Click here',
1852
- onClick: onClickRelaunch,
1853
- styles: {
1854
- 'text-decoration': 'underline',
1855
- cursor: 'pointer',
1856
- 'font-weight': '600'
1857
- }
1858
- });
1859
- var subHeading2 = createElement({
1860
- window: window,
1861
- element: 'span',
1862
- text: ' to relaunch and complete your payment.'
1863
- });
1864
- var subHeading3 = createElement({
1865
- window: window,
1866
- element: 'div',
1867
- text: 'OR',
1868
- styles: {
1869
- 'margin-top': '20px',
1870
- 'margin-bottom': '20px'
1871
- }
1872
- });
1873
- var link2 = createElement({
1874
- window: window,
1875
- element: 'a',
1876
- text: 'Click here to cancel the payment.',
1877
- onClick: onClickCancel,
1878
- styles: {
1879
- 'text-decoration': 'underline',
1880
- cursor: 'pointer',
1881
- 'font-weight': '600'
1882
- }
1883
- });
1884
- subHeadingContainer.appendChild(subHeading1);
1885
- subHeadingContainer.appendChild(link1);
1886
- subHeadingContainer.appendChild(subHeading2);
1887
- subHeadingContainer.appendChild(subHeading3);
1888
- subHeadingContainer.appendChild(link2);
1889
- return subHeadingContainer;
1890
- },
1891
- updateSubheading: function updateSubheading(_ref4) {
1892
- var window = _ref4.window,
1893
- onClickRelaunch = _ref4.onClickRelaunch,
1894
- onClickCancel = _ref4.onClickCancel;
1895
- if (!window) return;
1896
- var subheaderElement = document.getElementById(SUBHEADING_ELEMENT_ID);
1897
-
1898
- if (subheaderElement) {
1899
- subheaderElement.remove();
1900
- }
1901
-
1902
- var newSubheading = this.createSubHeading({
1903
- window: window,
1904
- onClickRelaunch: onClickRelaunch,
1905
- onClickCancel: onClickCancel
1906
- });
1907
-
1908
- if (this.contentElement && get_default()(this.contentElement, 'appendChild')) {
1909
- this.contentElement.appendChild(newSubheading);
1910
- }
1911
- }
1912
- };
1913
- /* harmony default export */ var src_overlay = (overlay);
1914
- // EXTERNAL MODULE: ./src/style.css
1915
- var style = __webpack_require__(54);
1916
-
1917
- // CONCATENATED MODULE: ./src/index.js
1918
-
1919
-
1920
-
1921
-
1922
- var POPUP_WIDTH = 450;
1923
-
1924
- var getWindowFeatures = function getWindowFeatures(_ref) {
1925
- var height = _ref.height,
1926
- width = _ref.width,
1927
- left = _ref.left,
1928
- top = _ref.top;
1929
- return "menubar=no, location=no, resizable=no, scrollbars=yes, status=no, height=" + height + ", width=" + width + ", left=" + left + ", top=" + top;
1930
- };
1931
-
1932
- function initialiseWindow(_ref2) {
1933
- var url = _ref2.url;
1934
- if (!window) return; // The target window could either be in an iframe, or just a normal standalone window.
1935
- // We need to grab the correct window height and width for calculating dimensions.
1936
-
1937
- var windowHeight = get_default()(window, 'outerHeight') || get_default()(window, 'innerHeight');
1938
-
1939
- var windowWidth = get_default()(window, 'outerWidth') || get_default()(window, 'innerWidth');
1940
-
1941
- var popupHeight = windowHeight * 0.80;
1942
- var popupWidth = windowWidth > POPUP_WIDTH ? POPUP_WIDTH : windowWidth * 0.25;
1943
- var xPosition = windowWidth / 2 - popupWidth / 2;
1944
- var yPosition = windowHeight / 2 - popupHeight / 2;
1945
- var windowRef = window.open(url, 'Medipass Checkout', getWindowFeatures({
1946
- height: popupHeight,
1947
- width: popupWidth,
1948
- left: xPosition,
1949
- top: yPosition
1950
- }));
1951
- return windowRef;
1952
- } ////////////////////////////////////////////////////////////
1953
-
1954
-
1955
- var _windowReferenceObject = null; ////////////////////////////////////////////////////////////
1956
-
1957
- var checkoutSDK = {
1958
- ENVS: ENVS,
1959
- isCheckoutInitiated: false,
1960
- isCheckoutComplete: null,
1961
- env: null,
1962
- onSuccess: null,
1963
- onFailure: null,
1964
- onCancel: null,
1965
- onCose: null,
1966
- init: function init(_ref3) {
1967
- var _this = this;
1968
-
1969
- var env = _ref3.env,
1970
- onSuccess = _ref3.onSuccess,
1971
- onFailure = _ref3.onFailure,
1972
- onCancel = _ref3.onCancel,
1973
- onClose = _ref3.onClose;
1974
- if (!env) return;
1975
- this.env = env;
1976
- this.onSuccess = onSuccess;
1977
- this.onFailure = onFailure;
1978
- this.onCancel = onCancel;
1979
- this.onClose = onClose; // Open a blank window
1980
-
1981
- _windowReferenceObject = initialiseWindow({
1982
- url: ''
1983
- });
1984
-
1985
- var handleClose = function handleClose() {
1986
- src_overlay.removeOverlay();
1987
- onClose && onClose();
1988
- if (!_windowReferenceObject) return;
1989
-
1990
- _windowReferenceObject.close();
1991
- };
1992
-
1993
- var onClickRelaunch = function onClickRelaunch() {
1994
- if (!_windowReferenceObject) {
1995
- _windowReferenceObject = initialiseWindow({
1996
- url: ''
1997
- });
1998
- return;
1999
- }
2000
-
2001
- _windowReferenceObject.focus();
2002
- };
2003
-
2004
- var checkWindowClosed = function checkWindowClosed() {
2005
- if (_this.isCheckoutInitiated) {
2006
- clearInterval(timer);
2007
- return;
2008
- }
2009
-
2010
- if (get_default()(_windowReferenceObject, 'closed')) {
2011
- clearInterval(timer);
2012
- handleClose();
2013
- }
2014
- };
2015
-
2016
- var onClickCancel = function onClickCancel() {
2017
- src_overlay.removeOverlay();
2018
-
2019
- if (_windowReferenceObject) {
2020
- _windowReferenceObject.close();
2021
- }
2022
-
2023
- clearInterval(timer);
2024
- onClose && onClose();
2025
- }; // This creates the gray overlay covering the client's screen while payment is in progress.
2026
-
2027
-
2028
- src_overlay.createOverlay({
2029
- window: window,
2030
- onClickRelaunch: onClickRelaunch,
2031
- onClickCancel: onClickCancel
2032
- }); // Check the window every 0.5 seconds to see if it has been closed.
2033
-
2034
- var timer = setInterval(checkWindowClosed, 500);
2035
- },
2036
- createCheckout: function createCheckout(_ref4) {
2037
- var _this2 = this;
2038
-
2039
- var paymentRequestUrl = _ref4.paymentRequestUrl;
2040
- if (!paymentRequestUrl || !window) return;
2041
- var env = this.env;
2042
- var onSuccess = this.onSuccess;
2043
- var onFailure = this.onFailure;
2044
- var onCancel = this.onCancel;
2045
- var onClose = this.onClose; ////////////////////////////////////////////////////////////
2046
-
2047
- var checkWindowClosed = function checkWindowClosed() {
2048
- if (get_default()(_windowReferenceObject, 'closed')) {
2049
- clearInterval(timer);
2050
- handleClose();
2051
- }
2052
- }; // Check the window every 0.5 seconds to see if it has been closed.
2053
-
2054
-
2055
- var timer = setInterval(checkWindowClosed, 500);
2056
- this.isCheckoutInitiated = true; ////////////////////////////////////////////////////////////
2057
-
2058
- var openWindow = function openWindow() {
2059
- // windowReferenceObject may not be defined if browser blocks the pop-up.
2060
- if (!_windowReferenceObject) {
2061
- _windowReferenceObject = initialiseWindow({
2062
- url: paymentRequestUrl
2063
- });
2064
- } else {
2065
- _windowReferenceObject.location.replace(paymentRequestUrl);
2066
- }
2067
-
2068
- if (!_windowReferenceObject) {
2069
- return;
2070
- } // Start listening for incoming messages
2071
-
2072
-
2073
- window.addEventListener('message', function (e) {
2074
- return onReceiveMessage(e);
2075
- });
2076
-
2077
- var onReceiveMessage = function onReceiveMessage(e) {
2078
- if (!e) return;
2079
- var transactionId = getMessage(e);
2080
-
2081
- if (transactionId) {
2082
- _this2.isCheckoutComplete = true;
2083
- }
2084
- };
2085
-
2086
- var getMessage = function getMessage(e) {
2087
- var origin = ORIGINS[env];
2088
- if (!e || !origin) return; // Ensure the message is coming from the correct origin.
2089
-
2090
- if (get_default()(e, 'origin') !== origin) return;
2091
-
2092
- var event = get_default()(e, 'data.event');
2093
-
2094
- var transactionId = get_default()(e, 'data.transactionId');
2095
-
2096
- var receiptAutoSent = get_default()(e, 'data.receiptAutoSent');
2097
-
2098
- if (!event || !transactionId) return;
2099
-
2100
- if (event === EVENTS.SUCCESS) {
2101
- if (receiptAutoSent) {
2102
- // Give 1.5 seconds for the user to see the success page before auto-closing the pop-up.
2103
- setTimeout(function () {
2104
- onSuccess && onSuccess({
2105
- transactionId: transactionId
2106
- });
2107
-
2108
- _windowReferenceObject.close();
2109
- }, 1500);
2110
- } else {
2111
- onSuccess && onSuccess({
2112
- transactionId: transactionId
2113
- });
2114
- }
2115
-
2116
- return transactionId;
2117
- }
2118
-
2119
- if (event === EVENTS.fAILURE) {
2120
- onFailure && onFailure({
2121
- transactionId: transactionId
2122
- });
2123
- return transactionId;
2124
- }
2125
-
2126
- if (event === EVENTS.CANCEL) {
2127
- // Give 1.5 seconds for the user to see the reject page before auto-closing the pop-up.
2128
- setTimeout(function () {
2129
- onCancel && onCancel({
2130
- transactionId: transactionId
2131
- });
2132
-
2133
- _windowReferenceObject.close();
2134
- }, 1500);
2135
- return transactionId;
2136
- }
2137
- };
2138
-
2139
- return _windowReferenceObject;
2140
- }; ////////////////////////////////////////////////////////////
2141
- // open the pop-up
2142
-
2143
-
2144
- openWindow(); ////////////////////////////////////////////////////////////
2145
-
2146
- var handleClose = function handleClose() {
2147
- // We need to remove the gray overlay covering the client's screen.
2148
- src_overlay.removeOverlay(); // If the pop-up has been closed before a payment action has been taken out, then we
2149
- // need to invoke the onClose callback.
2150
-
2151
- if (!_this2.isCheckoutComplete) {
2152
- onClose && onClose();
2153
- }
2154
-
2155
- if (!_windowReferenceObject) return;
2156
-
2157
- _windowReferenceObject.close();
2158
- }; ////////////////////////////////////////////////////////////
2159
-
2160
-
2161
- var onClickRelaunch = function onClickRelaunch() {
2162
- if (!_windowReferenceObject) {
2163
- _windowReferenceObject = openWindow();
2164
- return;
2165
- }
2166
-
2167
- _windowReferenceObject.focus();
2168
- };
2169
-
2170
- var onClickCancel = function onClickCancel() {
2171
- if (_windowReferenceObject) {
2172
- _windowReferenceObject.close();
2173
- } else {
2174
- clearInterval(timer);
2175
- }
2176
-
2177
- src_overlay.removeOverlay();
2178
- onClose && onClose();
2179
- }; // Reset the relaunch and cancel functions on the subheading
2180
-
2181
-
2182
- src_overlay.updateSubheading({
2183
- window: window,
2184
- onClickRelaunch: onClickRelaunch,
2185
- onClickCancel: onClickCancel
2186
- }); ////////////////////////////////////////////////////////////
2187
- }
2188
- };
2189
- /* harmony default export */ var src = __webpack_exports__["default"] = (checkoutSDK);
2190
-
2191
- /***/ })
2192
- /******/ ])["default"];
2193
- });