@ahoo-wang/fetcher-react 3.6.0 → 3.6.2

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,435 +1,455 @@
1
1
  var B = Object.defineProperty;
2
- var l = (r, e) => B(r, "name", { value: e, configurable: !0 });
3
- import { c as w } from "react/compiler-runtime";
4
- import { useRef as I, useEffect as $, useState as D, useCallback as _, useMemo as M, useReducer as H, useSyncExternalStore as X, createContext as Z, useContext as ee } from "react";
2
+ var s = (r, e) => B(r, "name", { value: e, configurable: !0 });
3
+ import { c as _ } from "react/compiler-runtime";
4
+ import { useRef as $, useEffect as I, useState as A, useCallback as w, useMemo as M, useReducer as H, useSyncExternalStore as X, createContext as Z, useContext as ee } from "react";
5
5
  import { jsx as N, Fragment as te } from "react/jsx-runtime";
6
6
  import { nameGenerator as re } from "@ahoo-wang/fetcher-eventbus";
7
7
  import { produce as ne } from "immer";
8
- import { fetcherRegistrar as ce, getFetcher as se, JsonResultExtractor as oe } from "@ahoo-wang/fetcher";
9
- import { JsonEventStreamResultExtractor as ue } from "@ahoo-wang/fetcher-eventstream";
10
- function L(r) {
11
- const e = I(r);
8
+ import { fetcherRegistrar as ce, getFetcher as se, JsonResultExtractor as ue } from "@ahoo-wang/fetcher";
9
+ import { JsonEventStreamResultExtractor as oe } from "@ahoo-wang/fetcher-eventstream";
10
+ function q(r) {
11
+ const e = $(r);
12
12
  return e.current = r, e;
13
13
  }
14
- l(L, "useLatest");
15
- function T(r, e) {
16
- const t = w(19);
14
+ s(q, "useLatest");
15
+ function D(r, e) {
16
+ const t = _(19);
17
17
  if (e.leading === !1 && e.trailing === !1)
18
18
  throw new Error("useDebouncedCallback: at least one of leading or trailing must be true");
19
- const n = I(void 0), o = I(null), c = I(null), s = L(r), u = L(e);
20
- let i;
21
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l(() => {
19
+ const n = $(void 0), a = $(null), u = $(null), c = q(r), o = q(e);
20
+ let l;
21
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ s(() => {
22
22
  n.current !== void 0 && (clearTimeout(n.current), n.current = void 0);
23
- }, "t0"), t[0] = i) : i = t[0];
24
- const m = i;
25
- let a;
26
- t[1] !== u ? (a = /* @__PURE__ */ l((F) => c.current ? F - c.current >= u.current.delay : !0, "t1"), t[1] = u, t[2] = a) : a = t[2];
27
- const f = a;
23
+ }, "t0"), t[0] = l) : l = t[0];
24
+ const y = l;
25
+ let f;
26
+ t[1] !== o ? (f = /* @__PURE__ */ s((F) => u.current ? F - u.current >= o.current.delay : !0, "t1"), t[1] = o, t[2] = f) : f = t[2];
27
+ const i = f;
28
28
  let d;
29
- t[3] !== s ? (d = /* @__PURE__ */ l((F, C) => {
30
- c.current = F, s.current(...C);
31
- }, "t2"), t[3] = s, t[4] = d) : d = t[4];
32
- const b = d;
33
- let y;
34
- t[5] !== b || t[6] !== u ? (y = /* @__PURE__ */ l(() => {
29
+ t[3] !== c ? (d = /* @__PURE__ */ s((F, C) => {
30
+ u.current = F, c.current(...C);
31
+ }, "t2"), t[3] = c, t[4] = d) : d = t[4];
32
+ const m = d;
33
+ let b;
34
+ t[5] !== m || t[6] !== o ? (b = /* @__PURE__ */ s(() => {
35
35
  n.current = setTimeout(() => {
36
- if (o.current) {
36
+ if (a.current) {
37
37
  const F = Date.now();
38
- b(F, o.current);
38
+ m(F, a.current);
39
39
  }
40
40
  n.current = void 0;
41
- }, u.current.delay);
42
- }, "t3"), t[5] = b, t[6] = u, t[7] = y) : y = t[7];
43
- const h = y;
41
+ }, o.current.delay);
42
+ }, "t3"), t[5] = m, t[6] = o, t[7] = b) : b = t[7];
43
+ const h = b;
44
44
  let g;
45
- t[8] !== b || t[9] !== u || t[10] !== h || t[11] !== f ? (g = /* @__PURE__ */ l((...F) => {
45
+ t[8] !== m || t[9] !== o || t[10] !== h || t[11] !== i ? (g = /* @__PURE__ */ s((...F) => {
46
46
  const C = F;
47
- m();
47
+ y();
48
48
  const {
49
- leading: q,
49
+ leading: U,
50
50
  trailing: k
51
- } = u.current, z = q === void 0 ? !1 : q, G = k === void 0 ? !0 : k;
52
- if (o.current = C, G && !z) {
51
+ } = o.current, z = U === void 0 ? !1 : U, G = k === void 0 ? !0 : k;
52
+ if (a.current = C, G && !z) {
53
53
  h();
54
54
  return;
55
55
  }
56
56
  const K = Date.now();
57
- if (z && f(K)) {
58
- b(K, C);
57
+ if (z && i(K)) {
58
+ m(K, C);
59
59
  return;
60
60
  }
61
61
  G && h();
62
- }, "t4"), t[8] = b, t[9] = u, t[10] = h, t[11] = f, t[12] = g) : g = t[12];
62
+ }, "t4"), t[8] = m, t[9] = o, t[10] = h, t[11] = i, t[12] = g) : g = t[12];
63
63
  const x = g;
64
- let S;
65
- t[13] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ l(() => {
66
- m(), o.current = null;
67
- }, "t5"), t[13] = S) : S = t[13];
68
- const E = S;
64
+ let E;
65
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ s(() => {
66
+ y(), a.current = null;
67
+ }, "t5"), t[13] = E) : E = t[13];
68
+ const v = E;
69
69
  let Q;
70
- t[14] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ l(() => n.current !== void 0, "t6"), t[14] = Q) : Q = t[14];
71
- const v = Q;
70
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ s(() => n.current !== void 0, "t6"), t[14] = Q) : Q = t[14];
71
+ const S = Q;
72
72
  let R, O;
73
- t[15] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ l(() => () => {
74
- E();
75
- }, "t7"), O = [E], t[15] = R, t[16] = O) : (R = t[15], O = t[16]), $(R, O);
76
- let p;
77
- return t[17] !== x ? (p = {
73
+ t[15] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ s(() => () => {
74
+ v();
75
+ }, "t7"), O = [v], t[15] = R, t[16] = O) : (R = t[15], O = t[16]), I(R, O);
76
+ let L;
77
+ return t[17] !== x ? (L = {
78
78
  run: x,
79
- cancel: E,
80
- isPending: v
81
- }, t[17] = x, t[18] = p) : p = t[18], p;
79
+ cancel: v,
80
+ isPending: S
81
+ }, t[17] = x, t[18] = L) : L = t[18], L;
82
82
  }
83
- l(T, "useDebouncedCallback");
84
- function V() {
85
- const r = w(3), e = I(!1);
83
+ s(D, "useDebouncedCallback");
84
+ function W() {
85
+ const r = _(3), e = $(!1);
86
86
  let t;
87
- r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ l(() => e.current, "t0"), r[0] = t) : t = r[0];
87
+ r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ s(() => e.current, "t0"), r[0] = t) : t = r[0];
88
88
  const n = t;
