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