@sebgroup/green-react 1.0.0-beta.1 → 1.0.0-beta.12

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 (39) hide show
  1. package/README.md +51 -1
  2. package/index.d.ts +5 -0
  3. package/index.esm.js +2740 -0
  4. package/index.umd.js +2771 -0
  5. package/lib/alert/alert.d.ts +3 -2
  6. package/lib/badge/badge.d.ts +10 -0
  7. package/lib/card/card.d.ts +3 -4
  8. package/lib/datepicker/datepicker.d.ts +2 -0
  9. package/lib/datepicker/hook.d.ts +12 -0
  10. package/lib/dropdown/dropdown.d.ts +13 -0
  11. package/lib/dropdown/hooks.d.ts +34 -0
  12. package/lib/form/{button.d.ts → button/button.d.ts} +0 -0
  13. package/lib/form/{buttonGroup.d.ts → buttonGroup/buttonGroup.d.ts} +2 -2
  14. package/lib/form/form.d.ts +5 -4
  15. package/lib/form/formContext.d.ts +13 -0
  16. package/lib/form/formItems.d.ts +9 -0
  17. package/lib/form/group/group.d.ts +9 -0
  18. package/lib/form/index.d.ts +7 -4
  19. package/lib/form/input/input.d.ts +10 -0
  20. package/lib/form/radioButton/radioGroup.d.ts +12 -0
  21. package/lib/form/{text.d.ts → text/text.d.ts} +1 -1
  22. package/lib/form/types.d.ts +19 -16
  23. package/lib/form/useInput.d.ts +2 -3
  24. package/lib/form/validateInput.d.ts +9 -0
  25. package/lib/layout/flexbox/flexbox.d.ts +13 -0
  26. package/lib/layout/flexbox/types.d.ts +5 -0
  27. package/lib/layout/index.d.ts +1 -1
  28. package/lib/link/link.d.ts +7 -0
  29. package/lib/list/list.d.ts +14 -0
  30. package/lib/list/listItem.d.ts +10 -0
  31. package/lib/modal/modal.d.ts +2 -1
  32. package/lib/navbar/navbar.d.ts +12 -0
  33. package/lib/tabs/tabs.d.ts +13 -0
  34. package/package.json +7 -7
  35. package/lib/form/buttonGroup.test.d.ts +0 -1
  36. package/lib/form/input.d.ts +0 -6
  37. package/lib/layout/group.d.ts +0 -6
  38. package/react.esm.js +0 -1718
  39. package/react.umd.js +0 -1670