89
- let o, c;
90
- return r[1] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(() => (e.current = !0, () => {
89
+ let a, u;
90
+ return r[1] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ s(() => (e.current = !0, () => {
91
91
  e.current = !1;
92
- }), "t1"), c = [], r[1] = o, r[2] = c) : (o = r[1], c = r[2]), $(o, c), n;
92
+ }), "t1"), u = [], r[1] = a, r[2] = u) : (a = r[1], u = r[2]), I(a, u), n;
93
93
  }
94
- l(V, "useMounted");
94
+ s(W, "useMounted");
95
95
  var le = /* @__PURE__ */ ((r) => (r.IDLE = "idle", r.LOADING = "loading", r.SUCCESS = "success", r.ERROR = "error", r))(le || {});
96
96
  function ie(r) {
97
- const [e, t] = D(
97
+ const [e, t] = A(
98
98
  r?.initialStatus ?? "idle"
99
99
  /* IDLE */
100
- ), [n, o] = D(void 0), [c, s] = D(void 0), u = V(), i = L(r), m = _(() => {
101
- u() && (t(
100
+ ), [n, a] = A(void 0), [u, c] = A(void 0), o = W(), l = q(r), y = w(() => {
101
+ o() && (t(
102
102
  "loading"
103
103
  /* LOADING */
104
- ), s(void 0));
105
- }, [u]), a = _(async (b) => {
106
- if (u()) {
107
- o(b), t(
104
+ ), c(void 0));
105
+ }, [o]), f = w(async (m) => {
106
+ if (o()) {
107
+ a(m), t(
108
108
  "success"
109
109
  /* SUCCESS */
110
- ), s(void 0);
110
+ ), c(void 0);
111
111
  try {
112
- await i.current?.onSuccess?.(b);
113
- } catch (y) {
114
- console.warn("PromiseState onSuccess callback error:", y);
112
+ await l.current?.onSuccess?.(m);
113
+ } catch (b) {
114
+ console.warn("PromiseState onSuccess callback error:", b);
115
115
  }
116
116
  }
117
- }, [u, i]), f = _(async (b) => {
118
- if (u()) {
119
- s(b), t(
117
+ }, [o, l]), i = w(async (m) => {
118
+ if (o()) {
119
+ c(m), t(
120
120
  "error"
121
121
  /* ERROR */
122
- ), o(void 0);
122
+ ), a(void 0);
123
123
  try {
124
- await i.current?.onError?.(b);
125
- } catch (y) {
126
- console.warn("PromiseState onError callback error:", y);
124
+ await l.current?.onError?.(m);
125
+ } catch (b) {
126
+ console.warn("PromiseState onError callback error:", b);
127
127
  }
128
128
  }
129
- }, [u, i]), d = _(() => {
130
- u() && (t(
129
+ }, [o, l]), d = w(() => {
130
+ o() && (t(
131
131
  "idle"
132
132
  /* IDLE */
133
- ), s(void 0), o(void 0));
134
- }, [u]);
133
+ ), c(void 0), a(void 0));
134
+ }, [o]);
135
135
  return M(() => ({
136
136
  status: e,
137
137
  loading: e === "loading",
138
138
  result: n,
139
- error: c,
140
- setLoading: m,
141
- setSuccess: a,
142
- setError: f,
139
+ error: u,
140
+ setLoading: y,
141
+ setSuccess: f,
142
+ setError: i,
143
143
  setIdle: d
144
- }), [e, n, c, m, a, f, d]);
144
+ }), [e, n, u, y, f, i, d]);
145
145
  }
146
- l(ie, "usePromiseState");
146
+ s(ie, "usePromiseState");
147
147
  function ae() {
148
- const r = w(6), e = I(0);
148
+ const r = _(6), e = $(0);
149
149
  let t;
150
- r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ l(() => e.current = e.current + 1, "t0"), r[0] = t) : t = r[0];
150
+ r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ s(() => e.current = e.current + 1, "t0"), r[0] = t) : t = r[0];
151
151
  const n = t;
152
- let o;
153
- r[1] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(() => e.current, "t1"), r[1] = o) : o = r[1];
154
- const c = o;
155
- let s;
156
- r[2] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l((b) => b === e.current, "t2"), r[2] = s) : s = r[2];
157
- const u = s;
158
- let i;
159
- r[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l(() => {
160
- e.current = e.current + 1;
161
- }, "t3"), r[3] = i) : i = r[3];
162
- const m = i;
163
152
  let a;
164
- r[4] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ l(() => {
153
+ r[1] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ s(() => e.current, "t1"), r[1] = a) : a = r[1];
154
+ const u = a;
155
+ let c;
156
+ r[2] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ s((m) => m === e.current, "t2"), r[2] = c) : c = r[2];
157
+ const o = c;
158
+ let l;
159
+ r[3] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ s(() => {
160
+ e.current = e.current + 1;
161
+ }, "t3"), r[3] = l) : l = r[3];
162
+ const y = l;
163
+ let f;
164
+ r[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ s(() => {
165
165
  e.current = 0;
166
- }, "t4"), r[4] = a) : a = r[4];
167
- const f = a;
166
+ }, "t4"), r[4] = f) : f = r[4];
167
+ const i = f;
168
168
  let d;
169
169
  return r[5] === Symbol.for("react.memo_cache_sentinel") ? (d = {
170
170
  generate: n,
171
- current: c,
172
- isLatest: u,
173
- invalidate: m,
174
- reset: f
171
+ current: u,
172
+ isLatest: o,
173
+ invalidate: y,
174
+ reset: i
175
175
  }, r[5] = d) : d = r[5], d;
176
176
  }
177
- l(ae, "useRequestId");
178
- function U(r) {
177
+ s(ae, "useRequestId");
178
+ function T(r) {
179
179
  const {
180
180
  loading: e,
181
181
  result: t,
182
182
  error: n,
183
- status: o,
184
- setLoading: c,
185
- setSuccess: s,
186
- setError: u,
187
- setIdle: i
188
- } = ie(r), m = V(), a = ae(), f = I(void 0), d = r?.propagateError, b = L(r?.onAbort), y = _(async () => {
183
+ status: a,
184
+ setLoading: u,
185
+ setSuccess: c,
186
+ setError: o,
187
+ setIdle: l
188
+ } = ie(r), y = W(), f = ae(), i = $(void 0), d = r?.propagateError, m = q(r?.onAbort), b = w(async () => {
189
189
  try {
190
- await b.current?.();
191
- } catch (S) {
192
- console.warn("useExecutePromise onAbort callback error:", S);
190
+ await m.current?.();
191
+ } catch (E) {
192
+ console.warn("useExecutePromise onAbort callback error:", E);
193
193
  }
194
- }, [b]), h = _(async (S) => {
195
- f.current && (f.current.abort(), await y());
196
- const E = new AbortController();
197
- f.current = E;
198
- const Q = a.generate();
199
- c();
194
+ }, [m]), h = w(async (E) => {
195
+ i.current && (i.current.abort(), await b());
196
+ const v = new AbortController();
197
+ i.current = v;
198
+ const Q = f.generate();
199
+ u();
200
200
  try {
201
- const v = await S(E);
202
- m() && a.isLatest(Q) && await s(v);
203
- } catch (v) {
204
- if (v instanceof Error && v.name === "AbortError") {
205
- m() && i();
201
+ const S = await E(v);
202
+ y() && f.isLatest(Q) && await c(S);
203
+ } catch (S) {
204
+ if (S instanceof Error && S.name === "AbortError") {
205
+ y() && l();
206
206
  return;
207
207
  }
208
- if (m() && a.isLatest(Q) && await u(v), d)
209
- throw v;
208
+ if (y() && f.isLatest(Q) && await o(S), d)
209
+ throw S;
210
210
  } finally {
211
- f.current === E && (f.current = void 0);
211
+ i.current === v && (i.current = void 0);
212
212
  }
213
- }, [c, s, u, i, m, a, d, y]), g = _(() => {
214
- m() && i();
215
- }, [i, m]), x = _(async () => {
216
- g(), f.current && (f.current.abort(), f.current = void 0, await y());
217
- }, [g, y]);
218
- return $(() => () => {
213
+ }, [u, c, o, l, y, f, d, b]), g = w(() => {
214
+ y() && l();
215
+ }, [l, y]), x = w(async () => {
216
+ g(), i.current && (i.current.abort(), i.current = void 0, await b());
217
+ }, [g, b]);
218
+ return I(() => () => {
219
219
  x();
220
220
  }, [x]), M(() => ({
221
221
  loading: e,
222
222
  result: t,
223
223
  error: n,
224
- status: o,
224
+ status: a,
225
225
  execute: h,
226
226
  reset: g,
227
227
  abort: x
228
- }), [e, t, n, o, h, g, x]);
228
+ }), [e, t, n, a, h, g, x]);
229
229
  }
