@tanstack/react-query-devtools 4.2.1 → 4.3.0-beta.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 (99) hide show
  1. package/build/{types/react-query-devtools/src → lib}/Explorer.d.ts +0 -0
  2. package/build/{types/react-query-devtools/src → lib}/Logo.d.ts +0 -0
  3. package/build/{types/react-query-devtools/src → lib}/devtools.d.ts +0 -0
  4. package/build/{types/react-query-devtools/src → lib}/index.d.ts +0 -0
  5. package/build/lib/index.js +2286 -0
  6. package/build/lib/index.js.map +1 -0
  7. package/build/{esm/index.js → lib/index.mjs} +282 -3
  8. package/build/lib/index.mjs.map +1 -0
  9. package/build/{types/react-query-devtools/src → lib}/noop.d.ts +0 -0
  10. package/build/{cjs → lib}/noop.js +0 -0
  11. package/build/{cjs → lib}/noop.js.map +0 -0
  12. package/build/{esm/noop.js → lib/noop.mjs} +1 -1
  13. package/build/lib/noop.mjs.map +1 -0
  14. package/build/{types/react-query-devtools/src → lib}/styledComponents.d.ts +0 -0
  15. package/build/{types/react-query-devtools/src → lib}/theme.d.ts +0 -0
  16. package/build/{types/react-query-devtools/src → lib}/useLocalStorage.d.ts +0 -0
  17. package/build/{types/react-query-devtools/src → lib}/useMediaQuery.d.ts +0 -0
  18. package/build/lib/useSyncExternalStore.d.ts +1 -0
  19. package/build/lib/useSyncExternalStore.native.d.ts +1 -0
  20. package/build/{types/react-query-devtools/src → lib}/utils.d.ts +0 -0
  21. package/build/umd/index.development.js +2240 -9
  22. package/build/umd/index.development.js.map +1 -1
  23. package/build/umd/index.production.js +2 -2
  24. package/build/umd/index.production.js.map +1 -1
  25. package/build/umd/noop.development.js +30 -0
  26. package/build/umd/noop.development.js.map +1 -0
  27. package/build/umd/noop.production.js +12 -0
  28. package/build/umd/noop.production.js.map +1 -0
  29. package/cjs.fallback.js +13 -0
  30. package/package.json +31 -20
  31. package/src/devtools.tsx +1 -1
  32. package/src/useSyncExternalStore.native.ts +3 -0
  33. package/src/useSyncExternalStore.ts +2 -0
  34. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -33
  35. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  36. package/build/cjs/node_modules/@tanstack/match-sorter-utils/build/esm/index.js +0 -757
  37. package/build/cjs/node_modules/@tanstack/match-sorter-utils/build/esm/index.js.map +0 -1
  38. package/build/cjs/packages/react-query-devtools/src/Explorer.js +0 -215
  39. package/build/cjs/packages/react-query-devtools/src/Explorer.js.map +0 -1
  40. package/build/cjs/packages/react-query-devtools/src/Logo.js +0 -66
  41. package/build/cjs/packages/react-query-devtools/src/Logo.js.map +0 -1
  42. package/build/cjs/packages/react-query-devtools/src/devtools.js +0 -805
  43. package/build/cjs/packages/react-query-devtools/src/devtools.js.map +0 -1
  44. package/build/cjs/packages/react-query-devtools/src/index.js +0 -26
  45. package/build/cjs/packages/react-query-devtools/src/index.js.map +0 -1
  46. package/build/cjs/packages/react-query-devtools/src/styledComponents.js +0 -113
  47. package/build/cjs/packages/react-query-devtools/src/styledComponents.js.map +0 -1
  48. package/build/cjs/packages/react-query-devtools/src/theme.js +0 -68
  49. package/build/cjs/packages/react-query-devtools/src/theme.js.map +0 -1
  50. package/build/cjs/packages/react-query-devtools/src/useLocalStorage.js +0 -81
  51. package/build/cjs/packages/react-query-devtools/src/useLocalStorage.js.map +0 -1
  52. package/build/cjs/packages/react-query-devtools/src/useMediaQuery.js +0 -66
  53. package/build/cjs/packages/react-query-devtools/src/useMediaQuery.js.map +0 -1
  54. package/build/cjs/packages/react-query-devtools/src/utils.js +0 -113
  55. package/build/cjs/packages/react-query-devtools/src/utils.js.map +0 -1
  56. package/build/esm/index.js.map +0 -1
  57. package/build/esm/noop.js.map +0 -1
  58. package/build/stats-html.html +0 -2689
  59. package/build/stats.json +0 -45
  60. package/build/types/query-core/src/focusManager.d.ts +0 -16
  61. package/build/types/query-core/src/hydration.d.ts +0 -34
  62. package/build/types/query-core/src/index.d.ts +0 -20
  63. package/build/types/query-core/src/infiniteQueryBehavior.d.ts +0 -15
  64. package/build/types/query-core/src/infiniteQueryObserver.d.ts +0 -18
  65. package/build/types/query-core/src/logger.d.ts +0 -8
  66. package/build/types/query-core/src/mutation.d.ts +0 -70
  67. package/build/types/query-core/src/mutationCache.d.ts +0 -57
  68. package/build/types/query-core/src/mutationObserver.d.ts +0 -23
  69. package/build/types/query-core/src/notifyManager.d.ts +0 -18
  70. package/build/types/query-core/src/onlineManager.d.ts +0 -16
  71. package/build/types/query-core/src/queriesObserver.d.ts +0 -23
  72. package/build/types/query-core/src/query.d.ts +0 -119
  73. package/build/types/query-core/src/queryCache.d.ts +0 -64
  74. package/build/types/query-core/src/queryClient.d.ts +0 -65
  75. package/build/types/query-core/src/queryObserver.d.ts +0 -61
  76. package/build/types/query-core/src/removable.d.ts +0 -9
  77. package/build/types/query-core/src/retryer.d.ts +0 -33
  78. package/build/types/query-core/src/subscribable.d.ts +0 -10
  79. package/build/types/query-core/src/types.d.ts +0 -419
  80. package/build/types/query-core/src/utils.d.ts +0 -99
  81. package/build/types/react-query/src/Hydrate.d.ts +0 -10
  82. package/build/types/react-query/src/QueryClientProvider.d.ts +0 -24
  83. package/build/types/react-query/src/QueryErrorResetBoundary.d.ts +0 -12
  84. package/build/types/react-query/src/index.d.ts +0 -17
  85. package/build/types/react-query/src/isRestoring.d.ts +0 -3
  86. package/build/types/react-query/src/reactBatchedUpdates.d.ts +0 -2
  87. package/build/types/react-query/src/setBatchUpdatesFn.d.ts +0 -1
  88. package/build/types/react-query/src/types.d.ts +0 -34
  89. package/build/types/react-query/src/useBaseQuery.d.ts +0 -3
  90. package/build/types/react-query/src/useInfiniteQuery.d.ts +0 -5
  91. package/build/types/react-query/src/useIsFetching.d.ts +0 -7
  92. package/build/types/react-query/src/useIsMutating.d.ts +0 -7
  93. package/build/types/react-query/src/useMutation.d.ts +0 -6
  94. package/build/types/react-query/src/useQueries.d.ts +0 -49
  95. package/build/types/react-query/src/useQuery.d.ts +0 -23
  96. package/build/types/react-query/src/utils.d.ts +0 -1
  97. package/build/types/react-query-devtools/src/__tests__/Explorer.test.d.ts +0 -1
  98. package/build/types/react-query-devtools/src/__tests__/devtools.test.d.ts +0 -6
  99. package/build/types/react-query-devtools/src/__tests__/utils.d.ts +0 -22
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-query-devtools-noop
2
+ * react-query-devtools
3
3
  *
4
4
  * Copyright (c) TanStack
5
5
  *
@@ -9,18 +9,2249 @@
9
9
  * @license MIT
10
10
  */
