@gen-epix/ui-client-common 4.6.1 → 4.8.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 (146) hide show
  1. package/README.md +2 -2
  2. package/dist/_chunks/Breadcrumbs.js +4 -4
  3. package/dist/_chunks/CrudPage.js +233 -232
  4. package/dist/_chunks/CrudPage.js.map +1 -1
  5. package/dist/_chunks/GeoFilter.js +1 -0
  6. package/dist/_chunks/GeoFilter.js.map +1 -1
  7. package/dist/_chunks/Notifications.js +16 -16
  8. package/dist/_chunks/QueryClientProvider.js +1 -1
  9. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  10. package/dist/_chunks/QueryClientService.js +73 -72
  11. package/dist/_chunks/QueryClientService.js.map +1 -1
  12. package/dist/_chunks/Table.js +1314 -887
  13. package/dist/_chunks/Table.js.map +1 -1
  14. package/dist/_chunks/TableUtil.js +5126 -178
  15. package/dist/_chunks/TableUtil.js.map +1 -1
  16. package/dist/_chunks/TextFilter.js +10 -6
  17. package/dist/_chunks/TextFilter.js.map +1 -1
  18. package/dist/_chunks/UserInvitationsAdminPage.js +131 -131
  19. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  20. package/dist/_chunks/_baseFlatten.js +12 -12
  21. package/dist/_chunks/_baseFlatten.js.map +1 -1
  22. package/dist/_chunks/_baseIteratee.js +78 -78
  23. package/dist/_chunks/_baseIteratee.js.map +1 -1
  24. package/dist/_chunks/decorate.js +1 -1
  25. package/dist/_chunks/decorateParam.js +1 -1
  26. package/dist/_chunks/middleware.js +66 -70
  27. package/dist/_chunks/middleware.js.map +1 -1
  28. package/dist/_chunks/omit.js +98 -98
  29. package/dist/_chunks/omit.js.map +1 -1
  30. package/dist/_chunks/query.js +123 -107
  31. package/dist/_chunks/query.js.map +1 -1
  32. package/dist/_chunks/react.js +1 -1
  33. package/dist/_chunks/react.js.map +1 -1
  34. package/dist/_chunks/tableStore.js +298 -275
  35. package/dist/_chunks/tableStore.js.map +1 -1
  36. package/dist/_chunks/useMutation.js +2 -2
  37. package/dist/_chunks/useMutation.js.map +1 -1
  38. package/dist/_chunks/useQueryMemo.js +15 -16
  39. package/dist/_chunks/useQueryMemo.js.map +1 -1
  40. package/dist/_chunks/vanilla.js +1 -1
  41. package/dist/_chunks/vanilla.js.map +1 -1
  42. package/dist/_chunks/yup.js +2 -2
  43. package/dist/_chunks/yup.js.map +1 -1
  44. package/dist/classes/abstracts/FilterAbstract/FilterAbstract.d.ts +11 -0
  45. package/dist/classes/abstracts/FilterAbstract/index.js +48 -3
  46. package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
  47. package/dist/classes/filters/BooleanFilter.d.ts +1 -0
  48. package/dist/classes/filters/DateFilter.d.ts +1 -1
  49. package/dist/classes/filters/GeoFilter.d.ts +1 -0
  50. package/dist/classes/filters/MultiSelectFilter.d.ts +1 -0
  51. package/dist/classes/filters/NumberRangeFilter.d.ts +1 -0
  52. package/dist/classes/filters/TextFilter.d.ts +1 -0
  53. package/dist/classes/services/AuthenticationService/index.js +8 -8
  54. package/dist/classes/services/AuthenticationService/index.js.map +1 -1
  55. package/dist/classes/services/AuthorizationService/index.js +4 -4
  56. package/dist/classes/services/AuthorizationService/index.js.map +1 -1
  57. package/dist/classes/services/BreadcrumbService/index.js +4 -4
  58. package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
  59. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  60. package/dist/classes/services/InactivityService/index.js +30 -30
  61. package/dist/classes/services/InactivityService/index.js.map +1 -1
  62. package/dist/classes/services/LogService/index.js +15 -15
  63. package/dist/classes/services/LogService/index.js.map +1 -1
  64. package/dist/classes/services/PageEventBusService/index.js.map +1 -1
  65. package/dist/components/app/App/index.js +27 -24
  66. package/dist/components/app/App/index.js.map +1 -1
  67. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +18 -18
  68. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  69. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +18 -18
  70. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
  71. package/dist/components/app/AuthenticationWrapper/index.js +15 -15
  72. package/dist/components/app/AuthorizationWrapper/index.js +16 -16
  73. package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
  74. package/dist/components/app/RouterRoot/index.js +33 -33
  75. package/dist/components/app/RouterRoot/index.js.map +1 -1
  76. package/dist/components/epi/EpiContactDetailsDialog/index.js +4 -4
  77. package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
  78. package/dist/components/ui/ApplicationBar/index.js +234 -234
  79. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  80. package/dist/components/ui/GenericErrorMessage/index.js +13 -13
  81. package/dist/components/ui/LicensesDialog/index.js +6 -6
  82. package/dist/components/ui/OrganizationSwitcherDialog/index.js +11 -11
  83. package/dist/components/ui/OutagesDialog/index.js +4 -4
  84. package/dist/components/ui/OutagesDialog/index.js.map +1 -1
  85. package/dist/components/ui/PageContainer/index.js +5 -5
  86. package/dist/components/ui/PageContainer/index.js.map +1 -1
  87. package/dist/components/ui/ResponseHandler/index.js +4 -4
  88. package/dist/components/ui/SortableList/SortableList.d.ts +5 -3
  89. package/dist/components/ui/Table/Table.d.ts +5 -2
  90. package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +13 -2
  91. package/dist/components/ui/Table/TableDownloadSidebarItem.d.ts +10 -0
  92. package/dist/components/ui/Table/TableSidebarMenu.d.ts +2 -1
  93. package/dist/components/ui/Table/index.d.ts +2 -0
  94. package/dist/components/ui/Table/index.js +1 -1
  95. package/dist/components/ui/Table/useTableColumnsMenu.d.ts +6 -0
  96. package/dist/components/ui/UserFeedbackDialog/index.js +15 -15
  97. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
  98. package/dist/dataHooks/useIdentifierIssuerQuery/index.js +11 -11
  99. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +5 -5
  100. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
  101. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +15 -15
  102. package/dist/dataHooks/useOrganizationsQuery/index.js +7 -7
  103. package/dist/dataHooks/useUsersQuery/index.js +10 -10
  104. package/dist/hooks/useCreateMutation/index.js +14 -14
  105. package/dist/hooks/useCreateMutation/index.js.map +1 -1
  106. package/dist/hooks/useDeleteMutation/index.js +17 -17
  107. package/dist/hooks/useDeleteMutation/index.js.map +1 -1
  108. package/dist/hooks/useEditMutation/index.js +22 -22
  109. package/dist/hooks/useEditMutation/index.js.map +1 -1
  110. package/dist/hooks/useInitializeTableStore/index.js +6 -6
  111. package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
  112. package/dist/locale/en.json +27 -5
  113. package/dist/locale/nl.json +27 -5
  114. package/dist/models/table.models.d.ts +1 -0
  115. package/dist/models/table.models.js.map +1 -1
  116. package/dist/pages/AcceptInvitationPage/index.js +10 -10
  117. package/dist/pages/AdminPage/index.js +19 -19
  118. package/dist/pages/ChooseIdentityProviderPage/index.js +5 -5
  119. package/dist/pages/ErrorPage/index.js +4 -4
  120. package/dist/pages/IdentifierIssuersAdminPage/index.js +7 -7
  121. package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
  122. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +16 -16
  123. package/dist/pages/OrganizationContactsAdminPage/index.js +10 -10
  124. package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
  125. package/dist/pages/OrganizationSitesAdminPage/index.js +12 -12
  126. package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
  127. package/dist/pages/OrganizationsAdminPage/index.js +20 -20
  128. package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
  129. package/dist/pages/OutagesAdminPage/index.js +11 -11
  130. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  131. package/dist/pages/RouterErrorPage/index.js +4 -4
  132. package/dist/pages/UsersAdminPage/index.js +34 -34
  133. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  134. package/dist/setup/setup.js +4 -4
  135. package/dist/setup/setup.js.map +1 -1
  136. package/dist/stores/oidcStore/oidcStore.d.ts +1 -1
  137. package/dist/stores/tableStore/tableStore.d.ts +3 -1
  138. package/dist/utils/StandardConfigUtil/index.js +2 -2
  139. package/dist/utils/StandardConfigUtil/index.js.map +1 -1
  140. package/dist/utils/TableUtil/TableUtil.d.ts +5 -0
  141. package/package.json +35 -37
  142. package/dist/_chunks/useColumnsMenu.js +0 -157
  143. package/dist/_chunks/useColumnsMenu.js.map +0 -1
  144. package/dist/hooks/useColumnsMenu/index.d.ts +0 -1
  145. package/dist/hooks/useColumnsMenu/index.js +0 -1
  146. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +0 -6
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
1
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
2
2
  var e = {
3
3
  setTimeout: (e, t) => setTimeout(e, t),
4
4
  clearTimeout: (e) => clearTimeout(e),
@@ -29,7 +29,7 @@ var e = {
29
29
  function n(e) {
30
30
  setTimeout(e, 0);
31
31
  }
32
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/utils.js
32
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/utils.js
33
33
  var r = typeof window > "u" || "Deno" in globalThis;
34
34
  function i() {}
35
35
  function a(e, t) {
@@ -112,7 +112,7 @@ function h(e, t, n = 0) {
112
112
  }
113
113
  function g(e, t) {
114
114
  if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
115
- for (let n in e) if (e[n] !== t[n]) return !1;
115
+ for (let n of Object.keys(e)) if (!m.call(t, n) || e[n] !== t[n]) return !1;
116
116
  return !0;
117
117
  }
118
118
  function _(e) {
@@ -148,11 +148,11 @@ function x(e, t, n) {
148
148
  }
149
149
  function S(e, t, n = 0) {
150
150
  let r = [...e, t];
151
- return n && r.length > n ? r.slice(1) : r;
151
+ return n && r.length > n ? r.slice(-n) : r;
152
152
  }
153
153
  function C(e, t, n = 0) {
154
154
  let r = [t, ...e];
155
- return n && r.length > n ? r.slice(0, -1) : r;
155
+ return n && r.length > n ? r.slice(0, n) : r;
156
156
  }
157
157
  var w = Symbol();
158
158
  function T(e, t) {
@@ -161,15 +161,19 @@ function T(e, t) {
161
161
  function E(e, t) {
162
162
  return typeof e == "function" ? e(...t) : !!e;
163
163
  }
164
- function D(e, t, n) {
165
- let r = !1, i;
166
- return Object.defineProperty(e, "signal", {
167
- enumerable: !0,
168
- get: () => (i ??= t(), r || (r = !0, i.aborted ? n() : i.addEventListener("abort", n, { once: !0 })), i)
164
+ var D = Symbol();
165
+ function O(e, t, n, r) {
166
+ let i = !1, a;
167
+ return Object.defineProperties(e, {
168
+ [D]: { value: r },
169
+ signal: {
170
+ enumerable: !0,
171
+ get: () => (a ??= t(), i || (i = !0, a.aborted ? n() : a.addEventListener("abort", n, { once: !0 })), a)
172
+ }
169
173
  }), e;
170
174
  }
171
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/environmentManager.js
172
- var O = () => r, k = () => O(), A = class {
175
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/environmentManager.js
176
+ var k = () => r, A = () => k(), j = class {
173
177
  constructor() {
174
178
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
175
179
  }
@@ -183,7 +187,7 @@ var O = () => r, k = () => O(), A = class {
183
187
  }
184
188
  onSubscribe() {}
185
189
  onUnsubscribe() {}
186
- }, j = new class extends A {
190
+ }, M = new class extends j {
187
191
  #e;
188
192
  #t;
189
193
  #n;
@@ -220,13 +224,13 @@ var O = () => r, k = () => O(), A = class {
220
224
  isFocused() {
221
225
  return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
222
226
  }
223
- }(), M = n;
224
- function N() {
227
+ }(), N = n;
228
+ function P() {
225
229
  let e = [], t = 0, n = (e) => {
226
230
  e();
227
231
  }, r = (e) => {
228
232
  e();
229
- }, i = M, a = (r) => {
233
+ }, i = N, a = (r) => {
230
234
  t ? e.push(r) : i(() => {
231
235
  n(r);
232
236
  });
@@ -268,7 +272,7 @@ function N() {
268
272
  }
269
273
  };
270
274
  }
271
- var P = N(), F = new class extends A {
275
+ var F = P(), I = new class extends j {
272
276
  #e = !0;
273
277
  #t;
274
278
  #n;
@@ -300,33 +304,33 @@ var P = N(), F = new class extends A {
300
304
  return this.#e;
301
305
  }
302
306
  }();
303
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/retryer.js
304
- function I(e) {
307
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/retryer.js
308
+ function L(e) {
305
309
  return Math.min(1e3 * 2 ** e, 3e4);
306
310
  }
307
- function L(e) {
308
- return (e ?? "online") !== "online" || F.isOnline();
311
+ function R(e) {
312
+ return (e ?? "online") !== "online" || I.isOnline();
309
313
  }
310
- var R = class extends Error {
314
+ var z = class extends Error {
311
315
  constructor(e) {
312
316
  super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
313
317
  }
314
318
  };
315
- function z(e) {
319
+ function B(e) {
316
320
  let t = !1, n = 0, r, a = "pending", o, s, c = new Promise((e, t) => {
317
321
  o = e, s = t;
318
322
  });
319
323
  c.catch(i);
320
324
  let l = () => a !== "pending", u = (t) => {
321
325
  if (!l()) {
322
- let n = new R(t);
326
+ let n = new z(t);
323
327
  g(n), e.onCancel?.(n);
324
328
  }
325
329
  }, d = () => {
326
330
  t = !0;
327
331
  }, f = () => {
328
332
  t = !1;
329
- }, p = () => j.isFocused() && (e.networkMode === "always" || F.isOnline()) && e.canRun(), m = () => L(e.networkMode) && e.canRun(), h = (e) => {
333
+ }, p = () => M.isFocused() && (e.networkMode === "always" || I.isOnline()) && e.canRun(), m = () => R(e.networkMode) && e.canRun(), h = (e) => {
330
334
  l() || (r?.(), a = "resolved", o(e));
331
335
  }, g = (e) => {
332
336
  l() || (r?.(), a = "rejected", s(e));
@@ -346,8 +350,8 @@ function z(e) {
346
350
  }
347
351
  Promise.resolve(r).then(h).catch((r) => {
348
352
  if (l()) return;
349
- let i = e.retry ?? (k() ? 0 : 3), a = e.retryDelay ?? I, o = typeof a == "function" ? a(n, r) : a, s = i === !0 || typeof i == "number" && n < i || typeof i == "function" && i(n, r);
350
- t || !s ? g(r) : (n++, e.onFail?.(n, r), b(o).then(() => p() ? void 0 : _(p)).then(() => {
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(() => {
351
355
  t ? g(r) : v();
352
356
  }));
353
357
  });
@@ -363,34 +367,16 @@ function z(e) {
363
367
  start: () => (m() ? v() : _(m).then(v), c)
364
368
  };
365
369
  }
366
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/removable.js
367
- var B = class {
368
- #e;
369
- destroy() {
370
- this.clearGcTimeout();
371
- }
372
- scheduleGc() {
373
- this.clearGcTimeout(), o(this.gcTime) && (this.#e = t.setTimeout(() => {
374
- this.optionalRemove();
375
- }, this.gcTime));
376
- }
377
- updateGcTime(e) {
378
- this.gcTime = Math.max(this.gcTime || 0, e ?? (k() ? Infinity : 3e5));
379
- }
380
- clearGcTimeout() {
381
- this.#e !== void 0 && (t.clearTimeout(this.#e), this.#e = void 0);
382
- }
383
- };
384
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
370
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
385
371
  function V(e) {
386
372
  return { onFetch: (t, n) => {
387
373
  let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
388
374
  pages: [],
389
375
  pageParams: []
390
376
  }, c = 0, l = async () => {
391
- let n = !1, l = (e) => {
392
- D(e, () => t.signal, () => n = !0);
393
- }, u = T(t.options, t.fetchOptions), d = async (e, r, i) => {
377
+ let n = !1, l = t, u = (e) => {
378
+ O(e, () => t.signal, () => n = !0, l[D]);
379
+ }, d = T(t.options, t.fetchOptions), f = async (e, r, i) => {
394
380
  if (n) return Promise.reject(t.signal.reason);
395
381
  if (r == null && e.pages.length) return Promise.resolve(e);
396
382
  let a = (() => {
@@ -401,8 +387,8 @@ function V(e) {
401
387
  direction: i ? "backward" : "forward",
402
388
  meta: t.options.meta
403
389
  };
404
- return l(e), e;
405
- })(), o = await u(a), { maxPages: s } = t.options, c = i ? C : S;
390
+ return u(e), e;
391
+ })(), o = await d(a), { maxPages: s } = t.options, c = i ? C : S;
406
392
  return {
407
393
  pages: c(e.pages, o, s),
408
394
  pageParams: c(e.pageParams, r, s)
@@ -413,13 +399,13 @@ function V(e) {
413
399
  pages: a,
414
400
  pageParams: o
415
401
  };
416
- s = await d(n, t(r, n), e);
402
+ s = await f(n, t(r, n), e);
417
403
  } else {
418
404
  let t = e ?? a.length;
419
405
  do {
420
406
  let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : H(r, s);
421
407
  if (c > 0 && e == null) break;
422
- s = await d(s, e), c++;
408
+ s = await f(s, e), c++;
423
409
  } while (c < t);
424
410
  }
425
411
  return s;
@@ -439,8 +425,24 @@ function H(e, { pages: t, pageParams: n }) {
439
425
  function U(e, { pages: t, pageParams: n }) {
440
426
  return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
441
427
  }
442
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/query.js
443
- var W = class extends B {
428
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/removable.js
429
+ var W = class {
430
+ #e;
431
+ destroy() {
432
+ this.clearGcTimeout();
433
+ }
434
+ scheduleGc() {
435
+ this.clearGcTimeout(), o(this.gcTime) && (this.#e = t.setTimeout(() => {
436
+ this.optionalRemove();
437
+ }, this.gcTime));
438
+ }
439
+ updateGcTime(e) {
440
+ this.gcTime = Math.max(this.gcTime || 0, e ?? (A() ? Infinity : 3e5));
441
+ }
442
+ clearGcTimeout() {
443
+ this.#e !== void 0 && (t.clearTimeout(this.#e), this.#e = void 0);
444
+ }
445
+ }, G = class extends W {
444
446
  #e;
445
447
  #t;
446
448
  #n;
@@ -449,8 +451,9 @@ var W = class extends B {
449
451
  #a;
450
452
  #o;
451
453
  #s;
454
+ #c;
452
455
  constructor(e) {
453
- super(), this.#s = !1, this.#o = 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();
456
+ 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();
454
457
  }
455
458
  get meta() {
456
459
  return this.options.meta;
@@ -463,11 +466,11 @@ var W = class extends B {
463
466
  }
464
467
  setOptions(e) {
465
468
  if (this.options = {
466
- ...this.#o,
469
+ ...this.#s,
467
470
  ...e
468
471
  }, e?._type && (this.#e = e._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
469
- let e = q(this.options);
470
- e.data !== void 0 && (this.setState(K(e.data, e.dataUpdatedAt)), this.#t = e);
472
+ let e = J(this.options);
473
+ e.data !== void 0 && (this.setState(q(e.data, e.dataUpdatedAt)), this.#t = e);
471
474
  }
472
475
  }
473
476
  optionalRemove() {
@@ -475,7 +478,7 @@ var W = class extends B {
475
478
  }
476
479
  setData(e, t) {
477
480
  let n = x(this.state.data, e, this.options);
478
- return this.#c({
481
+ return this.#l({
479
482
  data: n,
480
483
  type: "success",
481
484
  dataUpdatedAt: t?.updatedAt,
@@ -483,7 +486,7 @@ var W = class extends B {
483
486
  }), n;
484
487
  }
485
488
  setState(e) {
486
- this.#c({
489
+ this.#l({
487
490
  type: "setState",
488
491
  state: e
489
492
  });
@@ -511,7 +514,7 @@ var W = class extends B {
511
514
  return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
512
515
  }
513
516
  isStatic() {
514
- return this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
517
+ return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
515
518
  }
516
519
  isStale() {
517
520
  return this.getObserversCount() > 0 ? this.observers.some((e) => e.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
@@ -534,7 +537,7 @@ var W = class extends B {
534
537
  }
535
538
  removeObserver(e) {
536
539
  let t = this.observers.indexOf(e);
537
- t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#s || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.scheduleGc()), this.#r.notify({
540
+ 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({
538
541
  type: "observerRemoved",
539
542
  query: this,
540
543
  observer: e
@@ -544,12 +547,12 @@ var W = class extends B {
544
547
  return this.observers.length;
545
548
  }
546
549
  invalidate() {
547
- this.state.isInvalidated || this.#c({ type: "invalidate" });
550
+ this.state.isInvalidated || this.#l({ type: "invalidate" });
548
551
  }
549
552
  async fetch(e, t) {
550
553
  if (this.state.fetchStatus !== "idle" && this.#a?.status() !== "rejected") {
551
554
  if (this.state.data !== void 0 && t?.cancelRefetch) this.cancel({ silent: !0 });
552
- else if (this.#a) return this.#a.continueRetry(), this.#a.promise;
555
+ else if (this.#a && this.#o) return this.#a.continueRetry(), this.#o;
553
556
  }
554
557
  if (e && this.setOptions(e), !this.options.queryFn) {
555
558
  let e = this.observers.find((e) => e.options.queryFn);
@@ -557,9 +560,15 @@ var W = class extends B {
557
560
  }
558
561
  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']"));
559
562
  let n = new AbortController(), r = (e) => {
560
- Object.defineProperty(e, "signal", {
561
- enumerable: !0,
562
- get: () => (this.#s = !0, n.signal)
563
+ Object.defineProperties(e, {
564
+ [D]: {
565
+ value: n.signal,
566
+ enumerable: !0
567
+ },
568
+ signal: {
569
+ enumerable: !0,
570
+ get: () => (this.#c = !0, n.signal)
571
+ }
563
572
  });
564
573
  }, i = () => {
565
574
  let e = T(this.options, t), n = (() => {
@@ -570,7 +579,7 @@ var W = class extends B {
570
579
  };
571
580
  return r(e), e;
572
581
  })();
573
- return this.#s = !1, this.options.persister ? this.options.persister(e, n, this) : e(n);
582
+ return this.#c = !1, this.options.persister ? this.options.persister(e, n, this) : e(n);
574
583
  }, a = (() => {
575
584
  let e = {
576
585
  fetchOptions: t,
@@ -582,58 +591,63 @@ var W = class extends B {
582
591
  };
583
592
  return r(e), e;
584
593
  })();
585
- (this.#e === "infinite" ? V(this.options.pages) : this.options.behavior)?.onFetch(a, this), this.#n = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#c({
594
+ (this.#e === "infinite" ? V(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({
586
595
  type: "fetch",
587
596
  meta: a.fetchOptions?.meta
588
597
  });
589
- let o = this.#a = z({
598
+ let o = this.#a = B({
590
599
  initialPromise: t?.initialPromise,
591
600
  fn: a.fetchFn,
592
601
  onCancel: (e) => {
593
- e instanceof R && e.revert && this.setState({
602
+ e instanceof z && e.revert && this.setState({
594
603
  ...this.#n,
595
604
  fetchStatus: "idle"
596
605
  }), n.abort();
597
606
  },
598
607
  onFail: (e, t) => {
599
- this.#c({
608
+ this.#l({
600
609
  type: "failed",
601
610
  failureCount: e,
602
611
  error: t
603
612
  });
604
613
  },
605
614
  onPause: () => {
606
- this.#c({ type: "pause" });
615
+ this.#l({ type: "pause" });
607
616
  },
608
617
  onContinue: () => {
609
- this.#c({ type: "continue" });
618
+ this.#l({ type: "continue" });
610
619
  },
611
620
  retry: a.options.retry,
612
621
  retryDelay: a.options.retryDelay,
613
622
  networkMode: a.options.networkMode,
614
623
  canRun: () => !0
615
- });
616
- try {
617
- let e = await o.start();
618
- 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`);
619
- return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
620
- } catch (e) {
621
- if (e instanceof R) {
622
- if (e.silent) return this.#a.promise;
623
- if (e.revert) {
624
- if (this.state.data === void 0) throw e;
625
- return this.state.data;
624
+ }), s = (async () => {
625
+ try {
626
+ let e = await o.promise;
627
+ 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`);
628
+ return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
629
+ } catch (e) {
630
+ if (e instanceof z) {
631
+ if (e.silent) {
632
+ if (this.#a !== o && this.#o) return this.#o;
633
+ throw e;
634
+ }
635
+ if (e.revert) {
636
+ if (this.state.data === void 0) throw e;
637
+ return this.state.data;
638
+ }
626
639
  }
640
+ throw this.#l({
641
+ type: "error",
642
+ error: e
643
+ }), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
644
+ } finally {
645
+ this.#a === o && (this.#a = void 0, this.#o = void 0), this.scheduleGc();
627
646
  }
628
- throw this.#c({
629
- type: "error",
630
- error: e
631
- }), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
632
- } finally {
633
- this.#a === o && (this.#a = void 0), this.scheduleGc();
634
- }
647
+ })();
648
+ return this.#o = s, o.start(), s;
635
649
  }
636
- #c(e) {
650
+ #l(e) {
637
651
  let t = (t) => {
638
652
  switch (e.type) {
639
653
  case "failed": return {
@@ -651,13 +665,13 @@ var W = class extends B {
651
665
  };
652
666
  case "fetch": return {
653
667
  ...t,
654
- ...G(t.data, this.options),
668
+ ...K(t.data, this.options),
655
669
  fetchMeta: e.meta ?? null
656
670
  };
657
- case "success":
671
+ case "success": {
658
672
  let n = {
659
673
  ...t,
660
- ...K(e.data, e.dataUpdatedAt),
674
+ ...q(e.data, e.dataUpdatedAt),
661
675
  dataUpdateCount: t.dataUpdateCount + 1,
662
676
  ...!e.manual && {
663
677
  fetchStatus: "idle",
@@ -666,19 +680,21 @@ var W = class extends B {
666
680
  }
667
681
  };
668
682
  return this.#n = e.manual ? n : void 0, n;
669
- case "error":
670
- let r = e.error;
683
+ }
684
+ case "error": {
685
+ let n = e.error;
671
686
  return {
672
687
  ...t,
673
- error: r,
688
+ error: n,
674
689
  errorUpdateCount: t.errorUpdateCount + 1,
675
690
  errorUpdatedAt: Date.now(),
676
691
  fetchFailureCount: t.fetchFailureCount + 1,
677
- fetchFailureReason: r,
692
+ fetchFailureReason: n,
678
693
  fetchStatus: "idle",
679
694
  status: "error",
680
695
  isInvalidated: !0
681
696
  };
697
+ }
682
698
  case "invalidate": return {
683
699
  ...t,
684
700
  isInvalidated: !0
@@ -689,7 +705,7 @@ var W = class extends B {
689
705
  };
690
706
  }
691
707
  };
692
- this.state = t(this.state), P.batch(() => {
708
+ this.state = t(this.state), F.batch(() => {
693
709
  this.observers.slice().forEach((e) => {
694
710
  e.onQueryUpdate();
695
711
  }), this.#r.notify({
@@ -700,18 +716,18 @@ var W = class extends B {
700
716
  });
701
717
  }
702
718
  };
703
- function G(e, t) {
719
+ function K(e, t) {
704
720
  return {
705
721
  fetchFailureCount: 0,
706
722
  fetchFailureReason: null,
707
- fetchStatus: L(t.networkMode) ? "fetching" : "paused",
723
+ fetchStatus: R(t.networkMode) ? "fetching" : "paused",
708
724
  ...e === void 0 && {
709
725
  error: null,
710
726
  status: "pending"
711
727
  }
712
728
  };
713
729
  }
714
- function K(e, t) {
730
+ function q(e, t) {
715
731
  return {
716
732
  data: e,
717
733
  dataUpdatedAt: t ?? Date.now(),
@@ -720,7 +736,7 @@ function K(e, t) {
720
736
  status: "success"
721
737
  };
722
738
  }
723
- function q(e) {
739
+ function J(e) {
724
740
  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;
725
741
  return {
726
742
  data: t,
@@ -737,6 +753,6 @@ function q(e) {
737
753
  fetchStatus: "idle"
738
754
  };
739
755
  }
740
- export { s as C, w as S, p as _, F as a, g as b, A as c, f as d, d as f, i as g, l as h, z as i, k as l, u as m, G as n, P as o, o as p, B as r, j as s, W as t, a as u, x as v, t as w, E as x, c as y };
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, W as r, M as s, G as t, a as u, x as v, t as w, E as x, c as y };
741
757
 
742
758
  //# sourceMappingURL=query.js.map