@gen-epix/ui-client-common 4.7.0 → 4.9.0

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 (103) hide show
  1. package/dist/_chunks/CrudPage.js +236 -235
  2. package/dist/_chunks/CrudPage.js.map +1 -1
  3. package/dist/_chunks/GeoFilter.js +2 -1
  4. package/dist/_chunks/GeoFilter.js.map +1 -1
  5. package/dist/_chunks/QueryClientProvider.js +1 -1
  6. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  7. package/dist/_chunks/QueryClientService.js +39 -35
  8. package/dist/_chunks/QueryClientService.js.map +1 -1
  9. package/dist/_chunks/Table.js +1048 -714
  10. package/dist/_chunks/Table.js.map +1 -1
  11. package/dist/_chunks/TableUtil.js +5187 -230
  12. package/dist/_chunks/TableUtil.js.map +1 -1
  13. package/dist/_chunks/TextFilter.js +51 -38
  14. package/dist/_chunks/TextFilter.js.map +1 -1
  15. package/dist/_chunks/UserInvitationsAdminPage.js +3 -3
  16. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  17. package/dist/_chunks/{_cacheHas.js → _arrayIncludesWith.js} +17 -17
  18. package/dist/_chunks/_arrayIncludesWith.js.map +1 -0
  19. package/dist/_chunks/{isArrayLike.js → _arrayMap.js} +94 -94
  20. package/dist/_chunks/_arrayMap.js.map +1 -0
  21. package/dist/_chunks/_baseGet.js +61 -61
  22. package/dist/_chunks/_baseGet.js.map +1 -1
  23. package/dist/_chunks/_baseIteratee.js +28 -28
  24. package/dist/_chunks/_baseIteratee.js.map +1 -1
  25. package/dist/_chunks/_setToString.js +7 -7
  26. package/dist/_chunks/_setToString.js.map +1 -1
  27. package/dist/_chunks/middleware.js +1 -1
  28. package/dist/_chunks/middleware.js.map +1 -1
  29. package/dist/_chunks/omit.js +74 -58
  30. package/dist/_chunks/omit.js.map +1 -1
  31. package/dist/_chunks/query.js +271 -269
  32. package/dist/_chunks/query.js.map +1 -1
  33. package/dist/_chunks/react.js +1 -1
  34. package/dist/_chunks/react.js.map +1 -1
  35. package/dist/_chunks/tableStore.js +291 -246
  36. package/dist/_chunks/tableStore.js.map +1 -1
  37. package/dist/_chunks/uniq.js +2 -2
  38. package/dist/_chunks/uniq.js.map +1 -1
  39. package/dist/_chunks/useMutation.js +17 -17
  40. package/dist/_chunks/useMutation.js.map +1 -1
  41. package/dist/_chunks/useQueryMemo.js +103 -103
  42. package/dist/_chunks/useQueryMemo.js.map +1 -1
  43. package/dist/_chunks/vanilla.js +1 -1
  44. package/dist/_chunks/vanilla.js.map +1 -1
  45. package/dist/_chunks/yup.js +2 -2
  46. package/dist/_chunks/yup.js.map +1 -1
  47. package/dist/classes/abstracts/FilterAbstract/FilterAbstract.d.ts +11 -0
  48. package/dist/classes/abstracts/FilterAbstract/index.js +48 -3
  49. package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
  50. package/dist/classes/filters/BooleanFilter.d.ts +1 -0
  51. package/dist/classes/filters/DateFilter.d.ts +1 -1
  52. package/dist/classes/filters/GeoFilter.d.ts +1 -0
  53. package/dist/classes/filters/MultiSelectFilter.d.ts +9 -6
  54. package/dist/classes/filters/NumberRangeFilter.d.ts +1 -0
  55. package/dist/classes/filters/TextFilter.d.ts +1 -0
  56. package/dist/classes/services/EmotionCacheService/index.js +3 -1
  57. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  58. package/dist/components/app/App/index.js +4 -3
  59. package/dist/components/app/App/index.js.map +1 -1
  60. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +1 -1
  61. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  62. package/dist/components/ui/ApplicationBar/index.js +2 -0
  63. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  64. package/dist/components/ui/GenericErrorMessage/index.js +1 -0
  65. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  66. package/dist/components/ui/OrganizationSwitcherDialog/index.js +1 -1
  67. package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
  68. package/dist/components/ui/Table/TableDownloadSidebarItem.d.ts +10 -0
  69. package/dist/components/ui/Table/TableSidebarMenu.d.ts +2 -1
  70. package/dist/components/ui/Table/index.d.ts +1 -0
  71. package/dist/components/ui/Table/index.js +1 -1
  72. package/dist/components/ui/Table/useTableColumnsMenu.d.ts +6 -0
  73. package/dist/dataHooks/useSitesQuery/index.d.ts +1 -0
  74. package/dist/dataHooks/useSitesQuery/index.js +18 -0
  75. package/dist/dataHooks/useSitesQuery/index.js.map +1 -0
  76. package/dist/dataHooks/useSitesQuery/useSitesQuery.d.ts +5 -0
  77. package/dist/locale/en.json +16 -0
  78. package/dist/locale/nl.json +16 -0
  79. package/dist/models/table.models.d.ts +2 -1
  80. package/dist/models/table.models.js.map +1 -1
  81. package/dist/pages/CrudPage/CrudPage.d.ts +1 -1
  82. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +12 -11
  83. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
  84. package/dist/pages/OutagesAdminPage/index.js +55 -55
  85. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  86. package/dist/pages/UsersAdminPage/index.js +90 -90
  87. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  88. package/dist/stores/tableStore/tableStore.d.ts +3 -1
  89. package/dist/theme/demoTheme/index.js +1 -1
  90. package/dist/theme/demoTheme/index.js.map +1 -1
  91. package/dist/utils/TableUtil/TableUtil.d.ts +13 -1
  92. package/package.json +38 -34
  93. package/dist/_chunks/_baseFlatten.js +0 -26
  94. package/dist/_chunks/_baseFlatten.js.map +0 -1
  95. package/dist/_chunks/_cacheHas.js.map +0 -1
  96. package/dist/_chunks/isArrayLike.js.map +0 -1
  97. package/dist/_chunks/useColumnsMenu.js +0 -159
  98. package/dist/_chunks/useColumnsMenu.js.map +0 -1
  99. package/dist/hooks/useColumnsMenu/index.d.ts +0 -1
  100. package/dist/hooks/useColumnsMenu/index.js +0 -1
  101. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +0 -6
  102. package/dist/test/lib/index.d.ts +0 -1
  103. package/dist/test/lib/render.d.ts +0 -2