230
- l(U, "useExecutePromise");
231
- function we(r) {
232
- const e = w(10), {
230
+ s(T, "useExecutePromise");
231
+ function _e(r) {
232
+ const e = _(10), {
233
233
  loading: t,
234
234
  result: n,
235
- error: o,
236
- execute: c,
237
- reset: s,
238
- abort: u,
239
- status: i
240
- } = U(r), {
241
- run: m,
242
- cancel: a,
243
- isPending: f
244
- } = T(c, r.debounce);
235
+ error: a,
236
+ execute: u,
237
+ reset: c,
238
+ abort: o,
239
+ status: l
240
+ } = T(r), {
241
+ run: y,
242
+ cancel: f,
243
+ isPending: i
244
+ } = D(u, r.debounce);
245
245
  let d;
246
- return e[0] !== u || e[1] !== a || e[2] !== o || e[3] !== f || e[4] !== t || e[5] !== s || e[6] !== n || e[7] !== m || e[8] !== i ? (d = {
246
+ return e[0] !== o || e[1] !== f || e[2] !== a || e[3] !== i || e[4] !== t || e[5] !== c || e[6] !== n || e[7] !== y || e[8] !== l ? (d = {
247
247
  loading: t,
248
248
  result: n,
249
- error: o,
250
- status: i,
251
- reset: s,
252
- abort: u,
253
- run: m,
254
- cancel: a,
255
- isPending: f
256
- }, e[0] = u, e[1] = a, e[2] = o, e[3] = f, e[4] = t, e[5] = s, e[6] = n, e[7] = m, e[8] = i, e[9] = d) : d = e[9], d;
257
- }
258
- l(we, "useDebouncedExecutePromise");
249
+ error: a,
250
+ status: l,
251
+ reset: c,
252
+ abort: o,
253
+ run: y,
254
+ cancel: f,
255
+ isPending: i
256
+ }, e[0] = o, e[1] = f, e[2] = a, e[3] = i, e[4] = t, e[5] = c, e[6] = n, e[7] = y, e[8] = l, e[9] = d) : d = e[9], d;
257
+ }
258
+ s(_e, "useDebouncedExecutePromise");
259
259
  function Re(r) {
260
- const e = w(22), t = r.autoExecute;
260
+ const e = _(22), t = r.autoExecute;
261
261
  let n;
262
262
  e[0] !== r ? (n = {
263
263
  ...r,
264
264
  autoExecute: !1
265
265
  }, e[0] = r, e[1] = n) : n = e[1];
266
- const o = n, {
267
- loading: c,
268
- result: s,
269
- error: u,
270
- status: i,
271
- execute: m,
272
- reset: a,
273
- abort: f,
266
+ const a = n, {
267
+ loading: u,
268
+ result: c,
269
+ error: o,
270
+ status: l,
271
+ execute: y,
272
+ reset: f,
273
+ abort: i,
274
274
  getQuery: d,
275
- setQuery: b
276
- } = P(o), {
277
- run: y,
275
+ setQuery: m
276
+ } = p(a), {
277
+ run: b,
278
278
  cancel: h,
279
279
  isPending: g
280
- } = T(m, r.debounce);
280
+ } = D(y, r.debounce);
281
281
  let x;
282
- e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
283
- b(R), t && y();
284
- }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
285
- const S = x;
286
- let E, Q;
287
- e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
288
- t && y();
289
- }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
290
- let v;
291
- return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
292
- loading: c,
293
- result: s,
294
- error: u,
295
- status: i,
296
- reset: a,
297
- abort: f,
282
+ e[2] !== t || e[3] !== b || e[4] !== m ? (x = /* @__PURE__ */ s((R) => {
283
+ m(R), t && b();
284
+ }, "t1"), e[2] = t, e[3] = b, e[4] = m, e[5] = x) : x = e[5];
285
+ const E = x;
286
+ let v, Q;
287
+ e[6] !== t || e[7] !== b ? (v = /* @__PURE__ */ s(() => {
288
+ t && b();
289
+ }, "t2"), Q = [b, t], e[6] = t, e[7] = b, e[8] = v, e[9] = Q) : (v = e[8], Q = e[9]), I(v, Q);
290
+ let S;
291
+ return e[10] !== i || e[11] !== h || e[12] !== o || e[13] !== d || e[14] !== g || e[15] !== u || e[16] !== f || e[17] !== c || e[18] !== b || e[19] !== E || e[20] !== l ? (S = {
292
+ loading: u,
293
+ result: c,
294
+ error: o,
295
+ status: l,
296
+ reset: f,
297
+ abort: i,
298
298
  getQuery: d,
299
- setQuery: S,
300
- run: y,
299
+ setQuery: E,
300
+ run: b,
301
301
  cancel: h,
302
302
  isPending: g
303
- }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
303
+ }, e[10] = i, e[11] = h, e[12] = o, e[13] = d, e[14] = g, e[15] = u, e[16] = f, e[17] = c, e[18] = b, e[19] = E, e[20] = l, e[21] = S) : S = e[21], S;
304
304
  }
