@opengeoweb/form-fields 9.33.1-spike-ol.6 → 9.35.0

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 (2) hide show
  1. package/index.esm.js +406 -2799
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -92,2049 +92,27 @@ function _objectWithoutPropertiesLoose(r, e) {
92
92
  return t;
93
93
  }
94
94
 
95
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
96
-
97
- var check = function (it) {
98
- return it && it.Math === Math && it;
99
- };
100
-
101
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
102
- var globalThis_1 =
103
- // eslint-disable-next-line es/no-global-this -- safe
104
- check(typeof globalThis == 'object' && globalThis) ||
105
- check(typeof window == 'object' && window) ||
106
- // eslint-disable-next-line no-restricted-globals -- safe
107
- check(typeof self == 'object' && self) ||
108
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
109
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
110
- // eslint-disable-next-line no-new-func -- fallback
111
- (function () { return this; })() || Function('return this')();
112
-
113
- var objectGetOwnPropertyDescriptor = {};
114
-
115
- var fails$l = function (exec) {
116
- try {
117
- return !!exec();
118
- } catch (error) {
119
- return true;
120
- }
121
- };
122
-
123
- var fails$k = fails$l;
124
-
125
- // Detect IE8's incomplete defineProperty implementation
126
- var descriptors = !fails$k(function () {
127
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
128
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
129
- });
130
-
131
- var fails$j = fails$l;
132
-
133
- var functionBindNative = !fails$j(function () {
134
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
135
- var test = (function () { /* empty */ }).bind();
136
- // eslint-disable-next-line no-prototype-builtins -- safe
137
- return typeof test != 'function' || test.hasOwnProperty('prototype');
138
- });
139
-
140
- var NATIVE_BIND$1 = functionBindNative;
141
-
142
- var call$c = Function.prototype.call;
143
-
144
- var functionCall = NATIVE_BIND$1 ? call$c.bind(call$c) : function () {
145
- return call$c.apply(call$c, arguments);
146
- };
147
-
148
- var objectPropertyIsEnumerable = {};
149
-
150
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
151
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
152
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
153
-
154
- // Nashorn ~ JDK8 bug
155
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
156
-
157
- // `Object.prototype.propertyIsEnumerable` method implementation
158
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
159
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
160
- var descriptor = getOwnPropertyDescriptor$1(this, V);
161
- return !!descriptor && descriptor.enumerable;
162
- } : $propertyIsEnumerable;
163
-
164
- var createPropertyDescriptor$3 = function (bitmap, value) {
165
- return {
166
- enumerable: !(bitmap & 1),
167
- configurable: !(bitmap & 2),
168
- writable: !(bitmap & 4),
169
- value: value
170
- };
171
- };
172
-
173
- var NATIVE_BIND = functionBindNative;
174
-
175
- var FunctionPrototype$1 = Function.prototype;
176
- var call$b = FunctionPrototype$1.call;
177
- var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$b, call$b);
178
-
179
- var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
180
- return function () {
181
- return call$b.apply(fn, arguments);
182
- };
183
- };
184
-
185
- var uncurryThis$g = functionUncurryThis;
186
-
187
- var toString$a = uncurryThis$g({}.toString);
188
- var stringSlice$3 = uncurryThis$g(''.slice);
189
-
190
- var classofRaw$1 = function (it) {
191
- return stringSlice$3(toString$a(it), 8, -1);
192
- };
193
-
194
- var uncurryThis$f = functionUncurryThis;
195
- var fails$i = fails$l;
196
- var classof$5 = classofRaw$1;
197
-
198
- var $Object$4 = Object;
199
- var split = uncurryThis$f(''.split);
200
-
201
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
202
- var indexedObject = fails$i(function () {
203
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
204
- // eslint-disable-next-line no-prototype-builtins -- safe
205
- return !$Object$4('z').propertyIsEnumerable(0);
206
- }) ? function (it) {
207
- return classof$5(it) === 'String' ? split(it, '') : $Object$4(it);
208
- } : $Object$4;
209
-
210
- // we can't use just `it == null` since of `document.all` special case
211
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
212
- var isNullOrUndefined$3 = function (it) {
213
- return it === null || it === undefined;
214
- };
215
-
216
- var isNullOrUndefined$2 = isNullOrUndefined$3;
217
-
218
- var $TypeError$9 = TypeError;
219
-
220
- // `RequireObjectCoercible` abstract operation
221
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
222
- var requireObjectCoercible$7 = function (it) {
223
- if (isNullOrUndefined$2(it)) throw new $TypeError$9("Can't call method on " + it);
224
- return it;
225
- };
226
-
227
- // toObject with fallback for non-array-like ES3 strings
228
- var IndexedObject$2 = indexedObject;
229
- var requireObjectCoercible$6 = requireObjectCoercible$7;
230
-
231
- var toIndexedObject$5 = function (it) {
232
- return IndexedObject$2(requireObjectCoercible$6(it));
233
- };
234
-
235
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
236
- var documentAll = typeof document == 'object' && document.all;
237
-
238
- // `IsCallable` abstract operation
239
- // https://tc39.es/ecma262/#sec-iscallable
240
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
241
- var isCallable$g = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
242
- return typeof argument == 'function' || argument === documentAll;
243
- } : function (argument) {
244
- return typeof argument == 'function';
245
- };
246
-
247
- var isCallable$f = isCallable$g;
248
-
249
- var isObject$9 = function (it) {
250
- return typeof it == 'object' ? it !== null : isCallable$f(it);
251
- };
252
-
253
- var globalThis$i = globalThis_1;
254
- var isCallable$e = isCallable$g;
255
-
256
- var aFunction = function (argument) {
257
- return isCallable$e(argument) ? argument : undefined;
258
- };
259
-
260
- var getBuiltIn$3 = function (namespace, method) {
261
- return arguments.length < 2 ? aFunction(globalThis$i[namespace]) : globalThis$i[namespace] && globalThis$i[namespace][method];
262
- };
263
-
264
- var uncurryThis$e = functionUncurryThis;
265
-
266
- var objectIsPrototypeOf = uncurryThis$e({}.isPrototypeOf);
267
-
268
- var globalThis$h = globalThis_1;
269
-
270
- var navigator = globalThis$h.navigator;
271
- var userAgent$2 = navigator && navigator.userAgent;
272
-
273
- var environmentUserAgent = userAgent$2 ? String(userAgent$2) : '';
274
-
275
- var globalThis$g = globalThis_1;
276
- var userAgent$1 = environmentUserAgent;
277
-
278
- var process = globalThis$g.process;
279
- var Deno$1 = globalThis$g.Deno;
280
- var versions = process && process.versions || Deno$1 && Deno$1.version;
281
- var v8 = versions && versions.v8;
282
- var match, version;
283
-
284
- if (v8) {
285
- match = v8.split('.');
286
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
287
- // but their correct versions are not interesting for us
288
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
289
- }
290
-
291
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
292
- // so check `userAgent` even if `.v8` exists, but 0
293
- if (!version && userAgent$1) {
294
- match = userAgent$1.match(/Edge\/(\d+)/);
295
- if (!match || match[1] >= 74) {
296
- match = userAgent$1.match(/Chrome\/(\d+)/);
297
- if (match) version = +match[1];
298
- }
299
- }
300
-
301
- var environmentV8Version = version;
302
-
303
- /* eslint-disable es/no-symbol -- required for testing */
304
- var V8_VERSION = environmentV8Version;
305
- var fails$h = fails$l;
306
- var globalThis$f = globalThis_1;
307
-
308
- var $String$5 = globalThis$f.String;
309
-
310
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
311
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$h(function () {
312
- var symbol = Symbol('symbol detection');
313
- // Chrome 38 Symbol has incorrect toString conversion
314
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
315
- // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
316
- // of course, fail.
317
- return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
318
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
319
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
320
- });
321
-
322
- /* eslint-disable es/no-symbol -- required for testing */
323
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
324
-
325
- var useSymbolAsUid = NATIVE_SYMBOL$1 &&
326
- !Symbol.sham &&
327
- typeof Symbol.iterator == 'symbol';
328
-
329
- var getBuiltIn$2 = getBuiltIn$3;
330
- var isCallable$d = isCallable$g;
331
- var isPrototypeOf$1 = objectIsPrototypeOf;
332
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
333
-
334
- var $Object$3 = Object;
335
-
336
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
337
- return typeof it == 'symbol';
338
- } : function (it) {
339
- var $Symbol = getBuiltIn$2('Symbol');
340
- return isCallable$d($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$3(it));
341
- };
342
-
343
- var $String$4 = String;
344
-
345
- var tryToString$1 = function (argument) {
346
- try {
347
- return $String$4(argument);
348
- } catch (error) {
349
- return 'Object';
350
- }
351
- };
352
-
353
- var isCallable$c = isCallable$g;
354
- var tryToString = tryToString$1;
355
-
356
- var $TypeError$8 = TypeError;
357
-
358
- // `Assert: IsCallable(argument) is true`
359
- var aCallable$3 = function (argument) {
360
- if (isCallable$c(argument)) return argument;
361
- throw new $TypeError$8(tryToString(argument) + ' is not a function');
362
- };
363
-
364
- var aCallable$2 = aCallable$3;
365
- var isNullOrUndefined$1 = isNullOrUndefined$3;
366
-
367
- // `GetMethod` abstract operation
368
- // https://tc39.es/ecma262/#sec-getmethod
369
- var getMethod$2 = function (V, P) {
370
- var func = V[P];
371
- return isNullOrUndefined$1(func) ? undefined : aCallable$2(func);
372
- };
373
-
374
- var call$a = functionCall;
375
- var isCallable$b = isCallable$g;
376
- var isObject$8 = isObject$9;
377
-
378
- var $TypeError$7 = TypeError;
379
-
380
- // `OrdinaryToPrimitive` abstract operation
381
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
382
- var ordinaryToPrimitive$1 = function (input, pref) {
383
- var fn, val;
384
- if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$8(val = call$a(fn, input))) return val;
385
- if (isCallable$b(fn = input.valueOf) && !isObject$8(val = call$a(fn, input))) return val;
386
- if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$8(val = call$a(fn, input))) return val;
387
- throw new $TypeError$7("Can't convert object to primitive value");
388
- };
389
-
390
- var sharedStore = {exports: {}};
391
-
392
- var globalThis$e = globalThis_1;
393
-
394
- // eslint-disable-next-line es/no-object-defineproperty -- safe
395
- var defineProperty$5 = Object.defineProperty;
396
-
397
- var defineGlobalProperty$3 = function (key, value) {
398
- try {
399
- defineProperty$5(globalThis$e, key, { value: value, configurable: true, writable: true });
400
- } catch (error) {
401
- globalThis$e[key] = value;
402
- } return value;
403
- };
404
-
405
- var globalThis$d = globalThis_1;
406
- var defineGlobalProperty$2 = defineGlobalProperty$3;
407
-
408
- var SHARED = '__core-js_shared__';
409
- var store$3 = sharedStore.exports = globalThis$d[SHARED] || defineGlobalProperty$2(SHARED, {});
410
-
411
- (store$3.versions || (store$3.versions = [])).push({
412
- version: '3.39.0',
413
- mode: 'global',
414
- copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
415
- license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE',
416
- source: 'https://github.com/zloirock/core-js'
417
- });
418
-
419
- var sharedStoreExports = sharedStore.exports;
420
-
421
- var store$2 = sharedStoreExports;
422
-
423
- var shared$4 = function (key, value) {
424
- return store$2[key] || (store$2[key] = value || {});
425
- };
426
-
427
- var requireObjectCoercible$5 = requireObjectCoercible$7;
428
-
429
- var $Object$2 = Object;
430
-
431
- // `ToObject` abstract operation
432
- // https://tc39.es/ecma262/#sec-toobject
433
- var toObject$4 = function (argument) {
434
- return $Object$2(requireObjectCoercible$5(argument));
435
- };
436
-
437
- var uncurryThis$d = functionUncurryThis;
438
- var toObject$3 = toObject$4;
439
-
440
- var hasOwnProperty = uncurryThis$d({}.hasOwnProperty);
441
-
442
- // `HasOwnProperty` abstract operation
443
- // https://tc39.es/ecma262/#sec-hasownproperty
444
- // eslint-disable-next-line es/no-object-hasown -- safe
445
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
446
- return hasOwnProperty(toObject$3(it), key);
447
- };
448
-
449
- var uncurryThis$c = functionUncurryThis;
450
-
451
- var id = 0;
452
- var postfix = Math.random();
453
- var toString$9 = uncurryThis$c(1.0.toString);
454
-
455
- var uid$2 = function (key) {
456
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$9(++id + postfix, 36);
457
- };
458
-
459
- var globalThis$c = globalThis_1;
460
- var shared$3 = shared$4;
461
- var hasOwn$9 = hasOwnProperty_1;
462
- var uid$1 = uid$2;
463
- var NATIVE_SYMBOL = symbolConstructorDetection;
464
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
465
-
466
- var Symbol$3 = globalThis$c.Symbol;
467
- var WellKnownSymbolsStore = shared$3('wks');
468
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
469
-
470
- var wellKnownSymbol$b = function (name) {
471
- if (!hasOwn$9(WellKnownSymbolsStore, name)) {
472
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$9(Symbol$3, name)
473
- ? Symbol$3[name]
474
- : createWellKnownSymbol('Symbol.' + name);
475
- } return WellKnownSymbolsStore[name];
476
- };
477
-
478
- var call$9 = functionCall;
479
- var isObject$7 = isObject$9;
480
- var isSymbol$1 = isSymbol$2;
481
- var getMethod$1 = getMethod$2;
482
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
483
- var wellKnownSymbol$a = wellKnownSymbol$b;
484
-
485
- var $TypeError$6 = TypeError;
486
- var TO_PRIMITIVE = wellKnownSymbol$a('toPrimitive');
487
-
488
- // `ToPrimitive` abstract operation
489
- // https://tc39.es/ecma262/#sec-toprimitive
490
- var toPrimitive$1 = function (input, pref) {
491
- if (!isObject$7(input) || isSymbol$1(input)) return input;
492
- var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
493
- var result;
494
- if (exoticToPrim) {
495
- if (pref === undefined) pref = 'default';
496
- result = call$9(exoticToPrim, input, pref);
497
- if (!isObject$7(result) || isSymbol$1(result)) return result;
498
- throw new $TypeError$6("Can't convert object to primitive value");
499
- }
500
- if (pref === undefined) pref = 'number';
501
- return ordinaryToPrimitive(input, pref);
502
- };
503
-
504
- var toPrimitive = toPrimitive$1;
505
- var isSymbol = isSymbol$2;
506
-
507
- // `ToPropertyKey` abstract operation
508
- // https://tc39.es/ecma262/#sec-topropertykey
509
- var toPropertyKey$2 = function (argument) {
510
- var key = toPrimitive(argument, 'string');
511
- return isSymbol(key) ? key : key + '';
512
- };
513
-
514
- var globalThis$b = globalThis_1;
515
- var isObject$6 = isObject$9;
516
-
517
- var document$1 = globalThis$b.document;
518
- // typeof document.createElement is 'object' in old IE
519
- var EXISTS$1 = isObject$6(document$1) && isObject$6(document$1.createElement);
520
-
521
- var documentCreateElement$2 = function (it) {
522
- return EXISTS$1 ? document$1.createElement(it) : {};
523
- };
524
-
525
- var DESCRIPTORS$9 = descriptors;
526
- var fails$g = fails$l;
527
- var createElement = documentCreateElement$2;
528
-
529
- // Thanks to IE8 for its funny defineProperty
530
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$g(function () {
531
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
532
- return Object.defineProperty(createElement('div'), 'a', {
533
- get: function () { return 7; }
534
- }).a !== 7;
535
- });
536
-
537
- var DESCRIPTORS$8 = descriptors;
538
- var call$8 = functionCall;
539
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
540
- var createPropertyDescriptor$2 = createPropertyDescriptor$3;
541
- var toIndexedObject$4 = toIndexedObject$5;
542
- var toPropertyKey$1 = toPropertyKey$2;
543
- var hasOwn$8 = hasOwnProperty_1;
544
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
545
-
546
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
547
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
548
-
549
- // `Object.getOwnPropertyDescriptor` method
550
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
551
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
552
- O = toIndexedObject$4(O);
553
- P = toPropertyKey$1(P);
554
- if (IE8_DOM_DEFINE$1) try {
555
- return $getOwnPropertyDescriptor$1(O, P);
556
- } catch (error) { /* empty */ }
557
- if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$8(propertyIsEnumerableModule$1.f, O, P), O[P]);
558
- };
559
-
560
- var objectDefineProperty = {};
561
-
562
- var DESCRIPTORS$7 = descriptors;
563
- var fails$f = fails$l;
564
-
565
- // V8 ~ Chrome 36-
566
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
567
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$f(function () {
568
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
569
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
570
- value: 42,
571
- writable: false
572
- }).prototype !== 42;
573
- });
574
-
575
- var isObject$5 = isObject$9;
576
-
577
- var $String$3 = String;
578
- var $TypeError$5 = TypeError;
579
-
580
- // `Assert: Type(argument) is Object`
581
- var anObject$9 = function (argument) {
582
- if (isObject$5(argument)) return argument;
583
- throw new $TypeError$5($String$3(argument) + ' is not an object');
584
- };
585
-
586
- var DESCRIPTORS$6 = descriptors;
587
- var IE8_DOM_DEFINE = ie8DomDefine;
588
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
589
- var anObject$8 = anObject$9;
590
- var toPropertyKey = toPropertyKey$2;
591
-
592
- var $TypeError$4 = TypeError;
593
- // eslint-disable-next-line es/no-object-defineproperty -- safe
594
- var $defineProperty = Object.defineProperty;
595
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
596
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
597
- var ENUMERABLE = 'enumerable';
598
- var CONFIGURABLE$1 = 'configurable';
599
- var WRITABLE = 'writable';
600
-
601
- // `Object.defineProperty` method
602
- // https://tc39.es/ecma262/#sec-object.defineproperty
603
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
604
- anObject$8(O);
605
- P = toPropertyKey(P);
606
- anObject$8(Attributes);
607
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
608
- var current = $getOwnPropertyDescriptor(O, P);
609
- if (current && current[WRITABLE]) {
610
- O[P] = Attributes.value;
611
- Attributes = {
612
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
613
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
614
- writable: false
615
- };
616
- }
617
- } return $defineProperty(O, P, Attributes);
618
- } : $defineProperty : function defineProperty(O, P, Attributes) {
619
- anObject$8(O);
620
- P = toPropertyKey(P);
621
- anObject$8(Attributes);
622
- if (IE8_DOM_DEFINE) try {
623
- return $defineProperty(O, P, Attributes);
624
- } catch (error) { /* empty */ }
625
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$4('Accessors not supported');
626
- if ('value' in Attributes) O[P] = Attributes.value;
627
- return O;
628
- };
629
-
630
- var DESCRIPTORS$5 = descriptors;
631
- var definePropertyModule$3 = objectDefineProperty;
632
- var createPropertyDescriptor$1 = createPropertyDescriptor$3;
633
-
634
- var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
635
- return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
636
- } : function (object, key, value) {
637
- object[key] = value;
638
- return object;
639
- };
640
-
641
- var makeBuiltIn$2 = {exports: {}};
642
-
643
- var DESCRIPTORS$4 = descriptors;
644
- var hasOwn$7 = hasOwnProperty_1;
645
-
646
- var FunctionPrototype = Function.prototype;
647
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
648
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
649
-
650
- var EXISTS = hasOwn$7(FunctionPrototype, 'name');
651
- // additional protection from minified / mangled / dropped function names
652
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
653
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
654
-
655
- var functionName = {
656
- EXISTS: EXISTS,
657
- PROPER: PROPER,
658
- CONFIGURABLE: CONFIGURABLE
659
- };
660
-
661
- var uncurryThis$b = functionUncurryThis;
662
- var isCallable$a = isCallable$g;
663
- var store$1 = sharedStoreExports;
664
-
665
- var functionToString = uncurryThis$b(Function.toString);
666
-
667
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
668
- if (!isCallable$a(store$1.inspectSource)) {
669
- store$1.inspectSource = function (it) {
670
- return functionToString(it);
671
- };
672
- }
673
-
674
- var inspectSource$1 = store$1.inspectSource;
675
-
676
- var globalThis$a = globalThis_1;
677
- var isCallable$9 = isCallable$g;
678
-
679
- var WeakMap$1 = globalThis$a.WeakMap;
680
-
681
- var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
682
-
683
- var shared$2 = shared$4;
684
- var uid = uid$2;
685
-
686
- var keys = shared$2('keys');
687
-
688
- var sharedKey$3 = function (key) {
689
- return keys[key] || (keys[key] = uid(key));
690
- };
691
-
692
- var hiddenKeys$4 = {};
693
-
694
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
695
- var globalThis$9 = globalThis_1;
696
- var isObject$4 = isObject$9;
697
- var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
698
- var hasOwn$6 = hasOwnProperty_1;
699
- var shared$1 = sharedStoreExports;
700
- var sharedKey$2 = sharedKey$3;
701
- var hiddenKeys$3 = hiddenKeys$4;
702
-
703
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
704
- var TypeError$1 = globalThis$9.TypeError;
705
- var WeakMap = globalThis$9.WeakMap;
706
- var set, get, has;
707
-
708
- var enforce = function (it) {
709
- return has(it) ? get(it) : set(it, {});
710
- };
711
-
712
- var getterFor = function (TYPE) {
713
- return function (it) {
714
- var state;
715
- if (!isObject$4(it) || (state = get(it)).type !== TYPE) {
716
- throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
717
- } return state;
718
- };
719
- };
720
-
721
- if (NATIVE_WEAK_MAP || shared$1.state) {
722
- var store = shared$1.state || (shared$1.state = new WeakMap());
723
- /* eslint-disable no-self-assign -- prototype methods protection */
724
- store.get = store.get;
725
- store.has = store.has;
726
- store.set = store.set;
727
- /* eslint-enable no-self-assign -- prototype methods protection */
728
- set = function (it, metadata) {
729
- if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
730
- metadata.facade = it;
731
- store.set(it, metadata);
732
- return metadata;
733
- };
734
- get = function (it) {
735
- return store.get(it) || {};
736
- };
737
- has = function (it) {
738
- return store.has(it);
739
- };
740
- } else {
741
- var STATE = sharedKey$2('state');
742
- hiddenKeys$3[STATE] = true;
743
- set = function (it, metadata) {
744
- if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
745
- metadata.facade = it;
746
- createNonEnumerableProperty$4(it, STATE, metadata);
747
- return metadata;
748
- };
749
- get = function (it) {
750
- return hasOwn$6(it, STATE) ? it[STATE] : {};
751
- };
752
- has = function (it) {
753
- return hasOwn$6(it, STATE);
754
- };
755
- }
756
-
757
- var internalState = {
758
- set: set,
759
- get: get,
760
- has: has,
761
- enforce: enforce,
762
- getterFor: getterFor
763
- };
764
-
765
- var uncurryThis$a = functionUncurryThis;
766
- var fails$e = fails$l;
767
- var isCallable$8 = isCallable$g;
768
- var hasOwn$5 = hasOwnProperty_1;
769
- var DESCRIPTORS$3 = descriptors;
770
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
771
- var inspectSource = inspectSource$1;
772
- var InternalStateModule$1 = internalState;
773
-
774
- var enforceInternalState = InternalStateModule$1.enforce;
775
- var getInternalState$2 = InternalStateModule$1.get;
776
- var $String$2 = String;
777
- // eslint-disable-next-line es/no-object-defineproperty -- safe
778
- var defineProperty$4 = Object.defineProperty;
779
- var stringSlice$2 = uncurryThis$a(''.slice);
780
- var replace$2 = uncurryThis$a(''.replace);
781
- var join = uncurryThis$a([].join);
782
-
783
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$e(function () {
784
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
785
- });
786
-
787
- var TEMPLATE = String(String).split('String');
788
-
789
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
790
- if (stringSlice$2($String$2(name), 0, 7) === 'Symbol(') {
791
- name = '[' + replace$2($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
792
- }
793
- if (options && options.getter) name = 'get ' + name;
794
- if (options && options.setter) name = 'set ' + name;
795
- if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
796
- if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
797
- else value.name = name;
798
- }
799
- if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
800
- defineProperty$4(value, 'length', { value: options.arity });
801
- }
802
- try {
803
- if (options && hasOwn$5(options, 'constructor') && options.constructor) {
804
- if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
805
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
806
- } else if (value.prototype) value.prototype = undefined;
807
- } catch (error) { /* empty */ }
808
- var state = enforceInternalState(value);
809
- if (!hasOwn$5(state, 'source')) {
810
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
811
- } return value;
812
- };
813
-
814
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
815
- // eslint-disable-next-line no-extend-native -- required
816
- Function.prototype.toString = makeBuiltIn$1(function toString() {
817
- return isCallable$8(this) && getInternalState$2(this).source || inspectSource(this);
818
- }, 'toString');
819
-
820
- var makeBuiltInExports = makeBuiltIn$2.exports;
821
-
822
- var isCallable$7 = isCallable$g;
823
- var definePropertyModule$2 = objectDefineProperty;
824
- var makeBuiltIn = makeBuiltInExports;
825
- var defineGlobalProperty$1 = defineGlobalProperty$3;
826
-
827
- var defineBuiltIn$5 = function (O, key, value, options) {
828
- if (!options) options = {};
829
- var simple = options.enumerable;
830
- var name = options.name !== undefined ? options.name : key;
831
- if (isCallable$7(value)) makeBuiltIn(value, name, options);
832
- if (options.global) {
833
- if (simple) O[key] = value;
834
- else defineGlobalProperty$1(key, value);
835
- } else {
836
- try {
837
- if (!options.unsafe) delete O[key];
838
- else if (O[key]) simple = true;
839
- } catch (error) { /* empty */ }
840
- if (simple) O[key] = value;
841
- else definePropertyModule$2.f(O, key, {
842
- value: value,
843
- enumerable: false,
844
- configurable: !options.nonConfigurable,
845
- writable: !options.nonWritable
846
- });
847
- } return O;
848
- };
849
-
850
- var objectGetOwnPropertyNames = {};
851
-
852
- var ceil = Math.ceil;
853
- var floor = Math.floor;
854
-
855
- // `Math.trunc` method
856
- // https://tc39.es/ecma262/#sec-math.trunc
857
- // eslint-disable-next-line es/no-math-trunc -- safe
858
- var mathTrunc = Math.trunc || function trunc(x) {
859
- var n = +x;
860
- return (n > 0 ? floor : ceil)(n);
861
- };
862
-
863
- var trunc = mathTrunc;
864
-
865
- // `ToIntegerOrInfinity` abstract operation
866
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
867
- var toIntegerOrInfinity$3 = function (argument) {
868
- var number = +argument;
869
- // eslint-disable-next-line no-self-compare -- NaN check
870
- return number !== number || number === 0 ? 0 : trunc(number);
871
- };
872
-
873
- var toIntegerOrInfinity$2 = toIntegerOrInfinity$3;
874
-
875
- var max = Math.max;
876
- var min$1 = Math.min;
877
-
878
- // Helper for a popular repeating case of the spec:
879
- // Let integer be ? ToInteger(index).
880
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
881
- var toAbsoluteIndex$1 = function (index, length) {
882
- var integer = toIntegerOrInfinity$2(index);
883
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
884
- };
885
-
886
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$3;
887
-
888
- var min = Math.min;
889
-
890
- // `ToLength` abstract operation
891
- // https://tc39.es/ecma262/#sec-tolength
892
- var toLength$2 = function (argument) {
893
- var len = toIntegerOrInfinity$1(argument);
894
- return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
895
- };
896
-
897
- var toLength$1 = toLength$2;
898
-
899
- // `LengthOfArrayLike` abstract operation
900
- // https://tc39.es/ecma262/#sec-lengthofarraylike
901
- var lengthOfArrayLike$2 = function (obj) {
902
- return toLength$1(obj.length);
903
- };
904
-
905
- var toIndexedObject$3 = toIndexedObject$5;
906
- var toAbsoluteIndex = toAbsoluteIndex$1;
907
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
908
-
909
- // `Array.prototype.{ indexOf, includes }` methods implementation
910
- var createMethod$3 = function (IS_INCLUDES) {
911
- return function ($this, el, fromIndex) {
912
- var O = toIndexedObject$3($this);
913
- var length = lengthOfArrayLike$1(O);
914
- if (length === 0) return !IS_INCLUDES && -1;
915
- var index = toAbsoluteIndex(fromIndex, length);
916
- var value;
917
- // Array#includes uses SameValueZero equality algorithm
918
- // eslint-disable-next-line no-self-compare -- NaN check
919
- if (IS_INCLUDES && el !== el) while (length > index) {
920
- value = O[index++];
921
- // eslint-disable-next-line no-self-compare -- NaN check
922
- if (value !== value) return true;
923
- // Array#indexOf ignores holes, Array#includes - not
924
- } else for (;length > index; index++) {
925
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
926
- } return !IS_INCLUDES && -1;
927
- };
928
- };
929
-
930
- var arrayIncludes = {
931
- // `Array.prototype.includes` method
932
- // https://tc39.es/ecma262/#sec-array.prototype.includes
933
- includes: createMethod$3(true),
934
- // `Array.prototype.indexOf` method
935
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
936
- indexOf: createMethod$3(false)
937
- };
938
-
939
- var uncurryThis$9 = functionUncurryThis;
940
- var hasOwn$4 = hasOwnProperty_1;
941
- var toIndexedObject$2 = toIndexedObject$5;
942
- var indexOf$1 = arrayIncludes.indexOf;
943
- var hiddenKeys$2 = hiddenKeys$4;
944
-
945
- var push = uncurryThis$9([].push);
946
-
947
- var objectKeysInternal = function (object, names) {
948
- var O = toIndexedObject$2(object);
949
- var i = 0;
950
- var result = [];
951
- var key;
952
- for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
953
- // Don't enum bug & hidden keys
954
- while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
955
- ~indexOf$1(result, key) || push(result, key);
956
- }
957
- return result;
958
- };
959
-
960
- // IE8- don't enum bug keys
961
- var enumBugKeys$3 = [
962
- 'constructor',
963
- 'hasOwnProperty',
964
- 'isPrototypeOf',
965
- 'propertyIsEnumerable',
966
- 'toLocaleString',
967
- 'toString',
968
- 'valueOf'
969
- ];
970
-
971
- var internalObjectKeys$1 = objectKeysInternal;
972
- var enumBugKeys$2 = enumBugKeys$3;
973
-
974
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
975
-
976
- // `Object.getOwnPropertyNames` method
977
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
978
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
979
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
980
- return internalObjectKeys$1(O, hiddenKeys$1);
981
- };
982
-
983
- var objectGetOwnPropertySymbols = {};
984
-
985
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
986
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
987
-
988
- var getBuiltIn$1 = getBuiltIn$3;
989
- var uncurryThis$8 = functionUncurryThis;
990
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
991
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
992
- var anObject$7 = anObject$9;
993
-
994
- var concat$1 = uncurryThis$8([].concat);
995
-
996
- // all object keys, includes non-enumerable and symbols
997
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
998
- var keys = getOwnPropertyNamesModule.f(anObject$7(it));
999
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1000
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
1001
- };
1002
-
1003
- var hasOwn$3 = hasOwnProperty_1;
1004
- var ownKeys = ownKeys$1;
1005
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1006
- var definePropertyModule$1 = objectDefineProperty;
1007
-
1008
- var copyConstructorProperties$1 = function (target, source, exceptions) {
1009
- var keys = ownKeys(source);
1010
- var defineProperty = definePropertyModule$1.f;
1011
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1012
- for (var i = 0; i < keys.length; i++) {
1013
- var key = keys[i];
1014
- if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
1015
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1016
- }
1017
- }
1018
- };
1019
-
1020
- var fails$d = fails$l;
1021
- var isCallable$6 = isCallable$g;
1022
-
1023
- var replacement = /#|\.prototype\./;
1024
-
1025
- var isForced$1 = function (feature, detection) {
1026
- var value = data[normalize(feature)];
1027
- return value === POLYFILL ? true
1028
- : value === NATIVE ? false
1029
- : isCallable$6(detection) ? fails$d(detection)
1030
- : !!detection;
1031
- };
1032
-
1033
- var normalize = isForced$1.normalize = function (string) {
1034
- return String(string).replace(replacement, '.').toLowerCase();
1035
- };
1036
-
1037
- var data = isForced$1.data = {};
1038
- var NATIVE = isForced$1.NATIVE = 'N';
1039
- var POLYFILL = isForced$1.POLYFILL = 'P';
1040
-
1041
- var isForced_1 = isForced$1;
1042
-
1043
- var globalThis$8 = globalThis_1;
1044
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1045
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
1046
- var defineBuiltIn$4 = defineBuiltIn$5;
1047
- var defineGlobalProperty = defineGlobalProperty$3;
1048
- var copyConstructorProperties = copyConstructorProperties$1;
1049
- var isForced = isForced_1;
1050
-
1051
- /*
1052
- options.target - name of the target object
1053
- options.global - target is the global object
1054
- options.stat - export as static methods of target
1055
- options.proto - export as prototype methods of target
1056
- options.real - real prototype method for the `pure` version
1057
- options.forced - export even if the native feature is available
1058
- options.bind - bind methods to the target, required for the `pure` version
1059
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1060
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1061
- options.sham - add a flag to not completely full polyfills
1062
- options.enumerable - export as enumerable property
1063
- options.dontCallGetSet - prevent calling a getter on target
1064
- options.name - the .name of the function if it does not match the key
1065
- */
1066
- var _export = function (options, source) {
1067
- var TARGET = options.target;
1068
- var GLOBAL = options.global;
1069
- var STATIC = options.stat;
1070
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1071
- if (GLOBAL) {
1072
- target = globalThis$8;
1073
- } else if (STATIC) {
1074
- target = globalThis$8[TARGET] || defineGlobalProperty(TARGET, {});
1075
- } else {
1076
- target = globalThis$8[TARGET] && globalThis$8[TARGET].prototype;
1077
- }
1078
- if (target) for (key in source) {
1079
- sourceProperty = source[key];
1080
- if (options.dontCallGetSet) {
1081
- descriptor = getOwnPropertyDescriptor(target, key);
1082
- targetProperty = descriptor && descriptor.value;
1083
- } else targetProperty = target[key];
1084
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1085
- // contained in target
1086
- if (!FORCED && targetProperty !== undefined) {
1087
- if (typeof sourceProperty == typeof targetProperty) continue;
1088
- copyConstructorProperties(sourceProperty, targetProperty);
1089
- }
1090
- // add a flag to not completely full polyfills
1091
- if (options.sham || (targetProperty && targetProperty.sham)) {
1092
- createNonEnumerableProperty$3(sourceProperty, 'sham', true);
1093
- }
1094
- defineBuiltIn$4(target, key, sourceProperty, options);
1095
- }
1096
- };
1097
-
1098
- var internalObjectKeys = objectKeysInternal;
1099
- var enumBugKeys$1 = enumBugKeys$3;
1100
-
1101
- // `Object.keys` method
1102
- // https://tc39.es/ecma262/#sec-object.keys
1103
- // eslint-disable-next-line es/no-object-keys -- safe
1104
- var objectKeys$2 = Object.keys || function keys(O) {
1105
- return internalObjectKeys(O, enumBugKeys$1);
1106
- };
1107
-
1108
- var DESCRIPTORS$2 = descriptors;
1109
- var uncurryThis$7 = functionUncurryThis;
1110
- var call$7 = functionCall;
1111
- var fails$c = fails$l;
1112
- var objectKeys$1 = objectKeys$2;
1113
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1114
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1115
- var toObject$2 = toObject$4;
1116
- var IndexedObject$1 = indexedObject;
1117
-
1118
- // eslint-disable-next-line es/no-object-assign -- safe
1119
- var $assign = Object.assign;
1120
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1121
- var defineProperty$3 = Object.defineProperty;
1122
- var concat = uncurryThis$7([].concat);
1123
-
1124
- // `Object.assign` method
1125
- // https://tc39.es/ecma262/#sec-object.assign
1126
- var objectAssign = !$assign || fails$c(function () {
1127
- // should have correct order of operations (Edge bug)
1128
- if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1129
- enumerable: true,
1130
- get: function () {
1131
- defineProperty$3(this, 'b', {
1132
- value: 3,
1133
- enumerable: false
1134
- });
1135
- }
1136
- }), { b: 2 })).b !== 1) return true;
1137
- // should work with symbols and should have deterministic property order (V8 bug)
1138
- var A = {};
1139
- var B = {};
1140
- // eslint-disable-next-line es/no-symbol -- safe
1141
- var symbol = Symbol('assign detection');
1142
- var alphabet = 'abcdefghijklmnopqrst';
1143
- A[symbol] = 7;
1144
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1145
- return $assign({}, A)[symbol] !== 7 || objectKeys$1($assign({}, B)).join('') !== alphabet;
1146
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1147
- var T = toObject$2(target);
1148
- var argumentsLength = arguments.length;
1149
- var index = 1;
1150
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1151
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1152
- while (argumentsLength > index) {
1153
- var S = IndexedObject$1(arguments[index++]);
1154
- var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1155
- var length = keys.length;
1156
- var j = 0;
1157
- var key;
1158
- while (length > j) {
1159
- key = keys[j++];
1160
- if (!DESCRIPTORS$2 || call$7(propertyIsEnumerable, S, key)) T[key] = S[key];
1161
- }
1162
- } return T;
1163
- } : $assign;
1164
-
1165
- var $$9 = _export;
1166
- var assign = objectAssign;
1167
-
1168
- // `Object.assign` method
1169
- // https://tc39.es/ecma262/#sec-object.assign
1170
- // eslint-disable-next-line es/no-object-assign -- required for testing
1171
- $$9({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1172
- assign: assign
1173
- });
1174
-
1175
- var objectDefineProperties = {};
1176
-
1177
- var DESCRIPTORS$1 = descriptors;
1178
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1179
- var definePropertyModule = objectDefineProperty;
1180
- var anObject$6 = anObject$9;
1181
- var toIndexedObject$1 = toIndexedObject$5;
1182
- var objectKeys = objectKeys$2;
1183
-
1184
- // `Object.defineProperties` method
1185
- // https://tc39.es/ecma262/#sec-object.defineproperties
1186
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1187
- objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1188
- anObject$6(O);
1189
- var props = toIndexedObject$1(Properties);
1190
- var keys = objectKeys(Properties);
1191
- var length = keys.length;
1192
- var index = 0;
1193
- var key;
1194
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1195
- return O;
1196
- };
1197
-
1198
- var getBuiltIn = getBuiltIn$3;
1199
-
1200
- var html$1 = getBuiltIn('document', 'documentElement');
1201
-
1202
- /* global ActiveXObject -- old IE, WSH */
1203
- var anObject$5 = anObject$9;
1204
- var definePropertiesModule = objectDefineProperties;
1205
- var enumBugKeys = enumBugKeys$3;
1206
- var hiddenKeys = hiddenKeys$4;
1207
- var html = html$1;
1208
- var documentCreateElement$1 = documentCreateElement$2;
1209
- var sharedKey$1 = sharedKey$3;
1210
-
1211
- var GT = '>';
1212
- var LT = '<';
1213
- var PROTOTYPE = 'prototype';
1214
- var SCRIPT = 'script';
1215
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1216
-
1217
- var EmptyConstructor = function () { /* empty */ };
1218
-
1219
- var scriptTag = function (content) {
1220
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1221
- };
1222
-
1223
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1224
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1225
- activeXDocument.write(scriptTag(''));
1226
- activeXDocument.close();
1227
- var temp = activeXDocument.parentWindow.Object;
1228
- // eslint-disable-next-line no-useless-assignment -- avoid memory leak
1229
- activeXDocument = null;
1230
- return temp;
1231
- };
1232
-
1233
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1234
- var NullProtoObjectViaIFrame = function () {
1235
- // Thrash, waste and sodomy: IE GC bug
1236
- var iframe = documentCreateElement$1('iframe');
1237
- var JS = 'java' + SCRIPT + ':';
1238
- var iframeDocument;
1239
- iframe.style.display = 'none';
1240
- html.appendChild(iframe);
1241
- // https://github.com/zloirock/core-js/issues/475
1242
- iframe.src = String(JS);
1243
- iframeDocument = iframe.contentWindow.document;
1244
- iframeDocument.open();
1245
- iframeDocument.write(scriptTag('document.F=Object'));
1246
- iframeDocument.close();
1247
- return iframeDocument.F;
1248
- };
1249
-
1250
- // Check for document.domain and active x support
1251
- // No need to use active x approach when document.domain is not set
1252
- // see https://github.com/es-shims/es5-shim/issues/150
1253
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1254
- // avoid IE GC bug
1255
- var activeXDocument;
1256
- var NullProtoObject = function () {
1257
- try {
1258
- activeXDocument = new ActiveXObject('htmlfile');
1259
- } catch (error) { /* ignore */ }
1260
- NullProtoObject = typeof document != 'undefined'
1261
- ? document.domain && activeXDocument
1262
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1263
- : NullProtoObjectViaIFrame()
1264
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1265
- var length = enumBugKeys.length;
1266
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1267
- return NullProtoObject();
1268
- };
1269
-
1270
- hiddenKeys[IE_PROTO$1] = true;
1271
-
1272
- // `Object.create` method
1273
- // https://tc39.es/ecma262/#sec-object.create
1274
- // eslint-disable-next-line es/no-object-create -- safe
1275
- var objectCreate = Object.create || function create(O, Properties) {
1276
- var result;
1277
- if (O !== null) {
1278
- EmptyConstructor[PROTOTYPE] = anObject$5(O);
1279
- result = new EmptyConstructor();
1280
- EmptyConstructor[PROTOTYPE] = null;
1281
- // add "__proto__" for Object.getPrototypeOf polyfill
1282
- result[IE_PROTO$1] = O;
1283
- } else result = NullProtoObject();
1284
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1285
- };
1286
-
1287
- var wellKnownSymbol$9 = wellKnownSymbol$b;
1288
- var create$2 = objectCreate;
1289
- var defineProperty$2 = objectDefineProperty.f;
1290
-
1291
- var UNSCOPABLES = wellKnownSymbol$9('unscopables');
1292
- var ArrayPrototype = Array.prototype;
1293
-
1294
- // Array.prototype[@@unscopables]
1295
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1296
- if (ArrayPrototype[UNSCOPABLES] === undefined) {
1297
- defineProperty$2(ArrayPrototype, UNSCOPABLES, {
1298
- configurable: true,
1299
- value: create$2(null)
1300
- });
1301
- }
1302
-
1303
- // add a key to Array.prototype[@@unscopables]
1304
- var addToUnscopables$2 = function (key) {
1305
- ArrayPrototype[UNSCOPABLES][key] = true;
1306
- };
1307
-
1308
- var iterators = {};
1309
-
1310
- var fails$b = fails$l;
1311
-
1312
- var correctPrototypeGetter = !fails$b(function () {
1313
- function F() { /* empty */ }
1314
- F.prototype.constructor = null;
1315
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1316
- return Object.getPrototypeOf(new F()) !== F.prototype;
1317
- });
1318
-
1319
- var hasOwn$2 = hasOwnProperty_1;
1320
- var isCallable$5 = isCallable$g;
1321
- var toObject$1 = toObject$4;
1322
- var sharedKey = sharedKey$3;
1323
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1324
-
1325
- var IE_PROTO = sharedKey('IE_PROTO');
1326
- var $Object$1 = Object;
1327
- var ObjectPrototype = $Object$1.prototype;
1328
-
1329
- // `Object.getPrototypeOf` method
1330
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1331
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1332
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1333
- var object = toObject$1(O);
1334
- if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1335
- var constructor = object.constructor;
1336
- if (isCallable$5(constructor) && object instanceof constructor) {
1337
- return constructor.prototype;
1338
- } return object instanceof $Object$1 ? ObjectPrototype : null;
1339
- };
1340
-
1341
- var fails$a = fails$l;
1342
- var isCallable$4 = isCallable$g;
1343
- var isObject$3 = isObject$9;
1344
- var getPrototypeOf$1 = objectGetPrototypeOf;
1345
- var defineBuiltIn$3 = defineBuiltIn$5;
1346
- var wellKnownSymbol$8 = wellKnownSymbol$b;
1347
-
1348
- var ITERATOR$4 = wellKnownSymbol$8('iterator');
1349
- var BUGGY_SAFARI_ITERATORS$1 = false;
1350
-
1351
- // `%IteratorPrototype%` object
1352
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1353
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1354
-
1355
- /* eslint-disable es/no-array-prototype-keys -- safe */
1356
- if ([].keys) {
1357
- arrayIterator = [].keys();
1358
- // Safari 8 has buggy iterators w/o `next`
1359
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1360
- else {
1361
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1362
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1363
- }
1364
- }
1365
-
1366
- var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$a(function () {
1367
- var test = {};
1368
- // FF44- legacy iterators case
1369
- return IteratorPrototype$2[ITERATOR$4].call(test) !== test;
1370
- });
1371
-
1372
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1373
-
1374
- // `%IteratorPrototype%[@@iterator]()` method
1375
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1376
- if (!isCallable$4(IteratorPrototype$2[ITERATOR$4])) {
1377
- defineBuiltIn$3(IteratorPrototype$2, ITERATOR$4, function () {
1378
- return this;
1379
- });
1380
- }
1381
-
1382
- var iteratorsCore = {
1383
- IteratorPrototype: IteratorPrototype$2,
1384
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1385
- };
1386
-
1387
- var defineProperty$1 = objectDefineProperty.f;
1388
- var hasOwn$1 = hasOwnProperty_1;
1389
- var wellKnownSymbol$7 = wellKnownSymbol$b;
1390
-
1391
- var TO_STRING_TAG$2 = wellKnownSymbol$7('toStringTag');
1392
-
1393
- var setToStringTag$3 = function (target, TAG, STATIC) {
1394
- if (target && !STATIC) target = target.prototype;
1395
- if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
1396
- defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1397
- }
1398
- };
1399
-
1400
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1401
- var create$1 = objectCreate;
1402
- var createPropertyDescriptor = createPropertyDescriptor$3;
1403
- var setToStringTag$2 = setToStringTag$3;
1404
- var Iterators$2 = iterators;
1405
-
1406
- var returnThis$1 = function () { return this; };
1407
-
1408
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1409
- var TO_STRING_TAG = NAME + ' Iterator';
1410
- IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1411
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1412
- Iterators$2[TO_STRING_TAG] = returnThis$1;
1413
- return IteratorConstructor;
1414
- };
1415
-
1416
- var uncurryThis$6 = functionUncurryThis;
1417
- var aCallable$1 = aCallable$3;
1418
-
1419
- var functionUncurryThisAccessor = function (object, key, method) {
1420
- try {
1421
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1422
- return uncurryThis$6(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
1423
- } catch (error) { /* empty */ }
1424
- };
1425
-
1426
- var isObject$2 = isObject$9;
1427
-
1428
- var isPossiblePrototype$1 = function (argument) {
1429
- return isObject$2(argument) || argument === null;
1430
- };
1431
-
1432
- var isPossiblePrototype = isPossiblePrototype$1;
1433
-
1434
- var $String$1 = String;
1435
- var $TypeError$3 = TypeError;
1436
-
1437
- var aPossiblePrototype$1 = function (argument) {
1438
- if (isPossiblePrototype(argument)) return argument;
1439
- throw new $TypeError$3("Can't set " + $String$1(argument) + ' as a prototype');
1440
- };
1441
-
1442
- /* eslint-disable no-proto -- safe */
1443
- var uncurryThisAccessor = functionUncurryThisAccessor;
1444
- var isObject$1 = isObject$9;
1445
- var requireObjectCoercible$4 = requireObjectCoercible$7;
1446
- var aPossiblePrototype = aPossiblePrototype$1;
1447
-
1448
- // `Object.setPrototypeOf` method
1449
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1450
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1451
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1452
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1453
- var CORRECT_SETTER = false;
1454
- var test = {};
1455
- var setter;
1456
- try {
1457
- setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1458
- setter(test, []);
1459
- CORRECT_SETTER = test instanceof Array;
1460
- } catch (error) { /* empty */ }
1461
- return function setPrototypeOf(O, proto) {
1462
- requireObjectCoercible$4(O);
1463
- aPossiblePrototype(proto);
1464
- if (!isObject$1(O)) return O;
1465
- if (CORRECT_SETTER) setter(O, proto);
1466
- else O.__proto__ = proto;
1467
- return O;
1468
- };
1469
- }() : undefined);
1470
-
1471
- var $$8 = _export;
1472
- var call$6 = functionCall;
1473
- var FunctionName = functionName;
1474
- var isCallable$3 = isCallable$g;
1475
- var createIteratorConstructor = iteratorCreateConstructor;
1476
- var getPrototypeOf = objectGetPrototypeOf;
1477
- var setPrototypeOf = objectSetPrototypeOf;
1478
- var setToStringTag$1 = setToStringTag$3;
1479
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1480
- var defineBuiltIn$2 = defineBuiltIn$5;
1481
- var wellKnownSymbol$6 = wellKnownSymbol$b;
1482
- var Iterators$1 = iterators;
1483
- var IteratorsCore = iteratorsCore;
1484
-
1485
- var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
1486
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1487
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1488
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1489
- var ITERATOR$3 = wellKnownSymbol$6('iterator');
1490
- var KEYS = 'keys';
1491
- var VALUES = 'values';
1492
- var ENTRIES = 'entries';
1493
-
1494
- var returnThis = function () { return this; };
1495
-
1496
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1497
- createIteratorConstructor(IteratorConstructor, NAME, next);
1498
-
1499
- var getIterationMethod = function (KIND) {
1500
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1501
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1502
-
1503
- switch (KIND) {
1504
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1505
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1506
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1507
- }
1508
-
1509
- return function () { return new IteratorConstructor(this); };
1510
- };
1511
-
1512
- var TO_STRING_TAG = NAME + ' Iterator';
1513
- var INCORRECT_VALUES_NAME = false;
1514
- var IterablePrototype = Iterable.prototype;
1515
- var nativeIterator = IterablePrototype[ITERATOR$3]
1516
- || IterablePrototype['@@iterator']
1517
- || DEFAULT && IterablePrototype[DEFAULT];
1518
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1519
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1520
- var CurrentIteratorPrototype, methods, KEY;
1521
-
1522
- // fix native
1523
- if (anyNativeIterator) {
1524
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1525
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1526
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1527
- if (setPrototypeOf) {
1528
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1529
- } else if (!isCallable$3(CurrentIteratorPrototype[ITERATOR$3])) {
1530
- defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$3, returnThis);
1531
- }
1532
- }
1533
- // Set @@toStringTag to native iterators
1534
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1535
- }
1536
- }
1537
-
1538
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1539
- if (PROPER_FUNCTION_NAME$2 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1540
- if (CONFIGURABLE_FUNCTION_NAME) {
1541
- createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1542
- } else {
1543
- INCORRECT_VALUES_NAME = true;
1544
- defaultIterator = function values() { return call$6(nativeIterator, this); };
1545
- }
1546
- }
1547
-
1548
- // export additional methods
1549
- if (DEFAULT) {
1550
- methods = {
1551
- values: getIterationMethod(VALUES),
1552
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1553
- entries: getIterationMethod(ENTRIES)
1554
- };
1555
- if (FORCED) for (KEY in methods) {
1556
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1557
- defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1558
- }
1559
- } else $$8({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1560
- }
1561
-
1562
- // define iterator
1563
- if (IterablePrototype[ITERATOR$3] !== defaultIterator) {
1564
- defineBuiltIn$2(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
1565
- }
1566
- Iterators$1[NAME] = defaultIterator;
1567
-
1568
- return methods;
1569
- };
1570
-
1571
- // `CreateIterResultObject` abstract operation
1572
- // https://tc39.es/ecma262/#sec-createiterresultobject
1573
- var createIterResultObject$1 = function (value, done) {
1574
- return { value: value, done: done };
1575
- };
1576
-
1577
- var toIndexedObject = toIndexedObject$5;
1578
- var addToUnscopables$1 = addToUnscopables$2;
1579
- var Iterators = iterators;
1580
- var InternalStateModule = internalState;
1581
- var defineProperty = objectDefineProperty.f;
1582
- var defineIterator = iteratorDefine;
1583
- var createIterResultObject = createIterResultObject$1;
1584
- var DESCRIPTORS = descriptors;
1585
-
1586
- var ARRAY_ITERATOR = 'Array Iterator';
1587
- var setInternalState = InternalStateModule.set;
1588
- var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
1589
-
1590
- // `Array.prototype.entries` method
1591
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1592
- // `Array.prototype.keys` method
1593
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1594
- // `Array.prototype.values` method
1595
- // https://tc39.es/ecma262/#sec-array.prototype.values
1596
- // `Array.prototype[@@iterator]` method
1597
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1598
- // `CreateArrayIterator` internal method
1599
- // https://tc39.es/ecma262/#sec-createarrayiterator
1600
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1601
- setInternalState(this, {
1602
- type: ARRAY_ITERATOR,
1603
- target: toIndexedObject(iterated), // target
1604
- index: 0, // next index
1605
- kind: kind // kind
1606
- });
1607
- // `%ArrayIteratorPrototype%.next` method
1608
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1609
- }, function () {
1610
- var state = getInternalState$1(this);
1611
- var target = state.target;
1612
- var index = state.index++;
1613
- if (!target || index >= target.length) {
1614
- state.target = null;
1615
- return createIterResultObject(undefined, true);
1616
- }
1617
- switch (state.kind) {
1618
- case 'keys': return createIterResultObject(index, false);
1619
- case 'values': return createIterResultObject(target[index], false);
1620
- } return createIterResultObject([index, target[index]], false);
1621
- }, 'values');
1622
-
1623
- // argumentsList[@@iterator] is %ArrayProto_values%
1624
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1625
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1626
- var values = Iterators.Arguments = Iterators.Array;
1627
-
1628
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1629
- addToUnscopables$1('keys');
1630
- addToUnscopables$1('values');
1631
- addToUnscopables$1('entries');
1632
-
1633
- // V8 ~ Chrome 45- bug
1634
- if (DESCRIPTORS && values.name !== 'values') try {
1635
- defineProperty(values, 'name', { value: 'values' });
1636
- } catch (error) { /* empty */ }
1637
-
1638
- var wellKnownSymbol$5 = wellKnownSymbol$b;
1639
-
1640
- var TO_STRING_TAG$1 = wellKnownSymbol$5('toStringTag');
1641
- var test = {};
1642
-
1643
- test[TO_STRING_TAG$1] = 'z';
1644
-
1645
- var toStringTagSupport = String(test) === '[object z]';
1646
-
1647
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1648
- var isCallable$2 = isCallable$g;
1649
- var classofRaw = classofRaw$1;
1650
- var wellKnownSymbol$4 = wellKnownSymbol$b;
1651
-
1652
- var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
1653
- var $Object = Object;
1654
-
1655
- // ES3 wrong here
1656
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
1657
-
1658
- // fallback for IE11 Script Access Denied error
1659
- var tryGet = function (it, key) {
1660
- try {
1661
- return it[key];
1662
- } catch (error) { /* empty */ }
1663
- };
1664
-
1665
- // getting tag from ES6+ `Object.prototype.toString`
1666
- var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1667
- var O, tag, result;
1668
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1669
- // @@toStringTag case
1670
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1671
- // builtinTag case
1672
- : CORRECT_ARGUMENTS ? classofRaw(O)
1673
- // ES3 arguments fallback
1674
- : (result = classofRaw(O)) === 'Object' && isCallable$2(O.callee) ? 'Arguments' : result;
1675
- };
1676
-
1677
- var classof$3 = classof$4;
1678
-
1679
- var $String = String;
1680
-
1681
- var toString$8 = function (argument) {
1682
- if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1683
- return $String(argument);
1684
- };
1685
-
1686
- // a string of all valid unicode whitespaces
1687
- var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1688
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1689
-
1690
- var uncurryThis$5 = functionUncurryThis;
1691
- var requireObjectCoercible$3 = requireObjectCoercible$7;
1692
- var toString$7 = toString$8;
1693
- var whitespaces$3 = whitespaces$4;
1694
-
1695
- var replace$1 = uncurryThis$5(''.replace);
1696
- var ltrim = RegExp('^[' + whitespaces$3 + ']+');
1697
- var rtrim = RegExp('(^|[^' + whitespaces$3 + '])[' + whitespaces$3 + ']+$');
1698
-
1699
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1700
- var createMethod$2 = function (TYPE) {
1701
- return function ($this) {
1702
- var string = toString$7(requireObjectCoercible$3($this));
1703
- if (TYPE & 1) string = replace$1(string, ltrim, '');
1704
- if (TYPE & 2) string = replace$1(string, rtrim, '$1');
1705
- return string;
1706
- };
1707
- };
1708
-
1709
- var stringTrim = {
1710
- // `String.prototype.{ trimLeft, trimStart }` methods
1711
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1712
- start: createMethod$2(1),
1713
- // `String.prototype.{ trimRight, trimEnd }` methods
1714
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
1715
- end: createMethod$2(2),
1716
- // `String.prototype.trim` method
1717
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1718
- trim: createMethod$2(3)
1719
- };
1720
-
1721
- var globalThis$7 = globalThis_1;
1722
- var fails$9 = fails$l;
1723
- var uncurryThis$4 = functionUncurryThis;
1724
- var toString$6 = toString$8;
1725
- var trim$1 = stringTrim.trim;
1726
- var whitespaces$2 = whitespaces$4;
1727
-
1728
- var charAt$3 = uncurryThis$4(''.charAt);
1729
- var $parseFloat$1 = globalThis$7.parseFloat;
1730
- var Symbol$2 = globalThis$7.Symbol;
1731
- var ITERATOR$2 = Symbol$2 && Symbol$2.iterator;
1732
- var FORCED$2 = 1 / $parseFloat$1(whitespaces$2 + '-0') !== -Infinity
1733
- // MS Edge 18- broken with boxed symbols
1734
- || (ITERATOR$2 && !fails$9(function () { $parseFloat$1(Object(ITERATOR$2)); }));
1735
-
1736
- // `parseFloat` method
1737
- // https://tc39.es/ecma262/#sec-parsefloat-string
1738
- var numberParseFloat = FORCED$2 ? function parseFloat(string) {
1739
- var trimmedString = trim$1(toString$6(string));
1740
- var result = $parseFloat$1(trimmedString);
1741
- return result === 0 && charAt$3(trimmedString, 0) === '-' ? -0 : result;
1742
- } : $parseFloat$1;
1743
-
1744
- var $$7 = _export;
1745
- var $parseFloat = numberParseFloat;
1746
-
1747
- // `parseFloat` method
1748
- // https://tc39.es/ecma262/#sec-parsefloat-string
1749
- $$7({ global: true, forced: parseFloat !== $parseFloat }, {
1750
- parseFloat: $parseFloat
1751
- });
1752
-
1753
- var anObject$4 = anObject$9;
1754
-
1755
- // `RegExp.prototype.flags` getter implementation
1756
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1757
- var regexpFlags$1 = function () {
1758
- var that = anObject$4(this);
1759
- var result = '';
1760
- if (that.hasIndices) result += 'd';
1761
- if (that.global) result += 'g';
1762
- if (that.ignoreCase) result += 'i';
1763
- if (that.multiline) result += 'm';
1764
- if (that.dotAll) result += 's';
1765
- if (that.unicode) result += 'u';
1766
- if (that.unicodeSets) result += 'v';
1767
- if (that.sticky) result += 'y';
1768
- return result;
1769
- };
1770
-
1771
- var fails$8 = fails$l;
1772
- var globalThis$6 = globalThis_1;
1773
-
1774
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1775
- var $RegExp$2 = globalThis$6.RegExp;
1776
-
1777
- var UNSUPPORTED_Y$1 = fails$8(function () {
1778
- var re = $RegExp$2('a', 'y');
1779
- re.lastIndex = 2;
1780
- return re.exec('abcd') !== null;
1781
- });
1782
-
1783
- // UC Browser bug
1784
- // https://github.com/zloirock/core-js/issues/1008
1785
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$8(function () {
1786
- return !$RegExp$2('a', 'y').sticky;
1787
- });
1788
-
1789
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$8(function () {
1790
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1791
- var re = $RegExp$2('^r', 'gy');
1792
- re.lastIndex = 2;
1793
- return re.exec('str') !== null;
1794
- });
1795
-
1796
- var regexpStickyHelpers = {
1797
- BROKEN_CARET: BROKEN_CARET,
1798
- MISSED_STICKY: MISSED_STICKY,
1799
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
1800
- };
1801
-
1802
- var fails$7 = fails$l;
1803
- var globalThis$5 = globalThis_1;
1804
-
1805
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1806
- var $RegExp$1 = globalThis$5.RegExp;
1807
-
1808
- var regexpUnsupportedDotAll = fails$7(function () {
1809
- var re = $RegExp$1('.', 's');
1810
- return !(re.dotAll && re.test('\n') && re.flags === 's');
1811
- });
1812
-
1813
- var fails$6 = fails$l;
1814
- var globalThis$4 = globalThis_1;
1815
-
1816
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1817
- var $RegExp = globalThis$4.RegExp;
1818
-
1819
- var regexpUnsupportedNcg = fails$6(function () {
1820
- var re = $RegExp('(?<a>b)', 'g');
1821
- return re.exec('b').groups.a !== 'b' ||
1822
- 'b'.replace(re, '$<a>c') !== 'bc';
1823
- });
1824
-
1825
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1826
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1827
- var call$5 = functionCall;
1828
- var uncurryThis$3 = functionUncurryThis;
1829
- var toString$5 = toString$8;
1830
- var regexpFlags = regexpFlags$1;
1831
- var stickyHelpers = regexpStickyHelpers;
1832
- var shared = shared$4;
1833
- var create = objectCreate;
1834
- var getInternalState = internalState.get;
1835
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1836
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1837
-
1838
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1839
- var nativeExec = RegExp.prototype.exec;
1840
- var patchedExec = nativeExec;
1841
- var charAt$2 = uncurryThis$3(''.charAt);
1842
- var indexOf = uncurryThis$3(''.indexOf);
1843
- var replace = uncurryThis$3(''.replace);
1844
- var stringSlice$1 = uncurryThis$3(''.slice);
1845
-
1846
- var UPDATES_LAST_INDEX_WRONG = (function () {
1847
- var re1 = /a/;
1848
- var re2 = /b*/g;
1849
- call$5(nativeExec, re1, 'a');
1850
- call$5(nativeExec, re2, 'a');
1851
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1852
- })();
1853
-
1854
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1855
-
1856
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1857
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1858
-
1859
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1860
-
1861
- if (PATCH) {
1862
- patchedExec = function exec(string) {
1863
- var re = this;
1864
- var state = getInternalState(re);
1865
- var str = toString$5(string);
1866
- var raw = state.raw;
1867
- var result, reCopy, lastIndex, match, i, object, group;
1868
-
1869
- if (raw) {
1870
- raw.lastIndex = re.lastIndex;
1871
- result = call$5(patchedExec, raw, str);
1872
- re.lastIndex = raw.lastIndex;
1873
- return result;
1874
- }
1875
-
1876
- var groups = state.groups;
1877
- var sticky = UNSUPPORTED_Y && re.sticky;
1878
- var flags = call$5(regexpFlags, re);
1879
- var source = re.source;
1880
- var charsAdded = 0;
1881
- var strCopy = str;
1882
-
1883
- if (sticky) {
1884
- flags = replace(flags, 'y', '');
1885
- if (indexOf(flags, 'g') === -1) {
1886
- flags += 'g';
1887
- }
1888
-
1889
- strCopy = stringSlice$1(str, re.lastIndex);
1890
- // Support anchored sticky behavior.
1891
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$2(str, re.lastIndex - 1) !== '\n')) {
1892
- source = '(?: ' + source + ')';
1893
- strCopy = ' ' + strCopy;
1894
- charsAdded++;
1895
- }
1896
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1897
- // simulate the 'y' flag.
1898
- reCopy = new RegExp('^(?:' + source + ')', flags);
1899
- }
1900
-
1901
- if (NPCG_INCLUDED) {
1902
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1903
- }
1904
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1905
-
1906
- match = call$5(nativeExec, sticky ? reCopy : re, strCopy);
1907
-
1908
- if (sticky) {
1909
- if (match) {
1910
- match.input = stringSlice$1(match.input, charsAdded);
1911
- match[0] = stringSlice$1(match[0], charsAdded);
1912
- match.index = re.lastIndex;
1913
- re.lastIndex += match[0].length;
1914
- } else re.lastIndex = 0;
1915
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1916
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1917
- }
1918
- if (NPCG_INCLUDED && match && match.length > 1) {
1919
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1920
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1921
- call$5(nativeReplace, match[0], reCopy, function () {
1922
- for (i = 1; i < arguments.length - 2; i++) {
1923
- if (arguments[i] === undefined) match[i] = undefined;
1924
- }
1925
- });
1926
- }
1927
-
1928
- if (match && groups) {
1929
- match.groups = object = create(null);
1930
- for (i = 0; i < groups.length; i++) {
1931
- group = groups[i];
1932
- object[group[0]] = match[group[1]];
1933
- }
1934
- }
1935
-
1936
- return match;
1937
- };
1938
- }
1939
-
1940
- var regexpExec$2 = patchedExec;
1941
-
1942
- var $$6 = _export;
1943
- var exec$1 = regexpExec$2;
1944
-
1945
- // `RegExp.prototype.exec` method
1946
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1947
- $$6({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
1948
- exec: exec$1
1949
- });
1950
-
1951
- // TODO: Remove from `core-js@4` since it's moved to entry points
1952
-
1953
- var $$5 = _export;
1954
- var call$4 = functionCall;
1955
- var isCallable$1 = isCallable$g;
1956
- var anObject$3 = anObject$9;
1957
- var toString$4 = toString$8;
1958
-
1959
- var DELEGATES_TO_EXEC = function () {
1960
- var execCalled = false;
1961
- var re = /[ac]/;
1962
- re.exec = function () {
1963
- execCalled = true;
1964
- return /./.exec.apply(this, arguments);
1965
- };
1966
- return re.test('abc') === true && execCalled;
1967
- }();
1968
-
1969
- var nativeTest = /./.test;
1970
-
1971
- // `RegExp.prototype.test` method
1972
- // https://tc39.es/ecma262/#sec-regexp.prototype.test
1973
- $$5({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
1974
- test: function (S) {
1975
- var R = anObject$3(this);
1976
- var string = toString$4(S);
1977
- var exec = R.exec;
1978
- if (!isCallable$1(exec)) return call$4(nativeTest, R, string);
1979
- var result = call$4(exec, R, string);
1980
- if (result === null) return false;
1981
- anObject$3(result);
1982
- return true;
1983
- }
1984
- });
1985
-
1986
- var call$3 = functionCall;
1987
- var hasOwn = hasOwnProperty_1;
1988
- var isPrototypeOf = objectIsPrototypeOf;
1989
- var regExpFlags = regexpFlags$1;
1990
-
1991
- var RegExpPrototype$2 = RegExp.prototype;
1992
-
1993
- var regexpGetFlags = function (R) {
1994
- var flags = R.flags;
1995
- return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$2, R)
1996
- ? call$3(regExpFlags, R) : flags;
1997
- };
1998
-
1999
- var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
2000
- var defineBuiltIn$1 = defineBuiltIn$5;
2001
- var anObject$2 = anObject$9;
2002
- var $toString = toString$8;
2003
- var fails$5 = fails$l;
2004
- var getRegExpFlags = regexpGetFlags;
2005
-
2006
- var TO_STRING = 'toString';
2007
- var RegExpPrototype$1 = RegExp.prototype;
2008
- var nativeToString = RegExpPrototype$1[TO_STRING];
2009
-
2010
- var NOT_GENERIC = fails$5(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
2011
- // FF44- RegExp#toString has a wrong name
2012
- var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name !== TO_STRING;
2013
-
2014
- // `RegExp.prototype.toString` method
2015
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
2016
- if (NOT_GENERIC || INCORRECT_NAME) {
2017
- defineBuiltIn$1(RegExpPrototype$1, TO_STRING, function toString() {
2018
- var R = anObject$2(this);
2019
- var pattern = $toString(R.source);
2020
- var flags = $toString(getRegExpFlags(R));
2021
- return '/' + pattern + '/' + flags;
2022
- }, { unsafe: true });
2023
- }
2024
-
2025
- var PROPER_FUNCTION_NAME = functionName.PROPER;
2026
- var fails$4 = fails$l;
2027
- var whitespaces$1 = whitespaces$4;
2028
-
2029
- var non = '\u200B\u0085\u180E';
2030
-
2031
- // check that a method works with the correct list
2032
- // of whitespaces and has a correct name
2033
- var stringTrimForced = function (METHOD_NAME) {
2034
- return fails$4(function () {
2035
- return !!whitespaces$1[METHOD_NAME]()
2036
- || non[METHOD_NAME]() !== non
2037
- || (PROPER_FUNCTION_NAME && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
2038
- });
2039
- };
2040
-
2041
- var $$4 = _export;
2042
- var $trim = stringTrim.trim;
2043
- var forcedStringTrimMethod = stringTrimForced;
2044
-
2045
- // `String.prototype.trim` method
2046
- // https://tc39.es/ecma262/#sec-string.prototype.trim
2047
- $$4({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2048
- trim: function trim() {
2049
- return $trim(this);
2050
- }
2051
- });
2052
-
2053
- // iterable DOM collections
2054
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2055
- var domIterables = {
2056
- CSSRuleList: 0,
2057
- CSSStyleDeclaration: 0,
2058
- CSSValueList: 0,
2059
- ClientRectList: 0,
2060
- DOMRectList: 0,
2061
- DOMStringList: 0,
2062
- DOMTokenList: 1,
2063
- DataTransferItemList: 0,
2064
- FileList: 0,
2065
- HTMLAllCollection: 0,
2066
- HTMLCollection: 0,
2067
- HTMLFormElement: 0,
2068
- HTMLSelectElement: 0,
2069
- MediaList: 0,
2070
- MimeTypeArray: 0,
2071
- NamedNodeMap: 0,
2072
- NodeList: 1,
2073
- PaintRequestList: 0,
2074
- Plugin: 0,
2075
- PluginArray: 0,
2076
- SVGLengthList: 0,
2077
- SVGNumberList: 0,
2078
- SVGPathSegList: 0,
2079
- SVGPointList: 0,
2080
- SVGStringList: 0,
2081
- SVGTransformList: 0,
2082
- SourceBufferList: 0,
2083
- StyleSheetList: 0,
2084
- TextTrackCueList: 0,
2085
- TextTrackList: 0,
2086
- TouchList: 0
2087
- };
2088
-
2089
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2090
- var documentCreateElement = documentCreateElement$2;
2091
-
2092
- var classList = documentCreateElement('span').classList;
2093
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
2094
-
2095
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2096
-
2097
- var globalThis$3 = globalThis_1;
2098
- var DOMIterables = domIterables;
2099
- var DOMTokenListPrototype = domTokenListPrototype;
2100
- var ArrayIteratorMethods = es_array_iterator;
2101
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
2102
- var setToStringTag = setToStringTag$3;
2103
- var wellKnownSymbol$3 = wellKnownSymbol$b;
2104
-
2105
- var ITERATOR$1 = wellKnownSymbol$3('iterator');
2106
- var ArrayValues = ArrayIteratorMethods.values;
2107
-
2108
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2109
- if (CollectionPrototype) {
2110
- // some Chrome versions have non-configurable methods on DOMTokenList
2111
- if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
2112
- createNonEnumerableProperty$1(CollectionPrototype, ITERATOR$1, ArrayValues);
2113
- } catch (error) {
2114
- CollectionPrototype[ITERATOR$1] = ArrayValues;
2115
- }
2116
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
2117
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
2118
- // some Chrome versions have non-configurable methods on DOMTokenList
2119
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
2120
- createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
2121
- } catch (error) {
2122
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
2123
- }
2124
- }
2125
- }
2126
- };
2127
-
2128
- for (var COLLECTION_NAME in DOMIterables) {
2129
- handlePrototype(globalThis$3[COLLECTION_NAME] && globalThis$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
2130
- }
2131
-
2132
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2133
-
2134
- const defaultProps = {
95
+ /* *
96
+ * Licensed under the Apache License, Version 2.0 (the "License");
97
+ * you may not use this file except in compliance with the License.
98
+ * You may obtain a copy of the License at
99
+ *
100
+ * http://www.apache.org/licenses/LICENSE-2.0
101
+ *
102
+ * Unless required by applicable law or agreed to in writing, software
103
+ * distributed under the License is distributed on an "AS IS" BASIS,
104
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
+ * See the License for the specific language governing permissions and
106
+ * limitations under the License.
107
+ *
108
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
109
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
110
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
111
+ * */
112
+ var defaultProps = {
2135
113
  shouldUnregister: false
2136
114
  };
2137
- const errorMessages = {
115
+ var errorMessages = {
2138
116
  required: 'form-fields-error-required',
2139
117
  isValidDate: 'form-fields-error-date-valid',
2140
118
  isAfter: 'form-fields-error-date-after',
@@ -2150,55 +128,61 @@ const errorMessages = {
2150
128
  isInteger: 'form-fields-error-integer',
2151
129
  isNumeric: 'form-fields-error-numeric'
2152
130
  };
2153
- const regexMaxTwoDecimals = /^\s*-?\d+(\.\d{1,2})?\s*$/;
131
+ var regexMaxTwoDecimals = /^\s*-?\d+(\.\d{1,2})?\s*$/;
2154
132
  // validations
2155
- const isEmpty = value => {
133
+ var isEmpty = function isEmpty(value) {
2156
134
  if (typeof value === 'string' && !value.trim().length || value === null || value === undefined) {
2157
135
  return true;
2158
136
  }
2159
137
  return false;
2160
138
  };
2161
- const isXHoursBefore = (ownDate, otherDate, hours = 4) => {
139
+ var isXHoursBefore = function isXHoursBefore(ownDate, otherDate, hours) {
140
+ if (hours === void 0) {
141
+ hours = 4;
142
+ }
2162
143
  if (isEmpty(ownDate) || isEmpty(otherDate)) {
2163
144
  return true;
2164
145
  }
2165
- const duration = dateUtils.differenceInHours(dateUtils.utc(otherDate), dateUtils.utc(ownDate), 'ceil');
146
+ var duration = dateUtils.differenceInHours(dateUtils.utc(otherDate), dateUtils.utc(ownDate), 'ceil');
2166
147
  return duration <= hours;
2167
148
  };
2168
- const isXHoursAfter = (ownDate, otherDate, hours = 4) => {
149
+ var isXHoursAfter = function isXHoursAfter(ownDate, otherDate, hours) {
150
+ if (hours === void 0) {
151
+ hours = 4;
152
+ }
2169
153
  if (isEmpty(ownDate) || isEmpty(otherDate)) {
2170
154
  return true;
2171
155
  }
2172
- const duration = dateUtils.differenceInHours(dateUtils.utc(ownDate), dateUtils.utc(otherDate), 'ceil');
156
+ var duration = dateUtils.differenceInHours(dateUtils.utc(ownDate), dateUtils.utc(otherDate), 'ceil');
2173
157
  return duration <= hours;
2174
158
  };
2175
- const isLatitude = lat => {
159
+ var isLatitude = function isLatitude(lat) {
2176
160
  if (!lat) {
2177
161
  return true;
2178
162
  }
2179
163
  return isFinite(lat) && Math.abs(lat) <= 90 && regexMaxTwoDecimals.test(lat.toString());
2180
164
  };
2181
- const isLongitude = lng => {
165
+ var isLongitude = function isLongitude(lng) {
2182
166
  if (!lng) {
2183
167
  return true;
2184
168
  }
2185
169
  return isFinite(lng) && Math.abs(lng) <= 180 && lng >= -180 && regexMaxTwoDecimals.test(lng.toString());
2186
170
  };
2187
171
  // Pass null if no maxValue
2188
- const isValidMax = (value, maxValue) => {
172
+ var isValidMax = function isValidMax(value, maxValue) {
2189
173
  if (isEmpty(value) || maxValue === null) {
2190
174
  return true;
2191
175
  }
2192
176
  return !(value > maxValue);
2193
177
  };
2194
178
  // Pass null if no minValue
2195
- const isValidMin = (value, minValue) => {
179
+ var isValidMin = function isValidMin(value, minValue) {
2196
180
  if (isEmpty(value) || minValue === null) {
2197
181
  return true;
2198
182
  }
2199
183
  return !(value < minValue);
2200
184
  };
2201
- const hasValidGeometry = geojson => {
185
+ var hasValidGeometry = function hasValidGeometry(geojson) {
2202
186
  if (!geojson || !geojson.features || !geojson.features.length || !geojson.features[0].geometry ||
2203
187
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2204
188
  // @ts-ignore
@@ -2207,17 +191,16 @@ const hasValidGeometry = geojson => {
2207
191
  }
2208
192
  return true;
2209
193
  };
2210
- const isValidGeoJsonCoordinates = geojson => {
2211
- const hasGeometry = hasValidGeometry(geojson);
194
+ var isValidGeoJsonCoordinates = function isValidGeoJsonCoordinates(geojson) {
195
+ var hasGeometry = hasValidGeometry(geojson);
2212
196
  if (!hasGeometry) {
2213
197
  return false;
2214
198
  }
2215
199
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2216
200
  // @ts-ignore
2217
- const {
2218
- coordinates,
2219
- type
2220
- } = geojson.features[0].geometry;
201
+ var _geojson$features$0$g = geojson.features[0].geometry,
202
+ coordinates = _geojson$features$0$g.coordinates,
203
+ type = _geojson$features$0$g.type;
2221
204
  // For type POINT coordinates is an array of 2
2222
205
  if (coordinates.length === 2 && type === 'Point') {
2223
206
  return true;
@@ -2228,24 +211,23 @@ const isValidGeoJsonCoordinates = geojson => {
2228
211
  }
2229
212
  return false;
2230
213
  };
2231
- const isMaximumOneDrawing = geojson => {
2232
- const hasGeometry = hasValidGeometry(geojson);
214
+ var isMaximumOneDrawing = function isMaximumOneDrawing(geojson) {
215
+ var hasGeometry = hasValidGeometry(geojson);
2233
216
  if (!hasGeometry) {
2234
217
  return true; // no need to check further when there is no drawing yet
2235
218
  }
2236
219
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2237
220
  // @ts-ignore
2238
- const {
2239
- coordinates,
2240
- type
2241
- } = geojson.features[0].geometry;
221
+ var _geojson$features$0$g2 = geojson.features[0].geometry,
222
+ coordinates = _geojson$features$0$g2.coordinates,
223
+ type = _geojson$features$0$g2.type;
2242
224
  // For type POLYGON only one array of coordinates is allowed
2243
225
  if (type === 'Polygon' && coordinates.length > 1) {
2244
226
  return false;
2245
227
  }
2246
228
  return true;
2247
229
  };
2248
- const hasIntersectionWithFIR = (geojson, intersection) => {
230
+ var hasIntersectionWithFIR = function hasIntersectionWithFIR(geojson, intersection) {
2249
231
  if (!hasValidGeometry(geojson) ||
2250
232
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2251
233
  // @ts-ignore
@@ -2254,10 +236,9 @@ const hasIntersectionWithFIR = (geojson, intersection) => {
2254
236
  }
2255
237
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2256
238
  // @ts-ignore
2257
- const {
2258
- coordinates,
2259
- type
2260
- } = intersection.features[0].geometry;
239
+ var _intersection$feature = intersection.features[0].geometry,
240
+ coordinates = _intersection$feature.coordinates,
241
+ type = _intersection$feature.type;
2261
242
  if (type === 'Point' && coordinates.length === 0) {
2262
243
  return false;
2263
244
  }
@@ -2266,47 +247,55 @@ const hasIntersectionWithFIR = (geojson, intersection) => {
2266
247
  }
2267
248
  return true;
2268
249
  };
2269
- const hasMulitpleIntersections = geojson => {
2270
- const hasGeometry = hasValidGeometry(geojson);
250
+ var hasMulitpleIntersections = function hasMulitpleIntersections(geojson) {
251
+ var hasGeometry = hasValidGeometry(geojson);
2271
252
  if (!hasGeometry) {
2272
253
  return false;
2273
254
  }
2274
255
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2275
256
  // @ts-ignore
2276
- const {
2277
- coordinates,
2278
- type
2279
- } = geojson.features[0].geometry;
257
+ var _geojson$features$0$g3 = geojson.features[0].geometry,
258
+ coordinates = _geojson$features$0$g3.coordinates,
259
+ type = _geojson$features$0$g3.type;
2280
260
  if (type === 'MultiPolygon' || coordinates.length > 1 && type !== 'Point') {
2281
261
  return true;
2282
262
  }
2283
263
  return false;
2284
264
  };
2285
- const countIntersectionPoints = (geojson, intersection) => {
2286
- var _geojson$features$, _intersection$feature;
2287
- if (!(geojson != null && geojson.features) || !((_geojson$features$ = geojson.features[0]) != null && _geojson$features$.geometry) || !(intersection != null && intersection.features) || !((_intersection$feature = intersection.features[0]) != null && _intersection$feature.geometry)) {
265
+ var countIntersectionPoints = function countIntersectionPoints(geojson, intersection) {
266
+ var _geojson$features$, _intersection$feature2;
267
+ if (!(geojson != null && geojson.features) || !((_geojson$features$ = geojson.features[0]) != null && _geojson$features$.geometry) || !(intersection != null && intersection.features) || !((_intersection$feature2 = intersection.features[0]) != null && _intersection$feature2.geometry)) {
2288
268
  return 0;
2289
269
  }
2290
- const geojsonGeometry = geojson.features[0].geometry;
2291
- const intersectionGeometry = intersection.features[0].geometry;
270
+ var geojsonGeometry = geojson.features[0].geometry;
271
+ var intersectionGeometry = intersection.features[0].geometry;
2292
272
  if (geojsonGeometry.type !== 'Polygon' || intersectionGeometry.type !== 'Polygon') {
2293
273
  return 0;
2294
274
  }
2295
- const geojsonCoordinates = geojsonGeometry.coordinates[0];
2296
- const intersectionCoordinates = intersectionGeometry.coordinates[0];
275
+ var geojsonCoordinates = geojsonGeometry.coordinates[0];
276
+ var intersectionCoordinates = intersectionGeometry.coordinates[0];
2297
277
  // If both arrays are empty, return 0
2298
278
  if (!geojsonCoordinates && !intersectionCoordinates) {
2299
279
  return 0;
2300
280
  }
2301
- const intersectionPoints = intersectionCoordinates.map(point => [point[0], point[1]]);
2302
- const uniqueIntersectionPoints = intersectionPoints.filter((point, index, self) => index === self.findIndex(p => p[0] === point[0] && p[1] === point[1]));
2303
- const collisionPoints = uniqueIntersectionPoints.filter(point => {
2304
- const [x, y] = point;
2305
- return !geojsonCoordinates.some(originalPoint => originalPoint[0] === x && originalPoint[1] === y);
281
+ var intersectionPoints = intersectionCoordinates.map(function (point) {
282
+ return [point[0], point[1]];
283
+ });
284
+ var uniqueIntersectionPoints = intersectionPoints.filter(function (point, index, self) {
285
+ return index === self.findIndex(function (p) {
286
+ return p[0] === point[0] && p[1] === point[1];
287
+ });
288
+ });
289
+ var collisionPoints = uniqueIntersectionPoints.filter(function (point) {
290
+ var x = point[0],
291
+ y = point[1];
292
+ return !geojsonCoordinates.some(function (originalPoint) {
293
+ return originalPoint[0] === x && originalPoint[1] === y;
294
+ });
2306
295
  });
2307
296
  return collisionPoints.length;
2308
297
  };
2309
- const isGeometryDirty = (geoJSON, formGeoJSON) => {
298
+ var isGeometryDirty = function isGeometryDirty(geoJSON, formGeoJSON) {
2310
299
  if (geoJSON === (undefined) || formGeoJSON === (undefined) || !hasValidGeometry(geoJSON) || !hasValidGeometry(formGeoJSON)) {
2311
300
  return false;
2312
301
  }
@@ -2318,13 +307,13 @@ const isGeometryDirty = (geoJSON, formGeoJSON) => {
2318
307
  // @ts-ignore
2319
308
  formGeoJSON.features[0].geometry.coordinates);
2320
309
  };
2321
- const isInteger = value => {
310
+ var isInteger = function isInteger(value) {
2322
311
  if (isEmpty(value)) {
2323
312
  return true;
2324
313
  }
2325
314
  return Number.isInteger(value);
2326
315
  };
2327
- const isNonOrBothCoordinates = (coordinate, otherCoordinate) => {
316
+ var isNonOrBothCoordinates = function isNonOrBothCoordinates(coordinate, otherCoordinate) {
2328
317
  if (typeof coordinate === 'number' && typeof otherCoordinate === 'number' || coordinate === null && otherCoordinate === null || coordinate === undefined && otherCoordinate === undefined) {
2329
318
  return true;
2330
319
  }
@@ -2334,12 +323,31 @@ const isNonOrBothCoordinates = (coordinate, otherCoordinate) => {
2334
323
  return false;
2335
324
  };
2336
325
 
2337
- const FORM_FIELDS_NAMESPACE = 'form-fields';
2338
- const ns = [FORM_FIELDS_NAMESPACE];
2339
- const useFormFieldsTranslation = () => useTranslation(ns);
2340
-
2341
- const _excluded$6 = ["children", "errors", "isReadOnly", "sx", "className", "size"];
2342
- const radioCheckboxStyle = {
326
+ /* *
327
+ * Licensed under the Apache License, Version 2.0 (the "License");
328
+ * you may not use this file except in compliance with the License.
329
+ * You may obtain a copy of the License at
330
+ *
331
+ * http://www.apache.org/licenses/LICENSE-2.0
332
+ *
333
+ * Unless required by applicable law or agreed to in writing, software
334
+ * distributed under the License is distributed on an "AS IS" BASIS,
335
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
336
+ * See the License for the specific language governing permissions and
337
+ * limitations under the License.
338
+ *
339
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
340
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
341
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
342
+ * */
343
+ var FORM_FIELDS_NAMESPACE = 'form-fields';
344
+ var ns = [FORM_FIELDS_NAMESPACE];
345
+ var useFormFieldsTranslation = function useFormFieldsTranslation() {
346
+ return useTranslation(ns);
347
+ };
348
+
349
+ var _excluded$6 = ["children", "errors", "isReadOnly", "sx", "className", "size"];
350
+ var radioCheckboxStyle = {
2343
351
  // hides unchecked values
2344
352
  display: 'none',
2345
353
  '&+.MuiFormControlLabel-label': {
@@ -2359,7 +367,7 @@ const radioCheckboxStyle = {
2359
367
  color: 'geowebColors.typographyAndIcons.iconLinkActive'
2360
368
  }
2361
369
  };
2362
- const getErrorMessage = (t, errors) => {
370
+ var getErrorMessage = function getErrorMessage(t, errors) {
2363
371
  if (errors && errors.message && typeof errors.message === 'string') {
2364
372
  return t(errors.message);
2365
373
  }
@@ -2368,23 +376,23 @@ const getErrorMessage = (t, errors) => {
2368
376
  }
2369
377
  return '';
2370
378
  };
2371
- const ReactHookFormFormControl = _ref => {
2372
- let {
2373
- children,
2374
- errors,
2375
- isReadOnly,
2376
- sx = {},
2377
- className = '',
2378
- size = 'medium'
2379
- } = _ref,
379
+ var ReactHookFormFormControl = function ReactHookFormFormControl(_ref) {
380
+ var children = _ref.children,
381
+ errors = _ref.errors,
382
+ isReadOnly = _ref.isReadOnly,
383
+ _ref$sx = _ref.sx,
384
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
385
+ _ref$className = _ref.className,
386
+ className = _ref$className === void 0 ? '' : _ref$className,
387
+ _ref$size = _ref.size,
388
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
2380
389
  props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2381
- const {
2382
- t
2383
- } = useFormFieldsTranslation();
390
+ var _useFormFieldsTransla = useFormFieldsTranslation(),
391
+ t = _useFormFieldsTransla.t;
2384
392
  return jsxs(FormControl, Object.assign({
2385
393
  fullWidth: true,
2386
394
  error: !!errors,
2387
- className: `${isReadOnly ? 'is-read-only' : ''} ${className}`,
395
+ className: (isReadOnly ? 'is-read-only' : '') + " " + className,
2388
396
  size: size,
2389
397
  sx: Object.assign({}, isReadOnly && {
2390
398
  // Radio input
@@ -2415,156 +423,51 @@ const ReactHookFormFormControl = _ref => {
2415
423
  }));
2416
424
  };
2417
425
 
2418
- var aCallable = aCallable$3;
2419
- var toObject = toObject$4;
2420
- var IndexedObject = indexedObject;
2421
- var lengthOfArrayLike = lengthOfArrayLike$2;
2422
-
2423
- var $TypeError$2 = TypeError;
2424
-
2425
- var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
2426
-
2427
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
2428
- var createMethod$1 = function (IS_RIGHT) {
2429
- return function (that, callbackfn, argumentsLength, memo) {
2430
- var O = toObject(that);
2431
- var self = IndexedObject(O);
2432
- var length = lengthOfArrayLike(O);
2433
- aCallable(callbackfn);
2434
- if (length === 0 && argumentsLength < 2) throw new $TypeError$2(REDUCE_EMPTY);
2435
- var index = IS_RIGHT ? length - 1 : 0;
2436
- var i = IS_RIGHT ? -1 : 1;
2437
- if (argumentsLength < 2) while (true) {
2438
- if (index in self) {
2439
- memo = self[index];
2440
- index += i;
2441
- break;
2442
- }
2443
- index += i;
2444
- if (IS_RIGHT ? index < 0 : length <= index) {
2445
- throw new $TypeError$2(REDUCE_EMPTY);
2446
- }
2447
- }
2448
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
2449
- memo = callbackfn(memo, self[index], index, O);
2450
- }
2451
- return memo;
2452
- };
2453
- };
2454
-
2455
- var arrayReduce = {
2456
- // `Array.prototype.reduce` method
2457
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
2458
- left: createMethod$1(false),
2459
- // `Array.prototype.reduceRight` method
2460
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
2461
- right: createMethod$1(true)
2462
- };
2463
-
2464
- var fails$3 = fails$l;
2465
-
2466
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
2467
- var method = [][METHOD_NAME];
2468
- return !!method && fails$3(function () {
2469
- // eslint-disable-next-line no-useless-call -- required for testing
2470
- method.call(null, argument || function () { return 1; }, 1);
2471
- });
2472
- };
2473
-
2474
- /* global Bun, Deno -- detection */
2475
- var globalThis$2 = globalThis_1;
2476
- var userAgent = environmentUserAgent;
2477
- var classof$2 = classofRaw$1;
2478
-
2479
- var userAgentStartsWith = function (string) {
2480
- return userAgent.slice(0, string.length) === string;
2481
- };
2482
-
2483
- var environment = (function () {
2484
- if (userAgentStartsWith('Bun/')) return 'BUN';
2485
- if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
2486
- if (userAgentStartsWith('Deno/')) return 'DENO';
2487
- if (userAgentStartsWith('Node.js/')) return 'NODE';
2488
- if (globalThis$2.Bun && typeof Bun.version == 'string') return 'BUN';
2489
- if (globalThis$2.Deno && typeof Deno.version == 'object') return 'DENO';
2490
- if (classof$2(globalThis$2.process) === 'process') return 'NODE';
2491
- if (globalThis$2.window && globalThis$2.document) return 'BROWSER';
2492
- return 'REST';
2493
- })();
2494
-
2495
- var ENVIRONMENT = environment;
2496
-
2497
- var environmentIsNode = ENVIRONMENT === 'NODE';
2498
-
2499
- var $$3 = _export;
2500
- var $reduce = arrayReduce.left;
2501
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
2502
- var CHROME_VERSION = environmentV8Version;
2503
- var IS_NODE = environmentIsNode;
2504
-
2505
- // Chrome 80-82 has a critical bug
2506
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
2507
- var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
2508
- var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
2509
-
2510
- // `Array.prototype.reduce` method
2511
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
2512
- $$3({ target: 'Array', proto: true, forced: FORCED$1 }, {
2513
- reduce: function reduce(callbackfn /* , initialValue */) {
2514
- var length = arguments.length;
2515
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
2516
- }
2517
- });
2518
-
2519
426
  function getDeepProperty(p, o) {
2520
- return p.reduce((xs, x) => {
427
+ return p.reduce(function (xs, x) {
2521
428
  if (xs && typeof xs === 'object' && x in xs) {
2522
429
  return xs[x];
2523
430
  }
2524
431
  return null;
2525
432
  }, o);
2526
433
  }
2527
- const getErrors = (name, errors) => {
2528
- const nameAsArray = name.split('.');
434
+ var getErrors = function getErrors(name, errors) {
435
+ var nameAsArray = name.split('.');
2529
436
  return getDeepProperty(nameAsArray, errors) || undefined;
2530
437
  };
2531
438
 
2532
- const _excluded$5 = ["name", "label", "defaultValue", "children", "rules", "onChange", "disabled", "className", "sx", "isReadOnly", "size"];
2533
- const ReactHookFormSelect = _ref => {
2534
- let {
2535
- name,
2536
- label,
2537
- defaultValue = '',
2538
- children,
2539
- rules,
2540
- onChange = () => {},
2541
- disabled,
2542
- className,
2543
- sx,
2544
- isReadOnly,
2545
- size = 'medium'
2546
- } = _ref,
439
+ var _excluded$5 = ["name", "label", "defaultValue", "children", "rules", "onChange", "disabled", "className", "sx", "isReadOnly", "size"];
440
+ var ReactHookFormSelect = function ReactHookFormSelect(_ref) {
441
+ var name = _ref.name,
442
+ label = _ref.label,
443
+ _ref$defaultValue = _ref.defaultValue,
444
+ defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
445
+ children = _ref.children,
446
+ rules = _ref.rules,
447
+ _ref$onChange = _ref.onChange,
448
+ _onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
449
+ disabled = _ref.disabled,
450
+ className = _ref.className,
451
+ sx = _ref.sx,
452
+ isReadOnly = _ref.isReadOnly,
453
+ _ref$size = _ref.size,
454
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
2547
455
  otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$5);
2548
- const labelId = `${name}-label`;
2549
- const {
2550
- control
2551
- } = useFormContext();
2552
- const {
2553
- field: {
2554
- onChange: onChangeField,
2555
- value,
2556
- ref
2557
- },
2558
- formState: {
2559
- errors: formErrors
2560
- }
2561
- } = useController(Object.assign({
2562
- name,
2563
- control,
2564
- rules,
2565
- defaultValue
2566
- }, defaultProps));
2567
- const errors = getErrors(name, formErrors);
456
+ var labelId = name + "-label";
457
+ var _useFormContext = useFormContext(),
458
+ control = _useFormContext.control;
459
+ var _useController = useController(Object.assign({
460
+ name: name,
461
+ control: control,
462
+ rules: rules,
463
+ defaultValue: defaultValue
464
+ }, defaultProps)),
465
+ _useController$field = _useController.field,
466
+ onChangeField = _useController$field.onChange,
467
+ value = _useController$field.value,
468
+ ref = _useController$field.ref,
469
+ formErrors = _useController.formState.errors;
470
+ var errors = getErrors(name, formErrors);
2568
471
  return jsxs(ReactHookFormFormControl, {
2569
472
  className: className,
2570
473
  sx: sx,
@@ -2581,10 +484,10 @@ const ReactHookFormSelect = _ref => {
2581
484
  label: label,
2582
485
  inputRef: ref,
2583
486
  name: name,
2584
- onChange: (changeEvent, child) => {
487
+ onChange: function onChange(changeEvent, child) {
2585
488
  onChangeField(changeEvent.target.value);
2586
489
  // default props
2587
- onChange(changeEvent, child);
490
+ _onChange(changeEvent, child);
2588
491
  },
2589
492
  value: value || '',
2590
493
  variant: "filled"
@@ -2594,45 +497,41 @@ const ReactHookFormSelect = _ref => {
2594
497
  });
2595
498
  };
2596
499
 
2597
- const _excluded$4 = ["name", "label", "defaultValue", "children", "rules", "disabled", "onChange", "isReadOnly"];
2598
- const ReactHookFormRadioGroup = _ref => {
2599
- let {
2600
- name,
2601
- label,
2602
- defaultValue = '',
2603
- children,
2604
- rules,
2605
- disabled = false,
2606
- onChange = () => {},
2607
- isReadOnly
2608
- } = _ref,
500
+ var _excluded$4 = ["name", "label", "defaultValue", "children", "rules", "disabled", "onChange", "isReadOnly"];
501
+ var ReactHookFormRadioGroup = function ReactHookFormRadioGroup(_ref) {
502
+ var name = _ref.name,
503
+ label = _ref.label,
504
+ _ref$defaultValue = _ref.defaultValue,
505
+ defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
506
+ children = _ref.children,
507
+ rules = _ref.rules,
508
+ _ref$disabled = _ref.disabled,
509
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
510
+ _ref$onChange = _ref.onChange,
511
+ _onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
512
+ isReadOnly = _ref.isReadOnly,
2609
513
  otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$4);
2610
- const labelId = `${name}-label`;
2611
- const {
2612
- control
2613
- } = useFormContext();
2614
- const {
2615
- field: {
2616
- onChange: onChangeField,
2617
- value,
2618
- ref
2619
- },
2620
- formState: {
2621
- errors: formErrors
2622
- }
2623
- } = useController(Object.assign({
2624
- name,
2625
- control,
2626
- rules,
2627
- defaultValue
2628
- }, defaultProps));
2629
- const errors = getErrors(name, formErrors);
2630
- React.useEffect(() => {
514
+ var labelId = name + "-label";
515
+ var _useFormContext = useFormContext(),
516
+ control = _useFormContext.control;
517
+ var _useController = useController(Object.assign({
518
+ name: name,
519
+ control: control,
520
+ rules: rules,
521
+ defaultValue: defaultValue
522
+ }, defaultProps)),
523
+ _useController$field = _useController.field,
524
+ onChangeField = _useController$field.onChange,
525
+ value = _useController$field.value,
526
+ ref = _useController$field.ref,
527
+ formErrors = _useController.formState.errors;
528
+ var errors = getErrors(name, formErrors);
529
+ React.useEffect(function () {
2631
530
  if (errors) {
2632
- const firstError = Object.keys(formErrors)[0];
531
+ var firstError = Object.keys(formErrors)[0];
2633
532
  if (firstError === name) {
2634
533
  // if first error in form is same, focus on that input
2635
- const inputNode = document.querySelector(`[name="${name}"]`);
534
+ var inputNode = document.querySelector("[name=\"" + name + "\"]");
2636
535
  if (inputNode !== null) {
2637
536
  inputNode.focus();
2638
537
  }
@@ -2648,9 +547,9 @@ const ReactHookFormRadioGroup = _ref => {
2648
547
  children: label
2649
548
  }), jsx(RadioGroup, Object.assign({
2650
549
  value: value,
2651
- onChange: changeEvent => {
550
+ onChange: function onChange(changeEvent) {
2652
551
  onChangeField(changeEvent.target.value);
2653
- onChange(changeEvent, changeEvent.target.value);
552
+ _onChange(changeEvent, changeEvent.target.value);
2654
553
  },
2655
554
  ref: ref,
2656
555
  name: name
@@ -2660,45 +559,43 @@ const ReactHookFormRadioGroup = _ref => {
2660
559
  });
2661
560
  };
2662
561
 
2663
- const _excluded$3 = ["name", "label", "defaultValue", "rules", "disabled", "upperCase", "helperText", "className", "sx", "onChange", "isReadOnly", "inputSlotProps"];
2664
- const convertTextInputValue = (value, inCapitals) => {
562
+ var _excluded$3 = ["name", "label", "defaultValue", "rules", "disabled", "upperCase", "helperText", "className", "sx", "onChange", "isReadOnly", "inputSlotProps"];
563
+ var convertTextInputValue = function convertTextInputValue(value, inCapitals) {
2665
564
  return inCapitals ? value.toUpperCase() : value;
2666
565
  };
2667
- const ReactHookFormTextField = _ref => {
2668
- let {
2669
- name,
2670
- label,
2671
- defaultValue = '',
2672
- rules,
2673
- disabled = false,
2674
- upperCase = false,
2675
- helperText = '',
2676
- className,
2677
- sx,
2678
- onChange = () => {},
2679
- isReadOnly,
2680
- inputSlotProps
2681
- } = _ref,
566
+ var ReactHookFormTextField = function ReactHookFormTextField(_ref) {
567
+ var name = _ref.name,
568
+ label = _ref.label,
569
+ _ref$defaultValue = _ref.defaultValue,
570
+ defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
571
+ rules = _ref.rules,
572
+ _ref$disabled = _ref.disabled,
573
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
574
+ _ref$upperCase = _ref.upperCase,
575
+ upperCase = _ref$upperCase === void 0 ? false : _ref$upperCase,
576
+ _ref$helperText = _ref.helperText,
577
+ helperText = _ref$helperText === void 0 ? '' : _ref$helperText,
578
+ className = _ref.className,
579
+ sx = _ref.sx,
580
+ _ref$onChange = _ref.onChange,
581
+ _onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
582
+ isReadOnly = _ref.isReadOnly,
583
+ inputSlotProps = _ref.inputSlotProps,
2682
584
  otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2683
- const {
2684
- control
2685
- } = useFormContext();
2686
- const {
2687
- field: {
2688
- onChange: onChangeField,
2689
- value,
2690
- ref
2691
- },
2692
- formState: {
2693
- errors: formErrors
2694
- }
2695
- } = useController(Object.assign({
2696
- name,
2697
- control,
2698
- rules,
2699
- defaultValue
2700
- }, defaultProps));
2701
- const errors = getErrors(name, formErrors);
585
+ var _useFormContext = useFormContext(),
586
+ control = _useFormContext.control;
587
+ var _useController = useController(Object.assign({
588
+ name: name,
589
+ control: control,
590
+ rules: rules,
591
+ defaultValue: defaultValue
592
+ }, defaultProps)),
593
+ _useController$field = _useController.field,
594
+ onChangeField = _useController$field.onChange,
595
+ value = _useController$field.value,
596
+ ref = _useController$field.ref,
597
+ formErrors = _useController.formState.errors;
598
+ var errors = getErrors(name, formErrors);
2702
599
  return jsx(ReactHookFormFormControl, {
2703
600
  className: className,
2704
601
  sx: sx,
@@ -2713,13 +610,11 @@ const ReactHookFormTextField = _ref => {
2713
610
  variant: "filled",
2714
611
  type: "text",
2715
612
  name: name,
2716
- onChange: evt => {
2717
- const {
2718
- value
2719
- } = evt.target;
2720
- const convertedValue = convertTextInputValue(value, upperCase);
613
+ onChange: function onChange(evt) {
614
+ var value = evt.target.value;
615
+ var convertedValue = convertTextInputValue(value, upperCase);
2721
616
  onChangeField(convertedValue);
2722
- onChange(null);
617
+ _onChange(null);
2723
618
  },
2724
619
  disabled: disabled,
2725
620
  inputRef: ref
@@ -2733,364 +628,62 @@ const ReactHookFormTextField = _ref => {
2733
628
  });
2734
629
  };
2735
630
 
2736
- var $$2 = _export;
2737
- var $includes = arrayIncludes.includes;
2738
- var fails$2 = fails$l;
2739
- var addToUnscopables = addToUnscopables$2;
2740
-
2741
- // FF99+ bug
2742
- var BROKEN_ON_SPARSE = fails$2(function () {
2743
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
2744
- return !Array(1).includes();
2745
- });
2746
-
2747
- // `Array.prototype.includes` method
2748
- // https://tc39.es/ecma262/#sec-array.prototype.includes
2749
- $$2({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2750
- includes: function includes(el /* , fromIndex = 0 */) {
2751
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2752
- }
2753
- });
2754
-
2755
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2756
- addToUnscopables('includes');
2757
-
2758
- var globalThis$1 = globalThis_1;
2759
- var fails$1 = fails$l;
2760
- var uncurryThis$2 = functionUncurryThis;
2761
- var toString$3 = toString$8;
2762
- var trim = stringTrim.trim;
2763
- var whitespaces = whitespaces$4;
2764
-
2765
- var $parseInt$1 = globalThis$1.parseInt;
2766
- var Symbol$1 = globalThis$1.Symbol;
2767
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
2768
- var hex = /^[+-]?0x/i;
2769
- var exec = uncurryThis$2(hex.exec);
2770
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
2771
- // MS Edge 18- broken with boxed symbols
2772
- || (ITERATOR && !fails$1(function () { $parseInt$1(Object(ITERATOR)); }));
2773
-
2774
- // `parseInt` method
2775
- // https://tc39.es/ecma262/#sec-parseint-string-radix
2776
- var numberParseInt = FORCED ? function parseInt(string, radix) {
2777
- var S = trim(toString$3(string));
2778
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
2779
- } : $parseInt$1;
2780
-
2781
- var $$1 = _export;
2782
- var $parseInt = numberParseInt;
2783
-
2784
- // `parseInt` method
2785
- // https://tc39.es/ecma262/#sec-parseint-string-radix
2786
- $$1({ global: true, forced: parseInt !== $parseInt }, {
2787
- parseInt: $parseInt
2788
- });
2789
-
2790
- var isObject = isObject$9;
2791
- var classof$1 = classofRaw$1;
2792
- var wellKnownSymbol$2 = wellKnownSymbol$b;
2793
-
2794
- var MATCH$1 = wellKnownSymbol$2('match');
2795
-
2796
- // `IsRegExp` abstract operation
2797
- // https://tc39.es/ecma262/#sec-isregexp
2798
- var isRegexp = function (it) {
2799
- var isRegExp;
2800
- return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$1(it) === 'RegExp');
2801
- };
2802
-
2803
- var isRegExp = isRegexp;
2804
-
2805
- var $TypeError$1 = TypeError;
2806
-
2807
- var notARegexp = function (it) {
2808
- if (isRegExp(it)) {
2809
- throw new $TypeError$1("The method doesn't accept regular expressions");
2810
- } return it;
2811
- };
2812
-
2813
- var wellKnownSymbol$1 = wellKnownSymbol$b;
2814
-
2815
- var MATCH = wellKnownSymbol$1('match');
2816
-
2817
- var correctIsRegexpLogic = function (METHOD_NAME) {
2818
- var regexp = /./;
2819
- try {
2820
- '/./'[METHOD_NAME](regexp);
2821
- } catch (error1) {
2822
- try {
2823
- regexp[MATCH] = false;
2824
- return '/./'[METHOD_NAME](regexp);
2825
- } catch (error2) { /* empty */ }
2826
- } return false;
2827
- };
2828
-
2829
- var $ = _export;
2830
- var uncurryThis$1 = functionUncurryThis;
2831
- var notARegExp = notARegexp;
2832
- var requireObjectCoercible$2 = requireObjectCoercible$7;
2833
- var toString$2 = toString$8;
2834
- var correctIsRegExpLogic = correctIsRegexpLogic;
2835
-
2836
- var stringIndexOf = uncurryThis$1(''.indexOf);
2837
-
2838
- // `String.prototype.includes` method
2839
- // https://tc39.es/ecma262/#sec-string.prototype.includes
2840
- $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
2841
- includes: function includes(searchString /* , position = 0 */) {
2842
- return !!~stringIndexOf(
2843
- toString$2(requireObjectCoercible$2(this)),
2844
- toString$2(notARegExp(searchString)),
2845
- arguments.length > 1 ? arguments[1] : undefined
2846
- );
2847
- }
2848
- });
2849
-
2850
- // TODO: Remove from `core-js@4` since it's moved to entry points
2851
-
2852
- var call$2 = functionCall;
2853
- var defineBuiltIn = defineBuiltIn$5;
2854
- var regexpExec$1 = regexpExec$2;
2855
- var fails = fails$l;
2856
- var wellKnownSymbol = wellKnownSymbol$b;
2857
- var createNonEnumerableProperty = createNonEnumerableProperty$5;
2858
-
2859
- var SPECIES = wellKnownSymbol('species');
2860
- var RegExpPrototype = RegExp.prototype;
2861
-
2862
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2863
- var SYMBOL = wellKnownSymbol(KEY);
2864
-
2865
- var DELEGATES_TO_SYMBOL = !fails(function () {
2866
- // String methods call symbol-named RegExp methods
2867
- var O = {};
2868
- O[SYMBOL] = function () { return 7; };
2869
- return ''[KEY](O) !== 7;
2870
- });
2871
-
2872
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
2873
- // Symbol-named RegExp methods call .exec
2874
- var execCalled = false;
2875
- var re = /a/;
2876
-
2877
- if (KEY === 'split') {
2878
- // We can't use real regex here since it causes deoptimization
2879
- // and serious performance degradation in V8
2880
- // https://github.com/zloirock/core-js/issues/306
2881
- re = {};
2882
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
2883
- // a new one. We need to return the patched regex when creating the new one.
2884
- re.constructor = {};
2885
- re.constructor[SPECIES] = function () { return re; };
2886
- re.flags = '';
2887
- re[SYMBOL] = /./[SYMBOL];
2888
- }
2889
-
2890
- re.exec = function () {
2891
- execCalled = true;
2892
- return null;
2893
- };
2894
-
2895
- re[SYMBOL]('');
2896
- return !execCalled;
2897
- });
2898
-
2899
- if (
2900
- !DELEGATES_TO_SYMBOL ||
2901
- !DELEGATES_TO_EXEC ||
2902
- FORCED
2903
- ) {
2904
- var nativeRegExpMethod = /./[SYMBOL];
2905
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2906
- var $exec = regexp.exec;
2907
- if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
2908
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
2909
- // The native String method already delegates to @@method (this
2910
- // polyfilled function), leasing to infinite recursion.
2911
- // We avoid it by directly calling the native @@method method.
2912
- return { done: true, value: call$2(nativeRegExpMethod, regexp, str, arg2) };
2913
- }
2914
- return { done: true, value: call$2(nativeMethod, str, regexp, arg2) };
2915
- }
2916
- return { done: false };
2917
- });
2918
-
2919
- defineBuiltIn(String.prototype, KEY, methods[0]);
2920
- defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
2921
- }
2922
-
2923
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
2924
- };
2925
-
2926
- var uncurryThis = functionUncurryThis;
2927
- var toIntegerOrInfinity = toIntegerOrInfinity$3;
2928
- var toString$1 = toString$8;
2929
- var requireObjectCoercible$1 = requireObjectCoercible$7;
2930
-
2931
- var charAt$1 = uncurryThis(''.charAt);
2932
- var charCodeAt = uncurryThis(''.charCodeAt);
2933
- var stringSlice = uncurryThis(''.slice);
2934
-
2935
- var createMethod = function (CONVERT_TO_STRING) {
2936
- return function ($this, pos) {
2937
- var S = toString$1(requireObjectCoercible$1($this));
2938
- var position = toIntegerOrInfinity(pos);
2939
- var size = S.length;
2940
- var first, second;
2941
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
2942
- first = charCodeAt(S, position);
2943
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
2944
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
2945
- ? CONVERT_TO_STRING
2946
- ? charAt$1(S, position)
2947
- : first
2948
- : CONVERT_TO_STRING
2949
- ? stringSlice(S, position, position + 2)
2950
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2951
- };
2952
- };
2953
-
2954
- var stringMultibyte = {
2955
- // `String.prototype.codePointAt` method
2956
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
2957
- codeAt: createMethod(false),
2958
- // `String.prototype.at` method
2959
- // https://github.com/mathiasbynens/String.prototype.at
2960
- charAt: createMethod(true)
2961
- };
2962
-
2963
- var charAt = stringMultibyte.charAt;
2964
-
2965
- // `AdvanceStringIndex` abstract operation
2966
- // https://tc39.es/ecma262/#sec-advancestringindex
2967
- var advanceStringIndex$1 = function (S, index, unicode) {
2968
- return index + (unicode ? charAt(S, index).length : 1);
2969
- };
2970
-
2971
- var call$1 = functionCall;
2972
- var anObject$1 = anObject$9;
2973
- var isCallable = isCallable$g;
2974
- var classof = classofRaw$1;
2975
- var regexpExec = regexpExec$2;
2976
-
2977
- var $TypeError = TypeError;
2978
-
2979
- // `RegExpExec` abstract operation
2980
- // https://tc39.es/ecma262/#sec-regexpexec
2981
- var regexpExecAbstract = function (R, S) {
2982
- var exec = R.exec;
2983
- if (isCallable(exec)) {
2984
- var result = call$1(exec, R, S);
2985
- if (result !== null) anObject$1(result);
2986
- return result;
2987
- }
2988
- if (classof(R) === 'RegExp') return call$1(regexpExec, R, S);
2989
- throw new $TypeError('RegExp#exec called on incompatible receiver');
2990
- };
2991
-
2992
- var call = functionCall;
2993
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2994
- var anObject = anObject$9;
2995
- var isNullOrUndefined = isNullOrUndefined$3;
2996
- var toLength = toLength$2;
2997
- var toString = toString$8;
2998
- var requireObjectCoercible = requireObjectCoercible$7;
2999
- var getMethod = getMethod$2;
3000
- var advanceStringIndex = advanceStringIndex$1;
3001
- var regExpExec = regexpExecAbstract;
3002
-
3003
- // @@match logic
3004
- fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
3005
- return [
3006
- // `String.prototype.match` method
3007
- // https://tc39.es/ecma262/#sec-string.prototype.match
3008
- function match(regexp) {
3009
- var O = requireObjectCoercible(this);
3010
- var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
3011
- return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
3012
- },
3013
- // `RegExp.prototype[@@match]` method
3014
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
3015
- function (string) {
3016
- var rx = anObject(this);
3017
- var S = toString(string);
3018
- var res = maybeCallNative(nativeMatch, rx, S);
3019
-
3020
- if (res.done) return res.value;
3021
-
3022
- if (!rx.global) return regExpExec(rx, S);
3023
-
3024
- var fullUnicode = rx.unicode;
3025
- rx.lastIndex = 0;
3026
- var A = [];
3027
- var n = 0;
3028
- var result;
3029
- while ((result = regExpExec(rx, S)) !== null) {
3030
- var matchStr = toString(result[0]);
3031
- A[n] = matchStr;
3032
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
3033
- n++;
3034
- }
3035
- return n === 0 ? null : A;
3036
- }
3037
- ];
3038
- });
3039
-
3040
- const _excluded$2 = ["name", "label", "defaultValue", "rules", "disabled", "inputMode", "helperText", "className", "size", "sx", "onChange", "isReadOnly"];
3041
- const convertNumericInputValue = (value, inputMode) => {
631
+ var _excluded$2 = ["name", "label", "defaultValue", "rules", "disabled", "inputMode", "helperText", "className", "size", "sx", "onChange", "isReadOnly"];
632
+ var convertNumericInputValue = function convertNumericInputValue(value, inputMode) {
3042
633
  if (value !== '' && !isNaN(parseFloat(value))) {
3043
634
  return inputMode === 'numeric' ? parseInt(value, 10) : parseFloat(value);
3044
635
  }
3045
636
  return null;
3046
637
  };
3047
- const getAllowedKeys = (inputMode = 'numeric') => {
3048
- const allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', 'Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Home', 'End', 'PageDown', 'PageUp', 'Delete', ...(inputMode === 'decimal' ? ['.'] : [])];
638
+ var getAllowedKeys = function getAllowedKeys(inputMode) {
639
+ if (inputMode === void 0) {
640
+ inputMode = 'numeric';
641
+ }
642
+ var allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', 'Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Home', 'End', 'PageDown', 'PageUp', 'Delete'].concat(inputMode === 'decimal' ? ['.'] : []);
3049
643
  return allowedKeys;
3050
644
  };
3051
- const ReactHookFormNumberField = _ref => {
645
+ var ReactHookFormNumberField = function ReactHookFormNumberField(_ref) {
3052
646
  var _otherProps$slotProps;
3053
- let {
3054
- name,
3055
- label,
3056
- defaultValue = null,
3057
- rules,
3058
- disabled = false,
3059
- inputMode = 'numeric',
3060
- helperText = '',
3061
- className,
3062
- size = 'medium',
3063
- sx,
3064
- onChange = () => {},
3065
- isReadOnly
3066
- } = _ref,
647
+ var name = _ref.name,
648
+ label = _ref.label,
649
+ _ref$defaultValue = _ref.defaultValue,
650
+ defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue,
651
+ rules = _ref.rules,
652
+ _ref$disabled = _ref.disabled,
653
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
654
+ _ref$inputMode = _ref.inputMode,
655
+ inputMode = _ref$inputMode === void 0 ? 'numeric' : _ref$inputMode,
656
+ _ref$helperText = _ref.helperText,
657
+ helperText = _ref$helperText === void 0 ? '' : _ref$helperText,
658
+ className = _ref.className,
659
+ _ref$size = _ref.size,
660
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
661
+ sx = _ref.sx,
662
+ _ref$onChange = _ref.onChange,
663
+ _onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
664
+ isReadOnly = _ref.isReadOnly,
3067
665
  otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);
3068
- const {
3069
- control
3070
- } = useFormContext();
3071
- const {
3072
- field: {
3073
- onChange: onChangeField,
3074
- value,
3075
- ref
3076
- },
3077
- formState: {
3078
- errors: formErrors
3079
- }
3080
- } = useController(Object.assign({
3081
- name,
3082
- control,
3083
- rules,
3084
- defaultValue
3085
- }, defaultProps));
3086
- const errors = getErrors(name, formErrors);
3087
- const allowedKeyes = getAllowedKeys(inputMode);
3088
- const onPaste = event => {
3089
- const clipboardText = event.clipboardData.getData('text/plain');
3090
- const inputElement = event.target;
3091
- const before = inputElement.value.slice(0, inputElement.selectionStart);
3092
- const after = inputElement.value.slice(inputElement.selectionEnd);
3093
- const newValue = before + clipboardText + after;
666
+ var _useFormContext = useFormContext(),
667
+ control = _useFormContext.control;
668
+ var _useController = useController(Object.assign({
669
+ name: name,
670
+ control: control,
671
+ rules: rules,
672
+ defaultValue: defaultValue
673
+ }, defaultProps)),
674
+ _useController$field = _useController.field,
675
+ onChangeField = _useController$field.onChange,
676
+ value = _useController$field.value,
677
+ ref = _useController$field.ref,
678
+ formErrors = _useController.formState.errors;
679
+ var errors = getErrors(name, formErrors);
680
+ var allowedKeyes = getAllowedKeys(inputMode);
681
+ var onPaste = function onPaste(event) {
682
+ var clipboardText = event.clipboardData.getData('text/plain');
683
+ var inputElement = event.target;
684
+ var before = inputElement.value.slice(0, inputElement.selectionStart);
685
+ var after = inputElement.value.slice(inputElement.selectionEnd);
686
+ var newValue = before + clipboardText + after;
3094
687
  // eslint-disable-next-line no-useless-escape
3095
688
  if (inputMode === 'numeric' && !newValue.match(/^\-?[0-9]+$/)) {
3096
689
  event.preventDefault();
@@ -3100,8 +693,8 @@ const ReactHookFormNumberField = _ref => {
3100
693
  event.preventDefault();
3101
694
  }
3102
695
  };
3103
- const onKeyDown = event => {
3104
- const isMac = window.navigator.userAgent.includes(' Mac ');
696
+ var onKeyDown = function onKeyDown(event) {
697
+ var isMac = window.navigator.userAgent.includes(' Mac ');
3105
698
  if (isMac && event.metaKey || !isMac && event.ctrlKey) {
3106
699
  if (['c', 'v', 'x'].includes(event.key.toLowerCase())) {
3107
700
  return;
@@ -3115,7 +708,9 @@ const ReactHookFormNumberField = _ref => {
3115
708
  event.preventDefault();
3116
709
  }
3117
710
  };
3118
- const [displayValue, setDisplayValue] = React.useState(value === null || isNaN(value) ? '' : value);
711
+ var _React$useState = React.useState(value === null || isNaN(value) ? '' : value),
712
+ displayValue = _React$useState[0],
713
+ setDisplayValue = _React$useState[1];
3119
714
  return jsx(ReactHookFormFormControl, {
3120
715
  className: className,
3121
716
  sx: sx,
@@ -3132,13 +727,11 @@ const ReactHookFormNumberField = _ref => {
3132
727
  type: "text",
3133
728
  name: name,
3134
729
  size: size,
3135
- onChange: evt => {
3136
- const {
3137
- value
3138
- } = evt.target;
730
+ onChange: function onChange(evt) {
731
+ var value = evt.target.value;
3139
732
  setDisplayValue(value);
3140
733
  onChangeField(convertNumericInputValue(value, inputMode));
3141
- onChange(null);
734
+ _onChange(null);
3142
735
  },
3143
736
  onKeyDown: onKeyDown,
3144
737
  disabled: disabled,
@@ -3148,35 +741,43 @@ const ReactHookFormNumberField = _ref => {
3148
741
  input: Object.assign({}, isReadOnly && {
3149
742
  readOnly: true
3150
743
  }, {
3151
- onPaste
744
+ onPaste: onPaste
3152
745
  }),
3153
746
  htmlInput: Object.assign({}, (_otherProps$slotProps = otherProps.slotProps) == null ? void 0 : _otherProps$slotProps.htmlInput, {
3154
- inputMode
747
+ inputMode: inputMode
3155
748
  })
3156
749
  })
3157
750
  }))
3158
751
  });
3159
752
  };
3160
753
 
3161
- const _excluded$1 = ["name", "rules", "disabled", "label", "format", "openTo", "defaultNullValue", "helperText", "onChange", "className", "sx", "isReadOnly", "inputAdornment", "shouldHideUTC", "disablePast", "disableFuture"];
3162
- const OpenPicker = () => jsx(CalendarToday, {});
3163
- const getTimezoneOffset = value => value.getTimezoneOffset() * 60000;
3164
- const makeLocalAppearUTC = value => new Date(value.getTime() + getTimezoneOffset(value));
3165
- const localToUTC = dateTime => new Date(dateTime.getTime() - getTimezoneOffset(dateTime));
754
+ var _excluded$1 = ["name", "rules", "disabled", "label", "format", "openTo", "defaultNullValue", "helperText", "onChange", "className", "sx", "isReadOnly", "inputAdornment", "shouldHideUTC", "disablePast", "disableFuture"];
755
+ var OpenPicker = function OpenPicker() {
756
+ return jsx(CalendarToday, {});
757
+ };
758
+ var getTimezoneOffset = function getTimezoneOffset(value) {
759
+ return value.getTimezoneOffset() * 60000;
760
+ };
761
+ var makeLocalAppearUTC = function makeLocalAppearUTC(value) {
762
+ return new Date(value.getTime() + getTimezoneOffset(value));
763
+ };
764
+ var localToUTC = function localToUTC(dateTime) {
765
+ return new Date(dateTime.getTime() - getTimezoneOffset(dateTime));
766
+ };
3166
767
  /**
3167
768
  * Should return an isostring in the form "YYYY-MM-DDThh:mm:ssZ";
3168
769
  * The milli seconds section should not be included, strictly YYYY-MM-DDThh:mm:ssZ is important
3169
770
  * @param value input Date
3170
771
  * @returns iso string in YYYY-MM-DDThh:mm:ssZ format.
3171
772
  */
3172
- const getFormattedValueForDatePicker = value => {
773
+ var getFormattedValueForDatePicker = function getFormattedValueForDatePicker(value) {
3173
774
  var _dateUtils$dateToStri;
3174
775
  return (_dateUtils$dateToStri = dateUtils.dateToString(value, "yyyy-MM-dd'T'HH:mm:ss'Z'", true)) != null ? _dateUtils$dateToStri : null;
3175
776
  };
3176
- const getDateValue = value => {
777
+ var getDateValue = function getDateValue(value) {
3177
778
  if (value) {
3178
779
  var _ref, _dateUtils$stringToDa;
3179
- const dateValue = (_ref = (_dateUtils$stringToDa = dateUtils.stringToDate(value, 'yyyy/MM/dd HH:mm', false)) != null ? _dateUtils$stringToDa : dateUtils.isoStringToDate(value, false)) != null ? _ref : null;
780
+ var dateValue = (_ref = (_dateUtils$stringToDa = dateUtils.stringToDate(value, 'yyyy/MM/dd HH:mm', false)) != null ? _dateUtils$stringToDa : dateUtils.isoStringToDate(value, false)) != null ? _ref : null;
3180
781
  if (dateValue) {
3181
782
  return makeLocalAppearUTC(dateValue);
3182
783
  }
@@ -3184,50 +785,49 @@ const getDateValue = value => {
3184
785
  }
3185
786
  return null;
3186
787
  };
3187
- const ReactHookKeyboardDateTimePicker = _ref2 => {
3188
- let {
3189
- name,
3190
- rules,
3191
- disabled,
3192
- label = 'Select date and time',
3193
- format = dateUtils.DATE_FORMAT_DATEPICKER,
3194
- openTo = 'hours',
3195
- defaultNullValue = null,
3196
- helperText = '',
3197
- onChange = () => {},
3198
- className,
3199
- sx,
3200
- isReadOnly,
3201
- inputAdornment,
3202
- shouldHideUTC,
3203
- disablePast,
3204
- disableFuture
3205
- } = _ref2,
788
+ var ReactHookKeyboardDateTimePicker = function ReactHookKeyboardDateTimePicker(_ref2) {
789
+ var name = _ref2.name,
790
+ rules = _ref2.rules,
791
+ disabled = _ref2.disabled,
792
+ _ref2$label = _ref2.label,
793
+ label = _ref2$label === void 0 ? 'Select date and time' : _ref2$label,
794
+ _ref2$format = _ref2.format,
795
+ format = _ref2$format === void 0 ? dateUtils.DATE_FORMAT_DATEPICKER : _ref2$format,
796
+ _ref2$openTo = _ref2.openTo,
797
+ openTo = _ref2$openTo === void 0 ? 'hours' : _ref2$openTo,
798
+ _ref2$defaultNullValu = _ref2.defaultNullValue,
799
+ defaultNullValue = _ref2$defaultNullValu === void 0 ? null : _ref2$defaultNullValu,
800
+ _ref2$helperText = _ref2.helperText,
801
+ helperText = _ref2$helperText === void 0 ? '' : _ref2$helperText,
802
+ _ref2$onChange = _ref2.onChange,
803
+ _onChange = _ref2$onChange === void 0 ? function () {} : _ref2$onChange,
804
+ className = _ref2.className,
805
+ sx = _ref2.sx,
806
+ isReadOnly = _ref2.isReadOnly,
807
+ inputAdornment = _ref2.inputAdornment,
808
+ shouldHideUTC = _ref2.shouldHideUTC,
809
+ disablePast = _ref2.disablePast,
810
+ disableFuture = _ref2.disableFuture,
3206
811
  otherProps = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
3207
- const {
3208
- control
3209
- } = useFormContext();
3210
- const {
3211
- field: {
3212
- onChange: onChangeField,
3213
- value,
3214
- ref
3215
- },
3216
- formState: {
3217
- errors: formErrors
3218
- }
3219
- } = useController(Object.assign({
3220
- name,
3221
- control,
3222
- rules,
3223
- defaultValue: defaultNullValue
3224
- }, defaultProps));
3225
- const errors = getErrors(name, formErrors);
812
+ var _useFormContext = useFormContext(),
813
+ control = _useFormContext.control;
814
+ var _useController = useController(Object.assign({
815
+ name: name,
816
+ control: control,
817
+ rules: rules,
818
+ defaultValue: defaultNullValue
819
+ }, defaultProps)),
820
+ _useController$field = _useController.field,
821
+ onChangeField = _useController$field.onChange,
822
+ value = _useController$field.value,
823
+ ref = _useController$field.ref,
824
+ formErrors = _useController.formState.errors;
825
+ var errors = getErrors(name, formErrors);
3226
826
  // Ensure value is a Date object
3227
- const dateValue = getDateValue(value);
3228
- const now = makeLocalAppearUTC(dateUtils.utc());
3229
- const minDateTime = disablePast ? now : null;
3230
- const maxDateTime = disableFuture ? now : null;
827
+ var dateValue = getDateValue(value);
828
+ var now = makeLocalAppearUTC(dateUtils.utc());
829
+ var minDateTime = disablePast ? now : null;
830
+ var maxDateTime = disableFuture ? now : null;
3231
831
  return jsx(ReactHookFormFormControl, {
3232
832
  disabled: disabled,
3233
833
  errors: errors,
@@ -3242,23 +842,23 @@ const ReactHookKeyboardDateTimePicker = _ref2 => {
3242
842
  value: dateValue,
3243
843
  openTo: openTo,
3244
844
  disabled: disabled,
3245
- onChange: value => {
845
+ onChange: function onChange(value) {
3246
846
  if (!value) {
3247
- onChange(null);
847
+ _onChange(null);
3248
848
  onChangeField(null);
3249
849
  return;
3250
850
  }
3251
- const formattedDate = getFormattedValueForDatePicker(localToUTC(value));
851
+ var formattedDate = getFormattedValueForDatePicker(localToUTC(value));
3252
852
  onChangeField(formattedDate);
3253
- onChange(formattedDate);
853
+ _onChange(formattedDate);
3254
854
  },
3255
855
  inputRef: ref,
3256
856
  slotProps: {
3257
857
  textField: Object.assign({
3258
858
  variant: 'filled',
3259
- helperText,
859
+ helperText: helperText,
3260
860
  error: !!errors,
3261
- name,
861
+ name: name,
3262
862
  placeholder: disabled ? '' : format.toLowerCase(),
3263
863
  InputProps: Object.assign({}, !shouldHideUTC && {
3264
864
  endAdornment: jsx(InputAdornment, {
@@ -3297,15 +897,15 @@ const ReactHookKeyboardDateTimePicker = _ref2 => {
3297
897
  });
3298
898
  };
3299
899
 
3300
- const defaultFormOptions = {
900
+ var defaultFormOptions = {
3301
901
  mode: 'onChange',
3302
902
  reValidateMode: 'onChange'
3303
903
  };
3304
- const ReactHookFormProvider = ({
3305
- children,
3306
- options: _options = defaultFormOptions
3307
- }) => {
3308
- const formMethods = useForm(_options);
904
+ var ReactHookFormProvider = function ReactHookFormProvider(_ref) {
905
+ var children = _ref.children,
906
+ _ref$options = _ref.options,
907
+ options = _ref$options === void 0 ? defaultFormOptions : _ref$options;
908
+ var formMethods = useForm(options);
3309
909
  // added this ignore as the build is failing otherwise on: Type instantiation is excessively deep and possibly infinite.
3310
910
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3311
911
  // @ts-ignore
@@ -3313,73 +913,80 @@ const ReactHookFormProvider = ({
3313
913
  children: children
3314
914
  }));
3315
915
  };
3316
- const ReactHookFormProviderWrapper = ({
3317
- children,
3318
- options: _options2 = defaultFormOptions
3319
- }) => jsx(LocalizationProvider, {
3320
- dateAdapter: AdapterDateFns,
3321
- children: jsx(ReactHookFormProvider, {
3322
- options: _options2,
3323
- children: children
3324
- })
3325
- });
916
+ var ReactHookFormProviderWrapper = function ReactHookFormProviderWrapper(_ref2) {
917
+ var children = _ref2.children,
918
+ _ref2$options = _ref2.options,
919
+ options = _ref2$options === void 0 ? defaultFormOptions : _ref2$options;
920
+ return jsx(LocalizationProvider, {
921
+ dateAdapter: AdapterDateFns,
922
+ children: jsx(ReactHookFormProvider, {
923
+ options: options,
924
+ children: children
925
+ })
926
+ });
927
+ };
3326
928
 
3327
- const _excluded = ["name", "defaultValue", "rules"];
3328
- const ReactHookFormHiddenInput = _ref => {
3329
- let {
3330
- name,
3331
- defaultValue = null,
3332
- rules
3333
- } = _ref,
929
+ var _excluded = ["name", "defaultValue", "rules"];
930
+ var ReactHookFormHiddenInput = function ReactHookFormHiddenInput(_ref) {
931
+ var name = _ref.name,
932
+ _ref$defaultValue = _ref.defaultValue,
933
+ defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue,
934
+ rules = _ref.rules,
3334
935
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
3335
- const {
3336
- control
3337
- } = useFormContext();
3338
- const {
3339
- field
3340
- } = useController(Object.assign({
3341
- name,
3342
- control,
3343
- rules,
3344
- defaultValue
3345
- }, defaultProps));
936
+ var _useFormContext = useFormContext(),
937
+ control = _useFormContext.control;
938
+ var _useController = useController(Object.assign({
939
+ name: name,
940
+ control: control,
941
+ rules: rules,
942
+ defaultValue: defaultValue
943
+ }, defaultProps)),
944
+ field = _useController.field;
3346
945
  return field.value !== null ? jsx("input", Object.assign({}, field, {
3347
946
  type: "hidden"
3348
947
  }, props)) : null;
3349
948
  };
3350
949
 
3351
950
  // hidden input helpers, should not be part of send formdata
3352
- const HIDDEN_INPUT_HELPER_IS_DRAFT = 'IS_DRAFT';
3353
- const useDraftFormHelpers = (isDefaultDraft = false) => {
3354
- const {
3355
- getValues,
3356
- setValue,
3357
- register
3358
- } = useFormContext();
3359
- React.useEffect(() => {
951
+ var HIDDEN_INPUT_HELPER_IS_DRAFT = 'IS_DRAFT';
952
+ var useDraftFormHelpers = function useDraftFormHelpers(isDefaultDraft) {
953
+ if (isDefaultDraft === void 0) {
954
+ isDefaultDraft = false;
955
+ }
956
+ var _useFormContext = useFormContext(),
957
+ getValues = _useFormContext.getValues,
958
+ setValue = _useFormContext.setValue,
959
+ register = _useFormContext.register;
960
+ React.useEffect(function () {
3360
961
  setValue(HIDDEN_INPUT_HELPER_IS_DRAFT, isDefaultDraft, {
3361
962
  shouldDirty: false
3362
963
  });
3363
964
  // eslint-disable-next-line react-hooks/exhaustive-deps
3364
965
  }, []);
3365
- const isDraft = () => getValues(HIDDEN_INPUT_HELPER_IS_DRAFT) === true;
3366
- const isRequired = value => {
966
+ var isDraft = function isDraft() {
967
+ return getValues(HIDDEN_INPUT_HELPER_IS_DRAFT) === true;
968
+ };
969
+ var isRequired = function isRequired(value) {
3367
970
  if (!isDraft() && isEmpty(value)) {
3368
971
  return errorMessages.required;
3369
972
  }
3370
973
  return true;
3371
974
  };
3372
- const toggleIsDraft = isDraft => setValue(HIDDEN_INPUT_HELPER_IS_DRAFT, isDraft, {
3373
- shouldDirty: false
3374
- });
3375
- const DraftFieldHelper = () => jsx("input", Object.assign({}, register(HIDDEN_INPUT_HELPER_IS_DRAFT), {
3376
- type: "hidden"
3377
- }));
975
+ var toggleIsDraft = function toggleIsDraft(isDraft) {
976
+ return setValue(HIDDEN_INPUT_HELPER_IS_DRAFT, isDraft, {
977
+ shouldDirty: false
978
+ });
979
+ };
980
+ var DraftFieldHelper = function DraftFieldHelper() {
981
+ return jsx("input", Object.assign({}, register(HIDDEN_INPUT_HELPER_IS_DRAFT), {
982
+ type: "hidden"
983
+ }));
984
+ };
3378
985
  return {
3379
- isRequired,
3380
- toggleIsDraft,
3381
- isDraft,
3382
- DraftFieldHelper
986
+ isRequired: isRequired,
987
+ toggleIsDraft: toggleIsDraft,
988
+ isDraft: isDraft,
989
+ DraftFieldHelper: DraftFieldHelper
3383
990
  };
3384
991
  };
3385
992