cogsbox-state 0.5.162 → 0.5.164

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