305
- l(Re, "useDebouncedQuery");
305
+ s(Re, "useDebouncedQuery");
306
306
  function Fe() {
307
- const r = I(/* @__PURE__ */ new Map()), e = _((f) => r.current.get(f), []), t = _((f, d) => r.current.set(f, d), []), n = _((f) => r.current.has(f), []), o = _((f) => r.current.delete(f), []), c = _(() => r.current.clear(), []), s = _(() => r.current.keys(), []), u = _(() => r.current.values(), []), i = _(() => r.current.entries(), []), m = _(() => r.current[Symbol.iterator](), []), a = _((f) => (d) => {
308
- d ? r.current.set(f, d) : r.current.delete(f);
307
+ const r = $(/* @__PURE__ */ new Map()), e = w((i) => r.current.get(i), []), t = w((i, d) => r.current.set(i, d), []), n = w((i) => r.current.has(i), []), a = w((i) => r.current.delete(i), []), u = w(() => r.current.clear(), []), c = w(() => r.current.keys(), []), o = w(() => r.current.values(), []), l = w(() => r.current.entries(), []), y = w(() => r.current[Symbol.iterator](), []), f = w((i) => (d) => {
308
+ d ? r.current.set(i, d) : r.current.delete(i);
309
309
  }, []);
310
- return $(() => () => {
310
+ return I(() => () => {
311
311
  r.current.clear();
312
312
  }, []), M(() => ({
313
- register: a,
313
+ register: f,
314
314
  get: e,
315
315
  set: t,
316
316
  has: n,
317
- delete: o,
318
- clear: c,
319
- keys: s,
320
- values: u,
321
- entries: i,
317
+ delete: a,
318
+ clear: u,
319
+ keys: c,
320
+ values: o,
321
+ entries: l,
322
322
  get size() {
323
323
  return r.current.size;
324
324
  },
325
- [Symbol.iterator]: m
326
- }), [a, e, t, n, o, c, s, u, i, m]);
325
+ [Symbol.iterator]: y
326
+ }), [f, e, t, n, a, u, c, o, l, y]);
327
327
  }
328
- l(Fe, "useRefs");
328
+ s(Fe, "useRefs");
329
329
  function Ce() {
330
330
  const [, r] = H(fe, 0);
331
331
  return r;
332
332
  }
333
- l(Ce, "useForceUpdate");
333
+ s(Ce, "useForceUpdate");
334
334
  function fe(r) {
335
335
  return r + 1;
336
336
  }
337
- l(fe, "_temp");
337
+ s(fe, "_temp");
338
338
  function j(r) {
339
- const e = w(10), {
339
+ const e = _(12), {
340
340
  initialQuery: t,
341
- autoExecute: n,
342
- execute: o
343
- } = r, c = n ?? !0, s = I(t);
344
- let u;
345
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(() => s.current, "t0"), e[0] = u) : u = e[0];
346
- const i = u;
341
+ query: n,
342
+ autoExecute: a,
343
+ execute: u
344
+ } = r, c = a === void 0 ? !0 : a, o = n ?? t;
345
+ if (o === void 0)
346
+ throw new Error("Either initialQuery or query must be provided.");
347
+ const l = $(o);
348
+ let y;
349
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ s(() => l.current, "t1"), e[0] = y) : y = e[0];
350
+ const f = y;
351
+ let i;
352
+ e[1] !== c || e[2] !== u ? (i = /* @__PURE__ */ s(() => {
353
+ c && u(f());
354
+ }, "t2"), e[1] = c, e[2] = u, e[3] = i) : i = e[3];
355
+ const d = i;
347
356
  let m;
348
- e[1] !== c || e[2] !== o ? (m = /* @__PURE__ */ l((y) => {
349
- s.current = y, c && o(y);
350
- }, "t1"), e[1] = c, e[2] = o, e[3] = m) : m = e[3];
351
- const a = m;
352
- let f, d;
353
- e[4] !== c || e[5] !== o ? (f = /* @__PURE__ */ l(() => {
354
- c && o(s.current);
355
- }, "t2"), d = [c, o], e[4] = c, e[5] = o, e[6] = f, e[7] = d) : (f = e[6], d = e[7]), $(f, d);
356
- let b;
357
- return e[8] !== a ? (b = {
358
- getQuery: i,
359
- setQuery: a
360
- }, e[8] = a, e[9] = b) : b = e[9], b;
357
+ e[4] !== d ? (m = /* @__PURE__ */ s((E) => {
358
+ l.current = E, d();
359
+ }, "t3"), e[4] = d, e[5] = m) : m = e[5];
360
+ const b = m;
361
+ let h, g;
362
+ e[6] !== d || e[7] !== n ? (h = /* @__PURE__ */ s(() => {
363
+ n && (l.current = n), d();
364
+ }, "t4"), g = [d, n], e[6] = d, e[7] = n, e[8] = h, e[9] = g) : (h = e[8], g = e[9]), I(h, g);
365
+ let x;
366
+ return e[10] !== b ? (x = {
367
+ getQuery: f,
368
+ setQuery: b
369
+ }, e[10] = b, e[11] = x) : x = e[11], x;
361
370
  }
