mlform 0.1.4 → 0.1.6
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.
- package/README.md +2 -2
- package/dist/{engine-nnhWPT2L.js → engine-tP-QTA_5.js} +396 -330
- package/dist/{kit-Dt_1Fxlc.js → kit-fHGskli5.js} +2 -2
- package/dist/mlform/engine.mjs +2 -2
- package/dist/mlform/kit.mjs +1 -1
- package/dist/mlform/primitives.mjs +1 -1
- package/dist/mlform/questionnaire.mjs +2 -2
- package/dist/mlform.mjs +3 -3
- package/dist/{primitives-Pi-ztAr6.js → primitives-BtI1xyZz.js} +1 -1
- package/dist/types/src/engine/builtins/fields/mapped-category.d.ts +12 -0
- package/dist/types/src/engine/builtins/index.d.ts +9 -1
- package/dist/types/src/engine/builtins/shared.d.ts +1 -0
- package/dist/types/src/engine/index.d.ts +1 -1
- package/dist/types/src/engine/types/field.d.ts +1 -0
- package/package.json +1 -1
|
@@ -187,7 +187,7 @@ var r = class extends e {
|
|
|
187
187
|
listExplanations() {
|
|
188
188
|
return Array.from(this.explanationDefinitions.values());
|
|
189
189
|
}
|
|
190
|
-
}, S = () => new x(),
|
|
190
|
+
}, S = () => new x(), C = (e) => e, w = (e) => e, te = (e) => e;
|
|
191
191
|
Object.freeze({ status: "aborted" });
|
|
192
192
|
function T(e, t, n) {
|
|
193
193
|
function r(n, r) {
|
|
@@ -285,22 +285,22 @@ function de(e, t, n) {
|
|
|
285
285
|
configurable: !0
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function fe(...e) {
|
|
289
289
|
let t = {};
|
|
290
290
|
for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
|
|
291
291
|
return Object.defineProperties({}, t);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function pe(e) {
|
|
294
294
|
return JSON.stringify(e);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function me(e) {
|
|
297
297
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
298
298
|
}
|
|
299
|
-
var
|
|
300
|
-
function
|
|
299
|
+
var he = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
|
|
300
|
+
function ge(e) {
|
|
301
301
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
302
302
|
}
|
|
303
|
-
var
|
|
303
|
+
var _e = oe(() => {
|
|
304
304
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
|
305
305
|
try {
|
|
306
306
|
return Function(""), !0;
|
|
@@ -308,25 +308,25 @@ var ge = oe(() => {
|
|
|
308
308
|
return !1;
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
function
|
|
312
|
-
if (
|
|
311
|
+
function ve(e) {
|
|
312
|
+
if (ge(e) === !1) return !1;
|
|
313
313
|
let t = e.constructor;
|
|
314
314
|
if (t === void 0 || typeof t != "function") return !0;
|
|
315
315
|
let n = t.prototype;
|
|
316
|
-
return !(
|
|
316
|
+
return !(ge(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
318
|
+
function ye(e) {
|
|
319
|
+
return ve(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
320
320
|
}
|
|
321
|
-
var
|
|
321
|
+
var be = new Set([
|
|
322
322
|
"string",
|
|
323
323
|
"number",
|
|
324
324
|
"symbol"
|
|
325
325
|
]);
|
|
326
|
-
function
|
|
326
|
+
function xe(e) {
|
|
327
327
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function k(e, t, n) {
|
|
330
330
|
let r = new e._zod.constr(t ?? e._zod.def);
|
|
331
331
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
332
332
|
}
|
|
@@ -356,7 +356,7 @@ var Ce = {
|
|
|
356
356
|
function we(e, t) {
|
|
357
357
|
let n = e._zod.def, r = n.checks;
|
|
358
358
|
if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
|
|
359
|
-
return
|
|
359
|
+
return k(e, fe(e._zod.def, {
|
|
360
360
|
get shape() {
|
|
361
361
|
let e = {};
|
|
362
362
|
for (let r in t) {
|
|
@@ -371,7 +371,7 @@ function we(e, t) {
|
|
|
371
371
|
function Te(e, t) {
|
|
372
372
|
let n = e._zod.def, r = n.checks;
|
|
373
373
|
if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
|
|
374
|
-
return
|
|
374
|
+
return k(e, fe(e._zod.def, {
|
|
375
375
|
get shape() {
|
|
376
376
|
let r = { ...e._zod.def.shape };
|
|
377
377
|
for (let e in t) {
|
|
@@ -384,13 +384,13 @@ function Te(e, t) {
|
|
|
384
384
|
}));
|
|
385
385
|
}
|
|
386
386
|
function Ee(e, t) {
|
|
387
|
-
if (!
|
|
387
|
+
if (!ve(t)) throw Error("Invalid input to extend: expected a plain object");
|
|
388
388
|
let n = e._zod.def.checks;
|
|
389
389
|
if (n && n.length > 0) {
|
|
390
390
|
let n = e._zod.def.shape;
|
|
391
391
|
for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return k(e, fe(e._zod.def, { get shape() {
|
|
394
394
|
let n = {
|
|
395
395
|
...e._zod.def.shape,
|
|
396
396
|
...t
|
|
@@ -399,8 +399,8 @@ function Ee(e, t) {
|
|
|
399
399
|
} }));
|
|
400
400
|
}
|
|
401
401
|
function De(e, t) {
|
|
402
|
-
if (!
|
|
403
|
-
return
|
|
402
|
+
if (!ve(t)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
403
|
+
return k(e, fe(e._zod.def, { get shape() {
|
|
404
404
|
let n = {
|
|
405
405
|
...e._zod.def.shape,
|
|
406
406
|
...t
|
|
@@ -409,7 +409,7 @@ function De(e, t) {
|
|
|
409
409
|
} }));
|
|
410
410
|
}
|
|
411
411
|
function Oe(e, t) {
|
|
412
|
-
return
|
|
412
|
+
return k(e, fe(e._zod.def, {
|
|
413
413
|
get shape() {
|
|
414
414
|
let n = {
|
|
415
415
|
...e._zod.def.shape,
|
|
@@ -426,7 +426,7 @@ function Oe(e, t) {
|
|
|
426
426
|
function ke(e, t, n) {
|
|
427
427
|
let r = t._zod.def.checks;
|
|
428
428
|
if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
|
|
429
|
-
return
|
|
429
|
+
return k(t, fe(t._zod.def, {
|
|
430
430
|
get shape() {
|
|
431
431
|
let r = t._zod.def.shape, i = { ...r };
|
|
432
432
|
if (n) for (let t in n) {
|
|
@@ -446,7 +446,7 @@ function ke(e, t, n) {
|
|
|
446
446
|
}));
|
|
447
447
|
}
|
|
448
448
|
function Ae(e, t, n) {
|
|
449
|
-
return
|
|
449
|
+
return k(t, fe(t._zod.def, { get shape() {
|
|
450
450
|
let r = t._zod.def.shape, i = { ...r };
|
|
451
451
|
if (n) for (let t in n) {
|
|
452
452
|
if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
|
|
@@ -543,7 +543,7 @@ var Ve = (e) => (t, n, r, i) => {
|
|
|
543
543
|
if (o instanceof Promise) throw new E();
|
|
544
544
|
if (o.issues.length) {
|
|
545
545
|
let t = new (i?.Err ?? e)(o.issues.map((e) => j(e, a, D())));
|
|
546
|
-
throw
|
|
546
|
+
throw he(t, i?.callee), t;
|
|
547
547
|
}
|
|
548
548
|
return o.value;
|
|
549
549
|
}, He = (e) => async (t, n, r, i) => {
|
|
@@ -553,7 +553,7 @@ var Ve = (e) => (t, n, r, i) => {
|
|
|
553
553
|
}, a);
|
|
554
554
|
if (o instanceof Promise && (o = await o), o.issues.length) {
|
|
555
555
|
let t = new (i?.Err ?? e)(o.issues.map((e) => j(e, a, D())));
|
|
556
|
-
throw
|
|
556
|
+
throw he(t, i?.callee), t;
|
|
557
557
|
}
|
|
558
558
|
return o.value;
|
|
559
559
|
}, Ue = (e) => (t, n, r) => {
|
|
@@ -840,7 +840,7 @@ var Tt = (e) => {
|
|
|
840
840
|
t.pattern ??= At, zt.init(e, t);
|
|
841
841
|
}), Ut = /* @__PURE__ */ T("$ZodCheckIncludes", (e, t) => {
|
|
842
842
|
M.init(e, t);
|
|
843
|
-
let n =
|
|
843
|
+
let n = xe(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
844
844
|
t.pattern = r, e._zod.onattach.push((e) => {
|
|
845
845
|
let t = e._zod.bag;
|
|
846
846
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
|
|
@@ -857,7 +857,7 @@ var Tt = (e) => {
|
|
|
857
857
|
};
|
|
858
858
|
}), Wt = /* @__PURE__ */ T("$ZodCheckStartsWith", (e, t) => {
|
|
859
859
|
M.init(e, t);
|
|
860
|
-
let n = RegExp(`^${
|
|
860
|
+
let n = RegExp(`^${xe(t.prefix)}.*`);
|
|
861
861
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
862
862
|
let t = e._zod.bag;
|
|
863
863
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -874,7 +874,7 @@ var Tt = (e) => {
|
|
|
874
874
|
};
|
|
875
875
|
}), Gt = /* @__PURE__ */ T("$ZodCheckEndsWith", (e, t) => {
|
|
876
876
|
M.init(e, t);
|
|
877
|
-
let n = RegExp(`.*${
|
|
877
|
+
let n = RegExp(`.*${xe(t.suffix)}$`);
|
|
878
878
|
t.pattern ??= n, e._zod.onattach.push((e) => {
|
|
879
879
|
let t = e._zod.bag;
|
|
880
880
|
t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
|
|
@@ -1296,7 +1296,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
return n;
|
|
1298
1298
|
});
|
|
1299
|
-
let r =
|
|
1299
|
+
let r = ge, i = t.catchall, a;
|
|
1300
1300
|
e._zod.parse = (t, o) => {
|
|
1301
1301
|
a ??= n.value;
|
|
1302
1302
|
let s = t.value;
|
|
@@ -1325,7 +1325,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1325
1325
|
"payload",
|
|
1326
1326
|
"ctx"
|
|
1327
1327
|
]), n = r.value, i = (e) => {
|
|
1328
|
-
let t =
|
|
1328
|
+
let t = pe(e);
|
|
1329
1329
|
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
|
|
1330
1330
|
};
|
|
1331
1331
|
t.write("const input = payload.value;");
|
|
@@ -1333,7 +1333,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1333
1333
|
for (let e of n.keys) a[e] = `key_${o++}`;
|
|
1334
1334
|
t.write("const newResult = {};");
|
|
1335
1335
|
for (let r of n.keys) {
|
|
1336
|
-
let n = a[r], o =
|
|
1336
|
+
let n = a[r], o = pe(r), s = e[r]?._zod?.optout === "optional";
|
|
1337
1337
|
t.write(`const ${n} = ${i(r)};`), s ? t.write(`
|
|
1338
1338
|
if (${n}.issues.length) {
|
|
1339
1339
|
if (${o} in input) {
|
|
@@ -1373,7 +1373,7 @@ var Nn = /* @__PURE__ */ T("$ZodObject", (e, t) => {
|
|
|
1373
1373
|
t.write("payload.value = newResult;"), t.write("return payload;");
|
|
1374
1374
|
let s = t.compile();
|
|
1375
1375
|
return (t, n) => s(e, t, n);
|
|
1376
|
-
}, a, o =
|
|
1376
|
+
}, a, o = ge, s = !re.jitless, c = s && _e.value, l = t.catchall, u;
|
|
1377
1377
|
e._zod.parse = (d, f) => {
|
|
1378
1378
|
u ??= r.value;
|
|
1379
1379
|
let p = d.value;
|
|
@@ -1438,7 +1438,7 @@ function Rn(e, t) {
|
|
|
1438
1438
|
valid: !0,
|
|
1439
1439
|
data: e
|
|
1440
1440
|
};
|
|
1441
|
-
if (
|
|
1441
|
+
if (ve(e) && ve(t)) {
|
|
1442
1442
|
let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
|
|
1443
1443
|
...e,
|
|
1444
1444
|
...t
|
|
@@ -1500,7 +1500,7 @@ function zn(e, t, n) {
|
|
|
1500
1500
|
var Bn = /* @__PURE__ */ T("$ZodRecord", (e, t) => {
|
|
1501
1501
|
N.init(e, t), e._zod.parse = (n, r) => {
|
|
1502
1502
|
let i = n.value;
|
|
1503
|
-
if (!
|
|
1503
|
+
if (!ve(i)) return n.issues.push({
|
|
1504
1504
|
expected: "record",
|
|
1505
1505
|
code: "invalid_type",
|
|
1506
1506
|
input: i,
|
|
@@ -1570,7 +1570,7 @@ var Bn = /* @__PURE__ */ T("$ZodRecord", (e, t) => {
|
|
|
1570
1570
|
}), Vn = /* @__PURE__ */ T("$ZodEnum", (e, t) => {
|
|
1571
1571
|
N.init(e, t);
|
|
1572
1572
|
let n = ie(t.entries), r = new Set(n);
|
|
1573
|
-
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) =>
|
|
1573
|
+
e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => be.has(typeof e)).map((e) => typeof e == "string" ? xe(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
|
|
1574
1574
|
let a = t.value;
|
|
1575
1575
|
return r.has(a) || t.issues.push({
|
|
1576
1576
|
code: "invalid_value",
|
|
@@ -1582,7 +1582,7 @@ var Bn = /* @__PURE__ */ T("$ZodRecord", (e, t) => {
|
|
|
1582
1582
|
}), Hn = /* @__PURE__ */ T("$ZodLiteral", (e, t) => {
|
|
1583
1583
|
if (N.init(e, t), t.values.length === 0) throw Error("Cannot create literal schema with no valid values");
|
|
1584
1584
|
let n = new Set(t.values);
|
|
1585
|
-
e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == "string" ?
|
|
1585
|
+
e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == "string" ? xe(e) : e ? xe(e.toString()) : String(e)).join("|")})$`), e._zod.parse = (r, i) => {
|
|
1586
1586
|
let a = r.value;
|
|
1587
1587
|
return n.has(a) || r.issues.push({
|
|
1588
1588
|
code: "invalid_value",
|
|
@@ -2207,7 +2207,7 @@ function si() {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2209
2209
|
function ci() {
|
|
2210
|
-
return /* @__PURE__ */ ri((e) =>
|
|
2210
|
+
return /* @__PURE__ */ ri((e) => me(e));
|
|
2211
2211
|
}
|
|
2212
2212
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2213
2213
|
function li(e, t, n) {
|
|
@@ -2692,11 +2692,11 @@ T("ZodError", Xi);
|
|
|
2692
2692
|
var L = T("ZodError", Xi, { Parent: Error }), Zi = /* @__PURE__ */ Ve(L), Qi = /* @__PURE__ */ He(L), $i = /* @__PURE__ */ Ue(L), ea = /* @__PURE__ */ Ge(L), ta = /* @__PURE__ */ qe(L), na = /* @__PURE__ */ Je(L), ra = /* @__PURE__ */ Ye(L), ia = /* @__PURE__ */ Xe(L), aa = /* @__PURE__ */ Ze(L), oa = /* @__PURE__ */ Qe(L), sa = /* @__PURE__ */ $e(L), ca = /* @__PURE__ */ et(L), R = /* @__PURE__ */ T("ZodType", (e, t) => (N.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
|
|
2693
2693
|
input: vi(e, "input"),
|
|
2694
2694
|
output: vi(e, "output")
|
|
2695
|
-
} }), e.toJSONSchema = _i(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(
|
|
2695
|
+
} }), e.toJSONSchema = _i(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(fe(t, { checks: [...t.checks ?? [], ...n.map((e) => typeof e == "function" ? { _zod: {
|
|
2696
2696
|
check: e,
|
|
2697
2697
|
def: { check: "custom" },
|
|
2698
2698
|
onattach: []
|
|
2699
|
-
} } : e)] }), { parent: !0 }), e.with = e.check, e.clone = (t, n) =>
|
|
2699
|
+
} } : e)] }), { parent: !0 }), e.with = e.check, e.clone = (t, n) => k(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) => Zi(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => $i(e, t, n), e.parseAsync = async (t, n) => Qi(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => ea(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => ta(e, t, n), e.decode = (t, n) => na(e, t, n), e.encodeAsync = async (t, n) => ra(e, t, n), e.decodeAsync = async (t, n) => ia(e, t, n), e.safeEncode = (t, n) => aa(e, t, n), e.safeDecode = (t, n) => oa(e, t, n), e.safeEncodeAsync = async (t, n) => sa(e, t, n), e.safeDecodeAsync = async (t, n) => ca(e, t, n), e.refine = (t, n) => e.check(yo(t, n)), e.superRefine = (t) => e.check(bo(t)), e.overwrite = (t) => e.check(/* @__PURE__ */ ri(t)), e.optional = () => Za(e), e.exactOptional = () => $a(e), e.nullable = () => to(e), e.nullish = () => Za(to(e)), e.nonoptional = (t) => so(e, t), e.array = () => W(e), e.or = (t) => Ba([e, t]), e.and = (t) => Ha(e, t), e.transform = (t) => fo(e, Ya(t)), e.default = (t) => ro(e, t), e.prefault = (t) => ao(e, t), e.catch = (t) => lo(e, t), e.pipe = (t) => fo(e, t), e.readonly = () => mo(e), e.describe = (t) => {
|
|
2700
2700
|
let n = e.clone();
|
|
2701
2701
|
return ur.add(n, { description: t }), n;
|
|
2702
2702
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2952,7 +2952,7 @@ function ro(e, t) {
|
|
|
2952
2952
|
type: "default",
|
|
2953
2953
|
innerType: e,
|
|
2954
2954
|
get defaultValue() {
|
|
2955
|
-
return typeof t == "function" ? t() :
|
|
2955
|
+
return typeof t == "function" ? t() : ye(t);
|
|
2956
2956
|
}
|
|
2957
2957
|
});
|
|
2958
2958
|
}
|
|
@@ -2964,7 +2964,7 @@ function ao(e, t) {
|
|
|
2964
2964
|
type: "prefault",
|
|
2965
2965
|
innerType: e,
|
|
2966
2966
|
get defaultValue() {
|
|
2967
|
-
return typeof t == "function" ? t() :
|
|
2967
|
+
return typeof t == "function" ? t() : ye(t);
|
|
2968
2968
|
}
|
|
2969
2969
|
});
|
|
2970
2970
|
}
|
|
@@ -3137,6 +3137,7 @@ var xo = {
|
|
|
3137
3137
|
"omit",
|
|
3138
3138
|
"reset-on-hide"
|
|
3139
3139
|
]).optional(),
|
|
3140
|
+
includeInSubmission: H().optional(),
|
|
3140
3141
|
valuePath: Ba([z().min(1), W(z().min(1)).min(1)]).optional(),
|
|
3141
3142
|
defaultValue: U().optional(),
|
|
3142
3143
|
ui: wo
|
|
@@ -3214,21 +3215,53 @@ var xo = {
|
|
|
3214
3215
|
errors: t.state.errors
|
|
3215
3216
|
});
|
|
3216
3217
|
}
|
|
3217
|
-
}, Po = (
|
|
3218
|
+
}, Po = G({
|
|
3219
|
+
label: z(),
|
|
3220
|
+
value: z(),
|
|
3221
|
+
mapping: Wa(z(), U())
|
|
3222
|
+
}), Fo = {
|
|
3223
|
+
kind: "mapped-category",
|
|
3224
|
+
schema: G({
|
|
3225
|
+
kind: K("mapped-category"),
|
|
3226
|
+
...J,
|
|
3227
|
+
includeInSubmission: H().optional().default(!1),
|
|
3228
|
+
options: W(Po).min(1)
|
|
3229
|
+
}),
|
|
3230
|
+
getDefaultValue(e) {
|
|
3231
|
+
return typeof e.defaultValue == "string" ? e.defaultValue : null;
|
|
3232
|
+
},
|
|
3233
|
+
normalizeValue(e) {
|
|
3234
|
+
return e == null || e === "" ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" ? `${e}` : null;
|
|
3235
|
+
},
|
|
3236
|
+
validate(e, t) {
|
|
3237
|
+
return e === null || t.options.map((e) => e.value).includes(e) ? [] : [q.categoryOptionMismatch];
|
|
3238
|
+
},
|
|
3239
|
+
describe(e, t) {
|
|
3240
|
+
return Y("category-field", e, {
|
|
3241
|
+
value: t.state.value,
|
|
3242
|
+
options: e.options.map((e) => ({
|
|
3243
|
+
label: e.label,
|
|
3244
|
+
value: e.value
|
|
3245
|
+
})),
|
|
3246
|
+
state: t.state.status,
|
|
3247
|
+
errors: t.state.errors
|
|
3248
|
+
});
|
|
3249
|
+
}
|
|
3250
|
+
}, Io = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "item", X = (e) => typeof e == "object" && !!e && !Array.isArray(e), Lo = (e) => typeof e == "object" && !!e || typeof e == "function", Ro = (e) => Lo(e) && "then" in e && typeof e.then == "function", zo = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : e instanceof Date ? Number.isNaN(e.getTime()) : !1, Bo = (e) => {
|
|
3218
3251
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
3219
3252
|
if (typeof e == "string" || typeof e == "number") {
|
|
3220
3253
|
let t = new Date(e);
|
|
3221
3254
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
3222
3255
|
}
|
|
3223
3256
|
return null;
|
|
3224
|
-
},
|
|
3257
|
+
}, Vo = (e) => e, Ho = (e) => {
|
|
3225
3258
|
let t = typeof ArrayBuffer < "u" && ArrayBuffer.isView(e), n = typeof ArrayBuffer < "u" && e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer, r = typeof Blob < "u" && e instanceof Blob || typeof File < "u" && e instanceof File;
|
|
3226
3259
|
if (e !== null && (typeof e == "object" || typeof e == "function") && !t && !n && !r && !Object.isFrozen(e)) {
|
|
3227
3260
|
Object.freeze(e);
|
|
3228
|
-
for (let t of Object.values(e))
|
|
3261
|
+
for (let t of Object.values(e)) Ho(t);
|
|
3229
3262
|
}
|
|
3230
3263
|
return e;
|
|
3231
|
-
},
|
|
3264
|
+
}, Uo = (e, t) => e <= 0 ? Promise.resolve() : new Promise((n, r) => {
|
|
3232
3265
|
let i = setTimeout(() => {
|
|
3233
3266
|
t?.removeEventListener("abort", a), n();
|
|
3234
3267
|
}, e), a = () => {
|
|
@@ -3239,7 +3272,7 @@ var xo = {
|
|
|
3239
3272
|
return;
|
|
3240
3273
|
}
|
|
3241
3274
|
t?.addEventListener("abort", a, { once: !0 });
|
|
3242
|
-
}),
|
|
3275
|
+
}), Wo = {
|
|
3243
3276
|
kind: "date",
|
|
3244
3277
|
schema: G({
|
|
3245
3278
|
kind: K("date"),
|
|
@@ -3249,16 +3282,16 @@ var xo = {
|
|
|
3249
3282
|
step: V().positive().optional()
|
|
3250
3283
|
}),
|
|
3251
3284
|
getDefaultValue(e) {
|
|
3252
|
-
return
|
|
3285
|
+
return Bo(e.defaultValue) ?? null;
|
|
3253
3286
|
},
|
|
3254
3287
|
normalizeValue(e) {
|
|
3255
|
-
return
|
|
3288
|
+
return Bo(e);
|
|
3256
3289
|
},
|
|
3257
3290
|
serializeValue(e) {
|
|
3258
3291
|
return e instanceof Date ? e.toISOString() : e;
|
|
3259
3292
|
},
|
|
3260
3293
|
validate(e, t) {
|
|
3261
|
-
let n = [], r =
|
|
3294
|
+
let n = [], r = Bo(t.min), i = Bo(t.max);
|
|
3262
3295
|
if (r && i && r.getTime() > i.getTime() && n.push(q.invalidDateRange), e === null) return n;
|
|
3263
3296
|
if (r && e.getTime() < r.getTime() && n.push(q.dateOnOrAfter(String(t.min))), i && e.getTime() > i.getTime() && n.push(q.dateOnOrBefore(String(t.max))), t.step !== void 0) {
|
|
3264
3297
|
let i = r ?? /* @__PURE__ */ new Date("1970-01-01T00:00:00Z");
|
|
@@ -3276,7 +3309,7 @@ var xo = {
|
|
|
3276
3309
|
errors: t.state.errors
|
|
3277
3310
|
});
|
|
3278
3311
|
}
|
|
3279
|
-
},
|
|
3312
|
+
}, Go = {
|
|
3280
3313
|
kind: "long-text",
|
|
3281
3314
|
schema: G({
|
|
3282
3315
|
kind: K("long-text"),
|
|
@@ -3307,7 +3340,7 @@ var xo = {
|
|
|
3307
3340
|
errors: t.state.errors
|
|
3308
3341
|
});
|
|
3309
3342
|
}
|
|
3310
|
-
},
|
|
3343
|
+
}, Ko = {
|
|
3311
3344
|
kind: "multi-choice",
|
|
3312
3345
|
schema: G({
|
|
3313
3346
|
kind: K("multi-choice"),
|
|
@@ -3341,7 +3374,7 @@ var xo = {
|
|
|
3341
3374
|
errors: t.state.errors
|
|
3342
3375
|
});
|
|
3343
3376
|
}
|
|
3344
|
-
},
|
|
3377
|
+
}, qo = {
|
|
3345
3378
|
kind: "number",
|
|
3346
3379
|
schema: G({
|
|
3347
3380
|
kind: K("number"),
|
|
@@ -3391,7 +3424,7 @@ var xo = {
|
|
|
3391
3424
|
errors: t.state.errors
|
|
3392
3425
|
});
|
|
3393
3426
|
}
|
|
3394
|
-
},
|
|
3427
|
+
}, Jo = {
|
|
3395
3428
|
kind: "rating",
|
|
3396
3429
|
schema: G({
|
|
3397
3430
|
kind: K("rating"),
|
|
@@ -3423,7 +3456,7 @@ var xo = {
|
|
|
3423
3456
|
errors: t.state.errors
|
|
3424
3457
|
});
|
|
3425
3458
|
}
|
|
3426
|
-
},
|
|
3459
|
+
}, Yo = {
|
|
3427
3460
|
kind: "text",
|
|
3428
3461
|
schema: G({
|
|
3429
3462
|
kind: K("text"),
|
|
@@ -3454,16 +3487,16 @@ var xo = {
|
|
|
3454
3487
|
errors: t.state.errors
|
|
3455
3488
|
});
|
|
3456
3489
|
}
|
|
3457
|
-
},
|
|
3490
|
+
}, Xo = G({
|
|
3458
3491
|
kind: z().min(1),
|
|
3459
3492
|
label: z().min(1),
|
|
3460
3493
|
required: H().optional()
|
|
3461
|
-
}).passthrough(),
|
|
3462
|
-
text:
|
|
3463
|
-
number:
|
|
3464
|
-
date:
|
|
3494
|
+
}).passthrough(), Zo = "This field is required.", Qo = (e) => e.toISOString().slice(0, 10), $o = {
|
|
3495
|
+
text: Yo,
|
|
3496
|
+
number: qo,
|
|
3497
|
+
date: Wo,
|
|
3465
3498
|
category: No
|
|
3466
|
-
},
|
|
3499
|
+
}, es = (e) => $o[e], ts = (e) => {
|
|
3467
3500
|
if (e == null || e === "") return null;
|
|
3468
3501
|
if (typeof e == "boolean") return e;
|
|
3469
3502
|
if (typeof e == "string") {
|
|
@@ -3471,17 +3504,17 @@ var xo = {
|
|
|
3471
3504
|
if (e === "false") return !1;
|
|
3472
3505
|
}
|
|
3473
3506
|
return !!e;
|
|
3474
|
-
},
|
|
3475
|
-
if (e.kind === Mo.kind) return
|
|
3476
|
-
let n =
|
|
3507
|
+
}, ns = (e, t) => {
|
|
3508
|
+
if (e.kind === Mo.kind) return ts(t);
|
|
3509
|
+
let n = es(e.kind);
|
|
3477
3510
|
return n?.normalizeValue ? n.normalizeValue(t, e) : t;
|
|
3478
|
-
},
|
|
3511
|
+
}, rs = (e, t) => {
|
|
3479
3512
|
if (t == null) return null;
|
|
3480
|
-
if (e.kind === "date" && t instanceof Date) return
|
|
3481
|
-
let n =
|
|
3513
|
+
if (e.kind === "date" && t instanceof Date) return Qo(t);
|
|
3514
|
+
let n = es(e.kind);
|
|
3482
3515
|
return n?.serializeValue ? n.serializeValue(t, e) : t;
|
|
3483
|
-
},
|
|
3484
|
-
if (e.required &&
|
|
3516
|
+
}, is = (e, t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : e.kind === Mo.kind ? t == null : !1, as = (e, t) => {
|
|
3517
|
+
if (e.required && is(e, t)) return [Zo];
|
|
3485
3518
|
if (e.kind === Mo.kind) {
|
|
3486
3519
|
if (t === null) return [];
|
|
3487
3520
|
let n = Mo.validate?.(t, e, {
|
|
@@ -3496,7 +3529,7 @@ var xo = {
|
|
|
3496
3529
|
});
|
|
3497
3530
|
return Array.isArray(n) ? n : [];
|
|
3498
3531
|
}
|
|
3499
|
-
let n =
|
|
3532
|
+
let n = es(e.kind);
|
|
3500
3533
|
if (!n?.validate) return [];
|
|
3501
3534
|
let r = n.validate(t, e, {
|
|
3502
3535
|
field: {
|
|
@@ -3509,7 +3542,7 @@ var xo = {
|
|
|
3509
3542
|
signal: void 0
|
|
3510
3543
|
});
|
|
3511
3544
|
return Array.isArray(r) ? r : [];
|
|
3512
|
-
},
|
|
3545
|
+
}, os = (e, t, n) => n.map((n) => `Row ${e + 1} (${t}): ${n}`), ss = (e) => {
|
|
3513
3546
|
if (Array.isArray(e)) return e.length >= 2 ? {
|
|
3514
3547
|
field1: e[0],
|
|
3515
3548
|
field2: e[1]
|
|
@@ -3524,46 +3557,46 @@ var xo = {
|
|
|
3524
3557
|
field1: t[0]?.[1],
|
|
3525
3558
|
field2: t[1]?.[1]
|
|
3526
3559
|
};
|
|
3527
|
-
},
|
|
3528
|
-
let n =
|
|
3560
|
+
}, cs = (e, t) => {
|
|
3561
|
+
let n = ss(e);
|
|
3529
3562
|
return n ? {
|
|
3530
|
-
field1:
|
|
3531
|
-
field2:
|
|
3563
|
+
field1: ns(t.field1, n.field1),
|
|
3564
|
+
field2: ns(t.field2, n.field2)
|
|
3532
3565
|
} : null;
|
|
3533
|
-
},
|
|
3566
|
+
}, ls = {
|
|
3534
3567
|
kind: "series",
|
|
3535
3568
|
schema: G({
|
|
3536
3569
|
kind: K("series"),
|
|
3537
3570
|
...J,
|
|
3538
|
-
field1:
|
|
3539
|
-
field2:
|
|
3571
|
+
field1: Xo,
|
|
3572
|
+
field2: Xo,
|
|
3540
3573
|
minPoints: V().int().nonnegative().optional(),
|
|
3541
3574
|
maxPoints: V().int().nonnegative().optional()
|
|
3542
3575
|
}),
|
|
3543
3576
|
getDefaultValue(e) {
|
|
3544
|
-
return Array.isArray(e.defaultValue) ? e.defaultValue.map((t) =>
|
|
3577
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue.map((t) => cs(t, e)).filter((e) => e !== null) : [];
|
|
3545
3578
|
},
|
|
3546
3579
|
normalizeValue(e, t) {
|
|
3547
|
-
return Array.isArray(e) ? e.map((e) =>
|
|
3580
|
+
return Array.isArray(e) ? e.map((e) => cs(e, t)).filter((e) => e !== null) : [];
|
|
3548
3581
|
},
|
|
3549
3582
|
serializeValue(e, t) {
|
|
3550
3583
|
return e.map((e) => ({
|
|
3551
|
-
field1:
|
|
3552
|
-
field2:
|
|
3584
|
+
field1: rs(t.field1, e.field1),
|
|
3585
|
+
field2: rs(t.field2, e.field2)
|
|
3553
3586
|
}));
|
|
3554
3587
|
},
|
|
3555
3588
|
validate(e, t) {
|
|
3556
3589
|
let n = /* @__PURE__ */ new Set();
|
|
3557
3590
|
return t.minPoints !== void 0 && t.maxPoints !== void 0 && t.minPoints > t.maxPoints && n.add(q.invalidPointCountRange), t.minPoints !== void 0 && e.length < t.minPoints && n.add(q.minPoints(t.minPoints)), t.maxPoints !== void 0 && e.length > t.maxPoints && n.add(q.maxPoints(t.maxPoints)), e.forEach((e, r) => {
|
|
3558
|
-
for (let i of
|
|
3559
|
-
for (let i of
|
|
3591
|
+
for (let i of os(r, t.field1.label, as(t.field1, e.field1))) n.add(i);
|
|
3592
|
+
for (let i of os(r, t.field2.label, as(t.field2, e.field2))) n.add(i);
|
|
3560
3593
|
}), [...n];
|
|
3561
3594
|
},
|
|
3562
3595
|
describe(e, t) {
|
|
3563
3596
|
return Y("series-field", e, {
|
|
3564
3597
|
value: Array.isArray(t.state.value) ? t.state.value.map((t) => X(t) ? {
|
|
3565
|
-
field1:
|
|
3566
|
-
field2:
|
|
3598
|
+
field1: rs(e.field1, t.field1),
|
|
3599
|
+
field2: rs(e.field2, t.field2)
|
|
3567
3600
|
} : t) : [],
|
|
3568
3601
|
field1: e.field1,
|
|
3569
3602
|
field2: e.field2,
|
|
@@ -3573,7 +3606,7 @@ var xo = {
|
|
|
3573
3606
|
errors: t.state.errors
|
|
3574
3607
|
});
|
|
3575
3608
|
}
|
|
3576
|
-
},
|
|
3609
|
+
}, us = {
|
|
3577
3610
|
kind: "single-choice",
|
|
3578
3611
|
schema: G({
|
|
3579
3612
|
kind: K("single-choice"),
|
|
@@ -3599,7 +3632,7 @@ var xo = {
|
|
|
3599
3632
|
errors: t.state.errors
|
|
3600
3633
|
});
|
|
3601
3634
|
}
|
|
3602
|
-
},
|
|
3635
|
+
}, ds = {
|
|
3603
3636
|
kind: "classifier",
|
|
3604
3637
|
partialUpdatePolicy: "validate",
|
|
3605
3638
|
schema: G({
|
|
@@ -3628,7 +3661,7 @@ var xo = {
|
|
|
3628
3661
|
}
|
|
3629
3662
|
};
|
|
3630
3663
|
}
|
|
3631
|
-
},
|
|
3664
|
+
}, fs = {
|
|
3632
3665
|
kind: "regressor",
|
|
3633
3666
|
partialUpdatePolicy: "validate",
|
|
3634
3667
|
schema: G({
|
|
@@ -3657,64 +3690,64 @@ var xo = {
|
|
|
3657
3690
|
}
|
|
3658
3691
|
};
|
|
3659
3692
|
}
|
|
3660
|
-
},
|
|
3693
|
+
}, ps = () => {
|
|
3661
3694
|
let e = S();
|
|
3662
|
-
return e.registerField(
|
|
3663
|
-
},
|
|
3695
|
+
return e.registerField(Yo).registerField(qo).registerField(Mo).registerField(No).registerField(Fo).registerField(Wo).registerField(ls).registerField(Go).registerField(us).registerField(Ko).registerField(Jo).registerReport(ds).registerReport(fs), e;
|
|
3696
|
+
}, ms = (e) => typeof e == "object" && !!e && !Array.isArray(e), hs = (e, t) => Object.is(e, t), gs = (e, t) => e === t ? !0 : e.length === t.length ? e.every((e, n) => Object.is(e, t[n])) : !1, _s = (e, t) => {
|
|
3664
3697
|
if (e === t) return !0;
|
|
3665
3698
|
let n = Object.keys(e), r = Object.keys(t);
|
|
3666
3699
|
return n.length === r.length ? n.every((n) => Object.is(e[n], t[n])) : !1;
|
|
3667
|
-
},
|
|
3700
|
+
}, vs = (e, t) => Object.is(e, t) ? !0 : Array.isArray(e) && Array.isArray(t) ? gs(e, t) : ms(e) && ms(t) ? _s(e, t) : !1, ys = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), bs = (e) => {
|
|
3668
3701
|
let t = new Uint8Array(e.byteLength);
|
|
3669
3702
|
return t.set(new Uint8Array(e)), t.buffer;
|
|
3670
|
-
},
|
|
3703
|
+
}, xs = (e) => typeof File < "u" && e instanceof File ? new File([e], e.name, {
|
|
3671
3704
|
type: e.type,
|
|
3672
3705
|
lastModified: e.lastModified
|
|
3673
|
-
}) : typeof Blob < "u" && e instanceof Blob ? e.slice(0, e.size, e.type) : e,
|
|
3706
|
+
}) : typeof Blob < "u" && e instanceof Blob ? e.slice(0, e.size, e.type) : e, Ss = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Cs = (e, t) => e.byteLength === t.byteLength ? Ss(new Uint8Array(e), new Uint8Array(t)) : !1, Z = (e) => {
|
|
3674
3707
|
if (e instanceof Date) return new Date(e.getTime());
|
|
3675
3708
|
if (e instanceof RegExp) return new RegExp(e.source, e.flags);
|
|
3676
|
-
if (e instanceof ArrayBuffer) return
|
|
3677
|
-
if (e instanceof DataView) return new DataView(
|
|
3678
|
-
if (
|
|
3709
|
+
if (e instanceof ArrayBuffer) return bs(e);
|
|
3710
|
+
if (e instanceof DataView) return new DataView(bs(e.buffer), e.byteOffset, e.byteLength);
|
|
3711
|
+
if (ys(e)) {
|
|
3679
3712
|
let t = e.constructor;
|
|
3680
|
-
return new t(
|
|
3713
|
+
return new t(bs(e.buffer), e.byteOffset, e.length);
|
|
3681
3714
|
}
|
|
3682
|
-
return e instanceof Map ? new Map(Array.from(e.entries(), ([e, t]) => [Z(e), Z(t)])) : e instanceof Set ? new Set(Array.from(e.values(), (e) => Z(e))) : typeof File < "u" && e instanceof File || typeof Blob < "u" && e instanceof Blob ?
|
|
3683
|
-
},
|
|
3715
|
+
return e instanceof Map ? new Map(Array.from(e.entries(), ([e, t]) => [Z(e), Z(t)])) : e instanceof Set ? new Set(Array.from(e.values(), (e) => Z(e))) : typeof File < "u" && e instanceof File || typeof Blob < "u" && e instanceof Blob ? xs(e) : Array.isArray(e) ? e.map((e) => Z(e)) : X(e) ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Z(t)])) : e;
|
|
3716
|
+
}, ws = (e, t) => {
|
|
3684
3717
|
if (Object.is(e, t)) return !0;
|
|
3685
3718
|
if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
|
|
3686
3719
|
if (e instanceof RegExp && t instanceof RegExp) return e.source === t.source && e.flags === t.flags;
|
|
3687
|
-
if (e instanceof ArrayBuffer && t instanceof ArrayBuffer) return
|
|
3688
|
-
if (e instanceof DataView && t instanceof DataView) return e.byteOffset === t.byteOffset && e.byteLength === t.byteLength &&
|
|
3689
|
-
if (
|
|
3720
|
+
if (e instanceof ArrayBuffer && t instanceof ArrayBuffer) return Cs(e, t);
|
|
3721
|
+
if (e instanceof DataView && t instanceof DataView) return e.byteOffset === t.byteOffset && e.byteLength === t.byteLength && Cs(e.buffer, t.buffer);
|
|
3722
|
+
if (ys(e) && ys(t)) {
|
|
3690
3723
|
let n = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), r = new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
|
|
3691
|
-
return e.constructor === t.constructor &&
|
|
3724
|
+
return e.constructor === t.constructor && Ss(n, r);
|
|
3692
3725
|
}
|
|
3693
3726
|
if (e instanceof Map && t instanceof Map) return e.size === t.size && Array.from(e.entries()).every(([e, n], r) => {
|
|
3694
3727
|
let i = Array.from(t.entries())[r];
|
|
3695
|
-
return i !== void 0 &&
|
|
3728
|
+
return i !== void 0 && ws(e, i[0]) && ws(n, i[1]);
|
|
3696
3729
|
});
|
|
3697
3730
|
if (e instanceof Set && t instanceof Set) {
|
|
3698
3731
|
let n = Array.from(t.values());
|
|
3699
3732
|
for (let t of e.values()) {
|
|
3700
|
-
let e = n.findIndex((e) =>
|
|
3733
|
+
let e = n.findIndex((e) => ws(t, e));
|
|
3701
3734
|
if (e < 0) return !1;
|
|
3702
3735
|
n.splice(e, 1);
|
|
3703
3736
|
}
|
|
3704
3737
|
return n.length === 0;
|
|
3705
3738
|
}
|
|
3706
3739
|
if (typeof Blob < "u" && typeof File < "u" && e instanceof Blob && t instanceof Blob) return e.size === t.size && e.type === t.type ? e instanceof File && t instanceof File ? e.name === t.name && e.lastModified === t.lastModified : !0 : !1;
|
|
3707
|
-
if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((e, n) =>
|
|
3740
|
+
if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((e, n) => ws(e, t[n]));
|
|
3708
3741
|
if (X(e) && X(t)) {
|
|
3709
3742
|
let n = Object.keys(e), r = Object.keys(t);
|
|
3710
|
-
return n.length === r.length && n.every((n) =>
|
|
3743
|
+
return n.length === r.length && n.every((n) => ws(e[n], t[n]));
|
|
3711
3744
|
}
|
|
3712
3745
|
return !1;
|
|
3713
3746
|
}, Q = {
|
|
3714
3747
|
status: "idle",
|
|
3715
3748
|
result: void 0,
|
|
3716
3749
|
error: null
|
|
3717
|
-
},
|
|
3750
|
+
}, Ts = (e) => e instanceof Error ? e.message : typeof e == "string" && e.trim().length > 0 ? e : String(e), Es = (e, t, n) => {
|
|
3718
3751
|
e.update((e) => ({
|
|
3719
3752
|
...e,
|
|
3720
3753
|
explanationStates: {
|
|
@@ -3722,7 +3755,7 @@ var xo = {
|
|
|
3722
3755
|
[t]: n
|
|
3723
3756
|
}
|
|
3724
3757
|
}));
|
|
3725
|
-
},
|
|
3758
|
+
}, Ds = (e) => {
|
|
3726
3759
|
let t = e.filter((e) => e !== void 0);
|
|
3727
3760
|
if (t.length === 0) return {
|
|
3728
3761
|
signal: void 0,
|
|
@@ -3743,9 +3776,9 @@ var xo = {
|
|
|
3743
3776
|
for (let e of r) e();
|
|
3744
3777
|
}
|
|
3745
3778
|
};
|
|
3746
|
-
},
|
|
3747
|
-
let i =
|
|
3748
|
-
|
|
3779
|
+
}, Os = ({ config: e, definition: t, store: n, hooks: r }) => {
|
|
3780
|
+
let i = Ho(Z(e));
|
|
3781
|
+
Es(n, i.id, Q);
|
|
3749
3782
|
let a = null;
|
|
3750
3783
|
return {
|
|
3751
3784
|
get id() {
|
|
@@ -3771,22 +3804,22 @@ var xo = {
|
|
|
3771
3804
|
if ((n.getState().explanationStates[i.id] ?? Q).status !== "idle") return;
|
|
3772
3805
|
a?.abort();
|
|
3773
3806
|
let o = new AbortController();
|
|
3774
|
-
a = o,
|
|
3807
|
+
a = o, Es(n, i.id, {
|
|
3775
3808
|
status: "loading",
|
|
3776
3809
|
result: void 0,
|
|
3777
3810
|
error: null
|
|
3778
3811
|
});
|
|
3779
|
-
let s = t.transport(i), { signal: c, cleanup: l } =
|
|
3812
|
+
let s = t.transport(i), { signal: c, cleanup: l } = Ds([e.signal, o.signal]);
|
|
3780
3813
|
try {
|
|
3781
3814
|
let t = await s.submit({
|
|
3782
3815
|
...e,
|
|
3783
3816
|
signal: c
|
|
3784
3817
|
});
|
|
3785
3818
|
if (o.signal.aborted || c?.aborted) {
|
|
3786
|
-
|
|
3819
|
+
Es(n, i.id, Q);
|
|
3787
3820
|
return;
|
|
3788
3821
|
}
|
|
3789
|
-
|
|
3822
|
+
Es(n, i.id, {
|
|
3790
3823
|
status: "done",
|
|
3791
3824
|
result: t,
|
|
3792
3825
|
error: null
|
|
@@ -3797,11 +3830,11 @@ var xo = {
|
|
|
3797
3830
|
});
|
|
3798
3831
|
} catch (e) {
|
|
3799
3832
|
if (o.signal.aborted || c?.aborted || u(e)) {
|
|
3800
|
-
|
|
3833
|
+
Es(n, i.id, Q);
|
|
3801
3834
|
return;
|
|
3802
3835
|
}
|
|
3803
|
-
let t =
|
|
3804
|
-
|
|
3836
|
+
let t = Ts(e);
|
|
3837
|
+
Es(n, i.id, {
|
|
3805
3838
|
status: "error",
|
|
3806
3839
|
result: void 0,
|
|
3807
3840
|
error: t
|
|
@@ -3815,20 +3848,20 @@ var xo = {
|
|
|
3815
3848
|
}
|
|
3816
3849
|
},
|
|
3817
3850
|
abort() {
|
|
3818
|
-
a?.abort(), a = null,
|
|
3851
|
+
a?.abort(), a = null, Es(n, i.id, Q);
|
|
3819
3852
|
},
|
|
3820
3853
|
reset() {
|
|
3821
|
-
a?.abort(), a = null,
|
|
3854
|
+
a?.abort(), a = null, Es(n, i.id, Q);
|
|
3822
3855
|
},
|
|
3823
3856
|
subscribe(e) {
|
|
3824
3857
|
let t = n.getState().explanationStates[i.id] ?? Q;
|
|
3825
3858
|
return n.subscribe(() => {
|
|
3826
3859
|
let r = n.getState().explanationStates[i.id] ?? Q;
|
|
3827
|
-
|
|
3860
|
+
hs(t, r) || (t = r, e(Z(r)));
|
|
3828
3861
|
});
|
|
3829
3862
|
}
|
|
3830
3863
|
};
|
|
3831
|
-
},
|
|
3864
|
+
}, ks = "Unknown explanation error.", As = async ({ explanations: e, request: t }) => {
|
|
3832
3865
|
if (e.length === 0) return {
|
|
3833
3866
|
results: {},
|
|
3834
3867
|
errors: {}
|
|
@@ -3845,13 +3878,13 @@ var xo = {
|
|
|
3845
3878
|
n[t.id] = e.result;
|
|
3846
3879
|
continue;
|
|
3847
3880
|
}
|
|
3848
|
-
e.status === "error" && (r[t.id] = e.error ??
|
|
3881
|
+
e.status === "error" && (r[t.id] = e.error ?? ks);
|
|
3849
3882
|
}
|
|
3850
3883
|
return {
|
|
3851
3884
|
results: n,
|
|
3852
3885
|
errors: r
|
|
3853
3886
|
};
|
|
3854
|
-
},
|
|
3887
|
+
}, js = Object.freeze({}), Ms = (e, t) => ({
|
|
3855
3888
|
explanationId: "",
|
|
3856
3889
|
backend: e.backend,
|
|
3857
3890
|
values: e.values,
|
|
@@ -3862,10 +3895,10 @@ var xo = {
|
|
|
3862
3895
|
meta: e.meta,
|
|
3863
3896
|
raw: e.raw,
|
|
3864
3897
|
signal: t
|
|
3865
|
-
}),
|
|
3866
|
-
let i = await e.submit(t), a = r === "all" ? await
|
|
3898
|
+
}), Ns = async ({ form: e, submit: t, artifactAdapter: n, explanationMode: r = "all" }) => {
|
|
3899
|
+
let i = await e.submit(t), a = r === "all" ? await As({
|
|
3867
3900
|
explanations: e.explanations,
|
|
3868
|
-
request:
|
|
3901
|
+
request: Ms(i, t?.signal)
|
|
3869
3902
|
}) : {
|
|
3870
3903
|
results: {},
|
|
3871
3904
|
errors: {}
|
|
@@ -3873,14 +3906,14 @@ var xo = {
|
|
|
3873
3906
|
submitResult: i,
|
|
3874
3907
|
explanationResults: a.results,
|
|
3875
3908
|
explanationErrors: a.errors
|
|
3876
|
-
}, s = n ? await n.derive(o) :
|
|
3909
|
+
}, s = n ? await n.derive(o) : js;
|
|
3877
3910
|
return {
|
|
3878
3911
|
submitResult: i,
|
|
3879
3912
|
explanationResults: a.results,
|
|
3880
3913
|
explanationErrors: a.errors,
|
|
3881
3914
|
artifacts: s
|
|
3882
3915
|
};
|
|
3883
|
-
},
|
|
3916
|
+
}, Ps = (e, t) => (Array.isArray(e) ? e : (e ?? t).split(".")).map((e) => e.trim()).filter(Boolean), Fs = (e, t, n) => {
|
|
3884
3917
|
if (t.length === 0) return;
|
|
3885
3918
|
let r = e;
|
|
3886
3919
|
for (let e of t.slice(0, -1)) {
|
|
@@ -3893,26 +3926,27 @@ var xo = {
|
|
|
3893
3926
|
r = t;
|
|
3894
3927
|
}
|
|
3895
3928
|
r[t[t.length - 1]] = n;
|
|
3896
|
-
},
|
|
3929
|
+
}, Is = (e) => {
|
|
3897
3930
|
try {
|
|
3898
3931
|
return new TextEncoder().encode(JSON.stringify(e)).byteLength;
|
|
3899
3932
|
} catch {
|
|
3900
3933
|
return;
|
|
3901
3934
|
}
|
|
3902
|
-
},
|
|
3935
|
+
}, Ls = (e) => ({
|
|
3903
3936
|
values: Z(e.values),
|
|
3904
3937
|
fieldValues: Z(e.fieldValues),
|
|
3905
3938
|
serializedValues: Z(e.serializedValues),
|
|
3906
3939
|
serializedFieldValues: Z(e.serializedFieldValues)
|
|
3907
|
-
}),
|
|
3940
|
+
}), Rs = (e, t) => {
|
|
3941
|
+
if (e.config.includeInSubmission === !1) return !1;
|
|
3908
3942
|
let n = t(e), r = e.state;
|
|
3909
3943
|
return !((!r.visible || r.disabled) && (n === "omit" || n === "reset-on-hide"));
|
|
3910
|
-
},
|
|
3944
|
+
}, zs = (e, t) => {
|
|
3911
3945
|
let n = {}, r = {}, i = {}, a = {};
|
|
3912
3946
|
for (let o of e) {
|
|
3913
|
-
if (!
|
|
3914
|
-
let e =
|
|
3915
|
-
r[o.id] = Z(s), a[o.id] = Z(c),
|
|
3947
|
+
if (!Rs(o, t)) continue;
|
|
3948
|
+
let e = Ps(o.config.valuePath, o.id), s = o.state.value, c = o.serialize();
|
|
3949
|
+
r[o.id] = Z(s), a[o.id] = Z(c), Fs(n, e, Z(s)), Fs(i, e, Z(c));
|
|
3916
3950
|
}
|
|
3917
3951
|
return {
|
|
3918
3952
|
values: n,
|
|
@@ -3920,26 +3954,26 @@ var xo = {
|
|
|
3920
3954
|
serializedValues: i,
|
|
3921
3955
|
serializedFieldValues: a
|
|
3922
3956
|
};
|
|
3923
|
-
},
|
|
3957
|
+
}, Bs = (e) => X(e) ? {
|
|
3924
3958
|
reports: X(e.reports) ? e.reports : void 0,
|
|
3925
3959
|
meta: X(e.meta) ? e.meta : void 0,
|
|
3926
3960
|
raw: "raw" in e ? e.raw : e
|
|
3927
|
-
} : { raw: e },
|
|
3961
|
+
} : { raw: e }, Vs = async (e, t) => {
|
|
3928
3962
|
let n = /* @__PURE__ */ new Map();
|
|
3929
3963
|
return await Promise.all(e.map(async (e) => {
|
|
3930
3964
|
n.set(e.id, await e.prepareState(t));
|
|
3931
3965
|
})), n;
|
|
3932
|
-
},
|
|
3966
|
+
}, Hs = (e, t) => {
|
|
3933
3967
|
for (let n of e) {
|
|
3934
3968
|
let e = t.get(n.id);
|
|
3935
3969
|
if (!e) throw new r(`Prepared report state missing for "${n.id}".`);
|
|
3936
3970
|
n.commitState(e);
|
|
3937
3971
|
}
|
|
3938
|
-
},
|
|
3972
|
+
}, Us = (e, t) => Object.fromEntries(e.map((e) => {
|
|
3939
3973
|
let n = t.get(e.id);
|
|
3940
3974
|
if (!n) throw new r(`Prepared report state missing for "${e.id}".`);
|
|
3941
3975
|
return [e.id, e.cloneState(n)];
|
|
3942
|
-
})),
|
|
3976
|
+
})), Ws = (e) => {
|
|
3943
3977
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e.getTime();
|
|
3944
3978
|
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
3945
3979
|
if (typeof e == "string") {
|
|
@@ -3947,11 +3981,11 @@ var xo = {
|
|
|
3947
3981
|
return !Number.isNaN(t) && /^\d{4}-\d{2}-\d{2}/.test(e) ? t : e;
|
|
3948
3982
|
}
|
|
3949
3983
|
return typeof e == "bigint" ? e : null;
|
|
3950
|
-
},
|
|
3951
|
-
let n =
|
|
3984
|
+
}, Gs = (e, t) => {
|
|
3985
|
+
let n = Ws(e), r = Ws(t);
|
|
3952
3986
|
return n === null || r === null || typeof n != typeof r ? null : n === r ? 0 : n < r ? -1 : 1;
|
|
3953
|
-
},
|
|
3954
|
-
let r =
|
|
3987
|
+
}, Ks = (e, t, n) => e ? typeof e == "function" ? e(t) : Xs(e, t) : n, qs = (e, t) => t.some((t) => Object.is(t, e)), Js = (e, t, n) => {
|
|
3988
|
+
let r = Gs(e, t);
|
|
3955
3989
|
if (r === null) return !1;
|
|
3956
3990
|
switch (n) {
|
|
3957
3991
|
case "eq": return r === 0;
|
|
@@ -3960,27 +3994,27 @@ var xo = {
|
|
|
3960
3994
|
case "gte": return r >= 0;
|
|
3961
3995
|
case "lt": return r < 0;
|
|
3962
3996
|
case "lte": return r <= 0;
|
|
3963
|
-
default: return
|
|
3997
|
+
default: return Ys(n);
|
|
3964
3998
|
}
|
|
3965
|
-
},
|
|
3999
|
+
}, Ys = (e) => {
|
|
3966
4000
|
throw Error("Unsupported comparison operator.");
|
|
3967
|
-
},
|
|
4001
|
+
}, Xs = (e, t) => {
|
|
3968
4002
|
switch (e.kind) {
|
|
3969
4003
|
case "field-value": {
|
|
3970
4004
|
let n = t.values[e.field];
|
|
3971
|
-
return !(e.equals !== void 0 && !Object.is(n, e.equals) || e.notEquals !== void 0 && Object.is(n, e.notEquals) || e.greaterThan !== void 0 && !
|
|
4005
|
+
return !(e.equals !== void 0 && !Object.is(n, e.equals) || e.notEquals !== void 0 && Object.is(n, e.notEquals) || e.greaterThan !== void 0 && !Js(n, e.greaterThan, "gt") || e.greaterThanOrEqual !== void 0 && !Js(n, e.greaterThanOrEqual, "gte") || e.lessThan !== void 0 && !Js(n, e.lessThan, "lt") || e.lessThanOrEqual !== void 0 && !Js(n, e.lessThanOrEqual, "lte") || e.in && !qs(n, e.in) || e.notIn && qs(n, e.notIn) || e.empty === !0 && !zo(n) || e.notEmpty === !0 && zo(n) || e.truthy === !0 && !n || e.falsy === !0 && n);
|
|
3972
4006
|
}
|
|
3973
|
-
case "field-comparison": return
|
|
4007
|
+
case "field-comparison": return Js(t.values[e.field], t.values[e.otherField], e.operator);
|
|
3974
4008
|
case "form-status": return (Array.isArray(e.equals) ? e.equals : [e.equals]).includes(t.formStatus);
|
|
3975
4009
|
case "submit-count": return !(e.eq !== void 0 && t.submitCount !== e.eq || e.gte !== void 0 && t.submitCount < e.gte || e.lte !== void 0 && t.submitCount > e.lte);
|
|
3976
|
-
case "all": return e.conditions.every((e) =>
|
|
3977
|
-
case "any": return e.conditions.some((e) =>
|
|
3978
|
-
case "not": return !
|
|
3979
|
-
default: return
|
|
4010
|
+
case "all": return e.conditions.every((e) => Xs(e, t));
|
|
4011
|
+
case "any": return e.conditions.some((e) => Xs(e, t));
|
|
4012
|
+
case "not": return !Xs(e.condition, t);
|
|
4013
|
+
default: return Zs(e);
|
|
3980
4014
|
}
|
|
3981
|
-
},
|
|
4015
|
+
}, Zs = (e) => {
|
|
3982
4016
|
throw Error("Unsupported field condition.");
|
|
3983
|
-
},
|
|
4017
|
+
}, Qs = (e, t, n, r) => {
|
|
3984
4018
|
let i = {
|
|
3985
4019
|
field: e,
|
|
3986
4020
|
values: t,
|
|
@@ -3988,31 +4022,31 @@ var xo = {
|
|
|
3988
4022
|
formStatus: r
|
|
3989
4023
|
};
|
|
3990
4024
|
return {
|
|
3991
|
-
visible: !
|
|
3992
|
-
disabled:
|
|
3993
|
-
readOnly:
|
|
4025
|
+
visible: !Ks(e.hiddenWhen, i, !!e.hidden),
|
|
4026
|
+
disabled: Ks(e.disabledWhen, i, !!e.disabled),
|
|
4027
|
+
readOnly: Ks(e.readOnlyWhen, i, !!e.readOnly)
|
|
3994
4028
|
};
|
|
3995
|
-
},
|
|
4029
|
+
}, $s = (e) => [
|
|
3996
4030
|
...e.syncErrors,
|
|
3997
4031
|
...e.validationErrors,
|
|
3998
4032
|
...e.externalErrors
|
|
3999
|
-
],
|
|
4000
|
-
let t =
|
|
4033
|
+
], ec = (e) => {
|
|
4034
|
+
let t = $s(e);
|
|
4001
4035
|
return {
|
|
4002
4036
|
...e,
|
|
4003
4037
|
errors: t,
|
|
4004
4038
|
valid: t.length === 0,
|
|
4005
4039
|
status: t.length === 0 ? "valid" : "invalid"
|
|
4006
4040
|
};
|
|
4007
|
-
},
|
|
4008
|
-
let t =
|
|
4041
|
+
}, tc = (e) => {
|
|
4042
|
+
let t = $s(e);
|
|
4009
4043
|
return {
|
|
4010
4044
|
...e,
|
|
4011
4045
|
errors: t,
|
|
4012
4046
|
valid: t.length === 0,
|
|
4013
4047
|
status: "validating"
|
|
4014
4048
|
};
|
|
4015
|
-
},
|
|
4049
|
+
}, nc = (e, t) => e.required && zo(t) ? ["This field is required."] : [], rc = (e, t, n) => e.normalizeValue ? ic(e, t, e.normalizeValue(n, t)) : ic(e, t, n), ic = (e, t, n) => e.cloneValue ? e.cloneValue(n, t) : Z(n), ac = (e, t, n, r) => e.isEqual ? e.isEqual(n, r, t) : ws(n, r), oc = (e, t, n, r, i) => {
|
|
4016
4050
|
if (!e.validate || typeof t.asyncValidationDebounceMs == "number" && t.asyncValidationDebounceMs > 0) return [];
|
|
4017
4051
|
let a = e.validate(n, t, {
|
|
4018
4052
|
field: t,
|
|
@@ -4021,14 +4055,14 @@ var xo = {
|
|
|
4021
4055
|
validationVersion: 0,
|
|
4022
4056
|
signal: void 0
|
|
4023
4057
|
});
|
|
4024
|
-
return
|
|
4025
|
-
},
|
|
4058
|
+
return Ro(a) ? [] : a;
|
|
4059
|
+
}, sc = (e, t, n, r, i, a) => {
|
|
4026
4060
|
if (!a.visible || a.disabled) return [];
|
|
4027
|
-
let o =
|
|
4028
|
-
return o.length > 0 ? o :
|
|
4029
|
-
},
|
|
4030
|
-
let o =
|
|
4031
|
-
return
|
|
4061
|
+
let o = nc(t, n);
|
|
4062
|
+
return o.length > 0 ? o : oc(e, t, n, r, i);
|
|
4063
|
+
}, cc = (e, t, n, r, i, a) => {
|
|
4064
|
+
let o = rc(e, t, n), s = Qs(t, r, i, a), c = sc(e, t, o, r, i, s);
|
|
4065
|
+
return ec({
|
|
4032
4066
|
value: o,
|
|
4033
4067
|
initialValue: o,
|
|
4034
4068
|
touched: !1,
|
|
@@ -4044,16 +4078,16 @@ var xo = {
|
|
|
4044
4078
|
valid: c.length === 0,
|
|
4045
4079
|
status: c.length === 0 ? "valid" : "invalid"
|
|
4046
4080
|
});
|
|
4047
|
-
},
|
|
4081
|
+
}, lc = ({ config: e, definition: t, store: n, getValues: r, getSubmitCount: i, getFormStatus: a, commitState: o }) => {
|
|
4048
4082
|
let s = null, c = 0;
|
|
4049
4083
|
return {
|
|
4050
4084
|
abort(e) {
|
|
4051
4085
|
s?.abort(e), s = null;
|
|
4052
4086
|
},
|
|
4053
4087
|
async validate(l, d = n.getState().activeValidationVersion) {
|
|
4054
|
-
let f = n.getState().lifecycleVersion, p = r(), m =
|
|
4088
|
+
let f = n.getState().lifecycleVersion, p = r(), m = rc(t, e, l.value), h = i(), g = Qs(e, p, h, a()), _ = ++c, v = typeof AbortController < "u" ? new AbortController() : null, y = sc(t, e, m, p, h, g);
|
|
4055
4089
|
if (s?.abort("validation-restarted"), s = v, !g.visible || g.disabled) {
|
|
4056
|
-
let t =
|
|
4090
|
+
let t = ec({
|
|
4057
4091
|
...l,
|
|
4058
4092
|
value: m,
|
|
4059
4093
|
visible: g.visible,
|
|
@@ -4069,7 +4103,7 @@ var xo = {
|
|
|
4069
4103
|
errors: []
|
|
4070
4104
|
};
|
|
4071
4105
|
}
|
|
4072
|
-
o(e.id,
|
|
4106
|
+
o(e.id, tc({
|
|
4073
4107
|
...l,
|
|
4074
4108
|
visible: g.visible,
|
|
4075
4109
|
disabled: g.disabled,
|
|
@@ -4083,7 +4117,7 @@ var xo = {
|
|
|
4083
4117
|
let b = [];
|
|
4084
4118
|
if (y.length === 0 && t.validate) try {
|
|
4085
4119
|
let n = typeof e.asyncValidationDebounceMs == "number" ? e.asyncValidationDebounceMs : 0;
|
|
4086
|
-
n > 0 && await
|
|
4120
|
+
n > 0 && await Uo(n, v?.signal);
|
|
4087
4121
|
let r = t.validate(m, e, {
|
|
4088
4122
|
field: e,
|
|
4089
4123
|
values: p,
|
|
@@ -4091,7 +4125,7 @@ var xo = {
|
|
|
4091
4125
|
validationVersion: d,
|
|
4092
4126
|
signal: v?.signal
|
|
4093
4127
|
});
|
|
4094
|
-
|
|
4128
|
+
Ro(r) && (b = await r);
|
|
4095
4129
|
} catch (t) {
|
|
4096
4130
|
if (v?.signal.aborted || u(t)) return {
|
|
4097
4131
|
fieldId: e.id,
|
|
@@ -4100,11 +4134,11 @@ var xo = {
|
|
|
4100
4134
|
};
|
|
4101
4135
|
throw t;
|
|
4102
4136
|
}
|
|
4103
|
-
let ee = n.getState().activeValidationVersion === d && n.getState().lifecycleVersion === f && c === _ && !v?.signal.aborted, x =
|
|
4137
|
+
let ee = n.getState().activeValidationVersion === d && n.getState().lifecycleVersion === f && c === _ && !v?.signal.aborted, x = ec({
|
|
4104
4138
|
...l,
|
|
4105
4139
|
value: m,
|
|
4106
4140
|
touched: !0,
|
|
4107
|
-
dirty: !
|
|
4141
|
+
dirty: !ac(t, e, m, l.initialValue),
|
|
4108
4142
|
visible: g.visible,
|
|
4109
4143
|
disabled: g.disabled,
|
|
4110
4144
|
readOnly: g.readOnly,
|
|
@@ -4120,7 +4154,7 @@ var xo = {
|
|
|
4120
4154
|
};
|
|
4121
4155
|
}
|
|
4122
4156
|
};
|
|
4123
|
-
},
|
|
4157
|
+
}, uc = () => ({
|
|
4124
4158
|
status: "idle",
|
|
4125
4159
|
submitCount: 0,
|
|
4126
4160
|
lastResult: null,
|
|
@@ -4133,7 +4167,7 @@ var xo = {
|
|
|
4133
4167
|
activeValidationVersion: 0,
|
|
4134
4168
|
activeSubmissionVersion: null
|
|
4135
4169
|
}), $ = (e, t) => {
|
|
4136
|
-
switch (
|
|
4170
|
+
switch (fc(e.status, t.type), t.type) {
|
|
4137
4171
|
case "bump-lifecycle": return {
|
|
4138
4172
|
...e,
|
|
4139
4173
|
lifecycleVersion: e.lifecycleVersion + 1
|
|
@@ -4206,13 +4240,13 @@ var xo = {
|
|
|
4206
4240
|
submissionProgress: null,
|
|
4207
4241
|
activeSubmissionVersion: null
|
|
4208
4242
|
};
|
|
4209
|
-
default: return
|
|
4243
|
+
default: return dc(t);
|
|
4210
4244
|
}
|
|
4211
|
-
},
|
|
4245
|
+
}, dc = (e) => {
|
|
4212
4246
|
throw Error("Unsupported engine transition.");
|
|
4213
|
-
},
|
|
4247
|
+
}, fc = (e, t) => {
|
|
4214
4248
|
if (!(t === "submission-success" || t === "submission-aborted" ? e === "submitting" : t === "submission-error" ? e === "submitting" || e === "success" : t !== "validation-error" || e === "validating")) throw Error(`Invalid engine transition "${t}" from status "${e}".`);
|
|
4215
|
-
},
|
|
4249
|
+
}, pc = (e) => ({
|
|
4216
4250
|
value: Z(e.value),
|
|
4217
4251
|
initialValue: Z(e.initialValue),
|
|
4218
4252
|
touched: e.touched,
|
|
@@ -4223,8 +4257,8 @@ var xo = {
|
|
|
4223
4257
|
readOnly: e.readOnly,
|
|
4224
4258
|
errors: [...e.errors],
|
|
4225
4259
|
status: e.status
|
|
4226
|
-
}),
|
|
4227
|
-
let t = Object.fromEntries(Object.entries(e.fieldStates).map(([e, t]) => [e, Z(t.value)])), n =
|
|
4260
|
+
}), mc = (e) => Object.fromEntries(Object.entries(e).map(([e, t]) => [e, pc(t)])), hc = (e) => {
|
|
4261
|
+
let t = Object.fromEntries(Object.entries(e.fieldStates).map(([e, t]) => [e, Z(t.value)])), n = mc(e.fieldStates), r = Object.fromEntries(Object.entries(n).map(([e, t]) => [e, t.errors])), i = e.formErrors.length === 0 && Object.values(n).every((e) => e.valid), a = Object.values(n).some((e) => e.dirty), o = Object.values(n).some((e) => e.touched);
|
|
4228
4262
|
return {
|
|
4229
4263
|
status: e.status,
|
|
4230
4264
|
submitCount: e.submitCount,
|
|
@@ -4241,7 +4275,7 @@ var xo = {
|
|
|
4241
4275
|
},
|
|
4242
4276
|
lastResult: Z(e.lastResult)
|
|
4243
4277
|
};
|
|
4244
|
-
},
|
|
4278
|
+
}, gc = (e) => typeof AggregateError < "u" ? AggregateError(e, "Store listener notification failed.") : /* @__PURE__ */ Error("Store listener notification failed."), _c = (e, t = {}) => {
|
|
4245
4279
|
let n = e, r = 0, i = !1, a = /* @__PURE__ */ new Set(), o = () => {
|
|
4246
4280
|
let e = [];
|
|
4247
4281
|
for (let r of a) try {
|
|
@@ -4249,7 +4283,7 @@ var xo = {
|
|
|
4249
4283
|
} catch (r) {
|
|
4250
4284
|
e.push(r), t.onListenerError?.(r, n);
|
|
4251
4285
|
}
|
|
4252
|
-
if (e.length > 0 && t.listenerErrorPolicy === "throw-aggregate") throw
|
|
4286
|
+
if (e.length > 0 && t.listenerErrorPolicy === "throw-aggregate") throw gc(e);
|
|
4253
4287
|
};
|
|
4254
4288
|
return {
|
|
4255
4289
|
getState() {
|
|
@@ -4277,14 +4311,14 @@ var xo = {
|
|
|
4277
4311
|
return a.add(e), () => a.delete(e);
|
|
4278
4312
|
}
|
|
4279
4313
|
};
|
|
4280
|
-
},
|
|
4281
|
-
let t =
|
|
4314
|
+
}, vc = (e) => {
|
|
4315
|
+
let t = hc(e.getState());
|
|
4282
4316
|
return {
|
|
4283
4317
|
valid: t.valid,
|
|
4284
4318
|
fields: t.errors.fields,
|
|
4285
4319
|
formErrors: t.errors.form
|
|
4286
4320
|
};
|
|
4287
|
-
},
|
|
4321
|
+
}, yc = (e, t, n) => {
|
|
4288
4322
|
if (n) {
|
|
4289
4323
|
if (Array.isArray(n)) {
|
|
4290
4324
|
t.push(...n);
|
|
@@ -4292,7 +4326,7 @@ var xo = {
|
|
|
4292
4326
|
}
|
|
4293
4327
|
if (n.form && t.push(...n.form), n.fields) for (let [t, r] of Object.entries(n.fields)) e[t] = [...e[t] ?? [], ...r];
|
|
4294
4328
|
}
|
|
4295
|
-
},
|
|
4329
|
+
}, bc = ({ store: e, fields: t, normalizedSchema: n, validators: i, hooks: a, getValues: o, getSubmitCount: s, getFormStatus: c, syncDerivedFieldState: l, setRestingStatus: u, shouldResetInactiveFields: d, inactiveFieldPolicy: f }) => {
|
|
4296
4330
|
let p = 0, m = new Set(t.map((e) => e.id)), h = async (a, l) => {
|
|
4297
4331
|
let u = [], d = Object.fromEntries(t.map((e) => [e.id, []]));
|
|
4298
4332
|
if (i?.length) {
|
|
@@ -4300,22 +4334,22 @@ var xo = {
|
|
|
4300
4334
|
values: o(),
|
|
4301
4335
|
submitCount: s(),
|
|
4302
4336
|
formStatus: c(),
|
|
4303
|
-
fields:
|
|
4337
|
+
fields: mc(e.getState().fieldStates),
|
|
4304
4338
|
schema: {
|
|
4305
4339
|
fields: n.fields,
|
|
4306
4340
|
reports: n.reports
|
|
4307
4341
|
}
|
|
4308
4342
|
};
|
|
4309
|
-
for (let n of i) if (
|
|
4343
|
+
for (let n of i) if (yc(d, u, await n(t)), e.getState().activeValidationVersion !== a || e.getState().lifecycleVersion !== l) return vc(e);
|
|
4310
4344
|
}
|
|
4311
4345
|
let f = Object.keys(d).filter((e) => !m.has(e));
|
|
4312
4346
|
if (f.length > 0) throw new r(`Form validator returned errors for unknown fields: ${f.join(", ")}.`);
|
|
4313
|
-
if (e.getState().activeValidationVersion !== a || e.getState().lifecycleVersion !== l) return
|
|
4347
|
+
if (e.getState().activeValidationVersion !== a || e.getState().lifecycleVersion !== l) return vc(e);
|
|
4314
4348
|
for (let e of t) e.setExternalErrors(d[e.id] ?? []);
|
|
4315
4349
|
return e.update((e) => ({
|
|
4316
4350
|
...e,
|
|
4317
4351
|
formErrors: u
|
|
4318
|
-
})),
|
|
4352
|
+
})), vc(e);
|
|
4319
4353
|
};
|
|
4320
4354
|
return { async validate() {
|
|
4321
4355
|
let n = e.getState().lifecycleVersion, r = ++p;
|
|
@@ -4327,7 +4361,7 @@ var xo = {
|
|
|
4327
4361
|
if (await a?.beforeValidate?.({
|
|
4328
4362
|
values: o(),
|
|
4329
4363
|
submitCount: s()
|
|
4330
|
-
}), await Promise.all(t.map((e) => e.validate(r))), e.getState().lifecycleVersion !== n) return
|
|
4364
|
+
}), await Promise.all(t.map((e) => e.validate(r))), e.getState().lifecycleVersion !== n) return vc(e);
|
|
4331
4365
|
l({
|
|
4332
4366
|
preserveValidationErrors: !0,
|
|
4333
4367
|
preserveExternalErrors: !1,
|
|
@@ -4353,7 +4387,7 @@ var xo = {
|
|
|
4353
4387
|
})), t;
|
|
4354
4388
|
}
|
|
4355
4389
|
} };
|
|
4356
|
-
},
|
|
4390
|
+
}, xc = () => {
|
|
4357
4391
|
let e = null, t = "", n = null, i = 0, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = (e) => {
|
|
4358
4392
|
let t = o.get(e);
|
|
4359
4393
|
t && (o.delete(e), t());
|
|
@@ -4408,7 +4442,7 @@ var xo = {
|
|
|
4408
4442
|
n = null, e = null, t = "", a.clear();
|
|
4409
4443
|
}
|
|
4410
4444
|
};
|
|
4411
|
-
},
|
|
4445
|
+
}, Sc = ({ store: e, resetReports: t, resetExplanations: n, syncAfterSubmissionTransition: r }) => ({
|
|
4412
4446
|
start(t) {
|
|
4413
4447
|
e.batch(() => {
|
|
4414
4448
|
n(), e.update((e) => $(e, {
|
|
@@ -4447,10 +4481,10 @@ var xo = {
|
|
|
4447
4481
|
submissionVersion: t
|
|
4448
4482
|
}));
|
|
4449
4483
|
}
|
|
4450
|
-
}),
|
|
4484
|
+
}), Cc = (e, t, n) => ({
|
|
4451
4485
|
...t,
|
|
4452
|
-
reportStates:
|
|
4453
|
-
}),
|
|
4486
|
+
reportStates: Us(e, n)
|
|
4487
|
+
}), wc = (e, t) => {
|
|
4454
4488
|
let n = Object.fromEntries(e.map((e) => {
|
|
4455
4489
|
let n = t.reportStates[e.id];
|
|
4456
4490
|
return [e.id, n && e.cloneState(n)];
|
|
@@ -4466,8 +4500,8 @@ var xo = {
|
|
|
4466
4500
|
meta: Z(t.meta),
|
|
4467
4501
|
raw: Z(t.raw)
|
|
4468
4502
|
};
|
|
4469
|
-
},
|
|
4470
|
-
let S =
|
|
4503
|
+
}, Tc = ({ store: e, transport: r, hooks: i, hookFailurePolicy: s, normalizedSchema: d, fields: f, reports: p, validate: m, getSubmitCount: h, markReportsLoading: g, resetReports: _, resetExplanations: v, syncDerivedFieldState: y, shouldResetInactiveFields: b, resolveInactiveFieldPolicy: ee, inactiveFieldPolicy: x }) => {
|
|
4504
|
+
let S = xc(), C = Sc({
|
|
4471
4505
|
store: e,
|
|
4472
4506
|
resetReports: _,
|
|
4473
4507
|
resetExplanations: v,
|
|
@@ -4479,8 +4513,8 @@ var xo = {
|
|
|
4479
4513
|
inactiveFieldPolicy: x
|
|
4480
4514
|
});
|
|
4481
4515
|
}
|
|
4482
|
-
}),
|
|
4483
|
-
let a =
|
|
4516
|
+
}), w = new Map(f.map((e) => [e.id, e])), te = new Map(p.map((e) => [e.id, e])), T = async (e, t, n, r) => {
|
|
4517
|
+
let a = Ls(t);
|
|
4484
4518
|
await i?.onSubmitError?.({
|
|
4485
4519
|
backend: e,
|
|
4486
4520
|
...a,
|
|
@@ -4489,10 +4523,10 @@ var xo = {
|
|
|
4489
4523
|
});
|
|
4490
4524
|
}, E = async (t, n, r, i, a, o) => {
|
|
4491
4525
|
let s = t instanceof c ? t : l(S.getAbortReason(n));
|
|
4492
|
-
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r &&
|
|
4526
|
+
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r && C.abort(s.message), await T(o, a, i, s), s;
|
|
4493
4527
|
}, ne = async (t, n, r, i, a, s) => {
|
|
4494
4528
|
let c = t instanceof Error ? t.message : String(t);
|
|
4495
|
-
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r &&
|
|
4529
|
+
throw S.getCurrentRequestId() === n && e.getState().lifecycleVersion === r && C.fail(c), await T(s, a, i, t), new o(`Form submission failed: ${c}`, t);
|
|
4496
4530
|
}, re = (t, n, r) => {
|
|
4497
4531
|
S.getCurrentRequestId() !== n || e.getState().lifecycleVersion !== r || e.update((e) => ({
|
|
4498
4532
|
...e,
|
|
@@ -4577,14 +4611,14 @@ var xo = {
|
|
|
4577
4611
|
for (let [e, n] of Object.entries(t)) i[e] = e in i ? ie(i[e], n, "deep-merge") : Z(n);
|
|
4578
4612
|
return i;
|
|
4579
4613
|
}, ae = (e, t) => {
|
|
4580
|
-
let n =
|
|
4614
|
+
let n = te.get(e);
|
|
4581
4615
|
n && n.commitState({
|
|
4582
4616
|
payload: Z(t),
|
|
4583
4617
|
error: null,
|
|
4584
4618
|
status: t === void 0 ? "idle" : "ready"
|
|
4585
4619
|
});
|
|
4586
4620
|
}, oe = (t, n, r, i) => {
|
|
4587
|
-
let a =
|
|
4621
|
+
let a = te.get(r)?.config?.source ?? r, o = Z(e.getState().reportStates);
|
|
4588
4622
|
return {
|
|
4589
4623
|
backend: n,
|
|
4590
4624
|
values: Z(t.values),
|
|
@@ -4597,7 +4631,7 @@ var xo = {
|
|
|
4597
4631
|
raw: Z(i)
|
|
4598
4632
|
};
|
|
4599
4633
|
}, se = async (t, n, r, i) => {
|
|
4600
|
-
let a =
|
|
4634
|
+
let a = te.get(t);
|
|
4601
4635
|
if (a) {
|
|
4602
4636
|
if (a.partialUpdatePolicy === "trust") {
|
|
4603
4637
|
ae(t, n);
|
|
@@ -4630,7 +4664,7 @@ var xo = {
|
|
|
4630
4664
|
}
|
|
4631
4665
|
}
|
|
4632
4666
|
}, ce = (t, n, r = "deep-merge") => {
|
|
4633
|
-
let i =
|
|
4667
|
+
let i = te.get(t);
|
|
4634
4668
|
if (!i) return;
|
|
4635
4669
|
let a = e.getState().reportStates[t], o = ie(a?.payload, n, r);
|
|
4636
4670
|
i.commitState({
|
|
@@ -4639,7 +4673,7 @@ var xo = {
|
|
|
4639
4673
|
status: o === void 0 ? "idle" : "ready"
|
|
4640
4674
|
});
|
|
4641
4675
|
}, le = async (t, n, r = "deep-merge", i, a) => {
|
|
4642
|
-
let o =
|
|
4676
|
+
let o = te.get(t);
|
|
4643
4677
|
if (!o) return;
|
|
4644
4678
|
if (o.partialUpdatePolicy === "trust") {
|
|
4645
4679
|
ce(t, n, r);
|
|
@@ -4673,12 +4707,12 @@ var xo = {
|
|
|
4673
4707
|
ce(t, n, r);
|
|
4674
4708
|
}
|
|
4675
4709
|
}, ue = (t) => {
|
|
4676
|
-
let n =
|
|
4710
|
+
let n = w.get(t.fieldId);
|
|
4677
4711
|
if (!n) return;
|
|
4678
4712
|
let r = e.getState().fieldStates[t.fieldId];
|
|
4679
4713
|
if (!r) return;
|
|
4680
4714
|
let i = t.value === void 0 ? r.value : n.coerceValue(t.value);
|
|
4681
|
-
n.commitState(
|
|
4715
|
+
n.commitState(ec({
|
|
4682
4716
|
...r,
|
|
4683
4717
|
value: i,
|
|
4684
4718
|
touched: t.touched ?? r.touched,
|
|
@@ -4711,29 +4745,29 @@ var xo = {
|
|
|
4711
4745
|
if (S.getCurrentRequestId() !== c) throw S.clear(c), l(S.getAbortReason(c) || "superseded");
|
|
4712
4746
|
if (!v.valid) throw S.clear(c), new a(v);
|
|
4713
4747
|
if (o?.signal?.aborted) throw S.clear(c), l(String(o.signal.reason ?? ""));
|
|
4714
|
-
let y =
|
|
4748
|
+
let y = zs(f, ee);
|
|
4715
4749
|
S.setActiveController(c, typeof AbortController < "u" ? new AbortController() : null), S.attachExternalSignal(o, c), e.batch(() => {
|
|
4716
|
-
g(),
|
|
4750
|
+
g(), C.start(c);
|
|
4717
4751
|
});
|
|
4718
|
-
let b = h(), x = e.getState().lifecycleVersion,
|
|
4752
|
+
let b = h(), x = e.getState().lifecycleVersion, w = S.createSignal(o);
|
|
4719
4753
|
try {
|
|
4720
|
-
let a =
|
|
4754
|
+
let a = Ls(y);
|
|
4721
4755
|
if (await i?.beforeSubmit?.({
|
|
4722
4756
|
backend: _,
|
|
4723
4757
|
...a,
|
|
4724
4758
|
submitCount: b,
|
|
4725
|
-
signal:
|
|
4726
|
-
}),
|
|
4727
|
-
let o =
|
|
4759
|
+
signal: w
|
|
4760
|
+
}), w.aborted || S.isAborted(c)) throw l(S.getAbortReason(c));
|
|
4761
|
+
let o = Ls(y), u = {
|
|
4728
4762
|
backend: _,
|
|
4729
4763
|
...o,
|
|
4730
4764
|
fields: d.fields,
|
|
4731
4765
|
reports: d.reports,
|
|
4732
|
-
metadata: { estimatedPayloadBytes:
|
|
4766
|
+
metadata: { estimatedPayloadBytes: Is({
|
|
4733
4767
|
values: o.serializedValues,
|
|
4734
4768
|
fieldValues: o.serializedFieldValues
|
|
4735
4769
|
}) },
|
|
4736
|
-
signal:
|
|
4770
|
+
signal: w
|
|
4737
4771
|
}, f;
|
|
4738
4772
|
if (r.stream) {
|
|
4739
4773
|
let i = !1, a = await r.stream(u);
|
|
@@ -4745,37 +4779,37 @@ var xo = {
|
|
|
4745
4779
|
details: { backend: _ }
|
|
4746
4780
|
});
|
|
4747
4781
|
} else f = await r.submit(u);
|
|
4748
|
-
if (!(S.getCurrentRequestId() === c && e.getState().lifecycleVersion === x && !
|
|
4749
|
-
let m =
|
|
4782
|
+
if (!(S.getCurrentRequestId() === c && e.getState().lifecycleVersion === x && !w.aborted && !S.isAborted(c))) throw l(S.getAbortReason(c));
|
|
4783
|
+
let m = Bs(f), h = {
|
|
4750
4784
|
backend: _,
|
|
4751
4785
|
...y,
|
|
4752
4786
|
reports: m.reports ?? {},
|
|
4753
4787
|
meta: m.meta ?? {},
|
|
4754
4788
|
raw: m.raw
|
|
4755
|
-
}, g = await
|
|
4789
|
+
}, g = await Vs(p, {
|
|
4756
4790
|
...h,
|
|
4757
4791
|
reportStates: {}
|
|
4758
|
-
}), v =
|
|
4792
|
+
}), v = Cc(p, h, g), ee = wc(p, v);
|
|
4759
4793
|
e.batch(() => {
|
|
4760
|
-
|
|
4794
|
+
Hs(p, g), C.succeed(ee);
|
|
4761
4795
|
});
|
|
4762
4796
|
try {
|
|
4763
|
-
let e =
|
|
4797
|
+
let e = Ls(y);
|
|
4764
4798
|
await i?.afterSubmit?.({
|
|
4765
4799
|
backend: _,
|
|
4766
4800
|
...e,
|
|
4767
4801
|
submitCount: b,
|
|
4768
|
-
result:
|
|
4802
|
+
result: wc(p, v)
|
|
4769
4803
|
});
|
|
4770
4804
|
} catch (e) {
|
|
4771
4805
|
if (s?.afterSubmit !== "preserve-success") throw e;
|
|
4772
4806
|
await T(_, y, b, e);
|
|
4773
4807
|
}
|
|
4774
|
-
return
|
|
4808
|
+
return wc(p, v);
|
|
4775
4809
|
} catch (e) {
|
|
4776
|
-
return u(e) ||
|
|
4810
|
+
return u(e) || w.aborted || S.isAborted(c) ? await E(e, c, x, b, y, _) : await ne(e, c, x, b, y, _);
|
|
4777
4811
|
} finally {
|
|
4778
|
-
S.clear(c),
|
|
4812
|
+
S.clear(c), C.clear(c);
|
|
4779
4813
|
}
|
|
4780
4814
|
},
|
|
4781
4815
|
abort(e) {
|
|
@@ -4785,7 +4819,7 @@ var xo = {
|
|
|
4785
4819
|
S.reset();
|
|
4786
4820
|
}
|
|
4787
4821
|
};
|
|
4788
|
-
},
|
|
4822
|
+
}, Ec = (e, t, n) => {
|
|
4789
4823
|
e.update((e) => ({
|
|
4790
4824
|
...e,
|
|
4791
4825
|
fieldStates: {
|
|
@@ -4793,17 +4827,17 @@ var xo = {
|
|
|
4793
4827
|
[t]: n
|
|
4794
4828
|
}
|
|
4795
4829
|
}));
|
|
4796
|
-
},
|
|
4797
|
-
let c =
|
|
4798
|
-
|
|
4799
|
-
let u = () => n.getState().fieldStates[e.id], d =
|
|
4830
|
+
}, Dc = ({ config: e, definition: t, store: n, getValues: i, getSubmitCount: a, getFormStatus: o, onValueChange: s }) => {
|
|
4831
|
+
let c = Ho(Z(e)), l = cc(t, c, c.defaultValue === void 0 ? t.getDefaultValue?.(c) : c.defaultValue, i(), a(), o());
|
|
4832
|
+
Ec(n, e.id, l);
|
|
4833
|
+
let u = () => n.getState().fieldStates[e.id], d = lc({
|
|
4800
4834
|
config: c,
|
|
4801
4835
|
definition: t,
|
|
4802
4836
|
store: n,
|
|
4803
4837
|
getValues: i,
|
|
4804
4838
|
getSubmitCount: a,
|
|
4805
4839
|
getFormStatus: o,
|
|
4806
|
-
commitState: (e, t) =>
|
|
4840
|
+
commitState: (e, t) => Ec(n, e, t)
|
|
4807
4841
|
});
|
|
4808
4842
|
return {
|
|
4809
4843
|
get id() {
|
|
@@ -4816,7 +4850,7 @@ var xo = {
|
|
|
4816
4850
|
return c;
|
|
4817
4851
|
},
|
|
4818
4852
|
get state() {
|
|
4819
|
-
return
|
|
4853
|
+
return pc(u());
|
|
4820
4854
|
},
|
|
4821
4855
|
get descriptor() {
|
|
4822
4856
|
return t.describe(c, {
|
|
@@ -4844,16 +4878,16 @@ var xo = {
|
|
|
4844
4878
|
d.abort("value-updated"), this.commitState(this.prepareValue(e, t));
|
|
4845
4879
|
},
|
|
4846
4880
|
prepareValue(e, n) {
|
|
4847
|
-
let i = u(), s =
|
|
4881
|
+
let i = u(), s = rc(t, c, e), l = Qs(c, n, a(), o());
|
|
4848
4882
|
if (!l.visible) throw new r(`Field "${c.id}" is hidden and cannot be updated.`);
|
|
4849
4883
|
if (l.disabled) throw new r(`Field "${c.id}" is disabled and cannot be updated.`);
|
|
4850
4884
|
if (l.readOnly) throw new r(`Field "${c.id}" is read-only and cannot be updated.`);
|
|
4851
|
-
let d =
|
|
4852
|
-
return
|
|
4885
|
+
let d = sc(t, c, s, n, a(), l);
|
|
4886
|
+
return ec({
|
|
4853
4887
|
...i,
|
|
4854
4888
|
value: s,
|
|
4855
4889
|
touched: !0,
|
|
4856
|
-
dirty: !
|
|
4890
|
+
dirty: !ac(t, c, s, i.initialValue),
|
|
4857
4891
|
visible: l.visible,
|
|
4858
4892
|
disabled: l.disabled,
|
|
4859
4893
|
readOnly: l.readOnly,
|
|
@@ -4863,11 +4897,11 @@ var xo = {
|
|
|
4863
4897
|
});
|
|
4864
4898
|
},
|
|
4865
4899
|
commitState(e) {
|
|
4866
|
-
|
|
4900
|
+
Ec(n, c.id, e);
|
|
4867
4901
|
},
|
|
4868
4902
|
blur() {
|
|
4869
4903
|
let e = u();
|
|
4870
|
-
|
|
4904
|
+
Ec(n, c.id, {
|
|
4871
4905
|
...e,
|
|
4872
4906
|
touched: !0
|
|
4873
4907
|
}), n.update((e) => ({
|
|
@@ -4880,13 +4914,13 @@ var xo = {
|
|
|
4880
4914
|
return d.validate(u(), e);
|
|
4881
4915
|
},
|
|
4882
4916
|
reset() {
|
|
4883
|
-
d.abort("field-reset"),
|
|
4917
|
+
d.abort("field-reset"), Ec(n, c.id, { ...l });
|
|
4884
4918
|
},
|
|
4885
4919
|
subscribe(e) {
|
|
4886
4920
|
let t = u();
|
|
4887
4921
|
return n.subscribe(() => {
|
|
4888
4922
|
let r = n.getState().fieldStates[c.id];
|
|
4889
|
-
|
|
4923
|
+
hs(t, r) || (t = r, e(pc(r)));
|
|
4890
4924
|
});
|
|
4891
4925
|
},
|
|
4892
4926
|
serialize() {
|
|
@@ -4894,20 +4928,20 @@ var xo = {
|
|
|
4894
4928
|
return t.serializeValue ? t.serializeValue(e, c) : e;
|
|
4895
4929
|
},
|
|
4896
4930
|
coerceValue(e) {
|
|
4897
|
-
return
|
|
4931
|
+
return rc(t, c, e);
|
|
4898
4932
|
},
|
|
4899
4933
|
setExternalErrors(e) {
|
|
4900
4934
|
let t = u();
|
|
4901
|
-
|
|
4935
|
+
Ec(n, c.id, ec({
|
|
4902
4936
|
...t,
|
|
4903
4937
|
externalErrors: [...e]
|
|
4904
4938
|
}));
|
|
4905
4939
|
},
|
|
4906
4940
|
refresh(e) {
|
|
4907
|
-
let r = u(), s = e?.values ?? i(), l =
|
|
4941
|
+
let r = u(), s = e?.values ?? i(), l = Qs(c, s, a(), o()), d = c.inactiveFieldPolicy ?? e?.inactiveFieldPolicy, f = rc(t, c, (e?.resetInactiveToInitial === !0 || d === "reset-on-hide") && (!l.visible || l.disabled) ? r.initialValue : r.value), p = sc(t, c, f, s, a(), l), m = e?.preserveValidationErrors && l.visible && !l.disabled ? [...r.validationErrors] : [], h = e?.preserveExternalErrors && l.visible && !l.disabled ? [...r.externalErrors] : [], g = ec({
|
|
4908
4942
|
...r,
|
|
4909
4943
|
value: f,
|
|
4910
|
-
dirty: !
|
|
4944
|
+
dirty: !ac(t, c, f, r.initialValue),
|
|
4911
4945
|
visible: l.visible,
|
|
4912
4946
|
disabled: l.disabled,
|
|
4913
4947
|
readOnly: l.readOnly,
|
|
@@ -4916,24 +4950,24 @@ var xo = {
|
|
|
4916
4950
|
externalErrors: h,
|
|
4917
4951
|
validationVersion: r.validationVersion
|
|
4918
4952
|
});
|
|
4919
|
-
return
|
|
4953
|
+
return Ec(n, c.id, g), g;
|
|
4920
4954
|
}
|
|
4921
4955
|
};
|
|
4922
|
-
},
|
|
4956
|
+
}, Oc = {
|
|
4923
4957
|
payload: void 0,
|
|
4924
4958
|
error: null,
|
|
4925
4959
|
status: "idle"
|
|
4926
|
-
},
|
|
4960
|
+
}, kc = {
|
|
4927
4961
|
payload: void 0,
|
|
4928
4962
|
error: null,
|
|
4929
4963
|
status: "loading"
|
|
4930
|
-
},
|
|
4964
|
+
}, Ac = (e, t, n) => {
|
|
4931
4965
|
if (n !== void 0) return e.clonePayload ? e.clonePayload(n, t) : Z(n);
|
|
4932
|
-
},
|
|
4933
|
-
payload:
|
|
4966
|
+
}, jc = (e, t, n) => ({
|
|
4967
|
+
payload: Ac(e, t, n.payload),
|
|
4934
4968
|
error: n.error,
|
|
4935
4969
|
status: n.status
|
|
4936
|
-
}),
|
|
4970
|
+
}), Mc = (e, t, n) => {
|
|
4937
4971
|
e.update((e) => ({
|
|
4938
4972
|
...e,
|
|
4939
4973
|
reportStates: {
|
|
@@ -4941,9 +4975,9 @@ var xo = {
|
|
|
4941
4975
|
[t]: n
|
|
4942
4976
|
}
|
|
4943
4977
|
}));
|
|
4944
|
-
},
|
|
4945
|
-
let r =
|
|
4946
|
-
return
|
|
4978
|
+
}, Nc = ({ config: e, definition: t, store: n }) => {
|
|
4979
|
+
let r = Ho(Z(e));
|
|
4980
|
+
return Mc(n, r.id, Oc), {
|
|
4947
4981
|
get id() {
|
|
4948
4982
|
return r.id;
|
|
4949
4983
|
},
|
|
@@ -4957,7 +4991,7 @@ var xo = {
|
|
|
4957
4991
|
return t.partialUpdatePolicy ?? "trust";
|
|
4958
4992
|
},
|
|
4959
4993
|
get state() {
|
|
4960
|
-
return
|
|
4994
|
+
return jc(t, r, n.getState().reportStates[r.id]);
|
|
4961
4995
|
},
|
|
4962
4996
|
get descriptor() {
|
|
4963
4997
|
let e = this.state;
|
|
@@ -4969,7 +5003,7 @@ var xo = {
|
|
|
4969
5003
|
});
|
|
4970
5004
|
},
|
|
4971
5005
|
cloneState(e) {
|
|
4972
|
-
return
|
|
5006
|
+
return jc(t, r, e);
|
|
4973
5007
|
},
|
|
4974
5008
|
async prepareState(e) {
|
|
4975
5009
|
let n;
|
|
@@ -4986,13 +5020,13 @@ var xo = {
|
|
|
4986
5020
|
};
|
|
4987
5021
|
}
|
|
4988
5022
|
if (n === void 0 || !t.payloadSchema) return {
|
|
4989
|
-
payload:
|
|
5023
|
+
payload: Ac(t, r, n),
|
|
4990
5024
|
error: null,
|
|
4991
5025
|
status: n === void 0 ? "idle" : "ready"
|
|
4992
5026
|
};
|
|
4993
5027
|
try {
|
|
4994
5028
|
return {
|
|
4995
|
-
payload:
|
|
5029
|
+
payload: Ac(t, r, t.payloadSchema.parse(n)),
|
|
4996
5030
|
error: null,
|
|
4997
5031
|
status: "ready"
|
|
4998
5032
|
};
|
|
@@ -5007,35 +5041,35 @@ var xo = {
|
|
|
5007
5041
|
}
|
|
5008
5042
|
},
|
|
5009
5043
|
commitState(e) {
|
|
5010
|
-
|
|
5044
|
+
Mc(n, r.id, this.cloneState(e));
|
|
5011
5045
|
},
|
|
5012
5046
|
async update(e) {
|
|
5013
5047
|
this.commitState(await this.prepareState(e));
|
|
5014
5048
|
},
|
|
5015
5049
|
markLoading() {
|
|
5016
|
-
|
|
5050
|
+
Mc(n, r.id, kc);
|
|
5017
5051
|
},
|
|
5018
5052
|
reset() {
|
|
5019
|
-
|
|
5053
|
+
Mc(n, r.id, Oc);
|
|
5020
5054
|
},
|
|
5021
5055
|
subscribe(e) {
|
|
5022
5056
|
let t = n.getState().reportStates[r.id];
|
|
5023
5057
|
return n.subscribe(() => {
|
|
5024
5058
|
let i = n.getState().reportStates[r.id];
|
|
5025
|
-
|
|
5059
|
+
hs(t, i) || (t = i, e(this.cloneState(i)));
|
|
5026
5060
|
});
|
|
5027
5061
|
}
|
|
5028
5062
|
};
|
|
5029
|
-
},
|
|
5063
|
+
}, Pc = (e, t, n, a) => {
|
|
5030
5064
|
if (typeof n != "object" || !n) throw new r(`Series field "${e}" requires "${t}" configuration.`);
|
|
5031
5065
|
let o = "kind" in n && typeof n.kind == "string" ? n.kind : "";
|
|
5032
5066
|
if (o.length === 0) throw new r(`Series field "${e}" requires "${t}.kind".`);
|
|
5033
5067
|
if (o === "series") throw new r(`Series field "${e}" cannot nest series in "${t}".`);
|
|
5034
5068
|
if (!a.getField(o)) throw new i(`Series field "${e}" uses unknown sub-field kind "${o}" in "${t}".`);
|
|
5035
|
-
},
|
|
5036
|
-
if (e.kind === "series" && (
|
|
5037
|
-
},
|
|
5038
|
-
let a =
|
|
5069
|
+
}, Fc = (e, t) => {
|
|
5070
|
+
if (e.kind === "series" && (Pc(e.label, "field1", e.field1, t), Pc(e.label, "field2", e.field2, t), typeof e.minPoints == "number" && typeof e.maxPoints == "number" && e.minPoints > e.maxPoints)) throw new r(`Series field "${e.label}" requires minPoints to be less than or equal to maxPoints.`);
|
|
5071
|
+
}, Ic = (e, t, n, i) => {
|
|
5072
|
+
let a = Io((e ?? t) || i);
|
|
5039
5073
|
if (e) {
|
|
5040
5074
|
if (n.has(a)) throw new r(`Duplicate explicit id "${a}" in schema.`);
|
|
5041
5075
|
return n.add(a), a;
|
|
@@ -5043,50 +5077,50 @@ var xo = {
|
|
|
5043
5077
|
let o = a, s = 2;
|
|
5044
5078
|
for (; n.has(o);) o = `${a}-${s}`, s += 1;
|
|
5045
5079
|
return n.add(o), o;
|
|
5046
|
-
},
|
|
5080
|
+
}, Lc = (e, t, n, r) => {
|
|
5047
5081
|
let a = n.getField(e.kind);
|
|
5048
5082
|
if (!a) throw new i(`Unknown field kind "${e.kind}".`);
|
|
5049
5083
|
let o = a.schema.parse(e);
|
|
5050
|
-
|
|
5051
|
-
let s =
|
|
5084
|
+
Fc(o, n);
|
|
5085
|
+
let s = Ic(o.id, o.label, r, `field-${t + 1}`);
|
|
5052
5086
|
return {
|
|
5053
5087
|
...o,
|
|
5054
5088
|
id: s
|
|
5055
5089
|
};
|
|
5056
|
-
},
|
|
5090
|
+
}, Rc = (e, t, n, r) => {
|
|
5057
5091
|
let a = n.getReport(e.kind);
|
|
5058
5092
|
if (!a) throw new i(`Unknown report kind "${e.kind}".`);
|
|
5059
|
-
let o = a.schema.parse(e), s =
|
|
5093
|
+
let o = a.schema.parse(e), s = Ic(o.id, o.label ?? o.kind, r, `report-${t + 1}`);
|
|
5060
5094
|
return {
|
|
5061
5095
|
...o,
|
|
5062
5096
|
id: s,
|
|
5063
5097
|
source: o.source ?? s
|
|
5064
5098
|
};
|
|
5065
|
-
},
|
|
5099
|
+
}, zc = (e, t, n, r) => {
|
|
5066
5100
|
let a = n.getExplanation(e.kind);
|
|
5067
5101
|
if (!a) throw new i(`Unknown explanation kind "${e.kind}".`);
|
|
5068
|
-
let o = a.schema.parse(e), s =
|
|
5102
|
+
let o = a.schema.parse(e), s = Ic(o.id, o.label ?? o.kind, r, `explanation-${t + 1}`);
|
|
5069
5103
|
return {
|
|
5070
5104
|
...o,
|
|
5071
5105
|
id: s
|
|
5072
5106
|
};
|
|
5073
|
-
},
|
|
5107
|
+
}, Bc = (e, t) => {
|
|
5074
5108
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
5075
5109
|
return {
|
|
5076
|
-
fields: e.fields.map((e, r) =>
|
|
5077
|
-
reports: (e.reports ?? []).map((e, n) =>
|
|
5078
|
-
explanations: (e.explanations ?? []).map((e, n) =>
|
|
5110
|
+
fields: e.fields.map((e, r) => Lc(e, r, t, n)),
|
|
5111
|
+
reports: (e.reports ?? []).map((e, n) => Rc(e, n, t, r)),
|
|
5112
|
+
explanations: (e.explanations ?? []).map((e, n) => zc(e, n, t, i))
|
|
5079
5113
|
};
|
|
5080
|
-
},
|
|
5114
|
+
}, Vc = (e) => {
|
|
5081
5115
|
if (!e || typeof e.submit != "function") throw new r("createForm requires a transport with a submit(request) function.");
|
|
5082
|
-
},
|
|
5083
|
-
|
|
5084
|
-
let t =
|
|
5116
|
+
}, Hc = (e) => {
|
|
5117
|
+
Vc(e.transport);
|
|
5118
|
+
let t = Bc(e.schema, e.registry), n = _c(uc(), {
|
|
5085
5119
|
listenerErrorPolicy: e.listenerErrorPolicy ?? "ignore",
|
|
5086
5120
|
onListenerError: e.onListenerError
|
|
5087
|
-
}), i = n.getState(), a =
|
|
5121
|
+
}), i = n.getState(), a = hc(i), o = () => {
|
|
5088
5122
|
let e = n.getState();
|
|
5089
|
-
return e !== i && (i = e, a =
|
|
5123
|
+
return e !== i && (i = e, a = hc(e)), a;
|
|
5090
5124
|
}, s = () => Object.fromEntries(Object.entries(n.getState().fieldStates).map(([e, t]) => [e, Z(t.value)])), c = () => n.getState().submitCount, l = () => n.getState().status, u = (e) => {
|
|
5091
5125
|
for (let t in e) {
|
|
5092
5126
|
let n = e[t];
|
|
@@ -5096,7 +5130,7 @@ var xo = {
|
|
|
5096
5130
|
}, d = () => e.inactiveFieldPolicy === "reset-on-hide", f = (t) => t.config.inactiveFieldPolicy ?? e.inactiveFieldPolicy ?? "omit", p = t.fields.map((t) => {
|
|
5097
5131
|
let i = e.registry.getField(t.kind);
|
|
5098
5132
|
if (!i) throw new r(`Field definition "${t.kind}" disappeared during form creation.`);
|
|
5099
|
-
return
|
|
5133
|
+
return Dc({
|
|
5100
5134
|
config: {
|
|
5101
5135
|
...t,
|
|
5102
5136
|
defaultValue: e.initialValues?.[t.id] === void 0 ? t.defaultValue : e.initialValues[t.id]
|
|
@@ -5112,20 +5146,20 @@ var xo = {
|
|
|
5112
5146
|
type: "editing",
|
|
5113
5147
|
clearFormErrors: !0,
|
|
5114
5148
|
bumpLifecycle: !0
|
|
5115
|
-
})),
|
|
5149
|
+
})), E({
|
|
5116
5150
|
values: r,
|
|
5117
5151
|
preserveValidationErrors: !1,
|
|
5118
5152
|
preserveExternalErrors: !1,
|
|
5119
5153
|
resetInactiveToInitial: d(),
|
|
5120
5154
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5121
|
-
});
|
|
5155
|
+
}), v(t, r);
|
|
5122
5156
|
});
|
|
5123
5157
|
}
|
|
5124
5158
|
});
|
|
5125
5159
|
}), m = t.reports.map((t) => {
|
|
5126
5160
|
let i = e.registry.getReport(t.kind);
|
|
5127
5161
|
if (!i) throw new r(`Report definition "${t.kind}" disappeared during form creation.`);
|
|
5128
|
-
return
|
|
5162
|
+
return Nc({
|
|
5129
5163
|
config: t,
|
|
5130
5164
|
definition: i,
|
|
5131
5165
|
store: n
|
|
@@ -5133,20 +5167,51 @@ var xo = {
|
|
|
5133
5167
|
}), h = t.explanations.map((t) => {
|
|
5134
5168
|
let i = e.registry.getExplanation(t.kind);
|
|
5135
5169
|
if (!i) throw new r(`Explanation definition "${t.kind}" disappeared during form creation.`);
|
|
5136
|
-
return
|
|
5170
|
+
return Os({
|
|
5137
5171
|
config: t,
|
|
5138
5172
|
definition: i,
|
|
5139
5173
|
store: n,
|
|
5140
5174
|
hooks: e.hooks
|
|
5141
5175
|
});
|
|
5142
|
-
}), g = new Map(p.map((e) => [e.id, e])), _ =
|
|
5176
|
+
}), g = new Map(p.map((e) => [e.id, e])), _ = /* @__PURE__ */ new Map();
|
|
5177
|
+
for (let e of p) if (e.kind === "mapped-category") {
|
|
5178
|
+
let t = e.config;
|
|
5179
|
+
for (let n of t.options) if (n.mapping) {
|
|
5180
|
+
for (let t of Object.keys(n.mapping)) if (!g.has(t)) throw new r(`mapped-category "${e.id}": mapping references unknown field "${t}".`);
|
|
5181
|
+
}
|
|
5182
|
+
_.set(e.id, t);
|
|
5183
|
+
}
|
|
5184
|
+
let v = (t, i) => {
|
|
5185
|
+
let a = _.get(t);
|
|
5186
|
+
if (!a) return;
|
|
5187
|
+
let o = i[t], s = a.options.find((e) => e.value === o);
|
|
5188
|
+
if (s?.mapping) for (let [a, o] of Object.entries(s.mapping)) {
|
|
5189
|
+
let s = g.get(a);
|
|
5190
|
+
if (!s) throw new r(`mapped-category "${t}": target field "${a}" not found in schema.`);
|
|
5191
|
+
let l = s.coerceValue(o), u = e.registry.getField(s.kind);
|
|
5192
|
+
if (u?.validate) {
|
|
5193
|
+
let e = u.validate(l, s.config, {
|
|
5194
|
+
field: s.config,
|
|
5195
|
+
values: i,
|
|
5196
|
+
submitCount: c(),
|
|
5197
|
+
validationVersion: 0
|
|
5198
|
+
});
|
|
5199
|
+
if (Array.isArray(e) && e.length > 0) throw new r(`mapped-category "${t}": value ${JSON.stringify(o)} invalid for "${a}": ${e.join(", ")}`);
|
|
5200
|
+
}
|
|
5201
|
+
let d = n.getState().fieldStates[a];
|
|
5202
|
+
d && s.commitState({
|
|
5203
|
+
...d,
|
|
5204
|
+
value: l
|
|
5205
|
+
});
|
|
5206
|
+
}
|
|
5207
|
+
}, y = new Map(m.map((e) => [e.id, e])), b = new Map(h.map((e) => [e.id, e])), ee = Object.freeze([...p]), x = Object.freeze([...m]), S = Object.freeze([...h]), C = () => {
|
|
5143
5208
|
for (let e of m) e.reset();
|
|
5144
|
-
},
|
|
5209
|
+
}, w = () => {
|
|
5145
5210
|
for (let e of h) e.reset();
|
|
5146
5211
|
}, te = () => {
|
|
5147
5212
|
for (let e of m) e.markLoading();
|
|
5148
|
-
},
|
|
5149
|
-
function
|
|
5213
|
+
}, T = () => (n.update((e) => $(e, { type: "bump-lifecycle" })), n.getState().lifecycleVersion);
|
|
5214
|
+
function E(t) {
|
|
5150
5215
|
n.batch(() => {
|
|
5151
5216
|
let n = t?.resetInactiveToInitial === !0 ? { ...t.values ?? s() } : t?.values;
|
|
5152
5217
|
for (let r of p) {
|
|
@@ -5159,7 +5224,7 @@ var xo = {
|
|
|
5159
5224
|
}
|
|
5160
5225
|
});
|
|
5161
5226
|
}
|
|
5162
|
-
let
|
|
5227
|
+
let ne = bc({
|
|
5163
5228
|
store: n,
|
|
5164
5229
|
fields: p,
|
|
5165
5230
|
normalizedSchema: t,
|
|
@@ -5168,14 +5233,14 @@ var xo = {
|
|
|
5168
5233
|
getValues: s,
|
|
5169
5234
|
getSubmitCount: c,
|
|
5170
5235
|
getFormStatus: l,
|
|
5171
|
-
syncDerivedFieldState:
|
|
5236
|
+
syncDerivedFieldState: E,
|
|
5172
5237
|
setRestingStatus: () => {
|
|
5173
5238
|
n.batch(() => {
|
|
5174
5239
|
let t = u(n.getState().fieldStates) ? "editing" : "idle";
|
|
5175
5240
|
n.update((e) => $(e, {
|
|
5176
5241
|
type: "rest",
|
|
5177
5242
|
status: t
|
|
5178
|
-
})),
|
|
5243
|
+
})), E({
|
|
5179
5244
|
preserveValidationErrors: !0,
|
|
5180
5245
|
preserveExternalErrors: !0,
|
|
5181
5246
|
resetInactiveToInitial: d(),
|
|
@@ -5185,7 +5250,7 @@ var xo = {
|
|
|
5185
5250
|
},
|
|
5186
5251
|
shouldResetInactiveFields: d,
|
|
5187
5252
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5188
|
-
}),
|
|
5253
|
+
}), re = Tc({
|
|
5189
5254
|
store: n,
|
|
5190
5255
|
transport: e.transport,
|
|
5191
5256
|
hooks: e.hooks,
|
|
@@ -5193,30 +5258,30 @@ var xo = {
|
|
|
5193
5258
|
normalizedSchema: t,
|
|
5194
5259
|
fields: p,
|
|
5195
5260
|
reports: m,
|
|
5196
|
-
validate: () =>
|
|
5261
|
+
validate: () => ne.validate(),
|
|
5197
5262
|
getSubmitCount: c,
|
|
5198
5263
|
markReportsLoading: te,
|
|
5199
|
-
resetReports:
|
|
5200
|
-
resetExplanations:
|
|
5201
|
-
syncDerivedFieldState:
|
|
5264
|
+
resetReports: C,
|
|
5265
|
+
resetExplanations: w,
|
|
5266
|
+
syncDerivedFieldState: E,
|
|
5202
5267
|
shouldResetInactiveFields: d,
|
|
5203
5268
|
resolveInactiveFieldPolicy: f,
|
|
5204
5269
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5205
5270
|
});
|
|
5206
|
-
return
|
|
5271
|
+
return E({
|
|
5207
5272
|
preserveValidationErrors: !1,
|
|
5208
5273
|
preserveExternalErrors: !1,
|
|
5209
5274
|
resetInactiveToInitial: d(),
|
|
5210
5275
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5211
5276
|
}), {
|
|
5212
5277
|
get fields() {
|
|
5213
|
-
return
|
|
5278
|
+
return ee;
|
|
5214
5279
|
},
|
|
5215
5280
|
get reports() {
|
|
5216
|
-
return
|
|
5281
|
+
return x;
|
|
5217
5282
|
},
|
|
5218
5283
|
get explanations() {
|
|
5219
|
-
return
|
|
5284
|
+
return S;
|
|
5220
5285
|
},
|
|
5221
5286
|
get state() {
|
|
5222
5287
|
return o();
|
|
@@ -5225,10 +5290,10 @@ var xo = {
|
|
|
5225
5290
|
return g.get(e);
|
|
5226
5291
|
},
|
|
5227
5292
|
getReport(e) {
|
|
5228
|
-
return
|
|
5293
|
+
return y.get(e);
|
|
5229
5294
|
},
|
|
5230
5295
|
getExplanation(e) {
|
|
5231
|
-
return
|
|
5296
|
+
return b.get(e);
|
|
5232
5297
|
},
|
|
5233
5298
|
getValues() {
|
|
5234
5299
|
return s();
|
|
@@ -5246,7 +5311,7 @@ var xo = {
|
|
|
5246
5311
|
if (!n) throw new r(`Unknown field "${e}".`);
|
|
5247
5312
|
o.set(e, n.prepareValue(t, a));
|
|
5248
5313
|
}
|
|
5249
|
-
|
|
5314
|
+
T();
|
|
5250
5315
|
for (let [e, t] of o) {
|
|
5251
5316
|
let n = g.get(e);
|
|
5252
5317
|
if (!n) throw new r(`Unknown field "${e}".`);
|
|
@@ -5255,29 +5320,30 @@ var xo = {
|
|
|
5255
5320
|
n.update((e) => $(e, {
|
|
5256
5321
|
type: "editing",
|
|
5257
5322
|
clearFormErrors: !0
|
|
5258
|
-
})),
|
|
5323
|
+
})), E({
|
|
5259
5324
|
values: a,
|
|
5260
5325
|
preserveValidationErrors: !1,
|
|
5261
5326
|
preserveExternalErrors: !1,
|
|
5262
5327
|
resetInactiveToInitial: d(),
|
|
5263
5328
|
inactiveFieldPolicy: e.inactiveFieldPolicy
|
|
5264
5329
|
});
|
|
5330
|
+
for (let [e] of i) v(e, a);
|
|
5265
5331
|
});
|
|
5266
5332
|
},
|
|
5267
5333
|
validate() {
|
|
5268
|
-
return
|
|
5334
|
+
return ne.validate();
|
|
5269
5335
|
},
|
|
5270
5336
|
submit(e) {
|
|
5271
|
-
return
|
|
5337
|
+
return re.submit(e);
|
|
5272
5338
|
},
|
|
5273
5339
|
abortSubmit(e) {
|
|
5274
|
-
|
|
5340
|
+
re.abort(e);
|
|
5275
5341
|
},
|
|
5276
5342
|
reset() {
|
|
5277
5343
|
n.batch(() => {
|
|
5278
|
-
|
|
5344
|
+
re.abort("reset"), T();
|
|
5279
5345
|
for (let e of p) e.reset();
|
|
5280
|
-
|
|
5346
|
+
C(), w(), re.reset(), n.update((e) => $(e, { type: "reset" })), E({
|
|
5281
5347
|
preserveValidationErrors: !1,
|
|
5282
5348
|
preserveExternalErrors: !1
|
|
5283
5349
|
});
|
|
@@ -5289,7 +5355,7 @@ var xo = {
|
|
|
5289
5355
|
});
|
|
5290
5356
|
},
|
|
5291
5357
|
subscribeSelector(e, t, r) {
|
|
5292
|
-
let i = r?.equality ??
|
|
5358
|
+
let i = r?.equality ?? vs, a = e(o());
|
|
5293
5359
|
return r?.emitInitial && t(a, o()), n.subscribe(() => {
|
|
5294
5360
|
let n = o(), r = e(n);
|
|
5295
5361
|
i(a, r) || (a = r, t(r, n));
|
|
@@ -5298,4 +5364,4 @@ var xo = {
|
|
|
5298
5364
|
};
|
|
5299
5365
|
};
|
|
5300
5366
|
//#endregion
|
|
5301
|
-
export {
|
|
5367
|
+
export { w as A, Fo as C, S as D, x as E, i as F, s as I, c as L, v as M, m as N, te as O, r as P, o as R, Io as S, Mo as T, Ko as _, hs as a, Vo as b, _s as c, ds as d, us as f, qo as g, Jo as h, Os as i, ee as j, C as k, ps as l, Yo as m, Ns as n, gs as o, ls as p, As as r, vs as s, Hc as t, fs as u, Go as v, No as w, Ro as x, Wo as y, a as z };
|