@lehnihon/bit-form 2.2.9 → 2.2.10
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/dist/angular/index.cjs +1 -1
- package/dist/angular/index.d.cts +19 -52
- package/dist/angular/index.d.ts +19 -52
- package/dist/angular/index.js +1 -1
- package/dist/angular/index.js.map +1 -1
- package/dist/bus-BFOBGmd9.d.ts +41 -0
- package/dist/bus-DzTqgkZ4.d.cts +41 -0
- package/dist/chunk-2AFWJAQG.js +2 -0
- package/dist/chunk-2AFWJAQG.js.map +1 -0
- package/dist/chunk-4RQFECC7.cjs +2 -0
- package/dist/{chunk-J5ALITQW.cjs.map → chunk-4RQFECC7.cjs.map} +1 -1
- package/dist/chunk-FLFIOW75.js +2 -0
- package/dist/chunk-FLFIOW75.js.map +1 -0
- package/dist/chunk-G2FQQDRK.js +2 -0
- package/dist/chunk-G2FQQDRK.js.map +1 -0
- package/dist/{chunk-X5UCRGYJ.cjs → chunk-GPMAT4PT.cjs} +2 -2
- package/dist/{chunk-X5UCRGYJ.cjs.map → chunk-GPMAT4PT.cjs.map} +1 -1
- package/dist/{chunk-J5GQLEVA.js → chunk-GQ2QJCBF.js} +2 -2
- package/dist/{chunk-GGZPA7AO.cjs → chunk-IVPCXKYW.cjs} +2 -2
- package/dist/{chunk-GGZPA7AO.cjs.map → chunk-IVPCXKYW.cjs.map} +1 -1
- package/dist/{chunk-N4HCGMMM.js → chunk-LX4GSDUV.js} +2 -2
- package/dist/chunk-NVFZ22A7.cjs +2 -0
- package/dist/chunk-NVFZ22A7.cjs.map +1 -0
- package/dist/{chunk-2QLQPMCZ.js → chunk-OPC7HFNN.js} +2 -2
- package/dist/chunk-PA43XYOW.cjs +2 -0
- package/dist/{chunk-IV32WXCF.cjs.map → chunk-PA43XYOW.cjs.map} +1 -1
- package/dist/chunk-PG7ZH32Z.js +2 -0
- package/dist/chunk-PG7ZH32Z.js.map +1 -0
- package/dist/chunk-VBX5I5XG.cjs +2 -0
- package/dist/chunk-VBX5I5XG.cjs.map +1 -0
- package/dist/{chunk-OLQVH24Z.cjs → chunk-ZKAFHJPU.cjs} +2 -2
- package/dist/{chunk-OLQVH24Z.cjs.map → chunk-ZKAFHJPU.cjs.map} +1 -1
- package/dist/cli/index.cjs +5 -5
- package/dist/{types-SOg9xEce.d.cts → config-types-5eR82k2V.d.cts} +40 -169
- package/dist/{types-CRCP4Pgq.d.ts → config-types-D9n-rQLk.d.ts} +40 -169
- package/dist/core/bindings.cjs +1 -1
- package/dist/core/bindings.d.cts +15 -11
- package/dist/core/bindings.d.ts +15 -11
- package/dist/core/bindings.js +1 -1
- package/dist/core/status.d.cts +3 -4
- package/dist/core/status.d.ts +3 -4
- package/dist/core/store.cjs +1 -1
- package/dist/core/store.d.cts +8 -6
- package/dist/core/store.d.ts +8 -6
- package/dist/core/store.js +1 -1
- package/dist/core/utils.cjs +1 -1
- package/dist/core/utils.d.cts +1 -2
- package/dist/core/utils.d.ts +1 -2
- package/dist/core/utils.js +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +10 -9
- package/dist/core.d.ts +10 -9
- package/dist/core.js +1 -1
- package/dist/devtools/bridge.cjs +1 -1
- package/dist/devtools/bridge.d.cts +2 -3
- package/dist/devtools/bridge.d.ts +2 -3
- package/dist/devtools/bridge.js +1 -1
- package/dist/devtools/index.cjs +2 -2
- package/dist/devtools/index.d.cts +5 -3
- package/dist/devtools/index.d.ts +5 -3
- package/dist/devtools/index.js +1 -1
- package/dist/{field-binding-MX6jVQbT.d.ts → field-binding-Bi1g-D8X.d.ts} +1 -1
- package/dist/{field-binding-B_OX3bjp.d.cts → field-binding-X5TkvfUt.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -1
- package/dist/mask.d.cts +2 -2
- package/dist/mask.d.ts +2 -2
- package/dist/meta-types-BC1VLABk.d.cts +28 -0
- package/dist/meta-types-BC1VLABk.d.ts +28 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +12 -12
- package/dist/react/index.d.ts +12 -12
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-native/index.cjs +1 -1
- package/dist/react-native/index.d.cts +10 -9
- package/dist/react-native/index.d.ts +10 -9
- package/dist/react-native/index.js +1 -1
- package/dist/resolvers/index.d.cts +2 -3
- package/dist/resolvers/index.d.ts +2 -3
- package/dist/resolvers/joi.d.cts +2 -3
- package/dist/resolvers/joi.d.ts +2 -3
- package/dist/resolvers/yup.d.cts +2 -3
- package/dist/resolvers/yup.d.ts +2 -3
- package/dist/resolvers/zod.d.cts +2 -3
- package/dist/resolvers/zod.d.ts +2 -3
- package/dist/runtime-types-D1SRZr-n.d.cts +43 -0
- package/dist/runtime-types-D1SRZr-n.d.ts +43 -0
- package/dist/state-types-8bUndWfg.d.cts +42 -0
- package/dist/state-types-8bUndWfg.d.ts +42 -0
- package/dist/{store-api-types-Bm3EAqR_.d.cts → store-api-types-Bozwlwyb.d.ts} +9 -5
- package/dist/{store-api-types-DfTFy2h4.d.ts → store-api-types-DSgYwMS3.d.cts} +9 -5
- package/dist/{types-D8DgIUhJ.d.cts → types-CUXh7PqD.d.cts} +1 -1
- package/dist/{types-D8DgIUhJ.d.ts → types-CUXh7PqD.d.ts} +1 -1
- package/dist/upload-C4JqIaU2.d.cts +89 -0
- package/dist/upload-ao6skK9K.d.ts +89 -0
- package/dist/{use-bit-persist-BDMZmxBh.d.ts → use-bit-persist-Bd1H2fge.d.ts} +12 -45
- package/dist/{use-bit-persist-CBTZIMc5.d.cts → use-bit-persist-DDxV21AN.d.cts} +12 -45
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.d.cts +18 -51
- package/dist/vue/index.d.ts +18 -51
- package/dist/vue/index.js +1 -1
- package/dist/vue/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/array-controller-C61ByyG6.d.ts +0 -23
- package/dist/array-controller-CtlqjA0e.d.cts +0 -23
- package/dist/bus-BKuMV3E7.d.ts +0 -19
- package/dist/bus-WOHGxuVy.d.cts +0 -19
- package/dist/chunk-6LNXTSZ6.cjs +0 -2
- package/dist/chunk-6LNXTSZ6.cjs.map +0 -1
- package/dist/chunk-IV32WXCF.cjs +0 -2
- package/dist/chunk-J5ALITQW.cjs +0 -2
- package/dist/chunk-KDHPLXZF.cjs +0 -2
- package/dist/chunk-KDHPLXZF.cjs.map +0 -1
- package/dist/chunk-O5UPA33R.js +0 -2
- package/dist/chunk-O5UPA33R.js.map +0 -1
- package/dist/chunk-QX2IVNMK.js +0 -2
- package/dist/chunk-QX2IVNMK.js.map +0 -1
- package/dist/chunk-UARLAXZX.js +0 -2
- package/dist/chunk-UARLAXZX.js.map +0 -1
- package/dist/chunk-Y3XVQGCU.js +0 -2
- package/dist/chunk-Y3XVQGCU.js.map +0 -1
- package/dist/meta-types-Bzmm21TP.d.cts +0 -18
- package/dist/meta-types-Bzmm21TP.d.ts +0 -18
- package/dist/upload-C2mpfhp1.d.cts +0 -17
- package/dist/upload-C2mpfhp1.d.ts +0 -17
- /package/dist/{chunk-J5GQLEVA.js.map → chunk-GQ2QJCBF.js.map} +0 -0
- /package/dist/{chunk-N4HCGMMM.js.map → chunk-LX4GSDUV.js.map} +0 -0
- /package/dist/{chunk-2QLQPMCZ.js.map → chunk-OPC7HFNN.js.map} +0 -0
package/dist/bus-WOHGxuVy.d.cts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { r as BitFormGlobal } from './types-SOg9xEce.cjs';
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
var __BIT_FORM__: BitFormGlobal | undefined;
|
|
5
|
-
}
|
|
6
|
-
declare const bitBus: BitFormGlobal;
|
|
7
|
-
/**
|
|
8
|
-
* Creates an isolated bus instance — not connected to the browser global.
|
|
9
|
-
* Use this in SSR / Edge Runtime environments (e.g. Next.js Edge) where a
|
|
10
|
-
* shared `globalThis` singleton is unsafe across request contexts.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // _app.tsx (SSR-safe)
|
|
14
|
-
* const bus = createBitBus();
|
|
15
|
-
* const store = createBitStore({ bus, initialValues: { ... } });
|
|
16
|
-
*/
|
|
17
|
-
declare function createBitBus(): BitFormGlobal;
|
|
18
|
-
|
|
19
|
-
export { bitBus as b, createBitBus as c };
|
package/dist/chunk-6LNXTSZ6.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }function p(e){if(e===null||typeof e!="object")return e;if(typeof structuredClone=="function")return structuredClone(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(r=>p(r));let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=p(e[r]));return n}function d(e){return p(e)}function m(e,n){if(n===void 0)return d(e);if(n===null||typeof n!="object"||n instanceof Date||n instanceof RegExp||Array.isArray(n))return d(n);let r=e&&typeof e=="object"&&!Array.isArray(e)?d(e):{};for(let t of Object.keys(n)){let s=n[t],a=r[t];if(s!==null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp)){r[t]=m(a,s);continue}r[t]=d(s)}return r}function k(e,n){return e===n?!0:e===null||typeof e!="object"||n===null||typeof n!="object"?!1:h(e,n)}function h(e,n){if(e===n)return!0;if(e===null||typeof e!="object"||n===null||typeof n!="object")return!1;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp&&n instanceof RegExp)return e.toString()===n.toString();let r=Object.keys(e),t=Object.keys(n);if(r.length!==t.length)return!1;for(let s of r)if(!Object.prototype.hasOwnProperty.call(n,s)||!h(e[s],n[s]))return!1;return!0}function V(e,n,r="",t=new Set){if(k(e,n))return t;if(e===null||typeof e!="object"||n===null||typeof n!="object")return r&&t.add(r),t;if(Array.isArray(e)||Array.isArray(n))return!k(e,n)&&r&&t.add(r),t;let s=new Set;for(let a of Object.keys(e||{}))s.add(a);for(let a of Object.keys(n||{}))s.add(a);for(let a of s){let o=r?`${r}.${a}`:a;V(_optionalChain([e, 'optionalAccess', _ => _[a]]),_optionalChain([n, 'optionalAccess', _2 => _2[a]]),o,t)}return t}var g=new Map;function T(e,n){if(g.has(e))g.delete(e);else if(g.size>=5e3){let r=g.keys().next().value;r!==void 0&&g.delete(r)}g.set(e,n)}function A(e){let n=g.get(e);if(n)return n;let r=e.split(".");return T(e,r),r}function K(e,n){if(!n)return e;let r=A(n),t=e;for(let s of r){if(t==null)return;t=t[s]}return t}function D(e,n,r){if(!n)return r;let t=A(n),s=Array.isArray(e)?[...e]:{...e},a=s;for(let o=0;o<t.length-1;o++){let i=t[o],c=t[o+1],u=Number(c),y=Number.isInteger(u)&&String(u)===c,f=a[i];f==null?a[i]=y?[]:{}:a[i]=Array.isArray(f)?[...f]:{...f},a=a[i]}return a[t[t.length-1]]=r,s}function b(e,n){if(n.length===0)return e;let r=Array.isArray(e)?[...e]:{...e},t=new WeakSet;r&&typeof r=="object"&&t.add(r);for(let[s,a]of n){let o=A(s),i=r;for(let c=0;c<o.length-1;c++){let u=o[c],y=o[c+1],f=Number(y),R=Number.isInteger(f)&&String(f)===y,l=i[u];l==null?(i[u]=R?[]:{},t.add(i[u])):typeof l=="object"?t.has(l)||(i[u]=Array.isArray(l)?[...l]:{...l},t.add(i[u])):(i[u]=R?[]:{},t.add(i[u])),i=i[u]}i[o[o.length-1]]=a}return r}function E(e,n){if(n.length===0)return e;let r=Array.isArray(e)?[...e]:{...e},t=new WeakSet;r&&typeof r=="object"&&t.add(r);for(let s of n){if(!s)return Array.isArray(e)?[]:{};let a=A(s),o=r;for(let c=0;c<a.length-1;c++){let u=a[c],y=_optionalChain([o, 'optionalAccess', _3 => _3[u]]);if(y==null){o=void 0;break}if(typeof y=="object")t.has(y)||(o[u]=Array.isArray(y)?[...y]:{...y},t.add(o[u]));else{o=void 0;break}o=o[u]}if(!o)continue;let i=a[a.length-1];Array.isArray(o)?o.splice(Number(i),1):o&&typeof o=="object"&&delete o[i]}return r}function O(e,n){let r={},t=`${n}.`;for(let s in e)s!==n&&!s.startsWith(t)&&(r[s]=e[s]);return r}function $(e,n,r){let t={},s={},a={},o=`${n}.`;for(let i of Object.keys(e.errors)){let c=x(i,o,r);c&&(t[c]=e.errors[i])}for(let i of Object.keys(e.touched)){let c=x(i,o,r);c&&(s[c]=e.touched[i])}for(let i of Object.keys(e.isValidating)){let c=x(i,o,r);c&&(a[c]=e.isValidating[i])}return{errors:t,touched:s,isValidating:a}}function x(e,n,r){if(!e.startsWith(n))return e;let s=e.substring(n.length).split("."),a=parseInt(s[0],10),o=r(a);if(o===null)return null;let i=s.slice(1).join(".");return i?`${n}${o}.${i}`:`${n}${o}`}function w(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=_nullishCoalesce(e.errors, () => (e));return typeof n!="object"||n===null||Array.isArray(n)?!1:Object.values(n).every(r=>typeof r=="string"||Array.isArray(r)&&r.every(t=>typeof t=="string"))}function N(e){return w(e)?_nullishCoalesce(e.errors, () => (e)):{}}exports.a = d; exports.b = m; exports.c = k; exports.d = h; exports.e = V; exports.f = K; exports.g = D; exports.h = b; exports.i = E; exports.j = O; exports.k = $; exports.l = w; exports.m = N;
|
|
2
|
-
//# sourceMappingURL=chunk-6LNXTSZ6.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/utils/clone.ts","../src/core/utils/structural.ts"],"names":["cloneValue","obj","item","clone","key","deepClone","deepMerge","target","source","base","sourceValue","baseValue","valueEqual","a","b","deepEqual","keysA","keysB","collectDirtyPaths","initial","prefix","result","allKeys","k","p"],"mappings":"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","file":"/home/runner/work/bit-form/bit-form/dist/chunk-6LNXTSZ6.cjs","sourcesContent":["export function cloneValue<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n\n if (typeof structuredClone === \"function\") {\n return structuredClone(obj);\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as any as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as any as T;\n }\n\n if (Array.isArray(obj)) {\n return obj.map((item) => cloneValue(item)) as any as T;\n }\n\n const clone: any = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n clone[key] = cloneValue((obj as any)[key]);\n }\n }\n\n return clone as T;\n}\n","import { cloneValue } from \"./clone\";\n\nexport function deepClone<T>(obj: T): T {\n return cloneValue(obj);\n}\n\nexport function deepMerge<T>(target: T, source: any): T {\n if (source === undefined) {\n return deepClone(target);\n }\n\n if (\n source === null ||\n typeof source !== \"object\" ||\n source instanceof Date ||\n source instanceof RegExp ||\n Array.isArray(source)\n ) {\n return deepClone(source as T);\n }\n\n const base =\n target && typeof target === \"object\" && !Array.isArray(target)\n ? deepClone(target as any)\n : ({} as Record<string, unknown>);\n\n for (const key of Object.keys(source)) {\n const sourceValue = source[key];\n const baseValue = (base as Record<string, unknown>)[key];\n\n if (\n sourceValue !== null &&\n typeof sourceValue === \"object\" &&\n !Array.isArray(sourceValue) &&\n !(sourceValue instanceof Date) &&\n !(sourceValue instanceof RegExp)\n ) {\n (base as Record<string, unknown>)[key] = deepMerge(\n baseValue,\n sourceValue,\n );\n continue;\n }\n\n (base as Record<string, unknown>)[key] = deepClone(sourceValue);\n }\n\n return base as T;\n}\n\nexport function valueEqual(a: any, b: any): boolean {\n if (a === b) return true;\n if (\n a === null ||\n typeof a !== \"object\" ||\n b === null ||\n typeof b !== \"object\"\n ) {\n return false;\n }\n return deepEqual(a, b);\n}\n\nexport function deepEqual(a: any, b: any): boolean {\n if (a === b) return true;\n if (\n a === null ||\n typeof a !== \"object\" ||\n b === null ||\n typeof b !== \"object\"\n ) {\n return false;\n }\n\n if (a instanceof Date && b instanceof Date)\n return a.getTime() === b.getTime();\n if (a instanceof RegExp && b instanceof RegExp)\n return a.toString() === b.toString();\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (\n !Object.prototype.hasOwnProperty.call(b, key) ||\n !deepEqual(a[key], b[key])\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function collectDirtyPaths(\n obj: any,\n initial: any,\n prefix = \"\",\n result: Set<string> = new Set(),\n): Set<string> {\n if (valueEqual(obj, initial)) return result;\n if (\n obj === null ||\n typeof obj !== \"object\" ||\n initial === null ||\n typeof initial !== \"object\"\n ) {\n if (prefix) result.add(prefix);\n return result;\n }\n if (Array.isArray(obj) || Array.isArray(initial)) {\n if (!valueEqual(obj, initial) && prefix) result.add(prefix);\n return result;\n }\n const allKeys = new Set<string>();\n for (const key of Object.keys(obj || {})) {\n allKeys.add(key);\n }\n for (const key of Object.keys(initial || {})) {\n allKeys.add(key);\n }\n for (const k of allKeys) {\n const p = prefix ? `${prefix}.${k}` : k;\n collectDirtyPaths((obj as any)?.[k], (initial as any)?.[k], p, result);\n }\n return result;\n}\n"]}
|
package/dist/chunk-IV32WXCF.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function a(n,t,e){return async o=>{if(o){e.setLoading(!0),e.setError(n,void 0);try{let r=await t(o);e.setValue(r.url),e.setUploadKey(r.key),e.setError(n,void 0)}catch(r){let d=r instanceof Error?r.message:"Upload failed";e.setError(n,d)}finally{e.setLoading(!1)}}}}function l(n,t,e){return async()=>{let o=e.getUploadKey();if(o&&t)try{await t(o)}catch(r){let d=r instanceof Error?r.message:"Delete failed";e.setError(n,d);return}e.setValue(null),e.setUploadKey(null),e.setError(n,void 0)}}exports.a = a; exports.b = l;
|
|
2
|
-
//# sourceMappingURL=chunk-IV32WXCF.cjs.map
|
package/dist/chunk-J5ALITQW.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18;var _chunkRHMJPKNVcjs = require('./chunk-RHMJPKNV.cjs');var _chunkOLQVH24Zcjs = require('./chunk-OLQVH24Z.cjs');var _chunk6LNXTSZ6cjs = require('./chunk-6LNXTSZ6.cjs');function kt(r){let{path:t,getFieldConfig:e,masks:i}=r,s=_optionalChain([e, 'call', _2 => _2(t), 'optionalAccess', _3 => _3.mask]);if(s)return typeof s=="string"?_optionalChain([i, 'optionalAccess', _4 => _4[s]]):s}function It(r){let{state:t,path:e,value:i,isHidden:s,isRequired:a,isDirty:n,isValidating:o}=r,d=e;return{value:i,error:t.errors[d],touched:!!t.touched[d],isHidden:s,isRequired:a,isDirty:n,isValidating:o}}var D=Symbol.for("bit-form.framework-store-api");var A=Symbol.for("bit-form.hooks-api");var I=class{constructor(t){this.baselineValues=_chunk6LNXTSZ6cjs.a.call(void 0, t)}getValues(){return this.baselineSnapshot||(this.baselineSnapshot=Object.freeze(_chunk6LNXTSZ6cjs.a.call(void 0, this.baselineValues))),this.baselineSnapshot}setValues(t){this.baselineValues=_chunk6LNXTSZ6cjs.a.call(void 0, t),this.baselineSnapshot=void 0}};var O= (_class =class{constructor(t){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);this.getComputedEntries=t}__init() {this.equalityCache=new Map}__init2() {this.reverseDepsCache=null}__init3() {this.childDepsIndex=null}__init4() {this.validatedEntriesSignature=null}__init5() {this.validatedEntriesRef=null}__init6() {this.orderedAllEntriesCache=null}__init7() {this.orderedIndexByPathCache=null}isCacheableScalar(t){return t===null||typeof t!="object"&&typeof t!="function"}invalidateReverseDeps(){this.reverseDepsCache=null,this.childDepsIndex=null,this.orderedAllEntriesCache=null,this.validatedEntriesSignature=null,this.validatedEntriesRef=null,this.orderedIndexByPathCache=null,this.equalityCache.clear()}apply(t,e){let i=this.getComputedEntries();if(i.length===0)return t;this.ensureEntriesAreValid(i);let s=this.resolveEntriesToRun(i,e);if(s.length===0)return t;let a=t;for(let n of s){let o=n.compute(a),d=_chunk6LNXTSZ6cjs.f.call(void 0, a,n.path),p=this.equalityCache.get(n.path),l,c=this.isCacheableScalar(d)&&this.isCacheableScalar(o);c&&p&&p.current===d&&p.next===o?l=p.equal:(l=_chunk6LNXTSZ6cjs.d.call(void 0, d,o),c?this.equalityCache.set(n.path,{current:d,next:o,equal:l}):this.equalityCache.delete(n.path)),l||(a=_chunk6LNXTSZ6cjs.g.call(void 0, a,n.path,o))}return a}getReverseDependencies(t){if(this.reverseDepsCache)return this.reverseDepsCache;let e=new Map;for(let s of t)for(let a of s.dependsOn){let n=e.get(a);n||(n=new Set,e.set(a,n)),n.add(s.path)}let i=new Map;for(let s of e.keys()){let a=s.split(".");for(let n=1;n<a.length;n++){let o=a.slice(0,n).join("."),d=i.get(o);d||(d=new Set,i.set(o,d)),d.add(s)}}return this.reverseDepsCache=e,this.childDepsIndex=i,e}resolveEntriesToRun(t,e){if(!e||e.length===0||e.includes("*"))return this.getOrderedAllEntries(t);let i=this.getReverseDependencies(t),s=new Set,a=[...e],n=0;for(;n<a.length;){let l=a[n++],c=this.getDependentsForPath(i,l);if(c)for(let u of c)s.has(u)||(s.add(u),a.push(u))}if(s.size===0)return[];let o=this.getOrderedAllEntries(t),d=this.getOrderedIndexByPath(t,o),p=[];return s.forEach(l=>{let c=d.get(l);if(c===void 0)return;let u=o[c];u&&p.push({index:c,entry:u})}),p.sort((l,c)=>l.index-c.index),p.map(l=>l.entry)}orderEntries(t){if(t.length<=1)return t;let e=new Map(t.map(o=>[o.path,o])),i=new Map,s=new Map;t.forEach(o=>i.set(o.path,0)),t.forEach(o=>{o.dependsOn.forEach(d=>{if(!e.has(d))return;let p=_nullishCoalesce(s.get(d), () => (new Set));p.has(o.path)||(p.add(o.path),s.set(d,p),i.set(o.path,(_nullishCoalesce(i.get(o.path), () => (0)))+1))})});let a=t.filter(o=>(_nullishCoalesce(i.get(o.path), () => (0)))===0).map(o=>o.path),n=[];for(;a.length>0;){let o=a.shift();n.push(o);let d=s.get(o);d&&d.forEach(p=>{let l=(_nullishCoalesce(i.get(p), () => (0)))-1;i.set(p,l),l===0&&a.push(p)})}if(n.length!==t.length)throw new Error("BitStore: cyclic computed dependencies detected. Check computedDependsOn definitions.");return n.map(o=>e.get(o))}getOrderedAllEntries(t){let e=this.createEntriesSignature(t);if(this.orderedAllEntriesCache&&this.orderedAllEntriesCache.signature===e)return this.orderedAllEntriesCache.ordered;let i=this.orderEntries(t);return this.orderedAllEntriesCache={signature:e,ordered:i},i}getOrderedIndexByPath(t,e){let i=this.createEntriesSignature(t);if(this.orderedIndexByPathCache&&this.orderedIndexByPathCache.signature===i)return this.orderedIndexByPathCache.indexByPath;let s=new Map;return e.forEach((a,n)=>{s.set(a.path,n)}),this.orderedIndexByPathCache={signature:i,indexByPath:s},s}ensureEntriesAreValid(t){if(this.validatedEntriesRef===t)return;let e=this.createEntriesSignature(t);if(this.validatedEntriesSignature===e){this.validatedEntriesRef=t;return}t.forEach(i=>this.assertDependencies(i)),this.invalidateReverseDeps(),this.validatedEntriesSignature=e,this.validatedEntriesRef=t}createEntriesSignature(t){return t.map(e=>`${e.path}:${e.dependsOn.join(",")}`).join("|")}getDependentsForPath(t,e){let i=new Set,s=o=>{let d=t.get(o);d&&d.forEach(p=>i.add(p))};s(e);let a=e.split(".");for(;a.length>1;)a.pop(),s(a.join("."));let n=_optionalChain([this, 'access', _5 => _5.childDepsIndex, 'optionalAccess', _6 => _6.get, 'call', _7 => _7(e)]);if(n)for(let o of n)s(o);return i}assertDependencies(t){if(t.dependsOn.length===0)throw new Error(`BitStore: computed field \`${t.path}\` requires explicit computedDependsOn in v4.`);if(t.dependsOn.includes(t.path))throw new Error(`BitStore: computed field \`${t.path}\` cannot depend on itself.`)}}, _class);var j= (_class2 =class{constructor() { _class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this); }__init8() {this.dirtyPaths=new Set}__init9() {this.dirtyPathIndex=new Set}__init10() {this.dirtyPrefixRefCount=new Map}__init11() {this.childrenByPrefix=new Map}updateForPath(t,e,i){this.removeDirtyChildren(t);let s=_chunk6LNXTSZ6cjs.f.call(void 0, e,t),a=_chunk6LNXTSZ6cjs.f.call(void 0, i,t);return _chunk6LNXTSZ6cjs.c.call(void 0, s,a)?this.removeDirtyPath(t):this.addDirtyPath(t),this.dirtyPaths.size>0}rebuild(t,e){return this.dirtyPaths=_chunk6LNXTSZ6cjs.e.call(void 0, t,e),this.dirtyPrefixRefCount.clear(),this.rebuildIndex(),this.dirtyPaths.size>0}clear(){this.dirtyPaths.clear(),this.dirtyPathIndex.clear(),this.dirtyPrefixRefCount.clear(),this.childrenByPrefix.clear()}get isDirty(){return this.dirtyPaths.size>0}getDirtyPaths(){return this.dirtyPaths}isPathDirty(t){if(this.dirtyPathIndex.has(t))return!0;let e=t.lastIndexOf(".");for(;e>-1;){let i=t.slice(0,e);if((_nullishCoalesce(this.dirtyPrefixRefCount.get(i), () => (0)))>0)return!0;e=t.lastIndexOf(".",e-1)}return!1}buildDirtyValues(t){if(this.dirtyPaths.size===0)return{};let e=[],i=[...this.dirtyPaths].sort(),s=new Set,a=new Set,n=o=>{let d=o.lastIndexOf(".");for(;d>-1;){if(a.has(o.slice(0,d)))return!0;d=o.lastIndexOf(".",d-1)}return!1};for(let o of i){if(n(o))continue;let d=o.match(/^(.+)\.\d+/);if(d){let p=d[1];if(s.has(p))continue;s.add(p);let l=_chunk6LNXTSZ6cjs.f.call(void 0, t,p);e.push([p,l]),a.add(p)}else{let p=_chunk6LNXTSZ6cjs.f.call(void 0, t,o);e.push([o,p]),a.add(o)}}return e.length===0?{}:_chunk6LNXTSZ6cjs.h.call(void 0, {},e)}rebuildIndex(){let t=new Set,e=new Map,i=new Map;for(let s of this.dirtyPaths)this.forEachPathPrefix(s,a=>{t.add(a),e.set(a,(_nullishCoalesce(e.get(a), () => (0)))+1)}),this.forEachAncestorPrefix(s,a=>{let n=i.get(a);n?n.add(s):i.set(a,new Set([s]))});this.dirtyPathIndex=t,this.dirtyPrefixRefCount=e,this.childrenByPrefix=i}removeDirtyChildren(t){let e=this.childrenByPrefix.get(t);if(!(!e||e.size===0))for(let i of[...e])this.removeDirtyPath(i)}addDirtyPath(t){this.dirtyPaths.has(t)||(this.dirtyPaths.add(t),this.forEachPathPrefix(t,e=>{this.dirtyPathIndex.add(e),this.dirtyPrefixRefCount.set(e,(_nullishCoalesce(this.dirtyPrefixRefCount.get(e), () => (0)))+1)}),this.forEachAncestorPrefix(t,e=>{let i=this.childrenByPrefix.get(e);i?i.add(t):this.childrenByPrefix.set(e,new Set([t]))}))}removeDirtyPath(t){this.dirtyPaths.has(t)&&(this.dirtyPaths.delete(t),this.forEachPathPrefix(t,e=>{let i=(_nullishCoalesce(this.dirtyPrefixRefCount.get(e), () => (0)))-1;if(i<=0){this.dirtyPrefixRefCount.delete(e),this.dirtyPathIndex.delete(e);return}this.dirtyPrefixRefCount.set(e,i)}),this.forEachAncestorPrefix(t,e=>{_optionalChain([this, 'access', _8 => _8.childrenByPrefix, 'access', _9 => _9.get, 'call', _10 => _10(e), 'optionalAccess', _11 => _11.delete, 'call', _12 => _12(t)])}))}forEachPathPrefix(t,e){let i=t.split("."),s="";for(let a of i)s=s?`${s}.${a}`:a,e(s)}forEachAncestorPrefix(t,e){let i=t.split("."),s="";for(let a=0;a<i.length-1;a++)s=s?`${s}.${i[a]}`:i[a],e(s)}}, _class2);var H= (_class3 =class{constructor() { _class3.prototype.__init12.call(this); }__init12() {this.masks=new Map}registerMask(t,e){this.masks.set(t,e)}unregisterMask(t){this.masks.has(t)&&this.masks.delete(t)}resolveMask(t){return this.masks.get(t)}getAllMasks(){return Object.fromEntries(this.masks.entries())}clear(){this.masks.clear()}}, _class3);var z= (_class4 =class{constructor() { _class4.prototype.__init13.call(this);_class4.prototype.__init14.call(this);_class4.prototype.__init15.call(this);_class4.prototype.__init16.call(this);_class4.prototype.__init17.call(this); }__init13() {this.fieldConfigs=new Map}__init14() {this.scopeFieldsIndex=null}__init15() {this.computedEntriesCache=null}__init16() {this.normalizerEntriesCache=null}__init17() {this.transformEntriesCache=null}get(t){return this.fieldConfigs.get(t)}set(t,e){this.fieldConfigs.set(t,e),this.registerCachedIndexes(t,e)}delete(t){let e=this.fieldConfigs.get(t);return this.fieldConfigs.delete(t),this.unregisterCachedIndexes(t,e),e}has(t){return this.fieldConfigs.has(t)}forEach(t){this.fieldConfigs.forEach((e,i)=>t(e,i))}entries(){return Array.from(this.fieldConfigs.entries())}getScopeFields(t){if(!this.scopeFieldsIndex){let e=new Map;this.forEach((i,s)=>{if(!i.scope)return;let a=_nullishCoalesce(e.get(i.scope), () => (new Set));a.add(s),e.set(i.scope,a)}),this.scopeFieldsIndex=e}return Array.from(_nullishCoalesce(this.scopeFieldsIndex.get(t), () => ([])))}getComputedEntries(){if(!this.computedEntriesCache){let t=[];this.forEach((e,i)=>{e.computed&&t.push({path:i,compute:e.computed,dependsOn:e.computedDependsOn})}),this.computedEntriesCache=t}return this.computedEntriesCache}getTransformEntries(){if(!this.transformEntriesCache){let t=[];this.forEach((e,i)=>{e.transform&&t.push([i,e.transform])}),this.transformEntriesCache=t}return this.transformEntriesCache}getNormalizerEntries(){if(!this.normalizerEntriesCache){let t=[];this.forEach((e,i)=>{e.normalize&&t.push({path:i,normalize:e.normalize,dependsOn:_optionalChain([e, 'access', _13 => _13.normalizeDependsOn, 'optionalAccess', _14 => _14.length])?e.normalizeDependsOn:[i]})}),this.normalizerEntriesCache=t}return this.normalizerEntriesCache}invalidateIndexes(){this.scopeFieldsIndex=null,this.computedEntriesCache=null,this.normalizerEntriesCache=null,this.transformEntriesCache=null}registerCachedIndexes(t,e){if(this.scopeFieldsIndex&&e.scope){let i=_nullishCoalesce(this.scopeFieldsIndex.get(e.scope), () => (new Set));i.add(t),this.scopeFieldsIndex.set(e.scope,i)}this.computedEntriesCache&&e.computed&&this.computedEntriesCache.push({path:t,compute:e.computed,dependsOn:e.computedDependsOn}),this.normalizerEntriesCache&&e.normalize&&this.normalizerEntriesCache.push({path:t,normalize:e.normalize,dependsOn:_optionalChain([e, 'access', _15 => _15.normalizeDependsOn, 'optionalAccess', _16 => _16.length])?e.normalizeDependsOn:[t]}),this.transformEntriesCache&&e.transform&&this.transformEntriesCache.push([t,e.transform])}unregisterCachedIndexes(t,e){if(!e){this.invalidateIndexes();return}if(this.scopeFieldsIndex&&e.scope){let i=this.scopeFieldsIndex.get(e.scope);i&&(i.delete(t),i.size>0?this.scopeFieldsIndex.set(e.scope,i):this.scopeFieldsIndex.delete(e.scope))}this.computedEntriesCache&&e.computed&&(this.computedEntriesCache=this.computedEntriesCache.filter(i=>i.path!==t)),this.normalizerEntriesCache&&e.normalize&&(this.normalizerEntriesCache=this.normalizerEntriesCache.filter(i=>i.path!==t)),this.transformEntriesCache&&e.transform&&(this.transformEntriesCache=this.transformEntriesCache.filter(([i])=>i!==t))}}, _class4);var q= (_class5 =class{constructor(t){;_class5.prototype.__init18.call(this);_class5.prototype.__init19.call(this);_class5.prototype.__init20.call(this);_class5.prototype.__init21.call(this);_class5.prototype.__init22.call(this);_class5.prototype.__init23.call(this);_class5.prototype.__init24.call(this);this.getFieldConfig=t}__init18() {this.dependencies=new Map}__init19() {this.hiddenFields=new Set}__init20() {this.conditionalVisibilityPaths=new Set}__init21() {this.requiredPathsByDependency=new Map}__init22() {this.requiredConditionalPaths=new Set}__init23() {this.requiredEvaluationVersion=0}__init24() {this.requiredEvaluationCache=new Map}getHiddenFields(){return this.hiddenFields}onRegister(t,e,i){_optionalChain([e, 'access', _17 => _17.conditional, 'optionalAccess', _18 => _18.showIf])&&this.conditionalVisibilityPaths.add(t);let s=_optionalChain([e, 'access', _19 => _19.conditional, 'optionalAccess', _20 => _20.dependsOn]);s&&s.forEach(a=>{this.dependencies.has(a)||this.dependencies.set(a,new Set),this.dependencies.get(a).add(t)}),s&&_optionalChain([e, 'access', _21 => _21.conditional, 'optionalAccess', _22 => _22.requiredIf])&&(this.requiredConditionalPaths.add(t),s.forEach(a=>{this.requiredPathsByDependency.has(a)||this.requiredPathsByDependency.set(a,new Set),this.requiredPathsByDependency.get(a).add(t)})),this.requiredEvaluationVersion+=1,this.requiredEvaluationCache.clear(),this.evaluateFieldCondition(t,i)}onUnregister(t,e){this.hiddenFields.delete(t),this.conditionalVisibilityPaths.delete(t),this.dependencies.delete(t),this.requiredEvaluationVersion+=1,this.requiredEvaluationCache.clear(),this.requiredConditionalPaths.delete(t),_optionalChain([e, 'optionalAccess', _23 => _23.conditional, 'optionalAccess', _24 => _24.dependsOn, 'optionalAccess', _25 => _25.forEach, 'call', _26 => _26(i=>{let s=this.requiredPathsByDependency.get(i);s&&(s.delete(t),s.size===0&&this.requiredPathsByDependency.delete(i))})]),this.dependencies.forEach(i=>{i.delete(t)})}isHidden(t){return this.hiddenFields.has(t)}hasDependents(t){return(_nullishCoalesce(_optionalChain([this, 'access', _27 => _27.dependencies, 'access', _28 => _28.get, 'call', _29 => _29(t), 'optionalAccess', _30 => _30.size]), () => (0)))>0}isRequired(t,e){let i=this.getFieldConfig(t);if(!i||this.isHidden(t)||!_optionalChain([i, 'access', _31 => _31.conditional, 'optionalAccess', _32 => _32.requiredIf]))return!1;let s=this.requiredEvaluationCache.get(t);if(s&&s.version===this.requiredEvaluationVersion&&s.valuesRef===e)return s.result;let a=!!i.conditional.requiredIf(e);return this.requiredEvaluationCache.set(t,{version:this.requiredEvaluationVersion,valuesRef:e,result:a}),a}getRequiredErrors(t){let e={};return this.requiredConditionalPaths.forEach(i=>{let s=this.getFieldConfig(i);if(s&&this.isRequired(i,t)){let a=_chunk6LNXTSZ6cjs.f.call(void 0, t,i);this.isEmpty(a)&&(e[i]=_nullishCoalesce(_optionalChain([s, 'access', _33 => _33.conditional, 'optionalAccess', _34 => _34.requiredMessage]), () => ("required field")))}}),e}evaluateAll(t){this.conditionalVisibilityPaths.forEach(e=>{this.evaluateFieldCondition(e,t)})}updateDependencies(t,e,i){let s=new Set,a=new Set,n=new Set,o=[t],d=new Set;for(;o.length>0;){let p=o.shift();if(d.has(p))continue;d.add(p);let l=this.dependencies.get(p);l&&l.forEach(c=>{s.add(c);let u=this.isHidden(c),h=this.isRequired(c,e);this.evaluateFieldCondition(c,i);let S=this.isHidden(c),B=this.isRequired(c,i);u!==S&&a.add(c),h!==B&&n.add(c),o.push(c)})}return{affectedFields:Array.from(s),visibilityChanged:Array.from(a),requiredChanged:Array.from(n)}}evaluateFieldCondition(t,e){let s=_optionalChain([this, 'access', _35 => _35.getFieldConfig, 'call', _36 => _36(t), 'optionalAccess', _37 => _37.conditional, 'optionalAccess', _38 => _38.showIf]);s&&(s(e)?this.hiddenFields.delete(t):this.hiddenFields.add(t))}isEmpty(t){return t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0}}, _class5);function Ge(r){return r.replace(/\.+$/g,"")}function E(r){return Ge(r.trim())}function v(r,t){let e=E(t);return e.length===0?!1:r===e||r.startsWith(`${e}.`)}function bt(r,t){return E(t===void 0?r:`${r}.${t}`)}var U= (_class6 =class{constructor() { _class6.prototype.__init25.call(this);_class6.prototype.__init26.call(this); }__init25() {this.catalog=new z}__init26() {this.conditions=new q(t=>this.catalog.get(t))}getFieldConfig(t){return this.catalog.get(t)}forEachFieldConfig(t){this.catalog.forEach((e,i)=>t(e,i))}hasFieldConfig(t){return this.catalog.has(t)}getHiddenFields(){return this.conditions.getHiddenFields()}register(t,e,i){this.catalog.set(t,e),this.conditions.onRegister(t,e,i)}unregister(t){let e=this.catalog.delete(t);this.conditions.onUnregister(t,e)}unregisterPrefix(t){let e=[],i=E(t);return i.length===0||(this.catalog.forEach((s,a)=>{v(a,i)&&e.push([a,s])}),e.forEach(([s,a])=>{this.catalog.delete(s),this.conditions.onUnregister(s,a)})),e}isHidden(t){return this.conditions.isHidden(t)}hasDependents(t){return this.conditions.hasDependents(t)}isRequired(t,e){return this.conditions.isRequired(t,e)}getRequiredErrors(t){return this.conditions.getRequiredErrors(t)}evaluateAll(t){this.conditions.evaluateAll(t)}updateDependencies(t,e,i){return this.conditions.updateDependencies(t,e,i)}getScopeFields(t){return this.catalog.getScopeFields(t)}getComputedEntries(){return this.catalog.getComputedEntries()}getTransformEntries(){return this.catalog.getTransformEntries()}getNormalizerEntries(){return this.catalog.getNormalizerEntries()}invalidateIndexes(){this.catalog.invalidateIndexes()}}, _class6);function Ye(){return`bit-form-${Math.random().toString(36).slice(2,9)}`}function Xe(r){typeof console<"u"&&typeof console.error=="function"&&console.error(r)}function Ot(r={}){let t=_nullishCoalesce(r.initialValues, () => ({})),e=r.validation,i=r.history,s=r.name?`bit-form:${r.name}:draft`:"bit-form:draft",a=_nullishCoalesce(r.onUnhandledError, () => (Xe)),n=_optionalChain([r, 'access', _39 => _39.persist, 'optionalAccess', _40 => _40.onError]),o={enabled:_nullishCoalesce(_optionalChain([r, 'access', _41 => _41.persist, 'optionalAccess', _42 => _42.enabled]), () => (!1)),key:_nullishCoalesce(_optionalChain([r, 'access', _43 => _43.persist, 'optionalAccess', _44 => _44.key]), () => (s)),storage:_optionalChain([r, 'access', _45 => _45.persist, 'optionalAccess', _46 => _46.storage]),autoSave:_nullishCoalesce(_optionalChain([r, 'access', _47 => _47.persist, 'optionalAccess', _48 => _48.autoSave]), () => (!0)),debounceMs:_nullishCoalesce(_optionalChain([r, 'access', _49 => _49.persist, 'optionalAccess', _50 => _50.debounceMs]), () => (300)),mode:_nullishCoalesce(_optionalChain([r, 'access', _51 => _51.persist, 'optionalAccess', _52 => _52.mode]), () => ("values")),serialize:_nullishCoalesce(_optionalChain([r, 'access', _53 => _53.persist, 'optionalAccess', _54 => _54.serialize]), () => (JSON.stringify)),deserialize:_nullishCoalesce(_optionalChain([r, 'access', _55 => _55.persist, 'optionalAccess', _56 => _56.deserialize]), () => ((d=>JSON.parse(d)))),onError:d=>{if(n){n(d);return}a(d,"persist")}};return{name:r.name,initialValues:_chunk6LNXTSZ6cjs.a.call(void 0, t),resolver:_optionalChain([e, 'optionalAccess', _57 => _57.resolver]),validationDelay:_nullishCoalesce(_optionalChain([e, 'optionalAccess', _58 => _58.delay]), () => (300)),history:{enabled:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _59 => _59.enabled]), () => (!1)),limit:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _60 => _60.limit]), () => (50))},masks:r.masks,fields:r.fields,devTools:r.devTools,persist:o,idFactory:_nullishCoalesce(r.idFactory, () => (Ye)),plugins:_nullishCoalesce(r.plugins, () => ([])),scheduler:r.scheduler,subscriptionCacheSize:r.subscriptionCacheSize,trackedSubscriptions:_nullishCoalesce(r.trackedSubscriptions, () => (!1)),bus:r.bus,onUnhandledError:a}}function _(r,t){if((!r||r.length===0)&&(!t||t.length===0))return;let e=new Set(_nullishCoalesce(r, () => ([])));return _optionalChain([t, 'optionalAccess', _61 => _61.forEach, 'call', _62 => _62(i=>e.add(i))]),Array.from(e)}function jt(r){let{values:t,entries:e,deriveValue:i}=r,s=[];for(let a of e){let n=_chunk6LNXTSZ6cjs.f.call(void 0, t,a.path),o=i(a,n);_chunk6LNXTSZ6cjs.c.call(void 0, n,o)||s.push([a.path,o])}return s}function Ze(r){let t=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _63 => _63.includes, 'call', _64 => _64("*")]), () => (!1)),e=new Set(_nullishCoalesce(r, () => ([]))),i=new Set;for(let s of e){i.add(s);let a=s.lastIndexOf(".");for(;a>-1;)i.add(s.slice(0,a)),a=s.lastIndexOf(".",a-1)}return s=>{if(!r||r.length===0||t||e.has(s)||i.has(s))return!0;let a=s.lastIndexOf(".");for(;a>-1;){if(e.has(s.slice(0,a)))return!0;a=s.lastIndexOf(".",a-1)}return!1}}function Qe(r,t){if(!t||t.length===0||t.includes("*"))return r;let e=Ze(t);return r.filter(i=>i.dependsOn.some(s=>e(s)))}function N(r){let{values:t,changedPaths:e,normalizerEntries:i,applyComputed:s}=r,a=Qe(i,e);if(a.length===0)return s(t,e);let n=jt({values:t,entries:a,deriveValue:(p,l)=>p.normalize(l,t)}),o=n.length>0?_chunk6LNXTSZ6cjs.h.call(void 0, t,n):t,d=_(e,n.map(([p])=>p));return s(o,d)}function Ht(r){let{values:t,sourceValues:e,transformEntries:i}=r;if(i.length===0)return t;let s=jt({values:t,entries:i.map(([a,n])=>({path:a,transform:n})),deriveValue:(a,n)=>a.transform(n,e)});return s.length===0?t:_chunk6LNXTSZ6cjs.h.call(void 0, t,s)}var L=class{constructor(t,e,i=!0,s){this.storeId=t;this.bus=e;this.enableBusDispatch=i;this.storeBusPort=s}attachStorePort(t){this.storeBusPort=t,this.enableBusDispatch&&(this.bus.stores[this.storeId]=t)}initialize(){!this.enableBusDispatch||!this.storeBusPort||(this.bus.stores[this.storeId]=this.storeBusPort)}onStateUpdated(t){this.enableBusDispatch&&this.bus.dispatch(this.storeId,t)}destroy(){this.enableBusDispatch&&delete this.bus.stores[this.storeId]}};var W=class{constructor(t){this.persistManager=t}onStateUpdated(t,e){e&&this.persistManager.queueSave()}restorePersisted(){return this.persistManager.restore()}savePersistedNow(){return this.persistManager.saveNow()}clearPersisted(){return this.persistManager.clear()}destroy(){this.persistManager.destroy()}};var K=class{constructor(t){this.pluginManager=t}initialize(){this.pluginManager.setupAll()}beforeValidate(t){return this.pluginManager.beforeValidate(t)}afterValidate(t){return this.pluginManager.afterValidate(t)}beforeSubmit(t){return this.pluginManager.beforeSubmit(t)}afterSubmit(t){return this.pluginManager.afterSubmit(t)}onFieldChange(t){this.pluginManager.onFieldChange(t)}reportOperationalError(t){return this.pluginManager.reportError(t.source,t.error,t.payload)}destroy(){this.pluginManager.destroy()}};var $=class{constructor(t,e,i,s,a=!0,n){this.persistEffects=new W(i),this.pluginEffects=new K(s),this.busEffects=new L(t,e,a,n)}attachStorePort(t){this.busEffects.attachStorePort(t)}initialize(){this.pluginEffects.initialize(),this.busEffects.initialize()}onStateUpdated(t,e){this.persistEffects.onStateUpdated(t,e),this.busEffects.onStateUpdated(t)}restorePersisted(){return this.persistEffects.restorePersisted()}savePersistedNow(){return this.persistEffects.savePersistedNow()}clearPersisted(){return this.persistEffects.clearPersisted()}beforeValidate(t){return this.pluginEffects.beforeValidate(t)}afterValidate(t){return this.pluginEffects.afterValidate(t)}beforeSubmit(t){return this.pluginEffects.beforeSubmit(t)}afterSubmit(t){return this.pluginEffects.afterSubmit(t)}onFieldChange(t){this.pluginEffects.onFieldChange(t)}reportOperationalError(t){return this.pluginEffects.reportOperationalError(t)}destroy(){this.persistEffects.destroy(),this.pluginEffects.destroy(),this.busEffects.destroy()}};function ti(){if(typeof globalThis>"u")return;let r=globalThis.localStorage;if(r)return{getItem:t=>r.getItem(t),setItem:(t,e)=>r.setItem(t,e),removeItem:t=>r.removeItem(t)}}var J=class{constructor(t,e,i,s){this.config=t;this.getValues=e;this.getDirtyValues=i;this.applyRestoredValues=s}getStorage(){return this.config.storage||ti()}canPersist(){return!!(this.config.enabled&&this.config.key&&this.getStorage())}handleError(t){_optionalChain([this, 'access', _65 => _65.config, 'access', _66 => _66.onError, 'optionalCall', _67 => _67(t)])}async saveNow(){if(!this.canPersist())return;let t=this.getStorage();if(t)try{let e=this.config.mode==="dirtyValues"?this.getDirtyValues():this.getValues(),i=this.config.serialize(e);await t.setItem(this.config.key,i)}catch(e){this.handleError(e)}}queueSave(){!this.canPersist()||!this.config.autoSave||(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.saveNow()},this.config.debounceMs))}async restore(){if(!this.canPersist())return!1;let t=this.getStorage();if(!t)return!1;try{let e=await t.getItem(this.config.key);if(!e)return!1;let i=this.config.deserialize(e);return!i||typeof i!="object"?!1:(this.applyRestoredValues(i),!0)}catch(e){return this.handleError(e),!1}}async clear(){if(!this.canPersist())return;let t=this.getStorage();if(t)try{await t.removeItem(this.config.key)}catch(e){this.handleError(e)}}destroy(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}};var G= (_class7 =class{constructor(t,e){;_class7.prototype.__init27.call(this);_class7.prototype.__init28.call(this);_class7.prototype.__init29.call(this);this.plugins=t;this.contextFactory=e}__init27() {this.teardownFns=[]}__init28() {this.notifyingError=!1}__init29() {this.cachedContext=null}setupAll(){let t=this.getContext();this.plugins.forEach(e=>{if(e.setup)try{let i=e.setup(t);typeof i=="function"&&this.teardownFns.push(i)}catch(i){this.reportError("setup",i,void 0,e.name)}})}async beforeValidate(t){await this.emitHook("beforeValidate",t)}async afterValidate(t){await this.emitHook("afterValidate",t)}async beforeSubmit(t){await this.emitHook("beforeSubmit",t)}async afterSubmit(t){await this.emitHook("afterSubmit",t)}onFieldChange(t){let e=this.getContext();this.plugins.forEach(i=>{let s=_optionalChain([i, 'access', _68 => _68.hooks, 'optionalAccess', _69 => _69.onFieldChange]);if(s)try{let a=s(t,e);Promise.resolve(a).catch(n=>{this.reportError("onFieldChange",n,t,i.name)})}catch(a){this.reportError("onFieldChange",a,t,i.name)}})}async reportError(t,e,i,s){if(this.notifyingError)return;this.notifyingError=!0;let a=this.getContext(),n={source:t,pluginName:s,error:e,event:i,values:a.getState().values,state:a.getState()};for(let o of this.plugins){let d=_optionalChain([o, 'access', _70 => _70.hooks, 'optionalAccess', _71 => _71.onError]);if(d)try{await d(n,a)}catch (e2){}}this.notifyingError=!1}destroy(){for(let t=this.teardownFns.length-1;t>=0;t-=1){let e=this.teardownFns[t];try{e()}catch(i){this.reportError("teardown",i)}}this.teardownFns=[],this.cachedContext=null}async emitHook(t,e){let i=this.getContext();for(let s of this.plugins){let a=_optionalChain([s, 'access', _72 => _72.hooks, 'optionalAccess', _73 => _73[t]]);if(a)try{await a(e,i)}catch(n){await this.reportError(t,n,e,s.name)}}}getContext(){return this.cachedContext||(this.cachedContext=this.contextFactory()),this.cachedContext}}, _class7);var Bt=typeof globalThis<"u"?globalThis:typeof global<"u"?global:window;Bt.__BIT_FORM__||(Bt.__BIT_FORM__={stores:{},listeners:new Set,dispatch(r,t){this.listeners.forEach(e=>e(r,t))},subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r)}}});var Tt=Bt.__BIT_FORM__,ei={stores:{},listeners:new Set,dispatch:()=>{},subscribe:()=>()=>{}};function vt(){return ei}function ii(){let r=new Set;return{stores:{},listeners:r,dispatch(t,e){r.forEach(i=>i(t,e))},subscribe(t){return r.add(t),()=>r.delete(t)}}}function ri(r){return r.bus?!0:typeof r.devTools=="boolean"?r.devTools:r.devTools&&typeof r.devTools=="object"?r.devTools.enabled!==!1:!1}function zt(r){let{storeId:t,storeBusPort:e,config:i,getState:s,getConfig:a,getValues:n,getDirtyValues:o,applyPersistedValues:d}=r,p=new J(i.persist,n,o,d),l=new G([...i.plugins],()=>({storeId:t,getState:()=>s(),getConfig:()=>a()})),c=ri(i),u=typeof process<"u"&&typeof process.env<"u"&&process.env.VITEST==="true",h=c?_nullishCoalesce(i.bus, () => ((u?vt():Tt))):vt(),S=new $(t,h,p,l,c,e);return S.initialize(),S}function g(r,t,e){return{kind:"state.patch",partialState:r,changedPaths:t,skipComputed:_optionalChain([e, 'optionalAccess', _74 => _74.skipComputed])}}function Pt(r){return{kind:"field.touchMany",paths:r}}function P(r){return{kind:"form.persistMeta",patch:r}}function V(r,t){return{kind:"validation.commit",errors:r,isValid:t}}async function qt(r){let{dispatch:t,effects:e}=r;t(P({isRestoring:!0,error:null}));try{return await e.restorePersisted()}catch(i){return t(P({isRestoring:!1,error:i instanceof Error?i:new Error(String(i))})),!1}finally{t(P({isRestoring:!1}))}}async function Ut(r){let{dispatch:t,effects:e}=r;t(P({isSaving:!0,error:null}));try{await e.savePersistedNow()}catch(i){t(P({isSaving:!1,error:i instanceof Error?i:new Error(String(i))}));return}t(P({isSaving:!1}))}async function _t(r){let{dispatch:t,effects:e}=r;t(P({error:null}));try{await e.clearPersisted()}catch(i){t(P({error:i instanceof Error?i:new Error(String(i))}))}}function Nt(r){let{values:t,state:e,initialValues:i,validation:s,fieldRegistry:a,dirtyManager:n,dispatch:o,saveHistorySnapshot:d}=r,p=_chunk6LNXTSZ6cjs.a.call(void 0, _chunk6LNXTSZ6cjs.b.call(void 0, i,t));s.cancelAll(),a.evaluateAll(p);let l=n.rebuild(p,i);o(g({values:p,errors:{},touched:{},isValidating:{},persist:{...e.persist,error:null},isValid:!0,isDirty:l,isSubmitting:!1})),d(),s.validate()}function Lt(r){let{state:t,path:e}=r,i={...t.errors},s={...t.touched},a=!1;return i[e]&&(delete i[e],a=!0),s[e]&&(delete s[e],a=!0),a?{errors:i,touched:s}:null}function Wt(r){let{path:t,config:e,state:i,fieldRegistry:s,subscriptions:a,stateReader:n,invalidateFieldIndexes:o}=r;s.register(t,e,i.values),o(),a.invalidatePathExpansionCache(t),n.invalidatePath(t),e.scope&&a.notify(i,[_chunkRHMJPKNVcjs.d.call(void 0, e.scope)]),s.isHidden(t)&&a.notify(i,[t])}function Kt(r){let{path:t,state:e,hasStaticConfig:i,fieldRegistry:s,subscriptions:a,validationCleanupField:n,invalidateFieldIndexes:o,dispatch:d}=r;if(i)return;let p=s.getFieldConfig(t);n(t),s.unregister(t),o(),a.invalidatePathExpansionCache(t),_optionalChain([p, 'optionalAccess', _75 => _75.scope])&&a.notify(e,[_chunkRHMJPKNVcjs.d.call(void 0, p.scope)]);let l=Lt({state:e,path:t});l&&d(g({errors:l.errors,touched:l.touched}))}function Y(r){let{prefix:t,state:e,fieldRegistry:i,subscriptions:s,validationCleanupPrefix:a,invalidateFieldIndexes:n}=r;a(t);let o=i.unregisterPrefix(t);n(),s.invalidatePathExpansionCache(t),new Set(o.map(([,p])=>p.scope).filter(p=>!!p)).forEach(p=>{s.notify(e,[_chunkRHMJPKNVcjs.d.call(void 0, p)])})}var X= (_class8 =class{constructor(t,e=500){;_class8.prototype.__init30.call(this);_class8.prototype.__init31.call(this);_class8.prototype.__init32.call(this);_class8.prototype.__init33.call(this);_class8.prototype.__init34.call(this);_class8.prototype.__init35.call(this);this.getState=t;this.MAX_PATH_EXPANSION_CACHE_SIZE=e}__init30() {this.listeners=new Set}__init31() {this.pathScopedSubscriptions=new Map}__init32() {this.pathSelectorIndex=new Map}__init33() {this.pathExpansionCache=new Map}__init34() {this.subscriptionSeenVersion=new Map}__init35() {this.notifyVersion=0}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}subscribeSelector(t,e,i,s){let a=t(this.getState()),n={notify:d=>{let p=t(d);s(a,p)||(a=p,e(p))}},o=this.normalizeSubscriptionPaths(i.paths);return this.pathScopedSubscriptions.set(n,o),o.forEach(d=>{this.forEachIndexPath(d,p=>{let l=_nullishCoalesce(this.pathSelectorIndex.get(p), () => (new Set));l.add(n),this.pathSelectorIndex.set(p,l)})}),i.emitImmediately&&e(a),()=>{this.subscriptionSeenVersion.delete(n);let d=this.pathScopedSubscriptions.get(n);d&&(d.forEach(p=>{this.forEachIndexPath(p,l=>{let c=this.pathSelectorIndex.get(l);c&&(c.delete(n),c.size===0&&this.pathSelectorIndex.delete(l))})}),this.pathScopedSubscriptions.delete(n))}}notify(t,e){if(this.listeners.forEach(a=>a()),this.pathScopedSubscriptions.size===0)return;let i=this.normalizeChangedPathIterable(e);if(i.length===0||i.includes("*")){this.pathScopedSubscriptions.forEach((a,n)=>{n.notify(t)});return}if(i.length===1&&this.isSimplePath(i[0])){this.collectSubscribersForSingleChangedPath(i[0]).forEach(n=>{n.notify(t)});return}this.collectSubscribersForChangedPaths(i).forEach(a=>{a.notify(t)})}destroy(){this.listeners.clear(),this.pathScopedSubscriptions.clear(),this.pathSelectorIndex.clear(),this.pathExpansionCache.clear(),this.subscriptionSeenVersion.clear()}invalidatePathExpansionCache(t){if(!t){this.pathExpansionCache.clear();return}let e=E(t);if(e.length===0){this.pathExpansionCache.clear();return}for(let i of this.pathExpansionCache.keys())(v(i,e)||v(e,i))&&this.pathExpansionCache.delete(i)}normalizeSubscriptionPaths(t){if(!t||t.length===0)return[];let e=new Set,i=[];for(let s of t){let a=s.trim();a.length===0||e.has(a)||(e.add(a),i.push(a))}return i}normalizeChangedPathIterable(t){if(!t)return[];let e=new Set,i=[];for(let s of t){let a=s.trim();a.length===0||e.has(a)||(e.add(a),i.push(a))}return i}collectSubscribersForChangedPaths(t){let e=[],i=++this.notifyVersion,s=a=>{let n=this.pathSelectorIndex.get(a);n&&n.forEach(o=>{(_nullishCoalesce(this.subscriptionSeenVersion.get(o), () => (0)))>=i||(this.subscriptionSeenVersion.set(o,i),e.push(o))})};return t.forEach(a=>{this.forEachLookupPath(a,s)}),e}collectSubscribersForSingleChangedPath(t){let e=[],i=++this.notifyVersion,s=a=>{let n=this.pathSelectorIndex.get(a);n&&n.forEach(o=>{(_nullishCoalesce(this.subscriptionSeenVersion.get(o), () => (0)))>=i||(this.subscriptionSeenVersion.set(o,i),e.push(o))})};return this.forEachLookupPath(t,s),e}expandChangedPathForLookup(t){return this.expandPathGeneric(t)}expandPathForIndexing(t){return this.expandPathGeneric(t)}forEachIndexPath(t,e){if(!this.isSimplePath(t)){this.expandPathForIndexing(t).forEach(e);return}let i=t.split("."),s="";for(let a=0;a<i.length;a+=1)s=s?`${s}.${i[a]}`:i[a],e(s)}forEachLookupPath(t,e){if(!this.isSimplePath(t)){this.expandChangedPathForLookup(t).forEach(e);return}e(t);let i=t.lastIndexOf(".");for(;i>-1;)e(t.slice(0,i)),i=t.lastIndexOf(".",i-1)}isSimplePath(t){return!t.includes("*")&&!t.includes("[")&&!t.includes("]")}expandPathGeneric(t){let e=this.pathExpansionCache.get(t);if(e)return e;let i=t.split("."),s=[];for(let a=1;a<=i.length;a++)s.push(i.slice(0,a).join("."));return this.setBoundedCacheEntry(this.pathExpansionCache,t,s,this.MAX_PATH_EXPANSION_CACHE_SIZE),s}setBoundedCacheEntry(t,e,i,s){if(t.size>=s){let a=t.keys().next().value;a!==void 0&&t.delete(a)}t.set(e,i)}}, _class8);var w=class{constructor(t){this.steps=t}async run(t){for(let e of this.steps){if(t.halted)break;await e.run(t)}}},Z=class{constructor(t){this.steps=t}run(t){for(let e of this.steps){if(t.halted)break;let i=e.run(t);i!=null&&typeof i.then=="function"&&typeof process<"u"&&_optionalChain([process, 'access', _76 => _76.env, 'optionalAccess', _77 => _77.NODE_ENV])!=="production"&&console.warn(`BitSyncPipelineRunner: step "${e.name}" returned a Promise and will not be awaited.`)}}};function x(r){for(let t in r)return!0;return!1}function $t(r){let{targetFields:t,currentErrors:e,allErrors:i,asyncErrors:s}=r;if(t&&t.length>0){let n=e,o=!1,d=()=>(o||(n={...e},o=!0),n);t.forEach(l=>{let c=l,u=e[c];if(i[l])u!==i[l]&&(d()[c]=i[l]);else if(s.has(l)){let h=s.get(l);u!==h&&(d()[c]=h)}else u!==void 0&&delete d()[c]});let p=t.every(l=>!i[l]&&!s.has(l));return{committedErrors:o?n:e,result:p,mode:"scoped"}}let a={};return s.forEach((n,o)=>{a[o]=n}),Object.entries(i).forEach(([n,o])=>{a[n]=o}),{committedErrors:a,result:void 0,mode:"global"}}function Jt(r){let{targetFields:t,hiddenFields:e,getFieldConfig:i,forEachFieldConfig:s}=r,a=[];if(t&&t.length>0){for(let n of t){if(e.has(n))continue;_optionalChain([i, 'call', _78 => _78(n), 'optionalAccess', _79 => _79.validation, 'optionalAccess', _80 => _80.asyncValidate])&&a.push(n)}return a}return s&&s((n,o)=>{!_optionalChain([n, 'access', _81 => _81.validation, 'optionalAccess', _82 => _82.asyncValidate])||e.has(o)||a.push(o)}),a}async function Gt(r){let{path:t,values:e,validationId:i,currentValidationId:s,getFieldConfig:a,cancelFieldAsync:n,createAbortController:o,setAbortController:d,clearAbortController:p,setFieldValidating:l,setAsyncError:c,clearAsyncError:u}=r,h=_optionalChain([a, 'call', _83 => _83(t), 'optionalAccess', _84 => _84.validation, 'optionalAccess', _85 => _85.asyncValidate]);if(!h){u(t);return}n(t);let S=o();d(t,S),l(t,!0);try{let B=await h(_chunk6LNXTSZ6cjs.f.call(void 0, e,t),e);if(S.signal.aborted||i!==s)return;B?c(t,B):u(t)}finally{!S.signal.aborted&&i===s&&l(t,!1),p(t)}}var Q= (_class9 =class{constructor(t){;_class9.prototype.__init36.call(this);_class9.prototype.__init37.call(this);this.port=t}__init36() {this.abortControllers=new Map}__init37() {this.pendingJobs=new Map}handle(t,e,i,s){if(!i){this.cancel(t),this.port.setFieldValidating(t,!1);return}this.cancel(t),this.port.setFieldValidating(t,!0);let a=new AbortController;this.abortControllers.set(t,a),this.pendingJobs.set(t,{value:e,dueAt:Date.now()+s,validate:i,controller:a}),this.schedulePendingJobs()}cancel(t){this.pendingJobs.has(t)&&(this.pendingJobs.delete(t),this.schedulePendingJobs());let e=this.abortControllers.get(t);e&&(e.abort(),this.abortControllers.delete(t))}cleanupPrefix(t){for(let e of this.pendingJobs.keys())v(e,t)&&(this.cancel(e),this.port.clearAsyncError(e),this.port.setFieldValidating(e,!1))}cancelAll(){this.cancelSchedulerTimeout&&(this.cancelSchedulerTimeout(),this.cancelSchedulerTimeout=void 0),this.pendingJobs.clear(),this.abortControllers.forEach(t=>t.abort()),this.abortControllers.clear()}schedulePendingJobs(){this.cancelSchedulerTimeout&&(this.cancelSchedulerTimeout(),this.cancelSchedulerTimeout=void 0);let t=Number.POSITIVE_INFINITY;for(let e of this.pendingJobs.values())e.dueAt<t&&(t=e.dueAt);Number.isFinite(t)&&(this.cancelSchedulerTimeout=this.port.schedule(()=>{this.cancelSchedulerTimeout=void 0,this.flushPendingJobs()},Math.max(0,t-Date.now())))}async flushPendingJobs(){this.cancelSchedulerTimeout=void 0;let t=Date.now(),e=[];for(let[i,s]of this.pendingJobs.entries())s.dueAt<=t&&e.push([i,s]);if(e.length===0){this.schedulePendingJobs();return}e.forEach(([i])=>{this.pendingJobs.delete(i)}),await Promise.all(e.map(([i,s])=>this.runJob(i,s))),this.schedulePendingJobs()}async runJob(t,e){if(!e.controller.signal.aborted)try{let i=await e.validate(e.value,this.port.getValues());if(e.controller.signal.aborted)return;i?this.port.setAsyncError(t,i):(this.port.clearAsyncError(t),await this.port.onValidationPassed(t))}finally{e.controller.signal.aborted||this.port.setFieldValidating(t,!1),this.abortControllers.delete(t)}}}, _class9);var tt= (_class10 =class{constructor(t){;_class10.prototype.__init38.call(this);this.port=t}__init38() {this.pendingScopeFields=null}trigger(t,e){this.cancelTimeout&&(this.cancelTimeout(),this.cancelTimeout=void 0);let i=_nullishCoalesce(this.port.validationDelay, () => (300)),s=_optionalChain([e, 'optionalAccess', _86 => _86.forceDebounce])?Math.max(1,i):i;if(s>0){if(t&&t.length>0)if(!this.pendingScopeFields)this.pendingScopeFields=new Set(t);else for(let n of t)this.pendingScopeFields.add(n);else this.pendingScopeFields=null;let a=this.pendingScopeFields?Array.from(this.pendingScopeFields):void 0;this.cancelTimeout=this.port.schedule(()=>{this.pendingScopeFields=null,this.cancelTimeout=void 0,this.port.validate({scopeFields:a})},s)}else this.pendingScopeFields=null,this.port.validate({scopeFields:t})}cancelPending(){this.cancelTimeout&&(this.cancelTimeout(),this.cancelTimeout=void 0),this.pendingScopeFields=null}}, _class10);function Yt(r){let{ctx:t,deps:e}=r;if(_optionalChain([t, 'access', _87 => _87.options, 'optionalAccess', _88 => _88.scope])){let i=e.store.getScopeFields(t.options.scope);i.length>0&&(t.targetFields=i)}}async function Xt(r){let{ctx:t,deps:e}=r;await e.store.emitBeforeValidate({values:t.currentState.values,state:t.currentState,scope:_optionalChain([t, 'access', _89 => _89.options, 'optionalAccess', _90 => _90.scope]),scopeFields:t.targetFields})}async function Zt(r){let{ctx:t,deps:e}=r,i=e.store.config.resolver?await e.store.config.resolver(t.currentState.values,{scopeFields:t.targetFields}):{},s=e.store.getRequiredErrors(t.currentState.values);t.allErrors={...i,...s},e.store.getHiddenFields().forEach(a=>{delete t.allErrors[a],e.asyncErrors.delete(a)})}async function Qt(r){let{ctx:t,deps:e}=r,i=Jt({targetFields:t.targetFields,hiddenFields:e.store.getHiddenFields(),getFieldConfig:s=>e.store.getFieldConfig(s),forEachFieldConfig:e.store.forEachFieldConfig});i.length!==0&&await Promise.all(i.map(s=>e.runImmediateAsyncValidation(s,t.currentState.values,t.validationId)))}function te(r){let{ctx:t,deps:e}=r,i=$t({targetFields:t.targetFields,currentErrors:t.currentState.errors,allErrors:t.allErrors,asyncErrors:e.asyncErrors});t.committedErrors=i.committedErrors,t.isValid=!x(i.committedErrors),t.result=i.mode==="scoped"?i.result:t.isValid}async function xt(r){let{ctx:t,deps:e}=r;t.validationId!==e.getCurrentValidationId()&&(t.aborted=!0,t.result=t.currentState.isValid,t.halted=!0)}async function ee(r){let{ctx:t,deps:e}=r;e.store.dispatch(V(t.committedErrors,t.isValid)),await e.store.emitAfterValidate({values:e.store.getState().values,state:e.store.getState(),scope:_optionalChain([t, 'access', _91 => _91.options, 'optionalAccess', _92 => _92.scope]),scopeFields:t.targetFields,errors:t.committedErrors,result:t.result}),t.halted=!0}async function ie(r){let{scopeFields:t,store:e,asyncErrors:i}=r,s=e.getState(),a=e.config.resolver?await e.config.resolver(s.values,{scopeFields:t}):{},n=e.getRequiredErrors(s.values),o={...a,...n};e.getHiddenFields().forEach(p=>{delete o[p],i.delete(p)});let d={...s.errors};t.forEach(p=>{o[p]?d[p]=o[p]:i.has(p)?d[p]=i.get(p):delete d[p]}),e.dispatch(V(d,!x(d)))}var et= (_class11 =class{constructor() { _class11.prototype.__init39.call(this);_class11.prototype.__init40.call(this); }__init39() {this.currentValidationId=0}__init40() {this.immediateAbortControllers=new Map}beginValidation(){return this.currentValidationId+=1,this.currentValidationId}getCurrentValidationId(){return this.currentValidationId}isValidationCurrent(t){return t===this.currentValidationId}setImmediateController(t,e){this.immediateAbortControllers.set(t,e)}clearImmediateController(t){this.immediateAbortControllers.delete(t)}cancelImmediate(t){let e=this.immediateAbortControllers.get(t);e&&(e.abort(),this.immediateAbortControllers.delete(t))}cancelImmediatePrefix(t,e){for(let i of this.immediateAbortControllers.keys())v(i,t)&&(this.cancelImmediate(i),e(i))}cancelAllImmediate(){this.immediateAbortControllers.forEach(t=>{t.abort()}),this.immediateAbortControllers.clear()}}, _class11);var it= (_class12 =class{constructor(t){;_class12.prototype.__init41.call(this);_class12.prototype.__init42.call(this);_class12.prototype.__init43.call(this);this.store=t;this.schedule=_nullishCoalesce(_optionalChain([t, 'access', _93 => _93.config, 'access', _94 => _94.scheduler, 'optionalAccess', _95 => _95.schedule]), () => (((i,s)=>{let a=setTimeout(i,s);return()=>clearTimeout(a)}))),this.debouncer=new tt({schedule:(i,s)=>this.schedule(i,s),validate:i=>this.validate(i),validationDelay:_nullishCoalesce(t.config.validationDelay, () => (300))}),this.asyncScheduler=new Q({schedule:(i,s)=>this.schedule(i,s),getValues:()=>this.store.getState().values,setFieldValidating:(i,s)=>this.updateFieldValidating(i,s),setAsyncError:(i,s)=>{this.asyncErrors.set(i,s),this.store.setError(i,s)},clearAsyncError:i=>{this.asyncErrors.delete(i)},onValidationPassed:async i=>{await ie({scopeFields:[i],store:this.store,asyncErrors:this.asyncErrors})}});let e={store:this.store,asyncErrors:this.asyncErrors,getCurrentValidationId:()=>this.coordinator.getCurrentValidationId(),runImmediateAsyncValidation:(i,s,a)=>this.runImmediateAsyncValidation(i,s,a)};this.validationPipeline=new w([{name:"validate:resolve-target-fields",run:i=>Yt({ctx:i,deps:e})},{name:"validate:before-hooks",run:async i=>Xt({ctx:i,deps:e})},{name:"validate:sync-track",run:async i=>Zt({ctx:i,deps:e})},{name:"validate:abort-check-pre-async",run:async i=>xt({ctx:i,deps:e})},{name:"validate:async-track",run:async i=>Qt({ctx:i,deps:e})},{name:"validate:abort-check",run:async i=>xt({ctx:i,deps:e})},{name:"validate:async-track-merge",run:i=>te({ctx:i,deps:e})},{name:"validate:commit",run:async i=>ee({ctx:i,deps:e})}])}__init41() {this.validatingCount=0}__init42() {this.asyncErrors=new Map}__init43() {this.coordinator=new et}updateFieldValidating(t,e){let i=this.store.getState();if(!!i.isValidating[t]===e)return;let a={...i.isValidating};e?(a[t]=!0,this.validatingCount+=1):(delete a[t],this.validatingCount=Math.max(0,this.validatingCount-1)),this.store.dispatch(g({isValidating:a}))}cancelFieldAsync(t){this.asyncScheduler.cancel(t),this.coordinator.cancelImmediate(t)}cleanupField(t){this.cancelFieldAsync(t),this.asyncErrors.delete(t),this.updateFieldValidating(t,!1)}cleanupPrefix(t){this.asyncScheduler.cleanupPrefix(t),this.coordinator.cancelImmediatePrefix(t,e=>{this.asyncErrors.delete(e),this.updateFieldValidating(e,!1)})}beginExternalValidation(t){this.cancelFieldAsync(t),this.updateFieldValidating(t,!0)}endExternalValidation(t){this.updateFieldValidating(t,!1)}async setExternalError(t,e){if(e){this.asyncErrors.set(t,e),this.store.setError(t,e);return}if(this.asyncErrors.delete(t),this.store.validate){await this.store.validate({scopeFields:[t]});return}let i={...this.store.getState().errors};delete i[t],this.store.dispatch(V(i,!x(i)))}handleAsync(t,e){let i=this.store.getFieldConfig(t),s=_optionalChain([i, 'optionalAccess', _96 => _96.validation, 'optionalAccess', _97 => _97.asyncValidate]),a=_nullishCoalesce(_optionalChain([i, 'optionalAccess', _98 => _98.validation, 'optionalAccess', _99 => _99.asyncValidateOn]), () => ("blur"));if(!s||a!=="change"){this.cancelFieldAsync(t),this.updateFieldValidating(t,!1);return}let n=_nullishCoalesce(_optionalChain([i, 'access', _100 => _100.validation, 'optionalAccess', _101 => _101.asyncValidateDelay]), () => (500));this.asyncScheduler.handle(t,e,s,n)}hasValidationsInProgress(t){let e=this.store.getState();return t&&t.length>0?t.some(i=>!!e.isValidating[i]):this.validatingCount>0}trigger(t,e){this.debouncer.trigger(t,e)}async validate(t){try{_optionalChain([t, 'optionalAccess', _102 => _102.scopeFields, 'optionalAccess', _103 => _103.length])&&t.scopeFields.forEach(i=>this.cancelFieldAsync(i));let e={options:t,validationId:this.coordinator.beginValidation(),currentState:this.store.getState(),targetFields:_optionalChain([t, 'optionalAccess', _104 => _104.scopeFields]),allErrors:{},committedErrors:{},isValid:!0,result:!0,aborted:!1};return await this.validationPipeline.run(e),e.aborted&&await this.store.emitAfterValidate({values:this.store.getState().values,state:this.store.getState(),scope:_optionalChain([e, 'access', _105 => _105.options, 'optionalAccess', _106 => _106.scope]),scopeFields:e.targetFields,errors:this.store.getState().errors,result:e.currentState.isValid,aborted:!0}),e.result}catch(e){return this.store.config.onUnhandledError(e,"validation"),!1}}clear(t){this.cancelFieldAsync(t),this.updateFieldValidating(t,!1),this.asyncErrors.delete(t)}cancelAll(){this.validatingCount=0,this.debouncer.cancelPending(),this.asyncScheduler.cancelAll(),this.asyncErrors.clear(),this.coordinator.cancelAllImmediate(),this.store.dispatch(g({isValidating:{}}))}async runImmediateAsyncValidation(t,e,i){await Gt({path:t,values:e,validationId:i,currentValidationId:this.coordinator.getCurrentValidationId(),getFieldConfig:s=>this.store.getFieldConfig(s),cancelFieldAsync:s=>this.cancelFieldAsync(s),createAbortController:()=>new AbortController,setAbortController:(s,a)=>{this.coordinator.setImmediateController(s,a)},clearAbortController:s=>{this.coordinator.clearImmediateController(s)},setFieldValidating:(s,a)=>this.updateFieldValidating(s,a),setAsyncError:(s,a)=>{this.asyncErrors.set(s,a)},clearAsyncError:s=>{this.asyncErrors.delete(s)}})}}, _class12);function Et(r,t,e){if(!Object.prototype.hasOwnProperty.call(r,t))return[r,e];let s=r,a=e;return a||(s={...r},a=!0),delete s[t],[s,a]}var rt=class{constructor(t){this.store=t;this.fieldUpdatePipeline=new Z([{name:"field:clear-current-error",run:e=>this.clearCurrentError(e)},{name:"field:update-dependencies",run:e=>this.updateDependencies(e)},{name:"field:update-dirty",run:e=>this.updateDirtyState(e)},{name:"field:commit-state",run:e=>this.commitFieldState(e)},{name:"field:emit-change",run:e=>this.emitFieldChange(e)},{name:"field:trigger-validate",run:e=>this.triggerResolverValidation(e)},{name:"field:trigger-async-validate",run:e=>this.triggerAsyncValidation(e)}])}updateField(t,e,i={origin:"setField"}){let s=this.store.getState(),a=_chunk6LNXTSZ6cjs.f.call(void 0, s.values,t),n={path:t,value:e,meta:i,previousValue:a,nextValues:_chunk6LNXTSZ6cjs.g.call(void 0, s.values,t,e),nextErrors:s.errors,hasMutatedErrors:!1,dependencyDiff:{affectedFields:[],visibilityChanged:[],requiredChanged:[]},isDirty:!1};this.fieldUpdatePipeline.run(n)}clearCurrentError(t){[t.nextErrors,t.hasMutatedErrors]=Et(t.nextErrors,t.path,t.hasMutatedErrors),this.store.clearFieldValidation(t.path)}updateDependencies(t){if(typeof this.store.hasDependentFields=="function"&&!this.store.hasDependentFields(t.path)){t.dependencyDiff.affectedFields.length=0,t.dependencyDiff.visibilityChanged.length=0,t.dependencyDiff.requiredChanged.length=0;return}t.dependencyDiff=this.store.updateDependencies(t.path,this.store.getState().values,t.nextValues),new Set([...t.dependencyDiff.visibilityChanged,...t.dependencyDiff.requiredChanged]).forEach(i=>{[t.nextErrors,t.hasMutatedErrors]=Et(t.nextErrors,i,t.hasMutatedErrors),this.store.clearFieldValidation(i)})}updateDirtyState(t){t.isDirty=this.store.updateDirtyForPath(t.path,t.nextValues,this.store.getBaselineValues())}commitFieldState(t){let e=Array.from(new Set([t.path,...t.dependencyDiff.visibilityChanged,...t.dependencyDiff.requiredChanged]));this.store.dispatch(g({values:t.nextValues,errors:t.nextErrors,isDirty:t.isDirty},e))}emitFieldChange(t){this.store.emitFieldChange({path:t.path,previousValue:t.previousValue,nextValue:t.value,values:this.store.getState().values,state:this.store.getState(),meta:t.meta})}triggerResolverValidation(t){let e=Array.from(new Set([t.path,...t.dependencyDiff.visibilityChanged,...t.dependencyDiff.requiredChanged]));(this.store.config.resolver||t.dependencyDiff.visibilityChanged.length>0||t.dependencyDiff.requiredChanged.length>0)&&this.store.triggerValidation(e)}triggerAsyncValidation(t){(typeof this.store.getFieldConfig=="function"?_optionalChain([this, 'access', _107 => _107.store, 'access', _108 => _108.getFieldConfig, 'call', _109 => _109(t.path), 'optionalAccess', _110 => _110.validation, 'optionalAccess', _111 => _111.asyncValidateOn]):void 0)==="change"&&this.store.handleFieldAsyncValidation(t.path,t.value)}};var st=class{constructor(t){this.store=t}collectChangedUpdates(t,e="",i=[]){return Object.entries(t).forEach(([s,a])=>{let n=e?`${e}.${s}`:s;if(a&&typeof a=="object"&&!Array.isArray(a)&&Object.keys(a).length>0){this.collectChangedUpdates(a,n,i);return}i.push([n,a])}),i}setValues(t,e){if(_optionalChain([e, 'optionalAccess', _112 => _112.rebase])){this.rebaseValues(t);return}if(_optionalChain([e, 'optionalAccess', _113 => _113.partial])){this.hydrateValues(t);return}this.replaceValuesInternal(t,"replaceValues")}hydrateValues(t){let e=this.collectChangedUpdates(t),i=e.map(([a])=>a),s=e.length>0?_chunk6LNXTSZ6cjs.h.call(void 0, this.store.getState().values,e):this.store.getState().values;this.replaceValuesInternal(s,"hydrate",i.length>0?i:["*"])}rebaseValues(t){let e=this.store.getState().values,i=_chunk6LNXTSZ6cjs.a.call(void 0, t);this.store.setBaselineValues(t),this.store.cancelAllValidations(),this.store.evaluateAllDependencies(i),this.store.clearDirtyState(),this.store.dispatch(g({values:i,errors:{},touched:{},isValidating:{},isValid:!0,isDirty:!1,isSubmitting:!1},["*"])),this.store.resetHistory(i),this.store.validateNow(),this.store.emitFieldChange({path:"*",previousValue:e,nextValue:i,values:this.store.getState().values,state:this.store.getState(),meta:{origin:"rebase"}})}applyHistoryState(t){let e=this.store.rebuildDirtyState(t,this.store.getBaselineValues());this.store.dispatch(g({values:t,isDirty:e},["*"])),this.store.triggerValidation(void 0,{forceDebounce:!0})}reset(){this.store.cancelAllValidations();let t=_chunk6LNXTSZ6cjs.a.call(void 0, this.store.getBaselineValues());this.store.evaluateAllDependencies(t),this.store.clearDirtyState(),this.store.dispatch(g({values:t,errors:{},touched:{},isValidating:{},isValid:!0,isDirty:!1,isSubmitting:!1},["*"])),this.store.resetHistory(t)}replaceValuesInternal(t,e="replaceValues",i=["*"]){let s=this.store.getState().values,a=_chunk6LNXTSZ6cjs.a.call(void 0, t);this.store.cancelAllValidations(),this.store.evaluateAllDependencies(a);let n=this.store.rebuildDirtyState(a,this.store.getBaselineValues());this.store.dispatch(g({values:a,errors:{},isValidating:{},isValid:!0,isDirty:n,isSubmitting:!1},i)),this.store.internalSaveSnapshot(),this.store.validateNow(),this.store.emitFieldChange({path:"*",previousValue:s,nextValue:a,values:this.store.getState().values,state:this.store.getState(),meta:{origin:e}})}};var at=class{constructor(t){this.store=t;this.submitPipeline=new w([{name:"submit:start",run:async e=>this.startSubmit(e)},{name:"submit:invalid",run:async e=>this.handleInvalidSubmit(e)},{name:"submit:prepare",run:e=>this.prepareSubmitValues(e)},{name:"submit:before-hooks",run:async e=>this.runBeforeSubmitHooks(e)},{name:"submit:user-handler",run:async e=>this.runSubmitHandler(e)},{name:"submit:after-hooks",run:async e=>this.runAfterSubmitHooks(e)}])}async submit(t){if(this.store.getState().isSubmitting)return{status:"blocked",reason:"isSubmitting"};if(this.store.hasValidationsInProgress())return{status:"blocked",reason:"validating"};this.store.cancelAllValidations();let i={onSuccess:t,isValid:!1,valuesToSubmit:_chunk6LNXTSZ6cjs.a.call(void 0, this.store.getState().values),dirtyValues:{}};try{return await this.submitPipeline.run(i),i.invalid?{status:"invalid"}:{status:"submitted"}}catch(s){return i.error=s,await this.store.emitOperationalError({source:"submit",error:s}),await this.store.emitAfterSubmit({values:this.store.getState().values,dirtyValues:this.store.buildDirtyValues(this.store.getState().values),state:this.store.getState(),success:!1,error:s}),this.store.config.onUnhandledError(s,"submit"),{status:"failed",error:s}}finally{this.store.dispatch(g({isSubmitting:!1}))}}async startSubmit(t){this.store.dispatch(g({isSubmitting:!0})),t.isValid=await this.store.validateNow()}async handleInvalidSubmit(t){if(t.isValid)return;let e=this.store.getState().errors,i={...this.store.getState().touched};Object.keys(e).forEach(s=>{i[s]=!0}),this.store.batchStateUpdates(()=>{this.store.dispatch(g({touched:i}))}),t.dirtyValues=this.store.buildDirtyValues(this.store.getState().values),t.invalid=!0,await this.store.emitAfterSubmit({values:this.store.getState().values,dirtyValues:t.dirtyValues,state:this.store.getState(),success:!1,invalid:!0}),t.halted=!0}prepareSubmitValues(t){let e=[];this.store.getHiddenFields().forEach(i=>{e.push([i,void 0])}),t.valuesToSubmit=Ht({values:t.valuesToSubmit,sourceValues:this.store.getState().values,transformEntries:this.store.getTransformEntries()}),e.length>0&&(t.valuesToSubmit=_chunk6LNXTSZ6cjs.h.call(void 0, t.valuesToSubmit,e)),t.dirtyValues=this.store.buildDirtyValues(t.valuesToSubmit)}async runBeforeSubmitHooks(t){await this.store.emitBeforeSubmit({values:t.valuesToSubmit,dirtyValues:t.dirtyValues,state:this.store.getState()})}async runSubmitHandler(t){await t.onSuccess(t.valuesToSubmit,t.dirtyValues)}async runAfterSubmitHooks(t){await this.store.emitAfterSubmit({values:t.valuesToSubmit,dirtyValues:t.dirtyValues,state:this.store.getState(),success:!0})}};var nt=class{constructor(t){this.ports=t;this.fieldUpdate=new rt(t.fieldUpdate),this.values=new st(t.values),this.submitFlow=new at(t.submit)}updateField(t,e,i={origin:"setField"}){this.fieldUpdate.updateField(t,e,i)}setValues(t,e){this.values.setValues(t,e)}hydrateValues(t){this.values.hydrateValues(t)}rebaseValues(t){this.values.rebaseValues(t)}applyHistoryState(t){this.values.applyHistoryState(t)}async submit(t){return this.submitFlow.submit(t)}reset(){this.values.reset()}};function re(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp)}function se(r,t){let e=[],i=(s,a,n,o,d)=>{if(!(o&&d&&_chunk6LNXTSZ6cjs.d.call(void 0, s,a))){if(re(s)&&re(a)&&o&&d){let p=new Set([...Object.keys(s),...Object.keys(a)]);for(let l of p){let c=n?`${n}.${l}`:l,u=Object.prototype.hasOwnProperty.call(s,l),h=Object.prototype.hasOwnProperty.call(a,l);i(s[l],a[l],c,u,h)}return}e.push({path:n,previousValue:_chunk6LNXTSZ6cjs.a.call(void 0, s),nextValue:_chunk6LNXTSZ6cjs.a.call(void 0, a),hadPreviousValue:o,hasNextValue:d})}};return i(r,t,"",!0,!0),{operations:e}}function ot(r,t,e){let i=r,s=[],a=[];for(let n of t.operations){let o=e==="undo"?n.hadPreviousValue:n.hasNextValue,d=e==="undo"?n.previousValue:n.nextValue;if(!n.path){i=o?d:{},s.length=0,a.length=0;continue}if(o){s.push([n.path,d]);continue}a.push(n.path)}return s.length>0&&(i=_chunk6LNXTSZ6cjs.h.call(void 0, i,s)),a.length>0&&(i=_chunk6LNXTSZ6cjs.i.call(void 0, i,a)),i}var lt= (_class13 =class{constructor(t,e){;_class13.prototype.__init44.call(this);_class13.prototype.__init45.call(this);_class13.prototype.__init46.call(this);_class13.prototype.__init47.call(this);_class13.prototype.__init48.call(this);this.enableHistory=t;this.maxHistory=e}__init44() {this.baseSnapshot=null}__init45() {this.currentSnapshot=null}__init46() {this.patches=[]}__init47() {this.historyIndex=-1}__init48() {this.historySize=0}saveSnapshot(t){if(!this.enableHistory)return;if(!this.currentSnapshot||this.baseSnapshot===null){this.reset(t);return}this.historyIndex<this.historySize-1&&(this.patches.splice(this.historyIndex),this.historySize=this.historyIndex+1);let e=se(this.currentSnapshot,t);if(e.operations.length!==0)for(this.patches.push(e),this.currentSnapshot=t,this.historyIndex+=1,this.historySize=this.historyIndex+1;this.historySize>this.getCapacity();)this.compactOldestSnapshot()}get canUndo(){return this.enableHistory?this.historyIndex>0:!1}get canRedo(){return this.enableHistory?this.historyIndex<this.historySize-1:!1}undo(){if(!this.canUndo||!this.currentSnapshot)return null;let t=this.patches[this.historyIndex-1],e=ot(this.currentSnapshot,t,"undo");return this.currentSnapshot=e,this.historyIndex-=1,e}redo(){if(!this.canRedo||!this.currentSnapshot)return null;let t=this.patches[this.historyIndex],e=ot(this.currentSnapshot,t,"redo");return this.currentSnapshot=e,this.historyIndex+=1,e}reset(t){if(!this.enableHistory){this.baseSnapshot=null,this.currentSnapshot=null,this.patches=[],this.historyIndex=-1,this.historySize=0;return}this.baseSnapshot=_chunk6LNXTSZ6cjs.a.call(void 0, t),this.currentSnapshot=this.baseSnapshot,this.patches=[],this.historyIndex=0,this.historySize=1}getMetadata(){return{enabled:this.enableHistory,canUndo:this.canUndo,canRedo:this.canRedo,historyIndex:this.historyIndex,historySize:this.historySize}}compactOldestSnapshot(){let t=this.patches.shift();!t||this.baseSnapshot===null||(this.baseSnapshot=ot(this.baseSnapshot,t,"redo"),this.historySize=Math.max(1,this.historySize-1),this.historyIndex=Math.max(0,this.historyIndex-1))}getCapacity(){return Math.max(1,this.maxHistory)}}, _class13);var dt=class{constructor(t){this.store=t}pushItem(t,e){this.mutateArrayWithSetField(t,i=>[...i,e],{origin:"array",operation:"push"})}prependItem(t,e){this.mutateArrayWithSetField(t,i=>[e,...i],{origin:"array",operation:"prepend"})}insertItem(t,e,i){this.mutateArrayWithSetField(t,s=>{let a=[...s];return a.splice(e,0,i),a},{origin:"array",operation:"insert",index:e})}removeItem(t,e){let i=this.store.getState(),s=_chunk6LNXTSZ6cjs.f.call(void 0, i.values,t);if(!Array.isArray(s))return;let a=[...s];this.store.unregisterPrefix&&this.store.unregisterPrefix(bt(t,e));let n=s.filter((o,d)=>d!==e);this.commitArrayMutationWithFieldPipeline({path:t,nextArray:n,meta:{origin:"array",operation:"remove",index:e},reindex:o=>o===e?null:o>e?o-1:o})}swapItems(t,e,i){let s=this.store.getState(),a=[..._chunk6LNXTSZ6cjs.f.call(void 0, s.values,t)||[]];[a[e],a[i]]=[a[i],a[e]],this.commitArrayMutationWithFieldPipeline({path:t,nextArray:a,meta:{origin:"array",operation:"swap",from:e,to:i},reindex:n=>n===e?i:n===i?e:n})}moveItem(t,e,i){let s=this.store.getState(),a=[..._chunk6LNXTSZ6cjs.f.call(void 0, s.values,t)||[]],[n]=a.splice(e,1);a.splice(i,0,n),this.commitArrayMutationWithFieldPipeline({path:t,nextArray:a,meta:{origin:"array",operation:"move",from:e,to:i},reindex:o=>o===e?i:e<i&&o>e&&o<=i?o-1:e>i&&o>=i&&o<e?o+1:o})}replaceItems(t,e){this.commitArrayMutationWithFieldPipeline({path:t,nextArray:e,meta:{origin:"array",operation:"replace"},reindex:i=>i<e.length?i:null})}clearItems(t){this.store.unregisterPrefix&&this.store.unregisterPrefix(bt(t)),this.commitArrayMutationWithFieldPipeline({path:t,nextArray:[],meta:{origin:"array",operation:"clear"},reindex:()=>null})}mutateArrayWithSetField(t,e,i){let s=_chunk6LNXTSZ6cjs.f.call(void 0, this.store.getState().values,t)||[];this.store.setFieldWithMeta(t,e(s),i),this.store.internalSaveSnapshot()}commitArrayMutationWithFieldPipeline(t){let{path:e,nextArray:i,meta:s,reindex:a}=t,n=this.store.getState();this.store.setFieldWithMeta(e,i,s);let o=_chunk6LNXTSZ6cjs.k.call(void 0, n,e,a);this.store.dispatch(g({errors:o.errors,touched:o.touched,isValidating:o.isValidating},[e])),this.store.internalSaveSnapshot()}};var ct=class{constructor(t,e,i,s){this.getState=t;this.getInitialValues=e;this.getScopeFields=i;this.isPathDirty=s}getScopeStatus(t){let e=this.getScopeFields(t),i=this.getState(),s=e.some(o=>!!i.errors[o]),a=e.some(o=>this.isPathDirty(o)),n=this.getScopeErrors(t);return{hasErrors:s,isDirty:a,errors:n}}getScopeErrors(t){let e=this.getScopeFields(t),i=this.getState(),s={};for(let a of e){let n=i.errors[a];n&&(s[a]=n)}return s}};var pt= (_class14 =class{constructor(t,e,i){;_class14.prototype.__init49.call(this);this.fieldMetadataProvider=t;this.getState=e;this.isPathDirty=i}__init49() {this.requiredValuesRef=null}isHidden(t){return this.fieldMetadataProvider.isHidden(t)}isRequired(t){let e=this.getState().values;return this.requiredValuesRef!==e&&(this.requiredValuesRef=e),this.fieldMetadataProvider.isRequired(t,e)}isFieldDirty(t){return this.isPathDirty(t)}isFieldValidating(t){return!!this.getState().isValidating[t]}isTouched(t){return!!this.getState().touched[t]}}, _class14);var ut=class{constructor(t,e){this.getState=t;this.dispatch=e}setError(t,e){let i={...this.getState().errors,[t]:e};e||delete i[t],this.dispatch(g({errors:i}))}setErrors(t){this.dispatch(g({errors:{...this.getState().errors,...t}}))}setServerErrors(t){let e={};for(let[i,s]of Object.entries(t))e[i]=Array.isArray(s)?s[0]:s;this.setErrors(e)}};function ae(r){let t=[],e=new Map;for(let n of r)if(e.has(n.path)||e.set(n.path,new Set),n.dependsOn)for(let o of n.dependsOn)r.find(p=>p.path===o)&&e.get(n.path).add(o);let i=new Set,s=new Set,a=(n,o)=>{i.add(n),s.add(n),o.push(n);let d=e.get(n)||new Set;for(let p of d)if(i.has(p)){if(s.has(p)){let l=o.indexOf(p),c=[...o.slice(l),p];return{cycle:c,paths:Array.from(e.keys()).filter(u=>c.includes(u)),message:`Circular dependency detected: ${c.join(" \u2192 ")}. Check your computed field definitions.`}}}else{let l=a(p,[...o]);if(l)return l}return s.delete(n),null};for(let n of e.keys())if(!i.has(n)){let o=a(n,[]);o&&!t.some(d=>d.message===o.message)&&t.push(o)}return t}var Ft= (_class15 =class{constructor() { _class15.prototype.__init50.call(this); }__init50() {this.entries=new Map}register(t,e){this.entries.set(t,e)}resolve(t){let e=this.entries.get(t);if(!e)throw new Error(`BitStore capability "${String(t)}" n\xE3o foi registrada.`);return e}toCapabilities(){return{validation:this.resolve("validation"),lifecycle:this.resolve("lifecycle"),history:this.resolve("history"),arrays:this.resolve("arrays"),scope:this.resolve("scope"),query:this.resolve("query"),error:this.resolve("error")}}}, _class15);function ne(){return new Ft}function si(r){let{registry:t,ports:e,fieldRegistry:i}=r;t.register("validation",new it(e.validationPort)),t.register("lifecycle",new nt(e.lifecyclePorts)),t.register("history",new lt(!!e.config.history.enabled,_nullishCoalesce(e.config.history.limit, () => (50)))),t.register("arrays",new dt(e.arrayPort)),t.register("scope",new ct(()=>e.getState(),()=>e.getBaselineValues(),s=>e.getScopeFields(s),s=>e.isPathDirty(s))),t.register("query",new pt(i,()=>e.getState(),s=>e.isPathDirty(s))),t.register("error",new ut(()=>e.getState(),s=>e.dispatch(s)))}function oe(r){let{ports:t,fieldRegistry:e}=r,i=ne();return si({registry:i,ports:t,fieldRegistry:e}),{registry:i,capabilities:i.toCapabilities()}}function le(r){let{config:t,fieldRegistry:e,computedManager:i}=r,s=_chunk6LNXTSZ6cjs.a.call(void 0, t.initialValues);t.fields&&Object.entries(t.fields).forEach(([o,d])=>{e.register(o,d,s)});let a=ae(e.getComputedEntries());if(a.length>0)throw new Error(a[0].message);return{values:N({values:s,normalizerEntries:e.getNormalizerEntries(),applyComputed:(o,d)=>i.apply(o,d)}),errors:{},touched:{},isValidating:{},persist:{isSaving:!1,isRestoring:!1,error:null},isValid:!0,isSubmitting:!1,isDirty:!1}}function de(r){return{getState:r.getState,dispatch:r.dispatch,setError:r.setError,validate:r.validate,getFieldConfig:r.getFieldConfig,forEachFieldConfig:t=>r.fieldRegistry.forEachFieldConfig((e,i)=>t(e,i)),getScopeFields:r.getScopeFields,config:r.config,getRequiredErrors:t=>r.fieldRegistry.getRequiredErrors(t),getHiddenFields:()=>r.fieldRegistry.getHiddenFields(),emitBeforeValidate:t=>r.getEffects().beforeValidate(t),emitAfterValidate:t=>r.getEffects().afterValidate(t)}}function ce(r){let t={getState:r.getState,dispatch:r.dispatch,config:r.config,getFieldConfig:s=>r.fieldRegistry.getFieldConfig(s),updateDependencies:(s,a,n)=>r.fieldRegistry.updateDependencies(s,a,n),hasDependentFields:s=>r.fieldRegistry.hasDependents(s),isFieldHidden:s=>r.fieldRegistry.isHidden(s),clearFieldValidation:s=>r.getValidation().clear(s),triggerValidation:(s,a)=>r.getValidation().trigger(s,a),handleFieldAsyncValidation:(s,a)=>r.getValidation().handleAsync(s,a),updateDirtyForPath:(s,a,n)=>r.dirtyManager.updateForPath(s,a,n),getBaselineValues:r.getBaselineValues,emitFieldChange:s=>r.getEffects().onFieldChange(s)},e={getState:r.getState,dispatch:r.dispatch,internalSaveSnapshot:r.saveHistorySnapshot,evaluateAllDependencies:s=>r.fieldRegistry.evaluateAll(s),cancelAllValidations:()=>r.getValidation().cancelAll(),validateNow:s=>r.getValidation().validate(s),rebuildDirtyState:(s,a)=>r.dirtyManager.rebuild(s,a),clearDirtyState:r.dirtyManager.clear.bind(r.dirtyManager),getBaselineValues:r.getBaselineValues,setBaselineValues:r.setBaselineValues,resetHistory:s=>r.getHistory().reset(s),emitFieldChange:s=>r.getEffects().onFieldChange(s),triggerValidation:(s,a)=>r.getValidation().trigger(s,a)},i={getState:r.getState,dispatch:r.dispatch,batchStateUpdates:r.runStateBatch,config:r.config,getTransformEntries:r.getTransformEntries,getHiddenFields:()=>r.fieldRegistry.getHiddenFields(),cancelAllValidations:()=>r.getValidation().cancelAll(),validateNow:s=>r.getValidation().validate(s),hasValidationsInProgress:s=>r.getValidation().hasValidationsInProgress(s),buildDirtyValues:s=>r.dirtyManager.buildDirtyValues(s),emitBeforeSubmit:s=>r.getEffects().beforeSubmit(s),emitAfterSubmit:s=>r.getEffects().afterSubmit(s),emitOperationalError:s=>r.getEffects().reportOperationalError(s)};return{fieldUpdate:t,values:e,submit:i}}function pe(r){return{getState:r.getState,setFieldWithMeta:r.setFieldWithMeta,dispatch:r.dispatch,internalSaveSnapshot:r.saveHistorySnapshot,unregisterPrefix:r.unregisterPrefix}}function ue(r){let{config:t,fieldRegistry:e,dirtyManager:i,baselineManager:s,runtimeContext:a}=r,{stateAccess:n,fieldAccess:o,featureAccess:d,actions:p}=a,l=de({config:t,fieldRegistry:e,getState:n.getState,dispatch:n.dispatch,setError:p.setError,validate:p.validate,getFieldConfig:o.getFieldConfig,getScopeFields:o.getScopeFields,getEffects:d.getEffects}),c=ce({config:t,fieldRegistry:e,dirtyManager:i,getState:n.getState,dispatch:n.dispatch,saveHistorySnapshot:n.saveHistorySnapshot,runStateBatch:n.runStateBatch,getTransformEntries:o.getTransformEntries,getBaselineValues:()=>s.getValues(),setBaselineValues:h=>s.setValues(h),getValidation:d.getValidation,getHistory:d.getHistory,getEffects:d.getEffects}),u=pe({getState:n.getState,dispatch:n.dispatch,setFieldWithMeta:(h,S,B)=>p.setFieldWithMeta(h,S,B),unregisterPrefix:p.unregisterPrefix,saveHistorySnapshot:n.saveHistorySnapshot});return oe({ports:{validationPort:l,lifecyclePorts:c,arrayPort:u,config:t,getScopeFields:o.getScopeFields,getState:n.getState,dispatch:n.dispatch,getBaselineValues:()=>s.getValues(),isPathDirty:h=>i.isPathDirty(h)},fieldRegistry:e})}function he(r){let{config:t,fieldRegistry:e,dirtyManager:i,computedManager:s,rawConfig:a,baselineManager:n,runtimeContext:o}=r,{stateAccess:d,fieldAccess:p,featureAccess:l,actions:c}=o,u=ue({config:t,fieldRegistry:e,dirtyManager:i,baselineManager:n,runtimeContext:{stateAccess:d,fieldAccess:p,featureAccess:l,actions:c}}),h=le({config:t,fieldRegistry:e,computedManager:s}),S=new X(d.getState,t.subscriptionCacheSize),B=a.storeId||t.name||t.idFactory({scope:"store",storeName:t.name});return{state:h,subscriptions:S,capabilityRegistry:u.registry,storeId:B}}function ge(){return{depth:0,pendingState:null,changedPathSet:null,changedPathList:null,valuesChanged:!1,pendingHistorySnapshot:!1}}function fe(r){r.depth+=1}function me(r){return r.depth-=1,r.depth===0}function ht(r,t){return _nullishCoalesce(t.pendingState, () => (r))}function ye(r,t){if(r.pendingState=t.nextState,r.valuesChanged||=t.valuesChanged,t.valuesChanged&&(r.pendingHistorySnapshot=!0),t.changedPaths&&t.changedPaths.length>0){let e=_nullishCoalesce(r.changedPathSet, () => (new Set)),i=_nullishCoalesce(r.changedPathList, () => ([]));t.changedPaths.forEach(s=>{if(e.has("*")||e.has(s))return;if(s==="*"){e.clear(),i.length=0,e.add("*"),i.push("*");return}if(!i.some(n=>n!=="*"&&s.startsWith(`${n}.`))){for(let n=i.length-1;n>=0;n-=1){let o=i[n];o==="*"||!o.startsWith(`${s}.`)||(e.delete(o),i.splice(n,1))}e.add(s),i.push(s)}}),r.changedPathSet=e,r.changedPathList=i}}function Se(r){let{currentState:t,batchState:e,applyValueDerivations:i}=r;if(!e.pendingState)return e.pendingHistorySnapshot=!1,null;let s=e.pendingState,a=_nullishCoalesce(e.changedPathList, () => (void 0)),n=e.valuesChanged;return n&&(s={...s,values:i(s.values,a)}),e.pendingState=null,e.changedPathSet=null,e.changedPathList=null,e.valuesChanged=!1,{nextState:_nullishCoalesce(s, () => (t)),changedPaths:a,valuesChanged:n}}function ai(r){let t=!1;for(let i of Object.values(r))if(i===void 0){t=!0;break}if(!t)return r;let e={};return Object.entries(r).forEach(([i,s])=>{let a=s;a!==void 0&&(e[i]=a)}),e}function be(r){let{currentState:t,partialState:e,changedPaths:i,applyValueDerivations:s,applyComputedValues:a}=r,n=_nullishCoalesce(s, () => ((u=>a?a(u):u))),o={...t,...e},d=!!e.values;e.values&&(o.values=n(e.values,i)),e.errors&&(o.errors=ai(e.errors),o.isValid=!x(o.errors));let p=i&&i.length>0?i:void 0,l=ni(e),c=_(p,l);return{nextState:o,changedPaths:c,valuesChanged:d}}function ni(r){let t=new Set,e=[r.errors,r.touched,r.isValidating];for(let i of e)if(i)for(let s in i)t.add(s);return r.persist&&t.add("persist"),"isValid"in r&&t.add("isValid"),"isDirty"in r&&t.add("isDirty"),"isSubmitting"in r&&t.add("isSubmitting"),t.size>0?Array.from(t):void 0}function oi(r){throw new Error(`BitStore: unsupported operation kind: ${String(r.kind)}`)}function li(r,t){switch(t.kind){case"state.patch":return t;case"field.touchMany":{if(t.paths.length===0)return null;let e={...r.touched};for(let i of t.paths)e[i]=!0;return g({touched:e},t.paths)}case"form.persistMeta":return g({persist:{...r.persist,...t.patch}});case"history.apply":return g({values:t.values,isDirty:t.isDirty},["*"]);case"validation.commit":return g({errors:t.errors,isValid:t.isValid});default:return oi(t)}}function di(r){let{currentState:t,operation:e,applyValueDerivations:i}=r,s=Object.prototype.hasOwnProperty.call(e.partialState,"values"),a=_nullishCoalesce(e.changedPaths, () => ((s?["*"]:void 0)));return be({currentState:t,partialState:e.partialState,changedPaths:a,applyValueDerivations:i})}function Be(r){let{currentState:t,operation:e,applyValueDerivations:i}=r,s=li(t,e);return s?di({currentState:t,operation:s,applyValueDerivations:(a,n)=>s.skipComputed?a:i(a,n)}):null}function Te(r){let{state:t,batchState:e,operation:i,applyValueDerivations:s,onStateCommitted:a}=r,n=ht(t,e);if(e.depth>0){let d=Be({currentState:n,operation:i,applyValueDerivations:p=>p});return d&&ye(e,d),t}let o=Be({currentState:t,operation:i,applyValueDerivations:s});return o?(a({nextState:o.nextState,changedPaths:o.changedPaths,valuesChanged:o.valuesChanged}),o.nextState):t}function ve(r){let{state:t,batchState:e,applyValueDerivations:i,onStateCommitted:s}=r,a=Se({currentState:t,batchState:e,applyValueDerivations:i});return a?(s({nextState:a.nextState,changedPaths:a.changedPaths,valuesChanged:a.valuesChanged}),a.nextState):t}function Pe(r){let{batchState:t,callback:e,flushBatchedStateUpdates:i}=r;fe(t);try{return e()}finally{me(t)&&i()}}function xe(r){let{payload:t,setState:e,notifySubscriptions:i,notifyEffects:s}=r;e(t.nextState),i(t.nextState,t.changedPaths),s(t.nextState,t.valuesChanged)}function Ee(r){let{state:t,batchState:e,operation:i,applyValueDerivations:s,onStateCommitted:a}=r;return Te({state:t,batchState:e,operation:i,applyValueDerivations:s,onStateCommitted:a})}function Fe(r){let{batchState:t,values:e,saveHistory:i}=r;if(t.depth>0){t.pendingHistorySnapshot=!0;return}i(e)}function Ce(r){let{state:t,batchState:e,applyValueDerivations:i,onStateCommitted:s,saveHistory:a}=r,n=ve({state:t,batchState:e,applyValueDerivations:i,onStateCommitted:s});return e.pendingHistorySnapshot&&(e.pendingHistorySnapshot=!1,a(n.values)),n}var gt= (_class16 =class{constructor(t){;_class16.prototype.__init51.call(this);this.args=t;this.state=t.state,this.subscriptions=t.subscriptions,this.effects=t.effects,this.capabilityRegistry=t.capabilityRegistry,this.capabilities=t.capabilityRegistry.toCapabilities()}__init51() {this.batchState=ge()}getCapability(t){return this.capabilityRegistry.resolve(t)}getState(){return ht(this.state,this.batchState)}runBatch(t){return Pe({batchState:this.batchState,callback:t,flushBatchedStateUpdates:()=>this.flushBatchedStateUpdates()})}dispatch(t){this.state=Ee({state:this.state,batchState:this.batchState,operation:t,applyValueDerivations:(e,i)=>this.applyValueDerivations(e,i),onStateCommitted:e=>this.onStateCommitted(e)})}saveHistorySnapshot(){let t=this.capabilities.history.getMetadata();Fe({batchState:this.batchState,values:this.state.values,saveHistory:i=>this.capabilities.history.saveSnapshot(i)});let e=this.capabilities.history.getMetadata();this.notifyIfHistoryChanged(t,e)}cleanup(){this.subscriptions.destroy(),this.capabilities.validation.cancelAll(),this.effects.destroy()}onStateCommitted(t){xe({payload:t,setState:e=>{this.state=e},notifySubscriptions:(e,i)=>this.subscriptions.notify(e,i),notifyEffects:(e,i)=>this.effects.onStateUpdated(e,i)})}flushBatchedStateUpdates(){let t=this.capabilities.history.getMetadata();this.state=Ce({state:this.state,batchState:this.batchState,applyValueDerivations:(i,s)=>this.applyValueDerivations(i,s),onStateCommitted:i=>this.onStateCommitted(i),saveHistory:i=>this.capabilities.history.saveSnapshot(i)});let e=this.capabilities.history.getMetadata();this.notifyIfHistoryChanged(t,e)}applyValueDerivations(t,e){return this.args.applyValueDerivations?this.args.applyValueDerivations(t,e):t}notifyIfHistoryChanged(t,e){t.canUndo===e.canUndo&&t.canRedo===e.canRedo&&t.historyIndex===e.historyIndex&&t.historySize===e.historySize||this.subscriptions.notify(this.getState(),[_chunkRHMJPKNVcjs.h.call(void 0, )])}}, _class16);function Ve(r){let{rawConfig:t,overrides:e}=r,i=Ot(t),s=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _114 => _114.baselineManager]), () => (new I(i.initialValues))),a=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _115 => _115.fieldRegistry]), () => (new U)),n=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _116 => _116.computedManager]), () => (new O(()=>a.getComputedEntries()))),o=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _117 => _117.dirtyManager]), () => (new j)),d=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _118 => _118.maskManager]), () => (new H));i.masks&&Object.entries(i.masks).forEach(([f,b])=>{d.registerMask(f,b)});let p=()=>{a.invalidateIndexes(),n.invalidateReverseDeps()},l,c=()=>{if(!l)throw new Error("BitStore runtime kernel is not initialized yet.");return l},u=he({rawConfig:t,config:i,fieldRegistry:a,computedManager:n,dirtyManager:o,baselineManager:s,runtimeContext:{stateAccess:{getState:()=>c().getState(),dispatch:f=>c().dispatch(f),saveHistorySnapshot:()=>c().saveHistorySnapshot(),runStateBatch:f=>c().runBatch(f)},fieldAccess:{getFieldConfig:f=>a.getFieldConfig(f),getScopeFields:f=>a.getScopeFields(f),getNormalizerEntries:()=>a.getNormalizerEntries(),getTransformEntries:()=>a.getTransformEntries()},featureAccess:{getEffects:()=>c().effects,getHistory:()=>c().getCapability("history"),getValidation:()=>c().getCapability("validation")},actions:{setError:(f,b)=>{c().getCapability("error").setError(f,b)},validate:f=>c().getCapability("validation").validate(f),setFieldWithMeta:(f,b,yt={origin:"setField"})=>{c().runBatch(()=>{c().getCapability("lifecycle").updateField(f,b,yt)})},unregisterPrefix:f=>{Y({prefix:f,state:c().getState(),fieldRegistry:a,subscriptions:c().subscriptions,validationCleanupPrefix:b=>c().getCapability("validation").cleanupPrefix(b),invalidateFieldIndexes:p})},triggerValidation:(f,b)=>{c().getCapability("validation").trigger(f,b)}}}}),h=()=>{let f=c().getState();return o.buildDirtyValues(f.values)},S=f=>{Nt({values:f,state:c().getState(),initialValues:s.getValues(),validation:c().getCapability("validation"),fieldRegistry:a,dirtyManager:o,dispatch:b=>c().dispatch(b),saveHistorySnapshot:()=>c().saveHistorySnapshot()})},B=zt({storeId:u.storeId,config:i,getState:()=>c().getState(),getConfig:()=>i,getValues:()=>c().getState().values,getDirtyValues:h,applyPersistedValues:S});return l=new gt({state:u.state,subscriptions:u.subscriptions,effects:B,capabilityRegistry:u.capabilityRegistry,applyValueDerivations:(f,b)=>N({values:f,changedPaths:b,normalizerEntries:a.getNormalizerEntries(),applyComputed:(yt,Je)=>n.apply(yt,Je)})}),l.saveHistorySnapshot(),{config:i,storeId:u.storeId,runtime:l,fieldRegistry:a,computedManager:n,dirtyManager:o,maskManager:d,baselineManager:s}}function we(r){let{dispatch:t,effects:e}=r;return qt({dispatch:t,effects:e})}function De(r){let{dispatch:t,effects:e}=r;return Ut({dispatch:t,effects:e})}function Ae(r){let{dispatch:t,effects:e}=r;return _t({dispatch:t,effects:e})}function Me(r){let{history:t,applyHistoryState:e}=r,i=t.undo();i&&e(i)}function Re(r){let{history:t,applyHistoryState:e}=r,i=t.redo();i&&e(i)}function ke(r){return r.history.getMetadata()}function Ie(r,t){let e=new Set,i=(n,o)=>n===null||typeof n!="object"?n:new Proxy(n,{get:(d,p,l)=>{if(typeof p=="symbol")return Reflect.get(d,p,l);let c=String(p),u=o?`${o}.${c}`:c;e.add(u);let h=Reflect.get(d,p,l);return i(h,u)}}),s=i(r,"");t(s);let a=new Set;return e.forEach(n=>{let o=ci(n);o&&a.add(o)}),Array.from(a)}function ci(r){if(r)return r==="values"?"*":r.startsWith("values.")?r.slice(7):r==="errors"||r==="touched"||r==="isValidating"?"*":r.startsWith("errors.")?r.slice(7):r.startsWith("touched.")?r.slice(8):r.startsWith("isValidating.")?r.slice(13):r==="persist"||r.startsWith("persist.")?"persist":r}function pi(r,t){if(r.length!==t.length)return!1;let e=new Set(t);for(let i of r)if(!e.has(i))return!1;return!0}function ui(r,t){return r.length===0?{emitImmediately:_optionalChain([t, 'optionalAccess', _119 => _119.emitImmediately]),equalityFn:_optionalChain([t, 'optionalAccess', _120 => _120.equalityFn]),mode:"scoped",paths:["*"]}:{emitImmediately:_optionalChain([t, 'optionalAccess', _121 => _121.emitImmediately]),equalityFn:_optionalChain([t, 'optionalAccess', _122 => _122.equalityFn]),mode:"scoped",paths:r}}function Oe(r){let{getState:t,subscribeSelector:e,selector:i,listener:s,options:a}=r,n=null,o=Ie(t(),i),d=!1,p=!1,l=c=>{n=e(i,u=>{s(u);let h=Ie(t(),i);pi(o,h)||(o=h,!(p||d)&&(p=!0,queueMicrotask(()=>{p=!1,!d&&(_optionalChain([n, 'optionalCall', _123 => _123()]),l(o))})))},ui(c,a))};return l(o),()=>{d=!0,_optionalChain([n, 'optionalCall', _124 => _124()]),n=null}}function je(r){let{getState:t,subscriptions:e,selector:i,listener:s,options:a,trackedSubscriptionsEnabled:n}=r,o=_nullishCoalesce(_optionalChain([a, 'optionalAccess', _125 => _125.equalityFn]), () => (_chunk6LNXTSZ6cjs.c));if(_optionalChain([a, 'optionalAccess', _126 => _126.mode])==="tracked"){if(!n)throw new Error('BitForm: subscribeSelector com mode="tracked" est\xE1 desabilitado por padr\xE3o. Ative config.trackedSubscriptions=true para habilitar o modo avan\xE7ado.');return Oe({getState:t,subscribeSelector:(d,p,l)=>e.subscribeSelector(d,p,l,o),selector:i,listener:s,options:a})}return e.subscribeSelector(i,s,a,o)}function He(r){let{path:t,listener:e,options:i,subscribeSelector:s}=r,a=[..._nullishCoalesce(_optionalChain([i, 'optionalAccess', _127 => _127.paths]), () => ([])),t];return s(n=>_chunk6LNXTSZ6cjs.f.call(void 0, n.values,t),e,{...i,paths:a})}function ze(r){let{path:t,listener:e,getFieldState:i,subscribeSelector:s}=r;return s(()=>i(t),e,{paths:[t],equalityFn:_chunkOLQVH24Zcjs.c})}function qe(r){let{listener:t,subscribeSelector:e}=r;return e(i=>({isValid:i.isValid,isDirty:i.isDirty,isSubmitting:i.isSubmitting}),t,{paths:["isValid","isDirty","isSubmitting"],equalityFn:(i,s)=>i.isValid===s.isValid&&i.isDirty===s.isDirty&&i.isSubmitting===s.isSubmitting})}function Ue(r){let{listener:t,subscribeSelector:e}=r;return e(i=>i.persist,t,{paths:["persist"],equalityFn:(i,s)=>i.isSaving===s.isSaving&&i.isRestoring===s.isRestoring&&i.error===s.error})}function _e(r){let{readHistoryMeta:t,subscribeSelector:e,listener:i}=r;return e(()=>t(),i,{paths:[_chunkRHMJPKNVcjs.h.call(void 0, )],equalityFn:(s,a)=>_chunkRHMJPKNVcjs.e.call(void 0, s,a)})}function Ne(r){let{scopeName:t,getScopeFields:e,readScopeStatus:i,subscribeSelector:s,listener:a}=r,n=_chunkRHMJPKNVcjs.d.call(void 0, t),o=i(t),d=()=>{},p=()=>{d();let c=_chunkRHMJPKNVcjs.c.call(void 0, e(t));d=s(()=>i(t),u=>{_chunkRHMJPKNVcjs.b.call(void 0, o,u)||(o=u,a(u))},{paths:[...c,n]})};p();let l=s(()=>e(t).length,()=>{p();let c=i(t);_chunkRHMJPKNVcjs.b.call(void 0, o,c)||(o=c,a(c))},{paths:[n]});return()=>{d(),l()}}function Le(r){let{runtime:t,config:e,fieldRegistry:i,dirtyManager:s,stateReader:a}=r,n={getState:()=>a.getState(),getFieldState:l=>a.getFieldState(l),getIsValid:()=>a.getFlag("isValid"),getIsSubmitting:()=>a.getFlag("isSubmitting"),getIsDirty:()=>a.getFlag("isDirty"),isHidden:l=>t.capabilities.query.isHidden(l),isRequired:l=>t.capabilities.query.isRequired(l),isFieldDirty:l=>t.capabilities.query.isFieldDirty(l),isFieldValidating:l=>t.capabilities.query.isFieldValidating(l),getDirtyValues:()=>s.buildDirtyValues(a.getState().values),getPersistMetadata:()=>a.getPersistMetadata(),getHistoryMetadata:()=>ke({history:t.capabilities.history}),getScopeStatus:l=>t.capabilities.scope.getScopeStatus(l),getScopeErrors:l=>t.capabilities.scope.getScopeErrors(l),getCanUndo:()=>t.capabilities.history.canUndo,getCanRedo:()=>t.capabilities.history.canRedo,getScopeFields:l=>i.getScopeFields(l)},o={subscribe:l=>t.subscriptions.subscribe(l),subscribePersistMeta:l=>Ue({listener:l,subscribeSelector:(c,u,h)=>o.subscribeSelector(c,u,h)}),subscribeHistoryMeta:l=>_e({readHistoryMeta:()=>n.getHistoryMetadata(),subscribeSelector:(c,u,h)=>o.subscribeSelector(c,u,h),listener:l}),subscribeScopeStatus:(l,c)=>Ne({scopeName:l,getScopeFields:u=>n.getScopeFields(u),readScopeStatus:u=>n.getScopeStatus(u),subscribeSelector:(u,h,S)=>o.subscribeSelector(u,h,S),listener:c}),subscribeSelector:(l,c,u)=>je({getState:()=>n.getState(),subscriptions:t.subscriptions,selector:l,listener:c,options:u,trackedSubscriptionsEnabled:!!e.trackedSubscriptions}),subscribePath:(l,c,u)=>He({path:l,listener:c,options:u,subscribeSelector:(h,S,B)=>o.subscribeSelector(h,S,B)}),subscribeFieldState:(l,c)=>ze({path:l,listener:c,getFieldState:u=>n.getFieldState(u),subscribeSelector:(u,h,S)=>o.subscribeSelector(u,h,S)}),subscribeFormMeta:l=>qe({listener:l,subscribeSelector:(c,u,h)=>o.subscribeSelector(c,u,h)})};return{read:n,observe:o,write:{registerField:(l,c)=>{Wt({path:l,config:c,state:t.getState(),fieldRegistry:i,subscriptions:t.subscriptions,stateReader:a,invalidateFieldIndexes:()=>{i.invalidateIndexes()}})},unregisterField:l=>{Kt({path:l,state:t.getState(),hasStaticConfig:!!_optionalChain([e, 'access', _128 => _128.fields, 'optionalAccess', _129 => _129[l]]),fieldRegistry:i,subscriptions:t.subscriptions,validationCleanupField:c=>t.capabilities.validation.cleanupField(c),invalidateFieldIndexes:()=>{i.invalidateIndexes()},dispatch:c=>t.dispatch(c)})},unregisterPrefix:l=>{Y({prefix:l,state:t.getState(),fieldRegistry:i,subscriptions:t.subscriptions,validationCleanupPrefix:c=>t.capabilities.validation.cleanupPrefix(c),invalidateFieldIndexes:()=>{i.invalidateIndexes()}})},setField:(l,c)=>{t.runBatch(()=>{t.capabilities.lifecycle.updateField(l,c,{origin:"setField"})})},blurField:l=>{t.capabilities.query.isTouched(l)||t.runBatch(()=>{t.dispatch(Pt([l]))}),t.capabilities.validation.trigger([l])},markFieldsTouched:l=>{l.length!==0&&t.dispatch(Pt(l))},setValues:(l,c)=>{t.capabilities.lifecycle.setValues(l,c)},setError:(l,c)=>{t.capabilities.error.setError(l,c)},setErrors:l=>{t.capabilities.error.setErrors(l)},setServerErrors:l=>{t.capabilities.error.setServerErrors(l)},reset:()=>{t.runBatch(()=>{t.capabilities.lifecycle.reset()})},transaction:l=>t.runBatch(l),submit:l=>t.capabilities.lifecycle.submit(l),pushItem:(l,c)=>t.capabilities.arrays.pushItem(l,c),prependItem:(l,c)=>t.capabilities.arrays.prependItem(l,c),insertItem:(l,c,u)=>t.capabilities.arrays.insertItem(l,c,u),removeItem:(l,c)=>t.capabilities.arrays.removeItem(l,c),swapItems:(l,c,u)=>t.capabilities.arrays.swapItems(l,c,u),moveItem:(l,c,u)=>t.capabilities.arrays.moveItem(l,c,u),replaceItems:(l,c)=>t.capabilities.arrays.replaceItems(l,c),clearItems:l=>t.capabilities.arrays.clearItems(l)},feature:{undo:()=>{Me({history:t.capabilities.history,applyHistoryState:l=>t.capabilities.lifecycle.applyHistoryState(l)})},redo:()=>{Re({history:t.capabilities.history,applyHistoryState:l=>t.capabilities.lifecycle.applyHistoryState(l)})},validate:l=>t.capabilities.validation.validate(l),hasValidationsInProgress:l=>t.capabilities.validation.hasValidationsInProgress(l),triggerValidation:(l,c)=>t.capabilities.validation.trigger(l,c),restorePersisted:()=>we({dispatch:l=>t.dispatch(l),effects:t.effects}),forceSave:()=>De({dispatch:l=>t.dispatch(l),effects:t.effects}),clearPersisted:()=>Ae({dispatch:l=>t.dispatch(l),effects:t.effects}),cleanup:()=>t.cleanup()}}}function We(r){let t=()=>r.read.getState();return{read:{get storeId(){return r.identity.storeId},get config(){return r.identity.config},get isValid(){return r.read.getIsValid()},get isSubmitting(){return r.read.getIsSubmitting()},get isDirty(){return r.read.getIsDirty()},getState:t,getFieldConfig:n=>r.getFieldConfig(n),getFieldState:n=>r.read.getFieldState(n),isHidden:n=>r.read.isHidden(n),isRequired:n=>r.read.isRequired(n),isFieldDirty:n=>r.read.isFieldDirty(n),isFieldValidating:n=>r.read.isFieldValidating(n),getDirtyValues:()=>r.read.getDirtyValues(),getPersistMetadata:()=>r.read.getPersistMetadata(),getHistoryMetadata:()=>r.read.getHistoryMetadata(),getScopeStatus:n=>r.read.getScopeStatus(n),getScopeErrors:n=>r.read.getScopeErrors(n),getScopeFields:n=>r.read.getScopeFields(n)},observe:{getState:t,subscribe:n=>r.observe.subscribe(n),subscribePersistMeta:n=>r.observe.subscribePersistMeta(n),subscribeHistoryMeta:n=>r.observe.subscribeHistoryMeta(n),subscribeScopeStatus:(n,o)=>r.observe.subscribeScopeStatus(n,o),subscribeFormMeta:n=>r.observe.subscribeFormMeta(n),subscribeSelector:(n,o,d)=>r.observe.subscribeSelector(n,o,d),subscribePath:(n,o,d)=>r.observe.subscribePath(n,o,d),subscribeFieldState:(n,o)=>r.observe.subscribeFieldState(n,o)},write:{setField:(n,o)=>r.write.setField(n,o),blurField:n=>r.write.blurField(n),markFieldsTouched:n=>r.write.markFieldsTouched(n),setValues:(n,o)=>r.write.setValues(n,o),setError:(n,o)=>r.write.setError(n,o),setErrors:n=>r.write.setErrors(n),setServerErrors:n=>r.write.setServerErrors(n),reset:()=>r.write.reset(),transaction:n=>r.write.transaction(n),submit:n=>r.write.submit(n)},feature:{cleanup:()=>r.feature.cleanup(),validate:n=>r.feature.validate(n),triggerValidation:(n,o)=>r.feature.triggerValidation(n,o),restorePersisted:()=>r.feature.restorePersisted(),forceSave:()=>r.feature.forceSave(),clearPersisted:()=>r.feature.clearPersisted(),registerField:(n,o)=>r.write.registerField(n,o),unregisterField:n=>r.write.unregisterField(n),unregisterPrefix:n=>r.write.unregisterPrefix(n),pushItem:(n,o)=>r.write.pushItem(n,o),prependItem:(n,o)=>r.write.prependItem(n,o),insertItem:(n,o,d)=>r.write.insertItem(n,o,d),removeItem:(n,o)=>r.write.removeItem(n,o),moveItem:(n,o,d)=>r.write.moveItem(n,o,d),swapItems:(n,o,d)=>r.write.swapItems(n,o,d),replaceItems:(n,o)=>r.write.replaceItems(n,o),clearItems:n=>r.write.clearItems(n),get canUndo(){return r.read.getCanUndo()},get canRedo(){return r.read.getCanRedo()},hasValidationsInProgress:n=>r.feature.hasValidationsInProgress(n),resolveMask:n=>r.resolveMask(n),createArrayItemId:(n,o)=>r.createArrayItemId(n,o),undo:()=>r.feature.undo(),redo:()=>r.feature.redo()}}}var ft= (_class17 =class{constructor(t){;_class17.prototype.__init52.call(this);this.deps=t}__init52() {this.fieldStateCache=new Map}getState(){return this.deps.getState()}getFlag(t){return this.deps.getState()[t]}getPersistMetadata(){return this.deps.getState().persist}getFieldState(t){let e=t,i=this.deps.getState(),s=this.fieldStateCache.get(e),a=_chunk6LNXTSZ6cjs.f.call(void 0, i.values,e),n=i.errors[e],o=!!i.touched[e],d=this.deps.isHidden(e),p=this.deps.isRequired(e),l=this.deps.isFieldDirty(e),c=this.deps.isFieldValidating(e);if(s){let h=s.snapshot;if(h.value===a&&h.error===n&&h.touched===o&&h.isHidden===d&&h.isRequired===p&&h.isDirty===l&&h.isValidating===c)return h}let u=It({state:i,path:t,value:a,isHidden:d,isRequired:p,isDirty:l,isValidating:c});return this.fieldStateCache.set(e,{state:i,snapshot:u}),u}invalidatePath(t){this.fieldStateCache.delete(t)}}, _class17);var mt= (_class18 =class{__init53() {this[A]=!0}__init54() {this[D]=!0}constructor(t={}){;_class18.prototype.__init53.call(this);_class18.prototype.__init54.call(this);let e=Ve({rawConfig:t});this._config=e.config,this.storeId=e.storeId;let i=new ft({getState:()=>e.runtime.getState(),isHidden:n=>e.runtime.capabilities.query.isHidden(n),isRequired:n=>e.runtime.capabilities.query.isRequired(n),isFieldDirty:n=>e.runtime.capabilities.query.isFieldDirty(n),isFieldValidating:n=>e.runtime.capabilities.query.isFieldValidating(n)}),s=Le({runtime:e.runtime,config:this._config,fieldRegistry:e.fieldRegistry,dirtyManager:e.dirtyManager,stateReader:i}),a=We({identity:{storeId:this.storeId,config:this._config},read:s.read,observe:s.observe,write:s.write,feature:s.feature,getFieldConfig:n=>e.fieldRegistry.getFieldConfig(n),resolveMask:n=>kt({path:n,getFieldConfig:o=>e.fieldRegistry.getFieldConfig(o),masks:e.maskManager.getAllMasks()}),createArrayItemId:(n,o)=>this._config.idFactory({scope:"array",path:n,index:o})});this.read=a.read,this.observe=a.observe,this.write=a.write,this.feature=a.feature,e.runtime.effects.attachStorePort({getState:()=>this.read.getState(),getHistoryMetadata:()=>this.read.getHistoryMetadata(),undo:()=>this.feature.undo(),redo:()=>this.feature.redo(),reset:()=>this.write.reset()})}}, _class18);function Ke(r={}){return new mt(r)}function $e(r){if(!r||typeof r!="object")return!1;let t=r;return t[A]===!0&&!!t.read&&!!t.observe&&!!t.write&&!!t.feature}function hi(r){if($e(r))return r;throw new Error("BitForm: o store informado n\xE3o exp\xF5e a API necess\xE1ria para hooks/framework bindings.")}function gi(r){return!r||typeof r!="object"?!1:r[D]===!0}function fi(r){if(!$e(r))throw new Error("BitForm: o store informado n\xE3o possui branding de hooks (BIT_HOOKS_API_SYMBOL).");if(!gi(r))throw new Error("BitForm: o store informado n\xE3o possui branding de framework (BIT_FRAMEWORK_STORE_SYMBOL).");return r}function mi(r){return Object.defineProperty(r,A,{value:!0,enumerable:!1,configurable:!1,writable:!1}),Object.defineProperty(r,D,{value:!0,enumerable:!1,configurable:!1,writable:!1}),r}function yi(r={}){let t=Ke(r),e={read:t.read,observe:t.observe,write:t.write,feature:t.feature};return mi(e)}function Si(r){return r.read}function bi(r){return r.observe}function Bi(r){return r.write}function Ti(r){return r.feature}function vi(r,t){let e={};for(let i of t)e[i]=r[i];return e}exports.a = Tt; exports.b = ii; exports.c = hi; exports.d = fi; exports.e = yi; exports.f = Si; exports.g = bi; exports.h = Bi; exports.i = Ti; exports.j = vi;
|
|
2
|
-
//# sourceMappingURL=chunk-J5ALITQW.cjs.map
|
package/dist/chunk-KDHPLXZF.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk6LNXTSZ6cjs = require('./chunk-6LNXTSZ6.cjs');var _chunkPFPGASVZcjs = require('./chunk-PFPGASVZ.cjs');function c(e){let t=e.read.getState();return{isValid:t.isValid,isDirty:t.isDirty,isSubmitting:t.isSubmitting}}function f(e,t){return e.observe.subscribeFormMeta(()=>t())}function x(e,t){return t(c(e)),f(e,()=>{t(c(e))})}function P(e){return e.read.getPersistMetadata()}function T(e,t){return e.observe.subscribePersistMeta(()=>t())}function h(e,t){return t(P(e)),e.observe.subscribePersistMeta(i=>{t(i)})}function M(e,t){let i=[],n=r=>e.feature.createArrayItemId(t,r),s=r=>Array.isArray(r)?r:[],d=r=>{if(r.length!==i.length)if(r.length>i.length){let a=r.length-i.length;i=[...i,...Array.from({length:a},(o,l)=>n(i.length+l))]}else i=i.slice(0,r.length);return r};return{readItems(){let r=_chunk6LNXTSZ6cjs.f.call(void 0, e.read.getState().values,t);return d(s(r))},getFields(r){return r.map((a,o)=>({key:i[o]||`temp-${o}`,value:a,index:o}))},append(r){i=[...i,n(i.length)],e.feature.pushItem(t,r)},prepend(r){i=[n(0),...i],e.feature.prependItem(t,r)},insert(r,a){let o=[...i];o.splice(r,0,n(r)),i=o,e.feature.insertItem(t,r,a)},remove(r){i=i.filter((a,o)=>o!==r),e.feature.removeItem(t,r)},move(r,a){let o=[...i],[l]=o.splice(r,1);o.splice(a,0,l),i=o,e.feature.moveItem(t,r,a)},swap(r,a){let o=[...i];[o[r],o[a]]=[o[a],o[r]],i=o,e.feature.swapItems(t,r,a)},replace(r){i=r.map((a,o)=>n(o)),e.feature.replaceItems(t,r)},clear(){i=[],e.feature.clearItems(t)}}}function v(e,t,i){return{setValue:r=>{let a=i();e.setField(t,_chunkPFPGASVZcjs.c.call(void 0, r,a))},setBlur:()=>e.blurField(t),displayValue:r=>_chunkPFPGASVZcjs.b.call(void 0, r,i())}}function w(e,t){return{fieldController:v({setField(n,s){e.write.setField(n,s)},blurField(n){e.write.blurField(n)}},t,()=>e.feature.resolveMask(t))}}async function y(e,t,i,n){try{let s=await e(t,i);n.onSuccess(s)}catch(s){if(_chunk6LNXTSZ6cjs.l.call(void 0, s)){n.onServerErrors(_chunk6LNXTSZ6cjs.m.call(void 0, s));return}n.onUnhandledError(s instanceof Error?s:new Error(String(s)))}}function S(e,t){_optionalChain([e, 'optionalAccess', _ => _.preventDefault, 'optionalCall', _2 => _2()]),_optionalChain([t, 'optionalAccess', _3 => _3.stopPropagation])&&_optionalChain([e, 'optionalAccess', _4 => _4.stopPropagation, 'optionalCall', _5 => _5()])}function g(e,t,i){return{submit:r=>async a=>{S(a,i),await e.submit(r)},onSubmit:r=>async a=>{S(a,i),t.setSubmissionError(null),await e.submit(async(o,l)=>{await y(r,o,l,{onSuccess:m=>{t.setSubmissionResult(m),t.setSubmissionError(null)},onServerErrors:m=>{e.setServerErrors(m)},onUnhandledError:m=>{t.setSubmissionError(m)}})})},reset:()=>{e.reset(),t.clearSubmissionState()},getValues:()=>e.getState().values,getErrors:()=>e.getState().errors,getTouched:()=>e.getState().touched,getDirtyValues:()=>e.getDirtyValues()}}function I(e,t,i){let n={getState:e.read.getState,getDirtyValues:e.read.getDirtyValues,submit:e.write.submit,reset:e.write.reset,setServerErrors:e.write.setServerErrors};return{controller:g(n,t,i),actions:{setField:e.write.setField.bind(e.write),blurField:e.write.blurField.bind(e.write),setValues:e.write.setValues.bind(e.write),setError:e.write.setError.bind(e.write),setErrors:e.write.setErrors.bind(e.write),setServerErrors:e.write.setServerErrors.bind(e.write),validate:e.feature.validate.bind(e.feature),transaction:e.write.transaction.bind(e.write)}}}function A(e,t){_optionalChain([e, 'access', _6 => _6.feature, 'optionalAccess', _7 => _7.unregisterField, 'optionalCall', _8 => _8(t)])}function E(e,t){_optionalChain([e, 'access', _9 => _9.feature, 'optionalAccess', _10 => _10.unregisterPrefix, 'optionalCall', _11 => _11(t)])}exports.a = c; exports.b = f; exports.c = x; exports.d = P; exports.e = T; exports.f = h; exports.g = M; exports.h = w; exports.i = I; exports.j = A; exports.k = E;
|
|
2
|
-
//# sourceMappingURL=chunk-KDHPLXZF.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/bit-form/bit-form/dist/chunk-KDHPLXZF.cjs","../src/core/bindings/form-meta.ts","../src/core/bindings/persist-meta.ts","../src/core/bindings/array-controller.ts"],"names":["readFormMetaSnapshot","store","state","subscribeFormMetaSnapshot","listener","observeFormMetaSnapshot","readPersistMetaSnapshot","subscribePersistMetaSnapshot","observePersistMetaSnapshot","meta","createArrayBinding","path","ids","createId","index","normalizeItems","value","syncIds","items","diff","_","offset","getDeepValue","item"],"mappings":"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","file":"/home/runner/work/bit-form/bit-form/dist/chunk-KDHPLXZF.cjs","sourcesContent":[null,"import type { BitFormMeta } from \"../store/contracts/public/meta-types\";\nimport type { BitStoreApi } from \"../store/contracts/public/store-api-types\";\n\nexport function readFormMetaSnapshot<T extends object>(\n store: BitStoreApi<T>,\n): BitFormMeta {\n const state = store.read.getState();\n return {\n isValid: state.isValid,\n isDirty: state.isDirty,\n isSubmitting: state.isSubmitting,\n };\n}\n\nexport function subscribeFormMetaSnapshot<T extends object>(\n store: BitStoreApi<T>,\n listener: () => void,\n): () => void {\n return store.observe.subscribeFormMeta(() => listener());\n}\n\nexport function observeFormMetaSnapshot<T extends object>(\n store: BitStoreApi<T>,\n listener: (meta: BitFormMeta) => void,\n): () => void {\n listener(readFormMetaSnapshot(store));\n\n return subscribeFormMetaSnapshot(store, () => {\n listener(readFormMetaSnapshot(store));\n });\n}\n","import type { BitPersistMetadata } from \"../store/contracts/types\";\n\ntype BitPersistMetaReadableStore = {\n read: {\n getPersistMetadata(): BitPersistMetadata;\n };\n observe: {\n subscribePersistMeta(\n listener: (meta: BitPersistMetadata) => void,\n ): () => void;\n };\n};\n\nexport function readPersistMetaSnapshot(store: {\n read: {\n getPersistMetadata(): BitPersistMetadata;\n };\n}): BitPersistMetadata {\n return store.read.getPersistMetadata();\n}\n\nexport function subscribePersistMetaSnapshot(\n store: BitPersistMetaReadableStore,\n listener: () => void,\n): () => void {\n return store.observe.subscribePersistMeta(() => listener());\n}\n\nexport function observePersistMetaSnapshot(\n store: BitPersistMetaReadableStore,\n listener: (meta: BitPersistMetadata) => void,\n): () => void {\n listener(readPersistMetaSnapshot(store));\n\n return store.observe.subscribePersistMeta((meta) => {\n listener(meta);\n });\n}\n","import type { BitStoreApi } from \"../store/contracts/public/store-api-types\";\nimport type {\n BitArrayItem,\n BitArrayPath,\n BitPathValue,\n} from \"../store/contracts/types\";\nimport { getDeepValue } from \"../utils\";\n\nexport interface BitArrayBindingField<TItem> {\n key: string;\n value: TItem;\n index: number;\n}\n\nexport interface BitArrayBinding<\n TForm extends object,\n P extends BitArrayPath<TForm>,\n> {\n readItems(): BitArrayItem<BitPathValue<TForm, P>>[];\n getFields(\n items: BitArrayItem<BitPathValue<TForm, P>>[],\n ): BitArrayBindingField<BitArrayItem<BitPathValue<TForm, P>>>[];\n append(value: BitArrayItem<BitPathValue<TForm, P>>): void;\n prepend(value: BitArrayItem<BitPathValue<TForm, P>>): void;\n insert(index: number, value: BitArrayItem<BitPathValue<TForm, P>>): void;\n remove(index: number): void;\n move(from: number, to: number): void;\n swap(indexA: number, indexB: number): void;\n replace(items: BitArrayItem<BitPathValue<TForm, P>>[]): void;\n clear(): void;\n}\n\nexport function createArrayBinding<\n TForm extends object,\n P extends BitArrayPath<TForm>,\n>(store: BitStoreApi<TForm>, path: P): BitArrayBinding<TForm, P> {\n type Item = BitArrayItem<BitPathValue<TForm, P>>;\n\n let ids: string[] = [];\n\n const createId = (index?: number) =>\n store.feature.createArrayItemId(path as string, index);\n\n const normalizeItems = (value: unknown): Item[] =>\n Array.isArray(value) ? (value as Item[]) : [];\n\n const syncIds = (items: Item[]): Item[] => {\n if (items.length !== ids.length) {\n if (items.length > ids.length) {\n const diff = items.length - ids.length;\n ids = [\n ...ids,\n ...Array.from({ length: diff }, (_, offset) =>\n createId(ids.length + offset),\n ),\n ];\n } else {\n ids = ids.slice(0, items.length);\n }\n }\n\n return items;\n };\n\n return {\n readItems() {\n const value = getDeepValue(\n store.read.getState().values,\n path as string,\n ) as BitPathValue<TForm, P> | undefined;\n return syncIds(normalizeItems(value));\n },\n\n getFields(items) {\n return items.map((item, index) => ({\n key: ids[index] || `temp-${index}`,\n value: item,\n index,\n }));\n },\n\n append(value) {\n ids = [...ids, createId(ids.length)];\n store.feature.pushItem(path, value);\n },\n\n prepend(value) {\n ids = [createId(0), ...ids];\n store.feature.prependItem(path, value);\n },\n\n insert(index, value) {\n const nextIds = [...ids];\n nextIds.splice(index, 0, createId(index));\n ids = nextIds;\n store.feature.insertItem(path, index, value);\n },\n\n remove(index) {\n ids = ids.filter((_, currentIndex) => currentIndex !== index);\n store.feature.removeItem(path, index);\n },\n\n move(from, to) {\n const nextIds = [...ids];\n const [item] = nextIds.splice(from, 1);\n nextIds.splice(to, 0, item);\n ids = nextIds;\n store.feature.moveItem(path, from, to);\n },\n\n swap(indexA, indexB) {\n const nextIds = [...ids];\n [nextIds[indexA], nextIds[indexB]] = [nextIds[indexB], nextIds[indexA]];\n ids = nextIds;\n store.feature.swapItems(path, indexA, indexB);\n },\n\n replace(items) {\n ids = items.map((_, index) => createId(index));\n store.feature.replaceItems(path, items);\n },\n\n clear() {\n ids = [];\n store.feature.clearItems(path);\n },\n };\n}\n"]}
|
package/dist/chunk-O5UPA33R.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function a(n,t,e){return async o=>{if(o){e.setLoading(!0),e.setError(n,void 0);try{let r=await t(o);e.setValue(r.url),e.setUploadKey(r.key),e.setError(n,void 0)}catch(r){let d=r instanceof Error?r.message:"Upload failed";e.setError(n,d)}finally{e.setLoading(!1)}}}}function l(n,t,e){return async()=>{let o=e.getUploadKey();if(o&&t)try{await t(o)}catch(r){let d=r instanceof Error?r.message:"Delete failed";e.setError(n,d);return}e.setValue(null),e.setUploadKey(null),e.setError(n,void 0)}}export{a,l as b};
|
|
2
|
-
//# sourceMappingURL=chunk-O5UPA33R.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/adapters/upload-kernel.ts"],"sourcesContent":["/**\n * Framework-agnostic upload kernel.\n *\n * Encapsulates the side-effect logic for uploading/removing files so that\n * React, Vue, and Angular adapters share a single implementation and only\n * differ in how they wire reactive state.\n */\n\nimport type { BitUploadFn, BitDeleteUploadFn } from \"../types/upload\";\n\nexport interface UploadKernelCallbacks {\n /** Called with `true` when upload starts and `false` when it finishes. */\n setLoading: (loading: boolean) => void;\n /** Set or clear a field-level error message. */\n setError: (path: string, message: string | undefined) => void;\n /** Set the stored file URL after a successful upload (or `null` on remove). */\n setValue: (value: string | null) => void;\n /** Return the key of the last uploaded file (used when deleting). */\n getUploadKey: () => string | null;\n /** Persist the upload key returned by the upload function. */\n setUploadKey: (key: string | null) => void;\n}\n\n/**\n * Creates a type-safe `upload` handler for a field.\n *\n * @example\n * ```ts\n * const upload = createUploadHandler(\"avatar\", myUploadFn, {\n * setLoading: (v) => (isUploading.value = v),\n * setError: (p, m) => store.setError(p, m),\n * setValue: (v) => field.setValue(v),\n * getUploadKey: () => uploadKey,\n * setUploadKey: (k) => (uploadKey = k),\n * });\n * ```\n */\nexport function createUploadHandler(\n fieldPath: string,\n uploadFn: BitUploadFn,\n callbacks: UploadKernelCallbacks,\n): (file: File | null | undefined) => Promise<void> {\n return async (file) => {\n if (!file) return;\n\n callbacks.setLoading(true);\n callbacks.setError(fieldPath, undefined);\n\n try {\n const result = await uploadFn(file);\n\n callbacks.setValue(result.url);\n callbacks.setUploadKey(result.key);\n callbacks.setError(fieldPath, undefined);\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Upload failed\";\n callbacks.setError(fieldPath, message);\n } finally {\n callbacks.setLoading(false);\n }\n };\n}\n\n/**\n * Creates a type-safe `remove` handler for a field.\n */\nexport function createRemoveHandler(\n fieldPath: string,\n deleteFile: BitDeleteUploadFn | undefined,\n callbacks: UploadKernelCallbacks,\n): () => Promise<void> {\n return async () => {\n const uploadKey = callbacks.getUploadKey();\n\n if (uploadKey && deleteFile) {\n try {\n await deleteFile(uploadKey);\n } catch (error) {\n const message =\n error instanceof Error ? error.message : \"Delete failed\";\n callbacks.setError(fieldPath, message);\n return;\n }\n }\n\n callbacks.setValue(null);\n callbacks.setUploadKey(null);\n callbacks.setError(fieldPath, undefined);\n };\n}\n"],"mappings":"AAqCO,SAASA,EACdC,EACAC,EACAC,EACkD,CAClD,MAAO,OAAOC,GAAS,CACrB,GAAKA,EAEL,CAAAD,EAAU,WAAW,EAAI,EACzBA,EAAU,SAASF,EAAW,MAAS,EAEvC,GAAI,CACF,IAAMI,EAAS,MAAMH,EAASE,CAAI,EAElCD,EAAU,SAASE,EAAO,GAAG,EAC7BF,EAAU,aAAaE,EAAO,GAAG,EACjCF,EAAU,SAASF,EAAW,MAAS,CACzC,OAASK,EAAO,CACd,IAAMC,EAAUD,aAAiB,MAAQA,EAAM,QAAU,gBACzDH,EAAU,SAASF,EAAWM,CAAO,CACvC,QAAE,CACAJ,EAAU,WAAW,EAAK,CAC5B,EACF,CACF,CAKO,SAASK,EACdP,EACAQ,EACAN,EACqB,CACrB,MAAO,UAAY,CACjB,IAAMO,EAAYP,EAAU,aAAa,EAEzC,GAAIO,GAAaD,EACf,GAAI,CACF,MAAMA,EAAWC,CAAS,CAC5B,OAASJ,EAAO,CACd,IAAMC,EACJD,aAAiB,MAAQA,EAAM,QAAU,gBAC3CH,EAAU,SAASF,EAAWM,CAAO,EACrC,MACF,CAGFJ,EAAU,SAAS,IAAI,EACvBA,EAAU,aAAa,IAAI,EAC3BA,EAAU,SAASF,EAAW,MAAS,CACzC,CACF","names":["createUploadHandler","fieldPath","uploadFn","callbacks","file","result","error","message","createRemoveHandler","deleteFile","uploadKey"]}
|
package/dist/chunk-QX2IVNMK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function p(e){if(e===null||typeof e!="object")return e;if(typeof structuredClone=="function")return structuredClone(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(r=>p(r));let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=p(e[r]));return n}function d(e){return p(e)}function m(e,n){if(n===void 0)return d(e);if(n===null||typeof n!="object"||n instanceof Date||n instanceof RegExp||Array.isArray(n))return d(n);let r=e&&typeof e=="object"&&!Array.isArray(e)?d(e):{};for(let t of Object.keys(n)){let s=n[t],a=r[t];if(s!==null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp)){r[t]=m(a,s);continue}r[t]=d(s)}return r}function k(e,n){return e===n?!0:e===null||typeof e!="object"||n===null||typeof n!="object"?!1:h(e,n)}function h(e,n){if(e===n)return!0;if(e===null||typeof e!="object"||n===null||typeof n!="object")return!1;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp&&n instanceof RegExp)return e.toString()===n.toString();let r=Object.keys(e),t=Object.keys(n);if(r.length!==t.length)return!1;for(let s of r)if(!Object.prototype.hasOwnProperty.call(n,s)||!h(e[s],n[s]))return!1;return!0}function V(e,n,r="",t=new Set){if(k(e,n))return t;if(e===null||typeof e!="object"||n===null||typeof n!="object")return r&&t.add(r),t;if(Array.isArray(e)||Array.isArray(n))return!k(e,n)&&r&&t.add(r),t;let s=new Set;for(let a of Object.keys(e||{}))s.add(a);for(let a of Object.keys(n||{}))s.add(a);for(let a of s){let o=r?`${r}.${a}`:a;V(e?.[a],n?.[a],o,t)}return t}var g=new Map;function T(e,n){if(g.has(e))g.delete(e);else if(g.size>=5e3){let r=g.keys().next().value;r!==void 0&&g.delete(r)}g.set(e,n)}function A(e){let n=g.get(e);if(n)return n;let r=e.split(".");return T(e,r),r}function K(e,n){if(!n)return e;let r=A(n),t=e;for(let s of r){if(t==null)return;t=t[s]}return t}function D(e,n,r){if(!n)return r;let t=A(n),s=Array.isArray(e)?[...e]:{...e},a=s;for(let o=0;o<t.length-1;o++){let i=t[o],c=t[o+1],u=Number(c),y=Number.isInteger(u)&&String(u)===c,f=a[i];f==null?a[i]=y?[]:{}:a[i]=Array.isArray(f)?[...f]:{...f},a=a[i]}return a[t[t.length-1]]=r,s}function b(e,n){if(n.length===0)return e;let r=Array.isArray(e)?[...e]:{...e},t=new WeakSet;r&&typeof r=="object"&&t.add(r);for(let[s,a]of n){let o=A(s),i=r;for(let c=0;c<o.length-1;c++){let u=o[c],y=o[c+1],f=Number(y),R=Number.isInteger(f)&&String(f)===y,l=i[u];l==null?(i[u]=R?[]:{},t.add(i[u])):typeof l=="object"?t.has(l)||(i[u]=Array.isArray(l)?[...l]:{...l},t.add(i[u])):(i[u]=R?[]:{},t.add(i[u])),i=i[u]}i[o[o.length-1]]=a}return r}function E(e,n){if(n.length===0)return e;let r=Array.isArray(e)?[...e]:{...e},t=new WeakSet;r&&typeof r=="object"&&t.add(r);for(let s of n){if(!s)return Array.isArray(e)?[]:{};let a=A(s),o=r;for(let c=0;c<a.length-1;c++){let u=a[c],y=o?.[u];if(y==null){o=void 0;break}if(typeof y=="object")t.has(y)||(o[u]=Array.isArray(y)?[...y]:{...y},t.add(o[u]));else{o=void 0;break}o=o[u]}if(!o)continue;let i=a[a.length-1];Array.isArray(o)?o.splice(Number(i),1):o&&typeof o=="object"&&delete o[i]}return r}function O(e,n){let r={},t=`${n}.`;for(let s in e)s!==n&&!s.startsWith(t)&&(r[s]=e[s]);return r}function $(e,n,r){let t={},s={},a={},o=`${n}.`;for(let i of Object.keys(e.errors)){let c=x(i,o,r);c&&(t[c]=e.errors[i])}for(let i of Object.keys(e.touched)){let c=x(i,o,r);c&&(s[c]=e.touched[i])}for(let i of Object.keys(e.isValidating)){let c=x(i,o,r);c&&(a[c]=e.isValidating[i])}return{errors:t,touched:s,isValidating:a}}function x(e,n,r){if(!e.startsWith(n))return e;let s=e.substring(n.length).split("."),a=parseInt(s[0],10),o=r(a);if(o===null)return null;let i=s.slice(1).join(".");return i?`${n}${o}.${i}`:`${n}${o}`}function w(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e.errors??e;return typeof n!="object"||n===null||Array.isArray(n)?!1:Object.values(n).every(r=>typeof r=="string"||Array.isArray(r)&&r.every(t=>typeof t=="string"))}function N(e){return w(e)?e.errors??e:{}}export{d as a,m as b,k as c,h as d,V as e,K as f,D as g,b as h,E as i,O as j,$ as k,w as l,N as m};
|
|
2
|
-
//# sourceMappingURL=chunk-QX2IVNMK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/utils/clone.ts","../src/core/utils/structural.ts","../src/core/utils/path-value.ts","../src/core/utils/array-meta.ts","../src/core/utils/server-errors.ts"],"sourcesContent":["export function cloneValue<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n\n if (typeof structuredClone === \"function\") {\n return structuredClone(obj);\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as any as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as any as T;\n }\n\n if (Array.isArray(obj)) {\n return obj.map((item) => cloneValue(item)) as any as T;\n }\n\n const clone: any = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n clone[key] = cloneValue((obj as any)[key]);\n }\n }\n\n return clone as T;\n}\n","import { cloneValue } from \"./clone\";\n\nexport function deepClone<T>(obj: T): T {\n return cloneValue(obj);\n}\n\nexport function deepMerge<T>(target: T, source: any): T {\n if (source === undefined) {\n return deepClone(target);\n }\n\n if (\n source === null ||\n typeof source !== \"object\" ||\n source instanceof Date ||\n source instanceof RegExp ||\n Array.isArray(source)\n ) {\n return deepClone(source as T);\n }\n\n const base =\n target && typeof target === \"object\" && !Array.isArray(target)\n ? deepClone(target as any)\n : ({} as Record<string, unknown>);\n\n for (const key of Object.keys(source)) {\n const sourceValue = source[key];\n const baseValue = (base as Record<string, unknown>)[key];\n\n if (\n sourceValue !== null &&\n typeof sourceValue === \"object\" &&\n !Array.isArray(sourceValue) &&\n !(sourceValue instanceof Date) &&\n !(sourceValue instanceof RegExp)\n ) {\n (base as Record<string, unknown>)[key] = deepMerge(\n baseValue,\n sourceValue,\n );\n continue;\n }\n\n (base as Record<string, unknown>)[key] = deepClone(sourceValue);\n }\n\n return base as T;\n}\n\nexport function valueEqual(a: any, b: any): boolean {\n if (a === b) return true;\n if (\n a === null ||\n typeof a !== \"object\" ||\n b === null ||\n typeof b !== \"object\"\n ) {\n return false;\n }\n return deepEqual(a, b);\n}\n\nexport function deepEqual(a: any, b: any): boolean {\n if (a === b) return true;\n if (\n a === null ||\n typeof a !== \"object\" ||\n b === null ||\n typeof b !== \"object\"\n ) {\n return false;\n }\n\n if (a instanceof Date && b instanceof Date)\n return a.getTime() === b.getTime();\n if (a instanceof RegExp && b instanceof RegExp)\n return a.toString() === b.toString();\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (\n !Object.prototype.hasOwnProperty.call(b, key) ||\n !deepEqual(a[key], b[key])\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function collectDirtyPaths(\n obj: any,\n initial: any,\n prefix = \"\",\n result: Set<string> = new Set(),\n): Set<string> {\n if (valueEqual(obj, initial)) return result;\n if (\n obj === null ||\n typeof obj !== \"object\" ||\n initial === null ||\n typeof initial !== \"object\"\n ) {\n if (prefix) result.add(prefix);\n return result;\n }\n if (Array.isArray(obj) || Array.isArray(initial)) {\n if (!valueEqual(obj, initial) && prefix) result.add(prefix);\n return result;\n }\n const allKeys = new Set<string>();\n for (const key of Object.keys(obj || {})) {\n allKeys.add(key);\n }\n for (const key of Object.keys(initial || {})) {\n allKeys.add(key);\n }\n for (const k of allKeys) {\n const p = prefix ? `${prefix}.${k}` : k;\n collectDirtyPaths((obj as any)?.[k], (initial as any)?.[k], p, result);\n }\n return result;\n}\n","const PATH_CACHE_MAX = 5000;\nconst pathCache = new Map<string, string[]>();\n\nfunction setPathCacheEntry(path: string, keys: string[]) {\n if (pathCache.has(path)) {\n pathCache.delete(path);\n } else if (pathCache.size >= PATH_CACHE_MAX) {\n const oldestKey = pathCache.keys().next().value;\n if (oldestKey !== undefined) {\n pathCache.delete(oldestKey);\n }\n }\n\n pathCache.set(path, keys);\n}\n\nfunction getPathKeys(path: string): string[] {\n const cached = pathCache.get(path);\n if (cached) {\n return cached;\n }\n\n const keys = path.split(\".\");\n setPathCacheEntry(path, keys);\n return keys;\n}\n\nexport function getDeepValue(obj: any, path: string): any {\n if (!path) return obj;\n\n const keys = getPathKeys(path);\n\n let current = obj;\n for (const key of keys) {\n if (current === null || current === undefined) return undefined;\n current = current[key];\n }\n return current;\n}\n\nexport function setDeepValue(obj: any, path: string, value: any): any {\n if (!path) return value;\n\n const keys = getPathKeys(path);\n\n const result = Array.isArray(obj) ? [...obj] : { ...obj };\n let current = result;\n\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n const nextKey = keys[i + 1];\n\n const nextAsNumber = Number(nextKey);\n const isNextNumeric =\n Number.isInteger(nextAsNumber) && String(nextAsNumber) === nextKey;\n const currentValue = current[key];\n\n if (currentValue === null || currentValue === undefined) {\n current[key] = isNextNumeric ? [] : {};\n } else {\n current[key] = Array.isArray(currentValue)\n ? [...currentValue]\n : { ...currentValue };\n }\n\n current = current[key];\n }\n\n current[keys[keys.length - 1]] = value;\n\n return result;\n}\n\nexport function setDeepValues(\n obj: any,\n updates: ReadonlyArray<readonly [path: string, value: any]>,\n): any {\n if (updates.length === 0) {\n return obj;\n }\n\n const root = Array.isArray(obj) ? [...obj] : { ...obj };\n const clonedNodes = new WeakSet<object>();\n if (root && typeof root === \"object\") {\n clonedNodes.add(root);\n }\n\n for (const [path, value] of updates) {\n const keys = getPathKeys(path);\n let current: any = root;\n\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n const nextKey = keys[i + 1];\n\n const nextAsNumber = Number(nextKey);\n const isNextNumeric =\n Number.isInteger(nextAsNumber) && String(nextAsNumber) === nextKey;\n\n const currentValue = current[key];\n\n if (currentValue === null || currentValue === undefined) {\n current[key] = isNextNumeric ? [] : {};\n clonedNodes.add(current[key]);\n } else if (typeof currentValue === \"object\") {\n if (!clonedNodes.has(currentValue)) {\n current[key] = Array.isArray(currentValue)\n ? [...currentValue]\n : { ...currentValue };\n clonedNodes.add(current[key]);\n }\n } else {\n current[key] = isNextNumeric ? [] : {};\n clonedNodes.add(current[key]);\n }\n\n current = current[key];\n }\n\n current[keys[keys.length - 1]] = value;\n }\n\n return root;\n}\n\nexport function unsetDeepValue(obj: any, path: string): any {\n if (!path) {\n return Array.isArray(obj) ? [] : {};\n }\n\n const keys = getPathKeys(path);\n const root = Array.isArray(obj) ? [...obj] : { ...obj };\n let current: any = root;\n\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n const currentValue = current?.[key];\n\n if (currentValue === null || currentValue === undefined) {\n return root;\n }\n\n current[key] = Array.isArray(currentValue)\n ? [...currentValue]\n : { ...currentValue };\n\n current = current[key];\n }\n\n const leafKey = keys[keys.length - 1];\n\n if (Array.isArray(current)) {\n current.splice(Number(leafKey), 1);\n } else if (current && typeof current === \"object\") {\n delete current[leafKey];\n }\n\n return root;\n}\n\nexport function unsetDeepValues(obj: any, paths: ReadonlyArray<string>): any {\n if (paths.length === 0) {\n return obj;\n }\n\n const root = Array.isArray(obj) ? [...obj] : { ...obj };\n const clonedNodes = new WeakSet<object>();\n if (root && typeof root === \"object\") {\n clonedNodes.add(root);\n }\n\n for (const path of paths) {\n if (!path) {\n return Array.isArray(obj) ? [] : {};\n }\n\n const keys = getPathKeys(path);\n let current: any = root;\n\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n const currentValue = current?.[key];\n\n if (currentValue === null || currentValue === undefined) {\n current = undefined;\n break;\n }\n\n if (typeof currentValue === \"object\") {\n if (!clonedNodes.has(currentValue)) {\n current[key] = Array.isArray(currentValue)\n ? [...currentValue]\n : { ...currentValue };\n clonedNodes.add(current[key]);\n }\n } else {\n current = undefined;\n break;\n }\n\n current = current[key];\n }\n\n if (!current) {\n continue;\n }\n\n const leafKey = keys[keys.length - 1];\n\n if (Array.isArray(current)) {\n current.splice(Number(leafKey), 1);\n } else if (current && typeof current === \"object\") {\n delete current[leafKey];\n }\n }\n\n return root;\n}\n","export function cleanPrefixedKeys(\n obj: Record<string, any>,\n prefix: string,\n): Record<string, any> {\n const newObj: Record<string, any> = {};\n const prefixWithDot = `${prefix}.`;\n\n for (const key in obj) {\n if (key !== prefix && !key.startsWith(prefixWithDot)) {\n newObj[key] = obj[key];\n }\n }\n return newObj;\n}\n\nexport const shiftKeys = (\n obj: Record<string, any>,\n path: string,\n removedIndex: number,\n) => {\n return reindexObjectKeys(obj, path, (currentIdx) => {\n if (currentIdx === removedIndex) {\n return null;\n }\n\n return currentIdx > removedIndex ? currentIdx - 1 : currentIdx;\n });\n};\n\nexport const swapKeys = (\n obj: Record<string, any>,\n path: string,\n indexA: number,\n indexB: number,\n) => {\n return reindexObjectKeys(obj, path, (currentIdx) => {\n if (currentIdx === indexA) {\n return indexB;\n }\n\n if (currentIdx === indexB) {\n return indexA;\n }\n\n return currentIdx;\n });\n};\n\nexport const moveKeys = (\n obj: Record<string, any>,\n path: string,\n from: number,\n to: number,\n) => {\n return reindexObjectKeys(obj, path, (currentIdx) => {\n if (currentIdx === from) {\n return to;\n }\n\n if (from < to && currentIdx > from && currentIdx <= to) {\n return currentIdx - 1;\n }\n\n if (from > to && currentIdx >= to && currentIdx < from) {\n return currentIdx + 1;\n }\n\n return currentIdx;\n });\n};\n\nexport function reindexFieldArrayMeta(\n state: {\n errors: Record<string, any>;\n touched: Record<string, any>;\n isValidating: Record<string, any>;\n },\n path: string,\n remapIndex: (index: number) => number | null,\n) {\n const nextErrors: Record<string, any> = {};\n const nextTouched: Record<string, any> = {};\n const nextIsValidating: Record<string, any> = {};\n\n const prefix = `${path}.`;\n\n for (const key of Object.keys(state.errors)) {\n const nextKey = remapIndexedPath(key, prefix, remapIndex);\n if (nextKey) nextErrors[nextKey] = state.errors[key];\n }\n\n for (const key of Object.keys(state.touched)) {\n const nextKey = remapIndexedPath(key, prefix, remapIndex);\n if (nextKey) nextTouched[nextKey] = state.touched[key];\n }\n\n for (const key of Object.keys(state.isValidating)) {\n const nextKey = remapIndexedPath(key, prefix, remapIndex);\n if (nextKey) nextIsValidating[nextKey] = state.isValidating[key];\n }\n\n return {\n errors: nextErrors,\n touched: nextTouched,\n isValidating: nextIsValidating,\n };\n}\n\nfunction remapIndexedPath(\n key: string,\n prefix: string,\n remapIndex: (index: number) => number | null,\n) {\n if (!key.startsWith(prefix)) {\n return key;\n }\n\n const remaining = key.substring(prefix.length);\n const parts = remaining.split(\".\");\n const currentIdx = parseInt(parts[0], 10);\n const nextIdx = remapIndex(currentIdx);\n\n if (nextIdx === null) {\n return null;\n }\n\n const rest = parts.slice(1).join(\".\");\n return rest ? `${prefix}${nextIdx}.${rest}` : `${prefix}${nextIdx}`;\n}\n\nfunction reindexObjectKeys(\n obj: Record<string, any>,\n path: string,\n remapIndex: (index: number) => number | null,\n) {\n const nextObject: Record<string, any> = {};\n const prefix = `${path}.`;\n\n for (const key of Object.keys(obj)) {\n if (!key.startsWith(prefix)) {\n nextObject[key] = obj[key];\n continue;\n }\n\n const remaining = key.substring(prefix.length);\n const parts = remaining.split(\".\");\n const currentIdx = parseInt(parts[0], 10);\n const nextIdx = remapIndex(currentIdx);\n\n if (nextIdx === null) {\n continue;\n }\n\n const rest = parts.slice(1).join(\".\");\n const nextKey = rest\n ? `${prefix}${nextIdx}.${rest}`\n : `${prefix}${nextIdx}`;\n nextObject[nextKey] = obj[key];\n }\n\n return nextObject;\n}\n","export function isValidationErrorShape(\n x: unknown,\n): x is Record<string, string | string[]> {\n if (typeof x !== \"object\" || x === null || Array.isArray(x)) return false;\n\n const obj = (x as Record<string, unknown>).errors ?? x;\n if (typeof obj !== \"object\" || obj === null || Array.isArray(obj))\n return false;\n\n return Object.values(obj as Record<string, unknown>).every(\n (v) =>\n typeof v === \"string\" ||\n (Array.isArray(v) && v.every((i) => typeof i === \"string\")),\n );\n}\n\nexport function extractServerErrors(\n x: unknown,\n): Record<string, string | string[]> {\n if (!isValidationErrorShape(x)) return {};\n\n const obj = (x as Record<string, unknown>).errors ?? x;\n return obj as Record<string, string | string[]>;\n}\n"],"mappings":"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","names":["cloneValue","obj","item","clone","key","deepClone","obj","cloneValue","deepMerge","target","source","base","key","sourceValue","baseValue","valueEqual","a","b","deepEqual","keysA","keysB","collectDirtyPaths","initial","prefix","result","allKeys","k","p","pathCache","setPathCacheEntry","path","keys","oldestKey","getPathKeys","cached","getDeepValue","obj","current","key","setDeepValue","value","result","i","nextKey","nextAsNumber","isNextNumeric","currentValue","setDeepValues","updates","root","clonedNodes","unsetDeepValues","obj","paths","root","clonedNodes","path","keys","getPathKeys","current","i","key","currentValue","leafKey","cleanPrefixedKeys","obj","prefix","newObj","prefixWithDot","key","reindexFieldArrayMeta","state","path","remapIndex","nextErrors","nextTouched","nextIsValidating","prefix","key","nextKey","remapIndexedPath","parts","currentIdx","nextIdx","rest","isValidationErrorShape","x","obj","v","i","extractServerErrors"]}
|