react-state-custom 1.0.30 → 1.0.32

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/index.es.js CHANGED
@@ -49,22 +49,22 @@ var I;
49
49
  function re() {
50
50
  return I || (I = 1, process.env.NODE_ENV === "production" ? j.exports = ne() : j.exports = ie()), j.exports;
51
51
  }
52
- var _ = re();
52
+ var y = re();
53
53
  function H(n, e) {
54
- let t = null, s = function(...r) {
54
+ let t = null, s = function(...o) {
55
55
  t && clearTimeout(t), t = setTimeout(() => {
56
- n(...r);
56
+ n(...o);
57
57
  }, e);
58
58
  };
59
59
  return s.cancel = () => clearTimeout(t), s;
60
60
  }
61
61
  function oe(n) {
62
62
  const e = /* @__PURE__ */ new Map(), t = function(...s) {
63
- const r = JSON.stringify(s);
64
- if (e.has(r))
65
- return e.get(r);
63
+ const o = JSON.stringify(s);
64
+ if (e.has(o))
65
+ return e.get(o);
66
66
  const i = n(...s);
67
- return e.set(r, i), i;
67
+ return e.set(o, i), i;
68
68
  };
69
69
  return t.cache = e, t;
70
70
  }
@@ -74,7 +74,7 @@ const F = () => Math.random().toString().slice(2), ae = (n) => {
74
74
  id: F()
75
75
  });
76
76
  let t = !1;
77
- return t = t || !n != !e.current.values, t = t || n?.length != e.current.values?.length, t = t || n?.some((s, r) => s != e.current.values[r]), t && (e.current.values = n, e.current.id = F()), e.current.id;
77
+ return t = t || !n != !e.current.values, t = t || n?.length != e.current.values?.length, t = t || n?.some((s, o) => s != e.current.values[o]), t && (e.current.values = n, e.current.id = F()), e.current.id;
78
78
  }, M = "@--change-event";
