1import { 2 require_jsx_runtime 3} from "/@fs/home/runner/workspace/node_modules/.vite/deps/chunk-S77I6LSE.js?v=9ce4103e"; 4import { 5 require_react 6} from "/@fs/home/runner/workspace/node_modules/.vite/deps/chunk-3TFVT2CW.js?v=9ce4103e"; 7import { 8 __privateAdd, 9 __privateGet, 10 __privateMethod, 11 __privateSet, 12 __privateWrapper, 13 __toESM 14} from "/@fs/home/runner/workspace/node_modules/.vite/deps/chunk-4MBMRILA.js?v=9ce4103e"; 15
vendor: 499 bytes, lines 16-38
16// node_modules/@tanstack/query-core/build/modern/subscribable.js 17var Subscribable = class { 18 constructor() { 19 this.listeners = /* @__PURE__ */ new Set(); 20 this.subscribe = this.subscribe.bind(this); 21 } 22 subscribe(listener) { 23 this.listeners.add(listener); 24 this.onSubscribe(); 25 return () => { 26 this.listeners.delete(listener); 27 this.onUnsubscribe(); 28 }; 29 } 30 hasListeners() { 31 return this.listeners.size > 0; 32 } 33 onSubscribe() { 34 } 35 onUnsubscribe() { 36 } 37}; 38
vendor: 6,274 bytes, lines 39-259
39// node_modules/@tanstack/query-core/build/modern/utils.js 40var isServer = typeof window === "undefined" || "Deno" in globalThis; 41function noop() { 42 return void 0; 43} 44function functionalUpdate(updater, input) { 45 return typeof updater === "function" ? updater(input) : updater; 46} 47function isValidTimeout(value) { 48 return typeof value === "number" && value >= 0 && value !== Infinity; 49} 50function timeUntilStale(updatedAt, staleTime) { 51 return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); 52} 53function resolveStaleTime(staleTime, query) { 54 return typeof staleTime === "function" ? staleTime(query) : staleTime; 55} 56function resolveEnabled(enabled, query) { 57 return typeof enabled === "function" ? enabled(query) : enabled; 58} 59function matchQuery(filters, query) { 60 const { 61 type = "all", 62 exact, 63 fetchStatus, 64 predicate, 65 queryKey, 66 stale 67 } = filters; 68 if (queryKey) { 69 if (exact) { 70 if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { 71 return false; 72 } 73 } else if (!partialMatchKey(query.queryKey, queryKey)) { 74 return false; 75 } 76 } 77 if (type !== "all") { 78 const isActive = query.isActive(); 79 if (type === "active" && !isActive) { 80 return false; 81 } 82 if (type === "inactive" && isActive) { 83 return false; 84 } 85 } 86 if (typeof stale === "boolean" && query.isStale() !== stale) { 87 return false; 88 } 89 if (fetchStatus && fetchStatus !== query.state.fetchStatus) { 90 return false; 91 } 92 if (predicate && !predicate(query)) { 93 return false; 94 } 95 return true; 96} 97function matchMutation(filters, mutation) { 98 const { exact, status, predicate, mutationKey } = filters; 99 if (mutationKey) { 100 if (!mutation.options.mutationKey) { 101 return false; 102 } 103 if (exact) { 104 if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { 105 return false; 106 } 107 } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { 108 return false; 109 } 110 } 111 if (status && mutation.state.status !== status) { 112 return false; 113 } 114 if (predicate && !predicate(mutation)) { 115 return false; 116 } 117 return true; 118} 119function hashQueryKeyByOptions(queryKey, options) { 120 const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; 121 return hashFn(queryKey); 122} 123function hashKey(queryKey) { 124 return JSON.stringify( 125 queryKey, 126 (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { 127 result[key] = val[key]; 128 return result; 129 }, {}) : val 130 ); 131} 132function partialMatchKey(a, b) { 133 if (a === b) { 134 return true; 135 } 136 if (typeof a !== typeof b) { 137 return false; 138 } 139 if (a && b && typeof a === "object" && typeof b === "object") { 140 return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key])); 141 } 142 return false; 143} 144function replaceEqualDeep(a, b) { 145 if (a === b) { 146 return a; 147 } 148 const array = isPlainArray(a) && isPlainArray(b); 149 if (array || isPlainObject(a) && isPlainObject(b)) { 150 const aItems = array ? a : Object.keys(a); 151 const aSize = aItems.length; 152 const bItems = array ? b : Object.keys(b); 153 const bSize = bItems.length; 154 const copy = array ? [] : {}; 155 let equalItems = 0; 156 for (let i = 0; i < bSize; i++) { 157 const key = array ? i : bItems[i]; 158 if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) { 159 copy[key] = void 0; 160 equalItems++; 161 } else { 162 copy[key] = replaceEqualDeep(a[key], b[key]); 163 if (copy[key] === a[key] && a[key] !== void 0) { 164 equalItems++; 165 } 166 } 167 } 168 return aSize === bSize && equalItems === aSize ? a : copy; 169 } 170 return b; 171} 172function shallowEqualObjects(a, b) { 173 if (!b || Object.keys(a).length !== Object.keys(b).length) { 174 return false; 175 } 176 for (const key in a) { 177 if (a[key] !== b[key]) { 178 return false; 179 } 180 } 181 return true; 182} 183function isPlainArray(value) { 184 return Array.isArray(value) && value.length === Object.keys(value).length; 185} 186function isPlainObject(o) { 187 if (!hasObjectPrototype(o)) { 188 return false; 189 } 190 const ctor = o.constructor; 191 if (ctor === void 0) { 192 return true; 193 } 194 const prot = ctor.prototype; 195 if (!hasObjectPrototype(prot)) { 196 return false; 197 } 198 if (!prot.hasOwnProperty("isPrototypeOf")) { 199 return false; 200 } 201 if (Object.getPrototypeOf(o) !== Object.prototype) { 202 return false; 203 } 204 return true; 205} 206function hasObjectPrototype(o) { 207 return Object.prototype.toString.call(o) === "[object Object]"; 208} 209function sleep(timeout) { 210 return new Promise((resolve) => { 211 setTimeout(resolve, timeout); 212 }); 213} 214function replaceData(prevData, data, options) { 215 if (typeof options.structuralSharing === "function") { 216 return options.structuralSharing(prevData, data); 217 } else if (options.structuralSharing !== false) { 218 if (true) { 219 try { 220 return replaceEqualDeep(prevData, data); 221 } catch (error) { 222 console.error( 223 `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` 224 ); 225 } 226 } 227 return replaceEqualDeep(prevData, data); 228 } 229 return data; 230} 231function keepPreviousData(previousData) { 232 return previousData; 233} 234function addToEnd(items, item, max = 0) { 235 const newItems = [...items, item]; 236 return max && newItems.length > max ? newItems.slice(1) : newItems; 237} 238function addToStart(items, item, max = 0) { 239 const newItems = [item, ...items]; 240 return max && newItems.length > max ? newItems.slice(0, -1) : newItems; 241} 242var skipToken = Symbol(); 243function ensureQueryFn(options, fetchOptions) { 244 if (true) { 245 if (options.queryFn === skipToken) { 246 console.error( 247 `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` 248 ); 249 } 250 } 251 if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { 252 return () => fetchOptions.initialPromise; 253 } 254 if (!options.queryFn || options.queryFn === skipToken) { 255 return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); 256 } 257 return options.queryFn; 258} 259
vendor: 1,988 bytes, lines 260-325
260// node_modules/@tanstack/query-core/build/modern/focusManager.js 261var _focused, _cleanup, _setup, _a; 262var FocusManager = (_a = class extends Subscribable { 263 constructor() { 264 super(); 265 __privateAdd(this, _focused); 266 __privateAdd(this, _cleanup); 267 __privateAdd(this, _setup); 268 __privateSet(this, _setup, (onFocus) => { 269 if (!isServer && window.addEventListener) { 270 const listener = () => onFocus(); 271 window.addEventListener("visibilitychange", listener, false); 272 return () => { 273 window.removeEventListener("visibilitychange", listener); 274 }; 275 } 276 return; 277 }); 278 } 279 onSubscribe() { 280 if (!__privateGet(this, _cleanup)) { 281 this.setEventListener(__privateGet(this, _setup)); 282 } 283 } 284 onUnsubscribe() { 285 var _a12; 286 if (!this.hasListeners()) { 287 (_a12 = __privateGet(this, _cleanup)) == null ? void 0 : _a12.call(this); 288 __privateSet(this, _cleanup, void 0); 289 } 290 } 291 setEventListener(setup) { 292 var _a12; 293 __privateSet(this, _setup, setup); 294 (_a12 = __privateGet(this, _cleanup)) == null ? void 0 : _a12.call(this); 295 __privateSet(this, _cleanup, setup((focused) => { 296 if (typeof focused === "boolean") { 297 this.setFocused(focused); 298 } else { 299 this.onFocus(); 300 } 301 })); 302 } 303 setFocused(focused) { 304 const changed = __privateGet(this, _focused) !== focused; 305 if (changed) { 306 __privateSet(this, _focused, focused); 307 this.onFocus(); 308 } 309 } 310 onFocus() { 311 const isFocused = this.isFocused(); 312 this.listeners.forEach((listener) => { 313 listener(isFocused); 314 }); 315 } 316 isFocused() { 317 var _a12; 318 if (typeof __privateGet(this, _focused) === "boolean") { 319 return __privateGet(this, _focused); 320 } 321 return ((_a12 = globalThis.document) == null ? void 0 : _a12.visibilityState) !== "hidden"; 322 } 323}, _focused = new WeakMap(), _cleanup = new WeakMap(), _setup = new WeakMap(), _a); 324var focusManager = new FocusManager(); 325
vendor: 1,823 bytes, lines 326-380
326// node_modules/@tanstack/query-core/build/modern/onlineManager.js 327var _online, _cleanup2, _setup2, _a2; 328var OnlineManager = (_a2 = class extends Subscribable { 329 constructor() { 330 super(); 331 __privateAdd(this, _online, true); 332 __privateAdd(this, _cleanup2); 333 __privateAdd(this, _setup2); 334 __privateSet(this, _setup2, (onOnline) => { 335 if (!isServer && window.addEventListener) { 336 const onlineListener = () => onOnline(true); 337 const offlineListener = () => onOnline(false); 338 window.addEventListener("online", onlineListener, false); 339 window.addEventListener("offline", offlineListener, false); 340 return () => { 341 window.removeEventListener("online", onlineListener); 342 window.removeEventListener("offline", offlineListener); 343 }; 344 } 345 return; 346 }); 347 } 348 onSubscribe() { 349 if (!__privateGet(this, _cleanup2)) { 350 this.setEventListener(__privateGet(this, _setup2)); 351 } 352 } 353 onUnsubscribe() { 354 var _a12; 355 if (!this.hasListeners()) { 356 (_a12 = __privateGet(this, _cleanup2)) == null ? void 0 : _a12.call(this); 357 __privateSet(this, _cleanup2, void 0); 358 } 359 } 360 setEventListener(setup) { 361 var _a12; 362 __privateSet(this, _setup2, setup); 363 (_a12 = __privateGet(this, _cleanup2)) == null ? void 0 : _a12.call(this); 364 __privateSet(this, _cleanup2, setup(this.setOnline.bind(this))); 365 } 366 setOnline(online) { 367 const changed = __privateGet(this, _online) !== online; 368 if (changed) { 369 __privateSet(this, _online, online); 370 this.listeners.forEach((listener) => { 371 listener(online); 372 }); 373 } 374 } 375 isOnline() { 376 return __privateGet(this, _online); 377 } 378}, _online = new WeakMap(), _cleanup2 = new WeakMap(), _setup2 = new WeakMap(), _a2); 379var onlineManager = new OnlineManager(); 380
vendor: 678 bytes, lines 381-413
381// node_modules/@tanstack/query-core/build/modern/thenable.js 382function pendingThenable() { 383 let resolve; 384 let reject; 385 const thenable = new Promise((_resolve, _reject) => { 386 resolve = _resolve; 387 reject = _reject; 388 }); 389 thenable.status = "pending"; 390 thenable.catch(() => { 391 }); 392 function finalize(data) { 393 Object.assign(thenable, data); 394 delete thenable.resolve; 395 delete thenable.reject; 396 } 397 thenable.resolve = (value) => { 398 finalize({ 399 status: "fulfilled", 400 value 401 }); 402 resolve(value); 403 }; 404 thenable.reject = (reason) => { 405 finalize({ 406 status: "rejected", 407 reason 408 }); 409 reject(reason); 410 }; 411 return thenable; 412} 413
vendor: 3,867 bytes, lines 414-544
414// node_modules/@tanstack/query-core/build/modern/retryer.js 415function defaultRetryDelay(failureCount) { 416 return Math.min(1e3 * 2 ** failureCount, 3e4); 417} 418function canFetch(networkMode) { 419 return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; 420} 421var CancelledError = class extends Error { 422 constructor(options) { 423 super("CancelledError"); 424 this.revert = options == null ? void 0 : options.revert; 425 this.silent = options == null ? void 0 : options.silent; 426 } 427}; 428function isCancelledError(value) { 429 return value instanceof CancelledError; 430} 431function createRetryer(config) { 432 let isRetryCancelled = false; 433 let failureCount = 0; 434 let isResolved = false; 435 let continueFn; 436 const thenable = pendingThenable(); 437 const cancel = (cancelOptions) => { 438 var _a12; 439 if (!isResolved) { 440 reject(new CancelledError(cancelOptions)); 441 (_a12 = config.abort) == null ? void 0 : _a12.call(config); 442 } 443 }; 444 const cancelRetry = () => { 445 isRetryCancelled = true; 446 }; 447 const continueRetry = () => { 448 isRetryCancelled = false; 449 }; 450 const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); 451 const canStart = () => canFetch(config.networkMode) && config.canRun(); 452 const resolve = (value) => { 453 var _a12; 454 if (!isResolved) { 455 isResolved = true; 456 (_a12 = config.onSuccess) == null ? void 0 : _a12.call(config, value); 457 continueFn == null ? void 0 : continueFn(); 458 thenable.resolve(value); 459 } 460 }; 461 const reject = (value) => { 462 var _a12; 463 if (!isResolved) { 464 isResolved = true; 465 (_a12 = config.onError) == null ? void 0 : _a12.call(config, value); 466 continueFn == null ? void 0 : continueFn(); 467 thenable.reject(value); 468 } 469 }; 470 const pause = () => { 471 return new Promise((continueResolve) => { 472 var _a12; 473 continueFn = (value) => { 474 if (isResolved || canContinue()) { 475 continueResolve(value); 476 } 477 }; 478 (_a12 = config.onPause) == null ? void 0 : _a12.call(config); 479 }).then(() => { 480 var _a12; 481 continueFn = void 0; 482 if (!isResolved) { 483 (_a12 = config.onContinue) == null ? void 0 : _a12.call(config); 484 } 485 }); 486 }; 487 const run = () => { 488 if (isResolved) { 489 return; 490 } 491 let promiseOrValue; 492 const initialPromise = failureCount === 0 ? config.initialPromise : void 0; 493 try { 494 promiseOrValue = initialPromise ?? config.fn(); 495 } catch (error) { 496 promiseOrValue = Promise.reject(error); 497 } 498 Promise.resolve(promiseOrValue).then(resolve).catch((error) => { 499 var _a12; 500 if (isResolved) { 501 return; 502 } 503 const retry = config.retry ?? (isServer ? 0 : 3); 504 const retryDelay = config.retryDelay ?? defaultRetryDelay; 505 const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; 506 const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); 507 if (isRetryCancelled || !shouldRetry) { 508 reject(error); 509 return; 510 } 511 failureCount++; 512 (_a12 = config.onFail) == null ? void 0 : _a12.call(config, failureCount, error); 513 sleep(delay).then(() => { 514 return canContinue() ? void 0 : pause(); 515 }).then(() => { 516 if (isRetryCancelled) { 517 reject(error); 518 } else { 519 run(); 520 } 521 }); 522 }); 523 }; 524 return { 525 promise: thenable, 526 cancel, 527 continue: () => { 528 continueFn == null ? void 0 : continueFn(); 529 return thenable; 530 }, 531 cancelRetry, 532 continueRetry, 533 canStart, 534 start: () => { 535 if (canStart()) { 536 run(); 537 } else { 538 pause().then(run); 539 } 540 return thenable; 541 } 542 }; 543} 544
vendor: 1,867 bytes, lines 545-623
545// node_modules/@tanstack/query-core/build/modern/notifyManager.js 546function createNotifyManager() { 547 let queue = []; 548 let transactions = 0; 549 let notifyFn = (callback) => { 550 callback(); 551 }; 552 let batchNotifyFn = (callback) => { 553 callback(); 554 }; 555 let scheduleFn = (cb) => setTimeout(cb, 0); 556 const schedule = (callback) => { 557 if (transactions) { 558 queue.push(callback); 559 } else { 560 scheduleFn(() => { 561 notifyFn(callback); 562 }); 563 } 564 }; 565 const flush = () => { 566 const originalQueue = queue; 567 queue = []; 568 if (originalQueue.length) { 569 scheduleFn(() => { 570 batchNotifyFn(() => { 571 originalQueue.forEach((callback) => { 572 notifyFn(callback); 573 }); 574 }); 575 }); 576 } 577 }; 578 return { 579 batch: (callback) => { 580 let result; 581 transactions++; 582 try { 583 result = callback(); 584 } finally { 585 transactions--; 586 if (!transactions) { 587 flush(); 588 } 589 } 590 return result; 591 }, 592 /** 593 * All calls to the wrapped function will be batched. 594 */ 595 batchCalls: (callback) => { 596 return (...args) => { 597 schedule(() => { 598 callback(...args); 599 }); 600 }; 601 }, 602 schedule, 603 /** 604 * Use this method to set a custom notify function. 605 * This can be used to for example wrap notifications with `React.act` while running tests. 606 */ 607 setNotifyFunction: (fn) => { 608 notifyFn = fn; 609 }, 610 /** 611 * Use this method to set a custom function to batch notifications together into a single tick. 612 * By default React Query will use the batch function provided by ReactDOM or React Native. 613 */ 614 setBatchNotifyFunction: (fn) => { 615 batchNotifyFn = fn; 616 }, 617 setScheduler: (fn) => { 618 scheduleFn = fn; 619 } 620 }; 621} 622var notifyManager = createNotifyManager(); 623
vendor: 778 bytes, lines 624-654
624// node_modules/@tanstack/query-core/build/modern/removable.js 625var _gcTimeout, _a3; 626var Removable = (_a3 = class { 627 constructor() { 628 __privateAdd(this, _gcTimeout); 629 } 630 destroy() { 631 this.clearGcTimeout(); 632 } 633 scheduleGc() { 634 this.clearGcTimeout(); 635 if (isValidTimeout(this.gcTime)) { 636 __privateSet(this, _gcTimeout, setTimeout(() => { 637 this.optionalRemove(); 638 }, this.gcTime)); 639 } 640 } 641 updateGcTime(newGcTime) { 642 this.gcTime = Math.max( 643 this.gcTime || 0, 644 newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) 645 ); 646 } 647 clearGcTimeout() { 648 if (__privateGet(this, _gcTimeout)) { 649 clearTimeout(__privateGet(this, _gcTimeout)); 650 __privateSet(this, _gcTimeout, void 0); 651 } 652 } 653}, _gcTimeout = new WeakMap(), _a3); 654
vendor: 12,769 bytes, lines 655-1033
655// node_modules/@tanstack/query-core/build/modern/query.js 656var _initialState, _revertState, _cache, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _a4; 657var Query = (_a4 = class extends Removable { 658 constructor(config) { 659 super(); 660 __privateAdd(this, _Query_instances); 661 __privateAdd(this, _initialState); 662 __privateAdd(this, _revertState); 663 __privateAdd(this, _cache); 664 __privateAdd(this, _retryer); 665 __privateAdd(this, _defaultOptions); 666 __privateAdd(this, _abortSignalConsumed); 667 __privateSet(this, _abortSignalConsumed, false); 668 __privateSet(this, _defaultOptions, config.defaultOptions); 669 this.setOptions(config.options); 670 this.observers = []; 671 __privateSet(this, _cache, config.cache); 672 this.queryKey = config.queryKey; 673 this.queryHash = config.queryHash; 674 __privateSet(this, _initialState, getDefaultState(this.options)); 675 this.state = config.state ?? __privateGet(this, _initialState); 676 this.scheduleGc(); 677 } 678 get meta() { 679 return this.options.meta; 680 } 681 get promise() { 682 var _a12; 683 return (_a12 = __privateGet(this, _retryer)) == null ? void 0 : _a12.promise; 684 } 685 setOptions(options) { 686 this.options = { ...__privateGet(this, _defaultOptions), ...options }; 687 this.updateGcTime(this.options.gcTime); 688 } 689 optionalRemove() { 690 if (!this.observers.length && this.state.fetchStatus === "idle") { 691 __privateGet(this, _cache).remove(this); 692 } 693 } 694 setData(newData, options) { 695 const data = replaceData(this.state.data, newData, this.options); 696 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { 697 data, 698 type: "success", 699 dataUpdatedAt: options == null ? void 0 : options.updatedAt, 700 manual: options == null ? void 0 : options.manual 701 }); 702 return data; 703 } 704 setState(state, setStateOptions) { 705 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); 706 } 707 cancel(options) { 708 var _a12, _b; 709 const promise = (_a12 = __privateGet(this, _retryer)) == null ? void 0 : _a12.promise; 710 (_b = __privateGet(this, _retryer)) == null ? void 0 : _b.cancel(options); 711 return promise ? promise.then(noop).catch(noop) : Promise.resolve(); 712 } 713 destroy() { 714 super.destroy(); 715 this.cancel({ silent: true }); 716 } 717 reset() { 718 this.destroy(); 719 this.setState(__privateGet(this, _initialState)); 720 } 721 isActive() { 722 return this.observers.some( 723 (observer) => resolveEnabled(observer.options.enabled, this) !== false 724 ); 725 } 726 isDisabled() { 727 if (this.getObserversCount() > 0) { 728 return !this.isActive(); 729 } 730 return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; 731 } 732 isStale() { 733 if (this.state.isInvalidated) { 734 return true; 735 } 736 if (this.getObserversCount() > 0) { 737 return this.observers.some( 738 (observer) => observer.getCurrentResult().isStale 739 ); 740 } 741 return this.state.data === void 0; 742 } 743 isStaleByTime(staleTime = 0) { 744 return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime); 745 } 746 onFocus() { 747 var _a12; 748 const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); 749 observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); 750 (_a12 = __privateGet(this, _retryer)) == null ? void 0 : _a12.continue(); 751 } 752 onOnline() { 753 var _a12; 754 const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); 755 observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); 756 (_a12 = __privateGet(this, _retryer)) == null ? void 0 : _a12.continue(); 757 } 758 addObserver(observer) { 759 if (!this.observers.includes(observer)) { 760 this.observers.push(observer); 761 this.clearGcTimeout(); 762 __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); 763 } 764 } 765 removeObserver(observer) { 766 if (this.observers.includes(observer)) { 767 this.observers = this.observers.filter((x) => x !== observer); 768 if (!this.observers.length) { 769 if (__privateGet(this, _retryer)) { 770 if (__privateGet(this, _abortSignalConsumed)) { 771 __privateGet(this, _retryer).cancel({ revert: true }); 772 } else { 773 __privateGet(this, _retryer).cancelRetry(); 774 } 775 } 776 this.scheduleGc(); 777 } 778 __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); 779 } 780 } 781 getObserversCount() { 782 return this.observers.length; 783 } 784 invalidate() { 785 if (!this.state.isInvalidated) { 786 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "invalidate" }); 787 } 788 } 789 fetch(options, fetchOptions) { 790 var _a12, _b, _c; 791 if (this.state.fetchStatus !== "idle") { 792 if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { 793 this.cancel({ silent: true }); 794 } else if (__privateGet(this, _retryer)) { 795 __privateGet(this, _retryer).continueRetry(); 796 return __privateGet(this, _retryer).promise; 797 } 798 } 799 if (options) { 800 this.setOptions(options); 801 } 802 if (!this.options.queryFn) { 803 const observer = this.observers.find((x) => x.options.queryFn); 804 if (observer) { 805 this.setOptions(observer.options); 806 } 807 } 808 if (true) { 809 if (!Array.isArray(this.options.queryKey)) { 810 console.error( 811 `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']` 812 ); 813 } 814 } 815 const abortController = new AbortController(); 816 const addSignalProperty = (object) => { 817 Object.defineProperty(object, "signal", { 818 enumerable: true, 819 get: () => { 820 __privateSet(this, _abortSignalConsumed, true); 821 return abortController.signal; 822 } 823 }); 824 }; 825 const fetchFn = () => { 826 const queryFn = ensureQueryFn(this.options, fetchOptions); 827 const queryFnContext = { 828 queryKey: this.queryKey, 829 meta: this.meta 830 }; 831 addSignalProperty(queryFnContext); 832 __privateSet(this, _abortSignalConsumed, false); 833 if (this.options.persister) { 834 return this.options.persister( 835 queryFn, 836 queryFnContext, 837 this 838 ); 839 } 840 return queryFn(queryFnContext); 841 }; 842 const context = { 843 fetchOptions, 844 options: this.options, 845 queryKey: this.queryKey, 846 state: this.state, 847 fetchFn 848 }; 849 addSignalProperty(context); 850 (_a12 = this.options.behavior) == null ? void 0 : _a12.onFetch( 851 context, 852 this 853 ); 854 __privateSet(this, _revertState, this.state); 855 if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_b = context.fetchOptions) == null ? void 0 : _b.meta)) { 856 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "fetch", meta: (_c = context.fetchOptions) == null ? void 0 : _c.meta }); 857 } 858 const onError = (error) => { 859 var _a13, _b2, _c2, _d; 860 if (!(isCancelledError(error) && error.silent)) { 861 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { 862 type: "error", 863 error 864 }); 865 } 866 if (!isCancelledError(error)) { 867 (_b2 = (_a13 = __privateGet(this, _cache).config).onError) == null ? void 0 : _b2.call( 868 _a13, 869 error, 870 this 871 ); 872 (_d = (_c2 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d.call( 873 _c2, 874 this.state.data, 875 error, 876 this 877 ); 878 } 879 this.scheduleGc(); 880 }; 881 __privateSet(this, _retryer, createRetryer({ 882 initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, 883 fn: context.fetchFn, 884 abort: abortController.abort.bind(abortController), 885 onSuccess: (data) => { 886 var _a13, _b2, _c2, _d; 887 if (data === void 0) { 888 if (true) { 889 console.error( 890 `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` 891 ); 892 } 893 onError(new Error(`${this.queryHash} data is undefined`)); 894 return; 895 } 896 try { 897 this.setData(data); 898 } catch (error) { 899 onError(error); 900 return; 901 } 902 (_b2 = (_a13 = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _b2.call(_a13, data, this); 903 (_d = (_c2 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d.call( 904 _c2, 905 data, 906 this.state.error, 907 this 908 ); 909 this.scheduleGc(); 910 }, 911 onError, 912 onFail: (failureCount, error) => { 913 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); 914 }, 915 onPause: () => { 916 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "pause" }); 917 }, 918 onContinue: () => { 919 __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "continue" }); 920 }, 921 retry: context.options.retry, 922 retryDelay: context.options.retryDelay, 923 networkMode: context.options.networkMode, 924 canRun: () => true 925 })); 926 return __privateGet(this, _retryer).start(); 927 } 928}, _initialState = new WeakMap(), _revertState = new WeakMap(), _cache = new WeakMap(), _retryer = new WeakMap(), _defaultOptions = new WeakMap(), _abortSignalConsumed = new WeakMap(), _Query_instances = new WeakSet(), dispatch_fn = function(action) { 929 const reducer = (state) => { 930 switch (action.type) { 931 case "failed": 932 return { 933 ...state, 934 fetchFailureCount: action.failureCount, 935 fetchFailureReason: action.error 936 }; 937 case "pause": 938 return { 939 ...state, 940 fetchStatus: "paused" 941 }; 942 case "continue": 943 return { 944 ...state, 945 fetchStatus: "fetching" 946 }; 947 case "fetch": 948 return { 949 ...state, 950 ...fetchState(state.data, this.options), 951 fetchMeta: action.meta ?? null 952 }; 953 case "success": 954 return { 955 ...state, 956 data: action.data, 957 dataUpdateCount: state.dataUpdateCount + 1, 958 dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), 959 error: null, 960 isInvalidated: false, 961 status: "success", 962 ...!action.manual && { 963 fetchStatus: "idle", 964 fetchFailureCount: 0, 965 fetchFailureReason: null 966 } 967 }; 968 case "error": 969 const error = action.error; 970 if (isCancelledError(error) && error.revert && __privateGet(this, _revertState)) { 971 return { ...__privateGet(this, _revertState), fetchStatus: "idle" }; 972 } 973 return { 974 ...state, 975 error, 976 errorUpdateCount: state.errorUpdateCount + 1, 977 errorUpdatedAt: Date.now(), 978 fetchFailureCount: state.fetchFailureCount + 1, 979 fetchFailureReason: error, 980 fetchStatus: "idle", 981 status: "error" 982 }; 983 case "invalidate": 984 return { 985 ...state, 986 isInvalidated: true 987 }; 988 case "setState": 989 return { 990 ...state, 991 ...action.state 992 }; 993 } 994 }; 995 this.state = reducer(this.state); 996 notifyManager.batch(() => { 997 this.observers.forEach((observer) => { 998 observer.onQueryUpdate(); 999 }); 1000 __privateGet(this, _cache).notify({ query: this, type: "updated", action }); 1001 }); 1002}, _a4); 1003function fetchState(data, options) { 1004 return { 1005 fetchFailureCount: 0, 1006 fetchFailureReason: null, 1007 fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", 1008 ...data === void 0 && { 1009 error: null, 1010 status: "pending" 1011 } 1012 }; 1013} 1014function getDefaultState(options) { 1015 const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; 1016 const hasData = data !== void 0; 1017 const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; 1018 return { 1019 data, 1020 dataUpdateCount: 0, 1021 dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, 1022 error: null, 1023 errorUpdateCount: 0, 1024 errorUpdatedAt: 0, 1025 fetchFailureCount: 0, 1026 fetchFailureReason: null, 1027 fetchMeta: null, 1028 isInvalidated: false, 1029 status: hasData ? "success" : "pending", 1030 fetchStatus: "idle" 1031 }; 1032} 1033
vendor: 2,384 bytes, lines 1034-1124
1034// node_modules/@tanstack/query-core/build/modern/queryCache.js 1035var _queries, _a5; 1036var QueryCache = (_a5 = class extends Subscribable { 1037 constructor(config = {}) { 1038 super(); 1039 __privateAdd(this, _queries); 1040 this.config = config; 1041 __privateSet(this, _queries, /* @__PURE__ */ new Map()); 1042 } 1043 build(client, options, state) { 1044 const queryKey = options.queryKey; 1045 const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); 1046 let query = this.get(queryHash); 1047 if (!query) { 1048 query = new Query({ 1049 cache: this, 1050 queryKey, 1051 queryHash, 1052 options: client.defaultQueryOptions(options), 1053 state, 1054 defaultOptions: client.getQueryDefaults(queryKey) 1055 }); 1056 this.add(query); 1057 } 1058 return query; 1059 } 1060 add(query) { 1061 if (!__privateGet(this, _queries).has(query.queryHash)) { 1062 __privateGet(this, _queries).set(query.queryHash, query); 1063 this.notify({ 1064 type: "added", 1065 query 1066 }); 1067 } 1068 } 1069 remove(query) { 1070 const queryInMap = __privateGet(this, _queries).get(query.queryHash); 1071 if (queryInMap) { 1072 query.destroy(); 1073 if (queryInMap === query) { 1074 __privateGet(this, _queries).delete(query.queryHash); 1075 } 1076 this.notify({ type: "removed", query }); 1077 } 1078 } 1079 clear() { 1080 notifyManager.batch(() => { 1081 this.getAll().forEach((query) => { 1082 this.remove(query); 1083 }); 1084 }); 1085 } 1086 get(queryHash) { 1087 return __privateGet(this, _queries).get(queryHash); 1088 } 1089 getAll() { 1090 return [...__privateGet(this, _queries).values()]; 1091 } 1092 find(filters) { 1093 const defaultedFilters = { exact: true, ...filters }; 1094 return this.getAll().find( 1095 (query) => matchQuery(defaultedFilters, query) 1096 ); 1097 } 1098 findAll(filters = {}) { 1099 const queries = this.getAll(); 1100 return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; 1101 } 1102 notify(event) { 1103 notifyManager.batch(() => { 1104 this.listeners.forEach((listener) => { 1105 listener(event); 1106 }); 1107 }); 1108 } 1109 onFocus() { 1110 notifyManager.batch(() => { 1111 this.getAll().forEach((query) => { 1112 query.onFocus(); 1113 }); 1114 }); 1115 } 1116 onOnline() { 1117 notifyManager.batch(() => { 1118 this.getAll().forEach((query) => { 1119 query.onOnline(); 1120 }); 1121 }); 1122 } 1123}, _queries = new WeakMap(), _a5); 1124
vendor: 7,593 bytes, lines 1125-1362
1125// node_modules/@tanstack/query-core/build/modern/mutation.js 1126var _observers, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _a6; 1127var Mutation = (_a6 = class extends Removable { 1128 constructor(config) { 1129 super(); 1130 __privateAdd(this, _Mutation_instances); 1131 __privateAdd(this, _observers); 1132 __privateAdd(this, _mutationCache); 1133 __privateAdd(this, _retryer2); 1134 this.mutationId = config.mutationId; 1135 __privateSet(this, _mutationCache, config.mutationCache); 1136 __privateSet(this, _observers, []); 1137 this.state = config.state || getDefaultState2(); 1138 this.setOptions(config.options); 1139 this.scheduleGc(); 1140 } 1141 setOptions(options) { 1142 this.options = options; 1143 this.updateGcTime(this.options.gcTime); 1144 } 1145 get meta() { 1146 return this.options.meta; 1147 } 1148 addObserver(observer) { 1149 if (!__privateGet(this, _observers).includes(observer)) { 1150 __privateGet(this, _observers).push(observer); 1151 this.clearGcTimeout(); 1152 __privateGet(this, _mutationCache).notify({ 1153 type: "observerAdded", 1154 mutation: this, 1155 observer 1156 }); 1157 } 1158 } 1159 removeObserver(observer) { 1160 __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); 1161 this.scheduleGc(); 1162 __privateGet(this, _mutationCache).notify({ 1163 type: "observerRemoved", 1164 mutation: this, 1165 observer 1166 }); 1167 } 1168 optionalRemove() { 1169 if (!__privateGet(this, _observers).length) { 1170 if (this.state.status === "pending") { 1171 this.scheduleGc(); 1172 } else { 1173 __privateGet(this, _mutationCache).remove(this); 1174 } 1175 } 1176 } 1177 continue() { 1178 var _a12; 1179 return ((_a12 = __privateGet(this, _retryer2)) == null ? void 0 : _a12.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before 1180 this.execute(this.state.variables); 1181 } 1182 async execute(variables) { 1183 var _a12, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t; 1184 __privateSet(this, _retryer2, createRetryer({ 1185 fn: () => { 1186 if (!this.options.mutationFn) { 1187 return Promise.reject(new Error("No mutationFn found")); 1188 } 1189 return this.options.mutationFn(variables); 1190 }, 1191 onFail: (failureCount, error) => { 1192 __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "failed", failureCount, error }); 1193 }, 1194 onPause: () => { 1195 __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "pause" }); 1196 }, 1197 onContinue: () => { 1198 __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "continue" }); 1199 }, 1200 retry: this.options.retry ?? 0, 1201 retryDelay: this.options.retryDelay, 1202 networkMode: this.options.networkMode, 1203 canRun: () => __privateGet(this, _mutationCache).canRun(this) 1204 })); 1205 const restored = this.state.status === "pending"; 1206 const isPaused = !__privateGet(this, _retryer2).canStart(); 1207 try { 1208 if (!restored) { 1209 __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "pending", variables, isPaused }); 1210 await ((_b = (_a12 = __privateGet(this, _mutationCache).config).onMutate) == null ? void 0 : _b.call( 1211 _a12, 1212 variables, 1213 this 1214 )); 1215 const context = await ((_d = (_c = this.options).onMutate) == null ? void 0 : _d.call(_c, variables)); 1216 if (context !== this.state.context) { 1217 __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { 1218 type: "pending", 1219 context, 1220 variables, 1221 isPaused 1222 }); 1223 } 1224 } 1225 const data = await __privateGet(this, _retryer2).start(); 1226 await ((_f = (_e = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _f.call( 1227 _e, 1228 data, 1229 variables, 1230 this.state.context, 1231 this 1232 )); 1233 await ((_h = (_g = this.options).onSuccess) == null ? void 0 : _h.call(_g, data, variables, this.state.context)); 1234 await ((_j = (_i = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _j.call( 1235 _i, 1236 data, 1237 null, 1238 this.state.variables, 1239 this.state.context, 1240 this 1241 )); 1242 await ((_l = (_k = this.options).onSettled) == null ? void 0 : _l.call(_k, data, null, variables, this.state.context)); 1243 __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "success", data }); 1244 return data; 1245 } catch (error) { 1246 try { 1247 await ((_n = (_m = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _n.call( 1248 _m, 1249 error, 1250 variables, 1251 this.state.context, 1252 this 1253 )); 1254 await ((_p = (_o = this.options).onError) == null ? void 0 : _p.call( 1255 _o, 1256 error, 1257 variables, 1258 this.state.context 1259 )); 1260 await ((_r = (_q = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _r.call( 1261 _q, 1262 void 0, 1263 error, 1264 this.state.variables, 1265 this.state.context, 1266 this 1267 )); 1268 await ((_t = (_s = this.options).onSettled) == null ? void 0 : _t.call( 1269 _s, 1270 void 0, 1271 error, 1272 variables, 1273 this.state.context 1274 )); 1275 throw error; 1276 } finally { 1277 __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "error", error }); 1278 } 1279 } finally { 1280 __privateGet(this, _mutationCache).runNext(this); 1281 } 1282 } 1283}, _observers = new WeakMap(), _mutationCache = new WeakMap(), _retryer2 = new WeakMap(), _Mutation_instances = new WeakSet(), dispatch_fn2 = function(action) { 1284 const reducer = (state) => { 1285 switch (action.type) { 1286 case "failed": 1287 return { 1288 ...state, 1289 failureCount: action.failureCount, 1290 failureReason: action.error 1291 }; 1292 case "pause": 1293 return { 1294 ...state, 1295 isPaused: true 1296 }; 1297 case "continue": 1298 return { 1299 ...state, 1300 isPaused: false 1301 }; 1302 case "pending": 1303 return { 1304 ...state, 1305 context: action.context, 1306 data: void 0, 1307 failureCount: 0, 1308 failureReason: null, 1309 error: null, 1310 isPaused: action.isPaused, 1311 status: "pending", 1312 variables: action.variables, 1313 submittedAt: Date.now() 1314 }; 1315 case "success": 1316 return { 1317 ...state, 1318 data: action.data, 1319 failureCount: 0, 1320 failureReason: null, 1321 error: null, 1322 status: "success", 1323 isPaused: false 1324 }; 1325 case "error": 1326 return { 1327 ...state, 1328 data: void 0, 1329 error: action.error, 1330 failureCount: state.failureCount + 1, 1331 failureReason: action.error, 1332 isPaused: false, 1333 status: "error" 1334 }; 1335 } 1336 }; 1337 this.state = reducer(this.state); 1338 notifyManager.batch(() => { 1339 __privateGet(this, _observers).forEach((observer) => { 1340 observer.onMutationUpdate(action); 1341 }); 1342 __privateGet(this, _mutationCache).notify({ 1343 mutation: this, 1344 type: "updated", 1345 action 1346 }); 1347 }); 1348}, _a6); 1349function getDefaultState2() { 1350 return { 1351 context: void 0, 1352 data: void 0, 1353 error: null, 1354 failureCount: 0, 1355 failureReason: null, 1356 isPaused: false, 1357 status: "idle", 1358 variables: void 0, 1359 submittedAt: 0 1360 }; 1361} 1362
vendor: 3,181 bytes, lines 1363-1455
1363// node_modules/@tanstack/query-core/build/modern/mutationCache.js 1364var _mutations, _mutationId, _a7; 1365var MutationCache = (_a7 = class extends Subscribable { 1366 constructor(config = {}) { 1367 super(); 1368 __privateAdd(this, _mutations); 1369 __privateAdd(this, _mutationId); 1370 this.config = config; 1371 __privateSet(this, _mutations, /* @__PURE__ */ new Map()); 1372 __privateSet(this, _mutationId, Date.now()); 1373 } 1374 build(client, options, state) { 1375 const mutation = new Mutation({ 1376 mutationCache: this, 1377 mutationId: ++__privateWrapper(this, _mutationId)._, 1378 options: client.defaultMutationOptions(options), 1379 state 1380 }); 1381 this.add(mutation); 1382 return mutation; 1383 } 1384 add(mutation) { 1385 const scope = scopeFor(mutation); 1386 const mutations = __privateGet(this, _mutations).get(scope) ?? []; 1387 mutations.push(mutation); 1388 __privateGet(this, _mutations).set(scope, mutations); 1389 this.notify({ type: "added", mutation }); 1390 } 1391 remove(mutation) { 1392 var _a12; 1393 const scope = scopeFor(mutation); 1394 if (__privateGet(this, _mutations).has(scope)) { 1395 const mutations = (_a12 = __privateGet(this, _mutations).get(scope)) == null ? void 0 : _a12.filter((x) => x !== mutation); 1396 if (mutations) { 1397 if (mutations.length === 0) { 1398 __privateGet(this, _mutations).delete(scope); 1399 } else { 1400 __privateGet(this, _mutations).set(scope, mutations); 1401 } 1402 } 1403 } 1404 this.notify({ type: "removed", mutation }); 1405 } 1406 canRun(mutation) { 1407 var _a12; 1408 const firstPendingMutation = (_a12 = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a12.find((m) => m.state.status === "pending"); 1409 return !firstPendingMutation || firstPendingMutation === mutation; 1410 } 1411 runNext(mutation) { 1412 var _a12; 1413 const foundMutation = (_a12 = __privateGet(this, _mutations).get(scopeFor(mutation))) == null ? void 0 : _a12.find((m) => m !== mutation && m.state.isPaused); 1414 return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); 1415 } 1416 clear() { 1417 notifyManager.batch(() => { 1418 this.getAll().forEach((mutation) => { 1419 this.remove(mutation); 1420 }); 1421 }); 1422 } 1423 getAll() { 1424 return [...__privateGet(this, _mutations).values()].flat(); 1425 } 1426 find(filters) { 1427 const defaultedFilters = { exact: true, ...filters }; 1428 return this.getAll().find( 1429 (mutation) => matchMutation(defaultedFilters, mutation) 1430 ); 1431 } 1432 findAll(filters = {}) { 1433 return this.getAll().filter((mutation) => matchMutation(filters, mutation)); 1434 } 1435 notify(event) { 1436 notifyManager.batch(() => { 1437 this.listeners.forEach((listener) => { 1438 listener(event); 1439 }); 1440 }); 1441 } 1442 resumePausedMutations() { 1443 const pausedMutations = this.getAll().filter((x) => x.state.isPaused); 1444 return notifyManager.batch( 1445 () => Promise.all( 1446 pausedMutations.map((mutation) => mutation.continue().catch(noop)) 1447 ) 1448 ); 1449 } 1450}, _mutations = new WeakMap(), _mutationId = new WeakMap(), _a7); 1451function scopeFor(mutation) { 1452 var _a12; 1453 return ((_a12 = mutation.options.scope) == null ? void 0 : _a12.id) ?? String(mutation.mutationId); 1454} 1455
vendor: 4,249 bytes, lines 1456-1574
1456// node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js 1457function infiniteQueryBehavior(pages) { 1458 return { 1459 onFetch: (context, query) => { 1460 var _a12, _b, _c, _d, _e; 1461 const options = context.options; 1462 const direction = (_c = (_b = (_a12 = context.fetchOptions) == null ? void 0 : _a12.meta) == null ? void 0 : _b.fetchMore) == null ? void 0 : _c.direction; 1463 const oldPages = ((_d = context.state.data) == null ? void 0 : _d.pages) || []; 1464 const oldPageParams = ((_e = context.state.data) == null ? void 0 : _e.pageParams) || []; 1465 let result = { pages: [], pageParams: [] }; 1466 let currentPage = 0; 1467 const fetchFn = async () => { 1468 let cancelled = false; 1469 const addSignalProperty = (object) => { 1470 Object.defineProperty(object, "signal", { 1471 enumerable: true, 1472 get: () => { 1473 if (context.signal.aborted) { 1474 cancelled = true; 1475 } else { 1476 context.signal.addEventListener("abort", () => { 1477 cancelled = true; 1478 }); 1479 } 1480 return context.signal; 1481 } 1482 }); 1483 }; 1484 const queryFn = ensureQueryFn(context.options, context.fetchOptions); 1485 const fetchPage = async (data, param, previous) => { 1486 if (cancelled) { 1487 return Promise.reject(); 1488 } 1489 if (param == null && data.pages.length) { 1490 return Promise.resolve(data); 1491 } 1492 const queryFnContext = { 1493 queryKey: context.queryKey, 1494 pageParam: param, 1495 direction: previous ? "backward" : "forward", 1496 meta: context.options.meta 1497 }; 1498 addSignalProperty(queryFnContext); 1499 const page = await queryFn( 1500 queryFnContext 1501 ); 1502 const { maxPages } = context.options; 1503 const addTo = previous ? addToStart : addToEnd; 1504 return { 1505 pages: addTo(data.pages, page, maxPages), 1506 pageParams: addTo(data.pageParams, param, maxPages) 1507 }; 1508 }; 1509 if (direction && oldPages.length) { 1510 const previous = direction === "backward"; 1511 const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; 1512 const oldData = { 1513 pages: oldPages, 1514 pageParams: oldPageParams 1515 }; 1516 const param = pageParamFn(options, oldData); 1517 result = await fetchPage(oldData, param, previous); 1518 } else { 1519 const remainingPages = pages ?? oldPages.length; 1520 do { 1521 const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); 1522 if (currentPage > 0 && param == null) { 1523 break; 1524 } 1525 result = await fetchPage(result, param); 1526 currentPage++; 1527 } while (currentPage < remainingPages); 1528 } 1529 return result; 1530 }; 1531 if (context.options.persister) { 1532 context.fetchFn = () => { 1533 var _a13, _b2; 1534 return (_b2 = (_a13 = context.options).persister) == null ? void 0 : _b2.call( 1535 _a13, 1536 fetchFn, 1537 { 1538 queryKey: context.queryKey, 1539 meta: context.options.meta, 1540 signal: context.signal 1541 }, 1542 query 1543 ); 1544 }; 1545 } else { 1546 context.fetchFn = fetchFn; 1547 } 1548 } 1549 }; 1550} 1551function getNextPageParam(options, { pages, pageParams }) { 1552 const lastIndex = pages.length - 1; 1553 return pages.length > 0 ? options.getNextPageParam( 1554 pages[lastIndex], 1555 pages, 1556 pageParams[lastIndex], 1557 pageParams 1558 ) : void 0; 1559} 1560function getPreviousPageParam(options, { pages, pageParams }) { 1561 var _a12; 1562 return pages.length > 0 ? (_a12 = options.getPreviousPageParam) == null ? void 0 : _a12.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; 1563} 1564function hasNextPage(options, data) { 1565 if (!data) 1566 return false; 1567 return getNextPageParam(options, data) != null; 1568} 1569function hasPreviousPage(options, data) { 1570 if (!data || !options.getPreviousPageParam) 1571 return false; 1572 return getPreviousPageParam(options, data) != null; 1573} 1574
vendor: 10,369 bytes, lines 1575-1855
1575// node_modules/@tanstack/query-core/build/modern/queryClient.js 1576var _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _a8; 1577var QueryClient = (_a8 = class { 1578 constructor(config = {}) { 1579 __privateAdd(this, _queryCache); 1580 __privateAdd(this, _mutationCache2); 1581 __privateAdd(this, _defaultOptions2); 1582 __privateAdd(this, _queryDefaults); 1583 __privateAdd(this, _mutationDefaults); 1584 __privateAdd(this, _mountCount); 1585 __privateAdd(this, _unsubscribeFocus); 1586 __privateAdd(this, _unsubscribeOnline); 1587 __privateSet(this, _queryCache, config.queryCache || new QueryCache()); 1588 __privateSet(this, _mutationCache2, config.mutationCache || new MutationCache()); 1589 __privateSet(this, _defaultOptions2, config.defaultOptions || {}); 1590 __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); 1591 __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); 1592 __privateSet(this, _mountCount, 0); 1593 } 1594 mount() { 1595 __privateWrapper(this, _mountCount)._++; 1596 if (__privateGet(this, _mountCount) !== 1) 1597 return; 1598 __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => { 1599 if (focused) { 1600 await this.resumePausedMutations(); 1601 __privateGet(this, _queryCache).onFocus(); 1602 } 1603 })); 1604 __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => { 1605 if (online) { 1606 await this.resumePausedMutations(); 1607 __privateGet(this, _queryCache).onOnline(); 1608 } 1609 })); 1610 } 1611 unmount() { 1612 var _a12, _b; 1613 __privateWrapper(this, _mountCount)._--; 1614 if (__privateGet(this, _mountCount) !== 0) 1615 return; 1616 (_a12 = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a12.call(this); 1617 __privateSet(this, _unsubscribeFocus, void 0); 1618 (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); 1619 __privateSet(this, _unsubscribeOnline, void 0); 1620 } 1621 isFetching(filters) { 1622 return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; 1623 } 1624 isMutating(filters) { 1625 return __privateGet(this, _mutationCache2).findAll({ ...filters, status: "pending" }).length; 1626 } 1627 getQueryData(queryKey) { 1628 var _a12; 1629 const options = this.defaultQueryOptions({ queryKey }); 1630 return (_a12 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a12.state.data; 1631 } 1632 ensureQueryData(options) { 1633 const cachedData = this.getQueryData(options.queryKey); 1634 if (cachedData === void 0) 1635 return this.fetchQuery(options); 1636 else { 1637 const defaultedOptions = this.defaultQueryOptions(options); 1638 const query = __privateGet(this, _queryCache).build(this, defaultedOptions); 1639 if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { 1640 void this.prefetchQuery(defaultedOptions); 1641 } 1642 return Promise.resolve(cachedData); 1643 } 1644 } 1645 getQueriesData(filters) { 1646 return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { 1647 const data = state.data; 1648 return [queryKey, data]; 1649 }); 1650 } 1651 setQueryData(queryKey, updater, options) { 1652 const defaultedOptions = this.defaultQueryOptions({ queryKey }); 1653 const query = __privateGet(this, _queryCache).get( 1654 defaultedOptions.queryHash 1655 ); 1656 const prevData = query == null ? void 0 : query.state.data; 1657 const data = functionalUpdate(updater, prevData); 1658 if (data === void 0) { 1659 return void 0; 1660 } 1661 return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); 1662 } 1663 setQueriesData(filters, updater, options) { 1664 return notifyManager.batch( 1665 () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ 1666 queryKey, 1667 this.setQueryData(queryKey, updater, options) 1668 ]) 1669 ); 1670 } 1671 getQueryState(queryKey) { 1672 var _a12; 1673 const options = this.defaultQueryOptions({ queryKey }); 1674 return (_a12 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a12.state; 1675 } 1676 removeQueries(filters) { 1677 const queryCache = __privateGet(this, _queryCache); 1678 notifyManager.batch(() => { 1679 queryCache.findAll(filters).forEach((query) => { 1680 queryCache.remove(query); 1681 }); 1682 }); 1683 } 1684 resetQueries(filters, options) { 1685 const queryCache = __privateGet(this, _queryCache); 1686 const refetchFilters = { 1687 type: "active", 1688 ...filters 1689 }; 1690 return notifyManager.batch(() => { 1691 queryCache.findAll(filters).forEach((query) => { 1692 query.reset(); 1693 }); 1694 return this.refetchQueries(refetchFilters, options); 1695 }); 1696 } 1697 cancelQueries(filters = {}, cancelOptions = {}) { 1698 const defaultedCancelOptions = { revert: true, ...cancelOptions }; 1699 const promises = notifyManager.batch( 1700 () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) 1701 ); 1702 return Promise.all(promises).then(noop).catch(noop); 1703 } 1704 invalidateQueries(filters = {}, options = {}) { 1705 return notifyManager.batch(() => { 1706 __privateGet(this, _queryCache).findAll(filters).forEach((query) => { 1707 query.invalidate(); 1708 }); 1709 if (filters.refetchType === "none") { 1710 return Promise.resolve(); 1711 } 1712 const refetchFilters = { 1713 ...filters, 1714 type: filters.refetchType ?? filters.type ?? "active" 1715 }; 1716 return this.refetchQueries(refetchFilters, options); 1717 }); 1718 } 1719 refetchQueries(filters = {}, options) { 1720 const fetchOptions = { 1721 ...options, 1722 cancelRefetch: (options == null ? void 0 : options.cancelRefetch) ?? true 1723 }; 1724 const promises = notifyManager.batch( 1725 () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled()).map((query) => { 1726 let promise = query.fetch(void 0, fetchOptions); 1727 if (!fetchOptions.throwOnError) { 1728 promise = promise.catch(noop); 1729 } 1730 return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; 1731 }) 1732 ); 1733 return Promise.all(promises).then(noop); 1734 } 1735 fetchQuery(options) { 1736 const defaultedOptions = this.defaultQueryOptions(options); 1737 if (defaultedOptions.retry === void 0) { 1738 defaultedOptions.retry = false; 1739 } 1740 const query = __privateGet(this, _queryCache).build(this, defaultedOptions); 1741 return query.isStaleByTime( 1742 resolveStaleTime(defaultedOptions.staleTime, query) 1743 ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); 1744 } 1745 prefetchQuery(options) { 1746 return this.fetchQuery(options).then(noop).catch(noop); 1747 } 1748 fetchInfiniteQuery(options) { 1749 options.behavior = infiniteQueryBehavior(options.pages); 1750 return this.fetchQuery(options); 1751 } 1752 prefetchInfiniteQuery(options) { 1753 return this.fetchInfiniteQuery(options).then(noop).catch(noop); 1754 } 1755 ensureInfiniteQueryData(options) { 1756 options.behavior = infiniteQueryBehavior(options.pages); 1757 return this.ensureQueryData(options); 1758 } 1759 resumePausedMutations() { 1760 if (onlineManager.isOnline()) { 1761 return __privateGet(this, _mutationCache2).resumePausedMutations(); 1762 } 1763 return Promise.resolve(); 1764 } 1765 getQueryCache() { 1766 return __privateGet(this, _queryCache); 1767 } 1768 getMutationCache() { 1769 return __privateGet(this, _mutationCache2); 1770 } 1771 getDefaultOptions() { 1772 return __privateGet(this, _defaultOptions2); 1773 } 1774 setDefaultOptions(options) { 1775 __privateSet(this, _defaultOptions2, options); 1776 } 1777 setQueryDefaults(queryKey, options) { 1778 __privateGet(this, _queryDefaults).set(hashKey(queryKey), { 1779 queryKey, 1780 defaultOptions: options 1781 }); 1782 } 1783 getQueryDefaults(queryKey) { 1784 const defaults = [...__privateGet(this, _queryDefaults).values()]; 1785 let result = {}; 1786 defaults.forEach((queryDefault) => { 1787 if (partialMatchKey(queryKey, queryDefault.queryKey)) { 1788 result = { ...result, ...queryDefault.defaultOptions }; 1789 } 1790 }); 1791 return result; 1792 } 1793 setMutationDefaults(mutationKey, options) { 1794 __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), { 1795 mutationKey, 1796 defaultOptions: options 1797 }); 1798 } 1799 getMutationDefaults(mutationKey) { 1800 const defaults = [...__privateGet(this, _mutationDefaults).values()]; 1801 let result = {}; 1802 defaults.forEach((queryDefault) => { 1803 if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { 1804 result = { ...result, ...queryDefault.defaultOptions }; 1805 } 1806 }); 1807 return result; 1808 } 1809 defaultQueryOptions(options) { 1810 if (options._defaulted) { 1811 return options; 1812 } 1813 const defaultedOptions = { 1814 ...__privateGet(this, _defaultOptions2).queries, 1815 ...this.getQueryDefaults(options.queryKey), 1816 ...options, 1817 _defaulted: true 1818 }; 1819 if (!defaultedOptions.queryHash) { 1820 defaultedOptions.queryHash = hashQueryKeyByOptions( 1821 defaultedOptions.queryKey, 1822 defaultedOptions 1823 ); 1824 } 1825 if (defaultedOptions.refetchOnReconnect === void 0) { 1826 defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; 1827 } 1828 if (defaultedOptions.throwOnError === void 0) { 1829 defaultedOptions.throwOnError = !!defaultedOptions.suspense; 1830 } 1831 if (!defaultedOptions.networkMode && defaultedOptions.persister) { 1832 defaultedOptions.networkMode = "offlineFirst"; 1833 } 1834 if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) { 1835 defaultedOptions.enabled = false; 1836 } 1837 return defaultedOptions; 1838 } 1839 defaultMutationOptions(options) { 1840 if (options == null ? void 0 : options._defaulted) { 1841 return options; 1842 } 1843 return { 1844 ...__privateGet(this, _defaultOptions2).mutations, 1845 ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), 1846 ...options, 1847 _defaulted: true 1848 }; 1849 } 1850 clear() { 1851 __privateGet(this, _queryCache).clear(); 1852 __privateGet(this, _mutationCache2).clear(); 1853 } 1854}, _queryCache = new WeakMap(), _mutationCache2 = new WeakMap(), _defaultOptions2 = new WeakMap(), _queryDefaults = new WeakMap(), _mutationDefaults = new WeakMap(), _mountCount = new WeakMap(), _unsubscribeFocus = new WeakMap(), _unsubscribeOnline = new WeakMap(), _a8); 1855
vendor: 20,430 bytes, lines 1856-2311
1856// node_modules/@tanstack/query-core/build/modern/queryObserver.js 1857var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _a9; 1858var QueryObserver = (_a9 = class extends Subscribable { 1859 constructor(client, options) { 1860 super(); 1861 __privateAdd(this, _QueryObserver_instances); 1862 __privateAdd(this, _client); 1863 __privateAdd(this, _currentQuery); 1864 __privateAdd(this, _currentQueryInitialState); 1865 __privateAdd(this, _currentResult); 1866 __privateAdd(this, _currentResultState); 1867 __privateAdd(this, _currentResultOptions); 1868 __privateAdd(this, _currentThenable); 1869 __privateAdd(this, _selectError); 1870 __privateAdd(this, _selectFn); 1871 __privateAdd(this, _selectResult); 1872 // This property keeps track of the last query with defined data. 1873 // It will be used to pass the previous data and query to the placeholder function between renders. 1874 __privateAdd(this, _lastQueryWithDefinedData); 1875 __privateAdd(this, _staleTimeoutId); 1876 __privateAdd(this, _refetchIntervalId); 1877 __privateAdd(this, _currentRefetchInterval); 1878 __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set()); 1879 this.options = options; 1880 __privateSet(this, _client, client); 1881 __privateSet(this, _selectError, null); 1882 __privateSet(this, _currentThenable, pendingThenable()); 1883 if (!this.options.experimental_prefetchInRender) { 1884 __privateGet(this, _currentThenable).reject( 1885 new Error("experimental_prefetchInRender feature flag is not enabled") 1886 ); 1887 } 1888 this.bindMethods(); 1889 this.setOptions(options); 1890 } 1891 bindMethods() { 1892 this.refetch = this.refetch.bind(this); 1893 } 1894 onSubscribe() { 1895 if (this.listeners.size === 1) { 1896 __privateGet(this, _currentQuery).addObserver(this); 1897 if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) { 1898 __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); 1899 } else { 1900 this.updateResult(); 1901 } 1902 __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); 1903 } 1904 } 1905 onUnsubscribe() { 1906 if (!this.hasListeners()) { 1907 this.destroy(); 1908 } 1909 } 1910 shouldFetchOnReconnect() { 1911 return shouldFetchOn( 1912 __privateGet(this, _currentQuery), 1913 this.options, 1914 this.options.refetchOnReconnect 1915 ); 1916 } 1917 shouldFetchOnWindowFocus() { 1918 return shouldFetchOn( 1919 __privateGet(this, _currentQuery), 1920 this.options, 1921 this.options.refetchOnWindowFocus 1922 ); 1923 } 1924 destroy() { 1925 this.listeners = /* @__PURE__ */ new Set(); 1926 __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); 1927 __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); 1928 __privateGet(this, _currentQuery).removeObserver(this); 1929 } 1930 setOptions(options, notifyOptions) { 1931 const prevOptions = this.options; 1932 const prevQuery = __privateGet(this, _currentQuery); 1933 this.options = __privateGet(this, _client).defaultQueryOptions(options); 1934 if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") { 1935 throw new Error( 1936 "Expected enabled to be a boolean or a callback that returns a boolean" 1937 ); 1938 } 1939 __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); 1940 __privateGet(this, _currentQuery).setOptions(this.options); 1941 if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { 1942 __privateGet(this, _client).getQueryCache().notify({ 1943 type: "observerOptionsUpdated", 1944 query: __privateGet(this, _currentQuery), 1945 observer: this 1946 }); 1947 } 1948 const mounted = this.hasListeners(); 1949 if (mounted && shouldFetchOptionally( 1950 __privateGet(this, _currentQuery), 1951 prevQuery, 1952 this.options, 1953 prevOptions 1954 )) { 1955 __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); 1956 } 1957 this.updateResult(notifyOptions); 1958 if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || resolveStaleTime(this.options.staleTime, __privateGet(this, _currentQuery)) !== resolveStaleTime(prevOptions.staleTime, __privateGet(this, _currentQuery)))) { 1959 __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); 1960 } 1961 const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this); 1962 if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) { 1963 __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval); 1964 } 1965 } 1966 getOptimisticResult(options) { 1967 const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options); 1968 const result = this.createResult(query, options); 1969 if (shouldAssignObserverCurrentProperties(this, result)) { 1970 __privateSet(this, _currentResult, result); 1971 __privateSet(this, _currentResultOptions, this.options); 1972 __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); 1973 } 1974 return result; 1975 } 1976 getCurrentResult() { 1977 return __privateGet(this, _currentResult); 1978 } 1979 trackResult(result, onPropTracked) { 1980 const trackedResult = {}; 1981 Object.keys(result).forEach((key) => { 1982 Object.defineProperty(trackedResult, key, { 1983 configurable: false, 1984 enumerable: true, 1985 get: () => { 1986 this.trackProp(key); 1987 onPropTracked == null ? void 0 : onPropTracked(key); 1988 return result[key]; 1989 } 1990 }); 1991 }); 1992 return trackedResult; 1993 } 1994 trackProp(key) { 1995 __privateGet(this, _trackedProps).add(key); 1996 } 1997 getCurrentQuery() { 1998 return __privateGet(this, _currentQuery); 1999 } 2000 refetch({ ...options } = {}) { 2001 return this.fetch({ 2002 ...options 2003 }); 2004 } 2005 fetchOptimistic(options) { 2006 const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); 2007 const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions); 2008 return query.fetch().then(() => this.createResult(query, defaultedOptions)); 2009 } 2010 fetch(fetchOptions) { 2011 return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, { 2012 ...fetchOptions, 2013 cancelRefetch: fetchOptions.cancelRefetch ?? true 2014 }).then(() => { 2015 this.updateResult(); 2016 return __privateGet(this, _currentResult); 2017 }); 2018 } 2019 createResult(query, options) { 2020 var _a12; 2021 const prevQuery = __privateGet(this, _currentQuery); 2022 const prevOptions = this.options; 2023 const prevResult = __privateGet(this, _currentResult); 2024 const prevResultState = __privateGet(this, _currentResultState); 2025 const prevResultOptions = __privateGet(this, _currentResultOptions); 2026 const queryChange = query !== prevQuery; 2027 const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState); 2028 const { state } = query; 2029 let newState = { ...state }; 2030 let isPlaceholderData = false; 2031 let data; 2032 if (options._optimisticResults) { 2033 const mounted = this.hasListeners(); 2034 const fetchOnMount = !mounted && shouldFetchOnMount(query, options); 2035 const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); 2036 if (fetchOnMount || fetchOptionally) { 2037 newState = { 2038 ...newState, 2039 ...fetchState(state.data, query.options) 2040 }; 2041 } 2042 if (options._optimisticResults === "isRestoring") { 2043 newState.fetchStatus = "idle"; 2044 } 2045 } 2046 let { error, errorUpdatedAt, status } = newState; 2047 if (options.select && newState.data !== void 0) { 2048 if (prevResult && newState.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) { 2049 data = __privateGet(this, _selectResult); 2050 } else { 2051 try { 2052 __privateSet(this, _selectFn, options.select); 2053 data = options.select(newState.data); 2054 data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options); 2055 __privateSet(this, _selectResult, data); 2056 __privateSet(this, _selectError, null); 2057 } catch (selectError) { 2058 __privateSet(this, _selectError, selectError); 2059 } 2060 } 2061 } else { 2062 data = newState.data; 2063 } 2064 if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { 2065 let placeholderData; 2066 if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { 2067 placeholderData = prevResult.data; 2068 } else { 2069 placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( 2070 (_a12 = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a12.state.data, 2071 __privateGet(this, _lastQueryWithDefinedData) 2072 ) : options.placeholderData; 2073 if (options.select && placeholderData !== void 0) { 2074 try { 2075 placeholderData = options.select(placeholderData); 2076 __privateSet(this, _selectError, null); 2077 } catch (selectError) { 2078 __privateSet(this, _selectError, selectError); 2079 } 2080 } 2081 } 2082 if (placeholderData !== void 0) { 2083 status = "success"; 2084 data = replaceData( 2085 prevResult == null ? void 0 : prevResult.data, 2086 placeholderData, 2087 options 2088 ); 2089 isPlaceholderData = true; 2090 } 2091 } 2092 if (__privateGet(this, _selectError)) { 2093 error = __privateGet(this, _selectError); 2094 data = __privateGet(this, _selectResult); 2095 errorUpdatedAt = Date.now(); 2096 status = "error"; 2097 } 2098 const isFetching = newState.fetchStatus === "fetching"; 2099 const isPending = status === "pending"; 2100 const isError = status === "error"; 2101 const isLoading = isPending && isFetching; 2102 const hasData = data !== void 0; 2103 const result = { 2104 status, 2105 fetchStatus: newState.fetchStatus, 2106 isPending, 2107 isSuccess: status === "success", 2108 isError, 2109 isInitialLoading: isLoading, 2110 isLoading, 2111 data, 2112 dataUpdatedAt: newState.dataUpdatedAt, 2113 error, 2114 errorUpdatedAt, 2115 failureCount: newState.fetchFailureCount, 2116 failureReason: newState.fetchFailureReason, 2117 errorUpdateCount: newState.errorUpdateCount, 2118 isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, 2119 isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, 2120 isFetching, 2121 isRefetching: isFetching && !isPending, 2122 isLoadingError: isError && !hasData, 2123 isPaused: newState.fetchStatus === "paused", 2124 isPlaceholderData, 2125 isRefetchError: isError && hasData, 2126 isStale: isStale(query, options), 2127 refetch: this.refetch, 2128 promise: __privateGet(this, _currentThenable) 2129 }; 2130 const nextResult = result; 2131 if (this.options.experimental_prefetchInRender) { 2132 const finalizeThenableIfPossible = (thenable) => { 2133 if (nextResult.status === "error") { 2134 thenable.reject(nextResult.error); 2135 } else if (nextResult.data !== void 0) { 2136 thenable.resolve(nextResult.data); 2137 } 2138 }; 2139 const recreateThenable = () => { 2140 const pending = __privateSet(this, _currentThenable, nextResult.promise = pendingThenable()); 2141 finalizeThenableIfPossible(pending); 2142 }; 2143 const prevThenable = __privateGet(this, _currentThenable); 2144 switch (prevThenable.status) { 2145 case "pending": 2146 if (query.queryHash === prevQuery.queryHash) { 2147 finalizeThenableIfPossible(prevThenable); 2148 } 2149 break; 2150 case "fulfilled": 2151 if (nextResult.status === "error" || nextResult.data !== prevThenable.value) { 2152 recreateThenable(); 2153 } 2154 break; 2155 case "rejected": 2156 if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) { 2157 recreateThenable(); 2158 } 2159 break; 2160 } 2161 } 2162 return nextResult; 2163 } 2164 updateResult(notifyOptions) { 2165 const prevResult = __privateGet(this, _currentResult); 2166 const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); 2167 __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); 2168 __privateSet(this, _currentResultOptions, this.options); 2169 if (__privateGet(this, _currentResultState).data !== void 0) { 2170 __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); 2171 } 2172 if (shallowEqualObjects(nextResult, prevResult)) { 2173 return; 2174 } 2175 __privateSet(this, _currentResult, nextResult); 2176 const defaultNotifyOptions = {}; 2177 const shouldNotifyListeners = () => { 2178 if (!prevResult) { 2179 return true; 2180 } 2181 const { notifyOnChangeProps } = this.options; 2182 const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; 2183 if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) { 2184 return true; 2185 } 2186 const includedProps = new Set( 2187 notifyOnChangePropsValue ?? __privateGet(this, _trackedProps) 2188 ); 2189 if (this.options.throwOnError) { 2190 includedProps.add("error"); 2191 } 2192 return Object.keys(__privateGet(this, _currentResult)).some((key) => { 2193 const typedKey = key; 2194 const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey]; 2195 return changed && includedProps.has(typedKey); 2196 }); 2197 }; 2198 if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && shouldNotifyListeners()) { 2199 defaultNotifyOptions.listeners = true; 2200 } 2201 __privateMethod(this, _QueryObserver_instances, notify_fn).call(this, { ...defaultNotifyOptions, ...notifyOptions }); 2202 } 2203 onQueryUpdate() { 2204 this.updateResult(); 2205 if (this.hasListeners()) { 2206 __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); 2207 } 2208 } 2209}, _client = new WeakMap(), _currentQuery = new WeakMap(), _currentQueryInitialState = new WeakMap(), _currentResult = new WeakMap(), _currentResultState = new WeakMap(), _currentResultOptions = new WeakMap(), _currentThenable = new WeakMap(), _selectError = new WeakMap(), _selectFn = new WeakMap(), _selectResult = new WeakMap(), _lastQueryWithDefinedData = new WeakMap(), _staleTimeoutId = new WeakMap(), _refetchIntervalId = new WeakMap(), _currentRefetchInterval = new WeakMap(), _trackedProps = new WeakMap(), _QueryObserver_instances = new WeakSet(), executeFetch_fn = function(fetchOptions) { 2210 __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); 2211 let promise = __privateGet(this, _currentQuery).fetch( 2212 this.options, 2213 fetchOptions 2214 ); 2215 if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { 2216 promise = promise.catch(noop); 2217 } 2218 return promise; 2219}, updateStaleTimeout_fn = function() { 2220 __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); 2221 const staleTime = resolveStaleTime( 2222 this.options.staleTime, 2223 __privateGet(this, _currentQuery) 2224 ); 2225 if (isServer || __privateGet(this, _currentResult).isStale || !isValidTimeout(staleTime)) { 2226 return; 2227 } 2228 const time = timeUntilStale(__privateGet(this, _currentResult).dataUpdatedAt, staleTime); 2229 const timeout = time + 1; 2230 __privateSet(this, _staleTimeoutId, setTimeout(() => { 2231 if (!__privateGet(this, _currentResult).isStale) { 2232 this.updateResult(); 2233 } 2234 }, timeout)); 2235}, computeRefetchInterval_fn = function() { 2236 return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false; 2237}, updateRefetchInterval_fn = function(nextInterval) { 2238 __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); 2239 __privateSet(this, _currentRefetchInterval, nextInterval); 2240 if (isServer || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) === false || !isValidTimeout(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) { 2241 return; 2242 } 2243 __privateSet(this, _refetchIntervalId, setInterval(() => { 2244 if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { 2245 __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); 2246 } 2247 }, __privateGet(this, _currentRefetchInterval))); 2248}, updateTimers_fn = function() { 2249 __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); 2250 __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this)); 2251}, clearStaleTimeout_fn = function() { 2252 if (__privateGet(this, _staleTimeoutId)) { 2253 clearTimeout(__privateGet(this, _staleTimeoutId)); 2254 __privateSet(this, _staleTimeoutId, void 0); 2255 } 2256}, clearRefetchInterval_fn = function() { 2257 if (__privateGet(this, _refetchIntervalId)) { 2258 clearInterval(__privateGet(this, _refetchIntervalId)); 2259 __privateSet(this, _refetchIntervalId, void 0); 2260 } 2261}, updateQuery_fn = function() { 2262 const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options); 2263 if (query === __privateGet(this, _currentQuery)) { 2264 return; 2265 } 2266 const prevQuery = __privateGet(this, _currentQuery); 2267 __privateSet(this, _currentQuery, query); 2268 __privateSet(this, _currentQueryInitialState, query.state); 2269 if (this.hasListeners()) { 2270 prevQuery == null ? void 0 : prevQuery.removeObserver(this); 2271 query.addObserver(this); 2272 } 2273}, notify_fn = function(notifyOptions) { 2274 notifyManager.batch(() => { 2275 if (notifyOptions.listeners) { 2276 this.listeners.forEach((listener) => { 2277 listener(__privateGet(this, _currentResult)); 2278 }); 2279 } 2280 __privateGet(this, _client).getQueryCache().notify({ 2281 query: __privateGet(this, _currentQuery), 2282 type: "observerResultsUpdated" 2283 }); 2284 }); 2285}, _a9); 2286function shouldLoadOnMount(query, options) { 2287 return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); 2288} 2289function shouldFetchOnMount(query, options) { 2290 return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); 2291} 2292function shouldFetchOn(query, options, field) { 2293 if (resolveEnabled(options.enabled, query) !== false) { 2294 const value = typeof field === "function" ? field(query) : field; 2295 return value === "always" || value !== false && isStale(query, options); 2296 } 2297 return false; 2298} 2299function shouldFetchOptionally(query, prevQuery, options, prevOptions) { 2300 return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); 2301} 2302function isStale(query, options) { 2303 return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); 2304} 2305function shouldAssignObserverCurrentProperties(observer, optimisticResult) { 2306 if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { 2307 return true; 2308 } 2309 return false; 2310} 2311
vendor: 7,737 bytes, lines 2312-2501
2312// node_modules/@tanstack/query-core/build/modern/queriesObserver.js 2313function difference(array1, array2) { 2314 return array1.filter((x) => !array2.includes(x)); 2315} 2316function replaceAt(array, index, value) { 2317 const copy = array.slice(0); 2318 copy[index] = value; 2319 return copy; 2320} 2321var _client2, _result, _queries2, _options, _observers2, _combinedResult, _lastCombine, _lastResult, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn2, _a10; 2322var QueriesObserver = (_a10 = class extends Subscribable { 2323 constructor(client, queries, options) { 2324 super(); 2325 __privateAdd(this, _QueriesObserver_instances); 2326 __privateAdd(this, _client2); 2327 __privateAdd(this, _result); 2328 __privateAdd(this, _queries2); 2329 __privateAdd(this, _options); 2330 __privateAdd(this, _observers2); 2331 __privateAdd(this, _combinedResult); 2332 __privateAdd(this, _lastCombine); 2333 __privateAdd(this, _lastResult); 2334 __privateSet(this, _client2, client); 2335 __privateSet(this, _options, options); 2336 __privateSet(this, _queries2, []); 2337 __privateSet(this, _observers2, []); 2338 __privateSet(this, _result, []); 2339 this.setQueries(queries); 2340 } 2341 onSubscribe() { 2342 if (this.listeners.size === 1) { 2343 __privateGet(this, _observers2).forEach((observer) => { 2344 observer.subscribe((result) => { 2345 __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); 2346 }); 2347 }); 2348 } 2349 } 2350 onUnsubscribe() { 2351 if (!this.listeners.size) { 2352 this.destroy(); 2353 } 2354 } 2355 destroy() { 2356 this.listeners = /* @__PURE__ */ new Set(); 2357 __privateGet(this, _observers2).forEach((observer) => { 2358 observer.destroy(); 2359 }); 2360 } 2361 setQueries(queries, options, notifyOptions) { 2362 __privateSet(this, _queries2, queries); 2363 __privateSet(this, _options, options); 2364 if (true) { 2365 const queryHashes = queries.map((query) => query.queryHash); 2366 if (new Set(queryHashes).size !== queryHashes.length) { 2367 console.warn( 2368 "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." 2369 ); 2370 } 2371 } 2372 notifyManager.batch(() => { 2373 const prevObservers = __privateGet(this, _observers2); 2374 const newObserverMatches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, __privateGet(this, _queries2)); 2375 newObserverMatches.forEach( 2376 (match) => match.observer.setOptions(match.defaultedQueryOptions, notifyOptions) 2377 ); 2378 const newObservers = newObserverMatches.map((match) => match.observer); 2379 const newResult = newObservers.map( 2380 (observer) => observer.getCurrentResult() 2381 ); 2382 const hasIndexChange = newObservers.some( 2383 (observer, index) => observer !== prevObservers[index] 2384 ); 2385 if (prevObservers.length === newObservers.length && !hasIndexChange) { 2386 return; 2387 } 2388 __privateSet(this, _observers2, newObservers); 2389 __privateSet(this, _result, newResult); 2390 if (!this.hasListeners()) { 2391 return; 2392 } 2393 difference(prevObservers, newObservers).forEach((observer) => { 2394 observer.destroy(); 2395 }); 2396 difference(newObservers, prevObservers).forEach((observer) => { 2397 observer.subscribe((result) => { 2398 __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); 2399 }); 2400 }); 2401 __privateMethod(this, _QueriesObserver_instances, notify_fn2).call(this); 2402 }); 2403 } 2404 getCurrentResult() { 2405 return __privateGet(this, _result); 2406 } 2407 getQueries() { 2408 return __privateGet(this, _observers2).map((observer) => observer.getCurrentQuery()); 2409 } 2410 getObservers() { 2411 return __privateGet(this, _observers2); 2412 } 2413 getOptimisticResult(queries, combine) { 2414 const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries); 2415 const result = matches.map( 2416 (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) 2417 ); 2418 return [ 2419 result, 2420 (r) => { 2421 return __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, r ?? result, combine); 2422 }, 2423 () => { 2424 return __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, result, queries); 2425 } 2426 ]; 2427 } 2428}, _client2 = new WeakMap(), _result = new WeakMap(), _queries2 = new WeakMap(), _options = new WeakMap(), _observers2 = new WeakMap(), _combinedResult = new WeakMap(), _lastCombine = new WeakMap(), _lastResult = new WeakMap(), _QueriesObserver_instances = new WeakSet(), trackResult_fn = function(result, queries) { 2429 const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries); 2430 return matches.map((match, index) => { 2431 const observerResult = result[index]; 2432 return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { 2433 matches.forEach((m) => { 2434 m.observer.trackProp(accessedProp); 2435 }); 2436 }) : observerResult; 2437 }); 2438}, combineResult_fn = function(input, combine) { 2439 if (combine) { 2440 if (!__privateGet(this, _combinedResult) || __privateGet(this, _result) !== __privateGet(this, _lastResult) || combine !== __privateGet(this, _lastCombine)) { 2441 __privateSet(this, _lastCombine, combine); 2442 __privateSet(this, _lastResult, __privateGet(this, _result)); 2443 __privateSet(this, _combinedResult, replaceEqualDeep( 2444 __privateGet(this, _combinedResult), 2445 combine(input) 2446 )); 2447 } 2448 return __privateGet(this, _combinedResult); 2449 } 2450 return input; 2451}, findMatchingObservers_fn = function(queries) { 2452 const prevObserversMap = new Map( 2453 __privateGet(this, _observers2).map((observer) => [observer.options.queryHash, observer]) 2454 ); 2455 const observers = []; 2456 queries.forEach((options) => { 2457 const defaultedOptions = __privateGet(this, _client2).defaultQueryOptions(options); 2458 const match = prevObserversMap.get(defaultedOptions.queryHash); 2459 if (match) { 2460 observers.push({ 2461 defaultedQueryOptions: defaultedOptions, 2462 observer: match 2463 }); 2464 } else { 2465 const existingObserver = __privateGet(this, _observers2).find( 2466 (o) => o.options.queryHash === defaultedOptions.queryHash 2467 ); 2468 observers.push({ 2469 defaultedQueryOptions: defaultedOptions, 2470 observer: existingObserver ?? new QueryObserver(__privateGet(this, _client2), defaultedOptions) 2471 }); 2472 } 2473 }); 2474 return observers.sort((a, b) => { 2475 return queries.findIndex( 2476 (q) => q.queryHash === a.defaultedQueryOptions.queryHash 2477 ) - queries.findIndex( 2478 (q) => q.queryHash === b.defaultedQueryOptions.queryHash 2479 ); 2480 }); 2481}, onUpdate_fn = function(observer, result) { 2482 const index = __privateGet(this, _observers2).indexOf(observer); 2483 if (index !== -1) { 2484 __privateSet(this, _result, replaceAt(__privateGet(this, _result), index, result)); 2485 __privateMethod(this, _QueriesObserver_instances, notify_fn2).call(this); 2486 } 2487}, notify_fn2 = function() { 2488 var _a12; 2489 if (this.hasListeners()) { 2490 const previousResult = __privateGet(this, _combinedResult); 2491 const newResult = __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _queries2)), (_a12 = __privateGet(this, _options)) == null ? void 0 : _a12.combine); 2492 if (previousResult !== newResult) { 2493 notifyManager.batch(() => { 2494 this.listeners.forEach((listener) => { 2495 listener(__privateGet(this, _result)); 2496 }); 2497 }); 2498 } 2499 } 2500}, _a10); 2501
vendor: 2,195 bytes, lines 2502-2567
2502// node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js 2503var InfiniteQueryObserver = class extends QueryObserver { 2504 constructor(client, options) { 2505 super(client, options); 2506 } 2507 bindMethods() { 2508 super.bindMethods(); 2509 this.fetchNextPage = this.fetchNextPage.bind(this); 2510 this.fetchPreviousPage = this.fetchPreviousPage.bind(this); 2511 } 2512 setOptions(options, notifyOptions) { 2513 super.setOptions( 2514 { 2515 ...options, 2516 behavior: infiniteQueryBehavior() 2517 }, 2518 notifyOptions 2519 ); 2520 } 2521 getOptimisticResult(options) { 2522 options.behavior = infiniteQueryBehavior(); 2523 return super.getOptimisticResult(options); 2524 } 2525 fetchNextPage(options) { 2526 return this.fetch({ 2527 ...options, 2528 meta: { 2529 fetchMore: { direction: "forward" } 2530 } 2531 }); 2532 } 2533 fetchPreviousPage(options) { 2534 return this.fetch({ 2535 ...options, 2536 meta: { 2537 fetchMore: { direction: "backward" } 2538 } 2539 }); 2540 } 2541 createResult(query, options) { 2542 var _a12, _b; 2543 const { state } = query; 2544 const parentResult = super.createResult(query, options); 2545 const { isFetching, isRefetching, isError, isRefetchError } = parentResult; 2546 const fetchDirection = (_b = (_a12 = state.fetchMeta) == null ? void 0 : _a12.fetchMore) == null ? void 0 : _b.direction; 2547 const isFetchNextPageError = isError && fetchDirection === "forward"; 2548 const isFetchingNextPage = isFetching && fetchDirection === "forward"; 2549 const isFetchPreviousPageError = isError && fetchDirection === "backward"; 2550 const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; 2551 const result = { 2552 ...parentResult, 2553 fetchNextPage: this.fetchNextPage, 2554 fetchPreviousPage: this.fetchPreviousPage, 2555 hasNextPage: hasNextPage(options, state.data), 2556 hasPreviousPage: hasPreviousPage(options, state.data), 2557 isFetchNextPageError, 2558 isFetchingNextPage, 2559 isFetchPreviousPageError, 2560 isFetchingPreviousPage, 2561 isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, 2562 isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage 2563 }; 2564 return result; 2565 } 2566}; 2567
vendor: 4,654 bytes, lines 2568-2669
2568// node_modules/@tanstack/query-core/build/modern/mutationObserver.js 2569var _client3, _currentResult2, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn3, _a11; 2570var MutationObserver = (_a11 = class extends Subscribable { 2571 constructor(client, options) { 2572 super(); 2573 __privateAdd(this, _MutationObserver_instances); 2574 __privateAdd(this, _client3); 2575 __privateAdd(this, _currentResult2); 2576 __privateAdd(this, _currentMutation); 2577 __privateAdd(this, _mutateOptions); 2578 __privateSet(this, _client3, client); 2579 this.setOptions(options); 2580 this.bindMethods(); 2581 __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); 2582 } 2583 bindMethods() { 2584 this.mutate = this.mutate.bind(this); 2585 this.reset = this.reset.bind(this); 2586 } 2587 setOptions(options) { 2588 var _a12; 2589 const prevOptions = this.options; 2590 this.options = __privateGet(this, _client3).defaultMutationOptions(options); 2591 if (!shallowEqualObjects(this.options, prevOptions)) { 2592 __privateGet(this, _client3).getMutationCache().notify({ 2593 type: "observerOptionsUpdated", 2594 mutation: __privateGet(this, _currentMutation), 2595 observer: this 2596 }); 2597 } 2598 if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { 2599 this.reset(); 2600 } else if (((_a12 = __privateGet(this, _currentMutation)) == null ? void 0 : _a12.state.status) === "pending") { 2601 __privateGet(this, _currentMutation).setOptions(this.options); 2602 } 2603 } 2604 onUnsubscribe() { 2605 var _a12; 2606 if (!this.hasListeners()) { 2607 (_a12 = __privateGet(this, _currentMutation)) == null ? void 0 : _a12.removeObserver(this); 2608 } 2609 } 2610 onMutationUpdate(action) { 2611 __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); 2612 __privateMethod(this, _MutationObserver_instances, notify_fn3).call(this, action); 2613 } 2614 getCurrentResult() { 2615 return __privateGet(this, _currentResult2); 2616 } 2617 reset() { 2618 var _a12; 2619 (_a12 = __privateGet(this, _currentMutation)) == null ? void 0 : _a12.removeObserver(this); 2620 __privateSet(this, _currentMutation, void 0); 2621 __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); 2622 __privateMethod(this, _MutationObserver_instances, notify_fn3).call(this); 2623 } 2624 mutate(variables, options) { 2625 var _a12; 2626 __privateSet(this, _mutateOptions, options); 2627 (_a12 = __privateGet(this, _currentMutation)) == null ? void 0 : _a12.removeObserver(this); 2628 __privateSet(this, _currentMutation, __privateGet(this, _client3).getMutationCache().build(__privateGet(this, _client3), this.options)); 2629 __privateGet(this, _currentMutation).addObserver(this); 2630 return __privateGet(this, _currentMutation).execute(variables); 2631 } 2632}, _client3 = new WeakMap(), _currentResult2 = new WeakMap(), _currentMutation = new WeakMap(), _mutateOptions = new WeakMap(), _MutationObserver_instances = new WeakSet(), updateResult_fn = function() { 2633 var _a12; 2634 const state = ((_a12 = __privateGet(this, _currentMutation)) == null ? void 0 : _a12.state) ?? getDefaultState2(); 2635 __privateSet(this, _currentResult2, { 2636 ...state, 2637 isPending: state.status === "pending", 2638 isSuccess: state.status === "success", 2639 isError: state.status === "error", 2640 isIdle: state.status === "idle", 2641 mutate: this.mutate, 2642 reset: this.reset 2643 }); 2644}, notify_fn3 = function(action) { 2645 notifyManager.batch(() => { 2646 var _a12, _b, _c, _d, _e, _f, _g, _h; 2647 if (__privateGet(this, _mutateOptions) && this.hasListeners()) { 2648 const variables = __privateGet(this, _currentResult2).variables; 2649 const context = __privateGet(this, _currentResult2).context; 2650 if ((action == null ? void 0 : action.type) === "success") { 2651 (_b = (_a12 = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call(_a12, action.data, variables, context); 2652 (_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call(_c, action.data, null, variables, context); 2653 } else if ((action == null ? void 0 : action.type) === "error") { 2654 (_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call(_e, action.error, variables, context); 2655 (_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call( 2656 _g, 2657 void 0, 2658 action.error, 2659 variables, 2660 context 2661 ); 2662 } 2663 } 2664 this.listeners.forEach((listener) => { 2665 listener(__privateGet(this, _currentResult2)); 2666 }); 2667 }); 2668}, _a11); 2669
vendor: 4,341 bytes, lines 2670-2784
2670// node_modules/@tanstack/query-core/build/modern/hydration.js 2671function defaultTransformerFn(data) { 2672 return data; 2673} 2674function dehydrateMutation(mutation) { 2675 return { 2676 mutationKey: mutation.options.mutationKey, 2677 state: mutation.state, 2678 ...mutation.options.scope && { scope: mutation.options.scope }, 2679 ...mutation.meta && { meta: mutation.meta } 2680 }; 2681} 2682function dehydrateQuery(query, serializeData) { 2683 var _a12; 2684 return { 2685 state: { 2686 ...query.state, 2687 ...query.state.data !== void 0 && { 2688 data: serializeData(query.state.data) 2689 } 2690 }, 2691 queryKey: query.queryKey, 2692 queryHash: query.queryHash, 2693 ...query.state.status === "pending" && { 2694 promise: (_a12 = query.promise) == null ? void 0 : _a12.then(serializeData).catch((error) => { 2695 if (true) { 2696 console.error( 2697 `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` 2698 ); 2699 } 2700 return Promise.reject(new Error("redacted")); 2701 }) 2702 }, 2703 ...query.meta && { meta: query.meta } 2704 }; 2705} 2706function defaultShouldDehydrateMutation(mutation) { 2707 return mutation.state.isPaused; 2708} 2709function defaultShouldDehydrateQuery(query) { 2710 return query.state.status === "success"; 2711} 2712function dehydrate(client, options = {}) { 2713 var _a12, _b, _c; 2714 const filterMutation = options.shouldDehydrateMutation ?? ((_a12 = client.getDefaultOptions().dehydrate) == null ? void 0 : _a12.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation; 2715 const mutations = client.getMutationCache().getAll().flatMap( 2716 (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] 2717 ); 2718 const filterQuery = options.shouldDehydrateQuery ?? ((_b = client.getDefaultOptions().dehydrate) == null ? void 0 : _b.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery; 2719 const serializeData = options.serializeData ?? ((_c = client.getDefaultOptions().dehydrate) == null ? void 0 : _c.serializeData) ?? defaultTransformerFn; 2720 const queries = client.getQueryCache().getAll().flatMap( 2721 (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData)] : [] 2722 ); 2723 return { mutations, queries }; 2724} 2725function hydrate(client, dehydratedState, options) { 2726 var _a12, _b; 2727 if (typeof dehydratedState !== "object" || dehydratedState === null) { 2728 return; 2729 } 2730 const mutationCache = client.getMutationCache(); 2731 const queryCache = client.getQueryCache(); 2732 const deserializeData = ((_a12 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _a12.deserializeData) ?? ((_b = client.getDefaultOptions().hydrate) == null ? void 0 : _b.deserializeData) ?? defaultTransformerFn; 2733 const mutations = dehydratedState.mutations || []; 2734 const queries = dehydratedState.queries || []; 2735 mutations.forEach(({ state, ...mutationOptions }) => { 2736 var _a13, _b2; 2737 mutationCache.build( 2738 client, 2739 { 2740 ...(_a13 = client.getDefaultOptions().hydrate) == null ? void 0 : _a13.mutations, 2741 ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.mutations, 2742 ...mutationOptions 2743 }, 2744 state 2745 ); 2746 }); 2747 queries.forEach(({ queryKey, state, queryHash, meta, promise }) => { 2748 var _a13, _b2; 2749 let query = queryCache.get(queryHash); 2750 const data = state.data === void 0 ? state.data : deserializeData(state.data); 2751 if (query) { 2752 if (query.state.dataUpdatedAt < state.dataUpdatedAt) { 2753 const { fetchStatus: _ignored, ...serializedState } = state; 2754 query.setState({ 2755 ...serializedState, 2756 data 2757 }); 2758 } 2759 } else { 2760 query = queryCache.build( 2761 client, 2762 { 2763 ...(_a13 = client.getDefaultOptions().hydrate) == null ? void 0 : _a13.queries, 2764 ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.queries, 2765 queryKey, 2766 queryHash, 2767 meta 2768 }, 2769 // Reset fetch status to idle to avoid 2770 // query being stuck in fetching state upon hydration 2771 { 2772 ...state, 2773 data, 2774 fetchStatus: "idle" 2775 } 2776 ); 2777 } 2778 if (promise) { 2779 const initialPromise = Promise.resolve(promise).then(deserializeData); 2780 void query.fetch(void 0, { initialPromise }); 2781 } 2782 }); 2783} 2784
vendor: 108 bytes, lines 2785-2787
2785// node_modules/@tanstack/react-query/build/modern/useQueries.js 2786var React5 = __toESM(require_react(), 1); 2787
vendor: 767 bytes, lines 2788-2816
2788// node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js 2789var React = __toESM(require_react(), 1); 2790var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 2791var QueryClientContext = React.createContext( 2792 void 0 2793); 2794var useQueryClient = (queryClient) => { 2795 const client = React.useContext(QueryClientContext); 2796 if (queryClient) { 2797 return queryClient; 2798 } 2799 if (!client) { 2800 throw new Error("No QueryClient set, use QueryClientProvider to set one"); 2801 } 2802 return client; 2803}; 2804var QueryClientProvider = ({ 2805 client, 2806 children 2807}) => { 2808 React.useEffect(() => { 2809 client.mount(); 2810 return () => { 2811 client.unmount(); 2812 }; 2813 }, [client]); 2814 return (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); 2815}; 2816
vendor: 284 bytes, lines 2817-2822
2817// node_modules/@tanstack/react-query/build/modern/isRestoring.js 2818var React2 = __toESM(require_react(), 1); 2819var IsRestoringContext = React2.createContext(false); 2820var useIsRestoring = () => React2.useContext(IsRestoringContext); 2821var IsRestoringProvider = IsRestoringContext.Provider; 2822
vendor: 836 bytes, lines 2823-2848
2823// node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js 2824var React3 = __toESM(require_react(), 1); 2825var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 2826function createValue() { 2827 let isReset = false; 2828 return { 2829 clearReset: () => { 2830 isReset = false; 2831 }, 2832 reset: () => { 2833 isReset = true; 2834 }, 2835 isReset: () => { 2836 return isReset; 2837 } 2838 }; 2839} 2840var QueryErrorResetBoundaryContext = React3.createContext(createValue()); 2841var useQueryErrorResetBoundary = () => React3.useContext(QueryErrorResetBoundaryContext); 2842var QueryErrorResetBoundary = ({ 2843 children 2844}) => { 2845 const [value] = React3.useState(() => createValue()); 2846 return (0, import_jsx_runtime2.jsx)(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); 2847}; 2848
vendor: 116 bytes, lines 2849-2851
2849// node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js 2850var React4 = __toESM(require_react(), 1); 2851
vendor: 235 bytes, lines 2852-2861
2852// node_modules/@tanstack/react-query/build/modern/utils.js 2853function shouldThrowError(throwError, params) { 2854 if (typeof throwError === "function") { 2855 return throwError(...params); 2856 } 2857 return !!throwError; 2858} 2859function noop2() { 2860} 2861
vendor: 716 bytes, lines 2862-2883
2862// node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js 2863var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { 2864 if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) { 2865 if (!errorResetBoundary.isReset()) { 2866 options.retryOnMount = false; 2867 } 2868 } 2869}; 2870var useClearResetErrorBoundary = (errorResetBoundary) => { 2871 React4.useEffect(() => { 2872 errorResetBoundary.clearReset(); 2873 }, [errorResetBoundary]); 2874}; 2875var getHasError = ({ 2876 result, 2877 errorResetBoundary, 2878 throwOnError, 2879 query 2880}) => { 2881 return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]); 2882}; 2883
vendor: 860 bytes, lines 2884-2901
2884// node_modules/@tanstack/react-query/build/modern/suspense.js 2885var defaultThrowOnError = (_error, query) => query.state.data === void 0; 2886var ensureSuspenseTimers = (defaultedOptions) => { 2887 if (defaultedOptions.suspense) { 2888 if (defaultedOptions.staleTime === void 0) { 2889 defaultedOptions.staleTime = 1e3; 2890 } 2891 if (typeof defaultedOptions.gcTime === "number") { 2892 defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1e3); 2893 } 2894 } 2895}; 2896var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; 2897var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending; 2898var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { 2899 errorResetBoundary.clearReset(); 2900}); 2901
vendor: 2,778 bytes, lines 2902-2987
2902// node_modules/@tanstack/react-query/build/modern/useQueries.js 2903function useQueries({ 2904 queries, 2905 ...options 2906}, queryClient) { 2907 const client = useQueryClient(queryClient); 2908 const isRestoring = useIsRestoring(); 2909 const errorResetBoundary = useQueryErrorResetBoundary(); 2910 const defaultedQueries = React5.useMemo( 2911 () => queries.map((opts) => { 2912 const defaultedOptions = client.defaultQueryOptions( 2913 opts 2914 ); 2915 defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 2916 return defaultedOptions; 2917 }), 2918 [queries, client, isRestoring] 2919 ); 2920 defaultedQueries.forEach((query) => { 2921 ensureSuspenseTimers(query); 2922 ensurePreventErrorBoundaryRetry(query, errorResetBoundary); 2923 }); 2924 useClearResetErrorBoundary(errorResetBoundary); 2925 const [observer] = React5.useState( 2926 () => new QueriesObserver( 2927 client, 2928 defaultedQueries, 2929 options 2930 ) 2931 ); 2932 const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( 2933 defaultedQueries, 2934 options.combine 2935 ); 2936 React5.useSyncExternalStore( 2937 React5.useCallback( 2938 (onStoreChange) => isRestoring ? noop2 : observer.subscribe(notifyManager.batchCalls(onStoreChange)), 2939 [observer, isRestoring] 2940 ), 2941 () => observer.getCurrentResult(), 2942 () => observer.getCurrentResult() 2943 ); 2944 React5.useEffect(() => { 2945 observer.setQueries( 2946 defaultedQueries, 2947 options, 2948 { 2949 listeners: false 2950 } 2951 ); 2952 }, [defaultedQueries, options, observer]); 2953 const shouldAtLeastOneSuspend = optimisticResult.some( 2954 (result, index) => shouldSuspend(defaultedQueries[index], result) 2955 ); 2956 const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { 2957 const opts = defaultedQueries[index]; 2958 if (opts) { 2959 const queryObserver = new QueryObserver(client, opts); 2960 if (shouldSuspend(opts, result)) { 2961 return fetchOptimistic(opts, queryObserver, errorResetBoundary); 2962 } else if (willFetch(result, isRestoring)) { 2963 void fetchOptimistic(opts, queryObserver, errorResetBoundary); 2964 } 2965 } 2966 return []; 2967 }) : []; 2968 if (suspensePromises.length > 0) { 2969 throw Promise.all(suspensePromises); 2970 } 2971 const firstSingleResultWhichShouldThrow = optimisticResult.find( 2972 (result, index) => { 2973 const query = defaultedQueries[index]; 2974 return query && getHasError({ 2975 result, 2976 errorResetBoundary, 2977 throwOnError: query.throwOnError, 2978 query: client.getQueryCache().get(query.queryHash) 2979 }); 2980 } 2981 ); 2982 if (firstSingleResultWhichShouldThrow == null ? void 0 : firstSingleResultWhichShouldThrow.error) { 2983 throw firstSingleResultWhichShouldThrow.error; 2984 } 2985 return getCombinedResult(trackResult()); 2986} 2987
vendor: 3,262 bytes, lines 2988-3065
2988// node_modules/@tanstack/react-query/build/modern/useBaseQuery.js 2989var React6 = __toESM(require_react(), 1); 2990function useBaseQuery(options, Observer, queryClient) { 2991 var _a12, _b, _c, _d, _e; 2992 if (true) { 2993 if (typeof options !== "object" || Array.isArray(options)) { 2994 throw new Error( 2995 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' 2996 ); 2997 } 2998 } 2999 const client = useQueryClient(queryClient); 3000 const isRestoring = useIsRestoring(); 3001 const errorResetBoundary = useQueryErrorResetBoundary(); 3002 const defaultedOptions = client.defaultQueryOptions(options); 3003 (_b = (_a12 = client.getDefaultOptions().queries) == null ? void 0 : _a12._experimental_beforeQuery) == null ? void 0 : _b.call( 3004 _a12, 3005 defaultedOptions 3006 ); 3007 defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 3008 ensureSuspenseTimers(defaultedOptions); 3009 ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary); 3010 useClearResetErrorBoundary(errorResetBoundary); 3011 const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); 3012 const [observer] = React6.useState( 3013 () => new Observer( 3014 client, 3015 defaultedOptions 3016 ) 3017 ); 3018 const result = observer.getOptimisticResult(defaultedOptions); 3019 React6.useSyncExternalStore( 3020 React6.useCallback( 3021 (onStoreChange) => { 3022 const unsubscribe = isRestoring ? noop2 : observer.subscribe(notifyManager.batchCalls(onStoreChange)); 3023 observer.updateResult(); 3024 return unsubscribe; 3025 }, 3026 [observer, isRestoring] 3027 ), 3028 () => observer.getCurrentResult(), 3029 () => observer.getCurrentResult() 3030 ); 3031 React6.useEffect(() => { 3032 observer.setOptions(defaultedOptions, { listeners: false }); 3033 }, [defaultedOptions, observer]); 3034 if (shouldSuspend(defaultedOptions, result)) { 3035 throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); 3036 } 3037 if (getHasError({ 3038 result, 3039 errorResetBoundary, 3040 throwOnError: defaultedOptions.throwOnError, 3041 query: client.getQueryCache().get(defaultedOptions.queryHash) 3042 })) { 3043 throw result.error; 3044 } 3045 ; 3046 (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( 3047 _c, 3048 defaultedOptions, 3049 result 3050 ); 3051 if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { 3052 const promise = isNewCacheEntry ? ( 3053 // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted 3054 fetchOptimistic(defaultedOptions, observer, errorResetBoundary) 3055 ) : ( 3056 // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in 3057 (_e = client.getQueryCache().get(defaultedOptions.queryHash)) == null ? void 0 : _e.promise 3058 ); 3059 promise == null ? void 0 : promise.catch(noop2).finally(() => { 3060 observer.updateResult(); 3061 }); 3062 } 3063 return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; 3064} 3065
vendor: 168 bytes, lines 3066-3070
3066// node_modules/@tanstack/react-query/build/modern/useQuery.js 3067function useQuery(options, queryClient) { 3068 return useBaseQuery(options, QueryObserver, queryClient); 3069} 3070
vendor: 467 bytes, lines 3071-3090
3071// node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js 3072function useSuspenseQuery(options, queryClient) { 3073 if (true) { 3074 if (options.queryFn === skipToken) { 3075 console.error("skipToken is not allowed for useSuspenseQuery"); 3076 } 3077 } 3078 return useBaseQuery( 3079 { 3080 ...options, 3081 enabled: true, 3082 suspense: true, 3083 throwOnError: defaultThrowOnError, 3084 placeholderData: void 0 3085 }, 3086 QueryObserver, 3087 queryClient 3088 ); 3089} 3090
vendor: 468 bytes, lines 3091-3109
3091// node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js 3092function useSuspenseInfiniteQuery(options, queryClient) { 3093 if (true) { 3094 if (options.queryFn === skipToken) { 3095 console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); 3096 } 3097 } 3098 return useBaseQuery( 3099 { 3100 ...options, 3101 enabled: true, 3102 suspense: true, 3103 throwOnError: defaultThrowOnError 3104 }, 3105 InfiniteQueryObserver, 3106 queryClient 3107 ); 3108} 3109
vendor: 601 bytes, lines 3110-3133
3110// node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js 3111function useSuspenseQueries(options, queryClient) { 3112 return useQueries( 3113 { 3114 ...options, 3115 queries: options.queries.map((query) => { 3116 if (true) { 3117 if (query.queryFn === skipToken) { 3118 console.error("skipToken is not allowed for useSuspenseQueries"); 3119 } 3120 } 3121 return { 3122 ...query, 3123 suspense: true, 3124 throwOnError: defaultThrowOnError, 3125 enabled: true, 3126 placeholderData: void 0 3127 }; 3128 }) 3129 }, 3130 queryClient 3131 ); 3132} 3133
vendor: 258 bytes, lines 3134-3141
3134// node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js 3135function usePrefetchQuery(options, queryClient) { 3136 const client = useQueryClient(queryClient); 3137 if (!client.getQueryState(options.queryKey)) { 3138 client.prefetchQuery(options); 3139 } 3140} 3141
vendor: 282 bytes, lines 3142-3149
3142// node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js 3143function usePrefetchInfiniteQuery(options, queryClient) { 3144 const client = useQueryClient(queryClient); 3145 if (!client.getQueryState(options.queryKey)) { 3146 client.prefetchInfiniteQuery(options); 3147 } 3148} 3149
vendor: 121 bytes, lines 3150-3154
3150// node_modules/@tanstack/react-query/build/modern/queryOptions.js 3151function queryOptions(options) { 3152 return options; 3153} 3154
vendor: 137 bytes, lines 3155-3159
3155// node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js 3156function infiniteQueryOptions(options) { 3157 return options; 3158} 3159
vendor: 1,899 bytes, lines 3160-3213
3160// node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js 3161var React7 = __toESM(require_react(), 1); 3162var HydrationBoundary = ({ 3163 children, 3164 options = {}, 3165 state, 3166 queryClient 3167}) => { 3168 const client = useQueryClient(queryClient); 3169 const [hydrationQueue, setHydrationQueue] = React7.useState(); 3170 const optionsRef = React7.useRef(options); 3171 optionsRef.current = options; 3172 React7.useMemo(() => { 3173 if (state) { 3174 if (typeof state !== "object") { 3175 return; 3176 } 3177 const queryCache = client.getQueryCache(); 3178 const queries = state.queries || []; 3179 const newQueries = []; 3180 const existingQueries = []; 3181 for (const dehydratedQuery of queries) { 3182 const existingQuery = queryCache.get(dehydratedQuery.queryHash); 3183 if (!existingQuery) { 3184 newQueries.push(dehydratedQuery); 3185 } else { 3186 const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt; 3187 const queryAlreadyQueued = hydrationQueue == null ? void 0 : hydrationQueue.find( 3188 (query) => query.queryHash === dehydratedQuery.queryHash 3189 ); 3190 if (hydrationIsNewer && (!queryAlreadyQueued || dehydratedQuery.state.dataUpdatedAt > queryAlreadyQueued.state.dataUpdatedAt)) { 3191 existingQueries.push(dehydratedQuery); 3192 } 3193 } 3194 } 3195 if (newQueries.length > 0) { 3196 hydrate(client, { queries: newQueries }, optionsRef.current); 3197 } 3198 if (existingQueries.length > 0) { 3199 setHydrationQueue( 3200 (prev) => prev ? [...prev, ...existingQueries] : existingQueries 3201 ); 3202 } 3203 } 3204 }, [client, hydrationQueue, state]); 3205 React7.useEffect(() => { 3206 if (hydrationQueue) { 3207 hydrate(client, { queries: hydrationQueue }, optionsRef.current); 3208 setHydrationQueue(void 0); 3209 } 3210 }, [client, hydrationQueue]); 3211 return children; 3212}; 3213
vendor: 507 bytes, lines 3214-3228
3214// node_modules/@tanstack/react-query/build/modern/useIsFetching.js 3215var React8 = __toESM(require_react(), 1); 3216function useIsFetching(filters, queryClient) { 3217 const client = useQueryClient(queryClient); 3218 const queryCache = client.getQueryCache(); 3219 return React8.useSyncExternalStore( 3220 React8.useCallback( 3221 (onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), 3222 [queryCache] 3223 ), 3224 () => client.isFetching(filters), 3225 () => client.isFetching(filters) 3226 ); 3227} 3228
vendor: 1,351 bytes, lines 3229-3271
3229// node_modules/@tanstack/react-query/build/modern/useMutationState.js 3230var React9 = __toESM(require_react(), 1); 3231function useIsMutating(filters, queryClient) { 3232 const client = useQueryClient(queryClient); 3233 return useMutationState( 3234 { filters: { ...filters, status: "pending" } }, 3235 client 3236 ).length; 3237} 3238function getResult(mutationCache, options) { 3239 return mutationCache.findAll(options.filters).map( 3240 (mutation) => options.select ? options.select(mutation) : mutation.state 3241 ); 3242} 3243function useMutationState(options = {}, queryClient) { 3244 const mutationCache = useQueryClient(queryClient).getMutationCache(); 3245 const optionsRef = React9.useRef(options); 3246 const result = React9.useRef(null); 3247 if (!result.current) { 3248 result.current = getResult(mutationCache, options); 3249 } 3250 React9.useEffect(() => { 3251 optionsRef.current = options; 3252 }); 3253 return React9.useSyncExternalStore( 3254 React9.useCallback( 3255 (onStoreChange) => mutationCache.subscribe(() => { 3256 const nextResult = replaceEqualDeep( 3257 result.current, 3258 getResult(mutationCache, optionsRef.current) 3259 ); 3260 if (result.current !== nextResult) { 3261 result.current = nextResult; 3262 notifyManager.schedule(onStoreChange); 3263 } 3264 }), 3265 [mutationCache] 3266 ), 3267 () => result.current, 3268 () => result.current 3269 ); 3270} 3271
vendor: 1,006 bytes, lines 3272-3304
3272// node_modules/@tanstack/react-query/build/modern/useMutation.js 3273var React10 = __toESM(require_react(), 1); 3274function useMutation(options, queryClient) { 3275 const client = useQueryClient(queryClient); 3276 const [observer] = React10.useState( 3277 () => new MutationObserver( 3278 client, 3279 options 3280 ) 3281 ); 3282 React10.useEffect(() => { 3283 observer.setOptions(options); 3284 }, [observer, options]); 3285 const result = React10.useSyncExternalStore( 3286 React10.useCallback( 3287 (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), 3288 [observer] 3289 ), 3290 () => observer.getCurrentResult(), 3291 () => observer.getCurrentResult() 3292 ); 3293 const mutate = React10.useCallback( 3294 (variables, mutateOptions) => { 3295 observer.mutate(variables, mutateOptions).catch(noop2); 3296 }, 3297 [observer] 3298 ); 3299 if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { 3300 throw result.error; 3301 } 3302 return { ...result, mutate, mutateAsync: result.mutate }; 3303} 3304
vendor: 1,155 bytes, lines 3305-3362
3305// node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js 3306function useInfiniteQuery(options, queryClient) { 3307 return useBaseQuery( 3308 options, 3309 InfiniteQueryObserver, 3310 queryClient 3311 ); 3312} 3313export { 3314 CancelledError, 3315 HydrationBoundary, 3316 InfiniteQueryObserver, 3317 IsRestoringProvider, 3318 Mutation, 3319 MutationCache, 3320 MutationObserver, 3321 QueriesObserver, 3322 Query, 3323 QueryCache, 3324 QueryClient, 3325 QueryClientContext, 3326 QueryClientProvider, 3327 QueryErrorResetBoundary, 3328 QueryObserver, 3329 defaultShouldDehydrateMutation, 3330 defaultShouldDehydrateQuery, 3331 dehydrate, 3332 focusManager, 3333 hashKey, 3334 hydrate, 3335 infiniteQueryOptions, 3336 isCancelledError, 3337 isServer, 3338 keepPreviousData, 3339 matchMutation, 3340 matchQuery, 3341 notifyManager, 3342 onlineManager, 3343 queryOptions, 3344 replaceEqualDeep, 3345 skipToken, 3346 useInfiniteQuery, 3347 useIsFetching, 3348 useIsMutating, 3349 useIsRestoring, 3350 useMutation, 3351 useMutationState, 3352 usePrefetchInfiniteQuery, 3353 usePrefetchQuery, 3354 useQueries, 3355 useQuery, 3356 useQueryClient, 3357 useQueryErrorResetBoundary, 3358 useSuspenseInfiniteQuery, 3359 useSuspenseQueries, 3360 useSuspenseQuery 3361}; 3362//# sourceMappingURL=@tanstack_react-query.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.