@archbee/app-widget 1.1.24 → 1.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js ADDED
@@ -0,0 +1,1689 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import React, { forwardRef, useRef, useMemo, useImperativeHandle } from 'react';
3
+ import ReactDOM from 'react-dom';
4
+
5
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
+
7
+ var check = function (it) {
8
+ return it && it.Math === Math && it;
9
+ };
10
+
11
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
+ var global$b =
13
+ // eslint-disable-next-line es/no-global-this -- safe
14
+ check(typeof globalThis == 'object' && globalThis) ||
15
+ check(typeof window == 'object' && window) ||
16
+ // eslint-disable-next-line no-restricted-globals -- safe
17
+ check(typeof self == 'object' && self) ||
18
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
19
+ // eslint-disable-next-line no-new-func -- fallback
20
+ (function () { return this; })() || commonjsGlobal || Function('return this')();
21
+
22
+ var objectGetOwnPropertyDescriptor = {};
23
+
24
+ var fails$c = function (exec) {
25
+ try {
26
+ return !!exec();
27
+ } catch (error) {
28
+ return true;
29
+ }
30
+ };
31
+
32
+ var fails$b = fails$c;
33
+
34
+ // Detect IE8's incomplete defineProperty implementation
35
+ var descriptors = !fails$b(function () {
36
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
37
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
38
+ });
39
+
40
+ var fails$a = fails$c;
41
+
42
+ var functionBindNative = !fails$a(function () {
43
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
44
+ var test = (function () { /* empty */ }).bind();
45
+ // eslint-disable-next-line no-prototype-builtins -- safe
46
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
47
+ });
48
+
49
+ var NATIVE_BIND$1 = functionBindNative;
50
+
51
+ var call$6 = Function.prototype.call;
52
+
53
+ var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
54
+ return call$6.apply(call$6, arguments);
55
+ };
56
+
57
+ var objectPropertyIsEnumerable = {};
58
+
59
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
60
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
61
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
62
+
63
+ // Nashorn ~ JDK8 bug
64
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
65
+
66
+ // `Object.prototype.propertyIsEnumerable` method implementation
67
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
68
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
69
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
70
+ return !!descriptor && descriptor.enumerable;
71
+ } : $propertyIsEnumerable;
72
+
73
+ var createPropertyDescriptor$3 = function (bitmap, value) {
74
+ return {
75
+ enumerable: !(bitmap & 1),
76
+ configurable: !(bitmap & 2),
77
+ writable: !(bitmap & 4),
78
+ value: value
79
+ };
80
+ };
81
+
82
+ var NATIVE_BIND = functionBindNative;
83
+
84
+ var FunctionPrototype$1 = Function.prototype;
85
+ var call$5 = FunctionPrototype$1.call;
86
+ var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$5, call$5);
87
+
88
+ var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
89
+ return function () {
90
+ return call$5.apply(fn, arguments);
91
+ };
92
+ };
93
+
94
+ var uncurryThis$a = functionUncurryThis;
95
+
96
+ var toString$3 = uncurryThis$a({}.toString);
97
+ var stringSlice$1 = uncurryThis$a(''.slice);
98
+
99
+ var classofRaw$1 = function (it) {
100
+ return stringSlice$1(toString$3(it), 8, -1);
101
+ };
102
+
103
+ var uncurryThis$9 = functionUncurryThis;
104
+ var fails$9 = fails$c;
105
+ var classof$3 = classofRaw$1;
106
+
107
+ var $Object$4 = Object;
108
+ var split = uncurryThis$9(''.split);
109
+
110
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
111
+ var indexedObject = fails$9(function () {
112
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
113
+ // eslint-disable-next-line no-prototype-builtins -- safe
114
+ return !$Object$4('z').propertyIsEnumerable(0);
115
+ }) ? function (it) {
116
+ return classof$3(it) === 'String' ? split(it, '') : $Object$4(it);
117
+ } : $Object$4;
118
+
119
+ // we can't use just `it == null` since of `document.all` special case
120
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
121
+ var isNullOrUndefined$2 = function (it) {
122
+ return it === null || it === undefined;
123
+ };
124
+
125
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
126
+
127
+ var $TypeError$6 = TypeError;
128
+
129
+ // `RequireObjectCoercible` abstract operation
130
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
131
+ var requireObjectCoercible$3 = function (it) {
132
+ if (isNullOrUndefined$1(it)) throw new $TypeError$6("Can't call method on " + it);
133
+ return it;
134
+ };
135
+
136
+ // toObject with fallback for non-array-like ES3 strings
137
+ var IndexedObject$1 = indexedObject;
138
+ var requireObjectCoercible$2 = requireObjectCoercible$3;
139
+
140
+ var toIndexedObject$4 = function (it) {
141
+ return IndexedObject$1(requireObjectCoercible$2(it));
142
+ };
143
+
144
+ var documentAll$2 = typeof document == 'object' && document.all;
145
+
146
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
147
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
148
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
149
+
150
+ var documentAll_1 = {
151
+ all: documentAll$2,
152
+ IS_HTMLDDA: IS_HTMLDDA
153
+ };
154
+
155
+ var $documentAll$1 = documentAll_1;
156
+
157
+ var documentAll$1 = $documentAll$1.all;
158
+
159
+ // `IsCallable` abstract operation
160
+ // https://tc39.es/ecma262/#sec-iscallable
161
+ var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
162
+ return typeof argument == 'function' || argument === documentAll$1;
163
+ } : function (argument) {
164
+ return typeof argument == 'function';
165
+ };
166
+
167
+ var isCallable$b = isCallable$c;
168
+ var $documentAll = documentAll_1;
169
+
170
+ var documentAll = $documentAll.all;
171
+
172
+ var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
173
+ return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
174
+ } : function (it) {
175
+ return typeof it == 'object' ? it !== null : isCallable$b(it);
176
+ };
177
+
178
+ var global$a = global$b;
179
+ var isCallable$a = isCallable$c;
180
+
181
+ var aFunction = function (argument) {
182
+ return isCallable$a(argument) ? argument : undefined;
183
+ };
184
+
185
+ var getBuiltIn$3 = function (namespace, method) {
186
+ return arguments.length < 2 ? aFunction(global$a[namespace]) : global$a[namespace] && global$a[namespace][method];
187
+ };
188
+
189
+ var uncurryThis$8 = functionUncurryThis;
190
+
191
+ var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
192
+
193
+ var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
194
+
195
+ var global$9 = global$b;
196
+ var userAgent = engineUserAgent;
197
+
198
+ var process = global$9.process;
199
+ var Deno = global$9.Deno;
200
+ var versions = process && process.versions || Deno && Deno.version;
201
+ var v8 = versions && versions.v8;
202
+ var match, version;
203
+
204
+ if (v8) {
205
+ match = v8.split('.');
206
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
207
+ // but their correct versions are not interesting for us
208
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
209
+ }
210
+
211
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
212
+ // so check `userAgent` even if `.v8` exists, but 0
213
+ if (!version && userAgent) {
214
+ match = userAgent.match(/Edge\/(\d+)/);
215
+ if (!match || match[1] >= 74) {
216
+ match = userAgent.match(/Chrome\/(\d+)/);
217
+ if (match) version = +match[1];
218
+ }
219
+ }
220
+
221
+ var engineV8Version = version;
222
+
223
+ /* eslint-disable es/no-symbol -- required for testing */
224
+ var V8_VERSION = engineV8Version;
225
+ var fails$8 = fails$c;
226
+ var global$8 = global$b;
227
+
228
+ var $String$4 = global$8.String;
229
+
230
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
231
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
232
+ var symbol = Symbol('symbol detection');
233
+ // Chrome 38 Symbol has incorrect toString conversion
234
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
235
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
236
+ // of course, fail.
237
+ return !$String$4(symbol) || !(Object(symbol) instanceof Symbol) ||
238
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
239
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
240
+ });
241
+
242
+ /* eslint-disable es/no-symbol -- required for testing */
243
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
244
+
245
+ var useSymbolAsUid = NATIVE_SYMBOL$1
246
+ && !Symbol.sham
247
+ && typeof Symbol.iterator == 'symbol';
248
+
249
+ var getBuiltIn$2 = getBuiltIn$3;
250
+ var isCallable$9 = isCallable$c;
251
+ var isPrototypeOf = objectIsPrototypeOf;
252
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
253
+
254
+ var $Object$3 = Object;
255
+
256
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
257
+ return typeof it == 'symbol';
258
+ } : function (it) {
259
+ var $Symbol = getBuiltIn$2('Symbol');
260
+ return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$3(it));
261
+ };
262
+
263
+ var $String$3 = String;
264
+
265
+ var tryToString$1 = function (argument) {
266
+ try {
267
+ return $String$3(argument);
268
+ } catch (error) {
269
+ return 'Object';
270
+ }
271
+ };
272
+
273
+ var isCallable$8 = isCallable$c;
274
+ var tryToString = tryToString$1;
275
+
276
+ var $TypeError$5 = TypeError;
277
+
278
+ // `Assert: IsCallable(argument) is true`
279
+ var aCallable$1 = function (argument) {
280
+ if (isCallable$8(argument)) return argument;
281
+ throw new $TypeError$5(tryToString(argument) + ' is not a function');
282
+ };
283
+
284
+ var aCallable = aCallable$1;
285
+ var isNullOrUndefined = isNullOrUndefined$2;
286
+
287
+ // `GetMethod` abstract operation
288
+ // https://tc39.es/ecma262/#sec-getmethod
289
+ var getMethod$1 = function (V, P) {
290
+ var func = V[P];
291
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
292
+ };
293
+
294
+ var call$4 = functionCall;
295
+ var isCallable$7 = isCallable$c;
296
+ var isObject$6 = isObject$7;
297
+
298
+ var $TypeError$4 = TypeError;
299
+
300
+ // `OrdinaryToPrimitive` abstract operation
301
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
302
+ var ordinaryToPrimitive$1 = function (input, pref) {
303
+ var fn, val;
304
+ if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$4(fn, input))) return val;
305
+ if (isCallable$7(fn = input.valueOf) && !isObject$6(val = call$4(fn, input))) return val;
306
+ if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$4(fn, input))) return val;
307
+ throw new $TypeError$4("Can't convert object to primitive value");
308
+ };
309
+
310
+ var shared$3 = {exports: {}};
311
+
312
+ var global$7 = global$b;
313
+
314
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
315
+ var defineProperty$3 = Object.defineProperty;
316
+
317
+ var defineGlobalProperty$3 = function (key, value) {
318
+ try {
319
+ defineProperty$3(global$7, key, { value: value, configurable: true, writable: true });
320
+ } catch (error) {
321
+ global$7[key] = value;
322
+ } return value;
323
+ };
324
+
325
+ var global$6 = global$b;
326
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
327
+
328
+ var SHARED = '__core-js_shared__';
329
+ var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
330
+
331
+ var sharedStore = store$3;
332
+
333
+ var store$2 = sharedStore;
334
+
335
+ (shared$3.exports = function (key, value) {
336
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
337
+ })('versions', []).push({
338
+ version: '3.33.2',
339
+ mode: 'global',
340
+ copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
341
+ license: 'https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE',
342
+ source: 'https://github.com/zloirock/core-js'
343
+ });
344
+
345
+ var requireObjectCoercible$1 = requireObjectCoercible$3;
346
+
347
+ var $Object$2 = Object;
348
+
349
+ // `ToObject` abstract operation
350
+ // https://tc39.es/ecma262/#sec-toobject
351
+ var toObject$3 = function (argument) {
352
+ return $Object$2(requireObjectCoercible$1(argument));
353
+ };
354
+
355
+ var uncurryThis$7 = functionUncurryThis;
356
+ var toObject$2 = toObject$3;
357
+
358
+ var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
359
+
360
+ // `HasOwnProperty` abstract operation
361
+ // https://tc39.es/ecma262/#sec-hasownproperty
362
+ // eslint-disable-next-line es/no-object-hasown -- safe
363
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
364
+ return hasOwnProperty(toObject$2(it), key);
365
+ };
366
+
367
+ var uncurryThis$6 = functionUncurryThis;
368
+
369
+ var id = 0;
370
+ var postfix = Math.random();
371
+ var toString$2 = uncurryThis$6(1.0.toString);
372
+
373
+ var uid$2 = function (key) {
374
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
375
+ };
376
+
377
+ var global$5 = global$b;
378
+ var shared$2 = shared$3.exports;
379
+ var hasOwn$8 = hasOwnProperty_1;
380
+ var uid$1 = uid$2;
381
+ var NATIVE_SYMBOL = symbolConstructorDetection;
382
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
383
+
384
+ var Symbol$1 = global$5.Symbol;
385
+ var WellKnownSymbolsStore = shared$2('wks');
386
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
387
+
388
+ var wellKnownSymbol$6 = function (name) {
389
+ if (!hasOwn$8(WellKnownSymbolsStore, name)) {
390
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)
391
+ ? Symbol$1[name]
392
+ : createWellKnownSymbol('Symbol.' + name);
393
+ } return WellKnownSymbolsStore[name];
394
+ };
395
+
396
+ var call$3 = functionCall;
397
+ var isObject$5 = isObject$7;
398
+ var isSymbol$1 = isSymbol$2;
399
+ var getMethod = getMethod$1;
400
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
401
+ var wellKnownSymbol$5 = wellKnownSymbol$6;
402
+
403
+ var $TypeError$3 = TypeError;
404
+ var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
405
+
406
+ // `ToPrimitive` abstract operation
407
+ // https://tc39.es/ecma262/#sec-toprimitive
408
+ var toPrimitive$1 = function (input, pref) {
409
+ if (!isObject$5(input) || isSymbol$1(input)) return input;
410
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
411
+ var result;
412
+ if (exoticToPrim) {
413
+ if (pref === undefined) pref = 'default';
414
+ result = call$3(exoticToPrim, input, pref);
415
+ if (!isObject$5(result) || isSymbol$1(result)) return result;
416
+ throw new $TypeError$3("Can't convert object to primitive value");
417
+ }
418
+ if (pref === undefined) pref = 'number';
419
+ return ordinaryToPrimitive(input, pref);
420
+ };
421
+
422
+ var toPrimitive = toPrimitive$1;
423
+ var isSymbol = isSymbol$2;
424
+
425
+ // `ToPropertyKey` abstract operation
426
+ // https://tc39.es/ecma262/#sec-topropertykey
427
+ var toPropertyKey$2 = function (argument) {
428
+ var key = toPrimitive(argument, 'string');
429
+ return isSymbol(key) ? key : key + '';
430
+ };
431
+
432
+ var global$4 = global$b;
433
+ var isObject$4 = isObject$7;
434
+
435
+ var document$1 = global$4.document;
436
+ // typeof document.createElement is 'object' in old IE
437
+ var EXISTS$1 = isObject$4(document$1) && isObject$4(document$1.createElement);
438
+
439
+ var documentCreateElement$1 = function (it) {
440
+ return EXISTS$1 ? document$1.createElement(it) : {};
441
+ };
442
+
443
+ var DESCRIPTORS$8 = descriptors;
444
+ var fails$7 = fails$c;
445
+ var createElement = documentCreateElement$1;
446
+
447
+ // Thanks to IE8 for its funny defineProperty
448
+ var ie8DomDefine = !DESCRIPTORS$8 && !fails$7(function () {
449
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
450
+ return Object.defineProperty(createElement('div'), 'a', {
451
+ get: function () { return 7; }
452
+ }).a !== 7;
453
+ });
454
+
455
+ var DESCRIPTORS$7 = descriptors;
456
+ var call$2 = functionCall;
457
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
458
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
459
+ var toIndexedObject$3 = toIndexedObject$4;
460
+ var toPropertyKey$1 = toPropertyKey$2;
461
+ var hasOwn$7 = hasOwnProperty_1;
462
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
463
+
464
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
465
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
466
+
467
+ // `Object.getOwnPropertyDescriptor` method
468
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
469
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$7 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
470
+ O = toIndexedObject$3(O);
471
+ P = toPropertyKey$1(P);
472
+ if (IE8_DOM_DEFINE$1) try {
473
+ return $getOwnPropertyDescriptor$1(O, P);
474
+ } catch (error) { /* empty */ }
475
+ if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
476
+ };
477
+
478
+ var objectDefineProperty = {};
479
+
480
+ var DESCRIPTORS$6 = descriptors;
481
+ var fails$6 = fails$c;
482
+
483
+ // V8 ~ Chrome 36-
484
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
485
+ var v8PrototypeDefineBug = DESCRIPTORS$6 && fails$6(function () {
486
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
487
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
488
+ value: 42,
489
+ writable: false
490
+ }).prototype !== 42;
491
+ });
492
+
493
+ var isObject$3 = isObject$7;
494
+
495
+ var $String$2 = String;
496
+ var $TypeError$2 = TypeError;
497
+
498
+ // `Assert: Type(argument) is Object`
499
+ var anObject$5 = function (argument) {
500
+ if (isObject$3(argument)) return argument;
501
+ throw new $TypeError$2($String$2(argument) + ' is not an object');
502
+ };
503
+
504
+ var DESCRIPTORS$5 = descriptors;
505
+ var IE8_DOM_DEFINE = ie8DomDefine;
506
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
507
+ var anObject$4 = anObject$5;
508
+ var toPropertyKey = toPropertyKey$2;
509
+
510
+ var $TypeError$1 = TypeError;
511
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
512
+ var $defineProperty = Object.defineProperty;
513
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
514
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
515
+ var ENUMERABLE = 'enumerable';
516
+ var CONFIGURABLE$1 = 'configurable';
517
+ var WRITABLE = 'writable';
518
+
519
+ // `Object.defineProperty` method
520
+ // https://tc39.es/ecma262/#sec-object.defineproperty
521
+ objectDefineProperty.f = DESCRIPTORS$5 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
522
+ anObject$4(O);
523
+ P = toPropertyKey(P);
524
+ anObject$4(Attributes);
525
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
526
+ var current = $getOwnPropertyDescriptor(O, P);
527
+ if (current && current[WRITABLE]) {
528
+ O[P] = Attributes.value;
529
+ Attributes = {
530
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
531
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
532
+ writable: false
533
+ };
534
+ }
535
+ } return $defineProperty(O, P, Attributes);
536
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
537
+ anObject$4(O);
538
+ P = toPropertyKey(P);
539
+ anObject$4(Attributes);
540
+ if (IE8_DOM_DEFINE) try {
541
+ return $defineProperty(O, P, Attributes);
542
+ } catch (error) { /* empty */ }
543
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$1('Accessors not supported');
544
+ if ('value' in Attributes) O[P] = Attributes.value;
545
+ return O;
546
+ };
547
+
548
+ var DESCRIPTORS$4 = descriptors;
549
+ var definePropertyModule$4 = objectDefineProperty;
550
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
551
+
552
+ var createNonEnumerableProperty$2 = DESCRIPTORS$4 ? function (object, key, value) {
553
+ return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
554
+ } : function (object, key, value) {
555
+ object[key] = value;
556
+ return object;
557
+ };
558
+
559
+ var makeBuiltIn$2 = {exports: {}};
560
+
561
+ var DESCRIPTORS$3 = descriptors;
562
+ var hasOwn$6 = hasOwnProperty_1;
563
+
564
+ var FunctionPrototype = Function.prototype;
565
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
566
+ var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
567
+
568
+ var EXISTS = hasOwn$6(FunctionPrototype, 'name');
569
+ // additional protection from minified / mangled / dropped function names
570
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
571
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype, 'name').configurable));
572
+
573
+ var functionName = {
574
+ EXISTS: EXISTS,
575
+ PROPER: PROPER,
576
+ CONFIGURABLE: CONFIGURABLE
577
+ };
578
+
579
+ var uncurryThis$5 = functionUncurryThis;
580
+ var isCallable$6 = isCallable$c;
581
+ var store$1 = sharedStore;
582
+
583
+ var functionToString = uncurryThis$5(Function.toString);
584
+
585
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
586
+ if (!isCallable$6(store$1.inspectSource)) {
587
+ store$1.inspectSource = function (it) {
588
+ return functionToString(it);
589
+ };
590
+ }
591
+
592
+ var inspectSource$1 = store$1.inspectSource;
593
+
594
+ var global$3 = global$b;
595
+ var isCallable$5 = isCallable$c;
596
+
597
+ var WeakMap$1 = global$3.WeakMap;
598
+
599
+ var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
600
+
601
+ var shared$1 = shared$3.exports;
602
+ var uid = uid$2;
603
+
604
+ var keys = shared$1('keys');
605
+
606
+ var sharedKey$3 = function (key) {
607
+ return keys[key] || (keys[key] = uid(key));
608
+ };
609
+
610
+ var hiddenKeys$4 = {};
611
+
612
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
613
+ var global$2 = global$b;
614
+ var isObject$2 = isObject$7;
615
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
616
+ var hasOwn$5 = hasOwnProperty_1;
617
+ var shared = sharedStore;
618
+ var sharedKey$2 = sharedKey$3;
619
+ var hiddenKeys$3 = hiddenKeys$4;
620
+
621
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
622
+ var TypeError$1 = global$2.TypeError;
623
+ var WeakMap = global$2.WeakMap;
624
+ var set$1, get, has;
625
+
626
+ var enforce = function (it) {
627
+ return has(it) ? get(it) : set$1(it, {});
628
+ };
629
+
630
+ var getterFor = function (TYPE) {
631
+ return function (it) {
632
+ var state;
633
+ if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
634
+ throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
635
+ } return state;
636
+ };
637
+ };
638
+
639
+ if (NATIVE_WEAK_MAP || shared.state) {
640
+ var store = shared.state || (shared.state = new WeakMap());
641
+ /* eslint-disable no-self-assign -- prototype methods protection */
642
+ store.get = store.get;
643
+ store.has = store.has;
644
+ store.set = store.set;
645
+ /* eslint-enable no-self-assign -- prototype methods protection */
646
+ set$1 = function (it, metadata) {
647
+ if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
648
+ metadata.facade = it;
649
+ store.set(it, metadata);
650
+ return metadata;
651
+ };
652
+ get = function (it) {
653
+ return store.get(it) || {};
654
+ };
655
+ has = function (it) {
656
+ return store.has(it);
657
+ };
658
+ } else {
659
+ var STATE = sharedKey$2('state');
660
+ hiddenKeys$3[STATE] = true;
661
+ set$1 = function (it, metadata) {
662
+ if (hasOwn$5(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
663
+ metadata.facade = it;
664
+ createNonEnumerableProperty$1(it, STATE, metadata);
665
+ return metadata;
666
+ };
667
+ get = function (it) {
668
+ return hasOwn$5(it, STATE) ? it[STATE] : {};
669
+ };
670
+ has = function (it) {
671
+ return hasOwn$5(it, STATE);
672
+ };
673
+ }
674
+
675
+ var internalState = {
676
+ set: set$1,
677
+ get: get,
678
+ has: has,
679
+ enforce: enforce,
680
+ getterFor: getterFor
681
+ };
682
+
683
+ var uncurryThis$4 = functionUncurryThis;
684
+ var fails$5 = fails$c;
685
+ var isCallable$4 = isCallable$c;
686
+ var hasOwn$4 = hasOwnProperty_1;
687
+ var DESCRIPTORS$2 = descriptors;
688
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
689
+ var inspectSource = inspectSource$1;
690
+ var InternalStateModule = internalState;
691
+
692
+ var enforceInternalState = InternalStateModule.enforce;
693
+ var getInternalState = InternalStateModule.get;
694
+ var $String$1 = String;
695
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
696
+ var defineProperty$2 = Object.defineProperty;
697
+ var stringSlice = uncurryThis$4(''.slice);
698
+ var replace = uncurryThis$4(''.replace);
699
+ var join = uncurryThis$4([].join);
700
+
701
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$5(function () {
702
+ return defineProperty$2(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
703
+ });
704
+
705
+ var TEMPLATE = String(String).split('String');
706
+
707
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
708
+ if (stringSlice($String$1(name), 0, 7) === 'Symbol(') {
709
+ name = '[' + replace($String$1(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
710
+ }
711
+ if (options && options.getter) name = 'get ' + name;
712
+ if (options && options.setter) name = 'set ' + name;
713
+ if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
714
+ if (DESCRIPTORS$2) defineProperty$2(value, 'name', { value: name, configurable: true });
715
+ else value.name = name;
716
+ }
717
+ if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
718
+ defineProperty$2(value, 'length', { value: options.arity });
719
+ }
720
+ try {
721
+ if (options && hasOwn$4(options, 'constructor') && options.constructor) {
722
+ if (DESCRIPTORS$2) defineProperty$2(value, 'prototype', { writable: false });
723
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
724
+ } else if (value.prototype) value.prototype = undefined;
725
+ } catch (error) { /* empty */ }
726
+ var state = enforceInternalState(value);
727
+ if (!hasOwn$4(state, 'source')) {
728
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
729
+ } return value;
730
+ };
731
+
732
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
733
+ // eslint-disable-next-line no-extend-native -- required
734
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
735
+ return isCallable$4(this) && getInternalState(this).source || inspectSource(this);
736
+ }, 'toString');
737
+
738
+ var isCallable$3 = isCallable$c;
739
+ var definePropertyModule$3 = objectDefineProperty;
740
+ var makeBuiltIn = makeBuiltIn$2.exports;
741
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
742
+
743
+ var defineBuiltIn$1 = function (O, key, value, options) {
744
+ if (!options) options = {};
745
+ var simple = options.enumerable;
746
+ var name = options.name !== undefined ? options.name : key;
747
+ if (isCallable$3(value)) makeBuiltIn(value, name, options);
748
+ if (options.global) {
749
+ if (simple) O[key] = value;
750
+ else defineGlobalProperty$1(key, value);
751
+ } else {
752
+ try {
753
+ if (!options.unsafe) delete O[key];
754
+ else if (O[key]) simple = true;
755
+ } catch (error) { /* empty */ }
756
+ if (simple) O[key] = value;
757
+ else definePropertyModule$3.f(O, key, {
758
+ value: value,
759
+ enumerable: false,
760
+ configurable: !options.nonConfigurable,
761
+ writable: !options.nonWritable
762
+ });
763
+ } return O;
764
+ };
765
+
766
+ var objectGetOwnPropertyNames = {};
767
+
768
+ var ceil = Math.ceil;
769
+ var floor = Math.floor;
770
+
771
+ // `Math.trunc` method
772
+ // https://tc39.es/ecma262/#sec-math.trunc
773
+ // eslint-disable-next-line es/no-math-trunc -- safe
774
+ var mathTrunc = Math.trunc || function trunc(x) {
775
+ var n = +x;
776
+ return (n > 0 ? floor : ceil)(n);
777
+ };
778
+
779
+ var trunc = mathTrunc;
780
+
781
+ // `ToIntegerOrInfinity` abstract operation
782
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
783
+ var toIntegerOrInfinity$2 = function (argument) {
784
+ var number = +argument;
785
+ // eslint-disable-next-line no-self-compare -- NaN check
786
+ return number !== number || number === 0 ? 0 : trunc(number);
787
+ };
788
+
789
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
790
+
791
+ var max = Math.max;
792
+ var min$1 = Math.min;
793
+
794
+ // Helper for a popular repeating case of the spec:
795
+ // Let integer be ? ToInteger(index).
796
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
797
+ var toAbsoluteIndex$1 = function (index, length) {
798
+ var integer = toIntegerOrInfinity$1(index);
799
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
800
+ };
801
+
802
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
803
+
804
+ var min = Math.min;
805
+
806
+ // `ToLength` abstract operation
807
+ // https://tc39.es/ecma262/#sec-tolength
808
+ var toLength$1 = function (argument) {
809
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
810
+ };
811
+
812
+ var toLength = toLength$1;
813
+
814
+ // `LengthOfArrayLike` abstract operation
815
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
816
+ var lengthOfArrayLike$1 = function (obj) {
817
+ return toLength(obj.length);
818
+ };
819
+
820
+ var toIndexedObject$2 = toIndexedObject$4;
821
+ var toAbsoluteIndex = toAbsoluteIndex$1;
822
+ var lengthOfArrayLike = lengthOfArrayLike$1;
823
+
824
+ // `Array.prototype.{ indexOf, includes }` methods implementation
825
+ var createMethod = function (IS_INCLUDES) {
826
+ return function ($this, el, fromIndex) {
827
+ var O = toIndexedObject$2($this);
828
+ var length = lengthOfArrayLike(O);
829
+ var index = toAbsoluteIndex(fromIndex, length);
830
+ var value;
831
+ // Array#includes uses SameValueZero equality algorithm
832
+ // eslint-disable-next-line no-self-compare -- NaN check
833
+ if (IS_INCLUDES && el !== el) while (length > index) {
834
+ value = O[index++];
835
+ // eslint-disable-next-line no-self-compare -- NaN check
836
+ if (value !== value) return true;
837
+ // Array#indexOf ignores holes, Array#includes - not
838
+ } else for (;length > index; index++) {
839
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
840
+ } return !IS_INCLUDES && -1;
841
+ };
842
+ };
843
+
844
+ var arrayIncludes = {
845
+ // `Array.prototype.includes` method
846
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
847
+ includes: createMethod(true),
848
+ // `Array.prototype.indexOf` method
849
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
850
+ indexOf: createMethod(false)
851
+ };
852
+
853
+ var uncurryThis$3 = functionUncurryThis;
854
+ var hasOwn$3 = hasOwnProperty_1;
855
+ var toIndexedObject$1 = toIndexedObject$4;
856
+ var indexOf = arrayIncludes.indexOf;
857
+ var hiddenKeys$2 = hiddenKeys$4;
858
+
859
+ var push = uncurryThis$3([].push);
860
+
861
+ var objectKeysInternal = function (object, names) {
862
+ var O = toIndexedObject$1(object);
863
+ var i = 0;
864
+ var result = [];
865
+ var key;
866
+ for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push(result, key);
867
+ // Don't enum bug & hidden keys
868
+ while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
869
+ ~indexOf(result, key) || push(result, key);
870
+ }
871
+ return result;
872
+ };
873
+
874
+ // IE8- don't enum bug keys
875
+ var enumBugKeys$3 = [
876
+ 'constructor',
877
+ 'hasOwnProperty',
878
+ 'isPrototypeOf',
879
+ 'propertyIsEnumerable',
880
+ 'toLocaleString',
881
+ 'toString',
882
+ 'valueOf'
883
+ ];
884
+
885
+ var internalObjectKeys$1 = objectKeysInternal;
886
+ var enumBugKeys$2 = enumBugKeys$3;
887
+
888
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
889
+
890
+ // `Object.getOwnPropertyNames` method
891
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
892
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
893
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
894
+ return internalObjectKeys$1(O, hiddenKeys$1);
895
+ };
896
+
897
+ var objectGetOwnPropertySymbols = {};
898
+
899
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
900
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
901
+
902
+ var getBuiltIn$1 = getBuiltIn$3;
903
+ var uncurryThis$2 = functionUncurryThis;
904
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
905
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
906
+ var anObject$3 = anObject$5;
907
+
908
+ var concat$1 = uncurryThis$2([].concat);
909
+
910
+ // all object keys, includes non-enumerable and symbols
911
+ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
912
+ var keys = getOwnPropertyNamesModule.f(anObject$3(it));
913
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
914
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
915
+ };
916
+
917
+ var hasOwn$2 = hasOwnProperty_1;
918
+ var ownKeys = ownKeys$1;
919
+ var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
920
+ var definePropertyModule$2 = objectDefineProperty;
921
+
922
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
923
+ var keys = ownKeys(source);
924
+ var defineProperty = definePropertyModule$2.f;
925
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$1.f;
926
+ for (var i = 0; i < keys.length; i++) {
927
+ var key = keys[i];
928
+ if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
929
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
930
+ }
931
+ }
932
+ };
933
+
934
+ var fails$4 = fails$c;
935
+ var isCallable$2 = isCallable$c;
936
+
937
+ var replacement = /#|\.prototype\./;
938
+
939
+ var isForced$1 = function (feature, detection) {
940
+ var value = data[normalize(feature)];
941
+ return value === POLYFILL ? true
942
+ : value === NATIVE ? false
943
+ : isCallable$2(detection) ? fails$4(detection)
944
+ : !!detection;
945
+ };
946
+
947
+ var normalize = isForced$1.normalize = function (string) {
948
+ return String(string).replace(replacement, '.').toLowerCase();
949
+ };
950
+
951
+ var data = isForced$1.data = {};
952
+ var NATIVE = isForced$1.NATIVE = 'N';
953
+ var POLYFILL = isForced$1.POLYFILL = 'P';
954
+
955
+ var isForced_1 = isForced$1;
956
+
957
+ var global$1 = global$b;
958
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
959
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
960
+ var defineBuiltIn = defineBuiltIn$1;
961
+ var defineGlobalProperty = defineGlobalProperty$3;
962
+ var copyConstructorProperties = copyConstructorProperties$1;
963
+ var isForced = isForced_1;
964
+
965
+ /*
966
+ options.target - name of the target object
967
+ options.global - target is the global object
968
+ options.stat - export as static methods of target
969
+ options.proto - export as prototype methods of target
970
+ options.real - real prototype method for the `pure` version
971
+ options.forced - export even if the native feature is available
972
+ options.bind - bind methods to the target, required for the `pure` version
973
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
974
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
975
+ options.sham - add a flag to not completely full polyfills
976
+ options.enumerable - export as enumerable property
977
+ options.dontCallGetSet - prevent calling a getter on target
978
+ options.name - the .name of the function if it does not match the key
979
+ */
980
+ var _export = function (options, source) {
981
+ var TARGET = options.target;
982
+ var GLOBAL = options.global;
983
+ var STATIC = options.stat;
984
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
985
+ if (GLOBAL) {
986
+ target = global$1;
987
+ } else if (STATIC) {
988
+ target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
989
+ } else {
990
+ target = (global$1[TARGET] || {}).prototype;
991
+ }
992
+ if (target) for (key in source) {
993
+ sourceProperty = source[key];
994
+ if (options.dontCallGetSet) {
995
+ descriptor = getOwnPropertyDescriptor(target, key);
996
+ targetProperty = descriptor && descriptor.value;
997
+ } else targetProperty = target[key];
998
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
999
+ // contained in target
1000
+ if (!FORCED && targetProperty !== undefined) {
1001
+ if (typeof sourceProperty == typeof targetProperty) continue;
1002
+ copyConstructorProperties(sourceProperty, targetProperty);
1003
+ }
1004
+ // add a flag to not completely full polyfills
1005
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1006
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
1007
+ }
1008
+ defineBuiltIn(target, key, sourceProperty, options);
1009
+ }
1010
+ };
1011
+
1012
+ var internalObjectKeys = objectKeysInternal;
1013
+ var enumBugKeys$1 = enumBugKeys$3;
1014
+
1015
+ // `Object.keys` method
1016
+ // https://tc39.es/ecma262/#sec-object.keys
1017
+ // eslint-disable-next-line es/no-object-keys -- safe
1018
+ var objectKeys$2 = Object.keys || function keys(O) {
1019
+ return internalObjectKeys(O, enumBugKeys$1);
1020
+ };
1021
+
1022
+ var DESCRIPTORS$1 = descriptors;
1023
+ var uncurryThis$1 = functionUncurryThis;
1024
+ var call$1 = functionCall;
1025
+ var fails$3 = fails$c;
1026
+ var objectKeys$1 = objectKeys$2;
1027
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1028
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1029
+ var toObject$1 = toObject$3;
1030
+ var IndexedObject = indexedObject;
1031
+
1032
+ // eslint-disable-next-line es/no-object-assign -- safe
1033
+ var $assign = Object.assign;
1034
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1035
+ var defineProperty$1 = Object.defineProperty;
1036
+ var concat = uncurryThis$1([].concat);
1037
+
1038
+ // `Object.assign` method
1039
+ // https://tc39.es/ecma262/#sec-object.assign
1040
+ var objectAssign = !$assign || fails$3(function () {
1041
+ // should have correct order of operations (Edge bug)
1042
+ if (DESCRIPTORS$1 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
1043
+ enumerable: true,
1044
+ get: function () {
1045
+ defineProperty$1(this, 'b', {
1046
+ value: 3,
1047
+ enumerable: false
1048
+ });
1049
+ }
1050
+ }), { b: 2 })).b !== 1) return true;
1051
+ // should work with symbols and should have deterministic property order (V8 bug)
1052
+ var A = {};
1053
+ var B = {};
1054
+ // eslint-disable-next-line es/no-symbol -- safe
1055
+ var symbol = Symbol('assign detection');
1056
+ var alphabet = 'abcdefghijklmnopqrst';
1057
+ A[symbol] = 7;
1058
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1059
+ return $assign({}, A)[symbol] !== 7 || objectKeys$1($assign({}, B)).join('') !== alphabet;
1060
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1061
+ var T = toObject$1(target);
1062
+ var argumentsLength = arguments.length;
1063
+ var index = 1;
1064
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1065
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1066
+ while (argumentsLength > index) {
1067
+ var S = IndexedObject(arguments[index++]);
1068
+ var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1069
+ var length = keys.length;
1070
+ var j = 0;
1071
+ var key;
1072
+ while (length > j) {
1073
+ key = keys[j++];
1074
+ if (!DESCRIPTORS$1 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1075
+ }
1076
+ } return T;
1077
+ } : $assign;
1078
+
1079
+ var $$3 = _export;
1080
+ var assign = objectAssign;
1081
+
1082
+ // `Object.assign` method
1083
+ // https://tc39.es/ecma262/#sec-object.assign
1084
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1085
+ $$3({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1086
+ assign: assign
1087
+ });
1088
+
1089
+ /******************************************************************************
1090
+ Copyright (c) Microsoft Corporation.
1091
+
1092
+ Permission to use, copy, modify, and/or distribute this software for any
1093
+ purpose with or without fee is hereby granted.
1094
+
1095
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1096
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1097
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1098
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1099
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1100
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1101
+ PERFORMANCE OF THIS SOFTWARE.
1102
+ ***************************************************************************** */
1103
+
1104
+ function __rest(s, e) {
1105
+ var t = {};
1106
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1107
+ t[p] = s[p];
1108
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1109
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1110
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1111
+ t[p[i]] = s[p[i]];
1112
+ }
1113
+ return t;
1114
+ }
1115
+
1116
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1117
+ var e = new Error(message);
1118
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1119
+ };
1120
+
1121
+ const initScripts = () => {
1122
+ var _a;
1123
+ const widgetcsslink = document.createElement('link');
1124
+ const link = document.getElementsByTagName('link')[0];
1125
+ const mainurl = "https://widget.archbee.com/v1";
1126
+ widgetcsslink['rel'] = 'stylesheet';
1127
+ widgetcsslink['href'] = `${mainurl}/main.css`;
1128
+ if (!link) {
1129
+ document.getElementsByTagName('head')[0].append(widgetcsslink);
1130
+ }
1131
+ (_a = link === null || link === void 0 ? void 0 : link.parentNode) === null || _a === void 0 ? void 0 : _a.appendChild(widgetcsslink);
1132
+ };
1133
+ const initJsScripts = loadingStrategy => {
1134
+ var _a;
1135
+ const mainUrl = "https://widget.archbee.com/v1";
1136
+ let scripttag = document.createElement('script');
1137
+ scripttag['async'] = loadingStrategy === 'lazy';
1138
+ scripttag['src'] = `${mainUrl}/main.js`;
1139
+ const script = document.getElementsByTagName('script')[0];
1140
+ (_a = script === null || script === void 0 ? void 0 : script.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(scripttag, script);
1141
+ };
1142
+ const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'lazy', bubble = 'invisible', anchor) => {
1143
+ if (!window._archbee) {
1144
+ window._archbee = window._archbee || {
1145
+ queue: [],
1146
+ push: function (event) {
1147
+ window._archbee.queue.push(event);
1148
+ }
1149
+ };
1150
+ window._archbee.push({
1151
+ eventType: 'init',
1152
+ spaceId,
1153
+ jwt,
1154
+ shareableToken,
1155
+ bubble,
1156
+ anchor
1157
+ });
1158
+ initJsScripts(loadingStrategy);
1159
+ }
1160
+ return window._archbee;
1161
+ };
1162
+
1163
+ var hasOwn$1 = hasOwnProperty_1;
1164
+
1165
+ var isDataDescriptor$1 = function (descriptor) {
1166
+ return descriptor !== undefined && (hasOwn$1(descriptor, 'value') || hasOwn$1(descriptor, 'writable'));
1167
+ };
1168
+
1169
+ var fails$2 = fails$c;
1170
+
1171
+ var correctPrototypeGetter = !fails$2(function () {
1172
+ function F() { /* empty */ }
1173
+ F.prototype.constructor = null;
1174
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1175
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1176
+ });
1177
+
1178
+ var hasOwn = hasOwnProperty_1;
1179
+ var isCallable$1 = isCallable$c;
1180
+ var toObject = toObject$3;
1181
+ var sharedKey$1 = sharedKey$3;
1182
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1183
+
1184
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1185
+ var $Object$1 = Object;
1186
+ var ObjectPrototype = $Object$1.prototype;
1187
+
1188
+ // `Object.getPrototypeOf` method
1189
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1190
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1191
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1192
+ var object = toObject(O);
1193
+ if (hasOwn(object, IE_PROTO$1)) return object[IE_PROTO$1];
1194
+ var constructor = object.constructor;
1195
+ if (isCallable$1(constructor) && object instanceof constructor) {
1196
+ return constructor.prototype;
1197
+ } return object instanceof $Object$1 ? ObjectPrototype : null;
1198
+ };
1199
+
1200
+ var $$2 = _export;
1201
+ var call = functionCall;
1202
+ var anObject$2 = anObject$5;
1203
+ var isObject$1 = isObject$7;
1204
+ var isDataDescriptor = isDataDescriptor$1;
1205
+ var fails$1 = fails$c;
1206
+ var definePropertyModule$1 = objectDefineProperty;
1207
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1208
+ var getPrototypeOf = objectGetPrototypeOf;
1209
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1210
+
1211
+ // `Reflect.set` method
1212
+ // https://tc39.es/ecma262/#sec-reflect.set
1213
+ function set(target, propertyKey, V /* , receiver */) {
1214
+ var receiver = arguments.length < 4 ? target : arguments[3];
1215
+ var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject$2(target), propertyKey);
1216
+ var existingDescriptor, prototype, setter;
1217
+ if (!ownDescriptor) {
1218
+ if (isObject$1(prototype = getPrototypeOf(target))) {
1219
+ return set(prototype, propertyKey, V, receiver);
1220
+ }
1221
+ ownDescriptor = createPropertyDescriptor(0);
1222
+ }
1223
+ if (isDataDescriptor(ownDescriptor)) {
1224
+ if (ownDescriptor.writable === false || !isObject$1(receiver)) return false;
1225
+ if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
1226
+ if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
1227
+ existingDescriptor.value = V;
1228
+ definePropertyModule$1.f(receiver, propertyKey, existingDescriptor);
1229
+ } else definePropertyModule$1.f(receiver, propertyKey, createPropertyDescriptor(0, V));
1230
+ } else {
1231
+ setter = ownDescriptor.set;
1232
+ if (setter === undefined) return false;
1233
+ call(setter, receiver, V);
1234
+ } return true;
1235
+ }
1236
+
1237
+ // MS Edge 17-18 Reflect.set allows setting the property to object
1238
+ // with non-writable property on the prototype
1239
+ var MS_EDGE_BUG = fails$1(function () {
1240
+ var Constructor = function () { /* empty */ };
1241
+ var object = definePropertyModule$1.f(new Constructor(), 'a', { configurable: true });
1242
+ // eslint-disable-next-line es/no-reflect -- required for testing
1243
+ return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;
1244
+ });
1245
+
1246
+ $$2({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
1247
+ set: set
1248
+ });
1249
+
1250
+ var objectDefineProperties = {};
1251
+
1252
+ var DESCRIPTORS = descriptors;
1253
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1254
+ var definePropertyModule = objectDefineProperty;
1255
+ var anObject$1 = anObject$5;
1256
+ var toIndexedObject = toIndexedObject$4;
1257
+ var objectKeys = objectKeys$2;
1258
+
1259
+ // `Object.defineProperties` method
1260
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1261
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
1262
+ objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1263
+ anObject$1(O);
1264
+ var props = toIndexedObject(Properties);
1265
+ var keys = objectKeys(Properties);
1266
+ var length = keys.length;
1267
+ var index = 0;
1268
+ var key;
1269
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1270
+ return O;
1271
+ };
1272
+
1273
+ var getBuiltIn = getBuiltIn$3;
1274
+
1275
+ var html$1 = getBuiltIn('document', 'documentElement');
1276
+
1277
+ /* global ActiveXObject -- old IE, WSH */
1278
+ var anObject = anObject$5;
1279
+ var definePropertiesModule = objectDefineProperties;
1280
+ var enumBugKeys = enumBugKeys$3;
1281
+ var hiddenKeys = hiddenKeys$4;
1282
+ var html = html$1;
1283
+ var documentCreateElement = documentCreateElement$1;
1284
+ var sharedKey = sharedKey$3;
1285
+
1286
+ var GT = '>';
1287
+ var LT = '<';
1288
+ var PROTOTYPE = 'prototype';
1289
+ var SCRIPT = 'script';
1290
+ var IE_PROTO = sharedKey('IE_PROTO');
1291
+
1292
+ var EmptyConstructor = function () { /* empty */ };
1293
+
1294
+ var scriptTag = function (content) {
1295
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1296
+ };
1297
+
1298
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1299
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1300
+ activeXDocument.write(scriptTag(''));
1301
+ activeXDocument.close();
1302
+ var temp = activeXDocument.parentWindow.Object;
1303
+ activeXDocument = null; // avoid memory leak
1304
+ return temp;
1305
+ };
1306
+
1307
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1308
+ var NullProtoObjectViaIFrame = function () {
1309
+ // Thrash, waste and sodomy: IE GC bug
1310
+ var iframe = documentCreateElement('iframe');
1311
+ var JS = 'java' + SCRIPT + ':';
1312
+ var iframeDocument;
1313
+ iframe.style.display = 'none';
1314
+ html.appendChild(iframe);
1315
+ // https://github.com/zloirock/core-js/issues/475
1316
+ iframe.src = String(JS);
1317
+ iframeDocument = iframe.contentWindow.document;
1318
+ iframeDocument.open();
1319
+ iframeDocument.write(scriptTag('document.F=Object'));
1320
+ iframeDocument.close();
1321
+ return iframeDocument.F;
1322
+ };
1323
+
1324
+ // Check for document.domain and active x support
1325
+ // No need to use active x approach when document.domain is not set
1326
+ // see https://github.com/es-shims/es5-shim/issues/150
1327
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1328
+ // avoid IE GC bug
1329
+ var activeXDocument;
1330
+ var NullProtoObject = function () {
1331
+ try {
1332
+ activeXDocument = new ActiveXObject('htmlfile');
1333
+ } catch (error) { /* ignore */ }
1334
+ NullProtoObject = typeof document != 'undefined'
1335
+ ? document.domain && activeXDocument
1336
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1337
+ : NullProtoObjectViaIFrame()
1338
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1339
+ var length = enumBugKeys.length;
1340
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1341
+ return NullProtoObject();
1342
+ };
1343
+
1344
+ hiddenKeys[IE_PROTO] = true;
1345
+
1346
+ // `Object.create` method
1347
+ // https://tc39.es/ecma262/#sec-object.create
1348
+ // eslint-disable-next-line es/no-object-create -- safe
1349
+ var objectCreate = Object.create || function create(O, Properties) {
1350
+ var result;
1351
+ if (O !== null) {
1352
+ EmptyConstructor[PROTOTYPE] = anObject(O);
1353
+ result = new EmptyConstructor();
1354
+ EmptyConstructor[PROTOTYPE] = null;
1355
+ // add "__proto__" for Object.getPrototypeOf polyfill
1356
+ result[IE_PROTO] = O;
1357
+ } else result = NullProtoObject();
1358
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1359
+ };
1360
+
1361
+ var wellKnownSymbol$4 = wellKnownSymbol$6;
1362
+ var create = objectCreate;
1363
+ var defineProperty = objectDefineProperty.f;
1364
+
1365
+ var UNSCOPABLES = wellKnownSymbol$4('unscopables');
1366
+ var ArrayPrototype = Array.prototype;
1367
+
1368
+ // Array.prototype[@@unscopables]
1369
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1370
+ if (ArrayPrototype[UNSCOPABLES] === undefined) {
1371
+ defineProperty(ArrayPrototype, UNSCOPABLES, {
1372
+ configurable: true,
1373
+ value: create(null)
1374
+ });
1375
+ }
1376
+
1377
+ // add a key to Array.prototype[@@unscopables]
1378
+ var addToUnscopables$1 = function (key) {
1379
+ ArrayPrototype[UNSCOPABLES][key] = true;
1380
+ };
1381
+
1382
+ var $$1 = _export;
1383
+ var $includes = arrayIncludes.includes;
1384
+ var fails = fails$c;
1385
+ var addToUnscopables = addToUnscopables$1;
1386
+
1387
+ // FF99+ bug
1388
+ var BROKEN_ON_SPARSE = fails(function () {
1389
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
1390
+ return !Array(1).includes();
1391
+ });
1392
+
1393
+ // `Array.prototype.includes` method
1394
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
1395
+ $$1({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1396
+ includes: function includes(el /* , fromIndex = 0 */) {
1397
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1398
+ }
1399
+ });
1400
+
1401
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1402
+ addToUnscopables('includes');
1403
+
1404
+ var isObject = isObject$7;
1405
+ var classof$2 = classofRaw$1;
1406
+ var wellKnownSymbol$3 = wellKnownSymbol$6;
1407
+
1408
+ var MATCH$1 = wellKnownSymbol$3('match');
1409
+
1410
+ // `IsRegExp` abstract operation
1411
+ // https://tc39.es/ecma262/#sec-isregexp
1412
+ var isRegexp = function (it) {
1413
+ var isRegExp;
1414
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$2(it) === 'RegExp');
1415
+ };
1416
+
1417
+ var isRegExp = isRegexp;
1418
+
1419
+ var $TypeError = TypeError;
1420
+
1421
+ var notARegexp = function (it) {
1422
+ if (isRegExp(it)) {
1423
+ throw new $TypeError("The method doesn't accept regular expressions");
1424
+ } return it;
1425
+ };
1426
+
1427
+ var wellKnownSymbol$2 = wellKnownSymbol$6;
1428
+
1429
+ var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
1430
+ var test = {};
1431
+
1432
+ test[TO_STRING_TAG$1] = 'z';
1433
+
1434
+ var toStringTagSupport = String(test) === '[object z]';
1435
+
1436
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1437
+ var isCallable = isCallable$c;
1438
+ var classofRaw = classofRaw$1;
1439
+ var wellKnownSymbol$1 = wellKnownSymbol$6;
1440
+
1441
+ var TO_STRING_TAG = wellKnownSymbol$1('toStringTag');
1442
+ var $Object = Object;
1443
+
1444
+ // ES3 wrong here
1445
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
1446
+
1447
+ // fallback for IE11 Script Access Denied error
1448
+ var tryGet = function (it, key) {
1449
+ try {
1450
+ return it[key];
1451
+ } catch (error) { /* empty */ }
1452
+ };
1453
+
1454
+ // getting tag from ES6+ `Object.prototype.toString`
1455
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1456
+ var O, tag, result;
1457
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1458
+ // @@toStringTag case
1459
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1460
+ // builtinTag case
1461
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1462
+ // ES3 arguments fallback
1463
+ : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1464
+ };
1465
+
1466
+ var classof = classof$1;
1467
+
1468
+ var $String = String;
1469
+
1470
+ var toString$1 = function (argument) {
1471
+ if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1472
+ return $String(argument);
1473
+ };
1474
+
1475
+ var wellKnownSymbol = wellKnownSymbol$6;
1476
+
1477
+ var MATCH = wellKnownSymbol('match');
1478
+
1479
+ var correctIsRegexpLogic = function (METHOD_NAME) {
1480
+ var regexp = /./;
1481
+ try {
1482
+ '/./'[METHOD_NAME](regexp);
1483
+ } catch (error1) {
1484
+ try {
1485
+ regexp[MATCH] = false;
1486
+ return '/./'[METHOD_NAME](regexp);
1487
+ } catch (error2) { /* empty */ }
1488
+ } return false;
1489
+ };
1490
+
1491
+ var $ = _export;
1492
+ var uncurryThis = functionUncurryThis;
1493
+ var notARegExp = notARegexp;
1494
+ var requireObjectCoercible = requireObjectCoercible$3;
1495
+ var toString = toString$1;
1496
+ var correctIsRegExpLogic = correctIsRegexpLogic;
1497
+
1498
+ var stringIndexOf = uncurryThis(''.indexOf);
1499
+
1500
+ // `String.prototype.includes` method
1501
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
1502
+ $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1503
+ includes: function includes(searchString /* , position = 0 */) {
1504
+ return !!~stringIndexOf(
1505
+ toString(requireObjectCoercible(this)),
1506
+ toString(notARegExp(searchString)),
1507
+ arguments.length > 1 ? arguments[1] : undefined
1508
+ );
1509
+ }
1510
+ });
1511
+
1512
+ var EVENT_TYPE_ENUM;
1513
+ (function (EVENT_TYPE_ENUM) {
1514
+ EVENT_TYPE_ENUM["init"] = "init";
1515
+ EVENT_TYPE_ENUM["showWidget"] = "show-widget";
1516
+ EVENT_TYPE_ENUM["hideWidget"] = "hide-widget";
1517
+ })(EVENT_TYPE_ENUM || (EVENT_TYPE_ENUM = {}));
1518
+ const EVENT_TYPE_LIST = [EVENT_TYPE_ENUM.init, EVENT_TYPE_ENUM.showWidget, EVENT_TYPE_ENUM.hideWidget];
1519
+ const showWidgetEvent = () => {
1520
+ if (typeof window === 'undefined') return;
1521
+ return new CustomEvent(EVENT_TYPE_ENUM.showWidget);
1522
+ };
1523
+ const hideWidgetEvent = () => {
1524
+ if (typeof window === 'undefined') return;
1525
+ return new CustomEvent(EVENT_TYPE_ENUM.hideWidget);
1526
+ };
1527
+
1528
+ const render = (component, createContainer, cb) => {
1529
+ createContainer();
1530
+ const element = document.getElementsByClassName('ab-widget')[0];
1531
+ ReactDOM.render(jsx(React.StrictMode, {
1532
+ children: component
1533
+ }), element, () => cb && cb(element));
1534
+ };
1535
+
1536
+ const setWidget = widget => {
1537
+ window._archbee.widget = Object.assign({}, widget);
1538
+ window._archbee.widget.isOpen = false;
1539
+ };
1540
+ const loadWidget = (widg, render) => {
1541
+ var _a;
1542
+ if (typeof document.addEventListener !== 'function') {
1543
+ return;
1544
+ }
1545
+ window._archbee.widget = Object.assign(Object.assign({}, (_a = window._archbee) === null || _a === void 0 ? void 0 : _a.widget), widg);
1546
+ try {
1547
+ render(createContainer, widg.onRenderFinish);
1548
+ } catch (err) {
1549
+ console.log(err);
1550
+ }
1551
+ };
1552
+ const createContainer = () => {
1553
+ var _a, _b, _c, _d;
1554
+ if (document.getElementsByClassName('ab-widget').length) return;
1555
+ const abDiv = document.createElement('div');
1556
+ abDiv.style.cssText = 'visibility:hidden';
1557
+ abDiv.className = `ab-widget ab-id-${Date.now()}`;
1558
+ if (!((_b = (_a = window._archbee) === null || _a === void 0 ? void 0 : _a.widget) === null || _b === void 0 ? void 0 : _b.anchor)) {
1559
+ document.body.appendChild(abDiv);
1560
+ return;
1561
+ }
1562
+ const anchor = document.querySelector((_d = (_c = window._archbee) === null || _c === void 0 ? void 0 : _c.widget) === null || _d === void 0 ? void 0 : _d.anchor);
1563
+ if (!anchor) return;
1564
+ anchor.appendChild(abDiv);
1565
+ };
1566
+
1567
+ const registerProxy = component => {
1568
+ if (!('Proxy' in window)) {
1569
+ console.warn("Your browser doesn't support Proxies.");
1570
+ return;
1571
+ }
1572
+ const proxy = new Proxy(window._archbee.queue, {
1573
+ get(target, property, receiver) {
1574
+ return Reflect.get(target, property, receiver);
1575
+ },
1576
+ apply(target, thisArg, argumentsList) {
1577
+ return thisArg[target].apply(this, argumentsList);
1578
+ },
1579
+ set(target, property, value) {
1580
+ iterateProxy(target, component);
1581
+ return Reflect.set(target, property, value);
1582
+ },
1583
+ deleteProperty(target, property) {
1584
+ return Reflect.deleteProperty(target, property);
1585
+ }
1586
+ });
1587
+ return proxy;
1588
+ };
1589
+ const iterateProxy = (proxy, component) => {
1590
+ if (!proxy.length) return;
1591
+ proxy.forEach((event, index) => {
1592
+ // keep this here for now
1593
+ console.log('widget event received:', event.eventType, window._archbee.widget);
1594
+ if (event.hasExecuted || !EVENT_TYPE_LIST.includes(event.eventType)) {
1595
+ proxy.splice(index, 1);
1596
+ return;
1597
+ }
1598
+ if (event.eventType === EVENT_TYPE_ENUM.init) {
1599
+ setWidget(event);
1600
+ loadWidget(event, render.bind(undefined, component));
1601
+ }
1602
+ if (event.eventType === EVENT_TYPE_ENUM.showWidget) {
1603
+ window._archbee.widget.isOpen = true;
1604
+ if (event.docId) {
1605
+ window._archbee.widget.docId = event.docId;
1606
+ }
1607
+ if (event.blockId) {
1608
+ window._archbee.widget.blockId = event.blockId;
1609
+ }
1610
+ if (event.widgetType) {
1611
+ const widgetType = event.docId && event.widgetType === 'search' ? 'docs' : event.widgetType;
1612
+ window._archbee.widget.widgetType = widgetType;
1613
+ } else {
1614
+ window._archbee.widget.widgetType = 'docs';
1615
+ }
1616
+ window.dispatchEvent(showWidgetEvent());
1617
+ }
1618
+ if (event.eventType === EVENT_TYPE_ENUM.hideWidget) {
1619
+ window._archbee.widget.isOpen = false;
1620
+ window._archbee.widget.docId = undefined;
1621
+ window._archbee.widget.blockId = undefined;
1622
+ window._archbee.widget.widgetType = undefined;
1623
+ window.dispatchEvent(hideWidgetEvent());
1624
+ }
1625
+ event.hasExecuted = true;
1626
+ });
1627
+ };
1628
+
1629
+ const ArchbeeAppWidget = /*#__PURE__*/forwardRef((_a, ref) => {
1630
+ var {
1631
+ className,
1632
+ spaceId,
1633
+ jwt,
1634
+ shareableToken,
1635
+ docId,
1636
+ blockId,
1637
+ widgetType = 'docs',
1638
+ loadingStrategy = 'lazy',
1639
+ onWidgetOpen,
1640
+ onWidgetClose,
1641
+ bubble,
1642
+ anchor,
1643
+ children
1644
+ } = _a,
1645
+ rest = __rest(_a, ["className", "spaceId", "jwt", "shareableToken", "docId", "blockId", "widgetType", "loadingStrategy", "onWidgetOpen", "onWidgetClose", "bubble", "anchor", "children"]);
1646
+ const elementRef = useRef(null);
1647
+ const widgetInstance = useMemo(() => {
1648
+ if (typeof window === 'undefined') return;
1649
+ return createArchbeeWidget(spaceId, jwt, shareableToken, loadingStrategy, bubble, anchor);
1650
+ }, [spaceId, jwt, shareableToken, loadingStrategy, bubble]);
1651
+ useImperativeHandle(ref, () => {
1652
+ return {
1653
+ open: onOpenWidget,
1654
+ close: onCloseWidget,
1655
+ instance: () => widgetInstance
1656
+ };
1657
+ });
1658
+ const onOpenWidget = () => {
1659
+ widgetInstance === null || widgetInstance === void 0 ? void 0 : widgetInstance.push({
1660
+ eventType: 'show-widget',
1661
+ widgetType,
1662
+ docId,
1663
+ blockId
1664
+ });
1665
+ onWidgetOpen === null || onWidgetOpen === void 0 ? void 0 : onWidgetOpen();
1666
+ };
1667
+ const onCloseWidget = () => {
1668
+ widgetInstance === null || widgetInstance === void 0 ? void 0 : widgetInstance.push({
1669
+ eventType: 'hide-widget'
1670
+ });
1671
+ onWidgetClose === null || onWidgetClose === void 0 ? void 0 : onWidgetClose();
1672
+ };
1673
+ const onElementClicked = event => {
1674
+ var _a;
1675
+ if (typeof window !== 'undefined' && ((_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) && !ref) {
1676
+ event.preventDefault();
1677
+ onOpenWidget();
1678
+ }
1679
+ };
1680
+ return jsx("div", Object.assign({
1681
+ className: className !== null && className !== void 0 ? className : '',
1682
+ ref: elementRef,
1683
+ onClick: onElementClicked
1684
+ }, rest, {
1685
+ children: children
1686
+ }));
1687
+ });
1688
+
1689
+ export { ArchbeeAppWidget, EVENT_TYPE_ENUM, EVENT_TYPE_LIST, createArchbeeWidget, createContainer, hideWidgetEvent, initJsScripts, initScripts, iterateProxy, loadWidget, registerProxy, render, setWidget, showWidgetEvent };