remix-validated-form 4.6.0-beta.0 → 4.6.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.
@@ -1,34 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a2, b2) => {
9
- for (var prop in b2 || (b2 = {}))
10
- if (__hasOwnProp.call(b2, prop))
11
- __defNormalProp(a2, prop, b2[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b2)) {
14
- if (__propIsEnum.call(b2, prop))
15
- __defNormalProp(a2, prop, b2[prop]);
16
- }
17
- return a2;
18
- };
19
- var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
1
  import React, { createContext, useDebugValue, useContext, useCallback, useEffect, useMemo, useRef, useLayoutEffect, useState } from "react";
33
2
  import { useActionData, useMatches, useTransition, Form, useSubmit } from "@remix-run/react";
34
3
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -135,15 +104,15 @@ var freeSelf = typeof self == "object" && self && self.Object === Object && self
135
104
  var root$8 = freeGlobal || freeSelf || Function("return this")();
136
105
  var _root = root$8;
137
106
  var root$7 = _root;
138
- var Symbol$5 = root$7.Symbol;
139
- var _Symbol = Symbol$5;
140
- var Symbol$4 = _Symbol;
141
- var objectProto$d = Object.prototype;
142
- var hasOwnProperty$a = objectProto$d.hasOwnProperty;
143
- var nativeObjectToString$1 = objectProto$d.toString;
144
- var symToStringTag$1 = Symbol$4 ? Symbol$4.toStringTag : void 0;
107
+ var Symbol$7 = root$7.Symbol;
108
+ var _Symbol = Symbol$7;
109
+ var Symbol$6 = _Symbol;
110
+ var objectProto$f = Object.prototype;
111
+ var hasOwnProperty$c = objectProto$f.hasOwnProperty;
112
+ var nativeObjectToString$1 = objectProto$f.toString;
113
+ var symToStringTag$1 = Symbol$6 ? Symbol$6.toStringTag : void 0;
145
114
  function getRawTag$1(value) {
146
- var isOwn = hasOwnProperty$a.call(value, symToStringTag$1), tag = value[symToStringTag$1];
115
+ var isOwn = hasOwnProperty$c.call(value, symToStringTag$1), tag = value[symToStringTag$1];
147
116
  try {
148
117
  value[symToStringTag$1] = void 0;
149
118
  var unmasked = true;
@@ -160,35 +129,35 @@ function getRawTag$1(value) {
160
129
  return result;
161
130
  }
162
131
  var _getRawTag = getRawTag$1;
163
- var objectProto$c = Object.prototype;
164
- var nativeObjectToString = objectProto$c.toString;
132
+ var objectProto$e = Object.prototype;
133
+ var nativeObjectToString = objectProto$e.toString;
165
134
  function objectToString$1(value) {
166
135
  return nativeObjectToString.call(value);
167
136
  }
168
137
  var _objectToString = objectToString$1;
169
- var Symbol$3 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
138
+ var Symbol$5 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
170
139
  var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
171
- var symToStringTag = Symbol$3 ? Symbol$3.toStringTag : void 0;
172
- function baseGetTag$5(value) {
140
+ var symToStringTag = Symbol$5 ? Symbol$5.toStringTag : void 0;
141
+ function baseGetTag$6(value) {
173
142
  if (value == null) {
174
143
  return value === void 0 ? undefinedTag : nullTag;
175
144
  }
176
145
  return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
177
146
  }
178
- var _baseGetTag = baseGetTag$5;
179
- function isObject$5(value) {
147
+ var _baseGetTag = baseGetTag$6;
148
+ function isObject$7(value) {
180
149
  var type = typeof value;
181
150
  return value != null && (type == "object" || type == "function");
182
151
  }
183
- var isObject_1 = isObject$5;
184
- var baseGetTag$4 = _baseGetTag, isObject$4 = isObject_1;
185
- var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
152
+ var isObject_1 = isObject$7;
153
+ var baseGetTag$5 = _baseGetTag, isObject$6 = isObject_1;
154
+ var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
186
155
  function isFunction$2(value) {
187
- if (!isObject$4(value)) {
156
+ if (!isObject$6(value)) {
188
157
  return false;
189
158
  }
190
- var tag = baseGetTag$4(value);
191
- return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
159
+ var tag = baseGetTag$5(value);
160
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
192
161
  }
193
162
  var isFunction_1 = isFunction$2;
194
163
  var root$6 = _root;
@@ -203,12 +172,12 @@ function isMasked$1(func) {
203
172
  return !!maskSrcKey && maskSrcKey in func;
204
173
  }
205
174
  var _isMasked = isMasked$1;
206
- var funcProto$1 = Function.prototype;
207
- var funcToString$1 = funcProto$1.toString;
175
+ var funcProto$2 = Function.prototype;
176
+ var funcToString$2 = funcProto$2.toString;
208
177
  function toSource$2(func) {
209
178
  if (func != null) {
210
179
  try {
211
- return funcToString$1.call(func);
180
+ return funcToString$2.call(func);
212
181
  } catch (e2) {
213
182
  }
214
183
  try {
@@ -219,15 +188,17 @@ function toSource$2(func) {
219
188
  return "";
220
189
  }
221
190
  var _toSource = toSource$2;
222
- var isFunction$1 = isFunction_1, isMasked = _isMasked, isObject$3 = isObject_1, toSource$1 = _toSource;
191
+ var isFunction$1 = isFunction_1, isMasked = _isMasked, isObject$5 = isObject_1, toSource$1 = _toSource;
223
192
  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
224
193
  var reIsHostCtor = /^\[object .+?Constructor\]$/;
225
- var funcProto = Function.prototype, objectProto$b = Object.prototype;
226
- var funcToString = funcProto.toString;
227
- var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
228
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$9).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
194
+ var funcProto$1 = Function.prototype, objectProto$d = Object.prototype;
195
+ var funcToString$1 = funcProto$1.toString;
196
+ var hasOwnProperty$b = objectProto$d.hasOwnProperty;
197
+ var reIsNative = RegExp(
198
+ "^" + funcToString$1.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
199
+ );
229
200
  function baseIsNative$1(value) {
230
- if (!isObject$3(value) || isMasked(value)) {
201
+ if (!isObject$5(value) || isMasked(value)) {
231
202
  return false;
232
203
  }
233
204
  var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
@@ -264,23 +235,23 @@ function hashDelete$1(key) {
264
235
  var _hashDelete = hashDelete$1;
265
236
  var nativeCreate$2 = _nativeCreate;
266
237
  var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
267
- var objectProto$a = Object.prototype;
268
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
238
+ var objectProto$c = Object.prototype;
239
+ var hasOwnProperty$a = objectProto$c.hasOwnProperty;
269
240
  function hashGet$1(key) {
270
241
  var data = this.__data__;
271
242
  if (nativeCreate$2) {
272
243
  var result = data[key];
273
244
  return result === HASH_UNDEFINED$2 ? void 0 : result;
274
245
  }
275
- return hasOwnProperty$8.call(data, key) ? data[key] : void 0;
246
+ return hasOwnProperty$a.call(data, key) ? data[key] : void 0;
276
247
  }
277
248
  var _hashGet = hashGet$1;
278
249
  var nativeCreate$1 = _nativeCreate;
279
- var objectProto$9 = Object.prototype;
280
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
250
+ var objectProto$b = Object.prototype;
251
+ var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
281
252
  function hashHas$1(key) {
282
253
  var data = this.__data__;
283
- return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$7.call(data, key);
254
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$9.call(data, key);
284
255
  }
285
256
  var _hashHas = hashHas$1;
286
257
  var nativeCreate = _nativeCreate;
@@ -387,16 +358,16 @@ function stackSet$1(key, value) {
387
358
  }
388
359
  var _stackSet = stackSet$1;
389
360
  var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
390
- function Stack$2(entries) {
361
+ function Stack$3(entries) {
391
362
  var data = this.__data__ = new ListCache(entries);
392
363
  this.size = data.size;
393
364
  }
394
- Stack$2.prototype.clear = stackClear;
395
- Stack$2.prototype["delete"] = stackDelete;
396
- Stack$2.prototype.get = stackGet;
397
- Stack$2.prototype.has = stackHas;
398
- Stack$2.prototype.set = stackSet;
399
- var _Stack = Stack$2;
365
+ Stack$3.prototype.clear = stackClear;
366
+ Stack$3.prototype["delete"] = stackDelete;
367
+ Stack$3.prototype.get = stackGet;
368
+ Stack$3.prototype.has = stackHas;
369
+ Stack$3.prototype.set = stackSet;
370
+ var _Stack = Stack$3;
400
371
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
401
372
  function setCacheAdd$1(value) {
402
373
  this.__data__.set(value, HASH_UNDEFINED);
@@ -479,8 +450,8 @@ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
479
450
  }
480
451
  var _equalArrays = equalArrays$2;
481
452
  var root$4 = _root;
482
- var Uint8Array$1 = root$4.Uint8Array;
483
- var _Uint8Array = Uint8Array$1;
453
+ var Uint8Array$2 = root$4.Uint8Array;
454
+ var _Uint8Array = Uint8Array$2;
484
455
  function mapToArray$1(map) {
485
456
  var index = -1, result = Array(map.size);
486
457
  map.forEach(function(value, key) {
@@ -497,36 +468,36 @@ function setToArray$3(set2) {
497
468
  return result;
498
469
  }
499
470
  var _setToArray = setToArray$3;
500
- var Symbol$2 = _Symbol, Uint8Array2 = _Uint8Array, eq$1 = eq_1, equalArrays$1 = _equalArrays, mapToArray = _mapToArray, setToArray$2 = _setToArray;
471
+ var Symbol$4 = _Symbol, Uint8Array$1 = _Uint8Array, eq$1 = eq_1, equalArrays$1 = _equalArrays, mapToArray = _mapToArray, setToArray$2 = _setToArray;
501
472
  var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
502
- var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
503
- var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]";
504
- var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : void 0;
473
+ var boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", symbolTag$3 = "[object Symbol]";
474
+ var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]";
475
+ var symbolProto$2 = Symbol$4 ? Symbol$4.prototype : void 0, symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : void 0;
505
476
  function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
506
477
  switch (tag) {
507
- case dataViewTag$2:
478
+ case dataViewTag$4:
508
479
  if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
509
480
  return false;
510
481
  }
511
482
  object = object.buffer;
512
483
  other = other.buffer;
513
- case arrayBufferTag$1:
514
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
484
+ case arrayBufferTag$3:
485
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
515
486
  return false;
516
487
  }
517
488
  return true;
518
- case boolTag$1:
519
- case dateTag$1:
520
- case numberTag$1:
489
+ case boolTag$3:
490
+ case dateTag$3:
491
+ case numberTag$3:
521
492
  return eq$1(+object, +other);
522
- case errorTag$1:
493
+ case errorTag$2:
523
494
  return object.name == other.name && object.message == other.message;
524
- case regexpTag$1:
525
- case stringTag$1:
495
+ case regexpTag$3:
496
+ case stringTag$3:
526
497
  return object == other + "";
527
- case mapTag$2:
498
+ case mapTag$5:
528
499
  var convert = mapToArray;
529
- case setTag$2:
500
+ case setTag$5:
530
501
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
531
502
  convert || (convert = setToArray$2);
532
503
  if (object.size != other.size && !isPartial) {
@@ -541,28 +512,28 @@ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack)
541
512
  var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
542
513
  stack["delete"](object);
543
514
  return result;
544
- case symbolTag$1:
545
- if (symbolValueOf) {
546
- return symbolValueOf.call(object) == symbolValueOf.call(other);
515
+ case symbolTag$3:
516
+ if (symbolValueOf$1) {
517
+ return symbolValueOf$1.call(object) == symbolValueOf$1.call(other);
547
518
  }
548
519
  }
549
520
  return false;
550
521
  }
551
522
  var _equalByTag = equalByTag$1;
552
- function arrayPush$2(array, values) {
523
+ function arrayPush$3(array, values) {
553
524
  var index = -1, length = values.length, offset = array.length;
554
525
  while (++index < length) {
555
526
  array[offset + index] = values[index];
556
527
  }
557
528
  return array;
558
529
  }
559
- var _arrayPush = arrayPush$2;
560
- var isArray$8 = Array.isArray;
561
- var isArray_1 = isArray$8;
562
- var arrayPush$1 = _arrayPush, isArray$7 = isArray_1;
530
+ var _arrayPush = arrayPush$3;
531
+ var isArray$a = Array.isArray;
532
+ var isArray_1 = isArray$a;
533
+ var arrayPush$2 = _arrayPush, isArray$9 = isArray_1;
563
534
  function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
564
535
  var result = keysFunc(object);
565
- return isArray$7(object) ? result : arrayPush$1(result, symbolsFunc(object));
536
+ return isArray$9(object) ? result : arrayPush$2(result, symbolsFunc(object));
566
537
  }
567
538
  var _baseGetAllKeys = baseGetAllKeys$2;
568
539
  function arrayFilter$1(array, predicate) {
@@ -581,10 +552,10 @@ function stubArray$2() {
581
552
  }
582
553
  var stubArray_1 = stubArray$2;
583
554
  var arrayFilter = _arrayFilter, stubArray$1 = stubArray_1;
584
- var objectProto$8 = Object.prototype;
585
- var propertyIsEnumerable$1 = objectProto$8.propertyIsEnumerable;
555
+ var objectProto$a = Object.prototype;
556
+ var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
586
557
  var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
587
- var getSymbols$2 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
558
+ var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
588
559
  if (object == null) {
589
560
  return [];
590
561
  }
@@ -593,7 +564,7 @@ var getSymbols$2 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
593
564
  return propertyIsEnumerable$1.call(object, symbol);
594
565
  });
595
566
  };
596
- var _getSymbols = getSymbols$2;
567
+ var _getSymbols = getSymbols$3;
597
568
  function baseTimes$1(n2, iteratee) {
598
569
  var index = -1, result = Array(n2);
599
570
  while (++index < n2) {
@@ -602,27 +573,27 @@ function baseTimes$1(n2, iteratee) {
602
573
  return result;
603
574
  }
604
575
  var _baseTimes = baseTimes$1;
605
- function isObjectLike$5(value) {
576
+ function isObjectLike$8(value) {
606
577
  return value != null && typeof value == "object";
607
578
  }
608
- var isObjectLike_1 = isObjectLike$5;
609
- var baseGetTag$3 = _baseGetTag, isObjectLike$4 = isObjectLike_1;
610
- var argsTag$2 = "[object Arguments]";
579
+ var isObjectLike_1 = isObjectLike$8;
580
+ var baseGetTag$4 = _baseGetTag, isObjectLike$7 = isObjectLike_1;
581
+ var argsTag$3 = "[object Arguments]";
611
582
  function baseIsArguments$1(value) {
612
- return isObjectLike$4(value) && baseGetTag$3(value) == argsTag$2;
583
+ return isObjectLike$7(value) && baseGetTag$4(value) == argsTag$3;
613
584
  }
614
585
  var _baseIsArguments = baseIsArguments$1;
615
- var baseIsArguments = _baseIsArguments, isObjectLike$3 = isObjectLike_1;
616
- var objectProto$7 = Object.prototype;
617
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
618
- var propertyIsEnumerable = objectProto$7.propertyIsEnumerable;
619
- var isArguments$2 = baseIsArguments(function() {
586
+ var baseIsArguments = _baseIsArguments, isObjectLike$6 = isObjectLike_1;
587
+ var objectProto$9 = Object.prototype;
588
+ var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
589
+ var propertyIsEnumerable = objectProto$9.propertyIsEnumerable;
590
+ var isArguments$3 = baseIsArguments(function() {
620
591
  return arguments;
621
592
  }()) ? baseIsArguments : function(value) {
622
- return isObjectLike$3(value) && hasOwnProperty$6.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
593
+ return isObjectLike$6(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
623
594
  };
624
- var isArguments_1 = isArguments$2;
625
- var isBuffer$2 = { exports: {} };
595
+ var isArguments_1 = isArguments$3;
596
+ var isBuffer$3 = { exports: {} };
626
597
  function stubFalse() {
627
598
  return false;
628
599
  }
@@ -632,11 +603,11 @@ var stubFalse_1 = stubFalse;
632
603
  var freeExports = exports && !exports.nodeType && exports;
633
604
  var freeModule = freeExports && true && module && !module.nodeType && module;
634
605
  var moduleExports = freeModule && freeModule.exports === freeExports;
635
- var Buffer2 = moduleExports ? root2.Buffer : void 0;
636
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
606
+ var Buffer = moduleExports ? root2.Buffer : void 0;
607
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
637
608
  var isBuffer2 = nativeIsBuffer || stubFalse2;
638
609
  module.exports = isBuffer2;
639
- })(isBuffer$2, isBuffer$2.exports);
610
+ })(isBuffer$3, isBuffer$3.exports);
640
611
  var MAX_SAFE_INTEGER$1 = 9007199254740991;
641
612
  var reIsUint = /^(?:0|[1-9]\d*)$/;
642
613
  function isIndex$3(value, length) {
@@ -650,22 +621,22 @@ function isLength$3(value) {
650
621
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
651
622
  }
652
623
  var isLength_1 = isLength$3;
653
- var baseGetTag$2 = _baseGetTag, isLength$2 = isLength_1, isObjectLike$2 = isObjectLike_1;
654
- var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag$1 = "[object Map]", numberTag = "[object Number]", objectTag$2 = "[object Object]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", weakMapTag$1 = "[object WeakMap]";
655
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
624
+ var baseGetTag$3 = _baseGetTag, isLength$2 = isLength_1, isObjectLike$5 = isObjectLike_1;
625
+ var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", funcTag$1 = "[object Function]", mapTag$4 = "[object Map]", numberTag$2 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$4 = "[object Set]", stringTag$2 = "[object String]", weakMapTag$2 = "[object WeakMap]";
626
+ var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
656
627
  var typedArrayTags = {};
657
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
658
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
628
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
629
+ typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] = typedArrayTags[weakMapTag$2] = false;
659
630
  function baseIsTypedArray$1(value) {
660
- return isObjectLike$2(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$2(value)];
631
+ return isObjectLike$5(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$3(value)];
661
632
  }
662
633
  var _baseIsTypedArray = baseIsTypedArray$1;
663
- function baseUnary$1(func) {
634
+ function baseUnary$3(func) {
664
635
  return function(value) {
665
636
  return func(value);
666
637
  };
667
638
  }
668
- var _baseUnary = baseUnary$1;
639
+ var _baseUnary = baseUnary$3;
669
640
  var _nodeUtil = { exports: {} };
670
641
  (function(module, exports) {
671
642
  var freeGlobal2 = _freeGlobal;
@@ -685,29 +656,29 @@ var _nodeUtil = { exports: {} };
685
656
  }();
686
657
  module.exports = nodeUtil2;
687
658
  })(_nodeUtil, _nodeUtil.exports);
688
- var baseIsTypedArray = _baseIsTypedArray, baseUnary = _baseUnary, nodeUtil = _nodeUtil.exports;
689
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
690
- var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
659
+ var baseIsTypedArray = _baseIsTypedArray, baseUnary$2 = _baseUnary, nodeUtil$2 = _nodeUtil.exports;
660
+ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
661
+ var isTypedArray$2 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
691
662
  var isTypedArray_1 = isTypedArray$2;
692
- var baseTimes = _baseTimes, isArguments$1 = isArguments_1, isArray$6 = isArray_1, isBuffer$1 = isBuffer$2.exports, isIndex$2 = _isIndex, isTypedArray$1 = isTypedArray_1;
693
- var objectProto$6 = Object.prototype;
694
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
663
+ var baseTimes = _baseTimes, isArguments$2 = isArguments_1, isArray$8 = isArray_1, isBuffer$2 = isBuffer$3.exports, isIndex$2 = _isIndex, isTypedArray$1 = isTypedArray_1;
664
+ var objectProto$8 = Object.prototype;
665
+ var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
695
666
  function arrayLikeKeys$2(value, inherited) {
696
- var isArr = isArray$6(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
667
+ var isArr = isArray$8(value), isArg = !isArr && isArguments$2(value), isBuff = !isArr && !isArg && isBuffer$2(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
697
668
  for (var key in value) {
698
- if ((inherited || hasOwnProperty$5.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex$2(key, length)))) {
669
+ if ((inherited || hasOwnProperty$7.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex$2(key, length)))) {
699
670
  result.push(key);
700
671
  }
701
672
  }
702
673
  return result;
703
674
  }
704
675
  var _arrayLikeKeys = arrayLikeKeys$2;
705
- var objectProto$5 = Object.prototype;
706
- function isPrototype$2(value) {
707
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$5;
676
+ var objectProto$7 = Object.prototype;
677
+ function isPrototype$3(value) {
678
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$7;
708
679
  return value === proto;
709
680
  }
710
- var _isPrototype = isPrototype$2;
681
+ var _isPrototype = isPrototype$3;
711
682
  function overArg$2(func, transform) {
712
683
  return function(arg) {
713
684
  return func(transform(arg));
@@ -717,16 +688,16 @@ var _overArg = overArg$2;
717
688
  var overArg$1 = _overArg;
718
689
  var nativeKeys$1 = overArg$1(Object.keys, Object);
719
690
  var _nativeKeys = nativeKeys$1;
720
- var isPrototype$1 = _isPrototype, nativeKeys = _nativeKeys;
721
- var objectProto$4 = Object.prototype;
722
- var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
691
+ var isPrototype$2 = _isPrototype, nativeKeys = _nativeKeys;
692
+ var objectProto$6 = Object.prototype;
693
+ var hasOwnProperty$6 = objectProto$6.hasOwnProperty;
723
694
  function baseKeys$1(object) {
724
- if (!isPrototype$1(object)) {
695
+ if (!isPrototype$2(object)) {
725
696
  return nativeKeys(object);
726
697
  }
727
698
  var result = [];
728
699
  for (var key in Object(object)) {
729
- if (hasOwnProperty$4.call(object, key) && key != "constructor") {
700
+ if (hasOwnProperty$6.call(object, key) && key != "constructor") {
730
701
  result.push(key);
731
702
  }
732
703
  }
@@ -739,28 +710,28 @@ function isArrayLike$2(value) {
739
710
  }
740
711
  var isArrayLike_1 = isArrayLike$2;
741
712
  var arrayLikeKeys$1 = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike$1 = isArrayLike_1;
742
- function keys$2(object) {
713
+ function keys$4(object) {
743
714
  return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys(object);
744
715
  }
745
- var keys_1 = keys$2;
746
- var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols$1 = _getSymbols, keys$1 = keys_1;
747
- function getAllKeys$1(object) {
748
- return baseGetAllKeys$1(object, keys$1, getSymbols$1);
716
+ var keys_1 = keys$4;
717
+ var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols$2 = _getSymbols, keys$3 = keys_1;
718
+ function getAllKeys$2(object) {
719
+ return baseGetAllKeys$1(object, keys$3, getSymbols$2);
749
720
  }
750
- var _getAllKeys = getAllKeys$1;
751
- var getAllKeys = _getAllKeys;
721
+ var _getAllKeys = getAllKeys$2;
722
+ var getAllKeys$1 = _getAllKeys;
752
723
  var COMPARE_PARTIAL_FLAG$3 = 1;
753
- var objectProto$3 = Object.prototype;
754
- var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
724
+ var objectProto$5 = Object.prototype;
725
+ var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
755
726
  function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
756
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
727
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys$1(object), objLength = objProps.length, othProps = getAllKeys$1(other), othLength = othProps.length;
757
728
  if (objLength != othLength && !isPartial) {
758
729
  return false;
759
730
  }
760
731
  var index = objLength;
761
732
  while (index--) {
762
733
  var key = objProps[index];
763
- if (!(isPartial ? key in other : hasOwnProperty$3.call(other, key))) {
734
+ if (!(isPartial ? key in other : hasOwnProperty$5.call(other, key))) {
764
735
  return false;
765
736
  }
766
737
  }
@@ -808,80 +779,80 @@ var _Set = Set$3;
808
779
  var getNative$1 = _getNative, root = _root;
809
780
  var WeakMap$1 = getNative$1(root, "WeakMap");
810
781
  var _WeakMap = WeakMap$1;
811
- var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$2 = _Set, WeakMap = _WeakMap, baseGetTag$1 = _baseGetTag, toSource = _toSource;
812
- var mapTag = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
813
- var dataViewTag = "[object DataView]";
782
+ var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$2 = _Set, WeakMap = _WeakMap, baseGetTag$2 = _baseGetTag, toSource = _toSource;
783
+ var mapTag$3 = "[object Map]", objectTag$3 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
784
+ var dataViewTag$2 = "[object DataView]";
814
785
  var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$2), weakMapCtorString = toSource(WeakMap);
815
- var getTag$1 = baseGetTag$1;
816
- if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$2 && getTag$1(new Set$2()) != setTag || WeakMap && getTag$1(new WeakMap()) != weakMapTag) {
817
- getTag$1 = function(value) {
818
- var result = baseGetTag$1(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
786
+ var getTag$4 = baseGetTag$2;
787
+ if (DataView && getTag$4(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag$4(new Map$1()) != mapTag$3 || Promise$1 && getTag$4(Promise$1.resolve()) != promiseTag || Set$2 && getTag$4(new Set$2()) != setTag$3 || WeakMap && getTag$4(new WeakMap()) != weakMapTag$1) {
788
+ getTag$4 = function(value) {
789
+ var result = baseGetTag$2(value), Ctor = result == objectTag$3 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
819
790
  if (ctorString) {
820
791
  switch (ctorString) {
821
792
  case dataViewCtorString:
822
- return dataViewTag;
793
+ return dataViewTag$2;
823
794
  case mapCtorString:
824
- return mapTag;
795
+ return mapTag$3;
825
796
  case promiseCtorString:
826
797
  return promiseTag;
827
798
  case setCtorString:
828
- return setTag;
799
+ return setTag$3;
829
800
  case weakMapCtorString:
830
- return weakMapTag;
801
+ return weakMapTag$1;
831
802
  }
832
803
  }
833
804
  return result;
834
805
  };
835
806
  }
836
- var _getTag = getTag$1;
837
- var Stack$1 = _Stack, equalArrays = _equalArrays, equalByTag = _equalByTag, equalObjects = _equalObjects, getTag = _getTag, isArray$5 = isArray_1, isBuffer = isBuffer$2.exports, isTypedArray = isTypedArray_1;
807
+ var _getTag = getTag$4;
808
+ var Stack$2 = _Stack, equalArrays = _equalArrays, equalByTag = _equalByTag, equalObjects = _equalObjects, getTag$3 = _getTag, isArray$7 = isArray_1, isBuffer$1 = isBuffer$3.exports, isTypedArray = isTypedArray_1;
838
809
  var COMPARE_PARTIAL_FLAG$2 = 1;
839
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
840
- var objectProto$2 = Object.prototype;
841
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
810
+ var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", objectTag$2 = "[object Object]";
811
+ var objectProto$4 = Object.prototype;
812
+ var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
842
813
  function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
843
- var objIsArr = isArray$5(object), othIsArr = isArray$5(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
844
- objTag = objTag == argsTag ? objectTag : objTag;
845
- othTag = othTag == argsTag ? objectTag : othTag;
846
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
847
- if (isSameTag && isBuffer(object)) {
848
- if (!isBuffer(other)) {
814
+ var objIsArr = isArray$7(object), othIsArr = isArray$7(other), objTag = objIsArr ? arrayTag$1 : getTag$3(object), othTag = othIsArr ? arrayTag$1 : getTag$3(other);
815
+ objTag = objTag == argsTag$1 ? objectTag$2 : objTag;
816
+ othTag = othTag == argsTag$1 ? objectTag$2 : othTag;
817
+ var objIsObj = objTag == objectTag$2, othIsObj = othTag == objectTag$2, isSameTag = objTag == othTag;
818
+ if (isSameTag && isBuffer$1(object)) {
819
+ if (!isBuffer$1(other)) {
849
820
  return false;
850
821
  }
851
822
  objIsArr = true;
852
823
  objIsObj = false;
853
824
  }
854
825
  if (isSameTag && !objIsObj) {
855
- stack || (stack = new Stack$1());
826
+ stack || (stack = new Stack$2());
856
827
  return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
857
828
  }
858
829
  if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
859
- var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$2.call(other, "__wrapped__");
830
+ var objIsWrapped = objIsObj && hasOwnProperty$4.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$4.call(other, "__wrapped__");
860
831
  if (objIsWrapped || othIsWrapped) {
861
832
  var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
862
- stack || (stack = new Stack$1());
833
+ stack || (stack = new Stack$2());
863
834
  return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
864
835
  }
865
836
  }
866
837
  if (!isSameTag) {
867
838
  return false;
868
839
  }
869
- stack || (stack = new Stack$1());
840
+ stack || (stack = new Stack$2());
870
841
  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
871
842
  }
872
843
  var _baseIsEqualDeep = baseIsEqualDeep$1;
873
- var baseIsEqualDeep = _baseIsEqualDeep, isObjectLike$1 = isObjectLike_1;
844
+ var baseIsEqualDeep = _baseIsEqualDeep, isObjectLike$4 = isObjectLike_1;
874
845
  function baseIsEqual$3(value, other, bitmask, customizer, stack) {
875
846
  if (value === other) {
876
847
  return true;
877
848
  }
878
- if (value == null || other == null || !isObjectLike$1(value) && !isObjectLike$1(other)) {
849
+ if (value == null || other == null || !isObjectLike$4(value) && !isObjectLike$4(other)) {
879
850
  return value !== value && other !== other;
880
851
  }
881
852
  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$3, stack);
882
853
  }
883
854
  var _baseIsEqual = baseIsEqual$3;
884
- var Stack = _Stack, baseIsEqual$2 = _baseIsEqual;
855
+ var Stack$1 = _Stack, baseIsEqual$2 = _baseIsEqual;
885
856
  var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
886
857
  function baseIsMatch$1(object, source, matchData, customizer) {
887
858
  var index = matchData.length, length = index, noCustomizer = !customizer;
@@ -903,7 +874,7 @@ function baseIsMatch$1(object, source, matchData, customizer) {
903
874
  return false;
904
875
  }
905
876
  } else {
906
- var stack = new Stack();
877
+ var stack = new Stack$1();
907
878
  if (customizer) {
908
879
  var result = customizer(objValue, srcValue, key, object, source, stack);
909
880
  }
@@ -915,14 +886,14 @@ function baseIsMatch$1(object, source, matchData, customizer) {
915
886
  return true;
916
887
  }
917
888
  var _baseIsMatch = baseIsMatch$1;
918
- var isObject$2 = isObject_1;
889
+ var isObject$4 = isObject_1;
919
890
  function isStrictComparable$2(value) {
920
- return value === value && !isObject$2(value);
891
+ return value === value && !isObject$4(value);
921
892
  }
922
893
  var _isStrictComparable = isStrictComparable$2;
923
- var isStrictComparable$1 = _isStrictComparable, keys = keys_1;
894
+ var isStrictComparable$1 = _isStrictComparable, keys$2 = keys_1;
924
895
  function getMatchData$1(object) {
925
- var result = keys(object), length = result.length;
896
+ var result = keys$2(object), length = result.length;
926
897
  while (length--) {
927
898
  var key = result[length], value = object[key];
928
899
  result[length] = [key, value, isStrictComparable$1(value)];
@@ -950,16 +921,16 @@ function baseMatches$1(source) {
950
921
  };
951
922
  }
952
923
  var _baseMatches = baseMatches$1;
953
- var baseGetTag = _baseGetTag, isObjectLike = isObjectLike_1;
954
- var symbolTag = "[object Symbol]";
924
+ var baseGetTag$1 = _baseGetTag, isObjectLike$3 = isObjectLike_1;
925
+ var symbolTag$2 = "[object Symbol]";
955
926
  function isSymbol$3(value) {
956
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
927
+ return typeof value == "symbol" || isObjectLike$3(value) && baseGetTag$1(value) == symbolTag$2;
957
928
  }
958
929
  var isSymbol_1 = isSymbol$3;
959
- var isArray$4 = isArray_1, isSymbol$2 = isSymbol_1;
930
+ var isArray$6 = isArray_1, isSymbol$2 = isSymbol_1;
960
931
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
961
932
  function isKey$3(value, object) {
962
- if (isArray$4(value)) {
933
+ if (isArray$6(value)) {
963
934
  return false;
964
935
  }
965
936
  var type = typeof value;
@@ -1016,23 +987,23 @@ var stringToPath$1 = memoizeCapped(function(string) {
1016
987
  return result;
1017
988
  });
1018
989
  var _stringToPath = stringToPath$1;
1019
- function arrayMap$2(array, iteratee) {
990
+ function arrayMap$3(array, iteratee) {
1020
991
  var index = -1, length = array == null ? 0 : array.length, result = Array(length);
1021
992
  while (++index < length) {
1022
993
  result[index] = iteratee(array[index], index, array);
1023
994
  }
1024
995
  return result;
1025
996
  }
1026
- var _arrayMap = arrayMap$2;
1027
- var Symbol$1 = _Symbol, arrayMap$1 = _arrayMap, isArray$3 = isArray_1, isSymbol$1 = isSymbol_1;
997
+ var _arrayMap = arrayMap$3;
998
+ var Symbol$3 = _Symbol, arrayMap$2 = _arrayMap, isArray$5 = isArray_1, isSymbol$1 = isSymbol_1;
1028
999
  var INFINITY$2 = 1 / 0;
1029
- var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
1000
+ var symbolProto$1 = Symbol$3 ? Symbol$3.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
1030
1001
  function baseToString$1(value) {
1031
1002
  if (typeof value == "string") {
1032
1003
  return value;
1033
1004
  }
1034
- if (isArray$3(value)) {
1035
- return arrayMap$1(value, baseToString$1) + "";
1005
+ if (isArray$5(value)) {
1006
+ return arrayMap$2(value, baseToString$1) + "";
1036
1007
  }
1037
1008
  if (isSymbol$1(value)) {
1038
1009
  return symbolToString ? symbolToString.call(value) : "";
@@ -1046,37 +1017,37 @@ function toString$1(value) {
1046
1017
  return value == null ? "" : baseToString(value);
1047
1018
  }
1048
1019
  var toString_1 = toString$1;
1049
- var isArray$2 = isArray_1, isKey$2 = _isKey, stringToPath = _stringToPath, toString = toString_1;
1050
- function castPath$4(value, object) {
1051
- if (isArray$2(value)) {
1020
+ var isArray$4 = isArray_1, isKey$2 = _isKey, stringToPath = _stringToPath, toString = toString_1;
1021
+ function castPath$6(value, object) {
1022
+ if (isArray$4(value)) {
1052
1023
  return value;
1053
1024
  }
1054
1025
  return isKey$2(value, object) ? [value] : stringToPath(toString(value));
1055
1026
  }
1056
- var _castPath = castPath$4;
1027
+ var _castPath = castPath$6;
1057
1028
  var isSymbol = isSymbol_1;
1058
1029
  var INFINITY$1 = 1 / 0;
1059
- function toKey$5(value) {
1030
+ function toKey$6(value) {
1060
1031
  if (typeof value == "string" || isSymbol(value)) {
1061
1032
  return value;
1062
1033
  }
1063
1034
  var result = value + "";
1064
1035
  return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
1065
1036
  }
1066
- var _toKey = toKey$5;
1067
- var castPath$3 = _castPath, toKey$4 = _toKey;
1068
- function baseGet$3(object, path) {
1069
- path = castPath$3(path, object);
1037
+ var _toKey = toKey$6;
1038
+ var castPath$5 = _castPath, toKey$5 = _toKey;
1039
+ function baseGet$4(object, path) {
1040
+ path = castPath$5(path, object);
1070
1041
  var index = 0, length = path.length;
1071
1042
  while (object != null && index < length) {
1072
- object = object[toKey$4(path[index++])];
1043
+ object = object[toKey$5(path[index++])];
1073
1044
  }
1074
1045
  return index && index == length ? object : void 0;
1075
1046
  }
1076
- var _baseGet = baseGet$3;
1077
- var baseGet$2 = _baseGet;
1047
+ var _baseGet = baseGet$4;
1048
+ var baseGet$3 = _baseGet;
1078
1049
  function get$1(object, path, defaultValue) {
1079
- var result = object == null ? void 0 : baseGet$2(object, path);
1050
+ var result = object == null ? void 0 : baseGet$3(object, path);
1080
1051
  return result === void 0 ? defaultValue : result;
1081
1052
  }
1082
1053
  var get_1 = get$1;
@@ -1084,12 +1055,12 @@ function baseHasIn$1(object, key) {
1084
1055
  return object != null && key in Object(object);
1085
1056
  }
1086
1057
  var _baseHasIn = baseHasIn$1;
1087
- var castPath$2 = _castPath, isArguments = isArguments_1, isArray$1 = isArray_1, isIndex$1 = _isIndex, isLength = isLength_1, toKey$3 = _toKey;
1058
+ var castPath$4 = _castPath, isArguments$1 = isArguments_1, isArray$3 = isArray_1, isIndex$1 = _isIndex, isLength = isLength_1, toKey$4 = _toKey;
1088
1059
  function hasPath$1(object, path, hasFunc) {
1089
- path = castPath$2(path, object);
1060
+ path = castPath$4(path, object);
1090
1061
  var index = -1, length = path.length, result = false;
1091
1062
  while (++index < length) {
1092
- var key = toKey$3(path[index]);
1063
+ var key = toKey$4(path[index]);
1093
1064
  if (!(result = object != null && hasFunc(object, key))) {
1094
1065
  break;
1095
1066
  }
@@ -1099,7 +1070,7 @@ function hasPath$1(object, path, hasFunc) {
1099
1070
  return result;
1100
1071
  }
1101
1072
  length = object == null ? 0 : object.length;
1102
- return !!length && isLength(length) && isIndex$1(key, length) && (isArray$1(object) || isArguments(object));
1073
+ return !!length && isLength(length) && isIndex$1(key, length) && (isArray$3(object) || isArguments$1(object));
1103
1074
  }
1104
1075
  var _hasPath = hasPath$1;
1105
1076
  var baseHasIn = _baseHasIn, hasPath = _hasPath;
@@ -1107,11 +1078,11 @@ function hasIn$1(object, path) {
1107
1078
  return object != null && hasPath(object, path, baseHasIn);
1108
1079
  }
1109
1080
  var hasIn_1 = hasIn$1;
1110
- var baseIsEqual$1 = _baseIsEqual, get = get_1, hasIn = hasIn_1, isKey$1 = _isKey, isStrictComparable = _isStrictComparable, matchesStrictComparable = _matchesStrictComparable, toKey$2 = _toKey;
1081
+ var baseIsEqual$1 = _baseIsEqual, get = get_1, hasIn = hasIn_1, isKey$1 = _isKey, isStrictComparable = _isStrictComparable, matchesStrictComparable = _matchesStrictComparable, toKey$3 = _toKey;
1111
1082
  var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
1112
1083
  function baseMatchesProperty$1(path, srcValue) {
1113
1084
  if (isKey$1(path) && isStrictComparable(srcValue)) {
1114
- return matchesStrictComparable(toKey$2(path), srcValue);
1085
+ return matchesStrictComparable(toKey$3(path), srcValue);
1115
1086
  }
1116
1087
  return function(object) {
1117
1088
  var objValue = get(object, path);
@@ -1119,38 +1090,38 @@ function baseMatchesProperty$1(path, srcValue) {
1119
1090
  };
1120
1091
  }
1121
1092
  var _baseMatchesProperty = baseMatchesProperty$1;
1122
- function identity$1(value) {
1093
+ function identity$2(value) {
1123
1094
  return value;
1124
1095
  }
1125
- var identity_1 = identity$1;
1096
+ var identity_1 = identity$2;
1126
1097
  function baseProperty$1(key) {
1127
1098
  return function(object) {
1128
1099
  return object == null ? void 0 : object[key];
1129
1100
  };
1130
1101
  }
1131
1102
  var _baseProperty = baseProperty$1;
1132
- var baseGet$1 = _baseGet;
1103
+ var baseGet$2 = _baseGet;
1133
1104
  function basePropertyDeep$1(path) {
1134
1105
  return function(object) {
1135
- return baseGet$1(object, path);
1106
+ return baseGet$2(object, path);
1136
1107
  };
1137
1108
  }
1138
1109
  var _basePropertyDeep = basePropertyDeep$1;
1139
- var baseProperty = _baseProperty, basePropertyDeep = _basePropertyDeep, isKey = _isKey, toKey$1 = _toKey;
1110
+ var baseProperty = _baseProperty, basePropertyDeep = _basePropertyDeep, isKey = _isKey, toKey$2 = _toKey;
1140
1111
  function property$1(path) {
1141
- return isKey(path) ? baseProperty(toKey$1(path)) : basePropertyDeep(path);
1112
+ return isKey(path) ? baseProperty(toKey$2(path)) : basePropertyDeep(path);
1142
1113
  }
1143
1114
  var property_1 = property$1;
1144
- var baseMatches = _baseMatches, baseMatchesProperty = _baseMatchesProperty, identity = identity_1, isArray = isArray_1, property = property_1;
1115
+ var baseMatches = _baseMatches, baseMatchesProperty = _baseMatchesProperty, identity$1 = identity_1, isArray$2 = isArray_1, property = property_1;
1145
1116
  function baseIteratee$2(value) {
1146
1117
  if (typeof value == "function") {
1147
1118
  return value;
1148
1119
  }
1149
1120
  if (value == null) {
1150
- return identity;
1121
+ return identity$1;
1151
1122
  }
1152
1123
  if (typeof value == "object") {
1153
- return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
1124
+ return isArray$2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
1154
1125
  }
1155
1126
  return property(value);
1156
1127
  }
@@ -1177,7 +1148,7 @@ function negate$1(predicate) {
1177
1148
  }
1178
1149
  var negate_1 = negate$1;
1179
1150
  var getNative = _getNative;
1180
- var defineProperty$1 = function() {
1151
+ var defineProperty$2 = function() {
1181
1152
  try {
1182
1153
  var func = getNative(Object, "defineProperty");
1183
1154
  func({}, "", {});
@@ -1185,11 +1156,11 @@ var defineProperty$1 = function() {
1185
1156
  } catch (e2) {
1186
1157
  }
1187
1158
  }();
1188
- var _defineProperty = defineProperty$1;
1189
- var defineProperty = _defineProperty;
1190
- function baseAssignValue$1(object, key, value) {
1191
- if (key == "__proto__" && defineProperty) {
1192
- defineProperty(object, key, {
1159
+ var _defineProperty = defineProperty$2;
1160
+ var defineProperty$1 = _defineProperty;
1161
+ function baseAssignValue$2(object, key, value) {
1162
+ if (key == "__proto__" && defineProperty$1) {
1163
+ defineProperty$1(object, key, {
1193
1164
  "configurable": true,
1194
1165
  "enumerable": true,
1195
1166
  "value": value,
@@ -1199,26 +1170,26 @@ function baseAssignValue$1(object, key, value) {
1199
1170
  object[key] = value;
1200
1171
  }
1201
1172
  }
1202
- var _baseAssignValue = baseAssignValue$1;
1203
- var baseAssignValue = _baseAssignValue, eq = eq_1;
1204
- var objectProto$1 = Object.prototype;
1205
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1206
- function assignValue$1(object, key, value) {
1173
+ var _baseAssignValue = baseAssignValue$2;
1174
+ var baseAssignValue$1 = _baseAssignValue, eq = eq_1;
1175
+ var objectProto$3 = Object.prototype;
1176
+ var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
1177
+ function assignValue$3(object, key, value) {
1207
1178
  var objValue = object[key];
1208
- if (!(hasOwnProperty$1.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
1209
- baseAssignValue(object, key, value);
1179
+ if (!(hasOwnProperty$3.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
1180
+ baseAssignValue$1(object, key, value);
1210
1181
  }
1211
1182
  }
1212
- var _assignValue = assignValue$1;
1213
- var assignValue = _assignValue, castPath$1 = _castPath, isIndex = _isIndex, isObject$1 = isObject_1, toKey = _toKey;
1183
+ var _assignValue = assignValue$3;
1184
+ var assignValue$2 = _assignValue, castPath$3 = _castPath, isIndex = _isIndex, isObject$3 = isObject_1, toKey$1 = _toKey;
1214
1185
  function baseSet$2(object, path, value, customizer) {
1215
- if (!isObject$1(object)) {
1186
+ if (!isObject$3(object)) {
1216
1187
  return object;
1217
1188
  }
1218
- path = castPath$1(path, object);
1189
+ path = castPath$3(path, object);
1219
1190
  var index = -1, length = path.length, lastIndex = length - 1, nested = object;
1220
1191
  while (nested != null && ++index < length) {
1221
- var key = toKey(path[index]), newValue = value;
1192
+ var key = toKey$1(path[index]), newValue = value;
1222
1193
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
1223
1194
  return object;
1224
1195
  }
@@ -1226,41 +1197,41 @@ function baseSet$2(object, path, value, customizer) {
1226
1197
  var objValue = nested[key];
1227
1198
  newValue = customizer ? customizer(objValue, key, nested) : void 0;
1228
1199
  if (newValue === void 0) {
1229
- newValue = isObject$1(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1200
+ newValue = isObject$3(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1230
1201
  }
1231
1202
  }
1232
- assignValue(nested, key, newValue);
1203
+ assignValue$2(nested, key, newValue);
1233
1204
  nested = nested[key];
1234
1205
  }
1235
1206
  return object;
1236
1207
  }
1237
1208
  var _baseSet = baseSet$2;
1238
- var baseGet = _baseGet, baseSet$1 = _baseSet, castPath = _castPath;
1209
+ var baseGet$1 = _baseGet, baseSet$1 = _baseSet, castPath$2 = _castPath;
1239
1210
  function basePickBy$1(object, paths, predicate) {
1240
1211
  var index = -1, length = paths.length, result = {};
1241
1212
  while (++index < length) {
1242
- var path = paths[index], value = baseGet(object, path);
1213
+ var path = paths[index], value = baseGet$1(object, path);
1243
1214
  if (predicate(value, path)) {
1244
- baseSet$1(result, castPath(path, object), value);
1215
+ baseSet$1(result, castPath$2(path, object), value);
1245
1216
  }
1246
1217
  }
1247
1218
  return result;
1248
1219
  }
1249
1220
  var _basePickBy = basePickBy$1;
1250
1221
  var overArg = _overArg;
1251
- var getPrototype$1 = overArg(Object.getPrototypeOf, Object);
1252
- var _getPrototype = getPrototype$1;
1253
- var arrayPush = _arrayPush, getPrototype = _getPrototype, getSymbols = _getSymbols, stubArray = stubArray_1;
1222
+ var getPrototype$3 = overArg(Object.getPrototypeOf, Object);
1223
+ var _getPrototype = getPrototype$3;
1224
+ var arrayPush$1 = _arrayPush, getPrototype$2 = _getPrototype, getSymbols$1 = _getSymbols, stubArray = stubArray_1;
1254
1225
  var nativeGetSymbols = Object.getOwnPropertySymbols;
1255
- var getSymbolsIn$1 = !nativeGetSymbols ? stubArray : function(object) {
1226
+ var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
1256
1227
  var result = [];
1257
1228
  while (object) {
1258
- arrayPush(result, getSymbols(object));
1259
- object = getPrototype(object);
1229
+ arrayPush$1(result, getSymbols$1(object));
1230
+ object = getPrototype$2(object);
1260
1231
  }
1261
1232
  return result;
1262
1233
  };
1263
- var _getSymbolsIn = getSymbolsIn$1;
1234
+ var _getSymbolsIn = getSymbolsIn$2;
1264
1235
  function nativeKeysIn$1(object) {
1265
1236
  var result = [];
1266
1237
  if (object != null) {
@@ -1271,16 +1242,16 @@ function nativeKeysIn$1(object) {
1271
1242
  return result;
1272
1243
  }
1273
1244
  var _nativeKeysIn = nativeKeysIn$1;
1274
- var isObject = isObject_1, isPrototype = _isPrototype, nativeKeysIn = _nativeKeysIn;
1275
- var objectProto = Object.prototype;
1276
- var hasOwnProperty = objectProto.hasOwnProperty;
1245
+ var isObject$2 = isObject_1, isPrototype$1 = _isPrototype, nativeKeysIn = _nativeKeysIn;
1246
+ var objectProto$2 = Object.prototype;
1247
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
1277
1248
  function baseKeysIn$1(object) {
1278
- if (!isObject(object)) {
1249
+ if (!isObject$2(object)) {
1279
1250
  return nativeKeysIn(object);
1280
1251
  }
1281
- var isProto = isPrototype(object), result = [];
1252
+ var isProto = isPrototype$1(object), result = [];
1282
1253
  for (var key in object) {
1283
- if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
1254
+ if (!(key == "constructor" && (isProto || !hasOwnProperty$2.call(object, key)))) {
1284
1255
  result.push(key);
1285
1256
  }
1286
1257
  }
@@ -1288,21 +1259,21 @@ function baseKeysIn$1(object) {
1288
1259
  }
1289
1260
  var _baseKeysIn = baseKeysIn$1;
1290
1261
  var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
1291
- function keysIn$1(object) {
1262
+ function keysIn$3(object) {
1292
1263
  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1293
1264
  }
1294
- var keysIn_1 = keysIn$1;
1295
- var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn = keysIn_1;
1296
- function getAllKeysIn$1(object) {
1297
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
1265
+ var keysIn_1 = keysIn$3;
1266
+ var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn$1 = _getSymbolsIn, keysIn$2 = keysIn_1;
1267
+ function getAllKeysIn$3(object) {
1268
+ return baseGetAllKeys(object, keysIn$2, getSymbolsIn$1);
1298
1269
  }
1299
- var _getAllKeysIn = getAllKeysIn$1;
1300
- var arrayMap = _arrayMap, baseIteratee$1 = _baseIteratee, basePickBy = _basePickBy, getAllKeysIn = _getAllKeysIn;
1270
+ var _getAllKeysIn = getAllKeysIn$3;
1271
+ var arrayMap$1 = _arrayMap, baseIteratee$1 = _baseIteratee, basePickBy = _basePickBy, getAllKeysIn$2 = _getAllKeysIn;
1301
1272
  function pickBy$1(object, predicate) {
1302
1273
  if (object == null) {
1303
1274
  return {};
1304
1275
  }
1305
- var props = arrayMap(getAllKeysIn(object), function(prop) {
1276
+ var props = arrayMap$1(getAllKeysIn$2(object), function(prop) {
1306
1277
  return [prop];
1307
1278
  });
1308
1279
  predicate = baseIteratee$1(predicate);
@@ -1345,10 +1316,14 @@ const createGetInputProps = ({
1345
1316
  validationBehavior,
1346
1317
  name
1347
1318
  }) => {
1348
- const validationBehaviors = __spreadValues(__spreadValues({}, defaultValidationBehavior), validationBehavior);
1319
+ const validationBehaviors = {
1320
+ ...defaultValidationBehavior,
1321
+ ...validationBehavior
1322
+ };
1349
1323
  return (props = {}) => {
1350
1324
  const behavior = hasBeenSubmitted ? validationBehaviors.whenSubmitted : touched ? validationBehaviors.whenTouched : validationBehaviors.initial;
1351
- const inputProps = __spreadProps(__spreadValues({}, props), {
1325
+ const inputProps = {
1326
+ ...props,
1352
1327
  onChange: (...args) => {
1353
1328
  var _a;
1354
1329
  if (behavior === "onChange")
@@ -1365,7 +1340,7 @@ const createGetInputProps = ({
1365
1340
  return (_a = props == null ? void 0 : props.onBlur) == null ? void 0 : _a.call(props, ...args);
1366
1341
  },
1367
1342
  name
1368
- });
1343
+ };
1369
1344
  if (props.type === "checkbox") {
1370
1345
  inputProps.defaultChecked = getCheckboxChecked(props.value, defaultValue);
1371
1346
  } else if (props.type === "radio") {
@@ -1449,9 +1424,9 @@ var useSyncExternalStoreShim_production_min = {};
1449
1424
  */
1450
1425
  var e = React;
1451
1426
  function h$2(a2, b2) {
1452
- return a2 === b2 && (a2 !== 0 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
1427
+ return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
1453
1428
  }
1454
- var k$1 = typeof Object.is === "function" ? Object.is : h$2, l$1 = e.useState, m = e.useEffect, n$2 = e.useLayoutEffect, p$2 = e.useDebugValue;
1429
+ var k$1 = "function" === typeof Object.is ? Object.is : h$2, l$1 = e.useState, m = e.useEffect, n$2 = e.useLayoutEffect, p$2 = e.useDebugValue;
1455
1430
  function q$2(a2, b2) {
1456
1431
  var d2 = b2(), f2 = l$1({ inst: { value: d2, getSnapshot: b2 } }), c2 = f2[0].inst, g2 = f2[1];
1457
1432
  n$2(function() {
@@ -1481,8 +1456,8 @@ function r$2(a2) {
1481
1456
  function t$2(a2, b2) {
1482
1457
  return b2();
1483
1458
  }
1484
- var u$2 = typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined" ? t$2 : q$2;
1485
- useSyncExternalStoreShim_production_min.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u$2;
1459
+ var u$2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t$2 : q$2;
1460
+ useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u$2;
1486
1461
  {
1487
1462
  shim.exports = useSyncExternalStoreShim_production_min;
1488
1463
  }
@@ -1497,12 +1472,12 @@ useSyncExternalStoreShim_production_min.useSyncExternalStore = e.useSyncExternal
1497
1472
  */
1498
1473
  var h$1 = React, n$1 = shim.exports;
1499
1474
  function p$1(a2, b2) {
1500
- return a2 === b2 && (a2 !== 0 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
1475
+ return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
1501
1476
  }
1502
- var q$1 = typeof Object.is === "function" ? Object.is : p$1, r$1 = n$1.useSyncExternalStore, t$1 = h$1.useRef, u$1 = h$1.useEffect, v$1 = h$1.useMemo, w$1 = h$1.useDebugValue;
1477
+ var q$1 = "function" === typeof Object.is ? Object.is : p$1, r$1 = n$1.useSyncExternalStore, t$1 = h$1.useRef, u$1 = h$1.useEffect, v$1 = h$1.useMemo, w$1 = h$1.useDebugValue;
1503
1478
  withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b2, e2, l2, g2) {
1504
1479
  var c2 = t$1(null);
1505
- if (c2.current === null) {
1480
+ if (null === c2.current) {
1506
1481
  var f2 = { hasValue: false, value: null };
1507
1482
  c2.current = f2;
1508
1483
  } else
@@ -1513,7 +1488,7 @@ withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b2,
1513
1488
  c3 = true;
1514
1489
  d3 = a4;
1515
1490
  a4 = l2(a4);
1516
- if (g2 !== void 0 && f2.hasValue) {
1491
+ if (void 0 !== g2 && f2.hasValue) {
1517
1492
  var b3 = f2.value;
1518
1493
  if (g2(b3, a4))
1519
1494
  return k2 = b3;
@@ -1524,15 +1499,15 @@ withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b2,
1524
1499
  if (q$1(d3, a4))
1525
1500
  return b3;
1526
1501
  var e3 = l2(a4);
1527
- if (g2 !== void 0 && g2(b3, e3))
1502
+ if (void 0 !== g2 && g2(b3, e3))
1528
1503
  return b3;
1529
1504
  d3 = a4;
1530
1505
  return k2 = e3;
1531
1506
  }
1532
- var c3 = false, d3, k2, m2 = e2 === void 0 ? null : e2;
1507
+ var c3 = false, d3, k2, m2 = void 0 === e2 ? null : e2;
1533
1508
  return [function() {
1534
1509
  return a3(b2());
1535
- }, m2 === null ? void 0 : function() {
1510
+ }, null === m2 ? void 0 : function() {
1536
1511
  return a3(m2());
1537
1512
  }];
1538
1513
  }, [b2, e2, l2, g2]);
@@ -1572,18 +1547,18 @@ function r(n2) {
1572
1547
  }
1573
1548
  function t(n2) {
1574
1549
  return !!n2 && (function(n3) {
1575
- if (!n3 || typeof n3 != "object")
1550
+ if (!n3 || "object" != typeof n3)
1576
1551
  return false;
1577
1552
  var r2 = Object.getPrototypeOf(n3);
1578
- if (r2 === null)
1553
+ if (null === r2)
1579
1554
  return true;
1580
1555
  var t2 = Object.hasOwnProperty.call(r2, "constructor") && r2.constructor;
1581
- return t2 === Object || typeof t2 == "function" && Function.toString.call(t2) === Z;
1556
+ return t2 === Object || "function" == typeof t2 && Function.toString.call(t2) === Z;
1582
1557
  }(n2) || Array.isArray(n2) || !!n2[L] || !!n2.constructor[L] || s(n2) || v(n2));
1583
1558
  }
1584
1559
  function i(n2, r2, t2) {
1585
- t2 === void 0 && (t2 = false), o(n2) === 0 ? (t2 ? Object.keys : nn)(n2).forEach(function(e2) {
1586
- t2 && typeof e2 == "symbol" || r2(e2, n2[e2], n2);
1560
+ void 0 === t2 && (t2 = false), 0 === o(n2) ? (t2 ? Object.keys : nn)(n2).forEach(function(e2) {
1561
+ t2 && "symbol" == typeof e2 || r2(e2, n2[e2], n2);
1587
1562
  }) : n2.forEach(function(t3, e2) {
1588
1563
  return r2(e2, t3, n2);
1589
1564
  });
@@ -1593,17 +1568,17 @@ function o(n2) {
1593
1568
  return r2 ? r2.i > 3 ? r2.i - 4 : r2.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v(n2) ? 3 : 0;
1594
1569
  }
1595
1570
  function u(n2, r2) {
1596
- return o(n2) === 2 ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2);
1571
+ return 2 === o(n2) ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2);
1597
1572
  }
1598
1573
  function a(n2, r2) {
1599
- return o(n2) === 2 ? n2.get(r2) : n2[r2];
1574
+ return 2 === o(n2) ? n2.get(r2) : n2[r2];
1600
1575
  }
1601
1576
  function f(n2, r2, t2) {
1602
1577
  var e2 = o(n2);
1603
- e2 === 2 ? n2.set(r2, t2) : e2 === 3 ? (n2.delete(r2), n2.add(t2)) : n2[r2] = t2;
1578
+ 2 === e2 ? n2.set(r2, t2) : 3 === e2 ? (n2.delete(r2), n2.add(t2)) : n2[r2] = t2;
1604
1579
  }
1605
1580
  function c(n2, r2) {
1606
- return n2 === r2 ? n2 !== 0 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2;
1581
+ return n2 === r2 ? 0 !== n2 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2;
1607
1582
  }
1608
1583
  function s(n2) {
1609
1584
  return X && n2 instanceof Map;
@@ -1621,12 +1596,12 @@ function l(n2) {
1621
1596
  delete r2[Q];
1622
1597
  for (var t2 = nn(r2), e2 = 0; e2 < t2.length; e2++) {
1623
1598
  var i2 = t2[e2], o2 = r2[i2];
1624
- o2.writable === false && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r2[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] });
1599
+ false === o2.writable && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r2[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] });
1625
1600
  }
1626
1601
  return Object.create(Object.getPrototypeOf(n2), r2);
1627
1602
  }
1628
1603
  function d(n2, e2) {
1629
- return e2 === void 0 && (e2 = false), y(n2) || r(n2) || !t(n2) ? n2 : (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h), Object.freeze(n2), e2 && i(n2, function(n3, r2) {
1604
+ return void 0 === e2 && (e2 = false), y(n2) || r(n2) || !t(n2) ? n2 : (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h), Object.freeze(n2), e2 && i(n2, function(n3, r2) {
1630
1605
  return d(r2, true);
1631
1606
  }, true), n2);
1632
1607
  }
@@ -1634,7 +1609,7 @@ function h() {
1634
1609
  n(2);
1635
1610
  }
1636
1611
  function y(n2) {
1637
- return n2 == null || typeof n2 != "object" || Object.isFrozen(n2);
1612
+ return null == n2 || "object" != typeof n2 || Object.isFrozen(n2);
1638
1613
  }
1639
1614
  function b(r2) {
1640
1615
  var t2 = tn[r2];
@@ -1657,11 +1632,11 @@ function w(n2) {
1657
1632
  }
1658
1633
  function S(n2) {
1659
1634
  var r2 = n2[Q];
1660
- r2.i === 0 || r2.i === 1 ? r2.j() : r2.O = true;
1635
+ 0 === r2.i || 1 === r2.i ? r2.j() : r2.O = true;
1661
1636
  }
1662
1637
  function P(r2, e2) {
1663
1638
  e2._ = e2.p.length;
1664
- var i2 = e2.p[0], o2 = r2 !== void 0 && r2 !== i2;
1639
+ var i2 = e2.p[0], o2 = void 0 !== r2 && r2 !== i2;
1665
1640
  return e2.h.g || b("ES5").S(e2, r2, o2), o2 ? (i2[Q].P && (O(e2), n(4)), t(r2) && (r2 = M(e2, r2), e2.l || x(e2, r2)), e2.u && b("Patches").M(i2[Q].t, r2, e2.u, e2.s)) : r2 = M(e2, i2, []), O(e2), e2.u && e2.v(e2.u, e2.s), r2 !== H ? r2 : void 0;
1666
1641
  }
1667
1642
  function M(n2, r2, t2) {
@@ -1678,8 +1653,8 @@ function M(n2, r2, t2) {
1678
1653
  return x(n2, e2.t, true), e2.t;
1679
1654
  if (!e2.I) {
1680
1655
  e2.I = true, e2.A._--;
1681
- var o2 = e2.i === 4 || e2.i === 5 ? e2.o = l(e2.k) : e2.o;
1682
- i(e2.i === 3 ? new Set(o2) : o2, function(r3, i2) {
1656
+ var o2 = 4 === e2.i || 5 === e2.i ? e2.o = l(e2.k) : e2.o;
1657
+ i(3 === e2.i ? new Set(o2) : o2, function(r3, i2) {
1683
1658
  return A(n2, e2, o2, r3, i2, t2);
1684
1659
  }), x(n2, o2, false), t2 && n2.u && b("Patches").R(e2, t2, n2.u, n2.s);
1685
1660
  }
@@ -1687,7 +1662,7 @@ function M(n2, r2, t2) {
1687
1662
  }
1688
1663
  function A(e2, i2, o2, a2, c2, s2) {
1689
1664
  if (r(c2)) {
1690
- var v2 = M(e2, c2, s2 && i2 && i2.i !== 3 && !u(i2.D, a2) ? s2.concat(a2) : void 0);
1665
+ var v2 = M(e2, c2, s2 && i2 && 3 !== i2.i && !u(i2.D, a2) ? s2.concat(a2) : void 0);
1691
1666
  if (f(o2, a2, v2), !r(v2))
1692
1667
  return;
1693
1668
  e2.m = false;
@@ -1699,7 +1674,7 @@ function A(e2, i2, o2, a2, c2, s2) {
1699
1674
  }
1700
1675
  }
1701
1676
  function x(n2, r2, t2) {
1702
- t2 === void 0 && (t2 = false), n2.h.F && n2.m && d(r2, t2);
1677
+ void 0 === t2 && (t2 = false), n2.h.F && n2.m && d(r2, t2);
1703
1678
  }
1704
1679
  function z(n2, r2) {
1705
1680
  var t2 = n2[Q];
@@ -1742,7 +1717,7 @@ function D(e2) {
1742
1717
  e3 = F(r2, c2);
1743
1718
  return i(e3, function(r3, t2) {
1744
1719
  u2 && a(u2.t, r3) === t2 || f(e3, r3, n2(t2));
1745
- }), c2 === 3 ? new Set(e3) : e3;
1720
+ }), 3 === c2 ? new Set(e3) : e3;
1746
1721
  }(e2);
1747
1722
  }
1748
1723
  function F(n2, r2) {
@@ -1754,7 +1729,7 @@ function F(n2, r2) {
1754
1729
  }
1755
1730
  return l(n2);
1756
1731
  }
1757
- var G, U, W = typeof Symbol != "undefined" && typeof Symbol("x") == "symbol", X = typeof Map != "undefined", q = typeof Set != "undefined", B = typeof Proxy != "undefined" && Proxy.revocable !== void 0 && typeof Reflect != "undefined", H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G), L = W ? Symbol.for("immer-draftable") : "__$immer_draftable", Q = W ? Symbol.for("immer-state") : "__$immer_state", Z = "" + Object.prototype.constructor, nn = typeof Reflect != "undefined" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function(n2) {
1732
+ var G, U, W = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x"), X = "undefined" != typeof Map, q = "undefined" != typeof Set, B = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect, H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G), L = W ? Symbol.for("immer-draftable") : "__$immer_draftable", Q = W ? Symbol.for("immer-state") : "__$immer_state", Z = "" + Object.prototype.constructor, nn = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n2) {
1758
1733
  return Object.getOwnPropertyNames(n2).concat(Object.getOwnPropertySymbols(n2));
1759
1734
  } : Object.getOwnPropertyNames, rn = Object.getOwnPropertyDescriptors || function(n2) {
1760
1735
  var r2 = {};
@@ -1768,7 +1743,7 @@ var G, U, W = typeof Symbol != "undefined" && typeof Symbol("x") == "symbol", X
1768
1743
  if (!u(e2, r2))
1769
1744
  return function(n3, r3, t2) {
1770
1745
  var e3, i3 = I(r3, t2);
1771
- return i3 ? "value" in i3 ? i3.value : (e3 = i3.get) === null || e3 === void 0 ? void 0 : e3.call(n3.k) : void 0;
1746
+ return i3 ? "value" in i3 ? i3.value : null === (e3 = i3.get) || void 0 === e3 ? void 0 : e3.call(n3.k) : void 0;
1772
1747
  }(n2, e2, r2);
1773
1748
  var i2 = e2[r2];
1774
1749
  return n2.I || !t(i2) ? i2 : i2 === z(n2.t, r2) ? (E(n2), n2.o[r2] = R(n2.A.h, i2, n2)) : i2;
@@ -1778,22 +1753,22 @@ var G, U, W = typeof Symbol != "undefined" && typeof Symbol("x") == "symbol", X
1778
1753
  return Reflect.ownKeys(p(n2));
1779
1754
  }, set: function(n2, r2, t2) {
1780
1755
  var e2 = I(p(n2), r2);
1781
- if (e2 == null ? void 0 : e2.set)
1756
+ if (null == e2 ? void 0 : e2.set)
1782
1757
  return e2.set.call(n2.k, t2), true;
1783
1758
  if (!n2.P) {
1784
- var i2 = z(p(n2), r2), o2 = i2 == null ? void 0 : i2[Q];
1759
+ var i2 = z(p(n2), r2), o2 = null == i2 ? void 0 : i2[Q];
1785
1760
  if (o2 && o2.t === t2)
1786
1761
  return n2.o[r2] = t2, n2.D[r2] = false, true;
1787
- if (c(t2, i2) && (t2 !== void 0 || u(n2.t, r2)))
1762
+ if (c(t2, i2) && (void 0 !== t2 || u(n2.t, r2)))
1788
1763
  return true;
1789
1764
  E(n2), k(n2);
1790
1765
  }
1791
- return n2.o[r2] === t2 && typeof t2 != "number" && (t2 !== void 0 || r2 in n2.o) || (n2.o[r2] = t2, n2.D[r2] = true, true);
1766
+ return n2.o[r2] === t2 && "number" != typeof t2 && (void 0 !== t2 || r2 in n2.o) || (n2.o[r2] = t2, n2.D[r2] = true, true);
1792
1767
  }, deleteProperty: function(n2, r2) {
1793
- return z(n2.t, r2) !== void 0 || r2 in n2.t ? (n2.D[r2] = false, E(n2), k(n2)) : delete n2.D[r2], n2.o && delete n2.o[r2], true;
1768
+ return void 0 !== z(n2.t, r2) || r2 in n2.t ? (n2.D[r2] = false, E(n2), k(n2)) : delete n2.D[r2], n2.o && delete n2.o[r2], true;
1794
1769
  }, getOwnPropertyDescriptor: function(n2, r2) {
1795
1770
  var t2 = p(n2), e2 = Reflect.getOwnPropertyDescriptor(t2, r2);
1796
- return e2 ? { writable: true, configurable: n2.i !== 1 || r2 !== "length", enumerable: e2.enumerable, value: t2[r2] } : e2;
1771
+ return e2 ? { writable: true, configurable: 1 !== n2.i || "length" !== r2, enumerable: e2.enumerable, value: t2[r2] } : e2;
1797
1772
  }, defineProperty: function() {
1798
1773
  n(11);
1799
1774
  }, getPrototypeOf: function(n2) {
@@ -1814,13 +1789,13 @@ var un = function() {
1814
1789
  function e2(r2) {
1815
1790
  var e3 = this;
1816
1791
  this.g = B, this.F = true, this.produce = function(r3, i3, o2) {
1817
- if (typeof r3 == "function" && typeof i3 != "function") {
1792
+ if ("function" == typeof r3 && "function" != typeof i3) {
1818
1793
  var u2 = i3;
1819
1794
  i3 = r3;
1820
1795
  var a2 = e3;
1821
1796
  return function(n2) {
1822
1797
  var r4 = this;
1823
- n2 === void 0 && (n2 = u2);
1798
+ void 0 === n2 && (n2 = u2);
1824
1799
  for (var t2 = arguments.length, e4 = Array(t2 > 1 ? t2 - 1 : 0), o3 = 1; o3 < t2; o3++)
1825
1800
  e4[o3 - 1] = arguments[o3];
1826
1801
  return a2.produce(n2, function(n3) {
@@ -1830,21 +1805,21 @@ var un = function() {
1830
1805
  };
1831
1806
  }
1832
1807
  var f2;
1833
- if (typeof i3 != "function" && n(6), o2 !== void 0 && typeof o2 != "function" && n(7), t(r3)) {
1808
+ if ("function" != typeof i3 && n(6), void 0 !== o2 && "function" != typeof o2 && n(7), t(r3)) {
1834
1809
  var c2 = w(e3), s2 = R(e3, r3, void 0), v2 = true;
1835
1810
  try {
1836
1811
  f2 = i3(s2), v2 = false;
1837
1812
  } finally {
1838
1813
  v2 ? O(c2) : g(c2);
1839
1814
  }
1840
- return typeof Promise != "undefined" && f2 instanceof Promise ? f2.then(function(n2) {
1815
+ return "undefined" != typeof Promise && f2 instanceof Promise ? f2.then(function(n2) {
1841
1816
  return j(c2, o2), P(n2, c2);
1842
1817
  }, function(n2) {
1843
1818
  throw O(c2), n2;
1844
1819
  }) : (j(c2, o2), P(f2, c2));
1845
1820
  }
1846
- if (!r3 || typeof r3 != "object") {
1847
- if ((f2 = i3(r3)) === void 0 && (f2 = r3), f2 === H && (f2 = void 0), e3.F && d(f2, true), o2) {
1821
+ if (!r3 || "object" != typeof r3) {
1822
+ if (void 0 === (f2 = i3(r3)) && (f2 = r3), f2 === H && (f2 = void 0), e3.F && d(f2, true), o2) {
1848
1823
  var p2 = [], l2 = [];
1849
1824
  b("Patches").M(r3, f2, p2, l2), o2(p2, l2);
1850
1825
  }
@@ -1852,7 +1827,7 @@ var un = function() {
1852
1827
  }
1853
1828
  n(21, r3);
1854
1829
  }, this.produceWithPatches = function(n2, r3) {
1855
- if (typeof n2 == "function")
1830
+ if ("function" == typeof n2)
1856
1831
  return function(r4) {
1857
1832
  for (var t3 = arguments.length, i4 = Array(t3 > 1 ? t3 - 1 : 0), o3 = 1; o3 < t3; o3++)
1858
1833
  i4[o3 - 1] = arguments[o3];
@@ -1863,10 +1838,10 @@ var un = function() {
1863
1838
  var t2, i3, o2 = e3.produce(n2, r3, function(n3, r4) {
1864
1839
  t2 = n3, i3 = r4;
1865
1840
  });
1866
- return typeof Promise != "undefined" && o2 instanceof Promise ? o2.then(function(n3) {
1841
+ return "undefined" != typeof Promise && o2 instanceof Promise ? o2.then(function(n3) {
1867
1842
  return [n3, t2, i3];
1868
1843
  }) : [o2, t2, i3];
1869
- }, typeof (r2 == null ? void 0 : r2.useProxies) == "boolean" && this.setUseProxies(r2.useProxies), typeof (r2 == null ? void 0 : r2.autoFreeze) == "boolean" && this.setAutoFreeze(r2.autoFreeze);
1844
+ }, "boolean" == typeof (null == r2 ? void 0 : r2.useProxies) && this.setUseProxies(r2.useProxies), "boolean" == typeof (null == r2 ? void 0 : r2.autoFreeze) && this.setAutoFreeze(r2.autoFreeze);
1870
1845
  }
1871
1846
  var i2 = e2.prototype;
1872
1847
  return i2.createDraft = function(e3) {
@@ -1885,7 +1860,7 @@ var un = function() {
1885
1860
  var e3;
1886
1861
  for (e3 = t2.length - 1; e3 >= 0; e3--) {
1887
1862
  var i3 = t2[e3];
1888
- if (i3.path.length === 0 && i3.op === "replace") {
1863
+ if (0 === i3.path.length && "replace" === i3.op) {
1889
1864
  n2 = i3.value;
1890
1865
  break;
1891
1866
  }
@@ -1911,6 +1886,45 @@ const immerImpl = (initializer) => (set2, get2, store) => {
1911
1886
  return initializer(store.setState, get2, store);
1912
1887
  };
1913
1888
  const immer = immerImpl;
1889
+ const requestSubmit = (element, submitter) => {
1890
+ if (typeof Object.getPrototypeOf(element).requestSubmit === "function" && true) {
1891
+ element.requestSubmit(submitter);
1892
+ return;
1893
+ }
1894
+ if (submitter) {
1895
+ validateSubmitter(element, submitter);
1896
+ submitter.click();
1897
+ return;
1898
+ }
1899
+ const dummySubmitter = document.createElement("input");
1900
+ dummySubmitter.type = "submit";
1901
+ dummySubmitter.hidden = true;
1902
+ element.appendChild(dummySubmitter);
1903
+ dummySubmitter.click();
1904
+ element.removeChild(dummySubmitter);
1905
+ };
1906
+ function validateSubmitter(element, submitter) {
1907
+ const isHtmlElement = submitter instanceof HTMLElement;
1908
+ if (!isHtmlElement) {
1909
+ raise(TypeError, "parameter 1 is not of type 'HTMLElement'");
1910
+ }
1911
+ const hasSubmitType = "type" in submitter && submitter.type === "submit";
1912
+ if (!hasSubmitType)
1913
+ raise(TypeError, "The specified element is not a submit button");
1914
+ const isForCorrectForm = "form" in submitter && submitter.form === element;
1915
+ if (!isForCorrectForm)
1916
+ raise(
1917
+ DOMException,
1918
+ "The specified element is not owned by this form element",
1919
+ "NotFoundError"
1920
+ );
1921
+ }
1922
+ function raise(errorConstructor, message, name) {
1923
+ throw new errorConstructor(
1924
+ "Failed to execute 'requestSubmit' on 'HTMLFormElement': " + message + ".",
1925
+ name
1926
+ );
1927
+ }
1914
1928
  const getArray = (values, field) => {
1915
1929
  const value = get_1(values, field);
1916
1930
  if (value === void 0 || value === null) {
@@ -1918,7 +1932,10 @@ const getArray = (values, field) => {
1918
1932
  set_1(values, field, newValue);
1919
1933
  return newValue;
1920
1934
  }
1921
- invariant(Array.isArray(value), `FieldArray: defaultValue value for ${field} must be an array, null, or undefined`);
1935
+ invariant(
1936
+ Array.isArray(value),
1937
+ `FieldArray: defaultValue value for ${field} must be an array, null, or undefined`
1938
+ );
1922
1939
  return value;
1923
1940
  };
1924
1941
  const swap = (array, indexA, indexB) => {
@@ -1979,10 +1996,14 @@ const mutateAsArray = (field, obj, mutate) => {
1979
1996
  };
1980
1997
  const getDeepArrayPaths = (obj, basePath = "") => {
1981
1998
  if (Array.isArray(obj)) {
1982
- return obj.flatMap((item, index) => getDeepArrayPaths(item, `${basePath}[${index}]`));
1999
+ return obj.flatMap(
2000
+ (item, index) => getDeepArrayPaths(item, `${basePath}[${index}]`)
2001
+ );
1983
2002
  }
1984
2003
  if (typeof obj === "object") {
1985
- return Object.keys(obj).flatMap((key) => getDeepArrayPaths(obj[key], `${basePath}.${key}`));
2004
+ return Object.keys(obj).flatMap(
2005
+ (key) => getDeepArrayPaths(obj[key], `${basePath}.${key}`)
2006
+ );
1986
2007
  }
1987
2008
  return [basePath];
1988
2009
  };
@@ -2095,11 +2116,20 @@ const createFormState = (set2, get2) => ({
2095
2116
  validateField: async (field) => {
2096
2117
  var _a, _b, _c;
2097
2118
  const formElement = get2().formElement;
2098
- invariant(formElement, "Cannot find reference to form. This is probably a bug in remix-validated-form.");
2119
+ invariant(
2120
+ formElement,
2121
+ "Cannot find reference to form. This is probably a bug in remix-validated-form."
2122
+ );
2099
2123
  const validator = (_a = get2().formProps) == null ? void 0 : _a.validator;
2100
- invariant(validator, "Cannot validator. This is probably a bug in remix-validated-form.");
2124
+ invariant(
2125
+ validator,
2126
+ "Cannot validator. This is probably a bug in remix-validated-form."
2127
+ );
2101
2128
  await ((_c = (_b = get2().controlledFields).awaitValueUpdate) == null ? void 0 : _c.call(_b, field));
2102
- const { error } = await validator.validateField(new FormData(formElement), field);
2129
+ const { error } = await validator.validateField(
2130
+ new FormData(formElement),
2131
+ field
2132
+ );
2103
2133
  if (error) {
2104
2134
  get2().setFieldError(field, error);
2105
2135
  return error;
@@ -2111,9 +2141,15 @@ const createFormState = (set2, get2) => ({
2111
2141
  validate: async () => {
2112
2142
  var _a;
2113
2143
  const formElement = get2().formElement;
2114
- invariant(formElement, "Cannot find reference to form. This is probably a bug in remix-validated-form.");
2144
+ invariant(
2145
+ formElement,
2146
+ "Cannot find reference to form. This is probably a bug in remix-validated-form."
2147
+ );
2115
2148
  const validator = (_a = get2().formProps) == null ? void 0 : _a.validator;
2116
- invariant(validator, "Cannot validator. This is probably a bug in remix-validated-form.");
2149
+ invariant(
2150
+ validator,
2151
+ "Cannot validator. This is probably a bug in remix-validated-form."
2152
+ );
2117
2153
  const result = await validator.validate(new FormData(formElement));
2118
2154
  if (result.error)
2119
2155
  get2().setFieldErrors(result.error.fieldErrors);
@@ -2121,8 +2157,11 @@ const createFormState = (set2, get2) => ({
2121
2157
  },
2122
2158
  submit: () => {
2123
2159
  const formElement = get2().formElement;
2124
- invariant(formElement, "Cannot find reference to form. This is probably a bug in remix-validated-form.");
2125
- formElement.requestSubmit();
2160
+ invariant(
2161
+ formElement,
2162
+ "Cannot find reference to form. This is probably a bug in remix-validated-form."
2163
+ );
2164
+ requestSubmit(formElement);
2126
2165
  },
2127
2166
  getValues: () => {
2128
2167
  var _a;
@@ -2154,10 +2193,20 @@ const createFormState = (set2, get2) => ({
2154
2193
  state.controlledFields.refCounts[fieldName] = current - 1;
2155
2194
  return;
2156
2195
  }
2157
- const isNested = Object.keys(state.controlledFields.refCounts).some((key) => fieldName.startsWith(key) && key !== fieldName);
2196
+ const isNested = Object.keys(state.controlledFields.refCounts).some(
2197
+ (key) => fieldName.startsWith(key) && key !== fieldName
2198
+ );
2158
2199
  if (!isNested) {
2159
- set_1(state.controlledFields.values, fieldName, get_1((_b = state.formProps) == null ? void 0 : _b.defaultValues, fieldName));
2160
- set_1(state.currentDefaultValues, fieldName, get_1((_c = state.formProps) == null ? void 0 : _c.defaultValues, fieldName));
2200
+ set_1(
2201
+ state.controlledFields.values,
2202
+ fieldName,
2203
+ get_1((_b = state.formProps) == null ? void 0 : _b.defaultValues, fieldName)
2204
+ );
2205
+ set_1(
2206
+ state.currentDefaultValues,
2207
+ fieldName,
2208
+ get_1((_c = state.formProps) == null ? void 0 : _c.defaultValues, fieldName)
2209
+ );
2161
2210
  }
2162
2211
  delete state.controlledFields.refCounts[fieldName];
2163
2212
  });
@@ -2194,37 +2243,99 @@ const createFormState = (set2, get2) => ({
2194
2243
  },
2195
2244
  swap: (fieldName, indexA, indexB) => {
2196
2245
  set2((state) => {
2197
- swap(getArray(state.controlledFields.values, fieldName), indexA, indexB);
2198
- swap(getArray(state.currentDefaultValues, fieldName), indexA, indexB);
2199
- mutateAsArray(fieldName, state.touchedFields, (array) => swap(array, indexA, indexB));
2200
- mutateAsArray(fieldName, state.fieldErrors, (array) => swap(array, indexA, indexB));
2246
+ swap(
2247
+ getArray(state.controlledFields.values, fieldName),
2248
+ indexA,
2249
+ indexB
2250
+ );
2251
+ swap(
2252
+ getArray(state.currentDefaultValues, fieldName),
2253
+ indexA,
2254
+ indexB
2255
+ );
2256
+ mutateAsArray(
2257
+ fieldName,
2258
+ state.touchedFields,
2259
+ (array) => swap(array, indexA, indexB)
2260
+ );
2261
+ mutateAsArray(
2262
+ fieldName,
2263
+ state.fieldErrors,
2264
+ (array) => swap(array, indexA, indexB)
2265
+ );
2201
2266
  });
2202
2267
  get2().controlledFields.kickoffValueUpdate(fieldName);
2203
2268
  },
2204
2269
  move: (fieldName, from2, to) => {
2205
2270
  set2((state) => {
2206
- move(getArray(state.controlledFields.values, fieldName), from2, to);
2207
- move(getArray(state.currentDefaultValues, fieldName), from2, to);
2208
- mutateAsArray(fieldName, state.touchedFields, (array) => move(array, from2, to));
2209
- mutateAsArray(fieldName, state.fieldErrors, (array) => move(array, from2, to));
2271
+ move(
2272
+ getArray(state.controlledFields.values, fieldName),
2273
+ from2,
2274
+ to
2275
+ );
2276
+ move(
2277
+ getArray(state.currentDefaultValues, fieldName),
2278
+ from2,
2279
+ to
2280
+ );
2281
+ mutateAsArray(
2282
+ fieldName,
2283
+ state.touchedFields,
2284
+ (array) => move(array, from2, to)
2285
+ );
2286
+ mutateAsArray(
2287
+ fieldName,
2288
+ state.fieldErrors,
2289
+ (array) => move(array, from2, to)
2290
+ );
2210
2291
  });
2211
2292
  get2().controlledFields.kickoffValueUpdate(fieldName);
2212
2293
  },
2213
2294
  insert: (fieldName, index, item) => {
2214
2295
  set2((state) => {
2215
- insert(getArray(state.controlledFields.values, fieldName), index, item);
2216
- insert(getArray(state.currentDefaultValues, fieldName), index, item);
2217
- mutateAsArray(fieldName, state.touchedFields, (array) => insert(array, index, false));
2218
- mutateAsArray(fieldName, state.fieldErrors, (array) => insert(array, index, void 0));
2296
+ insert(
2297
+ getArray(state.controlledFields.values, fieldName),
2298
+ index,
2299
+ item
2300
+ );
2301
+ insert(
2302
+ getArray(state.currentDefaultValues, fieldName),
2303
+ index,
2304
+ item
2305
+ );
2306
+ mutateAsArray(
2307
+ fieldName,
2308
+ state.touchedFields,
2309
+ (array) => insert(array, index, false)
2310
+ );
2311
+ mutateAsArray(
2312
+ fieldName,
2313
+ state.fieldErrors,
2314
+ (array) => insert(array, index, void 0)
2315
+ );
2219
2316
  });
2220
2317
  get2().controlledFields.kickoffValueUpdate(fieldName);
2221
2318
  },
2222
2319
  remove: (fieldName, index) => {
2223
2320
  set2((state) => {
2224
- remove(getArray(state.controlledFields.values, fieldName), index);
2225
- remove(getArray(state.currentDefaultValues, fieldName), index);
2226
- mutateAsArray(fieldName, state.touchedFields, (array) => remove(array, index));
2227
- mutateAsArray(fieldName, state.fieldErrors, (array) => remove(array, index));
2321
+ remove(
2322
+ getArray(state.controlledFields.values, fieldName),
2323
+ index
2324
+ );
2325
+ remove(
2326
+ getArray(state.currentDefaultValues, fieldName),
2327
+ index
2328
+ );
2329
+ mutateAsArray(
2330
+ fieldName,
2331
+ state.touchedFields,
2332
+ (array) => remove(array, index)
2333
+ );
2334
+ mutateAsArray(
2335
+ fieldName,
2336
+ state.fieldErrors,
2337
+ (array) => remove(array, index)
2338
+ );
2228
2339
  });
2229
2340
  get2().controlledFields.kickoffValueUpdate(fieldName);
2230
2341
  },
@@ -2232,8 +2343,16 @@ const createFormState = (set2, get2) => ({
2232
2343
  set2((state) => {
2233
2344
  getArray(state.controlledFields.values, fieldName).pop();
2234
2345
  getArray(state.currentDefaultValues, fieldName).pop();
2235
- mutateAsArray(fieldName, state.touchedFields, (array) => array.pop());
2236
- mutateAsArray(fieldName, state.fieldErrors, (array) => array.pop());
2346
+ mutateAsArray(
2347
+ fieldName,
2348
+ state.touchedFields,
2349
+ (array) => array.pop()
2350
+ );
2351
+ mutateAsArray(
2352
+ fieldName,
2353
+ state.fieldErrors,
2354
+ (array) => array.pop()
2355
+ );
2237
2356
  });
2238
2357
  get2().controlledFields.kickoffValueUpdate(fieldName);
2239
2358
  },
@@ -2241,41 +2360,70 @@ const createFormState = (set2, get2) => ({
2241
2360
  set2((state) => {
2242
2361
  getArray(state.controlledFields.values, fieldName).unshift(value);
2243
2362
  getArray(state.currentDefaultValues, fieldName).unshift(value);
2244
- mutateAsArray(fieldName, state.touchedFields, (array) => array.unshift(false));
2245
- mutateAsArray(fieldName, state.fieldErrors, (array) => array.unshift(void 0));
2363
+ mutateAsArray(
2364
+ fieldName,
2365
+ state.touchedFields,
2366
+ (array) => array.unshift(false)
2367
+ );
2368
+ mutateAsArray(
2369
+ fieldName,
2370
+ state.fieldErrors,
2371
+ (array) => array.unshift(void 0)
2372
+ );
2246
2373
  });
2247
2374
  },
2248
2375
  replace: (fieldName, index, item) => {
2249
2376
  set2((state) => {
2250
- replace(getArray(state.controlledFields.values, fieldName), index, item);
2251
- replace(getArray(state.currentDefaultValues, fieldName), index, item);
2252
- mutateAsArray(fieldName, state.touchedFields, (array) => replace(array, index, item));
2253
- mutateAsArray(fieldName, state.fieldErrors, (array) => replace(array, index, item));
2377
+ replace(
2378
+ getArray(state.controlledFields.values, fieldName),
2379
+ index,
2380
+ item
2381
+ );
2382
+ replace(
2383
+ getArray(state.currentDefaultValues, fieldName),
2384
+ index,
2385
+ item
2386
+ );
2387
+ mutateAsArray(
2388
+ fieldName,
2389
+ state.touchedFields,
2390
+ (array) => replace(array, index, item)
2391
+ );
2392
+ mutateAsArray(
2393
+ fieldName,
2394
+ state.fieldErrors,
2395
+ (array) => replace(array, index, item)
2396
+ );
2254
2397
  });
2255
2398
  get2().controlledFields.kickoffValueUpdate(fieldName);
2256
2399
  }
2257
2400
  }
2258
2401
  }
2259
2402
  });
2260
- const useRootFormStore = create$1()(immer((set2, get2) => ({
2261
- forms: {},
2262
- form: (formId) => {
2263
- var _a;
2264
- return (_a = get2().forms[formId]) != null ? _a : defaultFormState;
2265
- },
2266
- cleanupForm: (formId) => {
2267
- set2((state) => {
2268
- delete state.forms[formId];
2269
- });
2270
- },
2271
- registerForm: (formId) => {
2272
- if (get2().forms[formId])
2273
- return;
2274
- set2((state) => {
2275
- state.forms[formId] = createFormState((setter) => set2((state2) => setter(state2.forms[formId])), () => get2().forms[formId]);
2276
- });
2277
- }
2278
- })));
2403
+ const useRootFormStore = create$1()(
2404
+ immer((set2, get2) => ({
2405
+ forms: {},
2406
+ form: (formId) => {
2407
+ var _a;
2408
+ return (_a = get2().forms[formId]) != null ? _a : defaultFormState;
2409
+ },
2410
+ cleanupForm: (formId) => {
2411
+ set2((state) => {
2412
+ delete state.forms[formId];
2413
+ });
2414
+ },
2415
+ registerForm: (formId) => {
2416
+ if (get2().forms[formId])
2417
+ return;
2418
+ set2((state) => {
2419
+ state.forms[formId] = createFormState(
2420
+ (setter) => set2((state2) => setter(state2.forms[formId])),
2421
+ () => get2().forms[formId]
2422
+ );
2423
+ });
2424
+ }
2425
+ }))
2426
+ );
2279
2427
  const useFormStore = (formId, selector) => {
2280
2428
  return useRootFormStore((state) => selector(state.form(formId)));
2281
2429
  };
@@ -2285,7 +2433,9 @@ const useInternalFormContext = (formId, hookName) => {
2285
2433
  return { formId };
2286
2434
  if (formContext)
2287
2435
  return formContext;
2288
- throw new Error(`Unable to determine form for ${hookName}. Please use it inside a ValidatedForm or pass a 'formId'.`);
2436
+ throw new Error(
2437
+ `Unable to determine form for ${hookName}. Please use it inside a ValidatedForm or pass a 'formId'.`
2438
+ );
2289
2439
  };
2290
2440
  function useErrorResponseForForm({
2291
2441
  fetcher,
@@ -2331,7 +2481,10 @@ const useDefaultValuesForForm = (context) => {
2331
2481
  if (hydrated)
2332
2482
  return hydratable.hydratedData();
2333
2483
  if (errorResponse == null ? void 0 : errorResponse.repopulateFields) {
2334
- invariant(typeof errorResponse.repopulateFields === "object", "repopulateFields returned something other than an object");
2484
+ invariant(
2485
+ typeof errorResponse.repopulateFields === "object",
2486
+ "repopulateFields returned something other than an object"
2487
+ );
2335
2488
  return hydratable.serverData(errorResponse.repopulateFields);
2336
2489
  }
2337
2490
  if (defaultValuesProp)
@@ -2348,12 +2501,18 @@ const useHasActiveFormSubmit = ({
2348
2501
  const useFieldTouched = (field, { formId }) => {
2349
2502
  const touched = useFormStore(formId, (state) => state.touchedFields[field]);
2350
2503
  const setFieldTouched = useFormStore(formId, (state) => state.setTouched);
2351
- const setTouched = useCallback((touched2) => setFieldTouched(field, touched2), [field, setFieldTouched]);
2504
+ const setTouched = useCallback(
2505
+ (touched2) => setFieldTouched(field, touched2),
2506
+ [field, setFieldTouched]
2507
+ );
2352
2508
  return [touched, setTouched];
2353
2509
  };
2354
2510
  const useFieldError = (name, context) => {
2355
2511
  const fieldErrors = useFieldErrorsForForm(context);
2356
- const state = useFormStore(context.formId, (state2) => state2.fieldErrors[name]);
2512
+ const state = useFormStore(
2513
+ context.formId,
2514
+ (state2) => state2.fieldErrors[name]
2515
+ );
2357
2516
  return fieldErrors.map((fieldErrors2) => fieldErrors2 == null ? void 0 : fieldErrors2[name]).hydrateTo(state);
2358
2517
  };
2359
2518
  const useClearError = (context) => {
@@ -2373,15 +2532,21 @@ const useValidateField = (formId) => useFormStore(formId, (state) => state.valid
2373
2532
  const useValidate = (formId) => useFormStore(formId, (state) => state.validate);
2374
2533
  const noOpReceiver = () => () => {
2375
2534
  };
2376
- const useRegisterReceiveFocus = (formId) => useFormStore(formId, (state) => {
2377
- var _a, _b;
2378
- return (_b = (_a = state.formProps) == null ? void 0 : _a.registerReceiveFocus) != null ? _b : noOpReceiver;
2379
- });
2535
+ const useRegisterReceiveFocus = (formId) => useFormStore(
2536
+ formId,
2537
+ (state) => {
2538
+ var _a, _b;
2539
+ return (_b = (_a = state.formProps) == null ? void 0 : _a.registerReceiveFocus) != null ? _b : noOpReceiver;
2540
+ }
2541
+ );
2380
2542
  const defaultDefaultValues = {};
2381
- const useSyncedDefaultValues = (formId) => useFormStore(formId, (state) => {
2382
- var _a, _b;
2383
- return (_b = (_a = state.formProps) == null ? void 0 : _a.defaultValues) != null ? _b : defaultDefaultValues;
2384
- });
2543
+ const useSyncedDefaultValues = (formId) => useFormStore(
2544
+ formId,
2545
+ (state) => {
2546
+ var _a, _b;
2547
+ return (_b = (_a = state.formProps) == null ? void 0 : _a.defaultValues) != null ? _b : defaultDefaultValues;
2548
+ }
2549
+ );
2385
2550
  const useSetTouched = ({ formId }) => useFormStore(formId, (state) => state.setTouched);
2386
2551
  const useTouchedFields = (formId) => useFormStore(formId, (state) => state.touchedFields);
2387
2552
  const useFieldErrors = (formId) => useFormStore(formId, (state) => state.fieldErrors);
@@ -2398,18 +2563,33 @@ const useFormSubactionProp = (formId) => useFormStore(formId, (state) => {
2398
2563
  });
2399
2564
  const useFormValues = (formId) => useFormStore(formId, (state) => state.getValues);
2400
2565
  const useControlledFieldValue = (context, field) => {
2401
- const value = useFormStore(context.formId, (state) => state.controlledFields.getValue(field));
2402
- const isFormHydrated = useFormStore(context.formId, (state) => state.isHydrated);
2566
+ const value = useFormStore(
2567
+ context.formId,
2568
+ (state) => state.controlledFields.getValue(field)
2569
+ );
2570
+ const isFormHydrated = useFormStore(
2571
+ context.formId,
2572
+ (state) => state.isHydrated
2573
+ );
2403
2574
  const defaultValue = useFieldDefaultValue(field, context);
2404
2575
  return isFormHydrated ? value : defaultValue;
2405
2576
  };
2406
2577
  const useRegisterControlledField = (context, field) => {
2407
- const resolveUpdate = useFormStore(context.formId, (state) => state.controlledFields.valueUpdateResolvers[field]);
2578
+ const resolveUpdate = useFormStore(
2579
+ context.formId,
2580
+ (state) => state.controlledFields.valueUpdateResolvers[field]
2581
+ );
2408
2582
  useEffect(() => {
2409
2583
  resolveUpdate == null ? void 0 : resolveUpdate();
2410
2584
  }, [resolveUpdate]);
2411
- const register = useFormStore(context.formId, (state) => state.controlledFields.register);
2412
- const unregister = useFormStore(context.formId, (state) => state.controlledFields.unregister);
2585
+ const register = useFormStore(
2586
+ context.formId,
2587
+ (state) => state.controlledFields.register
2588
+ );
2589
+ const unregister = useFormStore(
2590
+ context.formId,
2591
+ (state) => state.controlledFields.unregister
2592
+ );
2413
2593
  useEffect(() => {
2414
2594
  register(field);
2415
2595
  return () => unregister(field);
@@ -2417,14 +2597,26 @@ const useRegisterControlledField = (context, field) => {
2417
2597
  };
2418
2598
  const useControllableValue = (context, field) => {
2419
2599
  useRegisterControlledField(context, field);
2420
- const setControlledFieldValue = useFormStore(context.formId, (state) => state.controlledFields.setValue);
2421
- const setValue = useCallback((value2) => setControlledFieldValue(field, value2), [field, setControlledFieldValue]);
2600
+ const setControlledFieldValue = useFormStore(
2601
+ context.formId,
2602
+ (state) => state.controlledFields.setValue
2603
+ );
2604
+ const setValue = useCallback(
2605
+ (value2) => setControlledFieldValue(field, value2),
2606
+ [field, setControlledFieldValue]
2607
+ );
2422
2608
  const value = useControlledFieldValue(context, field);
2423
2609
  return [value, setValue];
2424
2610
  };
2425
2611
  const useUpdateControllableValue = (formId) => {
2426
- const setValue = useFormStore(formId, (state) => state.controlledFields.setValue);
2427
- return useCallback((field, value) => setValue(field, value), [setValue]);
2612
+ const setValue = useFormStore(
2613
+ formId,
2614
+ (state) => state.controlledFields.setValue
2615
+ );
2616
+ return useCallback(
2617
+ (field, value) => setValue(field, value),
2618
+ [setValue]
2619
+ );
2428
2620
  };
2429
2621
  const useIsSubmitting = (formId) => {
2430
2622
  const formContext = useInternalFormContext(formId, "useIsSubmitting");
@@ -2459,14 +2651,16 @@ const useField = (name, options) => {
2459
2651
  touched,
2460
2652
  setTouched
2461
2653
  };
2462
- const getInputProps = createGetInputProps(__spreadProps(__spreadValues({}, helpers), {
2654
+ const getInputProps = createGetInputProps({
2655
+ ...helpers,
2463
2656
  name,
2464
2657
  hasBeenSubmitted,
2465
2658
  validationBehavior: options == null ? void 0 : options.validationBehavior
2466
- }));
2467
- return __spreadProps(__spreadValues({}, helpers), {
2468
- getInputProps
2469
2659
  });
2660
+ return {
2661
+ ...helpers,
2662
+ getInputProps
2663
+ };
2470
2664
  }, [
2471
2665
  error,
2472
2666
  clearError,
@@ -2507,17 +2701,21 @@ const json = (data, init = {}) => {
2507
2701
  if (!headers.has("Content-Type")) {
2508
2702
  headers.set("Content-Type", "application/json; charset=utf-8");
2509
2703
  }
2510
- return new Response(JSON.stringify(data), __spreadProps(__spreadValues({}, responseInit), {
2704
+ return new Response(JSON.stringify(data), {
2705
+ ...responseInit,
2511
2706
  headers
2512
- }));
2707
+ });
2513
2708
  };
2514
2709
  function validationError(error, repopulateFields, init) {
2515
- return json({
2516
- fieldErrors: error.fieldErrors,
2517
- subaction: error.subaction,
2518
- repopulateFields,
2519
- formId: error.formId
2520
- }, __spreadValues({ status: 422 }, init));
2710
+ return json(
2711
+ {
2712
+ fieldErrors: error.fieldErrors,
2713
+ subaction: error.subaction,
2714
+ repopulateFields,
2715
+ formId: error.formId
2716
+ },
2717
+ { status: 422, ...init }
2718
+ );
2521
2719
  }
2522
2720
  const setFormDefaults = (formId, defaultValues) => ({
2523
2721
  [formDefaultValuesKey(formId)]: defaultValues
@@ -2728,7 +2926,9 @@ const focusFirstInvalidInput = (fieldErrors, customFocusHandlers, formElement) =
2728
2926
  if (!elem)
2729
2927
  continue;
2730
2928
  if (elem instanceof RadioNodeList) {
2731
- const selectedRadio = (_a = [...elem].filter((item) => item instanceof HTMLInputElement).find((item) => item.value === elem.value)) != null ? _a : elem[0];
2929
+ const selectedRadio = (_a = [...elem].filter(
2930
+ (item) => item instanceof HTMLInputElement
2931
+ ).find((item) => item.value === elem.value)) != null ? _a : elem[0];
2732
2932
  if (selectedRadio && selectedRadio instanceof HTMLInputElement) {
2733
2933
  selectedRadio.focus();
2734
2934
  break;
@@ -2777,53 +2977,41 @@ function formEventProxy(event) {
2777
2977
  }
2778
2978
  });
2779
2979
  }
2780
- function ValidatedForm(_a) {
2781
- var _b = _a, {
2782
- validator,
2783
- onSubmit,
2784
- children,
2785
- fetcher,
2786
- action,
2787
- defaultValues: unMemoizedDefaults,
2788
- formRef: formRefProp,
2789
- onReset,
2790
- subaction,
2791
- resetAfterSubmit = false,
2792
- disableFocusOnError,
2793
- method,
2794
- replace: replace2,
2795
- id
2796
- } = _b, rest = __objRest(_b, [
2797
- "validator",
2798
- "onSubmit",
2799
- "children",
2800
- "fetcher",
2801
- "action",
2802
- "defaultValues",
2803
- "formRef",
2804
- "onReset",
2805
- "subaction",
2806
- "resetAfterSubmit",
2807
- "disableFocusOnError",
2808
- "method",
2809
- "replace",
2810
- "id"
2811
- ]);
2812
- var _a2;
2980
+ function ValidatedForm({
2981
+ validator,
2982
+ onSubmit,
2983
+ children,
2984
+ fetcher,
2985
+ action,
2986
+ defaultValues: unMemoizedDefaults,
2987
+ formRef: formRefProp,
2988
+ onReset,
2989
+ subaction,
2990
+ resetAfterSubmit = false,
2991
+ disableFocusOnError,
2992
+ method,
2993
+ replace: replace2,
2994
+ id,
2995
+ ...rest
2996
+ }) {
2997
+ var _a;
2813
2998
  const formId = useFormId(id);
2814
2999
  const providedDefaultValues = useDeepEqualsMemo(unMemoizedDefaults);
2815
- const contextValue = useMemo(() => ({
2816
- formId,
2817
- action,
2818
- subaction,
2819
- defaultValuesProp: providedDefaultValues,
2820
- fetcher
2821
- }), [action, fetcher, formId, providedDefaultValues, subaction]);
3000
+ const contextValue = useMemo(
3001
+ () => ({
3002
+ formId,
3003
+ action,
3004
+ subaction,
3005
+ defaultValuesProp: providedDefaultValues,
3006
+ fetcher
3007
+ }),
3008
+ [action, fetcher, formId, providedDefaultValues, subaction]
3009
+ );
2822
3010
  const backendError = useErrorResponseForForm(contextValue);
2823
3011
  const backendDefaultValues = useDefaultValuesFromLoader(contextValue);
2824
3012
  const hasActiveSubmission = useHasActiveFormSubmit(contextValue);
2825
3013
  const formRef = useRef(null);
2826
- const Form$1 = (_a2 = fetcher == null ? void 0 : fetcher.Form) != null ? _a2 : Form;
3014
+ const Form$1 = (_a = fetcher == null ? void 0 : fetcher.Form) != null ? _a : Form;
2827
3015
  const submit = useSubmit();
2828
3016
  const setFieldErrors = useSetFieldErrors(formId);
2829
3017
  const setFieldError = useFormStore(formId, (state) => state.setFieldError);
@@ -2831,25 +3019,31 @@ function ValidatedForm(_a) {
2831
3019
  const startSubmit = useFormStore(formId, (state) => state.startSubmit);
2832
3020
  const endSubmit = useFormStore(formId, (state) => state.endSubmit);
2833
3021
  const syncFormProps = useFormStore(formId, (state) => state.syncFormProps);
2834
- const setFormElementInState = useFormStore(formId, (state) => state.setFormElement);
3022
+ const setFormElementInState = useFormStore(
3023
+ formId,
3024
+ (state) => state.setFormElement
3025
+ );
2835
3026
  const cleanupForm = useRootFormStore((state) => state.cleanupForm);
2836
3027
  const registerForm = useRootFormStore((state) => state.registerForm);
2837
3028
  const customFocusHandlers = useMultiValueMap();
2838
- const registerReceiveFocus = useCallback((fieldName, handler) => {
2839
- customFocusHandlers().add(fieldName, handler);
2840
- return () => {
2841
- customFocusHandlers().remove(fieldName, handler);
2842
- };
2843
- }, [customFocusHandlers]);
3029
+ const registerReceiveFocus = useCallback(
3030
+ (fieldName, handler) => {
3031
+ customFocusHandlers().add(fieldName, handler);
3032
+ return () => {
3033
+ customFocusHandlers().remove(fieldName, handler);
3034
+ };
3035
+ },
3036
+ [customFocusHandlers]
3037
+ );
2844
3038
  useIsomorphicLayoutEffect(() => {
2845
3039
  registerForm(formId);
2846
3040
  return () => cleanupForm(formId);
2847
3041
  }, [cleanupForm, formId, registerForm]);
2848
3042
  useIsomorphicLayoutEffect(() => {
2849
- var _a3;
3043
+ var _a2;
2850
3044
  syncFormProps({
2851
3045
  action,
2852
- defaultValues: (_a3 = providedDefaultValues != null ? providedDefaultValues : backendDefaultValues) != null ? _a3 : {},
3046
+ defaultValues: (_a2 = providedDefaultValues != null ? providedDefaultValues : backendDefaultValues) != null ? _a2 : {},
2853
3047
  subaction,
2854
3048
  registerReceiveFocus,
2855
3049
  validator
@@ -2867,45 +3061,61 @@ function ValidatedForm(_a) {
2867
3061
  setFormElementInState(formRef.current);
2868
3062
  }, [setFormElementInState]);
2869
3063
  useEffect(() => {
2870
- var _a3;
2871
- setFieldErrors((_a3 = backendError == null ? void 0 : backendError.fieldErrors) != null ? _a3 : {});
3064
+ var _a2;
3065
+ setFieldErrors((_a2 = backendError == null ? void 0 : backendError.fieldErrors) != null ? _a2 : {});
2872
3066
  }, [backendError == null ? void 0 : backendError.fieldErrors, setFieldErrors, setFieldError]);
2873
3067
  useSubmitComplete(hasActiveSubmission, () => {
2874
3068
  endSubmit();
2875
3069
  });
2876
3070
  const handleSubmit = async (e2, target, nativeEvent) => {
2877
3071
  startSubmit();
2878
- const result = await validator.validate(getDataFromForm(e2.currentTarget));
3072
+ const submitter = nativeEvent.submitter;
3073
+ const formDataToValidate = getDataFromForm(e2.currentTarget);
3074
+ if (submitter == null ? void 0 : submitter.name) {
3075
+ formDataToValidate.append(submitter.name, submitter.value);
3076
+ }
3077
+ const result = await validator.validate(formDataToValidate);
2879
3078
  if (result.error) {
2880
- endSubmit();
2881
3079
  setFieldErrors(result.error.fieldErrors);
3080
+ endSubmit();
2882
3081
  if (!disableFocusOnError) {
2883
- focusFirstInvalidInput(result.error.fieldErrors, customFocusHandlers(), formRef.current);
3082
+ focusFirstInvalidInput(
3083
+ result.error.fieldErrors,
3084
+ customFocusHandlers(),
3085
+ formRef.current
3086
+ );
2884
3087
  }
2885
3088
  } else {
3089
+ setFieldErrors({});
2886
3090
  const eventProxy = formEventProxy(e2);
2887
3091
  await (onSubmit == null ? void 0 : onSubmit(result.data, eventProxy));
2888
3092
  if (eventProxy.defaultPrevented) {
2889
3093
  endSubmit();
2890
3094
  return;
2891
3095
  }
2892
- const submitter = nativeEvent.submitter;
2893
3096
  if (fetcher)
2894
3097
  fetcher.submit(submitter || e2.currentTarget);
2895
3098
  else
2896
- submit(submitter || target, { replace: replace2 });
3099
+ submit(submitter || target, {
3100
+ replace: replace2,
3101
+ method: (submitter == null ? void 0 : submitter.formMethod) || method
3102
+ });
2897
3103
  }
2898
3104
  };
2899
- return /* @__PURE__ */ React.createElement(Form$1, __spreadProps(__spreadValues({
2900
- ref: mergeRefs([formRef, formRefProp])
2901
- }, rest), {
3105
+ return /* @__PURE__ */ React.createElement(Form$1, {
3106
+ ref: mergeRefs([formRef, formRefProp]),
3107
+ ...rest,
2902
3108
  id,
2903
3109
  action,
2904
3110
  method,
2905
3111
  replace: replace2,
2906
3112
  onSubmit: (e2) => {
2907
3113
  e2.preventDefault();
2908
- handleSubmit(e2, e2.currentTarget, e2.nativeEvent);
3114
+ handleSubmit(
3115
+ e2,
3116
+ e2.currentTarget,
3117
+ e2.nativeEvent
3118
+ );
2909
3119
  },
2910
3120
  onReset: (event) => {
2911
3121
  onReset == null ? void 0 : onReset(event);
@@ -2913,7 +3123,7 @@ function ValidatedForm(_a) {
2913
3123
  return;
2914
3124
  reset();
2915
3125
  }
2916
- }), /* @__PURE__ */ React.createElement(InternalFormContext.Provider, {
3126
+ }, /* @__PURE__ */ React.createElement(InternalFormContext.Provider, {
2917
3127
  value: contextValue
2918
3128
  }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FormResetter, {
2919
3129
  formRef,
@@ -2928,21 +3138,482 @@ function ValidatedForm(_a) {
2928
3138
  name: FORM_ID_FIELD
2929
3139
  }), children)));
2930
3140
  }
3141
+ function arrayEach$1(array, iteratee) {
3142
+ var index = -1, length = array == null ? 0 : array.length;
3143
+ while (++index < length) {
3144
+ if (iteratee(array[index], index, array) === false) {
3145
+ break;
3146
+ }
3147
+ }
3148
+ return array;
3149
+ }
3150
+ var _arrayEach = arrayEach$1;
3151
+ var assignValue$1 = _assignValue, baseAssignValue = _baseAssignValue;
3152
+ function copyObject$5(source, props, object, customizer) {
3153
+ var isNew = !object;
3154
+ object || (object = {});
3155
+ var index = -1, length = props.length;
3156
+ while (++index < length) {
3157
+ var key = props[index];
3158
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
3159
+ if (newValue === void 0) {
3160
+ newValue = source[key];
3161
+ }
3162
+ if (isNew) {
3163
+ baseAssignValue(object, key, newValue);
3164
+ } else {
3165
+ assignValue$1(object, key, newValue);
3166
+ }
3167
+ }
3168
+ return object;
3169
+ }
3170
+ var _copyObject = copyObject$5;
3171
+ var copyObject$4 = _copyObject, keys$1 = keys_1;
3172
+ function baseAssign$1(object, source) {
3173
+ return object && copyObject$4(source, keys$1(source), object);
3174
+ }
3175
+ var _baseAssign = baseAssign$1;
3176
+ var copyObject$3 = _copyObject, keysIn$1 = keysIn_1;
3177
+ function baseAssignIn$1(object, source) {
3178
+ return object && copyObject$3(source, keysIn$1(source), object);
3179
+ }
3180
+ var _baseAssignIn = baseAssignIn$1;
3181
+ var _cloneBuffer = { exports: {} };
3182
+ (function(module, exports) {
3183
+ var root2 = _root;
3184
+ var freeExports = exports && !exports.nodeType && exports;
3185
+ var freeModule = freeExports && true && module && !module.nodeType && module;
3186
+ var moduleExports = freeModule && freeModule.exports === freeExports;
3187
+ var Buffer = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
3188
+ function cloneBuffer2(buffer, isDeep) {
3189
+ if (isDeep) {
3190
+ return buffer.slice();
3191
+ }
3192
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
3193
+ buffer.copy(result);
3194
+ return result;
3195
+ }
3196
+ module.exports = cloneBuffer2;
3197
+ })(_cloneBuffer, _cloneBuffer.exports);
3198
+ function copyArray$1(source, array) {
3199
+ var index = -1, length = source.length;
3200
+ array || (array = Array(length));
3201
+ while (++index < length) {
3202
+ array[index] = source[index];
3203
+ }
3204
+ return array;
3205
+ }
3206
+ var _copyArray = copyArray$1;
3207
+ var copyObject$2 = _copyObject, getSymbols = _getSymbols;
3208
+ function copySymbols$1(source, object) {
3209
+ return copyObject$2(source, getSymbols(source), object);
3210
+ }
3211
+ var _copySymbols = copySymbols$1;
3212
+ var copyObject$1 = _copyObject, getSymbolsIn = _getSymbolsIn;
3213
+ function copySymbolsIn$1(source, object) {
3214
+ return copyObject$1(source, getSymbolsIn(source), object);
3215
+ }
3216
+ var _copySymbolsIn = copySymbolsIn$1;
3217
+ var objectProto$1 = Object.prototype;
3218
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
3219
+ function initCloneArray$1(array) {
3220
+ var length = array.length, result = new array.constructor(length);
3221
+ if (length && typeof array[0] == "string" && hasOwnProperty$1.call(array, "index")) {
3222
+ result.index = array.index;
3223
+ result.input = array.input;
3224
+ }
3225
+ return result;
3226
+ }
3227
+ var _initCloneArray = initCloneArray$1;
3228
+ var Uint8Array = _Uint8Array;
3229
+ function cloneArrayBuffer$3(arrayBuffer) {
3230
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
3231
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
3232
+ return result;
3233
+ }
3234
+ var _cloneArrayBuffer = cloneArrayBuffer$3;
3235
+ var cloneArrayBuffer$2 = _cloneArrayBuffer;
3236
+ function cloneDataView$1(dataView, isDeep) {
3237
+ var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
3238
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
3239
+ }
3240
+ var _cloneDataView = cloneDataView$1;
3241
+ var reFlags = /\w*$/;
3242
+ function cloneRegExp$1(regexp) {
3243
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
3244
+ result.lastIndex = regexp.lastIndex;
3245
+ return result;
3246
+ }
3247
+ var _cloneRegExp = cloneRegExp$1;
3248
+ var Symbol$2 = _Symbol;
3249
+ var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
3250
+ function cloneSymbol$1(symbol) {
3251
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
3252
+ }
3253
+ var _cloneSymbol = cloneSymbol$1;
3254
+ var cloneArrayBuffer$1 = _cloneArrayBuffer;
3255
+ function cloneTypedArray$1(typedArray, isDeep) {
3256
+ var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
3257
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
3258
+ }
3259
+ var _cloneTypedArray = cloneTypedArray$1;
3260
+ var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
3261
+ var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
3262
+ var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
3263
+ function initCloneByTag$1(object, tag, isDeep) {
3264
+ var Ctor = object.constructor;
3265
+ switch (tag) {
3266
+ case arrayBufferTag$1:
3267
+ return cloneArrayBuffer(object);
3268
+ case boolTag$1:
3269
+ case dateTag$1:
3270
+ return new Ctor(+object);
3271
+ case dataViewTag$1:
3272
+ return cloneDataView(object, isDeep);
3273
+ case float32Tag$1:
3274
+ case float64Tag$1:
3275
+ case int8Tag$1:
3276
+ case int16Tag$1:
3277
+ case int32Tag$1:
3278
+ case uint8Tag$1:
3279
+ case uint8ClampedTag$1:
3280
+ case uint16Tag$1:
3281
+ case uint32Tag$1:
3282
+ return cloneTypedArray(object, isDeep);
3283
+ case mapTag$2:
3284
+ return new Ctor();
3285
+ case numberTag$1:
3286
+ case stringTag$1:
3287
+ return new Ctor(object);
3288
+ case regexpTag$1:
3289
+ return cloneRegExp(object);
3290
+ case setTag$2:
3291
+ return new Ctor();
3292
+ case symbolTag$1:
3293
+ return cloneSymbol(object);
3294
+ }
3295
+ }
3296
+ var _initCloneByTag = initCloneByTag$1;
3297
+ var isObject$1 = isObject_1;
3298
+ var objectCreate = Object.create;
3299
+ var baseCreate$1 = function() {
3300
+ function object() {
3301
+ }
3302
+ return function(proto) {
3303
+ if (!isObject$1(proto)) {
3304
+ return {};
3305
+ }
3306
+ if (objectCreate) {
3307
+ return objectCreate(proto);
3308
+ }
3309
+ object.prototype = proto;
3310
+ var result = new object();
3311
+ object.prototype = void 0;
3312
+ return result;
3313
+ };
3314
+ }();
3315
+ var _baseCreate = baseCreate$1;
3316
+ var baseCreate = _baseCreate, getPrototype$1 = _getPrototype, isPrototype = _isPrototype;
3317
+ function initCloneObject$1(object) {
3318
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype$1(object)) : {};
3319
+ }
3320
+ var _initCloneObject = initCloneObject$1;
3321
+ var getTag$2 = _getTag, isObjectLike$2 = isObjectLike_1;
3322
+ var mapTag$1 = "[object Map]";
3323
+ function baseIsMap$1(value) {
3324
+ return isObjectLike$2(value) && getTag$2(value) == mapTag$1;
3325
+ }
3326
+ var _baseIsMap = baseIsMap$1;
3327
+ var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtil.exports;
3328
+ var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
3329
+ var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
3330
+ var isMap_1 = isMap$1;
3331
+ var getTag$1 = _getTag, isObjectLike$1 = isObjectLike_1;
3332
+ var setTag$1 = "[object Set]";
3333
+ function baseIsSet$1(value) {
3334
+ return isObjectLike$1(value) && getTag$1(value) == setTag$1;
3335
+ }
3336
+ var _baseIsSet = baseIsSet$1;
3337
+ var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtil.exports;
3338
+ var nodeIsSet = nodeUtil && nodeUtil.isSet;
3339
+ var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
3340
+ var isSet_1 = isSet$1;
3341
+ var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBuffer.exports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn$1 = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray$1 = isArray_1, isBuffer = isBuffer$3.exports, isMap = isMap_1, isObject = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
3342
+ var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$1 = 4;
3343
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag$1 = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
3344
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
3345
+ var cloneableTags = {};
3346
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag$1] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
3347
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
3348
+ function baseClone$1(value, bitmask, customizer, key, object, stack) {
3349
+ var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
3350
+ if (customizer) {
3351
+ result = object ? customizer(value, key, object, stack) : customizer(value);
3352
+ }
3353
+ if (result !== void 0) {
3354
+ return result;
3355
+ }
3356
+ if (!isObject(value)) {
3357
+ return value;
3358
+ }
3359
+ var isArr = isArray$1(value);
3360
+ if (isArr) {
3361
+ result = initCloneArray(value);
3362
+ if (!isDeep) {
3363
+ return copyArray(value, result);
3364
+ }
3365
+ } else {
3366
+ var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
3367
+ if (isBuffer(value)) {
3368
+ return cloneBuffer(value, isDeep);
3369
+ }
3370
+ if (tag == objectTag$1 || tag == argsTag || isFunc && !object) {
3371
+ result = isFlat || isFunc ? {} : initCloneObject(value);
3372
+ if (!isDeep) {
3373
+ return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
3374
+ }
3375
+ } else {
3376
+ if (!cloneableTags[tag]) {
3377
+ return object ? value : {};
3378
+ }
3379
+ result = initCloneByTag(value, tag, isDeep);
3380
+ }
3381
+ }
3382
+ stack || (stack = new Stack());
3383
+ var stacked = stack.get(value);
3384
+ if (stacked) {
3385
+ return stacked;
3386
+ }
3387
+ stack.set(value, result);
3388
+ if (isSet(value)) {
3389
+ value.forEach(function(subValue) {
3390
+ result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
3391
+ });
3392
+ } else if (isMap(value)) {
3393
+ value.forEach(function(subValue, key2) {
3394
+ result.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
3395
+ });
3396
+ }
3397
+ var keysFunc = isFull ? isFlat ? getAllKeysIn$1 : getAllKeys : isFlat ? keysIn : keys;
3398
+ var props = isArr ? void 0 : keysFunc(value);
3399
+ arrayEach(props || value, function(subValue, key2) {
3400
+ if (props) {
3401
+ key2 = subValue;
3402
+ subValue = value[key2];
3403
+ }
3404
+ assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
3405
+ });
3406
+ return result;
3407
+ }
3408
+ var _baseClone = baseClone$1;
3409
+ function last$1(array) {
3410
+ var length = array == null ? 0 : array.length;
3411
+ return length ? array[length - 1] : void 0;
3412
+ }
3413
+ var last_1 = last$1;
3414
+ function baseSlice$1(array, start, end) {
3415
+ var index = -1, length = array.length;
3416
+ if (start < 0) {
3417
+ start = -start > length ? 0 : length + start;
3418
+ }
3419
+ end = end > length ? length : end;
3420
+ if (end < 0) {
3421
+ end += length;
3422
+ }
3423
+ length = start > end ? 0 : end - start >>> 0;
3424
+ start >>>= 0;
3425
+ var result = Array(length);
3426
+ while (++index < length) {
3427
+ result[index] = array[index + start];
3428
+ }
3429
+ return result;
3430
+ }
3431
+ var _baseSlice = baseSlice$1;
3432
+ var baseGet = _baseGet, baseSlice = _baseSlice;
3433
+ function parent$1(object, path) {
3434
+ return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
3435
+ }
3436
+ var _parent = parent$1;
3437
+ var castPath$1 = _castPath, last = last_1, parent = _parent, toKey = _toKey;
3438
+ function baseUnset$1(object, path) {
3439
+ path = castPath$1(path, object);
3440
+ object = parent(object, path);
3441
+ return object == null || delete object[toKey(last(path))];
3442
+ }
3443
+ var _baseUnset = baseUnset$1;
3444
+ var baseGetTag = _baseGetTag, getPrototype = _getPrototype, isObjectLike = isObjectLike_1;
3445
+ var objectTag = "[object Object]";
3446
+ var funcProto = Function.prototype, objectProto = Object.prototype;
3447
+ var funcToString = funcProto.toString;
3448
+ var hasOwnProperty = objectProto.hasOwnProperty;
3449
+ var objectCtorString = funcToString.call(Object);
3450
+ function isPlainObject$1(value) {
3451
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
3452
+ return false;
3453
+ }
3454
+ var proto = getPrototype(value);
3455
+ if (proto === null) {
3456
+ return true;
3457
+ }
3458
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
3459
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
3460
+ }
3461
+ var isPlainObject_1 = isPlainObject$1;
3462
+ var isPlainObject = isPlainObject_1;
3463
+ function customOmitClone$1(value) {
3464
+ return isPlainObject(value) ? void 0 : value;
3465
+ }
3466
+ var _customOmitClone = customOmitClone$1;
3467
+ var Symbol$1 = _Symbol, isArguments = isArguments_1, isArray = isArray_1;
3468
+ var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
3469
+ function isFlattenable$1(value) {
3470
+ return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
3471
+ }
3472
+ var _isFlattenable = isFlattenable$1;
3473
+ var arrayPush = _arrayPush, isFlattenable = _isFlattenable;
3474
+ function baseFlatten$1(array, depth, predicate, isStrict, result) {
3475
+ var index = -1, length = array.length;
3476
+ predicate || (predicate = isFlattenable);
3477
+ result || (result = []);
3478
+ while (++index < length) {
3479
+ var value = array[index];
3480
+ if (depth > 0 && predicate(value)) {
3481
+ if (depth > 1) {
3482
+ baseFlatten$1(value, depth - 1, predicate, isStrict, result);
3483
+ } else {
3484
+ arrayPush(result, value);
3485
+ }
3486
+ } else if (!isStrict) {
3487
+ result[result.length] = value;
3488
+ }
3489
+ }
3490
+ return result;
3491
+ }
3492
+ var _baseFlatten = baseFlatten$1;
3493
+ var baseFlatten = _baseFlatten;
3494
+ function flatten$1(array) {
3495
+ var length = array == null ? 0 : array.length;
3496
+ return length ? baseFlatten(array, 1) : [];
3497
+ }
3498
+ var flatten_1 = flatten$1;
3499
+ function apply$1(func, thisArg, args) {
3500
+ switch (args.length) {
3501
+ case 0:
3502
+ return func.call(thisArg);
3503
+ case 1:
3504
+ return func.call(thisArg, args[0]);
3505
+ case 2:
3506
+ return func.call(thisArg, args[0], args[1]);
3507
+ case 3:
3508
+ return func.call(thisArg, args[0], args[1], args[2]);
3509
+ }
3510
+ return func.apply(thisArg, args);
3511
+ }
3512
+ var _apply = apply$1;
3513
+ var apply = _apply;
3514
+ var nativeMax = Math.max;
3515
+ function overRest$1(func, start, transform) {
3516
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
3517
+ return function() {
3518
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
3519
+ while (++index < length) {
3520
+ array[index] = args[start + index];
3521
+ }
3522
+ index = -1;
3523
+ var otherArgs = Array(start + 1);
3524
+ while (++index < start) {
3525
+ otherArgs[index] = args[index];
3526
+ }
3527
+ otherArgs[start] = transform(array);
3528
+ return apply(func, this, otherArgs);
3529
+ };
3530
+ }
3531
+ var _overRest = overRest$1;
3532
+ function constant$1(value) {
3533
+ return function() {
3534
+ return value;
3535
+ };
3536
+ }
3537
+ var constant_1 = constant$1;
3538
+ var constant = constant_1, defineProperty = _defineProperty, identity = identity_1;
3539
+ var baseSetToString$1 = !defineProperty ? identity : function(func, string) {
3540
+ return defineProperty(func, "toString", {
3541
+ "configurable": true,
3542
+ "enumerable": false,
3543
+ "value": constant(string),
3544
+ "writable": true
3545
+ });
3546
+ };
3547
+ var _baseSetToString = baseSetToString$1;
3548
+ var HOT_COUNT = 800, HOT_SPAN = 16;
3549
+ var nativeNow = Date.now;
3550
+ function shortOut$1(func) {
3551
+ var count = 0, lastCalled = 0;
3552
+ return function() {
3553
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
3554
+ lastCalled = stamp;
3555
+ if (remaining > 0) {
3556
+ if (++count >= HOT_COUNT) {
3557
+ return arguments[0];
3558
+ }
3559
+ } else {
3560
+ count = 0;
3561
+ }
3562
+ return func.apply(void 0, arguments);
3563
+ };
3564
+ }
3565
+ var _shortOut = shortOut$1;
3566
+ var baseSetToString = _baseSetToString, shortOut = _shortOut;
3567
+ var setToString$1 = shortOut(baseSetToString);
3568
+ var _setToString = setToString$1;
3569
+ var flatten = flatten_1, overRest = _overRest, setToString = _setToString;
3570
+ function flatRest$1(func) {
3571
+ return setToString(overRest(func, void 0, flatten), func + "");
3572
+ }
3573
+ var _flatRest = flatRest$1;
3574
+ var arrayMap = _arrayMap, baseClone = _baseClone, baseUnset = _baseUnset, castPath = _castPath, copyObject = _copyObject, customOmitClone = _customOmitClone, flatRest = _flatRest, getAllKeysIn = _getAllKeysIn;
3575
+ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
3576
+ var omit = flatRest(function(object, paths) {
3577
+ var result = {};
3578
+ if (object == null) {
3579
+ return result;
3580
+ }
3581
+ var isDeep = false;
3582
+ paths = arrayMap(paths, function(path) {
3583
+ path = castPath(path, object);
3584
+ isDeep || (isDeep = path.length > 1);
3585
+ return path;
3586
+ });
3587
+ copyObject(object, getAllKeysIn(object), result);
3588
+ if (isDeep) {
3589
+ result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
3590
+ }
3591
+ var length = paths.length;
3592
+ while (length--) {
3593
+ baseUnset(result, paths[length]);
3594
+ }
3595
+ return result;
3596
+ });
3597
+ var omit_1 = omit;
2931
3598
  const objectFromPathEntries = (entries) => {
2932
3599
  const map = new MultiValueMap();
2933
3600
  entries.forEach(([key, value]) => map.add(key, value));
2934
- return [...map.entries()].reduce((acc, [key, value]) => set_1(acc, key, value.length === 1 ? value[0] : value), {});
3601
+ return [...map.entries()].reduce(
3602
+ (acc, [key, value]) => set_1(acc, key, value.length === 1 ? value[0] : value),
3603
+ {}
3604
+ );
2935
3605
  };
2936
3606
  const preprocessFormData = (data) => {
2937
3607
  if ("entries" in data && typeof data.entries === "function")
2938
3608
  return objectFromPathEntries([...data.entries()]);
2939
3609
  return objectFromPathEntries(Object.entries(data));
2940
3610
  };
3611
+ const omitInternalFields = (data) => omit_1(data, FORM_ID_FIELD);
2941
3612
  function createValidator(validator) {
2942
3613
  return {
2943
3614
  validate: async (value) => {
2944
3615
  const data = preprocessFormData(value);
2945
- const result = await validator.validate(data);
3616
+ const result = await validator.validate(omitInternalFields(data));
2946
3617
  if (result.error) {
2947
3618
  return {
2948
3619
  data: void 0,
@@ -2979,25 +3650,28 @@ const useFormState = (formId) => {
2979
3650
  const fieldErrorsFromState = useFieldErrors(formContext.formId);
2980
3651
  const fieldErrorsToUse = useFieldErrorsForForm(formContext);
2981
3652
  const hydratedFieldErrors = fieldErrorsToUse.hydrateTo(fieldErrorsFromState);
2982
- return useMemo(() => ({
2983
- action,
2984
- subaction,
2985
- defaultValues: hydratedDefaultValues,
2986
- fieldErrors: hydratedFieldErrors != null ? hydratedFieldErrors : {},
2987
- hasBeenSubmitted,
2988
- isSubmitting,
2989
- touchedFields,
2990
- isValid
2991
- }), [
2992
- action,
2993
- hasBeenSubmitted,
2994
- hydratedDefaultValues,
2995
- hydratedFieldErrors,
2996
- isSubmitting,
2997
- isValid,
2998
- subaction,
2999
- touchedFields
3000
- ]);
3653
+ return useMemo(
3654
+ () => ({
3655
+ action,
3656
+ subaction,
3657
+ defaultValues: hydratedDefaultValues,
3658
+ fieldErrors: hydratedFieldErrors != null ? hydratedFieldErrors : {},
3659
+ hasBeenSubmitted,
3660
+ isSubmitting,
3661
+ touchedFields,
3662
+ isValid
3663
+ }),
3664
+ [
3665
+ action,
3666
+ hasBeenSubmitted,
3667
+ hydratedDefaultValues,
3668
+ hydratedFieldErrors,
3669
+ isSubmitting,
3670
+ isValid,
3671
+ subaction,
3672
+ touchedFields
3673
+ ]
3674
+ );
3001
3675
  };
3002
3676
  const useFormHelpers = (formId) => {
3003
3677
  const formContext = useInternalFormContext(formId, "useFormHelpers");
@@ -3009,25 +3683,28 @@ const useFormHelpers = (formId) => {
3009
3683
  const reset = useResetFormElement(formContext.formId);
3010
3684
  const submit = useSubmitForm(formContext.formId);
3011
3685
  const getValues = useFormValues(formContext.formId);
3012
- return useMemo(() => ({
3013
- setTouched,
3014
- validateField,
3015
- clearError,
3016
- validate,
3017
- clearAllErrors: () => setFieldErrors({}),
3018
- reset,
3019
- submit,
3020
- getValues
3021
- }), [
3022
- clearError,
3023
- reset,
3024
- setFieldErrors,
3025
- setTouched,
3026
- submit,
3027
- validate,
3028
- validateField,
3029
- getValues
3030
- ]);
3686
+ return useMemo(
3687
+ () => ({
3688
+ setTouched,
3689
+ validateField,
3690
+ clearError,
3691
+ validate,
3692
+ clearAllErrors: () => setFieldErrors({}),
3693
+ reset,
3694
+ submit,
3695
+ getValues
3696
+ }),
3697
+ [
3698
+ clearError,
3699
+ reset,
3700
+ setFieldErrors,
3701
+ setTouched,
3702
+ submit,
3703
+ validate,
3704
+ validateField,
3705
+ getValues
3706
+ ]
3707
+ );
3031
3708
  };
3032
3709
  const useFormContext = (formId) => {
3033
3710
  const context = useInternalFormContext(formId, "useFormContext");
@@ -3043,33 +3720,40 @@ const useFormContext = (formId) => {
3043
3720
  getValues
3044
3721
  } = useFormHelpers(formId);
3045
3722
  const registerReceiveFocus = useRegisterReceiveFocus(context.formId);
3046
- const clearError = useCallback((...names) => {
3047
- names.forEach((name) => {
3048
- internalClearError(name);
3049
- });
3050
- }, [internalClearError]);
3051
- return useMemo(() => __spreadProps(__spreadValues({}, state), {
3052
- setFieldTouched: setTouched,
3053
- validateField,
3054
- clearError,
3055
- registerReceiveFocus,
3056
- clearAllErrors,
3057
- validate,
3058
- reset,
3059
- submit,
3060
- getValues
3061
- }), [
3062
- clearAllErrors,
3063
- clearError,
3064
- registerReceiveFocus,
3065
- reset,
3066
- setTouched,
3067
- state,
3068
- submit,
3069
- validate,
3070
- validateField,
3071
- getValues
3072
- ]);
3723
+ const clearError = useCallback(
3724
+ (...names) => {
3725
+ names.forEach((name) => {
3726
+ internalClearError(name);
3727
+ });
3728
+ },
3729
+ [internalClearError]
3730
+ );
3731
+ return useMemo(
3732
+ () => ({
3733
+ ...state,
3734
+ setFieldTouched: setTouched,
3735
+ validateField,
3736
+ clearError,
3737
+ registerReceiveFocus,
3738
+ clearAllErrors,
3739
+ validate,
3740
+ reset,
3741
+ submit,
3742
+ getValues
3743
+ }),
3744
+ [
3745
+ clearAllErrors,
3746
+ clearError,
3747
+ registerReceiveFocus,
3748
+ reset,
3749
+ setTouched,
3750
+ state,
3751
+ submit,
3752
+ validate,
3753
+ validateField,
3754
+ getValues
3755
+ ]
3756
+ );
3073
3757
  };
3074
3758
  const useInternalFieldArray = (context, field, validationBehavior) => {
3075
3759
  const value = useFieldDefaultValue(field, context);
@@ -3077,52 +3761,62 @@ const useInternalFieldArray = (context, field, validationBehavior) => {
3077
3761
  const hasBeenSubmitted = useInternalHasBeenSubmitted(context.formId);
3078
3762
  const validateField = useValidateField(context.formId);
3079
3763
  const error = useFieldError(field, context);
3080
- const resolvedValidationBehavior = __spreadValues({
3764
+ const resolvedValidationBehavior = {
3081
3765
  initial: "onSubmit",
3082
- whenSubmitted: "onChange"
3083
- }, validationBehavior);
3766
+ whenSubmitted: "onChange",
3767
+ ...validationBehavior
3768
+ };
3084
3769
  const behavior = hasBeenSubmitted ? resolvedValidationBehavior.whenSubmitted : resolvedValidationBehavior.initial;
3085
3770
  const maybeValidate = useCallback(() => {
3086
3771
  if (behavior === "onChange") {
3087
3772
  validateField(field);
3088
3773
  }
3089
3774
  }, [behavior, field, validateField]);
3090
- invariant(value === void 0 || value === null || Array.isArray(value), `FieldArray: defaultValue value for ${field} must be an array, null, or undefined`);
3091
- const arr = useFormStore(context.formId, (state) => state.controlledFields.array);
3092
- const helpers = useMemo(() => ({
3093
- push: (item) => {
3094
- arr.push(field, item);
3095
- maybeValidate();
3096
- },
3097
- swap: (indexA, indexB) => {
3098
- arr.swap(field, indexA, indexB);
3099
- maybeValidate();
3100
- },
3101
- move: (from2, to) => {
3102
- arr.move(field, from2, to);
3103
- maybeValidate();
3104
- },
3105
- insert: (index, value2) => {
3106
- arr.insert(field, index, value2);
3107
- maybeValidate();
3108
- },
3109
- unshift: (value2) => {
3110
- arr.unshift(field, value2);
3111
- maybeValidate();
3112
- },
3113
- remove: (index) => {
3114
- arr.remove(field, index);
3115
- maybeValidate();
3116
- },
3117
- pop: () => {
3118
- arr.pop(field);
3119
- maybeValidate();
3120
- },
3121
- replace: (index, value2) => {
3122
- arr.replace(field, index, value2);
3123
- maybeValidate();
3124
- }
3125
- }), [arr, field, maybeValidate]);
3775
+ invariant(
3776
+ value === void 0 || value === null || Array.isArray(value),
3777
+ `FieldArray: defaultValue value for ${field} must be an array, null, or undefined`
3778
+ );
3779
+ const arr = useFormStore(
3780
+ context.formId,
3781
+ (state) => state.controlledFields.array
3782
+ );
3783
+ const helpers = useMemo(
3784
+ () => ({
3785
+ push: (item) => {
3786
+ arr.push(field, item);
3787
+ maybeValidate();
3788
+ },
3789
+ swap: (indexA, indexB) => {
3790
+ arr.swap(field, indexA, indexB);
3791
+ maybeValidate();
3792
+ },
3793
+ move: (from2, to) => {
3794
+ arr.move(field, from2, to);
3795
+ maybeValidate();
3796
+ },
3797
+ insert: (index, value2) => {
3798
+ arr.insert(field, index, value2);
3799
+ maybeValidate();
3800
+ },
3801
+ unshift: (value2) => {
3802
+ arr.unshift(field, value2);
3803
+ maybeValidate();
3804
+ },
3805
+ remove: (index) => {
3806
+ arr.remove(field, index);
3807
+ maybeValidate();
3808
+ },
3809
+ pop: () => {
3810
+ arr.pop(field);
3811
+ maybeValidate();
3812
+ },
3813
+ replace: (index, value2) => {
3814
+ arr.replace(field, index, value2);
3815
+ maybeValidate();
3816
+ }
3817
+ }),
3818
+ [arr, field, maybeValidate]
3819
+ );
3126
3820
  const arrayValue = useMemo(() => value != null ? value : [], [value]);
3127
3821
  return [arrayValue, helpers, error];
3128
3822
  };
@@ -3137,8 +3831,12 @@ const FieldArray = ({
3137
3831
  validationBehavior
3138
3832
  }) => {
3139
3833
  const context = useInternalFormContext(formId, "FieldArray");
3140
- const [value, helpers, error] = useInternalFieldArray(context, name, validationBehavior);
3141
- return children(value, helpers, error);
3834
+ const [value, helpers, error] = useInternalFieldArray(
3835
+ context,
3836
+ name,
3837
+ validationBehavior
3838
+ );
3839
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children(value, helpers, error));
3142
3840
  };
3143
3841
  export { FieldArray, ValidatedForm, createValidator, setFormDefaults, useControlField, useField, useFieldArray, useFormContext, useIsSubmitting, useIsValid, useUpdateControlledField, validationError };
3144
3842
  //# sourceMappingURL=remix-validated-form.es.js.map