package/index.esm.js ADDED
@@ -0,0 +1,2740 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import React, { useState, useLayoutEffect, useEffect, useMemo, useRef } from 'react';
3
+ import { randomId, validateClassName, createDropdown } from '@sebgroup/extract';
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$r =
13
+ // eslint-disable-next-line es-x/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; })() || Function('return this')();
21
+
22
+ var objectGetOwnPropertyDescriptor = {};
23
+
24
+ var fails$a = function (exec) {
25
+ try {
26
+ return !!exec();
27
+ } catch (error) {
28
+ return true;
29
+ }
30
+ };
31
+
32
+ var fails$9 = fails$a;
33
+
34
+ // Detect IE8's incomplete defineProperty implementation
35
+ var descriptors = !fails$9(function () {
36
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
37
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
38
+ });
39
+
40
+ var fails$8 = fails$a;
41
+
42
+ var functionBindNative = !fails$8(function () {
43
+ // eslint-disable-next-line es-x/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-x/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 bind = FunctionPrototype$1.bind;
86
+ var call$5 = FunctionPrototype$1.call;
87
+ var uncurryThis$c = NATIVE_BIND && bind.bind(call$5, call$5);
88
+
89
+ var functionUncurryThis = NATIVE_BIND ? function (fn) {
90
+ return fn && uncurryThis$c(fn);
91
+ } : function (fn) {
92
+ return fn && function () {
93
+ return call$5.apply(fn, arguments);
94
+ };
95
+ };
96
+
97
+ var uncurryThis$b = functionUncurryThis;
98
+
99
+ var toString$3 = uncurryThis$b({}.toString);
100
+ var stringSlice$1 = uncurryThis$b(''.slice);
101
+
102
+ var classofRaw$1 = function (it) {
103
+ return stringSlice$1(toString$3(it), 8, -1);
104
+ };
105
+
106
+ var global$q = global$r;
107
+ var uncurryThis$a = functionUncurryThis;
108
+ var fails$7 = fails$a;
109
+ var classof$2 = classofRaw$1;
110
+
111
+ var Object$5 = global$q.Object;
112
+ var split = uncurryThis$a(''.split);
113
+
114
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
115
+ var indexedObject = fails$7(function () {
116
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
117
+ // eslint-disable-next-line no-prototype-builtins -- safe
118
+ return !Object$5('z').propertyIsEnumerable(0);
119
+ }) ? function (it) {
120
+ return classof$2(it) == 'String' ? split(it, '') : Object$5(it);
121
+ } : Object$5;
122
+
123
+ var global$p = global$r;
124
+
125
+ var TypeError$8 = global$p.TypeError;
126
+
127
+ // `RequireObjectCoercible` abstract operation
128
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
129
+ var requireObjectCoercible$2 = function (it) {
130
+ if (it == undefined) throw TypeError$8("Can't call method on " + it);
131
+ return it;
132
+ };
133
+
134
+ // toObject with fallback for non-array-like ES3 strings
135
+ var IndexedObject$1 = indexedObject;
136
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
137
+
138
+ var toIndexedObject$5 = function (it) {
139
+ return IndexedObject$1(requireObjectCoercible$1(it));
140
+ };
141
+
142
+ // `IsCallable` abstract operation
143
+ // https://tc39.es/ecma262/#sec-iscallable
144
+ var isCallable$f = function (argument) {
145
+ return typeof argument == 'function';
146
+ };
147
+
148
+ var isCallable$e = isCallable$f;
149
+
150
+ var isObject$5 = function (it) {
151
+ return typeof it == 'object' ? it !== null : isCallable$e(it);
152
+ };
153
+
154
+ var global$o = global$r;
155
+ var isCallable$d = isCallable$f;
156
+
157
+ var aFunction = function (argument) {
158
+ return isCallable$d(argument) ? argument : undefined;
159
+ };
160
+
161
+ var getBuiltIn$4 = function (namespace, method) {
162
+ return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
163
+ };
164
+
165
+ var uncurryThis$9 = functionUncurryThis;
166
+
167
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
168
+
169
+ var getBuiltIn$3 = getBuiltIn$4;
170
+
171
+ var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
172
+
173
+ var global$n = global$r;
174
+ var userAgent = engineUserAgent;
175
+
176
+ var process = global$n.process;
177
+ var Deno = global$n.Deno;
178
+ var versions = process && process.versions || Deno && Deno.version;
179
+ var v8 = versions && versions.v8;
180
+ var match, version;
181
+
182
+ if (v8) {
183
+ match = v8.split('.');
184
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
185
+ // but their correct versions are not interesting for us
186
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
187
+ }
188
+
189
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
190
+ // so check `userAgent` even if `.v8` exists, but 0
191
+ if (!version && userAgent) {
192
+ match = userAgent.match(/Edge\/(\d+)/);
193
+ if (!match || match[1] >= 74) {
194
+ match = userAgent.match(/Chrome\/(\d+)/);
195
+ if (match) version = +match[1];
196
+ }
197
+ }
198
+
199
+ var engineV8Version = version;
200
+
201
+ /* eslint-disable es-x/no-symbol -- required for testing */
202
+
203
+ var V8_VERSION = engineV8Version;
204
+ var fails$6 = fails$a;
205
+
206
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
207
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
208
+ var symbol = Symbol();
209
+ // Chrome 38 Symbol has incorrect toString conversion
210
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
211
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
212
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
213
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
214
+ });
215
+
216
+ /* eslint-disable es-x/no-symbol -- required for testing */
217
+
218
+ var NATIVE_SYMBOL$2 = nativeSymbol;
219
+
220
+ var useSymbolAsUid = NATIVE_SYMBOL$2
221
+ && !Symbol.sham
222
+ && typeof Symbol.iterator == 'symbol';
223
+
224
+ var global$m = global$r;
225
+ var getBuiltIn$2 = getBuiltIn$4;
226
+ var isCallable$c = isCallable$f;
227
+ var isPrototypeOf$1 = objectIsPrototypeOf;
228
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
229
+
230
+ var Object$4 = global$m.Object;
231
+
232
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
233
+ return typeof it == 'symbol';
234
+ } : function (it) {
235
+ var $Symbol = getBuiltIn$2('Symbol');
236
+ return isCallable$c($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$4(it));
237
+ };
238
+
239
+ var global$l = global$r;
240
+
241
+ var String$4 = global$l.String;
242
+
243
+ var tryToString$1 = function (argument) {
244
+ try {
245
+ return String$4(argument);
246
+ } catch (error) {
247
+ return 'Object';
248
+ }
249
+ };
250
+
251
+ var global$k = global$r;
252
+ var isCallable$b = isCallable$f;
253
+ var tryToString = tryToString$1;
254
+
255
+ var TypeError$7 = global$k.TypeError;
256
+
257
+ // `Assert: IsCallable(argument) is true`
258
+ var aCallable$1 = function (argument) {
259
+ if (isCallable$b(argument)) return argument;
260
+ throw TypeError$7(tryToString(argument) + ' is not a function');
261
+ };
262
+
263
+ var aCallable = aCallable$1;
264
+
265
+ // `GetMethod` abstract operation
266
+ // https://tc39.es/ecma262/#sec-getmethod
267
+ var getMethod$1 = function (V, P) {
268
+ var func = V[P];
269
+ return func == null ? undefined : aCallable(func);
270
+ };
271
+
272
+ var global$j = global$r;
273
+ var call$4 = functionCall;
274
+ var isCallable$a = isCallable$f;
275
+ var isObject$4 = isObject$5;
276
+
277
+ var TypeError$6 = global$j.TypeError;
278
+
279
+ // `OrdinaryToPrimitive` abstract operation
280
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
281
+ var ordinaryToPrimitive$1 = function (input, pref) {
282
+ var fn, val;
283
+ if (pref === 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
284
+ if (isCallable$a(fn = input.valueOf) && !isObject$4(val = call$4(fn, input))) return val;
285
+ if (pref !== 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
286
+ throw TypeError$6("Can't convert object to primitive value");
287
+ };
288
+
289
+ var shared$3 = {exports: {}};
290
+
291
+ var global$i = global$r;
292
+
293
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
294
+ var defineProperty$4 = Object.defineProperty;
295
+
296
+ var setGlobal$3 = function (key, value) {
297
+ try {
298
+ defineProperty$4(global$i, key, { value: value, configurable: true, writable: true });
299
+ } catch (error) {
300
+ global$i[key] = value;
301
+ } return value;
302
+ };
303
+
304
+ var global$h = global$r;
305
+ var setGlobal$2 = setGlobal$3;
306
+
307
+ var SHARED = '__core-js_shared__';
308
+ var store$3 = global$h[SHARED] || setGlobal$2(SHARED, {});
309
+
310
+ var sharedStore = store$3;
311
+
312
+ var store$2 = sharedStore;
313
+
314
+ (shared$3.exports = function (key, value) {
315
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
316
+ })('versions', []).push({
317
+ version: '3.22.2',
318
+ mode: 'global',
319
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
320
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.2/LICENSE',
321
+ source: 'https://github.com/zloirock/core-js'
322
+ });
323
+
324
+ var global$g = global$r;
325
+ var requireObjectCoercible = requireObjectCoercible$2;
326
+
327
+ var Object$3 = global$g.Object;
328
+
329
+ // `ToObject` abstract operation
330
+ // https://tc39.es/ecma262/#sec-toobject
331
+ var toObject$3 = function (argument) {
332
+ return Object$3(requireObjectCoercible(argument));
333
+ };
334
+
335
+ var uncurryThis$8 = functionUncurryThis;
336
+ var toObject$2 = toObject$3;
337
+
338
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
339
+
340
+ // `HasOwnProperty` abstract operation
341
+ // https://tc39.es/ecma262/#sec-hasownproperty
342
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
343
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
344
+ return hasOwnProperty(toObject$2(it), key);
345
+ };
346
+
347
+ var uncurryThis$7 = functionUncurryThis;
348
+
349
+ var id = 0;
350
+ var postfix = Math.random();
351
+ var toString$2 = uncurryThis$7(1.0.toString);
352
+
353
+ var uid$2 = function (key) {
354
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
355
+ };
356
+
357
+ var global$f = global$r;
358
+ var shared$2 = shared$3.exports;
359
+ var hasOwn$9 = hasOwnProperty_1;
360
+ var uid$1 = uid$2;
361
+ var NATIVE_SYMBOL$1 = nativeSymbol;
362
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
363
+
364
+ var WellKnownSymbolsStore = shared$2('wks');
365
+ var Symbol$1 = global$f.Symbol;
366
+ var symbolFor = Symbol$1 && Symbol$1['for'];
367
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
368
+
369
+ var wellKnownSymbol$8 = function (name) {
370
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
371
+ var description = 'Symbol.' + name;
372
+ if (NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)) {
373
+ WellKnownSymbolsStore[name] = Symbol$1[name];
374
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
375
+ WellKnownSymbolsStore[name] = symbolFor(description);
376
+ } else {
377
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
378
+ }
379
+ } return WellKnownSymbolsStore[name];
380
+ };
381
+
382
+ var global$e = global$r;
383
+ var call$3 = functionCall;
384
+ var isObject$3 = isObject$5;
385
+ var isSymbol$1 = isSymbol$2;
386
+ var getMethod = getMethod$1;
387
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
388
+ var wellKnownSymbol$7 = wellKnownSymbol$8;
389
+
390
+ var TypeError$5 = global$e.TypeError;
391
+ var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
392
+
393
+ // `ToPrimitive` abstract operation
394
+ // https://tc39.es/ecma262/#sec-toprimitive
395
+ var toPrimitive$1 = function (input, pref) {
396
+ if (!isObject$3(input) || isSymbol$1(input)) return input;
397
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
398
+ var result;
399
+ if (exoticToPrim) {
400
+ if (pref === undefined) pref = 'default';
401
+ result = call$3(exoticToPrim, input, pref);
402
+ if (!isObject$3(result) || isSymbol$1(result)) return result;
403
+ throw TypeError$5("Can't convert object to primitive value");
404
+ }
405
+ if (pref === undefined) pref = 'number';
406
+ return ordinaryToPrimitive(input, pref);
407
+ };
408
+
409
+ var toPrimitive = toPrimitive$1;
410
+ var isSymbol = isSymbol$2;
411
+
412
+ // `ToPropertyKey` abstract operation
413
+ // https://tc39.es/ecma262/#sec-topropertykey
414
+ var toPropertyKey$2 = function (argument) {
415
+ var key = toPrimitive(argument, 'string');
416
+ return isSymbol(key) ? key : key + '';
417
+ };
418
+
419
+ var global$d = global$r;
420
+ var isObject$2 = isObject$5;
421
+
422
+ var document$1 = global$d.document;
423
+ // typeof document.createElement is 'object' in old IE
424
+ var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
425
+
426
+ var documentCreateElement$2 = function (it) {
427
+ return EXISTS$1 ? document$1.createElement(it) : {};
428
+ };
429
+
430
+ var DESCRIPTORS$9 = descriptors;
431
+ var fails$5 = fails$a;
432
+ var createElement = documentCreateElement$2;
433
+
434
+ // Thanks to IE8 for its funny defineProperty
435
+ var ie8DomDefine = !DESCRIPTORS$9 && !fails$5(function () {
436
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
437
+ return Object.defineProperty(createElement('div'), 'a', {
438
+ get: function () { return 7; }
439
+ }).a != 7;
440
+ });
441
+
442
+ var DESCRIPTORS$8 = descriptors;
443
+ var call$2 = functionCall;
444
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
445
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
446
+ var toIndexedObject$4 = toIndexedObject$5;
447
+ var toPropertyKey$1 = toPropertyKey$2;
448
+ var hasOwn$8 = hasOwnProperty_1;
449
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
450
+
451
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
452
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
453
+
454
+ // `Object.getOwnPropertyDescriptor` method
455
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
456
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
457
+ O = toIndexedObject$4(O);
458
+ P = toPropertyKey$1(P);
459
+ if (IE8_DOM_DEFINE$1) try {
460
+ return $getOwnPropertyDescriptor$1(O, P);
461
+ } catch (error) { /* empty */ }
462
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
463
+ };
464
+
465
+ var objectDefineProperty = {};
466
+
467
+ var DESCRIPTORS$7 = descriptors;
468
+ var fails$4 = fails$a;
469
+
470
+ // V8 ~ Chrome 36-
471
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
472
+ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$4(function () {
473
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
474
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
475
+ value: 42,
476
+ writable: false
477
+ }).prototype != 42;
478
+ });
479
+
480
+ var global$c = global$r;
481
+ var isObject$1 = isObject$5;
482
+
483
+ var String$3 = global$c.String;
484
+ var TypeError$4 = global$c.TypeError;
485
+
486
+ // `Assert: Type(argument) is Object`
487
+ var anObject$5 = function (argument) {
488
+ if (isObject$1(argument)) return argument;
489
+ throw TypeError$4(String$3(argument) + ' is not an object');
490
+ };
491
+
492
+ var global$b = global$r;
493
+ var DESCRIPTORS$6 = descriptors;
494
+ var IE8_DOM_DEFINE = ie8DomDefine;
495
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
496
+ var anObject$4 = anObject$5;
497
+ var toPropertyKey = toPropertyKey$2;
498
+
499
+ var TypeError$3 = global$b.TypeError;
500
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
501
+ var $defineProperty = Object.defineProperty;
502
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
503
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
504
+ var ENUMERABLE = 'enumerable';
505
+ var CONFIGURABLE$1 = 'configurable';
506
+ var WRITABLE = 'writable';
507
+
508
+ // `Object.defineProperty` method
509
+ // https://tc39.es/ecma262/#sec-object.defineproperty
510
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
511
+ anObject$4(O);
512
+ P = toPropertyKey(P);
513
+ anObject$4(Attributes);
514
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
515
+ var current = $getOwnPropertyDescriptor(O, P);
516
+ if (current && current[WRITABLE]) {
517
+ O[P] = Attributes.value;
518
+ Attributes = {
519
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
520
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
521
+ writable: false
522
+ };
523
+ }
524
+ } return $defineProperty(O, P, Attributes);
525
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
526
+ anObject$4(O);
527
+ P = toPropertyKey(P);
528
+ anObject$4(Attributes);
529
+ if (IE8_DOM_DEFINE) try {
530
+ return $defineProperty(O, P, Attributes);
531
+ } catch (error) { /* empty */ }
532
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$3('Accessors not supported');
533
+ if ('value' in Attributes) O[P] = Attributes.value;
534
+ return O;
535
+ };
536
+
537
+ var DESCRIPTORS$5 = descriptors;
538
+ var definePropertyModule$3 = objectDefineProperty;
539
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
540
+
541
+ var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
542
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
543
+ } : function (object, key, value) {
544
+ object[key] = value;
545
+ return object;
546
+ };
547
+
548
+ var redefine$3 = {exports: {}};
549
+
550
+ var uncurryThis$6 = functionUncurryThis;
551
+ var isCallable$9 = isCallable$f;
552
+ var store$1 = sharedStore;
553
+
554
+ var functionToString = uncurryThis$6(Function.toString);
555
+
556
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
557
+ if (!isCallable$9(store$1.inspectSource)) {
558
+ store$1.inspectSource = function (it) {
559
+ return functionToString(it);
560
+ };
561
+ }
562
+
563
+ var inspectSource$2 = store$1.inspectSource;
564
+
565
+ var global$a = global$r;
566
+ var isCallable$8 = isCallable$f;
567
+ var inspectSource$1 = inspectSource$2;
568
+
569
+ var WeakMap$1 = global$a.WeakMap;
570
+
571
+ var nativeWeakMap = isCallable$8(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
572
+
573
+ var shared$1 = shared$3.exports;
574
+ var uid = uid$2;
575
+
576
+ var keys = shared$1('keys');
577
+
578
+ var sharedKey$3 = function (key) {
579
+ return keys[key] || (keys[key] = uid(key));
580
+ };
581
+
582
+ var hiddenKeys$4 = {};
583
+
584
+ var NATIVE_WEAK_MAP = nativeWeakMap;
585
+ var global$9 = global$r;
586
+ var uncurryThis$5 = functionUncurryThis;
587
+ var isObject = isObject$5;
588
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
589
+ var hasOwn$7 = hasOwnProperty_1;
590
+ var shared = sharedStore;
591
+ var sharedKey$2 = sharedKey$3;
592
+ var hiddenKeys$3 = hiddenKeys$4;
593
+
594
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
595
+ var TypeError$2 = global$9.TypeError;
596
+ var WeakMap = global$9.WeakMap;
597
+ var set, get, has;
598
+
599
+ var enforce = function (it) {
600
+ return has(it) ? get(it) : set(it, {});
601
+ };
602
+
603
+ var getterFor = function (TYPE) {
604
+ return function (it) {
605
+ var state;
606
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
607
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
608
+ } return state;
609
+ };
610
+ };
611
+
612
+ if (NATIVE_WEAK_MAP || shared.state) {
613
+ var store = shared.state || (shared.state = new WeakMap());
614
+ var wmget = uncurryThis$5(store.get);
615
+ var wmhas = uncurryThis$5(store.has);
616
+ var wmset = uncurryThis$5(store.set);
617
+ set = function (it, metadata) {
618
+ if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
619
+ metadata.facade = it;
620
+ wmset(store, it, metadata);
621
+ return metadata;
622
+ };
623
+ get = function (it) {
624
+ return wmget(store, it) || {};
625
+ };
626
+ has = function (it) {
627
+ return wmhas(store, it);
628
+ };
629
+ } else {
630
+ var STATE = sharedKey$2('state');
631
+ hiddenKeys$3[STATE] = true;
632
+ set = function (it, metadata) {
633
+ if (hasOwn$7(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
634
+ metadata.facade = it;
635
+ createNonEnumerableProperty$4(it, STATE, metadata);
636
+ return metadata;
637
+ };
638
+ get = function (it) {
639
+ return hasOwn$7(it, STATE) ? it[STATE] : {};
640
+ };
641
+ has = function (it) {
642
+ return hasOwn$7(it, STATE);
643
+ };
644
+ }
645
+
646
+ var internalState = {
647
+ set: set,
648
+ get: get,
649
+ has: has,
650
+ enforce: enforce,
651
+ getterFor: getterFor
652
+ };
653
+
654
+ var DESCRIPTORS$4 = descriptors;
655
+ var hasOwn$6 = hasOwnProperty_1;
656
+
657
+ var FunctionPrototype = Function.prototype;
658
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
659
+ var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
660
+
661
+ var EXISTS = hasOwn$6(FunctionPrototype, 'name');
662
+ // additional protection from minified / mangled / dropped function names
663
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
664
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
665
+
666
+ var functionName = {
667
+ EXISTS: EXISTS,
668
+ PROPER: PROPER,
669
+ CONFIGURABLE: CONFIGURABLE
670
+ };
671
+
672
+ var global$8 = global$r;
673
+ var isCallable$7 = isCallable$f;
674
+ var hasOwn$5 = hasOwnProperty_1;
675
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
676
+ var setGlobal$1 = setGlobal$3;
677
+ var inspectSource = inspectSource$2;
678
+ var InternalStateModule$1 = internalState;
679
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
680
+
681
+ var getInternalState$1 = InternalStateModule$1.get;
682
+ var enforceInternalState = InternalStateModule$1.enforce;
683
+ var TEMPLATE = String(String).split('String');
684
+
685
+ (redefine$3.exports = function (O, key, value, options) {
686
+ var unsafe = options ? !!options.unsafe : false;
687
+ var simple = options ? !!options.enumerable : false;
688
+ var noTargetGet = options ? !!options.noTargetGet : false;
689
+ var name = options && options.name !== undefined ? options.name : key;
690
+ var state;
691
+ if (isCallable$7(value)) {
692
+ if (String(name).slice(0, 7) === 'Symbol(') {
693
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
694
+ }
695
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
696
+ createNonEnumerableProperty$3(value, 'name', name);
697
+ }
698
+ state = enforceInternalState(value);
699
+ if (!state.source) {
700
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
701
+ }
702
+ }
703
+ if (O === global$8) {
704
+ if (simple) O[key] = value;
705
+ else setGlobal$1(key, value);
706
+ return;
707
+ } else if (!unsafe) {
708
+ delete O[key];
709
+ } else if (!noTargetGet && O[key]) {
710
+ simple = true;
711
+ }
712
+ if (simple) O[key] = value;
713
+ else createNonEnumerableProperty$3(O, key, value);
714
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
715
+ })(Function.prototype, 'toString', function toString() {
716
+ return isCallable$7(this) && getInternalState$1(this).source || inspectSource(this);
717
+ });
718
+
719
+ var objectGetOwnPropertyNames = {};
720
+
721
+ var ceil = Math.ceil;
722
+ var floor = Math.floor;
723
+
724
+ // `ToIntegerOrInfinity` abstract operation
725
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
726
+ var toIntegerOrInfinity$2 = function (argument) {
727
+ var number = +argument;
728
+ // eslint-disable-next-line no-self-compare -- safe
729
+ return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
730
+ };
731
+
732
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
733
+
734
+ var max = Math.max;
735
+ var min$1 = Math.min;
736
+
737
+ // Helper for a popular repeating case of the spec:
738
+ // Let integer be ? ToInteger(index).
739
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
740
+ var toAbsoluteIndex$1 = function (index, length) {
741
+ var integer = toIntegerOrInfinity$1(index);
742
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
743
+ };
744
+
745
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
746
+
747
+ var min = Math.min;
748
+
749
+ // `ToLength` abstract operation
750
+ // https://tc39.es/ecma262/#sec-tolength
751
+ var toLength$1 = function (argument) {
752
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
753
+ };
754
+
755
+ var toLength = toLength$1;
756
+
757
+ // `LengthOfArrayLike` abstract operation
758
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
759
+ var lengthOfArrayLike$1 = function (obj) {
760
+ return toLength(obj.length);
761
+ };
762
+
763
+ var toIndexedObject$3 = toIndexedObject$5;
764
+ var toAbsoluteIndex = toAbsoluteIndex$1;
765
+ var lengthOfArrayLike = lengthOfArrayLike$1;
766
+
767
+ // `Array.prototype.{ indexOf, includes }` methods implementation
768
+ var createMethod = function (IS_INCLUDES) {
769
+ return function ($this, el, fromIndex) {
770
+ var O = toIndexedObject$3($this);
771
+ var length = lengthOfArrayLike(O);
772
+ var index = toAbsoluteIndex(fromIndex, length);
773
+ var value;
774
+ // Array#includes uses SameValueZero equality algorithm
775
+ // eslint-disable-next-line no-self-compare -- NaN check
776
+ if (IS_INCLUDES && el != el) while (length > index) {
777
+ value = O[index++];
778
+ // eslint-disable-next-line no-self-compare -- NaN check
779
+ if (value != value) return true;
780
+ // Array#indexOf ignores holes, Array#includes - not
781
+ } else for (;length > index; index++) {
782
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
783
+ } return !IS_INCLUDES && -1;
784
+ };
785
+ };
786
+
787
+ var arrayIncludes = {
788
+ // `Array.prototype.includes` method
789
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
790
+ includes: createMethod(true),
791
+ // `Array.prototype.indexOf` method
792
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
793
+ indexOf: createMethod(false)
794
+ };
795
+
796
+ var uncurryThis$4 = functionUncurryThis;
797
+ var hasOwn$4 = hasOwnProperty_1;
798
+ var toIndexedObject$2 = toIndexedObject$5;
799
+ var indexOf = arrayIncludes.indexOf;
800
+ var hiddenKeys$2 = hiddenKeys$4;
801
+
802
+ var push = uncurryThis$4([].push);
803
+
804
+ var objectKeysInternal = function (object, names) {
805
+ var O = toIndexedObject$2(object);
806
+ var i = 0;
807
+ var result = [];
808
+ var key;
809
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
810
+ // Don't enum bug & hidden keys
811
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
812
+ ~indexOf(result, key) || push(result, key);
813
+ }
814
+ return result;
815
+ };
816
+
817
+ // IE8- don't enum bug keys
818
+ var enumBugKeys$3 = [
819
+ 'constructor',
820
+ 'hasOwnProperty',
821
+ 'isPrototypeOf',
822
+ 'propertyIsEnumerable',
823
+ 'toLocaleString',
824
+ 'toString',
825
+ 'valueOf'
826
+ ];
827
+
828
+ var internalObjectKeys$1 = objectKeysInternal;
829
+ var enumBugKeys$2 = enumBugKeys$3;
830
+
831
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
832
+
833
+ // `Object.getOwnPropertyNames` method
834
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
835
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
836
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
837
+ return internalObjectKeys$1(O, hiddenKeys$1);
838
+ };
839
+
840
+ var objectGetOwnPropertySymbols = {};
841
+
842
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
843
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
844
+
845
+ var getBuiltIn$1 = getBuiltIn$4;
846
+ var uncurryThis$3 = functionUncurryThis;
847
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
848
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
849
+ var anObject$3 = anObject$5;
850
+
851
+ var concat$1 = uncurryThis$3([].concat);
852
+
853
+ // all object keys, includes non-enumerable and symbols
854
+ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
855
+ var keys = getOwnPropertyNamesModule.f(anObject$3(it));
856
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
857
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
858
+ };
859
+
860
+ var hasOwn$3 = hasOwnProperty_1;
861
+ var ownKeys = ownKeys$1;
862
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
863
+ var definePropertyModule$2 = objectDefineProperty;
864
+
865
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
866
+ var keys = ownKeys(source);
867
+ var defineProperty = definePropertyModule$2.f;
868
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
869
+ for (var i = 0; i < keys.length; i++) {
870
+ var key = keys[i];
871
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
872
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
873
+ }
874
+ }
875
+ };
876
+
877
+ var fails$3 = fails$a;
878
+ var isCallable$6 = isCallable$f;
879
+
880
+ var replacement = /#|\.prototype\./;
881
+
882
+ var isForced$1 = function (feature, detection) {
883
+ var value = data[normalize(feature)];
884
+ return value == POLYFILL ? true
885
+ : value == NATIVE ? false
886
+ : isCallable$6(detection) ? fails$3(detection)
887
+ : !!detection;
888
+ };
889
+
890
+ var normalize = isForced$1.normalize = function (string) {
891
+ return String(string).replace(replacement, '.').toLowerCase();
892
+ };
893
+
894
+ var data = isForced$1.data = {};
895
+ var NATIVE = isForced$1.NATIVE = 'N';
896
+ var POLYFILL = isForced$1.POLYFILL = 'P';
897
+
898
+ var isForced_1 = isForced$1;
899
+
900
+ var global$7 = global$r;
901
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
902
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
903
+ var redefine$2 = redefine$3.exports;
904
+ var setGlobal = setGlobal$3;
905
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
906
+ var isForced = isForced_1;
907
+
908
+ /*
909
+ options.target - name of the target object
910
+ options.global - target is the global object
911
+ options.stat - export as static methods of target
912
+ options.proto - export as prototype methods of target
913
+ options.real - real prototype method for the `pure` version
914
+ options.forced - export even if the native feature is available
915
+ options.bind - bind methods to the target, required for the `pure` version
916
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
917
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
918
+ options.sham - add a flag to not completely full polyfills
919
+ options.enumerable - export as enumerable property
920
+ options.noTargetGet - prevent calling a getter on target
921
+ options.name - the .name of the function if it does not match the key
922
+ */
923
+ var _export = function (options, source) {
924
+ var TARGET = options.target;
925
+ var GLOBAL = options.global;
926
+ var STATIC = options.stat;
927
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
928
+ if (GLOBAL) {
929
+ target = global$7;
930
+ } else if (STATIC) {
931
+ target = global$7[TARGET] || setGlobal(TARGET, {});
932
+ } else {
933
+ target = (global$7[TARGET] || {}).prototype;
934
+ }
935
+ if (target) for (key in source) {
936
+ sourceProperty = source[key];
937
+ if (options.noTargetGet) {
938
+ descriptor = getOwnPropertyDescriptor(target, key);
939
+ targetProperty = descriptor && descriptor.value;
940
+ } else targetProperty = target[key];
941
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
942
+ // contained in target
943
+ if (!FORCED && targetProperty !== undefined) {
944
+ if (typeof sourceProperty == typeof targetProperty) continue;
945
+ copyConstructorProperties$1(sourceProperty, targetProperty);
946
+ }
947
+ // add a flag to not completely full polyfills
948
+ if (options.sham || (targetProperty && targetProperty.sham)) {
949
+ createNonEnumerableProperty$2(sourceProperty, 'sham', true);
950
+ }
951
+ // extend global
952
+ redefine$2(target, key, sourceProperty, options);
953
+ }
954
+ };
955
+
956
+ var internalObjectKeys = objectKeysInternal;
957
+ var enumBugKeys$1 = enumBugKeys$3;
958
+
959
+ // `Object.keys` method
960
+ // https://tc39.es/ecma262/#sec-object.keys
961
+ // eslint-disable-next-line es-x/no-object-keys -- safe
962
+ var objectKeys$2 = Object.keys || function keys(O) {
963
+ return internalObjectKeys(O, enumBugKeys$1);
964
+ };
965
+
966
+ var DESCRIPTORS$3 = descriptors;
967
+ var uncurryThis$2 = functionUncurryThis;
968
+ var call$1 = functionCall;
969
+ var fails$2 = fails$a;
970
+ var objectKeys$1 = objectKeys$2;
971
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
972
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
973
+ var toObject$1 = toObject$3;
974
+ var IndexedObject = indexedObject;
975
+
976
+ // eslint-disable-next-line es-x/no-object-assign -- safe
977
+ var $assign = Object.assign;
978
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
979
+ var defineProperty$3 = Object.defineProperty;
980
+ var concat = uncurryThis$2([].concat);
981
+
982
+ // `Object.assign` method
983
+ // https://tc39.es/ecma262/#sec-object.assign
984
+ var objectAssign = !$assign || fails$2(function () {
985
+ // should have correct order of operations (Edge bug)
986
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
987
+ enumerable: true,
988
+ get: function () {
989
+ defineProperty$3(this, 'b', {
990
+ value: 3,
991
+ enumerable: false
992
+ });
993
+ }
994
+ }), { b: 2 })).b !== 1) return true;
995
+ // should work with symbols and should have deterministic property order (V8 bug)
996
+ var A = {};
997
+ var B = {};
998
+ // eslint-disable-next-line es-x/no-symbol -- safe
999
+ var symbol = Symbol();
1000
+ var alphabet = 'abcdefghijklmnopqrst';
1001
+ A[symbol] = 7;
1002
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1003
+ return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1004
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1005
+ var T = toObject$1(target);
1006
+ var argumentsLength = arguments.length;
1007
+ var index = 1;
1008
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1009
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1010
+ while (argumentsLength > index) {
1011
+ var S = IndexedObject(arguments[index++]);
1012
+ var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1013
+ var length = keys.length;
1014
+ var j = 0;
1015
+ var key;
1016
+ while (length > j) {
1017
+ key = keys[j++];
1018
+ if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1019
+ }
1020
+ } return T;
1021
+ } : $assign;
1022
+
1023
+ var $$2 = _export;
1024
+ var assign = objectAssign;
1025
+
1026
+ // `Object.assign` method
1027
+ // https://tc39.es/ecma262/#sec-object.assign
1028
+ // eslint-disable-next-line es-x/no-object-assign -- required for testing
1029
+ $$2({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
1030
+ assign: assign
1031
+ });
1032
+
1033
+ /******************************************************************************
1034
+ Copyright (c) Microsoft Corporation.
1035
+
1036
+ Permission to use, copy, modify, and/or distribute this software for any
1037
+ purpose with or without fee is hereby granted.
1038
+
1039
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1040
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1041
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1042
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1043
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1044
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1045
+ PERFORMANCE OF THIS SOFTWARE.
1046
+ ***************************************************************************** */
1047
+
1048
+ function __rest(s, e) {
1049
+ var t = {};
1050
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1051
+ t[p] = s[p];
1052
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1053
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1054
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1055
+ t[p[i]] = s[p[i]];
1056
+ }
1057
+ return t;
1058
+ }
1059
+
1060
+ function Button({
1061
+ children,
1062
+ variant,
1063
+ onClick,
1064
+ active = false,
1065
+ type = 'button'
1066
+ }) {
1067
+ const props = {
1068
+ type
1069
+ };
1070
+ const classNames = [];
1071
+ if (variant) classNames.push(variant);
1072
+ if (active) classNames.push('active');
1073
+ if (classNames.length) props.className = classNames.join(' ');
1074
+ if (onClick) props.onClick = onClick;
1075
+ return jsx("button", Object.assign({}, props, {
1076
+ children: children
1077
+ }));
1078
+ }
1079
+
1080
+ const ModalHeader = ({
1081
+ header: _header = '',
1082
+ onClose
1083
+ }) => {
1084
+ const handleClose = event => {
1085
+ if (onClose) onClose(event);
1086
+ };
1087
+
1088
+ return jsxs("div", Object.assign({
1089
+ className: "header"
1090
+ }, {
1091
+ children: [jsx("h3", {
1092
+ children: _header
1093
+ }), jsx("button", Object.assign({
1094
+ className: "close",
1095
+ onClick: handleClose
1096
+ }, {
1097
+ children: jsx("span", Object.assign({
1098
+ className: "sr-only"
1099
+ }, {
1100
+ children: "Close"
1101
+ }))
1102
+ }))]
1103
+ }));
1104
+ };
1105
+
1106
+ const ModalBody = ({
1107
+ children
1108
+ }) => {
1109
+ return jsx("div", Object.assign({
1110
+ className: "body"
1111
+ }, {
1112
+ children: children
1113
+ }));
1114
+ };
1115
+
1116
+ const ModalFooter = ({
1117
+ confirm,
1118
+ dismiss,
1119
+ onClose,
1120
+ onConfirm,
1121
+ onDismiss
1122
+ }) => {
1123
+ const handleConfirm = event => {
1124
+ if (onConfirm) onConfirm(event);
1125
+ if (onClose) onClose(event);
1126
+ };
1127
+
1128
+ const handleDismiss = event => {
1129
+ if (onDismiss) onDismiss(event);
1130
+ if (onClose) onClose(event);
1131
+ };
1132
+
1133
+ return jsxs("div", Object.assign({
1134
+ className: "footer"
1135
+ }, {
1136
+ children: [dismiss && jsx(Button, Object.assign({
1137
+ variant: "secondary",
1138
+ onClick: handleDismiss
1139
+ }, {
1140
+ children: dismiss
1141
+ })), confirm && jsx(Button, Object.assign({
1142
+ variant: "primary",
1143
+ onClick: handleConfirm
1144
+ }, {
1145
+ children: confirm
1146
+ }))]
1147
+ }));
1148
+ };
1149
+
1150
+ const Modal = _a => {
1151
+ var {
1152
+ type = 'default',
1153
+ isOpen
1154
+ } = _a,
1155
+ props = __rest(_a, ["type", "isOpen"]);
1156
+
1157
+ const modalContent = () => {
1158
+ switch (type) {
1159
+ case 'slideout':
1160
+ {
1161
+ return jsxs("aside", Object.assign({
1162
+ role: "dialog"
1163
+ }, {
1164
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1165
+ }));
1166
+ }
1167
+
1168
+ case 'takeover':
1169
+ {
1170
+ return jsxs("main", Object.assign({
1171
+ role: "dialog"
1172
+ }, {
1173
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1174
+ }));
1175
+ }
1176
+
1177
+ default:
1178
+ {
1179
+ return jsxs("section", Object.assign({
1180
+ role: "dialog"
1181
+ }, {
1182
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1183
+ }));
1184
+ }
1185
+ }
1186
+ };
1187
+
1188
+ return isOpen ? modalContent() : null;
1189
+ };
1190
+
1191
+ var objectDefineProperties = {};
1192
+
1193
+ var DESCRIPTORS$2 = descriptors;
1194
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1195
+ var definePropertyModule$1 = objectDefineProperty;
1196
+ var anObject$2 = anObject$5;
1197
+ var toIndexedObject$1 = toIndexedObject$5;
1198
+ var objectKeys = objectKeys$2;
1199
+
1200
+ // `Object.defineProperties` method
1201
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1202
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1203
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1204
+ anObject$2(O);
1205
+ var props = toIndexedObject$1(Properties);
1206
+ var keys = objectKeys(Properties);
1207
+ var length = keys.length;
1208
+ var index = 0;
1209
+ var key;
1210
+ while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
1211
+ return O;
1212
+ };
1213
+
1214
+ var getBuiltIn = getBuiltIn$4;
1215
+
1216
+ var html$1 = getBuiltIn('document', 'documentElement');
1217
+
1218
+ /* global ActiveXObject -- old IE, WSH */
1219
+
1220
+ var anObject$1 = anObject$5;
1221
+ var definePropertiesModule = objectDefineProperties;
1222
+ var enumBugKeys = enumBugKeys$3;
1223
+ var hiddenKeys = hiddenKeys$4;
1224
+ var html = html$1;
1225
+ var documentCreateElement$1 = documentCreateElement$2;
1226
+ var sharedKey$1 = sharedKey$3;
1227
+
1228
+ var GT = '>';
1229
+ var LT = '<';
1230
+ var PROTOTYPE = 'prototype';
1231
+ var SCRIPT = 'script';
1232
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1233
+
1234
+ var EmptyConstructor = function () { /* empty */ };
1235
+
1236
+ var scriptTag = function (content) {
1237
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1238
+ };
1239
+
1240
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1241
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1242
+ activeXDocument.write(scriptTag(''));
1243
+ activeXDocument.close();
1244
+ var temp = activeXDocument.parentWindow.Object;
1245
+ activeXDocument = null; // avoid memory leak
1246
+ return temp;
1247
+ };
1248
+
1249
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1250
+ var NullProtoObjectViaIFrame = function () {
1251
+ // Thrash, waste and sodomy: IE GC bug
1252
+ var iframe = documentCreateElement$1('iframe');
1253
+ var JS = 'java' + SCRIPT + ':';
1254
+ var iframeDocument;
1255
+ iframe.style.display = 'none';
1256
+ html.appendChild(iframe);
1257
+ // https://github.com/zloirock/core-js/issues/475
1258
+ iframe.src = String(JS);
1259
+ iframeDocument = iframe.contentWindow.document;
1260
+ iframeDocument.open();
1261
+ iframeDocument.write(scriptTag('document.F=Object'));
1262
+ iframeDocument.close();
1263
+ return iframeDocument.F;
1264
+ };
1265
+
1266
+ // Check for document.domain and active x support
1267
+ // No need to use active x approach when document.domain is not set
1268
+ // see https://github.com/es-shims/es5-shim/issues/150
1269
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1270
+ // avoid IE GC bug
1271
+ var activeXDocument;
1272
+ var NullProtoObject = function () {
1273
+ try {
1274
+ activeXDocument = new ActiveXObject('htmlfile');
1275
+ } catch (error) { /* ignore */ }
1276
+ NullProtoObject = typeof document != 'undefined'
1277
+ ? document.domain && activeXDocument
1278
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1279
+ : NullProtoObjectViaIFrame()
1280
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1281
+ var length = enumBugKeys.length;
1282
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1283
+ return NullProtoObject();
1284
+ };
1285
+
1286
+ hiddenKeys[IE_PROTO$1] = true;
1287
+
1288
+ // `Object.create` method
1289
+ // https://tc39.es/ecma262/#sec-object.create
1290
+ // eslint-disable-next-line es-x/no-object-create -- safe
1291
+ var objectCreate = Object.create || function create(O, Properties) {
1292
+ var result;
1293
+ if (O !== null) {
1294
+ EmptyConstructor[PROTOTYPE] = anObject$1(O);
1295
+ result = new EmptyConstructor();
1296
+ EmptyConstructor[PROTOTYPE] = null;
1297
+ // add "__proto__" for Object.getPrototypeOf polyfill
1298
+ result[IE_PROTO$1] = O;
1299
+ } else result = NullProtoObject();
1300
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1301
+ };
1302
+
1303
+ var wellKnownSymbol$6 = wellKnownSymbol$8;
1304
+ var create$1 = objectCreate;
1305
+ var definePropertyModule = objectDefineProperty;
1306
+
1307
+ var UNSCOPABLES = wellKnownSymbol$6('unscopables');
1308
+ var ArrayPrototype = Array.prototype;
1309
+
1310
+ // Array.prototype[@@unscopables]
1311
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1312
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
1313
+ definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
1314
+ configurable: true,
1315
+ value: create$1(null)
1316
+ });
1317
+ }
1318
+
1319
+ // add a key to Array.prototype[@@unscopables]
1320
+ var addToUnscopables$1 = function (key) {
1321
+ ArrayPrototype[UNSCOPABLES][key] = true;
1322
+ };
1323
+
1324
+ var iterators = {};
1325
+
1326
+ var fails$1 = fails$a;
1327
+
1328
+ var correctPrototypeGetter = !fails$1(function () {
1329
+ function F() { /* empty */ }
1330
+ F.prototype.constructor = null;
1331
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
1332
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1333
+ });
1334
+
1335
+ var global$6 = global$r;
1336
+ var hasOwn$2 = hasOwnProperty_1;
1337
+ var isCallable$5 = isCallable$f;
1338
+ var toObject = toObject$3;
1339
+ var sharedKey = sharedKey$3;
1340
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1341
+
1342
+ var IE_PROTO = sharedKey('IE_PROTO');
1343
+ var Object$2 = global$6.Object;
1344
+ var ObjectPrototype = Object$2.prototype;
1345
+
1346
+ // `Object.getPrototypeOf` method
1347
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1348
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
1349
+ var object = toObject(O);
1350
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1351
+ var constructor = object.constructor;
1352
+ if (isCallable$5(constructor) && object instanceof constructor) {
1353
+ return constructor.prototype;
1354
+ } return object instanceof Object$2 ? ObjectPrototype : null;
1355
+ };
1356
+
1357
+ var fails = fails$a;
1358
+ var isCallable$4 = isCallable$f;
1359
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1360
+ var redefine$1 = redefine$3.exports;
1361
+ var wellKnownSymbol$5 = wellKnownSymbol$8;
1362
+
1363
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
1364
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1365
+
1366
+ // `%IteratorPrototype%` object
1367
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1368
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1369
+
1370
+ /* eslint-disable es-x/no-array-prototype-keys -- safe */
1371
+ if ([].keys) {
1372
+ arrayIterator = [].keys();
1373
+ // Safari 8 has buggy iterators w/o `next`
1374
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1375
+ else {
1376
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1377
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1378
+ }
1379
+ }
1380
+
1381
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
1382
+ var test = {};
1383
+ // FF44- legacy iterators case
1384
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1385
+ });
1386
+
1387
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1388
+
1389
+ // `%IteratorPrototype%[@@iterator]()` method
1390
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1391
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1392
+ redefine$1(IteratorPrototype$2, ITERATOR$2, function () {
1393
+ return this;
1394
+ });
1395
+ }
1396
+
1397
+ var iteratorsCore = {
1398
+ IteratorPrototype: IteratorPrototype$2,
1399
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1400
+ };
1401
+
1402
+ var defineProperty$2 = objectDefineProperty.f;
1403
+ var hasOwn$1 = hasOwnProperty_1;
1404
+ var wellKnownSymbol$4 = wellKnownSymbol$8;
1405
+
1406
+ var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1407
+
1408
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1409
+ if (target && !STATIC) target = target.prototype;
1410
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1411
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1412
+ }
1413
+ };
1414
+
1415
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1416
+ var create = objectCreate;
1417
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1418
+ var setToStringTag$1 = setToStringTag$2;
1419
+ var Iterators$2 = iterators;
1420
+
1421
+ var returnThis$1 = function () { return this; };
1422
+
1423
+ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1424
+ var TO_STRING_TAG = NAME + ' Iterator';
1425
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1426
+ setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1427
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
1428
+ return IteratorConstructor;
1429
+ };
1430
+
1431
+ var global$5 = global$r;
1432
+ var isCallable$3 = isCallable$f;
1433
+
1434
+ var String$2 = global$5.String;
1435
+ var TypeError$1 = global$5.TypeError;
1436
+
1437
+ var aPossiblePrototype$1 = function (argument) {
1438
+ if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1439
+ throw TypeError$1("Can't set " + String$2(argument) + ' as a prototype');
1440
+ };
1441
+
1442
+ /* eslint-disable no-proto -- safe */
1443
+
1444
+ var uncurryThis$1 = functionUncurryThis;
1445
+ var anObject = anObject$5;
1446
+ var aPossiblePrototype = aPossiblePrototype$1;
1447
+
1448
+ // `Object.setPrototypeOf` method
1449
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1450
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1451
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
1452
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1453
+ var CORRECT_SETTER = false;
1454
+ var test = {};
1455
+ var setter;
1456
+ try {
1457
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1458
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1459
+ setter(test, []);
1460
+ CORRECT_SETTER = test instanceof Array;
1461
+ } catch (error) { /* empty */ }
1462
+ return function setPrototypeOf(O, proto) {
1463
+ anObject(O);
1464
+ aPossiblePrototype(proto);
1465
+ if (CORRECT_SETTER) setter(O, proto);
1466
+ else O.__proto__ = proto;
1467
+ return O;
1468
+ };
1469
+ }() : undefined);
1470
+
1471
+ var $$1 = _export;
1472
+ var call = functionCall;
1473
+ var FunctionName = functionName;
1474
+ var isCallable$2 = isCallable$f;
1475
+ var createIteratorConstructor = createIteratorConstructor$1;
1476
+ var getPrototypeOf = objectGetPrototypeOf;
1477
+ var setPrototypeOf = objectSetPrototypeOf;
1478
+ var setToStringTag = setToStringTag$2;
1479
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1480
+ var redefine = redefine$3.exports;
1481
+ var wellKnownSymbol$3 = wellKnownSymbol$8;
1482
+ var Iterators$1 = iterators;
1483
+ var IteratorsCore = iteratorsCore;
1484
+
1485
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1486
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1487
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1488
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1489
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
1490
+ var KEYS = 'keys';
1491
+ var VALUES = 'values';
1492
+ var ENTRIES = 'entries';
1493
+
1494
+ var returnThis = function () { return this; };
1495
+
1496
+ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1497
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1498
+
1499
+ var getIterationMethod = function (KIND) {
1500
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1501
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1502
+ switch (KIND) {
1503
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1504
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1505
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1506
+ } return function () { return new IteratorConstructor(this); };
1507
+ };
1508
+
1509
+ var TO_STRING_TAG = NAME + ' Iterator';
1510
+ var INCORRECT_VALUES_NAME = false;
1511
+ var IterablePrototype = Iterable.prototype;
1512
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1513
+ || IterablePrototype['@@iterator']
1514
+ || DEFAULT && IterablePrototype[DEFAULT];
1515
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1516
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1517
+ var CurrentIteratorPrototype, methods, KEY;
1518
+
1519
+ // fix native
1520
+ if (anyNativeIterator) {
1521
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1522
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1523
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1524
+ if (setPrototypeOf) {
1525
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1526
+ } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1527
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1528
+ }
1529
+ }
1530
+ // Set @@toStringTag to native iterators
1531
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1532
+ }
1533
+ }
1534
+
1535
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1536
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1537
+ if (CONFIGURABLE_FUNCTION_NAME) {
1538
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1539
+ } else {
1540
+ INCORRECT_VALUES_NAME = true;
1541
+ defaultIterator = function values() { return call(nativeIterator, this); };
1542
+ }
1543
+ }
1544
+
1545
+ // export additional methods
1546
+ if (DEFAULT) {
1547
+ methods = {
1548
+ values: getIterationMethod(VALUES),
1549
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1550
+ entries: getIterationMethod(ENTRIES)
1551
+ };
1552
+ if (FORCED) for (KEY in methods) {
1553
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1554
+ redefine(IterablePrototype, KEY, methods[KEY]);
1555
+ }
1556
+ } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1557
+ }
1558
+
1559
+ // define iterator
1560
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1561
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1562
+ }
1563
+ Iterators$1[NAME] = defaultIterator;
1564
+
1565
+ return methods;
1566
+ };
1567
+
1568
+ var toIndexedObject = toIndexedObject$5;
1569
+ var addToUnscopables = addToUnscopables$1;
1570
+ var Iterators = iterators;
1571
+ var InternalStateModule = internalState;
1572
+ var defineProperty$1 = objectDefineProperty.f;
1573
+ var defineIterator = defineIterator$1;
1574
+ var DESCRIPTORS$1 = descriptors;
1575
+
1576
+ var ARRAY_ITERATOR = 'Array Iterator';
1577
+ var setInternalState = InternalStateModule.set;
1578
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
1579
+
1580
+ // `Array.prototype.entries` method
1581
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1582
+ // `Array.prototype.keys` method
1583
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1584
+ // `Array.prototype.values` method
1585
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1586
+ // `Array.prototype[@@iterator]` method
1587
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1588
+ // `CreateArrayIterator` internal method
1589
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1590
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1591
+ setInternalState(this, {
1592
+ type: ARRAY_ITERATOR,
1593
+ target: toIndexedObject(iterated), // target
1594
+ index: 0, // next index
1595
+ kind: kind // kind
1596
+ });
1597
+ // `%ArrayIteratorPrototype%.next` method
1598
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1599
+ }, function () {
1600
+ var state = getInternalState(this);
1601
+ var target = state.target;
1602
+ var kind = state.kind;
1603
+ var index = state.index++;
1604
+ if (!target || index >= target.length) {
1605
+ state.target = undefined;
1606
+ return { value: undefined, done: true };
1607
+ }
1608
+ if (kind == 'keys') return { value: index, done: false };
1609
+ if (kind == 'values') return { value: target[index], done: false };
1610
+ return { value: [index, target[index]], done: false };
1611
+ }, 'values');
1612
+
1613
+ // argumentsList[@@iterator] is %ArrayProto_values%
1614
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1615
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1616
+ var values = Iterators.Arguments = Iterators.Array;
1617
+
1618
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1619
+ addToUnscopables('keys');
1620
+ addToUnscopables('values');
1621
+ addToUnscopables('entries');
1622
+
1623
+ // V8 ~ Chrome 45- bug
1624
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1625
+ defineProperty$1(values, 'name', { value: 'values' });
1626
+ } catch (error) { /* empty */ }
1627
+
1628
+ // iterable DOM collections
1629
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1630
+ var domIterables = {
1631
+ CSSRuleList: 0,
1632
+ CSSStyleDeclaration: 0,
1633
+ CSSValueList: 0,
1634
+ ClientRectList: 0,
1635
+ DOMRectList: 0,
1636
+ DOMStringList: 0,
1637
+ DOMTokenList: 1,
1638
+ DataTransferItemList: 0,
1639
+ FileList: 0,
1640
+ HTMLAllCollection: 0,
1641
+ HTMLCollection: 0,
1642
+ HTMLFormElement: 0,
1643
+ HTMLSelectElement: 0,
1644
+ MediaList: 0,
1645
+ MimeTypeArray: 0,
1646
+ NamedNodeMap: 0,
1647
+ NodeList: 1,
1648
+ PaintRequestList: 0,
1649
+ Plugin: 0,
1650
+ PluginArray: 0,
1651
+ SVGLengthList: 0,
1652
+ SVGNumberList: 0,
1653
+ SVGPathSegList: 0,
1654
+ SVGPointList: 0,
1655
+ SVGStringList: 0,
1656
+ SVGTransformList: 0,
1657
+ SourceBufferList: 0,
1658
+ StyleSheetList: 0,
1659
+ TextTrackCueList: 0,
1660
+ TextTrackList: 0,
1661
+ TouchList: 0
1662
+ };
1663
+
1664
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1665
+ var documentCreateElement = documentCreateElement$2;
1666
+
1667
+ var classList = documentCreateElement('span').classList;
1668
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1669
+
1670
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1671
+
1672
+ var global$4 = global$r;
1673
+ var DOMIterables = domIterables;
1674
+ var DOMTokenListPrototype = domTokenListPrototype;
1675
+ var ArrayIteratorMethods = es_array_iterator;
1676
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
1677
+ var wellKnownSymbol$2 = wellKnownSymbol$8;
1678
+
1679
+ var ITERATOR = wellKnownSymbol$2('iterator');
1680
+ var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1681
+ var ArrayValues = ArrayIteratorMethods.values;
1682
+
1683
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1684
+ if (CollectionPrototype) {
1685
+ // some Chrome versions have non-configurable methods on DOMTokenList
1686
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1687
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1688
+ } catch (error) {
1689
+ CollectionPrototype[ITERATOR] = ArrayValues;
1690
+ }
1691
+ if (!CollectionPrototype[TO_STRING_TAG$2]) {
1692
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1693
+ }
1694
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1695
+ // some Chrome versions have non-configurable methods on DOMTokenList
1696
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1697
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1698
+ } catch (error) {
1699
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1700
+ }
1701
+ }
1702
+ }
1703
+ };
1704
+
1705
+ for (var COLLECTION_NAME in DOMIterables) {
1706
+ handlePrototype(global$4[COLLECTION_NAME] && global$4[COLLECTION_NAME].prototype, COLLECTION_NAME);
1707
+ }
1708
+
1709
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1710
+
1711
+ const Flexbox = _a => {
1712
+ var {
1713
+ alignContent,
1714
+ alignItems,
1715
+ alignSelf,
1716
+ children,
1717
+ justifyContent,
1718
+ flexDirection,
1719
+ flexWrap,
1720
+ className
1721
+ } = _a,
1722
+ props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
1723
+
1724
+ const [classes, setClasses] = useState(['d-flex']);
1725
+ const [flexClassName, setFlexClassName] = useState('d-flex'); // // update className when classes change
1726
+
1727
+ useLayoutEffect(() => {
1728
+ const newClassName = classes.join(' ');
1729
+ if (newClassName !== flexClassName) setFlexClassName(newClassName);
1730
+ }, [classes, flexClassName]); // // update classes when props change
1731
+
1732
+ useLayoutEffect(() => {
1733
+ const newClasses = ['d-flex'];
1734
+ alignItems && newClasses.push(`align-items-${alignItems}`);
1735
+ alignContent && newClasses.push(`align-content-${alignContent}`);
1736
+ alignSelf && newClasses.push(`align-self-${alignSelf}`);
1737
+ justifyContent && newClasses.push(`justify-content-${justifyContent}`);
1738
+ flexDirection && newClasses.push(`flex-${flexDirection}`);
1739
+ flexWrap && newClasses.push(`flex-${flexWrap}`);
1740
+ className && newClasses.push(className);
1741
+ setClasses(newClasses);
1742
+ }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
1743
+ return jsx("div", Object.assign({
1744
+ className: flexClassName
1745
+ }, props, {
1746
+ children: children
1747
+ }));
1748
+ };
1749
+
1750
+ function Card({
1751
+ children,
1752
+ header,
1753
+ footer
1754
+ }) {
1755
+ return jsxs("section", Object.assign({
1756
+ className: "card"
1757
+ }, {
1758
+ children: [jsx("header", {
1759
+ children: header
1760
+ }), jsx("p", {
1761
+ children: children
1762
+ }), jsx("footer", {
1763
+ children: footer
1764
+ })]
1765
+ }));
1766
+ }
1767
+
1768
+ function Alert({
1769
+ type,
1770
+ header,
1771
+ footer,
1772
+ children,
1773
+ closeText,
1774
+ isCloseable = true
1775
+ }) {
1776
+ const [closeButton, setCloseButton] = useState();
1777
+ useEffect(() => {
1778
+ if (!isCloseable) {
1779
+ setCloseButton(null);
1780
+ } else {
1781
+ if (closeText) setCloseButton(jsx(Button, Object.assign({
1782
+ variant: "ghost"
1783
+ }, {
1784
+ children: jsx("span", Object.assign({
1785
+ className: "sr-only"
1786
+ }, {
1787
+ children: closeText
1788
+ }))
1789
+ })));else setCloseButton(jsx("button", {
1790
+ className: "close"
1791
+ }));
1792
+ }
1793
+ }, [isCloseable, closeText]);
1794
+ return jsxs("div", Object.assign({
1795
+ role: "alert",
1796
+ className: type
1797
+ }, {
1798
+ children: [header && jsxs("header", {
1799
+ children: [/*#__PURE__*/React.isValidElement(header) ? header : jsx("h3", {
1800
+ children: header
1801
+ }), closeButton]
1802
+ }), jsx("p", {
1803
+ children: children
1804
+ }), footer && jsx("footer", {
1805
+ children: footer
1806
+ })]
1807
+ }));
1808
+ }
1809
+
1810
+ const ButtonGroup = ({
1811
+ children,
1812
+ selectedIndex,
1813
+ variant
1814
+ }) => {
1815
+ const [selected, setSelected] = useState(selectedIndex);
1816
+ const [buttons, setButtons] = useState([]);
1817
+ useEffect(() => {
1818
+ const buttonProps = (children instanceof Array ? children : [children]).filter(b => b && b.props).map((b, ix) => {
1819
+ const bp = b.props;
1820
+ const props = Object.assign(Object.assign({}, bp), {
1821
+ variant,
1822
+ key: bp.key || `btn_${ix}`,
1823
+ active: ix === selected,
1824
+ onClick: e => {
1825
+ setSelected(ix);
1826
+ if (bp.onClick) bp.onClick(e);
1827
+ }
1828
+ });
1829
+ return props;
1830
+ });
1831
+ setButtons(buttonProps);
1832
+ }, [children, selected, variant]);
1833
+ return jsx(Group, {
1834
+ children: buttons.map(props => jsx(Button, Object.assign({}, props), props.key))
1835
+ });
1836
+ };
1837
+
1838
+ const validateInputValue = (target, rules, setError) => {
1839
+ const errorMessage = validateInputValueErrors(rules, target);
1840
+ errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
1841
+ return errorMessage;
1842
+ };
1843
+
1844
+ const validateInputValueErrors = (rules, target) => {
1845
+ const {
1846
+ value
1847
+ } = target;
1848
+
1849
+ if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
1850
+ return rules === null || rules === void 0 ? void 0 : rules.custom();
1851
+ }
1852
+
1853
+ return validateTextInputValues(value, rules);
1854
+ };
1855
+
1856
+ const setErrorInsert = (setError, name) => {
1857
+ setError(errors => {
1858
+ return Object.assign(Object.assign({}, errors), {
1859
+ [name]: true
1860
+ });
1861
+ });
1862
+ };
1863
+
1864
+ const setErrorRemove = (setError, name) => {
1865
+ setError(errors => {
1866
+ const newError = Object.assign({}, errors);
1867
+ delete newError[name];
1868
+ return newError;
1869
+ });
1870
+ };
1871
+
1872
+ const validateTextInputValues = (value, rules) => {
1873
+ switch (rules === null || rules === void 0 ? void 0 : rules.type) {
1874
+ case 'Required':
1875
+ {
1876
+ return value === '' || value === undefined || value === null ? 'error' : null;
1877
+ }
1878
+
1879
+ default:
1880
+ {
1881
+ return;
1882
+ }
1883
+ }
1884
+ };
1885
+
1886
+ const FormContext = /*#__PURE__*/React.createContext({});
1887
+ const useFormContext = () => {
1888
+ return React.useContext(FormContext);
1889
+ };
1890
+ const FormProvider = _a => {
1891
+ var {
1892
+ children,
1893
+ direction = 'vertical',
1894
+ formSize = 'md',
1895
+ onSubmit,
1896
+ onFormSubmit
1897
+ } = _a,
1898
+ props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
1899
+
1900
+ const [values, setValues] = React.useState();
1901
+ const [errors, setErrors] = React.useState();
1902
+ const [fields, setFields] = React.useState({});
1903
+
1904
+ const formSubmit = event => {
1905
+ let hasError = false;
1906
+ event.preventDefault();
1907
+ Object.keys(fields).forEach(key => {
1908
+ const errorMessage = validateInputValue({
1909
+ name: key,
1910
+ value: values === null || values === void 0 ? void 0 : values[key]
1911
+ }, fields[key], setErrors);
1912
+ hasError = hasError || !!errorMessage;
1913
+ });
1914
+
1915
+ if (!hasError) {
1916
+ onFormSubmit && onFormSubmit(values);
1917
+ }
1918
+ };
1919
+
1920
+ const resetForm = () => {
1921
+ setValues({});
1922
+ setErrors({});
1923
+ };
1924
+
1925
+ return jsx(FormContext.Provider, Object.assign({
1926
+ value: {
1927
+ setValues,
1928
+ setErrors,
1929
+ setFields,
1930
+ errors,
1931
+ values
1932
+ }
1933
+ }, {
1934
+ children: jsx("form", Object.assign({
1935
+ className: [direction, `size-${formSize}`].join(' '),
1936
+ onSubmit: formSubmit
1937
+ }, props, {
1938
+ onReset: resetForm
1939
+ }, {
1940
+ children: children
1941
+ }))
1942
+ }));
1943
+ };
1944
+
1945
+ const Form = props => {
1946
+ return jsx(FormProvider, Object.assign({}, props));
1947
+ };
1948
+
1949
+ const FormItems = ({
1950
+ children,
1951
+ validate,
1952
+ name
1953
+ }) => {
1954
+ const {
1955
+ setValues,
1956
+ setErrors,
1957
+ setFields,
1958
+ errors
1959
+ } = useFormContext();
1960
+ React.useEffect(() => {
1961
+ setFields(fields => Object.assign(Object.assign({}, fields), {
1962
+ [name]: validate === null || validate === void 0 ? void 0 : validate.rules
1963
+ }));
1964
+
1965
+ const removeValues = values => {
1966
+ const newValues = Object.assign({}, values);
1967
+ delete newValues[name];
1968
+ return newValues;
1969
+ };
1970
+
1971
+ return () => {
1972
+ setFields(fields => removeValues(fields));
1973
+ setValues(values => removeValues(values));
1974
+ setErrors(errors => removeValues(errors));
1975
+ };
1976
+ }, []);
1977
+
1978
+ const onChange = event => {
1979
+ const {
1980
+ value,
1981
+ name,
1982
+ type,
1983
+ checked
1984
+ } = event.target;
1985
+ let inputValue;
1986
+
1987
+ if (type === 'checkbox') {
1988
+ inputValue = checked ? value : null;
1989
+ checked ? setValues(values => Object.assign(Object.assign({}, values), {
1990
+ [name]: value
1991
+ })) : setValues(values => Object.assign(Object.assign({}, values), {
1992
+ [name]: null
1993
+ }));
1994
+ } else {
1995
+ inputValue = value;
1996
+ setValues(values => Object.assign(Object.assign({}, values), {
1997
+ [name]: value
1998
+ }));
1999
+ }
2000
+
2001
+ validateInputValue({
2002
+ value: inputValue,
2003
+ name,
2004
+ type,
2005
+ checked
2006
+ }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
2007
+ };
2008
+
2009
+ return /*#__PURE__*/React.cloneElement(children, {
2010
+ validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
2011
+ name,
2012
+ onChange
2013
+ });
2014
+ };
2015
+
2016
+ function Group({
2017
+ children,
2018
+ error,
2019
+ groupBorder = false
2020
+ }) {
2021
+ const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
2022
+ const errorMessage = error ? error.message || error : '';
2023
+ return jsxs("div", Object.assign({
2024
+ className: "form-group"
2025
+ }, {
2026
+ children: [jsx("div", Object.assign({
2027
+ className: groupClassName
2028
+ }, {
2029
+ children: children
2030
+ })), error && jsx("span", Object.assign({
2031
+ className: "form-info"
2032
+ }, {
2033
+ children: errorMessage
2034
+ }))]
2035
+ }));
2036
+ }
2037
+
2038
+ const useInput = (props, onChanges, onChangeInput) => {
2039
+ const id = useMemo(() => props.id || randomId(), [props.id]);
2040
+ const ref = useRef(null);
2041
+ const [value, setValue] = useState(props.value ? props.value : '');
2042
+ const [checked, setChecked] = useState(props.checked ? props.checked : false);
2043
+ useEffect(() => {
2044
+ if (ref.current && ref.current.form) {
2045
+ const resetListener = () => {
2046
+ setValue(props.value ? props.value : '');
2047
+ setChecked(props.checked ? props.checked : false);
2048
+ };
2049
+
2050
+ const form = ref.current.form;
2051
+ form.addEventListener('reset', resetListener);
2052
+ return () => form.removeEventListener('reset', resetListener);
2053
+ } else {
2054
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2055
+ return () => {};
2056
+ }
2057
+ }, [props]);
2058
+
2059
+ const onChange = event => {
2060
+ setValue(event.target.value);
2061
+ setChecked(event.currentTarget.checked);
2062
+ onChanges && onChanges(event);
2063
+ onChangeInput && onChangeInput(event.target.value);
2064
+ };
2065
+
2066
+ return Object.assign(Object.assign({}, props), {
2067
+ id,
2068
+ ref,
2069
+ value,
2070
+ checked,
2071
+ onChange
2072
+ });
2073
+ };
2074
+
2075
+ const RenderInput = (type, props, onChange, onChangeInput, label, info, validator) => {
2076
+ const _a = useInput(props, onChange, onChangeInput),
2077
+ {
2078
+ value
2079
+ } = _a,
2080
+ inputProps = __rest(_a, ["value"]);
2081
+
2082
+ const propsWithDescription = info ? Object.assign(Object.assign({}, inputProps), {
2083
+ 'aria-describedby': `${inputProps.id}_info`
2084
+ }) : inputProps; // Render naked
2085
+
2086
+ if (!label && !info) return jsx("input", Object.assign({
2087
+ type: type,
2088
+ value: value
2089
+ }, propsWithDescription));
2090
+ return jsxs("div", Object.assign({
2091
+ className: "form-group"
2092
+ }, {
2093
+ children: [label && jsx("label", Object.assign({
2094
+ htmlFor: inputProps.id
2095
+ }, {
2096
+ children: label
2097
+ })), info && jsx("span", Object.assign({
2098
+ className: "form-info",
2099
+ id: `${inputProps.id}_info`
2100
+ }, {
2101
+ children: info
2102
+ })), jsx("input", Object.assign({
2103
+ type: type,
2104
+ value: value
2105
+ }, propsWithDescription, {
2106
+ className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
2107
+ })), validator && jsx("span", Object.assign({
2108
+ className: "form-info"
2109
+ }, {
2110
+ children: validator.message
2111
+ }))]
2112
+ }));
2113
+ };
2114
+ const TextInput = _a => {
2115
+ var {
2116
+ label,
2117
+ info,
2118
+ onChange,
2119
+ onChangeInput,
2120
+ validator
2121
+ } = _a,
2122
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2123
+
2124
+ return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
2125
+ };
2126
+ const EmailInput = _a => {
2127
+ var {
2128
+ label,
2129
+ info,
2130
+ onChange,
2131
+ onChangeInput,
2132
+ validator
2133
+ } = _a,
2134
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2135
+
2136
+ return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
2137
+ };
2138
+ const NumberInput = _a => {
2139
+ var {
2140
+ label,
2141
+ info,
2142
+ onChange,
2143
+ onChangeInput,
2144
+ validator
2145
+ } = _a,
2146
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2147
+
2148
+ return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
2149
+ };
2150
+ const Checkbox = _a => {
2151
+ var {
2152
+ label,
2153
+ onChange,
2154
+ validator
2155
+ } = _a,
2156
+ props = __rest(_a, ["label", "onChange", "validator"]);
2157
+
2158
+ const inputProps = useInput(props, onChange);
2159
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2160
+ return jsxs(Fragment, {
2161
+ children: [jsxs("label", Object.assign({
2162
+ htmlFor: inputProps.id,
2163
+ className: `form-control ${validatorClassName}`
2164
+ }, {
2165
+ children: [label, jsx("input", Object.assign({
2166
+ type: "checkbox"
2167
+ }, inputProps)), jsx("span", {}), jsx("i", {})]
2168
+ })), validator && jsx("span", Object.assign({
2169
+ className: "form-info"
2170
+ }, {
2171
+ children: validator.message
2172
+ }))]
2173
+ });
2174
+ };
2175
+ const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
2176
+ var {
2177
+ label,
2178
+ validator
2179
+ } = _a,
2180
+ props = __rest(_a, ["label", "validator"]);
2181
+
2182
+ const {
2183
+ id
2184
+ } = useInput(props);
2185
+ return jsxs("label", Object.assign({
2186
+ htmlFor: id,
2187
+ className: "form-control"
2188
+ }, {
2189
+ children: [jsx("input", Object.assign({
2190
+ id: id,
2191
+ type: "radio"
2192
+ }, props, {
2193
+ className: validator,
2194
+ ref: ref
2195
+ })), jsx("span", {
2196
+ children: label
2197
+ }), jsx("i", {})]
2198
+ }));
2199
+ });
2200
+
2201
+ const Text = ({
2202
+ children
2203
+ }) => jsx("span", Object.assign({
2204
+ className: "form-text"
2205
+ }, {
2206
+ children: children
2207
+ }));
2208
+
2209
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
2210
+
2211
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
2212
+ var test = {};
2213
+
2214
+ test[TO_STRING_TAG$1] = 'z';
2215
+
2216
+ var toStringTagSupport = String(test) === '[object z]';
2217
+
2218
+ var global$3 = global$r;
2219
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2220
+ var isCallable$1 = isCallable$f;
2221
+ var classofRaw = classofRaw$1;
2222
+ var wellKnownSymbol = wellKnownSymbol$8;
2223
+
2224
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2225
+ var Object$1 = global$3.Object;
2226
+
2227
+ // ES3 wrong here
2228
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2229
+
2230
+ // fallback for IE11 Script Access Denied error
2231
+ var tryGet = function (it, key) {
2232
+ try {
2233
+ return it[key];
2234
+ } catch (error) { /* empty */ }
2235
+ };
2236
+
2237
+ // getting tag from ES6+ `Object.prototype.toString`
2238
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2239
+ var O, tag, result;
2240
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
2241
+ // @@toStringTag case
2242
+ : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
2243
+ // builtinTag case
2244
+ : CORRECT_ARGUMENTS ? classofRaw(O)
2245
+ // ES3 arguments fallback
2246
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
2247
+ };
2248
+
2249
+ var global$2 = global$r;
2250
+ var classof = classof$1;
2251
+
2252
+ var String$1 = global$2.String;
2253
+
2254
+ var toString$1 = function (argument) {
2255
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2256
+ return String$1(argument);
2257
+ };
2258
+
2259
+ var $ = _export;
2260
+ var DESCRIPTORS = descriptors;
2261
+ var global$1 = global$r;
2262
+ var uncurryThis = functionUncurryThis;
2263
+ var hasOwn = hasOwnProperty_1;
2264
+ var isCallable = isCallable$f;
2265
+ var isPrototypeOf = objectIsPrototypeOf;
2266
+ var toString = toString$1;
2267
+ var defineProperty = objectDefineProperty.f;
2268
+ var copyConstructorProperties = copyConstructorProperties$2;
2269
+
2270
+ var NativeSymbol = global$1.Symbol;
2271
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
2272
+
2273
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
2274
+ // Safari 12 bug
2275
+ NativeSymbol().description !== undefined
2276
+ )) {
2277
+ var EmptyStringDescriptionStore = {};
2278
+ // wrap Symbol constructor for correct work with undefined description
2279
+ var SymbolWrapper = function Symbol() {
2280
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
2281
+ var result = isPrototypeOf(SymbolPrototype, this)
2282
+ ? new NativeSymbol(description)
2283
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
2284
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
2285
+ if (description === '') EmptyStringDescriptionStore[result] = true;
2286
+ return result;
2287
+ };
2288
+
2289
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
2290
+ SymbolWrapper.prototype = SymbolPrototype;
2291
+ SymbolPrototype.constructor = SymbolWrapper;
2292
+
2293
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
2294
+ var symbolToString = uncurryThis(SymbolPrototype.toString);
2295
+ var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
2296
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
2297
+ var replace = uncurryThis(''.replace);
2298
+ var stringSlice = uncurryThis(''.slice);
2299
+
2300
+ defineProperty(SymbolPrototype, 'description', {
2301
+ configurable: true,
2302
+ get: function description() {
2303
+ var symbol = symbolValueOf(this);
2304
+ var string = symbolToString(symbol);
2305
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
2306
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
2307
+ return desc === '' ? undefined : desc;
2308
+ }
2309
+ });
2310
+
2311
+ $({ global: true, forced: true }, {
2312
+ Symbol: SymbolWrapper
2313
+ });
2314
+ }
2315
+
2316
+ const RadioGroup = ({
2317
+ description,
2318
+ title,
2319
+ validator,
2320
+ onChangeRadio,
2321
+ onChange,
2322
+ name,
2323
+ children
2324
+ }) => {
2325
+ const [checked, setChecked] = React.useState();
2326
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2327
+
2328
+ const onChanges = event => {
2329
+ setChecked(event.target.value);
2330
+ onChangeRadio && onChangeRadio(event.target.value);
2331
+ onChange && onChange(event);
2332
+ };
2333
+
2334
+ const radioBtnRef = React.useRef(null);
2335
+ React.useEffect(() => {
2336
+ var _a;
2337
+
2338
+ if (radioBtnRef && radioBtnRef.current) {
2339
+ const form = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
2340
+
2341
+ const resetListner = () => {
2342
+ setChecked(undefined);
2343
+ };
2344
+
2345
+ form === null || form === void 0 ? void 0 : form.addEventListener('reset', resetListner);
2346
+ return () => form === null || form === void 0 ? void 0 : form.removeEventListener('reset', resetListner);
2347
+ } else {
2348
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2349
+ return () => {};
2350
+ }
2351
+ }, []);
2352
+ return jsxs("div", Object.assign({
2353
+ className: "form-group"
2354
+ }, {
2355
+ children: [jsxs("fieldset", Object.assign({
2356
+ className: validatorClassName
2357
+ }, {
2358
+ children: [jsx("legend", {
2359
+ children: title
2360
+ }), jsx("span", Object.assign({
2361
+ className: "form-info"
2362
+ }, {
2363
+ children: description
2364
+ })), React.Children.map(children, Child => {
2365
+ return /*#__PURE__*/React.isValidElement(Child) ? /*#__PURE__*/React.cloneElement(Child, {
2366
+ validator: validatorClassName,
2367
+ onChange: onChanges,
2368
+ checked: checked === Child.props.value,
2369
+ name,
2370
+ ref: radioBtnRef
2371
+ }) : Child;
2372
+ })]
2373
+ })), (validator === null || validator === void 0 ? void 0 : validator.message) && jsx("span", Object.assign({
2374
+ className: "form-info"
2375
+ }, {
2376
+ children: validator === null || validator === void 0 ? void 0 : validator.message
2377
+ }))]
2378
+ }));
2379
+ };
2380
+
2381
+ const ListItem = _a => {
2382
+ var {
2383
+ listType,
2384
+ tableRowData,
2385
+ children
2386
+ } = _a,
2387
+ props = __rest(_a, ["listType", "tableRowData", "children"]);
2388
+
2389
+ if (listType === 'table') {
2390
+ return jsx("dl", {
2391
+ children: jsxs("div", {
2392
+ children: [jsx("dt", {
2393
+ children: tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.title
2394
+ }), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map((item, index) => jsx("dd", {
2395
+ children: item
2396
+ }, index))]
2397
+ })
2398
+ });
2399
+ } else {
2400
+ return jsx("li", Object.assign({}, props, {
2401
+ children: children
2402
+ }));
2403
+ }
2404
+ };
2405
+
2406
+ const List = _a => {
2407
+ var {
2408
+ listType,
2409
+ tableCaption,
2410
+ tableData,
2411
+ children
2412
+ } = _a,
2413
+ props = __rest(_a, ["listType", "tableCaption", "tableData", "children"]);
2414
+
2415
+ if (listType === 'ordered') {
2416
+ return jsx("ol", Object.assign({}, props, {
2417
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
2418
+ children: child
2419
+ }, index))
2420
+ }));
2421
+ } else if (listType !== 'table') {
2422
+ return jsx("ul", Object.assign({}, props, {
2423
+ className: listType
2424
+ }, {
2425
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
2426
+ children: child
2427
+ }, index))
2428
+ }));
2429
+ } else {
2430
+ return jsxs("figure", {
2431
+ children: [jsx("figcaption", Object.assign({
2432
+ className: "table-list-caption"
2433
+ }, {
2434
+ children: tableCaption
2435
+ })), jsx("dl", {
2436
+ children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsx(ListItem, {
2437
+ listType: listType,
2438
+ tableRowData: data
2439
+ }, index))
2440
+ })]
2441
+ });
2442
+ }
2443
+ };
2444
+
2445
+ const Link = _a => {
2446
+ var {
2447
+ button,
2448
+ children
2449
+ } = _a,
2450
+ props = __rest(_a, ["button", "children"]);
2451
+
2452
+ const [anchorProps, setAnchorProps] = useState({});
2453
+ useEffect(() => {
2454
+ const className = button ? typeof button === 'string' ? `button ${button}` : 'button' : undefined;
2455
+ const newProps = Object.assign({
2456
+ role: button ? 'button' : undefined,
2457
+ className: className
2458
+ }, props);
2459
+ setAnchorProps(newProps);
2460
+ }, [button]);
2461
+ return jsx("a", Object.assign({}, anchorProps, {
2462
+ children: children
2463
+ }));
2464
+ };
2465
+
2466
+ const Navbar = ({
2467
+ children,
2468
+ variant,
2469
+ title,
2470
+ titleLink,
2471
+ brandLink: _brandLink = 'https://www.seb.se',
2472
+ brandAriaLabel: _brandAriaLabel = 'Open seb.se in new tab'
2473
+ }) => {
2474
+ const [props, setProps] = useState({});
2475
+ useEffect(() => {
2476
+ const classNames = [];
2477
+ if (variant) classNames.push(variant);
2478
+ setProps(Object.assign(Object.assign({}, props), {
2479
+ className: classNames.join(' ')
2480
+ })); // eslint-disable-next-line react-hooks/exhaustive-deps
2481
+ }, [variant]);
2482
+ return jsxs("nav", Object.assign({
2483
+ role: "navigation"
2484
+ }, props, {
2485
+ children: [jsx(Link, {
2486
+ "aria-label": _brandAriaLabel,
2487
+ href: _brandLink,
2488
+ target: "_blank",
2489
+ className: "brand"
2490
+ }), jsx("div", Object.assign({
2491
+ className: "container-fluid"
2492
+ }, {
2493
+ children: jsxs("div", Object.assign({
2494
+ className: "row justify-content-between align-items-center"
2495
+ }, {
2496
+ children: [jsx("div", Object.assign({
2497
+ className: "col-auto"
2498
+ }, {
2499
+ children: titleLink ? jsx(Link, Object.assign({
2500
+ className: "mx-4",
2501
+ href: titleLink
2502
+ }, {
2503
+ children: jsx("h1", {
2504
+ children: title
2505
+ })
2506
+ })) : jsx("h1", {
2507
+ children: title
2508
+ })
2509
+ })), jsx("div", Object.assign({
2510
+ className: "col-auto"
2511
+ }, {
2512
+ children: jsx("div", Object.assign({
2513
+ className: "group size-sm"
2514
+ }, {
2515
+ children: children
2516
+ }))
2517
+ }))]
2518
+ }))
2519
+ }))]
2520
+ }));
2521
+ };
2522
+
2523
+ function Badge(_a) {
2524
+ var {
2525
+ children,
2526
+ badgeType,
2527
+ isCloseable,
2528
+ closeText
2529
+ } = _a,
2530
+ props = __rest(_a, ["children", "badgeType", "isCloseable", "closeText"]);
2531
+
2532
+ const [isClosed, setIsClosed] = React.useState(false);
2533
+ return !isClosed ? jsxs("span", Object.assign({}, props, {
2534
+ className: `badge ${badgeType}`
2535
+ }, {
2536
+ children: [jsx("strong", {
2537
+ children: children
2538
+ }), isCloseable && jsx("button", Object.assign({
2539
+ type: "button",
2540
+ className: "close",
2541
+ onClick: () => setIsClosed(true)
2542
+ }, {
2543
+ children: closeText
2544
+ }))]
2545
+ })) : null;
2546
+ }
2547
+
2548
+ const useDropdown = ({
2549
+ id,
2550
+ texts,
2551
+ options,
2552
+ loop,
2553
+ multiSelect,
2554
+ selectValue,
2555
+ useValue,
2556
+ display,
2557
+ togglerRef,
2558
+ listboxRef
2559
+ }) => {
2560
+ const [handler, setHandler] = useState();
2561
+ const [dropdown, setDropdown] = useState();
2562
+ const [togglerProps, setTogglerProps] = useState({});
2563
+ const [listboxProps, setListboxProps] = useState({});
2564
+ const [listItems, setListItems] = useState([]);
2565
+ const [multiSelectProps, setMultiSelectProps] = useState({}); // When dropdown data changes
2566
+
2567
+ useEffect(() => {
2568
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2569
+
2570
+ if (!dropdown) return;
2571
+ const {
2572
+ elements: {
2573
+ toggler,
2574
+ listbox
2575
+ }
2576
+ } = dropdown;
2577
+ const newToggleProps = Object.assign(Object.assign({}, toggler === null || toggler === void 0 ? void 0 : toggler.attributes), {
2578
+ className: (_a = toggler === null || toggler === void 0 ? void 0 : toggler.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2579
+ children: ((_b = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _b === void 0 ? void 0 : _b.select) || ((_c = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _c === void 0 ? void 0 : _c.placeholder),
2580
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.toggle()
2581
+ });
2582
+ setTogglerProps(newToggleProps);
2583
+ const newListboxProps = Object.assign(Object.assign({}, listbox === null || listbox === void 0 ? void 0 : listbox.attributes), {
2584
+ className: (_d = listbox === null || listbox === void 0 ? void 0 : listbox.classes) === null || _d === void 0 ? void 0 : _d.join(' ')
2585
+ });
2586
+ setListboxProps(newListboxProps);
2587
+
2588
+ if (!dropdown.isMultiSelect) {
2589
+ const newListItems = dropdown.options.map(o => {
2590
+ var _a;
2591
+
2592
+ return Object.assign(Object.assign({}, o.attributes), {
2593
+ className: (_a = o.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2594
+ children: o[dropdown.display],
2595
+ selected: o.selected,
2596
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o)
2597
+ });
2598
+ });
2599
+ setListItems(newListItems);
2600
+ } else {
2601
+ const checkboxes = dropdown.options.map(o => ({
2602
+ labelProps: Object.assign(Object.assign({}, o.attributes), {
2603
+ className: ['form-control', ...o.classes].join(' ')
2604
+ }),
2605
+ inputProps: {
2606
+ defaultChecked: o.selected,
2607
+ type: 'checkbox',
2608
+ onChange: () => handler === null || handler === void 0 ? void 0 : handler.select(o, false)
2609
+ },
2610
+ spanProps: {
2611
+ children: o[dropdown.display]
2612
+ }
2613
+ }));
2614
+ const newMultiselect = {
2615
+ fieldsetProps: {
2616
+ 'aria-describedby': (_g = (_f = (_e = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _e === void 0 ? void 0 : _e.fieldset) === null || _f === void 0 ? void 0 : _f.attributes) === null || _g === void 0 ? void 0 : _g.id,
2617
+ 'aria-multiselectable': true,
2618
+ role: 'listbox',
2619
+ tabIndex: -1
2620
+ },
2621
+ legendProps: {
2622
+ className: 'sr-only',
2623
+ id: (_k = (_j = (_h = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _h === void 0 ? void 0 : _h.fieldset) === null || _j === void 0 ? void 0 : _j.attributes) === null || _k === void 0 ? void 0 : _k.id,
2624
+ children: dropdown.texts.optionsDescription
2625
+ },
2626
+ checkboxes
2627
+ };
2628
+ setMultiSelectProps(newMultiselect);
2629
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
2630
+
2631
+ }, [dropdown]); // When dropdown properties change
2632
+
2633
+ useEffect(() => {
2634
+ if (!dropdown) return;
2635
+ handler === null || handler === void 0 ? void 0 : handler.update({
2636
+ id,
2637
+ texts,
2638
+ options,
2639
+ loop,
2640
+ multiSelect
2641
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
2642
+ }, [id, texts, options, loop, multiSelect, selectValue, useValue, display]); // Create dropdown handler
2643
+
2644
+ useEffect(() => {
2645
+ if (!handler && togglerRef.current && listboxRef.current) {
2646
+ setHandler(createDropdown({
2647
+ id,
2648
+ texts,
2649
+ options,
2650
+ loop,
2651
+ multiSelect,
2652
+ selectValue,
2653
+ useValue,
2654
+ display
2655
+ }, togglerRef.current, listboxRef.current, listboxRef.current, dd => setDropdown(dd)));
2656
+ }
2657
+
2658
+ return () => handler === null || handler === void 0 ? void 0 : handler.destroy(); // eslint-disable-next-line react-hooks/exhaustive-deps
2659
+ }, [togglerRef, listboxRef]);
2660
+ return {
2661
+ dropdown: handler,
2662
+ togglerProps,
2663
+ listboxProps,
2664
+ listItems,
2665
+ multiSelectProps
2666
+ };
2667
+ };
2668
+
2669
+ const Dropdown = ({
2670
+ id,
2671
+ options,
2672
+ loop,
2673
+ multiSelect,
2674
+ selectValue,
2675
+ useValue,
2676
+ display,
2677
+ texts
2678
+ }) => {
2679
+ var _a;
2680
+
2681
+ const togglerRef = useRef(null);
2682
+ const listboxRef = useRef(null);
2683
+ const {
2684
+ dropdown,
2685
+ listboxProps,
2686
+ togglerProps,
2687
+ listItems,
2688
+ multiSelectProps
2689
+ } = useDropdown({
2690
+ id,
2691
+ options,
2692
+ loop,
2693
+ multiSelect,
2694
+ selectValue,
2695
+ useValue,
2696
+ display,
2697
+ togglerRef,
2698
+ listboxRef,
2699
+ texts
2700
+ });
2701
+ return jsxs("div", {
2702
+ children: [jsx("button", Object.assign({
2703
+ type: "button"
2704
+ }, togglerProps, {
2705
+ ref: togglerRef
2706
+ }, {
2707
+ children: jsx("span", {
2708
+ children: togglerProps.children
2709
+ })
2710
+ })), jsxs("div", Object.assign({}, listboxProps, {
2711
+ ref: listboxRef
2712
+ }, {
2713
+ children: [jsx("button", Object.assign({
2714
+ type: "button",
2715
+ className: "close m-4 m-sm-2 d-block d-sm-none",
2716
+ onClick: dropdown === null || dropdown === void 0 ? void 0 : dropdown.close
2717
+ }, {
2718
+ children: jsx("span", Object.assign({
2719
+ className: "sr-only"
2720
+ }, {
2721
+ children: dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.texts.close
2722
+ }))
2723
+ })), (dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.isMultiSelect) ? jsx("div", Object.assign({
2724
+ className: "sg-fieldset-container"
2725
+ }, {
2726
+ children: jsxs("fieldset", Object.assign({}, multiSelectProps.fieldsetProps, {
2727
+ children: [jsx("legend", Object.assign({}, multiSelectProps.legendProps)), (_a = multiSelectProps.checkboxes) === null || _a === void 0 ? void 0 : _a.map(checkboxItem => jsxs("label", Object.assign({}, checkboxItem.labelProps, {
2728
+ children: [jsx("input", Object.assign({}, checkboxItem.inputProps)), jsx("span", Object.assign({}, checkboxItem.spanProps)), jsx("i", {})]
2729
+ }), checkboxItem.labelProps.id))]
2730
+ }))
2731
+ })) : jsx("ul", Object.assign({
2732
+ role: "listbox"
2733
+ }, {
2734
+ children: listItems.map(liProps => jsx("li", Object.assign({}, liProps), liProps.id))
2735
+ }))]
2736
+ }))]
2737
+ });
2738
+ };
2739
+
2740
+ export { Alert, Badge, Button, ButtonGroup, Card, Checkbox, Dropdown, EmailInput, Flexbox, Form, FormItems, Group, Link, List, Modal, Navbar, NumberInput, RadioButton, RadioGroup, RenderInput, Text, TextInput };