attaform 0.20.0 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +4 -1
  2. package/dist/chunks/devtools.cjs +2 -2
  3. package/dist/chunks/devtools.cjs.map +1 -1
  4. package/dist/chunks/devtools.mjs +2 -2
  5. package/dist/chunks/devtools.mjs.map +1 -1
  6. package/dist/chunks/indexeddb.cjs +1 -1
  7. package/dist/chunks/indexeddb.mjs +1 -1
  8. package/dist/chunks/local-storage.cjs +1 -1
  9. package/dist/chunks/local-storage.mjs +1 -1
  10. package/dist/chunks/session-storage.cjs +1 -1
  11. package/dist/chunks/session-storage.mjs +1 -1
  12. package/dist/index.cjs +3 -3
  13. package/dist/index.d.cts +4 -4
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.mjs +5 -5
  17. package/dist/nuxt.d.cts +1 -1
  18. package/dist/nuxt.d.mts +1 -1
  19. package/dist/nuxt.d.ts +1 -1
  20. package/dist/runtime/plugins/attaform.cjs +2 -2
  21. package/dist/runtime/plugins/attaform.mjs +2 -2
  22. package/dist/shared/{attaform.SfhU0OEY.d.ts → attaform.99cfHcIt.d.cts} +26 -9
  23. package/dist/shared/{attaform.SfhU0OEY.d.mts → attaform.99cfHcIt.d.mts} +26 -9
  24. package/dist/shared/{attaform.SfhU0OEY.d.cts → attaform.99cfHcIt.d.ts} +26 -9
  25. package/dist/shared/{attaform.BWgAFnsj.mjs → attaform.BGk8cfw2.mjs} +14 -10
  26. package/dist/shared/attaform.BGk8cfw2.mjs.map +1 -0
  27. package/dist/shared/{attaform.DoKXru-a.d.mts → attaform.BXinSW2T.d.mts} +1 -1
  28. package/dist/shared/{attaform.Dmb6itxC.cjs → attaform.B_hph5AE.cjs} +14 -10
  29. package/dist/shared/attaform.B_hph5AE.cjs.map +1 -0
  30. package/dist/shared/{attaform.DEBvCjeH.mjs → attaform.C5aYC_T8.mjs} +4 -4
  31. package/dist/shared/{attaform.DEBvCjeH.mjs.map → attaform.C5aYC_T8.mjs.map} +1 -1
  32. package/dist/shared/{attaform.CIn4bMsD.cjs → attaform.Cd4AOfwu.cjs} +4 -4
  33. package/dist/shared/{attaform.CIn4bMsD.cjs.map → attaform.Cd4AOfwu.cjs.map} +1 -1
  34. package/dist/shared/{attaform.EZG6fOFb.mjs → attaform.CnrxbkB6.mjs} +2 -2
  35. package/dist/shared/{attaform.EZG6fOFb.mjs.map → attaform.CnrxbkB6.mjs.map} +1 -1
  36. package/dist/shared/{attaform.DL4CQ-oW.cjs → attaform.CwLjUqmQ.cjs} +101 -50
  37. package/dist/shared/attaform.CwLjUqmQ.cjs.map +1 -0
  38. package/dist/shared/{attaform.GbDo_lJi.d.cts → attaform.CywE4y8x.d.cts} +1 -1
  39. package/dist/shared/{attaform.BPxsYtTe.cjs → attaform.D2SCCd4O.cjs} +2 -2
  40. package/dist/shared/{attaform.BPxsYtTe.cjs.map → attaform.D2SCCd4O.cjs.map} +1 -1
  41. package/dist/shared/{attaform.jgzuNZVC.cjs → attaform.DAKrGhxc.cjs} +4 -4
  42. package/dist/shared/{attaform.jgzuNZVC.cjs.map → attaform.DAKrGhxc.cjs.map} +1 -1
  43. package/dist/shared/{attaform.Dl5kDY-A.d.ts → attaform.DN5CvZrg.d.ts} +1 -1
  44. package/dist/shared/{attaform.D5-1XGQU.d.cts → attaform.DbRgDFa7.d.cts} +1 -1
  45. package/dist/shared/{attaform.DvA-CJJW.mjs → attaform.Dt7dEcHk.mjs} +4 -4
  46. package/dist/shared/{attaform.DvA-CJJW.mjs.map → attaform.Dt7dEcHk.mjs.map} +1 -1
  47. package/dist/shared/{attaform.BKozEdTr.mjs → attaform.QG5TG8lB.mjs} +51 -35
  48. package/dist/shared/attaform.QG5TG8lB.mjs.map +1 -0
  49. package/dist/shared/{attaform.EMzJcQci.d.mts → attaform.ceGEAEMk.d.ts} +1 -1
  50. package/dist/shared/{attaform.Bh3ACtts.d.ts → attaform.sWm8B15V.d.mts} +1 -1
  51. package/dist/shared/{attaform.CKFbKFb6.mjs → attaform.tiWEVznj.mjs} +100 -51
  52. package/dist/shared/attaform.tiWEVznj.mjs.map +1 -0
  53. package/dist/shared/{attaform.BPy-4qRx.cjs → attaform.z5j3LwJz.cjs} +51 -34
  54. package/dist/shared/attaform.z5j3LwJz.cjs.map +1 -0
  55. package/dist/zod-v3.cjs +3 -3
  56. package/dist/zod-v3.d.cts +3 -3
  57. package/dist/zod-v3.d.mts +3 -3
  58. package/dist/zod-v3.d.ts +3 -3
  59. package/dist/zod-v3.mjs +3 -3
  60. package/dist/zod-v4.cjs +3 -3
  61. package/dist/zod-v4.d.cts +4 -4
  62. package/dist/zod-v4.d.mts +4 -4
  63. package/dist/zod-v4.d.ts +4 -4
  64. package/dist/zod-v4.mjs +3 -3
  65. package/dist/zod.cjs +5 -5
  66. package/dist/zod.d.cts +5 -5
  67. package/dist/zod.d.mts +5 -5
  68. package/dist/zod.d.ts +5 -5
  69. package/dist/zod.mjs +6 -6
  70. package/package.json +4 -3
  71. package/dist/shared/attaform.BKozEdTr.mjs.map +0 -1
  72. package/dist/shared/attaform.BPy-4qRx.cjs.map +0 -1
  73. package/dist/shared/attaform.BWgAFnsj.mjs.map +0 -1
  74. package/dist/shared/attaform.CKFbKFb6.mjs.map +0 -1
  75. package/dist/shared/attaform.DL4CQ-oW.cjs.map +0 -1
  76. package/dist/shared/attaform.Dmb6itxC.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { t as FormKey, ae as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, T as PathKey, S as Path, am as ValidationError, A as AbstractSchema, x as GetDisplayState, aq as WriteMeta, D as DeepPartial, ar as WriteShape, ak as ValidateOn, Y as PersistOptInRegistry, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.SfhU0OEY.mjs';
1
+ import { t as FormKey, ae as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, T as PathKey, S as Path, am as ValidationError, A as AbstractSchema, x as GetDisplayState, aq as WriteMeta, D as DeepPartial, ar as WriteShape, ak as ValidateOn, Y as PersistOptInRegistry, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.99cfHcIt.js';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as FormKey, ae as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, T as PathKey, S as Path, am as ValidationError, A as AbstractSchema, x as GetDisplayState, aq as WriteMeta, D as DeepPartial, ar as WriteShape, ak as ValidateOn, Y as PersistOptInRegistry, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.SfhU0OEY.js';
1
+ import { t as FormKey, ae as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, T as PathKey, S as Path, am as ValidationError, A as AbstractSchema, x as GetDisplayState, aq as WriteMeta, D as DeepPartial, ar as WriteShape, ak as ValidateOn, Y as PersistOptInRegistry, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.99cfHcIt.mjs';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -1,5 +1,28 @@
1
1
  import { computed, ref, watchEffect, getCurrentScope, onScopeDispose, shallowReadonly, readonly, reactive, toRaw, watch, markRaw, shallowRef, getCurrentInstance, onServerPrefetch, provide, useId, inject, effectScope, nextTick } from 'vue';
2
- import { _ as __DEV__, j as canonicalizePath, E as segmentsForPathKey, s as isPathPrefix, b as FORM_ERRORS_PATH_KEY, S as SubmitErrorHandlerError, A as AnonPersistError, k as captureUserCallSite, I as INTERACTIVE_TAG_NAMES, e as ROOT_PATH_KEY, R as ROOT_PATH, h as allowSensitivePersist, F as FORM_ERRORS_PATH, l as coerceToPathKey, u as isSensitivePath, o as createPersistOptInRegistry, d as InvalidUseFormConfigError, q as ensureAttaformInstalled, H as useRegistry, y as kFormContext, z as kFormInstanceId, g as ReservedFormKeyError, n as createIsSensitivePath, x as kAttaformWizardActiveStepResolver, v as kAttaformAncestorWizard } from './attaform.BKozEdTr.mjs';
2
+ import { _ as __DEV__, j as canonicalizePath, G as segmentsForPathKey, t as isPathPrefix, b as FORM_ERRORS_PATH_KEY, S as SubmitErrorHandlerError, A as AnonPersistError, k as captureUserCallSite, I as INTERACTIVE_TAG_NAMES, r as getOrAssignElementId, e as ROOT_PATH_KEY, R as ROOT_PATH, h as allowSensitivePersist, F as FORM_ERRORS_PATH, l as coerceToPathKey, v as isSensitivePath, o as createPersistOptInRegistry, d as InvalidUseFormConfigError, q as ensureAttaformInstalled, J as useRegistry, z as kFormContext, B as kFormInstanceId, g as ReservedFormKeyError, n as createIsSensitivePath, y as kAttaformWizardActiveStepResolver, w as kAttaformAncestorWizard } from './attaform.QG5TG8lB.mjs';
3
+
4
+ function safeAssign(target, key, value) {
5
+ if (key === "__proto__") {
6
+ Object.defineProperty(target, key, {
7
+ value,
8
+ writable: true,
9
+ enumerable: true,
10
+ configurable: true
11
+ });
12
+ return;
13
+ }
14
+ target[key] = value;
15
+ }
16
+ function safeOwnRead(target, key) {
17
+ if (key === "__proto__") {
18
+ const desc = Object.getOwnPropertyDescriptor(target, "__proto__");
19
+ return desc?.value;
20
+ }
21
+ return target[key];
22
+ }
23
+ function safeOwnHas(target, key) {
24
+ return Object.prototype.hasOwnProperty.call(target, key);
25
+ }
3
26
 
4
27
  const NOT_FOUND = Symbol("NOT_FOUND");
5
28
  function descendStep(value, segment) {
@@ -62,8 +85,8 @@ function setAtPathOffset(root, path, value, offset) {
62
85
  arr[head] = setAtPathOffset(arr[head], path, value, nextOffset);
63
86
  return arr;
64
87
  }
65
- const rec = isPlainRecord(root) ? Object.assign(/* @__PURE__ */ Object.create(null), root) : /* @__PURE__ */ Object.create(null);
66
- rec[head] = setAtPathOffset(rec[head], path, value, nextOffset);
88
+ const rec = isPlainRecord(root) ? { ...root } : {};
89
+ safeAssign(rec, head, setAtPathOffset(safeOwnRead(rec, head), path, value, nextOffset));
67
90
  return rec;
68
91
  }
69
92
  function deleteAtPath(root, path) {
@@ -92,9 +115,9 @@ function deleteAtPathOffset(root, path, offset) {
92
115
  delete rec2[head];
93
116
  return rec2;
94
117
  }
95
- if (!(head in root)) return root;
118
+ if (!safeOwnHas(root, head)) return root;
96
119
  const rec = { ...root };
97
- rec[head] = deleteAtPathOffset(rec[head], path, nextOffset);
120
+ safeAssign(rec, head, deleteAtPathOffset(safeOwnRead(rec, head), path, nextOffset));
98
121
  return rec;
99
122
  }
100
123
  function resolveArrayShape(schema, scratch) {
@@ -163,27 +186,27 @@ function mergeStructuralImpl(schema, scratch, consumer, defaultValue) {
163
186
  return consumer;
164
187
  }
165
188
  let mutated = false;
166
- const out = Object.assign(/* @__PURE__ */ Object.create(null), consumer);
189
+ const out = { ...consumer };
167
190
  for (const key of Object.keys(defaultValue)) {
168
- if (!(key in consumer)) {
169
- const defAtKey = defaultValue[key];
191
+ if (!safeOwnHas(consumer, key)) {
192
+ const defAtKey = safeOwnRead(defaultValue, key);
170
193
  scratch.push(key);
171
194
  const filled = mergeStructuralImpl(schema, scratch, void 0, defAtKey);
172
195
  scratch.pop();
173
196
  if (filled !== void 0) {
174
- out[key] = filled;
197
+ safeAssign(out, key, filled);
175
198
  mutated = true;
176
199
  }
177
200
  }
178
201
  }
179
202
  for (const key of Object.keys(consumer)) {
180
- const cVal = consumer[key];
203
+ const cVal = safeOwnRead(consumer, key);
181
204
  if (cVal === void 0) continue;
182
205
  scratch.push(key);
183
- const merged = mergeStructuralImpl(schema, scratch, cVal, defaultValue[key]);
206
+ const merged = mergeStructuralImpl(schema, scratch, cVal, safeOwnRead(defaultValue, key));
184
207
  scratch.pop();
185
208
  if (merged !== cVal) {
186
- out[key] = merged;
209
+ safeAssign(out, key, merged);
187
210
  mutated = true;
188
211
  }
189
212
  }
@@ -377,7 +400,8 @@ function applyChangedKeys(target, source) {
377
400
  }
378
401
  for (const k of changedFirstSegments) {
379
402
  if (typeof k === "symbol") continue;
380
- t[String(k)] = s[String(k)];
403
+ const key = String(k);
404
+ safeAssign(t, key, safeOwnRead(s, key));
381
405
  }
382
406
  }
383
407
  return true;
@@ -427,9 +451,9 @@ function structuralSnapshot(value) {
427
451
  return out2;
428
452
  }
429
453
  const src = value;
430
- const out = /* @__PURE__ */ Object.create(null);
454
+ const out = {};
431
455
  for (const k of Object.keys(src)) {
432
- out[k] = structuralSnapshot(src[k]);
456
+ safeAssign(out, k, structuralSnapshot(safeOwnRead(src, k)));
433
457
  }
434
458
  return out;
435
459
  }
@@ -1093,7 +1117,7 @@ function errorAwareContainerKeys(state, segments) {
1093
1117
  }
1094
1118
  function materializeErrors(state, containerSegments) {
1095
1119
  const liveContainer = getAtPath(state.form.value, containerSegments);
1096
- const tree = Array.isArray(liveContainer) ? [] : /* @__PURE__ */ Object.create(null);
1120
+ const tree = Array.isArray(liveContainer) ? [] : {};
1097
1121
  const collect = (store, applyActivePathFilter) => {
1098
1122
  entries: for (const [pathKey, errors] of store) {
1099
1123
  if (errors.length === 0) continue;
@@ -1141,18 +1165,18 @@ function placeAt(tree, path, errors) {
1141
1165
  const nextSeg = path[i + 1];
1142
1166
  const key = typeof seg === "number" ? String(seg) : seg;
1143
1167
  const cursorRecord2 = cursor;
1144
- let child = cursorRecord2[key];
1168
+ let child = safeOwnRead(cursorRecord2, key);
1145
1169
  if (child === null || child === void 0 || typeof child !== "object") {
1146
- child = typeof nextSeg === "number" ? [] : /* @__PURE__ */ Object.create(null);
1147
- cursorRecord2[key] = child;
1170
+ child = typeof nextSeg === "number" ? [] : {};
1171
+ safeAssign(cursorRecord2, key, child);
1148
1172
  }
1149
1173
  cursor = child;
1150
1174
  }
1151
1175
  const lastSeg = path[path.length - 1];
1152
1176
  const lastKey = typeof lastSeg === "number" ? String(lastSeg) : lastSeg;
1153
1177
  const cursorRecord = cursor;
1154
- const existing = cursorRecord[lastKey];
1155
- cursorRecord[lastKey] = Array.isArray(existing) ? [...existing, ...errors] : errors;
1178
+ const existing = safeOwnRead(cursorRecord, lastKey);
1179
+ safeAssign(cursorRecord, lastKey, Array.isArray(existing) ? [...existing, ...errors] : errors);
1156
1180
  }
1157
1181
 
1158
1182
  function buildFieldArrayApi(state) {
@@ -1548,10 +1572,10 @@ function stripUnacknowledgedSensitiveLeaves(form, optedInPaths, isSensitivePath)
1548
1572
  if (value === null || typeof value !== "object") return value;
1549
1573
  if (Array.isArray(value)) return value.map((item, i) => walk([...path, i], item));
1550
1574
  if (!isPlainRecord(value)) return value;
1551
- const out = /* @__PURE__ */ Object.create(null);
1575
+ const out = {};
1552
1576
  for (const key of Object.keys(value)) {
1553
1577
  const walked = walk([...path, key], value[key]);
1554
- if (walked !== void 0) out[key] = walked;
1578
+ if (walked !== void 0) safeAssign(out, key, walked);
1555
1579
  }
1556
1580
  return out;
1557
1581
  };
@@ -1583,10 +1607,19 @@ function mergeDeep(target, source, path, schema) {
1583
1607
  if (sourceDisc !== void 0) {
1584
1608
  const variantDefault = du.getVariantDefault(sourceDisc);
1585
1609
  if (isPlainRecord(variantDefault)) {
1586
- const out2 = Object.assign(/* @__PURE__ */ Object.create(null), variantDefault);
1610
+ const out2 = { ...variantDefault };
1587
1611
  for (const key of Object.keys(sourceRecord)) {
1588
- if (!(key in variantDefault) && key !== du.discriminatorKey) continue;
1589
- out2[key] = mergeDeep(out2[key], sourceRecord[key], [...path, key], schema);
1612
+ if (!safeOwnHas(variantDefault, key) && key !== du.discriminatorKey) continue;
1613
+ safeAssign(
1614
+ out2,
1615
+ key,
1616
+ mergeDeep(
1617
+ safeOwnRead(out2, key),
1618
+ safeOwnRead(sourceRecord, key),
1619
+ [...path, key],
1620
+ schema
1621
+ )
1622
+ );
1590
1623
  }
1591
1624
  return out2;
1592
1625
  }
@@ -1595,9 +1628,18 @@ function mergeDeep(target, source, path, schema) {
1595
1628
  }
1596
1629
  }
1597
1630
  const mergeTarget = target;
1598
- const out = isPlainRecord(mergeTarget) ? Object.assign(/* @__PURE__ */ Object.create(null), mergeTarget) : /* @__PURE__ */ Object.create(null);
1631
+ const out = isPlainRecord(mergeTarget) ? { ...mergeTarget } : {};
1599
1632
  for (const key of Object.keys(source)) {
1600
- out[key] = mergeDeep(out[key], source[key], [...path, key], schema);
1633
+ safeAssign(
1634
+ out,
1635
+ key,
1636
+ mergeDeep(
1637
+ safeOwnRead(out, key),
1638
+ safeOwnRead(source, key),
1639
+ [...path, key],
1640
+ schema
1641
+ )
1642
+ );
1601
1643
  }
1602
1644
  return out;
1603
1645
  }
@@ -2264,6 +2306,7 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2264
2306
  const isRequired = state.schema.isRequiredAtPath(segments);
2265
2307
  const ariaEnabled = options?.autoAria ?? formAutoAria;
2266
2308
  const ariaDisplayState = getDisplayStateAt !== void 0 ? computed(() => getDisplayStateAt(segments)) : void 0;
2309
+ let boundElement = null;
2267
2310
  const internalRv = {
2268
2311
  innerRef,
2269
2312
  displayValue,
@@ -2282,6 +2325,7 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2282
2325
  state.markInteracted(segments);
2283
2326
  },
2284
2327
  registerElement: (element) => {
2328
+ boundElement = element;
2285
2329
  if (!INTERACTIVE_TAG_NAMES.has(element.tagName)) return;
2286
2330
  const added = state.registerElement(segments, element, formInstanceId);
2287
2331
  if (added) attachFocusListeners(state, segments, element, instanceMeta);
@@ -2289,9 +2333,11 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2289
2333
  deregisterElement: (element) => {
2290
2334
  detachFocusListeners(element);
2291
2335
  state.deregisterElement(segments, element);
2336
+ if (boundElement === element) boundElement = null;
2292
2337
  },
2293
2338
  setValueWithInternalPath: (value, meta) => {
2294
- return state.setValueAtPath(segments, value, withInstanceMeta(meta));
2339
+ const resolvedMeta = meta === void 0 && boundElement !== null ? { persist: state.persistOptIns.hasOptIn(getOrAssignElementId(boundElement), pathKey) } : meta;
2340
+ return state.setValueAtPath(segments, value, withInstanceMeta(resolvedMeta));
2295
2341
  },
2296
2342
  // Called by the `vRegisterHint` compile-time transform's wrapping
2297
2343
  // IIFE on every server-side render of `<element v-register="…">`.
@@ -2381,17 +2427,17 @@ function walk(input, segments, schema, paths) {
2381
2427
  if (slim !== null && slim !== void 0 && typeof slim === "object" && !Array.isArray(slim) && !(slim instanceof Date) && !(slim instanceof RegExp) && !(slim instanceof Map) && !(slim instanceof Set)) {
2382
2428
  for (const k of Object.keys(slim)) allKeys.add(k);
2383
2429
  }
2384
- const out = /* @__PURE__ */ Object.create(null);
2430
+ const out = {};
2385
2431
  let mutated = allKeys.size !== inputKeys.length;
2386
2432
  for (const key of allKeys) {
2387
2433
  const orig = input[key];
2388
2434
  if (orig === void 0 && inputKeysSet.has(key)) {
2389
- out[key] = void 0;
2435
+ safeAssign(out, key, void 0);
2390
2436
  mutated = true;
2391
2437
  continue;
2392
2438
  }
2393
2439
  const walked = walk(orig, [...segments, key], schema, paths);
2394
- out[key] = walked;
2440
+ safeAssign(out, key, walked);
2395
2441
  if (walked !== orig) mutated = true;
2396
2442
  }
2397
2443
  return mutated ? out : input;
@@ -2410,9 +2456,13 @@ function walkUnspecified(slim, segments, paths) {
2410
2456
  }
2411
2457
  if (Array.isArray(slim)) return slim;
2412
2458
  if (slim !== null && typeof slim === "object") {
2413
- const out = /* @__PURE__ */ Object.create(null);
2459
+ const out = {};
2414
2460
  for (const key of Object.keys(slim)) {
2415
- out[key] = walkUnspecified(slim[key], [...segments, key], paths);
2461
+ safeAssign(
2462
+ out,
2463
+ key,
2464
+ walkUnspecified(slim[key], [...segments, key], paths)
2465
+ );
2416
2466
  }
2417
2467
  return out;
2418
2468
  }
@@ -2443,11 +2493,11 @@ function substitute(input, segments, schema, paths) {
2443
2493
  }
2444
2494
  if (typeof input === "object") {
2445
2495
  let mutated = false;
2446
- const out = /* @__PURE__ */ Object.create(null);
2496
+ const out = {};
2447
2497
  for (const key of Object.keys(input)) {
2448
2498
  const orig = input[key];
2449
2499
  const walked = substitute(orig, [...segments, key], schema, paths);
2450
- out[key] = walked;
2500
+ safeAssign(out, key, walked);
2451
2501
  if (walked !== orig) mutated = true;
2452
2502
  }
2453
2503
  return mutated ? out : input;
@@ -3057,9 +3107,9 @@ function buildFormApi(state, formInstanceId, options = {}) {
3057
3107
  if (value === null || typeof value !== "object" || Array.isArray(value)) {
3058
3108
  return EMPTY_FIELD_RECORD;
3059
3109
  }
3060
- const out = /* @__PURE__ */ Object.create(null);
3110
+ const out = {};
3061
3111
  for (const key of Object.keys(value)) {
3062
- out[key] = callTerminal(`${path}.${key}`);
3112
+ safeAssign(out, key, callTerminal(`${path}.${key}`));
3063
3113
  }
3064
3114
  return Object.freeze(out);
3065
3115
  }
@@ -3181,14 +3231,14 @@ function walkDuStubs(schema, value, path, warned) {
3181
3231
  );
3182
3232
  }
3183
3233
  }
3184
- const stub = /* @__PURE__ */ Object.create(null);
3185
- stub[du.discriminatorKey] = discValue;
3234
+ const stub = {};
3235
+ safeAssign(stub, du.discriminatorKey, discValue);
3186
3236
  return stub;
3187
3237
  }
3188
3238
  }
3189
- const out = /* @__PURE__ */ Object.create(null);
3239
+ const out = {};
3190
3240
  for (const k of Object.keys(rec)) {
3191
- out[k] = walkDuStubs(schema, rec[k], [...path, k], warned);
3241
+ safeAssign(out, k, walkDuStubs(schema, rec[k], [...path, k], warned));
3192
3242
  }
3193
3243
  return out;
3194
3244
  }
@@ -3271,8 +3321,8 @@ function cloneVariantSnapshot(value) {
3271
3321
  return out2;
3272
3322
  }
3273
3323
  const src = raw;
3274
- const out = /* @__PURE__ */ Object.create(null);
3275
- for (const k of Object.keys(src)) out[k] = cloneVariantSnapshot(src[k]);
3324
+ const out = {};
3325
+ for (const k of Object.keys(src)) safeAssign(out, k, cloneVariantSnapshot(src[k]));
3276
3326
  return out;
3277
3327
  }
3278
3328
 
@@ -5195,9 +5245,8 @@ function wirePersistence(state, config) {
5195
5245
  if (isDisposed()) return;
5196
5246
  const raw = await adapter.getItem(key);
5197
5247
  const existing = readPersistedPayload(raw);
5198
- const baseForm = existing?.data.form ?? /* @__PURE__ */ Object.create(null);
5199
5248
  const value = getAtPath(toRaw(state.form.value), path);
5200
- const nextForm = setAtPath(baseForm, path, value);
5249
+ const nextForm = setAtPath(existing?.data.form ?? {}, path, value);
5201
5250
  const { key: pathKey } = canonicalizePath(path);
5202
5251
  const transientSet = new Set(
5203
5252
  (existing?.data.blankPaths ?? []).filter(
@@ -5389,15 +5438,15 @@ function stripSensitivePathsDeep(value, pathSoFar, isSensitivePath) {
5389
5438
  }
5390
5439
  const proto = Object.getPrototypeOf(value);
5391
5440
  if (proto !== Object.prototype && proto !== null) return value;
5392
- const out = /* @__PURE__ */ Object.create(null);
5441
+ const out = {};
5393
5442
  const src = value;
5394
5443
  for (const key of Object.keys(src)) {
5395
5444
  const childPath = [...pathSoFar, key];
5396
5445
  if (isSensitivePath(childPath)) {
5397
- out[key] = void 0;
5446
+ safeAssign(out, key, void 0);
5398
5447
  continue;
5399
5448
  }
5400
- out[key] = stripSensitivePathsDeep(src[key], childPath, isSensitivePath);
5449
+ safeAssign(out, key, stripSensitivePathsDeep(src[key], childPath, isSensitivePath));
5401
5450
  }
5402
5451
  return out;
5403
5452
  }
@@ -7157,5 +7206,5 @@ function warnIfAmbientWizardProviderHadDuplicates() {
7157
7206
  }
7158
7207
  }
7159
7208
 
7160
- export { AttaformErrorCode as A, defaultDisplayState as a, defineCoercion as b, injectWizard as c, defaultCoercionRules as d, isPlainRecord as e, isUnset as f, getAtPath as g, humanize as h, injectForm as i, slimKindOf as j, useAbstractForm as k, lazy as l, useWizard as m, normalizeNumericOption as n, setAtPath as s, unset as u };
7161
- //# sourceMappingURL=attaform.CKFbKFb6.mjs.map
7209
+ export { AttaformErrorCode as A, defaultDisplayState as a, defineCoercion as b, injectWizard as c, defaultCoercionRules as d, isPlainRecord as e, isUnset as f, getAtPath as g, humanize as h, injectForm as i, safeOwnRead as j, setAtPath as k, lazy as l, slimKindOf as m, normalizeNumericOption as n, useAbstractForm as o, useWizard as p, safeAssign as s, unset as u };
7210
+ //# sourceMappingURL=attaform.tiWEVznj.mjs.map