cogsbox-state 0.5.63 → 0.5.65
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/CogsState.d.ts +3 -1
- package/dist/CogsState.jsx +301 -291
- package/dist/CogsState.jsx.map +1 -1
- package/package.json +1 -1
package/dist/CogsState.jsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { transformStateFunc as
|
|
5
|
-
import { pushFunc as
|
|
2
|
+
import { jsx as lt } from "react/jsx-runtime";
|
|
3
|
+
import { useState as et, useRef as Z, useEffect as nt, useLayoutEffect as It, useMemo as Et, createElement as Y, useSyncExternalStore as _t, startTransition as H } from "react";
|
|
4
|
+
import { transformStateFunc as wt, isFunction as q, getNestedValue as G, isDeepEqual as W, debounce as pt } from "./utility.js";
|
|
5
|
+
import { pushFunc as K, updateFn as B, cutFunc as J, ValidationWrapper as Vt, FormControlComponent as Nt } from "./Functions.jsx";
|
|
6
6
|
import "zod";
|
|
7
|
-
import { getGlobalStore as
|
|
7
|
+
import { getGlobalStore as o, formRefStore as dt } from "./store.js";
|
|
8
8
|
import { useCogsConfig as $t } from "./CogsStateClient.jsx";
|
|
9
|
-
import
|
|
9
|
+
import rt from "./node_modules/uuid/dist/esm-browser/v4.js";
|
|
10
10
|
function ut(t, i) {
|
|
11
|
-
const f =
|
|
11
|
+
const f = o.getState().getInitialOptions, S = o.getState().setInitialStateOptions, u = f(t) || {};
|
|
12
12
|
S(t, {
|
|
13
13
|
...u,
|
|
14
14
|
...i
|
|
@@ -19,19 +19,19 @@ function ft({
|
|
|
19
19
|
options: i,
|
|
20
20
|
initialOptionsPart: f
|
|
21
21
|
}) {
|
|
22
|
-
const S =
|
|
22
|
+
const S = ot(t) || {}, u = f[t] || {}, _ = o.getState().setInitialStateOptions, E = { ...u, ...S };
|
|
23
23
|
let y = !1;
|
|
24
24
|
if (i)
|
|
25
25
|
for (const g in i)
|
|
26
|
-
|
|
27
|
-
y && _(t,
|
|
26
|
+
E.hasOwnProperty(g) ? g == "localStorage" && i[g] && E[g].key !== i[g]?.key && (y = !0, E[g] = i[g]) : (y = !0, E[g] = i[g]);
|
|
27
|
+
y && _(t, E);
|
|
28
28
|
}
|
|
29
29
|
function qt(t, { formElements: i, validation: f }) {
|
|
30
30
|
return { initialState: t, formElements: i, validation: f };
|
|
31
31
|
}
|
|
32
32
|
const zt = (t, i) => {
|
|
33
33
|
let f = t;
|
|
34
|
-
const [S, u] =
|
|
34
|
+
const [S, u] = wt(f);
|
|
35
35
|
(i?.formElements || i?.validation) && Object.keys(u).forEach((y) => {
|
|
36
36
|
u[y] = u[y] || {}, u[y].formElements = {
|
|
37
37
|
...i.formElements,
|
|
@@ -40,20 +40,20 @@ const zt = (t, i) => {
|
|
|
40
40
|
...u[y].formElements || {}
|
|
41
41
|
// State-specific overrides
|
|
42
42
|
};
|
|
43
|
-
}),
|
|
43
|
+
}), o.getState().setInitialStates(S);
|
|
44
44
|
const _ = (y, g) => {
|
|
45
|
-
const [
|
|
45
|
+
const [w] = et(g?.componentId ?? rt());
|
|
46
46
|
ft({
|
|
47
47
|
stateKey: y,
|
|
48
48
|
options: g,
|
|
49
49
|
initialOptionsPart: u
|
|
50
50
|
});
|
|
51
|
-
const
|
|
51
|
+
const c = o.getState().cogsStateStore[y] || S[y], e = g?.modifyState ? g.modifyState(c) : c, [I, $] = jt(
|
|
52
52
|
e,
|
|
53
53
|
{
|
|
54
54
|
stateKey: y,
|
|
55
55
|
syncUpdate: g?.syncUpdate,
|
|
56
|
-
componentId:
|
|
56
|
+
componentId: w,
|
|
57
57
|
localStorage: g?.localStorage,
|
|
58
58
|
middleware: g?.middleware,
|
|
59
59
|
enabledSync: g?.enabledSync,
|
|
@@ -65,22 +65,22 @@ const zt = (t, i) => {
|
|
|
65
65
|
);
|
|
66
66
|
return $;
|
|
67
67
|
};
|
|
68
|
-
function
|
|
68
|
+
function E(y, g) {
|
|
69
69
|
ft({ stateKey: y, options: g, initialOptionsPart: u });
|
|
70
70
|
}
|
|
71
|
-
return { useCogsState: _, setCogsOptions:
|
|
71
|
+
return { useCogsState: _, setCogsOptions: E };
|
|
72
72
|
}, {
|
|
73
|
-
setUpdaterState:
|
|
74
|
-
setState:
|
|
75
|
-
getInitialOptions:
|
|
73
|
+
setUpdaterState: Q,
|
|
74
|
+
setState: R,
|
|
75
|
+
getInitialOptions: ot,
|
|
76
76
|
getKeyState: gt,
|
|
77
77
|
getValidationErrors: ht,
|
|
78
78
|
setStateLog: At,
|
|
79
|
-
updateInitialStateGlobal:
|
|
79
|
+
updateInitialStateGlobal: at,
|
|
80
80
|
addValidationError: Ct,
|
|
81
|
-
removeValidationError:
|
|
81
|
+
removeValidationError: U,
|
|
82
82
|
setServerSyncActions: Tt
|
|
83
|
-
} =
|
|
83
|
+
} = o.getState(), St = (t) => {
|
|
84
84
|
if (!t) return null;
|
|
85
85
|
try {
|
|
86
86
|
const i = window.localStorage.getItem(t);
|
|
@@ -100,15 +100,15 @@ const zt = (t, i) => {
|
|
|
100
100
|
const _ = {
|
|
101
101
|
state: t,
|
|
102
102
|
lastUpdated: Date.now(),
|
|
103
|
-
lastSyncedWithServer:
|
|
104
|
-
baseServerState:
|
|
105
|
-
},
|
|
106
|
-
window.localStorage.setItem(
|
|
103
|
+
lastSyncedWithServer: o.getState().serverSyncLog[i]?.[0]?.timeStamp,
|
|
104
|
+
baseServerState: o.getState().serverState[i]
|
|
105
|
+
}, E = `${S}-${i}-${u}`;
|
|
106
|
+
window.localStorage.setItem(E, JSON.stringify(_));
|
|
107
107
|
}
|
|
108
108
|
}, Ft = (t, i, f, S, u, _) => {
|
|
109
|
-
const
|
|
109
|
+
const E = {
|
|
110
110
|
initialState: i,
|
|
111
|
-
updaterState:
|
|
111
|
+
updaterState: X(
|
|
112
112
|
t,
|
|
113
113
|
S,
|
|
114
114
|
u,
|
|
@@ -116,22 +116,22 @@ const zt = (t, i) => {
|
|
|
116
116
|
),
|
|
117
117
|
state: f
|
|
118
118
|
};
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
H(() => {
|
|
120
|
+
at(t, E.initialState), Q(t, E.updaterState), R(t, E.state);
|
|
121
121
|
});
|
|
122
122
|
}, mt = (t) => {
|
|
123
|
-
const i =
|
|
123
|
+
const i = o.getState().stateComponents.get(t);
|
|
124
124
|
if (!i) return;
|
|
125
125
|
const f = /* @__PURE__ */ new Set();
|
|
126
126
|
i.components.forEach((S) => {
|
|
127
127
|
f.add(() => S.forceUpdate());
|
|
128
128
|
}), queueMicrotask(() => {
|
|
129
|
-
|
|
129
|
+
H(() => {
|
|
130
130
|
f.forEach((S) => S());
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
-
},
|
|
134
|
-
const f =
|
|
133
|
+
}, Bt = (t, i) => {
|
|
134
|
+
const f = o.getState().stateComponents.get(t);
|
|
135
135
|
if (f) {
|
|
136
136
|
const S = `${t}////${i}`, u = f.components.get(S);
|
|
137
137
|
u && u.forceUpdate();
|
|
@@ -143,150 +143,150 @@ function jt(t, {
|
|
|
143
143
|
localStorage: S,
|
|
144
144
|
formElements: u,
|
|
145
145
|
middleware: _,
|
|
146
|
-
reactiveDeps:
|
|
146
|
+
reactiveDeps: E,
|
|
147
147
|
reactiveType: y,
|
|
148
148
|
componentId: g,
|
|
149
|
-
initialState:
|
|
150
|
-
syncUpdate:
|
|
149
|
+
initialState: w,
|
|
150
|
+
syncUpdate: c,
|
|
151
151
|
dependencies: e
|
|
152
152
|
} = {}) {
|
|
153
|
-
const [
|
|
154
|
-
let
|
|
155
|
-
const [d] =
|
|
156
|
-
h.current =
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
...
|
|
160
|
-
[
|
|
153
|
+
const [I, $] = et({}), { sessionId: T } = $t();
|
|
154
|
+
let P = !i;
|
|
155
|
+
const [d] = et(i ?? rt()), O = o.getState().stateLog[d], s = Z(/* @__PURE__ */ new Set()), b = Z(g ?? rt()), h = Z(null);
|
|
156
|
+
h.current = ot(d), nt(() => {
|
|
157
|
+
if (c && c.stateKey === d && c.path?.[0]) {
|
|
158
|
+
R(d, (a) => ({
|
|
159
|
+
...a,
|
|
160
|
+
[c.path[0]]: c.newValue
|
|
161
161
|
}));
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
timeStamp:
|
|
165
|
-
userId:
|
|
162
|
+
const r = `${c.stateKey}:${c.path.join(".")}`;
|
|
163
|
+
o.getState().setSyncInfo(r, {
|
|
164
|
+
timeStamp: c.timeStamp,
|
|
165
|
+
userId: c.userId
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
}, [
|
|
168
|
+
}, [c]), nt(() => {
|
|
169
169
|
ut(d, {
|
|
170
|
-
initialState:
|
|
170
|
+
initialState: w
|
|
171
171
|
});
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
T + "-" + d + "-" +
|
|
172
|
+
const r = h.current;
|
|
173
|
+
let a = null;
|
|
174
|
+
r.log && console.log("newoptions", r);
|
|
175
|
+
const l = q(r.localStorage?.key) ? r.localStorage?.key(w) : r.localStorage?.key;
|
|
176
|
+
l && T && (a = St(
|
|
177
|
+
T + "-" + d + "-" + l
|
|
178
178
|
));
|
|
179
179
|
let m = null;
|
|
180
|
-
|
|
180
|
+
w && (m = w, a && a.lastUpdated > (a.lastSyncedWithServer || 0) && (m = a.state), Ft(
|
|
181
181
|
d,
|
|
182
|
-
|
|
182
|
+
w,
|
|
183
183
|
m,
|
|
184
184
|
D,
|
|
185
185
|
b.current,
|
|
186
186
|
T
|
|
187
187
|
), mt(d), $({}));
|
|
188
|
-
}, [
|
|
189
|
-
|
|
188
|
+
}, [w, ...e || []]), It(() => {
|
|
189
|
+
P && ut(d, {
|
|
190
190
|
serverSync: f,
|
|
191
191
|
formElements: u,
|
|
192
|
-
initialState:
|
|
192
|
+
initialState: w,
|
|
193
193
|
localStorage: S,
|
|
194
194
|
middleware: _
|
|
195
195
|
});
|
|
196
|
-
const
|
|
196
|
+
const r = `${d}////${b.current}`, a = o.getState().stateComponents.get(d) || {
|
|
197
197
|
components: /* @__PURE__ */ new Map()
|
|
198
198
|
};
|
|
199
|
-
return
|
|
199
|
+
return a.components.set(r, {
|
|
200
200
|
forceUpdate: () => $({}),
|
|
201
201
|
paths: /* @__PURE__ */ new Set(),
|
|
202
202
|
deps: [],
|
|
203
|
-
depsFunction:
|
|
203
|
+
depsFunction: E || void 0,
|
|
204
204
|
reactiveType: y ?? ["component", "deps"]
|
|
205
|
-
}),
|
|
206
|
-
const
|
|
207
|
-
|
|
205
|
+
}), o.getState().stateComponents.set(d, a), $({}), () => {
|
|
206
|
+
const l = `${d}////${b.current}`;
|
|
207
|
+
a && (a.components.delete(l), a.components.size === 0 && o.getState().stateComponents.delete(d));
|
|
208
208
|
};
|
|
209
209
|
}, []);
|
|
210
|
-
const D = (
|
|
211
|
-
if (Array.isArray(
|
|
212
|
-
const
|
|
213
|
-
s.current.add(
|
|
210
|
+
const D = (r, a, l, m) => {
|
|
211
|
+
if (Array.isArray(a)) {
|
|
212
|
+
const p = `${d}-${a.join(".")}`;
|
|
213
|
+
s.current.add(p);
|
|
214
214
|
}
|
|
215
|
-
|
|
216
|
-
const A = q(
|
|
215
|
+
R(d, (p) => {
|
|
216
|
+
const A = q(r) ? r(p) : r, F = `${d}-${a.join(".")}`;
|
|
217
217
|
if (F) {
|
|
218
|
-
let
|
|
219
|
-
if ((!v || v.size === 0) && (
|
|
220
|
-
const
|
|
218
|
+
let x = !1, v = o.getState().signalDomElements.get(F);
|
|
219
|
+
if ((!v || v.size === 0) && (l.updateType === "insert" || l.updateType === "cut")) {
|
|
220
|
+
const N = a.slice(0, -1), C = G(A, N);
|
|
221
221
|
if (Array.isArray(C)) {
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
v =
|
|
222
|
+
x = !0;
|
|
223
|
+
const V = `${d}-${N.join(".")}`;
|
|
224
|
+
v = o.getState().signalDomElements.get(V);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
if (v) {
|
|
228
|
-
const
|
|
229
|
-
v.forEach(({ parentId: C, position:
|
|
228
|
+
const N = x ? G(A, a.slice(0, -1)) : G(A, a);
|
|
229
|
+
v.forEach(({ parentId: C, position: V, effect: L }) => {
|
|
230
230
|
const j = document.querySelector(
|
|
231
231
|
`[data-parent-id="${C}"]`
|
|
232
232
|
);
|
|
233
233
|
if (j) {
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
const vt = L ? new Function("state", `return (${L})(state)`)(
|
|
237
|
-
|
|
234
|
+
const ct = Array.from(j.childNodes);
|
|
235
|
+
if (ct[V]) {
|
|
236
|
+
const vt = L ? new Function("state", `return (${L})(state)`)(N) : N;
|
|
237
|
+
ct[V].textContent = String(vt);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
|
|
244
|
-
(m || h.current?.validationKey) + "." +
|
|
243
|
+
l.updateType === "update" && (m || h.current?.validationKey) && a && U(
|
|
244
|
+
(m || h.current?.validationKey) + "." + a.join(".")
|
|
245
245
|
);
|
|
246
|
-
const k =
|
|
247
|
-
|
|
246
|
+
const k = a.slice(0, a.length - 1);
|
|
247
|
+
l.updateType === "cut" && h.current?.validationKey && U(
|
|
248
248
|
h.current?.validationKey + "." + k.join(".")
|
|
249
|
-
),
|
|
249
|
+
), l.updateType === "insert" && h.current?.validationKey && ht(
|
|
250
250
|
h.current?.validationKey + "." + k.join(".")
|
|
251
|
-
).filter(([v,
|
|
251
|
+
).filter(([v, N]) => {
|
|
252
252
|
let C = v?.split(".").length;
|
|
253
253
|
if (v == k.join(".") && C == k.length - 1) {
|
|
254
|
-
let
|
|
255
|
-
|
|
254
|
+
let V = v + "." + k;
|
|
255
|
+
U(v), Ct(V, N);
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
-
const M = G(
|
|
259
|
-
if (
|
|
260
|
-
for (const [
|
|
261
|
-
let
|
|
258
|
+
const M = G(p, a), z = G(A, a), yt = l.updateType === "update" ? a.join(".") : [...a].slice(0, -1).join("."), it = o.getState().stateComponents.get(d);
|
|
259
|
+
if (it)
|
|
260
|
+
for (const [x, v] of it.components.entries()) {
|
|
261
|
+
let N = !1;
|
|
262
262
|
const C = Array.isArray(v.reactiveType) ? v.reactiveType : [v.reactiveType || "component"];
|
|
263
263
|
if (!C.includes("none")) {
|
|
264
264
|
if (C.includes("all")) {
|
|
265
265
|
v.forceUpdate();
|
|
266
266
|
continue;
|
|
267
267
|
}
|
|
268
|
-
if (C.includes("component") && v.paths && (v.paths.has(yt) || v.paths.has("")) && (
|
|
269
|
-
const
|
|
270
|
-
typeof
|
|
268
|
+
if (C.includes("component") && v.paths && (v.paths.has(yt) || v.paths.has("")) && (N = !0), !N && C.includes("deps") && v.depsFunction) {
|
|
269
|
+
const V = v.depsFunction(A);
|
|
270
|
+
typeof V == "boolean" ? V && (N = !0) : W(v.deps, V) || (v.deps = V, N = !0);
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
N && v.forceUpdate();
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
const
|
|
275
|
+
const st = {
|
|
276
276
|
timeStamp: Date.now(),
|
|
277
277
|
stateKey: d,
|
|
278
|
-
path:
|
|
279
|
-
updateType:
|
|
278
|
+
path: a,
|
|
279
|
+
updateType: l.updateType,
|
|
280
280
|
status: "new",
|
|
281
281
|
oldValue: M,
|
|
282
282
|
newValue: z
|
|
283
283
|
};
|
|
284
|
-
if (At(d, (
|
|
285
|
-
const
|
|
286
|
-
const L = `${
|
|
287
|
-
return j ? (j.timeStamp = Math.max(j.timeStamp,
|
|
284
|
+
if (At(d, (x) => {
|
|
285
|
+
const N = [...x ?? [], st].reduce((C, V) => {
|
|
286
|
+
const L = `${V.stateKey}:${JSON.stringify(V.path)}`, j = C.get(L);
|
|
287
|
+
return j ? (j.timeStamp = Math.max(j.timeStamp, V.timeStamp), j.newValue = V.newValue, j.oldValue = j.oldValue ?? V.oldValue, j.updateType = V.updateType) : C.set(L, { ...V }), C;
|
|
288
288
|
}, /* @__PURE__ */ new Map());
|
|
289
|
-
return Array.from(
|
|
289
|
+
return Array.from(N.values());
|
|
290
290
|
}), kt(
|
|
291
291
|
A,
|
|
292
292
|
d,
|
|
@@ -294,12 +294,12 @@ function jt(t, {
|
|
|
294
294
|
T
|
|
295
295
|
), _ && _({
|
|
296
296
|
updateLog: O,
|
|
297
|
-
update:
|
|
297
|
+
update: st
|
|
298
298
|
}), h.current?.serverSync) {
|
|
299
|
-
const
|
|
299
|
+
const x = o.getState().serverState[d], v = h.current?.serverSync;
|
|
300
300
|
Tt(d, {
|
|
301
301
|
syncKey: typeof v.syncKey == "string" ? v.syncKey : v.syncKey({ state: A }),
|
|
302
|
-
rollBackState:
|
|
302
|
+
rollBackState: x,
|
|
303
303
|
actionTimeStamp: Date.now() + (v.debounce ?? 3e3),
|
|
304
304
|
status: "waiting"
|
|
305
305
|
});
|
|
@@ -307,16 +307,16 @@ function jt(t, {
|
|
|
307
307
|
return A;
|
|
308
308
|
});
|
|
309
309
|
};
|
|
310
|
-
|
|
310
|
+
o.getState().updaterState[d] || (Q(
|
|
311
311
|
d,
|
|
312
|
-
|
|
312
|
+
X(
|
|
313
313
|
d,
|
|
314
314
|
D,
|
|
315
315
|
b.current,
|
|
316
316
|
T
|
|
317
317
|
)
|
|
318
|
-
),
|
|
319
|
-
const n = Et(() =>
|
|
318
|
+
), o.getState().cogsStateStore[d] || R(d, t), o.getState().initialStateGlobal[d] || at(d, t));
|
|
319
|
+
const n = Et(() => X(
|
|
320
320
|
d,
|
|
321
321
|
D,
|
|
322
322
|
b.current,
|
|
@@ -324,209 +324,219 @@ function jt(t, {
|
|
|
324
324
|
), [d]);
|
|
325
325
|
return [gt(d), n];
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function X(t, i, f, S) {
|
|
328
328
|
const u = /* @__PURE__ */ new Map();
|
|
329
329
|
let _ = 0;
|
|
330
|
-
const
|
|
331
|
-
const e =
|
|
332
|
-
for (const [
|
|
333
|
-
(
|
|
330
|
+
const E = (c) => {
|
|
331
|
+
const e = c.join(".");
|
|
332
|
+
for (const [I] of u)
|
|
333
|
+
(I === e || I.startsWith(e + ".")) && u.delete(I);
|
|
334
334
|
_++;
|
|
335
335
|
}, y = /* @__PURE__ */ new Map(), g = {
|
|
336
|
-
removeValidation: (
|
|
337
|
-
|
|
336
|
+
removeValidation: (c) => {
|
|
337
|
+
c?.validationKey && U(c.validationKey);
|
|
338
338
|
},
|
|
339
|
-
revertToInitialState: (
|
|
340
|
-
const e =
|
|
341
|
-
e?.key &&
|
|
342
|
-
const
|
|
339
|
+
revertToInitialState: (c) => {
|
|
340
|
+
const e = o.getState().getInitialOptions(t)?.validation;
|
|
341
|
+
e?.key && U(e?.key), c?.validationKey && U(c.validationKey);
|
|
342
|
+
const I = o.getState().initialStateGlobal[t];
|
|
343
343
|
u.clear(), _++;
|
|
344
|
-
const $ =
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
const T =
|
|
344
|
+
const $ = w(I, []);
|
|
345
|
+
return H(() => {
|
|
346
|
+
Q(t, $), R(t, I);
|
|
347
|
+
const T = o.getState().stateComponents.get(t);
|
|
348
348
|
T && T.components.forEach((O) => {
|
|
349
349
|
O.forceUpdate();
|
|
350
350
|
});
|
|
351
|
-
const
|
|
351
|
+
const P = ot(t), d = q(P?.localStorage?.key) ? P?.localStorage?.key(I) : P?.localStorage?.key;
|
|
352
352
|
d && localStorage.removeItem(d);
|
|
353
|
-
});
|
|
353
|
+
}), I;
|
|
354
354
|
},
|
|
355
|
-
updateInitialState: (
|
|
355
|
+
updateInitialState: (c) => {
|
|
356
356
|
u.clear(), _++;
|
|
357
|
-
const e =
|
|
357
|
+
const e = X(
|
|
358
358
|
t,
|
|
359
359
|
i,
|
|
360
360
|
f,
|
|
361
361
|
S
|
|
362
362
|
);
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
363
|
+
return H(() => {
|
|
364
|
+
at(t, c), Q(t, e), R(t, c);
|
|
365
|
+
const I = o.getState().stateComponents.get(t);
|
|
366
|
+
I && I.components.forEach(($) => {
|
|
367
367
|
$.forceUpdate();
|
|
368
368
|
}), localStorage.removeItem(t);
|
|
369
369
|
}), {
|
|
370
|
-
fetchId: (
|
|
370
|
+
fetchId: (I) => e.get()[I]
|
|
371
371
|
};
|
|
372
372
|
},
|
|
373
|
-
_initialState:
|
|
374
|
-
_serverState:
|
|
375
|
-
_isLoading:
|
|
373
|
+
_initialState: o.getState().initialStateGlobal[t],
|
|
374
|
+
_serverState: o.getState().serverState[t],
|
|
375
|
+
_isLoading: o.getState().isLoadingGlobal[t],
|
|
376
376
|
_isServerSynced: () => {
|
|
377
|
-
const
|
|
378
|
-
return !!(
|
|
377
|
+
const c = o.getState().serverState[t];
|
|
378
|
+
return !!(c && W(c, gt(t)));
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
|
-
function
|
|
381
|
+
function w(c, e = [], I) {
|
|
382
382
|
const $ = e.map(String).join(".");
|
|
383
383
|
u.get($);
|
|
384
384
|
const T = function() {
|
|
385
|
-
return
|
|
385
|
+
return o().getNestedState(t, e);
|
|
386
386
|
};
|
|
387
387
|
Object.keys(g).forEach((O) => {
|
|
388
388
|
T[O] = g[O];
|
|
389
389
|
});
|
|
390
|
-
const
|
|
390
|
+
const P = {
|
|
391
391
|
apply(O, s, b) {
|
|
392
|
-
return
|
|
392
|
+
return o().getNestedState(t, e);
|
|
393
393
|
},
|
|
394
394
|
get(O, s) {
|
|
395
395
|
if (s !== "then" && !s.startsWith("$") && s !== "stateMapNoRender") {
|
|
396
|
-
const n = e.join("."),
|
|
397
|
-
if (
|
|
398
|
-
const
|
|
399
|
-
|
|
396
|
+
const n = e.join("."), r = `${t}////${f}`, a = o.getState().stateComponents.get(t);
|
|
397
|
+
if (a) {
|
|
398
|
+
const l = a.components.get(r);
|
|
399
|
+
l && (e.length > 0 || s === "get") && l.paths.add(n);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
if (s === "showValidationErrors")
|
|
403
403
|
return () => {
|
|
404
|
-
const n =
|
|
404
|
+
const n = o.getState().getInitialOptions(t)?.validation;
|
|
405
405
|
if (!n?.key)
|
|
406
406
|
throw new Error("Validation key not found");
|
|
407
|
-
return
|
|
407
|
+
return o.getState().getValidationErrors(n.key + "." + e.join("."));
|
|
408
408
|
};
|
|
409
|
-
if (Array.isArray(
|
|
409
|
+
if (Array.isArray(c)) {
|
|
410
410
|
if (s === "getSelected")
|
|
411
411
|
return () => {
|
|
412
412
|
const n = y.get(e.join("."));
|
|
413
413
|
if (n !== void 0)
|
|
414
|
-
return
|
|
415
|
-
|
|
414
|
+
return w(
|
|
415
|
+
c[n],
|
|
416
416
|
[...e, n.toString()],
|
|
417
|
-
|
|
417
|
+
I
|
|
418
418
|
);
|
|
419
419
|
};
|
|
420
420
|
if (s === "stateMap" || s === "stateMapNoRender")
|
|
421
421
|
return (n) => {
|
|
422
|
-
const
|
|
423
|
-
(
|
|
424
|
-
),
|
|
425
|
-
return s !== "stateMapNoRender" && (u.clear(), _++),
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
[...e,
|
|
429
|
-
|
|
422
|
+
const r = I?.filtered?.some(
|
|
423
|
+
(l) => l.join(".") === e.join(".")
|
|
424
|
+
), a = r ? c : o.getState().getNestedState(t, e);
|
|
425
|
+
return s !== "stateMapNoRender" && (u.clear(), _++), a.map((l, m) => {
|
|
426
|
+
const p = r && l.__origIndex ? l.__origIndex : m, A = w(
|
|
427
|
+
l,
|
|
428
|
+
[...e, p.toString()],
|
|
429
|
+
I
|
|
430
430
|
);
|
|
431
431
|
return n(
|
|
432
|
-
|
|
432
|
+
l,
|
|
433
433
|
A,
|
|
434
434
|
m,
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
c,
|
|
436
|
+
w(c, e, I)
|
|
437
437
|
);
|
|
438
438
|
});
|
|
439
439
|
};
|
|
440
440
|
if (s === "$stateMap")
|
|
441
|
-
return (n) =>
|
|
441
|
+
return (n) => Y(bt, {
|
|
442
442
|
proxy: {
|
|
443
443
|
_stateKey: t,
|
|
444
444
|
_path: e,
|
|
445
445
|
_mapFn: n
|
|
446
446
|
// Pass the actual function, not string
|
|
447
447
|
},
|
|
448
|
-
rebuildStateShape:
|
|
448
|
+
rebuildStateShape: w
|
|
449
449
|
});
|
|
450
450
|
if (s === "stateFlattenOn")
|
|
451
451
|
return (n) => {
|
|
452
|
-
const
|
|
452
|
+
const a = I?.filtered?.some(
|
|
453
453
|
(m) => m.join(".") === e.join(".")
|
|
454
|
-
) ?
|
|
454
|
+
) ? c : o.getState().getNestedState(t, e);
|
|
455
455
|
u.clear(), _++;
|
|
456
|
-
const
|
|
457
|
-
(m,
|
|
456
|
+
const l = a.flatMap(
|
|
457
|
+
(m, p) => m[n] ?? []
|
|
458
458
|
);
|
|
459
|
-
return
|
|
460
|
-
|
|
459
|
+
return w(
|
|
460
|
+
l,
|
|
461
461
|
[...e, "[*]", n],
|
|
462
|
-
|
|
462
|
+
I
|
|
463
463
|
);
|
|
464
464
|
};
|
|
465
465
|
if (s === "findWith")
|
|
466
|
-
return (n,
|
|
467
|
-
const
|
|
468
|
-
(
|
|
466
|
+
return (n, r) => {
|
|
467
|
+
const a = c.findIndex(
|
|
468
|
+
(p) => p[n] === r
|
|
469
469
|
);
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
return u.clear(), _++, u.clear(), _++,
|
|
470
|
+
if (a === -1) return;
|
|
471
|
+
const l = c[a], m = [...e, a.toString()];
|
|
472
|
+
return u.clear(), _++, u.clear(), _++, w(l, m);
|
|
473
473
|
};
|
|
474
474
|
if (s === "index")
|
|
475
475
|
return (n) => {
|
|
476
|
-
const
|
|
477
|
-
return
|
|
476
|
+
const r = c[n];
|
|
477
|
+
return w(r, [...e, n.toString()]);
|
|
478
478
|
};
|
|
479
479
|
if (s === "insert")
|
|
480
|
-
return (n) => (
|
|
481
|
-
|
|
480
|
+
return (n) => (E(e), K(i, n, e, t), w(
|
|
481
|
+
o.getState().cogsStateStore[t],
|
|
482
482
|
[]
|
|
483
483
|
));
|
|
484
484
|
if (s === "uniqueInsert")
|
|
485
|
-
return (n,
|
|
486
|
-
const
|
|
487
|
-
let
|
|
488
|
-
if (!
|
|
489
|
-
if (
|
|
490
|
-
const M =
|
|
485
|
+
return (n, r, a) => {
|
|
486
|
+
const l = o.getState().getNestedState(t, e), m = q(n) ? n(l) : n;
|
|
487
|
+
let p = null;
|
|
488
|
+
if (!l.some((F) => {
|
|
489
|
+
if (r) {
|
|
490
|
+
const M = r.every(
|
|
491
491
|
(z) => W(F[z], m[z])
|
|
492
492
|
);
|
|
493
|
-
return M && (
|
|
493
|
+
return M && (p = F), M;
|
|
494
494
|
}
|
|
495
495
|
const k = W(F, m);
|
|
496
|
-
return k && (
|
|
496
|
+
return k && (p = F), k;
|
|
497
497
|
}))
|
|
498
|
-
|
|
499
|
-
else if (
|
|
500
|
-
const F =
|
|
501
|
-
(M) => W(M,
|
|
498
|
+
E(e), K(i, m, e, t);
|
|
499
|
+
else if (a && p) {
|
|
500
|
+
const F = a(p), k = l.map(
|
|
501
|
+
(M) => W(M, p) ? F : M
|
|
502
502
|
);
|
|
503
|
-
|
|
503
|
+
E(e), B(i, k, e);
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
506
|
if (s === "cut")
|
|
507
|
-
return (n,
|
|
508
|
-
|
|
507
|
+
return (n, r) => {
|
|
508
|
+
r?.waitForSync || (E(e), J(i, e, t, n));
|
|
509
|
+
};
|
|
510
|
+
if (s === "cutByValue")
|
|
511
|
+
return (n) => {
|
|
512
|
+
for (let r = 0; r < c.length; r++)
|
|
513
|
+
c[r] === n && J(i, e, t, r);
|
|
514
|
+
};
|
|
515
|
+
if (s === "toggleByValue")
|
|
516
|
+
return (n) => {
|
|
517
|
+
const r = c.findIndex((a) => a === n);
|
|
518
|
+
r > -1 ? J(i, e, t, r) : K(i, n, e, t);
|
|
509
519
|
};
|
|
510
520
|
if (s === "stateFilter")
|
|
511
521
|
return (n) => {
|
|
512
|
-
const
|
|
522
|
+
const r = c.map((m, p) => ({
|
|
513
523
|
...m,
|
|
514
|
-
__origIndex:
|
|
515
|
-
})),
|
|
516
|
-
for (let m = 0; m <
|
|
517
|
-
n(
|
|
518
|
-
return u.clear(), _++,
|
|
519
|
-
filtered: [...
|
|
520
|
-
validIndices:
|
|
524
|
+
__origIndex: p.toString()
|
|
525
|
+
})), a = [], l = [];
|
|
526
|
+
for (let m = 0; m < r.length; m++)
|
|
527
|
+
n(r[m], m) && (a.push(m), l.push(r[m]));
|
|
528
|
+
return u.clear(), _++, w(l, e, {
|
|
529
|
+
filtered: [...I?.filtered || [], e],
|
|
530
|
+
validIndices: a
|
|
521
531
|
// Always pass validIndices, even if empty
|
|
522
532
|
});
|
|
523
533
|
};
|
|
524
534
|
}
|
|
525
535
|
const b = e[e.length - 1];
|
|
526
536
|
if (!isNaN(Number(b))) {
|
|
527
|
-
const n = e.slice(0, -1),
|
|
528
|
-
if (Array.isArray(
|
|
529
|
-
return () =>
|
|
537
|
+
const n = e.slice(0, -1), r = o.getState().getNestedState(t, n);
|
|
538
|
+
if (Array.isArray(r) && s === "cut")
|
|
539
|
+
return () => J(
|
|
530
540
|
i,
|
|
531
541
|
n,
|
|
532
542
|
t,
|
|
@@ -534,76 +544,76 @@ function Q(t, i, f, S) {
|
|
|
534
544
|
);
|
|
535
545
|
}
|
|
536
546
|
if (s === "get")
|
|
537
|
-
return () =>
|
|
547
|
+
return () => o.getState().getNestedState(t, e);
|
|
538
548
|
if (s === "$derive")
|
|
539
|
-
return (n) =>
|
|
549
|
+
return (n) => tt({
|
|
540
550
|
_stateKey: t,
|
|
541
551
|
_path: e,
|
|
542
552
|
_effect: n.toString()
|
|
543
553
|
});
|
|
544
554
|
if (s === "$derive")
|
|
545
|
-
return (n) =>
|
|
555
|
+
return (n) => tt({
|
|
546
556
|
_stateKey: t,
|
|
547
557
|
_path: e,
|
|
548
558
|
_effect: n.toString()
|
|
549
559
|
});
|
|
550
560
|
if (s === "$get")
|
|
551
|
-
return () =>
|
|
561
|
+
return () => tt({
|
|
552
562
|
_stateKey: t,
|
|
553
563
|
_path: e
|
|
554
564
|
});
|
|
555
565
|
if (s === "lastSynced") {
|
|
556
566
|
const n = `${t}:${e.join(".")}`;
|
|
557
|
-
return
|
|
567
|
+
return o.getState().getSyncInfo(n);
|
|
558
568
|
}
|
|
559
569
|
if (s === "_selected") {
|
|
560
|
-
const n = e.slice(0, -1),
|
|
561
|
-
return Array.isArray(
|
|
570
|
+
const n = e.slice(0, -1), r = n.join("."), a = o.getState().getNestedState(t, n);
|
|
571
|
+
return Array.isArray(a) ? Number(e[e.length - 1]) === y.get(r) : void 0;
|
|
562
572
|
}
|
|
563
573
|
if (s == "getLocalStorage")
|
|
564
574
|
return (n) => St(S + "-" + t + "-" + n);
|
|
565
575
|
if (s === "setSelected")
|
|
566
576
|
return (n) => {
|
|
567
|
-
const
|
|
568
|
-
n ? y.set(
|
|
569
|
-
const m =
|
|
570
|
-
|
|
577
|
+
const r = e.slice(0, -1), a = Number(e[e.length - 1]), l = r.join(".");
|
|
578
|
+
n ? y.set(l, a) : y.delete(l);
|
|
579
|
+
const m = o.getState().getNestedState(t, [...r]);
|
|
580
|
+
B(i, m, r), E(r);
|
|
571
581
|
};
|
|
572
582
|
if (e.length == 0) {
|
|
573
583
|
if (s === "validateZodSchema")
|
|
574
584
|
return () => {
|
|
575
|
-
const n =
|
|
585
|
+
const n = o.getState().getInitialOptions(t)?.validation, r = o.getState().addValidationError;
|
|
576
586
|
if (!n?.zodSchema)
|
|
577
587
|
throw new Error("Zod schema not found");
|
|
578
588
|
if (!n?.key)
|
|
579
589
|
throw new Error("Validation key not found");
|
|
580
|
-
|
|
581
|
-
const
|
|
590
|
+
U(n.key);
|
|
591
|
+
const a = o.getState().cogsStateStore[t];
|
|
582
592
|
try {
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
|
|
593
|
+
const l = o.getState().getValidationErrors(n.key);
|
|
594
|
+
l && l.length > 0 && l.forEach(([p]) => {
|
|
595
|
+
p && p.startsWith(n.key) && U(p);
|
|
586
596
|
});
|
|
587
|
-
const m = n.zodSchema.safeParse(
|
|
597
|
+
const m = n.zodSchema.safeParse(a);
|
|
588
598
|
return m.success ? !0 : (m.error.errors.forEach((A) => {
|
|
589
599
|
const F = A.path, k = A.message, M = [n.key, ...F].join(".");
|
|
590
|
-
|
|
600
|
+
r(M, k);
|
|
591
601
|
}), mt(t), !1);
|
|
592
|
-
} catch (
|
|
593
|
-
return console.error("Zod schema validation failed",
|
|
602
|
+
} catch (l) {
|
|
603
|
+
return console.error("Zod schema validation failed", l), !1;
|
|
594
604
|
}
|
|
595
605
|
};
|
|
596
606
|
if (s === "_componentId") return f;
|
|
597
607
|
if (s === "getComponents")
|
|
598
|
-
return () =>
|
|
608
|
+
return () => o().stateComponents.get(t);
|
|
599
609
|
if (s === "getAllFormRefs")
|
|
600
610
|
return () => dt.getState().getFormRefsByStateKey(t);
|
|
601
611
|
if (s === "_initialState")
|
|
602
|
-
return
|
|
612
|
+
return o.getState().initialStateGlobal[t];
|
|
603
613
|
if (s === "_serverState")
|
|
604
|
-
return
|
|
614
|
+
return o.getState().serverState[t];
|
|
605
615
|
if (s === "_isLoading")
|
|
606
|
-
return
|
|
616
|
+
return o.getState().isLoadingGlobal[t];
|
|
607
617
|
if (s === "revertToInitialState")
|
|
608
618
|
return g.revertToInitialState;
|
|
609
619
|
if (s === "updateInitialState") return g.updateInitialState;
|
|
@@ -614,15 +624,15 @@ function Q(t, i, f, S) {
|
|
|
614
624
|
if (s === "validationWrapper")
|
|
615
625
|
return ({
|
|
616
626
|
children: n,
|
|
617
|
-
hideMessage:
|
|
618
|
-
}) => /* @__PURE__ */
|
|
619
|
-
|
|
627
|
+
hideMessage: r
|
|
628
|
+
}) => /* @__PURE__ */ lt(
|
|
629
|
+
Vt,
|
|
620
630
|
{
|
|
621
|
-
formOpts:
|
|
631
|
+
formOpts: r ? { validation: { message: "" } } : void 0,
|
|
622
632
|
path: e,
|
|
623
|
-
validationKey:
|
|
633
|
+
validationKey: o.getState().getInitialOptions(t)?.validation?.key || "",
|
|
624
634
|
stateKey: t,
|
|
625
|
-
validIndices:
|
|
635
|
+
validIndices: I?.validIndices,
|
|
626
636
|
children: n
|
|
627
637
|
}
|
|
628
638
|
);
|
|
@@ -630,102 +640,102 @@ function Q(t, i, f, S) {
|
|
|
630
640
|
if (s === "_path") return e;
|
|
631
641
|
if (s === "_isServerSynced") return g._isServerSynced;
|
|
632
642
|
if (s === "update")
|
|
633
|
-
return (n,
|
|
634
|
-
if (
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
},
|
|
643
|
+
return (n, r) => {
|
|
644
|
+
if (r?.debounce)
|
|
645
|
+
pt(() => {
|
|
646
|
+
B(i, n, e, "");
|
|
647
|
+
const a = o.getState().getNestedState(t, e);
|
|
648
|
+
r?.afterUpdate && r.afterUpdate(a);
|
|
649
|
+
}, r.debounce);
|
|
640
650
|
else {
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
|
|
651
|
+
B(i, n, e, "");
|
|
652
|
+
const a = o.getState().getNestedState(t, e);
|
|
653
|
+
r?.afterUpdate && r.afterUpdate(a);
|
|
644
654
|
}
|
|
645
|
-
|
|
655
|
+
E(e);
|
|
646
656
|
};
|
|
647
657
|
if (s === "formElement")
|
|
648
|
-
return (n,
|
|
649
|
-
|
|
658
|
+
return (n, r) => /* @__PURE__ */ lt(
|
|
659
|
+
Nt,
|
|
650
660
|
{
|
|
651
661
|
setState: i,
|
|
652
662
|
stateKey: t,
|
|
653
663
|
path: e,
|
|
654
664
|
child: n,
|
|
655
|
-
formOpts:
|
|
665
|
+
formOpts: r
|
|
656
666
|
}
|
|
657
667
|
);
|
|
658
|
-
const h = [...e, s], D =
|
|
659
|
-
return
|
|
668
|
+
const h = [...e, s], D = o.getState().getNestedState(t, h);
|
|
669
|
+
return w(D, h, I);
|
|
660
670
|
}
|
|
661
|
-
}, d = new Proxy(T,
|
|
671
|
+
}, d = new Proxy(T, P);
|
|
662
672
|
return u.set($, {
|
|
663
673
|
proxy: d,
|
|
664
674
|
stateVersion: _
|
|
665
675
|
}), d;
|
|
666
676
|
}
|
|
667
|
-
return
|
|
668
|
-
|
|
677
|
+
return w(
|
|
678
|
+
o.getState().getNestedState(t, [])
|
|
669
679
|
);
|
|
670
680
|
}
|
|
671
|
-
function
|
|
672
|
-
return
|
|
681
|
+
function tt(t) {
|
|
682
|
+
return Y(Mt, { proxy: t });
|
|
673
683
|
}
|
|
674
684
|
function bt({
|
|
675
685
|
proxy: t,
|
|
676
686
|
rebuildStateShape: i
|
|
677
687
|
}) {
|
|
678
|
-
const f =
|
|
688
|
+
const f = o().getNestedState(t._stateKey, t._path);
|
|
679
689
|
return Array.isArray(f) ? i(
|
|
680
690
|
f,
|
|
681
691
|
t._path
|
|
682
692
|
).stateMapNoRender(
|
|
683
|
-
(u, _,
|
|
693
|
+
(u, _, E, y, g) => t._mapFn(u, _, E, y, g)
|
|
684
694
|
) : null;
|
|
685
695
|
}
|
|
686
696
|
function Mt({
|
|
687
697
|
proxy: t
|
|
688
698
|
}) {
|
|
689
|
-
const i =
|
|
690
|
-
return
|
|
699
|
+
const i = Z(null), f = `${t._stateKey}-${t._path.join(".")}`;
|
|
700
|
+
return nt(() => {
|
|
691
701
|
const S = i.current;
|
|
692
702
|
if (!S || !S.parentElement) return;
|
|
693
|
-
const u = S.parentElement,
|
|
703
|
+
const u = S.parentElement, E = Array.from(u.childNodes).indexOf(S);
|
|
694
704
|
let y = u.getAttribute("data-parent-id");
|
|
695
705
|
y || (y = `parent-${crypto.randomUUID()}`, u.setAttribute("data-parent-id", y));
|
|
696
|
-
const
|
|
706
|
+
const w = {
|
|
697
707
|
instanceId: `instance-${crypto.randomUUID()}`,
|
|
698
708
|
parentId: y,
|
|
699
|
-
position:
|
|
709
|
+
position: E,
|
|
700
710
|
effect: t._effect
|
|
701
711
|
};
|
|
702
|
-
|
|
703
|
-
const
|
|
712
|
+
o.getState().addSignalElement(f, w);
|
|
713
|
+
const c = o.getState().getNestedState(t._stateKey, t._path);
|
|
704
714
|
let e;
|
|
705
715
|
if (t._effect)
|
|
706
716
|
try {
|
|
707
717
|
e = new Function(
|
|
708
718
|
"state",
|
|
709
719
|
`return (${t._effect})(state)`
|
|
710
|
-
)(
|
|
720
|
+
)(c);
|
|
711
721
|
} catch ($) {
|
|
712
|
-
console.error("Error evaluating effect function during mount:", $), e =
|
|
722
|
+
console.error("Error evaluating effect function during mount:", $), e = c;
|
|
713
723
|
}
|
|
714
724
|
else
|
|
715
|
-
e =
|
|
725
|
+
e = c;
|
|
716
726
|
e !== null && typeof e == "object" && (e = JSON.stringify(e));
|
|
717
|
-
const
|
|
718
|
-
S.replaceWith(
|
|
719
|
-
}, [t._stateKey, t._path.join("."), t._effect]),
|
|
727
|
+
const I = document.createTextNode(String(e));
|
|
728
|
+
S.replaceWith(I);
|
|
729
|
+
}, [t._stateKey, t._path.join("."), t._effect]), Y("span", {
|
|
720
730
|
ref: i,
|
|
721
731
|
style: { display: "none" },
|
|
722
732
|
"data-signal-id": f
|
|
723
733
|
});
|
|
724
734
|
}
|
|
725
|
-
function
|
|
735
|
+
function Jt(t) {
|
|
726
736
|
const i = _t(
|
|
727
737
|
(f) => {
|
|
728
|
-
const S =
|
|
738
|
+
const S = o.getState().stateComponents.get(t._stateKey) || {
|
|
729
739
|
components: /* @__PURE__ */ new Map()
|
|
730
740
|
};
|
|
731
741
|
return S.components.set(t._stateKey, {
|
|
@@ -733,16 +743,16 @@ function Bt(t) {
|
|
|
733
743
|
paths: /* @__PURE__ */ new Set([t._path.join(".")])
|
|
734
744
|
}), () => S.components.delete(t._stateKey);
|
|
735
745
|
},
|
|
736
|
-
() =>
|
|
746
|
+
() => o.getState().getNestedState(t._stateKey, t._path)
|
|
737
747
|
);
|
|
738
|
-
return
|
|
748
|
+
return Y("text", {}, String(i));
|
|
739
749
|
}
|
|
740
750
|
export {
|
|
741
|
-
|
|
742
|
-
|
|
751
|
+
tt as $cogsSignal,
|
|
752
|
+
Jt as $cogsSignalStore,
|
|
743
753
|
qt as addStateOptions,
|
|
744
754
|
zt as createCogsState,
|
|
745
|
-
|
|
755
|
+
Bt as notifyComponent,
|
|
746
756
|
jt as useCogsStateFn
|
|
747
757
|
};
|
|
748
758
|
//# sourceMappingURL=CogsState.jsx.map
|