react-state-custom 1.0.25 → 1.0.26
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 +617 -373
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +21 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/state-utils/createAutoCtx.d.ts +5 -4
- package/dist/state-utils/createRootCtx.d.ts +5 -1
- package/dist/state-utils/paramsToId.d.ts +1 -0
- package/package.json +4 -2
package/dist/index.es.js
CHANGED
|
@@ -1,25 +1,79 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import M, { useRef as W, useMemo as T, useEffect as v, useState as E, useCallback as X, Fragment as Z, useContext as x } from "react";
|
|
2
|
+
import { jsx as b, Fragment as $, jsxs as D } from "react/jsx-runtime";
|
|
3
|
+
var K = { exports: {} }, V = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-compiler-runtime.production.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var I;
|
|
14
|
+
function ee() {
|
|
15
|
+
if (I) return V;
|
|
16
|
+
I = 1;
|
|
17
|
+
var s = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
18
|
+
return V.c = function(e) {
|
|
19
|
+
return s.H.useMemoCache(e);
|
|
20
|
+
}, V;
|
|
21
|
+
}
|
|
22
|
+
var U = {};
|
|
23
|
+
/**
|
|
24
|
+
* @license React
|
|
25
|
+
* react-compiler-runtime.development.js
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/
|
|
32
|
+
var F;
|
|
33
|
+
function te() {
|
|
34
|
+
return F || (F = 1, process.env.NODE_ENV !== "production" && function() {
|
|
35
|
+
var s = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
36
|
+
U.c = function(e) {
|
|
37
|
+
var t = s.H;
|
|
38
|
+
return t === null && console.error(
|
|
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:
|
|
40
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
41
|
+
2. You might be breaking the Rules of Hooks
|
|
42
|
+
3. You might have more than one copy of React in the same app
|
|
43
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
44
|
+
), t.useMemoCache(e);
|
|
45
|
+
};
|
|
46
|
+
}()), U;
|
|
47
|
+
}
|
|
48
|
+
var G;
|
|
49
|
+
function ne() {
|
|
50
|
+
return G || (G = 1, process.env.NODE_ENV === "production" ? K.exports = ee() : K.exports = te()), K.exports;
|
|
51
|
+
}
|
|
52
|
+
var C = ne();
|
|
53
|
+
function O(s, e) {
|
|
54
|
+
let t = null, n = function(...a) {
|
|
55
|
+
t && clearTimeout(t), t = setTimeout(() => {
|
|
56
|
+
s(...a);
|
|
57
|
+
}, e);
|
|
8
58
|
};
|
|
9
|
-
return
|
|
59
|
+
return n.cancel = () => clearTimeout(t), n;
|
|
10
60
|
}
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
-
const
|
|
17
|
-
return
|
|
61
|
+
function se(s) {
|
|
62
|
+
const e = /* @__PURE__ */ new Map(), t = function(...n) {
|
|
63
|
+
const a = JSON.stringify(n);
|
|
64
|
+
if (e.has(a))
|
|
65
|
+
return e.get(a);
|
|
66
|
+
const r = s(...n);
|
|
67
|
+
return e.set(a, r), r;
|
|
18
68
|
};
|
|
19
|
-
return
|
|
69
|
+
return t.cache = e, t;
|
|
20
70
|
}
|
|
21
|
-
const
|
|
22
|
-
const {
|
|
71
|
+
const q = () => Math.random().toString().slice(2), re = (s) => {
|
|
72
|
+
const {
|
|
73
|
+
current: {
|
|
74
|
+
computedHash: e
|
|
75
|
+
}
|
|
76
|
+
} = W({
|
|
23
77
|
/**
|
|
24
78
|
* Getter for the computed hash function.
|
|
25
79
|
*
|
|
@@ -28,32 +82,32 @@ const y = () => Math.random().toString().slice(2), K = (e) => {
|
|
|
28
82
|
* - Updates the hash if any difference is detected.
|
|
29
83
|
*/
|
|
30
84
|
get computedHash() {
|
|
31
|
-
let
|
|
32
|
-
return (
|
|
33
|
-
let
|
|
34
|
-
return
|
|
85
|
+
let t = [], n = q();
|
|
86
|
+
return (a) => {
|
|
87
|
+
let r = !1;
|
|
88
|
+
return r = r || !a != !t, r = r || a?.length != t?.length, r = r || a.some((i, l) => i != t[l]), t = a, r && (n = q()), n;
|
|
35
89
|
};
|
|
36
90
|
}
|
|
37
91
|
});
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
class
|
|
41
|
-
constructor(
|
|
42
|
-
super(String(
|
|
92
|
+
return e(s);
|
|
93
|
+
}, j = "@--change-event";
|
|
94
|
+
class oe extends Event {
|
|
95
|
+
constructor(e, t) {
|
|
96
|
+
super(String(e)), this.event = e, this.value = t;
|
|
43
97
|
}
|
|
44
98
|
}
|
|
45
|
-
class
|
|
46
|
-
constructor(
|
|
47
|
-
super(
|
|
99
|
+
class J extends Event {
|
|
100
|
+
constructor(e) {
|
|
101
|
+
super(j, e), this.value = e;
|
|
48
102
|
}
|
|
49
103
|
}
|
|
50
|
-
class
|
|
104
|
+
class ae extends EventTarget {
|
|
51
105
|
/**
|
|
52
106
|
* Create a new Context instance.
|
|
53
107
|
* @param name - The name of the context (for debugging).
|
|
54
108
|
*/
|
|
55
|
-
constructor(
|
|
56
|
-
console.log("[CONTEXT] %s",
|
|
109
|
+
constructor(e) {
|
|
110
|
+
console.log("[CONTEXT] %s", e), super(), this.name = e;
|
|
57
111
|
}
|
|
58
112
|
/**
|
|
59
113
|
* The current data held by the context.
|
|
@@ -69,11 +123,11 @@ class J extends EventTarget {
|
|
|
69
123
|
* @param key - The key to update.
|
|
70
124
|
* @param value - The new value.
|
|
71
125
|
*/
|
|
72
|
-
publish(
|
|
73
|
-
if (
|
|
74
|
-
this.data[
|
|
75
|
-
let
|
|
76
|
-
this.dispatchEvent(
|
|
126
|
+
publish(e, t) {
|
|
127
|
+
if (t != this.data[e]) {
|
|
128
|
+
this.data[e] = t;
|
|
129
|
+
let n = new oe(e, t);
|
|
130
|
+
this.dispatchEvent(n), this.dispatchEvent(new J(n));
|
|
77
131
|
}
|
|
78
132
|
}
|
|
79
133
|
/**
|
|
@@ -82,389 +136,579 @@ class J extends EventTarget {
|
|
|
82
136
|
* @param _listener - Callback invoked with the new value.
|
|
83
137
|
* @returns Unsubscribe function.
|
|
84
138
|
*/
|
|
85
|
-
subscribe(
|
|
86
|
-
const
|
|
87
|
-
|
|
139
|
+
subscribe(e, t) {
|
|
140
|
+
const n = ({
|
|
141
|
+
event: a,
|
|
142
|
+
value: r
|
|
143
|
+
}) => {
|
|
144
|
+
t(r);
|
|
88
145
|
};
|
|
89
|
-
return this.addEventListener(String(
|
|
146
|
+
return this.addEventListener(String(e), n), e in this.data && t(this.data[e]), () => this.removeEventListener(String(e), n);
|
|
90
147
|
}
|
|
91
|
-
subscribeAll(
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
const {
|
|
95
|
-
|
|
148
|
+
subscribeAll(e) {
|
|
149
|
+
const t = (n) => {
|
|
150
|
+
if (n instanceof J) {
|
|
151
|
+
const {
|
|
152
|
+
value: a
|
|
153
|
+
} = n;
|
|
154
|
+
e(a.event, this.data);
|
|
96
155
|
}
|
|
97
156
|
};
|
|
98
|
-
return this.addEventListener(String(
|
|
157
|
+
return this.addEventListener(String(j), t), () => this.removeEventListener(String(j), t);
|
|
99
158
|
}
|
|
100
159
|
}
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
160
|
+
const A = se((s) => new ae(s)), y = (s = "noname") => {
|
|
161
|
+
const e = T(() => A(s), [s]);
|
|
162
|
+
return v(() => (e.useCounter += 1, () => {
|
|
163
|
+
e.useCounter -= 1, e.useCounter <= 0 && setTimeout(() => {
|
|
164
|
+
e.useCounter <= 0 && A.cache.delete(JSON.stringify([s]));
|
|
106
165
|
}, 100);
|
|
107
|
-
}), [
|
|
108
|
-
},
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
166
|
+
}), [e]), e;
|
|
167
|
+
}, Y = (s, ...e) => {
|
|
168
|
+
const t = C.c(12), n = e;
|
|
169
|
+
let a;
|
|
170
|
+
t[0] !== s?.name || t[1] !== n ? (a = JSON.stringify({
|
|
171
|
+
names: n,
|
|
172
|
+
ctx: s?.name ?? "undefined"
|
|
173
|
+
}), t[0] = s?.name, t[1] = n, t[2] = a) : a = t[2];
|
|
174
|
+
const r = "[ctx] useRegistryChecker failed " + a;
|
|
175
|
+
let i;
|
|
176
|
+
t[3] !== r ? (i = new Error(r), t[3] = r, t[4] = i) : i = t[4];
|
|
177
|
+
const l = i;
|
|
178
|
+
let o;
|
|
179
|
+
t[5] !== s || t[6] !== n || t[7] !== l ? (o = () => {
|
|
180
|
+
if (s)
|
|
181
|
+
return n.some((c) => s.registry.has(c)) && console.error(l), n.forEach((c) => s.registry.add(c)), () => {
|
|
182
|
+
n.forEach((c) => s.registry.delete(c));
|
|
183
|
+
};
|
|
184
|
+
}, t[5] = s, t[6] = n, t[7] = l, t[8] = o) : o = t[8];
|
|
185
|
+
let u;
|
|
186
|
+
t[9] !== s || t[10] !== n.length ? (u = [s, n.length], t[9] = s, t[10] = n.length, t[11] = u) : u = t[11], v(o, u);
|
|
187
|
+
}, Oe = (s, e, t) => {
|
|
188
|
+
const n = C.c(5);
|
|
189
|
+
let a, r;
|
|
190
|
+
n[0] !== s || n[1] !== e || n[2] !== t ? (a = () => {
|
|
191
|
+
s && s.data[e] != t && s.publish(e, t);
|
|
192
|
+
}, r = [e, t, s], n[0] = s, n[1] = e, n[2] = t, n[3] = a, n[4] = r) : (a = n[3], r = n[4]), v(a, r), Y(s, e);
|
|
193
|
+
}, le = (s, e, t) => {
|
|
194
|
+
const n = C.c(11), a = t === void 0 ? 0 : t;
|
|
195
|
+
let r;
|
|
196
|
+
n[0] !== s?.data || n[1] !== e ? (r = () => ({
|
|
197
|
+
value: s?.data?.[e]
|
|
198
|
+
}), n[0] = s?.data, n[1] = e, n[2] = r) : r = n[2];
|
|
199
|
+
const [i, l] = E(r), {
|
|
200
|
+
value: o
|
|
201
|
+
} = i;
|
|
202
|
+
let u;
|
|
203
|
+
n[3] !== s || n[4] !== a || n[5] !== e || n[6] !== o ? (u = () => {
|
|
204
|
+
if (s) {
|
|
205
|
+
const d = a == 0 ? (m) => l({
|
|
206
|
+
value: m
|
|
207
|
+
}) : O((m) => l({
|
|
208
|
+
value: m
|
|
209
|
+
}), a), f = s.subscribe(e, d);
|
|
210
|
+
return o != s.data[e] && l({
|
|
211
|
+
value: s.data[e]
|
|
212
|
+
}), () => {
|
|
213
|
+
f();
|
|
130
214
|
};
|
|
131
215
|
}
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return s(), () => i();
|
|
216
|
+
}, n[3] = s, n[4] = a, n[5] = e, n[6] = o, n[7] = u) : u = n[7];
|
|
217
|
+
let c;
|
|
218
|
+
return n[8] !== s || n[9] !== e ? (c = [e, s], n[8] = s, n[9] = e, n[10] = c) : c = n[10], v(u, c), s?.data[e];
|
|
219
|
+
}, ke = (s, e, t) => {
|
|
220
|
+
const [, n] = E(0), a = T(() => t(s?.data[e]), [t, s?.data[e]]);
|
|
221
|
+
return v(() => {
|
|
222
|
+
if (s) {
|
|
223
|
+
let r = a, i = () => {
|
|
224
|
+
let o = t(s.data[e]);
|
|
225
|
+
o != r && (r = o, n((u) => u + 1));
|
|
226
|
+
}, l = s.subscribe(e, i);
|
|
227
|
+
return i(), () => l();
|
|
145
228
|
}
|
|
146
|
-
}, [
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
if (
|
|
150
|
-
for (let [
|
|
151
|
-
|
|
152
|
-
}, [
|
|
153
|
-
},
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
229
|
+
}, [e, s]), a;
|
|
230
|
+
}, P = (s, ...e) => {
|
|
231
|
+
v(() => {
|
|
232
|
+
if (s)
|
|
233
|
+
for (let [t, n] of e)
|
|
234
|
+
s.data[t] != n && s.publish(t, n);
|
|
235
|
+
}, [s, re(e.flat())]), Y(s, ...e.map((t) => t[0]));
|
|
236
|
+
}, Ae = (s, ...e) => {
|
|
237
|
+
const t = C.c(18), n = e, [, a] = E(0);
|
|
238
|
+
let r;
|
|
239
|
+
if (t[0] !== s?.data || t[1] !== n) {
|
|
240
|
+
let c;
|
|
241
|
+
t[3] !== s?.data ? (c = (d) => s?.data?.[d], t[3] = s?.data, t[4] = c) : c = t[4], r = n.map(c), t[0] = s?.data, t[1] = n, t[2] = r;
|
|
242
|
+
} else
|
|
243
|
+
r = t[2];
|
|
244
|
+
const i = r;
|
|
245
|
+
let l;
|
|
246
|
+
t[5] !== s || t[6] !== n || t[7] !== i || t[8] !== a ? (l = () => {
|
|
247
|
+
if (s) {
|
|
248
|
+
let c = i;
|
|
249
|
+
const d = O(() => {
|
|
250
|
+
const p = n.map((h) => s?.data?.[h]);
|
|
251
|
+
n.some((h, g) => c[g] != p[g]) && (c = p, a(ie));
|
|
252
|
+
}, 1), f = n.map((p) => s.subscribe(p, d)), m = setTimeout(d, 1);
|
|
163
253
|
return () => {
|
|
164
|
-
clearTimeout(
|
|
254
|
+
clearTimeout(m), d.cancel(), f.forEach(ce);
|
|
165
255
|
};
|
|
166
256
|
}
|
|
167
|
-
}, [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
257
|
+
}, t[5] = s, t[6] = n, t[7] = i, t[8] = a, t[9] = l) : l = t[9];
|
|
258
|
+
let o;
|
|
259
|
+
t[10] !== s || t[11] !== n ? (o = [s, ...n], t[10] = s, t[11] = n, t[12] = o) : o = t[12], v(l, o);
|
|
260
|
+
let u;
|
|
261
|
+
if (t[13] !== n || t[14] !== i) {
|
|
262
|
+
let c;
|
|
263
|
+
t[16] !== i ? (c = (d, f) => [d, i[f]], t[16] = i, t[17] = c) : c = t[17], u = Object.fromEntries(n.map(c)), t[13] = n, t[14] = i, t[15] = u;
|
|
264
|
+
} else
|
|
265
|
+
u = t[15];
|
|
266
|
+
return u;
|
|
267
|
+
}, He = (s, e, ...t) => {
|
|
268
|
+
const n = C.c(14), a = e === void 0 ? 50 : e, r = t, [, i] = E(0);
|
|
269
|
+
let l;
|
|
270
|
+
if (n[0] !== s?.data || n[1] !== r) {
|
|
271
|
+
let d;
|
|
272
|
+
n[3] !== s?.data ? (d = (f) => s?.data?.[f], n[3] = s?.data, n[4] = d) : d = n[4], l = r.map(d), n[0] = s?.data, n[1] = r, n[2] = l;
|
|
273
|
+
} else
|
|
274
|
+
l = n[2];
|
|
275
|
+
const o = l;
|
|
276
|
+
let u;
|
|
277
|
+
n[5] !== s || n[6] !== a || n[7] !== r || n[8] !== o || n[9] !== i ? (u = () => {
|
|
278
|
+
if (s) {
|
|
279
|
+
let d = o;
|
|
280
|
+
const f = O(() => {
|
|
281
|
+
const h = r.map((g) => s?.data?.[g]);
|
|
282
|
+
r.some((g, S) => d[S] != h[S]) && (d = h, i(ue));
|
|
283
|
+
}, a), m = r.map((h) => s.subscribe(h, f)), p = setTimeout(f, 1);
|
|
178
284
|
return () => {
|
|
179
|
-
clearTimeout(
|
|
285
|
+
clearTimeout(p), f.cancel(), m.forEach(fe);
|
|
180
286
|
};
|
|
181
287
|
}
|
|
182
|
-
}, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
288
|
+
}, n[5] = s, n[6] = a, n[7] = r, n[8] = o, n[9] = i, n[10] = u) : u = n[10];
|
|
289
|
+
let c;
|
|
290
|
+
return n[11] !== s || n[12] !== r ? (c = [s, ...r], n[11] = s, n[12] = r, n[13] = c) : c = n[13], v(u, c), o;
|
|
291
|
+
};
|
|
292
|
+
function ie(s) {
|
|
293
|
+
return s + 1;
|
|
294
|
+
}
|
|
295
|
+
function ce(s) {
|
|
296
|
+
return s();
|
|
297
|
+
}
|
|
298
|
+
function ue(s) {
|
|
299
|
+
return s + 1;
|
|
300
|
+
}
|
|
301
|
+
function fe(s) {
|
|
302
|
+
return s();
|
|
303
|
+
}
|
|
304
|
+
const Ke = (s, e) => {
|
|
305
|
+
const t = (l) => [s, ...Object.entries(l ?? {}).sort((o, u) => o[0].localeCompare(u[0])).flat()].join("-"), n = /* @__PURE__ */ new Set(), a = (l) => {
|
|
306
|
+
const o = C.c(5), u = e(l), c = t(l), d = y(c);
|
|
307
|
+
let f;
|
|
308
|
+
o[0] === Symbol.for("react.memo_cache_sentinel") ? (f = new Error(), o[0] = f) : f = o[0];
|
|
309
|
+
const m = f.stack;
|
|
310
|
+
let p;
|
|
311
|
+
o[1] !== u ? (p = Object.entries(u), o[1] = u, o[2] = p) : p = o[2], P(d, ...p);
|
|
312
|
+
let h;
|
|
313
|
+
return o[3] !== c ? (h = () => {
|
|
314
|
+
if (n.has(c)) {
|
|
315
|
+
const g = new Error("RootContext " + c + " are mounted more than once");
|
|
316
|
+
throw g.stack = m, g;
|
|
196
317
|
}
|
|
197
|
-
return
|
|
198
|
-
|
|
318
|
+
return n.add(c), () => {
|
|
319
|
+
n.delete(c);
|
|
199
320
|
};
|
|
200
|
-
}
|
|
321
|
+
}, o[3] = c, o[4] = h) : h = o[4], v(h), u;
|
|
322
|
+
}, r = (l) => {
|
|
323
|
+
const o = C.c(1);
|
|
324
|
+
let u;
|
|
325
|
+
return o[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ b($, {}), o[0] = u) : u = o[0], u;
|
|
326
|
+
}, i = (l) => {
|
|
327
|
+
const o = C.c(3), u = a(l);
|
|
328
|
+
let c;
|
|
329
|
+
return o[0] !== l || o[1] !== u ? (c = /* @__PURE__ */ b(r, { ...l, ...u }), o[0] = l, o[1] = u, o[2] = c) : c = o[2], c;
|
|
201
330
|
};
|
|
202
|
-
return a.displayName = `StateContainer[${
|
|
203
|
-
name:
|
|
204
|
-
|
|
205
|
-
|
|
331
|
+
return a.displayName = `useState[${s}]`, i.displayName = `StateContainer[${s}]`, r.displayName = `Debug[${s}]`, {
|
|
332
|
+
name: s,
|
|
333
|
+
getCtxName: t,
|
|
334
|
+
useRootState: a,
|
|
335
|
+
Root: i,
|
|
206
336
|
/**
|
|
207
337
|
* Strict consumer: throws if the corresponding Root for these props isn't mounted.
|
|
208
338
|
* Use in development/tests to fail fast when wiring is incorrect.
|
|
209
339
|
*/
|
|
210
|
-
useCtxStateStrict: (
|
|
211
|
-
const
|
|
212
|
-
return
|
|
213
|
-
if (!
|
|
214
|
-
const
|
|
215
|
-
throw
|
|
340
|
+
useCtxStateStrict: (l) => {
|
|
341
|
+
const o = t(l), u = T(() => new Error().stack, []);
|
|
342
|
+
return v(() => {
|
|
343
|
+
if (!n.has(o)) {
|
|
344
|
+
const c = new Error("RootContext [" + o + "] is not mounted");
|
|
345
|
+
throw c.stack = u, c;
|
|
216
346
|
}
|
|
217
|
-
}, [
|
|
347
|
+
}, [o]), y(o);
|
|
218
348
|
},
|
|
219
349
|
/**
|
|
220
350
|
* Lenient consumer: schedules a console.error if the Root isn't mounted instead of throwing.
|
|
221
351
|
* Useful in production to avoid hard crashes while still surfacing misconfiguration.
|
|
222
352
|
*/
|
|
223
|
-
useCtxState: (
|
|
224
|
-
const
|
|
225
|
-
return
|
|
226
|
-
if (!
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
let
|
|
230
|
-
return () => clearTimeout(
|
|
353
|
+
useCtxState: (l) => {
|
|
354
|
+
const o = t(l), u = T(() => new Error().stack, []);
|
|
355
|
+
return v(() => {
|
|
356
|
+
if (!n.has(o)) {
|
|
357
|
+
const c = new Error("RootContext [" + o + "] is not mounted");
|
|
358
|
+
c.stack = u;
|
|
359
|
+
let d = setTimeout(() => console.error(c), 1e3);
|
|
360
|
+
return () => clearTimeout(d);
|
|
231
361
|
}
|
|
232
|
-
}, [
|
|
362
|
+
}, [n.has(o)]), y(o);
|
|
233
363
|
}
|
|
234
364
|
};
|
|
235
|
-
},
|
|
236
|
-
const e =
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
365
|
+
}, de = (s) => Object.keys(s ?? {}).toSorted().map((e) => e + "=" + s?.[e]).join("&"), he = (s) => {
|
|
366
|
+
const e = C.c(1);
|
|
367
|
+
let t;
|
|
368
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ b($, {}), e[0] = t) : t = e[0], t;
|
|
369
|
+
}, me = ({
|
|
370
|
+
useStateFn: s,
|
|
371
|
+
params: e,
|
|
372
|
+
debugging: t
|
|
373
|
+
}) => {
|
|
374
|
+
const n = s(e);
|
|
375
|
+
return t ? /* @__PURE__ */ b(he, { ...n }) : /* @__PURE__ */ b($, {});
|
|
376
|
+
}, Le = ({
|
|
377
|
+
Wrapper: s = Z,
|
|
378
|
+
debugging: e = !1
|
|
379
|
+
}) => {
|
|
380
|
+
const t = y("auto-ctx"), [n, a] = E({}), r = X((l, o, u, c = 0) => {
|
|
381
|
+
const d = l + "?" + de(u);
|
|
382
|
+
return a((f) => ({
|
|
383
|
+
...f,
|
|
384
|
+
[d]: {
|
|
385
|
+
...f[d] ?? {
|
|
386
|
+
useStateFn: o,
|
|
387
|
+
params: u
|
|
388
|
+
},
|
|
389
|
+
counter: (f[d]?.counter ?? 0) + 1,
|
|
390
|
+
keepUntil: void 0,
|
|
391
|
+
useStateFn: o
|
|
392
|
+
}
|
|
393
|
+
})), () => a(({
|
|
394
|
+
[d]: f,
|
|
395
|
+
...m
|
|
396
|
+
}) => ({
|
|
397
|
+
...m,
|
|
398
|
+
...f?.counter > 1 || c > 0 ? {
|
|
399
|
+
[d]: {
|
|
400
|
+
...f,
|
|
401
|
+
counter: f.counter - 1,
|
|
402
|
+
keepUntil: f.counter > 1 ? void 0 : Date.now() + c
|
|
253
403
|
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
r(({ [s]: l, ...u }) => u);
|
|
277
|
-
}, Math.max(0, i - Date.now()));
|
|
404
|
+
} : {}
|
|
405
|
+
}));
|
|
406
|
+
}, []), i = T(() => Object.entries(n).filter(([, {
|
|
407
|
+
counter: l,
|
|
408
|
+
keepUntil: o
|
|
409
|
+
}]) => l <= 0 && o).toSorted(([, {
|
|
410
|
+
keepUntil: l = 0
|
|
411
|
+
}], [, {
|
|
412
|
+
keepUntil: o = 0
|
|
413
|
+
}]) => l - o)?.at(0), [n]);
|
|
414
|
+
return v(() => {
|
|
415
|
+
if (i) {
|
|
416
|
+
const [l, {
|
|
417
|
+
keepUntil: o
|
|
418
|
+
}] = i;
|
|
419
|
+
if (typeof o > "u") throw new Error("Invalid state mgr");
|
|
420
|
+
let u = setTimeout(() => {
|
|
421
|
+
a(({
|
|
422
|
+
[l]: c,
|
|
423
|
+
...d
|
|
424
|
+
}) => d);
|
|
425
|
+
}, Math.max(0, o - Date.now()));
|
|
278
426
|
return () => {
|
|
279
|
-
clearTimeout(
|
|
427
|
+
clearTimeout(u);
|
|
280
428
|
};
|
|
281
429
|
}
|
|
282
|
-
}, [
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
430
|
+
}, [i]), P(t, ["subscribe", r], ["state", n]), /* @__PURE__ */ b($, { children: Object.entries(n).filter(([, {
|
|
431
|
+
counter: l,
|
|
432
|
+
keepUntil: o = 0
|
|
433
|
+
}]) => l > 0 || o >= Date.now()).map(([l, {
|
|
434
|
+
useStateFn: o,
|
|
435
|
+
params: u
|
|
436
|
+
}]) => /* @__PURE__ */ b(s, { children: /* @__PURE__ */ b(me, { params: u, useStateFn: o, debugging: e }, l) }, l)) });
|
|
437
|
+
}, Ve = ({
|
|
438
|
+
useRootState: s,
|
|
439
|
+
getCtxName: e,
|
|
440
|
+
name: t
|
|
441
|
+
}, n = 0) => ({
|
|
442
|
+
useCtxState: (a) => {
|
|
443
|
+
const r = e(a), i = le(y("auto-ctx"), "subscribe");
|
|
444
|
+
return v(() => i?.(t, s, a, n), [s, i, t, r, n]), y(r);
|
|
294
445
|
}
|
|
295
|
-
}),
|
|
296
|
-
const [,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
446
|
+
}), Ue = (s) => {
|
|
447
|
+
const [, e] = E(0), {
|
|
448
|
+
proxy: t,
|
|
449
|
+
finalGetter: n,
|
|
450
|
+
openGetter: a,
|
|
451
|
+
clean: r
|
|
452
|
+
} = T(() => {
|
|
453
|
+
const i = /* @__PURE__ */ new Set(), l = {}, o = /* @__PURE__ */ new Map(), u = new Proxy(s?.data, {
|
|
454
|
+
get(h, g) {
|
|
455
|
+
if (c)
|
|
456
|
+
return i.add(g), l[g] = h[g];
|
|
457
|
+
throw new Error("now allow here");
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
let c = !0, d = O(() => {
|
|
461
|
+
[...i.values()].some((h) => l[h] != s?.data?.[h]) && e((h) => h + 1);
|
|
462
|
+
}, 0), f = () => {
|
|
463
|
+
c = !0, i.clear();
|
|
464
|
+
}, m = () => {
|
|
465
|
+
c = !1, [...i.values()].filter((h) => !o.has(h)).forEach((h) => {
|
|
466
|
+
o.set(h, s?.subscribe(h, d));
|
|
467
|
+
}), [...o.keys()].filter((h) => !i.has(h)).forEach((h) => {
|
|
468
|
+
o.get(h)?.(), o.delete(h);
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
return {
|
|
472
|
+
proxy: u,
|
|
473
|
+
finalGetter: m,
|
|
474
|
+
openGetter: f,
|
|
475
|
+
clean: () => {
|
|
476
|
+
f(), m(), e((h) => h + 1);
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
}, [s]);
|
|
480
|
+
return a(), setTimeout(n, 0), v(() => () => r(), [r]), t;
|
|
329
481
|
};
|
|
330
|
-
function
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
482
|
+
function pe(s) {
|
|
483
|
+
const e = C.c(4);
|
|
484
|
+
let t;
|
|
485
|
+
e[0] !== s ? (t = be(s.toLowerCase().split(" "), "gi"), e[0] = s, e[1] = t) : t = e[1];
|
|
486
|
+
const n = t;
|
|
487
|
+
let a;
|
|
488
|
+
return e[2] !== n ? (a = {
|
|
489
|
+
highlight: n
|
|
490
|
+
}, e[2] = n, e[3] = a) : a = e[3], a;
|
|
335
491
|
}
|
|
336
|
-
function
|
|
337
|
-
return
|
|
492
|
+
function ge(s) {
|
|
493
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
338
494
|
}
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
return new RegExp(`(${
|
|
495
|
+
function be(s, e = "gi") {
|
|
496
|
+
const t = s.map(ge).join("|");
|
|
497
|
+
return new RegExp(`(${t})`, e);
|
|
342
498
|
}
|
|
343
|
-
function
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
for (const
|
|
347
|
-
const [
|
|
348
|
-
|
|
499
|
+
function ve(s, e) {
|
|
500
|
+
const t = [];
|
|
501
|
+
let n = 0;
|
|
502
|
+
for (const a of s.matchAll(e)) {
|
|
503
|
+
const [r] = a, i = a.index;
|
|
504
|
+
i > n && t.push(s.slice(n, i)), t.push(/* @__PURE__ */ b("mark", { children: r }, i)), n = i + r.length;
|
|
349
505
|
}
|
|
350
|
-
return
|
|
506
|
+
return n < s.length && t.push(s.slice(n)), t;
|
|
351
507
|
}
|
|
352
|
-
const
|
|
508
|
+
const z = M.createContext({
|
|
353
509
|
highlight: void 0
|
|
354
|
-
}),
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
);
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
510
|
+
}), Ce = (s) => {
|
|
511
|
+
const e = C.c(3), {
|
|
512
|
+
children: t,
|
|
513
|
+
highlight: n
|
|
514
|
+
} = s, a = pe(n);
|
|
515
|
+
let r;
|
|
516
|
+
return e[0] !== t || e[1] !== a ? (r = /* @__PURE__ */ b(z.Provider, { value: a, children: t }), e[0] = t, e[1] = a, e[2] = r) : r = e[2], r;
|
|
517
|
+
}, Se = (s) => {
|
|
518
|
+
const e = C.c(5), {
|
|
519
|
+
text: t
|
|
520
|
+
} = s, {
|
|
521
|
+
highlight: n
|
|
522
|
+
} = x(z);
|
|
523
|
+
let a;
|
|
524
|
+
e[0] !== n || e[1] !== t ? (a = n ? ve(t, n) : t, e[0] = n, e[1] = t, e[2] = a) : a = e[2];
|
|
525
|
+
const r = a;
|
|
526
|
+
let i;
|
|
527
|
+
return e[3] !== r ? (i = /* @__PURE__ */ b($, { children: r }), e[3] = r, e[4] = i) : i = e[4], i;
|
|
528
|
+
}, B = (s) => {
|
|
529
|
+
const e = C.c(5), {
|
|
530
|
+
name: t,
|
|
531
|
+
value: n
|
|
532
|
+
} = s;
|
|
533
|
+
let a;
|
|
534
|
+
try {
|
|
535
|
+
let l;
|
|
536
|
+
e[0] !== t || e[1] !== n ? (l = JSON.stringify({
|
|
537
|
+
[t]: n
|
|
538
|
+
}, null, 2), e[0] = t, e[1] = n, e[2] = l) : l = e[2], a = l;
|
|
539
|
+
} catch (l) {
|
|
540
|
+
a = String(l);
|
|
541
|
+
}
|
|
542
|
+
const r = a;
|
|
543
|
+
let i;
|
|
544
|
+
return e[3] !== r ? (i = /* @__PURE__ */ b("pre", { children: r }), e[3] = r, e[4] = i) : i = e[4], i;
|
|
545
|
+
}, _e = (s) => {
|
|
546
|
+
const e = C.c(26);
|
|
547
|
+
let t, n, a, r;
|
|
548
|
+
if (e[0] !== s) {
|
|
549
|
+
const {
|
|
550
|
+
selectedKey: R,
|
|
551
|
+
setKey: N,
|
|
552
|
+
currentKey: w,
|
|
553
|
+
highlight: k,
|
|
554
|
+
..._
|
|
555
|
+
} = s;
|
|
556
|
+
a = R, r = N, t = w, n = _, e[0] = s, e[1] = t, e[2] = n, e[3] = a, e[4] = r;
|
|
557
|
+
} else
|
|
558
|
+
t = e[1], n = e[2], a = e[3], r = e[4];
|
|
559
|
+
let i;
|
|
560
|
+
e[5] !== t ? (i = A(t), e[5] = t, e[6] = i) : i = e[6];
|
|
561
|
+
const l = i, o = W(void 0);
|
|
562
|
+
let u, c;
|
|
563
|
+
e[7] !== l ? (u = () => {
|
|
564
|
+
if (o.current) {
|
|
565
|
+
const R = O(() => {
|
|
566
|
+
o.current && (o.current?.classList.add("state-key-updated"), requestAnimationFrame(() => o.current?.classList.remove("state-key-updated")));
|
|
375
567
|
}, 5);
|
|
376
|
-
return
|
|
568
|
+
return l.subscribeAll(R);
|
|
377
569
|
}
|
|
378
|
-
}, [
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
570
|
+
}, c = [l, o], e[7] = l, e[8] = u, e[9] = c) : (u = e[8], c = e[9]), v(u, c);
|
|
571
|
+
const d = t == a;
|
|
572
|
+
let f;
|
|
573
|
+
e[10] !== t || e[11] !== r ? (f = () => r(t), e[10] = t, e[11] = r, e[12] = f) : f = e[12];
|
|
574
|
+
const m = String(t);
|
|
575
|
+
let p;
|
|
576
|
+
e[13] !== m ? (p = /* @__PURE__ */ b("div", { className: "state-key-name", children: /* @__PURE__ */ b(Se, { text: m }) }), e[13] = m, e[14] = p) : p = e[14];
|
|
577
|
+
let h;
|
|
578
|
+
e[15] !== l.data ? (h = Object.keys(l.data), e[15] = l.data, e[16] = h) : h = e[16];
|
|
579
|
+
let g;
|
|
580
|
+
e[17] !== h.length ? (g = /* @__PURE__ */ D("div", { className: "state-key-meta", children: [
|
|
581
|
+
h.length,
|
|
582
|
+
" items"
|
|
583
|
+
] }), e[17] = h.length, e[18] = g) : g = e[18];
|
|
584
|
+
let S;
|
|
585
|
+
return e[19] !== t || e[20] !== n || e[21] !== d || e[22] !== f || e[23] !== p || e[24] !== g ? (S = /* @__PURE__ */ D("div", { ref: o, className: "state-key", title: t, "data-active": d, onClick: f, ...n, children: [
|
|
586
|
+
p,
|
|
587
|
+
g
|
|
588
|
+
] }), e[19] = t, e[20] = n, e[21] = d, e[22] = f, e[23] = p, e[24] = g, e[25] = S) : S = e[25], S;
|
|
589
|
+
}, L = A.cache, Ee = (s) => {
|
|
590
|
+
const e = C.c(27), {
|
|
591
|
+
Component: t
|
|
592
|
+
} = s, [n, a] = E(Ne), [r, i] = E(""), [l, o] = E("");
|
|
593
|
+
let u, c;
|
|
594
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
|
|
595
|
+
const _ = setInterval(() => {
|
|
596
|
+
a(we);
|
|
403
597
|
}, 50);
|
|
404
|
-
return () => clearInterval(
|
|
405
|
-
}, [
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
},
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
]
|
|
598
|
+
return () => clearInterval(_);
|
|
599
|
+
}, c = [L], e[0] = u, e[1] = c) : (u = e[0], c = e[1]), v(u, c);
|
|
600
|
+
let d;
|
|
601
|
+
e[2] !== r ? (d = r.toLowerCase().split(" "), e[2] = r, e[3] = d) : d = e[3];
|
|
602
|
+
const f = d;
|
|
603
|
+
let m;
|
|
604
|
+
e[4] !== f ? (m = (_) => {
|
|
605
|
+
const H = _.toLowerCase();
|
|
606
|
+
return f.every((Q) => H.includes(Q));
|
|
607
|
+
}, e[4] = f, e[5] = m) : m = e[5];
|
|
608
|
+
const p = m;
|
|
609
|
+
let h;
|
|
610
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = (_) => i(_.target.value), e[6] = h) : h = e[6];
|
|
611
|
+
let g;
|
|
612
|
+
e[7] !== r ? (g = /* @__PURE__ */ b("input", { placeholder: "Type to Filter ...", className: "state-filter", value: r, onChange: h }), e[7] = r, e[8] = g) : g = e[8];
|
|
613
|
+
let S;
|
|
614
|
+
if (e[9] !== n || e[10] !== p || e[11] !== l) {
|
|
615
|
+
let _;
|
|
616
|
+
e[13] !== l ? (_ = (H) => /* @__PURE__ */ b(_e, { selectedKey: l, setKey: o, currentKey: H }, H), e[13] = l, e[14] = _) : _ = e[14], S = n.map(ye).filter(Te).filter(p).map(_), e[9] = n, e[10] = p, e[11] = l, e[12] = S;
|
|
617
|
+
} else
|
|
618
|
+
S = e[12];
|
|
619
|
+
let R;
|
|
620
|
+
e[15] !== r || e[16] !== S ? (R = /* @__PURE__ */ b(Ce, { highlight: r, children: S }), e[15] = r, e[16] = S, e[17] = R) : R = e[17];
|
|
621
|
+
let N;
|
|
622
|
+
e[18] !== g || e[19] !== R ? (N = /* @__PURE__ */ D("div", { className: "state-list", children: [
|
|
623
|
+
g,
|
|
624
|
+
R
|
|
625
|
+
] }), e[18] = g, e[19] = R, e[20] = N) : N = e[20];
|
|
626
|
+
let w;
|
|
627
|
+
e[21] !== t || e[22] !== l ? (w = /* @__PURE__ */ b("div", { className: "state-view", children: /* @__PURE__ */ b(Re, { dataKey: l, Component: t }, l) }), e[21] = t, e[22] = l, e[23] = w) : w = e[23];
|
|
628
|
+
let k;
|
|
629
|
+
return e[24] !== w || e[25] !== N ? (k = /* @__PURE__ */ D("div", { className: "main-panel", children: [
|
|
630
|
+
N,
|
|
631
|
+
w
|
|
632
|
+
] }), e[24] = w, e[25] = N, e[26] = k) : k = e[26], k;
|
|
633
|
+
}, Re = (s) => {
|
|
634
|
+
const e = C.c(11), {
|
|
635
|
+
dataKey: t,
|
|
636
|
+
Component: n
|
|
637
|
+
} = s, a = n === void 0 ? B : n;
|
|
638
|
+
let r;
|
|
639
|
+
e[0] !== t ? (r = A(t), e[0] = t, e[1] = r) : r = e[1];
|
|
640
|
+
const i = r, l = i?.data;
|
|
641
|
+
let o;
|
|
642
|
+
e[2] !== l ? (o = {
|
|
643
|
+
...l
|
|
644
|
+
}, e[2] = l, e[3] = o) : o = e[3];
|
|
645
|
+
const [u, c] = E(o);
|
|
646
|
+
let d, f;
|
|
647
|
+
e[4] !== i ? (d = () => {
|
|
648
|
+
const p = O(c, 5);
|
|
649
|
+
return i.subscribeAll((h, g) => p({
|
|
650
|
+
...g
|
|
651
|
+
}));
|
|
652
|
+
}, f = [i], e[4] = i, e[5] = d, e[6] = f) : (d = e[5], f = e[6]), v(d, f);
|
|
653
|
+
let m;
|
|
654
|
+
return e[7] !== a || e[8] !== u || e[9] !== t ? (m = /* @__PURE__ */ b(a, { value: u, name: t }), e[7] = a, e[8] = u, e[9] = t, e[10] = m) : m = e[10], m;
|
|
655
|
+
};
|
|
656
|
+
function Ne() {
|
|
657
|
+
return [...L.keys()];
|
|
658
|
+
}
|
|
659
|
+
function we(s) {
|
|
660
|
+
return s.length != L.size ? [...L.keys()] : s;
|
|
661
|
+
}
|
|
662
|
+
function ye(s) {
|
|
663
|
+
return JSON.parse(s)?.[0];
|
|
664
|
+
}
|
|
665
|
+
function Te(s) {
|
|
666
|
+
return s != "auto-ctx" && s;
|
|
667
|
+
}
|
|
668
|
+
const je = (s) => {
|
|
669
|
+
const e = C.c(19);
|
|
670
|
+
let t, n, a;
|
|
671
|
+
e[0] !== s ? ({
|
|
672
|
+
toggleButton: n,
|
|
673
|
+
Component: a,
|
|
674
|
+
...t
|
|
675
|
+
} = s, e[0] = s, e[1] = t, e[2] = n, e[3] = a) : (t = e[1], n = e[2], a = e[3]);
|
|
676
|
+
const r = a === void 0 ? B : a, [i, l] = E(!1);
|
|
677
|
+
let o;
|
|
678
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (o = () => l(!0), e[4] = o) : o = e[4];
|
|
679
|
+
const u = t?.children ?? "Toggle Dev Tool";
|
|
680
|
+
let c;
|
|
681
|
+
e[5] !== i || e[6] !== t || e[7] !== u ? (c = /* @__PURE__ */ b("button", { className: "react-state-dev-btn", "data-active": i, onClick: o, ...t, children: u }), e[5] = i, e[6] = t, e[7] = u, e[8] = c) : c = e[8];
|
|
682
|
+
let d;
|
|
683
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ b("button", { className: "close-btn", onClick: () => l(!1), children: "[x]" }), e[9] = d) : d = e[9];
|
|
684
|
+
let f;
|
|
685
|
+
e[10] !== r || e[11] !== i ? (f = i && /* @__PURE__ */ b(Ee, { Component: r }), e[10] = r, e[11] = i, e[12] = f) : f = e[12];
|
|
686
|
+
let m;
|
|
687
|
+
e[13] !== i || e[14] !== f ? (m = /* @__PURE__ */ D("div", { className: "react-state-dev-container", "data-active": i, children: [
|
|
688
|
+
d,
|
|
689
|
+
f
|
|
690
|
+
] }), e[13] = i, e[14] = f, e[15] = m) : m = e[15];
|
|
691
|
+
let p;
|
|
692
|
+
return e[16] !== c || e[17] !== m ? (p = /* @__PURE__ */ D($, { children: [
|
|
693
|
+
c,
|
|
694
|
+
m
|
|
695
|
+
] }), e[16] = c, e[17] = m, e[18] = p) : p = e[18], p;
|
|
452
696
|
};
|
|
453
697
|
export {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
698
|
+
Le as AutoRootCtx,
|
|
699
|
+
ae as Context,
|
|
700
|
+
je as DevToolContainer,
|
|
701
|
+
Ve as createAutoCtx,
|
|
702
|
+
Ke as createRootCtx,
|
|
703
|
+
A as getContext,
|
|
704
|
+
re as useArrayHash,
|
|
705
|
+
y as useDataContext,
|
|
706
|
+
Oe as useDataSource,
|
|
707
|
+
P as useDataSourceMultiple,
|
|
708
|
+
le as useDataSubscribe,
|
|
709
|
+
Ae as useDataSubscribeMultiple,
|
|
710
|
+
He as useDataSubscribeMultipleWithDebounce,
|
|
711
|
+
ke as useDataSubscribeWithTransform,
|
|
712
|
+
Ue as useQuickSubscribe
|
|
469
713
|
};
|
|
470
714
|
//# sourceMappingURL=index.es.js.map
|