@e7w/easy-model 0.1.7 → 0.1.9

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,42 +1,42 @@
1
- var Te = Object.defineProperty;
2
- var Pe = (e, r, n) => r in e ? Te(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n;
3
- var g = (e, r, n) => Pe(e, typeof r != "symbol" ? r + "" : r, n);
4
- import Oe, { useReducer as Se, useEffect as je, createContext as xe, useContext as ae } from "react";
5
- const G = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), ce = Symbol("origin");
6
- let v = null;
7
- const U = ["includes", "indexOf", "lastIndexOf"], Ae = [Promise, RegExp, Date, WeakMap, WeakSet, Map, Set];
1
+ var xe = Object.defineProperty;
2
+ var Ae = (e, r, n) => r in e ? xe(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n;
3
+ var g = (e, r, n) => Ae(e, typeof r != "symbol" ? r + "" : r, n);
4
+ import Ce, { useReducer as Me, useEffect as ue, Children as Ne } from "react";
5
+ const V = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), fe = Symbol("origin");
6
+ let m = null;
7
+ const q = ["includes", "indexOf", "lastIndexOf"], Le = [Promise, RegExp, Date, WeakMap, WeakSet, Map, Set];
8
8
  function C(e) {
9
- if (e = _(e), !e || Ae.some((i) => e instanceof i)) return e;
10
- if (G.has(e)) return G.get(e);
9
+ if (e = p(e), !e || Le.some((i) => e instanceof i)) return e;
10
+ if (V.has(e)) return V.get(e);
11
11
  const r = {}, n = {}, a = new Proxy(e, {
12
12
  get(i, o, c) {
13
- if (o === ce) return i;
14
- let s = ue(i, o);
15
- return s || (s = Reflect.get(i, o, c), typeof s == "function" ? (n[o] || (n[o] = s.bind(C(i))), s = n[o]) : typeof s == "object" && s !== null && (r[o] || (r[o] = q(s, re(e, o))), s = C(s)), s);
13
+ if (o === fe) return i;
14
+ let s = de(i, o);
15
+ return s || (s = Reflect.get(i, o, c), typeof s == "function" ? (n[o] || (n[o] = s.bind(C(i))), s = n[o]) : typeof s == "object" && s !== null && (r[o] || (r[o] = I(s, re(e, o))), s = C(s)), s);
16
16
  },
17
17
  set(i, o, c, s) {
18
18
  let f = Reflect.get(i, o, s);
19
- if (f = _(f), c = _(c), f === c) return !0;
20
- const l = Reflect.set(i, o, c, s);
21
- if (l) {
22
- r[o] && (r[o](), delete r[o]), typeof c == "object" && c !== null && (r[o] = q(c, re(e, o))), n[o] && delete n[o];
23
- const b = v;
24
- v = /* @__PURE__ */ new WeakSet(), J(i, [o], f, c), v = b;
19
+ if (f = p(f), c = p(c), f === c) return !0;
20
+ const u = Reflect.set(i, o, c, s);
21
+ if (u) {
22
+ r[o] && (r[o](), delete r[o]), typeof c == "object" && c !== null && (r[o] = I(c, re(e, o))), n[o] && delete n[o];
23
+ const b = m;
24
+ m = /* @__PURE__ */ new WeakSet(), B(i, [o], f, c), m = b;
25
25
  }
26
- return l;
26
+ return u;
27
27
  },
28
28
  deleteProperty(i, o) {
29
29
  let c = Reflect.get(i, o);
30
- c = _(c);
30
+ c = p(c);
31
31
  const s = Reflect.deleteProperty(i, o);
32
- return s && (r[o] && (r[o](), delete r[o]), n[o] && delete n[o], J(i, [o], c, void 0)), s;
32
+ return s && (r[o] && (r[o](), delete r[o]), n[o] && delete n[o], B(i, [o], c, void 0)), s;
33
33
  }
34
34
  });
35
- return G.set(e, a), a;
35
+ return V.set(e, a), a;
36
36
  }
37
- function q(e, r) {
38
- e = _(e), L.has(e) || L.set(e, /* @__PURE__ */ new Map());
39
- const n = L.get(e), a = Symbol();
37
+ function I(e, r) {
38
+ e = p(e), W.has(e) || W.set(e, /* @__PURE__ */ new Map());
39
+ const n = W.get(e), a = Symbol();
40
40
  return n.set(a, r), function() {
41
41
  n.delete(a);
42
42
  };
@@ -44,13 +44,13 @@ function q(e, r) {
44
44
  function re(e, r) {
45
45
  return function(...n) {
46
46
  const [a, ...i] = n;
47
- J(e, [r, ...a], ...i);
47
+ B(e, [r, ...a], ...i);
48
48
  };
49
49
  }
50
- function J(e, ...r) {
51
- if (e = _(e), v != null && v.has(e)) return;
52
- v == null || v.add(e);
53
- const n = L.get(e);
50
+ function B(e, ...r) {
51
+ if (e = p(e), m != null && m.has(e)) return;
52
+ m == null || m.add(e);
53
+ const n = W.get(e);
54
54
  if (!n) return;
55
55
  [...n.values()].forEach((i) => {
56
56
  const o = new EventTarget(), c = new Event("__trigger__");
@@ -60,111 +60,126 @@ function J(e, ...r) {
60
60
  }
61
61
  });
62
62
  }
63
- function _(e) {
64
- return typeof e != "object" || e === null ? e : e[ce] ?? e;
63
+ function p(e) {
64
+ return typeof e != "object" || e === null ? e : e[fe] ?? e;
65
65
  }
66
- function ue(e, r) {
67
- if (e = _(e), ["constructor", "__proto__"].includes(r))
66
+ function de(e, r) {
67
+ if (e = p(e), ["constructor", "__proto__"].includes(r))
68
68
  return Reflect.get(e, r);
69
69
  if (r === "hasOwnProperty")
70
70
  return function(n) {
71
- return Object.prototype.hasOwnProperty.call(_(this), n);
71
+ return Object.prototype.hasOwnProperty.call(p(this), n);
72
72
  };
73
- if (Array.isArray(e) && U.includes(r))
73
+ if (Array.isArray(e) && q.includes(r))
74
74
  return function(...n) {
75
- const a = U[r].apply(_(this), n);
76
- return a === -1 || a === !1 ? U[r].apply(_(this), n.map(_)) : a;
75
+ const a = q[r].apply(p(this), n);
76
+ return a === -1 || a === !1 ? q[r].apply(p(this), n.map(p)) : a;
77
77
  };
78
78
  }
79
- const T = Symbol("instance"), M = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap();
80
- function W(e) {
79
+ const w = Symbol("instance"), N = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakSet(), J = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap();
80
+ function $(e) {
81
81
  if (ne.has(e))
82
82
  return e;
83
- if (M.has(e))
84
- return M.get(e);
83
+ if (N.has(e))
84
+ return N.get(e);
85
85
  const r = {};
86
- o.prototype = new Proxy(
87
- {
88
- constructor: e,
89
- __proto__: e.prototype
90
- },
91
- {
92
- get(c, s, f) {
93
- let l = ue(c, s);
94
- return l || (l = Reflect.get(c, s, f), typeof s == "symbol" || ["constructor", "__proto__"].includes(s) || typeof l != "function") ? l : (r[s] || (r[s] = function(...b) {
95
- return l.apply(C(this), b);
96
- }), r[s]);
97
- }
86
+ o.prototype = new Proxy({
87
+ constructor: e,
88
+ __proto__: e.prototype
89
+ }, {
90
+ get(c, s, f) {
91
+ let u = de(c, s);
92
+ return u || (u = Reflect.get(c, s, f), typeof s == "symbol" || ["constructor", "__proto__"].includes(s) || typeof u != "function") ? u : (r[s] || (r[s] = function(...b) {
93
+ return u.apply(C(this), b);
94
+ }), r[s]);
98
95
  }
99
- );
100
- const n = /* @__PURE__ */ new Map(), a = new FinalizationRegistry(
101
- ({ args: c, token: s }) => {
102
- var f;
103
- le(n, c), (f = V.get(s)) == null || f(), a.unregister(s);
104
- }
105
- ), i = new Proxy(e, {
96
+ });
97
+ const n = /* @__PURE__ */ new Map(), a = new FinalizationRegistry(({
98
+ args: c,
99
+ token: s
100
+ }) => {
101
+ var f;
102
+ be(n, c), (f = X.get(s)) == null || f(), a.unregister(s);
103
+ }), i = new Proxy(e, {
106
104
  apply(c, s, f) {
107
- var b, h, p, w;
108
- let l = n;
109
- for (let E = 0; E < f.length; E++)
110
- l.has(f[E]) || l.set(f[E], /* @__PURE__ */ new Map()), l = l.get(f[E]);
111
- if (!l.has(T) || l.get(T) !== void 0 && !((h = (b = l.get(T)) == null ? void 0 : b.deref) != null && h.call(b))) {
112
- l.set(T, void 0);
113
- const E = C(Reflect.construct(c, f, o));
114
- l.set(T, new WeakRef(E));
115
- const P = fe(E);
116
- a.register(E, { args: f, token: P }, P);
105
+ var b, E, R, v;
106
+ let u = n;
107
+ for (let y = 0; y < f.length; y++)
108
+ u.has(f[y]) || u.set(f[y], /* @__PURE__ */ new Map()), u = u.get(f[y]);
109
+ if (!u.has(w) || u.get(w) !== void 0 && !((E = (b = u.get(w)) == null ? void 0 : b.deref) != null && E.call(b))) {
110
+ u.set(w, void 0);
111
+ const y = C(Reflect.construct(c, f, o));
112
+ u.set(w, new WeakRef(y));
113
+ const k = _e(y);
114
+ a.register(y, {
115
+ args: f,
116
+ token: k
117
+ }, k);
117
118
  }
118
- return (w = (p = l.get(T)) == null ? void 0 : p.deref) == null ? void 0 : w.call(p);
119
+ return (v = (R = u.get(w)) == null ? void 0 : R.deref) == null ? void 0 : v.call(R);
119
120
  }
120
121
  });
121
- return M.set(e, i), ne.add(i), M.get(e);
122
+ return N.set(e, i), ne.add(i), N.get(e);
122
123
  function o() {
123
124
  }
124
125
  }
125
- function le(e, r) {
126
- if (r.length === 0) return e.delete(T);
126
+ function be(e, r) {
127
+ if (r.length === 0) return e.delete(w);
127
128
  const [n, ...a] = r, i = e.get(n);
128
- if (!(i instanceof Map && (le(i, a), i.size > 0)))
129
+ if (!(i instanceof Map && (be(i, a), i.size > 0)))
129
130
  return e.delete(n);
130
131
  }
131
- function Je(e) {
132
- const r = C(e), n = fe(r);
132
+ function Ze(e) {
133
+ const r = C(e), n = _e(r);
133
134
  return {
134
135
  register(a) {
135
- n && V.set(n, a);
136
+ n && X.set(n, a);
136
137
  },
137
138
  unregister() {
138
- n && V.delete(n);
139
+ n && X.delete(n);
139
140
  }
140
141
  };
141
142
  }
142
- function fe(e) {
143
- return z.has(e) || z.set(e, {}), z.get(e);
143
+ function _e(e) {
144
+ return J.has(e) || J.set(e, {}), J.get(e);
145
+ }
146
+ const We = /* @__PURE__ */ Object.create(null);
147
+ function Qe(e, r) {
148
+ const n = $(e), a = r ? n(...r) : We;
149
+ return he(a);
144
150
  }
145
- const Ce = /* @__PURE__ */ Object.create(null);
146
- function Ve(e, r) {
147
- const n = W(e), a = r ? n(...r) : Ce;
148
- return de(a);
151
+ function he(e) {
152
+ const [, r] = Me((n) => (n + 1) % 100, 0);
153
+ return ue(() => (r(), I(e, () => r())), [e]), e;
149
154
  }
150
- function de(e) {
151
- const [, r] = Se((n) => (n + 1) % 100, 0);
152
- return je(() => (r(), q(e, () => r())), [e]), e;
155
+ function Ke(...e) {
156
+ ue(() => I(...e), e);
153
157
  }
154
- class Me {
158
+ const Ie = Promise.withResolvers ? () => Promise.withResolvers() : () => {
159
+ let e, r;
160
+ return {
161
+ promise: new Promise((a, i) => {
162
+ e = a, r = i;
163
+ }),
164
+ resolve: e,
165
+ reject: r
166
+ };
167
+ };
168
+ class $e {
155
169
  constructor(r, ...n) {
156
170
  g(this, "symbol", Symbol());
157
171
  g(this, "args");
158
172
  this.target = r, this.args = n;
159
173
  }
160
174
  }
161
- const Ne = W(Me);
162
- class Le {
175
+ const Fe = $($e);
176
+ class Ye {
163
177
  constructor() {
164
178
  g(this, "loading", {});
165
179
  g(this, "globalLoading", 0);
166
180
  g(this, "onceTokens", /* @__PURE__ */ new WeakMap());
167
181
  g(this, "oncePool", {});
182
+ g(this, "loadingTokens", /* @__PURE__ */ new WeakMap());
168
183
  }
169
184
  addGlobalLoading() {
170
185
  this.globalLoading++;
@@ -173,46 +188,67 @@ class Le {
173
188
  this.globalLoading--;
174
189
  }
175
190
  load(r = !1) {
176
- return (n, { name: a }) => {
177
- const { loading: i, addGlobalLoading: o, subGlobalLoading: c } = this;
178
- return async function(...s) {
179
- const f = Reflect.get(this, a), l = Ne(f, ...s);
180
- if (!!i[l.symbol]) return i[l.symbol][1];
181
- const { promise: h, resolve: p, reject: w } = Promise.withResolvers();
182
- i[l.symbol] = [f, h], r && o();
191
+ return (n, {
192
+ name: a
193
+ }) => {
194
+ const {
195
+ loading: i,
196
+ addGlobalLoading: o,
197
+ subGlobalLoading: c,
198
+ loadingTokens: s
199
+ } = this;
200
+ return async function(...f) {
201
+ const u = Reflect.get(this, a), b = Fe(u, ...f);
202
+ if (s.set(u, b.symbol), !!i[b.symbol]) return i[b.symbol];
203
+ const {
204
+ promise: R,
205
+ resolve: v,
206
+ reject: y
207
+ } = Ie();
208
+ i[b.symbol] = R, r && o();
183
209
  try {
184
- const E = await n.apply(this, s);
185
- p(E);
186
- } catch (E) {
187
- w(E);
210
+ const k = await n.apply(this, f);
211
+ v(k);
212
+ } catch (k) {
213
+ y(k);
188
214
  }
189
- return Reflect.deleteProperty(i, l.symbol), r && c(), h;
215
+ return Reflect.deleteProperty(i, b.symbol), r && c(), s.delete(u), R;
190
216
  };
191
217
  };
192
218
  }
193
- once(r, { name: n }) {
194
- const { oncePool: a, onceTokens: i } = this;
219
+ once(r, {
220
+ name: n
221
+ }) {
222
+ const {
223
+ oncePool: a,
224
+ onceTokens: i
225
+ } = this;
195
226
  return function(...o) {
196
227
  const c = Reflect.get(this, n);
197
228
  i.has(c) || i.set(c, Symbol());
198
229
  const s = i.get(c);
199
- return !!a[s] || (a[s] = r.apply(this, o).catch((l) => (Reflect.deleteProperty(a, s), Promise.reject(l)))), a[s];
230
+ return !!a[s] || (a[s] = r.apply(this, o).catch((u) => (Reflect.deleteProperty(a, s), Promise.reject(u)))), a[s];
200
231
  };
201
232
  }
202
233
  isLoading(r) {
203
- return Object.getOwnPropertySymbols(this.loading).some(
204
- (n) => this.loading[n][0] === r
205
- );
234
+ const n = this.loadingTokens.get(r);
235
+ return n ? !!this.loading[n] : !1;
206
236
  }
207
237
  get isGlobalLoading() {
208
238
  return this.globalLoading > 0;
209
239
  }
210
240
  }
211
- const We = W(Le)(), Xe = () => {
212
- const { isGlobalLoading: e, isLoading: r } = de(We);
213
- return { isGlobalLoading: e, isLoading: r };
241
+ const ze = $(Ye)(), et = () => {
242
+ const {
243
+ isGlobalLoading: e,
244
+ isLoading: r
245
+ } = he(ze);
246
+ return {
247
+ isGlobalLoading: e,
248
+ isLoading: r
249
+ };
214
250
  };
215
- var N = { exports: {} }, x = {};
251
+ var L = { exports: {} }, x = {};
216
252
  /**
217
253
  * @license React
218
254
  * react-jsx-runtime.production.js
@@ -223,7 +259,7 @@ var N = { exports: {} }, x = {};
223
259
  * LICENSE file in the root directory of this source tree.
224
260
  */
225
261
  var oe;
226
- function Ie() {
262
+ function De() {
227
263
  if (oe) return x;
228
264
  oe = 1;
229
265
  var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
@@ -255,46 +291,46 @@ var A = {};
255
291
  * LICENSE file in the root directory of this source tree.
256
292
  */
257
293
  var se;
258
- function Ye() {
259
- return se || (se = 1, process.env.NODE_ENV !== "production" && function() {
294
+ function Ge() {
295
+ return se || (se = 1, process.env.NODE_ENV !== "production" && (function() {
260
296
  function e(t) {
261
297
  if (t == null) return null;
262
298
  if (typeof t == "function")
263
- return t.$$typeof === ke ? null : t.displayName || t.name || null;
299
+ return t.$$typeof === je ? null : t.displayName || t.name || null;
264
300
  if (typeof t == "string") return t;
265
301
  switch (t) {
266
- case P:
302
+ case F:
267
303
  return "Fragment";
268
- case me:
304
+ case pe:
269
305
  return "Profiler";
270
- case be:
306
+ case Re:
271
307
  return "StrictMode";
272
- case _e:
308
+ case ge:
273
309
  return "Suspense";
274
- case ye:
310
+ case we:
275
311
  return "SuspenseList";
276
- case he:
312
+ case Pe:
277
313
  return "Activity";
278
314
  }
279
315
  if (typeof t == "object")
280
316
  switch (typeof t.tag == "number" && console.error(
281
317
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
282
318
  ), t.$$typeof) {
283
- case E:
319
+ case k:
284
320
  return "Portal";
321
+ case me:
322
+ return t.displayName || "Context";
285
323
  case Ee:
286
- return (t.displayName || "Context") + ".Provider";
287
- case Re:
288
324
  return (t._context.displayName || "Context") + ".Consumer";
289
- case pe:
290
- var u = t.render;
291
- return t = t.displayName, t || (t = u.displayName || u.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
292
- case ve:
293
- return u = t.displayName || null, u !== null ? u : e(t.type) || "Memo";
294
- case B:
295
- u = t._payload, t = t._init;
325
+ case ke:
326
+ var l = t.render;
327
+ return t = t.displayName, t || (t = l.displayName || l.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
328
+ case Te:
329
+ return l = t.displayName || null, l !== null ? l : e(t.type) || "Memo";
330
+ case Y:
331
+ l = t._payload, t = t._init;
296
332
  try {
297
- return e(t(u));
333
+ return e(t(l));
298
334
  } catch {
299
335
  }
300
336
  }
@@ -306,33 +342,33 @@ function Ye() {
306
342
  function n(t) {
307
343
  try {
308
344
  r(t);
309
- var u = !1;
345
+ var l = !1;
310
346
  } catch {
311
- u = !0;
347
+ l = !0;
312
348
  }
313
- if (u) {
314
- u = console;
315
- var d = u.error, m = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
349
+ if (l) {
350
+ l = console;
351
+ var d = l.error, _ = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
316
352
  return d.call(
317
- u,
353
+ l,
318
354
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
319
- m
355
+ _
320
356
  ), r(t);
321
357
  }
322
358
  }
323
359
  function a(t) {
324
- if (t === P) return "<>";
325
- if (typeof t == "object" && t !== null && t.$$typeof === B)
360
+ if (t === F) return "<>";
361
+ if (typeof t == "object" && t !== null && t.$$typeof === Y)
326
362
  return "<...>";
327
363
  try {
328
- var u = e(t);
329
- return u ? "<" + u + ">" : "<...>";
364
+ var l = e(t);
365
+ return l ? "<" + l + ">" : "<...>";
330
366
  } catch {
331
367
  return "<...>";
332
368
  }
333
369
  }
334
370
  function i() {
335
- var t = I.A;
371
+ var t = z.A;
336
372
  return t === null ? null : t.getOwner();
337
373
  }
338
374
  function o() {
@@ -340,16 +376,16 @@ function Ye() {
340
376
  }
341
377
  function c(t) {
342
378
  if (H.call(t, "key")) {
343
- var u = Object.getOwnPropertyDescriptor(t, "key").get;
344
- if (u && u.isReactWarning) return !1;
379
+ var l = Object.getOwnPropertyDescriptor(t, "key").get;
380
+ if (l && l.isReactWarning) return !1;
345
381
  }
346
382
  return t.key !== void 0;
347
383
  }
348
- function s(t, u) {
384
+ function s(t, l) {
349
385
  function d() {
350
386
  Z || (Z = !0, console.error(
351
387
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
352
- u
388
+ l
353
389
  ));
354
390
  }
355
391
  d.isReactWarning = !0, Object.defineProperty(t, "key", {
@@ -363,14 +399,15 @@ function Ye() {
363
399
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
364
400
  )), t = this.props.ref, t !== void 0 ? t : null;
365
401
  }
366
- function l(t, u, d, m, k, y, $, F) {
367
- return d = y.ref, t = {
368
- $$typeof: w,
402
+ function u(t, l, d, _, M, G) {
403
+ var h = d.ref;
404
+ return t = {
405
+ $$typeof: y,
369
406
  type: t,
370
- key: u,
371
- props: y,
372
- _owner: k
373
- }, (d !== void 0 ? d : null) !== null ? Object.defineProperty(t, "ref", {
407
+ key: l,
408
+ props: d,
409
+ _owner: _
410
+ }, (h !== void 0 ? h : null) !== null ? Object.defineProperty(t, "ref", {
374
411
  enumerable: !1,
375
412
  get: f
376
413
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
@@ -387,181 +424,215 @@ function Ye() {
387
424
  configurable: !1,
388
425
  enumerable: !1,
389
426
  writable: !0,
390
- value: $
427
+ value: M
391
428
  }), Object.defineProperty(t, "_debugTask", {
392
429
  configurable: !1,
393
430
  enumerable: !1,
394
431
  writable: !0,
395
- value: F
432
+ value: G
396
433
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
397
434
  }
398
- function b(t, u, d, m, k, y, $, F) {
399
- var R = u.children;
400
- if (R !== void 0)
401
- if (m)
402
- if (we(R)) {
403
- for (m = 0; m < R.length; m++)
404
- h(R[m]);
405
- Object.freeze && Object.freeze(R);
435
+ function b(t, l, d, _, M, G) {
436
+ var h = l.children;
437
+ if (h !== void 0)
438
+ if (_)
439
+ if (Oe(h)) {
440
+ for (_ = 0; _ < h.length; _++)
441
+ E(h[_]);
442
+ Object.freeze && Object.freeze(h);
406
443
  } else
407
444
  console.error(
408
445
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
409
446
  );
410
- else h(R);
411
- if (H.call(u, "key")) {
412
- R = e(t);
413
- var O = Object.keys(u).filter(function(ge) {
414
- return ge !== "key";
447
+ else E(h);
448
+ if (H.call(l, "key")) {
449
+ h = e(t);
450
+ var P = Object.keys(l).filter(function(Se) {
451
+ return Se !== "key";
415
452
  });
416
- m = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", te[R + m] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
453
+ _ = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", te[h + _] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
417
454
  `A props object containing a "key" prop is being spread into JSX:
418
455
  let props = %s;
419
456
  <%s {...props} />
420
457
  React keys must be passed directly to JSX without using spread:
421
458
  let props = %s;
422
459
  <%s key={someKey} {...props} />`,
423
- m,
424
- R,
425
- O,
426
- R
427
- ), te[R + m] = !0);
460
+ _,
461
+ h,
462
+ P,
463
+ h
464
+ ), te[h + _] = !0);
428
465
  }
429
- if (R = null, d !== void 0 && (n(d), R = "" + d), c(u) && (n(u.key), R = "" + u.key), "key" in u) {
466
+ if (h = null, d !== void 0 && (n(d), h = "" + d), c(l) && (n(l.key), h = "" + l.key), "key" in l) {
430
467
  d = {};
431
- for (var D in u)
432
- D !== "key" && (d[D] = u[D]);
433
- } else d = u;
434
- return R && s(
468
+ for (var U in l)
469
+ U !== "key" && (d[U] = l[U]);
470
+ } else d = l;
471
+ return h && s(
435
472
  d,
436
473
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
437
- ), l(
474
+ ), u(
438
475
  t,
439
- R,
440
- y,
441
- k,
442
- i(),
476
+ h,
443
477
  d,
444
- $,
445
- F
478
+ i(),
479
+ M,
480
+ G
446
481
  );
447
482
  }
448
- function h(t) {
449
- typeof t == "object" && t !== null && t.$$typeof === w && t._store && (t._store.validated = 1);
483
+ function E(t) {
484
+ R(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === Y && (t._payload.status === "fulfilled" ? R(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
485
+ }
486
+ function R(t) {
487
+ return typeof t == "object" && t !== null && t.$$typeof === y;
450
488
  }
451
- var p = Oe, w = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), be = Symbol.for("react.strict_mode"), me = Symbol.for("react.profiler"), Re = Symbol.for("react.consumer"), Ee = Symbol.for("react.context"), pe = Symbol.for("react.forward_ref"), _e = Symbol.for("react.suspense"), ye = Symbol.for("react.suspense_list"), ve = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), he = Symbol.for("react.activity"), ke = Symbol.for("react.client.reference"), I = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, we = Array.isArray, Y = console.createTask ? console.createTask : function() {
489
+ var v = Ce, y = Symbol.for("react.transitional.element"), k = Symbol.for("react.portal"), F = Symbol.for("react.fragment"), Re = Symbol.for("react.strict_mode"), pe = Symbol.for("react.profiler"), Ee = Symbol.for("react.consumer"), me = Symbol.for("react.context"), ke = Symbol.for("react.forward_ref"), ge = Symbol.for("react.suspense"), we = Symbol.for("react.suspense_list"), Te = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), Pe = Symbol.for("react.activity"), je = Symbol.for("react.client.reference"), z = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, Oe = Array.isArray, D = console.createTask ? console.createTask : function() {
452
490
  return null;
453
491
  };
454
- p = {
455
- "react-stack-bottom-frame": function(t) {
492
+ v = {
493
+ react_stack_bottom_frame: function(t) {
456
494
  return t();
457
495
  }
458
496
  };
459
- var Z, Q = {}, K = p["react-stack-bottom-frame"].bind(
460
- p,
497
+ var Z, Q = {}, K = v.react_stack_bottom_frame.bind(
498
+ v,
461
499
  o
462
- )(), ee = Y(a(o)), te = {};
463
- A.Fragment = P, A.jsx = function(t, u, d, m, k) {
464
- var y = 1e4 > I.recentlyCreatedOwnerStacks++;
500
+ )(), ee = D(a(o)), te = {};
501
+ A.Fragment = F, A.jsx = function(t, l, d) {
502
+ var _ = 1e4 > z.recentlyCreatedOwnerStacks++;
465
503
  return b(
466
504
  t,
467
- u,
505
+ l,
468
506
  d,
469
507
  !1,
470
- m,
471
- k,
472
- y ? Error("react-stack-top-frame") : K,
473
- y ? Y(a(t)) : ee
508
+ _ ? Error("react-stack-top-frame") : K,
509
+ _ ? D(a(t)) : ee
474
510
  );
475
- }, A.jsxs = function(t, u, d, m, k) {
476
- var y = 1e4 > I.recentlyCreatedOwnerStacks++;
511
+ }, A.jsxs = function(t, l, d) {
512
+ var _ = 1e4 > z.recentlyCreatedOwnerStacks++;
477
513
  return b(
478
514
  t,
479
- u,
515
+ l,
480
516
  d,
481
517
  !0,
482
- m,
483
- k,
484
- y ? Error("react-stack-top-frame") : K,
485
- y ? Y(a(t)) : ee
518
+ _ ? Error("react-stack-top-frame") : K,
519
+ _ ? D(a(t)) : ee
486
520
  );
487
521
  };
488
- }()), A;
522
+ })()), A;
489
523
  }
490
524
  var ie;
491
- function $e() {
492
- return ie || (ie = 1, process.env.NODE_ENV === "production" ? N.exports = Ie() : N.exports = Ye()), N.exports;
525
+ function Ue() {
526
+ return ie || (ie = 1, process.env.NODE_ENV === "production" ? L.exports = De() : L.exports = Ge()), L.exports;
493
527
  }
494
- var Fe = $e();
495
- const S = {}, j = {}, X = xe({ namespace: "" });
496
- function De(e) {
497
- return S[e] || (S[e] = /* @__PURE__ */ new Map()), S[e];
528
+ var ae = Ue();
529
+ const O = {}, S = {}, j = /* @__PURE__ */ new WeakMap();
530
+ let T = "";
531
+ function ve(e) {
532
+ return O[e] || (O[e] = /* @__PURE__ */ new Map()), O[e];
498
533
  }
499
- function Ge(e) {
500
- return j[e] || (j[e] = /* @__PURE__ */ new Map()), j[e];
534
+ function ye(e) {
535
+ return S[e] || (S[e] = /* @__PURE__ */ new Map()), S[e];
501
536
  }
502
- const Be = ({
503
- children: e,
504
- namespace: r = ""
505
- }) => /* @__PURE__ */ Fe.jsx(X.Provider, { value: { namespace: r }, children: e });
506
- function He({ schema: e, ctor: r }) {
507
- const { namespace: n } = ae(X);
508
- return De(n).set(e, r), null;
537
+ const ce = ({
538
+ children: e
539
+ }) => /* @__PURE__ */ ae.jsx(ae.Fragment, { children: e });
540
+ function Ve({
541
+ schema: e,
542
+ ctor: r
543
+ }) {
544
+ return ye(T).delete(e), ve(T).set(e, r), null;
509
545
  }
510
- function Ze({
546
+ function qe({
511
547
  schema: e,
512
548
  val: r
513
549
  }) {
514
- const { namespace: n } = ae(X);
515
- return Ge(n).set(e, r), null;
550
+ return ve(T).delete(e), ye(T).set(e, r), null;
516
551
  }
517
- function Qe(e, r = "") {
518
- return (n, { static: a, kind: i }) => {
552
+ function tt(e, r = "") {
553
+ return (n, {
554
+ static: a,
555
+ kind: i,
556
+ name: o,
557
+ addInitializer: c
558
+ }) => {
519
559
  if (i !== "field")
520
- throw new Error("inject 装饰器只能用于类的属性字段");
560
+ throw new Error("[IoC] - inject 装饰器只能用于类的属性字段");
521
561
  if (a)
522
- throw new Error("inject 装饰器不能用于静态属性");
523
- return function(o) {
524
- var l;
525
- if (!Ue(e, r))
526
- return console.error(
527
- `[IoC] 依赖注入失败 - namespace: "${r}", schema: ${e.description || "unknown"}`,
528
- "未注册"
529
- ), o;
530
- let c = o;
531
- const s = (l = S[r]) == null ? void 0 : l.get(e);
532
- if (s)
533
- c = W(s)();
534
- else {
535
- const b = j[r];
536
- b != null && b.has(e) && (c = b.get(e));
537
- }
538
- const f = e.safeParse(c);
539
- return f.success ? c : (console.error(
540
- `[IoC] 依赖注入失败 - namespace: "${r}", schema: ${e.description || "unknown"}`,
541
- f.error.issues
542
- ), o);
562
+ throw new Error("[IoC] - inject 装饰器不能用于静态属性");
563
+ return c(function() {
564
+ Object.defineProperty(this, o, {
565
+ get() {
566
+ var R;
567
+ j.has(this) || j.set(this, {});
568
+ const s = j.get(this);
569
+ s[o] || (s[o] = {
570
+ initialized: !1,
571
+ val: void 0
572
+ });
573
+ const f = s[o];
574
+ if (f.initialized) return f.val;
575
+ if (!Je(e, r))
576
+ return console.error(`[IoC] 依赖注入失败 - namespace: ${r || "默认"}, schema: ${e.description || e.type || "unknown"}`, "未注册"), f.val;
577
+ let u;
578
+ const b = (R = O[r]) == null ? void 0 : R.get(e);
579
+ if (b)
580
+ u = $(b)();
581
+ else {
582
+ const v = S[r];
583
+ v != null && v.has(e) && (u = v.get(e));
584
+ }
585
+ const E = e.safeParse(u);
586
+ return E.success ? (f.initialized = !0, f.val = u, u) : (console.error(`[IoC] 依赖注入失败 - namespace: "${r}", schema: ${e.description || "unknown"}`, E.error.issues), u);
587
+ }
588
+ });
589
+ }), function(s) {
590
+ j.has(this) || j.set(this, {});
591
+ const f = j.get(this);
592
+ return f[o] || (f[o] = {
593
+ initialized: !1,
594
+ val: s
595
+ }), s;
543
596
  };
544
597
  };
545
598
  }
546
- function Ke(e) {
547
- delete S[e], delete j[e];
599
+ function rt(e) {
600
+ delete O[e], delete S[e];
601
+ }
602
+ function Je(e, r = "") {
603
+ const n = O[r], a = S[r];
604
+ return !!(n != null && n.has(e) || a != null && a.has(e));
548
605
  }
549
- function Ue(e, r = "") {
550
- const n = S[r], a = j[r];
551
- return (n == null ? void 0 : n.has(e)) || (a == null ? void 0 : a.has(e));
606
+ const Be = [qe, Ve];
607
+ function le(e) {
608
+ if (!e || typeof e != "object" || !("type" in e))
609
+ return;
610
+ const {
611
+ type: r,
612
+ props: n
613
+ } = e;
614
+ if (!Be.includes(r)) {
615
+ const i = T;
616
+ r === ce && (T = n.namespace || ""), Ne.toArray(n == null ? void 0 : n.children).forEach((c) => le(c)), r === ce && (T = i);
617
+ return;
618
+ }
619
+ const a = r(n);
620
+ le(a);
552
621
  }
553
622
  export {
554
- He as CInjection,
555
- Be as Container,
556
- Ze as VInjection,
557
- Ke as clearNamespace,
558
- Je as finalizationRegistry,
559
- Qe as inject,
560
- Ue as isRegistered,
561
- We as loader,
562
- W as provide,
563
- de as useInstance,
564
- Xe as useLoader,
565
- Ve as useModel,
566
- q as watch
623
+ Ve as CInjection,
624
+ ce as Container,
625
+ qe as VInjection,
626
+ rt as clearNamespace,
627
+ le as config,
628
+ Ze as finalizationRegistry,
629
+ tt as inject,
630
+ Je as isRegistered,
631
+ ze as loader,
632
+ $ as provide,
633
+ he as useInstance,
634
+ et as useLoader,
635
+ Qe as useModel,
636
+ Ke as useWatcher,
637
+ I as watch
567
638
  };