@ahoo-wang/fetcher-react 3.5.8 → 3.6.1

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