react-state-custom 1.0.31 → 1.0.33

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