@trackunit/iris-app-runtime-core 0.0.1-alpha-afcc978985.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js ADDED
@@ -0,0 +1,1509 @@
1
+ import { CustomFieldType } from '@trackunit/iris-app-runtime-core-api';
2
+ export * from '@trackunit/iris-app-runtime-core-api';
3
+ import { connectToParent } from 'penpal';
4
+
5
+ /******************************************************************************
6
+ Copyright (c) Microsoft Corporation.
7
+
8
+ Permission to use, copy, modify, and/or distribute this software for any
9
+ purpose with or without fee is hereby granted.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
+ PERFORMANCE OF THIS SOFTWARE.
18
+ ***************************************************************************** */
19
+
20
+ function __awaiter(thisArg, _arguments, P, generator) {
21
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
22
+ return new (P || (P = Promise))(function (resolve, reject) {
23
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
24
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
25
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
27
+ });
28
+ }
29
+
30
+ const hostConnector = connectToParent({
31
+ // Methods child is exposing to parent.
32
+ methods: {}
33
+ });
34
+ const getHostConnector = () => {
35
+ return hostConnector.promise;
36
+ };
37
+
38
+ const AssetRuntime = {
39
+ getAssetInfo: () => __awaiter(void 0, void 0, void 0, function* () {
40
+ const api = yield getHostConnector();
41
+ return api.getAssetInfo();
42
+ })
43
+ };
44
+
45
+ const CurrentUserRuntime = {
46
+ getCurrentUserContext: () => __awaiter(void 0, void 0, void 0, function* () {
47
+ const api = yield getHostConnector();
48
+ return api.getCurrentUserContext();
49
+ })
50
+ };
51
+
52
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
53
+
54
+ var check = function (it) {
55
+ return it && it.Math == Math && it;
56
+ };
57
+
58
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
59
+ var global$c =
60
+ // eslint-disable-next-line es/no-global-this -- safe
61
+ check(typeof globalThis == 'object' && globalThis) ||
62
+ check(typeof window == 'object' && window) ||
63
+ // eslint-disable-next-line no-restricted-globals -- safe
64
+ check(typeof self == 'object' && self) ||
65
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
66
+ // eslint-disable-next-line no-new-func -- fallback
67
+ (function () { return this; })() || Function('return this')();
68
+
69
+ var objectGetOwnPropertyDescriptor = {};
70
+
71
+ var fails$c = function (exec) {
72
+ try {
73
+ return !!exec();
74
+ } catch (error) {
75
+ return true;
76
+ }
77
+ };
78
+
79
+ var fails$b = fails$c;
80
+
81
+ // Detect IE8's incomplete defineProperty implementation
82
+ var descriptors = !fails$b(function () {
83
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
84
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
85
+ });
86
+
87
+ var fails$a = fails$c;
88
+
89
+ var functionBindNative = !fails$a(function () {
90
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
91
+ var test = (function () { /* empty */ }).bind();
92
+ // eslint-disable-next-line no-prototype-builtins -- safe
93
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
94
+ });
95
+
96
+ var NATIVE_BIND$1 = functionBindNative;
97
+
98
+ var call$5 = Function.prototype.call;
99
+
100
+ var functionCall = NATIVE_BIND$1 ? call$5.bind(call$5) : function () {
101
+ return call$5.apply(call$5, arguments);
102
+ };
103
+
104
+ var objectPropertyIsEnumerable = {};
105
+
106
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
107
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
108
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
109
+
110
+ // Nashorn ~ JDK8 bug
111
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
112
+
113
+ // `Object.prototype.propertyIsEnumerable` method implementation
114
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
115
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
116
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
117
+ return !!descriptor && descriptor.enumerable;
118
+ } : $propertyIsEnumerable;
119
+
120
+ var createPropertyDescriptor$2 = function (bitmap, value) {
121
+ return {
122
+ enumerable: !(bitmap & 1),
123
+ configurable: !(bitmap & 2),
124
+ writable: !(bitmap & 4),
125
+ value: value
126
+ };
127
+ };
128
+
129
+ var NATIVE_BIND = functionBindNative;
130
+
131
+ var FunctionPrototype$1 = Function.prototype;
132
+ var call$4 = FunctionPrototype$1.call;
133
+ var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$4, call$4);
134
+
135
+ var functionUncurryThisRaw = function (fn) {
136
+ return NATIVE_BIND ? uncurryThisWithBind(fn) : function () {
137
+ return call$4.apply(fn, arguments);
138
+ };
139
+ };
140
+
141
+ var uncurryThisRaw$1 = functionUncurryThisRaw;
142
+
143
+ var toString$5 = uncurryThisRaw$1({}.toString);
144
+ var stringSlice = uncurryThisRaw$1(''.slice);
145
+
146
+ var classofRaw$2 = function (it) {
147
+ return stringSlice(toString$5(it), 8, -1);
148
+ };
149
+
150
+ var classofRaw$1 = classofRaw$2;
151
+ var uncurryThisRaw = functionUncurryThisRaw;
152
+
153
+ var functionUncurryThis = function (fn) {
154
+ // Nashorn bug:
155
+ // https://github.com/zloirock/core-js/issues/1128
156
+ // https://github.com/zloirock/core-js/issues/1130
157
+ if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
158
+ };
159
+
160
+ var uncurryThis$a = functionUncurryThis;
161
+ var fails$9 = fails$c;
162
+ var classof$2 = classofRaw$2;
163
+
164
+ var $Object$3 = Object;
165
+ var split = uncurryThis$a(''.split);
166
+
167
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
168
+ var indexedObject = fails$9(function () {
169
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
170
+ // eslint-disable-next-line no-prototype-builtins -- safe
171
+ return !$Object$3('z').propertyIsEnumerable(0);
172
+ }) ? function (it) {
173
+ return classof$2(it) == 'String' ? split(it, '') : $Object$3(it);
174
+ } : $Object$3;
175
+
176
+ // we can't use just `it == null` since of `document.all` special case
177
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
178
+ var isNullOrUndefined$2 = function (it) {
179
+ return it === null || it === undefined;
180
+ };
181
+
182
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
183
+
184
+ var $TypeError$5 = TypeError;
185
+
186
+ // `RequireObjectCoercible` abstract operation
187
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
188
+ var requireObjectCoercible$3 = function (it) {
189
+ if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
190
+ return it;
191
+ };
192
+
193
+ // toObject with fallback for non-array-like ES3 strings
194
+ var IndexedObject$1 = indexedObject;
195
+ var requireObjectCoercible$2 = requireObjectCoercible$3;
196
+
197
+ var toIndexedObject$3 = function (it) {
198
+ return IndexedObject$1(requireObjectCoercible$2(it));
199
+ };
200
+
201
+ var documentAll$2 = typeof document == 'object' && document.all;
202
+
203
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
204
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
205
+
206
+ var documentAll_1 = {
207
+ all: documentAll$2,
208
+ IS_HTMLDDA: IS_HTMLDDA
209
+ };
210
+
211
+ var $documentAll$1 = documentAll_1;
212
+
213
+ var documentAll$1 = $documentAll$1.all;
214
+
215
+ // `IsCallable` abstract operation
216
+ // https://tc39.es/ecma262/#sec-iscallable
217
+ var isCallable$b = $documentAll$1.IS_HTMLDDA ? function (argument) {
218
+ return typeof argument == 'function' || argument === documentAll$1;
219
+ } : function (argument) {
220
+ return typeof argument == 'function';
221
+ };
222
+
223
+ var isCallable$a = isCallable$b;
224
+ var $documentAll = documentAll_1;
225
+
226
+ var documentAll = $documentAll.all;
227
+
228
+ var isObject$5 = $documentAll.IS_HTMLDDA ? function (it) {
229
+ return typeof it == 'object' ? it !== null : isCallable$a(it) || it === documentAll;
230
+ } : function (it) {
231
+ return typeof it == 'object' ? it !== null : isCallable$a(it);
232
+ };
233
+
234
+ var global$b = global$c;
235
+ var isCallable$9 = isCallable$b;
236
+
237
+ var aFunction = function (argument) {
238
+ return isCallable$9(argument) ? argument : undefined;
239
+ };
240
+
241
+ var getBuiltIn$3 = function (namespace, method) {
242
+ return arguments.length < 2 ? aFunction(global$b[namespace]) : global$b[namespace] && global$b[namespace][method];
243
+ };
244
+
245
+ var uncurryThis$9 = functionUncurryThis;
246
+
247
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
248
+
249
+ var getBuiltIn$2 = getBuiltIn$3;
250
+
251
+ var engineUserAgent = getBuiltIn$2('navigator', 'userAgent') || '';
252
+
253
+ var global$a = global$c;
254
+ var userAgent = engineUserAgent;
255
+
256
+ var process = global$a.process;
257
+ var Deno = global$a.Deno;
258
+ var versions = process && process.versions || Deno && Deno.version;
259
+ var v8 = versions && versions.v8;
260
+ var match, version;
261
+
262
+ if (v8) {
263
+ match = v8.split('.');
264
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
265
+ // but their correct versions are not interesting for us
266
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
267
+ }
268
+
269
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
270
+ // so check `userAgent` even if `.v8` exists, but 0
271
+ if (!version && userAgent) {
272
+ match = userAgent.match(/Edge\/(\d+)/);
273
+ if (!match || match[1] >= 74) {
274
+ match = userAgent.match(/Chrome\/(\d+)/);
275
+ if (match) version = +match[1];
276
+ }
277
+ }
278
+
279
+ var engineV8Version = version;
280
+
281
+ /* eslint-disable es/no-symbol -- required for testing */
282
+
283
+ var V8_VERSION = engineV8Version;
284
+ var fails$8 = fails$c;
285
+
286
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
287
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
288
+ var symbol = Symbol();
289
+ // Chrome 38 Symbol has incorrect toString conversion
290
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
291
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
292
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
293
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
294
+ });
295
+
296
+ /* eslint-disable es/no-symbol -- required for testing */
297
+
298
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
299
+
300
+ var useSymbolAsUid = NATIVE_SYMBOL$1
301
+ && !Symbol.sham
302
+ && typeof Symbol.iterator == 'symbol';
303
+
304
+ var getBuiltIn$1 = getBuiltIn$3;
305
+ var isCallable$8 = isCallable$b;
306
+ var isPrototypeOf = objectIsPrototypeOf;
307
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
308
+
309
+ var $Object$2 = Object;
310
+
311
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
312
+ return typeof it == 'symbol';
313
+ } : function (it) {
314
+ var $Symbol = getBuiltIn$1('Symbol');
315
+ return isCallable$8($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
316
+ };
317
+
318
+ var $String$2 = String;
319
+
320
+ var tryToString$1 = function (argument) {
321
+ try {
322
+ return $String$2(argument);
323
+ } catch (error) {
324
+ return 'Object';
325
+ }
326
+ };
327
+
328
+ var isCallable$7 = isCallable$b;
329
+ var tryToString = tryToString$1;
330
+
331
+ var $TypeError$4 = TypeError;
332
+
333
+ // `Assert: IsCallable(argument) is true`
334
+ var aCallable$1 = function (argument) {
335
+ if (isCallable$7(argument)) return argument;
336
+ throw $TypeError$4(tryToString(argument) + ' is not a function');
337
+ };
338
+
339
+ var aCallable = aCallable$1;
340
+ var isNullOrUndefined = isNullOrUndefined$2;
341
+
342
+ // `GetMethod` abstract operation
343
+ // https://tc39.es/ecma262/#sec-getmethod
344
+ var getMethod$1 = function (V, P) {
345
+ var func = V[P];
346
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
347
+ };
348
+
349
+ var call$3 = functionCall;
350
+ var isCallable$6 = isCallable$b;
351
+ var isObject$4 = isObject$5;
352
+
353
+ var $TypeError$3 = TypeError;
354
+
355
+ // `OrdinaryToPrimitive` abstract operation
356
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
357
+ var ordinaryToPrimitive$1 = function (input, pref) {
358
+ var fn, val;
359
+ if (pref === 'string' && isCallable$6(fn = input.toString) && !isObject$4(val = call$3(fn, input))) return val;
360
+ if (isCallable$6(fn = input.valueOf) && !isObject$4(val = call$3(fn, input))) return val;
361
+ if (pref !== 'string' && isCallable$6(fn = input.toString) && !isObject$4(val = call$3(fn, input))) return val;
362
+ throw $TypeError$3("Can't convert object to primitive value");
363
+ };
364
+
365
+ var shared$3 = {exports: {}};
366
+
367
+ var global$9 = global$c;
368
+
369
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
370
+ var defineProperty$2 = Object.defineProperty;
371
+
372
+ var defineGlobalProperty$3 = function (key, value) {
373
+ try {
374
+ defineProperty$2(global$9, key, { value: value, configurable: true, writable: true });
375
+ } catch (error) {
376
+ global$9[key] = value;
377
+ } return value;
378
+ };
379
+
380
+ var global$8 = global$c;
381
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
382
+
383
+ var SHARED = '__core-js_shared__';
384
+ var store$3 = global$8[SHARED] || defineGlobalProperty$2(SHARED, {});
385
+
386
+ var sharedStore = store$3;
387
+
388
+ var store$2 = sharedStore;
389
+
390
+ (shared$3.exports = function (key, value) {
391
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
392
+ })('versions', []).push({
393
+ version: '3.25.5',
394
+ mode: 'global',
395
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
396
+ license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
397
+ source: 'https://github.com/zloirock/core-js'
398
+ });
399
+
400
+ var requireObjectCoercible$1 = requireObjectCoercible$3;
401
+
402
+ var $Object$1 = Object;
403
+
404
+ // `ToObject` abstract operation
405
+ // https://tc39.es/ecma262/#sec-toobject
406
+ var toObject$2 = function (argument) {
407
+ return $Object$1(requireObjectCoercible$1(argument));
408
+ };
409
+
410
+ var uncurryThis$8 = functionUncurryThis;
411
+ var toObject$1 = toObject$2;
412
+
413
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
414
+
415
+ // `HasOwnProperty` abstract operation
416
+ // https://tc39.es/ecma262/#sec-hasownproperty
417
+ // eslint-disable-next-line es/no-object-hasown -- safe
418
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
419
+ return hasOwnProperty(toObject$1(it), key);
420
+ };
421
+
422
+ var uncurryThis$7 = functionUncurryThis;
423
+
424
+ var id = 0;
425
+ var postfix = Math.random();
426
+ var toString$4 = uncurryThis$7(1.0.toString);
427
+
428
+ var uid$2 = function (key) {
429
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
430
+ };
431
+
432
+ var global$7 = global$c;
433
+ var shared$2 = shared$3.exports;
434
+ var hasOwn$6 = hasOwnProperty_1;
435
+ var uid$1 = uid$2;
436
+ var NATIVE_SYMBOL = symbolConstructorDetection;
437
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
438
+
439
+ var WellKnownSymbolsStore = shared$2('wks');
440
+ var Symbol$3 = global$7.Symbol;
441
+ var symbolFor = Symbol$3 && Symbol$3['for'];
442
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
443
+
444
+ var wellKnownSymbol$3 = function (name) {
445
+ if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
446
+ var description = 'Symbol.' + name;
447
+ if (NATIVE_SYMBOL && hasOwn$6(Symbol$3, name)) {
448
+ WellKnownSymbolsStore[name] = Symbol$3[name];
449
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
450
+ WellKnownSymbolsStore[name] = symbolFor(description);
451
+ } else {
452
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
453
+ }
454
+ } return WellKnownSymbolsStore[name];
455
+ };
456
+
457
+ var call$2 = functionCall;
458
+ var isObject$3 = isObject$5;
459
+ var isSymbol$1 = isSymbol$2;
460
+ var getMethod = getMethod$1;
461
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
462
+ var wellKnownSymbol$2 = wellKnownSymbol$3;
463
+
464
+ var $TypeError$2 = TypeError;
465
+ var TO_PRIMITIVE = wellKnownSymbol$2('toPrimitive');
466
+
467
+ // `ToPrimitive` abstract operation
468
+ // https://tc39.es/ecma262/#sec-toprimitive
469
+ var toPrimitive$1 = function (input, pref) {
470
+ if (!isObject$3(input) || isSymbol$1(input)) return input;
471
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
472
+ var result;
473
+ if (exoticToPrim) {
474
+ if (pref === undefined) pref = 'default';
475
+ result = call$2(exoticToPrim, input, pref);
476
+ if (!isObject$3(result) || isSymbol$1(result)) return result;
477
+ throw $TypeError$2("Can't convert object to primitive value");
478
+ }
479
+ if (pref === undefined) pref = 'number';
480
+ return ordinaryToPrimitive(input, pref);
481
+ };
482
+
483
+ var toPrimitive = toPrimitive$1;
484
+ var isSymbol = isSymbol$2;
485
+
486
+ // `ToPropertyKey` abstract operation
487
+ // https://tc39.es/ecma262/#sec-topropertykey
488
+ var toPropertyKey$2 = function (argument) {
489
+ var key = toPrimitive(argument, 'string');
490
+ return isSymbol(key) ? key : key + '';
491
+ };
492
+
493
+ var global$6 = global$c;
494
+ var isObject$2 = isObject$5;
495
+
496
+ var document$1 = global$6.document;
497
+ // typeof document.createElement is 'object' in old IE
498
+ var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
499
+
500
+ var documentCreateElement = function (it) {
501
+ return EXISTS$1 ? document$1.createElement(it) : {};
502
+ };
503
+
504
+ var DESCRIPTORS$7 = descriptors;
505
+ var fails$7 = fails$c;
506
+ var createElement = documentCreateElement;
507
+
508
+ // Thanks to IE8 for its funny defineProperty
509
+ var ie8DomDefine = !DESCRIPTORS$7 && !fails$7(function () {
510
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
511
+ return Object.defineProperty(createElement('div'), 'a', {
512
+ get: function () { return 7; }
513
+ }).a != 7;
514
+ });
515
+
516
+ var DESCRIPTORS$6 = descriptors;
517
+ var call$1 = functionCall;
518
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
519
+ var createPropertyDescriptor$1 = createPropertyDescriptor$2;
520
+ var toIndexedObject$2 = toIndexedObject$3;
521
+ var toPropertyKey$1 = toPropertyKey$2;
522
+ var hasOwn$5 = hasOwnProperty_1;
523
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
524
+
525
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
526
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
527
+
528
+ // `Object.getOwnPropertyDescriptor` method
529
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
530
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
531
+ O = toIndexedObject$2(O);
532
+ P = toPropertyKey$1(P);
533
+ if (IE8_DOM_DEFINE$1) try {
534
+ return $getOwnPropertyDescriptor$1(O, P);
535
+ } catch (error) { /* empty */ }
536
+ if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$1(propertyIsEnumerableModule$1.f, O, P), O[P]);
537
+ };
538
+
539
+ var objectDefineProperty = {};
540
+
541
+ var DESCRIPTORS$5 = descriptors;
542
+ var fails$6 = fails$c;
543
+
544
+ // V8 ~ Chrome 36-
545
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
546
+ var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$6(function () {
547
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
548
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
549
+ value: 42,
550
+ writable: false
551
+ }).prototype != 42;
552
+ });
553
+
554
+ var isObject$1 = isObject$5;
555
+
556
+ var $String$1 = String;
557
+ var $TypeError$1 = TypeError;
558
+
559
+ // `Assert: Type(argument) is Object`
560
+ var anObject$2 = function (argument) {
561
+ if (isObject$1(argument)) return argument;
562
+ throw $TypeError$1($String$1(argument) + ' is not an object');
563
+ };
564
+
565
+ var DESCRIPTORS$4 = descriptors;
566
+ var IE8_DOM_DEFINE = ie8DomDefine;
567
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
568
+ var anObject$1 = anObject$2;
569
+ var toPropertyKey = toPropertyKey$2;
570
+
571
+ var $TypeError = TypeError;
572
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
573
+ var $defineProperty = Object.defineProperty;
574
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
575
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
576
+ var ENUMERABLE = 'enumerable';
577
+ var CONFIGURABLE$1 = 'configurable';
578
+ var WRITABLE = 'writable';
579
+
580
+ // `Object.defineProperty` method
581
+ // https://tc39.es/ecma262/#sec-object.defineproperty
582
+ objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
583
+ anObject$1(O);
584
+ P = toPropertyKey(P);
585
+ anObject$1(Attributes);
586
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
587
+ var current = $getOwnPropertyDescriptor(O, P);
588
+ if (current && current[WRITABLE]) {
589
+ O[P] = Attributes.value;
590
+ Attributes = {
591
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
592
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
593
+ writable: false
594
+ };
595
+ }
596
+ } return $defineProperty(O, P, Attributes);
597
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
598
+ anObject$1(O);
599
+ P = toPropertyKey(P);
600
+ anObject$1(Attributes);
601
+ if (IE8_DOM_DEFINE) try {
602
+ return $defineProperty(O, P, Attributes);
603
+ } catch (error) { /* empty */ }
604
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
605
+ if ('value' in Attributes) O[P] = Attributes.value;
606
+ return O;
607
+ };
608
+
609
+ var DESCRIPTORS$3 = descriptors;
610
+ var definePropertyModule$2 = objectDefineProperty;
611
+ var createPropertyDescriptor = createPropertyDescriptor$2;
612
+
613
+ var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
614
+ return definePropertyModule$2.f(object, key, createPropertyDescriptor(1, value));
615
+ } : function (object, key, value) {
616
+ object[key] = value;
617
+ return object;
618
+ };
619
+
620
+ var makeBuiltIn$2 = {exports: {}};
621
+
622
+ var DESCRIPTORS$2 = descriptors;
623
+ var hasOwn$4 = hasOwnProperty_1;
624
+
625
+ var FunctionPrototype = Function.prototype;
626
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
627
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
628
+
629
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
630
+ // additional protection from minified / mangled / dropped function names
631
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
632
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
633
+
634
+ var functionName = {
635
+ EXISTS: EXISTS,
636
+ PROPER: PROPER,
637
+ CONFIGURABLE: CONFIGURABLE
638
+ };
639
+
640
+ var uncurryThis$6 = functionUncurryThis;
641
+ var isCallable$5 = isCallable$b;
642
+ var store$1 = sharedStore;
643
+
644
+ var functionToString = uncurryThis$6(Function.toString);
645
+
646
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
647
+ if (!isCallable$5(store$1.inspectSource)) {
648
+ store$1.inspectSource = function (it) {
649
+ return functionToString(it);
650
+ };
651
+ }
652
+
653
+ var inspectSource$1 = store$1.inspectSource;
654
+
655
+ var global$5 = global$c;
656
+ var isCallable$4 = isCallable$b;
657
+
658
+ var WeakMap$1 = global$5.WeakMap;
659
+
660
+ var weakMapBasicDetection = isCallable$4(WeakMap$1) && /native code/.test(String(WeakMap$1));
661
+
662
+ var shared$1 = shared$3.exports;
663
+ var uid = uid$2;
664
+
665
+ var keys = shared$1('keys');
666
+
667
+ var sharedKey$1 = function (key) {
668
+ return keys[key] || (keys[key] = uid(key));
669
+ };
670
+
671
+ var hiddenKeys$3 = {};
672
+
673
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
674
+ var global$4 = global$c;
675
+ var isObject = isObject$5;
676
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
677
+ var hasOwn$3 = hasOwnProperty_1;
678
+ var shared = sharedStore;
679
+ var sharedKey = sharedKey$1;
680
+ var hiddenKeys$2 = hiddenKeys$3;
681
+
682
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
683
+ var TypeError$1 = global$4.TypeError;
684
+ var WeakMap = global$4.WeakMap;
685
+ var set, get, has;
686
+
687
+ var enforce = function (it) {
688
+ return has(it) ? get(it) : set(it, {});
689
+ };
690
+
691
+ var getterFor = function (TYPE) {
692
+ return function (it) {
693
+ var state;
694
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
695
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
696
+ } return state;
697
+ };
698
+ };
699
+
700
+ if (NATIVE_WEAK_MAP || shared.state) {
701
+ var store = shared.state || (shared.state = new WeakMap());
702
+ /* eslint-disable no-self-assign -- prototype methods protection */
703
+ store.get = store.get;
704
+ store.has = store.has;
705
+ store.set = store.set;
706
+ /* eslint-enable no-self-assign -- prototype methods protection */
707
+ set = function (it, metadata) {
708
+ if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
709
+ metadata.facade = it;
710
+ store.set(it, metadata);
711
+ return metadata;
712
+ };
713
+ get = function (it) {
714
+ return store.get(it) || {};
715
+ };
716
+ has = function (it) {
717
+ return store.has(it);
718
+ };
719
+ } else {
720
+ var STATE = sharedKey('state');
721
+ hiddenKeys$2[STATE] = true;
722
+ set = function (it, metadata) {
723
+ if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
724
+ metadata.facade = it;
725
+ createNonEnumerableProperty$1(it, STATE, metadata);
726
+ return metadata;
727
+ };
728
+ get = function (it) {
729
+ return hasOwn$3(it, STATE) ? it[STATE] : {};
730
+ };
731
+ has = function (it) {
732
+ return hasOwn$3(it, STATE);
733
+ };
734
+ }
735
+
736
+ var internalState = {
737
+ set: set,
738
+ get: get,
739
+ has: has,
740
+ enforce: enforce,
741
+ getterFor: getterFor
742
+ };
743
+
744
+ var fails$5 = fails$c;
745
+ var isCallable$3 = isCallable$b;
746
+ var hasOwn$2 = hasOwnProperty_1;
747
+ var DESCRIPTORS$1 = descriptors;
748
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
749
+ var inspectSource = inspectSource$1;
750
+ var InternalStateModule = internalState;
751
+
752
+ var enforceInternalState = InternalStateModule.enforce;
753
+ var getInternalState = InternalStateModule.get;
754
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
755
+ var defineProperty$1 = Object.defineProperty;
756
+
757
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$5(function () {
758
+ return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
759
+ });
760
+
761
+ var TEMPLATE = String(String).split('String');
762
+
763
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
764
+ if (String(name).slice(0, 7) === 'Symbol(') {
765
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
766
+ }
767
+ if (options && options.getter) name = 'get ' + name;
768
+ if (options && options.setter) name = 'set ' + name;
769
+ if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
770
+ if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
771
+ else value.name = name;
772
+ }
773
+ if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
774
+ defineProperty$1(value, 'length', { value: options.arity });
775
+ }
776
+ try {
777
+ if (options && hasOwn$2(options, 'constructor') && options.constructor) {
778
+ if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
779
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
780
+ } else if (value.prototype) value.prototype = undefined;
781
+ } catch (error) { /* empty */ }
782
+ var state = enforceInternalState(value);
783
+ if (!hasOwn$2(state, 'source')) {
784
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
785
+ } return value;
786
+ };
787
+
788
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
789
+ // eslint-disable-next-line no-extend-native -- required
790
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
791
+ return isCallable$3(this) && getInternalState(this).source || inspectSource(this);
792
+ }, 'toString');
793
+
794
+ var isCallable$2 = isCallable$b;
795
+ var definePropertyModule$1 = objectDefineProperty;
796
+ var makeBuiltIn = makeBuiltIn$2.exports;
797
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
798
+
799
+ var defineBuiltIn$1 = function (O, key, value, options) {
800
+ if (!options) options = {};
801
+ var simple = options.enumerable;
802
+ var name = options.name !== undefined ? options.name : key;
803
+ if (isCallable$2(value)) makeBuiltIn(value, name, options);
804
+ if (options.global) {
805
+ if (simple) O[key] = value;
806
+ else defineGlobalProperty$1(key, value);
807
+ } else {
808
+ try {
809
+ if (!options.unsafe) delete O[key];
810
+ else if (O[key]) simple = true;
811
+ } catch (error) { /* empty */ }
812
+ if (simple) O[key] = value;
813
+ else definePropertyModule$1.f(O, key, {
814
+ value: value,
815
+ enumerable: false,
816
+ configurable: !options.nonConfigurable,
817
+ writable: !options.nonWritable
818
+ });
819
+ } return O;
820
+ };
821
+
822
+ var objectGetOwnPropertyNames = {};
823
+
824
+ var ceil = Math.ceil;
825
+ var floor = Math.floor;
826
+
827
+ // `Math.trunc` method
828
+ // https://tc39.es/ecma262/#sec-math.trunc
829
+ // eslint-disable-next-line es/no-math-trunc -- safe
830
+ var mathTrunc = Math.trunc || function trunc(x) {
831
+ var n = +x;
832
+ return (n > 0 ? floor : ceil)(n);
833
+ };
834
+
835
+ var trunc = mathTrunc;
836
+
837
+ // `ToIntegerOrInfinity` abstract operation
838
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
839
+ var toIntegerOrInfinity$2 = function (argument) {
840
+ var number = +argument;
841
+ // eslint-disable-next-line no-self-compare -- NaN check
842
+ return number !== number || number === 0 ? 0 : trunc(number);
843
+ };
844
+
845
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
846
+
847
+ var max = Math.max;
848
+ var min$1 = Math.min;
849
+
850
+ // Helper for a popular repeating case of the spec:
851
+ // Let integer be ? ToInteger(index).
852
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
853
+ var toAbsoluteIndex$1 = function (index, length) {
854
+ var integer = toIntegerOrInfinity$1(index);
855
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
856
+ };
857
+
858
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
859
+
860
+ var min = Math.min;
861
+
862
+ // `ToLength` abstract operation
863
+ // https://tc39.es/ecma262/#sec-tolength
864
+ var toLength$1 = function (argument) {
865
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
866
+ };
867
+
868
+ var toLength = toLength$1;
869
+
870
+ // `LengthOfArrayLike` abstract operation
871
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
872
+ var lengthOfArrayLike$1 = function (obj) {
873
+ return toLength(obj.length);
874
+ };
875
+
876
+ var toIndexedObject$1 = toIndexedObject$3;
877
+ var toAbsoluteIndex = toAbsoluteIndex$1;
878
+ var lengthOfArrayLike = lengthOfArrayLike$1;
879
+
880
+ // `Array.prototype.{ indexOf, includes }` methods implementation
881
+ var createMethod$1 = function (IS_INCLUDES) {
882
+ return function ($this, el, fromIndex) {
883
+ var O = toIndexedObject$1($this);
884
+ var length = lengthOfArrayLike(O);
885
+ var index = toAbsoluteIndex(fromIndex, length);
886
+ var value;
887
+ // Array#includes uses SameValueZero equality algorithm
888
+ // eslint-disable-next-line no-self-compare -- NaN check
889
+ if (IS_INCLUDES && el != el) while (length > index) {
890
+ value = O[index++];
891
+ // eslint-disable-next-line no-self-compare -- NaN check
892
+ if (value != value) return true;
893
+ // Array#indexOf ignores holes, Array#includes - not
894
+ } else for (;length > index; index++) {
895
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
896
+ } return !IS_INCLUDES && -1;
897
+ };
898
+ };
899
+
900
+ var arrayIncludes = {
901
+ // `Array.prototype.includes` method
902
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
903
+ includes: createMethod$1(true),
904
+ // `Array.prototype.indexOf` method
905
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
906
+ indexOf: createMethod$1(false)
907
+ };
908
+
909
+ var uncurryThis$5 = functionUncurryThis;
910
+ var hasOwn$1 = hasOwnProperty_1;
911
+ var toIndexedObject = toIndexedObject$3;
912
+ var indexOf = arrayIncludes.indexOf;
913
+ var hiddenKeys$1 = hiddenKeys$3;
914
+
915
+ var push = uncurryThis$5([].push);
916
+
917
+ var objectKeysInternal = function (object, names) {
918
+ var O = toIndexedObject(object);
919
+ var i = 0;
920
+ var result = [];
921
+ var key;
922
+ for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push(result, key);
923
+ // Don't enum bug & hidden keys
924
+ while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
925
+ ~indexOf(result, key) || push(result, key);
926
+ }
927
+ return result;
928
+ };
929
+
930
+ // IE8- don't enum bug keys
931
+ var enumBugKeys$2 = [
932
+ 'constructor',
933
+ 'hasOwnProperty',
934
+ 'isPrototypeOf',
935
+ 'propertyIsEnumerable',
936
+ 'toLocaleString',
937
+ 'toString',
938
+ 'valueOf'
939
+ ];
940
+
941
+ var internalObjectKeys$1 = objectKeysInternal;
942
+ var enumBugKeys$1 = enumBugKeys$2;
943
+
944
+ var hiddenKeys = enumBugKeys$1.concat('length', 'prototype');
945
+
946
+ // `Object.getOwnPropertyNames` method
947
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
948
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
949
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
950
+ return internalObjectKeys$1(O, hiddenKeys);
951
+ };
952
+
953
+ var objectGetOwnPropertySymbols = {};
954
+
955
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
956
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
957
+
958
+ var getBuiltIn = getBuiltIn$3;
959
+ var uncurryThis$4 = functionUncurryThis;
960
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
961
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
962
+ var anObject = anObject$2;
963
+
964
+ var concat$1 = uncurryThis$4([].concat);
965
+
966
+ // all object keys, includes non-enumerable and symbols
967
+ var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
968
+ var keys = getOwnPropertyNamesModule.f(anObject(it));
969
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
970
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
971
+ };
972
+
973
+ var hasOwn = hasOwnProperty_1;
974
+ var ownKeys = ownKeys$1;
975
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
976
+ var definePropertyModule = objectDefineProperty;
977
+
978
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
979
+ var keys = ownKeys(source);
980
+ var defineProperty = definePropertyModule.f;
981
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
982
+ for (var i = 0; i < keys.length; i++) {
983
+ var key = keys[i];
984
+ if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
985
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
986
+ }
987
+ }
988
+ };
989
+
990
+ var fails$4 = fails$c;
991
+ var isCallable$1 = isCallable$b;
992
+
993
+ var replacement = /#|\.prototype\./;
994
+
995
+ var isForced$1 = function (feature, detection) {
996
+ var value = data[normalize(feature)];
997
+ return value == POLYFILL ? true
998
+ : value == NATIVE ? false
999
+ : isCallable$1(detection) ? fails$4(detection)
1000
+ : !!detection;
1001
+ };
1002
+
1003
+ var normalize = isForced$1.normalize = function (string) {
1004
+ return String(string).replace(replacement, '.').toLowerCase();
1005
+ };
1006
+
1007
+ var data = isForced$1.data = {};
1008
+ var NATIVE = isForced$1.NATIVE = 'N';
1009
+ var POLYFILL = isForced$1.POLYFILL = 'P';
1010
+
1011
+ var isForced_1 = isForced$1;
1012
+
1013
+ var global$3 = global$c;
1014
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1015
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
1016
+ var defineBuiltIn = defineBuiltIn$1;
1017
+ var defineGlobalProperty = defineGlobalProperty$3;
1018
+ var copyConstructorProperties = copyConstructorProperties$1;
1019
+ var isForced = isForced_1;
1020
+
1021
+ /*
1022
+ options.target - name of the target object
1023
+ options.global - target is the global object
1024
+ options.stat - export as static methods of target
1025
+ options.proto - export as prototype methods of target
1026
+ options.real - real prototype method for the `pure` version
1027
+ options.forced - export even if the native feature is available
1028
+ options.bind - bind methods to the target, required for the `pure` version
1029
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1030
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
1031
+ options.sham - add a flag to not completely full polyfills
1032
+ options.enumerable - export as enumerable property
1033
+ options.dontCallGetSet - prevent calling a getter on target
1034
+ options.name - the .name of the function if it does not match the key
1035
+ */
1036
+ var _export = function (options, source) {
1037
+ var TARGET = options.target;
1038
+ var GLOBAL = options.global;
1039
+ var STATIC = options.stat;
1040
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1041
+ if (GLOBAL) {
1042
+ target = global$3;
1043
+ } else if (STATIC) {
1044
+ target = global$3[TARGET] || defineGlobalProperty(TARGET, {});
1045
+ } else {
1046
+ target = (global$3[TARGET] || {}).prototype;
1047
+ }
1048
+ if (target) for (key in source) {
1049
+ sourceProperty = source[key];
1050
+ if (options.dontCallGetSet) {
1051
+ descriptor = getOwnPropertyDescriptor(target, key);
1052
+ targetProperty = descriptor && descriptor.value;
1053
+ } else targetProperty = target[key];
1054
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1055
+ // contained in target
1056
+ if (!FORCED && targetProperty !== undefined) {
1057
+ if (typeof sourceProperty == typeof targetProperty) continue;
1058
+ copyConstructorProperties(sourceProperty, targetProperty);
1059
+ }
1060
+ // add a flag to not completely full polyfills
1061
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1062
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
1063
+ }
1064
+ defineBuiltIn(target, key, sourceProperty, options);
1065
+ }
1066
+ };
1067
+
1068
+ var wellKnownSymbol$1 = wellKnownSymbol$3;
1069
+
1070
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1071
+ var test = {};
1072
+
1073
+ test[TO_STRING_TAG$1] = 'z';
1074
+
1075
+ var toStringTagSupport = String(test) === '[object z]';
1076
+
1077
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1078
+ var isCallable = isCallable$b;
1079
+ var classofRaw = classofRaw$2;
1080
+ var wellKnownSymbol = wellKnownSymbol$3;
1081
+
1082
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1083
+ var $Object = Object;
1084
+
1085
+ // ES3 wrong here
1086
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1087
+
1088
+ // fallback for IE11 Script Access Denied error
1089
+ var tryGet = function (it, key) {
1090
+ try {
1091
+ return it[key];
1092
+ } catch (error) { /* empty */ }
1093
+ };
1094
+
1095
+ // getting tag from ES6+ `Object.prototype.toString`
1096
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1097
+ var O, tag, result;
1098
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1099
+ // @@toStringTag case
1100
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1101
+ // builtinTag case
1102
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1103
+ // ES3 arguments fallback
1104
+ : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1105
+ };
1106
+
1107
+ var classof = classof$1;
1108
+
1109
+ var $String = String;
1110
+
1111
+ var toString$3 = function (argument) {
1112
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1113
+ return $String(argument);
1114
+ };
1115
+
1116
+ // a string of all valid unicode whitespaces
1117
+ var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1118
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1119
+
1120
+ var uncurryThis$3 = functionUncurryThis;
1121
+ var requireObjectCoercible = requireObjectCoercible$3;
1122
+ var toString$2 = toString$3;
1123
+ var whitespaces$3 = whitespaces$4;
1124
+
1125
+ var replace = uncurryThis$3(''.replace);
1126
+ var whitespace = '[' + whitespaces$3 + ']';
1127
+ var ltrim = RegExp('^' + whitespace + whitespace + '*');
1128
+ var rtrim = RegExp(whitespace + whitespace + '*$');
1129
+
1130
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1131
+ var createMethod = function (TYPE) {
1132
+ return function ($this) {
1133
+ var string = toString$2(requireObjectCoercible($this));
1134
+ if (TYPE & 1) string = replace(string, ltrim, '');
1135
+ if (TYPE & 2) string = replace(string, rtrim, '');
1136
+ return string;
1137
+ };
1138
+ };
1139
+
1140
+ var stringTrim = {
1141
+ // `String.prototype.{ trimLeft, trimStart }` methods
1142
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1143
+ start: createMethod(1),
1144
+ // `String.prototype.{ trimRight, trimEnd }` methods
1145
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
1146
+ end: createMethod(2),
1147
+ // `String.prototype.trim` method
1148
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1149
+ trim: createMethod(3)
1150
+ };
1151
+
1152
+ var global$2 = global$c;
1153
+ var fails$3 = fails$c;
1154
+ var uncurryThis$2 = functionUncurryThis;
1155
+ var toString$1 = toString$3;
1156
+ var trim$1 = stringTrim.trim;
1157
+ var whitespaces$2 = whitespaces$4;
1158
+
1159
+ var $parseInt$1 = global$2.parseInt;
1160
+ var Symbol$2 = global$2.Symbol;
1161
+ var ITERATOR$1 = Symbol$2 && Symbol$2.iterator;
1162
+ var hex = /^[+-]?0x/i;
1163
+ var exec = uncurryThis$2(hex.exec);
1164
+ var FORCED$1 = $parseInt$1(whitespaces$2 + '08') !== 8 || $parseInt$1(whitespaces$2 + '0x16') !== 22
1165
+ // MS Edge 18- broken with boxed symbols
1166
+ || (ITERATOR$1 && !fails$3(function () { $parseInt$1(Object(ITERATOR$1)); }));
1167
+
1168
+ // `parseInt` method
1169
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
1170
+ var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
1171
+ var S = trim$1(toString$1(string));
1172
+ return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
1173
+ } : $parseInt$1;
1174
+
1175
+ var $$3 = _export;
1176
+ var $parseInt = numberParseInt;
1177
+
1178
+ // `parseInt` method
1179
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
1180
+ $$3({ global: true, forced: parseInt != $parseInt }, {
1181
+ parseInt: $parseInt
1182
+ });
1183
+
1184
+ var global$1 = global$c;
1185
+ var fails$2 = fails$c;
1186
+ var uncurryThis$1 = functionUncurryThis;
1187
+ var toString = toString$3;
1188
+ var trim = stringTrim.trim;
1189
+ var whitespaces$1 = whitespaces$4;
1190
+
1191
+ var charAt = uncurryThis$1(''.charAt);
1192
+ var $parseFloat$1 = global$1.parseFloat;
1193
+ var Symbol$1 = global$1.Symbol;
1194
+ var ITERATOR = Symbol$1 && Symbol$1.iterator;
1195
+ var FORCED = 1 / $parseFloat$1(whitespaces$1 + '-0') !== -Infinity
1196
+ // MS Edge 18- broken with boxed symbols
1197
+ || (ITERATOR && !fails$2(function () { $parseFloat$1(Object(ITERATOR)); }));
1198
+
1199
+ // `parseFloat` method
1200
+ // https://tc39.es/ecma262/#sec-parsefloat-string
1201
+ var numberParseFloat = FORCED ? function parseFloat(string) {
1202
+ var trimmedString = trim(toString(string));
1203
+ var result = $parseFloat$1(trimmedString);
1204
+ return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
1205
+ } : $parseFloat$1;
1206
+
1207
+ var $$2 = _export;
1208
+ var $parseFloat = numberParseFloat;
1209
+
1210
+ // `parseFloat` method
1211
+ // https://tc39.es/ecma262/#sec-parsefloat-string
1212
+ $$2({ global: true, forced: parseFloat != $parseFloat }, {
1213
+ parseFloat: $parseFloat
1214
+ });
1215
+
1216
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
1217
+ var fails$1 = fails$c;
1218
+ var whitespaces = whitespaces$4;
1219
+
1220
+ var non = '\u200B\u0085\u180E';
1221
+
1222
+ // check that a method works with the correct list
1223
+ // of whitespaces and has a correct name
1224
+ var stringTrimForced = function (METHOD_NAME) {
1225
+ return fails$1(function () {
1226
+ return !!whitespaces[METHOD_NAME]()
1227
+ || non[METHOD_NAME]() !== non
1228
+ || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
1229
+ });
1230
+ };
1231
+
1232
+ var $$1 = _export;
1233
+ var $trim = stringTrim.trim;
1234
+ var forcedStringTrimMethod = stringTrimForced;
1235
+
1236
+ // `String.prototype.trim` method
1237
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1238
+ $$1({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1239
+ trim: function trim() {
1240
+ return $trim(this);
1241
+ }
1242
+ });
1243
+
1244
+ const getCustomFieldValueFromRawValue = (customFieldDefinition, newValue) => {
1245
+ if (customFieldDefinition.type === CustomFieldType.BOOLEAN) {
1246
+ return {
1247
+ booleanValue: newValue ? true : false,
1248
+ type: CustomFieldType.BOOLEAN
1249
+ };
1250
+ } else if (customFieldDefinition.type === CustomFieldType.DATE) {
1251
+ return {
1252
+ dateValue: getStringValue(newValue),
1253
+ type: CustomFieldType.DATE
1254
+ };
1255
+ } else if (customFieldDefinition.type === CustomFieldType.DROPDOWN) {
1256
+ const stringArrayValue = [];
1257
+
1258
+ if (Array.isArray(newValue)) {
1259
+ newValue.forEach(item => {
1260
+ if (typeof item === "string") {
1261
+ stringArrayValue.push(item);
1262
+ } else {
1263
+ stringArrayValue.push(item === null || item === void 0 ? void 0 : item.value);
1264
+ }
1265
+ });
1266
+ } else {
1267
+ if (typeof newValue === "string") {
1268
+ stringArrayValue.push(newValue);
1269
+ } else if (typeof newValue === "object") {
1270
+ stringArrayValue.push(newValue === null || newValue === void 0 ? void 0 : newValue.value);
1271
+ }
1272
+ }
1273
+
1274
+ return {
1275
+ stringArrayValue: stringArrayValue,
1276
+ type: CustomFieldType.DROPDOWN
1277
+ };
1278
+ } else if (customFieldDefinition.type === CustomFieldType.EMAIL) {
1279
+ return {
1280
+ stringValue: getStringValue(newValue),
1281
+ type: CustomFieldType.EMAIL
1282
+ };
1283
+ } else if (customFieldDefinition.type === CustomFieldType.NUMBER) {
1284
+ let value = customFieldDefinition.isInteger ? parseInt(newValue) : parseFloat(newValue);
1285
+
1286
+ if (isNaN(value)) {
1287
+ value = null;
1288
+ }
1289
+
1290
+ return {
1291
+ numberValue: value,
1292
+ type: CustomFieldType.NUMBER
1293
+ };
1294
+ } else if (customFieldDefinition.type === CustomFieldType.PHONE_NUMBER) {
1295
+ return {
1296
+ stringValue: getStringValue(newValue),
1297
+ type: CustomFieldType.PHONE_NUMBER
1298
+ };
1299
+ } else if (customFieldDefinition.type === CustomFieldType.STRING) {
1300
+ return {
1301
+ stringValue: getStringValue(newValue),
1302
+ type: CustomFieldType.STRING
1303
+ };
1304
+ } else if (customFieldDefinition.type === CustomFieldType.WEB_ADDRESS) {
1305
+ return {
1306
+ stringValue: getStringValue(newValue),
1307
+ type: CustomFieldType.WEB_ADDRESS
1308
+ };
1309
+ }
1310
+
1311
+ throw new Error("Unsupported custom field type");
1312
+ };
1313
+
1314
+ const getStringValue = value => {
1315
+ const stringValue = value;
1316
+
1317
+ if (!isNaN(new Date(stringValue).getDate())) {
1318
+ return new Date(stringValue).toISOString();
1319
+ } else if (stringValue === null || stringValue === undefined) {
1320
+ return null;
1321
+ } else if (stringValue.trim().length === 0) {
1322
+ return null;
1323
+ } else {
1324
+ return stringValue.trim();
1325
+ }
1326
+ };
1327
+
1328
+ const CustomFieldRuntime = {
1329
+ getCustomFieldsFor: entity => __awaiter(void 0, void 0, void 0, function* () {
1330
+ const api = yield getHostConnector();
1331
+ return api.getCustomFieldsFor(entity);
1332
+ }),
1333
+ setCustomFieldsFor: (entity, values) => __awaiter(void 0, void 0, void 0, function* () {
1334
+ const api = yield getHostConnector();
1335
+ return api.setCustomFieldsFor(entity, values);
1336
+ }),
1337
+ setCustomFieldsFromFormData: (entity, formData, originalDefinitions) => __awaiter(void 0, void 0, void 0, function* () {
1338
+ const api = yield getHostConnector();
1339
+ const values = [];
1340
+ Object.keys(formData).forEach(key => {
1341
+ var _a;
1342
+
1343
+ const found = (_a = originalDefinitions.find(originalDefinition => originalDefinition.definition.key === key)) === null || _a === void 0 ? void 0 : _a.definition;
1344
+
1345
+ if (found) {
1346
+ values.push({
1347
+ definitionKey: key,
1348
+ value: getCustomFieldValueFromRawValue(found, formData[key])
1349
+ });
1350
+ } else {
1351
+ throw new Error("Unsupported custom field type: " + key);
1352
+ }
1353
+ });
1354
+ return api.setCustomFieldsFor(entity, values);
1355
+ })
1356
+ };
1357
+
1358
+ const DeveloperSettingsRuntime = {
1359
+ getDeveloperSettingsContext: () => __awaiter(void 0, void 0, void 0, function* () {
1360
+ const api = yield getHostConnector();
1361
+ return api.getDeveloperSettingsContext();
1362
+ })
1363
+ };
1364
+
1365
+ const EnvironmentRuntime = {
1366
+ getEnvironmentContext: () => __awaiter(void 0, void 0, void 0, function* () {
1367
+ const api = yield getHostConnector();
1368
+ return api.getEnvironmentContext();
1369
+ })
1370
+ };
1371
+
1372
+ const NavigationRuntime = {
1373
+ setDeepLink: props => __awaiter(void 0, void 0, void 0, function* () {
1374
+ const api = yield getHostConnector();
1375
+ return api.setDeepLink(props);
1376
+ })
1377
+ };
1378
+
1379
+ const RestRuntime = {
1380
+ apiHost: "https://API_HOST",
1381
+
1382
+ request(path, method, requestParams, body, bodyType, secureByDefault) {
1383
+ return __awaiter(this, void 0, void 0, function* () {
1384
+ const api = yield getHostConnector();
1385
+ return api.requestTrackunitRestApi(path, method, requestParams, body, bodyType, secureByDefault);
1386
+ });
1387
+ }
1388
+
1389
+ };
1390
+
1391
+ var internalObjectKeys = objectKeysInternal;
1392
+ var enumBugKeys = enumBugKeys$2;
1393
+
1394
+ // `Object.keys` method
1395
+ // https://tc39.es/ecma262/#sec-object.keys
1396
+ // eslint-disable-next-line es/no-object-keys -- safe
1397
+ var objectKeys$1 = Object.keys || function keys(O) {
1398
+ return internalObjectKeys(O, enumBugKeys);
1399
+ };
1400
+
1401
+ var DESCRIPTORS = descriptors;
1402
+ var uncurryThis = functionUncurryThis;
1403
+ var call = functionCall;
1404
+ var fails = fails$c;
1405
+ var objectKeys = objectKeys$1;
1406
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1407
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1408
+ var toObject = toObject$2;
1409
+ var IndexedObject = indexedObject;
1410
+
1411
+ // eslint-disable-next-line es/no-object-assign -- safe
1412
+ var $assign = Object.assign;
1413
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1414
+ var defineProperty = Object.defineProperty;
1415
+ var concat = uncurryThis([].concat);
1416
+
1417
+ // `Object.assign` method
1418
+ // https://tc39.es/ecma262/#sec-object.assign
1419
+ var objectAssign = !$assign || fails(function () {
1420
+ // should have correct order of operations (Edge bug)
1421
+ if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
1422
+ enumerable: true,
1423
+ get: function () {
1424
+ defineProperty(this, 'b', {
1425
+ value: 3,
1426
+ enumerable: false
1427
+ });
1428
+ }
1429
+ }), { b: 2 })).b !== 1) return true;
1430
+ // should work with symbols and should have deterministic property order (V8 bug)
1431
+ var A = {};
1432
+ var B = {};
1433
+ // eslint-disable-next-line es/no-symbol -- safe
1434
+ var symbol = Symbol();
1435
+ var alphabet = 'abcdefghijklmnopqrst';
1436
+ A[symbol] = 7;
1437
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1438
+ return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
1439
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1440
+ var T = toObject(target);
1441
+ var argumentsLength = arguments.length;
1442
+ var index = 1;
1443
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1444
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1445
+ while (argumentsLength > index) {
1446
+ var S = IndexedObject(arguments[index++]);
1447
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1448
+ var length = keys.length;
1449
+ var j = 0;
1450
+ var key;
1451
+ while (length > j) {
1452
+ key = keys[j++];
1453
+ if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
1454
+ }
1455
+ } return T;
1456
+ } : $assign;
1457
+
1458
+ var $ = _export;
1459
+ var assign = objectAssign;
1460
+
1461
+ // `Object.assign` method
1462
+ // https://tc39.es/ecma262/#sec-object.assign
1463
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1464
+ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1465
+ assign: assign
1466
+ });
1467
+
1468
+ const ToastRuntime = {
1469
+ addToast(toast) {
1470
+ var _a, _b;
1471
+
1472
+ return __awaiter(this, void 0, void 0, function* () {
1473
+ const api = yield getHostConnector();
1474
+ return api.addToast(Object.assign(Object.assign({}, toast), {
1475
+ primaryAction: (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.label,
1476
+ secondaryAction: (_b = toast.secondaryAction) === null || _b === void 0 ? void 0 : _b.label
1477
+ })).then(res => {
1478
+ var _a, _b, _c, _d;
1479
+
1480
+ switch (res) {
1481
+ case "primaryAction":
1482
+ (_b = (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
1483
+ break;
1484
+
1485
+ case "secondaryAction":
1486
+ (_d = (_c = toast.secondaryAction) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.call(_c);
1487
+ break;
1488
+ }
1489
+ });
1490
+ });
1491
+ }
1492
+
1493
+ };
1494
+
1495
+ const TokenRuntime = {
1496
+ getTokenContext: () => __awaiter(void 0, void 0, void 0, function* () {
1497
+ const api = yield getHostConnector();
1498
+ return api.getTokenContext();
1499
+ })
1500
+ };
1501
+
1502
+ const UserSubscriptionRuntime = {
1503
+ getUserSubscriptionContext: () => __awaiter(void 0, void 0, void 0, function* () {
1504
+ const api = yield getHostConnector();
1505
+ return api.getUserSubscriptionContext();
1506
+ })
1507
+ };
1508
+
1509
+ export { AssetRuntime, CurrentUserRuntime, CustomFieldRuntime, DeveloperSettingsRuntime, EnvironmentRuntime, NavigationRuntime, RestRuntime, ToastRuntime, TokenRuntime, UserSubscriptionRuntime, getCustomFieldValueFromRawValue };