11
11
  (function (global, factory) {
12
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
13
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
14
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactQueryDevtools = {}));
15
- })(this, (function (exports) { 'use strict';
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@tanstack/react-query')) :
13
+ typeof define === 'function' && define.amd ? define(['exports', 'react', '@tanstack/react-query'], factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactQueryDevtools = {}, global.React, global.ReactQuery));
15
+ })(this, (function (exports, React, reactQuery) { 'use strict';
16
16
 
17
- function ReactQueryDevtools() {
18
- return null;
17
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
+
19
+ function _interopNamespace(e) {
20
+ if (e && e.__esModule) return e;
21
+ var n = Object.create(null);
22
+ if (e) {
23
+ Object.keys(e).forEach(function (k) {
24
+ if (k !== 'default') {
25
+ var d = Object.getOwnPropertyDescriptor(e, k);
26
+ Object.defineProperty(n, k, d.get ? d : {
27
+ enumerable: true,
28
+ get: function () { return e[k]; }
29
+ });
30
+ }
31
+ });
32
+ }
33
+ n["default"] = e;
34
+ return Object.freeze(n);
35
+ }
36
+
37
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
38
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
39
+
40
+ function _extends() {
41
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
42
+ for (var i = 1; i < arguments.length; i++) {
43
+ var source = arguments[i];
44
+
45
+ for (var key in source) {
46
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
47
+ target[key] = source[key];
48
+ }
49
+ }
50
+ }
51
+
52
+ return target;
53
+ };
54
+ return _extends.apply(this, arguments);
55
+ }
56
+
57
+ var shim = {exports: {}};
58
+
59
+ var useSyncExternalStoreShim_development = {};
60
+
61
+ /**
62
+ * @license React
63
+ * use-sync-external-store-shim.development.js
64
+ *
65
+ * Copyright (c) Facebook, Inc. and its affiliates.
66
+ *
67
+ * This source code is licensed under the MIT license found in the
68
+ * LICENSE file in the root directory of this source tree.
69
+ */
70
+
71
+ var hasRequiredUseSyncExternalStoreShim_development;
72
+
73
+ function requireUseSyncExternalStoreShim_development () {
74
+ if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
75
+ hasRequiredUseSyncExternalStoreShim_development = 1;
76
+
77
+ {
78
+ (function() {
79
+
80
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
81
+ if (
82
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
83
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
84
+ 'function'
85
+ ) {
86
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
87
+ }
88
+ var React = React__default["default"];
89
+
90
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
91
+
92
+ function error(format) {
93
+ {
94
+ {
95
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
96
+ args[_key2 - 1] = arguments[_key2];
97
+ }
98
+
99
+ printWarning('error', format, args);
100
+ }
101
+ }
102
+ }
103
+
104
+ function printWarning(level, format, args) {
105
+ // When changing this logic, you might want to also
106
+ // update consoleWithStackDev.www.js as well.
107
+ {
108
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
109
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
110
+
111
+ if (stack !== '') {
112
+ format += '%s';
113
+ args = args.concat([stack]);
114
+ } // eslint-disable-next-line react-internal/safe-string-coercion
115
+
116
+
117
+ var argsWithFormat = args.map(function (item) {
118
+ return String(item);
119
+ }); // Careful: RN currently depends on this prefix
120
+
121
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
122
+ // breaks IE9: https://github.com/facebook/react/issues/13610
123
+ // eslint-disable-next-line react-internal/no-production-logging
124
+
125
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
126
+ }
127
+ }
128
+
129
+ /**
130
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
131
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
132
+ */
133
+ function is(x, y) {
134
+ return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
135
+ ;
136
+ }
137
+
138
+ var objectIs = typeof Object.is === 'function' ? Object.is : is;
139
+
140
+ // dispatch for CommonJS interop named imports.
141
+
142
+ var useState = React.useState,
143
+ useEffect = React.useEffect,
144
+ useLayoutEffect = React.useLayoutEffect,
145
+ useDebugValue = React.useDebugValue;
146
+ var didWarnOld18Alpha = false;
147
+ var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
148
+ // because of a very particular set of implementation details and assumptions
149
+ // -- change any one of them and it will break. The most important assumption
150
+ // is that updates are always synchronous, because concurrent rendering is
151
+ // only available in versions of React that also have a built-in
152
+ // useSyncExternalStore API. And we only use this shim when the built-in API
153
+ // does not exist.
154
+ //
155
+ // Do not assume that the clever hacks used by this hook also work in general.
156
+ // The point of this shim is to replace the need for hacks by other libraries.
157
+
158
+ function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
159
+ // React do not expose a way to check if we're hydrating. So users of the shim
160
+ // will need to track that themselves and return the correct value
161
+ // from `getSnapshot`.
162
+ getServerSnapshot) {
163
+ {
164
+ if (!didWarnOld18Alpha) {
165
+ if (React.startTransition !== undefined) {
166
+ didWarnOld18Alpha = true;
167
+
168
+ error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
169
+ }
170
+ }
171
+ } // Read the current snapshot from the store on every render. Again, this
172
+ // breaks the rules of React, and only works here because of specific
173
+ // implementation details, most importantly that updates are
174
+ // always synchronous.
175
+
176
+
177
+ var value = getSnapshot();
178
+
179
+ {
180
+ if (!didWarnUncachedGetSnapshot) {
181
+ var cachedValue = getSnapshot();
182
+
183
+ if (!objectIs(value, cachedValue)) {
184
+ error('The result of getSnapshot should be cached to avoid an infinite loop');
185
+
186
+ didWarnUncachedGetSnapshot = true;
187
+ }
188
+ }
189
+ } // Because updates are synchronous, we don't queue them. Instead we force a
190
+ // re-render whenever the subscribed state changes by updating an some
191
+ // arbitrary useState hook. Then, during render, we call getSnapshot to read
192
+ // the current value.
193
+ //
194
+ // Because we don't actually use the state returned by the useState hook, we
195
+ // can save a bit of memory by storing other stuff in that slot.
196
+ //
197
+ // To implement the early bailout, we need to track some things on a mutable
198
+ // object. Usually, we would put that in a useRef hook, but we can stash it in
199
+ // our useState hook instead.
200
+ //
201
+ // To force a re-render, we call forceUpdate({inst}). That works because the
202
+ // new object always fails an equality check.
203
+
204
+
205
+ var _useState = useState({
206
+ inst: {
207
+ value: value,
208
+ getSnapshot: getSnapshot
209
+ }
210
+ }),
211
+ inst = _useState[0].inst,
212
+ forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
213
+ // in the layout phase so we can access it during the tearing check that
214
+ // happens on subscribe.
215
+
216
+
217
+ useLayoutEffect(function () {
218
+ inst.value = value;
219
+ inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
220
+ // commit phase if there was an interleaved mutation. In concurrent mode
221
+ // this can happen all the time, but even in synchronous mode, an earlier
222
+ // effect may have mutated the store.
223
+
224
+ if (checkIfSnapshotChanged(inst)) {
225
+ // Force a re-render.
226
+ forceUpdate({
227
+ inst: inst
228
+ });
229
+ }
230
+ }, [subscribe, value, getSnapshot]);
231
+ useEffect(function () {
232
+ // Check for changes right before subscribing. Subsequent changes will be
233
+ // detected in the subscription handler.
234
+ if (checkIfSnapshotChanged(inst)) {
235
+ // Force a re-render.
236
+ forceUpdate({
237
+ inst: inst
238
+ });
239
+ }
240
+
241
+ var handleStoreChange = function () {
242
+ // TODO: Because there is no cross-renderer API for batching updates, it's
243
+ // up to the consumer of this library to wrap their subscription event
244
+ // with unstable_batchedUpdates. Should we try to detect when this isn't
245
+ // the case and print a warning in development?
246
+ // The store changed. Check if the snapshot changed since the last time we
247
+ // read from the store.
248
+ if (checkIfSnapshotChanged(inst)) {
249
+ // Force a re-render.
250
+ forceUpdate({
251
+ inst: inst
252
+ });
253
+ }
254
+ }; // Subscribe to the store and return a clean-up function.
255
+
256
+
257
+ return subscribe(handleStoreChange);
258
+ }, [subscribe]);
259
+ useDebugValue(value);
260
+ return value;
261
+ }
262
+
263
+ function checkIfSnapshotChanged(inst) {
264
+ var latestGetSnapshot = inst.getSnapshot;
265
+ var prevValue = inst.value;
266
+
267
+ try {
268
+ var nextValue = latestGetSnapshot();
269
+ return !objectIs(prevValue, nextValue);
270
+ } catch (error) {
271
+ return true;
272
+ }
273
+ }
274
+
275
+ function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
276
+ // Note: The shim does not use getServerSnapshot, because pre-18 versions of
277
+ // React do not expose a way to check if we're hydrating. So users of the shim
278
+ // will need to track that themselves and return the correct value
279
+ // from `getSnapshot`.
280
+ return getSnapshot();
281
+ }
282
+
283
+ var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
284
+
285
+ var isServerEnvironment = !canUseDOM;
286
+
287
+ var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
288
+ var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
289
+
290
+ useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
291
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
292
+ if (
293
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
294
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
295
+ 'function'
296
+ ) {
297
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
298
+ }
299
+
300
+ })();
301
+ }
302
+ return useSyncExternalStoreShim_development;
303
+ }
304
+
305
+ (function (module) {
306
+
307
+ {
308
+ module.exports = requireUseSyncExternalStoreShim_development();
309
+ }
310
+ } (shim));
311
+
312
+ /**
313
+ * match-sorter-utils
314
+ *
315
+ * Copyright (c) TanStack
316
+ *
317
+ * This source code is licensed under the MIT license found in the
318
+ * LICENSE.md file in the root directory of this source tree.
319
+ *
320
+ * @license MIT
321
+ */
322
+ const characterMap = {
323
+ À: 'A',
324
+ Á: 'A',
325
+ Â: 'A',
326
+ Ã: 'A',
327
+ Ä: 'A',
328
+ Å: 'A',
329
+ Ấ: 'A',
330
+ Ắ: 'A',
331
+ Ẳ: 'A',
332
+ Ẵ: 'A',
333
+ Ặ: 'A',
334
+ Æ: 'AE',
335
+ Ầ: 'A',
336
+ Ằ: 'A',
337
+ Ȃ: 'A',
338
+ Ç: 'C',
339
+ Ḉ: 'C',
340
+ È: 'E',
341
+ É: 'E',
342
+ Ê: 'E',
343
+ Ë: 'E',
344
+ Ế: 'E',
345
+ Ḗ: 'E',
346
+ Ề: 'E',
347
+ Ḕ: 'E',
348
+ Ḝ: 'E',
349
+ Ȇ: 'E',
350
+ Ì: 'I',
351
+ Í: 'I',
352
+ Î: 'I',
353
+ Ï: 'I',
354
+ Ḯ: 'I',
355
+ Ȋ: 'I',
356
+ Ð: 'D',
357
+ Ñ: 'N',
358
+ Ò: 'O',
359
+ Ó: 'O',
360
+ Ô: 'O',
361
+ Õ: 'O',
362
+ Ö: 'O',
363
+ Ø: 'O',
364
+ Ố: 'O',
365
+ Ṍ: 'O',
366
+ Ṓ: 'O',
367
+ Ȏ: 'O',
368
+ Ù: 'U',
369
+ Ú: 'U',
370
+ Û: 'U',
371
+ Ü: 'U',
372
+ Ý: 'Y',
373
+ à: 'a',
374
+ á: 'a',
375
+ â: 'a',
376
+ ã: 'a',
377
+ ä: 'a',
378
+ å: 'a',
379
+ ấ: 'a',
380
+ ắ: 'a',
381
+ ẳ: 'a',
382
+ ẵ: 'a',
383
+ ặ: 'a',
384
+ æ: 'ae',
385
+ ầ: 'a',
386
+ ằ: 'a',
387
+ ȃ: 'a',
388
+ ç: 'c',
389
+ ḉ: 'c',
390
+ è: 'e',
391
+ é: 'e',
392
+ ê: 'e',
393
+ ë: 'e',
394
+ ế: 'e',
395
+ ḗ: 'e',
396
+ ề: 'e',
397
+ ḕ: 'e',
398
+ ḝ: 'e',
399
+ ȇ: 'e',
400
+ ì: 'i',
401
+ í: 'i',
402
+ î: 'i',
403
+ ï: 'i',
404
+ ḯ: 'i',
405
+ ȋ: 'i',
406
+ ð: 'd',
407
+ ñ: 'n',
408
+ ò: 'o',
409
+ ó: 'o',
410
+ ô: 'o',
411
+ õ: 'o',
412
+ ö: 'o',
413
+ ø: 'o',
414
+ ố: 'o',
415
+ ṍ: 'o',
416
+ ṓ: 'o',
417
+ ȏ: 'o',
418
+ ù: 'u',
419
+ ú: 'u',
420
+ û: 'u',
421
+ ü: 'u',
422
+ ý: 'y',
423
+ ÿ: 'y',
424
+ Ā: 'A',
425
+ ā: 'a',
426
+ Ă: 'A',
427
+ ă: 'a',
428
+ Ą: 'A',
429
+ ą: 'a',
430
+ Ć: 'C',
431
+ ć: 'c',
432
+ Ĉ: 'C',
433
+ ĉ: 'c',
434
+ Ċ: 'C',
435
+ ċ: 'c',
436
+ Č: 'C',
437
+ č: 'c',
438
+ C̆: 'C',
439
+ c̆: 'c',
440
+ Ď: 'D',
441
+ ď: 'd',
442
+ Đ: 'D',
443
+ đ: 'd',
444
+ Ē: 'E',
445
+ ē: 'e',
446
+ Ĕ: 'E',
447
+ ĕ: 'e',
448
+ Ė: 'E',
449
+ ė: 'e',
450
+ Ę: 'E',
451
+ ę: 'e',
452
+ Ě: 'E',
453
+ ě: 'e',
454
+ Ĝ: 'G',
455
+ Ǵ: 'G',
456
+ ĝ: 'g',
457
+ ǵ: 'g',
458
+ Ğ: 'G',
459
+ ğ: 'g',
460
+ Ġ: 'G',
461
+ ġ: 'g',
462
+ Ģ: 'G',
463
+ ģ: 'g',
464
+ Ĥ: 'H',
465
+ ĥ: 'h',
466
+ Ħ: 'H',
467
+ ħ: 'h',
468
+ Ḫ: 'H',
469
+ ḫ: 'h',
470
+ Ĩ: 'I',
471
+ ĩ: 'i',
472
+ Ī: 'I',
473
+ ī: 'i',
474
+ Ĭ: 'I',
475
+ ĭ: 'i',
476
+ Į: 'I',
477
+ į: 'i',
478
+ İ: 'I',
479
+ ı: 'i',
480
+ IJ: 'IJ',
481
+ ij: 'ij',
482
+ Ĵ: 'J',
483
+ ĵ: 'j',
484
+ Ķ: 'K',
485
+ ķ: 'k',
486
+ Ḱ: 'K',
487
+ ḱ: 'k',
488
+ K̆: 'K',
489
+ k̆: 'k',
490
+ Ĺ: 'L',
491
+ ĺ: 'l',
492
+ Ļ: 'L',
493
+ ļ: 'l',
494
+ Ľ: 'L',
495
+ ľ: 'l',
496
+ Ŀ: 'L',
497
+ ŀ: 'l',
498
+ Ł: 'l',
499
+ ł: 'l',
500
+ Ḿ: 'M',
501
+ ḿ: 'm',
502
+ M̆: 'M',
503
+ m̆: 'm',
504
+ Ń: 'N',
505
+ ń: 'n',
506
+ Ņ: 'N',
507
+ ņ: 'n',
508
+ Ň: 'N',
509
+ ň: 'n',
510
+ ʼn: 'n',
511
+ N̆: 'N',
512
+ n̆: 'n',
513
+ Ō: 'O',
514
+ ō: 'o',
515
+ Ŏ: 'O',
516
+ ŏ: 'o',
517
+ Ő: 'O',
518
+ ő: 'o',
519
+ Œ: 'OE',
520
+ œ: 'oe',
521
+ P̆: 'P',
522
+ p̆: 'p',
523
+ Ŕ: 'R',
524
+ ŕ: 'r',
525
+ Ŗ: 'R',
526
+ ŗ: 'r',
527
+ Ř: 'R',
528
+ ř: 'r',
529
+ R̆: 'R',
530
+ r̆: 'r',
531
+ Ȓ: 'R',
532
+ ȓ: 'r',
533
+ Ś: 'S',
534
+ ś: 's',
535
+ Ŝ: 'S',
536
+ ŝ: 's',
537
+ Ş: 'S',
538
+ Ș: 'S',
539
+ ș: 's',
540
+ ş: 's',
541
+ Š: 'S',
542
+ š: 's',
543
+ Ţ: 'T',
544
+ ţ: 't',
545
+ ț: 't',
546
+ Ț: 'T',
547
+ Ť: 'T',
548
+ ť: 't',
549
+ Ŧ: 'T',
550
+ ŧ: 't',
551
+ T̆: 'T',
552
+ t̆: 't',
553
+ Ũ: 'U',
554
+ ũ: 'u',
555
+ Ū: 'U',
556
+ ū: 'u',
557
+ Ŭ: 'U',
558
+ ŭ: 'u',
559
+ Ů: 'U',
560
+ ů: 'u',
561
+ Ű: 'U',
562
+ ű: 'u',
563
+ Ų: 'U',
564
+ ų: 'u',
565
+ Ȗ: 'U',
566
+ ȗ: 'u',
567
+ V̆: 'V',
568
+ v̆: 'v',
569
+ Ŵ: 'W',
570
+ ŵ: 'w',
571
+ Ẃ: 'W',
572
+ ẃ: 'w',
573
+ X̆: 'X',
574
+ x̆: 'x',
575
+ Ŷ: 'Y',
576
+ ŷ: 'y',
577
+ Ÿ: 'Y',
578
+ Y̆: 'Y',
579
+ y̆: 'y',
580
+ Ź: 'Z',
581
+ ź: 'z',
582
+ Ż: 'Z',
583
+ ż: 'z',
584
+ Ž: 'Z',
585
+ ž: 'z',
586
+ ſ: 's',
587
+ ƒ: 'f',
588
+ Ơ: 'O',
589
+ ơ: 'o',
590
+ Ư: 'U',
591
+ ư: 'u',
592
+ Ǎ: 'A',
593
+ ǎ: 'a',
594
+ Ǐ: 'I',
595
+ ǐ: 'i',
596
+ Ǒ: 'O',
597
+ ǒ: 'o',
598
+ Ǔ: 'U',
599
+ ǔ: 'u',
600
+ Ǖ: 'U',
601
+ ǖ: 'u',
602
+ Ǘ: 'U',
603
+ ǘ: 'u',
604
+ Ǚ: 'U',
605
+ ǚ: 'u',
606
+ Ǜ: 'U',
607
+ ǜ: 'u',
608
+ Ứ: 'U',
609
+ ứ: 'u',
610
+ Ṹ: 'U',
611
+ ṹ: 'u',
612
+ Ǻ: 'A',
613
+ ǻ: 'a',
614
+ Ǽ: 'AE',
615
+ ǽ: 'ae',
616
+ Ǿ: 'O',
617
+ ǿ: 'o',
618
+ Þ: 'TH',
619
+ þ: 'th',
620
+ Ṕ: 'P',
621
+ ṕ: 'p',
622
+ Ṥ: 'S',
623
+ ṥ: 's',
624
+ X́: 'X',
625
+ x́: 'x',
626
+ Ѓ: 'Г',
627
+ ѓ: 'г',
628
+ Ќ: 'К',
629
+ ќ: 'к',
630
+ A̋: 'A',
631
+ a̋: 'a',
632
+ E̋: 'E',
633
+ e̋: 'e',
634
+ I̋: 'I',
635
+ i̋: 'i',
636
+ Ǹ: 'N',
637
+ ǹ: 'n',
638
+ Ồ: 'O',
639
+ ồ: 'o',
640
+ Ṑ: 'O',
641
+ ṑ: 'o',
642
+ Ừ: 'U',
643
+ ừ: 'u',
644
+ Ẁ: 'W',
645
+ ẁ: 'w',
646
+ Ỳ: 'Y',
647
+ ỳ: 'y',
648
+ Ȁ: 'A',
649
+ ȁ: 'a',
650
+ Ȅ: 'E',
651
+ ȅ: 'e',
652
+ Ȉ: 'I',
653
+ ȉ: 'i',
654
+ Ȍ: 'O',
655
+ ȍ: 'o',
656
+ Ȑ: 'R',
657
+ ȑ: 'r',
658
+ Ȕ: 'U',
659
+ ȕ: 'u',
660
+ B̌: 'B',
661
+ b̌: 'b',
662
+ Č̣: 'C',
663
+ č̣: 'c',
664
+ Ê̌: 'E',
665
+ ê̌: 'e',
666
+ F̌: 'F',
667
+ f̌: 'f',
668
+ Ǧ: 'G',
669
+ ǧ: 'g',
670
+ Ȟ: 'H',
671
+ ȟ: 'h',
672
+ J̌: 'J',
673
+ ǰ: 'j',
674
+ Ǩ: 'K',
675
+ ǩ: 'k',
676
+ M̌: 'M',
677
+ m̌: 'm',
678
+ P̌: 'P',
679
+ p̌: 'p',
680
+ Q̌: 'Q',
681
+ q̌: 'q',
682
+ Ř̩: 'R',
683
+ ř̩: 'r',
684
+ Ṧ: 'S',
685
+ ṧ: 's',
686
+ V̌: 'V',
687
+ v̌: 'v',
688
+ W̌: 'W',
689
+ w̌: 'w',
690
+ X̌: 'X',
691
+ x̌: 'x',
692
+ Y̌: 'Y',
693
+ y̌: 'y',
694
+ A̧: 'A',
695
+ a̧: 'a',
696
+ B̧: 'B',
697
+ b̧: 'b',
698
+ Ḑ: 'D',
699
+ ḑ: 'd',
700
+ Ȩ: 'E',
701
+ ȩ: 'e',
702
+ Ɛ̧: 'E',
703
+ ɛ̧: 'e',
704
+ Ḩ: 'H',
705
+ ḩ: 'h',
706
+ I̧: 'I',
707
+ i̧: 'i',
708
+ Ɨ̧: 'I',
709
+ ɨ̧: 'i',
710
+ M̧: 'M',
711
+ m̧: 'm',
712
+ O̧: 'O',
713
+ o̧: 'o',
714
+ Q̧: 'Q',
715
+ q̧: 'q',
716
+ U̧: 'U',
717
+ u̧: 'u',
718
+ X̧: 'X',
719
+ x̧: 'x',
720
+ Z̧: 'Z',
721
+ z̧: 'z'
722
+ };
723
+ const chars = Object.keys(characterMap).join('|');
724
+ const allAccents = new RegExp(chars, 'g');
725
+ function removeAccents(str) {
726
+ return str.replace(allAccents, match => {
727
+ return characterMap[match];
728
+ });
729
+ }
730
+
731
+ /**
732
+ * @name match-sorter
733
+ * @license MIT license.
734
+ * @copyright (c) 2099 Kent C. Dodds
735
+ * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
736
+ */
737
+ const rankings = {
738
+ CASE_SENSITIVE_EQUAL: 7,
739
+ EQUAL: 6,
740
+ STARTS_WITH: 5,
741
+ WORD_STARTS_WITH: 4,
742
+ CONTAINS: 3,
743
+ ACRONYM: 2,
744
+ MATCHES: 1,
745
+ NO_MATCH: 0
746
+ };
747
+
748
+ /**
749
+ * Gets the highest ranking for value for the given item based on its values for the given keys
750
+ * @param {*} item - the item to rank
751
+ * @param {Array} keys - the keys to get values from the item for the ranking
752
+ * @param {String} value - the value to rank against
753
+ * @param {Object} options - options to control the ranking
754
+ * @return {{rank: Number, accessorIndex: Number, accessorThreshold: Number}} - the highest ranking
755
+ */
756
+ function rankItem(item, value, options) {
757
+ var _options$threshold;
758
+
759
+ options = options || {};
760
+ options.threshold = (_options$threshold = options.threshold) != null ? _options$threshold : rankings.MATCHES;
761
+
762
+ if (!options.accessors) {
763
+ // if keys is not specified, then we assume the item given is ready to be matched
764
+ const rank = getMatchRanking(item, value, options);
765
+ return {
766
+ // ends up being duplicate of 'item' in matches but consistent
767
+ rankedValue: item,
768
+ rank,
769
+ accessorIndex: -1,
770
+ accessorThreshold: options.threshold,
771
+ passed: rank >= options.threshold
772
+ };
773
+ }
774
+
775
+ const valuesToRank = getAllValuesToRank(item, options.accessors);
776
+ const rankingInfo = {
777
+ rankedValue: item,
778
+ rank: rankings.NO_MATCH,
779
+ accessorIndex: -1,
780
+ accessorThreshold: options.threshold,
781
+ passed: false
782
+ };
783
+
784
+ for (let i = 0; i < valuesToRank.length; i++) {
785
+ const rankValue = valuesToRank[i];
786
+ let newRank = getMatchRanking(rankValue.itemValue, value, options);
787
+ const {
788
+ minRanking,
789
+ maxRanking,
790
+ threshold
791
+ } = rankValue.attributes;
792
+
793
+ if (newRank < minRanking && newRank >= rankings.MATCHES) {
794
+ newRank = minRanking;
795
+ } else if (newRank > maxRanking) {
796
+ newRank = maxRanking;
797
+ }
798
+
799
+ newRank = Math.min(newRank, maxRanking);
800
+
801
+ if (newRank > rankingInfo.rank) {
802
+ rankingInfo.rank = newRank;
803
+ rankingInfo.accessorIndex = i;
804
+ rankingInfo.accessorThreshold = threshold;
805
+ rankingInfo.rankedValue = rankValue.itemValue;
806
+ }
807
+ }
808
+
809
+ return rankingInfo;
810
+ }
811
+ /**
812
+ * Gives a rankings score based on how well the two strings match.
813
+ * @param {String} testString - the string to test against
814
+ * @param {String} stringToRank - the string to rank
815
+ * @param {Object} options - options for the match (like keepDiacritics for comparison)
816
+ * @returns {Number} the ranking for how well stringToRank matches testString
817
+ */
818
+
819
+ function getMatchRanking(testString, stringToRank, options) {
820
+ testString = prepareValueForComparison(testString, options);
821
+ stringToRank = prepareValueForComparison(stringToRank, options); // too long
822
+
823
+ if (stringToRank.length > testString.length) {
824
+ return rankings.NO_MATCH;
825
+ } // case sensitive equals
826
+
827
+
828
+ if (testString === stringToRank) {
829
+ return rankings.CASE_SENSITIVE_EQUAL;
830
+ } // Lower casing before further comparison
831
+
832
+
833
+ testString = testString.toLowerCase();
834
+ stringToRank = stringToRank.toLowerCase(); // case insensitive equals
835
+
836
+ if (testString === stringToRank) {
837
+ return rankings.EQUAL;
838
+ } // starts with
839
+
840
+
841
+ if (testString.startsWith(stringToRank)) {
842
+ return rankings.STARTS_WITH;
843
+ } // word starts with
844
+
845
+
846
+ if (testString.includes(" " + stringToRank)) {
847
+ return rankings.WORD_STARTS_WITH;
848
+ } // contains
849
+
850
+
851
+ if (testString.includes(stringToRank)) {
852
+ return rankings.CONTAINS;
853
+ } else if (stringToRank.length === 1) {
854
+ // If the only character in the given stringToRank
855
+ // isn't even contained in the testString, then
856
+ // it's definitely not a match.
857
+ return rankings.NO_MATCH;
858
+ } // acronym
859
+
860
+
861
+ if (getAcronym(testString).includes(stringToRank)) {
862
+ return rankings.ACRONYM;
863
+ } // will return a number between rankings.MATCHES and
864
+ // rankings.MATCHES + 1 depending on how close of a match it is.
865
+
866
+
867
+ return getClosenessRanking(testString, stringToRank);
868
+ }
869
+ /**
870
+ * Generates an acronym for a string.
871
+ *
872
+ * @param {String} string the string for which to produce the acronym
873
+ * @returns {String} the acronym
874
+ */
875
+
876
+
877
+ function getAcronym(string) {
878
+ let acronym = '';
879
+ const wordsInString = string.split(' ');
880
+ wordsInString.forEach(wordInString => {
881
+ const splitByHyphenWords = wordInString.split('-');
882
+ splitByHyphenWords.forEach(splitByHyphenWord => {
883
+ acronym += splitByHyphenWord.substr(0, 1);
884
+ });
885
+ });
886
+ return acronym;
887
+ }
888
+ /**
889
+ * Returns a score based on how spread apart the
890
+ * characters from the stringToRank are within the testString.
891
+ * A number close to rankings.MATCHES represents a loose match. A number close
892
+ * to rankings.MATCHES + 1 represents a tighter match.
893
+ * @param {String} testString - the string to test against
894
+ * @param {String} stringToRank - the string to rank
895
+ * @returns {Number} the number between rankings.MATCHES and
896
+ * rankings.MATCHES + 1 for how well stringToRank matches testString
897
+ */
898
+
899
+
900
+ function getClosenessRanking(testString, stringToRank) {
901
+ let matchingInOrderCharCount = 0;
902
+ let charNumber = 0;
903
+
904
+ function findMatchingCharacter(matchChar, string, index) {
905
+ for (let j = index, J = string.length; j < J; j++) {
906
+ const stringChar = string[j];
907
+
908
+ if (stringChar === matchChar) {
909
+ matchingInOrderCharCount += 1;
910
+ return j + 1;
911
+ }
912
+ }
913
+
914
+ return -1;
915
+ }
916
+
917
+ function getRanking(spread) {
918
+ const spreadPercentage = 1 / spread;
919
+ const inOrderPercentage = matchingInOrderCharCount / stringToRank.length;
920
+ const ranking = rankings.MATCHES + inOrderPercentage * spreadPercentage;
921
+ return ranking;
922
+ }
923
+
924
+ const firstIndex = findMatchingCharacter(stringToRank[0], testString, 0);
925
+
926
+ if (firstIndex < 0) {
927
+ return rankings.NO_MATCH;
928
+ }
929
+
930
+ charNumber = firstIndex;
931
+
932
+ for (let i = 1, I = stringToRank.length; i < I; i++) {
933
+ const matchChar = stringToRank[i];
934
+ charNumber = findMatchingCharacter(matchChar, testString, charNumber);
935
+ const found = charNumber > -1;
936
+
937
+ if (!found) {
938
+ return rankings.NO_MATCH;
939
+ }
940
+ }
941
+
942
+ const spread = charNumber - firstIndex;
943
+ return getRanking(spread);
944
+ }
945
+ /**
946
+ * Sorts items that have a rank, index, and accessorIndex
947
+ * @param {Object} a - the first item to sort
948
+ * @param {Object} b - the second item to sort
949
+ * @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal
950
+ */
951
+
952
+
953
+ function compareItems(a, b) {
954
+ return a.rank === b.rank ? 0 : a.rank > b.rank ? -1 : 1;
955
+ }
956
+ /**
957
+ * Prepares value for comparison by stringifying it, removing diacritics (if specified)
958
+ * @param {String} value - the value to clean
959
+ * @param {Object} options - {keepDiacritics: whether to remove diacritics}
960
+ * @return {String} the prepared value
961
+ */
962
+
963
+ function prepareValueForComparison(value, _ref) {
964
+ let {
965
+ keepDiacritics
966
+ } = _ref;
967
+ // value might not actually be a string at this point (we don't get to choose)
968
+ // so part of preparing the value for comparison is ensure that it is a string
969
+ value = "" + value; // toString
970
+
971
+ if (!keepDiacritics) {
972
+ value = removeAccents(value);
973
+ }
974
+
975
+ return value;
976
+ }
977
+ /**
978
+ * Gets value for key in item at arbitrarily nested keypath
979
+ * @param {Object} item - the item
980
+ * @param {Object|Function} key - the potentially nested keypath or property callback
981
+ * @return {Array} - an array containing the value(s) at the nested keypath
982
+ */
983
+
984
+
985
+ function getItemValues(item, accessor) {
986
+ let accessorFn = accessor;
987
+
988
+ if (typeof accessor === 'object') {
989
+ accessorFn = accessor.accessor;
990
+ }
991
+
992
+ const value = accessorFn(item); // because `value` can also be undefined
993
+
994
+ if (value == null) {
995
+ return [];
996
+ }
997
+
998
+ if (Array.isArray(value)) {
999
+ return value;
1000
+ }
1001
+
1002
+ return [String(value)];
1003
+ }
1004
+ /**
1005
+ * Gets all the values for the given keys in the given item and returns an array of those values
1006
+ * @param item - the item from which the values will be retrieved
1007
+ * @param keys - the keys to use to retrieve the values
1008
+ * @return objects with {itemValue, attributes}
1009
+ */
1010
+
1011
+
1012
+ function getAllValuesToRank(item, accessors) {
1013
+ const allValues = [];
1014
+
1015
+ for (let j = 0, J = accessors.length; j < J; j++) {
1016
+ const accessor = accessors[j];
1017
+ const attributes = getAccessorAttributes(accessor);
1018
+ const itemValues = getItemValues(item, accessor);
1019
+
1020
+ for (let i = 0, I = itemValues.length; i < I; i++) {
1021
+ allValues.push({
1022
+ itemValue: itemValues[i],
1023
+ attributes
1024
+ });
1025
+ }
1026
+ }
1027
+
1028
+ return allValues;
1029
+ }
1030
+
1031
+ const defaultKeyAttributes = {
1032
+ maxRanking: Infinity,
1033
+ minRanking: -Infinity
1034
+ };
1035
+ /**
1036
+ * Gets all the attributes for the given accessor
1037
+ * @param accessor - the accessor from which the attributes will be retrieved
1038
+ * @return object containing the accessor's attributes
1039
+ */
1040
+
1041
+ function getAccessorAttributes(accessor) {
1042
+ if (typeof accessor === 'function') {
1043
+ return defaultKeyAttributes;
1044
+ }
1045
+
1046
+ return { ...defaultKeyAttributes,
1047
+ ...accessor
1048
+ };
1049
+ }
1050
+
1051
+ const getItem = key => {
1052
+ try {
1053
+ const itemValue = localStorage.getItem(key);
1054
+
1055
+ if (typeof itemValue === 'string') {
1056
+ return JSON.parse(itemValue);
1057
+ }
1058
+
1059
+ return undefined;
1060
+ } catch {
1061
+ return undefined;
1062
+ }
1063
+ };
1064
+
1065
+ function useLocalStorage(key, defaultValue) {
1066
+ const [value, setValue] = React__namespace.useState();
1067
+ React__namespace.useEffect(() => {
1068
+ const initialValue = getItem(key);
1069
+
1070
+ if (typeof initialValue === 'undefined' || initialValue === null) {
1071
+ setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
1072
+ } else {
1073
+ setValue(initialValue);
1074
+ }
1075
+ }, [defaultValue, key]);
1076
+ const setter = React__namespace.useCallback(updater => {
1077
+ setValue(old => {
1078
+ let newVal = updater;
1079
+
1080
+ if (typeof updater == 'function') {
1081
+ newVal = updater(old);
1082
+ }
1083
+
1084
+ try {
1085
+ localStorage.setItem(key, JSON.stringify(newVal));
1086
+ } catch {}
1087
+
1088
+ return newVal;
1089
+ });
1090
+ }, [key]);
1091
+ return [value, setter];
1092
+ }
1093
+
1094
+ const defaultTheme = {
1095
+ background: '#0b1521',
1096
+ backgroundAlt: '#132337',
1097
+ foreground: 'white',
1098
+ gray: '#3f4e60',
1099
+ grayAlt: '#222e3e',
1100
+ inputBackgroundColor: '#fff',
1101
+ inputTextColor: '#000',
1102
+ success: '#00ab52',
1103
+ danger: '#ff0085',
1104
+ active: '#006bff',
1105
+ paused: '#8c49eb',
1106
+ warning: '#ffb200'
1107
+ };
1108
+ const ThemeContext = /*#__PURE__*/React__namespace.createContext(defaultTheme);
1109
+ function ThemeProvider({
1110
+ theme,
1111
+ ...rest
1112
+ }) {
1113
+ return /*#__PURE__*/React__namespace.createElement(ThemeContext.Provider, _extends({
1114
+ value: theme
1115
+ }, rest));
19
1116
  }
