@sebgroup/green-react 1.0.0-beta.2 → 1.0.0-beta.20

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