cogsbox-state 0.5.128 → 0.5.129
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.jsx +273 -262
- package/dist/CogsState.jsx.map +1 -1
- package/package.json +1 -1
package/dist/CogsState.jsx
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { transformStateFunc as
|
|
5
|
-
import { pushFunc as
|
|
2
|
+
import { jsx as ue } from "react/jsx-runtime";
|
|
3
|
+
import { useState as ae, useRef as Y, useEffect as oe, useLayoutEffect as he, useMemo as we, createElement as K, useSyncExternalStore as Ne, startTransition as $e } from "react";
|
|
4
|
+
import { transformStateFunc as Ae, isFunction as q, getDifferences as ge, getNestedValue as W, isDeepEqual as G, debounce as Te } from "./utility.js";
|
|
5
|
+
import { pushFunc as ne, updateFn as Z, cutFunc as H, ValidationWrapper as pe, FormControlComponent as ke } from "./Functions.jsx";
|
|
6
6
|
import "zod";
|
|
7
|
-
import { getGlobalStore as r, formRefStore as
|
|
8
|
-
import { useCogsConfig as
|
|
9
|
-
import
|
|
10
|
-
function
|
|
7
|
+
import { getGlobalStore as r, formRefStore as fe } from "./store.js";
|
|
8
|
+
import { useCogsConfig as Ce } from "./CogsStateClient.jsx";
|
|
9
|
+
import ie from "./node_modules/uuid/dist/esm-browser/v4.js";
|
|
10
|
+
function Se(e, i) {
|
|
11
11
|
const v = r.getState().getInitialOptions, S = r.getState().setInitialStateOptions, d = v(e) || {};
|
|
12
12
|
S(e, {
|
|
13
13
|
...d,
|
|
14
14
|
...i
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function me({
|
|
18
18
|
stateKey: e,
|
|
19
19
|
options: i,
|
|
20
20
|
initialOptionsPart: v
|
|
21
21
|
}) {
|
|
22
|
-
const S =
|
|
22
|
+
const S = J(e) || {}, d = v[e] || {}, E = r.getState().setInitialStateOptions, I = { ...d, ...S };
|
|
23
23
|
let m = !1;
|
|
24
24
|
if (i)
|
|
25
25
|
for (const c in i)
|
|
26
|
-
|
|
27
|
-
m && E(e,
|
|
26
|
+
I.hasOwnProperty(c) ? (c == "localStorage" && i[c] && I[c].key !== i[c]?.key && (m = !0, I[c] = i[c]), c == "initialState" && i[c] && I[c] !== i[c] && (m = !0, I[c] = i[c])) : (m = !0, I[c] = i[c]);
|
|
27
|
+
m && E(e, I);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Ze(e, { formElements: i, validation: v }) {
|
|
30
30
|
return { initialState: e, formElements: i, validation: v };
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const He = (e, i) => {
|
|
33
33
|
let v = e;
|
|
34
|
-
const [S, d] =
|
|
34
|
+
const [S, d] = Ae(v);
|
|
35
35
|
(Object.keys(d).length > 0 || i && Object.keys(i).length > 0) && Object.keys(d).forEach((m) => {
|
|
36
36
|
d[m] = d[m] || {}, d[m].formElements = {
|
|
37
37
|
...i?.formElements,
|
|
@@ -39,16 +39,16 @@ const Ze = (e, i) => {
|
|
|
39
39
|
...i?.validation,
|
|
40
40
|
...d[m].formElements || {}
|
|
41
41
|
// State-specific overrides
|
|
42
|
-
},
|
|
42
|
+
}, J(m) || r.getState().setInitialStateOptions(m, d[m]);
|
|
43
43
|
}), r.getState().setInitialStates(S), r.getState().setCreatedState(S);
|
|
44
44
|
const E = (m, c) => {
|
|
45
|
-
const [f] =
|
|
46
|
-
|
|
45
|
+
const [f] = ae(c?.componentId ?? ie());
|
|
46
|
+
me({
|
|
47
47
|
stateKey: m,
|
|
48
48
|
options: c,
|
|
49
49
|
initialOptionsPart: d
|
|
50
50
|
});
|
|
51
|
-
const t = r.getState().cogsStateStore[m] || S[m], y = c?.modifyState ? c.modifyState(t) : t, [
|
|
51
|
+
const t = r.getState().cogsStateStore[m] || S[m], y = c?.modifyState ? c.modifyState(t) : t, [x, T] = Fe(
|
|
52
52
|
y,
|
|
53
53
|
{
|
|
54
54
|
stateKey: m,
|
|
@@ -65,22 +65,22 @@ const Ze = (e, i) => {
|
|
|
65
65
|
);
|
|
66
66
|
return T;
|
|
67
67
|
};
|
|
68
|
-
function
|
|
69
|
-
|
|
68
|
+
function I(m, c) {
|
|
69
|
+
me({ stateKey: m, options: c, initialOptionsPart: d }), ce(m);
|
|
70
70
|
}
|
|
71
|
-
return { useCogsState: E, setCogsOptions:
|
|
71
|
+
return { useCogsState: E, setCogsOptions: I };
|
|
72
72
|
}, {
|
|
73
|
-
setUpdaterState:
|
|
74
|
-
setState:
|
|
75
|
-
getInitialOptions:
|
|
76
|
-
getKeyState:
|
|
77
|
-
getValidationErrors:
|
|
78
|
-
setStateLog:
|
|
79
|
-
updateInitialStateGlobal:
|
|
80
|
-
addValidationError:
|
|
81
|
-
removeValidationError:
|
|
82
|
-
setServerSyncActions:
|
|
83
|
-
} = r.getState(),
|
|
73
|
+
setUpdaterState: X,
|
|
74
|
+
setState: z,
|
|
75
|
+
getInitialOptions: J,
|
|
76
|
+
getKeyState: ye,
|
|
77
|
+
getValidationErrors: Ve,
|
|
78
|
+
setStateLog: xe,
|
|
79
|
+
updateInitialStateGlobal: se,
|
|
80
|
+
addValidationError: be,
|
|
81
|
+
removeValidationError: D,
|
|
82
|
+
setServerSyncActions: Pe
|
|
83
|
+
} = r.getState(), ve = (e) => {
|
|
84
84
|
if (!e) return null;
|
|
85
85
|
try {
|
|
86
86
|
const i = window.localStorage.getItem(e);
|
|
@@ -95,20 +95,20 @@ const Ze = (e, i) => {
|
|
|
95
95
|
v.localStorage?.key,
|
|
96
96
|
S
|
|
97
97
|
);
|
|
98
|
-
const d =
|
|
98
|
+
const d = q(v?.localStorage?.key) ? v.localStorage?.key(e) : v?.localStorage?.key;
|
|
99
99
|
if (d && S) {
|
|
100
100
|
const E = {
|
|
101
101
|
state: e,
|
|
102
102
|
lastUpdated: Date.now(),
|
|
103
103
|
lastSyncedWithServer: r.getState().serverSyncLog[i]?.[0]?.timeStamp,
|
|
104
104
|
baseServerState: r.getState().serverState[i]
|
|
105
|
-
},
|
|
106
|
-
window.localStorage.setItem(
|
|
105
|
+
}, I = `${S}-${i}-${d}`;
|
|
106
|
+
window.localStorage.setItem(I, JSON.stringify(E));
|
|
107
107
|
}
|
|
108
|
-
},
|
|
109
|
-
const
|
|
108
|
+
}, je = (e, i, v, S, d, E) => {
|
|
109
|
+
const I = {
|
|
110
110
|
initialState: i,
|
|
111
|
-
updaterState:
|
|
111
|
+
updaterState: Q(
|
|
112
112
|
e,
|
|
113
113
|
S,
|
|
114
114
|
d,
|
|
@@ -116,8 +116,8 @@ const Ze = (e, i) => {
|
|
|
116
116
|
),
|
|
117
117
|
state: v
|
|
118
118
|
};
|
|
119
|
-
|
|
120
|
-
},
|
|
119
|
+
se(e, I.initialState), X(e, I.updaterState), z(e, I.state);
|
|
120
|
+
}, ce = (e) => {
|
|
121
121
|
const i = r.getState().stateComponents.get(e);
|
|
122
122
|
if (!i) return;
|
|
123
123
|
const v = /* @__PURE__ */ new Set();
|
|
@@ -126,7 +126,7 @@ const Ze = (e, i) => {
|
|
|
126
126
|
}), queueMicrotask(() => {
|
|
127
127
|
v.forEach((S) => S());
|
|
128
128
|
});
|
|
129
|
-
},
|
|
129
|
+
}, Ye = (e, i) => {
|
|
130
130
|
const v = r.getState().stateComponents.get(e);
|
|
131
131
|
if (v) {
|
|
132
132
|
const S = `${e}////${i}`, d = v.components.get(S);
|
|
@@ -135,25 +135,25 @@ const Ze = (e, i) => {
|
|
|
135
135
|
d && d.forceUpdate();
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
function
|
|
138
|
+
function Fe(e, {
|
|
139
139
|
stateKey: i,
|
|
140
140
|
serverSync: v,
|
|
141
141
|
localStorage: S,
|
|
142
142
|
formElements: d,
|
|
143
143
|
middleware: E,
|
|
144
|
-
reactiveDeps:
|
|
144
|
+
reactiveDeps: I,
|
|
145
145
|
reactiveType: m,
|
|
146
146
|
componentId: c,
|
|
147
147
|
initialState: f,
|
|
148
148
|
syncUpdate: t,
|
|
149
149
|
dependencies: y
|
|
150
150
|
} = {}) {
|
|
151
|
-
const [
|
|
152
|
-
let
|
|
153
|
-
const [g] =
|
|
154
|
-
|
|
151
|
+
const [x, T] = ae({}), { sessionId: b } = Ce();
|
|
152
|
+
let L = !i;
|
|
153
|
+
const [g] = ae(i ?? ie()), s = r.getState().stateLog[g], B = Y(/* @__PURE__ */ new Set()), R = Y(c ?? ie()), k = Y(null);
|
|
154
|
+
k.current = J(g), oe(() => {
|
|
155
155
|
if (t && t.stateKey === g && t.path?.[0]) {
|
|
156
|
-
|
|
156
|
+
z(g, (a) => ({
|
|
157
157
|
...a,
|
|
158
158
|
[t.path[0]]: t.newValue
|
|
159
159
|
}));
|
|
@@ -163,220 +163,231 @@ function je(e, {
|
|
|
163
163
|
userId: t.userId
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
}, [t]),
|
|
167
|
-
f &&
|
|
166
|
+
}, [t]), oe(() => {
|
|
167
|
+
f && Se(g, {
|
|
168
168
|
initialState: f
|
|
169
169
|
});
|
|
170
|
-
const l =
|
|
170
|
+
const l = k.current;
|
|
171
171
|
let a = null;
|
|
172
|
-
const u =
|
|
173
|
-
console.log("newoptions", l), console.log("localkey", u), console.log("initialState", f), u &&
|
|
174
|
-
|
|
172
|
+
const u = q(l?.localStorage?.key) ? l?.localStorage?.key(f) : l?.localStorage?.key;
|
|
173
|
+
console.log("newoptions", l), console.log("localkey", u), console.log("initialState", f), u && b && (a = ve(
|
|
174
|
+
b + "-" + g + "-" + u
|
|
175
175
|
));
|
|
176
|
-
const
|
|
177
|
-
console.log("createdState - intiual",
|
|
176
|
+
const h = r.getState().iniitialCreatedState[g];
|
|
177
|
+
console.log("createdState - intiual", h, f);
|
|
178
178
|
let N = null;
|
|
179
179
|
if (f) {
|
|
180
|
-
N = f, a && a.lastUpdated > (a.lastSyncedWithServer || 0) && (N = a.state, l?.localStorage?.onChange && l?.localStorage?.onChange(N)), console.log("newState thius is newstate", N),
|
|
180
|
+
N = f, a && a.lastUpdated > (a.lastSyncedWithServer || 0) && (N = a.state, l?.localStorage?.onChange && l?.localStorage?.onChange(N)), console.log("newState thius is newstate", N), je(
|
|
181
181
|
g,
|
|
182
182
|
f,
|
|
183
183
|
N,
|
|
184
184
|
n,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
),
|
|
188
|
-
const
|
|
189
|
-
console.log("reactiveTypes.............................",
|
|
185
|
+
R.current,
|
|
186
|
+
b
|
|
187
|
+
), ce(g);
|
|
188
|
+
const w = Array.isArray(m) ? m : [m || "component"];
|
|
189
|
+
console.log("reactiveTypes.............................", w), w.includes("none") || T({});
|
|
190
190
|
}
|
|
191
|
-
}, [f, ...y || []]),
|
|
192
|
-
|
|
191
|
+
}, [f, ...y || []]), he(() => {
|
|
192
|
+
L && Se(g, {
|
|
193
193
|
serverSync: v,
|
|
194
194
|
formElements: d,
|
|
195
195
|
initialState: f,
|
|
196
196
|
localStorage: S,
|
|
197
197
|
middleware: E
|
|
198
198
|
});
|
|
199
|
-
const l = `${g}////${
|
|
199
|
+
const l = `${g}////${R.current}`, a = r.getState().stateComponents.get(g) || {
|
|
200
200
|
components: /* @__PURE__ */ new Map()
|
|
201
201
|
};
|
|
202
202
|
return a.components.set(l, {
|
|
203
203
|
forceUpdate: () => T({}),
|
|
204
204
|
paths: /* @__PURE__ */ new Set(),
|
|
205
205
|
deps: [],
|
|
206
|
-
depsFunction:
|
|
206
|
+
depsFunction: I || void 0,
|
|
207
207
|
reactiveType: m ?? ["component", "deps"]
|
|
208
208
|
}), r.getState().stateComponents.set(g, a), T({}), () => {
|
|
209
|
-
const u = `${g}////${
|
|
209
|
+
const u = `${g}////${R.current}`;
|
|
210
210
|
a && (a.components.delete(u), a.components.size === 0 && r.getState().stateComponents.delete(g));
|
|
211
211
|
};
|
|
212
212
|
}, []);
|
|
213
|
-
const n = (l, a, u,
|
|
213
|
+
const n = (l, a, u, h) => {
|
|
214
214
|
if (Array.isArray(a)) {
|
|
215
215
|
const N = `${g}-${a.join(".")}`;
|
|
216
|
-
|
|
216
|
+
B.current.add(N);
|
|
217
217
|
}
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
218
|
+
z(g, (N) => {
|
|
219
|
+
const w = q(l) ? l(N) : l, M = ge(N, w);
|
|
220
|
+
new Set(M);
|
|
221
|
+
const P = `${g}-${a.join(".")}`;
|
|
222
|
+
if (P) {
|
|
223
|
+
let j = !1, $ = r.getState().signalDomElements.get(P);
|
|
224
|
+
if ((!$ || $.size === 0) && (u.updateType === "insert" || u.updateType === "cut")) {
|
|
225
|
+
const V = a.slice(0, -1), O = W(w, V);
|
|
226
|
+
if (Array.isArray(O)) {
|
|
227
|
+
j = !0;
|
|
228
|
+
const _ = `${g}-${V.join(".")}`;
|
|
229
|
+
$ = r.getState().signalDomElements.get(_);
|
|
228
230
|
}
|
|
229
231
|
}
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
`[data-parent-id="${
|
|
232
|
+
if ($) {
|
|
233
|
+
const V = j ? W(w, a.slice(0, -1)) : W(w, a);
|
|
234
|
+
$.forEach(({ parentId: O, position: _, effect: p }) => {
|
|
235
|
+
const A = document.querySelector(
|
|
236
|
+
`[data-parent-id="${O}"]`
|
|
235
237
|
);
|
|
236
|
-
if (
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
239
|
-
const
|
|
240
|
-
|
|
238
|
+
if (A) {
|
|
239
|
+
const F = Array.from(A.childNodes);
|
|
240
|
+
if (F[_]) {
|
|
241
|
+
const C = p ? new Function("state", `return (${p})(state)`)(V) : V;
|
|
242
|
+
F[_].textContent = String(C);
|
|
241
243
|
}
|
|
242
244
|
}
|
|
243
245
|
});
|
|
244
246
|
}
|
|
245
247
|
}
|
|
246
|
-
u.updateType === "update" && (
|
|
247
|
-
(
|
|
248
|
+
u.updateType === "update" && (h || k.current?.validationKey) && a && D(
|
|
249
|
+
(h || k.current?.validationKey) + "." + a.join(".")
|
|
248
250
|
);
|
|
249
|
-
const
|
|
250
|
-
u.updateType === "cut" &&
|
|
251
|
-
|
|
252
|
-
), u.updateType === "insert" &&
|
|
253
|
-
|
|
254
|
-
).filter(([
|
|
255
|
-
let
|
|
256
|
-
if (
|
|
257
|
-
let
|
|
258
|
-
|
|
251
|
+
const U = a.slice(0, a.length - 1);
|
|
252
|
+
u.updateType === "cut" && k.current?.validationKey && D(
|
|
253
|
+
k.current?.validationKey + "." + U.join(".")
|
|
254
|
+
), u.updateType === "insert" && k.current?.validationKey && Ve(
|
|
255
|
+
k.current?.validationKey + "." + U.join(".")
|
|
256
|
+
).filter(([$, V]) => {
|
|
257
|
+
let O = $?.split(".").length;
|
|
258
|
+
if ($ == U.join(".") && O == U.length - 1) {
|
|
259
|
+
let _ = $ + "." + U;
|
|
260
|
+
D($), be(_, V);
|
|
259
261
|
}
|
|
260
262
|
});
|
|
261
|
-
const
|
|
263
|
+
const Ie = W(N, a), _e = W(w, a), Ee = u.updateType === "update" ? a.join(".") : [...a].slice(0, -1).join("."), ee = r.getState().stateComponents.get(g);
|
|
262
264
|
if (console.log(
|
|
263
265
|
"pathetocaheck.............................",
|
|
264
266
|
a,
|
|
265
267
|
u,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
),
|
|
268
|
+
Ee ?? "NONE",
|
|
269
|
+
ee
|
|
270
|
+
), ee) {
|
|
271
|
+
const j = ge(N, w), $ = new Set(j), V = u.updateType === "update" ? a.join(".") : a.slice(0, -1).join(".") || "";
|
|
269
272
|
for (const [
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
] of
|
|
273
|
-
let
|
|
274
|
-
const
|
|
275
|
-
if (!
|
|
276
|
-
if (
|
|
277
|
-
|
|
273
|
+
O,
|
|
274
|
+
_
|
|
275
|
+
] of ee.components.entries()) {
|
|
276
|
+
let p = !1;
|
|
277
|
+
const A = Array.isArray(_.reactiveType) ? _.reactiveType : [_.reactiveType || "component"];
|
|
278
|
+
if (!A.includes("none")) {
|
|
279
|
+
if (A.includes("all")) {
|
|
280
|
+
_.forceUpdate();
|
|
278
281
|
continue;
|
|
279
282
|
}
|
|
280
|
-
if (
|
|
281
|
-
for (const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
let k = $;
|
|
287
|
-
for (; k.includes("."); )
|
|
288
|
-
if (k = k.substring(
|
|
289
|
-
0,
|
|
290
|
-
k.lastIndexOf(".")
|
|
291
|
-
), I.paths.has(k)) {
|
|
292
|
-
A = !0;
|
|
283
|
+
if (A.includes("component") && ((_.paths.has(V) || _.paths.has("")) && (p = !0), !p))
|
|
284
|
+
for (const F of $) {
|
|
285
|
+
let C = F;
|
|
286
|
+
for (; ; ) {
|
|
287
|
+
if (_.paths.has(C)) {
|
|
288
|
+
p = !0;
|
|
293
289
|
break;
|
|
294
290
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
291
|
+
const te = C.lastIndexOf(".");
|
|
292
|
+
if (te !== -1) {
|
|
293
|
+
const de = C.substring(
|
|
294
|
+
0,
|
|
295
|
+
te
|
|
296
|
+
);
|
|
297
|
+
if (!isNaN(
|
|
298
|
+
Number(C.substring(te + 1))
|
|
299
|
+
) && _.paths.has(de)) {
|
|
300
|
+
p = !0;
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
C = de;
|
|
304
|
+
} else
|
|
305
|
+
C = "";
|
|
306
|
+
if (C === "")
|
|
307
|
+
break;
|
|
299
308
|
}
|
|
309
|
+
if (p) break;
|
|
300
310
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
A && I.forceUpdate();
|
|
311
|
+
if (!p && A.includes("deps") && _.depsFunction) {
|
|
312
|
+
const F = _.depsFunction(w);
|
|
313
|
+
let C = !1;
|
|
314
|
+
typeof F == "boolean" ? F && (C = !0) : G(_.deps, F) || (_.deps = F, C = !0), C && (p = !0);
|
|
306
315
|
}
|
|
316
|
+
p && _.forceUpdate();
|
|
307
317
|
}
|
|
308
318
|
}
|
|
309
|
-
|
|
319
|
+
}
|
|
320
|
+
const le = {
|
|
310
321
|
timeStamp: Date.now(),
|
|
311
322
|
stateKey: g,
|
|
312
323
|
path: a,
|
|
313
324
|
updateType: u.updateType,
|
|
314
325
|
status: "new",
|
|
315
|
-
oldValue:
|
|
316
|
-
newValue:
|
|
326
|
+
oldValue: Ie,
|
|
327
|
+
newValue: _e
|
|
317
328
|
};
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
const
|
|
321
|
-
return
|
|
329
|
+
if (xe(g, (j) => {
|
|
330
|
+
const V = [...j ?? [], le].reduce((O, _) => {
|
|
331
|
+
const p = `${_.stateKey}:${JSON.stringify(_.path)}`, A = O.get(p);
|
|
332
|
+
return A ? (A.timeStamp = Math.max(A.timeStamp, _.timeStamp), A.newValue = _.newValue, A.oldValue = A.oldValue ?? _.oldValue, A.updateType = _.updateType) : O.set(p, { ..._ }), O;
|
|
322
333
|
}, /* @__PURE__ */ new Map());
|
|
323
|
-
return Array.from(
|
|
334
|
+
return Array.from(V.values());
|
|
324
335
|
}), Oe(
|
|
325
|
-
|
|
336
|
+
w,
|
|
326
337
|
g,
|
|
327
|
-
|
|
328
|
-
|
|
338
|
+
k.current,
|
|
339
|
+
b
|
|
329
340
|
), E && E({
|
|
330
341
|
updateLog: s,
|
|
331
|
-
update:
|
|
332
|
-
}),
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
syncKey: typeof
|
|
336
|
-
rollBackState:
|
|
337
|
-
actionTimeStamp: Date.now() + (
|
|
342
|
+
update: le
|
|
343
|
+
}), k.current?.serverSync) {
|
|
344
|
+
const j = r.getState().serverState[g], $ = k.current?.serverSync;
|
|
345
|
+
Pe(g, {
|
|
346
|
+
syncKey: typeof $.syncKey == "string" ? $.syncKey : $.syncKey({ state: w }),
|
|
347
|
+
rollBackState: j,
|
|
348
|
+
actionTimeStamp: Date.now() + ($.debounce ?? 3e3),
|
|
338
349
|
status: "waiting"
|
|
339
350
|
});
|
|
340
351
|
}
|
|
341
|
-
return
|
|
352
|
+
return w;
|
|
342
353
|
});
|
|
343
354
|
};
|
|
344
|
-
r.getState().updaterState[g] || (
|
|
355
|
+
r.getState().updaterState[g] || (X(
|
|
345
356
|
g,
|
|
346
|
-
|
|
357
|
+
Q(
|
|
347
358
|
g,
|
|
348
359
|
n,
|
|
349
|
-
|
|
350
|
-
|
|
360
|
+
R.current,
|
|
361
|
+
b
|
|
351
362
|
)
|
|
352
|
-
), r.getState().cogsStateStore[g] ||
|
|
353
|
-
const o =
|
|
363
|
+
), r.getState().cogsStateStore[g] || z(g, e), r.getState().initialStateGlobal[g] || se(g, e));
|
|
364
|
+
const o = we(() => Q(
|
|
354
365
|
g,
|
|
355
366
|
n,
|
|
356
|
-
|
|
357
|
-
|
|
367
|
+
R.current,
|
|
368
|
+
b
|
|
358
369
|
), [g]);
|
|
359
|
-
return [
|
|
370
|
+
return [ye(g), o];
|
|
360
371
|
}
|
|
361
|
-
function
|
|
372
|
+
function Q(e, i, v, S) {
|
|
362
373
|
const d = /* @__PURE__ */ new Map();
|
|
363
374
|
let E = 0;
|
|
364
|
-
const
|
|
375
|
+
const I = (f) => {
|
|
365
376
|
const t = f.join(".");
|
|
366
377
|
for (const [y] of d)
|
|
367
378
|
(y === t || y.startsWith(t + ".")) && d.delete(y);
|
|
368
379
|
E++;
|
|
369
380
|
}, m = {
|
|
370
381
|
removeValidation: (f) => {
|
|
371
|
-
f?.validationKey &&
|
|
382
|
+
f?.validationKey && D(f.validationKey);
|
|
372
383
|
},
|
|
373
384
|
revertToInitialState: (f) => {
|
|
374
385
|
const t = r.getState().getInitialOptions(e)?.validation;
|
|
375
|
-
t?.key &&
|
|
386
|
+
t?.key && D(t?.key), f?.validationKey && D(f.validationKey);
|
|
376
387
|
const y = r.getState().initialStateGlobal[e];
|
|
377
388
|
r.getState().clearSelectedIndexesForState(e), d.clear(), E++;
|
|
378
|
-
const
|
|
379
|
-
|
|
389
|
+
const x = c(y, []), T = J(e), b = q(T?.localStorage?.key) ? T?.localStorage?.key(y) : T?.localStorage?.key, L = `${S}-${e}-${b}`;
|
|
390
|
+
L && localStorage.removeItem(L), X(e, x), z(e, y);
|
|
380
391
|
const g = r.getState().stateComponents.get(e);
|
|
381
392
|
return g && g.components.forEach((s) => {
|
|
382
393
|
s.forceUpdate();
|
|
@@ -384,17 +395,17 @@ function X(e, i, v, S) {
|
|
|
384
395
|
},
|
|
385
396
|
updateInitialState: (f) => {
|
|
386
397
|
d.clear(), E++;
|
|
387
|
-
const t =
|
|
398
|
+
const t = Q(
|
|
388
399
|
e,
|
|
389
400
|
i,
|
|
390
401
|
v,
|
|
391
402
|
S
|
|
392
403
|
);
|
|
393
404
|
return $e(() => {
|
|
394
|
-
|
|
405
|
+
se(e, f), X(e, t), z(e, f);
|
|
395
406
|
const y = r.getState().stateComponents.get(e);
|
|
396
|
-
y && y.components.forEach((
|
|
397
|
-
|
|
407
|
+
y && y.components.forEach((x) => {
|
|
408
|
+
x.forceUpdate();
|
|
398
409
|
});
|
|
399
410
|
}), {
|
|
400
411
|
fetchId: (y) => t.get()[y]
|
|
@@ -405,20 +416,20 @@ function X(e, i, v, S) {
|
|
|
405
416
|
_isLoading: r.getState().isLoadingGlobal[e],
|
|
406
417
|
_isServerSynced: () => {
|
|
407
418
|
const f = r.getState().serverState[e];
|
|
408
|
-
return !!(f &&
|
|
419
|
+
return !!(f && G(f, ye(e)));
|
|
409
420
|
}
|
|
410
421
|
};
|
|
411
422
|
function c(f, t = [], y) {
|
|
412
|
-
const
|
|
413
|
-
d.get(
|
|
423
|
+
const x = t.map(String).join(".");
|
|
424
|
+
d.get(x);
|
|
414
425
|
const T = function() {
|
|
415
426
|
return r().getNestedState(e, t);
|
|
416
427
|
};
|
|
417
428
|
Object.keys(m).forEach((g) => {
|
|
418
429
|
T[g] = m[g];
|
|
419
430
|
});
|
|
420
|
-
const
|
|
421
|
-
apply(g, s,
|
|
431
|
+
const b = {
|
|
432
|
+
apply(g, s, B) {
|
|
422
433
|
return console.log(
|
|
423
434
|
`PROXY APPLY TRAP HIT: stateKey=${e}, path=${t.join(".")}`
|
|
424
435
|
), console.trace("Apply trap stack trace"), r().getNestedState(e, t);
|
|
@@ -432,20 +443,20 @@ function X(e, i, v, S) {
|
|
|
432
443
|
}
|
|
433
444
|
}
|
|
434
445
|
if (s === "_status") {
|
|
435
|
-
const n = r.getState().getNestedState(e, t), o = r.getState().initialStateGlobal[e], l =
|
|
436
|
-
return
|
|
446
|
+
const n = r.getState().getNestedState(e, t), o = r.getState().initialStateGlobal[e], l = W(o, t);
|
|
447
|
+
return G(n, l) ? "fresh" : "stale";
|
|
437
448
|
}
|
|
438
449
|
if (s === "getStatus")
|
|
439
450
|
return function() {
|
|
440
451
|
const n = r().getNestedState(
|
|
441
452
|
e,
|
|
442
453
|
t
|
|
443
|
-
), o = r.getState().initialStateGlobal[e], l =
|
|
444
|
-
return
|
|
454
|
+
), o = r.getState().initialStateGlobal[e], l = W(o, t);
|
|
455
|
+
return G(n, l) ? "fresh" : "stale";
|
|
445
456
|
};
|
|
446
457
|
if (s === "removeStorage")
|
|
447
458
|
return () => {
|
|
448
|
-
const n = r.getState().initialStateGlobal[e], o =
|
|
459
|
+
const n = r.getState().initialStateGlobal[e], o = J(e), l = q(o?.localStorage?.key) ? o?.localStorage?.key(n) : o?.localStorage?.key, a = `${S}-${e}-${l}`;
|
|
449
460
|
console.log("removing storage", a), a && localStorage.removeItem(a);
|
|
450
461
|
};
|
|
451
462
|
if (s === "showValidationErrors")
|
|
@@ -470,9 +481,9 @@ function X(e, i, v, S) {
|
|
|
470
481
|
return () => r.getState().getSelectedIndex(e, t.join(".")) ?? -1;
|
|
471
482
|
if (s === "stateSort")
|
|
472
483
|
return (n) => {
|
|
473
|
-
const a = [...r.getState().getNestedState(e, t).map((u,
|
|
484
|
+
const a = [...r.getState().getNestedState(e, t).map((u, h) => ({
|
|
474
485
|
...u,
|
|
475
|
-
__origIndex:
|
|
486
|
+
__origIndex: h.toString()
|
|
476
487
|
}))].sort(n);
|
|
477
488
|
return d.clear(), E++, c(a, t, {
|
|
478
489
|
filtered: [...y?.filtered || [], t],
|
|
@@ -487,9 +498,9 @@ function X(e, i, v, S) {
|
|
|
487
498
|
(a) => a.join(".") === t.join(".")
|
|
488
499
|
), l = o ? f : r.getState().getNestedState(e, t);
|
|
489
500
|
return s !== "stateMapNoRender" && (d.clear(), E++), l.map((a, u) => {
|
|
490
|
-
const
|
|
501
|
+
const h = o && a.__origIndex ? a.__origIndex : u, N = c(
|
|
491
502
|
a,
|
|
492
|
-
[...t,
|
|
503
|
+
[...t, h.toString()],
|
|
493
504
|
y
|
|
494
505
|
);
|
|
495
506
|
return n(
|
|
@@ -502,7 +513,7 @@ function X(e, i, v, S) {
|
|
|
502
513
|
});
|
|
503
514
|
};
|
|
504
515
|
if (s === "$stateMap")
|
|
505
|
-
return (n) =>
|
|
516
|
+
return (n) => K(Re, {
|
|
506
517
|
proxy: {
|
|
507
518
|
_stateKey: e,
|
|
508
519
|
_path: t,
|
|
@@ -518,7 +529,7 @@ function X(e, i, v, S) {
|
|
|
518
529
|
) ? f : r.getState().getNestedState(e, t);
|
|
519
530
|
d.clear(), E++;
|
|
520
531
|
const a = l.flatMap(
|
|
521
|
-
(u,
|
|
532
|
+
(u, h) => u[n] ?? []
|
|
522
533
|
);
|
|
523
534
|
return c(
|
|
524
535
|
a,
|
|
@@ -529,7 +540,7 @@ function X(e, i, v, S) {
|
|
|
529
540
|
if (s === "findWith")
|
|
530
541
|
return (n, o) => {
|
|
531
542
|
const l = f.findIndex(
|
|
532
|
-
(
|
|
543
|
+
(h) => h[n] === o
|
|
533
544
|
);
|
|
534
545
|
if (l === -1) return;
|
|
535
546
|
const a = f[l], u = [...t, l.toString()];
|
|
@@ -541,51 +552,51 @@ function X(e, i, v, S) {
|
|
|
541
552
|
return c(o, [...t, n.toString()]);
|
|
542
553
|
};
|
|
543
554
|
if (s === "insert")
|
|
544
|
-
return (n) => (
|
|
555
|
+
return (n) => (I(t), ne(i, n, t, e), c(
|
|
545
556
|
r.getState().cogsStateStore[e],
|
|
546
557
|
[]
|
|
547
558
|
));
|
|
548
559
|
if (s === "uniqueInsert")
|
|
549
560
|
return (n, o, l) => {
|
|
550
|
-
const a = r.getState().getNestedState(e, t), u =
|
|
551
|
-
let
|
|
552
|
-
if (!a.some((
|
|
561
|
+
const a = r.getState().getNestedState(e, t), u = q(n) ? n(a) : n;
|
|
562
|
+
let h = null;
|
|
563
|
+
if (!a.some((w) => {
|
|
553
564
|
if (o) {
|
|
554
|
-
const
|
|
555
|
-
(
|
|
565
|
+
const P = o.every(
|
|
566
|
+
(U) => G(w[U], u[U])
|
|
556
567
|
);
|
|
557
|
-
return
|
|
568
|
+
return P && (h = w), P;
|
|
558
569
|
}
|
|
559
|
-
const
|
|
560
|
-
return
|
|
570
|
+
const M = G(w, u);
|
|
571
|
+
return M && (h = w), M;
|
|
561
572
|
}))
|
|
562
|
-
|
|
563
|
-
else if (l &&
|
|
564
|
-
const
|
|
565
|
-
(
|
|
573
|
+
I(t), ne(i, u, t, e);
|
|
574
|
+
else if (l && h) {
|
|
575
|
+
const w = l(h), M = a.map(
|
|
576
|
+
(P) => G(P, h) ? w : P
|
|
566
577
|
);
|
|
567
|
-
|
|
578
|
+
I(t), Z(i, M, t);
|
|
568
579
|
}
|
|
569
580
|
};
|
|
570
581
|
if (s === "cut")
|
|
571
582
|
return (n, o) => {
|
|
572
|
-
o?.waitForSync || (
|
|
583
|
+
o?.waitForSync || (I(t), H(i, t, e, n));
|
|
573
584
|
};
|
|
574
585
|
if (s === "cutByValue")
|
|
575
586
|
return (n) => {
|
|
576
587
|
for (let o = 0; o < f.length; o++)
|
|
577
|
-
f[o] === n &&
|
|
588
|
+
f[o] === n && H(i, t, e, o);
|
|
578
589
|
};
|
|
579
590
|
if (s === "toggleByValue")
|
|
580
591
|
return (n) => {
|
|
581
592
|
const o = f.findIndex((l) => l === n);
|
|
582
|
-
o > -1 ?
|
|
593
|
+
o > -1 ? H(i, t, e, o) : ne(i, n, t, e);
|
|
583
594
|
};
|
|
584
595
|
if (s === "stateFilter")
|
|
585
596
|
return (n) => {
|
|
586
|
-
const o = f.map((u,
|
|
597
|
+
const o = f.map((u, h) => ({
|
|
587
598
|
...u,
|
|
588
|
-
__origIndex:
|
|
599
|
+
__origIndex: h.toString()
|
|
589
600
|
})), l = [], a = [];
|
|
590
601
|
for (let u = 0; u < o.length; u++)
|
|
591
602
|
n(o[u], u) && (l.push(u), a.push(o[u]));
|
|
@@ -596,33 +607,33 @@ function X(e, i, v, S) {
|
|
|
596
607
|
});
|
|
597
608
|
};
|
|
598
609
|
}
|
|
599
|
-
const
|
|
600
|
-
if (!isNaN(Number(
|
|
610
|
+
const B = t[t.length - 1];
|
|
611
|
+
if (!isNaN(Number(B))) {
|
|
601
612
|
const n = t.slice(0, -1), o = r.getState().getNestedState(e, n);
|
|
602
613
|
if (Array.isArray(o) && s === "cut")
|
|
603
|
-
return () =>
|
|
614
|
+
return () => H(
|
|
604
615
|
i,
|
|
605
616
|
n,
|
|
606
617
|
e,
|
|
607
|
-
Number(
|
|
618
|
+
Number(B)
|
|
608
619
|
);
|
|
609
620
|
}
|
|
610
621
|
if (s === "get")
|
|
611
622
|
return () => r.getState().getNestedState(e, t);
|
|
612
623
|
if (s === "$derive")
|
|
613
|
-
return (n) =>
|
|
624
|
+
return (n) => re({
|
|
614
625
|
_stateKey: e,
|
|
615
626
|
_path: t,
|
|
616
627
|
_effect: n.toString()
|
|
617
628
|
});
|
|
618
629
|
if (s === "$derive")
|
|
619
|
-
return (n) =>
|
|
630
|
+
return (n) => re({
|
|
620
631
|
_stateKey: e,
|
|
621
632
|
_path: t,
|
|
622
633
|
_effect: n.toString()
|
|
623
634
|
});
|
|
624
635
|
if (s === "$get")
|
|
625
|
-
return () =>
|
|
636
|
+
return () => re({
|
|
626
637
|
_stateKey: e,
|
|
627
638
|
_path: t
|
|
628
639
|
});
|
|
@@ -631,7 +642,7 @@ function X(e, i, v, S) {
|
|
|
631
642
|
return r.getState().getSyncInfo(n);
|
|
632
643
|
}
|
|
633
644
|
if (s == "getLocalStorage")
|
|
634
|
-
return (n) =>
|
|
645
|
+
return (n) => ve(S + "-" + e + "-" + n);
|
|
635
646
|
if (s === "_selected") {
|
|
636
647
|
const n = t.slice(0, -1), o = n.join("."), l = r.getState().getNestedState(e, n);
|
|
637
648
|
return Array.isArray(l) ? Number(t[t.length - 1]) === r.getState().getSelectedIndex(e, o) : void 0;
|
|
@@ -641,7 +652,7 @@ function X(e, i, v, S) {
|
|
|
641
652
|
const o = t.slice(0, -1), l = Number(t[t.length - 1]), a = o.join(".");
|
|
642
653
|
n ? r.getState().setSelectedIndex(e, a, l) : r.getState().setSelectedIndex(e, a, void 0);
|
|
643
654
|
const u = r.getState().getNestedState(e, [...o]);
|
|
644
|
-
|
|
655
|
+
Z(i, u, o), I(o);
|
|
645
656
|
};
|
|
646
657
|
if (t.length == 0) {
|
|
647
658
|
if (s === "validateZodSchema")
|
|
@@ -651,18 +662,18 @@ function X(e, i, v, S) {
|
|
|
651
662
|
throw new Error("Zod schema not found");
|
|
652
663
|
if (!n?.key)
|
|
653
664
|
throw new Error("Validation key not found");
|
|
654
|
-
|
|
665
|
+
D(n.key);
|
|
655
666
|
const l = r.getState().cogsStateStore[e];
|
|
656
667
|
try {
|
|
657
668
|
const a = r.getState().getValidationErrors(n.key);
|
|
658
|
-
a && a.length > 0 && a.forEach(([
|
|
659
|
-
|
|
669
|
+
a && a.length > 0 && a.forEach(([h]) => {
|
|
670
|
+
h && h.startsWith(n.key) && D(h);
|
|
660
671
|
});
|
|
661
672
|
const u = n.zodSchema.safeParse(l);
|
|
662
673
|
return u.success ? !0 : (u.error.errors.forEach((N) => {
|
|
663
|
-
const
|
|
664
|
-
o(
|
|
665
|
-
}),
|
|
674
|
+
const w = N.path, M = N.message, P = [n.key, ...w].join(".");
|
|
675
|
+
o(P, M);
|
|
676
|
+
}), ce(e), !1);
|
|
666
677
|
} catch (a) {
|
|
667
678
|
return console.error("Zod schema validation failed", a), !1;
|
|
668
679
|
}
|
|
@@ -671,7 +682,7 @@ function X(e, i, v, S) {
|
|
|
671
682
|
if (s === "getComponents")
|
|
672
683
|
return () => r().stateComponents.get(e);
|
|
673
684
|
if (s === "getAllFormRefs")
|
|
674
|
-
return () =>
|
|
685
|
+
return () => fe.getState().getFormRefsByStateKey(e);
|
|
675
686
|
if (s === "_initialState")
|
|
676
687
|
return r.getState().initialStateGlobal[e];
|
|
677
688
|
if (s === "_serverState")
|
|
@@ -684,13 +695,13 @@ function X(e, i, v, S) {
|
|
|
684
695
|
if (s === "removeValidation") return m.removeValidation;
|
|
685
696
|
}
|
|
686
697
|
if (s === "getFormRef")
|
|
687
|
-
return () =>
|
|
698
|
+
return () => fe.getState().getFormRef(e + "." + t.join("."));
|
|
688
699
|
if (s === "validationWrapper")
|
|
689
700
|
return ({
|
|
690
701
|
children: n,
|
|
691
702
|
hideMessage: o
|
|
692
|
-
}) => /* @__PURE__ */
|
|
693
|
-
|
|
703
|
+
}) => /* @__PURE__ */ ue(
|
|
704
|
+
pe,
|
|
694
705
|
{
|
|
695
706
|
formOpts: o ? { validation: { message: "" } } : void 0,
|
|
696
707
|
path: t,
|
|
@@ -706,21 +717,21 @@ function X(e, i, v, S) {
|
|
|
706
717
|
if (s === "update")
|
|
707
718
|
return (n, o) => {
|
|
708
719
|
if (o?.debounce)
|
|
709
|
-
|
|
710
|
-
|
|
720
|
+
Te(() => {
|
|
721
|
+
Z(i, n, t, "");
|
|
711
722
|
const l = r.getState().getNestedState(e, t);
|
|
712
723
|
o?.afterUpdate && o.afterUpdate(l);
|
|
713
724
|
}, o.debounce);
|
|
714
725
|
else {
|
|
715
|
-
|
|
726
|
+
Z(i, n, t, "");
|
|
716
727
|
const l = r.getState().getNestedState(e, t);
|
|
717
728
|
o?.afterUpdate && o.afterUpdate(l);
|
|
718
729
|
}
|
|
719
|
-
|
|
730
|
+
I(t);
|
|
720
731
|
};
|
|
721
732
|
if (s === "formElement")
|
|
722
|
-
return (n, o) => /* @__PURE__ */
|
|
723
|
-
|
|
733
|
+
return (n, o) => /* @__PURE__ */ ue(
|
|
734
|
+
ke,
|
|
724
735
|
{
|
|
725
736
|
setState: i,
|
|
726
737
|
stateKey: e,
|
|
@@ -729,23 +740,23 @@ function X(e, i, v, S) {
|
|
|
729
740
|
formOpts: o
|
|
730
741
|
}
|
|
731
742
|
);
|
|
732
|
-
const
|
|
733
|
-
return c(
|
|
743
|
+
const R = [...t, s], k = r.getState().getNestedState(e, R);
|
|
744
|
+
return c(k, R, y);
|
|
734
745
|
}
|
|
735
|
-
},
|
|
736
|
-
return d.set(
|
|
737
|
-
proxy:
|
|
746
|
+
}, L = new Proxy(T, b);
|
|
747
|
+
return d.set(x, {
|
|
748
|
+
proxy: L,
|
|
738
749
|
stateVersion: E
|
|
739
|
-
}),
|
|
750
|
+
}), L;
|
|
740
751
|
}
|
|
741
752
|
return c(
|
|
742
753
|
r.getState().getNestedState(e, [])
|
|
743
754
|
);
|
|
744
755
|
}
|
|
745
|
-
function
|
|
746
|
-
return
|
|
756
|
+
function re(e) {
|
|
757
|
+
return K(Me, { proxy: e });
|
|
747
758
|
}
|
|
748
|
-
function
|
|
759
|
+
function Re({
|
|
749
760
|
proxy: e,
|
|
750
761
|
rebuildStateShape: i
|
|
751
762
|
}) {
|
|
@@ -754,23 +765,23 @@ function Fe({
|
|
|
754
765
|
v,
|
|
755
766
|
e._path
|
|
756
767
|
).stateMapNoRender(
|
|
757
|
-
(d, E,
|
|
768
|
+
(d, E, I, m, c) => e._mapFn(d, E, I, m, c)
|
|
758
769
|
) : null;
|
|
759
770
|
}
|
|
760
|
-
function
|
|
771
|
+
function Me({
|
|
761
772
|
proxy: e
|
|
762
773
|
}) {
|
|
763
|
-
const i =
|
|
764
|
-
return
|
|
774
|
+
const i = Y(null), v = `${e._stateKey}-${e._path.join(".")}`;
|
|
775
|
+
return oe(() => {
|
|
765
776
|
const S = i.current;
|
|
766
777
|
if (!S || !S.parentElement) return;
|
|
767
|
-
const d = S.parentElement,
|
|
778
|
+
const d = S.parentElement, I = Array.from(d.childNodes).indexOf(S);
|
|
768
779
|
let m = d.getAttribute("data-parent-id");
|
|
769
780
|
m || (m = `parent-${crypto.randomUUID()}`, d.setAttribute("data-parent-id", m));
|
|
770
781
|
const f = {
|
|
771
782
|
instanceId: `instance-${crypto.randomUUID()}`,
|
|
772
783
|
parentId: m,
|
|
773
|
-
position:
|
|
784
|
+
position: I,
|
|
774
785
|
effect: e._effect
|
|
775
786
|
};
|
|
776
787
|
r.getState().addSignalElement(v, f);
|
|
@@ -788,16 +799,16 @@ function Re({
|
|
|
788
799
|
else
|
|
789
800
|
y = t;
|
|
790
801
|
y !== null && typeof y == "object" && (y = JSON.stringify(y));
|
|
791
|
-
const
|
|
792
|
-
S.replaceWith(
|
|
793
|
-
}, [e._stateKey, e._path.join("."), e._effect]),
|
|
802
|
+
const x = document.createTextNode(String(y));
|
|
803
|
+
S.replaceWith(x);
|
|
804
|
+
}, [e._stateKey, e._path.join("."), e._effect]), K("span", {
|
|
794
805
|
ref: i,
|
|
795
806
|
style: { display: "none" },
|
|
796
807
|
"data-signal-id": v
|
|
797
808
|
});
|
|
798
809
|
}
|
|
799
|
-
function
|
|
800
|
-
const i =
|
|
810
|
+
function Xe(e) {
|
|
811
|
+
const i = Ne(
|
|
801
812
|
(v) => {
|
|
802
813
|
const S = r.getState().stateComponents.get(e._stateKey) || {
|
|
803
814
|
components: /* @__PURE__ */ new Map()
|
|
@@ -809,14 +820,14 @@ function Ye(e) {
|
|
|
809
820
|
},
|
|
810
821
|
() => r.getState().getNestedState(e._stateKey, e._path)
|
|
811
822
|
);
|
|
812
|
-
return
|
|
823
|
+
return K("text", {}, String(i));
|
|
813
824
|
}
|
|
814
825
|
export {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
826
|
+
re as $cogsSignal,
|
|
827
|
+
Xe as $cogsSignalStore,
|
|
828
|
+
Ze as addStateOptions,
|
|
829
|
+
He as createCogsState,
|
|
830
|
+
Ye as notifyComponent,
|
|
831
|
+
Fe as useCogsStateFn
|
|
821
832
|
};
|
|
822
833
|
//# sourceMappingURL=CogsState.jsx.map
|