docviewhelper 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js ADDED
@@ -0,0 +1,3342 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Docviewhelper = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
+
9
+ var check = function (it) {
10
+ return it && it.Math == Math && it;
11
+ };
12
+
13
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
14
+ var global$F =
15
+ // eslint-disable-next-line es/no-global-this -- safe
16
+ check(typeof globalThis == 'object' && globalThis) ||
17
+ check(typeof window == 'object' && window) ||
18
+ // eslint-disable-next-line no-restricted-globals -- safe
19
+ check(typeof self == 'object' && self) ||
20
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
21
+ // eslint-disable-next-line no-new-func -- fallback
22
+ (function () { return this; })() || Function('return this')();
23
+
24
+ var objectGetOwnPropertyDescriptor = {};
25
+
26
+ var fails$d = function (exec) {
27
+ try {
28
+ return !!exec();
29
+ } catch (error) {
30
+ return true;
31
+ }
32
+ };
33
+
34
+ var fails$c = fails$d;
35
+
36
+ // Detect IE8's incomplete defineProperty implementation
37
+ var descriptors = !fails$c(function () {
38
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
39
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
40
+ });
41
+
42
+ var call$e = Function.prototype.call;
43
+
44
+ var functionCall = call$e.bind ? call$e.bind(call$e) : function () {
45
+ return call$e.apply(call$e, arguments);
46
+ };
47
+
48
+ var objectPropertyIsEnumerable = {};
49
+
50
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
51
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
52
+ var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor;
53
+
54
+ // Nashorn ~ JDK8 bug
55
+ var NASHORN_BUG = getOwnPropertyDescriptor$4 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
56
+
57
+ // `Object.prototype.propertyIsEnumerable` method implementation
58
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
59
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
60
+ var descriptor = getOwnPropertyDescriptor$4(this, V);
61
+ return !!descriptor && descriptor.enumerable;
62
+ } : $propertyIsEnumerable;
63
+
64
+ var createPropertyDescriptor$3 = function (bitmap, value) {
65
+ return {
66
+ enumerable: !(bitmap & 1),
67
+ configurable: !(bitmap & 2),
68
+ writable: !(bitmap & 4),
69
+ value: value
70
+ };
71
+ };
72
+
73
+ var FunctionPrototype$2 = Function.prototype;
74
+ var bind$6 = FunctionPrototype$2.bind;
75
+ var call$d = FunctionPrototype$2.call;
76
+ var callBind = bind$6 && bind$6.bind(call$d);
77
+
78
+ var functionUncurryThis = bind$6 ? function (fn) {
79
+ return fn && callBind(call$d, fn);
80
+ } : function (fn) {
81
+ return fn && function () {
82
+ return call$d.apply(fn, arguments);
83
+ };
84
+ };
85
+
86
+ var uncurryThis$k = functionUncurryThis;
87
+
88
+ var toString$9 = uncurryThis$k({}.toString);
89
+ var stringSlice$6 = uncurryThis$k(''.slice);
90
+
91
+ var classofRaw$1 = function (it) {
92
+ return stringSlice$6(toString$9(it), 8, -1);
93
+ };
94
+
95
+ var global$E = global$F;
96
+ var uncurryThis$j = functionUncurryThis;
97
+ var fails$b = fails$d;
98
+ var classof$7 = classofRaw$1;
99
+
100
+ var Object$4 = global$E.Object;
101
+ var split = uncurryThis$j(''.split);
102
+
103
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
104
+ var indexedObject = fails$b(function () {
105
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
106
+ // eslint-disable-next-line no-prototype-builtins -- safe
107
+ return !Object$4('z').propertyIsEnumerable(0);
108
+ }) ? function (it) {
109
+ return classof$7(it) == 'String' ? split(it, '') : Object$4(it);
110
+ } : Object$4;
111
+
112
+ var global$D = global$F;
113
+
114
+ var TypeError$f = global$D.TypeError;
115
+
116
+ // `RequireObjectCoercible` abstract operation
117
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
118
+ var requireObjectCoercible$8 = function (it) {
119
+ if (it == undefined) throw TypeError$f("Can't call method on " + it);
120
+ return it;
121
+ };
122
+
123
+ // toObject with fallback for non-array-like ES3 strings
124
+ var IndexedObject = indexedObject;
125
+ var requireObjectCoercible$7 = requireObjectCoercible$8;
126
+
127
+ var toIndexedObject$4 = function (it) {
128
+ return IndexedObject(requireObjectCoercible$7(it));
129
+ };
130
+
131
+ // `IsCallable` abstract operation
132
+ // https://tc39.es/ecma262/#sec-iscallable
133
+ var isCallable$g = function (argument) {
134
+ return typeof argument == 'function';
135
+ };
136
+
137
+ var isCallable$f = isCallable$g;
138
+
139
+ var isObject$8 = function (it) {
140
+ return typeof it == 'object' ? it !== null : isCallable$f(it);
141
+ };
142
+
143
+ var global$C = global$F;
144
+ var isCallable$e = isCallable$g;
145
+
146
+ var aFunction = function (argument) {
147
+ return isCallable$e(argument) ? argument : undefined;
148
+ };
149
+
150
+ var getBuiltIn$7 = function (namespace, method) {
151
+ return arguments.length < 2 ? aFunction(global$C[namespace]) : global$C[namespace] && global$C[namespace][method];
152
+ };
153
+
154
+ var uncurryThis$i = functionUncurryThis;
155
+
156
+ var objectIsPrototypeOf = uncurryThis$i({}.isPrototypeOf);
157
+
158
+ var getBuiltIn$6 = getBuiltIn$7;
159
+
160
+ var engineUserAgent = getBuiltIn$6('navigator', 'userAgent') || '';
161
+
162
+ var global$B = global$F;
163
+ var userAgent$3 = engineUserAgent;
164
+
165
+ var process$3 = global$B.process;
166
+ var Deno = global$B.Deno;
167
+ var versions = process$3 && process$3.versions || Deno && Deno.version;
168
+ var v8 = versions && versions.v8;
169
+ var match, version;
170
+
171
+ if (v8) {
172
+ match = v8.split('.');
173
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
174
+ // but their correct versions are not interesting for us
175
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
176
+ }
177
+
178
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
179
+ // so check `userAgent` even if `.v8` exists, but 0
180
+ if (!version && userAgent$3) {
181
+ match = userAgent$3.match(/Edge\/(\d+)/);
182
+ if (!match || match[1] >= 74) {
183
+ match = userAgent$3.match(/Chrome\/(\d+)/);
184
+ if (match) version = +match[1];
185
+ }
186
+ }
187
+
188
+ var engineV8Version = version;
189
+
190
+ /* eslint-disable es/no-symbol -- required for testing */
191
+
192
+ var V8_VERSION$1 = engineV8Version;
193
+ var fails$a = fails$d;
194
+
195
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
196
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$a(function () {
197
+ var symbol = Symbol();
198
+ // Chrome 38 Symbol has incorrect toString conversion
199
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
200
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
201
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
202
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
203
+ });
204
+
205
+ /* eslint-disable es/no-symbol -- required for testing */
206
+
207
+ var NATIVE_SYMBOL$1 = nativeSymbol;
208
+
209
+ var useSymbolAsUid = NATIVE_SYMBOL$1
210
+ && !Symbol.sham
211
+ && typeof Symbol.iterator == 'symbol';
212
+
213
+ var global$A = global$F;
214
+ var getBuiltIn$5 = getBuiltIn$7;
215
+ var isCallable$d = isCallable$g;
216
+ var isPrototypeOf$2 = objectIsPrototypeOf;
217
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
218
+
219
+ var Object$3 = global$A.Object;
220
+
221
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
222
+ return typeof it == 'symbol';
223
+ } : function (it) {
224
+ var $Symbol = getBuiltIn$5('Symbol');
225
+ return isCallable$d($Symbol) && isPrototypeOf$2($Symbol.prototype, Object$3(it));
226
+ };
227
+
228
+ var global$z = global$F;
229
+
230
+ var String$5 = global$z.String;
231
+
232
+ var tryToString$4 = function (argument) {
233
+ try {
234
+ return String$5(argument);
235
+ } catch (error) {
236
+ return 'Object';
237
+ }
238
+ };
239
+
240
+ var global$y = global$F;
241
+ var isCallable$c = isCallable$g;
242
+ var tryToString$3 = tryToString$4;
243
+
244
+ var TypeError$e = global$y.TypeError;
245
+
246
+ // `Assert: IsCallable(argument) is true`
247
+ var aCallable$5 = function (argument) {
248
+ if (isCallable$c(argument)) return argument;
249
+ throw TypeError$e(tryToString$3(argument) + ' is not a function');
250
+ };
251
+
252
+ var aCallable$4 = aCallable$5;
253
+
254
+ // `GetMethod` abstract operation
255
+ // https://tc39.es/ecma262/#sec-getmethod
256
+ var getMethod$6 = function (V, P) {
257
+ var func = V[P];
258
+ return func == null ? undefined : aCallable$4(func);
259
+ };
260
+
261
+ var global$x = global$F;
262
+ var call$c = functionCall;
263
+ var isCallable$b = isCallable$g;
264
+ var isObject$7 = isObject$8;
265
+
266
+ var TypeError$d = global$x.TypeError;
267
+
268
+ // `OrdinaryToPrimitive` abstract operation
269
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
270
+ var ordinaryToPrimitive$1 = function (input, pref) {
271
+ var fn, val;
272
+ if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
273
+ if (isCallable$b(fn = input.valueOf) && !isObject$7(val = call$c(fn, input))) return val;
274
+ if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
275
+ throw TypeError$d("Can't convert object to primitive value");
276
+ };
277
+
278
+ var shared$4 = {exports: {}};
279
+
280
+ var global$w = global$F;
281
+
282
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
283
+ var defineProperty$1 = Object.defineProperty;
284
+
285
+ var setGlobal$3 = function (key, value) {
286
+ try {
287
+ defineProperty$1(global$w, key, { value: value, configurable: true, writable: true });
288
+ } catch (error) {
289
+ global$w[key] = value;
290
+ } return value;
291
+ };
292
+
293
+ var global$v = global$F;
294
+ var setGlobal$2 = setGlobal$3;
295
+
296
+ var SHARED = '__core-js_shared__';
297
+ var store$3 = global$v[SHARED] || setGlobal$2(SHARED, {});
298
+
299
+ var sharedStore = store$3;
300
+
301
+ var store$2 = sharedStore;
302
+
303
+ (shared$4.exports = function (key, value) {
304
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
305
+ })('versions', []).push({
306
+ version: '3.20.1',
307
+ mode: 'global',
308
+ copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
309
+ });
310
+
311
+ var global$u = global$F;
312
+ var requireObjectCoercible$6 = requireObjectCoercible$8;
313
+
314
+ var Object$2 = global$u.Object;
315
+
316
+ // `ToObject` abstract operation
317
+ // https://tc39.es/ecma262/#sec-toobject
318
+ var toObject$2 = function (argument) {
319
+ return Object$2(requireObjectCoercible$6(argument));
320
+ };
321
+
322
+ var uncurryThis$h = functionUncurryThis;
323
+ var toObject$1 = toObject$2;
324
+
325
+ var hasOwnProperty = uncurryThis$h({}.hasOwnProperty);
326
+
327
+ // `HasOwnProperty` abstract operation
328
+ // https://tc39.es/ecma262/#sec-hasownproperty
329
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
330
+ return hasOwnProperty(toObject$1(it), key);
331
+ };
332
+
333
+ var uncurryThis$g = functionUncurryThis;
334
+
335
+ var id = 0;
336
+ var postfix = Math.random();
337
+ var toString$8 = uncurryThis$g(1.0.toString);
338
+
339
+ var uid$2 = function (key) {
340
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id + postfix, 36);
341
+ };
342
+
343
+ var global$t = global$F;
344
+ var shared$3 = shared$4.exports;
345
+ var hasOwn$8 = hasOwnProperty_1;
346
+ var uid$1 = uid$2;
347
+ var NATIVE_SYMBOL = nativeSymbol;
348
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
349
+
350
+ var WellKnownSymbolsStore = shared$3('wks');
351
+ var Symbol$1 = global$t.Symbol;
352
+ var symbolFor = Symbol$1 && Symbol$1['for'];
353
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
354
+
355
+ var wellKnownSymbol$e = function (name) {
356
+ if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
357
+ var description = 'Symbol.' + name;
358
+ if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
359
+ WellKnownSymbolsStore[name] = Symbol$1[name];
360
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
361
+ WellKnownSymbolsStore[name] = symbolFor(description);
362
+ } else {
363
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
364
+ }
365
+ } return WellKnownSymbolsStore[name];
366
+ };
367
+
368
+ var global$s = global$F;
369
+ var call$b = functionCall;
370
+ var isObject$6 = isObject$8;
371
+ var isSymbol$1 = isSymbol$2;
372
+ var getMethod$5 = getMethod$6;
373
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
374
+ var wellKnownSymbol$d = wellKnownSymbol$e;
375
+
376
+ var TypeError$c = global$s.TypeError;
377
+ var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
378
+
379
+ // `ToPrimitive` abstract operation
380
+ // https://tc39.es/ecma262/#sec-toprimitive
381
+ var toPrimitive$1 = function (input, pref) {
382
+ if (!isObject$6(input) || isSymbol$1(input)) return input;
383
+ var exoticToPrim = getMethod$5(input, TO_PRIMITIVE);
384
+ var result;
385
+ if (exoticToPrim) {
386
+ if (pref === undefined) pref = 'default';
387
+ result = call$b(exoticToPrim, input, pref);
388
+ if (!isObject$6(result) || isSymbol$1(result)) return result;
389
+ throw TypeError$c("Can't convert object to primitive value");
390
+ }
391
+ if (pref === undefined) pref = 'number';
392
+ return ordinaryToPrimitive(input, pref);
393
+ };
394
+
395
+ var toPrimitive = toPrimitive$1;
396
+ var isSymbol = isSymbol$2;
397
+
398
+ // `ToPropertyKey` abstract operation
399
+ // https://tc39.es/ecma262/#sec-topropertykey
400
+ var toPropertyKey$3 = function (argument) {
401
+ var key = toPrimitive(argument, 'string');
402
+ return isSymbol(key) ? key : key + '';
403
+ };
404
+
405
+ var global$r = global$F;
406
+ var isObject$5 = isObject$8;
407
+
408
+ var document$3 = global$r.document;
409
+ // typeof document.createElement is 'object' in old IE
410
+ var EXISTS$1 = isObject$5(document$3) && isObject$5(document$3.createElement);
411
+
412
+ var documentCreateElement$1 = function (it) {
413
+ return EXISTS$1 ? document$3.createElement(it) : {};
414
+ };
415
+
416
+ var DESCRIPTORS$6 = descriptors;
417
+ var fails$9 = fails$d;
418
+ var createElement$1 = documentCreateElement$1;
419
+
420
+ // Thank's IE8 for his funny defineProperty
421
+ var ie8DomDefine = !DESCRIPTORS$6 && !fails$9(function () {
422
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
423
+ return Object.defineProperty(createElement$1('div'), 'a', {
424
+ get: function () { return 7; }
425
+ }).a != 7;
426
+ });
427
+
428
+ var DESCRIPTORS$5 = descriptors;
429
+ var call$a = functionCall;
430
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
431
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
432
+ var toIndexedObject$3 = toIndexedObject$4;
433
+ var toPropertyKey$2 = toPropertyKey$3;
434
+ var hasOwn$7 = hasOwnProperty_1;
435
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
436
+
437
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
438
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
439
+
440
+ // `Object.getOwnPropertyDescriptor` method
441
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
442
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
443
+ O = toIndexedObject$3(O);
444
+ P = toPropertyKey$2(P);
445
+ if (IE8_DOM_DEFINE$1) try {
446
+ return $getOwnPropertyDescriptor(O, P);
447
+ } catch (error) { /* empty */ }
448
+ if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$a(propertyIsEnumerableModule.f, O, P), O[P]);
449
+ };
450
+
451
+ var objectDefineProperty = {};
452
+
453
+ var global$q = global$F;
454
+ var isObject$4 = isObject$8;
455
+
456
+ var String$4 = global$q.String;
457
+ var TypeError$b = global$q.TypeError;
458
+
459
+ // `Assert: Type(argument) is Object`
460
+ var anObject$f = function (argument) {
461
+ if (isObject$4(argument)) return argument;
462
+ throw TypeError$b(String$4(argument) + ' is not an object');
463
+ };
464
+
465
+ var global$p = global$F;
466
+ var DESCRIPTORS$4 = descriptors;
467
+ var IE8_DOM_DEFINE = ie8DomDefine;
468
+ var anObject$e = anObject$f;
469
+ var toPropertyKey$1 = toPropertyKey$3;
470
+
471
+ var TypeError$a = global$p.TypeError;
472
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
473
+ var $defineProperty = Object.defineProperty;
474
+
475
+ // `Object.defineProperty` method
476
+ // https://tc39.es/ecma262/#sec-object.defineproperty
477
+ objectDefineProperty.f = DESCRIPTORS$4 ? $defineProperty : function defineProperty(O, P, Attributes) {
478
+ anObject$e(O);
479
+ P = toPropertyKey$1(P);
480
+ anObject$e(Attributes);
481
+ if (IE8_DOM_DEFINE) try {
482
+ return $defineProperty(O, P, Attributes);
483
+ } catch (error) { /* empty */ }
484
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$a('Accessors not supported');
485
+ if ('value' in Attributes) O[P] = Attributes.value;
486
+ return O;
487
+ };
488
+
489
+ var DESCRIPTORS$3 = descriptors;
490
+ var definePropertyModule$4 = objectDefineProperty;
491
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
492
+
493
+ var createNonEnumerableProperty$4 = DESCRIPTORS$3 ? function (object, key, value) {
494
+ return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
495
+ } : function (object, key, value) {
496
+ object[key] = value;
497
+ return object;
498
+ };
499
+
500
+ var redefine$4 = {exports: {}};
501
+
502
+ var uncurryThis$f = functionUncurryThis;
503
+ var isCallable$a = isCallable$g;
504
+ var store$1 = sharedStore;
505
+
506
+ var functionToString = uncurryThis$f(Function.toString);
507
+
508
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
509
+ if (!isCallable$a(store$1.inspectSource)) {
510
+ store$1.inspectSource = function (it) {
511
+ return functionToString(it);
512
+ };
513
+ }
514
+
515
+ var inspectSource$4 = store$1.inspectSource;
516
+
517
+ var global$o = global$F;
518
+ var isCallable$9 = isCallable$g;
519
+ var inspectSource$3 = inspectSource$4;
520
+
521
+ var WeakMap$1 = global$o.WeakMap;
522
+
523
+ var nativeWeakMap = isCallable$9(WeakMap$1) && /native code/.test(inspectSource$3(WeakMap$1));
524
+
525
+ var shared$2 = shared$4.exports;
526
+ var uid = uid$2;
527
+
528
+ var keys = shared$2('keys');
529
+
530
+ var sharedKey$2 = function (key) {
531
+ return keys[key] || (keys[key] = uid(key));
532
+ };
533
+
534
+ var hiddenKeys$4 = {};
535
+
536
+ var NATIVE_WEAK_MAP = nativeWeakMap;
537
+ var global$n = global$F;
538
+ var uncurryThis$e = functionUncurryThis;
539
+ var isObject$3 = isObject$8;
540
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
541
+ var hasOwn$6 = hasOwnProperty_1;
542
+ var shared$1 = sharedStore;
543
+ var sharedKey$1 = sharedKey$2;
544
+ var hiddenKeys$3 = hiddenKeys$4;
545
+
546
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
547
+ var TypeError$9 = global$n.TypeError;
548
+ var WeakMap = global$n.WeakMap;
549
+ var set$1, get, has;
550
+
551
+ var enforce = function (it) {
552
+ return has(it) ? get(it) : set$1(it, {});
553
+ };
554
+
555
+ var getterFor = function (TYPE) {
556
+ return function (it) {
557
+ var state;
558
+ if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
559
+ throw TypeError$9('Incompatible receiver, ' + TYPE + ' required');
560
+ } return state;
561
+ };
562
+ };
563
+
564
+ if (NATIVE_WEAK_MAP || shared$1.state) {
565
+ var store = shared$1.state || (shared$1.state = new WeakMap());
566
+ var wmget = uncurryThis$e(store.get);
567
+ var wmhas = uncurryThis$e(store.has);
568
+ var wmset = uncurryThis$e(store.set);
569
+ set$1 = function (it, metadata) {
570
+ if (wmhas(store, it)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED);
571
+ metadata.facade = it;
572
+ wmset(store, it, metadata);
573
+ return metadata;
574
+ };
575
+ get = function (it) {
576
+ return wmget(store, it) || {};
577
+ };
578
+ has = function (it) {
579
+ return wmhas(store, it);
580
+ };
581
+ } else {
582
+ var STATE = sharedKey$1('state');
583
+ hiddenKeys$3[STATE] = true;
584
+ set$1 = function (it, metadata) {
585
+ if (hasOwn$6(it, STATE)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED);
586
+ metadata.facade = it;
587
+ createNonEnumerableProperty$3(it, STATE, metadata);
588
+ return metadata;
589
+ };
590
+ get = function (it) {
591
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
592
+ };
593
+ has = function (it) {
594
+ return hasOwn$6(it, STATE);
595
+ };
596
+ }
597
+
598
+ var internalState = {
599
+ set: set$1,
600
+ get: get,
601
+ has: has,
602
+ enforce: enforce,
603
+ getterFor: getterFor
604
+ };
605
+
606
+ var DESCRIPTORS$2 = descriptors;
607
+ var hasOwn$5 = hasOwnProperty_1;
608
+
609
+ var FunctionPrototype$1 = Function.prototype;
610
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
611
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
612
+
613
+ var EXISTS = hasOwn$5(FunctionPrototype$1, 'name');
614
+ // additional protection from minified / mangled / dropped function names
615
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
616
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype$1, 'name').configurable));
617
+
618
+ var functionName = {
619
+ EXISTS: EXISTS,
620
+ PROPER: PROPER,
621
+ CONFIGURABLE: CONFIGURABLE
622
+ };
623
+
624
+ var global$m = global$F;
625
+ var isCallable$8 = isCallable$g;
626
+ var hasOwn$4 = hasOwnProperty_1;
627
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
628
+ var setGlobal$1 = setGlobal$3;
629
+ var inspectSource$2 = inspectSource$4;
630
+ var InternalStateModule$1 = internalState;
631
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
632
+
633
+ var getInternalState$2 = InternalStateModule$1.get;
634
+ var enforceInternalState = InternalStateModule$1.enforce;
635
+ var TEMPLATE = String(String).split('String');
636
+
637
+ (redefine$4.exports = function (O, key, value, options) {
638
+ var unsafe = options ? !!options.unsafe : false;
639
+ var simple = options ? !!options.enumerable : false;
640
+ var noTargetGet = options ? !!options.noTargetGet : false;
641
+ var name = options && options.name !== undefined ? options.name : key;
642
+ var state;
643
+ if (isCallable$8(value)) {
644
+ if (String(name).slice(0, 7) === 'Symbol(') {
645
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
646
+ }
647
+ if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
648
+ createNonEnumerableProperty$2(value, 'name', name);
649
+ }
650
+ state = enforceInternalState(value);
651
+ if (!state.source) {
652
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
653
+ }
654
+ }
655
+ if (O === global$m) {
656
+ if (simple) O[key] = value;
657
+ else setGlobal$1(key, value);
658
+ return;
659
+ } else if (!unsafe) {
660
+ delete O[key];
661
+ } else if (!noTargetGet && O[key]) {
662
+ simple = true;
663
+ }
664
+ if (simple) O[key] = value;
665
+ else createNonEnumerableProperty$2(O, key, value);
666
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
667
+ })(Function.prototype, 'toString', function toString() {
668
+ return isCallable$8(this) && getInternalState$2(this).source || inspectSource$2(this);
669
+ });
670
+
671
+ var objectGetOwnPropertyNames = {};
672
+
673
+ var ceil = Math.ceil;
674
+ var floor$1 = Math.floor;
675
+
676
+ // `ToIntegerOrInfinity` abstract operation
677
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
678
+ var toIntegerOrInfinity$4 = function (argument) {
679
+ var number = +argument;
680
+ // eslint-disable-next-line no-self-compare -- safe
681
+ return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
682
+ };
683
+
684
+ var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
685
+
686
+ var max$2 = Math.max;
687
+ var min$5 = Math.min;
688
+
689
+ // Helper for a popular repeating case of the spec:
690
+ // Let integer be ? ToInteger(index).
691
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
692
+ var toAbsoluteIndex$2 = function (index, length) {
693
+ var integer = toIntegerOrInfinity$3(index);
694
+ return integer < 0 ? max$2(integer + length, 0) : min$5(integer, length);
695
+ };
696
+
697
+ var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
698
+
699
+ var min$4 = Math.min;
700
+
701
+ // `ToLength` abstract operation
702
+ // https://tc39.es/ecma262/#sec-tolength
703
+ var toLength$6 = function (argument) {
704
+ return argument > 0 ? min$4(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
705
+ };
706
+
707
+ var toLength$5 = toLength$6;
708
+
709
+ // `LengthOfArrayLike` abstract operation
710
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
711
+ var lengthOfArrayLike$3 = function (obj) {
712
+ return toLength$5(obj.length);
713
+ };
714
+
715
+ var toIndexedObject$2 = toIndexedObject$4;
716
+ var toAbsoluteIndex$1 = toAbsoluteIndex$2;
717
+ var lengthOfArrayLike$2 = lengthOfArrayLike$3;
718
+
719
+ // `Array.prototype.{ indexOf, includes }` methods implementation
720
+ var createMethod$1 = function (IS_INCLUDES) {
721
+ return function ($this, el, fromIndex) {
722
+ var O = toIndexedObject$2($this);
723
+ var length = lengthOfArrayLike$2(O);
724
+ var index = toAbsoluteIndex$1(fromIndex, length);
725
+ var value;
726
+ // Array#includes uses SameValueZero equality algorithm
727
+ // eslint-disable-next-line no-self-compare -- NaN check
728
+ if (IS_INCLUDES && el != el) while (length > index) {
729
+ value = O[index++];
730
+ // eslint-disable-next-line no-self-compare -- NaN check
731
+ if (value != value) return true;
732
+ // Array#indexOf ignores holes, Array#includes - not
733
+ } else for (;length > index; index++) {
734
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
735
+ } return !IS_INCLUDES && -1;
736
+ };
737
+ };
738
+
739
+ var arrayIncludes = {
740
+ // `Array.prototype.includes` method
741
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
742
+ includes: createMethod$1(true),
743
+ // `Array.prototype.indexOf` method
744
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
745
+ indexOf: createMethod$1(false)
746
+ };
747
+
748
+ var uncurryThis$d = functionUncurryThis;
749
+ var hasOwn$3 = hasOwnProperty_1;
750
+ var toIndexedObject$1 = toIndexedObject$4;
751
+ var indexOf$1 = arrayIncludes.indexOf;
752
+ var hiddenKeys$2 = hiddenKeys$4;
753
+
754
+ var push$2 = uncurryThis$d([].push);
755
+
756
+ var objectKeysInternal = function (object, names) {
757
+ var O = toIndexedObject$1(object);
758
+ var i = 0;
759
+ var result = [];
760
+ var key;
761
+ for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push$2(result, key);
762
+ // Don't enum bug & hidden keys
763
+ while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
764
+ ~indexOf$1(result, key) || push$2(result, key);
765
+ }
766
+ return result;
767
+ };
768
+
769
+ // IE8- don't enum bug keys
770
+ var enumBugKeys$3 = [
771
+ 'constructor',
772
+ 'hasOwnProperty',
773
+ 'isPrototypeOf',
774
+ 'propertyIsEnumerable',
775
+ 'toLocaleString',
776
+ 'toString',
777
+ 'valueOf'
778
+ ];
779
+
780
+ var internalObjectKeys$1 = objectKeysInternal;
781
+ var enumBugKeys$2 = enumBugKeys$3;
782
+
783
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
784
+
785
+ // `Object.getOwnPropertyNames` method
786
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
787
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
788
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
789
+ return internalObjectKeys$1(O, hiddenKeys$1);
790
+ };
791
+
792
+ var objectGetOwnPropertySymbols = {};
793
+
794
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
795
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
796
+
797
+ var getBuiltIn$4 = getBuiltIn$7;
798
+ var uncurryThis$c = functionUncurryThis;
799
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
800
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
801
+ var anObject$d = anObject$f;
802
+
803
+ var concat$1 = uncurryThis$c([].concat);
804
+
805
+ // all object keys, includes non-enumerable and symbols
806
+ var ownKeys$1 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
807
+ var keys = getOwnPropertyNamesModule.f(anObject$d(it));
808
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
809
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
810
+ };
811
+
812
+ var hasOwn$2 = hasOwnProperty_1;
813
+ var ownKeys = ownKeys$1;
814
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
815
+ var definePropertyModule$3 = objectDefineProperty;
816
+
817
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
818
+ var keys = ownKeys(source);
819
+ var defineProperty = definePropertyModule$3.f;
820
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
821
+ for (var i = 0; i < keys.length; i++) {
822
+ var key = keys[i];
823
+ if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
824
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
825
+ }
826
+ }
827
+ };
828
+
829
+ var fails$8 = fails$d;
830
+ var isCallable$7 = isCallable$g;
831
+
832
+ var replacement = /#|\.prototype\./;
833
+
834
+ var isForced$2 = function (feature, detection) {
835
+ var value = data[normalize(feature)];
836
+ return value == POLYFILL ? true
837
+ : value == NATIVE ? false
838
+ : isCallable$7(detection) ? fails$8(detection)
839
+ : !!detection;
840
+ };
841
+
842
+ var normalize = isForced$2.normalize = function (string) {
843
+ return String(string).replace(replacement, '.').toLowerCase();
844
+ };
845
+
846
+ var data = isForced$2.data = {};
847
+ var NATIVE = isForced$2.NATIVE = 'N';
848
+ var POLYFILL = isForced$2.POLYFILL = 'P';
849
+
850
+ var isForced_1 = isForced$2;
851
+
852
+ var global$l = global$F;
853
+ var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
854
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
855
+ var redefine$3 = redefine$4.exports;
856
+ var setGlobal = setGlobal$3;
857
+ var copyConstructorProperties = copyConstructorProperties$1;
858
+ var isForced$1 = isForced_1;
859
+
860
+ /*
861
+ options.target - name of the target object
862
+ options.global - target is the global object
863
+ options.stat - export as static methods of target
864
+ options.proto - export as prototype methods of target
865
+ options.real - real prototype method for the `pure` version
866
+ options.forced - export even if the native feature is available
867
+ options.bind - bind methods to the target, required for the `pure` version
868
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
869
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
870
+ options.sham - add a flag to not completely full polyfills
871
+ options.enumerable - export as enumerable property
872
+ options.noTargetGet - prevent calling a getter on target
873
+ options.name - the .name of the function if it does not match the key
874
+ */
875
+ var _export = function (options, source) {
876
+ var TARGET = options.target;
877
+ var GLOBAL = options.global;
878
+ var STATIC = options.stat;
879
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
880
+ if (GLOBAL) {
881
+ target = global$l;
882
+ } else if (STATIC) {
883
+ target = global$l[TARGET] || setGlobal(TARGET, {});
884
+ } else {
885
+ target = (global$l[TARGET] || {}).prototype;
886
+ }
887
+ if (target) for (key in source) {
888
+ sourceProperty = source[key];
889
+ if (options.noTargetGet) {
890
+ descriptor = getOwnPropertyDescriptor$3(target, key);
891
+ targetProperty = descriptor && descriptor.value;
892
+ } else targetProperty = target[key];
893
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
894
+ // contained in target
895
+ if (!FORCED && targetProperty !== undefined) {
896
+ if (typeof sourceProperty == typeof targetProperty) continue;
897
+ copyConstructorProperties(sourceProperty, targetProperty);
898
+ }
899
+ // add a flag to not completely full polyfills
900
+ if (options.sham || (targetProperty && targetProperty.sham)) {
901
+ createNonEnumerableProperty$1(sourceProperty, 'sham', true);
902
+ }
903
+ // extend global
904
+ redefine$3(target, key, sourceProperty, options);
905
+ }
906
+ };
907
+
908
+ var global$k = global$F;
909
+
910
+ var nativePromiseConstructor = global$k.Promise;
911
+
912
+ var redefine$2 = redefine$4.exports;
913
+
914
+ var redefineAll$1 = function (target, src, options) {
915
+ for (var key in src) redefine$2(target, key, src[key], options);
916
+ return target;
917
+ };
918
+
919
+ var global$j = global$F;
920
+ var isCallable$6 = isCallable$g;
921
+
922
+ var String$3 = global$j.String;
923
+ var TypeError$8 = global$j.TypeError;
924
+
925
+ var aPossiblePrototype$1 = function (argument) {
926
+ if (typeof argument == 'object' || isCallable$6(argument)) return argument;
927
+ throw TypeError$8("Can't set " + String$3(argument) + ' as a prototype');
928
+ };
929
+
930
+ /* eslint-disable no-proto -- safe */
931
+
932
+ var uncurryThis$b = functionUncurryThis;
933
+ var anObject$c = anObject$f;
934
+ var aPossiblePrototype = aPossiblePrototype$1;
935
+
936
+ // `Object.setPrototypeOf` method
937
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
938
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
939
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
940
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
941
+ var CORRECT_SETTER = false;
942
+ var test = {};
943
+ var setter;
944
+ try {
945
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
946
+ setter = uncurryThis$b(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
947
+ setter(test, []);
948
+ CORRECT_SETTER = test instanceof Array;
949
+ } catch (error) { /* empty */ }
950
+ return function setPrototypeOf(O, proto) {
951
+ anObject$c(O);
952
+ aPossiblePrototype(proto);
953
+ if (CORRECT_SETTER) setter(O, proto);
954
+ else O.__proto__ = proto;
955
+ return O;
956
+ };
957
+ }() : undefined);
958
+
959
+ var defineProperty = objectDefineProperty.f;
960
+ var hasOwn$1 = hasOwnProperty_1;
961
+ var wellKnownSymbol$c = wellKnownSymbol$e;
962
+
963
+ var TO_STRING_TAG$2 = wellKnownSymbol$c('toStringTag');
964
+
965
+ var setToStringTag$1 = function (target, TAG, STATIC) {
966
+ if (target && !STATIC) target = target.prototype;
967
+ if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
968
+ defineProperty(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
969
+ }
970
+ };
971
+
972
+ var getBuiltIn$3 = getBuiltIn$7;
973
+ var definePropertyModule$2 = objectDefineProperty;
974
+ var wellKnownSymbol$b = wellKnownSymbol$e;
975
+ var DESCRIPTORS$1 = descriptors;
976
+
977
+ var SPECIES$3 = wellKnownSymbol$b('species');
978
+
979
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
980
+ var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
981
+ var defineProperty = definePropertyModule$2.f;
982
+
983
+ if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$3]) {
984
+ defineProperty(Constructor, SPECIES$3, {
985
+ configurable: true,
986
+ get: function () { return this; }
987
+ });
988
+ }
989
+ };
990
+
991
+ var global$i = global$F;
992
+ var isPrototypeOf$1 = objectIsPrototypeOf;
993
+
994
+ var TypeError$7 = global$i.TypeError;
995
+
996
+ var anInstance$1 = function (it, Prototype) {
997
+ if (isPrototypeOf$1(Prototype, it)) return it;
998
+ throw TypeError$7('Incorrect invocation');
999
+ };
1000
+
1001
+ var uncurryThis$a = functionUncurryThis;
1002
+ var aCallable$3 = aCallable$5;
1003
+
1004
+ var bind$5 = uncurryThis$a(uncurryThis$a.bind);
1005
+
1006
+ // optional / simple context binding
1007
+ var functionBindContext = function (fn, that) {
1008
+ aCallable$3(fn);
1009
+ return that === undefined ? fn : bind$5 ? bind$5(fn, that) : function (/* ...args */) {
1010
+ return fn.apply(that, arguments);
1011
+ };
1012
+ };
1013
+
1014
+ var iterators = {};
1015
+
1016
+ var wellKnownSymbol$a = wellKnownSymbol$e;
1017
+ var Iterators$1 = iterators;
1018
+
1019
+ var ITERATOR$2 = wellKnownSymbol$a('iterator');
1020
+ var ArrayPrototype = Array.prototype;
1021
+
1022
+ // check on default Array iterator
1023
+ var isArrayIteratorMethod$1 = function (it) {
1024
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
1025
+ };
1026
+
1027
+ var wellKnownSymbol$9 = wellKnownSymbol$e;
1028
+
1029
+ var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag');
1030
+ var test = {};
1031
+
1032
+ test[TO_STRING_TAG$1] = 'z';
1033
+
1034
+ var toStringTagSupport = String(test) === '[object z]';
1035
+
1036
+ var global$h = global$F;
1037
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1038
+ var isCallable$5 = isCallable$g;
1039
+ var classofRaw = classofRaw$1;
1040
+ var wellKnownSymbol$8 = wellKnownSymbol$e;
1041
+
1042
+ var TO_STRING_TAG = wellKnownSymbol$8('toStringTag');
1043
+ var Object$1 = global$h.Object;
1044
+
1045
+ // ES3 wrong here
1046
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1047
+
1048
+ // fallback for IE11 Script Access Denied error
1049
+ var tryGet = function (it, key) {
1050
+ try {
1051
+ return it[key];
1052
+ } catch (error) { /* empty */ }
1053
+ };
1054
+
1055
+ // getting tag from ES6+ `Object.prototype.toString`
1056
+ var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1057
+ var O, tag, result;
1058
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1059
+ // @@toStringTag case
1060
+ : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1061
+ // builtinTag case
1062
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1063
+ // ES3 arguments fallback
1064
+ : (result = classofRaw(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1065
+ };
1066
+
1067
+ var classof$5 = classof$6;
1068
+ var getMethod$4 = getMethod$6;
1069
+ var Iterators = iterators;
1070
+ var wellKnownSymbol$7 = wellKnownSymbol$e;
1071
+
1072
+ var ITERATOR$1 = wellKnownSymbol$7('iterator');
1073
+
1074
+ var getIteratorMethod$2 = function (it) {
1075
+ if (it != undefined) return getMethod$4(it, ITERATOR$1)
1076
+ || getMethod$4(it, '@@iterator')
1077
+ || Iterators[classof$5(it)];
1078
+ };
1079
+
1080
+ var global$g = global$F;
1081
+ var call$9 = functionCall;
1082
+ var aCallable$2 = aCallable$5;
1083
+ var anObject$b = anObject$f;
1084
+ var tryToString$2 = tryToString$4;
1085
+ var getIteratorMethod$1 = getIteratorMethod$2;
1086
+
1087
+ var TypeError$6 = global$g.TypeError;
1088
+
1089
+ var getIterator$1 = function (argument, usingIterator) {
1090
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
1091
+ if (aCallable$2(iteratorMethod)) return anObject$b(call$9(iteratorMethod, argument));
1092
+ throw TypeError$6(tryToString$2(argument) + ' is not iterable');
1093
+ };
1094
+
1095
+ var call$8 = functionCall;
1096
+ var anObject$a = anObject$f;
1097
+ var getMethod$3 = getMethod$6;
1098
+
1099
+ var iteratorClose$1 = function (iterator, kind, value) {
1100
+ var innerResult, innerError;
1101
+ anObject$a(iterator);
1102
+ try {
1103
+ innerResult = getMethod$3(iterator, 'return');
1104
+ if (!innerResult) {
1105
+ if (kind === 'throw') throw value;
1106
+ return value;
1107
+ }
1108
+ innerResult = call$8(innerResult, iterator);
1109
+ } catch (error) {
1110
+ innerError = true;
1111
+ innerResult = error;
1112
+ }
1113
+ if (kind === 'throw') throw value;
1114
+ if (innerError) throw innerResult;
1115
+ anObject$a(innerResult);
1116
+ return value;
1117
+ };
1118
+
1119
+ var global$f = global$F;
1120
+ var bind$4 = functionBindContext;
1121
+ var call$7 = functionCall;
1122
+ var anObject$9 = anObject$f;
1123
+ var tryToString$1 = tryToString$4;
1124
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
1125
+ var lengthOfArrayLike$1 = lengthOfArrayLike$3;
1126
+ var isPrototypeOf = objectIsPrototypeOf;
1127
+ var getIterator = getIterator$1;
1128
+ var getIteratorMethod = getIteratorMethod$2;
1129
+ var iteratorClose = iteratorClose$1;
1130
+
1131
+ var TypeError$5 = global$f.TypeError;
1132
+
1133
+ var Result = function (stopped, result) {
1134
+ this.stopped = stopped;
1135
+ this.result = result;
1136
+ };
1137
+
1138
+ var ResultPrototype = Result.prototype;
1139
+
1140
+ var iterate$1 = function (iterable, unboundFunction, options) {
1141
+ var that = options && options.that;
1142
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1143
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1144
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
1145
+ var fn = bind$4(unboundFunction, that);
1146
+ var iterator, iterFn, index, length, result, next, step;
1147
+
1148
+ var stop = function (condition) {
1149
+ if (iterator) iteratorClose(iterator, 'normal', condition);
1150
+ return new Result(true, condition);
1151
+ };
1152
+
1153
+ var callFn = function (value) {
1154
+ if (AS_ENTRIES) {
1155
+ anObject$9(value);
1156
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1157
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
1158
+ };
1159
+
1160
+ if (IS_ITERATOR) {
1161
+ iterator = iterable;
1162
+ } else {
1163
+ iterFn = getIteratorMethod(iterable);
1164
+ if (!iterFn) throw TypeError$5(tryToString$1(iterable) + ' is not iterable');
1165
+ // optimisation for array iterators
1166
+ if (isArrayIteratorMethod(iterFn)) {
1167
+ for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
1168
+ result = callFn(iterable[index]);
1169
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
1170
+ } return new Result(false);
1171
+ }
1172
+ iterator = getIterator(iterable, iterFn);
1173
+ }
1174
+
1175
+ next = iterator.next;
1176
+ while (!(step = call$7(next, iterator)).done) {
1177
+ try {
1178
+ result = callFn(step.value);
1179
+ } catch (error) {
1180
+ iteratorClose(iterator, 'throw', error);
1181
+ }
1182
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
1183
+ } return new Result(false);
1184
+ };
1185
+
1186
+ var wellKnownSymbol$6 = wellKnownSymbol$e;
1187
+
1188
+ var ITERATOR = wellKnownSymbol$6('iterator');
1189
+ var SAFE_CLOSING = false;
1190
+
1191
+ try {
1192
+ var called = 0;
1193
+ var iteratorWithReturn = {
1194
+ next: function () {
1195
+ return { done: !!called++ };
1196
+ },
1197
+ 'return': function () {
1198
+ SAFE_CLOSING = true;
1199
+ }
1200
+ };
1201
+ iteratorWithReturn[ITERATOR] = function () {
1202
+ return this;
1203
+ };
1204
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
1205
+ Array.from(iteratorWithReturn, function () { throw 2; });
1206
+ } catch (error) { /* empty */ }
1207
+
1208
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
1209
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
1210
+ var ITERATION_SUPPORT = false;
1211
+ try {
1212
+ var object = {};
1213
+ object[ITERATOR] = function () {
1214
+ return {
1215
+ next: function () {
1216
+ return { done: ITERATION_SUPPORT = true };
1217
+ }
1218
+ };
1219
+ };
1220
+ exec(object);
1221
+ } catch (error) { /* empty */ }
1222
+ return ITERATION_SUPPORT;
1223
+ };
1224
+
1225
+ var uncurryThis$9 = functionUncurryThis;
1226
+ var fails$7 = fails$d;
1227
+ var isCallable$4 = isCallable$g;
1228
+ var classof$4 = classof$6;
1229
+ var getBuiltIn$2 = getBuiltIn$7;
1230
+ var inspectSource$1 = inspectSource$4;
1231
+
1232
+ var noop = function () { /* empty */ };
1233
+ var empty = [];
1234
+ var construct = getBuiltIn$2('Reflect', 'construct');
1235
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1236
+ var exec$2 = uncurryThis$9(constructorRegExp.exec);
1237
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1238
+
1239
+ var isConstructorModern = function isConstructor(argument) {
1240
+ if (!isCallable$4(argument)) return false;
1241
+ try {
1242
+ construct(noop, empty, argument);
1243
+ return true;
1244
+ } catch (error) {
1245
+ return false;
1246
+ }
1247
+ };
1248
+
1249
+ var isConstructorLegacy = function isConstructor(argument) {
1250
+ if (!isCallable$4(argument)) return false;
1251
+ switch (classof$4(argument)) {
1252
+ case 'AsyncFunction':
1253
+ case 'GeneratorFunction':
1254
+ case 'AsyncGeneratorFunction': return false;
1255
+ }
1256
+ try {
1257
+ // we can't check .prototype since constructors produced by .bind haven't it
1258
+ // `Function#toString` throws on some built-it function in some legacy engines
1259
+ // (for example, `DOMQuad` and similar in FF41-)
1260
+ return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource$1(argument));
1261
+ } catch (error) {
1262
+ return true;
1263
+ }
1264
+ };
1265
+
1266
+ isConstructorLegacy.sham = true;
1267
+
1268
+ // `IsConstructor` abstract operation
1269
+ // https://tc39.es/ecma262/#sec-isconstructor
1270
+ var isConstructor$1 = !construct || fails$7(function () {
1271
+ var called;
1272
+ return isConstructorModern(isConstructorModern.call)
1273
+ || !isConstructorModern(Object)
1274
+ || !isConstructorModern(function () { called = true; })
1275
+ || called;
1276
+ }) ? isConstructorLegacy : isConstructorModern;
1277
+
1278
+ var global$e = global$F;
1279
+ var isConstructor = isConstructor$1;
1280
+ var tryToString = tryToString$4;
1281
+
1282
+ var TypeError$4 = global$e.TypeError;
1283
+
1284
+ // `Assert: IsConstructor(argument) is true`
1285
+ var aConstructor$1 = function (argument) {
1286
+ if (isConstructor(argument)) return argument;
1287
+ throw TypeError$4(tryToString(argument) + ' is not a constructor');
1288
+ };
1289
+
1290
+ var anObject$8 = anObject$f;
1291
+ var aConstructor = aConstructor$1;
1292
+ var wellKnownSymbol$5 = wellKnownSymbol$e;
1293
+
1294
+ var SPECIES$2 = wellKnownSymbol$5('species');
1295
+
1296
+ // `SpeciesConstructor` abstract operation
1297
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1298
+ var speciesConstructor$2 = function (O, defaultConstructor) {
1299
+ var C = anObject$8(O).constructor;
1300
+ var S;
1301
+ return C === undefined || (S = anObject$8(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
1302
+ };
1303
+
1304
+ var FunctionPrototype = Function.prototype;
1305
+ var apply$3 = FunctionPrototype.apply;
1306
+ var bind$3 = FunctionPrototype.bind;
1307
+ var call$6 = FunctionPrototype.call;
1308
+
1309
+ // eslint-disable-next-line es/no-reflect -- safe
1310
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$3 ? call$6.bind(apply$3) : function () {
1311
+ return call$6.apply(apply$3, arguments);
1312
+ });
1313
+
1314
+ var getBuiltIn$1 = getBuiltIn$7;
1315
+
1316
+ var html$2 = getBuiltIn$1('document', 'documentElement');
1317
+
1318
+ var uncurryThis$8 = functionUncurryThis;
1319
+
1320
+ var arraySlice$2 = uncurryThis$8([].slice);
1321
+
1322
+ var userAgent$2 = engineUserAgent;
1323
+
1324
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1325
+
1326
+ var classof$3 = classofRaw$1;
1327
+ var global$d = global$F;
1328
+
1329
+ var engineIsNode = classof$3(global$d.process) == 'process';
1330
+
1331
+ var global$c = global$F;
1332
+ var apply$2 = functionApply;
1333
+ var bind$2 = functionBindContext;
1334
+ var isCallable$3 = isCallable$g;
1335
+ var hasOwn = hasOwnProperty_1;
1336
+ var fails$6 = fails$d;
1337
+ var html$1 = html$2;
1338
+ var arraySlice$1 = arraySlice$2;
1339
+ var createElement = documentCreateElement$1;
1340
+ var IS_IOS$1 = engineIsIos;
1341
+ var IS_NODE$2 = engineIsNode;
1342
+
1343
+ var set = global$c.setImmediate;
1344
+ var clear = global$c.clearImmediate;
1345
+ var process$2 = global$c.process;
1346
+ var Dispatch = global$c.Dispatch;
1347
+ var Function$1 = global$c.Function;
1348
+ var MessageChannel = global$c.MessageChannel;
1349
+ var String$2 = global$c.String;
1350
+ var counter = 0;
1351
+ var queue$1 = {};
1352
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1353
+ var location, defer, channel, port;
1354
+
1355
+ try {
1356
+ // Deno throws a ReferenceError on `location` access without `--location` flag
1357
+ location = global$c.location;
1358
+ } catch (error) { /* empty */ }
1359
+
1360
+ var run = function (id) {
1361
+ if (hasOwn(queue$1, id)) {
1362
+ var fn = queue$1[id];
1363
+ delete queue$1[id];
1364
+ fn();
1365
+ }
1366
+ };
1367
+
1368
+ var runner = function (id) {
1369
+ return function () {
1370
+ run(id);
1371
+ };
1372
+ };
1373
+
1374
+ var listener = function (event) {
1375
+ run(event.data);
1376
+ };
1377
+
1378
+ var post = function (id) {
1379
+ // old engines have not location.origin
1380
+ global$c.postMessage(String$2(id), location.protocol + '//' + location.host);
1381
+ };
1382
+
1383
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1384
+ if (!set || !clear) {
1385
+ set = function setImmediate(fn) {
1386
+ var args = arraySlice$1(arguments, 1);
1387
+ queue$1[++counter] = function () {
1388
+ apply$2(isCallable$3(fn) ? fn : Function$1(fn), undefined, args);
1389
+ };
1390
+ defer(counter);
1391
+ return counter;
1392
+ };
1393
+ clear = function clearImmediate(id) {
1394
+ delete queue$1[id];
1395
+ };
1396
+ // Node.js 0.8-
1397
+ if (IS_NODE$2) {
1398
+ defer = function (id) {
1399
+ process$2.nextTick(runner(id));
1400
+ };
1401
+ // Sphere (JS game engine) Dispatch API
1402
+ } else if (Dispatch && Dispatch.now) {
1403
+ defer = function (id) {
1404
+ Dispatch.now(runner(id));
1405
+ };
1406
+ // Browsers with MessageChannel, includes WebWorkers
1407
+ // except iOS - https://github.com/zloirock/core-js/issues/624
1408
+ } else if (MessageChannel && !IS_IOS$1) {
1409
+ channel = new MessageChannel();
1410
+ port = channel.port2;
1411
+ channel.port1.onmessage = listener;
1412
+ defer = bind$2(port.postMessage, port);
1413
+ // Browsers with postMessage, skip WebWorkers
1414
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1415
+ } else if (
1416
+ global$c.addEventListener &&
1417
+ isCallable$3(global$c.postMessage) &&
1418
+ !global$c.importScripts &&
1419
+ location && location.protocol !== 'file:' &&
1420
+ !fails$6(post)
1421
+ ) {
1422
+ defer = post;
1423
+ global$c.addEventListener('message', listener, false);
1424
+ // IE8-
1425
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
1426
+ defer = function (id) {
1427
+ html$1.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
1428
+ html$1.removeChild(this);
1429
+ run(id);
1430
+ };
1431
+ };
1432
+ // Rest old browsers
1433
+ } else {
1434
+ defer = function (id) {
1435
+ setTimeout(runner(id), 0);
1436
+ };
1437
+ }
1438
+ }
1439
+
1440
+ var task$1 = {
1441
+ set: set,
1442
+ clear: clear
1443
+ };
1444
+
1445
+ var userAgent$1 = engineUserAgent;
1446
+ var global$b = global$F;
1447
+
1448
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$b.Pebble !== undefined;
1449
+
1450
+ var userAgent = engineUserAgent;
1451
+
1452
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
1453
+
1454
+ var global$a = global$F;
1455
+ var bind$1 = functionBindContext;
1456
+ var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
1457
+ var macrotask = task$1.set;
1458
+ var IS_IOS = engineIsIos;
1459
+ var IS_IOS_PEBBLE = engineIsIosPebble;
1460
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
1461
+ var IS_NODE$1 = engineIsNode;
1462
+
1463
+ var MutationObserver = global$a.MutationObserver || global$a.WebKitMutationObserver;
1464
+ var document$2 = global$a.document;
1465
+ var process$1 = global$a.process;
1466
+ var Promise$1 = global$a.Promise;
1467
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1468
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor$2(global$a, 'queueMicrotask');
1469
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1470
+
1471
+ var flush, head, last, notify$1, toggle, node, promise, then;
1472
+
1473
+ // modern engines have queueMicrotask method
1474
+ if (!queueMicrotask) {
1475
+ flush = function () {
1476
+ var parent, fn;
1477
+ if (IS_NODE$1 && (parent = process$1.domain)) parent.exit();
1478
+ while (head) {
1479
+ fn = head.fn;
1480
+ head = head.next;
1481
+ try {
1482
+ fn();
1483
+ } catch (error) {
1484
+ if (head) notify$1();
1485
+ else last = undefined;
1486
+ throw error;
1487
+ }
1488
+ } last = undefined;
1489
+ if (parent) parent.enter();
1490
+ };
1491
+
1492
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1493
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
1494
+ if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
1495
+ toggle = true;
1496
+ node = document$2.createTextNode('');
1497
+ new MutationObserver(flush).observe(node, { characterData: true });
1498
+ notify$1 = function () {
1499
+ node.data = toggle = !toggle;
1500
+ };
1501
+ // environments with maybe non-completely correct, but existent Promise
1502
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
1503
+ // Promise.resolve without an argument throws an error in LG WebOS 2
1504
+ promise = Promise$1.resolve(undefined);
1505
+ // workaround of WebKit ~ iOS Safari 10.1 bug
1506
+ promise.constructor = Promise$1;
1507
+ then = bind$1(promise.then, promise);
1508
+ notify$1 = function () {
1509
+ then(flush);
1510
+ };
1511
+ // Node.js without promises
1512
+ } else if (IS_NODE$1) {
1513
+ notify$1 = function () {
1514
+ process$1.nextTick(flush);
1515
+ };
1516
+ // for other environments - macrotask based on:
1517
+ // - setImmediate
1518
+ // - MessageChannel
1519
+ // - window.postMessag
1520
+ // - onreadystatechange
1521
+ // - setTimeout
1522
+ } else {
1523
+ // strange IE + webpack dev server bug - use .bind(global)
1524
+ macrotask = bind$1(macrotask, global$a);
1525
+ notify$1 = function () {
1526
+ macrotask(flush);
1527
+ };
1528
+ }
1529
+ }
1530
+
1531
+ var microtask$1 = queueMicrotask || function (fn) {
1532
+ var task = { fn: fn, next: undefined };
1533
+ if (last) last.next = task;
1534
+ if (!head) {
1535
+ head = task;
1536
+ notify$1();
1537
+ } last = task;
1538
+ };
1539
+
1540
+ var newPromiseCapability$2 = {};
1541
+
1542
+ var aCallable$1 = aCallable$5;
1543
+
1544
+ var PromiseCapability = function (C) {
1545
+ var resolve, reject;
1546
+ this.promise = new C(function ($$resolve, $$reject) {
1547
+ if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1548
+ resolve = $$resolve;
1549
+ reject = $$reject;
1550
+ });
1551
+ this.resolve = aCallable$1(resolve);
1552
+ this.reject = aCallable$1(reject);
1553
+ };
1554
+
1555
+ // `NewPromiseCapability` abstract operation
1556
+ // https://tc39.es/ecma262/#sec-newpromisecapability
1557
+ newPromiseCapability$2.f = function (C) {
1558
+ return new PromiseCapability(C);
1559
+ };
1560
+
1561
+ var anObject$7 = anObject$f;
1562
+ var isObject$2 = isObject$8;
1563
+ var newPromiseCapability$1 = newPromiseCapability$2;
1564
+
1565
+ var promiseResolve$1 = function (C, x) {
1566
+ anObject$7(C);
1567
+ if (isObject$2(x) && x.constructor === C) return x;
1568
+ var promiseCapability = newPromiseCapability$1.f(C);
1569
+ var resolve = promiseCapability.resolve;
1570
+ resolve(x);
1571
+ return promiseCapability.promise;
1572
+ };
1573
+
1574
+ var global$9 = global$F;
1575
+
1576
+ var hostReportErrors$1 = function (a, b) {
1577
+ var console = global$9.console;
1578
+ if (console && console.error) {
1579
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
1580
+ }
1581
+ };
1582
+
1583
+ var perform$1 = function (exec) {
1584
+ try {
1585
+ return { error: false, value: exec() };
1586
+ } catch (error) {
1587
+ return { error: true, value: error };
1588
+ }
1589
+ };
1590
+
1591
+ var Queue$1 = function () {
1592
+ this.head = null;
1593
+ this.tail = null;
1594
+ };
1595
+
1596
+ Queue$1.prototype = {
1597
+ add: function (item) {
1598
+ var entry = { item: item, next: null };
1599
+ if (this.head) this.tail.next = entry;
1600
+ else this.head = entry;
1601
+ this.tail = entry;
1602
+ },
1603
+ get: function () {
1604
+ var entry = this.head;
1605
+ if (entry) {
1606
+ this.head = entry.next;
1607
+ if (this.tail === entry) this.tail = null;
1608
+ return entry.item;
1609
+ }
1610
+ }
1611
+ };
1612
+
1613
+ var queue = Queue$1;
1614
+
1615
+ var engineIsBrowser = typeof window == 'object';
1616
+
1617
+ var $$3 = _export;
1618
+ var global$8 = global$F;
1619
+ var getBuiltIn = getBuiltIn$7;
1620
+ var call$5 = functionCall;
1621
+ var NativePromise = nativePromiseConstructor;
1622
+ var redefine$1 = redefine$4.exports;
1623
+ var redefineAll = redefineAll$1;
1624
+ var setPrototypeOf = objectSetPrototypeOf;
1625
+ var setToStringTag = setToStringTag$1;
1626
+ var setSpecies = setSpecies$1;
1627
+ var aCallable = aCallable$5;
1628
+ var isCallable$2 = isCallable$g;
1629
+ var isObject$1 = isObject$8;
1630
+ var anInstance = anInstance$1;
1631
+ var inspectSource = inspectSource$4;
1632
+ var iterate = iterate$1;
1633
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
1634
+ var speciesConstructor$1 = speciesConstructor$2;
1635
+ var task = task$1.set;
1636
+ var microtask = microtask$1;
1637
+ var promiseResolve = promiseResolve$1;
1638
+ var hostReportErrors = hostReportErrors$1;
1639
+ var newPromiseCapabilityModule = newPromiseCapability$2;
1640
+ var perform = perform$1;
1641
+ var Queue = queue;
1642
+ var InternalStateModule = internalState;
1643
+ var isForced = isForced_1;
1644
+ var wellKnownSymbol$4 = wellKnownSymbol$e;
1645
+ var IS_BROWSER = engineIsBrowser;
1646
+ var IS_NODE = engineIsNode;
1647
+ var V8_VERSION = engineV8Version;
1648
+
1649
+ var SPECIES$1 = wellKnownSymbol$4('species');
1650
+ var PROMISE = 'Promise';
1651
+
1652
+ var getInternalState$1 = InternalStateModule.getterFor(PROMISE);
1653
+ var setInternalState = InternalStateModule.set;
1654
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
1655
+ var NativePromisePrototype = NativePromise && NativePromise.prototype;
1656
+ var PromiseConstructor = NativePromise;
1657
+ var PromisePrototype = NativePromisePrototype;
1658
+ var TypeError$3 = global$8.TypeError;
1659
+ var document$1 = global$8.document;
1660
+ var process = global$8.process;
1661
+ var newPromiseCapability = newPromiseCapabilityModule.f;
1662
+ var newGenericPromiseCapability = newPromiseCapability;
1663
+
1664
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$8.dispatchEvent);
1665
+ var NATIVE_REJECTION_EVENT = isCallable$2(global$8.PromiseRejectionEvent);
1666
+ var UNHANDLED_REJECTION = 'unhandledrejection';
1667
+ var REJECTION_HANDLED = 'rejectionhandled';
1668
+ var PENDING = 0;
1669
+ var FULFILLED = 1;
1670
+ var REJECTED = 2;
1671
+ var HANDLED = 1;
1672
+ var UNHANDLED = 2;
1673
+ var SUBCLASSING = false;
1674
+
1675
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1676
+
1677
+ var FORCED = isForced(PROMISE, function () {
1678
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
1679
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
1680
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1681
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1682
+ // We can't detect it synchronously, so just check versions
1683
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
1684
+ // We can't use @@species feature detection in V8 since it causes
1685
+ // deoptimization and performance degradation
1686
+ // https://github.com/zloirock/core-js/issues/679
1687
+ if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
1688
+ // Detect correctness of subclassing with @@species support
1689
+ var promise = new PromiseConstructor(function (resolve) { resolve(1); });
1690
+ var FakePromise = function (exec) {
1691
+ exec(function () { /* empty */ }, function () { /* empty */ });
1692
+ };
1693
+ var constructor = promise.constructor = {};
1694
+ constructor[SPECIES$1] = FakePromise;
1695
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1696
+ if (!SUBCLASSING) return true;
1697
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1698
+ return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
1699
+ });
1700
+
1701
+ var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
1702
+ PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
1703
+ });
1704
+
1705
+ // helpers
1706
+ var isThenable = function (it) {
1707
+ var then;
1708
+ return isObject$1(it) && isCallable$2(then = it.then) ? then : false;
1709
+ };
1710
+
1711
+ var callReaction = function (reaction, state) {
1712
+ var value = state.value;
1713
+ var ok = state.state == FULFILLED;
1714
+ var handler = ok ? reaction.ok : reaction.fail;
1715
+ var resolve = reaction.resolve;
1716
+ var reject = reaction.reject;
1717
+ var domain = reaction.domain;
1718
+ var result, then, exited;
1719
+ try {
1720
+ if (handler) {
1721
+ if (!ok) {
1722
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1723
+ state.rejection = HANDLED;
1724
+ }
1725
+ if (handler === true) result = value;
1726
+ else {
1727
+ if (domain) domain.enter();
1728
+ result = handler(value); // can throw
1729
+ if (domain) {
1730
+ domain.exit();
1731
+ exited = true;
1732
+ }
1733
+ }
1734
+ if (result === reaction.promise) {
1735
+ reject(TypeError$3('Promise-chain cycle'));
1736
+ } else if (then = isThenable(result)) {
1737
+ call$5(then, result, resolve, reject);
1738
+ } else resolve(result);
1739
+ } else reject(value);
1740
+ } catch (error) {
1741
+ if (domain && !exited) domain.exit();
1742
+ reject(error);
1743
+ }
1744
+ };
1745
+
1746
+ var notify = function (state, isReject) {
1747
+ if (state.notified) return;
1748
+ state.notified = true;
1749
+ microtask(function () {
1750
+ var reactions = state.reactions;
1751
+ var reaction;
1752
+ while (reaction = reactions.get()) {
1753
+ callReaction(reaction, state);
1754
+ }
1755
+ state.notified = false;
1756
+ if (isReject && !state.rejection) onUnhandled(state);
1757
+ });
1758
+ };
1759
+
1760
+ var dispatchEvent = function (name, promise, reason) {
1761
+ var event, handler;
1762
+ if (DISPATCH_EVENT) {
1763
+ event = document$1.createEvent('Event');
1764
+ event.promise = promise;
1765
+ event.reason = reason;
1766
+ event.initEvent(name, false, true);
1767
+ global$8.dispatchEvent(event);
1768
+ } else event = { promise: promise, reason: reason };
1769
+ if (!NATIVE_REJECTION_EVENT && (handler = global$8['on' + name])) handler(event);
1770
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1771
+ };
1772
+
1773
+ var onUnhandled = function (state) {
1774
+ call$5(task, global$8, function () {
1775
+ var promise = state.facade;
1776
+ var value = state.value;
1777
+ var IS_UNHANDLED = isUnhandled(state);
1778
+ var result;
1779
+ if (IS_UNHANDLED) {
1780
+ result = perform(function () {
1781
+ if (IS_NODE) {
1782
+ process.emit('unhandledRejection', value, promise);
1783
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
1784
+ });
1785
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
1786
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
1787
+ if (result.error) throw result.value;
1788
+ }
1789
+ });
1790
+ };
1791
+
1792
+ var isUnhandled = function (state) {
1793
+ return state.rejection !== HANDLED && !state.parent;
1794
+ };
1795
+
1796
+ var onHandleUnhandled = function (state) {
1797
+ call$5(task, global$8, function () {
1798
+ var promise = state.facade;
1799
+ if (IS_NODE) {
1800
+ process.emit('rejectionHandled', promise);
1801
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
1802
+ });
1803
+ };
1804
+
1805
+ var bind = function (fn, state, unwrap) {
1806
+ return function (value) {
1807
+ fn(state, value, unwrap);
1808
+ };
1809
+ };
1810
+
1811
+ var internalReject = function (state, value, unwrap) {
1812
+ if (state.done) return;
1813
+ state.done = true;
1814
+ if (unwrap) state = unwrap;
1815
+ state.value = value;
1816
+ state.state = REJECTED;
1817
+ notify(state, true);
1818
+ };
1819
+
1820
+ var internalResolve = function (state, value, unwrap) {
1821
+ if (state.done) return;
1822
+ state.done = true;
1823
+ if (unwrap) state = unwrap;
1824
+ try {
1825
+ if (state.facade === value) throw TypeError$3("Promise can't be resolved itself");
1826
+ var then = isThenable(value);
1827
+ if (then) {
1828
+ microtask(function () {
1829
+ var wrapper = { done: false };
1830
+ try {
1831
+ call$5(then, value,
1832
+ bind(internalResolve, wrapper, state),
1833
+ bind(internalReject, wrapper, state)
1834
+ );
1835
+ } catch (error) {
1836
+ internalReject(wrapper, error, state);
1837
+ }
1838
+ });
1839
+ } else {
1840
+ state.value = value;
1841
+ state.state = FULFILLED;
1842
+ notify(state, false);
1843
+ }
1844
+ } catch (error) {
1845
+ internalReject({ done: false }, error, state);
1846
+ }
1847
+ };
1848
+
1849
+ // constructor polyfill
1850
+ if (FORCED) {
1851
+ // 25.4.3.1 Promise(executor)
1852
+ PromiseConstructor = function Promise(executor) {
1853
+ anInstance(this, PromisePrototype);
1854
+ aCallable(executor);
1855
+ call$5(Internal, this);
1856
+ var state = getInternalState$1(this);
1857
+ try {
1858
+ executor(bind(internalResolve, state), bind(internalReject, state));
1859
+ } catch (error) {
1860
+ internalReject(state, error);
1861
+ }
1862
+ };
1863
+ PromisePrototype = PromiseConstructor.prototype;
1864
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
1865
+ Internal = function Promise(executor) {
1866
+ setInternalState(this, {
1867
+ type: PROMISE,
1868
+ done: false,
1869
+ notified: false,
1870
+ parent: false,
1871
+ reactions: new Queue(),
1872
+ rejection: false,
1873
+ state: PENDING,
1874
+ value: undefined
1875
+ });
1876
+ };
1877
+ Internal.prototype = redefineAll(PromisePrototype, {
1878
+ // `Promise.prototype.then` method
1879
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
1880
+ then: function then(onFulfilled, onRejected) {
1881
+ var state = getInternalPromiseState(this);
1882
+ var reaction = newPromiseCapability(speciesConstructor$1(this, PromiseConstructor));
1883
+ state.parent = true;
1884
+ reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true;
1885
+ reaction.fail = isCallable$2(onRejected) && onRejected;
1886
+ reaction.domain = IS_NODE ? process.domain : undefined;
1887
+ if (state.state == PENDING) state.reactions.add(reaction);
1888
+ else microtask(function () {
1889
+ callReaction(reaction, state);
1890
+ });
1891
+ return reaction.promise;
1892
+ },
1893
+ // `Promise.prototype.catch` method
1894
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
1895
+ 'catch': function (onRejected) {
1896
+ return this.then(undefined, onRejected);
1897
+ }
1898
+ });
1899
+ OwnPromiseCapability = function () {
1900
+ var promise = new Internal();
1901
+ var state = getInternalState$1(promise);
1902
+ this.promise = promise;
1903
+ this.resolve = bind(internalResolve, state);
1904
+ this.reject = bind(internalReject, state);
1905
+ };
1906
+ newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
1907
+ return C === PromiseConstructor || C === PromiseWrapper
1908
+ ? new OwnPromiseCapability(C)
1909
+ : newGenericPromiseCapability(C);
1910
+ };
1911
+
1912
+ if (isCallable$2(NativePromise) && NativePromisePrototype !== Object.prototype) {
1913
+ nativeThen = NativePromisePrototype.then;
1914
+
1915
+ if (!SUBCLASSING) {
1916
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
1917
+ redefine$1(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
1918
+ var that = this;
1919
+ return new PromiseConstructor(function (resolve, reject) {
1920
+ call$5(nativeThen, that, resolve, reject);
1921
+ }).then(onFulfilled, onRejected);
1922
+ // https://github.com/zloirock/core-js/issues/640
1923
+ }, { unsafe: true });
1924
+
1925
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
1926
+ redefine$1(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
1927
+ }
1928
+
1929
+ // make `.constructor === Promise` work for native promise-based APIs
1930
+ try {
1931
+ delete NativePromisePrototype.constructor;
1932
+ } catch (error) { /* empty */ }
1933
+
1934
+ // make `instanceof Promise` work for native promise-based APIs
1935
+ if (setPrototypeOf) {
1936
+ setPrototypeOf(NativePromisePrototype, PromisePrototype);
1937
+ }
1938
+ }
1939
+ }
1940
+
1941
+ $$3({ global: true, wrap: true, forced: FORCED }, {
1942
+ Promise: PromiseConstructor
1943
+ });
1944
+
1945
+ setToStringTag(PromiseConstructor, PROMISE, false);
1946
+ setSpecies(PROMISE);
1947
+
1948
+ PromiseWrapper = getBuiltIn(PROMISE);
1949
+
1950
+ // statics
1951
+ $$3({ target: PROMISE, stat: true, forced: FORCED }, {
1952
+ // `Promise.reject` method
1953
+ // https://tc39.es/ecma262/#sec-promise.reject
1954
+ reject: function reject(r) {
1955
+ var capability = newPromiseCapability(this);
1956
+ call$5(capability.reject, undefined, r);
1957
+ return capability.promise;
1958
+ }
1959
+ });
1960
+
1961
+ $$3({ target: PROMISE, stat: true, forced: FORCED }, {
1962
+ // `Promise.resolve` method
1963
+ // https://tc39.es/ecma262/#sec-promise.resolve
1964
+ resolve: function resolve(x) {
1965
+ return promiseResolve(this, x);
1966
+ }
1967
+ });
1968
+
1969
+ $$3({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
1970
+ // `Promise.all` method
1971
+ // https://tc39.es/ecma262/#sec-promise.all
1972
+ all: function all(iterable) {
1973
+ var C = this;
1974
+ var capability = newPromiseCapability(C);
1975
+ var resolve = capability.resolve;
1976
+ var reject = capability.reject;
1977
+ var result = perform(function () {
1978
+ var $promiseResolve = aCallable(C.resolve);
1979
+ var values = [];
1980
+ var counter = 0;
1981
+ var remaining = 1;
1982
+ iterate(iterable, function (promise) {
1983
+ var index = counter++;
1984
+ var alreadyCalled = false;
1985
+ remaining++;
1986
+ call$5($promiseResolve, C, promise).then(function (value) {
1987
+ if (alreadyCalled) return;
1988
+ alreadyCalled = true;
1989
+ values[index] = value;
1990
+ --remaining || resolve(values);
1991
+ }, reject);
1992
+ });
1993
+ --remaining || resolve(values);
1994
+ });
1995
+ if (result.error) reject(result.value);
1996
+ return capability.promise;
1997
+ },
1998
+ // `Promise.race` method
1999
+ // https://tc39.es/ecma262/#sec-promise.race
2000
+ race: function race(iterable) {
2001
+ var C = this;
2002
+ var capability = newPromiseCapability(C);
2003
+ var reject = capability.reject;
2004
+ var result = perform(function () {
2005
+ var $promiseResolve = aCallable(C.resolve);
2006
+ iterate(iterable, function (promise) {
2007
+ call$5($promiseResolve, C, promise).then(capability.resolve, reject);
2008
+ });
2009
+ });
2010
+ if (result.error) reject(result.value);
2011
+ return capability.promise;
2012
+ }
2013
+ });
2014
+
2015
+ var global$7 = global$F;
2016
+ var classof$2 = classof$6;
2017
+
2018
+ var String$1 = global$7.String;
2019
+
2020
+ var toString$7 = function (argument) {
2021
+ if (classof$2(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2022
+ return String$1(argument);
2023
+ };
2024
+
2025
+ var anObject$6 = anObject$f;
2026
+
2027
+ // `RegExp.prototype.flags` getter implementation
2028
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
2029
+ var regexpFlags$1 = function () {
2030
+ var that = anObject$6(this);
2031
+ var result = '';
2032
+ if (that.global) result += 'g';
2033
+ if (that.ignoreCase) result += 'i';
2034
+ if (that.multiline) result += 'm';
2035
+ if (that.dotAll) result += 's';
2036
+ if (that.unicode) result += 'u';
2037
+ if (that.sticky) result += 'y';
2038
+ return result;
2039
+ };
2040
+
2041
+ var fails$5 = fails$d;
2042
+ var global$6 = global$F;
2043
+
2044
+ // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
2045
+ var $RegExp$2 = global$6.RegExp;
2046
+
2047
+ var UNSUPPORTED_Y$2 = fails$5(function () {
2048
+ var re = $RegExp$2('a', 'y');
2049
+ re.lastIndex = 2;
2050
+ return re.exec('abcd') != null;
2051
+ });
2052
+
2053
+ // UC Browser bug
2054
+ // https://github.com/zloirock/core-js/issues/1008
2055
+ var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$5(function () {
2056
+ return !$RegExp$2('a', 'y').sticky;
2057
+ });
2058
+
2059
+ var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$5(function () {
2060
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
2061
+ var re = $RegExp$2('^r', 'gy');
2062
+ re.lastIndex = 2;
2063
+ return re.exec('str') != null;
2064
+ });
2065
+
2066
+ var regexpStickyHelpers = {
2067
+ BROKEN_CARET: BROKEN_CARET,
2068
+ MISSED_STICKY: MISSED_STICKY,
2069
+ UNSUPPORTED_Y: UNSUPPORTED_Y$2
2070
+ };
2071
+
2072
+ var internalObjectKeys = objectKeysInternal;
2073
+ var enumBugKeys$1 = enumBugKeys$3;
2074
+
2075
+ // `Object.keys` method
2076
+ // https://tc39.es/ecma262/#sec-object.keys
2077
+ // eslint-disable-next-line es/no-object-keys -- safe
2078
+ var objectKeys$1 = Object.keys || function keys(O) {
2079
+ return internalObjectKeys(O, enumBugKeys$1);
2080
+ };
2081
+
2082
+ var DESCRIPTORS = descriptors;
2083
+ var definePropertyModule$1 = objectDefineProperty;
2084
+ var anObject$5 = anObject$f;
2085
+ var toIndexedObject = toIndexedObject$4;
2086
+ var objectKeys = objectKeys$1;
2087
+
2088
+ // `Object.defineProperties` method
2089
+ // https://tc39.es/ecma262/#sec-object.defineproperties
2090
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
2091
+ var objectDefineProperties = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
2092
+ anObject$5(O);
2093
+ var props = toIndexedObject(Properties);
2094
+ var keys = objectKeys(Properties);
2095
+ var length = keys.length;
2096
+ var index = 0;
2097
+ var key;
2098
+ while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
2099
+ return O;
2100
+ };
2101
+
2102
+ /* global ActiveXObject -- old IE, WSH */
2103
+
2104
+ var anObject$4 = anObject$f;
2105
+ var defineProperties = objectDefineProperties;
2106
+ var enumBugKeys = enumBugKeys$3;
2107
+ var hiddenKeys = hiddenKeys$4;
2108
+ var html = html$2;
2109
+ var documentCreateElement = documentCreateElement$1;
2110
+ var sharedKey = sharedKey$2;
2111
+
2112
+ var GT = '>';
2113
+ var LT = '<';
2114
+ var PROTOTYPE = 'prototype';
2115
+ var SCRIPT = 'script';
2116
+ var IE_PROTO = sharedKey('IE_PROTO');
2117
+
2118
+ var EmptyConstructor = function () { /* empty */ };
2119
+
2120
+ var scriptTag = function (content) {
2121
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2122
+ };
2123
+
2124
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2125
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
2126
+ activeXDocument.write(scriptTag(''));
2127
+ activeXDocument.close();
2128
+ var temp = activeXDocument.parentWindow.Object;
2129
+ activeXDocument = null; // avoid memory leak
2130
+ return temp;
2131
+ };
2132
+
2133
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
2134
+ var NullProtoObjectViaIFrame = function () {
2135
+ // Thrash, waste and sodomy: IE GC bug
2136
+ var iframe = documentCreateElement('iframe');
2137
+ var JS = 'java' + SCRIPT + ':';
2138
+ var iframeDocument;
2139
+ iframe.style.display = 'none';
2140
+ html.appendChild(iframe);
2141
+ // https://github.com/zloirock/core-js/issues/475
2142
+ iframe.src = String(JS);
2143
+ iframeDocument = iframe.contentWindow.document;
2144
+ iframeDocument.open();
2145
+ iframeDocument.write(scriptTag('document.F=Object'));
2146
+ iframeDocument.close();
2147
+ return iframeDocument.F;
2148
+ };
2149
+
2150
+ // Check for document.domain and active x support
2151
+ // No need to use active x approach when document.domain is not set
2152
+ // see https://github.com/es-shims/es5-shim/issues/150
2153
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2154
+ // avoid IE GC bug
2155
+ var activeXDocument;
2156
+ var NullProtoObject = function () {
2157
+ try {
2158
+ activeXDocument = new ActiveXObject('htmlfile');
2159
+ } catch (error) { /* ignore */ }
2160
+ NullProtoObject = typeof document != 'undefined'
2161
+ ? document.domain && activeXDocument
2162
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2163
+ : NullProtoObjectViaIFrame()
2164
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
2165
+ var length = enumBugKeys.length;
2166
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2167
+ return NullProtoObject();
2168
+ };
2169
+
2170
+ hiddenKeys[IE_PROTO] = true;
2171
+
2172
+ // `Object.create` method
2173
+ // https://tc39.es/ecma262/#sec-object.create
2174
+ var objectCreate = Object.create || function create(O, Properties) {
2175
+ var result;
2176
+ if (O !== null) {
2177
+ EmptyConstructor[PROTOTYPE] = anObject$4(O);
2178
+ result = new EmptyConstructor();
2179
+ EmptyConstructor[PROTOTYPE] = null;
2180
+ // add "__proto__" for Object.getPrototypeOf polyfill
2181
+ result[IE_PROTO] = O;
2182
+ } else result = NullProtoObject();
2183
+ return Properties === undefined ? result : defineProperties(result, Properties);
2184
+ };
2185
+
2186
+ var fails$4 = fails$d;
2187
+ var global$5 = global$F;
2188
+
2189
+ // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
2190
+ var $RegExp$1 = global$5.RegExp;
2191
+
2192
+ var regexpUnsupportedDotAll = fails$4(function () {
2193
+ var re = $RegExp$1('.', 's');
2194
+ return !(re.dotAll && re.exec('\n') && re.flags === 's');
2195
+ });
2196
+
2197
+ var fails$3 = fails$d;
2198
+ var global$4 = global$F;
2199
+
2200
+ // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
2201
+ var $RegExp = global$4.RegExp;
2202
+
2203
+ var regexpUnsupportedNcg = fails$3(function () {
2204
+ var re = $RegExp('(?<a>b)', 'g');
2205
+ return re.exec('b').groups.a !== 'b' ||
2206
+ 'b'.replace(re, '$<a>c') !== 'bc';
2207
+ });
2208
+
2209
+ /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
2210
+ /* eslint-disable regexp/no-useless-quantifier -- testing */
2211
+ var call$4 = functionCall;
2212
+ var uncurryThis$7 = functionUncurryThis;
2213
+ var toString$6 = toString$7;
2214
+ var regexpFlags = regexpFlags$1;
2215
+ var stickyHelpers$1 = regexpStickyHelpers;
2216
+ var shared = shared$4.exports;
2217
+ var create = objectCreate;
2218
+ var getInternalState = internalState.get;
2219
+ var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
2220
+ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
2221
+
2222
+ var nativeReplace = shared('native-string-replace', String.prototype.replace);
2223
+ var nativeExec = RegExp.prototype.exec;
2224
+ var patchedExec = nativeExec;
2225
+ var charAt$3 = uncurryThis$7(''.charAt);
2226
+ var indexOf = uncurryThis$7(''.indexOf);
2227
+ var replace$1 = uncurryThis$7(''.replace);
2228
+ var stringSlice$5 = uncurryThis$7(''.slice);
2229
+
2230
+ var UPDATES_LAST_INDEX_WRONG = (function () {
2231
+ var re1 = /a/;
2232
+ var re2 = /b*/g;
2233
+ call$4(nativeExec, re1, 'a');
2234
+ call$4(nativeExec, re2, 'a');
2235
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2236
+ })();
2237
+
2238
+ var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
2239
+
2240
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
2241
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2242
+
2243
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
2244
+
2245
+ if (PATCH) {
2246
+ patchedExec = function exec(string) {
2247
+ var re = this;
2248
+ var state = getInternalState(re);
2249
+ var str = toString$6(string);
2250
+ var raw = state.raw;
2251
+ var result, reCopy, lastIndex, match, i, object, group;
2252
+
2253
+ if (raw) {
2254
+ raw.lastIndex = re.lastIndex;
2255
+ result = call$4(patchedExec, raw, str);
2256
+ re.lastIndex = raw.lastIndex;
2257
+ return result;
2258
+ }
2259
+
2260
+ var groups = state.groups;
2261
+ var sticky = UNSUPPORTED_Y$1 && re.sticky;
2262
+ var flags = call$4(regexpFlags, re);
2263
+ var source = re.source;
2264
+ var charsAdded = 0;
2265
+ var strCopy = str;
2266
+
2267
+ if (sticky) {
2268
+ flags = replace$1(flags, 'y', '');
2269
+ if (indexOf(flags, 'g') === -1) {
2270
+ flags += 'g';
2271
+ }
2272
+
2273
+ strCopy = stringSlice$5(str, re.lastIndex);
2274
+ // Support anchored sticky behavior.
2275
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
2276
+ source = '(?: ' + source + ')';
2277
+ strCopy = ' ' + strCopy;
2278
+ charsAdded++;
2279
+ }
2280
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
2281
+ // simulate the 'y' flag.
2282
+ reCopy = new RegExp('^(?:' + source + ')', flags);
2283
+ }
2284
+
2285
+ if (NPCG_INCLUDED) {
2286
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
2287
+ }
2288
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2289
+
2290
+ match = call$4(nativeExec, sticky ? reCopy : re, strCopy);
2291
+
2292
+ if (sticky) {
2293
+ if (match) {
2294
+ match.input = stringSlice$5(match.input, charsAdded);
2295
+ match[0] = stringSlice$5(match[0], charsAdded);
2296
+ match.index = re.lastIndex;
2297
+ re.lastIndex += match[0].length;
2298
+ } else re.lastIndex = 0;
2299
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
2300
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2301
+ }
2302
+ if (NPCG_INCLUDED && match && match.length > 1) {
2303
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
2304
+ // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
2305
+ call$4(nativeReplace, match[0], reCopy, function () {
2306
+ for (i = 1; i < arguments.length - 2; i++) {
2307
+ if (arguments[i] === undefined) match[i] = undefined;
2308
+ }
2309
+ });
2310
+ }
2311
+
2312
+ if (match && groups) {
2313
+ match.groups = object = create(null);
2314
+ for (i = 0; i < groups.length; i++) {
2315
+ group = groups[i];
2316
+ object[group[0]] = match[group[1]];
2317
+ }
2318
+ }
2319
+
2320
+ return match;
2321
+ };
2322
+ }
2323
+
2324
+ var regexpExec$3 = patchedExec;
2325
+
2326
+ var $$2 = _export;
2327
+ var exec$1 = regexpExec$3;
2328
+
2329
+ // `RegExp.prototype.exec` method
2330
+ // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2331
+ $$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
2332
+ exec: exec$1
2333
+ });
2334
+
2335
+ // TODO: Remove from `core-js@4` since it's moved to entry points
2336
+
2337
+ var uncurryThis$6 = functionUncurryThis;
2338
+ var redefine = redefine$4.exports;
2339
+ var regexpExec$2 = regexpExec$3;
2340
+ var fails$2 = fails$d;
2341
+ var wellKnownSymbol$3 = wellKnownSymbol$e;
2342
+ var createNonEnumerableProperty = createNonEnumerableProperty$4;
2343
+
2344
+ var SPECIES = wellKnownSymbol$3('species');
2345
+ var RegExpPrototype = RegExp.prototype;
2346
+
2347
+ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2348
+ var SYMBOL = wellKnownSymbol$3(KEY);
2349
+
2350
+ var DELEGATES_TO_SYMBOL = !fails$2(function () {
2351
+ // String methods call symbol-named RegEp methods
2352
+ var O = {};
2353
+ O[SYMBOL] = function () { return 7; };
2354
+ return ''[KEY](O) != 7;
2355
+ });
2356
+
2357
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$2(function () {
2358
+ // Symbol-named RegExp methods call .exec
2359
+ var execCalled = false;
2360
+ var re = /a/;
2361
+
2362
+ if (KEY === 'split') {
2363
+ // We can't use real regex here since it causes deoptimization
2364
+ // and serious performance degradation in V8
2365
+ // https://github.com/zloirock/core-js/issues/306
2366
+ re = {};
2367
+ // RegExp[@@split] doesn't call the regex's exec method, but first creates
2368
+ // a new one. We need to return the patched regex when creating the new one.
2369
+ re.constructor = {};
2370
+ re.constructor[SPECIES] = function () { return re; };
2371
+ re.flags = '';
2372
+ re[SYMBOL] = /./[SYMBOL];
2373
+ }
2374
+
2375
+ re.exec = function () { execCalled = true; return null; };
2376
+
2377
+ re[SYMBOL]('');
2378
+ return !execCalled;
2379
+ });
2380
+
2381
+ if (
2382
+ !DELEGATES_TO_SYMBOL ||
2383
+ !DELEGATES_TO_EXEC ||
2384
+ FORCED
2385
+ ) {
2386
+ var uncurriedNativeRegExpMethod = uncurryThis$6(/./[SYMBOL]);
2387
+ var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2388
+ var uncurriedNativeMethod = uncurryThis$6(nativeMethod);
2389
+ var $exec = regexp.exec;
2390
+ if ($exec === regexpExec$2 || $exec === RegExpPrototype.exec) {
2391
+ if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
2392
+ // The native String method already delegates to @@method (this
2393
+ // polyfilled function), leasing to infinite recursion.
2394
+ // We avoid it by directly calling the native @@method method.
2395
+ return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
2396
+ }
2397
+ return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
2398
+ }
2399
+ return { done: false };
2400
+ });
2401
+
2402
+ redefine(String.prototype, KEY, methods[0]);
2403
+ redefine(RegExpPrototype, SYMBOL, methods[1]);
2404
+ }
2405
+
2406
+ if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
2407
+ };
2408
+
2409
+ var isObject = isObject$8;
2410
+ var classof$1 = classofRaw$1;
2411
+ var wellKnownSymbol$2 = wellKnownSymbol$e;
2412
+
2413
+ var MATCH$1 = wellKnownSymbol$2('match');
2414
+
2415
+ // `IsRegExp` abstract operation
2416
+ // https://tc39.es/ecma262/#sec-isregexp
2417
+ var isRegexp = function (it) {
2418
+ var isRegExp;
2419
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$1(it) == 'RegExp');
2420
+ };
2421
+
2422
+ var uncurryThis$5 = functionUncurryThis;
2423
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
2424
+ var toString$5 = toString$7;
2425
+ var requireObjectCoercible$5 = requireObjectCoercible$8;
2426
+
2427
+ var charAt$2 = uncurryThis$5(''.charAt);
2428
+ var charCodeAt = uncurryThis$5(''.charCodeAt);
2429
+ var stringSlice$4 = uncurryThis$5(''.slice);
2430
+
2431
+ var createMethod = function (CONVERT_TO_STRING) {
2432
+ return function ($this, pos) {
2433
+ var S = toString$5(requireObjectCoercible$5($this));
2434
+ var position = toIntegerOrInfinity$1(pos);
2435
+ var size = S.length;
2436
+ var first, second;
2437
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
2438
+ first = charCodeAt(S, position);
2439
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
2440
+ || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
2441
+ ? CONVERT_TO_STRING
2442
+ ? charAt$2(S, position)
2443
+ : first
2444
+ : CONVERT_TO_STRING
2445
+ ? stringSlice$4(S, position, position + 2)
2446
+ : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2447
+ };
2448
+ };
2449
+
2450
+ var stringMultibyte = {
2451
+ // `String.prototype.codePointAt` method
2452
+ // https://tc39.es/ecma262/#sec-string.prototype.codepointat
2453
+ codeAt: createMethod(false),
2454
+ // `String.prototype.at` method
2455
+ // https://github.com/mathiasbynens/String.prototype.at
2456
+ charAt: createMethod(true)
2457
+ };
2458
+
2459
+ var charAt$1 = stringMultibyte.charAt;
2460
+
2461
+ // `AdvanceStringIndex` abstract operation
2462
+ // https://tc39.es/ecma262/#sec-advancestringindex
2463
+ var advanceStringIndex$3 = function (S, index, unicode) {
2464
+ return index + (unicode ? charAt$1(S, index).length : 1);
2465
+ };
2466
+
2467
+ var toPropertyKey = toPropertyKey$3;
2468
+ var definePropertyModule = objectDefineProperty;
2469
+ var createPropertyDescriptor = createPropertyDescriptor$3;
2470
+
2471
+ var createProperty$1 = function (object, key, value) {
2472
+ var propertyKey = toPropertyKey(key);
2473
+ if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
2474
+ else object[propertyKey] = value;
2475
+ };
2476
+
2477
+ var global$3 = global$F;
2478
+ var toAbsoluteIndex = toAbsoluteIndex$2;
2479
+ var lengthOfArrayLike = lengthOfArrayLike$3;
2480
+ var createProperty = createProperty$1;
2481
+
2482
+ var Array$1 = global$3.Array;
2483
+ var max$1 = Math.max;
2484
+
2485
+ var arraySliceSimple = function (O, start, end) {
2486
+ var length = lengthOfArrayLike(O);
2487
+ var k = toAbsoluteIndex(start, length);
2488
+ var fin = toAbsoluteIndex(end === undefined ? length : end, length);
2489
+ var result = Array$1(max$1(fin - k, 0));
2490
+ for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
2491
+ result.length = n;
2492
+ return result;
2493
+ };
2494
+
2495
+ var global$2 = global$F;
2496
+ var call$3 = functionCall;
2497
+ var anObject$3 = anObject$f;
2498
+ var isCallable$1 = isCallable$g;
2499
+ var classof = classofRaw$1;
2500
+ var regexpExec$1 = regexpExec$3;
2501
+
2502
+ var TypeError$2 = global$2.TypeError;
2503
+
2504
+ // `RegExpExec` abstract operation
2505
+ // https://tc39.es/ecma262/#sec-regexpexec
2506
+ var regexpExecAbstract = function (R, S) {
2507
+ var exec = R.exec;
2508
+ if (isCallable$1(exec)) {
2509
+ var result = call$3(exec, R, S);
2510
+ if (result !== null) anObject$3(result);
2511
+ return result;
2512
+ }
2513
+ if (classof(R) === 'RegExp') return call$3(regexpExec$1, R, S);
2514
+ throw TypeError$2('RegExp#exec called on incompatible receiver');
2515
+ };
2516
+
2517
+ var apply$1 = functionApply;
2518
+ var call$2 = functionCall;
2519
+ var uncurryThis$4 = functionUncurryThis;
2520
+ var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
2521
+ var isRegExp$1 = isRegexp;
2522
+ var anObject$2 = anObject$f;
2523
+ var requireObjectCoercible$4 = requireObjectCoercible$8;
2524
+ var speciesConstructor = speciesConstructor$2;
2525
+ var advanceStringIndex$2 = advanceStringIndex$3;
2526
+ var toLength$4 = toLength$6;
2527
+ var toString$4 = toString$7;
2528
+ var getMethod$2 = getMethod$6;
2529
+ var arraySlice = arraySliceSimple;
2530
+ var callRegExpExec = regexpExecAbstract;
2531
+ var regexpExec = regexpExec$3;
2532
+ var stickyHelpers = regexpStickyHelpers;
2533
+ var fails$1 = fails$d;
2534
+
2535
+ var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
2536
+ var MAX_UINT32 = 0xFFFFFFFF;
2537
+ var min$3 = Math.min;
2538
+ var $push = [].push;
2539
+ var exec = uncurryThis$4(/./.exec);
2540
+ var push$1 = uncurryThis$4($push);
2541
+ var stringSlice$3 = uncurryThis$4(''.slice);
2542
+
2543
+ // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
2544
+ // Weex JS has frozen built-in prototypes, so use try / catch wrapper
2545
+ var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$1(function () {
2546
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
2547
+ var re = /(?:)/;
2548
+ var originalExec = re.exec;
2549
+ re.exec = function () { return originalExec.apply(this, arguments); };
2550
+ var result = 'ab'.split(re);
2551
+ return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
2552
+ });
2553
+
2554
+ // @@split logic
2555
+ fixRegExpWellKnownSymbolLogic$2('split', function (SPLIT, nativeSplit, maybeCallNative) {
2556
+ var internalSplit;
2557
+ if (
2558
+ 'abbc'.split(/(b)*/)[1] == 'c' ||
2559
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
2560
+ 'test'.split(/(?:)/, -1).length != 4 ||
2561
+ 'ab'.split(/(?:ab)*/).length != 2 ||
2562
+ '.'.split(/(.?)(.?)/).length != 4 ||
2563
+ // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
2564
+ '.'.split(/()()/).length > 1 ||
2565
+ ''.split(/.?/).length
2566
+ ) {
2567
+ // based on es5-shim implementation, need to rework it
2568
+ internalSplit = function (separator, limit) {
2569
+ var string = toString$4(requireObjectCoercible$4(this));
2570
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2571
+ if (lim === 0) return [];
2572
+ if (separator === undefined) return [string];
2573
+ // If `separator` is not a regex, use native split
2574
+ if (!isRegExp$1(separator)) {
2575
+ return call$2(nativeSplit, string, separator, lim);
2576
+ }
2577
+ var output = [];
2578
+ var flags = (separator.ignoreCase ? 'i' : '') +
2579
+ (separator.multiline ? 'm' : '') +
2580
+ (separator.unicode ? 'u' : '') +
2581
+ (separator.sticky ? 'y' : '');
2582
+ var lastLastIndex = 0;
2583
+ // Make `global` and avoid `lastIndex` issues by working with a copy
2584
+ var separatorCopy = new RegExp(separator.source, flags + 'g');
2585
+ var match, lastIndex, lastLength;
2586
+ while (match = call$2(regexpExec, separatorCopy, string)) {
2587
+ lastIndex = separatorCopy.lastIndex;
2588
+ if (lastIndex > lastLastIndex) {
2589
+ push$1(output, stringSlice$3(string, lastLastIndex, match.index));
2590
+ if (match.length > 1 && match.index < string.length) apply$1($push, output, arraySlice(match, 1));
2591
+ lastLength = match[0].length;
2592
+ lastLastIndex = lastIndex;
2593
+ if (output.length >= lim) break;
2594
+ }
2595
+ if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2596
+ }
2597
+ if (lastLastIndex === string.length) {
2598
+ if (lastLength || !exec(separatorCopy, '')) push$1(output, '');
2599
+ } else push$1(output, stringSlice$3(string, lastLastIndex));
2600
+ return output.length > lim ? arraySlice(output, 0, lim) : output;
2601
+ };
2602
+ // Chakra, V8
2603
+ } else if ('0'.split(undefined, 0).length) {
2604
+ internalSplit = function (separator, limit) {
2605
+ return separator === undefined && limit === 0 ? [] : call$2(nativeSplit, this, separator, limit);
2606
+ };
2607
+ } else internalSplit = nativeSplit;
2608
+
2609
+ return [
2610
+ // `String.prototype.split` method
2611
+ // https://tc39.es/ecma262/#sec-string.prototype.split
2612
+ function split(separator, limit) {
2613
+ var O = requireObjectCoercible$4(this);
2614
+ var splitter = separator == undefined ? undefined : getMethod$2(separator, SPLIT);
2615
+ return splitter
2616
+ ? call$2(splitter, separator, O, limit)
2617
+ : call$2(internalSplit, toString$4(O), separator, limit);
2618
+ },
2619
+ // `RegExp.prototype[@@split]` method
2620
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
2621
+ //
2622
+ // NOTE: This cannot be properly polyfilled in engines that don't support
2623
+ // the 'y' flag.
2624
+ function (string, limit) {
2625
+ var rx = anObject$2(this);
2626
+ var S = toString$4(string);
2627
+ var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
2628
+
2629
+ if (res.done) return res.value;
2630
+
2631
+ var C = speciesConstructor(rx, RegExp);
2632
+
2633
+ var unicodeMatching = rx.unicode;
2634
+ var flags = (rx.ignoreCase ? 'i' : '') +
2635
+ (rx.multiline ? 'm' : '') +
2636
+ (rx.unicode ? 'u' : '') +
2637
+ (UNSUPPORTED_Y ? 'g' : 'y');
2638
+
2639
+ // ^(? + rx + ) is needed, in combination with some S slicing, to
2640
+ // simulate the 'y' flag.
2641
+ var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
2642
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2643
+ if (lim === 0) return [];
2644
+ if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
2645
+ var p = 0;
2646
+ var q = 0;
2647
+ var A = [];
2648
+ while (q < S.length) {
2649
+ splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
2650
+ var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice$3(S, q) : S);
2651
+ var e;
2652
+ if (
2653
+ z === null ||
2654
+ (e = min$3(toLength$4(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
2655
+ ) {
2656
+ q = advanceStringIndex$2(S, q, unicodeMatching);
2657
+ } else {
2658
+ push$1(A, stringSlice$3(S, p, q));
2659
+ if (A.length === lim) return A;
2660
+ for (var i = 1; i <= z.length - 1; i++) {
2661
+ push$1(A, z[i]);
2662
+ if (A.length === lim) return A;
2663
+ }
2664
+ q = p = e;
2665
+ }
2666
+ }
2667
+ push$1(A, stringSlice$3(S, p));
2668
+ return A;
2669
+ }
2670
+ ];
2671
+ }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
2672
+
2673
+ var call$1 = functionCall;
2674
+ var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
2675
+ var anObject$1 = anObject$f;
2676
+ var toLength$3 = toLength$6;
2677
+ var toString$3 = toString$7;
2678
+ var requireObjectCoercible$3 = requireObjectCoercible$8;
2679
+ var getMethod$1 = getMethod$6;
2680
+ var advanceStringIndex$1 = advanceStringIndex$3;
2681
+ var regExpExec$1 = regexpExecAbstract;
2682
+
2683
+ // @@match logic
2684
+ fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCallNative) {
2685
+ return [
2686
+ // `String.prototype.match` method
2687
+ // https://tc39.es/ecma262/#sec-string.prototype.match
2688
+ function match(regexp) {
2689
+ var O = requireObjectCoercible$3(this);
2690
+ var matcher = regexp == undefined ? undefined : getMethod$1(regexp, MATCH);
2691
+ return matcher ? call$1(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$3(O));
2692
+ },
2693
+ // `RegExp.prototype[@@match]` method
2694
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
2695
+ function (string) {
2696
+ var rx = anObject$1(this);
2697
+ var S = toString$3(string);
2698
+ var res = maybeCallNative(nativeMatch, rx, S);
2699
+
2700
+ if (res.done) return res.value;
2701
+
2702
+ if (!rx.global) return regExpExec$1(rx, S);
2703
+
2704
+ var fullUnicode = rx.unicode;
2705
+ rx.lastIndex = 0;
2706
+ var A = [];
2707
+ var n = 0;
2708
+ var result;
2709
+ while ((result = regExpExec$1(rx, S)) !== null) {
2710
+ var matchStr = toString$3(result[0]);
2711
+ A[n] = matchStr;
2712
+ if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
2713
+ n++;
2714
+ }
2715
+ return n === 0 ? null : A;
2716
+ }
2717
+ ];
2718
+ });
2719
+
2720
+ var uncurryThis$3 = functionUncurryThis;
2721
+ var toObject = toObject$2;
2722
+
2723
+ var floor = Math.floor;
2724
+ var charAt = uncurryThis$3(''.charAt);
2725
+ var replace = uncurryThis$3(''.replace);
2726
+ var stringSlice$2 = uncurryThis$3(''.slice);
2727
+ var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2728
+ var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2729
+
2730
+ // `GetSubstitution` abstract operation
2731
+ // https://tc39.es/ecma262/#sec-getsubstitution
2732
+ var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2733
+ var tailPos = position + matched.length;
2734
+ var m = captures.length;
2735
+ var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2736
+ if (namedCaptures !== undefined) {
2737
+ namedCaptures = toObject(namedCaptures);
2738
+ symbols = SUBSTITUTION_SYMBOLS;
2739
+ }
2740
+ return replace(replacement, symbols, function (match, ch) {
2741
+ var capture;
2742
+ switch (charAt(ch, 0)) {
2743
+ case '$': return '$';
2744
+ case '&': return matched;
2745
+ case '`': return stringSlice$2(str, 0, position);
2746
+ case "'": return stringSlice$2(str, tailPos);
2747
+ case '<':
2748
+ capture = namedCaptures[stringSlice$2(ch, 1, -1)];
2749
+ break;
2750
+ default: // \d\d?
2751
+ var n = +ch;
2752
+ if (n === 0) return match;
2753
+ if (n > m) {
2754
+ var f = floor(n / 10);
2755
+ if (f === 0) return match;
2756
+ if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
2757
+ return match;
2758
+ }
2759
+ capture = captures[n - 1];
2760
+ }
2761
+ return capture === undefined ? '' : capture;
2762
+ });
2763
+ };
2764
+
2765
+ var apply = functionApply;
2766
+ var call = functionCall;
2767
+ var uncurryThis$2 = functionUncurryThis;
2768
+ var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2769
+ var fails = fails$d;
2770
+ var anObject = anObject$f;
2771
+ var isCallable = isCallable$g;
2772
+ var toIntegerOrInfinity = toIntegerOrInfinity$4;
2773
+ var toLength$2 = toLength$6;
2774
+ var toString$2 = toString$7;
2775
+ var requireObjectCoercible$2 = requireObjectCoercible$8;
2776
+ var advanceStringIndex = advanceStringIndex$3;
2777
+ var getMethod = getMethod$6;
2778
+ var getSubstitution = getSubstitution$1;
2779
+ var regExpExec = regexpExecAbstract;
2780
+ var wellKnownSymbol$1 = wellKnownSymbol$e;
2781
+
2782
+ var REPLACE = wellKnownSymbol$1('replace');
2783
+ var max = Math.max;
2784
+ var min$2 = Math.min;
2785
+ var concat = uncurryThis$2([].concat);
2786
+ var push = uncurryThis$2([].push);
2787
+ var stringIndexOf = uncurryThis$2(''.indexOf);
2788
+ var stringSlice$1 = uncurryThis$2(''.slice);
2789
+
2790
+ var maybeToString = function (it) {
2791
+ return it === undefined ? it : String(it);
2792
+ };
2793
+
2794
+ // IE <= 11 replaces $0 with the whole match, as if it was $&
2795
+ // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2796
+ var REPLACE_KEEPS_$0 = (function () {
2797
+ // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
2798
+ return 'a'.replace(/./, '$0') === '$0';
2799
+ })();
2800
+
2801
+ // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2802
+ var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2803
+ if (/./[REPLACE]) {
2804
+ return /./[REPLACE]('a', '$0') === '';
2805
+ }
2806
+ return false;
2807
+ })();
2808
+
2809
+ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
2810
+ var re = /./;
2811
+ re.exec = function () {
2812
+ var result = [];
2813
+ result.groups = { a: '7' };
2814
+ return result;
2815
+ };
2816
+ // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
2817
+ return ''.replace(re, '$<a>') !== '7';
2818
+ });
2819
+
2820
+ // @@replace logic
2821
+ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
2822
+ var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2823
+
2824
+ return [
2825
+ // `String.prototype.replace` method
2826
+ // https://tc39.es/ecma262/#sec-string.prototype.replace
2827
+ function replace(searchValue, replaceValue) {
2828
+ var O = requireObjectCoercible$2(this);
2829
+ var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
2830
+ return replacer
2831
+ ? call(replacer, searchValue, O, replaceValue)
2832
+ : call(nativeReplace, toString$2(O), searchValue, replaceValue);
2833
+ },
2834
+ // `RegExp.prototype[@@replace]` method
2835
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2836
+ function (string, replaceValue) {
2837
+ var rx = anObject(this);
2838
+ var S = toString$2(string);
2839
+
2840
+ if (
2841
+ typeof replaceValue == 'string' &&
2842
+ stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2843
+ stringIndexOf(replaceValue, '$<') === -1
2844
+ ) {
2845
+ var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2846
+ if (res.done) return res.value;
2847
+ }
2848
+
2849
+ var functionalReplace = isCallable(replaceValue);
2850
+ if (!functionalReplace) replaceValue = toString$2(replaceValue);
2851
+
2852
+ var global = rx.global;
2853
+ if (global) {
2854
+ var fullUnicode = rx.unicode;
2855
+ rx.lastIndex = 0;
2856
+ }
2857
+ var results = [];
2858
+ while (true) {
2859
+ var result = regExpExec(rx, S);
2860
+ if (result === null) break;
2861
+
2862
+ push(results, result);
2863
+ if (!global) break;
2864
+
2865
+ var matchStr = toString$2(result[0]);
2866
+ if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$2(rx.lastIndex), fullUnicode);
2867
+ }
2868
+
2869
+ var accumulatedResult = '';
2870
+ var nextSourcePosition = 0;
2871
+ for (var i = 0; i < results.length; i++) {
2872
+ result = results[i];
2873
+
2874
+ var matched = toString$2(result[0]);
2875
+ var position = max(min$2(toIntegerOrInfinity(result.index), S.length), 0);
2876
+ var captures = [];
2877
+ // NOTE: This is equivalent to
2878
+ // captures = result.slice(1).map(maybeToString)
2879
+ // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2880
+ // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2881
+ // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2882
+ for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
2883
+ var namedCaptures = result.groups;
2884
+ if (functionalReplace) {
2885
+ var replacerArgs = concat([matched], captures, position, S);
2886
+ if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2887
+ var replacement = toString$2(apply(replaceValue, undefined, replacerArgs));
2888
+ } else {
2889
+ replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2890
+ }
2891
+ if (position >= nextSourcePosition) {
2892
+ accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
2893
+ nextSourcePosition = position + matched.length;
2894
+ }
2895
+ }
2896
+ return accumulatedResult + stringSlice$1(S, nextSourcePosition);
2897
+ }
2898
+ ];
2899
+ }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
2900
+
2901
+ var global$1 = global$F;
2902
+ var isRegExp = isRegexp;
2903
+
2904
+ var TypeError$1 = global$1.TypeError;
2905
+
2906
+ var notARegexp = function (it) {
2907
+ if (isRegExp(it)) {
2908
+ throw TypeError$1("The method doesn't accept regular expressions");
2909
+ } return it;
2910
+ };
2911
+
2912
+ var wellKnownSymbol = wellKnownSymbol$e;
2913
+
2914
+ var MATCH = wellKnownSymbol('match');
2915
+
2916
+ var correctIsRegexpLogic = function (METHOD_NAME) {
2917
+ var regexp = /./;
2918
+ try {
2919
+ '/./'[METHOD_NAME](regexp);
2920
+ } catch (error1) {
2921
+ try {
2922
+ regexp[MATCH] = false;
2923
+ return '/./'[METHOD_NAME](regexp);
2924
+ } catch (error2) { /* empty */ }
2925
+ } return false;
2926
+ };
2927
+
2928
+ var $$1 = _export;
2929
+ var uncurryThis$1 = functionUncurryThis;
2930
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
2931
+ var toLength$1 = toLength$6;
2932
+ var toString$1 = toString$7;
2933
+ var notARegExp$1 = notARegexp;
2934
+ var requireObjectCoercible$1 = requireObjectCoercible$8;
2935
+ var correctIsRegExpLogic$1 = correctIsRegexpLogic;
2936
+
2937
+ // eslint-disable-next-line es/no-string-prototype-startswith -- safe
2938
+ var un$StartsWith = uncurryThis$1(''.startsWith);
2939
+ var stringSlice = uncurryThis$1(''.slice);
2940
+ var min$1 = Math.min;
2941
+
2942
+ var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('startsWith');
2943
+ // https://github.com/zloirock/core-js/pull/702
2944
+ var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
2945
+ var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'startsWith');
2946
+ return descriptor && !descriptor.writable;
2947
+ }();
2948
+
2949
+ // `String.prototype.startsWith` method
2950
+ // https://tc39.es/ecma262/#sec-string.prototype.startswith
2951
+ $$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
2952
+ startsWith: function startsWith(searchString /* , position = 0 */) {
2953
+ var that = toString$1(requireObjectCoercible$1(this));
2954
+ notARegExp$1(searchString);
2955
+ var index = toLength$1(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
2956
+ var search = toString$1(searchString);
2957
+ return un$StartsWith
2958
+ ? un$StartsWith(that, search, index)
2959
+ : stringSlice(that, index, index + search.length) === search;
2960
+ }
2961
+ });
2962
+
2963
+ var $ = _export;
2964
+ var uncurryThis = functionUncurryThis;
2965
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
2966
+ var toLength = toLength$6;
2967
+ var toString = toString$7;
2968
+ var notARegExp = notARegexp;
2969
+ var requireObjectCoercible = requireObjectCoercible$8;
2970
+ var correctIsRegExpLogic = correctIsRegexpLogic;
2971
+
2972
+ // eslint-disable-next-line es/no-string-prototype-endswith -- safe
2973
+ var un$EndsWith = uncurryThis(''.endsWith);
2974
+ var slice = uncurryThis(''.slice);
2975
+ var min = Math.min;
2976
+
2977
+ var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
2978
+ // https://github.com/zloirock/core-js/pull/702
2979
+ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
2980
+ var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
2981
+ return descriptor && !descriptor.writable;
2982
+ }();
2983
+
2984
+ // `String.prototype.endsWith` method
2985
+ // https://tc39.es/ecma262/#sec-string.prototype.endswith
2986
+ $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
2987
+ endsWith: function endsWith(searchString /* , endPosition = @length */) {
2988
+ var that = toString(requireObjectCoercible(this));
2989
+ notARegExp(searchString);
2990
+ var endPosition = arguments.length > 1 ? arguments[1] : undefined;
2991
+ var len = that.length;
2992
+ var end = endPosition === undefined ? len : min(toLength(endPosition), len);
2993
+ var search = toString(searchString);
2994
+ return un$EndsWith
2995
+ ? un$EndsWith(that, search, end)
2996
+ : slice(that, end - search.length, end) === search;
2997
+ }
2998
+ });
2999
+
3000
+ /*! *****************************************************************************
3001
+ Copyright (c) Microsoft Corporation.
3002
+
3003
+ Permission to use, copy, modify, and/or distribute this software for any
3004
+ purpose with or without fee is hereby granted.
3005
+
3006
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3007
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3008
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3009
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3010
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3011
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3012
+ PERFORMANCE OF THIS SOFTWARE.
3013
+ ***************************************************************************** */
3014
+
3015
+ function __awaiter(thisArg, _arguments, P, generator) {
3016
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3017
+ return new (P || (P = Promise))(function (resolve, reject) {
3018
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
3019
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
3020
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
3021
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
3022
+ });
3023
+ }
3024
+
3025
+ function __generator(thisArg, body) {
3026
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
3027
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
3028
+ function verb(n) { return function (v) { return step([n, v]); }; }
3029
+ function step(op) {
3030
+ if (f) throw new TypeError("Generator is already executing.");
3031
+ while (_) try {
3032
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3033
+ if (y = 0, t) op = [op[0] & 2, t.value];
3034
+ switch (op[0]) {
3035
+ case 0: case 1: t = op; break;
3036
+ case 4: _.label++; return { value: op[1], done: false };
3037
+ case 5: _.label++; y = op[1]; op = [0]; continue;
3038
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
3039
+ default:
3040
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
3041
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
3042
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
3043
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
3044
+ if (t[2]) _.ops.pop();
3045
+ _.trys.pop(); continue;
3046
+ }
3047
+ op = body.call(thisArg, _);
3048
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
3049
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
3050
+ }
3051
+ }
3052
+
3053
+ var fileToArray = function fileToArray(url) {
3054
+ return new Promise(function (resolve, reject) {
3055
+ try {
3056
+ var request_1 = new XMLHttpRequest();
3057
+ request_1.open('GET', url, true);
3058
+ request_1.responseType = 'blob';
3059
+
3060
+ request_1.onload = function () {
3061
+ var reader = new FileReader();
3062
+ reader.readAsArrayBuffer(request_1.response);
3063
+
3064
+ reader.onloadend = function () {
3065
+ resolve(reader.result);
3066
+ };
3067
+ };
3068
+
3069
+ request_1.send();
3070
+ } catch (_a) {
3071
+ reject("error while retrieving file " + url + ".");
3072
+ }
3073
+ });
3074
+ };
3075
+
3076
+ var reloadIFrame = function reloadIFrame(iframe) {
3077
+ if (iframe) {
3078
+ console.log('reloading..'); // eslint-disable-next-line no-self-assign
3079
+
3080
+ iframe.src = iframe.src;
3081
+ }
3082
+ }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
3083
+
3084
+
3085
+ var handleFileUpload = function handleFileUpload(fileInput) {
3086
+ return new Promise(function (resolve, reject) {
3087
+ if (fileInput.target.files && fileInput.target.files[0]) {
3088
+ var reader = new FileReader(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
3089
+
3090
+ reader.onload = function (e) {
3091
+ resolve(e.target.result);
3092
+ };
3093
+
3094
+ reader.readAsDataURL(fileInput.target.files[0]);
3095
+ } else {
3096
+ reject('no files selected');
3097
+ }
3098
+ });
3099
+ };
3100
+ var getbaseUrl = function getbaseUrl() {
3101
+ var pathArray = window.location.href.split('/');
3102
+ var protocol = pathArray[0];
3103
+ var host = pathArray[2];
3104
+ return protocol + '//' + host;
3105
+ };
3106
+ var getLocation = function getLocation(href) {
3107
+ // eslint-disable-next-line no-useless-escape
3108
+ var match = href.match(/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);
3109
+ return match && {
3110
+ href: href,
3111
+ protocol: match[1],
3112
+ host: match[2],
3113
+ hostname: match[3],
3114
+ port: match[4],
3115
+ pathname: match[5],
3116
+ search: match[6],
3117
+ hash: match[7]
3118
+ };
3119
+ };
3120
+ var getDocxToHtml = function getDocxToHtml(url) {
3121
+ return __awaiter(void 0, void 0, void 0, function () {
3122
+ var arrayBuffer, resultObject;
3123
+ return __generator(this, function (_a) {
3124
+ switch (_a.label) {
3125
+ case 0:
3126
+ if (!mammoth) {
3127
+ console.error('Please install mammoth and make sure mammoth.browser.min.js is loaded.');
3128
+ }
3129
+
3130
+ return [4
3131
+ /*yield*/
3132
+ , fileToArray(url)];
3133
+
3134
+ case 1:
3135
+ arrayBuffer = _a.sent();
3136
+ return [4
3137
+ /*yield*/
3138
+ , mammoth.convertToHtml({
3139
+ arrayBuffer: arrayBuffer
3140
+ })];
3141
+
3142
+ case 2:
3143
+ resultObject = _a.sent();
3144
+ return [2
3145
+ /*return*/
3146
+ , resultObject.value];
3147
+ }
3148
+ });
3149
+ });
3150
+ };
3151
+ var googleCheckSubscription = function googleCheckSubscription() {
3152
+ var subscription = null;
3153
+ var checkCount = 0;
3154
+ return {
3155
+ subscribe: function (iframe, interval, maxChecks) {
3156
+ if (interval === void 0) {
3157
+ interval = 3000;
3158
+ }
3159
+
3160
+ if (maxChecks === void 0) {
3161
+ maxChecks = 5;
3162
+ }
3163
+
3164
+ if (!iframeIsLoaded(iframe)) {
3165
+ subscription = setInterval(function () {
3166
+ checkCount++;
3167
+
3168
+ if (checkCount >= maxChecks) {
3169
+ clearInterval(subscription);
3170
+ }
3171
+
3172
+ reloadIFrame(iframe);
3173
+ }, interval);
3174
+ return subscription;
3175
+ } else {
3176
+ if (subscription) {
3177
+ clearInterval(subscription);
3178
+ }
3179
+ }
3180
+ },
3181
+ unsubscribe: function () {
3182
+ if (subscription) {
3183
+ clearInterval(subscription);
3184
+ }
3185
+ }
3186
+ };
3187
+ };
3188
+ var iframeIsLoaded = function iframeIsLoaded(iframe) {
3189
+ var _a; // its #document <html><head></head><body></body></html> when google is returning a 204
3190
+ // so if contentDocument = null then it's loaded.
3191
+
3192
+
3193
+ var isLoaded = false;
3194
+
3195
+ try {
3196
+ if (!internetExplorer()) {
3197
+ isLoaded = !(iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument);
3198
+ } else {
3199
+ isLoaded = !((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document);
3200
+ }
3201
+ } catch (_b) {// ignore message Blocked a frame with origin "http://..." from accessing a cross-origin frame.
3202
+ }
3203
+
3204
+ return isLoaded;
3205
+ };
3206
+
3207
+ var internetExplorer = function internetExplorer() {
3208
+ return /MSIE (\d+\.\d+);/.test(navigator.userAgent) || navigator.userAgent.indexOf("Trident/") > -1;
3209
+ };
3210
+
3211
+ var getViewerDetails = function getViewerDetails(url, configuredViewer, queryParams, viewerUrl) {
3212
+ if (configuredViewer === void 0) {
3213
+ configuredViewer = 'google';
3214
+ }
3215
+
3216
+ if (queryParams === void 0) {
3217
+ queryParams = '';
3218
+ }
3219
+
3220
+ if (viewerUrl === void 0) {
3221
+ viewerUrl = '';
3222
+ }
3223
+
3224
+ switch (configuredViewer) {
3225
+ case 'google':
3226
+ viewerUrl = "https://docs.google.com/gview?url=%URL%&embedded=true";
3227
+ break;
3228
+
3229
+ case 'office':
3230
+ {
3231
+ viewerUrl = "https://view.officeapps.live.com/op/embed.aspx?src=%URL%";
3232
+ break;
3233
+ }
3234
+
3235
+ case 'pdf':
3236
+ {
3237
+ viewerUrl = '';
3238
+ break;
3239
+ }
3240
+ }
3241
+
3242
+ var externalViewer = configuredViewer === 'google' || configuredViewer === 'office' || configuredViewer === 'url';
3243
+ var u = (url === null || url === void 0 ? void 0 : url.indexOf('/')) ? encodeURIComponent(url) : url;
3244
+ var fullUrl = viewerUrl ? viewerUrl.replace('%URL%', u) : url;
3245
+
3246
+ if (queryParams && externalViewer && configuredViewer !== 'url') {
3247
+ var start = queryParams.startsWith('&') ? '' : '&';
3248
+ fullUrl = "" + fullUrl + start + queryParams;
3249
+ }
3250
+
3251
+ return {
3252
+ url: fullUrl,
3253
+ externalViewer: externalViewer
3254
+ };
3255
+ };
3256
+ var replaceLocalUrl = function replaceLocalUrl(url, overrideLocalhost) {
3257
+ var loc = getLocation(url);
3258
+ var locReplace = getLocation(overrideLocalhost);
3259
+
3260
+ if (loc && locReplace) {
3261
+ return url.replace(loc.port ? loc.hostname + ":" + loc.port : loc.hostname, locReplace.port ? locReplace.hostname + ":" + locReplace.port : locReplace.hostname);
3262
+ }
3263
+
3264
+ return url;
3265
+ };
3266
+
3267
+ var getBlobFromUrl = function getBlobFromUrl(url) {
3268
+ return new Promise(function (resolve, reject) {
3269
+ var request = new XMLHttpRequest();
3270
+ request.open('GET', url, true);
3271
+ request.responseType = 'blob';
3272
+
3273
+ request.onload = function () {
3274
+ resolve(request.response);
3275
+ };
3276
+
3277
+ request.onerror = reject;
3278
+ request.send();
3279
+ });
3280
+ };
3281
+
3282
+ var uploadToCloud = function uploadToCloud(fileUrl, api) {
3283
+ return new Promise(function (resolve, reject) {
3284
+ getBlobFromUrl(fileUrl).then(function (blob) {
3285
+ var _a, _b;
3286
+
3287
+ var loc = getLocation(fileUrl);
3288
+ var name = (loc === null || loc === void 0 ? void 0 : loc.pathname) ? (_a = loc === null || loc === void 0 ? void 0 : loc.pathname) === null || _a === void 0 ? void 0 : _a.split('/')[((_b = loc === null || loc === void 0 ? void 0 : loc.pathname) === null || _b === void 0 ? void 0 : _b.split('/').length) - 1] : '';
3289
+ var formData = new FormData();
3290
+ var request = new XMLHttpRequest();
3291
+ formData.append('file', blob, name);
3292
+
3293
+ request.onreadystatechange = function (e) {
3294
+ if (request.readyState === XMLHttpRequest.DONE) {
3295
+ if (request.status === 200) {
3296
+ resolve(request.responseText);
3297
+ } else {
3298
+ reject(request.responseText);
3299
+ }
3300
+ }
3301
+ };
3302
+
3303
+ request.onerror = reject;
3304
+ request.open('post', api, true);
3305
+ request.send(formData);
3306
+ });
3307
+ });
3308
+ };
3309
+ var isLocalFile = function isLocalFile(file) {
3310
+ var loc = getLocation(file);
3311
+ var hostname = (loc === null || loc === void 0 ? void 0 : loc.hostname) || '';
3312
+ return ['localhost', '127.0.0.1', '', '::1'].includes(hostname) || hostname.startsWith('192.168.') || hostname.startsWith('10.0.') || hostname.endsWith('.local');
3313
+ };
3314
+
3315
+ var defaultProps = {
3316
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3317
+ loaded: function () {},
3318
+ disableContent: 'none',
3319
+ googleCheckContentLoaded: true,
3320
+ googleCheckInterval: 3000,
3321
+ queryParams: '',
3322
+ url: '',
3323
+ viewer: 'google',
3324
+ viewerUrl: ''
3325
+ };
3326
+
3327
+ exports.defaultProps = defaultProps;
3328
+ exports.fileToArray = fileToArray;
3329
+ exports.getDocxToHtml = getDocxToHtml;
3330
+ exports.getLocation = getLocation;
3331
+ exports.getViewerDetails = getViewerDetails;
3332
+ exports.getbaseUrl = getbaseUrl;
3333
+ exports.googleCheckSubscription = googleCheckSubscription;
3334
+ exports.handleFileUpload = handleFileUpload;
3335
+ exports.iframeIsLoaded = iframeIsLoaded;
3336
+ exports.isLocalFile = isLocalFile;
3337
+ exports.replaceLocalUrl = replaceLocalUrl;
3338
+ exports.uploadToCloud = uploadToCloud;
3339
+
3340
+ Object.defineProperty(exports, '__esModule', { value: true });
3341
+
3342
+ }));