79
79
  class le extends Event {
80
80
  constructor(e, t) {
@@ -123,7 +123,7 @@ class ce extends EventTarget {
123
123
  */
124
124
  subscribe(e, t) {
125
125
  const s = ({
126
- event: r,
126
+ event: o,
127
127
  value: i
128
128
  }) => {
129
129
  t(i);
@@ -134,9 +134,9 @@ class ce extends EventTarget {
134
134
  const t = (s) => {
135
135
  if (s instanceof G) {
136
136
  const {
137
- value: r
137
+ value: o
138
138
  } = s;
139
- e(r.event, this.data);
139
+ e(o.event, this.data);
140
140
  }
141
141
  };
142
142
  return this.addEventListener(String(M), t), () => this.removeEventListener(String(M), t);
@@ -150,71 +150,71 @@ const k = oe((n) => new ce(n)), z = (n = "noname") => {
150
150
  }, 100);
151
151
  }), [e]), e;
152
152
  }, Y = (n, ...e) => {
153
- const t = _.c(6), s = e;
153
+ const t = y.c(6), s = e;
154
154
  new Error("[ctx] useRegistryChecker failed " + JSON.stringify({
155
155
  names: s,
156
156
  ctx: n?.name ?? "undefined"
157
157
  }));
158
- let r;
159
- t[0] !== n || t[1] !== s ? (r = () => {
158
+ let o;
159
+ t[0] !== n || t[1] !== s ? (o = () => {
160
160
  if (n)
161
161
  return s.some((l) => n.registry.has(l)), s.forEach((l) => n.registry.add(l)), () => {
162
162
  s.forEach((l) => n.registry.delete(l));
163
163
  };
164
- }, t[0] = n, t[1] = s, t[2] = r) : r = t[2];
164
+ }, t[0] = n, t[1] = s, t[2] = o) : o = t[2];
165
165
  let i;
166
- t[3] !== n || t[4] !== s.length ? (i = [n, s.length], t[3] = n, t[4] = s.length, t[5] = i) : i = t[5], w(r, i);
167
- }, ke = (n, e, t) => {
168
- const s = _.c(5);
169
- let r, i;
170
- s[0] !== n || s[1] !== e || s[2] !== t ? (r = () => {
166
+ t[3] !== n || t[4] !== s.length ? (i = [n, s.length], t[3] = n, t[4] = s.length, t[5] = i) : i = t[5], w(o, i);
167
+ }, Le = (n, e, t) => {
168
+ const s = y.c(5);
169
+ let o, i;
170
+ s[0] !== n || s[1] !== e || s[2] !== t ? (o = () => {
171
171
  n && n.data[e] != t && n.publish(e, t);
172
- }, i = [e, t, n], s[0] = n, s[1] = e, s[2] = t, s[3] = r, s[4] = i) : (r = s[3], i = s[4]), w(r, i), Y(n, e);
172
+ }, i = [e, t, n], s[0] = n, s[1] = e, s[2] = t, s[3] = o, s[4] = i) : (o = s[3], i = s[4]), w(o, i), Y(n, e);
173
173
  }, ue = (n, e, t) => {
174
- const s = _.c(11), r = t === void 0 ? 0 : t;
174
+ const s = y.c(11), o = t === void 0 ? 0 : t;
175
175
  let i;
176
176
  s[0] !== n?.data || s[1] !== e ? (i = () => ({
177
177
  value: n?.data?.[e]
178
178
  }), s[0] = n?.data, s[1] = e, s[2] = i) : i = s[2];
179
179
  const [l, a] = N(i), {
180
- value: o
180
+ value: r
181
181
  } = l;
182
182
  let u;
183
- s[3] !== n || s[4] !== r || s[5] !== e || s[6] !== o ? (u = () => {
183
+ s[3] !== n || s[4] !== o || s[5] !== e || s[6] !== r ? (u = () => {
184
184
  if (n) {
185
- const d = r == 0 ? (m) => a({
186
- value: m
187
- }) : H((m) => a({
188
- value: m
189
- }), r), f = n.subscribe(e, d);
190
- return o != n.data[e] && a({
185
+ const d = o == 0 ? (p) => a({
186
+ value: p
187
+ }) : H((p) => a({
188
+ value: p
189
+ }), o), f = n.subscribe(e, d);
190
+ return r != n.data[e] && a({
191
191
  value: n.data[e]
192
192
  }), () => {
193
193
  f();
194
194
  };
195
195
  }
196
- }, s[3] = n, s[4] = r, s[5] = e, s[6] = o, s[7] = u) : u = s[7];
196
+ }, s[3] = n, s[4] = o, s[5] = e, s[6] = r, s[7] = u) : u = s[7];
197
197
  let c;
198
198
  return s[8] !== n || s[9] !== e ? (c = [e, n], s[8] = n, s[9] = e, s[10] = c) : c = s[10], w(u, c), n?.data[e];
199
- }, We = (n, e, t) => {
200
- const [, s] = N(0), r = x(() => t(n?.data[e]), [t, n?.data[e]]);
199
+ }, Ae = (n, e, t) => {
200
+ const [, s] = N(0), o = x(() => t(n?.data[e]), [t, n?.data[e]]);
201
201
  return w(() => {
202
202
  if (n) {
203
- let i = r, l = () => {
204
- let o = t(n.data[e]);
205
- o != i && (i = o, s((u) => u + 1));
203
+ let i = o, l = () => {
204
+ let r = t(n.data[e]);
205
+ r != i && (i = r, s((u) => u + 1));
206
206
  }, a = n.subscribe(e, l);
207
207
  return l(), () => a();
208
208
  }
209
- }, [e, n]), r;
209
+ }, [e, n]), o;
210
210
  }, q = (n, ...e) => {
211
211
  w(() => {
212
212
  if (n)
213
213
  for (let [t, s] of e)
214
214
  n.data[t] != s && n.publish(t, s);
215
215
  }, [n, ae(e.flat())]), Y(n, ...e.map((t) => t[0]));
216
- }, je = (n, ...e) => {
217
- const t = _.c(18), s = e, [, r] = N(0);
216
+ }, Ke = (n, ...e) => {
217
+ const t = y.c(18), s = e, [, o] = N(0);
218
218
  let i;
219
219
  if (t[0] !== n?.data || t[1] !== s) {
220
220
  let c;
@@ -223,20 +223,20 @@ const k = oe((n) => new ce(n)), z = (n = "noname") => {
223
223
  i = t[2];
224
224
  const l = i;
225
225
  let a;
226
- t[5] !== n || t[6] !== s || t[7] !== l || t[8] !== r ? (a = () => {
226
+ t[5] !== n || t[6] !== s || t[7] !== l || t[8] !== o ? (a = () => {
227
227
  if (n) {
228
228
  let c = l;
229
229
  const d = H(() => {
230
230
  const g = s.map((h) => n?.data?.[h]);
231
- s.some((h, p) => c[p] != g[p]) && (c = g, r(he));
232
- }, 1), f = s.map((g) => n.subscribe(g, d)), m = setTimeout(d, 1);
231
+ s.some((h, m) => c[m] != g[m]) && (c = g, o(he));
232
+ }, 1), f = s.map((g) => n.subscribe(g, d)), p = setTimeout(d, 1);
233
233
  return () => {
234
- clearTimeout(m), d.cancel(), f.forEach(de);
234
+ clearTimeout(p), d.cancel(), f.forEach(de);
235
235
  };
236
236
  }
237
- }, t[5] = n, t[6] = s, t[7] = l, t[8] = r, t[9] = a) : a = t[9];
238
- let o;
239
- t[10] !== n || t[11] !== s ? (o = [n, ...s], t[10] = n, t[11] = s, t[12] = o) : o = t[12], w(a, o);
237
+ }, t[5] = n, t[6] = s, t[7] = l, t[8] = o, t[9] = a) : a = t[9];
238
+ let r;
239
+ t[10] !== n || t[11] !== s ? (r = [n, ...s], t[10] = n, t[11] = s, t[12] = r) : r = t[12], w(a, r);
240
240
  let u;
241
241
  if (t[13] !== s || t[14] !== l) {
242
242
  let c;
@@ -244,30 +244,30 @@ const k = oe((n) => new ce(n)), z = (n = "noname") => {
244
244
  } else
245
245
  u = t[15];
246
246
  return u;
247
- }, Le = (n, e, ...t) => {
248
- const s = _.c(14), r = e === void 0 ? 50 : e, i = t, [, l] = N(0);
247
+ }, Me = (n, e, ...t) => {
248
+ const s = y.c(14), o = e === void 0 ? 50 : e, i = t, [, l] = N(0);
249
249
  let a;
250
250
  if (s[0] !== n?.data || s[1] !== i) {
251
251
  let d;
252
252
  s[3] !== n?.data ? (d = (f) => n?.data?.[f], s[3] = n?.data, s[4] = d) : d = s[4], a = i.map(d), s[0] = n?.data, s[1] = i, s[2] = a;
253
253
  } else
254
254
  a = s[2];
255
- const o = a;
255
+ const r = a;
256
256
  let u;
257
- s[5] !== n || s[6] !== r || s[7] !== i || s[8] !== o || s[9] !== l ? (u = () => {
257
+ s[5] !== n || s[6] !== o || s[7] !== i || s[8] !== r || s[9] !== l ? (u = () => {
258
258
  if (n) {
259
- let d = o;
259
+ let d = r;
260
260
  const f = H(() => {
261
- const h = i.map((p) => n?.data?.[p]);
262
- i.some((p, b) => d[b] != h[b]) && (d = h, l(fe));
263
- }, r), m = i.map((h) => n.subscribe(h, f)), g = setTimeout(f, 1);
261
+ const h = i.map((m) => n?.data?.[m]);
262
+ i.some((m, b) => d[b] != h[b]) && (d = h, l(fe));
263
+ }, o), p = i.map((h) => n.subscribe(h, f)), g = setTimeout(f, 1);
264
264
  return () => {
265
- clearTimeout(g), f.cancel(), m.forEach(pe);
265
+ clearTimeout(g), f.cancel(), p.forEach(pe);
266
266
  };
267
267
  }
268
- }, s[5] = n, s[6] = r, s[7] = i, s[8] = o, s[9] = l, s[10] = u) : u = s[10];
268
+ }, s[5] = n, s[6] = o, s[7] = i, s[8] = r, s[9] = l, s[10] = u) : u = s[10];
269
269
  let c;
270
- return s[11] !== n || s[12] !== i ? (c = [n, ...i], s[11] = n, s[12] = i, s[13] = c) : c = s[13], w(u, c), o;
270
+ return s[11] !== n || s[12] !== i ? (c = [n, ...i], s[11] = n, s[12] = i, s[13] = c) : c = s[13], w(u, c), r;
271
271
  };
272
272
  function he(n) {
273
273
  return n + 1;
@@ -286,294 +286,309 @@ const J = (n = void 0) => Object.keys(n ?? {}).sort().map((e) => {
286
286
  if (t !== null && (typeof t == "object" || typeof t == "function"))
287
287
  throw new Error(`Parameter "${e}" must be a primitive value (string, number, bigint, null, or undefined), but received ${typeof t}`);
288
288
  return e + "=" + t;
289
- }).join("&"), Ae = (n, e) => {
290
- const t = (a) => [n, J(a)].filter(Boolean).join("?"), s = /* @__PURE__ */ new Set(), r = (a) => {
291
- const o = _.c(5), u = e(a), c = t(a), d = z(c);
292
- let f;
293
- o[0] === Symbol.for("react.memo_cache_sentinel") ? (f = new Error(), o[0] = f) : f = o[0];
294
- const m = f.stack;
295
- let g;
296
- o[1] !== u ? (g = Object.entries(u), o[1] = u, o[2] = g) : g = o[2], q(d, ...g);
289
+ }).join("&"), me = (n, e) => {
290
+ const t = (a) => [n, J(a)].filter(Boolean).join("?"), s = /* @__PURE__ */ new Set(), o = (a) => {
291
+ const r = y.c(7), u = t(a), c = z(u);
292
+ let d;
293
+ r[0] !== c.data ? (d = {
294
+ ...c.data
295
+ }, r[0] = c.data, r[1] = d) : d = r[1];
296
+ const f = e(a, d);
297
+ let p;
298
+ r[2] === Symbol.for("react.memo_cache_sentinel") ? (p = new Error(), r[2] = p) : p = r[2];
299
+ const g = p.stack;
297
300
  let h;
298
- return o[3] !== c ? (h = () => {
299
- if (s.has(c)) {
300
- const p = new Error("RootContext " + c + " are mounted more than once");
301
- throw p.stack = m, p;
301
+ r[3] !== f ? (h = Object.entries(f), r[3] = f, r[4] = h) : h = r[4], q(c, ...h);
302
+ let m;
303
+ return r[5] !== u ? (m = () => {
304
+ if (s.has(u)) {
305
+ const b = new Error("RootContext " + u + " are mounted more than once");
306
+ throw b.stack = g, b;
302
307
  }
303
- return s.add(c), () => {
304
- s.delete(c);
308
+ return s.add(u), () => {
309
+ s.delete(u);
305
310
  };
306
- }, o[3] = c, o[4] = h) : h = o[4], w(h), u;
311
+ }, r[5] = u, r[6] = m) : m = r[6], w(m), f;
307
312
  }, i = (a) => {
308
- const o = _.c(1);
313
+ const r = y.c(1);
309
314
  let u;
310
- return o[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ v($, {}), o[0] = u) : u = o[0], u;
315
+ return r[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ v($, {}), r[0] = u) : u = r[0], u;
311
316
  }, l = (a) => {
312
- const o = _.c(3), u = r(a);
317
+ const r = y.c(3), u = o(a);
313
318
  let c;
314
- return o[0] !== a || o[1] !== u ? (c = /* @__PURE__ */ v(i, { ...a, ...u }), o[0] = a, o[1] = u, o[2] = c) : c = o[2], c;
319
+ return r[0] !== a || r[1] !== u ? (c = /* @__PURE__ */ v(i, { ...a, ...u }), r[0] = a, r[1] = u, r[2] = c) : c = r[2], c;
315
320
  };
316
- return r.displayName = `useState[${n}]`, l.displayName = `StateContainer[${n}]`, i.displayName = `Debug[${n}]`, {
321
+ return o.displayName = `useState[${n}]`, l.displayName = `StateContainer[${n}]`, i.displayName = `Debug[${n}]`, {
317
322
  name: n,
318
323
  getCtxName: t,
319
- useRootState: r,
324
+ useRootState: o,
320
325
  Root: l,
321
326
  /**
322
327
  * Strict consumer: throws if the corresponding Root for these props isn't mounted.
323
328
  * Use in development/tests to fail fast when wiring is incorrect.
324
329
  */
325
330
  useCtxStateStrict: (a) => {
326
- const o = t(a), u = x(() => new Error().stack, []);
331
+ const r = t(a), u = x(() => new Error().stack, []);
327
332
  return w(() => {
328
- if (!s.has(o)) {
329
- const c = new Error("RootContext [" + o + "] is not mounted");
333
+ if (!s.has(r)) {
334
+ const c = new Error("RootContext [" + r + "] is not mounted");
330
335
  throw c.stack = u, c;
331
336
  }
332
- }, [o]), z(o);
337
+ }, [r]), z(r);
333
338
  },
334
339
  /**
335
340
  * Lenient consumer: schedules a console.error if the Root isn't mounted instead of throwing.
336
341
  * Useful in production to avoid hard crashes while still surfacing misconfiguration.
337
342
  */
338
343
  useCtxState: (a) => {
339
- const o = t(a), u = x(() => new Error().stack, []);
344
+ const r = t(a), u = x(() => new Error().stack, []);
340
345
  return w(() => {
341
- if (!s.has(o)) {
342
- const c = new Error("RootContext [" + o + "] is not mounted");
346
+ if (!s.has(r)) {
347
+ const c = new Error("RootContext [" + r + "] is not mounted");
343
348
  c.stack = u;
344
349
  let d = setTimeout(() => console.error(c), 1e3);
345
350
  return () => clearTimeout(d);
346
351
  }
347
- }, [s.has(o)]), z(o);
352
+ }, [s.has(r)]), z(r);
348
353
  }
349
354
  };
350
- }, me = (n) => {
351
- const e = _.c(1);
355
+ }, ge = (n) => {
356
+ const [, e] = N(0), {
357
+ proxy: t,
358
+ finalGetter: s,
359
+ openGetter: o,
360
+ clean: i
361
+ } = x(() => {
362
+ const l = /* @__PURE__ */ new Set(), a = {}, r = /* @__PURE__ */ new Map(), u = new Proxy(n?.data, {
363
+ get(h, m) {
364
+ if (c)
365
+ return l.add(m), a[m] = h[m];
366
+ throw new Error("useQuickSubscribe: Cannot access context data outside render phase. Destructure needed properties immediately during render.");
367
+ },
368
+ ownKeys(h) {
369
+ return console.warn("useQuickSubscribe: Rest object operations aren't recommended as they bypass selective subscription and may cause performance issues"), Reflect.ownKeys(h);
370
+ }
371
+ });
372
+ let c = !0, d = H(() => {
373
+ [...l.values()].some((h) => a[h] != n?.data?.[h]) && e((h) => h + 1);
374
+ }, 0), f = () => {
375
+ c = !0, l.clear();
376
+ }, p = () => {
377
+ c = !1, [...l.values()].filter((h) => !r.has(h)).forEach((h) => {
378
+ r.set(h, n?.subscribe(h, d));
379
+ }), [...r.keys()].filter((h) => !l.has(h)).forEach((h) => {
380
+ r.get(h)?.(), r.delete(h);
381
+ });
382
+ };
383
+ return {
384
+ proxy: u,
385
+ finalGetter: p,
386
+ openGetter: f,
387
+ clean: () => {
388
+ f(), p(), e((h) => h + 1);
389
+ }
390
+ };
391
+ }, [n]);
392
+ return o(), setTimeout(s, 0), w(() => () => i(), [i]), t;
393
+ }, ve = (n) => {
394
+ const e = y.c(1);
352
395
  let t;
353
396
  return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ v($, {}), e[0] = t) : t = e[0], t;
354
- }, ge = ({
397
+ }, be = ({
355
398
  useStateFn: n,
356
399
  params: e,
357
400
  debugging: t
358
401
  }) => {
359
402
  const s = n(e);
360
- return t ? /* @__PURE__ */ v(me, { ...s }) : /* @__PURE__ */ v($, {});
361
- }, Ke = ({
403
+ return t ? /* @__PURE__ */ v(ve, { ...s }) : /* @__PURE__ */ v($, {});
404
+ }, Ue = ({
362
405
  Wrapper: n = te,
363
406
  debugging: e = !1
364
407
  }) => {
365
- const t = z("auto-ctx"), [s, r] = N({}), i = ee((a, o, u, c = 0) => {
366
- const d = [a, J(u)].filter(Boolean).join("?");
367
- return r((f) => ({
368
- ...f,
369
- [d]: {
370
- ...f[d] ?? {
371
- useStateFn: o,
372
- params: u
408
+ const t = z("auto-ctx"), [s, o] = N({}), i = ee((a, r, u, c = 0, d = void 0) => {
409
+ const f = [a, J(u)].filter(Boolean).join("?");
410
+ return o((p) => ({
411
+ ...p,
412
+ [f]: {
413
+ ...p[f] ?? {
414
+ useStateFn: r,
415
+ params: u,
416
+ AttatchedComponent: d
373
417
  },
374
- counter: (f[d]?.counter ?? 0) + 1,
418
+ counter: (p[f]?.counter ?? 0) + 1,
375
419
  keepUntil: void 0,
376
- useStateFn: o
420
+ useStateFn: r,
421
+ AttatchedComponent: d
377
422
  }
378
- })), () => r(({
379
- [d]: f,
380
- ...m
423
+ })), () => o(({
424
+ [f]: p,
425
+ ...g
381
426
  }) => ({
382
- ...m,
383
- ...f?.counter > 1 || c > 0 ? {
384
- [d]: {
385
- ...f,
386
- counter: f.counter - 1,
387
- keepUntil: f.counter > 1 ? void 0 : Date.now() + c
427
+ ...g,
428
+ ...p?.counter > 1 || c > 0 ? {
429
+ [f]: {
430
+ ...p,
431
+ counter: p.counter - 1,
432
+ keepUntil: p.counter > 1 ? void 0 : Date.now() + c
388
433
  }
389
434
  } : {}
390
435
  }));
391
436
  }, []), l = x(() => Object.entries(s).filter(([, {
392
437
  counter: a,
393
- keepUntil: o
394
- }]) => a <= 0 && o).toSorted(([, {
438
+ keepUntil: r
439
+ }]) => a <= 0 && r).toSorted(([, {
395
440
  keepUntil: a = 0
396
441
  }], [, {
397
- keepUntil: o = 0
398
- }]) => a - o)?.at(0), [s]);
442
+ keepUntil: r = 0
443
+ }]) => a - r)?.at(0), [s]);
399
444
  return w(() => {
400
445
  if (l) {
401
446
  const [a, {
402
- keepUntil: o
447
+ keepUntil: r
403
448
  }] = l;
404
- if (typeof o > "u") throw new Error("Invalid state mgr");
449
+ if (typeof r > "u") throw new Error("Invalid state mgr");
405
450
  let u = setTimeout(() => {
406
- r(({
451
+ o(({
407
452
  [a]: c,
408
453
  ...d
409
454
  }) => d);
410
- }, Math.max(0, o - Date.now()));
455
+ }, Math.max(0, r - Date.now()));
411
456
  return () => {
412
457
  clearTimeout(u);
413
458
  };
414
459
  }
415
460
  }, [l]), q(t, ["subscribe", i], ["state", s]), /* @__PURE__ */ v($, { children: Object.entries(s).filter(([, {
416
461
  counter: a,
417
- keepUntil: o = 0
418
- }]) => a > 0 || o >= Date.now()).map(([a, {
419
- useStateFn: o,
420
- params: u
421
- }]) => /* @__PURE__ */ v(n, { children: /* @__PURE__ */ v(ge, { params: u, useStateFn: o, debugging: e }, a) }, a)) });
422
- }, Me = ({
462
+ keepUntil: r = 0
463
+ }]) => a > 0 || r >= Date.now()).map(([a, {
464
+ useStateFn: r,
465
+ params: u,
466
+ AttatchedComponent: c
467
+ }]) => /* @__PURE__ */ R(n, { children: [
468
+ /* @__PURE__ */ v(be, { params: u, useStateFn: r, debugging: e }, a),
469
+ c && /* @__PURE__ */ v(c, { ...u }, "attatch_" + a)
470
+ ] }, a)) });
471
+ }, Se = ({
423
472
  useRootState: n,
424
473
  getCtxName: e,
425
474
  name: t
426
- }, s = 0) => ({
427
- useCtxState: (r) => {
428
- const i = e(r), l = ue(z("auto-ctx"), "subscribe");
429
- return w(() => l?.(t, n, r, s), [n, l, t, i, s]), z(i);
430
- }
431
- }), Ue = (n) => {
432
- const [, e] = N(0), {
433
- proxy: t,
434
- finalGetter: s,
435
- openGetter: r,
436
- clean: i
437
- } = x(() => {
438
- const l = /* @__PURE__ */ new Set(), a = {}, o = /* @__PURE__ */ new Map(), u = new Proxy(n?.data, {
439
- get(h, p) {
440
- if (c)
441
- return l.add(p), a[p] = h[p];
442
- throw new Error("useQuickSubscribe: Cannot access context data outside render phase. Destructure needed properties immediately during render.");
443
- },
444
- ownKeys(h) {
445
- return console.warn("useQuickSubscribe: Rest object operations aren't recommended as they bypass selective subscription and may cause performance issues"), Reflect.ownKeys(h);
446
- }
447
- });
448
- let c = !0, d = H(() => {
449
- [...l.values()].some((h) => a[h] != n?.data?.[h]) && e((h) => h + 1);
450
- }, 0), f = () => {
451
- c = !0, l.clear();
452
- }, m = () => {
453
- c = !1, [...l.values()].filter((h) => !o.has(h)).forEach((h) => {
454
- o.set(h, n?.subscribe(h, d));
455
- }), [...o.keys()].filter((h) => !l.has(h)).forEach((h) => {
456
- o.get(h)?.(), o.delete(h);
457
- });
458
- };
459
- return {
460
- proxy: u,
461
- finalGetter: m,
462
- openGetter: f,
463
- clean: () => {
464
- f(), m(), e((h) => h + 1);
465
- }
466
- };
467
- }, [n]);
468
- return r(), setTimeout(s, 0), w(() => () => i(), [i]), t;
469
- };
470
- function ve(n) {
471
- const e = _.c(4);
475
+ }, s = 0, o = void 0) => {
476
+ const i = (l) => {
477
+ const a = e(l), r = ue(z("auto-ctx"), "subscribe");
478
+ return w(() => r?.(t, n, l, s, o), [n, r, t, a, s, o]), z(a);
479
+ };
480
+ return {
481
+ useCtxState: i,
482
+ useStore: (l) => ge(i(l))
483
+ };
484
+ }, Be = (n, e, t = 0, s = void 0) => Se(me(n, e), t, s);
485
+ function Ee(n) {
486
+ const e = y.c(4);
472
487
  let t;
473
- e[0] !== n ? (t = n ? Se(n.trim().toLowerCase().split(" "), "gi") : void 0, e[0] = n, e[1] = t) : t = e[1];
488
+ e[0] !== n ? (t = n ? we(n.trim().toLowerCase().split(" "), "gi") : void 0, e[0] = n, e[1] = t) : t = e[1];
474
489
  const s = t;
475
- let r;
476
- return e[2] !== s ? (r = {
490
+ let o;
491
+ return e[2] !== s ? (o = {
477
492
  highlight: s
478
- }, e[2] = s, e[3] = r) : r = e[3], r;
493
+ }, e[2] = s, e[3] = o) : o = e[3], o;
479
494
  }
480
- function be(n) {
495
+ function Ce(n) {
481
496
  return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
482
497
  }
483
- function Se(n, e = "gi") {
484
- const t = n.map(be).join("|");
498
+ function we(n, e = "gi") {
499
+ const t = n.map(Ce).join("|");
485
500
  return new RegExp(`(${t})`, e);
486
501
  }
487
- function Ce(n, e) {
502
+ function ye(n, e) {
488
503
  const t = [];
489
504
  let s = 0;
490
- for (const r of n.matchAll(e)) {
491
- const [i] = r, l = r.index;
505
+ for (const o of n.matchAll(e)) {
506
+ const [i] = o, l = o.index;
492
507
  l > s && t.push(n.slice(s, l)), t.push(/* @__PURE__ */ v("mark", { children: i }, l)), s = l + i.length;
493
508
  }
494
509
  return s < n.length && t.push(n.slice(s)), t;
495
510
  }
496
511
  const X = D.createContext({
497
512
  highlight: void 0
498
- }), Ee = (n) => {
499
- const e = _.c(3), {
513
+ }), _e = (n) => {
514
+ const e = y.c(3), {
500
515
  children: t,
501
516
  highlight: s
502
- } = n, r = ve(s);
517
+ } = n, o = Ee(s);
503
518
  let i;
504
- return e[0] !== t || e[1] !== r ? (i = /* @__PURE__ */ v(X.Provider, { value: r, children: t }), e[0] = t, e[1] = r, e[2] = i) : i = e[2], i;
505
- }, we = (n) => {
506
- const e = _.c(5), {
519
+ return e[0] !== t || e[1] !== o ? (i = /* @__PURE__ */ v(X.Provider, { value: o, children: t }), e[0] = t, e[1] = o, e[2] = i) : i = e[2], i;
520
+ }, Ne = (n) => {
521
+ const e = y.c(5), {
507
522
  text: t
508
523
  } = n, {
509
524
  highlight: s
510
525
  } = se(X);
511
- let r;
512
- e[0] !== s || e[1] !== t ? (r = s ? Ce(t, s) : t, e[0] = s, e[1] = t, e[2] = r) : r = e[2];
513
- const i = r;
526
+ let o;
527
+ e[0] !== s || e[1] !== t ? (o = s ? ye(t, s) : t, e[0] = s, e[1] = t, e[2] = o) : o = e[2];
528
+ const i = o;
514
529
  let l;
515
530
  return e[3] !== i ? (l = /* @__PURE__ */ v($, { children: i }), e[3] = i, e[4] = l) : l = e[4], l;
516
531
  }, Q = (n) => {
517
- const e = _.c(5), {
532
+ const e = y.c(5), {
518
533
  name: t,
519
534
  value: s
520
535
  } = n;
521
- let r;
536
+ let o;
522
537
  try {
523
538
  let a;
524
539
  e[0] !== t || e[1] !== s ? (a = JSON.stringify({
525
540
  [t]: s
526
- }, null, 2), e[0] = t, e[1] = s, e[2] = a) : a = e[2], r = a;
541
+ }, null, 2), e[0] = t, e[1] = s, e[2] = a) : a = e[2], o = a;
527
542
  } catch (a) {
528
- r = String(a);
543
+ o = String(a);
529
544
  }
530
- const i = r;
545
+ const i = o;
531
546
  let l;
532
547
  return e[3] !== i ? (l = /* @__PURE__ */ v("pre", { children: i }), e[3] = i, e[4] = l) : l = e[4], l;
533
- }, _e = (n) => {
534
- const e = _.c(26);
535
- let t, s, r, i;
548
+ }, De = (n) => {
549
+ const e = y.c(26);
550
+ let t, s, o, i;
536
551
  if (e[0] !== n) {
537
552
  const {
538
553
  selectedKey: S,
539
- setKey: C,
540
- currentKey: E,
554
+ setKey: E,
555
+ currentKey: C,
541
556
  highlight: O,
542
- ...y
557
+ ..._
543
558
  } = n;
544
- r = S, i = C, t = E, s = y, e[0] = n, e[1] = t, e[2] = s, e[3] = r, e[4] = i;
559
+ o = S, i = E, t = C, s = _, e[0] = n, e[1] = t, e[2] = s, e[3] = o, e[4] = i;
545
560
  } else
546
- t = e[1], s = e[2], r = e[3], i = e[4];
561
+ t = e[1], s = e[2], o = e[3], i = e[4];
547
562
  let l;
548
563
  e[5] !== t ? (l = k(t), e[5] = t, e[6] = l) : l = e[6];
549
- const a = l, o = P(void 0);
564
+ const a = l, r = P(void 0);
550
565
  let u, c;
551
566
  e[7] !== a ? (u = () => {
552
- if (o.current) {
567
+ if (r.current) {
553
568
  const S = H(() => {
554
- o.current && (o.current?.classList.add("state-key-updated"), requestAnimationFrame(() => o.current?.classList.remove("state-key-updated")));
569
+ r.current && (r.current?.classList.add("state-key-updated"), requestAnimationFrame(() => r.current?.classList.remove("state-key-updated")));
555
570
  }, 5);
556
571
  return a.subscribeAll(S);
557
572
  }
558
- }, c = [a, o], e[7] = a, e[8] = u, e[9] = c) : (u = e[8], c = e[9]), w(u, c);
559
- const d = t == r;
573
+ }, c = [a, r], e[7] = a, e[8] = u, e[9] = c) : (u = e[8], c = e[9]), w(u, c);
574
+ const d = t == o;
560
575
  let f;
561
576
  e[10] !== t || e[11] !== i ? (f = () => i(t), e[10] = t, e[11] = i, e[12] = f) : f = e[12];
562
- const m = String(t);
577
+ const p = String(t);
563
578
  let g;
564
- e[13] !== m ? (g = /* @__PURE__ */ v("div", { className: "state-key-name", children: /* @__PURE__ */ v(we, { text: m }) }), e[13] = m, e[14] = g) : g = e[14];
579
+ e[13] !== p ? (g = /* @__PURE__ */ v("div", { className: "state-key-name", children: /* @__PURE__ */ v(Ne, { text: p }) }), e[13] = p, e[14] = g) : g = e[14];
565
580
  let h;
566
581
  e[15] !== a.data ? (h = Object.keys(a.data), e[15] = a.data, e[16] = h) : h = e[16];
567
- let p;
568
- e[17] !== h.length ? (p = /* @__PURE__ */ R("div", { className: "state-key-meta", children: [
582
+ let m;
583
+ e[17] !== h.length ? (m = /* @__PURE__ */ R("div", { className: "state-key-meta", children: [
569
584
  h.length,
570
585
  " items"
571
- ] }), e[17] = h.length, e[18] = p) : p = e[18];
586
+ ] }), e[17] = h.length, e[18] = m) : m = e[18];
572
587
  let b;
573
- return e[19] !== t || e[20] !== s || e[21] !== d || e[22] !== f || e[23] !== g || e[24] !== p ? (b = /* @__PURE__ */ R("div", { ref: o, className: "state-key", title: t, "data-active": d, onClick: f, ...s, children: [
588
+ return e[19] !== t || e[20] !== s || e[21] !== d || e[22] !== f || e[23] !== g || e[24] !== m ? (b = /* @__PURE__ */ R("div", { ref: r, className: "state-key", title: t, "data-active": d, onClick: f, ...s, children: [
574
589
  g,
575
- p
576
- ] }), e[19] = t, e[20] = s, e[21] = d, e[22] = f, e[23] = g, e[24] = p, e[25] = b) : b = e[25], b;
590
+ m
591
+ ] }), e[19] = t, e[20] = s, e[21] = d, e[22] = f, e[23] = g, e[24] = m, e[25] = b) : b = e[25], b;
577
592
  };
578
593
  function T() {
579
594
  return T = Object.assign ? Object.assign.bind() : function(n) {
@@ -584,7 +599,7 @@ function T() {
584
599
  return n;
585
600
  }, T.apply(null, arguments);
586
601
  }
587
- function ye(n, e) {
602
+ function Re(n, e) {
588
603
  if (n == null) return {};
589
604
  var t = {};
590
605
  for (var s in n) if ({}.hasOwnProperty.call(n, s)) {
@@ -593,7 +608,7 @@ function ye(n, e) {
593
608
  }
594
609
  return t;
595
610
  }
596
- var Ne = ["prefixCls", "className", "children", "mode", "visiable", "visible", "renderBar", "lineBar", "disable", "onDragEnd", "onDragging"];
611
+ var Te = ["prefixCls", "className", "children", "mode", "visiable", "visible", "renderBar", "lineBar", "disable", "onDragEnd", "onDragging"];
597
612
  class U extends D.Component {
598
613
  constructor(e) {
599
614
  super(e), this.state = {
@@ -609,8 +624,8 @@ class U extends D.Component {
609
624
  onMouseDown(e, t) {
610
625
  if (!(!t.target || !this.warpper)) {
611
626
  this.paneNumber = e, this.startX = t.clientX, this.startY = t.clientY, this.move = !0, this.target = t.target.parentNode;
612
- var s = this.target.previousElementSibling, r = this.target.nextElementSibling;
613
- this.boxWidth = this.warpper.clientWidth, this.boxHeight = this.warpper.clientHeight, s && (this.preWidth = s.clientWidth, this.preHeight = s.clientHeight), r && (this.nextWidth = r.clientWidth, this.nextHeight = r.clientHeight), window.addEventListener("mousemove", this.onDragging), window.addEventListener("mouseup", this.onDragEnd, !1), this.setState({
627
+ var s = this.target.previousElementSibling, o = this.target.nextElementSibling;
628
+ this.boxWidth = this.warpper.clientWidth, this.boxHeight = this.warpper.clientHeight, s && (this.preWidth = s.clientWidth, this.preHeight = s.clientHeight), o && (this.nextWidth = o.clientWidth, this.nextHeight = o.clientHeight), window.addEventListener("mousemove", this.onDragging), window.addEventListener("mouseup", this.onDragEnd, !1), this.setState({
614
629
  dragging: !0
615
630
  });
616
631
  }
@@ -623,16 +638,16 @@ class U extends D.Component {
623
638
  var {
624
639
  mode: t,
625
640
  onDragging: s
626
- } = this.props, r = this.target.nextElementSibling, i = this.target.previousElementSibling, l = e.clientX - this.startX, a = e.clientY - this.startY;
641
+ } = this.props, o = this.target.nextElementSibling, i = this.target.previousElementSibling, l = e.clientX - this.startX, a = e.clientY - this.startY;
627
642
  if (this.preSize = 0, this.nextSize = 0, t === "horizontal") {
628
643
  if (this.preSize = this.preWidth + l > -1 ? this.preWidth + l : 0, this.nextSize = this.nextWidth - l > -1 ? this.nextWidth - l : 0, this.preSize === 0 || this.nextSize === 0)
629
644
  return;
630
- this.preSize = (this.preSize / this.boxWidth >= 1 ? 1 : this.preSize / this.boxWidth) * 100, this.nextSize = (this.nextSize / this.boxWidth >= 1 ? 1 : this.nextSize / this.boxWidth) * 100, i && r && (i.style.width = this.preSize + "%", r.style.width = this.nextSize + "%");
645
+ this.preSize = (this.preSize / this.boxWidth >= 1 ? 1 : this.preSize / this.boxWidth) * 100, this.nextSize = (this.nextSize / this.boxWidth >= 1 ? 1 : this.nextSize / this.boxWidth) * 100, i && o && (i.style.width = this.preSize + "%", o.style.width = this.nextSize + "%");
631
646
  }
632
647
  if (t === "vertical" && this.preHeight + a > -1 && this.nextHeight - a > -1) {
633
648
  if (this.preSize = this.preHeight + a > -1 ? this.preHeight + a : 0, this.nextSize = this.nextHeight - a > -1 ? this.nextHeight - a : 0, this.preSize = (this.preSize / this.boxHeight >= 1 ? 1 : this.preSize / this.boxHeight) * 100, this.nextSize = (this.nextSize / this.boxHeight >= 1 ? 1 : this.nextSize / this.boxHeight) * 100, this.preSize === 0 || this.nextSize === 0)
634
649
  return;
635
- i && r && (i.style.height = this.preSize + "%", r.style.height = this.nextSize + "%");
650
+ i && o && (i.style.height = this.preSize + "%", o.style.height = this.nextSize + "%");
636
651
  }
637
652
  s && s(this.preSize, this.nextSize, this.paneNumber);
638
653
  }
@@ -648,36 +663,36 @@ class U extends D.Component {
648
663
  render() {
649
664
  var e, t = this.props, {
650
665
  prefixCls: s,
651
- className: r,
666
+ className: o,
652
667
  children: i,
653
668
  mode: l,
654
669
  visible: a = (e = this.props.visible) != null ? e : this.props.visiable,
655
- renderBar: o,
670
+ renderBar: r,
656
671
  lineBar: u,
657
672
  disable: c
658
- } = t, d = ye(t, Ne), {
673
+ } = t, d = Re(t, Te), {
659
674
  dragging: f
660
- } = this.state, m = [s, r, s + "-" + l, f ? "dragging" : null].filter(Boolean).join(" ").trim(), g = D.Children.toArray(i);
675
+ } = this.state, p = [s, o, s + "-" + l, f ? "dragging" : null].filter(Boolean).join(" ").trim(), g = D.Children.toArray(i);
661
676
  return /* @__PURE__ */ v("div", T({
662
- className: m
677
+ className: p
663
678
  }, d, {
664
679
  ref: (h) => this.warpper = h,
665
- children: D.Children.map(g, (h, p) => {
680
+ children: D.Children.map(g, (h, m) => {
666
681
  var b = Object.assign({}, h.props, {
667
682
  className: [s + "-pane", h.props.className].filter(Boolean).join(" ").trim(),
668
683
  style: T({}, h.props.style)
669
- }), S = a === !0 || a && a.includes(p + 1) || !1, C = {
684
+ }), S = a === !0 || a && a.includes(m + 1) || !1, E = {
670
685
  className: [s + "-bar", u ? s + "-line-bar" : null, u ? null : s + "-large-bar"].filter(Boolean).join(" ").trim()
671
686
  };
672
- (c === !0 || c && c.includes(p + 1)) && (C.className = [C.className, c ? "disable" : null].filter(Boolean).join(" ").trim());
673
- var E = null;
674
- return p !== 0 && S && o ? E = o(T({}, C, {
675
- onMouseDown: this.onMouseDown.bind(this, p + 1)
676
- })) : p !== 0 && S && (E = /* @__PURE__ */ D.createElement("div", T({}, C), /* @__PURE__ */ v("div", {
677
- onMouseDown: this.onMouseDown.bind(this, p + 1)
687
+ (c === !0 || c && c.includes(m + 1)) && (E.className = [E.className, c ? "disable" : null].filter(Boolean).join(" ").trim());
688
+ var C = null;
689
+ return m !== 0 && S && r ? C = r(T({}, E, {
690
+ onMouseDown: this.onMouseDown.bind(this, m + 1)
691
+ })) : m !== 0 && S && (C = /* @__PURE__ */ D.createElement("div", T({}, E), /* @__PURE__ */ v("div", {
692
+ onMouseDown: this.onMouseDown.bind(this, m + 1)
678
693
  }))), /* @__PURE__ */ R(D.Fragment, {
679
- children: [E, /* @__PURE__ */ D.cloneElement(h, T({}, b))]
680
- }, p);
694
+ children: [C, /* @__PURE__ */ D.cloneElement(h, T({}, b))]
695
+ }, m);
681
696
  })
682
697
  }));
683
698
  }
@@ -687,108 +702,108 @@ U.defaultProps = {
687
702
  visiable: !0,
688
703
  mode: "horizontal"
689
704
  };
690
- const L = k.cache, De = (n) => {
691
- const e = _.c(27), {
705
+ const L = k.cache, ze = (n) => {
706
+ const e = y.c(27), {
692
707
  Component: t
693
- } = n, [s, r] = N(Te), [i, l] = N(""), [a, o] = N("");
708
+ } = n, [s, o] = N($e), [i, l] = N(""), [a, r] = N("");
694
709
  let u, c;
695
710
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
696
- const y = setInterval(() => {
697
- r(ze);
711
+ const _ = setInterval(() => {
712
+ o(He);
698
713
  }, 50);
699
- return () => clearInterval(y);
714
+ return () => clearInterval(_);
700
715
  }, c = [L], e[0] = u, e[1] = c) : (u = e[0], c = e[1]), w(u, c);
701
716
  let d;
702
717
  e[2] !== i ? (d = i.toLowerCase().split(" "), e[2] = i, e[3] = d) : d = e[3];
703
718
  const f = d;
704
- let m;
705
- e[4] !== f ? (m = (y) => {
706
- const W = y.toLowerCase();
719
+ let p;
720
+ e[4] !== f ? (p = (_) => {
721
+ const W = _.toLowerCase();
707
722
  return f.every((Z) => W.includes(Z));
708
- }, e[4] = f, e[5] = m) : m = e[5];
709
- const g = m;
723
+ }, e[4] = f, e[5] = p) : p = e[5];
724
+ const g = p;
710
725
  let h;
711
- e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = (y) => l(y.target.value), e[6] = h) : h = e[6];
712
- let p;
713
- e[7] !== i ? (p = /* @__PURE__ */ v("input", { placeholder: "Type to Filter ...", className: "state-filter", value: i, onChange: h }), e[7] = i, e[8] = p) : p = e[8];
726
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = (_) => l(_.target.value), e[6] = h) : h = e[6];
727
+ let m;
728
+ e[7] !== i ? (m = /* @__PURE__ */ v("input", { placeholder: "Type to Filter ...", className: "state-filter", value: i, onChange: h }), e[7] = i, e[8] = m) : m = e[8];
714
729
  let b;
715
730
  if (e[9] !== s || e[10] !== g || e[11] !== a) {
716
- let y;
717
- e[13] !== a ? (y = (W) => /* @__PURE__ */ v(_e, { selectedKey: a, setKey: o, currentKey: W }, W), e[13] = a, e[14] = y) : y = e[14], b = s.map(xe).filter($e).filter(g).map(y), e[9] = s, e[10] = g, e[11] = a, e[12] = b;
731
+ let _;
732
+ e[13] !== a ? (_ = (W) => /* @__PURE__ */ v(De, { selectedKey: a, setKey: r, currentKey: W }, W), e[13] = a, e[14] = _) : _ = e[14], b = s.map(Oe).filter(ke).filter(g).map(_), e[9] = s, e[10] = g, e[11] = a, e[12] = b;
718
733
  } else
719
734
  b = e[12];
720
735
  let S;
721
- e[15] !== i || e[16] !== b ? (S = /* @__PURE__ */ v(Ee, { highlight: i, children: b }), e[15] = i, e[16] = b, e[17] = S) : S = e[17];
722
- let C;
723
- e[18] !== p || e[19] !== S ? (C = /* @__PURE__ */ R("div", { className: "state-list", children: [
724
- p,
725
- S
726
- ] }), e[18] = p, e[19] = S, e[20] = C) : C = e[20];
736
+ e[15] !== i || e[16] !== b ? (S = /* @__PURE__ */ v(_e, { highlight: i, children: b }), e[15] = i, e[16] = b, e[17] = S) : S = e[17];
727
737
  let E;
728
- e[21] !== t || e[22] !== a ? (E = /* @__PURE__ */ v("div", { className: "state-view", children: /* @__PURE__ */ v(Re, { dataKey: a, Component: t }, a) }), e[21] = t, e[22] = a, e[23] = E) : E = e[23];
738
+ e[18] !== m || e[19] !== S ? (E = /* @__PURE__ */ R("div", { className: "state-list", children: [
739
+ m,
740
+ S
741
+ ] }), e[18] = m, e[19] = S, e[20] = E) : E = e[20];
742
+ let C;
743
+ e[21] !== t || e[22] !== a ? (C = /* @__PURE__ */ v("div", { className: "state-view", children: /* @__PURE__ */ v(xe, { dataKey: a, Component: t }, a) }), e[21] = t, e[22] = a, e[23] = C) : C = e[23];
729
744
  let O;
730
- return e[24] !== E || e[25] !== C ? (O = /* @__PURE__ */ R(U, { mode: "horizontal", className: "main-panel", children: [
731
- C,
732
- E
733
- ] }), e[24] = E, e[25] = C, e[26] = O) : O = e[26], O;
734
- }, Re = (n) => {
735
- const e = _.c(11), {
745
+ return e[24] !== C || e[25] !== E ? (O = /* @__PURE__ */ R(U, { mode: "horizontal", className: "main-panel", children: [
746
+ E,
747
+ C
748
+ ] }), e[24] = C, e[25] = E, e[26] = O) : O = e[26], O;
749
+ }, xe = (n) => {
750
+ const e = y.c(11), {
736
751
  dataKey: t,
737
752
  Component: s
738
- } = n, r = s === void 0 ? Q : s;
753
+ } = n, o = s === void 0 ? Q : s;
739
754
  let i;
740
755
  e[0] !== t ? (i = k(t), e[0] = t, e[1] = i) : i = e[1];
741
756
  const l = i, a = l?.data;
742
- let o;
743
- e[2] !== a ? (o = {
757
+ let r;
758
+ e[2] !== a ? (r = {
744
759
  ...a
745
- }, e[2] = a, e[3] = o) : o = e[3];
746
- const [u, c] = N(o);
760
+ }, e[2] = a, e[3] = r) : r = e[3];
761
+ const [u, c] = N(r);
747
762
  let d, f;
748
763
  e[4] !== l ? (d = () => {
749
764
  const g = H(c, 5);
750
- return l.subscribeAll((h, p) => g({
751
- ...p
765
+ return l.subscribeAll((h, m) => g({
766
+ ...m
752
767
  }));
753
768
  }, f = [l], e[4] = l, e[5] = d, e[6] = f) : (d = e[5], f = e[6]), w(d, f);
754
- let m;
755
- return e[7] !== r || e[8] !== u || e[9] !== t ? (m = /* @__PURE__ */ v(r, { value: u, name: t }), e[7] = r, e[8] = u, e[9] = t, e[10] = m) : m = e[10], m;
769
+ let p;
770
+ return e[7] !== o || e[8] !== u || e[9] !== t ? (p = /* @__PURE__ */ v(o, { value: u, name: t }), e[7] = o, e[8] = u, e[9] = t, e[10] = p) : p = e[10], p;
756
771
  };
757
- function Te() {
772
+ function $e() {
758
773
  return [...L.keys()];
759
774
  }
760
- function ze(n) {
775
+ function He(n) {
761
776
  return n.length != L.size ? [...L.keys()] : n;
762
777
  }
763
- function xe(n) {
778
+ function Oe(n) {
764
779
  return JSON.parse(n)?.[0];
765
780
  }
766
- function $e(n) {
781
+ function ke(n) {
767
782
  return n != "auto-ctx" && n;
768
783
  }
769
- const Be = (n) => {
770
- const e = _.c(29);
771
- let t, s, r;
784
+ const Ve = (n) => {
785
+ const e = y.c(29);
786
+ let t, s, o;
772
787
  e[0] !== n ? ({
773
788
  toggleButton: s,
774
- Component: r,
789
+ Component: o,
775
790
  ...t
776
- } = n, e[0] = n, e[1] = t, e[2] = s, e[3] = r) : (t = e[1], s = e[2], r = e[3]);
777
- const i = r === void 0 ? Q : r, [l, a] = N(!1);
778
- let o;
779
- e[4] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(!0), e[4] = o) : o = e[4];
791
+ } = n, e[0] = n, e[1] = t, e[2] = s, e[3] = o) : (t = e[1], s = e[2], o = e[3]);
792
+ const i = o === void 0 ? Q : o, [l, a] = N(!1);
793
+ let r;
794
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (r = () => a(!0), e[4] = r) : r = e[4];
780
795
  const u = t?.children ?? "Toggle Dev Tool";
781
796
  let c;
782
- e[5] !== l || e[6] !== t || e[7] !== u ? (c = /* @__PURE__ */ v("button", { className: "react-state-dev-btn", "data-active": l, onClick: o, ...t, children: u }), e[5] = l, e[6] = t, e[7] = u, e[8] = c) : c = e[8];
797
+ e[5] !== l || e[6] !== t || e[7] !== u ? (c = /* @__PURE__ */ v("button", { className: "react-state-dev-btn", "data-active": l, onClick: r, ...t, children: u }), e[5] = l, e[6] = t, e[7] = u, e[8] = c) : c = e[8];
783
798
  let d;
784
799
  e[9] === Symbol.for("react.memo_cache_sentinel") ? (d = {
785
800
  height: "100%"
786
801
  }, e[9] = d) : d = e[9];
787
802
  const f = l ? "66.66%" : "100%";
788
- let m;
789
- e[10] !== f ? (m = /* @__PURE__ */ v("div", { style: {
803
+ let p;
804
+ e[10] !== f ? (p = /* @__PURE__ */ v("div", { style: {
790
805
  height: f
791
- } }), e[10] = f, e[11] = m) : m = e[11];
806
+ } }), e[10] = f, e[11] = p) : p = e[11];
792
807
  const g = l ? "33.33%" : "0";
793
808
  let h;
794
809
  e[12] !== g ? (h = {
@@ -796,41 +811,43 @@ const Be = (n) => {
796
811
  backgroundColor: "var(--rs-bg-color)",
797
812
  position: "relative"
798
813
  }, e[12] = g, e[13] = h) : h = e[13];
799
- let p;
800
- e[14] !== l ? (p = l && /* @__PURE__ */ v("button", { className: "close-btn", onClick: () => a(!1), children: "[x]" }), e[14] = l, e[15] = p) : p = e[15];
814
+ let m;
815
+ e[14] !== l ? (m = l && /* @__PURE__ */ v("button", { className: "close-btn", onClick: () => a(!1), children: "[x]" }), e[14] = l, e[15] = m) : m = e[15];
801
816
  let b;
802
- e[16] !== i || e[17] !== l ? (b = l && /* @__PURE__ */ v(De, { Component: i }), e[16] = i, e[17] = l, e[18] = b) : b = e[18];
817
+ e[16] !== i || e[17] !== l ? (b = l && /* @__PURE__ */ v(ze, { Component: i }), e[16] = i, e[17] = l, e[18] = b) : b = e[18];
803
818
  let S;
804
- e[19] !== h || e[20] !== p || e[21] !== b ? (S = /* @__PURE__ */ R("div", { className: "react-state-dev-panel", style: h, children: [
805
- p,
806
- b
807
- ] }), e[19] = h, e[20] = p, e[21] = b, e[22] = S) : S = e[22];
808
- let C;
809
- e[23] !== S || e[24] !== m ? (C = /* @__PURE__ */ v("div", { className: "react-state-dev-container", children: /* @__PURE__ */ R(U, { mode: "vertical", style: d, children: [
819
+ e[19] !== h || e[20] !== m || e[21] !== b ? (S = /* @__PURE__ */ R("div", { className: "react-state-dev-panel", style: h, children: [
810
820
  m,
811
- S
812
- ] }) }), e[23] = S, e[24] = m, e[25] = C) : C = e[25];
821
+ b
822
+ ] }), e[19] = h, e[20] = m, e[21] = b, e[22] = S) : S = e[22];
813
823
  let E;
814
- return e[26] !== C || e[27] !== c ? (E = /* @__PURE__ */ R($, { children: [
824
+ e[23] !== S || e[24] !== p ? (E = /* @__PURE__ */ v("div", { className: "react-state-dev-container", children: /* @__PURE__ */ R(U, { mode: "vertical", style: d, children: [
825
+ p,
826
+ S
827
+ ] }) }), e[23] = S, e[24] = p, e[25] = E) : E = e[25];
828
+ let C;
829
+ return e[26] !== E || e[27] !== c ? (C = /* @__PURE__ */ R($, { children: [
815
830
  c,
816
- C
817
- ] }), e[26] = C, e[27] = c, e[28] = E) : E = e[28], E;
831
+ E
832
+ ] }), e[26] = E, e[27] = c, e[28] = C) : C = e[28], C;
818
833
  };
819
834
  export {
820
- Ke as AutoRootCtx,
835
+ Ue as AutoRootCtx,
821
836
  ce as Context,
822
- Be as DevToolContainer,
823
- Me as createAutoCtx,
824
- Ae as createRootCtx,
837
+ Ve as DevToolContainer,
838
+ Se as createAutoCtx,
839
+ me as createRootCtx,
840
+ Be as createStore,
825
841
  k as getContext,
842
+ J as paramsToId,
826
843
  ae as useArrayChangeId,
827
844
  z as useDataContext,
828
- ke as useDataSource,
845
+ Le as useDataSource,
829
846
  q as useDataSourceMultiple,
830
847
  ue as useDataSubscribe,
831
- je as useDataSubscribeMultiple,
832
- Le as useDataSubscribeMultipleWithDebounce,
833
- We as useDataSubscribeWithTransform,
834
- Ue as useQuickSubscribe
848
+ Ke as useDataSubscribeMultiple,
849
+ Me as useDataSubscribeMultipleWithDebounce,
850
+ Ae as useDataSubscribeWithTransform,
851
+ ge as useQuickSubscribe
835
852
  };
836
853
  //# sourceMappingURL=index.es.js.map