362
- l(j, "useQueryState");
363
- function P(r) {
364
- const e = L(r), {
365
- loading: t,
366
- result: n,
367
- error: o,
371
+ s(j, "useQueryState");
372
+ function p(r) {
373
+ const e = _(21), t = q(r), {
374
+ loading: n,
375
+ result: a,
376
+ error: u,
368
377
  status: c,
369
- execute: s,
370
- reset: u,
371
- abort: i
372
- } = U(e.current), m = _((b) => s(/* @__PURE__ */ l(async (h) => e.current.execute(b, e.current.attributes, h), "queryExecutor")), [s, e]), {
373
- getQuery: a,
374
- setQuery: f
375
- } = j({
378
+ execute: o,
379
+ reset: l,
380
+ abort: y
381
+ } = T(r);
382
+ let f;
383
+ e[0] !== t || e[1] !== o ? (f = /* @__PURE__ */ s((E) => o(/* @__PURE__ */ s(async (Q) => t.current.execute(E, t.current.attributes, Q), "queryExecutor")), "t0"), e[0] = t, e[1] = o, e[2] = f) : f = e[2];
384
+ const i = f;
385
+ let d;
386
+ e[3] !== i || e[4] !== r.autoExecute || e[5] !== r.initialQuery || e[6] !== r.query ? (d = {
376
387
  initialQuery: r.initialQuery,
377
- autoExecute: e.current.autoExecute,
378
- execute: m
379
- }), d = _(() => m(a()), [m, a]);
380
- return M(() => ({
381
- loading: t,
382
- result: n,
383
- error: o,
388
+ query: r.query,
389
+ autoExecute: r.autoExecute,
390
+ execute: i
391
+ }, e[3] = i, e[4] = r.autoExecute, e[5] = r.initialQuery, e[6] = r.query, e[7] = d) : d = e[7];
392
+ const {
393
+ getQuery: m,
394
+ setQuery: b
395
+ } = j(d);
396
+ let h;
397
+ e[8] !== i || e[9] !== m ? (h = /* @__PURE__ */ s(() => i(m()), "t2"), e[8] = i, e[9] = m, e[10] = h) : h = e[10];
398
+ const g = h;
399
+ let x;
400
+ return e[11] !== y || e[12] !== u || e[13] !== g || e[14] !== m || e[15] !== n || e[16] !== l || e[17] !== a || e[18] !== b || e[19] !== c ? (x = {
401
+ loading: n,
402
+ result: a,
403
+ error: u,
384
404
  status: c,
385
- execute: d,
386
- reset: u,
387
- abort: i,
388
- getQuery: a,
389
- setQuery: f
390
- }), [t, n, o, c, d, u, i, a, f]);
405
+ execute: g,
406
+ reset: l,
407
+ abort: y,
408
+ getQuery: m,
409
+ setQuery: b
410
+ }, e[11] = y, e[12] = u, e[13] = g, e[14] = m, e[15] = n, e[16] = l, e[17] = a, e[18] = b, e[19] = c, e[20] = x) : x = e[20], x;
391
411
  }
392
- l(P, "useQuery");
412
+ s(p, "useQuery");
393
413
  function J(r, e) {
394
- const t = w(13);
414
+ const t = _(13);
395
415
  let n;
396
- t[0] !== r ? (n = /* @__PURE__ */ l((b) => r.addListener({
416
+ t[0] !== r ? (n = /* @__PURE__ */ s((m) => r.addListener({
397
417
  name: re.generate("useKeyStorage"),
398
- handle: b
418
+ handle: m
399
419
  }), "t0"), t[0] = r, t[1] = n) : n = t[1];
400
- const o = n;
401
- let c;
402
- t[2] !== e || t[3] !== r ? (c = /* @__PURE__ */ l(() => {
403
- const b = r.get();
404
- return b !== null ? b : e ?? null;
405
- }, "t1"), t[2] = e, t[3] = r, t[4] = c) : c = t[4];
406
- const s = c, u = X(o, s, s);
407
- let i;
408
- t[5] !== r ? (i = /* @__PURE__ */ l((b) => r.set(b), "t2"), t[5] = r, t[6] = i) : i = t[6];
409
- const m = i;
410
- let a;
411
- t[7] !== r ? (a = /* @__PURE__ */ l(() => r.remove(), "t3"), t[7] = r, t[8] = a) : a = t[8];
412
- const f = a;
420
+ const a = n;
421
+ let u;
422
+ t[2] !== e || t[3] !== r ? (u = /* @__PURE__ */ s(() => {
423
+ const m = r.get();
424
+ return m !== null ? m : e ?? null;
425
+ }, "t1"), t[2] = e, t[3] = r, t[4] = u) : u = t[4];
426
+ const c = u, o = X(a, c, c);
427
+ let l;
428
+ t[5] !== r ? (l = /* @__PURE__ */ s((m) => r.set(m), "t2"), t[5] = r, t[6] = l) : l = t[6];
429
+ const y = l;
430
+ let f;
431
+ t[7] !== r ? (f = /* @__PURE__ */ s(() => r.remove(), "t3"), t[7] = r, t[8] = f) : f = t[8];
432
+ const i = f;
413
433
  let d;
414
- return t[9] !== f || t[10] !== m || t[11] !== u ? (d = [u, m, f], t[9] = f, t[10] = m, t[11] = u, t[12] = d) : d = t[12], d;
434
+ return t[9] !== i || t[10] !== y || t[11] !== o ? (d = [o, y, i], t[9] = i, t[10] = y, t[11] = o, t[12] = d) : d = t[12], d;
415
435
  }
416
- l(J, "useKeyStorage");
436
+ s(J, "useKeyStorage");
417
437
  function Oe(r, e) {
418
- const t = w(8), [n, o, c] = J(r, e);
419
- let s;
420
- t[0] !== c || t[1] !== o || t[2] !== n ? (s = /* @__PURE__ */ l((m) => {
421
- const a = ne(n, m);
422
- if (a === null) {
423
- c();
438
+ const t = _(8), [n, a, u] = J(r, e);
439
+ let c;
440
+ t[0] !== u || t[1] !== a || t[2] !== n ? (c = /* @__PURE__ */ s((y) => {
441
+ const f = ne(n, y);
442
+ if (f === null) {
443
+ u();
424
444
  return;
425
445
  }
426
- return o(a);
427
- }, "t0"), t[0] = c, t[1] = o, t[2] = n, t[3] = s) : s = t[3];
428
- const u = s;
429
- let i;
430
- return t[4] !== c || t[5] !== u || t[6] !== n ? (i = [n, u, c], t[4] = c, t[5] = u, t[6] = n, t[7] = i) : i = t[7], i;
446
+ return a(f);
447
+ }, "t0"), t[0] = u, t[1] = a, t[2] = n, t[3] = c) : c = t[3];
448
+ const o = c;
449
+ let l;
450
+ return t[4] !== u || t[5] !== o || t[6] !== n ? (l = [n, o, u], t[4] = u, t[5] = o, t[6] = n, t[7] = l) : l = t[7], l;
431
451
  }
432
- l(Oe, "useImmerKeyStorage");
452
+ s(Oe, "useImmerKeyStorage");
433
453
  const de = {
434
454
  jti: "",
435
455
  sub: "anonymous",
@@ -437,354 +457,355 @@ const de = {
437
457
  exp: 0
438
458
  };
439
459
  function me(r, e) {
440
- const t = w(13);
460
+ const t = _(13);
441
461
  let n;
442
462
  t[0] !== e ? (n = e === void 0 ? {} : e, t[0] = e, t[1] = n) : n = t[1];
443
- const o = n, [c, , s] = J(r), u = L(o);
444
- let i;
445
- t[2] !== u || t[3] !== r ? (i = /* @__PURE__ */ l(async (h) => {
463
+ const a = n, [u, , c] = J(r), o = q(a);
464
+ let l;
465
+ t[2] !== o || t[3] !== r ? (l = /* @__PURE__ */ s(async (h) => {
446
466
  const g = typeof h == "function" ? await h() : h;
447
- r.signIn(g), u.current.onSignIn?.();
448
- }, "t2"), t[2] = u, t[3] = r, t[4] = i) : i = t[4];
449
- const m = i;
450
- let a;
451
- t[5] !== u || t[6] !== s ? (a = /* @__PURE__ */ l(() => {
452
- s(), u.current.onSignOut?.();
453
- }, "t3"), t[5] = u, t[6] = s, t[7] = a) : a = t[7];
454
- const f = a, d = c?.access?.payload ?? de, b = c?.authenticated ?? !1;
455
- let y;
456
- return t[8] !== m || t[9] !== f || t[10] !== d || t[11] !== b ? (y = {
467
+ r.signIn(g), o.current.onSignIn?.();
468
+ }, "t2"), t[2] = o, t[3] = r, t[4] = l) : l = t[4];
469
+ const y = l;
470
+ let f;
471
+ t[5] !== o || t[6] !== c ? (f = /* @__PURE__ */ s(() => {
472
+ c(), o.current.onSignOut?.();
473
+ }, "t3"), t[5] = o, t[6] = c, t[7] = f) : f = t[7];
474
+ const i = f, d = u?.access?.payload ?? de, m = u?.authenticated ?? !1;
475
+ let b;
476
+ return t[8] !== y || t[9] !== i || t[10] !== d || t[11] !== m ? (b = {
457
477
  currentUser: d,
458
- authenticated: b,
459
- signIn: m,
460
- signOut: f
461
- }, t[8] = m, t[9] = f, t[10] = d, t[11] = b, t[12] = y) : y = t[12], y;
478
+ authenticated: m,
479
+ signIn: y,
480
+ signOut: i
481
+ }, t[8] = y, t[9] = i, t[10] = d, t[11] = m, t[12] = b) : b = t[12], b;
462
482
  }
463
- l(me, "useSecurity");
464
- const W = Z(void 0);
465
- function Ie(r) {
466
- const e = w(7);
467
- let t, n, o;
483
+ s(me, "useSecurity");
484
+ const V = Z(void 0);
485
+ function $e(r) {
486
+ const e = _(7);
487
+ let t, n, a;
468
488
  e[0] !== r ? ({
469
489
  tokenStorage: n,
470
490
  children: t,
471
- ...o
472
- } = r, e[0] = r, e[1] = t, e[2] = n, e[3] = o) : (t = e[1], n = e[2], o = e[3]);
473
- const c = me(n, o);
474
- let s;
475
- return e[4] !== t || e[5] !== c ? (s = /* @__PURE__ */ N(W.Provider, { value: c, children: t }), e[4] = t, e[5] = c, e[6] = s) : s = e[6], s;
476
- }
477
- l(Ie, "SecurityProvider");
478
- function be() {
479
- const r = ee(W);
491
+ ...a
492
+ } = r, e[0] = r, e[1] = t, e[2] = n, e[3] = a) : (t = e[1], n = e[2], a = e[3]);
493
+ const u = me(n, a);
494
+ let c;
495
+ return e[4] !== t || e[5] !== u ? (c = /* @__PURE__ */ N(V.Provider, { value: u, children: t }), e[4] = t, e[5] = u, e[6] = c) : c = e[6], c;
496
+ }
497
+ s($e, "SecurityProvider");
498
+ function ye() {
499
+ const r = ee(V);
480
500
  if (!r)
481
501
  throw new Error("useSecurityContext must be used within a SecurityProvider");
482
502
  return r;
483
503
  }
484
- l(be, "useSecurityContext");
485
- function Le(r) {
486
- const e = w(2), {
504
+ s(ye, "useSecurityContext");
505
+ function qe(r) {
506
+ const e = _(2), {
487
507
  children: t,
488
508
  fallback: n,
489
- onUnauthorized: o
509
+ onUnauthorized: a
490
510
  } = r, {
491
- authenticated: c
492
- } = be();
493
- if (c) {
494
- let s;
495
- return e[0] !== t ? (s = /* @__PURE__ */ N(te, { children: t }), e[0] = t, e[1] = s) : s = e[1], s;
511
+ authenticated: u
512
+ } = ye();
513
+ if (u) {
514
+ let c;
515
+ return e[0] !== t ? (c = /* @__PURE__ */ N(te, { children: t }), e[0] = t, e[1] = c) : c = e[1], c;
496
516
  }
497
- return o && o(), n;
517
+ return a && a(), n;
498
518
  }
499
- l(Le, "RouteGuard");
519
+ s(qe, "RouteGuard");
500
520
  function Y(r) {
501
- const e = w(21);
521
+ const e = _(21);
502
522
  let t;
503
523
  e[0] !== r ? (t = r || {}, e[0] = r, e[1] = t) : t = e[1];
504
524
  const {
505
525
  fetcher: n
506
- } = t, o = n === void 0 ? ce.default : n, {
507
- loading: c,
508
- result: s,
509
- error: u,
510
- status: i,
511
- execute: m,
512
- reset: a,
513
- abort: f
514
- } = U(r), [d, b] = D(void 0), y = L(r);
526
+ } = t, a = n === void 0 ? ce.default : n, {
527
+ loading: u,
528
+ result: c,
529
+ error: o,
530
+ status: l,
531
+ execute: y,
532
+ reset: f,
533
+ abort: i
534
+ } = T(r), [d, m] = A(void 0), b = q(r);
515
535
  let h;
516
- e[2] !== o ? (h = se(o), e[2] = o, e[3] = h) : h = e[3];
536
+ e[2] !== a ? (h = se(a), e[2] = a, e[3] = h) : h = e[3];
517
537
  const g = h;
518
538
  let x;
519
- e[4] !== g || e[5] !== y || e[6] !== m ? (x = /* @__PURE__ */ l(async (p) => {
539
+ e[4] !== g || e[5] !== b || e[6] !== y ? (x = /* @__PURE__ */ s(async (L) => {
520
540
  try {
521
- await m(async (F) => {
522
- p.abortController = F;
523
- const C = await g.exchange(p, y.current);
524
- return b(C), await C.extractResult();
541
+ await y(async (F) => {
542
+ L.abortController = F;
543
+ const C = await g.exchange(L, b.current);
544
+ return m(C), await C.extractResult();
525
545
  });
526
546
  } catch (F) {
527
547
  const C = F;
528
- throw b(void 0), C;
548
+ throw m(void 0), C;
529
549
  }
530
- }, "t3"), e[4] = g, e[5] = y, e[6] = m, e[7] = x) : x = e[7];
531
- const S = x;
532
- let E;
533
- e[8] !== a ? (E = /* @__PURE__ */ l(() => {
534
- a(), b(void 0);
535
- }, "t4"), e[8] = a, e[9] = E) : E = e[9];
536
- const Q = E;
550
+ }, "t3"), e[4] = g, e[5] = b, e[6] = y, e[7] = x) : x = e[7];
551
+ const E = x;
537
552
  let v;
538
- e[10] !== f ? (v = /* @__PURE__ */ l(() => {
539
- f(), b(void 0);
540
- }, "t5"), e[10] = f, e[11] = v) : v = e[11];
541
- const R = v;
553
+ e[8] !== f ? (v = /* @__PURE__ */ s(() => {
554
+ f(), m(void 0);
555
+ }, "t4"), e[8] = f, e[9] = v) : v = e[9];
556
+ const Q = v;
557
+ let S;
558
+ e[10] !== i ? (S = /* @__PURE__ */ s(() => {
559
+ i(), m(void 0);
560
+ }, "t5"), e[10] = i, e[11] = S) : S = e[11];
561
+ const R = S;
542
562
  let O;
543
- return e[12] !== R || e[13] !== u || e[14] !== d || e[15] !== S || e[16] !== c || e[17] !== Q || e[18] !== s || e[19] !== i ? (O = {
544
- loading: c,
545
- result: s,
546
- error: u,
547
- status: i,
563
+ return e[12] !== R || e[13] !== o || e[14] !== d || e[15] !== E || e[16] !== u || e[17] !== Q || e[18] !== c || e[19] !== l ? (O = {
564
+ loading: u,
565
+ result: c,
566
+ error: o,
567
+ status: l,
548
568
  exchange: d,
549
- execute: S,
569
+ execute: E,
550
570
  reset: Q,
551
571
  abort: R
552
- }, e[12] = R, e[13] = u, e[14] = d, e[15] = S, e[16] = c, e[17] = Q, e[18] = s, e[19] = i, e[20] = O) : O = e[20], O;
572
+ }, e[12] = R, e[13] = o, e[14] = d, e[15] = E, e[16] = u, e[17] = Q, e[18] = c, e[19] = l, e[20] = O) : O = e[20], O;
553
573
  }
554
- l(Y, "useFetcher");
555
- function $e(r) {
556
- const e = w(11), {
574
+ s(Y, "useFetcher");
575
+ function Ie(r) {
576
+ const e = _(11), {
557
577
  loading: t,
558
578
  result: n,
559
- error: o,
560
- status: c,
561
- exchange: s,
562
- execute: u,
563
- reset: i,
564
- abort: m
579
+ error: a,
580
+ status: u,
581
+ exchange: c,
582
+ execute: o,
583
+ reset: l,
584
+ abort: y
565
585
  } = Y(r), {
566
- run: a,
567
- cancel: f,
586
+ run: f,
587
+ cancel: i,
568
588
  isPending: d
569
- } = T(u, r.debounce);
570
- let b;
571
- return e[0] !== m || e[1] !== f || e[2] !== o || e[3] !== s || e[4] !== d || e[5] !== t || e[6] !== i || e[7] !== n || e[8] !== a || e[9] !== c ? (b = {
589
+ } = D(o, r.debounce);
590
+ let m;
591
+ return e[0] !== y || e[1] !== i || e[2] !== a || e[3] !== c || e[4] !== d || e[5] !== t || e[6] !== l || e[7] !== n || e[8] !== f || e[9] !== u ? (m = {
572
592
  loading: t,
573
593
  result: n,
574
- error: o,
575
- status: c,
576
- exchange: s,
577
- reset: i,
578
- abort: m,
579
- run: a,
580
- cancel: f,
594
+ error: a,
595
+ status: u,
596
+ exchange: c,
597
+ reset: l,
598
+ abort: y,
599
+ run: f,
600
+ cancel: i,
581
601
  isPending: d
582
- }, e[0] = m, e[1] = f, e[2] = o, e[3] = s, e[4] = d, e[5] = t, e[6] = i, e[7] = n, e[8] = a, e[9] = c, e[10] = b) : b = e[10], b;
602
+ }, e[0] = y, e[1] = i, e[2] = a, e[3] = c, e[4] = d, e[5] = t, e[6] = l, e[7] = n, e[8] = f, e[9] = u, e[10] = m) : m = e[10], m;
583
603
  }
584
- l($e, "useDebouncedFetcher");
585
- function pe(r) {
586
- const e = w(22), t = r.autoExecute;
604
+ s(Ie, "useDebouncedFetcher");
605
+ function Le(r) {
606
+ const e = _(22), t = r.autoExecute;
587
607
  let n;
588
608
  e[0] !== r ? (n = {
589
609
  ...r,
590
610
  autoExecute: !1
591
611
  }, e[0] = r, e[1] = n) : n = e[1];
592
- const o = n, {
593
- loading: c,
594
- result: s,
595
- error: u,
596
- status: i,
597
- execute: m,
598
- reset: a,
599
- abort: f,
612
+ const a = n, {
613
+ loading: u,
614
+ result: c,
615
+ error: o,
616
+ status: l,
617
+ execute: y,
618
+ reset: f,
619
+ abort: i,
600
620
  getQuery: d,
601
- setQuery: b
602
- } = A(o), {
603
- run: y,
621
+ setQuery: m
622
+ } = P(a), {
623
+ run: b,
604
624
  cancel: h,
605
625
  isPending: g
606
- } = T(m, r.debounce);
626
+ } = D(y, r.debounce);
607
627
  let x;
608
- e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
609
- b(R), t && y();
610
- }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
611
- const S = x;
612
- let E, Q;
613
- e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
614
- t && y();
615
- }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
616
- let v;
617
- return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
618
- loading: c,
619
- result: s,
620
- error: u,
621
- status: i,
622
- reset: a,
623
- abort: f,
628
+ e[2] !== t || e[3] !== b || e[4] !== m ? (x = /* @__PURE__ */ s((R) => {
629
+ m(R), t && b();
630
+ }, "t1"), e[2] = t, e[3] = b, e[4] = m, e[5] = x) : x = e[5];
631
+ const E = x;
632
+ let v, Q;
633
+ e[6] !== t || e[7] !== b ? (v = /* @__PURE__ */ s(() => {
634
+ t && b();
635
+ }, "t2"), Q = [b, t], e[6] = t, e[7] = b, e[8] = v, e[9] = Q) : (v = e[8], Q = e[9]), I(v, Q);
636
+ let S;
637
+ return e[10] !== i || e[11] !== h || e[12] !== o || e[13] !== d || e[14] !== g || e[15] !== u || e[16] !== f || e[17] !== c || e[18] !== b || e[19] !== E || e[20] !== l ? (S = {
638
+ loading: u,
639
+ result: c,
640
+ error: o,
641
+ status: l,
642
+ reset: f,
643
+ abort: i,
624
644
  getQuery: d,
625
- setQuery: S,
626
- run: y,
645
+ setQuery: E,
646
+ run: b,
627
647
  cancel: h,
628
648
  isPending: g
629
- }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
649
+ }, e[10] = i, e[11] = h, e[12] = o, e[13] = d, e[14] = g, e[15] = u, e[16] = f, e[17] = c, e[18] = b, e[19] = E, e[20] = l, e[21] = S) : S = e[21], S;
630
650
  }
631
- l(pe, "useDebouncedFetcherQuery");
632
- function A(r) {
633
- const e = w(22);
651
+ s(Le, "useDebouncedFetcherQuery");
652
+ function P(r) {
653
+ const e = _(23);
634
654
  let t;
635
655
  e[0] !== r ? (t = {
636
- resultExtractor: oe,
656
+ resultExtractor: ue,
637
657
  ...r
638
658
  }, e[0] = r, e[1] = t) : t = e[1];
639
- const n = t, o = L(n), {
640
- loading: c,
641
- result: s,
642
- error: u,
643
- status: i,
644
- execute: m,
645
- reset: a,
646
- abort: f
659
+ const n = t, a = q(n), {
660
+ loading: u,
661
+ result: c,
662
+ error: o,
663
+ status: l,
664
+ execute: y,
665
+ reset: f,
666
+ abort: i
647
667
  } = Y(n);
648
668
  let d;
649
- e[2] !== m || e[3] !== o ? (d = /* @__PURE__ */ l((Q) => {
650
- const v = {
651
- url: o.current.url,
669
+ e[2] !== y || e[3] !== a ? (d = /* @__PURE__ */ s((Q) => {
670
+ const S = {
671
+ url: a.current.url,
652
672
  method: "POST",
653
673
  body: Q
654
674
  };
655
- return m(v);
656
- }, "t1"), e[2] = m, e[3] = o, e[4] = d) : d = e[4];
657
- const b = d;
658
- let y;
659
- e[5] !== b || e[6] !== n.autoExecute || e[7] !== n.initialQuery ? (y = {
675
+ return y(S);
676
+ }, "t1"), e[2] = y, e[3] = a, e[4] = d) : d = e[4];
677
+ const m = d;
678
+ let b;
679
+ e[5] !== m || e[6] !== n.autoExecute || e[7] !== n.initialQuery || e[8] !== n.query ? (b = {
660
680
  initialQuery: n.initialQuery,
681
+ query: n.query,
661
682
  autoExecute: n.autoExecute,
662
- execute: b
663
- }, e[5] = b, e[6] = n.autoExecute, e[7] = n.initialQuery, e[8] = y) : y = e[8];
683
+ execute: m
684
+ }, e[5] = m, e[6] = n.autoExecute, e[7] = n.initialQuery, e[8] = n.query, e[9] = b) : b = e[9];
664
685
  const {
665
686
  getQuery: h,
666
687
  setQuery: g
667
- } = j(y);
688
+ } = j(b);
668
689
  let x;
669
- e[9] !== b || e[10] !== h ? (x = /* @__PURE__ */ l(() => b(h()), "t3"), e[9] = b, e[10] = h, e[11] = x) : x = e[11];
670
- const S = x;
671
- let E;
672
- return e[12] !== f || e[13] !== u || e[14] !== S || e[15] !== h || e[16] !== c || e[17] !== a || e[18] !== s || e[19] !== g || e[20] !== i ? (E = {
673
- loading: c,
674
- result: s,
675
- error: u,
676
- status: i,
677
- execute: S,
678
- reset: a,
679
- abort: f,
690
+ e[10] !== m || e[11] !== h ? (x = /* @__PURE__ */ s(() => m(h()), "t3"), e[10] = m, e[11] = h, e[12] = x) : x = e[12];
691
+ const E = x;
692
+ let v;
693
+ return e[13] !== i || e[14] !== o || e[15] !== E || e[16] !== h || e[17] !== u || e[18] !== f || e[19] !== c || e[20] !== g || e[21] !== l ? (v = {
694
+ loading: u,
695
+ result: c,
696
+ error: o,
697
+ status: l,
698
+ execute: E,
699
+ reset: f,
700
+ abort: i,
680
701
  getQuery: h,
681
702
  setQuery: g
682
- }, e[12] = f, e[13] = u, e[14] = S, e[15] = h, e[16] = c, e[17] = a, e[18] = s, e[19] = g, e[20] = i, e[21] = E) : E = e[21], E;
703
+ }, e[13] = i, e[14] = o, e[15] = E, e[16] = h, e[17] = u, e[18] = f, e[19] = c, e[20] = g, e[21] = l, e[22] = v) : v = e[22], v;
683
704
  }
684
- l(A, "useFetcherQuery");
705
+ s(P, "useFetcherQuery");
706
+ function pe(r) {
707
+ return P(r);
708
+ }
709
+ s(pe, "useFetcherCountQuery");
685
710
  function Pe(r) {
686
- return A(r);
711
+ return P(r);
687
712
  }
688
- l(Pe, "useFetcherCountQuery");
713
+ s(Pe, "useFetcherListQuery");
689
714
  function Ae(r) {
690
- return A(r);
691
- }
692
- l(Ae, "useFetcherListQuery");
693
- function De(r) {
694
- const e = w(2);
715
+ const e = _(2);
695
716
  let t;
696
717
  return e[0] !== r ? (t = {
697
718
  ...r,
698
- resultExtractor: ue
699
- }, e[0] = r, e[1] = t) : t = e[1], A(t);
719
+ resultExtractor: oe
720
+ }, e[0] = r, e[1] = t) : t = e[1], P(t);
721
+ }
722
+ s(Ae, "useFetcherListStreamQuery");
723
+ function De(r) {
724
+ return P(r);
700
725
  }
701
- l(De, "useFetcherListStreamQuery");
726
+ s(De, "useFetcherPagedQuery");
702
727
  function Me(r) {
703
- return A(r);
728
+ return P(r);
704
729
  }
705
- l(Me, "useFetcherPagedQuery");
730
+ s(Me, "useFetcherSingleQuery");
706
731
  function Te(r) {
707
- return A(r);
732
+ return p(r);
708
733
  }
709
- l(Te, "useFetcherSingleQuery");
734
+ s(Te, "useCountQuery");
710
735
  function Ue(r) {
711
- return P(r);
736
+ return p(r);
712
737
  }
713
- l(Ue, "useCountQuery");
714
- function qe(r) {
715
- return P(r);
716
- }
717
- l(qe, "useListQuery");
738
+ s(Ue, "useListQuery");
718
739
  function ke(r) {
719
- return P(r);
740
+ return p(r);
720
741
  }
721
- l(ke, "useListStreamQuery");
742
+ s(ke, "useListStreamQuery");
722
743
  function ze(r) {
723
- return P(r);
744
+ return p(r);
724
745
  }
725
- l(ze, "usePagedQuery");
746
+ s(ze, "usePagedQuery");
726
747
  function Ge(r) {
727
- return P(r);
748
+ return p(r);
728
749
  }
729
- l(Ge, "useSingleQuery");
750
+ s(Ge, "useSingleQuery");
730
751
  function Ke(r) {
731
- const e = w(13), {
752
+ const e = _(13), {
732
753
  bus: t,
733
754
  handler: n
734
755
  } = r;
735
- let o;
736
- e[0] !== t || e[1] !== n ? (o = /* @__PURE__ */ l(() => t.on(n), "t0"), e[0] = t, e[1] = n, e[2] = o) : o = e[2];
737
- const c = o;
738
- let s;
739
- e[3] !== t || e[4] !== n.name ? (s = /* @__PURE__ */ l(() => t.off(n.name), "t1"), e[3] = t, e[4] = n.name, e[5] = s) : s = e[5];
740
- const u = s;
741
- let i, m;
742
- e[6] !== t || e[7] !== n ? (i = /* @__PURE__ */ l(() => (t.on(n) || console.warn(`Failed to subscribe to event bus with handler: ${n.name}`), () => {
743
- t.off(n.name);
744
- }), "t2"), m = [t, n], e[6] = t, e[7] = n, e[8] = i, e[9] = m) : (i = e[8], m = e[9]), $(i, m);
745
756
  let a;
746
- return e[10] !== c || e[11] !== u ? (a = {
747
- subscribe: c,
748
- unsubscribe: u
749
- }, e[10] = c, e[11] = u, e[12] = a) : a = e[12], a;
750
- }
751
- l(Ke, "useEventSubscription");
757
+ e[0] !== t || e[1] !== n ? (a = /* @__PURE__ */ s(() => t.on(n), "t0"), e[0] = t, e[1] = n, e[2] = a) : a = e[2];
758
+ const u = a;
759
+ let c;
760
+ e[3] !== t || e[4] !== n.name ? (c = /* @__PURE__ */ s(() => t.off(n.name), "t1"), e[3] = t, e[4] = n.name, e[5] = c) : c = e[5];
761
+ const o = c;
762
+ let l, y;
763
+ e[6] !== t || e[7] !== n ? (l = /* @__PURE__ */ s(() => (t.on(n) || console.warn(`Failed to subscribe to event bus with handler: ${n.name}`), () => {
764
+ t.off(n.name);
765
+ }), "t2"), y = [t, n], e[6] = t, e[7] = n, e[8] = l, e[9] = y) : (l = e[8], y = e[9]), I(l, y);
766
+ let f;
767
+ return e[10] !== u || e[11] !== o ? (f = {
768
+ subscribe: u,
769
+ unsubscribe: o
770
+ }, e[10] = u, e[11] = o, e[12] = f) : f = e[12], f;
771
+ }
772
+ s(Ke, "useEventSubscription");
752
773
  export {
753
774
  de as ANONYMOUS_USER,
754
775
  le as PromiseStatus,
755
- Le as RouteGuard,
756
- W as SecurityContext,
757
- Ie as SecurityProvider,
758
- Ue as useCountQuery,
759
- T as useDebouncedCallback,
760
- we as useDebouncedExecutePromise,
761
- $e as useDebouncedFetcher,
762
- pe as useDebouncedFetcherQuery,
776
+ qe as RouteGuard,
777
+ V as SecurityContext,
778
+ $e as SecurityProvider,
779
+ Te as useCountQuery,
780
+ D as useDebouncedCallback,
781
+ _e as useDebouncedExecutePromise,
782
+ Ie as useDebouncedFetcher,
783
+ Le as useDebouncedFetcherQuery,
763
784
  Re as useDebouncedQuery,
764
785
  Ke as useEventSubscription,
765
- U as useExecutePromise,
786
+ T as useExecutePromise,
766
787
  Y as useFetcher,
767
- Pe as useFetcherCountQuery,
768
- Ae as useFetcherListQuery,
769
- De as useFetcherListStreamQuery,
770
- Me as useFetcherPagedQuery,
771
- A as useFetcherQuery,
772
- Te as useFetcherSingleQuery,
788
+ pe as useFetcherCountQuery,
789
+ Pe as useFetcherListQuery,
790
+ Ae as useFetcherListStreamQuery,
791
+ De as useFetcherPagedQuery,
792
+ P as useFetcherQuery,
793
+ Me as useFetcherSingleQuery,
773
794
  Ce as useForceUpdate,
774
795
  Oe as useImmerKeyStorage,
775
796
  J as useKeyStorage,
776
- L as useLatest,
777
- qe as useListQuery,
797
+ q as useLatest,
798
+ Ue as useListQuery,
778
799
  ke as useListStreamQuery,
779
- V as useMounted,
800
+ W as useMounted,
780
801
  ze as usePagedQuery,
781
802
  ie as usePromiseState,
782
- P as useQuery,
803
+ p as useQuery,
783
804
  j as useQueryState,
784
805
  Fe as useRefs,
785
806
  ae as useRequestId,
786
807
  me as useSecurity,
787
- be as useSecurityContext,
808
+ ye as useSecurityContext,
788
809
  Ge as useSingleQuery
789
810
  };
790
811
  //# sourceMappingURL=index.es.js.map