@@ -1,11 +1,62 @@
1
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
2
- var e = {
1
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/subscribable.js
2
+ var e = class {
3
+ constructor() {
4
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
5
+ }
6
+ subscribe(e) {
7
+ return this.listeners.add(e), this.onSubscribe(), () => {
8
+ this.listeners.delete(e), this.onUnsubscribe();
9
+ };
10
+ }
11
+ hasListeners() {
12
+ return this.listeners.size > 0;
13
+ }
14
+ onSubscribe() {}
15
+ onUnsubscribe() {}
16
+ }, t = new class extends e {
17
+ #e;
18
+ #t;
19
+ #n;
20
+ constructor() {
21
+ super(), this.#n = (e) => {
22
+ if (typeof window < "u" && window.addEventListener) {
23
+ let t = () => e();
24
+ return window.addEventListener("visibilitychange", t, !1), () => {
25
+ window.removeEventListener("visibilitychange", t);
26
+ };
27
+ }
28
+ };
29
+ }
30
+ onSubscribe() {
31
+ this.#t || this.setEventListener(this.#n);
32
+ }
33
+ onUnsubscribe() {
34
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
35
+ }
36
+ setEventListener(e) {
37
+ this.#n = e, this.#t?.(), this.#t = e((e) => {
38
+ typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
39
+ });
40
+ }
41
+ setFocused(e) {
42
+ this.#e !== e && (this.#e = e, this.onFocus());
43
+ }
44
+ onFocus() {
45
+ let e = this.isFocused();
46
+ this.listeners.forEach((t) => {
47
+ t(e);
48
+ });
49
+ }
50
+ isFocused() {
51
+ return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
52
+ }
53
+ }(), n = {
3
54
  setTimeout: (e, t) => setTimeout(e, t),
4
55
  clearTimeout: (e) => clearTimeout(e),
5
56
  setInterval: (e, t) => setInterval(e, t),
6
57
  clearInterval: (e) => clearInterval(e)
7
- }, t = new class {
8
- #e = e;
58
+ }, r = new class {
59
+ #e = n;
9
60
  #t = !1;
10
61
  setTimeoutProvider(e) {
11
62
  process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
@@ -26,30 +77,30 @@ var e = {
26
77
  this.#e.clearInterval(e);
27
78
  }
28
79
  }();
29
- function n(e) {
80
+ function i(e) {
30
81
  setTimeout(e, 0);
31
82
  }
32
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/utils.js
33
- var r = typeof window > "u" || "Deno" in globalThis;
34
- function i() {}
35
- function a(e, t) {
83
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/utils.js
84
+ var a = typeof window > "u" || "Deno" in globalThis;
85
+ function o() {}
86
+ function s(e, t) {
36
87
  return typeof e == "function" ? e(t) : e;
37
88
  }
38
- function o(e) {
89
+ function c(e) {
39
90
  return typeof e == "number" && e >= 0 && e !== Infinity;
40
91
  }
41
- function s(e, t) {
92
+ function l(e, t) {
42
93
  return Math.max(e + (t || 0) - Date.now(), 0);
43
94
  }
44
- function c(e, t) {
95
+ function u(e, t) {
45
96
  return typeof e == "function" ? e(t) : e;
46
97
  }
47
- function l(e, t) {
98
+ function d(e, t) {
48
99
  let { type: n = "all", exact: r, fetchStatus: i, predicate: a, queryKey: o, stale: s } = e;
49
100
  if (o) {
50
101
  if (r) {
51
- if (t.queryHash !== d(o, t.options)) return !1;
52
- } else if (!p(t.queryKey, o)) return !1;
102
+ if (t.queryHash !== p(o, t.options)) return !1;
103
+ } else if (!h(t.queryKey, o)) return !1;
53
104
  }
54
105
  if (n !== "all") {
55
106
  let e = t.isActive();
@@ -57,180 +108,186 @@ function l(e, t) {
57
108
  }
58
109
  return !(typeof s == "boolean" && t.isStale() !== s || i && i !== t.state.fetchStatus || a && !a(t));
59
110
  }
60
- function u(e, t) {
111
+ function f(e, t) {
61
112
  let { exact: n, status: r, predicate: i, mutationKey: a } = e;
62
113
  if (a) {
63
114
  if (!t.options.mutationKey) return !1;
64
115
  if (n) {
65
- if (f(t.options.mutationKey) !== f(a)) return !1;
66
- } else if (!p(t.options.mutationKey, a)) return !1;
116
+ if (m(t.options.mutationKey) !== m(a)) return !1;
117
+ } else if (!h(t.options.mutationKey, a)) return !1;
67
118
  }
68
119
  return !(r && t.state.status !== r || i && !i(t));
69
120
  }
70
- function d(e, t) {
71
- return (t?.queryKeyHashFn || f)(e);
121
+ function p(e, t) {
122
+ return (t?.queryKeyHashFn || m)(e);
72
123
  }
73
- function f(e) {
74
- return JSON.stringify(e, (e, t) => v(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
124
+ function m(e) {
125
+ return JSON.stringify(e, (e, t) => b(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
75
126
  }
76
- function p(e, t) {
127
+ function h(e, t) {
77
128
  if (e === t) return !0;
78
129
  if (typeof e != typeof t) return !1;
79
130
  if (e && t && typeof e == "object" && typeof t == "object") {
131
+ if (Array.isArray(e) !== Array.isArray(t)) return !1;
80
132
  if (Array.isArray(e) && Array.isArray(t)) {
81
133
  if (t.length > e.length) return !1;
82
- for (let n = 0; n < t.length; n++) if (!p(e[n], t[n])) return !1;
134
+ for (let n = 0; n < t.length; n++) if (!h(e[n], t[n])) return !1;
83
135
  return !0;
84
136
  }
85
137
  let n = Object.keys(t);
86
- for (let r of n) if (!p(e[r], t[r])) return !1;
138
+ for (let r of n) if (!h(e[r], t[r])) return !1;
87
139
  return !0;
88
140
  }
89
141
  return !1;
90
142
  }
91
- var m = Object.prototype.hasOwnProperty;
92
- function h(e, t, n = 0) {
143
+ var g = Object.prototype.hasOwnProperty;
144
+ function _(e, t, n = 0) {
93
145
  if (e === t) return e;
94
146
  if (n > 500) return t;
95
- let r = _(e) && _(t);
96
- if (!r && !(v(e) && v(t))) return t;
147
+ let r = y(e) && y(t);
148
+ if (!r && !(b(e) && b(t))) return t;
97
149
  let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
98
150
  for (let l = 0; l < o; l++) {
99
151
  let o = r ? l : a[l], u = e[o], d = t[o];
100
152
  if (u === d) {
101
- s[o] = u, (r ? l < i : m.call(e, o)) && c++;
153
+ s[o] = u, (r ? l < i : g.call(e, o)) && c++;
102
154
  continue;
103
155
  }
104
156
  if (u === null || d === null || typeof u != "object" || typeof d != "object") {
105
157
  s[o] = d;
106
158
  continue;
107
159
  }
108
- let f = h(u, d, n + 1);
160
+ let f = _(u, d, n + 1);
109
161
  s[o] = f, f === u && c++;
110
162
  }
111
163
  return i === o && c === i ? e : s;
112
164
  }
113
- function g(e, t) {
165
+ function v(e, t) {
114
166
  if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
115
- for (let n of Object.keys(e)) if (!m.call(t, n) || e[n] !== t[n]) return !1;
167
+ for (let n of Object.keys(e)) if (!g.call(t, n) || e[n] !== t[n]) return !1;
116
168
  return !0;
117
169
  }
118
- function _(e) {
170
+ function y(e) {
119
171
  return Array.isArray(e) && e.length === Object.keys(e).length;
120
172
  }
121
- function v(e) {
122
- if (!y(e)) return !1;
173
+ function b(e) {
174
+ if (!x(e)) return !1;
123
175
  let t = Object.getPrototypeOf(e), n = t?.constructor;
124
176
  if (n === void 0) return !0;
125
177
  if (typeof n != "function") return !1;
126
178
  let r = n.prototype;
127
- return !(!y(r) || !r.hasOwnProperty("isPrototypeOf") || t !== Object.prototype);
179
+ return !(!x(r) || !r.hasOwnProperty("isPrototypeOf") || t !== Object.prototype);
128
180
  }
129
- function y(e) {
181
+ function x(e) {
130
182
  return Object.prototype.toString.call(e) === "[object Object]";
131
183
  }
132
- function b(e) {
133
- return new Promise((n) => {
134
- t.setTimeout(n, e);
184
+ function S(e) {
185
+ return new Promise((t) => {
186
+ r.setTimeout(t, e);
135
187
  });
136
188
  }
137
- function x(e, t, n) {
189
+ function C(e, t, n) {
138
190
  if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
139
191
  if (n.structuralSharing !== !1) {
140
192
  if (process.env.NODE_ENV !== "production") try {
141
- return h(e, t);
193
+ return _(e, t);
142
194
  } catch (e) {
143
195
  throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
144
196
  }
145
- return h(e, t);
197
+ return _(e, t);
146
198
  }
147
199
  return t;
148
200
  }
149
- function S(e, t, n = 0) {
150
- let r = [...e, t];
151
- return n && r.length > n ? r.slice(-n) : r;
152
- }
153
- function C(e, t, n = 0) {
154
- let r = [t, ...e];
155
- return n && r.length > n ? r.slice(0, n) : r;
156
- }
157
- var w = Symbol();
158
- function T(e, t) {
159
- return process.env.NODE_ENV !== "production" && e.queryFn === w && console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === w ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
201
+ function w(e, t, n, r) {
202
+ let i = r ? [t, ...e] : [...e, t];
203
+ return n && i.length > n ? r ? i.slice(0, n) : i.slice(-n) : i;
160
204
  }
205
+ var T = Symbol();
161
206
  function E(e, t) {
207
+ return process.env.NODE_ENV !== "production" && e.queryFn === T && console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === T ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
208
+ }
209
+ function D(e, t) {
162
210
  return typeof e == "function" ? e(...t) : !!e;
163
211
  }
164
- var D = Symbol();
165
- function O(e, t, n, r) {
212
+ var O = Symbol();
213
+ function k(e, t, n, r) {
166
214
  let i = !1, a;
167
215
  return Object.defineProperties(e, {
168
- [D]: { value: r },
216
+ [O]: { value: r },
169
217
  signal: {
170
218
  enumerable: !0,
171
219
  get: () => (a ??= t(), i || (i = !0, a.aborted ? n() : a.addEventListener("abort", n, { once: !0 })), a)
172
220
  }
173
221
  }), e;
174
222
  }
175
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/environmentManager.js
176
- var k = () => r, A = () => k(), j = class {
177
- constructor() {
178
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
179
- }
180
- subscribe(e) {
181
- return this.listeners.add(e), this.onSubscribe(), () => {
182
- this.listeners.delete(e), this.onUnsubscribe();
183
- };
184
- }
185
- hasListeners() {
186
- return this.listeners.size > 0;
187
- }
188
- onSubscribe() {}
189
- onUnsubscribe() {}
190
- }, M = new class extends j {
191
- #e;
192
- #t;
193
- #n;
194
- constructor() {
195
- super(), this.#n = (e) => {
196
- if (typeof window < "u" && window.addEventListener) {
197
- let t = () => e();
198
- return window.addEventListener("visibilitychange", t, !1), () => {
199
- window.removeEventListener("visibilitychange", t);
223
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/environmentManager.js
224
+ var A = () => a, j = () => A();
225
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
226
+ function M(e) {
227
+ return { onFetch: (t, n) => {
228
+ let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
229
+ pages: [],
230
+ pageParams: []
231
+ }, c = 0, l = async () => {
232
+ let n = !1, l = t, u = (e) => {
233
+ k(e, () => t.signal, () => n = !0, l[O]);
234
+ }, d = E(t.options, t.fetchOptions), f = async (e, r, i) => {
235
+ if (n) return Promise.reject(t.signal.reason);
236
+ if (r == null && e.pages.length) return Promise.resolve(e);
237
+ let a = (() => {
238
+ let e = {
239
+ client: t.client,
240
+ queryKey: t.queryKey,
241
+ pageParam: r,
242
+ direction: i ? "backward" : "forward",
243
+ meta: t.options.meta
244
+ };
245
+ return u(e), e;
246
+ })(), o = await d(a), { maxPages: s } = t.options;
247
+ return {
248
+ pages: w(e.pages, o, s, i),
249
+ pageParams: w(e.pageParams, r, s, i)
250
+ };
251
+ };
252
+ if (i && a.length) {
253
+ let e = i === "backward", t = e ? P : N, n = {
254
+ pages: a,
255
+ pageParams: o
200
256
  };
257
+ s = await f(n, t(r, n), e);
258
+ } else {
259
+ let t = e ?? a.length;
260
+ do {
261
+ let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : N(r, s);
262
+ if (c > 0 && e == null) break;
263
+ s = await f(s, e), c++;
264
+ } while (c < t);
201
265
  }
266
+ return s;
202
267
  };
203
- }
204
- onSubscribe() {
205
- this.#t || this.setEventListener(this.#n);
206
- }
207
- onUnsubscribe() {
208
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
209
- }
210
- setEventListener(e) {
211
- this.#n = e, this.#t?.(), this.#t = e((e) => {
212
- typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
213
- });
214
- }
215
- setFocused(e) {
216
- this.#e !== e && (this.#e = e, this.onFocus());
217
- }
218
- onFocus() {
219
- let e = this.isFocused();
220
- this.listeners.forEach((t) => {
221
- t(e);
222
- });
223
- }
224
- isFocused() {
225
- return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
226
- }
227
- }(), N = n;
228
- function P() {
268
+ t.fetchFn = t.options.persister ? () => t.options.persister?.(l, {
269
+ client: t.client,
270
+ queryKey: t.queryKey,
271
+ meta: t.options.meta,
272
+ signal: t.signal
273
+ }, n) : l;
274
+ } };
275
+ }
276
+ function N(e, { pages: t, pageParams: n }) {
277
+ let r = t.length - 1;
278
+ return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
279
+ }
280
+ function P(e, { pages: t, pageParams: n }) {
281
+ return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
282
+ }
283
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/notifyManager.js
284
+ var F = i;
285
+ function I() {
229
286
  let e = [], t = 0, n = (e) => {
230
287
  e();
231
288
  }, r = (e) => {
232
289
  e();
233
- }, i = N, a = (r) => {
290
+ }, i = F, a = (r) => {
234
291
  t ? e.push(r) : i(() => {
235
292
  n(r);
236
293
  });
@@ -272,7 +329,23 @@ function P() {
272
329
  }
273
330
  };
274
331
  }
275
- var F = P(), I = new class extends j {
332
+ var L = I(), R = class {
333
+ #e;
334
+ destroy() {
335
+ this.clearGcTimeout();
336
+ }
337
+ scheduleGc() {
338
+ this.clearGcTimeout(), c(this.gcTime) && (this.#e = r.setTimeout(() => {
339
+ this.optionalRemove();
340
+ }, this.gcTime));
341
+ }
342
+ updateGcTime(e) {
343
+ this.gcTime = Math.max(this.gcTime || 0, e ?? (j() ? Infinity : 3e5));
344
+ }
345
+ clearGcTimeout() {
346
+ this.#e !== void 0 && (r.clearTimeout(this.#e), this.#e = void 0);
347
+ }
348
+ }, z = new class extends e {
276
349
  #e = !0;
277
350
  #t;
278
351
  #n;
@@ -304,147 +377,71 @@ var F = P(), I = new class extends j {
304
377
  return this.#e;
305
378
  }
306
379
  }();
307
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/retryer.js
308
- function L(e) {
380
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/retryer.js
381
+ function B(e) {
309
382
  return Math.min(1e3 * 2 ** e, 3e4);
310
383
  }
311
- function R(e) {
312
- return (e ?? "online") !== "online" || I.isOnline();
384
+ function V(e) {
385
+ return (e ?? "online") !== "online" || z.isOnline();
313
386
  }
314
- var z = class extends Error {
387
+ var H = class extends Error {
315
388
  constructor(e) {
316
389
  super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
317
390
  }
318
391
  };
319
- function B(e) {
320
- let t = !1, n = 0, r, a = "pending", o, s, c = new Promise((e, t) => {
321
- o = e, s = t;
392
+ function U(e) {
393
+ let n = !1, r = 0, i, a = "pending", s, c, l = new Promise((e, t) => {
394
+ s = e, c = t;
322
395
  });
323
- c.catch(i);
324
- let l = () => a !== "pending", u = (t) => {
325
- if (!l()) {
326
- let n = new z(t);
327
- g(n), e.onCancel?.(n);
396
+ l.catch(o);
397
+ let u = () => a !== "pending", d = (t) => {
398
+ if (!u()) {
399
+ let n = new H(t);
400
+ _(n), e.onCancel?.(n);
328
401
  }
329
- }, d = () => {
330
- t = !0;
331
402
  }, f = () => {
332
- t = !1;
333
- }, p = () => M.isFocused() && (e.networkMode === "always" || I.isOnline()) && e.canRun(), m = () => R(e.networkMode) && e.canRun(), h = (e) => {
334
- l() || (r?.(), a = "resolved", o(e));
335
- }, g = (e) => {
336
- l() || (r?.(), a = "rejected", s(e));
337
- }, _ = (t) => new Promise((n) => {
338
- r = (e) => {
339
- (l() || t()) && n(e);
403
+ n = !0;
404
+ }, p = () => {
405
+ n = !1;
406
+ }, m = () => t.isFocused() && (e.networkMode === "always" || z.isOnline()) && e.canRun(), h = () => V(e.networkMode) && e.canRun(), g = (e) => {
407
+ u() || (i?.(), a = "resolved", s(e));
408
+ }, _ = (e) => {
409
+ u() || (i?.(), a = "rejected", c(e));
410
+ }, v = (t) => new Promise((n) => {
411
+ i = (e) => {
412
+ (u() || t()) && n(e);
340
413
  }, e.onPause?.();
341
414
  }).then(() => {
342
- r = void 0, l() || e.onContinue?.();
343
- }), v = () => {
344
- if (l()) return;
345
- let r, i = n === 0 ? e.initialPromise : void 0;
415
+ i = void 0, u() || e.onContinue?.();
416
+ }), y = () => {
417
+ if (u()) return;
418
+ let t, i = r === 0 ? e.initialPromise : void 0;
346
419
  try {
347
- r = i ?? e.fn();
420
+ t = i ?? e.fn();
348
421
  } catch (e) {
349
- r = Promise.reject(e);
422
+ t = Promise.reject(e);
350
423
  }
351
- Promise.resolve(r).then(h).catch((r) => {
352
- if (l()) return;
353
- let i = e.retry ?? (A() ? 0 : 3), a = e.retryDelay ?? L, o = typeof a == "function" ? a(n, r) : a, s = i === !0 || typeof i == "number" && n < i || typeof i == "function" && i(n, r);
354
- t || !s ? g(r) : (n++, e.onFail?.(n, r), b(o).then(() => l() || p() ? void 0 : _(p)).then(() => {
355
- t ? g(r) : v();
424
+ Promise.resolve(t).then(g).catch((t) => {
425
+ if (u()) return;
426
+ let i = e.retry ?? (j() ? 0 : 3), a = e.retryDelay ?? B, o = typeof a == "function" ? a(r, t) : a, s = i === !0 || typeof i == "number" && r < i || typeof i == "function" && i(r, t);
427
+ n || !s ? _(t) : (r++, e.onFail?.(r, t), S(o).then(() => u() || m() ? void 0 : v(m)).then(() => {
428
+ n ? _(t) : y();
356
429
  }));
357
430
  });
358
431
  };
359
432
  return {
360
- promise: c,
433
+ promise: l,
361
434
  status: () => a,
362
- cancel: u,
363
- continue: () => (r?.(), c),
364
- cancelRetry: d,
365
- continueRetry: f,
366
- canStart: m,
367
- start: () => (m() ? v() : _(m).then(v), c)
435
+ cancel: d,
436
+ continue: () => (i?.(), l),
437
+ cancelRetry: f,
438
+ continueRetry: p,
439
+ canStart: h,
440
+ start: () => (h() ? y() : v(h).then(y), l)
368
441
  };
369
442
  }
370
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/removable.js
371
- var V = class {
372
- #e;
373
- destroy() {
374
- this.clearGcTimeout();
375
- }
376
- scheduleGc() {
377
- this.clearGcTimeout(), o(this.gcTime) && (this.#e = t.setTimeout(() => {
378
- this.optionalRemove();
379
- }, this.gcTime));
380
- }
381
- updateGcTime(e) {
382
- this.gcTime = Math.max(this.gcTime || 0, e ?? (A() ? Infinity : 3e5));
383
- }
384
- clearGcTimeout() {
385
- this.#e !== void 0 && (t.clearTimeout(this.#e), this.#e = void 0);
386
- }
387
- };
388
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
389
- function H(e) {
390
- return { onFetch: (t, n) => {
391
- let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
392
- pages: [],
393
- pageParams: []
394
- }, c = 0, l = async () => {
395
- let n = !1, l = t, u = (e) => {
396
- O(e, () => t.signal, () => n = !0, l[D]);
397
- }, d = T(t.options, t.fetchOptions), f = async (e, r, i) => {
398
- if (n) return Promise.reject(t.signal.reason);
399
- if (r == null && e.pages.length) return Promise.resolve(e);
400
- let a = (() => {
401
- let e = {
402
- client: t.client,
403
- queryKey: t.queryKey,
404
- pageParam: r,
405
- direction: i ? "backward" : "forward",
406
- meta: t.options.meta
407
- };
408
- return u(e), e;
409
- })(), o = await d(a), { maxPages: s } = t.options, c = i ? C : S;
410
- return {
411
- pages: c(e.pages, o, s),
412
- pageParams: c(e.pageParams, r, s)
413
- };
414
- };
415
- if (i && a.length) {
416
- let e = i === "backward", t = e ? W : U, n = {
417
- pages: a,
418
- pageParams: o
419
- };
420
- s = await f(n, t(r, n), e);
421
- } else {
422
- let t = e ?? a.length;
423
- do {
424
- let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : U(r, s);
425
- if (c > 0 && e == null) break;
426
- s = await f(s, e), c++;
427
- } while (c < t);
428
- }
429
- return s;
430
- };
431
- t.fetchFn = t.options.persister ? () => t.options.persister?.(l, {
432
- client: t.client,
433
- queryKey: t.queryKey,
434
- meta: t.options.meta,
435
- signal: t.signal
436
- }, n) : l;
437
- } };
438
- }
439
- function U(e, { pages: t, pageParams: n }) {
440
- let r = t.length - 1;
441
- return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
442
- }
443
- function W(e, { pages: t, pageParams: n }) {
444
- return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
445
- }
446
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/query.js
447
- var G = class extends V {
443
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/query.js
444
+ var W = class extends R {
448
445
  #e;
449
446
  #t;
450
447
  #n;
@@ -455,7 +452,7 @@ var G = class extends V {
455
452
  #s;
456
453
  #c;
457
454
  constructor(e) {
458
- super(), this.#c = !1, this.#s = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#r = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = J(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
455
+ super(), this.#c = !1, this.#s = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#r = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = q(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
459
456
  }
460
457
  get meta() {
461
458
  return this.options.meta;
@@ -471,16 +468,16 @@ var G = class extends V {
471
468
  ...this.#s,
472
469
  ...e
473
470
  }, e?._type && (this.#e = e._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
474
- let e = J(this.options);
475
- e.data !== void 0 && (this.setState(q(e.data, e.dataUpdatedAt)), this.#t = e);
471
+ let e = q(this.options);
472
+ e.data !== void 0 && (this.setState(K(e.data, e.dataUpdatedAt)), this.#t = e);
476
473
  }
477
474
  }
478
475
  optionalRemove() {
479
476
  !this.observers.length && this.state.fetchStatus === "idle" && this.#r.remove(this);
480
477
  }
481
478
  setData(e, t) {
482
- let n = x(this.state.data, e, this.options);
483
- return this.#l({
479
+ let n = C(this.state.data, e, this.options);
480
+ return this.#u({
484
481
  data: n,
485
482
  type: "success",
486
483
  dataUpdatedAt: t?.updatedAt,
@@ -488,17 +485,17 @@ var G = class extends V {
488
485
  }), n;
489
486
  }
490
487
  setState(e) {
491
- this.#l({
488
+ this.#u({
492
489
  type: "setState",
493
490
  state: e
494
491
  });
495
492
  }
496
493
  cancel(e) {
497
494
  let t = this.#a?.promise;
498
- return this.#a?.cancel(e), t ? t.then(i).catch(i) : Promise.resolve();
495
+ return this.#a?.cancel(e), t ? t.then(o).catch(o) : Promise.resolve();
499
496
  }
500
497
  destroy() {
501
- super.destroy(), this.cancel({ silent: !0 });
498
+ this.cancel({ silent: !0 }), super.destroy();
502
499
  }
503
500
  get resetState() {
504
501
  return this.#t;
@@ -507,22 +504,22 @@ var G = class extends V {
507
504
  this.destroy(), this.setState(this.resetState);
508
505
  }
509
506
  isActive() {
510
- return this.observers.some((e) => c(e.options.enabled, this) !== !1);
507
+ return this.observers.some((e) => u(e.options.enabled, this) !== !1);
511
508
  }
512
509
  isDisabled() {
513
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === w || !this.isFetched();
510
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === T || !this.isFetched();
514
511
  }
515
512
  isFetched() {
516
513
  return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
517
514
  }
518
515
  isStatic() {
519
- return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
516
+ return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => u(e.options.staleTime, this) === "static");
520
517
  }
521
518
  isStale() {
522
519
  return this.getObserversCount() > 0 ? this.observers.some((e) => e.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
523
520
  }
524
521
  isStaleByTime(e = 0) {
525
- return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !s(this.state.dataUpdatedAt, e);
522
+ return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !l(this.state.dataUpdatedAt, e);
526
523
  }
527
524
  onFocus() {
528
525
  this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#a?.continue();
@@ -539,7 +536,7 @@ var G = class extends V {
539
536
  }
540
537
  removeObserver(e) {
541
538
  let t = this.observers.indexOf(e);
542
- t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#c || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.scheduleGc()), this.#r.notify({
539
+ t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#c || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.#l()), this.#r.notify({
543
540
  type: "observerRemoved",
544
541
  query: this,
545
542
  observer: e
@@ -549,7 +546,7 @@ var G = class extends V {
549
546
  return this.observers.length;
550
547
  }
551
548
  invalidate() {
552
- this.state.isInvalidated || this.#l({ type: "invalidate" });
549
+ this.state.isInvalidated || this.#u({ type: "invalidate" });
553
550
  }
554
551
  async fetch(e, t) {
555
552
  if (this.state.fetchStatus !== "idle" && this.#a?.status() !== "rejected") {
@@ -563,7 +560,7 @@ var G = class extends V {
563
560
  process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));
564
561
  let n = new AbortController(), r = (e) => {
565
562
  Object.defineProperties(e, {
566
- [D]: {
563
+ [O]: {
567
564
  value: n.signal,
568
565
  enumerable: !0
569
566
  },
@@ -573,7 +570,7 @@ var G = class extends V {
573
570
  }
574
571
  });
575
572
  }, i = () => {
576
- let e = T(this.options, t), n = (() => {
573
+ let e = E(this.options, t), n = (() => {
577
574
  let e = {
578
575
  client: this.#i,
579
576
  queryKey: this.queryKey,
@@ -593,31 +590,31 @@ var G = class extends V {
593
590
  };
594
591
  return r(e), e;
595
592
  })();
596
- (this.#e === "infinite" ? H(this.options.pages) : this.options.behavior)?.onFetch(a, this), this.#n = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#l({
593
+ (this.#e === "infinite" ? M(this.options.pages) : this.options.behavior)?.onFetch(a, this), this.#n = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#u({
597
594
  type: "fetch",
598
595
  meta: a.fetchOptions?.meta
599
596
  });
600
- let o = this.#a = B({
597
+ let o = this.#a = U({
601
598
  initialPromise: t?.initialPromise,
602
599
  fn: a.fetchFn,
603
600
  onCancel: (e) => {
604
- e instanceof z && e.revert && this.setState({
601
+ e instanceof H && e.revert && this.setState({
605
602
  ...this.#n,
606
603
  fetchStatus: "idle"
607
604
  }), n.abort();
608
605
  },
609
606
  onFail: (e, t) => {
610
- this.#l({
607
+ this.#u({
611
608
  type: "failed",
612
609
  failureCount: e,
613
610
  error: t
614
611
  });
615
612
  },
616
613
  onPause: () => {
617
- this.#l({ type: "pause" });
614
+ this.#u({ type: "pause" });
618
615
  },
619
616
  onContinue: () => {
620
- this.#l({ type: "continue" });
617
+ this.#u({ type: "continue" });
621
618
  },
622
619
  retry: a.options.retry,
623
620
  retryDelay: a.options.retryDelay,
@@ -629,7 +626,7 @@ var G = class extends V {
629
626
  if (e === void 0) throw process.env.NODE_ENV !== "production" && console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`), Error(`${this.queryHash} data is undefined`);
630
627
  return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
631
628
  } catch (e) {
632
- if (e instanceof z) {
629
+ if (e instanceof H) {
633
630
  if (e.silent) {
634
631
  if (this.#a !== o && this.#o) return this.#o;
635
632
  throw e;
@@ -639,17 +636,20 @@ var G = class extends V {
639
636
  return this.state.data;
640
637
  }
641
638
  }
642
- throw this.#l({
639
+ throw this.#u({
643
640
  type: "error",
644
641
  error: e
645
642
  }), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
646
643
  } finally {
647
- this.#a === o && (this.#a = void 0, this.#o = void 0), this.scheduleGc();
644
+ this.#a === o && (this.#a = void 0, this.#o = void 0), this.#l();
648
645
  }
649
646
  })();
650
647
  return this.#o = s, o.start(), s;
651
648
  }
652
- #l(e) {
649
+ #l() {
650
+ this.#r.get(this.queryHash) === this && this.scheduleGc();
651
+ }
652
+ #u(e) {
653
653
  let t = (t) => {
654
654
  switch (e.type) {
655
655
  case "failed": return {
@@ -667,13 +667,13 @@ var G = class extends V {
667
667
  };
668
668
  case "fetch": return {
669
669
  ...t,
670
- ...K(t.data, this.options),
670
+ ...G(t.data, this.options),
671
671
  fetchMeta: e.meta ?? null
672
672
  };
673
- case "success":
673
+ case "success": {
674
674
  let n = {
675
675
  ...t,
676
- ...q(e.data, e.dataUpdatedAt),
676
+ ...K(e.data, e.dataUpdatedAt),
677
677
  dataUpdateCount: t.dataUpdateCount + 1,
678
678
  ...!e.manual && {
679
679
  fetchStatus: "idle",
@@ -682,19 +682,21 @@ var G = class extends V {
682
682
  }
683
683
  };
684
684
  return this.#n = e.manual ? n : void 0, n;
685
- case "error":
686
- let r = e.error;
685
+ }
686
+ case "error": {
687
+ let n = e.error;
687
688
  return {
688
689
  ...t,
689
- error: r,
690
+ error: n,
690
691
  errorUpdateCount: t.errorUpdateCount + 1,
691
692
  errorUpdatedAt: Date.now(),
692
693
  fetchFailureCount: t.fetchFailureCount + 1,
693
- fetchFailureReason: r,
694
+ fetchFailureReason: n,
694
695
  fetchStatus: "idle",
695
696
  status: "error",
696
697
  isInvalidated: !0
697
698
  };
699
+ }
698
700
  case "invalidate": return {
699
701
  ...t,
700
702
  isInvalidated: !0
@@ -705,7 +707,7 @@ var G = class extends V {
705
707
  };
706
708
  }
707
709
  };
708
- this.state = t(this.state), F.batch(() => {
710
+ this.state = t(this.state), L.batch(() => {
709
711
  this.observers.slice().forEach((e) => {
710
712
  e.onQueryUpdate();
711
713
  }), this.#r.notify({
@@ -716,18 +718,18 @@ var G = class extends V {
716
718
  });
717
719
  }
718
720
  };
719
- function K(e, t) {
721
+ function G(e, t) {
720
722
  return {
721
723
  fetchFailureCount: 0,
722
724
  fetchFailureReason: null,
723
- fetchStatus: R(t.networkMode) ? "fetching" : "paused",
725
+ fetchStatus: V(t.networkMode) ? "fetching" : "paused",
724
726
  ...e === void 0 && {
725
727
  error: null,
726
728
  status: "pending"
727
729
  }
728
730
  };
729
731
  }
730
- function q(e, t) {
732
+ function K(e, t) {
731
733
  return {
732
734
  data: e,
733
735
  dataUpdatedAt: t ?? Date.now(),
@@ -736,7 +738,7 @@ function q(e, t) {
736
738
  status: "success"
737
739
  };
738
740
  }
739
- function J(e) {
741
+ function q(e) {
740
742
  let t = typeof e.initialData == "function" ? e.initialData() : e.initialData, n = t !== void 0, r = n ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
741
743
  return {
742
744
  data: t,
@@ -753,6 +755,6 @@ function J(e) {
753
755
  fetchStatus: "idle"
754
756
  };
755
757
  }
756
- export { s as C, w as S, p as _, I as a, g as b, j as c, f as d, d as f, i as g, l as h, B as i, A as l, u as m, K as n, F as o, o as p, V as r, M as s, G as t, a as u, x as v, t as w, E as x, c as y };
758
+ export { t as C, r as S, u as _, R as a, T as b, s as c, c as d, f, C as g, h, z as i, m as l, o as m, G as n, L as o, d as p, U as r, j as s, W as t, p as u, v, e as w, l as x, D as y };
757
759
 
758
760
  //# sourceMappingURL=query.js.map