20
- function ReactQueryDevtoolsPanel() {
21
- return null;
1117
+ function useTheme() {
1118
+ return React__namespace.useContext(ThemeContext);
22
1119
  }
23
1120
 
1121
+ function useMediaQuery(query) {
1122
+ // Keep track of the preference in state, start with the current match
1123
+ const [isMatch, setIsMatch] = React__namespace.useState(() => {
1124
+ if (typeof window !== 'undefined') {
1125
+ return window.matchMedia(query).matches;
1126
+ }
1127
+ }); // Watch for changes
1128
+
1129
+ React__namespace.useEffect(() => {
1130
+ if (typeof window !== 'undefined') {
1131
+ // Create a matcher
1132
+ const matcher = window.matchMedia(query); // Create our handler
1133
+
1134
+ const onChange = ({
1135
+ matches
1136
+ }) => setIsMatch(matches); // Listen for changes
1137
+
1138
+
1139
+ matcher.addListener(onChange);
1140
+ return () => {
1141
+ // Stop listening for changes
1142
+ matcher.removeListener(onChange);
1143
+ };
1144
+ }
1145
+ }, [isMatch, query, setIsMatch]);
1146
+ return isMatch;
1147
+ }
1148
+
1149
+ const isServer$1 = typeof window === 'undefined';
1150
+ function getQueryStatusColor({
1151
+ queryState,
1152
+ observerCount,
1153
+ isStale,
1154
+ theme
1155
+ }) {
1156
+ return queryState.fetchStatus === 'fetching' ? theme.active : !observerCount ? theme.gray : queryState.fetchStatus === 'paused' ? theme.paused : isStale ? theme.warning : theme.success;
1157
+ }
1158
+ function getQueryStatusLabel(query) {
1159
+ return query.state.fetchStatus === 'fetching' ? 'fetching' : !query.getObserversCount() ? 'inactive' : query.state.fetchStatus === 'paused' ? 'paused' : query.isStale() ? 'stale' : 'fresh';
1160
+ }
1161
+ function styled(type, newStyles, queries = {}) {
1162
+ return /*#__PURE__*/React__namespace.forwardRef(({
1163
+ style,
1164
+ ...rest
1165
+ }, ref) => {
1166
+ const theme = useTheme();
1167
+ const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
1168
+ // eslint-disable-next-line react-hooks/rules-of-hooks
1169
+ return useMediaQuery(key) ? { ...current,
1170
+ ...(typeof value === 'function' ? value(rest, theme) : value)
1171
+ } : current;
1172
+ }, {});
1173
+ return /*#__PURE__*/React__namespace.createElement(type, { ...rest,
1174
+ style: { ...(typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles),
1175
+ ...style,
1176
+ ...mediaStyles
1177
+ },
1178
+ ref
1179
+ });
1180
+ });
1181
+ }
1182
+ function useIsMounted() {
1183
+ const mountedRef = React__namespace.useRef(false);
1184
+ const isMounted = React__namespace.useCallback(() => mountedRef.current, []);
1185
+ React__namespace[isServer$1 ? 'useEffect' : 'useLayoutEffect'](() => {
1186
+ mountedRef.current = true;
1187
+ return () => {
1188
+ mountedRef.current = false;
1189
+ };
1190
+ }, []);
1191
+ return isMounted;
1192
+ }
1193
+ /**
1194
+ * Displays a string regardless the type of the data
1195
+ * @param {unknown} value Value to be stringified
1196
+ */
1197
+
1198
+ const displayValue = value => {
1199
+ const name = Object.getOwnPropertyNames(Object(value));
1200
+ const newValue = typeof value === 'bigint' ? value.toString() + "n" : value;
1201
+ return JSON.stringify(newValue, name);
1202
+ };
1203
+
1204
+ const getStatusRank = q => q.state.fetchStatus !== 'idle' ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
1205
+
1206
+ const sortFns = {
1207
+ 'Status > Last Updated': (a, b) => {
1208
+ var _sortFns$LastUpdated;
1209
+
1210
+ return getStatusRank(a) === getStatusRank(b) ? (_sortFns$LastUpdated = sortFns['Last Updated']) == null ? void 0 : _sortFns$LastUpdated.call(sortFns, a, b) : getStatusRank(a) > getStatusRank(b) ? 1 : -1;
1211
+ },
1212
+ 'Query Hash': (a, b) => a.queryHash > b.queryHash ? 1 : -1,
1213
+ 'Last Updated': (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1
1214
+ };
1215
+
1216
+ const Panel = styled('div', (_props, theme) => ({
1217
+ fontSize: 'clamp(12px, 1.5vw, 14px)',
1218
+ fontFamily: "sans-serif",
1219
+ display: 'flex',
1220
+ backgroundColor: theme.background,
1221
+ color: theme.foreground
1222
+ }), {
1223
+ '(max-width: 700px)': {
1224
+ flexDirection: 'column'
1225
+ },
1226
+ '(max-width: 600px)': {
1227
+ fontSize: '.9em' // flexDirection: 'column',
1228
+
1229
+ }
1230
+ });
1231
+ const ActiveQueryPanel = styled('div', () => ({
1232
+ flex: '1 1 500px',
1233
+ display: 'flex',
1234
+ flexDirection: 'column',
1235
+ overflow: 'auto',
1236
+ height: '100%'
1237
+ }), {
1238
+ '(max-width: 700px)': (_props, theme) => ({
1239
+ borderTop: "2px solid " + theme.gray
1240
+ })
1241
+ });
1242
+ const Button = styled('button', (props, theme) => ({
1243
+ appearance: 'none',
1244
+ fontSize: '.9em',
1245
+ fontWeight: 'bold',
1246
+ background: theme.gray,
1247
+ border: '0',
1248
+ borderRadius: '.3em',
1249
+ color: 'white',
1250
+ padding: '.5em',
1251
+ opacity: props.disabled ? '.5' : undefined,
1252
+ cursor: 'pointer'
1253
+ }));
1254
+ const QueryKeys = styled('span', {
1255
+ display: 'inline-block',
1256
+ fontSize: '0.9em'
1257
+ });
1258
+ const QueryKey = styled('span', {
1259
+ display: 'inline-flex',
1260
+ alignItems: 'center',
1261
+ padding: '.2em .4em',
1262
+ fontWeight: 'bold',
1263
+ textShadow: '0 0 10px black',
1264
+ borderRadius: '.2em'
1265
+ });
1266
+ const Code = styled('code', {
1267
+ fontSize: '.9em',
1268
+ color: 'inherit',
1269
+ background: 'inherit'
1270
+ });
1271
+ const Input = styled('input', (_props, theme) => ({
1272
+ backgroundColor: theme.inputBackgroundColor,
1273
+ border: 0,
1274
+ borderRadius: '.2em',
1275
+ color: theme.inputTextColor,
1276
+ fontSize: '.9em',
1277
+ lineHeight: "1.3",
1278
+ padding: '.3em .4em'
1279
+ }));
1280
+ const Select = styled('select', (_props, theme) => ({
1281
+ display: "inline-block",
1282
+ fontSize: ".9em",
1283
+ fontFamily: "sans-serif",
1284
+ fontWeight: 'normal',
1285
+ lineHeight: "1.3",
1286
+ padding: ".3em 1.5em .3em .5em",
1287
+ height: 'auto',
1288
+ border: 0,
1289
+ borderRadius: ".2em",
1290
+ appearance: "none",
1291
+ WebkitAppearance: 'none',
1292
+ backgroundColor: theme.inputBackgroundColor,
1293
+ backgroundImage: "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")",
1294
+ backgroundRepeat: "no-repeat",
1295
+ backgroundPosition: "right .55em center",
1296
+ backgroundSize: ".65em auto, 100%",
1297
+ color: theme.inputTextColor
1298
+ }), {
1299
+ '(max-width: 500px)': {
1300
+ display: 'none'
1301
+ }
1302
+ });
1303
+
1304
+ const Entry = styled('div', {
1305
+ fontFamily: 'Menlo, monospace',
1306
+ fontSize: '1em',
1307
+ lineHeight: '1.7',
1308
+ outline: 'none',
1309
+ wordBreak: 'break-word'
1310
+ });
1311
+ const Label = styled('span', {
1312
+ color: 'white'
1313
+ });
1314
+ const LabelButton = styled('button', {
1315
+ cursor: 'pointer',
1316
+ color: 'white'
1317
+ });
1318
+ const ExpandButton = styled('button', {
1319
+ cursor: 'pointer',
1320
+ color: 'inherit',
1321
+ font: 'inherit',
1322
+ outline: 'inherit',
1323
+ background: 'transparent',
1324
+ border: 'none',
1325
+ padding: 0
1326
+ });
1327
+ const Value = styled('span', (_props, theme) => ({
1328
+ color: theme.danger
1329
+ }));
1330
+ const SubEntries = styled('div', {
1331
+ marginLeft: '.1em',
1332
+ paddingLeft: '1em',
1333
+ borderLeft: '2px solid rgba(0,0,0,.15)'
1334
+ });
1335
+ const Info = styled('span', {
1336
+ color: 'grey',
1337
+ fontSize: '.7em'
1338
+ });
1339
+ const Expander = ({
1340
+ expanded,
1341
+ style = {}
1342
+ }) => /*#__PURE__*/React__namespace.createElement("span", {
1343
+ style: {
1344
+ display: 'inline-block',
1345
+ transition: 'all .1s ease',
1346
+ transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || ''),
1347
+ ...style
1348
+ }
1349
+ }, "\u25B6");
1350
+
1351
+ /**
1352
+ * Chunk elements in the array by size
1353
+ *
1354
+ * when the array cannot be chunked evenly by size, the last chunk will be
1355
+ * filled with the remaining elements
1356
+ *
1357
+ * @example
1358
+ * chunkArray(['a','b', 'c', 'd', 'e'], 2) // returns [['a','b'], ['c', 'd'], ['e']]
1359
+ */
1360
+ function chunkArray(array, size) {
1361
+ if (size < 1) return [];
1362
+ let i = 0;
1363
+ const result = [];
1364
+
1365
+ while (i < array.length) {
1366
+ result.push(array.slice(i, i + size));
1367
+ i = i + size;
1368
+ }
1369
+
1370
+ return result;
1371
+ }
1372
+ const DefaultRenderer = ({
1373
+ HandleEntry,
1374
+ label,
1375
+ value,
1376
+ subEntries = [],
1377
+ subEntryPages = [],
1378
+ type,
1379
+ expanded = false,
1380
+ toggleExpanded,
1381
+ pageSize
1382
+ }) => {
1383
+ const [expandedPages, setExpandedPages] = React__namespace.useState([]);
1384
+ return /*#__PURE__*/React__namespace.createElement(Entry, {
1385
+ key: label
1386
+ }, subEntryPages.length ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ExpandButton, {
1387
+ onClick: () => toggleExpanded()
1388
+ }, /*#__PURE__*/React__namespace.createElement(Expander, {
1389
+ expanded: expanded
1390
+ }), " ", label, ' ', /*#__PURE__*/React__namespace.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? "items" : "item")), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntries.map(entry => /*#__PURE__*/React__namespace.createElement(HandleEntry, {
1391
+ key: entry.label,
1392
+ entry: entry
1393
+ }))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
1394
+ key: index
1395
+ }, /*#__PURE__*/React__namespace.createElement(Entry, null, /*#__PURE__*/React__namespace.createElement(LabelButton, {
1396
+ onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index])
1397
+ }, /*#__PURE__*/React__namespace.createElement(Expander, {
1398
+ expanded: expanded
1399
+ }), " [", index * pageSize, " ...", ' ', index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, entries.map(entry => /*#__PURE__*/React__namespace.createElement(HandleEntry, {
1400
+ key: entry.label,
1401
+ entry: entry
1402
+ }))) : null)))) : null) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Label, null, label, ":"), " ", /*#__PURE__*/React__namespace.createElement(Value, null, displayValue(value))));
1403
+ };
1404
+
1405
+ function isIterable(x) {
1406
+ return Symbol.iterator in x;
1407
+ }
1408
+
1409
+ function Explorer({
1410
+ value,
1411
+ defaultExpanded,
1412
+ renderer = DefaultRenderer,
1413
+ pageSize = 100,
1414
+ ...rest
1415
+ }) {
1416
+ const [expanded, setExpanded] = React__namespace.useState(Boolean(defaultExpanded));
1417
+ const toggleExpanded = React__namespace.useCallback(() => setExpanded(old => !old), []);
1418
+ let type = typeof value;
1419
+ let subEntries = [];
1420
+
1421
+ const makeProperty = sub => {
1422
+ const subDefaultExpanded = defaultExpanded === true ? {
1423
+ [sub.label]: true
1424
+ } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
1425
+ return { ...sub,
1426
+ defaultExpanded: subDefaultExpanded
1427
+ };
1428
+ };
1429
+
1430
+ if (Array.isArray(value)) {
1431
+ type = 'array';
1432
+ subEntries = value.map((d, i) => makeProperty({
1433
+ label: i.toString(),
1434
+ value: d
1435
+ }));
1436
+ } else if (value !== null && typeof value === 'object' && isIterable(value) && typeof value[Symbol.iterator] === 'function') {
1437
+ type = 'Iterable';
1438
+ subEntries = Array.from(value, (val, i) => makeProperty({
1439
+ label: i.toString(),
1440
+ value: val
1441
+ }));
1442
+ } else if (typeof value === 'object' && value !== null) {
1443
+ type = 'object';
1444
+ subEntries = Object.entries(value).map(([key, val]) => makeProperty({
1445
+ label: key,
1446
+ value: val
1447
+ }));
1448
+ }
1449
+
1450
+ const subEntryPages = chunkArray(subEntries, pageSize);
1451
+ return renderer({
1452
+ HandleEntry: ({
1453
+ entry
1454
+ }) => /*#__PURE__*/React__namespace.createElement(Explorer, _extends({
1455
+ value: value,
1456
+ renderer: renderer
1457
+ }, rest, entry)),
1458
+ type,
1459
+ subEntries,
1460
+ subEntryPages,
1461
+ value,
1462
+ expanded,
1463
+ toggleExpanded,
1464
+ pageSize,
1465
+ ...rest
1466
+ });
1467
+ }
1468
+
1469
+ function Logo(props) {
1470
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
1471
+ width: "40px",
1472
+ height: "40px",
1473
+ viewBox: "0 0 190 190",
1474
+ version: "1.1"
1475
+ }, props), /*#__PURE__*/React__namespace.createElement("g", {
1476
+ stroke: "none",
1477
+ strokeWidth: "1",
1478
+ fill: "none",
1479
+ fillRule: "evenodd"
1480
+ }, /*#__PURE__*/React__namespace.createElement("g", {
1481
+ transform: "translate(-33.000000, 0.000000)"
1482
+ }, /*#__PURE__*/React__namespace.createElement("path", {
1483
+ d: "M72.7239712,61.3436237 C69.631224,46.362877 68.9675112,34.8727722 70.9666331,26.5293551 C72.1555965,21.5671678 74.3293088,17.5190846 77.6346064,14.5984631 C81.1241394,11.5150478 85.5360327,10.0020122 90.493257,10.0020122 C98.6712013,10.0020122 107.26826,13.7273214 116.455725,20.8044264 C120.20312,23.6910458 124.092437,27.170411 128.131651,31.2444746 C128.45314,30.8310265 128.816542,30.4410453 129.22143,30.0806152 C140.64098,19.9149716 150.255245,13.5989272 158.478408,11.1636507 C163.367899,9.715636 167.958526,9.57768202 172.138936,10.983031 C176.551631,12.4664684 180.06766,15.5329489 182.548314,19.8281091 C186.642288,26.9166735 187.721918,36.2310983 186.195595,47.7320243 C185.573451,52.4199112 184.50985,57.5263831 183.007094,63.0593153 C183.574045,63.1277086 184.142416,63.2532808 184.705041,63.4395297 C199.193932,68.2358678 209.453582,73.3937462 215.665021,79.2882839 C219.360669,82.7953831 221.773972,86.6998434 222.646365,91.0218204 C223.567176,95.5836746 222.669313,100.159332 220.191548,104.451297 C216.105211,111.529614 208.591643,117.11221 197.887587,121.534031 C193.589552,123.309539 188.726579,124.917559 183.293259,126.363748 C183.541176,126.92292 183.733521,127.516759 183.862138,128.139758 C186.954886,143.120505 187.618598,154.61061 185.619477,162.954027 C184.430513,167.916214 182.256801,171.964297 178.951503,174.884919 C175.46197,177.968334 171.050077,179.48137 166.092853,179.48137 C157.914908,179.48137 149.31785,175.756061 140.130385,168.678956 C136.343104,165.761613 132.410866,162.238839 128.325434,158.108619 C127.905075,158.765474 127.388968,159.376011 126.77857,159.919385 C115.35902,170.085028 105.744755,176.401073 97.5215915,178.836349 C92.6321009,180.284364 88.0414736,180.422318 83.8610636,179.016969 C79.4483686,177.533532 75.9323404,174.467051 73.4516862,170.171891 C69.3577116,163.083327 68.2780823,153.768902 69.8044053,142.267976 C70.449038,137.410634 71.56762,132.103898 73.1575891,126.339009 C72.5361041,126.276104 71.9120754,126.144816 71.2949591,125.940529 C56.8060684,121.144191 46.5464184,115.986312 40.3349789,110.091775 C36.6393312,106.584675 34.2260275,102.680215 33.3536352,98.3582381 C32.4328237,93.7963839 33.3306866,89.2207269 35.8084524,84.9287618 C39.8947886,77.8504443 47.4083565,72.2678481 58.1124133,67.8460273 C62.5385143,66.0176154 67.5637208,64.366822 73.1939394,62.8874674 C72.9933393,62.3969171 72.8349374,61.8811235 72.7239712,61.3436237 Z",
1484
+ fill: "#002C4B",
1485
+ fillRule: "nonzero",
1486
+ transform: "translate(128.000000, 95.000000) scale(-1, 1) translate(-128.000000, -95.000000) "
1487
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1488
+ d: "M113.396882,64 L142.608177,64 C144.399254,64 146.053521,64.958025 146.944933,66.5115174 L161.577138,92.0115174 C162.461464,93.5526583 162.461464,95.4473417 161.577138,96.9884826 L146.944933,122.488483 C146.053521,124.041975 144.399254,125 142.608177,125 L113.396882,125 C111.605806,125 109.951539,124.041975 109.060126,122.488483 L94.4279211,96.9884826 C93.543596,95.4473417 93.543596,93.5526583 94.4279211,92.0115174 L109.060126,66.5115174 C109.951539,64.958025 111.605806,64 113.396882,64 Z M138.987827,70.2765273 C140.779849,70.2765273 142.434839,71.2355558 143.325899,72.7903404 L154.343038,92.0138131 C155.225607,93.5537825 155.225607,95.4462175 154.343038,96.9861869 L143.325899,116.20966 C142.434839,117.764444 140.779849,118.723473 138.987827,118.723473 L117.017233,118.723473 C115.225211,118.723473 113.570221,117.764444 112.67916,116.20966 L101.662022,96.9861869 C100.779452,95.4462175 100.779452,93.5537825 101.662022,92.0138131 L112.67916,72.7903404 C113.570221,71.2355558 115.225211,70.2765273 117.017233,70.2765273 L138.987827,70.2765273 Z M135.080648,77.1414791 L120.924411,77.1414791 C119.134228,77.1414791 117.480644,78.0985567 116.5889,79.6508285 L116.5889,79.6508285 L109.489217,92.0093494 C108.603232,93.5515958 108.603232,95.4484042 109.489217,96.9906506 L109.489217,96.9906506 L116.5889,109.349172 C117.480644,110.901443 119.134228,111.858521 120.924411,111.858521 L120.924411,111.858521 L135.080648,111.858521 C136.870831,111.858521 138.524416,110.901443 139.41616,109.349172 L139.41616,109.349172 L146.515843,96.9906506 C147.401828,95.4484042 147.401828,93.5515958 146.515843,92.0093494 L146.515843,92.0093494 L139.41616,79.6508285 C138.524416,78.0985567 136.870831,77.1414791 135.080648,77.1414791 L135.080648,77.1414791 Z M131.319186,83.7122186 C133.108028,83.7122186 134.760587,84.6678753 135.652827,86.2183156 L138.983552,92.0060969 C139.87203,93.5500005 139.87203,95.4499995 138.983552,96.9939031 L135.652827,102.781684 C134.760587,104.332125 133.108028,105.287781 131.319186,105.287781 L124.685874,105.287781 C122.897032,105.287781 121.244473,104.332125 120.352233,102.781684 L117.021508,96.9939031 C116.13303,95.4499995 116.13303,93.5500005 117.021508,92.0060969 L120.352233,86.2183156 C121.244473,84.6678753 122.897032,83.7122186 124.685874,83.7122186 L131.319186,83.7122186 Z M128.003794,90.1848875 C126.459294,90.1848875 125.034382,91.0072828 124.263005,92.3424437 C123.491732,93.6774232 123.491732,95.3225768 124.263005,96.6575563 C125.034382,97.9927172 126.459294,98.8151125 128.001266,98.8151125 L128.001266,98.8151125 C129.545766,98.8151125 130.970678,97.9927172 131.742055,96.6575563 C132.513327,95.3225768 132.513327,93.6774232 131.742055,92.3424437 C130.970678,91.0072828 129.545766,90.1848875 128.003794,90.1848875 L128.003794,90.1848875 Z M93,94.5009646 L100.767764,94.5009646",
1489
+ fill: "#FFD94C"
1490
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1491
+ d: "M87.8601729,108.357758 C89.1715224,107.608286 90.8360246,108.074601 91.5779424,109.399303 L91.5779424,109.399303 L92.0525843,110.24352 C95.8563392,116.982993 99.8190116,123.380176 103.940602,129.435068 C108.807881,136.585427 114.28184,143.82411 120.362479,151.151115 C121.316878,152.30114 121.184944,154.011176 120.065686,154.997937 L120.065686,154.997937 L119.454208,155.534625 C99.3465389,173.103314 86.2778188,176.612552 80.2480482,166.062341 C74.3500652,155.742717 76.4844915,136.982888 86.6513274,109.782853 C86.876818,109.179582 87.3045861,108.675291 87.8601729,108.357758 Z M173.534177,129.041504 C174.986131,128.785177 176.375496,129.742138 176.65963,131.194242 L176.65963,131.194242 L176.812815,131.986376 C181.782365,157.995459 178.283348,171 166.315764,171 C154.609745,171 139.708724,159.909007 121.612702,137.727022 C121.211349,137.235047 120.994572,136.617371 121,135.981509 C121.013158,134.480686 122.235785,133.274651 123.730918,133.287756 L123.730918,133.287756 L124.684654,133.294531 C132.305698,133.335994 139.714387,133.071591 146.910723,132.501323 C155.409039,131.82788 164.283523,130.674607 173.534177,129.041504 Z M180.408726,73.8119663 C180.932139,72.4026903 182.508386,71.6634537 183.954581,72.149012 L183.954581,72.149012 L184.742552,72.4154854 C210.583763,81.217922 220.402356,90.8916805 214.198332,101.436761 C208.129904,111.751366 190.484347,119.260339 161.26166,123.963678 C160.613529,124.067994 159.948643,123.945969 159.382735,123.618843 C158.047025,122.846729 157.602046,121.158214 158.388848,119.847438 L158.388848,119.847438 L158.889328,119.0105 C162.877183,112.31633 166.481358,105.654262 169.701854,99.0242957 C173.50501,91.1948179 177.073967,82.7907081 180.408726,73.8119663 Z M94.7383398,66.0363218 C95.3864708,65.9320063 96.0513565,66.0540315 96.6172646,66.3811573 C97.9529754,67.153271 98.3979538,68.8417862 97.6111517,70.1525615 L97.6111517,70.1525615 L97.1106718,70.9895001 C93.1228168,77.6836699 89.5186416,84.3457379 86.2981462,90.9757043 C82.49499,98.8051821 78.9260328,107.209292 75.5912744,116.188034 C75.0678608,117.59731 73.4916142,118.336546 72.045419,117.850988 L72.045419,117.850988 L71.2574475,117.584515 C45.4162372,108.782078 35.597644,99.1083195 41.8016679,88.5632391 C47.8700957,78.2486335 65.515653,70.7396611 94.7383398,66.0363218 Z M136.545792,34.4653746 C156.653461,16.8966864 169.722181,13.3874478 175.751952,23.9376587 C181.649935,34.2572826 179.515508,53.0171122 169.348673,80.2171474 C169.123182,80.8204179 168.695414,81.324709 168.139827,81.6422422 C166.828478,82.3917144 165.163975,81.9253986 164.422058,80.6006966 L164.422058,80.6006966 L163.947416,79.7564798 C160.143661,73.0170065 156.180988,66.6198239 152.059398,60.564932 C147.192119,53.4145727 141.71816,46.1758903 135.637521,38.8488847 C134.683122,37.6988602 134.815056,35.9888243 135.934314,35.0020629 L135.934314,35.0020629 Z M90.6842361,18 C102.390255,18 117.291276,29.0909926 135.387298,51.2729777 C135.788651,51.7649527 136.005428,52.3826288 136,53.0184911 C135.986842,54.5193144 134.764215,55.7253489 133.269082,55.7122445 L133.269082,55.7122445 L132.315346,55.7054689 C124.694302,55.6640063 117.285613,55.9284091 110.089277,56.4986773 C101.590961,57.17212 92.7164767,58.325393 83.4658235,59.9584962 C82.0138691,60.2148231 80.6245044,59.2578618 80.3403697,57.805758 L80.3403697,57.805758 L80.1871846,57.0136235 C75.2176347,31.0045412 78.7166519,18 90.6842361,18 Z",
1492
+ fill: "#FF4154"
1493
+ }))));
1494
+ }
1495
+
1496
+ const isServer = typeof window === 'undefined';
1497
+ function ReactQueryDevtools$1({
1498
+ initialIsOpen,
1499
+ panelProps = {},
1500
+ closeButtonProps = {},
1501
+ toggleButtonProps = {},
1502
+ position = 'bottom-left',
1503
+ containerElement: Container = 'aside',
1504
+ context,
1505
+ styleNonce
1506
+ }) {
1507
+ const rootRef = React__namespace.useRef(null);
1508
+ const panelRef = React__namespace.useRef(null);
1509
+ const [isOpen, setIsOpen] = useLocalStorage('reactQueryDevtoolsOpen', initialIsOpen);
1510
+ const [devtoolsHeight, setDevtoolsHeight] = useLocalStorage('reactQueryDevtoolsHeight', null);
1511
+ const [isResolvedOpen, setIsResolvedOpen] = React__namespace.useState(false);
1512
+ const [isResizing, setIsResizing] = React__namespace.useState(false);
1513
+ const isMounted = useIsMounted();
1514
+
1515
+ const handleDragStart = (panelElement, startEvent) => {
1516
+ var _panelElement$getBoun;
1517
+
1518
+ if (startEvent.button !== 0) return; // Only allow left click for drag
1519
+
1520
+ setIsResizing(true);
1521
+ const dragInfo = {
1522
+ originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0,
1523
+ pageY: startEvent.pageY
1524
+ };
1525
+
1526
+ const run = moveEvent => {
1527
+ const delta = dragInfo.pageY - moveEvent.pageY;
1528
+ const newHeight = dragInfo.originalHeight + delta;
1529
+ setDevtoolsHeight(newHeight);
1530
+
1531
+ if (newHeight < 70) {
1532
+ setIsOpen(false);
1533
+ } else {
1534
+ setIsOpen(true);
1535
+ }
1536
+ };
1537
+
1538
+ const unsub = () => {
1539
+ setIsResizing(false);
1540
+ document.removeEventListener('mousemove', run);
1541
+ document.removeEventListener('mouseUp', unsub);
1542
+ };
1543
+
1544
+ document.addEventListener('mousemove', run);
1545
+ document.addEventListener('mouseup', unsub);
1546
+ };
1547
+
1548
+ React__namespace.useEffect(() => {
1549
+ setIsResolvedOpen(isOpen != null ? isOpen : false);
1550
+ }, [isOpen, isResolvedOpen, setIsResolvedOpen]); // Toggle panel visibility before/after transition (depending on direction).
1551
+ // Prevents focusing in a closed panel.
1552
+
1553
+ React__namespace.useEffect(() => {
1554
+ const ref = panelRef.current;
1555
+
1556
+ if (ref) {
1557
+ const handlePanelTransitionStart = () => {
1558
+ if (isResolvedOpen) {
1559
+ ref.style.visibility = 'visible';
1560
+ }
1561
+ };
1562
+
1563
+ const handlePanelTransitionEnd = () => {
1564
+ if (!isResolvedOpen) {
1565
+ ref.style.visibility = 'hidden';
1566
+ }
1567
+ };
1568
+
1569
+ ref.addEventListener('transitionstart', handlePanelTransitionStart);
1570
+ ref.addEventListener('transitionend', handlePanelTransitionEnd);
1571
+ return () => {
1572
+ ref.removeEventListener('transitionstart', handlePanelTransitionStart);
1573
+ ref.removeEventListener('transitionend', handlePanelTransitionEnd);
1574
+ };
1575
+ }
1576
+ }, [isResolvedOpen]);
1577
+ React__namespace[isServer ? 'useEffect' : 'useLayoutEffect'](() => {
1578
+ if (isResolvedOpen) {
1579
+ var _rootRef$current, _rootRef$current$pare;
1580
+
1581
+ const previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom;
1582
+
1583
+ const run = () => {
1584
+ var _panelRef$current, _rootRef$current2;
1585
+
1586
+ const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
1587
+
1588
+ if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
1589
+ rootRef.current.parentElement.style.paddingBottom = containerHeight + "px";
1590
+ }
1591
+ };
1592
+
1593
+ run();
1594
+
1595
+ if (typeof window !== 'undefined') {
1596
+ window.addEventListener('resize', run);
1597
+ return () => {
1598
+ var _rootRef$current3;
1599
+
1600
+ window.removeEventListener('resize', run);
1601
+
1602
+ if ((_rootRef$current3 = rootRef.current) != null && _rootRef$current3.parentElement && typeof previousValue === 'string') {
1603
+ rootRef.current.parentElement.style.paddingBottom = previousValue;
1604
+ }
1605
+ };
1606
+ }
1607
+ }
1608
+ }, [isResolvedOpen]);
1609
+ const {
1610
+ style: panelStyle = {},
1611
+ ...otherPanelProps
1612
+ } = panelProps;
1613
+ const {
1614
+ style: closeButtonStyle = {},
1615
+ onClick: onCloseClick,
1616
+ ...otherCloseButtonProps
1617
+ } = closeButtonProps;
1618
+ const {
1619
+ style: toggleButtonStyle = {},
1620
+ onClick: onToggleClick,
1621
+ ...otherToggleButtonProps
1622
+ } = toggleButtonProps; // Do not render on the server
1623
+
1624
+ if (!isMounted()) return null;
1625
+ return /*#__PURE__*/React__namespace.createElement(Container, {
1626
+ ref: rootRef,
1627
+ className: "ReactQueryDevtools",
1628
+ "aria-label": "React Query Devtools"
1629
+ }, /*#__PURE__*/React__namespace.createElement(ThemeProvider, {
1630
+ theme: defaultTheme
1631
+ }, /*#__PURE__*/React__namespace.createElement(ReactQueryDevtoolsPanel$1, _extends({
1632
+ ref: panelRef,
1633
+ context: context,
1634
+ styleNonce: styleNonce
1635
+ }, otherPanelProps, {
1636
+ style: {
1637
+ position: 'fixed',
1638
+ bottom: '0',
1639
+ right: '0',
1640
+ zIndex: 99999,
1641
+ width: '100%',
1642
+ height: devtoolsHeight != null ? devtoolsHeight : 500,
1643
+ maxHeight: '90%',
1644
+ boxShadow: '0 0 20px rgba(0,0,0,.3)',
1645
+ borderTop: "1px solid " + defaultTheme.gray,
1646
+ transformOrigin: 'top',
1647
+ // visibility will be toggled after transitions, but set initial state here
1648
+ visibility: isOpen ? 'visible' : 'hidden',
1649
+ ...panelStyle,
1650
+ ...(isResizing ? {
1651
+ transition: "none"
1652
+ } : {
1653
+ transition: "all .2s ease"
1654
+ }),
1655
+ ...(isResolvedOpen ? {
1656
+ opacity: 1,
1657
+ pointerEvents: 'all',
1658
+ transform: "translateY(0) scale(1)"
1659
+ } : {
1660
+ opacity: 0,
1661
+ pointerEvents: 'none',
1662
+ transform: "translateY(15px) scale(1.02)"
1663
+ })
1664
+ },
1665
+ isOpen: isResolvedOpen,
1666
+ setIsOpen: setIsOpen,
1667
+ handleDragStart: e => handleDragStart(panelRef.current, e)
1668
+ })), isResolvedOpen ? /*#__PURE__*/React__namespace.createElement(Button, _extends({
1669
+ type: "button",
1670
+ "aria-controls": "ReactQueryDevtoolsPanel",
1671
+ "aria-haspopup": "true",
1672
+ "aria-expanded": "true"
1673
+ }, otherCloseButtonProps, {
1674
+ onClick: e => {
1675
+ setIsOpen(false);
1676
+ onCloseClick == null ? void 0 : onCloseClick(e);
1677
+ },
1678
+ style: {
1679
+ position: 'fixed',
1680
+ zIndex: 99999,
1681
+ margin: '.5em',
1682
+ bottom: 0,
1683
+ ...(position === 'top-right' ? {
1684
+ right: '0'
1685
+ } : position === 'top-left' ? {
1686
+ left: '0'
1687
+ } : position === 'bottom-right' ? {
1688
+ right: '0'
1689
+ } : {
1690
+ left: '0'
1691
+ }),
1692
+ ...closeButtonStyle
1693
+ }
1694
+ }), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__namespace.createElement("button", _extends({
1695
+ type: "button"
1696
+ }, otherToggleButtonProps, {
1697
+ "aria-label": "Open React Query Devtools",
1698
+ "aria-controls": "ReactQueryDevtoolsPanel",
1699
+ "aria-haspopup": "true",
1700
+ "aria-expanded": "false",
1701
+ onClick: e => {
1702
+ setIsOpen(true);
1703
+ onToggleClick == null ? void 0 : onToggleClick(e);
1704
+ },
1705
+ style: {
1706
+ background: 'none',
1707
+ border: 0,
1708
+ padding: 0,
1709
+ position: 'fixed',
1710
+ zIndex: 99999,
1711
+ display: 'inline-flex',
1712
+ fontSize: '1.5em',
1713
+ margin: '.5em',
1714
+ cursor: 'pointer',
1715
+ width: 'fit-content',
1716
+ ...(position === 'top-right' ? {
1717
+ top: '0',
1718
+ right: '0'
1719
+ } : position === 'top-left' ? {
1720
+ top: '0',
1721
+ left: '0'
1722
+ } : position === 'bottom-right' ? {
1723
+ bottom: '0',
1724
+ right: '0'
1725
+ } : {
1726
+ bottom: '0',
1727
+ left: '0'
1728
+ }),
1729
+ ...toggleButtonStyle
1730
+ }
1731
+ }), /*#__PURE__*/React__namespace.createElement(Logo, {
1732
+ "aria-hidden": true
1733
+ })) : null);
1734
+ }
1735
+
1736
+ const useSubscribeToQueryCache = (queryCache, getSnapshot) => {
1737
+ return shim.exports.useSyncExternalStore(React__namespace.useCallback(onStoreChange => queryCache.subscribe(reactQuery.notifyManager.batchCalls(onStoreChange)), [queryCache]), getSnapshot, getSnapshot);
1738
+ };
1739
+
1740
+ const ReactQueryDevtoolsPanel$1 = /*#__PURE__*/React__namespace.forwardRef(function ReactQueryDevtoolsPanel(props, ref) {
1741
+ const {
1742
+ isOpen = true,
1743
+ styleNonce,
1744
+ setIsOpen,
1745
+ handleDragStart,
1746
+ context,
1747
+ ...panelProps
1748
+ } = props;
1749
+ const queryClient = reactQuery.useQueryClient({
1750
+ context
1751
+ });
1752
+ const queryCache = queryClient.getQueryCache();
1753
+ const [sort, setSort] = useLocalStorage('reactQueryDevtoolsSortFn', Object.keys(sortFns)[0]);
1754
+ const [filter, setFilter] = useLocalStorage('reactQueryDevtoolsFilter', '');
1755
+ const [sortDesc, setSortDesc] = useLocalStorage('reactQueryDevtoolsSortDesc', false);
1756
+ const sortFn = React__namespace.useMemo(() => sortFns[sort], [sort]);
1757
+ const queriesCount = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().length);
1758
+ const [activeQueryHash, setActiveQueryHash] = useLocalStorage('reactQueryDevtoolsActiveQueryHash', '');
1759
+ const queries = React__namespace.useMemo(() => {
1760
+ const unsortedQueries = queryCache.getAll();
1761
+ const sorted = queriesCount > 0 ? [...unsortedQueries].sort(sortFn) : [];
1762
+
1763
+ if (sortDesc) {
1764
+ sorted.reverse();
1765
+ }
1766
+
1767
+ if (!filter) {
1768
+ return sorted;
1769
+ }
1770
+
1771
+ let ranked = sorted.map(item => [item, rankItem(item.queryHash, filter)]);
1772
+ ranked = ranked.filter(d => d[1].passed);
1773
+ ranked = ranked.sort((a, b) => compareItems(a[1], b[1]));
1774
+ return ranked.map(d => d[0]);
1775
+ }, [sortDesc, sortFn, filter, queriesCount, queryCache]);
1776
+ const [isMockOffline, setMockOffline] = React__namespace.useState(false);
1777
+ return /*#__PURE__*/React__namespace.createElement(ThemeProvider, {
1778
+ theme: defaultTheme
1779
+ }, /*#__PURE__*/React__namespace.createElement(Panel, _extends({
1780
+ ref: ref,
1781
+ className: "ReactQueryDevtoolsPanel",
1782
+ "aria-label": "React Query Devtools Panel",
1783
+ id: "ReactQueryDevtoolsPanel"
1784
+ }, panelProps), /*#__PURE__*/React__namespace.createElement("style", {
1785
+ nonce: styleNonce,
1786
+ dangerouslySetInnerHTML: {
1787
+ __html: "\n .ReactQueryDevtoolsPanel * {\n scrollbar-color: " + defaultTheme.backgroundAlt + " " + defaultTheme.gray + ";\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar, .ReactQueryDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar-track, .ReactQueryDevtoolsPanel scrollbar-track {\n background: " + defaultTheme.backgroundAlt + ";\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar-thumb, .ReactQueryDevtoolsPanel scrollbar-thumb {\n background: " + defaultTheme.gray + ";\n border-radius: .5em;\n border: 3px solid " + defaultTheme.backgroundAlt + ";\n }\n "
1788
+ }
1789
+ }), /*#__PURE__*/React__namespace.createElement("div", {
1790
+ style: {
1791
+ position: 'absolute',
1792
+ left: 0,
1793
+ top: 0,
1794
+ width: '100%',
1795
+ height: '4px',
1796
+ marginBottom: '-4px',
1797
+ cursor: 'row-resize',
1798
+ zIndex: 100000
1799
+ },
1800
+ onMouseDown: handleDragStart
1801
+ }), /*#__PURE__*/React__namespace.createElement("div", {
1802
+ style: {
1803
+ flex: '1 1 500px',
1804
+ minHeight: '40%',
1805
+ maxHeight: '100%',
1806
+ overflow: 'auto',
1807
+ borderRight: "1px solid " + defaultTheme.grayAlt,
1808
+ display: isOpen ? 'flex' : 'none',
1809
+ flexDirection: 'column'
1810
+ }
1811
+ }, /*#__PURE__*/React__namespace.createElement("div", {
1812
+ style: {
1813
+ padding: '.5em',
1814
+ background: defaultTheme.backgroundAlt,
1815
+ display: 'flex',
1816
+ justifyContent: 'space-between',
1817
+ alignItems: 'center'
1818
+ }
1819
+ }, /*#__PURE__*/React__namespace.createElement("button", {
1820
+ type: "button",
1821
+ "aria-label": "Close React Query Devtools",
1822
+ "aria-controls": "ReactQueryDevtoolsPanel",
1823
+ "aria-haspopup": "true",
1824
+ "aria-expanded": "true",
1825
+ onClick: () => setIsOpen(false),
1826
+ style: {
1827
+ display: 'inline-flex',
1828
+ background: 'none',
1829
+ border: 0,
1830
+ padding: 0,
1831
+ marginRight: '.5em',
1832
+ cursor: 'pointer'
1833
+ }
1834
+ }, /*#__PURE__*/React__namespace.createElement(Logo, {
1835
+ "aria-hidden": true
1836
+ })), /*#__PURE__*/React__namespace.createElement("div", {
1837
+ style: {
1838
+ display: 'flex',
1839
+ flexDirection: 'column'
1840
+ }
1841
+ }, /*#__PURE__*/React__namespace.createElement(QueryStatusCount, {
1842
+ queryCache: queryCache
1843
+ }), /*#__PURE__*/React__namespace.createElement("div", {
1844
+ style: {
1845
+ display: 'flex',
1846
+ alignItems: 'center'
1847
+ }
1848
+ }, /*#__PURE__*/React__namespace.createElement(Input, {
1849
+ placeholder: "Filter",
1850
+ "aria-label": "Filter by queryhash",
1851
+ value: filter != null ? filter : '',
1852
+ onChange: e => setFilter(e.target.value),
1853
+ onKeyDown: e => {
1854
+ if (e.key === 'Escape') setFilter('');
1855
+ },
1856
+ style: {
1857
+ flex: '1',
1858
+ marginRight: '.5em',
1859
+ width: '100%'
1860
+ }
1861
+ }), !filter ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Select, {
1862
+ "aria-label": "Sort queries",
1863
+ value: sort,
1864
+ onChange: e => setSort(e.target.value),
1865
+ style: {
1866
+ flex: '1',
1867
+ minWidth: 75,
1868
+ marginRight: '.5em'
1869
+ }
1870
+ }, Object.keys(sortFns).map(key => /*#__PURE__*/React__namespace.createElement("option", {
1871
+ key: key,
1872
+ value: key
1873
+ }, "Sort by ", key))), /*#__PURE__*/React__namespace.createElement(Button, {
1874
+ type: "button",
1875
+ onClick: () => setSortDesc(old => !old),
1876
+ style: {
1877
+ padding: '.3em .4em',
1878
+ marginRight: '.5em'
1879
+ }
1880
+ }, sortDesc ? '⬇ Desc' : '⬆ Asc'), /*#__PURE__*/React__namespace.createElement(Button, {
1881
+ type: "button",
1882
+ onClick: () => {
1883
+ if (isMockOffline) {
1884
+ reactQuery.onlineManager.setOnline(undefined);
1885
+ setMockOffline(false);
1886
+ window.dispatchEvent(new Event('online'));
1887
+ } else {
1888
+ reactQuery.onlineManager.setOnline(false);
1889
+ setMockOffline(true);
1890
+ }
1891
+ },
1892
+ "aria-label": isMockOffline ? 'Restore offline mock' : 'Mock offline behavior',
1893
+ title: isMockOffline ? 'Restore offline mock' : 'Mock offline behavior',
1894
+ style: {
1895
+ padding: '0',
1896
+ height: '2em'
1897
+ }
1898
+ }, /*#__PURE__*/React__namespace.createElement("svg", {
1899
+ xmlns: "http://www.w3.org/2000/svg",
1900
+ width: "2em",
1901
+ height: "2em",
1902
+ viewBox: "0 0 24 24",
1903
+ stroke: isMockOffline ? defaultTheme.danger : 'currentColor',
1904
+ fill: "none"
1905
+ }, isMockOffline ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("path", {
1906
+ stroke: "none",
1907
+ d: "M0 0h24v24H0z",
1908
+ fill: "none"
1909
+ }), /*#__PURE__*/React__namespace.createElement("line", {
1910
+ x1: "12",
1911
+ y1: "18",
1912
+ x2: "12.01",
1913
+ y2: "18"
1914
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1915
+ d: "M9.172 15.172a4 4 0 0 1 5.656 0"
1916
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1917
+ d: "M6.343 12.343a7.963 7.963 0 0 1 3.864 -2.14m4.163 .155a7.965 7.965 0 0 1 3.287 2"
1918
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1919
+ d: "M3.515 9.515a12 12 0 0 1 3.544 -2.455m3.101 -.92a12 12 0 0 1 10.325 3.374"
1920
+ }), /*#__PURE__*/React__namespace.createElement("line", {
1921
+ x1: "3",
1922
+ y1: "3",
1923
+ x2: "21",
1924
+ y2: "21"
1925
+ })) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("path", {
1926
+ stroke: "none",
1927
+ d: "M0 0h24v24H0z",
1928
+ fill: "none"
1929
+ }), /*#__PURE__*/React__namespace.createElement("line", {
1930
+ x1: "12",
1931
+ y1: "18",
1932
+ x2: "12.01",
1933
+ y2: "18"
1934
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1935
+ d: "M9.172 15.172a4 4 0 0 1 5.656 0"
1936
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1937
+ d: "M6.343 12.343a8 8 0 0 1 11.314 0"
1938
+ }), /*#__PURE__*/React__namespace.createElement("path", {
1939
+ d: "M3.515 9.515c4.686 -4.687 12.284 -4.687 17 0"
1940
+ }))))) : null))), /*#__PURE__*/React__namespace.createElement("div", {
1941
+ style: {
1942
+ overflowY: 'auto',
1943
+ flex: '1'
1944
+ }
1945
+ }, queries.map(query => {
1946
+ return /*#__PURE__*/React__namespace.createElement(QueryRow, {
1947
+ queryKey: query.queryKey,
1948
+ activeQueryHash: activeQueryHash,
1949
+ setActiveQueryHash: setActiveQueryHash,
1950
+ key: query.queryHash,
1951
+ queryCache: queryCache
1952
+ });
1953
+ }))), activeQueryHash ? /*#__PURE__*/React__namespace.createElement(ActiveQuery, {
1954
+ activeQueryHash: activeQueryHash,
1955
+ queryCache: queryCache,
1956
+ queryClient: queryClient
1957
+ }) : null));
1958
+ });
1959
+
1960
+ const ActiveQuery = ({
1961
+ queryCache,
1962
+ activeQueryHash,
1963
+ queryClient
1964
+ }) => {
1965
+ var _useSubscribeToQueryC, _useSubscribeToQueryC2;
1966
+
1967
+ const activeQuery = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().find(query => query.queryHash === activeQueryHash));
1968
+ const activeQueryState = useSubscribeToQueryCache(queryCache, () => {
1969
+ var _queryCache$getAll$fi;
1970
+
1971
+ return (_queryCache$getAll$fi = queryCache.getAll().find(query => query.queryHash === activeQueryHash)) == null ? void 0 : _queryCache$getAll$fi.state;
1972
+ });
1973
+ const isStale = (_useSubscribeToQueryC = useSubscribeToQueryCache(queryCache, () => {
1974
+ var _queryCache$getAll$fi2;
1975
+
1976
+ return (_queryCache$getAll$fi2 = queryCache.getAll().find(query => query.queryHash === activeQueryHash)) == null ? void 0 : _queryCache$getAll$fi2.isStale();
1977
+ })) != null ? _useSubscribeToQueryC : false;
1978
+ const observerCount = (_useSubscribeToQueryC2 = useSubscribeToQueryCache(queryCache, () => {
1979
+ var _queryCache$getAll$fi3;
1980
+
1981
+ return (_queryCache$getAll$fi3 = queryCache.getAll().find(query => query.queryHash === activeQueryHash)) == null ? void 0 : _queryCache$getAll$fi3.getObserversCount();
1982
+ })) != null ? _useSubscribeToQueryC2 : 0;
1983
+
1984
+ const handleRefetch = () => {
1985
+ const promise = activeQuery == null ? void 0 : activeQuery.fetch();
1986
+ promise == null ? void 0 : promise.catch(noop);
1987
+ };
1988
+
1989
+ if (!activeQuery || !activeQueryState) {
1990
+ return null;
1991
+ }
1992
+
1993
+ return /*#__PURE__*/React__namespace.createElement(ActiveQueryPanel, null, /*#__PURE__*/React__namespace.createElement("div", {
1994
+ style: {
1995
+ padding: '.5em',
1996
+ background: defaultTheme.backgroundAlt,
1997
+ position: 'sticky',
1998
+ top: 0,
1999
+ zIndex: 1
2000
+ }
2001
+ }, "Query Details"), /*#__PURE__*/React__namespace.createElement("div", {
2002
+ style: {
2003
+ padding: '.5em'
2004
+ }
2005
+ }, /*#__PURE__*/React__namespace.createElement("div", {
2006
+ style: {
2007
+ marginBottom: '.5em',
2008
+ display: 'flex',
2009
+ alignItems: 'stretch',
2010
+ justifyContent: 'space-between'
2011
+ }
2012
+ }, /*#__PURE__*/React__namespace.createElement(Code, {
2013
+ style: {
2014
+ lineHeight: '1.8em'
2015
+ }
2016
+ }, /*#__PURE__*/React__namespace.createElement("pre", {
2017
+ style: {
2018
+ margin: 0,
2019
+ padding: 0,
2020
+ overflow: 'auto'
2021
+ }
2022
+ }, JSON.stringify(activeQuery.queryKey, null, 2))), /*#__PURE__*/React__namespace.createElement("span", {
2023
+ style: {
2024
+ padding: '0.3em .6em',
2025
+ borderRadius: '0.4em',
2026
+ fontWeight: 'bold',
2027
+ textShadow: '0 2px 10px black',
2028
+ background: getQueryStatusColor({
2029
+ queryState: activeQueryState,
2030
+ isStale: isStale,
2031
+ observerCount: observerCount,
2032
+ theme: defaultTheme
2033
+ }),
2034
+ flexShrink: 0
2035
+ }
2036
+ }, getQueryStatusLabel(activeQuery))), /*#__PURE__*/React__namespace.createElement("div", {
2037
+ style: {
2038
+ marginBottom: '.5em',
2039
+ display: 'flex',
2040
+ alignItems: 'center',
2041
+ justifyContent: 'space-between'
2042
+ }
2043
+ }, "Observers: ", /*#__PURE__*/React__namespace.createElement(Code, null, observerCount)), /*#__PURE__*/React__namespace.createElement("div", {
2044
+ style: {
2045
+ display: 'flex',
2046
+ alignItems: 'center',
2047
+ justifyContent: 'space-between'
2048
+ }
2049
+ }, "Last Updated:", ' ', /*#__PURE__*/React__namespace.createElement(Code, null, new Date(activeQueryState.dataUpdatedAt).toLocaleTimeString()))), /*#__PURE__*/React__namespace.createElement("div", {
2050
+ style: {
2051
+ background: defaultTheme.backgroundAlt,
2052
+ padding: '.5em',
2053
+ position: 'sticky',
2054
+ top: 0,
2055
+ zIndex: 1
2056
+ }
2057
+ }, "Actions"), /*#__PURE__*/React__namespace.createElement("div", {
2058
+ style: {
2059
+ padding: '0.5em'
2060
+ }
2061
+ }, /*#__PURE__*/React__namespace.createElement(Button, {
2062
+ type: "button",
2063
+ onClick: handleRefetch,
2064
+ disabled: activeQueryState.fetchStatus === 'fetching',
2065
+ style: {
2066
+ background: defaultTheme.active
2067
+ }
2068
+ }, "Refetch"), ' ', /*#__PURE__*/React__namespace.createElement(Button, {
2069
+ type: "button",
2070
+ onClick: () => queryClient.invalidateQueries(activeQuery),
2071
+ style: {
2072
+ background: defaultTheme.warning,
2073
+ color: defaultTheme.inputTextColor
2074
+ }
2075
+ }, "Invalidate"), ' ', /*#__PURE__*/React__namespace.createElement(Button, {
2076
+ type: "button",
2077
+ onClick: () => queryClient.resetQueries(activeQuery),
2078
+ style: {
2079
+ background: defaultTheme.gray
2080
+ }
2081
+ }, "Reset"), ' ', /*#__PURE__*/React__namespace.createElement(Button, {
2082
+ type: "button",
2083
+ onClick: () => queryClient.removeQueries(activeQuery),
2084
+ style: {
2085
+ background: defaultTheme.danger
2086
+ }
2087
+ }, "Remove")), /*#__PURE__*/React__namespace.createElement("div", {
2088
+ style: {
2089
+ background: defaultTheme.backgroundAlt,
2090
+ padding: '.5em',
2091
+ position: 'sticky',
2092
+ top: 0,
2093
+ zIndex: 1
2094
+ }
2095
+ }, "Data Explorer"), /*#__PURE__*/React__namespace.createElement("div", {
2096
+ style: {
2097
+ padding: '.5em'
2098
+ }
2099
+ }, /*#__PURE__*/React__namespace.createElement(Explorer, {
2100
+ label: "Data",
2101
+ value: activeQueryState.data,
2102
+ defaultExpanded: {}
2103
+ })), /*#__PURE__*/React__namespace.createElement("div", {
2104
+ style: {
2105
+ background: defaultTheme.backgroundAlt,
2106
+ padding: '.5em',
2107
+ position: 'sticky',
2108
+ top: 0,
2109
+ zIndex: 1
2110
+ }
2111
+ }, "Query Explorer"), /*#__PURE__*/React__namespace.createElement("div", {
2112
+ style: {
2113
+ padding: '.5em'
2114
+ }
2115
+ }, /*#__PURE__*/React__namespace.createElement(Explorer, {
2116
+ label: "Query",
2117
+ value: activeQuery,
2118
+ defaultExpanded: {
2119
+ queryKey: true
2120
+ }
2121
+ })));
2122
+ };
2123
+
2124
+ const QueryStatusCount = ({
2125
+ queryCache
2126
+ }) => {
2127
+ const hasFresh = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'fresh').length);
2128
+ const hasFetching = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'fetching').length);
2129
+ const hasPaused = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'paused').length);
2130
+ const hasStale = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'stale').length);
2131
+ const hasInactive = useSubscribeToQueryCache(queryCache, () => queryCache.getAll().filter(q => getQueryStatusLabel(q) === 'inactive').length);
2132
+ return /*#__PURE__*/React__namespace.createElement(QueryKeys, {
2133
+ style: {
2134
+ marginBottom: '.5em'
2135
+ }
2136
+ }, /*#__PURE__*/React__namespace.createElement(QueryKey, {
2137
+ style: {
2138
+ background: defaultTheme.success,
2139
+ opacity: hasFresh ? 1 : 0.3
2140
+ }
2141
+ }, "fresh ", /*#__PURE__*/React__namespace.createElement(Code, null, "(", hasFresh, ")")), ' ', /*#__PURE__*/React__namespace.createElement(QueryKey, {
2142
+ style: {
2143
+ background: defaultTheme.active,
2144
+ opacity: hasFetching ? 1 : 0.3
2145
+ }
2146
+ }, "fetching ", /*#__PURE__*/React__namespace.createElement(Code, null, "(", hasFetching, ")")), ' ', /*#__PURE__*/React__namespace.createElement(QueryKey, {
2147
+ style: {
2148
+ background: defaultTheme.paused,
2149
+ opacity: hasPaused ? 1 : 0.3
2150
+ }
2151
+ }, "paused ", /*#__PURE__*/React__namespace.createElement(Code, null, "(", hasPaused, ")")), ' ', /*#__PURE__*/React__namespace.createElement(QueryKey, {
2152
+ style: {
2153
+ background: defaultTheme.warning,
2154
+ color: 'black',
2155
+ textShadow: '0',
2156
+ opacity: hasStale ? 1 : 0.3
2157
+ }
2158
+ }, "stale ", /*#__PURE__*/React__namespace.createElement(Code, null, "(", hasStale, ")")), ' ', /*#__PURE__*/React__namespace.createElement(QueryKey, {
2159
+ style: {
2160
+ background: defaultTheme.gray,
2161
+ opacity: hasInactive ? 1 : 0.3
2162
+ }
2163
+ }, "inactive ", /*#__PURE__*/React__namespace.createElement(Code, null, "(", hasInactive, ")")));
2164
+ };
2165
+
2166
+ const QueryRow = ({
2167
+ queryKey,
2168
+ setActiveQueryHash,
2169
+ activeQueryHash,
2170
+ queryCache
2171
+ }) => {
2172
+ var _useSubscribeToQueryC3, _useSubscribeToQueryC4, _useSubscribeToQueryC5, _useSubscribeToQueryC6;
2173
+
2174
+ const queryHash = (_useSubscribeToQueryC3 = useSubscribeToQueryCache(queryCache, () => {
2175
+ var _queryCache$find;
2176
+
2177
+ return (_queryCache$find = queryCache.find(queryKey)) == null ? void 0 : _queryCache$find.queryHash;
2178
+ })) != null ? _useSubscribeToQueryC3 : '';
2179
+ const queryState = useSubscribeToQueryCache(queryCache, () => {
2180
+ var _queryCache$find2;
2181
+
2182
+ return (_queryCache$find2 = queryCache.find(queryKey)) == null ? void 0 : _queryCache$find2.state;
2183
+ });
2184
+ const isStale = (_useSubscribeToQueryC4 = useSubscribeToQueryCache(queryCache, () => {
2185
+ var _queryCache$find3;
2186
+
2187
+ return (_queryCache$find3 = queryCache.find(queryKey)) == null ? void 0 : _queryCache$find3.isStale();
2188
+ })) != null ? _useSubscribeToQueryC4 : false;
2189
+ const isDisabled = (_useSubscribeToQueryC5 = useSubscribeToQueryCache(queryCache, () => {
2190
+ var _queryCache$find4;
2191
+
2192
+ return (_queryCache$find4 = queryCache.find(queryKey)) == null ? void 0 : _queryCache$find4.isDisabled();
2193
+ })) != null ? _useSubscribeToQueryC5 : false;
2194
+ const observerCount = (_useSubscribeToQueryC6 = useSubscribeToQueryCache(queryCache, () => {
2195
+ var _queryCache$find5;
2196
+
2197
+ return (_queryCache$find5 = queryCache.find(queryKey)) == null ? void 0 : _queryCache$find5.getObserversCount();
2198
+ })) != null ? _useSubscribeToQueryC6 : 0;
2199
+
2200
+ if (!queryState) {
2201
+ return null;
2202
+ }
2203
+
2204
+ return /*#__PURE__*/React__namespace.createElement("div", {
2205
+ role: "button",
2206
+ "aria-label": "Open query details for " + queryHash,
2207
+ onClick: () => setActiveQueryHash(activeQueryHash === queryHash ? '' : queryHash),
2208
+ style: {
2209
+ display: 'flex',
2210
+ borderBottom: "solid 1px " + defaultTheme.grayAlt,
2211
+ cursor: 'pointer',
2212
+ background: queryHash === activeQueryHash ? 'rgba(255,255,255,.1)' : undefined
2213
+ }
2214
+ }, /*#__PURE__*/React__namespace.createElement("div", {
2215
+ style: {
2216
+ flex: '0 0 auto',
2217
+ width: '2em',
2218
+ height: '2em',
2219
+ background: getQueryStatusColor({
2220
+ queryState,
2221
+ isStale,
2222
+ observerCount,
2223
+ theme: defaultTheme
2224
+ }),
2225
+ display: 'flex',
2226
+ alignItems: 'center',
2227
+ justifyContent: 'center',
2228
+ fontWeight: 'bold',
2229
+ textShadow: isStale ? '0' : '0 0 10px black',
2230
+ color: isStale ? 'black' : 'white'
2231
+ }
2232
+ }, observerCount), isDisabled ? /*#__PURE__*/React__namespace.createElement("div", {
2233
+ style: {
2234
+ flex: '0 0 auto',
2235
+ height: '2em',
2236
+ background: defaultTheme.gray,
2237
+ display: 'flex',
2238
+ alignItems: 'center',
2239
+ fontWeight: 'bold',
2240
+ padding: '0 0.5em'
2241
+ }
2242
+ }, "disabled") : null, /*#__PURE__*/React__namespace.createElement(Code, {
2243
+ style: {
2244
+ padding: '.5em'
2245
+ }
2246
+ }, "" + queryHash));
2247
+ }; // eslint-disable-next-line @typescript-eslint/no-empty-function
2248
+
2249
+
2250
+ function noop() {}
2251
+
2252
+ const ReactQueryDevtools = ReactQueryDevtools$1;
2253
+ const ReactQueryDevtoolsPanel = ReactQueryDevtoolsPanel$1;
2254
+
24
2255
  exports.ReactQueryDevtools = ReactQueryDevtools;
25
2256
  exports.ReactQueryDevtoolsPanel = ReactQueryDevtoolsPanel;
26
2257