@dynamic-labs/react-native-extension 4.0.0-alpha.3 → 4.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs +121 -2879
  2. package/index.js +281 -0
  3. package/package.json +8 -8
package/index.cjs CHANGED
@@ -13,2909 +13,151 @@ var expoLinking = require('expo-linking');
13
13
  var expoWebBrowser = require('expo-web-browser');
14
14
  var expoSecureStore = require('expo-secure-store');
15
15
 
16
- var version$1 = "4.0.0-alpha.3";
17
-
18
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
19
-
20
- var check = function (it) {
21
- return it && it.Math == Math && it;
22
- };
23
-
24
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
25
- var global$j =
26
- // eslint-disable-next-line es/no-global-this -- safe
27
- check(typeof globalThis == 'object' && globalThis) ||
28
- check(typeof window == 'object' && window) ||
29
- // eslint-disable-next-line no-restricted-globals -- safe
30
- check(typeof self == 'object' && self) ||
31
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
32
- // eslint-disable-next-line no-new-func -- fallback
33
- (function () { return this; })() || Function('return this')();
34
-
35
- var objectGetOwnPropertyDescriptor = {};
36
-
37
- var fails$d = function (exec) {
38
- try {
39
- return !!exec();
40
- } catch (error) {
41
- return true;
42
- }
43
- };
44
-
45
- var fails$c = fails$d;
46
-
47
- // Detect IE8's incomplete defineProperty implementation
48
- var descriptors = !fails$c(function () {
49
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
50
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
51
- });
52
-
53
- var fails$b = fails$d;
54
-
55
- var functionBindNative = !fails$b(function () {
56
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
57
- var test = (function () { /* empty */ }).bind();
58
- // eslint-disable-next-line no-prototype-builtins -- safe
59
- return typeof test != 'function' || test.hasOwnProperty('prototype');
60
- });
61
-
62
- var NATIVE_BIND$3 = functionBindNative;
63
-
64
- var call$e = Function.prototype.call;
65
-
66
- var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
67
- return call$e.apply(call$e, arguments);
68
- };
69
-
70
- var objectPropertyIsEnumerable = {};
71
-
72
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
73
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
74
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
75
-
76
- // Nashorn ~ JDK8 bug
77
- var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
78
-
79
- // `Object.prototype.propertyIsEnumerable` method implementation
80
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
81
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
82
- var descriptor = getOwnPropertyDescriptor$2(this, V);
83
- return !!descriptor && descriptor.enumerable;
84
- } : $propertyIsEnumerable;
85
-
86
- var createPropertyDescriptor$4 = function (bitmap, value) {
87
- return {
88
- enumerable: !(bitmap & 1),
89
- configurable: !(bitmap & 2),
90
- writable: !(bitmap & 4),
91
- value: value
92
- };
93
- };
94
-
95
- var NATIVE_BIND$2 = functionBindNative;
96
-
97
- var FunctionPrototype$2 = Function.prototype;
98
- var call$d = FunctionPrototype$2.call;
99
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$d, call$d);
100
-
101
- var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
102
- return function () {
103
- return call$d.apply(fn, arguments);
104
- };
105
- };
106
-
107
- var uncurryThis$d = functionUncurryThis;
108
-
109
- var toString$1 = uncurryThis$d({}.toString);
110
- var stringSlice = uncurryThis$d(''.slice);
111
-
112
- var classofRaw$2 = function (it) {
113
- return stringSlice(toString$1(it), 8, -1);
114
- };
115
-
116
- var uncurryThis$c = functionUncurryThis;
117
- var fails$a = fails$d;
118
- var classof$4 = classofRaw$2;
119
-
120
- var $Object$4 = Object;
121
- var split = uncurryThis$c(''.split);
122
-
123
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
124
- var indexedObject = fails$a(function () {
125
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
126
- // eslint-disable-next-line no-prototype-builtins -- safe
127
- return !$Object$4('z').propertyIsEnumerable(0);
128
- }) ? function (it) {
129
- return classof$4(it) == 'String' ? split(it, '') : $Object$4(it);
130
- } : $Object$4;
131
-
132
- // we can't use just `it == null` since of `document.all` special case
133
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
134
- var isNullOrUndefined$4 = function (it) {
135
- return it === null || it === undefined;
136
- };
137
-
138
- var isNullOrUndefined$3 = isNullOrUndefined$4;
139
-
140
- var $TypeError$c = TypeError;
141
-
142
- // `RequireObjectCoercible` abstract operation
143
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
144
- var requireObjectCoercible$2 = function (it) {
145
- if (isNullOrUndefined$3(it)) throw $TypeError$c("Can't call method on " + it);
146
- return it;
147
- };
148
-
149
- // toObject with fallback for non-array-like ES3 strings
150
- var IndexedObject$1 = indexedObject;
151
- var requireObjectCoercible$1 = requireObjectCoercible$2;
152
-
153
- var toIndexedObject$5 = function (it) {
154
- return IndexedObject$1(requireObjectCoercible$1(it));
155
- };
156
-
157
- var documentAll$2 = typeof document == 'object' && document.all;
158
-
159
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
160
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
161
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
162
-
163
- var documentAll_1 = {
164
- all: documentAll$2,
165
- IS_HTMLDDA: IS_HTMLDDA
166
- };
167
-
168
- var $documentAll$1 = documentAll_1;
169
-
170
- var documentAll$1 = $documentAll$1.all;
171
-
172
- // `IsCallable` abstract operation
173
- // https://tc39.es/ecma262/#sec-iscallable
174
- var isCallable$k = $documentAll$1.IS_HTMLDDA ? function (argument) {
175
- return typeof argument == 'function' || argument === documentAll$1;
176
- } : function (argument) {
177
- return typeof argument == 'function';
178
- };
179
-
180
- var isCallable$j = isCallable$k;
181
- var $documentAll = documentAll_1;
182
-
183
- var documentAll = $documentAll.all;
184
-
185
- var isObject$8 = $documentAll.IS_HTMLDDA ? function (it) {
186
- return typeof it == 'object' ? it !== null : isCallable$j(it) || it === documentAll;
187
- } : function (it) {
188
- return typeof it == 'object' ? it !== null : isCallable$j(it);
189
- };
190
-
191
- var global$i = global$j;
192
- var isCallable$i = isCallable$k;
193
-
194
- var aFunction = function (argument) {
195
- return isCallable$i(argument) ? argument : undefined;
196
- };
197
-
198
- var getBuiltIn$8 = function (namespace, method) {
199
- return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
200
- };
201
-
202
- var uncurryThis$b = functionUncurryThis;
203
-
204
- var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
205
-
206
- var getBuiltIn$7 = getBuiltIn$8;
207
-
208
- var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || '';
209
-
210
- var global$h = global$j;
211
- var userAgent$3 = engineUserAgent;
212
-
213
- var process$3 = global$h.process;
214
- var Deno$1 = global$h.Deno;
215
- var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
216
- var v8 = versions && versions.v8;
217
- var match, version;
218
-
219
- if (v8) {
220
- match = v8.split('.');
221
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
222
- // but their correct versions are not interesting for us
223
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
224
- }
225
-
226
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
227
- // so check `userAgent` even if `.v8` exists, but 0
228
- if (!version && userAgent$3) {
229
- match = userAgent$3.match(/Edge\/(\d+)/);
230
- if (!match || match[1] >= 74) {
231
- match = userAgent$3.match(/Chrome\/(\d+)/);
232
- if (match) version = +match[1];
233
- }
234
- }
235
-
236
- var engineV8Version = version;
237
-
238
- /* eslint-disable es/no-symbol -- required for testing */
239
-
240
- var V8_VERSION$1 = engineV8Version;
241
- var fails$9 = fails$d;
242
-
243
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
244
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$9(function () {
245
- var symbol = Symbol();
246
- // Chrome 38 Symbol has incorrect toString conversion
247
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
248
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
249
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
250
- !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
251
- });
252
-
253
- /* eslint-disable es/no-symbol -- required for testing */
254
-
255
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
256
-
257
- var useSymbolAsUid = NATIVE_SYMBOL$1
258
- && !Symbol.sham
259
- && typeof Symbol.iterator == 'symbol';
260
-
261
- var getBuiltIn$6 = getBuiltIn$8;
262
- var isCallable$h = isCallable$k;
263
- var isPrototypeOf$2 = objectIsPrototypeOf;
264
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
265
-
266
- var $Object$3 = Object;
267
-
268
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
269
- return typeof it == 'symbol';
270
- } : function (it) {
271
- var $Symbol = getBuiltIn$6('Symbol');
272
- return isCallable$h($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$3(it));
273
- };
274
-
275
- var $String$2 = String;
276
-
277
- var tryToString$4 = function (argument) {
278
- try {
279
- return $String$2(argument);
280
- } catch (error) {
281
- return 'Object';
282
- }
283
- };
284
-
285
- var isCallable$g = isCallable$k;
286
- var tryToString$3 = tryToString$4;
287
-
288
- var $TypeError$b = TypeError;
289
-
290
- // `Assert: IsCallable(argument) is true`
291
- var aCallable$7 = function (argument) {
292
- if (isCallable$g(argument)) return argument;
293
- throw $TypeError$b(tryToString$3(argument) + ' is not a function');
294
- };
295
-
296
- var aCallable$6 = aCallable$7;
297
- var isNullOrUndefined$2 = isNullOrUndefined$4;
298
-
299
- // `GetMethod` abstract operation
300
- // https://tc39.es/ecma262/#sec-getmethod
301
- var getMethod$3 = function (V, P) {
302
- var func = V[P];
303
- return isNullOrUndefined$2(func) ? undefined : aCallable$6(func);
304
- };
305
-
306
- var call$c = functionCall;
307
- var isCallable$f = isCallable$k;
308
- var isObject$7 = isObject$8;
309
-
310
- var $TypeError$a = TypeError;
311
-
312
- // `OrdinaryToPrimitive` abstract operation
313
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
314
- var ordinaryToPrimitive$1 = function (input, pref) {
315
- var fn, val;
316
- if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
317
- if (isCallable$f(fn = input.valueOf) && !isObject$7(val = call$c(fn, input))) return val;
318
- if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
319
- throw $TypeError$a("Can't convert object to primitive value");
320
- };
321
-
322
- var shared$3 = {exports: {}};
323
-
324
- var global$g = global$j;
325
-
326
- // eslint-disable-next-line es/no-object-defineproperty -- safe
327
- var defineProperty$5 = Object.defineProperty;
328
-
329
- var defineGlobalProperty$3 = function (key, value) {
330
- try {
331
- defineProperty$5(global$g, key, { value: value, configurable: true, writable: true });
332
- } catch (error) {
333
- global$g[key] = value;
334
- } return value;
335
- };
336
-
337
- var global$f = global$j;
338
- var defineGlobalProperty$2 = defineGlobalProperty$3;
339
-
340
- var SHARED = '__core-js_shared__';
341
- var store$3 = global$f[SHARED] || defineGlobalProperty$2(SHARED, {});
342
-
343
- var sharedStore = store$3;
344
-
345
- var store$2 = sharedStore;
346
-
347
- (shared$3.exports = function (key, value) {
348
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
349
- })('versions', []).push({
350
- version: '3.27.0',
351
- mode: 'global',
352
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
353
- license: 'https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE',
354
- source: 'https://github.com/zloirock/core-js'
355
- });
356
-
357
- var requireObjectCoercible = requireObjectCoercible$2;
358
-
359
- var $Object$2 = Object;
360
-
361
- // `ToObject` abstract operation
362
- // https://tc39.es/ecma262/#sec-toobject
363
- var toObject$3 = function (argument) {
364
- return $Object$2(requireObjectCoercible(argument));
365
- };
366
-
367
- var uncurryThis$a = functionUncurryThis;
368
- var toObject$2 = toObject$3;
369
-
370
- var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
371
-
372
- // `HasOwnProperty` abstract operation
373
- // https://tc39.es/ecma262/#sec-hasownproperty
374
- // eslint-disable-next-line es/no-object-hasown -- safe
375
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
376
- return hasOwnProperty(toObject$2(it), key);
377
- };
378
-
379
- var uncurryThis$9 = functionUncurryThis;
380
-
381
- var id = 0;
382
- var postfix = Math.random();
383
- var toString = uncurryThis$9(1.0.toString);
384
-
385
- var uid$2 = function (key) {
386
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
387
- };
388
-
389
- var global$e = global$j;
390
- var shared$2 = shared$3.exports;
391
- var hasOwn$9 = hasOwnProperty_1;
392
- var uid$1 = uid$2;
393
- var NATIVE_SYMBOL = symbolConstructorDetection;
394
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
395
-
396
- var WellKnownSymbolsStore = shared$2('wks');
397
- var Symbol$1 = global$e.Symbol;
398
- var symbolFor = Symbol$1 && Symbol$1['for'];
399
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
400
-
401
- var wellKnownSymbol$e = function (name) {
402
- if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
403
- var description = 'Symbol.' + name;
404
- if (NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)) {
405
- WellKnownSymbolsStore[name] = Symbol$1[name];
406
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
407
- WellKnownSymbolsStore[name] = symbolFor(description);
408
- } else {
409
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
410
- }
411
- } return WellKnownSymbolsStore[name];
412
- };
413
-
414
- var call$b = functionCall;
415
- var isObject$6 = isObject$8;
416
- var isSymbol$1 = isSymbol$2;
417
- var getMethod$2 = getMethod$3;
418
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
419
- var wellKnownSymbol$d = wellKnownSymbol$e;
420
-
421
- var $TypeError$9 = TypeError;
422
- var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
423
-
424
- // `ToPrimitive` abstract operation
425
- // https://tc39.es/ecma262/#sec-toprimitive
426
- var toPrimitive$1 = function (input, pref) {
427
- if (!isObject$6(input) || isSymbol$1(input)) return input;
428
- var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
429
- var result;
430
- if (exoticToPrim) {
431
- if (pref === undefined) pref = 'default';
432
- result = call$b(exoticToPrim, input, pref);
433
- if (!isObject$6(result) || isSymbol$1(result)) return result;
434
- throw $TypeError$9("Can't convert object to primitive value");
435
- }
436
- if (pref === undefined) pref = 'number';
437
- return ordinaryToPrimitive(input, pref);
438
- };
439
-
440
- var toPrimitive = toPrimitive$1;
441
- var isSymbol = isSymbol$2;
442
-
443
- // `ToPropertyKey` abstract operation
444
- // https://tc39.es/ecma262/#sec-topropertykey
445
- var toPropertyKey$3 = function (argument) {
446
- var key = toPrimitive(argument, 'string');
447
- return isSymbol(key) ? key : key + '';
448
- };
449
-
450
- var global$d = global$j;
451
- var isObject$5 = isObject$8;
452
-
453
- var document$3 = global$d.document;
454
- // typeof document.createElement is 'object' in old IE
455
- var EXISTS$1 = isObject$5(document$3) && isObject$5(document$3.createElement);
456
-
457
- var documentCreateElement$2 = function (it) {
458
- return EXISTS$1 ? document$3.createElement(it) : {};
459
- };
460
-
461
- var DESCRIPTORS$a = descriptors;
462
- var fails$8 = fails$d;
463
- var createElement$1 = documentCreateElement$2;
464
-
465
- // Thanks to IE8 for its funny defineProperty
466
- var ie8DomDefine = !DESCRIPTORS$a && !fails$8(function () {
467
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
468
- return Object.defineProperty(createElement$1('div'), 'a', {
469
- get: function () { return 7; }
470
- }).a != 7;
471
- });
472
-
473
- var DESCRIPTORS$9 = descriptors;
474
- var call$a = functionCall;
475
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
476
- var createPropertyDescriptor$3 = createPropertyDescriptor$4;
477
- var toIndexedObject$4 = toIndexedObject$5;
478
- var toPropertyKey$2 = toPropertyKey$3;
479
- var hasOwn$8 = hasOwnProperty_1;
480
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
481
-
482
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
483
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
484
-
485
- // `Object.getOwnPropertyDescriptor` method
486
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
487
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
488
- O = toIndexedObject$4(O);
489
- P = toPropertyKey$2(P);
490
- if (IE8_DOM_DEFINE$1) try {
491
- return $getOwnPropertyDescriptor$1(O, P);
492
- } catch (error) { /* empty */ }
493
- if (hasOwn$8(O, P)) return createPropertyDescriptor$3(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
494
- };
495
-
496
- var objectDefineProperty = {};
497
-
498
- var DESCRIPTORS$8 = descriptors;
499
- var fails$7 = fails$d;
500
-
501
- // V8 ~ Chrome 36-
502
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
503
- var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$7(function () {
504
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
505
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
506
- value: 42,
507
- writable: false
508
- }).prototype != 42;
509
- });
510
-
511
- var isObject$4 = isObject$8;
512
-
513
- var $String$1 = String;
514
- var $TypeError$8 = TypeError;
515
-
516
- // `Assert: Type(argument) is Object`
517
- var anObject$a = function (argument) {
518
- if (isObject$4(argument)) return argument;
519
- throw $TypeError$8($String$1(argument) + ' is not an object');
520
- };
521
-
522
- var DESCRIPTORS$7 = descriptors;
523
- var IE8_DOM_DEFINE = ie8DomDefine;
524
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
525
- var anObject$9 = anObject$a;
526
- var toPropertyKey$1 = toPropertyKey$3;
527
-
528
- var $TypeError$7 = TypeError;
529
- // eslint-disable-next-line es/no-object-defineproperty -- safe
530
- var $defineProperty = Object.defineProperty;
531
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
532
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
533
- var ENUMERABLE = 'enumerable';
534
- var CONFIGURABLE$1 = 'configurable';
535
- var WRITABLE = 'writable';
536
-
537
- // `Object.defineProperty` method
538
- // https://tc39.es/ecma262/#sec-object.defineproperty
539
- objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
540
- anObject$9(O);
541
- P = toPropertyKey$1(P);
542
- anObject$9(Attributes);
543
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
544
- var current = $getOwnPropertyDescriptor(O, P);
545
- if (current && current[WRITABLE]) {
546
- O[P] = Attributes.value;
547
- Attributes = {
548
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
549
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
550
- writable: false
551
- };
552
- }
553
- } return $defineProperty(O, P, Attributes);
554
- } : $defineProperty : function defineProperty(O, P, Attributes) {
555
- anObject$9(O);
556
- P = toPropertyKey$1(P);
557
- anObject$9(Attributes);
558
- if (IE8_DOM_DEFINE) try {
559
- return $defineProperty(O, P, Attributes);
560
- } catch (error) { /* empty */ }
561
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$7('Accessors not supported');
562
- if ('value' in Attributes) O[P] = Attributes.value;
563
- return O;
564
- };
565
-
566
- var DESCRIPTORS$6 = descriptors;
567
- var definePropertyModule$5 = objectDefineProperty;
568
- var createPropertyDescriptor$2 = createPropertyDescriptor$4;
569
-
570
- var createNonEnumerableProperty$4 = DESCRIPTORS$6 ? function (object, key, value) {
571
- return definePropertyModule$5.f(object, key, createPropertyDescriptor$2(1, value));
572
- } : function (object, key, value) {
573
- object[key] = value;
574
- return object;
575
- };
576
-
577
- var makeBuiltIn$2 = {exports: {}};
578
-
579
- var DESCRIPTORS$5 = descriptors;
580
- var hasOwn$7 = hasOwnProperty_1;
581
-
582
- var FunctionPrototype$1 = Function.prototype;
583
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
584
- var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
585
-
586
- var EXISTS = hasOwn$7(FunctionPrototype$1, 'name');
587
- // additional protection from minified / mangled / dropped function names
588
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
589
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype$1, 'name').configurable));
590
-
591
- var functionName = {
592
- EXISTS: EXISTS,
593
- PROPER: PROPER,
594
- CONFIGURABLE: CONFIGURABLE
595
- };
596
-
597
- var uncurryThis$8 = functionUncurryThis;
598
- var isCallable$e = isCallable$k;
599
- var store$1 = sharedStore;
600
-
601
- var functionToString = uncurryThis$8(Function.toString);
602
-
603
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
604
- if (!isCallable$e(store$1.inspectSource)) {
605
- store$1.inspectSource = function (it) {
606
- return functionToString(it);
607
- };
608
- }
609
-
610
- var inspectSource$3 = store$1.inspectSource;
611
-
612
- var global$c = global$j;
613
- var isCallable$d = isCallable$k;
614
-
615
- var WeakMap$1 = global$c.WeakMap;
616
-
617
- var weakMapBasicDetection = isCallable$d(WeakMap$1) && /native code/.test(String(WeakMap$1));
618
-
619
- var shared$1 = shared$3.exports;
620
- var uid = uid$2;
621
-
622
- var keys = shared$1('keys');
623
-
624
- var sharedKey$3 = function (key) {
625
- return keys[key] || (keys[key] = uid(key));
626
- };
627
-
628
- var hiddenKeys$4 = {};
629
-
630
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
631
- var global$b = global$j;
632
- var isObject$3 = isObject$8;
633
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
634
- var hasOwn$6 = hasOwnProperty_1;
635
- var shared = sharedStore;
636
- var sharedKey$2 = sharedKey$3;
637
- var hiddenKeys$3 = hiddenKeys$4;
638
-
639
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
640
- var TypeError$2 = global$b.TypeError;
641
- var WeakMap = global$b.WeakMap;
642
- var set$1, get, has;
643
-
644
- var enforce = function (it) {
645
- return has(it) ? get(it) : set$1(it, {});
646
- };
647
-
648
- var getterFor = function (TYPE) {
649
- return function (it) {
650
- var state;
651
- if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
652
- throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
653
- } return state;
654
- };
655
- };
656
-
657
- if (NATIVE_WEAK_MAP || shared.state) {
658
- var store = shared.state || (shared.state = new WeakMap());
659
- /* eslint-disable no-self-assign -- prototype methods protection */
660
- store.get = store.get;
661
- store.has = store.has;
662
- store.set = store.set;
663
- /* eslint-enable no-self-assign -- prototype methods protection */
664
- set$1 = function (it, metadata) {
665
- if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
666
- metadata.facade = it;
667
- store.set(it, metadata);
668
- return metadata;
669
- };
670
- get = function (it) {
671
- return store.get(it) || {};
672
- };
673
- has = function (it) {
674
- return store.has(it);
675
- };
676
- } else {
677
- var STATE = sharedKey$2('state');
678
- hiddenKeys$3[STATE] = true;
679
- set$1 = function (it, metadata) {
680
- if (hasOwn$6(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
681
- metadata.facade = it;
682
- createNonEnumerableProperty$3(it, STATE, metadata);
683
- return metadata;
684
- };
685
- get = function (it) {
686
- return hasOwn$6(it, STATE) ? it[STATE] : {};
687
- };
688
- has = function (it) {
689
- return hasOwn$6(it, STATE);
690
- };
691
- }
692
-
693
- var internalState = {
694
- set: set$1,
695
- get: get,
696
- has: has,
697
- enforce: enforce,
698
- getterFor: getterFor
699
- };
700
-
701
- var fails$6 = fails$d;
702
- var isCallable$c = isCallable$k;
703
- var hasOwn$5 = hasOwnProperty_1;
704
- var DESCRIPTORS$4 = descriptors;
705
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
706
- var inspectSource$2 = inspectSource$3;
707
- var InternalStateModule$2 = internalState;
708
-
709
- var enforceInternalState = InternalStateModule$2.enforce;
710
- var getInternalState$1 = InternalStateModule$2.get;
711
- // eslint-disable-next-line es/no-object-defineproperty -- safe
712
- var defineProperty$4 = Object.defineProperty;
713
-
714
- var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$6(function () {
715
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
716
- });
717
-
718
- var TEMPLATE = String(String).split('String');
719
-
720
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
721
- if (String(name).slice(0, 7) === 'Symbol(') {
722
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
723
- }
724
- if (options && options.getter) name = 'get ' + name;
725
- if (options && options.setter) name = 'set ' + name;
726
- if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
727
- if (DESCRIPTORS$4) defineProperty$4(value, 'name', { value: name, configurable: true });
728
- else value.name = name;
729
- }
730
- if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
731
- defineProperty$4(value, 'length', { value: options.arity });
732
- }
733
- try {
734
- if (options && hasOwn$5(options, 'constructor') && options.constructor) {
735
- if (DESCRIPTORS$4) defineProperty$4(value, 'prototype', { writable: false });
736
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
737
- } else if (value.prototype) value.prototype = undefined;
738
- } catch (error) { /* empty */ }
739
- var state = enforceInternalState(value);
740
- if (!hasOwn$5(state, 'source')) {
741
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
742
- } return value;
743
- };
744
-
745
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
746
- // eslint-disable-next-line no-extend-native -- required
747
- Function.prototype.toString = makeBuiltIn$1(function toString() {
748
- return isCallable$c(this) && getInternalState$1(this).source || inspectSource$2(this);
749
- }, 'toString');
750
-
751
- var isCallable$b = isCallable$k;
752
- var definePropertyModule$4 = objectDefineProperty;
753
- var makeBuiltIn = makeBuiltIn$2.exports;
754
- var defineGlobalProperty$1 = defineGlobalProperty$3;
755
-
756
- var defineBuiltIn$5 = function (O, key, value, options) {
757
- if (!options) options = {};
758
- var simple = options.enumerable;
759
- var name = options.name !== undefined ? options.name : key;
760
- if (isCallable$b(value)) makeBuiltIn(value, name, options);
761
- if (options.global) {
762
- if (simple) O[key] = value;
763
- else defineGlobalProperty$1(key, value);
764
- } else {
765
- try {
766
- if (!options.unsafe) delete O[key];
767
- else if (O[key]) simple = true;
768
- } catch (error) { /* empty */ }
769
- if (simple) O[key] = value;
770
- else definePropertyModule$4.f(O, key, {
771
- value: value,
772
- enumerable: false,
773
- configurable: !options.nonConfigurable,
774
- writable: !options.nonWritable
775
- });
776
- } return O;
777
- };
778
-
779
- var objectGetOwnPropertyNames = {};
780
-
781
- var ceil = Math.ceil;
782
- var floor = Math.floor;
783
-
784
- // `Math.trunc` method
785
- // https://tc39.es/ecma262/#sec-math.trunc
786
- // eslint-disable-next-line es/no-math-trunc -- safe
787
- var mathTrunc = Math.trunc || function trunc(x) {
788
- var n = +x;
789
- return (n > 0 ? floor : ceil)(n);
790
- };
791
-
792
- var trunc = mathTrunc;
793
-
794
- // `ToIntegerOrInfinity` abstract operation
795
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
796
- var toIntegerOrInfinity$2 = function (argument) {
797
- var number = +argument;
798
- // eslint-disable-next-line no-self-compare -- NaN check
799
- return number !== number || number === 0 ? 0 : trunc(number);
800
- };
801
-
802
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
803
-
804
- var max = Math.max;
805
- var min$1 = Math.min;
806
-
807
- // Helper for a popular repeating case of the spec:
808
- // Let integer be ? ToInteger(index).
809
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
810
- var toAbsoluteIndex$1 = function (index, length) {
811
- var integer = toIntegerOrInfinity$1(index);
812
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
813
- };
814
-
815
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
816
-
817
- var min = Math.min;
818
-
819
- // `ToLength` abstract operation
820
- // https://tc39.es/ecma262/#sec-tolength
821
- var toLength$1 = function (argument) {
822
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
823
- };
824
-
825
- var toLength = toLength$1;
826
-
827
- // `LengthOfArrayLike` abstract operation
828
- // https://tc39.es/ecma262/#sec-lengthofarraylike
829
- var lengthOfArrayLike$2 = function (obj) {
830
- return toLength(obj.length);
831
- };
832
-
833
- var toIndexedObject$3 = toIndexedObject$5;
834
- var toAbsoluteIndex = toAbsoluteIndex$1;
835
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
836
-
837
- // `Array.prototype.{ indexOf, includes }` methods implementation
838
- var createMethod = function (IS_INCLUDES) {
839
- return function ($this, el, fromIndex) {
840
- var O = toIndexedObject$3($this);
841
- var length = lengthOfArrayLike$1(O);
842
- var index = toAbsoluteIndex(fromIndex, length);
843
- var value;
844
- // Array#includes uses SameValueZero equality algorithm
845
- // eslint-disable-next-line no-self-compare -- NaN check
846
- if (IS_INCLUDES && el != el) while (length > index) {
847
- value = O[index++];
848
- // eslint-disable-next-line no-self-compare -- NaN check
849
- if (value != value) return true;
850
- // Array#indexOf ignores holes, Array#includes - not
851
- } else for (;length > index; index++) {
852
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
853
- } return !IS_INCLUDES && -1;
854
- };
855
- };
856
-
857
- var arrayIncludes = {
858
- // `Array.prototype.includes` method
859
- // https://tc39.es/ecma262/#sec-array.prototype.includes
860
- includes: createMethod(true),
861
- // `Array.prototype.indexOf` method
862
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
863
- indexOf: createMethod(false)
864
- };
865
-
866
- var uncurryThis$7 = functionUncurryThis;
867
- var hasOwn$4 = hasOwnProperty_1;
868
- var toIndexedObject$2 = toIndexedObject$5;
869
- var indexOf = arrayIncludes.indexOf;
870
- var hiddenKeys$2 = hiddenKeys$4;
871
-
872
- var push = uncurryThis$7([].push);
873
-
874
- var objectKeysInternal = function (object, names) {
875
- var O = toIndexedObject$2(object);
876
- var i = 0;
877
- var result = [];
878
- var key;
879
- for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
880
- // Don't enum bug & hidden keys
881
- while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
882
- ~indexOf(result, key) || push(result, key);
883
- }
884
- return result;
885
- };
886
-
887
- // IE8- don't enum bug keys
888
- var enumBugKeys$3 = [
889
- 'constructor',
890
- 'hasOwnProperty',
891
- 'isPrototypeOf',
892
- 'propertyIsEnumerable',
893
- 'toLocaleString',
894
- 'toString',
895
- 'valueOf'
896
- ];
897
-
898
- var internalObjectKeys$1 = objectKeysInternal;
899
- var enumBugKeys$2 = enumBugKeys$3;
900
-
901
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
902
-
903
- // `Object.getOwnPropertyNames` method
904
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
905
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
906
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
907
- return internalObjectKeys$1(O, hiddenKeys$1);
908
- };
909
-
910
- var objectGetOwnPropertySymbols = {};
911
-
912
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
913
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
914
-
915
- var getBuiltIn$5 = getBuiltIn$8;
916
- var uncurryThis$6 = functionUncurryThis;
917
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
918
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
919
- var anObject$8 = anObject$a;
920
-
921
- var concat$1 = uncurryThis$6([].concat);
922
-
923
- // all object keys, includes non-enumerable and symbols
924
- var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
925
- var keys = getOwnPropertyNamesModule.f(anObject$8(it));
926
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
927
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
928
- };
929
-
930
- var hasOwn$3 = hasOwnProperty_1;
931
- var ownKeys = ownKeys$1;
932
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
933
- var definePropertyModule$3 = objectDefineProperty;
934
-
935
- var copyConstructorProperties$1 = function (target, source, exceptions) {
936
- var keys = ownKeys(source);
937
- var defineProperty = definePropertyModule$3.f;
938
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
939
- for (var i = 0; i < keys.length; i++) {
940
- var key = keys[i];
941
- if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
942
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
943
- }
944
- }
945
- };
946
-
947
- var fails$5 = fails$d;
948
- var isCallable$a = isCallable$k;
949
-
950
- var replacement = /#|\.prototype\./;
951
-
952
- var isForced$2 = function (feature, detection) {
953
- var value = data[normalize(feature)];
954
- return value == POLYFILL ? true
955
- : value == NATIVE ? false
956
- : isCallable$a(detection) ? fails$5(detection)
957
- : !!detection;
958
- };
959
-
960
- var normalize = isForced$2.normalize = function (string) {
961
- return String(string).replace(replacement, '.').toLowerCase();
962
- };
963
-
964
- var data = isForced$2.data = {};
965
- var NATIVE = isForced$2.NATIVE = 'N';
966
- var POLYFILL = isForced$2.POLYFILL = 'P';
967
-
968
- var isForced_1 = isForced$2;
969
-
970
- var global$a = global$j;
971
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
972
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
973
- var defineBuiltIn$4 = defineBuiltIn$5;
974
- var defineGlobalProperty = defineGlobalProperty$3;
975
- var copyConstructorProperties = copyConstructorProperties$1;
976
- var isForced$1 = isForced_1;
977
-
978
- /*
979
- options.target - name of the target object
980
- options.global - target is the global object
981
- options.stat - export as static methods of target
982
- options.proto - export as prototype methods of target
983
- options.real - real prototype method for the `pure` version
984
- options.forced - export even if the native feature is available
985
- options.bind - bind methods to the target, required for the `pure` version
986
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
987
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
988
- options.sham - add a flag to not completely full polyfills
989
- options.enumerable - export as enumerable property
990
- options.dontCallGetSet - prevent calling a getter on target
991
- options.name - the .name of the function if it does not match the key
992
- */
993
- var _export = function (options, source) {
994
- var TARGET = options.target;
995
- var GLOBAL = options.global;
996
- var STATIC = options.stat;
997
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
998
- if (GLOBAL) {
999
- target = global$a;
1000
- } else if (STATIC) {
1001
- target = global$a[TARGET] || defineGlobalProperty(TARGET, {});
1002
- } else {
1003
- target = (global$a[TARGET] || {}).prototype;
1004
- }
1005
- if (target) for (key in source) {
1006
- sourceProperty = source[key];
1007
- if (options.dontCallGetSet) {
1008
- descriptor = getOwnPropertyDescriptor$1(target, key);
1009
- targetProperty = descriptor && descriptor.value;
1010
- } else targetProperty = target[key];
1011
- FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1012
- // contained in target
1013
- if (!FORCED && targetProperty !== undefined) {
1014
- if (typeof sourceProperty == typeof targetProperty) continue;
1015
- copyConstructorProperties(sourceProperty, targetProperty);
1016
- }
1017
- // add a flag to not completely full polyfills
1018
- if (options.sham || (targetProperty && targetProperty.sham)) {
1019
- createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1020
- }
1021
- defineBuiltIn$4(target, key, sourceProperty, options);
1022
- }
1023
- };
1024
-
1025
- var internalObjectKeys = objectKeysInternal;
1026
- var enumBugKeys$1 = enumBugKeys$3;
1027
-
1028
- // `Object.keys` method
1029
- // https://tc39.es/ecma262/#sec-object.keys
1030
- // eslint-disable-next-line es/no-object-keys -- safe
1031
- var objectKeys$2 = Object.keys || function keys(O) {
1032
- return internalObjectKeys(O, enumBugKeys$1);
1033
- };
1034
-
1035
- var DESCRIPTORS$3 = descriptors;
1036
- var uncurryThis$5 = functionUncurryThis;
1037
- var call$9 = functionCall;
1038
- var fails$4 = fails$d;
1039
- var objectKeys$1 = objectKeys$2;
1040
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1041
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1042
- var toObject$1 = toObject$3;
1043
- var IndexedObject = indexedObject;
1044
-
1045
- // eslint-disable-next-line es/no-object-assign -- safe
1046
- var $assign = Object.assign;
1047
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1048
- var defineProperty$3 = Object.defineProperty;
1049
- var concat = uncurryThis$5([].concat);
1050
-
1051
- // `Object.assign` method
1052
- // https://tc39.es/ecma262/#sec-object.assign
1053
- var objectAssign = !$assign || fails$4(function () {
1054
- // should have correct order of operations (Edge bug)
1055
- if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1056
- enumerable: true,
1057
- get: function () {
1058
- defineProperty$3(this, 'b', {
1059
- value: 3,
1060
- enumerable: false
1061
- });
1062
- }
1063
- }), { b: 2 })).b !== 1) return true;
1064
- // should work with symbols and should have deterministic property order (V8 bug)
1065
- var A = {};
1066
- var B = {};
1067
- // eslint-disable-next-line es/no-symbol -- safe
1068
- var symbol = Symbol();
1069
- var alphabet = 'abcdefghijklmnopqrst';
1070
- A[symbol] = 7;
1071
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1072
- return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1073
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1074
- var T = toObject$1(target);
1075
- var argumentsLength = arguments.length;
1076
- var index = 1;
1077
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1078
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1079
- while (argumentsLength > index) {
1080
- var S = IndexedObject(arguments[index++]);
1081
- var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1082
- var length = keys.length;
1083
- var j = 0;
1084
- var key;
1085
- while (length > j) {
1086
- key = keys[j++];
1087
- if (!DESCRIPTORS$3 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
1088
- }
1089
- } return T;
1090
- } : $assign;
1091
-
1092
- var $$8 = _export;
1093
- var assign = objectAssign;
1094
-
1095
- // `Object.assign` method
1096
- // https://tc39.es/ecma262/#sec-object.assign
1097
- // eslint-disable-next-line es/no-object-assign -- required for testing
1098
- $$8({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1099
- assign: assign
1100
- });
1101
-
1102
- const logger = new logger$1.Logger('react-native-extension');
1103
-
1104
- const useIsMounted = () => {
1105
- const isMountedRef = react.useRef(true);
1106
- react.useEffect(() => () => {
1107
- isMountedRef.current = false;
1108
- }, []);
1109
- return react.useCallback(() => isMountedRef.current, [isMountedRef]);
1110
- };
1111
-
1112
- const useMessageTransportWebViewBridge = (core, webViewRef) => {
1113
- const canBroadcastMessages = useIsMounted();
1114
- /**
1115
- * Receive a message from the webview and forward it to the client
1116
- * message transport
1117
- */
1118
- const onMessageHandler = event => {
1119
- if (!canBroadcastMessages()) return;
1120
- let parsedData = null;
1121
- try {
1122
- parsedData = JSON.parse(event.nativeEvent.data);
1123
- } catch (err) {
1124
- logger.debug('error parsing data', err);
1125
- return;
1126
- }
1127
- const message = messageTransport.parseMessageTransportData(parsedData);
1128
- if (!message) {
1129
- logger.debug('invalid message', message);
1130
- return;
1131
- }
1132
- /**
1133
- * Only forward messages from the created by the webview
1134
- */
1135
- if (message.origin === 'webview') {
1136
- core.messageTransport.emit(message);
1137
- }
1138
- };
1139
- /**
1140
- * Send messages created by the client to the webview
1141
- */
1142
- react.useEffect(() => {
1143
- const sendMessageToWebView = message => {
1144
- if (!canBroadcastMessages()) return;
1145
- /**
1146
- * Only forward messages to the webview
1147
- * that where created by the client/host
1148
- */
1149
- if (message.origin === 'host' && webViewRef.current) {
1150
- webViewRef.current.postMessage(JSON.stringify(message));
1151
- }
1152
- };
1153
- core.messageTransport.on(sendMessageToWebView);
1154
- return () => {
1155
- core.messageTransport.off(sendMessageToWebView);
1156
- };
1157
- }, [core.messageTransport, webViewRef, canBroadcastMessages]);
1158
- return {
1159
- onMessageHandler
1160
- };
1161
- };
1162
-
1163
- var objectDefineProperties = {};
1164
-
1165
- var DESCRIPTORS$2 = descriptors;
1166
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1167
- var definePropertyModule$2 = objectDefineProperty;
1168
- var anObject$7 = anObject$a;
1169
- var toIndexedObject$1 = toIndexedObject$5;
1170
- var objectKeys = objectKeys$2;
1171
-
1172
- // `Object.defineProperties` method
1173
- // https://tc39.es/ecma262/#sec-object.defineproperties
1174
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1175
- objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1176
- anObject$7(O);
1177
- var props = toIndexedObject$1(Properties);
1178
- var keys = objectKeys(Properties);
1179
- var length = keys.length;
1180
- var index = 0;
1181
- var key;
1182
- while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
1183
- return O;
1184
- };
1185
-
1186
- var getBuiltIn$4 = getBuiltIn$8;
1187
-
1188
- var html$2 = getBuiltIn$4('document', 'documentElement');
1189
-
1190
- /* global ActiveXObject -- old IE, WSH */
1191
-
1192
- var anObject$6 = anObject$a;
1193
- var definePropertiesModule = objectDefineProperties;
1194
- var enumBugKeys = enumBugKeys$3;
1195
- var hiddenKeys = hiddenKeys$4;
1196
- var html$1 = html$2;
1197
- var documentCreateElement$1 = documentCreateElement$2;
1198
- var sharedKey$1 = sharedKey$3;
1199
-
1200
- var GT = '>';
1201
- var LT = '<';
1202
- var PROTOTYPE = 'prototype';
1203
- var SCRIPT = 'script';
1204
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1205
-
1206
- var EmptyConstructor = function () { /* empty */ };
1207
-
1208
- var scriptTag = function (content) {
1209
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1210
- };
1211
-
1212
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1213
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1214
- activeXDocument.write(scriptTag(''));
1215
- activeXDocument.close();
1216
- var temp = activeXDocument.parentWindow.Object;
1217
- activeXDocument = null; // avoid memory leak
1218
- return temp;
1219
- };
1220
-
1221
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1222
- var NullProtoObjectViaIFrame = function () {
1223
- // Thrash, waste and sodomy: IE GC bug
1224
- var iframe = documentCreateElement$1('iframe');
1225
- var JS = 'java' + SCRIPT + ':';
1226
- var iframeDocument;
1227
- iframe.style.display = 'none';
1228
- html$1.appendChild(iframe);
1229
- // https://github.com/zloirock/core-js/issues/475
1230
- iframe.src = String(JS);
1231
- iframeDocument = iframe.contentWindow.document;
1232
- iframeDocument.open();
1233
- iframeDocument.write(scriptTag('document.F=Object'));
1234
- iframeDocument.close();
1235
- return iframeDocument.F;
1236
- };
1237
-
1238
- // Check for document.domain and active x support
1239
- // No need to use active x approach when document.domain is not set
1240
- // see https://github.com/es-shims/es5-shim/issues/150
1241
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1242
- // avoid IE GC bug
1243
- var activeXDocument;
1244
- var NullProtoObject = function () {
1245
- try {
1246
- activeXDocument = new ActiveXObject('htmlfile');
1247
- } catch (error) { /* ignore */ }
1248
- NullProtoObject = typeof document != 'undefined'
1249
- ? document.domain && activeXDocument
1250
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1251
- : NullProtoObjectViaIFrame()
1252
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1253
- var length = enumBugKeys.length;
1254
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1255
- return NullProtoObject();
1256
- };
1257
-
1258
- hiddenKeys[IE_PROTO$1] = true;
1259
-
1260
- // `Object.create` method
1261
- // https://tc39.es/ecma262/#sec-object.create
1262
- // eslint-disable-next-line es/no-object-create -- safe
1263
- var objectCreate = Object.create || function create(O, Properties) {
1264
- var result;
1265
- if (O !== null) {
1266
- EmptyConstructor[PROTOTYPE] = anObject$6(O);
1267
- result = new EmptyConstructor();
1268
- EmptyConstructor[PROTOTYPE] = null;
1269
- // add "__proto__" for Object.getPrototypeOf polyfill
1270
- result[IE_PROTO$1] = O;
1271
- } else result = NullProtoObject();
1272
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1273
- };
1274
-
1275
- var wellKnownSymbol$c = wellKnownSymbol$e;
1276
- var create$1 = objectCreate;
1277
- var defineProperty$2 = objectDefineProperty.f;
1278
-
1279
- var UNSCOPABLES = wellKnownSymbol$c('unscopables');
1280
- var ArrayPrototype$1 = Array.prototype;
1281
-
1282
- // Array.prototype[@@unscopables]
1283
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1284
- if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
1285
- defineProperty$2(ArrayPrototype$1, UNSCOPABLES, {
1286
- configurable: true,
1287
- value: create$1(null)
1288
- });
1289
- }
1290
-
1291
- // add a key to Array.prototype[@@unscopables]
1292
- var addToUnscopables$1 = function (key) {
1293
- ArrayPrototype$1[UNSCOPABLES][key] = true;
1294
- };
1295
-
1296
- var iterators = {};
1297
-
1298
- var fails$3 = fails$d;
1299
-
1300
- var correctPrototypeGetter = !fails$3(function () {
1301
- function F() { /* empty */ }
1302
- F.prototype.constructor = null;
1303
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1304
- return Object.getPrototypeOf(new F()) !== F.prototype;
1305
- });
1306
-
1307
- var hasOwn$2 = hasOwnProperty_1;
1308
- var isCallable$9 = isCallable$k;
1309
- var toObject = toObject$3;
1310
- var sharedKey = sharedKey$3;
1311
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1312
-
1313
- var IE_PROTO = sharedKey('IE_PROTO');
1314
- var $Object$1 = Object;
1315
- var ObjectPrototype = $Object$1.prototype;
1316
-
1317
- // `Object.getPrototypeOf` method
1318
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1319
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1320
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1321
- var object = toObject(O);
1322
- if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1323
- var constructor = object.constructor;
1324
- if (isCallable$9(constructor) && object instanceof constructor) {
1325
- return constructor.prototype;
1326
- } return object instanceof $Object$1 ? ObjectPrototype : null;
1327
- };
1328
-
1329
- var fails$2 = fails$d;
1330
- var isCallable$8 = isCallable$k;
1331
- var isObject$2 = isObject$8;
1332
- var getPrototypeOf$1 = objectGetPrototypeOf;
1333
- var defineBuiltIn$3 = defineBuiltIn$5;
1334
- var wellKnownSymbol$b = wellKnownSymbol$e;
1335
-
1336
- var ITERATOR$5 = wellKnownSymbol$b('iterator');
1337
- var BUGGY_SAFARI_ITERATORS$1 = false;
1338
-
1339
- // `%IteratorPrototype%` object
1340
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1341
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1342
-
1343
- /* eslint-disable es/no-array-prototype-keys -- safe */
1344
- if ([].keys) {
1345
- arrayIterator = [].keys();
1346
- // Safari 8 has buggy iterators w/o `next`
1347
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1348
- else {
1349
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1350
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1351
- }
1352
- }
1353
-
1354
- var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$2(function () {
1355
- var test = {};
1356
- // FF44- legacy iterators case
1357
- return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
1358
- });
1359
-
1360
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1361
-
1362
- // `%IteratorPrototype%[@@iterator]()` method
1363
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1364
- if (!isCallable$8(IteratorPrototype$2[ITERATOR$5])) {
1365
- defineBuiltIn$3(IteratorPrototype$2, ITERATOR$5, function () {
1366
- return this;
1367
- });
1368
- }
1369
-
1370
- var iteratorsCore = {
1371
- IteratorPrototype: IteratorPrototype$2,
1372
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1373
- };
1374
-
1375
- var defineProperty$1 = objectDefineProperty.f;
1376
- var hasOwn$1 = hasOwnProperty_1;
1377
- var wellKnownSymbol$a = wellKnownSymbol$e;
1378
-
1379
- var TO_STRING_TAG$3 = wellKnownSymbol$a('toStringTag');
1380
-
1381
- var setToStringTag$3 = function (target, TAG, STATIC) {
1382
- if (target && !STATIC) target = target.prototype;
1383
- if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1384
- defineProperty$1(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1385
- }
1386
- };
1387
-
1388
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1389
- var create = objectCreate;
1390
- var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1391
- var setToStringTag$2 = setToStringTag$3;
1392
- var Iterators$4 = iterators;
1393
-
1394
- var returnThis$1 = function () { return this; };
1395
-
1396
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1397
- var TO_STRING_TAG = NAME + ' Iterator';
1398
- IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
1399
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1400
- Iterators$4[TO_STRING_TAG] = returnThis$1;
1401
- return IteratorConstructor;
1402
- };
1403
-
1404
- var isCallable$7 = isCallable$k;
1405
-
1406
- var $String = String;
1407
- var $TypeError$6 = TypeError;
1408
-
1409
- var aPossiblePrototype$1 = function (argument) {
1410
- if (typeof argument == 'object' || isCallable$7(argument)) return argument;
1411
- throw $TypeError$6("Can't set " + $String(argument) + ' as a prototype');
1412
- };
1413
-
1414
- /* eslint-disable no-proto -- safe */
1415
-
1416
- var uncurryThis$4 = functionUncurryThis;
1417
- var anObject$5 = anObject$a;
1418
- var aPossiblePrototype = aPossiblePrototype$1;
1419
-
1420
- // `Object.setPrototypeOf` method
1421
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1422
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1423
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1424
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1425
- var CORRECT_SETTER = false;
1426
- var test = {};
1427
- var setter;
1428
- try {
1429
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1430
- setter = uncurryThis$4(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1431
- setter(test, []);
1432
- CORRECT_SETTER = test instanceof Array;
1433
- } catch (error) { /* empty */ }
1434
- return function setPrototypeOf(O, proto) {
1435
- anObject$5(O);
1436
- aPossiblePrototype(proto);
1437
- if (CORRECT_SETTER) setter(O, proto);
1438
- else O.__proto__ = proto;
1439
- return O;
1440
- };
1441
- }() : undefined);
1442
-
1443
- var $$7 = _export;
1444
- var call$8 = functionCall;
1445
- var FunctionName = functionName;
1446
- var isCallable$6 = isCallable$k;
1447
- var createIteratorConstructor = iteratorCreateConstructor;
1448
- var getPrototypeOf = objectGetPrototypeOf;
1449
- var setPrototypeOf$1 = objectSetPrototypeOf;
1450
- var setToStringTag$1 = setToStringTag$3;
1451
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1452
- var defineBuiltIn$2 = defineBuiltIn$5;
1453
- var wellKnownSymbol$9 = wellKnownSymbol$e;
1454
- var Iterators$3 = iterators;
1455
- var IteratorsCore = iteratorsCore;
1456
-
1457
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1458
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1459
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1460
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1461
- var ITERATOR$4 = wellKnownSymbol$9('iterator');
1462
- var KEYS = 'keys';
1463
- var VALUES = 'values';
1464
- var ENTRIES = 'entries';
1465
-
1466
- var returnThis = function () { return this; };
1467
-
1468
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1469
- createIteratorConstructor(IteratorConstructor, NAME, next);
1470
-
1471
- var getIterationMethod = function (KIND) {
1472
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1473
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1474
- switch (KIND) {
1475
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1476
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1477
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1478
- } return function () { return new IteratorConstructor(this); };
1479
- };
1480
-
1481
- var TO_STRING_TAG = NAME + ' Iterator';
1482
- var INCORRECT_VALUES_NAME = false;
1483
- var IterablePrototype = Iterable.prototype;
1484
- var nativeIterator = IterablePrototype[ITERATOR$4]
1485
- || IterablePrototype['@@iterator']
1486
- || DEFAULT && IterablePrototype[DEFAULT];
1487
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1488
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1489
- var CurrentIteratorPrototype, methods, KEY;
1490
-
1491
- // fix native
1492
- if (anyNativeIterator) {
1493
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1494
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1495
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1496
- if (setPrototypeOf$1) {
1497
- setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1498
- } else if (!isCallable$6(CurrentIteratorPrototype[ITERATOR$4])) {
1499
- defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$4, returnThis);
1500
- }
1501
- }
1502
- // Set @@toStringTag to native iterators
1503
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1504
- }
1505
- }
1506
-
1507
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1508
- if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1509
- if (CONFIGURABLE_FUNCTION_NAME) {
1510
- createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1511
- } else {
1512
- INCORRECT_VALUES_NAME = true;
1513
- defaultIterator = function values() { return call$8(nativeIterator, this); };
1514
- }
1515
- }
1516
-
1517
- // export additional methods
1518
- if (DEFAULT) {
1519
- methods = {
1520
- values: getIterationMethod(VALUES),
1521
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1522
- entries: getIterationMethod(ENTRIES)
1523
- };
1524
- if (FORCED) for (KEY in methods) {
1525
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1526
- defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1527
- }
1528
- } else $$7({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1529
- }
1530
-
1531
- // define iterator
1532
- if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
1533
- defineBuiltIn$2(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
1534
- }
1535
- Iterators$3[NAME] = defaultIterator;
1536
-
1537
- return methods;
1538
- };
1539
-
1540
- // `CreateIterResultObject` abstract operation
1541
- // https://tc39.es/ecma262/#sec-createiterresultobject
1542
- var createIterResultObject$1 = function (value, done) {
1543
- return { value: value, done: done };
1544
- };
1545
-
1546
- var toIndexedObject = toIndexedObject$5;
1547
- var addToUnscopables = addToUnscopables$1;
1548
- var Iterators$2 = iterators;
1549
- var InternalStateModule$1 = internalState;
1550
- var defineProperty = objectDefineProperty.f;
1551
- var defineIterator = iteratorDefine;
1552
- var createIterResultObject = createIterResultObject$1;
1553
- var DESCRIPTORS$1 = descriptors;
1554
-
1555
- var ARRAY_ITERATOR = 'Array Iterator';
1556
- var setInternalState$1 = InternalStateModule$1.set;
1557
- var getInternalState = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
1558
-
1559
- // `Array.prototype.entries` method
1560
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1561
- // `Array.prototype.keys` method
1562
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1563
- // `Array.prototype.values` method
1564
- // https://tc39.es/ecma262/#sec-array.prototype.values
1565
- // `Array.prototype[@@iterator]` method
1566
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1567
- // `CreateArrayIterator` internal method
1568
- // https://tc39.es/ecma262/#sec-createarrayiterator
1569
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1570
- setInternalState$1(this, {
1571
- type: ARRAY_ITERATOR,
1572
- target: toIndexedObject(iterated), // target
1573
- index: 0, // next index
1574
- kind: kind // kind
1575
- });
1576
- // `%ArrayIteratorPrototype%.next` method
1577
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1578
- }, function () {
1579
- var state = getInternalState(this);
1580
- var target = state.target;
1581
- var kind = state.kind;
1582
- var index = state.index++;
1583
- if (!target || index >= target.length) {
1584
- state.target = undefined;
1585
- return createIterResultObject(undefined, true);
1586
- }
1587
- if (kind == 'keys') return createIterResultObject(index, false);
1588
- if (kind == 'values') return createIterResultObject(target[index], false);
1589
- return createIterResultObject([index, target[index]], false);
1590
- }, 'values');
1591
-
1592
- // argumentsList[@@iterator] is %ArrayProto_values%
1593
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1594
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1595
- var values = Iterators$2.Arguments = Iterators$2.Array;
1596
-
1597
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1598
- addToUnscopables('keys');
1599
- addToUnscopables('values');
1600
- addToUnscopables('entries');
1601
-
1602
- // V8 ~ Chrome 45- bug
1603
- if (DESCRIPTORS$1 && values.name !== 'values') try {
1604
- defineProperty(values, 'name', { value: 'values' });
1605
- } catch (error) { /* empty */ }
1606
-
1607
- // iterable DOM collections
1608
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1609
- var domIterables = {
1610
- CSSRuleList: 0,
1611
- CSSStyleDeclaration: 0,
1612
- CSSValueList: 0,
1613
- ClientRectList: 0,
1614
- DOMRectList: 0,
1615
- DOMStringList: 0,
1616
- DOMTokenList: 1,
1617
- DataTransferItemList: 0,
1618
- FileList: 0,
1619
- HTMLAllCollection: 0,
1620
- HTMLCollection: 0,
1621
- HTMLFormElement: 0,
1622
- HTMLSelectElement: 0,
1623
- MediaList: 0,
1624
- MimeTypeArray: 0,
1625
- NamedNodeMap: 0,
1626
- NodeList: 1,
1627
- PaintRequestList: 0,
1628
- Plugin: 0,
1629
- PluginArray: 0,
1630
- SVGLengthList: 0,
1631
- SVGNumberList: 0,
1632
- SVGPathSegList: 0,
1633
- SVGPointList: 0,
1634
- SVGStringList: 0,
1635
- SVGTransformList: 0,
1636
- SourceBufferList: 0,
1637
- StyleSheetList: 0,
1638
- TextTrackCueList: 0,
1639
- TextTrackList: 0,
1640
- TouchList: 0
1641
- };
1642
-
1643
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1644
- var documentCreateElement = documentCreateElement$2;
1645
-
1646
- var classList = documentCreateElement('span').classList;
1647
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1648
-
1649
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1650
-
1651
- var global$9 = global$j;
1652
- var DOMIterables = domIterables;
1653
- var DOMTokenListPrototype = domTokenListPrototype;
1654
- var ArrayIteratorMethods = es_array_iterator;
1655
- var createNonEnumerableProperty = createNonEnumerableProperty$4;
1656
- var wellKnownSymbol$8 = wellKnownSymbol$e;
1657
-
1658
- var ITERATOR$3 = wellKnownSymbol$8('iterator');
1659
- var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1660
- var ArrayValues = ArrayIteratorMethods.values;
1661
-
1662
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1663
- if (CollectionPrototype) {
1664
- // some Chrome versions have non-configurable methods on DOMTokenList
1665
- if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
1666
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
1667
- } catch (error) {
1668
- CollectionPrototype[ITERATOR$3] = ArrayValues;
1669
- }
1670
- if (!CollectionPrototype[TO_STRING_TAG$2]) {
1671
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1672
- }
1673
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1674
- // some Chrome versions have non-configurable methods on DOMTokenList
1675
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1676
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1677
- } catch (error) {
1678
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1679
- }
1680
- }
1681
- }
1682
- };
1683
-
1684
- for (var COLLECTION_NAME in DOMIterables) {
1685
- handlePrototype(global$9[COLLECTION_NAME] && global$9[COLLECTION_NAME].prototype, COLLECTION_NAME);
1686
- }
1687
-
1688
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1689
-
1690
- const useWebViewVisibility = core => {
1691
- const webViewVisibilityRequestChannelRef = react.useRef(messageTransport.createRequestChannel(core.messageTransport));
1692
- const [visible, setVisible] = react.useState(false);
1693
- react.useEffect(() => webViewVisibilityRequestChannelRef.current.handle('setVisibility', setVisible), [setVisible]);
1694
- return {
1695
- visible
1696
- };
1697
- };
1698
-
1699
- const styles = reactNative.StyleSheet.create({
1700
- container: {
1701
- backgroundColor: 'transparent',
1702
- bottom: 0,
1703
- flex: 1,
1704
- left: 0,
1705
- position: 'absolute',
1706
- right: 0,
1707
- top: 0,
1708
- width: '100%'
1709
- },
1710
- hide: {
1711
- elevation: 0,
1712
- opacity: 0,
1713
- zIndex: -10000
1714
- },
1715
- show: {
1716
- elevation: 10000,
1717
- opacity: 1,
1718
- zIndex: 10000
1719
- },
1720
- webview: {
1721
- backgroundColor: 'transparent',
1722
- flex: 1
1723
- }
1724
- });
1725
-
1726
- const WebView = ({
1727
- webviewUrl,
1728
- core,
1729
- webviewDebuggingEnabled: _webviewDebuggingEnabled = false
1730
- }) => {
1731
- const webViewRef = react.useRef(null);
1732
- const {
1733
- visible
1734
- } = useWebViewVisibility(core);
1735
- const {
1736
- onMessageHandler
1737
- } = useMessageTransportWebViewBridge(core, webViewRef);
1738
- const containerStyles = [styles['container'], visible ? styles.show : styles.hide];
1739
- return /*#__PURE__*/jsxRuntime.jsx(reactNativeWebview.WebView, {
1740
- ref: webViewRef,
1741
- source: {
1742
- uri: webviewUrl
1743
- },
1744
- containerStyle: containerStyles,
1745
- style: styles['webview'],
1746
- onMessage: onMessageHandler,
1747
- hideKeyboardAccessoryView: true,
1748
- webviewDebuggingEnabled: _webviewDebuggingEnabled,
1749
- onError: () => core.initialization.error = new Error('Could not load Dynamic WebView')
1750
- }, 'webview');
1751
- };
1752
- const createWebView = props => {
1753
- const WebViewWrapper = () => /*#__PURE__*/jsxRuntime.jsx(WebView, Object.assign({}, props));
1754
- return WebViewWrapper;
1755
- };
1756
-
1757
- var classof$3 = classofRaw$2;
1758
- var global$8 = global$j;
1759
-
1760
- var engineIsNode = classof$3(global$8.process) == 'process';
1761
-
1762
- var getBuiltIn$3 = getBuiltIn$8;
1763
- var definePropertyModule$1 = objectDefineProperty;
1764
- var wellKnownSymbol$7 = wellKnownSymbol$e;
1765
- var DESCRIPTORS = descriptors;
1766
-
1767
- var SPECIES$2 = wellKnownSymbol$7('species');
1768
-
1769
- var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1770
- var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
1771
- var defineProperty = definePropertyModule$1.f;
1772
-
1773
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES$2]) {
1774
- defineProperty(Constructor, SPECIES$2, {
1775
- configurable: true,
1776
- get: function () { return this; }
1777
- });
1778
- }
1779
- };
1780
-
1781
- var isPrototypeOf$1 = objectIsPrototypeOf;
1782
-
1783
- var $TypeError$5 = TypeError;
1784
-
1785
- var anInstance$1 = function (it, Prototype) {
1786
- if (isPrototypeOf$1(Prototype, it)) return it;
1787
- throw $TypeError$5('Incorrect invocation');
1788
- };
1789
-
1790
- var wellKnownSymbol$6 = wellKnownSymbol$e;
1791
-
1792
- var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
1793
- var test = {};
1794
-
1795
- test[TO_STRING_TAG$1] = 'z';
1796
-
1797
- var toStringTagSupport = String(test) === '[object z]';
1798
-
1799
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1800
- var isCallable$5 = isCallable$k;
1801
- var classofRaw$1 = classofRaw$2;
1802
- var wellKnownSymbol$5 = wellKnownSymbol$e;
1803
-
1804
- var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
1805
- var $Object = Object;
1806
-
1807
- // ES3 wrong here
1808
- var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
1809
-
1810
- // fallback for IE11 Script Access Denied error
1811
- var tryGet = function (it, key) {
1812
- try {
1813
- return it[key];
1814
- } catch (error) { /* empty */ }
1815
- };
1816
-
1817
- // getting tag from ES6+ `Object.prototype.toString`
1818
- var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1819
- var O, tag, result;
1820
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1821
- // @@toStringTag case
1822
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1823
- // builtinTag case
1824
- : CORRECT_ARGUMENTS ? classofRaw$1(O)
1825
- // ES3 arguments fallback
1826
- : (result = classofRaw$1(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1827
- };
1828
-
1829
- var uncurryThis$3 = functionUncurryThis;
1830
- var fails$1 = fails$d;
1831
- var isCallable$4 = isCallable$k;
1832
- var classof$1 = classof$2;
1833
- var getBuiltIn$2 = getBuiltIn$8;
1834
- var inspectSource$1 = inspectSource$3;
1835
-
1836
- var noop = function () { /* empty */ };
1837
- var empty = [];
1838
- var construct = getBuiltIn$2('Reflect', 'construct');
1839
- var constructorRegExp = /^\s*(?:class|function)\b/;
1840
- var exec = uncurryThis$3(constructorRegExp.exec);
1841
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1842
-
1843
- var isConstructorModern = function isConstructor(argument) {
1844
- if (!isCallable$4(argument)) return false;
1845
- try {
1846
- construct(noop, empty, argument);
1847
- return true;
1848
- } catch (error) {
1849
- return false;
1850
- }
1851
- };
1852
-
1853
- var isConstructorLegacy = function isConstructor(argument) {
1854
- if (!isCallable$4(argument)) return false;
1855
- switch (classof$1(argument)) {
1856
- case 'AsyncFunction':
1857
- case 'GeneratorFunction':
1858
- case 'AsyncGeneratorFunction': return false;
1859
- }
1860
- try {
1861
- // we can't check .prototype since constructors produced by .bind haven't it
1862
- // `Function#toString` throws on some built-it function in some legacy engines
1863
- // (for example, `DOMQuad` and similar in FF41-)
1864
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1865
- } catch (error) {
1866
- return true;
1867
- }
1868
- };
1869
-
1870
- isConstructorLegacy.sham = true;
1871
-
1872
- // `IsConstructor` abstract operation
1873
- // https://tc39.es/ecma262/#sec-isconstructor
1874
- var isConstructor$1 = !construct || fails$1(function () {
1875
- var called;
1876
- return isConstructorModern(isConstructorModern.call)
1877
- || !isConstructorModern(Object)
1878
- || !isConstructorModern(function () { called = true; })
1879
- || called;
1880
- }) ? isConstructorLegacy : isConstructorModern;
1881
-
1882
- var isConstructor = isConstructor$1;
1883
- var tryToString$2 = tryToString$4;
1884
-
1885
- var $TypeError$4 = TypeError;
1886
-
1887
- // `Assert: IsConstructor(argument) is true`
1888
- var aConstructor$1 = function (argument) {
1889
- if (isConstructor(argument)) return argument;
1890
- throw $TypeError$4(tryToString$2(argument) + ' is not a constructor');
1891
- };
1892
-
1893
- var anObject$4 = anObject$a;
1894
- var aConstructor = aConstructor$1;
1895
- var isNullOrUndefined$1 = isNullOrUndefined$4;
1896
- var wellKnownSymbol$4 = wellKnownSymbol$e;
1897
-
1898
- var SPECIES$1 = wellKnownSymbol$4('species');
1899
-
1900
- // `SpeciesConstructor` abstract operation
1901
- // https://tc39.es/ecma262/#sec-speciesconstructor
1902
- var speciesConstructor$1 = function (O, defaultConstructor) {
1903
- var C = anObject$4(O).constructor;
1904
- var S;
1905
- return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1906
- };
1907
-
1908
- var NATIVE_BIND$1 = functionBindNative;
1909
-
1910
- var FunctionPrototype = Function.prototype;
1911
- var apply$1 = FunctionPrototype.apply;
1912
- var call$7 = FunctionPrototype.call;
1913
-
1914
- // eslint-disable-next-line es/no-reflect -- safe
1915
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$1) : function () {
1916
- return call$7.apply(apply$1, arguments);
1917
- });
1918
-
1919
- var classofRaw = classofRaw$2;
1920
- var uncurryThis$2 = functionUncurryThis;
1921
-
1922
- var functionUncurryThisClause = function (fn) {
1923
- // Nashorn bug:
1924
- // https://github.com/zloirock/core-js/issues/1128
1925
- // https://github.com/zloirock/core-js/issues/1130
1926
- if (classofRaw(fn) === 'Function') return uncurryThis$2(fn);
1927
- };
1928
-
1929
- var uncurryThis$1 = functionUncurryThisClause;
1930
- var aCallable$5 = aCallable$7;
1931
- var NATIVE_BIND = functionBindNative;
1932
-
1933
- var bind$4 = uncurryThis$1(uncurryThis$1.bind);
1934
-
1935
- // optional / simple context binding
1936
- var functionBindContext = function (fn, that) {
1937
- aCallable$5(fn);
1938
- return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1939
- return fn.apply(that, arguments);
1940
- };
1941
- };
1942
-
1943
- var uncurryThis = functionUncurryThis;
1944
-
1945
- var arraySlice$1 = uncurryThis([].slice);
1946
-
1947
- var $TypeError$3 = TypeError;
1948
-
1949
- var validateArgumentsLength$1 = function (passed, required) {
1950
- if (passed < required) throw $TypeError$3('Not enough arguments');
1951
- return passed;
1952
- };
1953
-
1954
- var userAgent$2 = engineUserAgent;
1955
-
1956
- var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1957
-
1958
- var global$7 = global$j;
1959
- var apply = functionApply;
1960
- var bind$3 = functionBindContext;
1961
- var isCallable$3 = isCallable$k;
1962
- var hasOwn = hasOwnProperty_1;
1963
- var fails = fails$d;
1964
- var html = html$2;
1965
- var arraySlice = arraySlice$1;
1966
- var createElement = documentCreateElement$2;
1967
- var validateArgumentsLength = validateArgumentsLength$1;
1968
- var IS_IOS$1 = engineIsIos;
1969
- var IS_NODE$3 = engineIsNode;
1970
-
1971
- var set = global$7.setImmediate;
1972
- var clear = global$7.clearImmediate;
1973
- var process$2 = global$7.process;
1974
- var Dispatch = global$7.Dispatch;
1975
- var Function$1 = global$7.Function;
1976
- var MessageChannel = global$7.MessageChannel;
1977
- var String$1 = global$7.String;
1978
- var counter = 0;
1979
- var queue$1 = {};
1980
- var ONREADYSTATECHANGE = 'onreadystatechange';
1981
- var $location, defer, channel, port;
1982
-
1983
- try {
1984
- // Deno throws a ReferenceError on `location` access without `--location` flag
1985
- $location = global$7.location;
1986
- } catch (error) { /* empty */ }
1987
-
1988
- var run = function (id) {
1989
- if (hasOwn(queue$1, id)) {
1990
- var fn = queue$1[id];
1991
- delete queue$1[id];
1992
- fn();
1993
- }
1994
- };
1995
-
1996
- var runner = function (id) {
1997
- return function () {
1998
- run(id);
1999
- };
2000
- };
2001
-
2002
- var listener = function (event) {
2003
- run(event.data);
2004
- };
2005
-
2006
- var post = function (id) {
2007
- // old engines have not location.origin
2008
- global$7.postMessage(String$1(id), $location.protocol + '//' + $location.host);
2009
- };
2010
-
2011
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
2012
- if (!set || !clear) {
2013
- set = function setImmediate(handler) {
2014
- validateArgumentsLength(arguments.length, 1);
2015
- var fn = isCallable$3(handler) ? handler : Function$1(handler);
2016
- var args = arraySlice(arguments, 1);
2017
- queue$1[++counter] = function () {
2018
- apply(fn, undefined, args);
2019
- };
2020
- defer(counter);
2021
- return counter;
2022
- };
2023
- clear = function clearImmediate(id) {
2024
- delete queue$1[id];
2025
- };
2026
- // Node.js 0.8-
2027
- if (IS_NODE$3) {
2028
- defer = function (id) {
2029
- process$2.nextTick(runner(id));
2030
- };
2031
- // Sphere (JS game engine) Dispatch API
2032
- } else if (Dispatch && Dispatch.now) {
2033
- defer = function (id) {
2034
- Dispatch.now(runner(id));
2035
- };
2036
- // Browsers with MessageChannel, includes WebWorkers
2037
- // except iOS - https://github.com/zloirock/core-js/issues/624
2038
- } else if (MessageChannel && !IS_IOS$1) {
2039
- channel = new MessageChannel();
2040
- port = channel.port2;
2041
- channel.port1.onmessage = listener;
2042
- defer = bind$3(port.postMessage, port);
2043
- // Browsers with postMessage, skip WebWorkers
2044
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
2045
- } else if (
2046
- global$7.addEventListener &&
2047
- isCallable$3(global$7.postMessage) &&
2048
- !global$7.importScripts &&
2049
- $location && $location.protocol !== 'file:' &&
2050
- !fails(post)
2051
- ) {
2052
- defer = post;
2053
- global$7.addEventListener('message', listener, false);
2054
- // IE8-
2055
- } else if (ONREADYSTATECHANGE in createElement('script')) {
2056
- defer = function (id) {
2057
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
2058
- html.removeChild(this);
2059
- run(id);
2060
- };
2061
- };
2062
- // Rest old browsers
2063
- } else {
2064
- defer = function (id) {
2065
- setTimeout(runner(id), 0);
2066
- };
2067
- }
2068
- }
2069
-
2070
- var task$1 = {
2071
- set: set,
2072
- clear: clear
2073
- };
2074
-
2075
- var userAgent$1 = engineUserAgent;
2076
- var global$6 = global$j;
2077
-
2078
- var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$6.Pebble !== undefined;
2079
-
2080
- var userAgent = engineUserAgent;
2081
-
2082
- var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2083
-
2084
- var global$5 = global$j;
2085
- var bind$2 = functionBindContext;
2086
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
2087
- var macrotask = task$1.set;
2088
- var IS_IOS = engineIsIos;
2089
- var IS_IOS_PEBBLE = engineIsIosPebble;
2090
- var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
2091
- var IS_NODE$2 = engineIsNode;
2092
-
2093
- var MutationObserver = global$5.MutationObserver || global$5.WebKitMutationObserver;
2094
- var document$2 = global$5.document;
2095
- var process$1 = global$5.process;
2096
- var Promise$1 = global$5.Promise;
2097
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
2098
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$5, 'queueMicrotask');
2099
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
2100
-
2101
- var flush, head, last, notify$1, toggle, node, promise, then;
2102
-
2103
- // modern engines have queueMicrotask method
2104
- if (!queueMicrotask) {
2105
- flush = function () {
2106
- var parent, fn;
2107
- if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
2108
- while (head) {
2109
- fn = head.fn;
2110
- head = head.next;
2111
- try {
2112
- fn();
2113
- } catch (error) {
2114
- if (head) notify$1();
2115
- else last = undefined;
2116
- throw error;
2117
- }
2118
- } last = undefined;
2119
- if (parent) parent.enter();
2120
- };
2121
-
2122
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
2123
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
2124
- if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
2125
- toggle = true;
2126
- node = document$2.createTextNode('');
2127
- new MutationObserver(flush).observe(node, { characterData: true });
2128
- notify$1 = function () {
2129
- node.data = toggle = !toggle;
2130
- };
2131
- // environments with maybe non-completely correct, but existent Promise
2132
- } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
2133
- // Promise.resolve without an argument throws an error in LG WebOS 2
2134
- promise = Promise$1.resolve(undefined);
2135
- // workaround of WebKit ~ iOS Safari 10.1 bug
2136
- promise.constructor = Promise$1;
2137
- then = bind$2(promise.then, promise);
2138
- notify$1 = function () {
2139
- then(flush);
2140
- };
2141
- // Node.js without promises
2142
- } else if (IS_NODE$2) {
2143
- notify$1 = function () {
2144
- process$1.nextTick(flush);
2145
- };
2146
- // for other environments - macrotask based on:
2147
- // - setImmediate
2148
- // - MessageChannel
2149
- // - window.postMessage
2150
- // - onreadystatechange
2151
- // - setTimeout
2152
- } else {
2153
- // strange IE + webpack dev server bug - use .bind(global)
2154
- macrotask = bind$2(macrotask, global$5);
2155
- notify$1 = function () {
2156
- macrotask(flush);
2157
- };
2158
- }
2159
- }
2160
-
2161
- var microtask$1 = queueMicrotask || function (fn) {
2162
- var task = { fn: fn, next: undefined };
2163
- if (last) last.next = task;
2164
- if (!head) {
2165
- head = task;
2166
- notify$1();
2167
- } last = task;
2168
- };
2169
-
2170
- var global$4 = global$j;
2171
-
2172
- var hostReportErrors$1 = function (a, b) {
2173
- var console = global$4.console;
2174
- if (console && console.error) {
2175
- arguments.length == 1 ? console.error(a) : console.error(a, b);
2176
- }
2177
- };
2178
-
2179
- var perform$3 = function (exec) {
2180
- try {
2181
- return { error: false, value: exec() };
2182
- } catch (error) {
2183
- return { error: true, value: error };
2184
- }
2185
- };
2186
-
2187
- var Queue$1 = function () {
2188
- this.head = null;
2189
- this.tail = null;
2190
- };
2191
-
2192
- Queue$1.prototype = {
2193
- add: function (item) {
2194
- var entry = { item: item, next: null };
2195
- if (this.head) this.tail.next = entry;
2196
- else this.head = entry;
2197
- this.tail = entry;
2198
- },
2199
- get: function () {
2200
- var entry = this.head;
2201
- if (entry) {
2202
- this.head = entry.next;
2203
- if (this.tail === entry) this.tail = null;
2204
- return entry.item;
2205
- }
2206
- }
2207
- };
2208
-
2209
- var queue = Queue$1;
2210
-
2211
- var global$3 = global$j;
2212
-
2213
- var promiseNativeConstructor = global$3.Promise;
2214
-
2215
- /* global Deno -- Deno case */
2216
-
2217
- var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
2218
-
2219
- var IS_DENO$1 = engineIsDeno;
2220
- var IS_NODE$1 = engineIsNode;
2221
-
2222
- var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
2223
- && typeof window == 'object'
2224
- && typeof document == 'object';
2225
-
2226
- var global$2 = global$j;
2227
- var NativePromiseConstructor$3 = promiseNativeConstructor;
2228
- var isCallable$2 = isCallable$k;
2229
- var isForced = isForced_1;
2230
- var inspectSource = inspectSource$3;
2231
- var wellKnownSymbol$3 = wellKnownSymbol$e;
2232
- var IS_BROWSER = engineIsBrowser;
2233
- var IS_DENO = engineIsDeno;
2234
- var V8_VERSION = engineV8Version;
2235
-
2236
- NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
2237
- var SPECIES = wellKnownSymbol$3('species');
2238
- var SUBCLASSING = false;
2239
- var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$2(global$2.PromiseRejectionEvent);
2240
-
2241
- var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
2242
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
2243
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
2244
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
2245
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
2246
- // We can't detect it synchronously, so just check versions
2247
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
2248
- // We can't use @@species feature detection in V8 since it causes
2249
- // deoptimization and performance degradation
2250
- // https://github.com/zloirock/core-js/issues/679
2251
- if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
2252
- // Detect correctness of subclassing with @@species support
2253
- var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
2254
- var FakePromise = function (exec) {
2255
- exec(function () { /* empty */ }, function () { /* empty */ });
2256
- };
2257
- var constructor = promise.constructor = {};
2258
- constructor[SPECIES] = FakePromise;
2259
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2260
- if (!SUBCLASSING) return true;
2261
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
2262
- } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
2263
- });
2264
-
2265
- var promiseConstructorDetection = {
2266
- CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
2267
- REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
2268
- SUBCLASSING: SUBCLASSING
2269
- };
2270
-
2271
- var newPromiseCapability$2 = {};
2272
-
2273
- var aCallable$4 = aCallable$7;
2274
-
2275
- var $TypeError$2 = TypeError;
2276
-
2277
- var PromiseCapability = function (C) {
2278
- var resolve, reject;
2279
- this.promise = new C(function ($$resolve, $$reject) {
2280
- if (resolve !== undefined || reject !== undefined) throw $TypeError$2('Bad Promise constructor');
2281
- resolve = $$resolve;
2282
- reject = $$reject;
2283
- });
2284
- this.resolve = aCallable$4(resolve);
2285
- this.reject = aCallable$4(reject);
2286
- };
2287
-
2288
- // `NewPromiseCapability` abstract operation
2289
- // https://tc39.es/ecma262/#sec-newpromisecapability
2290
- newPromiseCapability$2.f = function (C) {
2291
- return new PromiseCapability(C);
2292
- };
2293
-
2294
- var $$6 = _export;
2295
- var IS_NODE = engineIsNode;
2296
- var global$1 = global$j;
2297
- var call$6 = functionCall;
2298
- var defineBuiltIn$1 = defineBuiltIn$5;
2299
- var setPrototypeOf = objectSetPrototypeOf;
2300
- var setToStringTag = setToStringTag$3;
2301
- var setSpecies = setSpecies$1;
2302
- var aCallable$3 = aCallable$7;
2303
- var isCallable$1 = isCallable$k;
2304
- var isObject$1 = isObject$8;
2305
- var anInstance = anInstance$1;
2306
- var speciesConstructor = speciesConstructor$1;
2307
- var task = task$1.set;
2308
- var microtask = microtask$1;
2309
- var hostReportErrors = hostReportErrors$1;
2310
- var perform$2 = perform$3;
2311
- var Queue = queue;
2312
- var InternalStateModule = internalState;
2313
- var NativePromiseConstructor$2 = promiseNativeConstructor;
2314
- var PromiseConstructorDetection = promiseConstructorDetection;
2315
- var newPromiseCapabilityModule$3 = newPromiseCapability$2;
2316
-
2317
- var PROMISE = 'Promise';
2318
- var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
2319
- var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
2320
- var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
2321
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
2322
- var setInternalState = InternalStateModule.set;
2323
- var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
2324
- var PromiseConstructor = NativePromiseConstructor$2;
2325
- var PromisePrototype = NativePromisePrototype$1;
2326
- var TypeError$1 = global$1.TypeError;
2327
- var document$1 = global$1.document;
2328
- var process = global$1.process;
2329
- var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
2330
- var newGenericPromiseCapability = newPromiseCapability$1;
2331
-
2332
- var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
2333
- var UNHANDLED_REJECTION = 'unhandledrejection';
2334
- var REJECTION_HANDLED = 'rejectionhandled';
2335
- var PENDING = 0;
2336
- var FULFILLED = 1;
2337
- var REJECTED = 2;
2338
- var HANDLED = 1;
2339
- var UNHANDLED = 2;
2340
-
2341
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2342
-
2343
- // helpers
2344
- var isThenable = function (it) {
2345
- var then;
2346
- return isObject$1(it) && isCallable$1(then = it.then) ? then : false;
2347
- };
2348
-
2349
- var callReaction = function (reaction, state) {
2350
- var value = state.value;
2351
- var ok = state.state == FULFILLED;
2352
- var handler = ok ? reaction.ok : reaction.fail;
2353
- var resolve = reaction.resolve;
2354
- var reject = reaction.reject;
2355
- var domain = reaction.domain;
2356
- var result, then, exited;
2357
- try {
2358
- if (handler) {
2359
- if (!ok) {
2360
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2361
- state.rejection = HANDLED;
2362
- }
2363
- if (handler === true) result = value;
2364
- else {
2365
- if (domain) domain.enter();
2366
- result = handler(value); // can throw
2367
- if (domain) {
2368
- domain.exit();
2369
- exited = true;
16
+ var version = "4.0.0-alpha.5";
17
+
18
+ function _extends() {
19
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
20
+ for (var i = 1; i < arguments.length; i++) {
21
+ var source = arguments[i];
22
+ for (var key in source) {
23
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
24
+ target[key] = source[key];
2370
25
  }
2371
26
  }
2372
- if (result === reaction.promise) {
2373
- reject(TypeError$1('Promise-chain cycle'));
2374
- } else if (then = isThenable(result)) {
2375
- call$6(then, result, resolve, reject);
2376
- } else resolve(result);
2377
- } else reject(value);
2378
- } catch (error) {
2379
- if (domain && !exited) domain.exit();
2380
- reject(error);
2381
- }
2382
- };
2383
-
2384
- var notify = function (state, isReject) {
2385
- if (state.notified) return;
2386
- state.notified = true;
2387
- microtask(function () {
2388
- var reactions = state.reactions;
2389
- var reaction;
2390
- while (reaction = reactions.get()) {
2391
- callReaction(reaction, state);
2392
- }
2393
- state.notified = false;
2394
- if (isReject && !state.rejection) onUnhandled(state);
2395
- });
2396
- };
2397
-
2398
- var dispatchEvent = function (name, promise, reason) {
2399
- var event, handler;
2400
- if (DISPATCH_EVENT) {
2401
- event = document$1.createEvent('Event');
2402
- event.promise = promise;
2403
- event.reason = reason;
2404
- event.initEvent(name, false, true);
2405
- global$1.dispatchEvent(event);
2406
- } else event = { promise: promise, reason: reason };
2407
- if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
2408
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2409
- };
2410
-
2411
- var onUnhandled = function (state) {
2412
- call$6(task, global$1, function () {
2413
- var promise = state.facade;
2414
- var value = state.value;
2415
- var IS_UNHANDLED = isUnhandled(state);
2416
- var result;
2417
- if (IS_UNHANDLED) {
2418
- result = perform$2(function () {
2419
- if (IS_NODE) {
2420
- process.emit('unhandledRejection', value, promise);
2421
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2422
- });
2423
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2424
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2425
- if (result.error) throw result.value;
2426
27
  }
2427
- });
2428
- };
2429
-
2430
- var isUnhandled = function (state) {
2431
- return state.rejection !== HANDLED && !state.parent;
2432
- };
2433
-
2434
- var onHandleUnhandled = function (state) {
2435
- call$6(task, global$1, function () {
2436
- var promise = state.facade;
2437
- if (IS_NODE) {
2438
- process.emit('rejectionHandled', promise);
2439
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
2440
- });
2441
- };
2442
-
2443
- var bind$1 = function (fn, state, unwrap) {
2444
- return function (value) {
2445
- fn(state, value, unwrap);
28
+ return target;
2446
29
  };
2447
- };
30
+ return _extends.apply(this, arguments);
31
+ }
2448
32
 
2449
- var internalReject = function (state, value, unwrap) {
2450
- if (state.done) return;
2451
- state.done = true;
2452
- if (unwrap) state = unwrap;
2453
- state.value = value;
2454
- state.state = REJECTED;
2455
- notify(state, true);
2456
- };
33
+ const logger = new logger$1.Logger('react-native-extension');
2457
34
 
2458
- var internalResolve = function (state, value, unwrap) {
2459
- if (state.done) return;
2460
- state.done = true;
2461
- if (unwrap) state = unwrap;
2462
- try {
2463
- if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
2464
- var then = isThenable(value);
2465
- if (then) {
2466
- microtask(function () {
2467
- var wrapper = { done: false };
2468
- try {
2469
- call$6(then, value,
2470
- bind$1(internalResolve, wrapper, state),
2471
- bind$1(internalReject, wrapper, state)
2472
- );
2473
- } catch (error) {
2474
- internalReject(wrapper, error, state);
2475
- }
2476
- });
2477
- } else {
2478
- state.value = value;
2479
- state.state = FULFILLED;
2480
- notify(state, false);
2481
- }
2482
- } catch (error) {
2483
- internalReject({ done: false }, error, state);
2484
- }
35
+ const useIsMounted = () => {
36
+ const isMountedRef = react.useRef(true);
37
+ react.useEffect(() => () => {
38
+ isMountedRef.current = false;
39
+ }, []);
40
+ return react.useCallback(() => isMountedRef.current, [isMountedRef]);
2485
41
  };
2486
42
 
2487
- // constructor polyfill
2488
- if (FORCED_PROMISE_CONSTRUCTOR$4) {
2489
- // 25.4.3.1 Promise(executor)
2490
- PromiseConstructor = function Promise(executor) {
2491
- anInstance(this, PromisePrototype);
2492
- aCallable$3(executor);
2493
- call$6(Internal, this);
2494
- var state = getInternalPromiseState(this);
43
+ const useMessageTransportWebViewBridge = (core, webViewRef) => {
44
+ const canBroadcastMessages = useIsMounted();
45
+ /**
46
+ * Receive a message from the webview and forward it to the client
47
+ * message transport
48
+ */
49
+ const onMessageHandler = event => {
50
+ if (!canBroadcastMessages()) return;
51
+ let parsedData = null;
2495
52
  try {
2496
- executor(bind$1(internalResolve, state), bind$1(internalReject, state));
2497
- } catch (error) {
2498
- internalReject(state, error);
2499
- }
2500
- };
2501
-
2502
- PromisePrototype = PromiseConstructor.prototype;
2503
-
2504
- // eslint-disable-next-line no-unused-vars -- required for `.length`
2505
- Internal = function Promise(executor) {
2506
- setInternalState(this, {
2507
- type: PROMISE,
2508
- done: false,
2509
- notified: false,
2510
- parent: false,
2511
- reactions: new Queue(),
2512
- rejection: false,
2513
- state: PENDING,
2514
- value: undefined
2515
- });
2516
- };
2517
-
2518
- // `Promise.prototype.then` method
2519
- // https://tc39.es/ecma262/#sec-promise.prototype.then
2520
- Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2521
- var state = getInternalPromiseState(this);
2522
- var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2523
- state.parent = true;
2524
- reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
2525
- reaction.fail = isCallable$1(onRejected) && onRejected;
2526
- reaction.domain = IS_NODE ? process.domain : undefined;
2527
- if (state.state == PENDING) state.reactions.add(reaction);
2528
- else microtask(function () {
2529
- callReaction(reaction, state);
2530
- });
2531
- return reaction.promise;
2532
- });
2533
-
2534
- OwnPromiseCapability = function () {
2535
- var promise = new Internal();
2536
- var state = getInternalPromiseState(promise);
2537
- this.promise = promise;
2538
- this.resolve = bind$1(internalResolve, state);
2539
- this.reject = bind$1(internalReject, state);
2540
- };
2541
-
2542
- newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
2543
- return C === PromiseConstructor || C === PromiseWrapper
2544
- ? new OwnPromiseCapability(C)
2545
- : newGenericPromiseCapability(C);
2546
- };
2547
-
2548
- if (isCallable$1(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
2549
- nativeThen = NativePromisePrototype$1.then;
2550
-
2551
- if (!NATIVE_PROMISE_SUBCLASSING) {
2552
- // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2553
- defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2554
- var that = this;
2555
- return new PromiseConstructor(function (resolve, reject) {
2556
- call$6(nativeThen, that, resolve, reject);
2557
- }).then(onFulfilled, onRejected);
2558
- // https://github.com/zloirock/core-js/issues/640
2559
- }, { unsafe: true });
53
+ parsedData = JSON.parse(event.nativeEvent.data);
54
+ } catch (err) {
55
+ logger.debug('error parsing data', err);
56
+ return;
2560
57
  }
2561
-
2562
- // make `.constructor === Promise` work for native promise-based APIs
2563
- try {
2564
- delete NativePromisePrototype$1.constructor;
2565
- } catch (error) { /* empty */ }
2566
-
2567
- // make `instanceof Promise` work for native promise-based APIs
2568
- if (setPrototypeOf) {
2569
- setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
58
+ const message = messageTransport.parseMessageTransportData(parsedData);
59
+ if (!message) {
60
+ logger.debug('invalid message', message);
61
+ return;
2570
62
  }
2571
- }
2572
- }
2573
-
2574
- $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2575
- Promise: PromiseConstructor
2576
- });
2577
-
2578
- setToStringTag(PromiseConstructor, PROMISE, false);
2579
- setSpecies(PROMISE);
2580
-
2581
- var wellKnownSymbol$2 = wellKnownSymbol$e;
2582
- var Iterators$1 = iterators;
2583
-
2584
- var ITERATOR$2 = wellKnownSymbol$2('iterator');
2585
- var ArrayPrototype = Array.prototype;
2586
-
2587
- // check on default Array iterator
2588
- var isArrayIteratorMethod$1 = function (it) {
2589
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
2590
- };
2591
-
2592
- var classof = classof$2;
2593
- var getMethod$1 = getMethod$3;
2594
- var isNullOrUndefined = isNullOrUndefined$4;
2595
- var Iterators = iterators;
2596
- var wellKnownSymbol$1 = wellKnownSymbol$e;
2597
-
2598
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
2599
-
2600
- var getIteratorMethod$2 = function (it) {
2601
- if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$1)
2602
- || getMethod$1(it, '@@iterator')
2603
- || Iterators[classof(it)];
2604
- };
2605
-
2606
- var call$5 = functionCall;
2607
- var aCallable$2 = aCallable$7;
2608
- var anObject$3 = anObject$a;
2609
- var tryToString$1 = tryToString$4;
2610
- var getIteratorMethod$1 = getIteratorMethod$2;
2611
-
2612
- var $TypeError$1 = TypeError;
2613
-
2614
- var getIterator$1 = function (argument, usingIterator) {
2615
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2616
- if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
2617
- throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
2618
- };
2619
-
2620
- var call$4 = functionCall;
2621
- var anObject$2 = anObject$a;
2622
- var getMethod = getMethod$3;
2623
-
2624
- var iteratorClose$1 = function (iterator, kind, value) {
2625
- var innerResult, innerError;
2626
- anObject$2(iterator);
2627
- try {
2628
- innerResult = getMethod(iterator, 'return');
2629
- if (!innerResult) {
2630
- if (kind === 'throw') throw value;
2631
- return value;
63
+ /**
64
+ * Only forward messages from the created by the webview
65
+ */
66
+ if (message.origin === 'webview') {
67
+ core.messageTransport.emit(message);
2632
68
  }
2633
- innerResult = call$4(innerResult, iterator);
2634
- } catch (error) {
2635
- innerError = true;
2636
- innerResult = error;
2637
- }
2638
- if (kind === 'throw') throw value;
2639
- if (innerError) throw innerResult;
2640
- anObject$2(innerResult);
2641
- return value;
2642
- };
2643
-
2644
- var bind = functionBindContext;
2645
- var call$3 = functionCall;
2646
- var anObject$1 = anObject$a;
2647
- var tryToString = tryToString$4;
2648
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
2649
- var lengthOfArrayLike = lengthOfArrayLike$2;
2650
- var isPrototypeOf = objectIsPrototypeOf;
2651
- var getIterator = getIterator$1;
2652
- var getIteratorMethod = getIteratorMethod$2;
2653
- var iteratorClose = iteratorClose$1;
2654
-
2655
- var $TypeError = TypeError;
2656
-
2657
- var Result = function (stopped, result) {
2658
- this.stopped = stopped;
2659
- this.result = result;
2660
- };
2661
-
2662
- var ResultPrototype = Result.prototype;
2663
-
2664
- var iterate$3 = function (iterable, unboundFunction, options) {
2665
- var that = options && options.that;
2666
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2667
- var IS_RECORD = !!(options && options.IS_RECORD);
2668
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2669
- var INTERRUPTED = !!(options && options.INTERRUPTED);
2670
- var fn = bind(unboundFunction, that);
2671
- var iterator, iterFn, index, length, result, next, step;
2672
-
2673
- var stop = function (condition) {
2674
- if (iterator) iteratorClose(iterator, 'normal', condition);
2675
- return new Result(true, condition);
2676
69
  };
2677
-
2678
- var callFn = function (value) {
2679
- if (AS_ENTRIES) {
2680
- anObject$1(value);
2681
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2682
- } return INTERRUPTED ? fn(value, stop) : fn(value);
70
+ /**
71
+ * Send messages created by the client to the webview
72
+ */
73
+ react.useEffect(() => {
74
+ const sendMessageToWebView = message => {
75
+ if (!canBroadcastMessages()) return;
76
+ /**
77
+ * Only forward messages to the webview
78
+ * that where created by the client/host
79
+ */
80
+ if (message.origin === 'host' && webViewRef.current) {
81
+ webViewRef.current.postMessage(JSON.stringify(message));
82
+ }
83
+ };
84
+ core.messageTransport.on(sendMessageToWebView);
85
+ return () => {
86
+ core.messageTransport.off(sendMessageToWebView);
87
+ };
88
+ }, [core.messageTransport, webViewRef, canBroadcastMessages]);
89
+ return {
90
+ onMessageHandler
2683
91
  };
2684
-
2685
- if (IS_RECORD) {
2686
- iterator = iterable.iterator;
2687
- } else if (IS_ITERATOR) {
2688
- iterator = iterable;
2689
- } else {
2690
- iterFn = getIteratorMethod(iterable);
2691
- if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2692
- // optimisation for array iterators
2693
- if (isArrayIteratorMethod(iterFn)) {
2694
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2695
- result = callFn(iterable[index]);
2696
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
2697
- } return new Result(false);
2698
- }
2699
- iterator = getIterator(iterable, iterFn);
2700
- }
2701
-
2702
- next = IS_RECORD ? iterable.next : iterator.next;
2703
- while (!(step = call$3(next, iterator)).done) {
2704
- try {
2705
- result = callFn(step.value);
2706
- } catch (error) {
2707
- iteratorClose(iterator, 'throw', error);
2708
- }
2709
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2710
- } return new Result(false);
2711
92
  };
2712
93
 
2713
- var wellKnownSymbol = wellKnownSymbol$e;
2714
-
2715
- var ITERATOR = wellKnownSymbol('iterator');
2716
- var SAFE_CLOSING = false;
2717
-
2718
- try {
2719
- var called = 0;
2720
- var iteratorWithReturn = {
2721
- next: function () {
2722
- return { done: !!called++ };
2723
- },
2724
- 'return': function () {
2725
- SAFE_CLOSING = true;
2726
- }
2727
- };
2728
- iteratorWithReturn[ITERATOR] = function () {
2729
- return this;
94
+ const useWebViewVisibility = core => {
95
+ const webViewVisibilityRequestChannelRef = react.useRef(messageTransport.createRequestChannel(core.messageTransport));
96
+ const [visible, setVisible] = react.useState(false);
97
+ react.useEffect(() => webViewVisibilityRequestChannelRef.current.handle('setVisibility', setVisible), [setVisible]);
98
+ return {
99
+ visible
2730
100
  };
2731
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2732
- Array.from(iteratorWithReturn, function () { throw 2; });
2733
- } catch (error) { /* empty */ }
2734
-
2735
- var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2736
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2737
- var ITERATION_SUPPORT = false;
2738
- try {
2739
- var object = {};
2740
- object[ITERATOR] = function () {
2741
- return {
2742
- next: function () {
2743
- return { done: ITERATION_SUPPORT = true };
2744
- }
2745
- };
2746
- };
2747
- exec(object);
2748
- } catch (error) { /* empty */ }
2749
- return ITERATION_SUPPORT;
2750
101
  };
2751
102
 
2752
- var NativePromiseConstructor$1 = promiseNativeConstructor;
2753
- var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2754
- var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2755
-
2756
- var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2757
- NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2758
- });
2759
-
2760
- var $$5 = _export;
2761
- var call$2 = functionCall;
2762
- var aCallable$1 = aCallable$7;
2763
- var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2764
- var perform$1 = perform$3;
2765
- var iterate$2 = iterate$3;
2766
- var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2767
-
2768
- // `Promise.all` method
2769
- // https://tc39.es/ecma262/#sec-promise.all
2770
- $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2771
- all: function all(iterable) {
2772
- var C = this;
2773
- var capability = newPromiseCapabilityModule$2.f(C);
2774
- var resolve = capability.resolve;
2775
- var reject = capability.reject;
2776
- var result = perform$1(function () {
2777
- var $promiseResolve = aCallable$1(C.resolve);
2778
- var values = [];
2779
- var counter = 0;
2780
- var remaining = 1;
2781
- iterate$2(iterable, function (promise) {
2782
- var index = counter++;
2783
- var alreadyCalled = false;
2784
- remaining++;
2785
- call$2($promiseResolve, C, promise).then(function (value) {
2786
- if (alreadyCalled) return;
2787
- alreadyCalled = true;
2788
- values[index] = value;
2789
- --remaining || resolve(values);
2790
- }, reject);
2791
- });
2792
- --remaining || resolve(values);
2793
- });
2794
- if (result.error) reject(result.value);
2795
- return capability.promise;
2796
- }
2797
- });
2798
-
2799
- var $$4 = _export;
2800
- var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2801
- var NativePromiseConstructor = promiseNativeConstructor;
2802
- var getBuiltIn$1 = getBuiltIn$8;
2803
- var isCallable = isCallable$k;
2804
- var defineBuiltIn = defineBuiltIn$5;
2805
-
2806
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2807
-
2808
- // `Promise.prototype.catch` method
2809
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
2810
- $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2811
- 'catch': function (onRejected) {
2812
- return this.then(undefined, onRejected);
2813
- }
2814
- });
2815
-
2816
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2817
- if (isCallable(NativePromiseConstructor)) {
2818
- var method = getBuiltIn$1('Promise').prototype['catch'];
2819
- if (NativePromisePrototype['catch'] !== method) {
2820
- defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2821
- }
2822
- }
2823
-
2824
- var $$3 = _export;
2825
- var call$1 = functionCall;
2826
- var aCallable = aCallable$7;
2827
- var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2828
- var perform = perform$3;
2829
- var iterate$1 = iterate$3;
2830
- var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2831
-
2832
- // `Promise.race` method
2833
- // https://tc39.es/ecma262/#sec-promise.race
2834
- $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2835
- race: function race(iterable) {
2836
- var C = this;
2837
- var capability = newPromiseCapabilityModule$1.f(C);
2838
- var reject = capability.reject;
2839
- var result = perform(function () {
2840
- var $promiseResolve = aCallable(C.resolve);
2841
- iterate$1(iterable, function (promise) {
2842
- call$1($promiseResolve, C, promise).then(capability.resolve, reject);
2843
- });
2844
- });
2845
- if (result.error) reject(result.value);
2846
- return capability.promise;
2847
- }
2848
- });
2849
-
2850
- var $$2 = _export;
2851
- var call = functionCall;
2852
- var newPromiseCapabilityModule = newPromiseCapability$2;
2853
- var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2854
-
2855
- // `Promise.reject` method
2856
- // https://tc39.es/ecma262/#sec-promise.reject
2857
- $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2858
- reject: function reject(r) {
2859
- var capability = newPromiseCapabilityModule.f(this);
2860
- call(capability.reject, undefined, r);
2861
- return capability.promise;
103
+ const styles = reactNative.StyleSheet.create({
104
+ container: {
105
+ backgroundColor: 'transparent',
106
+ bottom: 0,
107
+ flex: 1,
108
+ left: 0,
109
+ position: 'absolute',
110
+ right: 0,
111
+ top: 0,
112
+ width: '100%'
113
+ },
114
+ hide: {
115
+ elevation: 0,
116
+ opacity: 0,
117
+ zIndex: -10000
118
+ },
119
+ show: {
120
+ elevation: 10000,
121
+ opacity: 1,
122
+ zIndex: 10000
123
+ },
124
+ webview: {
125
+ backgroundColor: 'transparent',
126
+ flex: 1
2862
127
  }
2863
128
  });
2864
129
 
2865
- var anObject = anObject$a;
2866
- var isObject = isObject$8;
2867
- var newPromiseCapability = newPromiseCapability$2;
2868
-
2869
- var promiseResolve$1 = function (C, x) {
2870
- anObject(C);
2871
- if (isObject(x) && x.constructor === C) return x;
2872
- var promiseCapability = newPromiseCapability.f(C);
2873
- var resolve = promiseCapability.resolve;
2874
- resolve(x);
2875
- return promiseCapability.promise;
130
+ const WebView = ({
131
+ webviewUrl,
132
+ core,
133
+ webviewDebuggingEnabled: _webviewDebuggingEnabled = false
134
+ }) => {
135
+ const webViewRef = react.useRef(null);
136
+ const {
137
+ visible
138
+ } = useWebViewVisibility(core);
139
+ const {
140
+ onMessageHandler
141
+ } = useMessageTransportWebViewBridge(core, webViewRef);
142
+ const containerStyles = [styles['container'], visible ? styles.show : styles.hide];
143
+ return /*#__PURE__*/jsxRuntime.jsx(reactNativeWebview.WebView, {
144
+ ref: webViewRef,
145
+ source: {
146
+ uri: webviewUrl
147
+ },
148
+ containerStyle: containerStyles,
149
+ style: styles['webview'],
150
+ onMessage: onMessageHandler,
151
+ hideKeyboardAccessoryView: true,
152
+ webviewDebuggingEnabled: _webviewDebuggingEnabled,
153
+ onError: () => core.initialization.error = new Error('Could not load Dynamic WebView')
154
+ }, 'webview');
2876
155
  };
2877
-
2878
- var $$1 = _export;
2879
- var getBuiltIn = getBuiltIn$8;
2880
- var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2881
- var promiseResolve = promiseResolve$1;
2882
-
2883
- getBuiltIn('Promise');
2884
-
2885
- // `Promise.resolve` method
2886
- // https://tc39.es/ecma262/#sec-promise.resolve
2887
- $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2888
- resolve: function resolve(x) {
2889
- return promiseResolve(this, x);
2890
- }
2891
- });
2892
-
2893
- var toPropertyKey = toPropertyKey$3;
2894
- var definePropertyModule = objectDefineProperty;
2895
- var createPropertyDescriptor = createPropertyDescriptor$4;
2896
-
2897
- var createProperty$1 = function (object, key, value) {
2898
- var propertyKey = toPropertyKey(key);
2899
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
2900
- else object[propertyKey] = value;
156
+ const createWebView = props => {
157
+ const WebViewWrapper = () => /*#__PURE__*/jsxRuntime.jsx(WebView, _extends({}, props));
158
+ return WebViewWrapper;
2901
159
  };
2902
160
 
2903
- var $ = _export;
2904
- var iterate = iterate$3;
2905
- var createProperty = createProperty$1;
2906
-
2907
- // `Object.fromEntries` method
2908
- // https://github.com/tc39/proposal-object-from-entries
2909
- $({ target: 'Object', stat: true }, {
2910
- fromEntries: function fromEntries(iterable) {
2911
- var obj = {};
2912
- iterate(iterable, function (k, v) {
2913
- createProperty(obj, k, v);
2914
- }, { AS_ENTRIES: true });
2915
- return obj;
2916
- }
2917
- });
2918
-
2919
161
  /******************************************************************************
2920
162
  Copyright (c) Microsoft Corporation.
2921
163
 
@@ -3018,7 +260,7 @@ const setupSecureStorageHandler = core => {
3018
260
  secureStorageRequestChannel.handle('deleteSecureItem', expoSecureStore.deleteItemAsync);
3019
261
  };
3020
262
 
3021
- const defaultWebviewUrl = `https://webview.dynamicauth.com/${version$1}`;
263
+ const defaultWebviewUrl = `https://webview.dynamicauth.com/${version}`;
3022
264
  const ReactNativeExtension = ({
3023
265
  webviewUrl: _webviewUrl = defaultWebviewUrl,
3024
266
  webviewDebuggingEnabled,